diff --git a/ApplicationCode/Application/RiaApplication.cpp b/ApplicationCode/Application/RiaApplication.cpp index 4128c52d20..58fd7ede6c 100644 --- a/ApplicationCode/Application/RiaApplication.cpp +++ b/ApplicationCode/Application/RiaApplication.cpp @@ -145,7 +145,7 @@ namespace RegTestNames const QString generatedFolderName = "RegTestGeneratedImages"; const QString diffFolderName = "RegTestDiffImages"; const QString baseFolderName = "RegTestBaseImages"; - const QString testProjectName = "RegressionTest.rip"; + const QString testProjectName = "RegressionTest"; const QString testFolderFilter = "TestCase*"; const QString imageCompareExeName = "compare"; const QString reportFileName = "ResInsightRegressionTestReport.html"; @@ -350,7 +350,7 @@ bool RiaApplication::loadProject(const QString& projectFileName, ProjectLoadActi // Open the project file and read the serialized data. // Will initialize itself. - if (!QFile::exists(projectFileName)) + if (!caf::Utils::fileExists(projectFileName)) { RiaLogging::info(QString("File does not exist : '%1'").arg(projectFileName)); return false; @@ -718,7 +718,7 @@ bool RiaApplication::saveProject() { CVF_ASSERT(m_project.notNull()); - if (!QFile::exists(m_project->fileName())) + if (!caf::Utils::fileExists(m_project->fileName())) { return saveProjectPromptForFileName(); } @@ -944,7 +944,7 @@ QString RiaApplication::createAbsolutePathFromProjectRelativePath(QString projec //-------------------------------------------------------------------------------------------------- bool RiaApplication::openEclipseCaseFromFile(const QString& fileName) { - if (!QFile::exists(fileName)) return false; + if (!caf::Utils::fileExists(fileName)) return false; QFileInfo gridFileName(fileName); QString caseName = gridFileName.completeBaseName(); @@ -1138,7 +1138,7 @@ bool RiaApplication::openInputEclipseCaseFromFileNames(const QStringList& fileNa //-------------------------------------------------------------------------------------------------- bool RiaApplication::openOdbCaseFromFile(const QString& fileName) { - if (!QFile::exists(fileName)) return false; + if (!caf::Utils::fileExists(fileName)) return false; QFileInfo gridFileName(fileName); QString caseName = gridFileName.completeBaseName(); @@ -1424,7 +1424,8 @@ bool RiaApplication::parseArguments() std::vector gridFiles = readFileListFromTextFile(gridListFile); runMultiCaseSnapshots(projectFileName, gridFiles, "multiCaseSnapshots"); - closeProject(); + closeAllWindows(); + processEvents(); return false; } @@ -1503,14 +1504,14 @@ bool RiaApplication::parseArguments() foreach (QString caseName, caseNames) { QString caseFileNameWithExt = caseName + ".EGRID"; - if (QFile::exists(caseFileNameWithExt)) + if (!caf::Utils::fileExists(caseFileNameWithExt)) { openEclipseCaseFromFile(caseFileNameWithExt); } else { caseFileNameWithExt = caseName + ".GRID"; - if (QFile::exists(caseFileNameWithExt)) + if (!caf::Utils::fileExists(caseFileNameWithExt)) { openEclipseCaseFromFile(caseFileNameWithExt); } @@ -1577,7 +1578,8 @@ bool RiaApplication::parseArguments() } } - closeProject(); + closeAllWindows(); + processEvents(); } // Returning false will exit the application @@ -1733,6 +1735,24 @@ RimViewWindow* RiaApplication::activeViewWindow() return viewWindow; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RiaApplication::isMain3dWindowVisible() const +{ + return RiuMainWindow::instance()->isVisible(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RiaApplication::isMainPlotWindowVisible() const +{ + if (!m_mainPlotWindow) return false; + + return m_mainPlotWindow->isVisible(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -2140,7 +2160,7 @@ void RiaApplication::setLastUsedDialogDirectory(const QString& dialogName, const //-------------------------------------------------------------------------------------------------- bool RiaApplication::openFile(const QString& fileName) { - if (!QFile::exists(fileName)) return false; + if (!caf::Utils::fileExists(fileName)) return false; bool loadingSucceded = false; @@ -2284,6 +2304,18 @@ void removeDirectoryWithContent(QDir dirToDelete ) dirToDelete.rmdir("."); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void logInfoTextWithTimeInSeconds(const QTime& time, const QString& msg) +{ + double timeRunning = time.elapsed() / 1000.0; + + QString timeText = QString("(%1 s) ").arg(timeRunning, 0, 'f', 1); + + RiaLogging::info(timeText + msg); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -2340,6 +2372,11 @@ void RiaApplication::runRegressionTest(const QString& testRootPath) } } + QTime timeStamp; + timeStamp.start(); + + logInfoTextWithTimeInSeconds(timeStamp, "Starting regression tests\n"); + for (int dirIdx = 0; dirIdx < folderList.size(); ++dirIdx) { QDir testCaseFolder(folderList[dirIdx].filePath()); @@ -2361,49 +2398,103 @@ void RiaApplication::runRegressionTest(const QString& testRootPath) for (int dirIdx = 0; dirIdx < folderList.size(); ++dirIdx) { QDir testCaseFolder(folderList[dirIdx].filePath()); - if (testCaseFolder.exists(regTestProjectName)) + + QString projectFileName; + + if (testCaseFolder.exists(regTestProjectName + ".rip")) { - loadProject(testCaseFolder.filePath(regTestProjectName)); + projectFileName = regTestProjectName + ".rip"; + } - // Wait until all command objects have completed - while (!m_commandQueueLock.tryLock()) - { - processEvents(); - } - m_commandQueueLock.unlock(); + if (testCaseFolder.exists(regTestProjectName + ".rsp")) + { + projectFileName = regTestProjectName + ".rsp"; + } - regressionTestConfigureProject(); + if (!projectFileName.isEmpty()) + { + logInfoTextWithTimeInSeconds(timeStamp, "Initializing test :" + testCaseFolder.absolutePath()); - QString fullPathGeneratedFolder = testCaseFolder.absoluteFilePath(generatedFolderName); - saveSnapshotForAllViews(fullPathGeneratedFolder); + loadProject(testCaseFolder.filePath(projectFileName)); - RicSnapshotAllPlotsToFileFeature::exportSnapshotOfAllPlotsIntoFolder(fullPathGeneratedFolder); + // Wait until all command objects have completed + while (!m_commandQueueLock.tryLock()) + { + processEvents(); + } + m_commandQueueLock.unlock(); - QDir baseDir(testCaseFolder.filePath(baseFolderName)); - QDir genDir(testCaseFolder.filePath(generatedFolderName)); - QDir diffDir(testCaseFolder.filePath(diffFolderName)); - if (!diffDir.exists()) testCaseFolder.mkdir(diffFolderName); - baseDir.setFilter(QDir::Files); - QStringList baseImageFileNames = baseDir.entryList(); + regressionTestConfigureProject(); - for (int fIdx = 0; fIdx < baseImageFileNames.size(); ++fIdx) - { - QString fileName = baseImageFileNames[fIdx]; - RiaImageFileCompare imgComparator(RegTestNames::imageCompareExeName); - bool ok = imgComparator.runComparison(genDir.filePath(fileName), baseDir.filePath(fileName), diffDir.filePath(fileName)); - if (!ok) - { + resizeMaximizedPlotWindows(); + + QString fullPathGeneratedFolder = testCaseFolder.absoluteFilePath(generatedFolderName); + saveSnapshotForAllViews(fullPathGeneratedFolder); + + RicSnapshotAllPlotsToFileFeature::exportSnapshotOfAllPlotsIntoFolder(fullPathGeneratedFolder); + + QDir baseDir(testCaseFolder.filePath(baseFolderName)); + QDir genDir(testCaseFolder.filePath(generatedFolderName)); + QDir diffDir(testCaseFolder.filePath(diffFolderName)); + if (!diffDir.exists()) testCaseFolder.mkdir(diffFolderName); + baseDir.setFilter(QDir::Files); + QStringList baseImageFileNames = baseDir.entryList(); + + for (int fIdx = 0; fIdx < baseImageFileNames.size(); ++fIdx) + { + QString fileName = baseImageFileNames[fIdx]; + RiaImageFileCompare imgComparator(RegTestNames::imageCompareExeName); + bool ok = imgComparator.runComparison(genDir.filePath(fileName), baseDir.filePath(fileName), diffDir.filePath(fileName)); + if (!ok) + { qDebug() << "Error comparing :" << imgComparator.errorMessage() << "\n" << imgComparator.errorDetails(); - } - } + } + } - closeProject(); + closeProject(); + + logInfoTextWithTimeInSeconds(timeStamp, "Completed test :" + testCaseFolder.absolutePath()); } } + RiaLogging::info("\n"); + logInfoTextWithTimeInSeconds(timeStamp, "Completed regression tests"); + m_runningRegressionTests = false; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaApplication::resizeMaximizedPlotWindows() +{ + std::vector viewWindows; + m_project->mainPlotCollection()->descendantsIncludingThisOfType(viewWindows); + + for (auto viewWindow : viewWindows) + { + if (viewWindow->isMdiWindow()) + { + RimMdiWindowGeometry wndGeo = viewWindow->mdiWindowGeometry(); + if (wndGeo.isMaximized) + { + QWidget* viewWidget = viewWindow->viewWidget(); + + if (viewWidget) + { + QMdiSubWindow* mdiWindow = m_mainPlotWindow->findMdiSubWindow(viewWidget); + if (mdiWindow) + { + mdiWindow->showNormal(); + + viewWidget->resize(RiaApplication::regressionDefaultImageSize()); + } + } + } + } + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -2798,7 +2889,6 @@ void RiaApplication::executeRegressionTests(const QString& regressionTestPath) } } - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -2833,8 +2923,16 @@ void RiaApplication::regressionTestConfigureProject() } // This size is set to match the regression test reference images - riv->viewer()->setFixedSize(1000, 745); + riv->viewer()->setFixedSize(RiaApplication::regressionDefaultImageSize()); } } } } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QSize RiaApplication::regressionDefaultImageSize() +{ + return QSize(1000, 745); +} diff --git a/ApplicationCode/Application/RiaApplication.h b/ApplicationCode/Application/RiaApplication.h index 229883247c..8e158e3ebc 100644 --- a/ApplicationCode/Application/RiaApplication.h +++ b/ApplicationCode/Application/RiaApplication.h @@ -137,8 +137,6 @@ public: void saveSnapshotForAllViews(const QString& snapshotFolderName); void runMultiCaseSnapshots(const QString& templateProjectFileName, std::vector gridFileNames, const QString& snapshotFolderName); void runRegressionTest(const QString& testRootPath); - void updateRegressionTest(const QString& testRootPath ); - void regressionTestConfigureProject(); void processNonGuiEvents(); @@ -187,6 +185,9 @@ public: static RimViewWindow* activeViewWindow(); + bool isMain3dWindowVisible() const; + bool isMainPlotWindowVisible() const; + bool tryCloseMainWindow(); bool tryClosePlotWindow(); @@ -215,6 +216,11 @@ private: void storeTreeViewState(); + void resizeMaximizedPlotWindows(); + void updateRegressionTest(const QString& testRootPath); + void regressionTestConfigureProject(); + static QSize regressionDefaultImageSize(); + private slots: void slotWorkerProcessFinished(int exitCode, QProcess::ExitStatus exitStatus); void slotUpdateScheduledDisplayModels(); diff --git a/ApplicationCode/Application/RiaPreferences.cpp b/ApplicationCode/Application/RiaPreferences.cpp index a8307d799f..6816ab4cae 100644 --- a/ApplicationCode/Application/RiaPreferences.cpp +++ b/ApplicationCode/Application/RiaPreferences.cpp @@ -33,7 +33,7 @@ CAF_PDM_SOURCE_INIT(RiaPreferences, "RiaPreferences"); //-------------------------------------------------------------------------------------------------- RiaPreferences::RiaPreferences(void) { - CAF_PDM_InitField(&navigationPolicy, "navigationPolicy", caf::AppEnum(RiaApplication::NAVIGATION_POLICY_CEETRON), "Navigation mode", "", "", ""); + CAF_PDM_InitField(&navigationPolicy, "navigationPolicy", caf::AppEnum(RiaApplication::NAVIGATION_POLICY_CEETRON), "Navigation Mode", "", "", ""); CAF_PDM_InitFieldNoDefault(&scriptDirectories, "scriptDirectory", "Shared Script Folder(s)", "", "", ""); scriptDirectories.uiCapability()->setUiEditorTypeName(caf::PdmUiFilePathEditor::uiEditorTypeName()); @@ -41,27 +41,27 @@ RiaPreferences::RiaPreferences(void) CAF_PDM_InitField(&scriptEditorExecutable, "scriptEditorExecutable", QString("kate"), "Script Editor", "", "", ""); scriptEditorExecutable.uiCapability()->setUiEditorTypeName(caf::PdmUiFilePathEditor::uiEditorTypeName()); - CAF_PDM_InitField(&octaveExecutable, "octaveExecutable", QString("octave"), "Octave executable location", "", "", ""); + CAF_PDM_InitField(&octaveExecutable, "octaveExecutable", QString("octave"), "Octave Executable Location", "", "", ""); octaveExecutable.uiCapability()->setUiEditorTypeName(caf::PdmUiFilePathEditor::uiEditorTypeName()); octaveExecutable.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::TOP); - CAF_PDM_InitField(&octaveShowHeaderInfoWhenExecutingScripts, "octaveShowHeaderInfoWhenExecutingScripts", false, "Show text header when executing scripts", "", "", ""); + CAF_PDM_InitField(&octaveShowHeaderInfoWhenExecutingScripts, "octaveShowHeaderInfoWhenExecutingScripts", false, "Show Text Header When Executing Scripts", "", "", ""); octaveShowHeaderInfoWhenExecutingScripts.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN); - CAF_PDM_InitField(&ssihubAddress, "ssihubAddress", QString("http://"), "ssihub Address", "", "", ""); + CAF_PDM_InitField(&ssihubAddress, "ssihubAddress", QString("http://"), "SSIHUB Address", "", "", ""); ssihubAddress.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::TOP); CAF_PDM_InitField(&defaultGridLines, "defaultGridLines", true, "Gridlines", "", "", ""); - CAF_PDM_InitField(&defaultGridLineColors, "defaultGridLineColors", cvf::Color3f(0.92f, 0.92f, 0.92f), "Mesh color", "", "", ""); - CAF_PDM_InitField(&defaultFaultGridLineColors, "defaultFaultGridLineColors", cvf::Color3f(0.08f, 0.08f, 0.08f), "Mesh color along faults", "", "", ""); - CAF_PDM_InitField(&defaultWellLabelColor, "defaultWellLableColor", cvf::Color3f(0.92f, 0.92f, 0.92f), "Well label color", "", "The default well label color in new views", ""); + CAF_PDM_InitField(&defaultGridLineColors, "defaultGridLineColors", cvf::Color3f(0.92f, 0.92f, 0.92f), "Mesh Color", "", "", ""); + CAF_PDM_InitField(&defaultFaultGridLineColors, "defaultFaultGridLineColors", cvf::Color3f(0.08f, 0.08f, 0.08f), "Mesh Color Along Faults", "", "", ""); + CAF_PDM_InitField(&defaultWellLabelColor, "defaultWellLableColor", cvf::Color3f(0.92f, 0.92f, 0.92f), "Well Label Color", "", "The default well label color in new views", ""); - CAF_PDM_InitField(&defaultViewerBackgroundColor, "defaultViewerBackgroundColor", cvf::Color3f(0.69f, 0.77f, 0.87f), "Viewer background", "", "The viewer background color for new views", ""); + CAF_PDM_InitField(&defaultViewerBackgroundColor, "defaultViewerBackgroundColor", cvf::Color3f(0.69f, 0.77f, 0.87f), "Viewer Background", "", "The viewer background color for new views", ""); - CAF_PDM_InitField(&defaultScaleFactorZ, "defaultScaleFactorZ", 5, "Default Z scale factor", "", "", ""); - CAF_PDM_InitField(&fontSizeInScene, "fontSizeInScene", QString("8"), "Font size", "", "", ""); + CAF_PDM_InitField(&defaultScaleFactorZ, "defaultScaleFactorZ", 5, "Default Z Scale Factor", "", "", ""); + CAF_PDM_InitField(&fontSizeInScene, "fontSizeInScene", QString("8"), "Font Size", "", "", ""); - CAF_PDM_InitField(&showLasCurveWithoutTvdWarning, "showLasCurveWithoutTvdWarning", true, "Show LAS curve without TVD warning", "", "", ""); + CAF_PDM_InitField(&showLasCurveWithoutTvdWarning, "showLasCurveWithoutTvdWarning", true, "Show LAS Curve Without TVD Warning", "", "", ""); showLasCurveWithoutTvdWarning.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN); CAF_PDM_InitField(&useShaders, "useShaders", true, "Use Shaders", "", "", ""); @@ -77,21 +77,22 @@ RiaPreferences::RiaPreferences(void) CAF_PDM_InitFieldNoDefault(&lastUsedProjectFileName,"lastUsedProjectFileName", "Last Used Project File", "", "", ""); lastUsedProjectFileName.uiCapability()->setUiHidden(true); - CAF_PDM_InitField(&autocomputeDepthRelatedProperties, "autocomputeDepth", true, "Compute DEPTH related properties", "", "DEPTH, DX, DY, DZ, TOP, BOTTOM", ""); + CAF_PDM_InitField(&autocomputeDepthRelatedProperties, "autocomputeDepth", true, "Compute DEPTH Related Properties", "", "DEPTH, DX, DY, DZ, TOP, BOTTOM", ""); autocomputeDepthRelatedProperties.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN); - CAF_PDM_InitField(&loadAndShowSoil, "loadAndShowSoil", true, "Load and show SOIL", "", "", ""); + CAF_PDM_InitField(&loadAndShowSoil, "loadAndShowSoil", true, "Load and Show SOIL", "", "", ""); loadAndShowSoil.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN); - CAF_PDM_InitFieldNoDefault(&readerSettings, "readerSettings", "Reader settings", "", "", ""); + CAF_PDM_InitFieldNoDefault(&readerSettings, "readerSettings", "Reader Settings", "", "", ""); readerSettings = new RifReaderSettings; - CAF_PDM_InitField(&autoCreatePlotsOnImport, "AutoCreatePlotsOnImport", true, "Create Summary Plots When Importing Eclipse Case", "", "", ""); + CAF_PDM_InitField(&autoCreatePlotsOnImport, "AutoCreatePlotsOnImport", true, "Automatically Create Summary Plots On Import", "", "", ""); autoCreatePlotsOnImport.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN); CAF_PDM_InitField(&defaultCurveFilter, "DefaultCurveFilter", QString("F*PT"), "Default Vector Selection Filter", "", "", ""); m_tabNames << "General"; + m_tabNames << "Eclipse"; m_tabNames << "Octave"; m_tabNames << "Summary"; } @@ -113,7 +114,7 @@ void RiaPreferences::defineEditorAttribute(const caf::PdmFieldHandle* field, QSt if (field == &scriptDirectories) { - caf::PdmUiFilePathEditorAttribute* myAttr = static_cast(attribute); + caf::PdmUiFilePathEditorAttribute* myAttr = dynamic_cast(attribute); if (myAttr) { myAttr->m_selectDirectory = true; @@ -129,7 +130,7 @@ void RiaPreferences::defineEditorAttribute(const caf::PdmFieldHandle* field, QSt field == &showLasCurveWithoutTvdWarning || field == &autoCreatePlotsOnImport) { - caf::PdmUiCheckBoxEditorAttribute* myAttr = static_cast(attribute); + caf::PdmUiCheckBoxEditorAttribute* myAttr = dynamic_cast(attribute); if (myAttr) { myAttr->m_useNativeCheckBoxLabel = true; @@ -144,33 +145,36 @@ void RiaPreferences::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& { if (uiConfigName == m_tabNames[0]) { - caf::PdmUiGroup* defaultSettingsGroup = uiOrdering.addNewGroup("Default settings"); + caf::PdmUiGroup* defaultSettingsGroup = uiOrdering.addNewGroup("Default Settings"); defaultSettingsGroup->add(&defaultViewerBackgroundColor); defaultSettingsGroup->add(&defaultGridLines); defaultSettingsGroup->add(&defaultGridLineColors); defaultSettingsGroup->add(&defaultFaultGridLineColors); defaultSettingsGroup->add(&defaultWellLabelColor); defaultSettingsGroup->add(&fontSizeInScene); + defaultSettingsGroup->add(&defaultScaleFactorZ); - caf::PdmUiGroup* viewsGroup = uiOrdering.addNewGroup("3D views"); + caf::PdmUiGroup* viewsGroup = uiOrdering.addNewGroup("3D Views"); viewsGroup->add(&navigationPolicy); viewsGroup->add(&useShaders); viewsGroup->add(&showHud); - caf::PdmUiGroup* newCaseBehaviourGroup = uiOrdering.addNewGroup("Behavior when loading new case"); - newCaseBehaviourGroup->add(&defaultScaleFactorZ); - newCaseBehaviourGroup->add(&autocomputeDepthRelatedProperties); - newCaseBehaviourGroup->add(&loadAndShowSoil); - newCaseBehaviourGroup->add(&showLasCurveWithoutTvdWarning); - - readerSettings->defineUiOrdering(uiConfigName, *newCaseBehaviourGroup); - caf::PdmUiGroup* ssihubGroup = uiOrdering.addNewGroup("SSIHUB"); - ssihubGroup->add(&ssihubAddress); + caf::PdmUiGroup* otherGroup = uiOrdering.addNewGroup("Other"); + otherGroup->add(&ssihubAddress); + otherGroup->add(&showLasCurveWithoutTvdWarning); uiOrdering.add(&appendClassNameToUiText); } else if (uiConfigName == m_tabNames[1]) + { + caf::PdmUiGroup* newCaseBehaviourGroup = uiOrdering.addNewGroup("Behavior When Loading Data"); + newCaseBehaviourGroup->add(&autocomputeDepthRelatedProperties); + newCaseBehaviourGroup->add(&loadAndShowSoil); + + readerSettings->defineUiOrdering(uiConfigName, *newCaseBehaviourGroup); + } + else if (uiConfigName == m_tabNames[2]) { caf::PdmUiGroup* octaveGroup = uiOrdering.addNewGroup("Octave"); octaveGroup->add(&octaveExecutable); @@ -180,7 +184,7 @@ void RiaPreferences::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& scriptGroup->add(&scriptDirectories); scriptGroup->add(&scriptEditorExecutable); } - else if (uiConfigName == m_tabNames[2]) + else if (uiConfigName == m_tabNames[3]) { uiOrdering.add(&autoCreatePlotsOnImport); uiOrdering.add(&defaultCurveFilter); diff --git a/ApplicationCode/Application/RiaRegressionTest.cpp b/ApplicationCode/Application/RiaRegressionTest.cpp index f05e1f28e6..ce54c33d17 100644 --- a/ApplicationCode/Application/RiaRegressionTest.cpp +++ b/ApplicationCode/Application/RiaRegressionTest.cpp @@ -51,7 +51,7 @@ void RiaRegressionTest::defineEditorAttribute(const caf::PdmFieldHandle* field, { if (field == &applicationWorkingFolder || field == ®ressionTestFolder) { - caf::PdmUiFilePathEditorAttribute* myAttr = static_cast(attribute); + caf::PdmUiFilePathEditorAttribute* myAttr = dynamic_cast(attribute); if (myAttr) { myAttr->m_selectDirectory = true; diff --git a/ApplicationCode/CMakeLists.txt b/ApplicationCode/CMakeLists.txt index c1ec89d9a5..c9cf21a3b8 100644 --- a/ApplicationCode/CMakeLists.txt +++ b/ApplicationCode/CMakeLists.txt @@ -49,6 +49,7 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel ${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/Summary ${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/Flow + ${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/Fishbones ${CMAKE_CURRENT_SOURCE_DIR}/ResultStatisticsCache ${CMAKE_CURRENT_SOURCE_DIR}/ReservoirDataModel @@ -107,6 +108,7 @@ list( APPEND REFERENCED_CMAKE_FILES ProjectDataModel/CMakeLists_files.cmake ProjectDataModel/Summary/CMakeLists_files.cmake ProjectDataModel/Flow/CMakeLists_files.cmake + ProjectDataModel/Fishbones/CMakeLists_files.cmake GeoMech/GeoMechVisualization/CMakeLists_files.cmake @@ -121,6 +123,8 @@ list( APPEND REFERENCED_CMAKE_FILES Commands/CrossSectionCommands/CMakeLists_files.cmake Commands/EclipseCommands/CMakeLists_files.cmake Commands/EclipseCommands/EclipseWell/CMakeLists_files.cmake + Commands/FishbonesCommands/CMakeLists_files.cmake + Commands/PerforationCommands/CMakeLists_files.cmake Commands/FlowCommands/CMakeLists_files.cmake Commands/IntersectionBoxCommands/CMakeLists_files.cmake Commands/OctaveScriptCommands/CMakeLists_files.cmake diff --git a/ApplicationCode/Commands/ApplicationCommands/RicExitApplicationFeature.cpp b/ApplicationCode/Commands/ApplicationCommands/RicExitApplicationFeature.cpp index 92feded515..24aaa0dd11 100644 --- a/ApplicationCode/Commands/ApplicationCommands/RicExitApplicationFeature.cpp +++ b/ApplicationCode/Commands/ApplicationCommands/RicExitApplicationFeature.cpp @@ -51,4 +51,5 @@ void RicExitApplicationFeature::onActionTriggered(bool isChecked) void RicExitApplicationFeature::setupActionLook(QAction* actionToSetup) { actionToSetup->setText("E&xit"); + actionToSetup->setShortcuts(QKeySequence::Quit); } diff --git a/ApplicationCode/Commands/ApplicationCommands/RicOpenProjectFeature.cpp b/ApplicationCode/Commands/ApplicationCommands/RicOpenProjectFeature.cpp index 857c4579f8..64f5da34df 100644 --- a/ApplicationCode/Commands/ApplicationCommands/RicOpenProjectFeature.cpp +++ b/ApplicationCode/Commands/ApplicationCommands/RicOpenProjectFeature.cpp @@ -66,4 +66,5 @@ void RicOpenProjectFeature::setupActionLook(QAction* actionToSetup) { actionToSetup->setText("Open Project"); actionToSetup->setIcon(QIcon(":/openFolder24x24.png")); + actionToSetup->setShortcuts(QKeySequence::Open); } diff --git a/ApplicationCode/Commands/ApplicationCommands/RicSaveProjectAsFeature.cpp b/ApplicationCode/Commands/ApplicationCommands/RicSaveProjectAsFeature.cpp index f119d5ea2e..a8616fb13e 100644 --- a/ApplicationCode/Commands/ApplicationCommands/RicSaveProjectAsFeature.cpp +++ b/ApplicationCode/Commands/ApplicationCommands/RicSaveProjectAsFeature.cpp @@ -54,4 +54,5 @@ void RicSaveProjectAsFeature::setupActionLook(QAction* actionToSetup) { actionToSetup->setText("Save Project &As"); actionToSetup->setIcon(QIcon(":/Save.png")); + actionToSetup->setShortcuts(QKeySequence::SaveAs); } diff --git a/ApplicationCode/Commands/ApplicationCommands/RicSaveProjectFeature.cpp b/ApplicationCode/Commands/ApplicationCommands/RicSaveProjectFeature.cpp index 5bfcadd436..8a5c33c660 100644 --- a/ApplicationCode/Commands/ApplicationCommands/RicSaveProjectFeature.cpp +++ b/ApplicationCode/Commands/ApplicationCommands/RicSaveProjectFeature.cpp @@ -51,6 +51,7 @@ void RicSaveProjectFeature::setupActionLook(QAction* actionToSetup) { actionToSetup->setText("&Save Project"); actionToSetup->setIcon(QIcon(":/Save.png")); + actionToSetup->setShortcuts(QKeySequence::Save); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Commands/ApplicationCommands/RicShowPlotDataFeature.cpp b/ApplicationCode/Commands/ApplicationCommands/RicShowPlotDataFeature.cpp index d01b0c2226..da5bffebb5 100644 --- a/ApplicationCode/Commands/ApplicationCommands/RicShowPlotDataFeature.cpp +++ b/ApplicationCode/Commands/ApplicationCommands/RicShowPlotDataFeature.cpp @@ -103,7 +103,8 @@ void RiuQPlainTextEdit::slotSelectAll() /// /// //-------------------------------------------------------------------------------------------------- -RicTextWidget::RicTextWidget(QWidget* parent) : QDialog(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint) +RicTextWidget::RicTextWidget(QWidget* parent) + : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint) { m_textEdit = new RiuQPlainTextEdit(this); m_textEdit->setReadOnly(true); diff --git a/ApplicationCode/Commands/CMakeLists_files.cmake b/ApplicationCode/Commands/CMakeLists_files.cmake index bcbcf6481b..ac39783f01 100644 --- a/ApplicationCode/Commands/CMakeLists_files.cmake +++ b/ApplicationCode/Commands/CMakeLists_files.cmake @@ -66,6 +66,9 @@ ${CEE_CURRENT_LIST_DIR}RicDeleteItemFeature.h ${CEE_CURRENT_LIST_DIR}RicDeleteSubItemsFeature.h ${CEE_CURRENT_LIST_DIR}RicCommandFeature.h + +${CEE_CURRENT_LIST_DIR}RicReloadCaseFeature.h +${CEE_CURRENT_LIST_DIR}RicFlyToObjectFeature.h ) set (SOURCE_GROUP_SOURCE_FILES @@ -127,6 +130,9 @@ ${CEE_CURRENT_LIST_DIR}RicDeleteItemExecData.cpp ${CEE_CURRENT_LIST_DIR}RicDeleteItemFeature.cpp ${CEE_CURRENT_LIST_DIR}RicDeleteSubItemsFeature.cpp + +${CEE_CURRENT_LIST_DIR}RicReloadCaseFeature.cpp +${CEE_CURRENT_LIST_DIR}RicFlyToObjectFeature.cpp ) list(APPEND CODE_HEADER_FILES diff --git a/ApplicationCode/Commands/EclipseCommands/RicSaveEclipseResultAsInputPropertyExec.cpp b/ApplicationCode/Commands/EclipseCommands/RicSaveEclipseResultAsInputPropertyExec.cpp index e8cb054c3f..b28c89474f 100644 --- a/ApplicationCode/Commands/EclipseCommands/RicSaveEclipseResultAsInputPropertyExec.cpp +++ b/ApplicationCode/Commands/EclipseCommands/RicSaveEclipseResultAsInputPropertyExec.cpp @@ -94,9 +94,8 @@ void RicSaveEclipseResultAsInputPropertyExec::redo() if (propertyDialog.exec() == QDialog::Accepted) { size_t timeStep = m_cellColors->reservoirView()->currentTimeStep(); - RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(m_cellColors->porosityModel()); - bool isOk = RifEclipseInputFileTools::writeBinaryResultToTextFile(exportSettings.fileName, m_cellColors->reservoirView()->eclipseCase()->eclipseCaseData(), porosityModel, timeStep, m_cellColors->resultVariable(), exportSettings.eclipseKeyword, exportSettings.undefinedValue); + bool isOk = RifEclipseInputFileTools::writeBinaryResultToTextFile(exportSettings.fileName, m_cellColors->reservoirView()->eclipseCase()->eclipseCaseData(), timeStep, m_cellColors, exportSettings.eclipseKeyword, exportSettings.undefinedValue); if (!isOk) { QMessageBox::critical(NULL, "File export", "Failed to exported current result to " + exportSettings.fileName); diff --git a/ApplicationCode/Commands/FishbonesCommands/CMakeLists_files.cmake b/ApplicationCode/Commands/FishbonesCommands/CMakeLists_files.cmake new file mode 100644 index 0000000000..5e0d83996b --- /dev/null +++ b/ApplicationCode/Commands/FishbonesCommands/CMakeLists_files.cmake @@ -0,0 +1,27 @@ + +# Use this workaround until we're on 2.8.3 on all platforms and can use CMAKE_CURRENT_LIST_DIR directly +if (${CMAKE_VERSION} VERSION_GREATER "2.8.2") + set(CEE_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_DIR}/) +endif() + +set (SOURCE_GROUP_HEADER_FILES +${CEE_CURRENT_LIST_DIR}RicNewFishbonesSubsFeature.h +${CEE_CURRENT_LIST_DIR}RicExportFishbonesLateralsFeature.h +${CEE_CURRENT_LIST_DIR}RicNewFishbonesSubsAtMeasuredDepthFeature.h +) + +set (SOURCE_GROUP_SOURCE_FILES +${CEE_CURRENT_LIST_DIR}RicNewFishbonesSubsFeature.cpp +${CEE_CURRENT_LIST_DIR}RicExportFishbonesLateralsFeature.cpp +${CEE_CURRENT_LIST_DIR}RicNewFishbonesSubsAtMeasuredDepthFeature.cpp +) + +list(APPEND CODE_HEADER_FILES +${SOURCE_GROUP_HEADER_FILES} +) + +list(APPEND CODE_SOURCE_FILES +${SOURCE_GROUP_SOURCE_FILES} +) + +source_group( "CommandFeature\\Fishbones" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CEE_CURRENT_LIST_DIR}CMakeLists_files.cmake ) diff --git a/ApplicationCode/Commands/FishbonesCommands/RicExportFishbonesLateralsFeature.cpp b/ApplicationCode/Commands/FishbonesCommands/RicExportFishbonesLateralsFeature.cpp new file mode 100644 index 0000000000..7fd77802ce --- /dev/null +++ b/ApplicationCode/Commands/FishbonesCommands/RicExportFishbonesLateralsFeature.cpp @@ -0,0 +1,168 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicExportFishbonesLateralsFeature.h" + +#include "RiaApplication.h" +#include "RiaLogging.h" + +#include "RimFishbonesCollection.h" +#include "RimFishbonesMultipleSubs.h" +#include "RimWellPath.h" + +#include "cafSelectionManager.h" +#include "cafUtils.h" + +#include "cvfAssert.h" + +#include +#include +#include + +CAF_CMD_SOURCE_INIT(RicExportFishbonesLateralsFeature, "RicExportFishbonesLateralsFeature"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicExportFishbonesLateralsFeature::onActionTriggered(bool isChecked) +{ + RimFishbonesCollection* fishbonesCollection = selectedFishbonesCollection(); + CVF_ASSERT(fishbonesCollection); + + RimWellPath* wellPath = nullptr; + fishbonesCollection->firstAncestorOrThisOfType(wellPath); + CVF_ASSERT(wellPath); + + RiaApplication* app = RiaApplication::instance(); + QString projectFolder = app->currentProjectPath(); + + QString defaultDir = app->lastUsedDialogDirectoryWithFallback("WELL_PATH_EXPORT_DIR", projectFolder); + + QString defaultFileName = defaultDir + "/" + caf::Utils::makeValidFileBasename((wellPath->name())) + ".dev"; + QString completeFilename = QFileDialog::getSaveFileName(nullptr, "Select File for Well Path Data Export", defaultFileName, "Well Path Text File(*.dev);;All files(*.*)"); + if (completeFilename.isEmpty()) return; + + QFile exportFile(completeFilename); + + RiaLogging::info("Starting export of Fishbones well path laterals to : " + completeFilename); + + if (!exportFile.open(QIODevice::WriteOnly)) + { + RiaLogging::error("Could not open the file :\n" + completeFilename); + return; + } + + + // See RifWellPathAsciiFileReader::readAllWellData for reading of dev files + // + // http://resinsight.org/docs/wellpaths/ + // Export format + // + // wellname : ____ + // + // for each coordinate along lateral, export + // x y TVD MD + // separate laterals using -999 on a single line + + size_t fishboneSubIndex = 0; + + QTextStream stream(&exportFile); + for (RimFishbonesMultipleSubs* fishbone : fishbonesCollection->fishbonesSubs()) + { + if (!fishbone->isChecked()) continue; + + for (size_t subIndex = 0; subIndex < fishbone->locationOfSubs().size(); subIndex++) + { + for (size_t lateralIndex = 0; lateralIndex < fishbone->lateralLengths().size(); lateralIndex++) + { + std::vector> coordsAndMD = fishbone->coordsAndMDForLateral(subIndex, lateralIndex); + + // Pad with "0" to get a total of two characters defining the sub index text + QString subIndexText = QString("%1").arg(fishboneSubIndex++, 2, 10, QChar('0')); + + QString lateralNameCandidate = QString("%1_%2_%3_%4").arg(wellPath->name()).arg("fishbone").arg(subIndexText).arg(lateralIndex); + + QString lateralName = caf::Utils::makeValidFileBasename(lateralNameCandidate); + + stream << "WELLNAME: " << lateralName << endl; + + for (auto coordMD : coordsAndMD) + { + int numberOfDecimals = 2; + + // Export X and Y unchanged, invert sign of Z to get TVD, export MD unchanged + stream << formatNumber( coordMD.first.x(), numberOfDecimals); + stream << " " << formatNumber( coordMD.first.y(), numberOfDecimals); + stream << " " << formatNumber(-coordMD.first.z(), numberOfDecimals); + stream << " " << formatNumber( coordMD.second, numberOfDecimals) << endl; + } + stream << -999 << endl << endl; + } + } + } + + RiaLogging::info("Completed export of Fishbones well path laterals to : " + completeFilename); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RicExportFishbonesLateralsFeature::formatNumber(double val, int numberOfDecimals) +{ + return QString("%1").arg(val, 0, 'f', numberOfDecimals); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimFishbonesCollection* RicExportFishbonesLateralsFeature::selectedFishbonesCollection() +{ + RimFishbonesCollection* objToFind = nullptr; + + caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem(); + + caf::PdmObjectHandle* objHandle = dynamic_cast(pdmUiItem); + if (objHandle) + { + objHandle->firstAncestorOrThisOfType(objToFind); + } + + return objToFind; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicExportFishbonesLateralsFeature::setupActionLook(QAction* actionToSetup) +{ + //actionToSetup->setIcon(QIcon(":/FractureSymbol16x16.png")); + actionToSetup->setText("Export Laterals"); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicExportFishbonesLateralsFeature::isCommandEnabled() +{ + if (selectedFishbonesCollection()) + { + return true; + } + + return false; +} diff --git a/ApplicationCode/Commands/FishbonesCommands/RicExportFishbonesLateralsFeature.h b/ApplicationCode/Commands/FishbonesCommands/RicExportFishbonesLateralsFeature.h new file mode 100644 index 0000000000..8422c11694 --- /dev/null +++ b/ApplicationCode/Commands/FishbonesCommands/RicExportFishbonesLateralsFeature.h @@ -0,0 +1,40 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +class RimFishbonesCollection; + +//================================================================================================== +/// +//================================================================================================== +class RicExportFishbonesLateralsFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; + +protected: + virtual void onActionTriggered(bool isChecked) override; + virtual void setupActionLook(QAction* actionToSetup) override; + virtual bool isCommandEnabled() override; + +private: + static QString formatNumber(double val, int numberOfDecimals); + static RimFishbonesCollection* selectedFishbonesCollection(); +}; diff --git a/ApplicationCode/Commands/FishbonesCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.cpp b/ApplicationCode/Commands/FishbonesCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.cpp new file mode 100644 index 0000000000..f5813e7377 --- /dev/null +++ b/ApplicationCode/Commands/FishbonesCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.cpp @@ -0,0 +1,99 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicNewFishbonesSubsAtMeasuredDepthFeature.h" + +#include "RicNewFishbonesSubsFeature.h" + +#include "RimFishbonesCollection.h" +#include "RimFishbonesMultipleSubs.h" +#include "RimProject.h" +#include "RimWellPath.h" + +#include "RiuMainWindow.h" +#include "RiuSelectionManager.h" + +#include "cafSelectionManager.h" + +#include + + +CAF_CMD_SOURCE_INIT(RicNewFishbonesSubsAtMeasuredDepthFeature, "RicNewFishbonesSubsAtMeasuredDepthFeature"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicNewFishbonesSubsAtMeasuredDepthFeature::onActionTriggered(bool isChecked) +{ + RiuWellPathSelectionItem* wellPathSelItem = wellPathSelectionItem(); + CVF_ASSERT(wellPathSelItem); + + RimWellPath* wellPath = wellPathSelItem->m_wellpath; + CVF_ASSERT(wellPath); + + RimFishbonesMultipleSubs* obj = new RimFishbonesMultipleSubs; + wellPath->fishbonesCollection()->fishbonesSubs.push_back(obj); + + obj->setName(QString("Fishbones Subs (%1)").arg(wellPath->fishbonesCollection()->fishbonesSubs.size())); + int integerValue = wellPathSelItem->m_measuredDepth; + obj->setMeasuredDepthAndCount(integerValue, 24, 1); + + RicNewFishbonesSubsFeature::askUserToSetUsefulScaling(wellPath->fishbonesCollection()); + + wellPath->updateConnectedEditors(); + RiuMainWindow::instance()->selectAsCurrentItem(obj); + + RimProject* proj; + wellPath->firstAncestorOrThisOfTypeAsserted(proj); + proj->createDisplayModelAndRedrawAllViews(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiuWellPathSelectionItem* RicNewFishbonesSubsAtMeasuredDepthFeature::wellPathSelectionItem() +{ + RiuSelectionManager* riuSelManager = RiuSelectionManager::instance(); + RiuSelectionItem* selItem = riuSelManager->selectedItem(RiuSelectionManager::RUI_TEMPORARY); + + RiuWellPathSelectionItem* wellPathItem = dynamic_cast(selItem); + + return wellPathItem; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicNewFishbonesSubsAtMeasuredDepthFeature::setupActionLook(QAction* actionToSetup) +{ + //actionToSetup->setIcon(QIcon(":/FractureSymbol16x16.png")); + actionToSetup->setText("New Fishbones Subs Definition"); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicNewFishbonesSubsAtMeasuredDepthFeature::isCommandEnabled() +{ + if (wellPathSelectionItem()) + { + return true; + } + + return false; +} diff --git a/ApplicationCode/Commands/FishbonesCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.h b/ApplicationCode/Commands/FishbonesCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.h new file mode 100644 index 0000000000..dc58ed094b --- /dev/null +++ b/ApplicationCode/Commands/FishbonesCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.h @@ -0,0 +1,39 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +class RiuWellPathSelectionItem; + +//================================================================================================== +/// +//================================================================================================== +class RicNewFishbonesSubsAtMeasuredDepthFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; +protected: + + virtual void onActionTriggered(bool isChecked) override; + virtual void setupActionLook(QAction* actionToSetup) override; + virtual bool isCommandEnabled() override; + +private: + static RiuWellPathSelectionItem* wellPathSelectionItem(); +}; diff --git a/ApplicationCode/Commands/FishbonesCommands/RicNewFishbonesSubsFeature.cpp b/ApplicationCode/Commands/FishbonesCommands/RicNewFishbonesSubsFeature.cpp new file mode 100644 index 0000000000..2eb4748bec --- /dev/null +++ b/ApplicationCode/Commands/FishbonesCommands/RicNewFishbonesSubsFeature.cpp @@ -0,0 +1,151 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicNewFishbonesSubsFeature.h" + +#include "RiaApplication.h" + +#include "RimFishboneWellPathCollection.h" +#include "RimFishbonesCollection.h" +#include "RimFishbonesMultipleSubs.h" +#include "RimView.h" +#include "RimWellPathCollection.h" + +#include "RiuMainWindow.h" + +#include "cafSelectionManager.h" + +#include +#include + + +CAF_CMD_SOURCE_INIT(RicNewFishbonesSubsFeature, "RicNewFishbonesSubsFeature"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicNewFishbonesSubsFeature::onActionTriggered(bool isChecked) +{ + RimFishbonesCollection* fishbonesCollection = selectedFishbonesCollection(); + CVF_ASSERT(fishbonesCollection); + + RimFishbonesMultipleSubs* obj = new RimFishbonesMultipleSubs; + obj->setName(QString("Fishbones Subs (%1)").arg(fishbonesCollection->fishbonesSubs.size())); + fishbonesCollection->fishbonesSubs.push_back(obj); + + RicNewFishbonesSubsFeature::askUserToSetUsefulScaling(fishbonesCollection); + + fishbonesCollection->updateConnectedEditors(); + RiuMainWindow::instance()->selectAsCurrentItem(obj); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimFishbonesCollection* RicNewFishbonesSubsFeature::selectedFishbonesCollection() +{ + RimFishbonesCollection* objToFind = nullptr; + + caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem(); + + caf::PdmObjectHandle* objHandle = dynamic_cast(pdmUiItem); + if (objHandle) + { + objHandle->firstAncestorOrThisOfType(objToFind); + } + + return objToFind; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicNewFishbonesSubsFeature::setupActionLook(QAction* actionToSetup) +{ + //actionToSetup->setIcon(QIcon(":/FractureSymbol16x16.png")); + actionToSetup->setText("New Fishbones Subs Definition"); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicNewFishbonesSubsFeature::isCommandEnabled() +{ + if (selectedFishbonesCollection()) + { + return true; + } + + return false; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicNewFishbonesSubsFeature::askUserToSetUsefulScaling(RimFishbonesCollection* fishboneCollection) +{ + // Always reset well path collection scale factor + CVF_ASSERT(fishboneCollection); + RimWellPathCollection* wellPathColl = nullptr; + fishboneCollection->firstAncestorOrThisOfTypeAsserted(wellPathColl); + wellPathColl->wellPathRadiusScaleFactor = 0.01; + + RimView* activeView = RiaApplication::instance()->activeReservoirView(); + if (!activeView) return; + + RiaApplication* app = RiaApplication::instance(); + QString sessionKey = "AutoAdjustSettingsForFishbones"; + + bool autoAdjustSettings = false; + QVariant v = app->cacheDataObject(sessionKey); + if (!v.isValid()) + { + double currentScaleFactor = activeView->scaleZ(); + if (fabs(currentScaleFactor - 1.0) < 0.1) return; + + QMessageBox msgBox; + msgBox.setIcon(QMessageBox::Question); + + QString questionText; + questionText = QString("When displaying Fishbones structures, the view scaling should be set to 1.\n\nDo you want ResInsight to automatically set view scaling to 1?"); + + msgBox.setText(questionText); + msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); + + int ret = msgBox.exec(); + if (ret == QMessageBox::Yes) + { + autoAdjustSettings = true; + } + + app->setCacheDataObject(sessionKey, autoAdjustSettings); + } + else + { + autoAdjustSettings = v.toBool(); + } + + if (autoAdjustSettings) + { + activeView->setScaleZAndUpdate(1.0); + + wellPathColl->scheduleGeometryRegenAndRedrawViews(); + + RiuMainWindow::instance()->updateScaleValue(); + } +} diff --git a/ApplicationCode/Commands/FishbonesCommands/RicNewFishbonesSubsFeature.h b/ApplicationCode/Commands/FishbonesCommands/RicNewFishbonesSubsFeature.h new file mode 100644 index 0000000000..a10a71bec2 --- /dev/null +++ b/ApplicationCode/Commands/FishbonesCommands/RicNewFishbonesSubsFeature.h @@ -0,0 +1,42 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +class RimFishbonesCollection; + +//================================================================================================== +/// +//================================================================================================== +class RicNewFishbonesSubsFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; + +public: + static void askUserToSetUsefulScaling(RimFishbonesCollection* fishboneCollection); + +protected: + virtual void onActionTriggered(bool isChecked) override; + virtual void setupActionLook(QAction* actionToSetup) override; + virtual bool isCommandEnabled() override; + +private: + static RimFishbonesCollection* selectedFishbonesCollection(); +}; diff --git a/ApplicationCode/Commands/FlowCommands/RicShowContributingWellsFromPlotFeature.cpp b/ApplicationCode/Commands/FlowCommands/RicShowContributingWellsFromPlotFeature.cpp index e805a344de..40f4e73c58 100644 --- a/ApplicationCode/Commands/FlowCommands/RicShowContributingWellsFromPlotFeature.cpp +++ b/ApplicationCode/Commands/FlowCommands/RicShowContributingWellsFromPlotFeature.cpp @@ -54,8 +54,7 @@ void RicShowContributingWellsFromPlotFeature::onActionTriggered(bool isChecked) int timeStep = wellAllocationPlot->timeStep(); QString wellName = wellAllocationPlot->wellName(); - RimEclipseResultCase* wellAllocationResultCase = nullptr; - wellAllocationPlot->flowDiagSolution()->firstAncestorOrThisOfTypeAsserted(wellAllocationResultCase); + RimEclipseResultCase* wellAllocationResultCase = wellAllocationPlot->rimCase(); RicShowContributingWellsFeatureImpl::maniuplateSelectedView(wellAllocationResultCase, wellName, timeStep); } diff --git a/ApplicationCode/Commands/FlowCommands/RicShowTotalAllocationDataFeature.cpp b/ApplicationCode/Commands/FlowCommands/RicShowTotalAllocationDataFeature.cpp index 3a862f488d..37a77bb1a0 100644 --- a/ApplicationCode/Commands/FlowCommands/RicShowTotalAllocationDataFeature.cpp +++ b/ApplicationCode/Commands/FlowCommands/RicShowTotalAllocationDataFeature.cpp @@ -76,7 +76,7 @@ void RicShowTotalAllocationDataFeature::onActionTriggered(bool isChecked) //-------------------------------------------------------------------------------------------------- void RicShowTotalAllocationDataFeature::setupActionLook(QAction* actionToSetup) { - actionToSetup->setText("Show Total Allocation"); + actionToSetup->setText("Show Total Allocation Data"); //actionToSetup->setIcon(QIcon(":/PlotWindow24x24.png")); } diff --git a/ApplicationCode/Commands/OctaveScriptCommands/RicNewScriptFeature.cpp b/ApplicationCode/Commands/OctaveScriptCommands/RicNewScriptFeature.cpp index dd011f9825..5febff7db3 100644 --- a/ApplicationCode/Commands/OctaveScriptCommands/RicNewScriptFeature.cpp +++ b/ApplicationCode/Commands/OctaveScriptCommands/RicNewScriptFeature.cpp @@ -29,6 +29,8 @@ #include "RiuMainWindow.h" +#include "cafUtils.h" + #include #include #include @@ -76,7 +78,7 @@ void RicNewScriptFeature::onActionTriggered(bool isChecked) fullPathFilenameNewScript = fullPathNewScript + "/untitled.m"; int num= 1; - while (QFileInfo(fullPathFilenameNewScript).exists()) + while (caf::Utils::fileExists(fullPathFilenameNewScript)) { fullPathFilenameNewScript = fullPathNewScript + "/untitled" + QString::number(num) + ".m"; num++; diff --git a/ApplicationCode/Commands/OperationsUsingObjReferences/RicCopyReferencesToClipboardFeature.cpp b/ApplicationCode/Commands/OperationsUsingObjReferences/RicCopyReferencesToClipboardFeature.cpp index ac8ff487fd..150fc76b89 100644 --- a/ApplicationCode/Commands/OperationsUsingObjReferences/RicCopyReferencesToClipboardFeature.cpp +++ b/ApplicationCode/Commands/OperationsUsingObjReferences/RicCopyReferencesToClipboardFeature.cpp @@ -38,8 +38,6 @@ #include -namespace caf -{ CAF_CMD_SOURCE_INIT(RicCopyReferencesToClipboardFeature, "RicCopyReferencesToClipboardFeature"); @@ -63,14 +61,14 @@ void RicCopyReferencesToClipboardFeature::onActionTriggered(bool isChecked) std::vector referenceList; - std::vector selectedFormationNamesCollObjs; + std::vector selectedFormationNamesCollObjs; caf::SelectionManager::instance()->objectsByType(&selectedFormationNamesCollObjs); - for (PdmObject* pdmObject : selectedFormationNamesCollObjs) + for (caf::PdmObject* pdmObject : selectedFormationNamesCollObjs) { if (RicCopyReferencesToClipboardFeature::isCopyOfObjectSupported(pdmObject)) { - QString itemRef = PdmReferenceHelper::referenceFromRootToObject(SelectionManager::instance()->pdmRootObject(), pdmObject); + QString itemRef = caf::PdmReferenceHelper::referenceFromRootToObject(caf::SelectionManager::instance()->pdmRootObject(), pdmObject); referenceList.push_back(itemRef); } @@ -96,16 +94,15 @@ void RicCopyReferencesToClipboardFeature::setupActionLook(QAction* actionToSetup actionToSetup->setShortcuts(QKeySequence::Copy); } - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- bool RicCopyReferencesToClipboardFeature::isAnyCopyableObjectSelected() { - std::vector selectedFormationNamesCollObjs; + std::vector selectedFormationNamesCollObjs; caf::SelectionManager::instance()->objectsByType(&selectedFormationNamesCollObjs); - for (PdmObject* pdmObject : selectedFormationNamesCollObjs) + for (caf::PdmObject* pdmObject : selectedFormationNamesCollObjs) { if (RicCopyReferencesToClipboardFeature::isCopyOfObjectSupported(pdmObject)) { @@ -116,12 +113,10 @@ bool RicCopyReferencesToClipboardFeature::isAnyCopyableObjectSelected() return false; } - - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RicCopyReferencesToClipboardFeature::isCopyOfObjectSupported(PdmObject* pdmObject) +bool RicCopyReferencesToClipboardFeature::isCopyOfObjectSupported(caf::PdmObject* pdmObject) { RimWellAllocationPlot* wellAllocPlot = nullptr; pdmObject->firstAncestorOrThisOfType(wellAllocPlot); @@ -161,5 +156,3 @@ bool RicCopyReferencesToClipboardFeature::isCopyOfObjectSupported(PdmObject* pdm return false; } - -} // end namespace caf diff --git a/ApplicationCode/Commands/OperationsUsingObjReferences/RicCopyReferencesToClipboardFeature.h b/ApplicationCode/Commands/OperationsUsingObjReferences/RicCopyReferencesToClipboardFeature.h index 477eba8a15..ff1b55f966 100644 --- a/ApplicationCode/Commands/OperationsUsingObjReferences/RicCopyReferencesToClipboardFeature.h +++ b/ApplicationCode/Commands/OperationsUsingObjReferences/RicCopyReferencesToClipboardFeature.h @@ -22,29 +22,25 @@ #include "cafCmdFeature.h" -namespace caf +namespace caf { - -class PdmObject; + class PdmObject; +} //================================================================================================== /// //================================================================================================== -class RicCopyReferencesToClipboardFeature : public CmdFeature +class RicCopyReferencesToClipboardFeature : public caf::CmdFeature { CAF_CMD_HEADER_INIT; protected: // Overrides - virtual bool isCommandEnabled(); - virtual void onActionTriggered( bool isChecked ); - virtual void setupActionLook( QAction* actionToSetup ); + virtual bool isCommandEnabled() override; + virtual void onActionTriggered( bool isChecked ) override; + virtual void setupActionLook( QAction* actionToSetup ) override; private: static bool isAnyCopyableObjectSelected(); - static bool isCopyOfObjectSupported(PdmObject* pdmObject); + static bool isCopyOfObjectSupported(caf::PdmObject* pdmObject); }; - - - -} // end namespace caf diff --git a/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteEclipseCasesFeature.cpp b/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteEclipseCasesFeature.cpp index 1ef1447676..596c28adbc 100644 --- a/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteEclipseCasesFeature.cpp +++ b/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteEclipseCasesFeature.cpp @@ -42,8 +42,6 @@ #include #include -namespace caf -{ CAF_CMD_SOURCE_INIT(RicPasteEclipseCasesFeature, "RicPasteEclipseCasesFeature"); @@ -53,7 +51,7 @@ CAF_CMD_SOURCE_INIT(RicPasteEclipseCasesFeature, "RicPasteEclipseCasesFeature"); //-------------------------------------------------------------------------------------------------- bool RicPasteEclipseCasesFeature::isCommandEnabled() { - PdmObjectGroup objectGroup; + caf::PdmObjectGroup objectGroup; RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup); std::vector > typedObjects; @@ -64,7 +62,7 @@ bool RicPasteEclipseCasesFeature::isCommandEnabled() return false; } - PdmObjectHandle* destinationObject = dynamic_cast(SelectionManager::instance()->selectedItem()); + caf::PdmObjectHandle* destinationObject = dynamic_cast(caf::SelectionManager::instance()->selectedItem()); RimIdenticalGridCaseGroup* gridCaseGroup = RicPasteFeatureImpl::findGridCaseGroup(destinationObject); if (gridCaseGroup) return true; @@ -77,12 +75,12 @@ bool RicPasteEclipseCasesFeature::isCommandEnabled() //-------------------------------------------------------------------------------------------------- void RicPasteEclipseCasesFeature::onActionTriggered(bool isChecked) { - PdmObjectHandle* destinationObject = dynamic_cast(SelectionManager::instance()->selectedItem()); + caf::PdmObjectHandle* destinationObject = dynamic_cast(caf::SelectionManager::instance()->selectedItem()); RimIdenticalGridCaseGroup* gridCaseGroup = RicPasteFeatureImpl::findGridCaseGroup(destinationObject); if (!gridCaseGroup) return; - PdmObjectGroup objectGroup; + caf::PdmObjectGroup objectGroup; RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup); if (objectGroup.objects.size() == 0) return; @@ -105,7 +103,7 @@ void RicPasteEclipseCasesFeature::setupActionLook(QAction* actionToSetup) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicPasteEclipseCasesFeature::addCasesToGridCaseGroup(PdmObjectGroup& objectGroup, RimIdenticalGridCaseGroup* gridCaseGroup) +void RicPasteEclipseCasesFeature::addCasesToGridCaseGroup(caf::PdmObjectGroup& objectGroup, RimIdenticalGridCaseGroup* gridCaseGroup) { RimProject* proj = RiaApplication::instance()->project(); CVF_ASSERT(proj); @@ -202,5 +200,3 @@ void RicPasteEclipseCasesFeature::addCasesToGridCaseGroup(PdmObjectGroup& object } } - -} // end namespace caf diff --git a/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteEclipseCasesFeature.h b/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteEclipseCasesFeature.h index 648f62c5ed..5a1ed65387 100644 --- a/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteEclipseCasesFeature.h +++ b/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteEclipseCasesFeature.h @@ -28,6 +28,7 @@ class RimIdenticalGridCaseGroup; namespace caf { class PdmObjectGroup; +} //================================================================================================== /// @@ -37,15 +38,11 @@ class RicPasteEclipseCasesFeature : public caf::CmdFeature CAF_CMD_HEADER_INIT; public: - static void addCasesToGridCaseGroup(PdmObjectGroup& objectGroup, RimIdenticalGridCaseGroup* gridCaseGroup); + static void addCasesToGridCaseGroup(caf::PdmObjectGroup& objectGroup, RimIdenticalGridCaseGroup* gridCaseGroup); protected: // Overrides - virtual bool isCommandEnabled(); - virtual void onActionTriggered(bool isChecked); - virtual void setupActionLook(QAction* actionToSetup); + virtual bool isCommandEnabled() override; + virtual void onActionTriggered(bool isChecked) override; + virtual void setupActionLook(QAction* actionToSetup) override; }; - - - -} // end namespace caf diff --git a/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteEclipseViewsFeature.cpp b/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteEclipseViewsFeature.cpp index 97fb22d65a..aecc75ee64 100644 --- a/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteEclipseViewsFeature.cpp +++ b/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteEclipseViewsFeature.cpp @@ -35,8 +35,6 @@ #include -namespace caf -{ CAF_CMD_SOURCE_INIT(RicPasteEclipseViewsFeature, "RicPasteEclipseViewsFeature"); @@ -45,7 +43,7 @@ CAF_CMD_SOURCE_INIT(RicPasteEclipseViewsFeature, "RicPasteEclipseViewsFeature"); //-------------------------------------------------------------------------------------------------- bool RicPasteEclipseViewsFeature::isCommandEnabled() { - PdmObjectGroup objectGroup; + caf::PdmObjectGroup objectGroup; RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup); std::vector > typedObjects; @@ -56,7 +54,7 @@ bool RicPasteEclipseViewsFeature::isCommandEnabled() return false; } - PdmObjectHandle* destinationObject = dynamic_cast(SelectionManager::instance()->selectedItem()); + caf::PdmObjectHandle* destinationObject = dynamic_cast(caf::SelectionManager::instance()->selectedItem()); RimIdenticalGridCaseGroup* gridCaseGroup = RicPasteFeatureImpl::findGridCaseGroup(destinationObject); if (gridCaseGroup) return false; @@ -72,12 +70,12 @@ bool RicPasteEclipseViewsFeature::isCommandEnabled() //-------------------------------------------------------------------------------------------------- void RicPasteEclipseViewsFeature::onActionTriggered(bool isChecked) { - PdmObjectHandle* destinationObject = dynamic_cast(SelectionManager::instance()->selectedItem()); + caf::PdmObjectHandle* destinationObject = dynamic_cast(caf::SelectionManager::instance()->selectedItem()); RimEclipseCase* eclipseCase = RicPasteFeatureImpl::findEclipseCase(destinationObject); assert(eclipseCase); - PdmObjectGroup objectGroup; + caf::PdmObjectGroup objectGroup; RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup); if (objectGroup.objects.size() == 0) return; @@ -90,7 +88,7 @@ void RicPasteEclipseViewsFeature::onActionTriggered(bool isChecked) // Add cases to case group for (size_t i = 0; i < eclipseViews.size(); i++) { - RimEclipseView* rimReservoirView = dynamic_cast(eclipseViews[i]->xmlCapability()->copyByXmlSerialization(PdmDefaultObjectFactory::instance())); + RimEclipseView* rimReservoirView = dynamic_cast(eclipseViews[i]->xmlCapability()->copyByXmlSerialization(caf::PdmDefaultObjectFactory::instance())); CVF_ASSERT(rimReservoirView); QString nameOfCopy = QString("Copy of ") + rimReservoirView->name; @@ -124,6 +122,3 @@ void RicPasteEclipseViewsFeature::setupActionLook(QAction* actionToSetup) RicPasteFeatureImpl::setIconAndShortcuts(actionToSetup); } - - -} // end namespace caf diff --git a/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteEclipseViewsFeature.h b/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteEclipseViewsFeature.h index 8ddd2ea5f7..3f0b0ca454 100644 --- a/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteEclipseViewsFeature.h +++ b/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteEclipseViewsFeature.h @@ -23,8 +23,6 @@ #include "cafCmdFeature.h" -namespace caf -{ //================================================================================================== /// @@ -35,11 +33,8 @@ CAF_CMD_HEADER_INIT; protected: // Overrides - virtual bool isCommandEnabled(); - virtual void onActionTriggered(bool isChecked); - virtual void setupActionLook(QAction* actionToSetup); + virtual bool isCommandEnabled() override; + virtual void onActionTriggered(bool isChecked) override; + virtual void setupActionLook(QAction* actionToSetup) override; }; - - -} // end namespace caf diff --git a/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteGeoMechViewsFeature.cpp b/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteGeoMechViewsFeature.cpp index b5c6505452..cf1b63151f 100644 --- a/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteGeoMechViewsFeature.cpp +++ b/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteGeoMechViewsFeature.cpp @@ -32,8 +32,6 @@ #include -namespace caf -{ CAF_CMD_SOURCE_INIT(RicPasteGeoMechViewsFeature, "RicPasteGeoMechViewsFeature"); @@ -42,7 +40,7 @@ CAF_CMD_SOURCE_INIT(RicPasteGeoMechViewsFeature, "RicPasteGeoMechViewsFeature"); //-------------------------------------------------------------------------------------------------- bool RicPasteGeoMechViewsFeature::isCommandEnabled() { - PdmObjectGroup objectGroup; + caf::PdmObjectGroup objectGroup; RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup); std::vector > typedObjects; @@ -53,7 +51,7 @@ bool RicPasteGeoMechViewsFeature::isCommandEnabled() return false; } - PdmObjectHandle* destinationObject = dynamic_cast(SelectionManager::instance()->selectedItem()); + caf::PdmObjectHandle* destinationObject = dynamic_cast(caf::SelectionManager::instance()->selectedItem()); RimGeoMechCase* geoMechCase = RicPasteFeatureImpl::findGeoMechCase(destinationObject); if (geoMechCase) return true; @@ -66,12 +64,12 @@ bool RicPasteGeoMechViewsFeature::isCommandEnabled() //-------------------------------------------------------------------------------------------------- void RicPasteGeoMechViewsFeature::onActionTriggered(bool isChecked) { - PdmObjectHandle* destinationObject = dynamic_cast(SelectionManager::instance()->selectedItem()); + caf::PdmObjectHandle* destinationObject = dynamic_cast(caf::SelectionManager::instance()->selectedItem()); RimGeoMechCase* geomCase = RicPasteFeatureImpl::findGeoMechCase(destinationObject); assert(geomCase); - PdmObjectGroup objectGroup; + caf::PdmObjectGroup objectGroup; RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup); if (objectGroup.objects.size() == 0) return; @@ -84,7 +82,7 @@ void RicPasteGeoMechViewsFeature::onActionTriggered(bool isChecked) // Add cases to case group for (size_t i = 0; i < geomViews.size(); i++) { - RimGeoMechView* rimReservoirView = dynamic_cast(geomViews[i]->xmlCapability()->copyByXmlSerialization(PdmDefaultObjectFactory::instance())); + RimGeoMechView* rimReservoirView = dynamic_cast(geomViews[i]->xmlCapability()->copyByXmlSerialization(caf::PdmDefaultObjectFactory::instance())); QString nameOfCopy = QString("Copy of ") + rimReservoirView->name; rimReservoirView->name = nameOfCopy; geomCase->geoMechViews().push_back(rimReservoirView); @@ -117,6 +115,3 @@ void RicPasteGeoMechViewsFeature::setupActionLook(QAction* actionToSetup) RicPasteFeatureImpl::setIconAndShortcuts(actionToSetup); } - - -} // end namespace caf diff --git a/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteGeoMechViewsFeature.h b/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteGeoMechViewsFeature.h index 98c991b722..143534f8e6 100644 --- a/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteGeoMechViewsFeature.h +++ b/ApplicationCode/Commands/OperationsUsingObjReferences/RicPasteGeoMechViewsFeature.h @@ -22,10 +22,6 @@ #include "cafCmdFeature.h" - -namespace caf -{ - //================================================================================================== /// //================================================================================================== @@ -35,11 +31,7 @@ CAF_CMD_HEADER_INIT; protected: // Overrides - virtual bool isCommandEnabled(); - virtual void onActionTriggered(bool isChecked); - virtual void setupActionLook(QAction* actionToSetup); + virtual bool isCommandEnabled() override; + virtual void onActionTriggered(bool isChecked) override; + virtual void setupActionLook(QAction* actionToSetup) override; }; - - - -} // end namespace caf diff --git a/ApplicationCode/Commands/PerforationCommands/CMakeLists_files.cmake b/ApplicationCode/Commands/PerforationCommands/CMakeLists_files.cmake new file mode 100644 index 0000000000..8f272175c2 --- /dev/null +++ b/ApplicationCode/Commands/PerforationCommands/CMakeLists_files.cmake @@ -0,0 +1,27 @@ + +# Use this workaround until we're on 2.8.3 on all platforms and can use CMAKE_CURRENT_LIST_DIR directly +if (${CMAKE_VERSION} VERSION_GREATER "2.8.2") + set(CEE_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_DIR}/) +endif() + +set (SOURCE_GROUP_HEADER_FILES +${CEE_CURRENT_LIST_DIR}RicEditPerforationCollectionFeature.h +${CEE_CURRENT_LIST_DIR}RicNewPerforationIntervalFeature.h +${CEE_CURRENT_LIST_DIR}RicNewPerforationIntervalAtMeasuredDepthFeature.h +) + +set (SOURCE_GROUP_SOURCE_FILES +${CEE_CURRENT_LIST_DIR}RicEditPerforationCollectionFeature.cpp +${CEE_CURRENT_LIST_DIR}RicNewPerforationIntervalFeature.cpp +${CEE_CURRENT_LIST_DIR}RicNewPerforationIntervalAtMeasuredDepthFeature.cpp +) + +list(APPEND CODE_HEADER_FILES +${SOURCE_GROUP_HEADER_FILES} +) + +list(APPEND CODE_SOURCE_FILES +${SOURCE_GROUP_SOURCE_FILES} +) + +source_group( "CommandFeature\\Perforations" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CEE_CURRENT_LIST_DIR}CMakeLists_files.cmake ) diff --git a/ApplicationCode/Commands/PerforationCommands/RicEditPerforationCollectionFeature.cpp b/ApplicationCode/Commands/PerforationCommands/RicEditPerforationCollectionFeature.cpp new file mode 100644 index 0000000000..018b3f4ffb --- /dev/null +++ b/ApplicationCode/Commands/PerforationCommands/RicEditPerforationCollectionFeature.cpp @@ -0,0 +1,82 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2016- Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicEditPerforationCollectionFeature.h" + +#include "RiuEditPerforationCollectionWidget.h" + +#include "RimPerforationCollection.h" + +#include "cafSelectionManager.h" + +#include + + +CAF_CMD_SOURCE_INIT(RicEditPerforationCollectionFeature, "RicEditPerforationCollectionFeature"); + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicEditPerforationCollectionFeature::isCommandEnabled() +{ + return selectedPerforationCollection() != nullptr; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicEditPerforationCollectionFeature::onActionTriggered(bool isChecked) +{ + this->disableModelChangeContribution(); + + RimPerforationCollection* perforationCollection = selectedPerforationCollection(); + + if (perforationCollection == nullptr) return; + + RiuEditPerforationCollectionWidget dlg(nullptr, perforationCollection); + dlg.exec(); + + perforationCollection->updateConnectedEditors(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicEditPerforationCollectionFeature::setupActionLook(QAction* actionToSetup) +{ + actionToSetup->setText("Edit Perforations"); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimPerforationCollection* RicEditPerforationCollectionFeature::selectedPerforationCollection() +{ + RimPerforationCollection* objToFind = nullptr; + + caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem(); + + caf::PdmObjectHandle* objHandle = dynamic_cast(pdmUiItem); + if (objHandle) + { + objHandle->firstAncestorOrThisOfType(objToFind); + } + + return objToFind; +} diff --git a/ApplicationCode/Commands/PerforationCommands/RicEditPerforationCollectionFeature.h b/ApplicationCode/Commands/PerforationCommands/RicEditPerforationCollectionFeature.h new file mode 100644 index 0000000000..170fa535b9 --- /dev/null +++ b/ApplicationCode/Commands/PerforationCommands/RicEditPerforationCollectionFeature.h @@ -0,0 +1,40 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2016- Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +class RimPerforationCollection; + +//================================================================================================== +/// +//================================================================================================== +class RicEditPerforationCollectionFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; + +protected: + virtual bool isCommandEnabled() override; + virtual void onActionTriggered( bool isChecked ) override; + virtual void setupActionLook(QAction* actionToSetup) override; + +private: + static RimPerforationCollection* selectedPerforationCollection(); +}; + diff --git a/ApplicationCode/Commands/PerforationCommands/RicNewPerforationIntervalAtMeasuredDepthFeature.cpp b/ApplicationCode/Commands/PerforationCommands/RicNewPerforationIntervalAtMeasuredDepthFeature.cpp new file mode 100644 index 0000000000..e29b86ff44 --- /dev/null +++ b/ApplicationCode/Commands/PerforationCommands/RicNewPerforationIntervalAtMeasuredDepthFeature.cpp @@ -0,0 +1,97 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicNewPerforationIntervalAtMeasuredDepthFeature.h" + +#include "RimFishbonesMultipleSubs.h" +#include "RimPerforationCollection.h" +#include "RimPerforationInterval.h" +#include "RimProject.h" +#include "RimWellPath.h" +#include "RimWellPathCollection.h" + +#include "RiuMainWindow.h" +#include "RiuSelectionManager.h" + +#include "cafSelectionManager.h" + +#include + + +CAF_CMD_SOURCE_INIT(RicNewPerforationIntervalAtMeasuredDepthFeature, "RicNewPerforationIntervalAtMeasuredDepthFeature"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicNewPerforationIntervalAtMeasuredDepthFeature::onActionTriggered(bool isChecked) +{ + RiuWellPathSelectionItem* wellPathSelItem = wellPathSelectionItem(); + CVF_ASSERT(wellPathSelItem); + + RimWellPath* wellPath = wellPathSelItem->m_wellpath; + CVF_ASSERT(wellPath); + + RimPerforationInterval* perforationInterval = new RimPerforationInterval; + int measuredDepth = wellPathSelItem->m_measuredDepth; + perforationInterval->setStartAndEndMD(measuredDepth, measuredDepth + 50); + + wellPath->perforationIntervalCollection()->appendPerforation(perforationInterval); + + RimWellPathCollection* wellPathCollection = nullptr; + wellPath->firstAncestorOrThisOfTypeAsserted(wellPathCollection); + + wellPathCollection->uiCapability()->updateConnectedEditors(); + wellPathCollection->scheduleGeometryRegenAndRedrawViews(); + + RiuMainWindow::instance()->selectAsCurrentItem(perforationInterval); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiuWellPathSelectionItem* RicNewPerforationIntervalAtMeasuredDepthFeature::wellPathSelectionItem() +{ + RiuSelectionManager* riuSelManager = RiuSelectionManager::instance(); + RiuSelectionItem* selItem = riuSelManager->selectedItem(RiuSelectionManager::RUI_TEMPORARY); + + RiuWellPathSelectionItem* wellPathItem = dynamic_cast(selItem); + + return wellPathItem; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicNewPerforationIntervalAtMeasuredDepthFeature::setupActionLook(QAction* actionToSetup) +{ + //actionToSetup->setIcon(QIcon(":/FractureSymbol16x16.png")); + actionToSetup->setText("New Perforation Interval"); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicNewPerforationIntervalAtMeasuredDepthFeature::isCommandEnabled() +{ + if (wellPathSelectionItem()) + { + return true; + } + + return false; +} diff --git a/ApplicationCode/Commands/PerforationCommands/RicNewPerforationIntervalAtMeasuredDepthFeature.h b/ApplicationCode/Commands/PerforationCommands/RicNewPerforationIntervalAtMeasuredDepthFeature.h new file mode 100644 index 0000000000..ae77586bf5 --- /dev/null +++ b/ApplicationCode/Commands/PerforationCommands/RicNewPerforationIntervalAtMeasuredDepthFeature.h @@ -0,0 +1,39 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +class RiuWellPathSelectionItem; + +//================================================================================================== +/// +//================================================================================================== +class RicNewPerforationIntervalAtMeasuredDepthFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; + +protected: + virtual void onActionTriggered(bool isChecked) override; + virtual void setupActionLook(QAction* actionToSetup) override; + virtual bool isCommandEnabled() override; + +private: + static RiuWellPathSelectionItem* wellPathSelectionItem(); +}; diff --git a/ApplicationCode/Commands/PerforationCommands/RicNewPerforationIntervalFeature.cpp b/ApplicationCode/Commands/PerforationCommands/RicNewPerforationIntervalFeature.cpp new file mode 100644 index 0000000000..bbf4a6b184 --- /dev/null +++ b/ApplicationCode/Commands/PerforationCommands/RicNewPerforationIntervalFeature.cpp @@ -0,0 +1,90 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2015- Statoil ASA +// Copyright (C) 2015- 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicNewPerforationIntervalFeature.h" + +#include "RiuMainWindow.h" + +#include "RimPerforationInterval.h" +#include "RimPerforationCollection.h" +#include "RimWellPathCollection.h" + +#include "cafSelectionManager.h" + +#include + + +CAF_CMD_SOURCE_INIT(RicNewPerforationIntervalFeature, "RicNewPerforationIntervalFeature"); + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicNewPerforationIntervalFeature::isCommandEnabled() +{ + return selectedPerforationCollection() != nullptr; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicNewPerforationIntervalFeature::onActionTriggered(bool isChecked) +{ + RimPerforationCollection* perforationCollection = selectedPerforationCollection(); + if (perforationCollection == nullptr) return; + + RimPerforationInterval* perforationInterval = new RimPerforationInterval; + + perforationCollection->appendPerforation(perforationInterval); + + RimWellPathCollection* wellPathCollection = nullptr; + perforationCollection->firstAncestorOrThisOfType(wellPathCollection); + if (!wellPathCollection) return; + + wellPathCollection->uiCapability()->updateConnectedEditors(); + wellPathCollection->scheduleGeometryRegenAndRedrawViews(); + + RiuMainWindow::instance()->selectAsCurrentItem(perforationInterval); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicNewPerforationIntervalFeature::setupActionLook(QAction* actionToSetup) +{ + actionToSetup->setText("New Perforation Interval"); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimPerforationCollection* RicNewPerforationIntervalFeature::selectedPerforationCollection() +{ + RimPerforationCollection* objToFind = nullptr; + + caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem(); + + caf::PdmObjectHandle* objHandle = dynamic_cast(pdmUiItem); + if (objHandle) + { + objHandle->firstAncestorOrThisOfType(objToFind); + } + + return objToFind; +} diff --git a/ApplicationCode/Commands/PerforationCommands/RicNewPerforationIntervalFeature.h b/ApplicationCode/Commands/PerforationCommands/RicNewPerforationIntervalFeature.h new file mode 100644 index 0000000000..162ad9c390 --- /dev/null +++ b/ApplicationCode/Commands/PerforationCommands/RicNewPerforationIntervalFeature.h @@ -0,0 +1,41 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2015- Statoil ASA +// Copyright (C) 2015- 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +class RimPerforationCollection; + +//================================================================================================== +/// +//================================================================================================== +class RicNewPerforationIntervalFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; +protected: + + // Overrides + virtual bool isCommandEnabled() override; + virtual void onActionTriggered( bool isChecked ) override; + virtual void setupActionLook( QAction* actionToSetup ) override; + +private: + RimPerforationCollection* selectedPerforationCollection(); +}; diff --git a/ApplicationCode/Commands/RicDeleteItemExec.cpp b/ApplicationCode/Commands/RicDeleteItemExec.cpp index 96bfbd22eb..d4e8a00a8f 100644 --- a/ApplicationCode/Commands/RicDeleteItemExec.cpp +++ b/ApplicationCode/Commands/RicDeleteItemExec.cpp @@ -46,9 +46,6 @@ #include "cafSelectionManager.h" -namespace caf -{ - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -62,15 +59,15 @@ QString RicDeleteItemExec::name() //-------------------------------------------------------------------------------------------------- void RicDeleteItemExec::redo() { - PdmFieldHandle* field = PdmReferenceHelper::fieldFromReference(m_commandData->m_rootObject, m_commandData->m_pathToField); + caf::PdmFieldHandle* field = caf::PdmReferenceHelper::fieldFromReference(m_commandData->m_rootObject, m_commandData->m_pathToField); - PdmChildArrayFieldHandle* listField = dynamic_cast(field); + caf::PdmChildArrayFieldHandle* listField = dynamic_cast(field); if (listField) { - std::vector children; + std::vector children; listField->childObjects(&children); - PdmObjectHandle* obj = children[m_commandData->m_indexToObject]; + caf::PdmObjectHandle* obj = children[m_commandData->m_indexToObject]; caf::SelectionManager::instance()->removeObjectFromAllSelections(obj); std::vector referringObjects; @@ -161,6 +158,7 @@ void RicDeleteItemExec::redo() if (wellPathColl) { wellPathColl->scheduleGeometryRegenAndRedrawViews(); + wellPathColl->uiCapability()->updateConnectedEditors(); } // Update due to deletion of curves (not tracks, handled separatly) @@ -235,12 +233,12 @@ void RicDeleteItemExec::redo() //-------------------------------------------------------------------------------------------------- void RicDeleteItemExec::undo() { - PdmFieldHandle* field = PdmReferenceHelper::fieldFromReference(m_commandData->m_rootObject, m_commandData->m_pathToField); + caf::PdmFieldHandle* field = caf::PdmReferenceHelper::fieldFromReference(m_commandData->m_rootObject, m_commandData->m_pathToField); - PdmChildArrayFieldHandle* listField = dynamic_cast(field); + caf::PdmChildArrayFieldHandle* listField = dynamic_cast(field); if (listField) { - PdmObjectHandle* obj = PdmXmlObjectHandle::readUnknownObjectFromXmlString(m_commandData->m_deletedObjectAsXml(), PdmDefaultObjectFactory::instance()); + caf::PdmObjectHandle* obj = caf::PdmXmlObjectHandle::readUnknownObjectFromXmlString(m_commandData->m_deletedObjectAsXml(), caf::PdmDefaultObjectFactory::instance()); listField->insertAt(m_commandData->m_indexToObject, obj); @@ -256,7 +254,7 @@ void RicDeleteItemExec::undo() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RicDeleteItemExec::RicDeleteItemExec(NotificationCenter* notificationCenter) +RicDeleteItemExec::RicDeleteItemExec(caf::NotificationCenter* notificationCenter) : CmdExecuteCommand(notificationCenter) { m_commandData = new RicDeleteItemExecData; @@ -269,5 +267,3 @@ RicDeleteItemExecData* RicDeleteItemExec::commandData() { return m_commandData; } - -} // end namespace caf diff --git a/ApplicationCode/Commands/RicDeleteItemExec.h b/ApplicationCode/Commands/RicDeleteItemExec.h index e733702f45..38bef07d1e 100644 --- a/ApplicationCode/Commands/RicDeleteItemExec.h +++ b/ApplicationCode/Commands/RicDeleteItemExec.h @@ -22,18 +22,15 @@ #include "cafCmdExecuteCommand.h" -namespace caf -{ - class RicDeleteItemExecData; //================================================================================================== /// //================================================================================================== -class RicDeleteItemExec : public CmdExecuteCommand +class RicDeleteItemExec : public caf::CmdExecuteCommand { public: - explicit RicDeleteItemExec(NotificationCenter* notificationCenter); + explicit RicDeleteItemExec(caf::NotificationCenter* notificationCenter); RicDeleteItemExecData* commandData(); @@ -44,7 +41,3 @@ public: private: RicDeleteItemExecData* m_commandData; }; - - - -} // end namespace caf diff --git a/ApplicationCode/Commands/RicDeleteItemExecData.cpp b/ApplicationCode/Commands/RicDeleteItemExecData.cpp index 6f0a20bb6a..0a00e9752e 100644 --- a/ApplicationCode/Commands/RicDeleteItemExecData.cpp +++ b/ApplicationCode/Commands/RicDeleteItemExecData.cpp @@ -21,9 +21,4 @@ #include "RicDeleteItemExecData.h" -namespace caf -{ - CAF_PDM_SOURCE_INIT(RicDeleteItemExecData, "RicDeleteItemExecData"); - -} // end namespace caf diff --git a/ApplicationCode/Commands/RicDeleteItemExecData.h b/ApplicationCode/Commands/RicDeleteItemExecData.h index e8000233b4..f5af3a7874 100644 --- a/ApplicationCode/Commands/RicDeleteItemExecData.h +++ b/ApplicationCode/Commands/RicDeleteItemExecData.h @@ -23,14 +23,10 @@ #include "cafPdmObject.h" #include "cafPdmField.h" -namespace caf -{ - - //================================================================================================== /// //================================================================================================== -class RicDeleteItemExecData : public PdmObject +class RicDeleteItemExecData : public caf::PdmObject { CAF_PDM_HEADER_INIT; @@ -44,13 +40,9 @@ public: CAF_PDM_InitField(&m_deletedObjectAsXml, "deletedObjectAsXml", QString(), "deletedObjectAsXml", "", "deletedObjectAsXml tooltip", "deletedObjectAsXml whatsthis"); } - caf::PdmPointer m_rootObject; + caf::PdmPointer m_rootObject; caf::PdmField m_pathToField; caf::PdmField m_indexToObject; caf::PdmField m_deletedObjectAsXml; }; - - - -} // end namespace caf diff --git a/ApplicationCode/Commands/RicDeleteItemFeature.cpp b/ApplicationCode/Commands/RicDeleteItemFeature.cpp index 1572dcb5fd..576af95962 100644 --- a/ApplicationCode/Commands/RicDeleteItemFeature.cpp +++ b/ApplicationCode/Commands/RicDeleteItemFeature.cpp @@ -25,6 +25,7 @@ #include "RimEclipseInputProperty.h" #include "RimEclipsePropertyFilter.h" #include "RimEclipseView.h" +#include "RimFishbonesMultipleSubs.h" #include "RimEllipseFractureTemplate.h" #include "RimFormationNames.h" #include "RimFormationNamesCollection.h" @@ -46,6 +47,8 @@ #include "RimWellLogCurve.h" #include "RimWellLogPlot.h" #include "RimWellLogTrack.h" +#include "RimFishboneWellPath.h" +#include "RimPerforationInterval.h" #include "RimWellPathFracture.h" #include "RimWellPathFractureCollection.h" @@ -58,11 +61,9 @@ #include -namespace caf -{ - CAF_CMD_SOURCE_INIT(RicDeleteItemFeature, "RicDeleteItemFeature"); +CAF_CMD_SOURCE_INIT(RicDeleteItemFeature, "RicDeleteItemFeature"); -bool isDeletable(PdmUiItem * uiItem) +bool isDeletable(caf::PdmUiItem* uiItem) { // Enable delete of well allocation plots if (dynamic_cast(uiItem)) return true; @@ -92,12 +93,15 @@ bool isDeletable(PdmUiItem * uiItem) if (dynamic_cast(uiItem)) return true; if (dynamic_cast(uiItem)) return true; if (dynamic_cast(uiItem)) return true; - if (dynamic_cast(uiItem)) return true; + if (dynamic_cast(uiItem)) return true; if (dynamic_cast(uiItem)) return true; if (dynamic_cast(uiItem)) return true; if (dynamic_cast(uiItem)) return true; if (dynamic_cast(uiItem)) return true; if (dynamic_cast(uiItem)) return true; + if (dynamic_cast(uiItem)) return true; + if (dynamic_cast(uiItem)) return true; + if (dynamic_cast(uiItem)) return true; if (dynamic_cast(uiItem)) return true; if (dynamic_cast(uiItem)) return true; if (dynamic_cast(uiItem)) return true; @@ -114,12 +118,12 @@ bool isDeletable(PdmUiItem * uiItem) //-------------------------------------------------------------------------------------------------- bool RicDeleteItemFeature::isCommandEnabled() { - std::vector items; + std::vector items; caf::SelectionManager::instance()->selectedItems(items); if (items.empty() ) return false; - for (PdmUiItem* item : items) + for (caf::PdmUiItem* item : items) { if (!isDeletable(item)) return false; @@ -138,11 +142,11 @@ bool RicDeleteItemFeature::isCommandEnabled() //-------------------------------------------------------------------------------------------------- void RicDeleteItemFeature::onActionTriggered(bool isChecked) { - std::vector items; - SelectionManager::instance()->selectedItems(items); + std::vector items; + caf::SelectionManager::instance()->selectedItems(items); assert(items.size() > 0); - for (PdmUiItem* item: items) + for (caf::PdmUiItem* item: items) { if (!isDeletable(item)) continue; @@ -154,7 +158,7 @@ void RicDeleteItemFeature::onActionTriggered(bool isChecked) int indexAfter = -1; - std::vector childObjects; + std::vector childObjects; childArrayFieldHandle->childObjects(&childObjects); for ( size_t i = 0; i < childObjects.size(); i++ ) @@ -168,15 +172,15 @@ void RicDeleteItemFeature::onActionTriggered(bool isChecked) // Did not find currently selected pdm object in the current list field assert(indexAfter != -1); - RicDeleteItemExec* executeCmd = new RicDeleteItemExec(SelectionManager::instance()->notificationCenter()); + RicDeleteItemExec* executeCmd = new RicDeleteItemExec(caf::SelectionManager::instance()->notificationCenter()); RicDeleteItemExecData* data = executeCmd->commandData(); - data->m_rootObject = PdmReferenceHelper::findRoot(childArrayFieldHandle); - data->m_pathToField = PdmReferenceHelper::referenceFromRootToField(data->m_rootObject, childArrayFieldHandle); + data->m_rootObject = caf::PdmReferenceHelper::findRoot(childArrayFieldHandle); + data->m_pathToField = caf::PdmReferenceHelper::referenceFromRootToField(data->m_rootObject, childArrayFieldHandle); data->m_indexToObject = indexAfter; - CmdExecCommandManager::instance()->processExecuteCommand(executeCmd); + caf::CmdExecCommandManager::instance()->processExecuteCommand(executeCmd); } } @@ -188,5 +192,3 @@ void RicDeleteItemFeature::setupActionLook(QAction* actionToSetup) actionToSetup->setText("Delete"); actionToSetup->setIcon(QIcon(":/Erase.png")); } - -} // end namespace caf diff --git a/ApplicationCode/Commands/RicDeleteItemFeature.h b/ApplicationCode/Commands/RicDeleteItemFeature.h index 5cde0517ef..466b2bcf17 100644 --- a/ApplicationCode/Commands/RicDeleteItemFeature.h +++ b/ApplicationCode/Commands/RicDeleteItemFeature.h @@ -21,23 +21,16 @@ #include "cafCmdFeature.h" -namespace caf -{ - //================================================================================================== /// //================================================================================================== -class RicDeleteItemFeature : public CmdFeature +class RicDeleteItemFeature : public caf::CmdFeature { CAF_CMD_HEADER_INIT; protected: // Overrides - virtual bool isCommandEnabled(); - virtual void onActionTriggered( bool isChecked ); - virtual void setupActionLook( QAction* actionToSetup ); + virtual bool isCommandEnabled() override; + virtual void onActionTriggered( bool isChecked ) override; + virtual void setupActionLook( QAction* actionToSetup ) override; }; - - - -} // end namespace caf diff --git a/ApplicationCode/Commands/RicExportMultipleSnapshotsFeature.cpp b/ApplicationCode/Commands/RicExportMultipleSnapshotsFeature.cpp index 3062534c09..5d8c09df3a 100644 --- a/ApplicationCode/Commands/RicExportMultipleSnapshotsFeature.cpp +++ b/ApplicationCode/Commands/RicExportMultipleSnapshotsFeature.cpp @@ -95,8 +95,8 @@ void RicExportMultipleSnapshotsFeature::onActionTriggered(bool isChecked) //-------------------------------------------------------------------------------------------------- void RicExportMultipleSnapshotsFeature::setupActionLook(QAction* actionToSetup) { - actionToSetup->setText("Export Multiple Snapshots ..."); - //actionToSetup->setIcon(QIcon(":/Save.png")); + actionToSetup->setText("Advanced Snapshot Export ..."); + actionToSetup->setIcon(QIcon(":/SnapShotSaveViews.png")); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Commands/RicExportToLasFileResampleUi.cpp b/ApplicationCode/Commands/RicExportToLasFileResampleUi.cpp index 3f45167a4d..43125dc085 100644 --- a/ApplicationCode/Commands/RicExportToLasFileResampleUi.cpp +++ b/ApplicationCode/Commands/RicExportToLasFileResampleUi.cpp @@ -121,7 +121,7 @@ void RicExportToLasFileResampleUi::defineEditorAttribute(const caf::PdmFieldHand { if (field == &exportFolder) { - caf::PdmUiFilePathEditorAttribute* myAttr = static_cast(attribute); + caf::PdmUiFilePathEditorAttribute* myAttr = dynamic_cast(attribute); if (myAttr) { myAttr->m_selectDirectory = true; @@ -130,7 +130,7 @@ void RicExportToLasFileResampleUi::defineEditorAttribute(const caf::PdmFieldHand if (field == &exportTvdrkb || field == &activateResample) { - caf::PdmUiCheckBoxEditorAttribute* myAttr = static_cast(attribute); + caf::PdmUiCheckBoxEditorAttribute* myAttr = dynamic_cast(attribute); if (myAttr) { myAttr->m_useNativeCheckBoxLabel = true; diff --git a/ApplicationCode/Commands/RicFlyToObjectFeature.cpp b/ApplicationCode/Commands/RicFlyToObjectFeature.cpp new file mode 100644 index 0000000000..db3b311e96 --- /dev/null +++ b/ApplicationCode/Commands/RicFlyToObjectFeature.cpp @@ -0,0 +1,122 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicFlyToObjectFeature.h" + +#include "RiaApplication.h" + +#include "Rim3dPropertiesInterface.h" +#include "RimView.h" + +#include "RiuViewer.h" + +#include "cafDisplayCoordTransform.h" +#include "cafPdmObject.h" +#include "cafSelectionManager.h" + +#include "cvfCamera.h" + +#include + +#include + +CAF_CMD_SOURCE_INIT(RicFlyToObjectFeature, "RicFlyToObjectFeature"); + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicFlyToObjectFeature::isCommandEnabled() +{ + if (RicFlyToObjectFeature::boundingBoxForSelectedObjects().isValid()) + { + return true; + } + else + { + return false; + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicFlyToObjectFeature::onActionTriggered(bool isChecked) +{ + RimView* activeView = RiaApplication::instance()->activeReservoirView(); + if (!activeView) return; + + RiuViewer* destinationViewer = activeView->viewer(); + if (!destinationViewer) return; + + cvf::BoundingBox bb = RicFlyToObjectFeature::boundingBoxForSelectedObjects(); + CVF_ASSERT(bb.isValid()); + + cvf::ref transForm = activeView->displayCoordTransform(); + + cvf::Vec3d centerInDisplayCoords = transForm->transformToDisplayCoord(bb.center()); + + cvf::Vec3d directionNormalToLargesExtent = cvf::Vec3d::X_AXIS; + double largesExtent = fabs(bb.extent().y()); + if (fabs(bb.extent().x()) > largesExtent) + { + largesExtent = fabs(bb.extent().x()); + directionNormalToLargesExtent = cvf::Vec3d::Y_AXIS; + } + + cvf::Vec3d cameraEye = centerInDisplayCoords + directionNormalToLargesExtent * std::max(largesExtent, 30.0); + cvf::Vec3d cameraViewRefPoint = centerInDisplayCoords; + cvf::Vec3d cameraUp = cvf::Vec3d::Z_AXIS; + + destinationViewer->mainCamera()->setFromLookAt(cameraEye, cameraViewRefPoint, cameraUp); + + destinationViewer->setPointOfInterest(cameraViewRefPoint); + + activeView->updateCurrentTimeStepAndRedraw(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicFlyToObjectFeature::setupActionLook(QAction* actionToSetup) +{ + actionToSetup->setText("Fly to Object"); + //actionToSetup->setIcon(QIcon(":/3DView16x16.png")); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +cvf::BoundingBox RicFlyToObjectFeature::boundingBoxForSelectedObjects() +{ + cvf::BoundingBox bb; + + std::vector objects; + caf::SelectionManager::instance()->objectsByType(&objects); + + for (auto obj : objects) + { + if (obj) + { + bb.add(obj->boundingBoxInDomainCoords()); + } + } + + return bb; +} + diff --git a/ApplicationCode/Commands/RicFlyToObjectFeature.h b/ApplicationCode/Commands/RicFlyToObjectFeature.h new file mode 100644 index 0000000000..f8028c44d9 --- /dev/null +++ b/ApplicationCode/Commands/RicFlyToObjectFeature.h @@ -0,0 +1,44 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +#include "cvfBoundingBox.h" + +namespace caf { + class PdmObject; +} + + +//================================================================================================== +/// +//================================================================================================== +class RicFlyToObjectFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; + +protected: + virtual void onActionTriggered( bool isChecked ) override; + virtual bool isCommandEnabled() override; + virtual void setupActionLook( QAction* actionToSetup ) override; + +private: + static cvf::BoundingBox boundingBoxForSelectedObjects(); +}; diff --git a/ApplicationCode/Commands/RicImportSummaryCaseFeature.cpp b/ApplicationCode/Commands/RicImportSummaryCaseFeature.cpp index da00e9c3e4..66ed83b6e5 100644 --- a/ApplicationCode/Commands/RicImportSummaryCaseFeature.cpp +++ b/ApplicationCode/Commands/RicImportSummaryCaseFeature.cpp @@ -19,6 +19,7 @@ #include "RicImportSummaryCaseFeature.h" #include "RiaApplication.h" +#include "RiaPreferences.h" #include "RimGridSummaryCase.h" #include "RimMainPlotCollection.h" @@ -102,10 +103,14 @@ bool RicImportSummaryCaseFeature::createAndAddSummaryCaseFromFile(const QString& RimSummaryCase* newSumCase = sumCaseColl->createAndAddSummaryCaseFromFileName(fileName); newSumCase->loadCase(); - RimMainPlotCollection* mainPlotColl = proj->mainPlotCollection(); - RimSummaryPlotCollection* summaryPlotColl = mainPlotColl->summaryPlotCollection(); - RicNewSummaryPlotFeature::createNewSummaryPlot(summaryPlotColl, newSumCase); + if (app->preferences()->autoCreatePlotsOnImport()) + { + RimMainPlotCollection* mainPlotColl = proj->mainPlotCollection(); + RimSummaryPlotCollection* summaryPlotColl = mainPlotColl->summaryPlotCollection(); + + RicNewSummaryPlotFeature::createNewSummaryPlot(summaryPlotColl, newSumCase); + } sumCaseColl->updateConnectedEditors(); app->addToRecentFiles(fileName); diff --git a/ApplicationCode/Commands/RicReloadCaseFeature.cpp b/ApplicationCode/Commands/RicReloadCaseFeature.cpp new file mode 100644 index 0000000000..7519b4c719 --- /dev/null +++ b/ApplicationCode/Commands/RicReloadCaseFeature.cpp @@ -0,0 +1,69 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2015- Statoil ASA +// Copyright (C) 2015- 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicReloadCaseFeature.h" + +#include "RimEclipseCase.h" + +#include "cafPdmObject.h" +#include "cafSelectionManager.h" + +#include + +CAF_CMD_SOURCE_INIT(RicReloadCaseFeature, "RicReloadCaseFeature"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicReloadCaseFeature::isCommandEnabled() +{ + std::vector selectedFormationNamesCollObjs; + caf::SelectionManager::instance()->objectsByType(&selectedFormationNamesCollObjs); + for (caf::PdmObject* pdmObject : selectedFormationNamesCollObjs) { + if (dynamic_cast(pdmObject)) + { + return true; + } + } + + return false; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicReloadCaseFeature::onActionTriggered(bool isChecked) +{ + std::vector selectedEclipseCases; + caf::SelectionManager::instance()->objectsByType(&selectedEclipseCases); + + for (RimEclipseCase* selectedCase : selectedEclipseCases) + { + selectedCase->reloadDataAndUpdate(); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicReloadCaseFeature::setupActionLook(QAction* actionToSetup) +{ + actionToSetup->setText("Reload"); + actionToSetup->setIcon(QIcon(":/Refresh-32.png")); +} diff --git a/ApplicationCode/Commands/RicReloadCaseFeature.h b/ApplicationCode/Commands/RicReloadCaseFeature.h new file mode 100644 index 0000000000..95bf4b7752 --- /dev/null +++ b/ApplicationCode/Commands/RicReloadCaseFeature.h @@ -0,0 +1,32 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2015- Statoil ASA +// Copyright (C) 2015- 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +class RicReloadCaseFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; + +protected: + virtual bool isCommandEnabled(); + virtual void onActionTriggered(bool isChecked); + virtual void setupActionLook(QAction* actionToSetup); +}; diff --git a/ApplicationCode/Commands/RicSnapshotViewToClipboardFeature.cpp b/ApplicationCode/Commands/RicSnapshotViewToClipboardFeature.cpp index 056314c980..05b198be5f 100644 --- a/ApplicationCode/Commands/RicSnapshotViewToClipboardFeature.cpp +++ b/ApplicationCode/Commands/RicSnapshotViewToClipboardFeature.cpp @@ -278,6 +278,6 @@ void RicSnapshotAllPlotsToFileFeature::onActionTriggered(bool isChecked) void RicSnapshotAllPlotsToFileFeature::setupActionLook(QAction* actionToSetup) { actionToSetup->setText("Snapshot All Plots To File"); - actionToSetup->setIcon(QIcon(":/SnapShotSave.png")); + actionToSetup->setIcon(QIcon(":/SnapShotSaveViews.png")); } diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicAsciiExportSummaryPlotFeature.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicAsciiExportSummaryPlotFeature.cpp index d86baf0014..f441dfc4d7 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicAsciiExportSummaryPlotFeature.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicAsciiExportSummaryPlotFeature.cpp @@ -95,7 +95,7 @@ void RicAsciiExportSummaryPlotFeature::onActionTriggered(bool isChecked) bool writeFiles = caf::Utils::getSaveDirectoryAndCheckOverwriteFiles(defaultDir, fileNames, &saveDir); if (!writeFiles) return; - RiaLogging::debug(QString("Writing to directory %1").arg(saveDir)); + RiaLogging::info(QString("Writing to directory %1").arg(saveDir)); for (RimSummaryPlot* summaryPlot : selectedSummaryPlots) { QString fileName = saveDir + "/" + caf::Utils::makeValidFileBasename(summaryPlot->description()) + ".ascii"; diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicNewGridTimeHistoryCurveFeature.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicNewGridTimeHistoryCurveFeature.cpp index 788aba473b..f588f5a4d6 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicNewGridTimeHistoryCurveFeature.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicNewGridTimeHistoryCurveFeature.cpp @@ -216,6 +216,15 @@ bool RicNewGridTimeHistoryCurveFeature::isCommandEnabled() if (items.size() > 0) { + const RiuEclipseSelectionItem* eclSelectionItem = dynamic_cast(items[0]); + if (eclSelectionItem) + { + if (eclSelectionItem->m_view->cellResult()->resultType() == RimDefines::FLOW_DIAGNOSTICS) + { + return false; + } + } + return true; } diff --git a/ApplicationCode/Commands/ToggleCommands/RicToggleItemsFeature.cpp b/ApplicationCode/Commands/ToggleCommands/RicToggleItemsFeature.cpp index 75e5e7be2f..24023e0790 100644 --- a/ApplicationCode/Commands/ToggleCommands/RicToggleItemsFeature.cpp +++ b/ApplicationCode/Commands/ToggleCommands/RicToggleItemsFeature.cpp @@ -19,14 +19,11 @@ #include "RicToggleItemsFeature.h" -#include "cafSelectionManager.h" - #include "RicToggleItemsFeatureImpl.h" -#include +#include "cafSelectionManager.h" -namespace caf -{ +#include CAF_CMD_SOURCE_INIT(RicToggleItemsFeature, "RicToggleItemsFeature"); @@ -56,5 +53,3 @@ void RicToggleItemsFeature::setupActionLook(QAction* actionToSetup) else actionToSetup->setText("Toggle"); } - -} // end namespace caf diff --git a/ApplicationCode/Commands/ToggleCommands/RicToggleItemsFeature.h b/ApplicationCode/Commands/ToggleCommands/RicToggleItemsFeature.h index 8698dc3237..13aac4e39d 100644 --- a/ApplicationCode/Commands/ToggleCommands/RicToggleItemsFeature.h +++ b/ApplicationCode/Commands/ToggleCommands/RicToggleItemsFeature.h @@ -21,23 +21,16 @@ #include "cafCmdFeature.h" -namespace caf -{ - //================================================================================================== /// //================================================================================================== -class RicToggleItemsFeature : public CmdFeature +class RicToggleItemsFeature : public caf::CmdFeature { CAF_CMD_HEADER_INIT; protected: // Overrides - virtual bool isCommandEnabled(); - virtual void onActionTriggered( bool isChecked ); - virtual void setupActionLook( QAction* actionToSetup ); + virtual bool isCommandEnabled() override; + virtual void onActionTriggered( bool isChecked ) override; + virtual void setupActionLook( QAction* actionToSetup ) override; }; - - - -} // end namespace caf diff --git a/ApplicationCode/Commands/ToggleCommands/RicToggleItemsOffFeature.cpp b/ApplicationCode/Commands/ToggleCommands/RicToggleItemsOffFeature.cpp index 0d61886c90..027e33d5ca 100644 --- a/ApplicationCode/Commands/ToggleCommands/RicToggleItemsOffFeature.cpp +++ b/ApplicationCode/Commands/ToggleCommands/RicToggleItemsOffFeature.cpp @@ -19,14 +19,11 @@ #include "RicToggleItemsOffFeature.h" -#include "cafSelectionManager.h" - #include "RicToggleItemsFeatureImpl.h" -#include +#include "cafSelectionManager.h" -namespace caf -{ +#include CAF_CMD_SOURCE_INIT(RicToggleItemsOffFeature, "RicToggleItemsOffFeature"); @@ -56,5 +53,3 @@ void RicToggleItemsOffFeature::setupActionLook(QAction* actionToSetup) else actionToSetup->setText("Off"); } - -} // end namespace caf diff --git a/ApplicationCode/Commands/ToggleCommands/RicToggleItemsOffFeature.h b/ApplicationCode/Commands/ToggleCommands/RicToggleItemsOffFeature.h index 2ae4f4a0fe..0f9b77f87a 100644 --- a/ApplicationCode/Commands/ToggleCommands/RicToggleItemsOffFeature.h +++ b/ApplicationCode/Commands/ToggleCommands/RicToggleItemsOffFeature.h @@ -21,23 +21,16 @@ #include "cafCmdFeature.h" -namespace caf -{ - //================================================================================================== /// //================================================================================================== -class RicToggleItemsOffFeature : public CmdFeature +class RicToggleItemsOffFeature : public caf::CmdFeature { CAF_CMD_HEADER_INIT; protected: // Overrides - virtual bool isCommandEnabled(); - virtual void onActionTriggered( bool isChecked ); - virtual void setupActionLook( QAction* actionToSetup ); + virtual bool isCommandEnabled() override; + virtual void onActionTriggered( bool isChecked ) override; + virtual void setupActionLook( QAction* actionToSetup ) override; }; - - - -} // end namespace caf diff --git a/ApplicationCode/Commands/ToggleCommands/RicToggleItemsOnFeature.cpp b/ApplicationCode/Commands/ToggleCommands/RicToggleItemsOnFeature.cpp index ecb20cb108..0f2467c5ff 100644 --- a/ApplicationCode/Commands/ToggleCommands/RicToggleItemsOnFeature.cpp +++ b/ApplicationCode/Commands/ToggleCommands/RicToggleItemsOnFeature.cpp @@ -19,14 +19,11 @@ #include "RicToggleItemsOnFeature.h" -#include "cafSelectionManager.h" - #include "RicToggleItemsFeatureImpl.h" -#include +#include "cafSelectionManager.h" -namespace caf -{ +#include CAF_CMD_SOURCE_INIT(RicToggleItemsOnFeature, "RicToggleItemsOnFeature"); @@ -56,5 +53,3 @@ void RicToggleItemsOnFeature::setupActionLook(QAction* actionToSetup) else actionToSetup->setText("On"); } - -} // end namespace caf diff --git a/ApplicationCode/Commands/ToggleCommands/RicToggleItemsOnFeature.h b/ApplicationCode/Commands/ToggleCommands/RicToggleItemsOnFeature.h index e92b543e26..97d8c3fed1 100644 --- a/ApplicationCode/Commands/ToggleCommands/RicToggleItemsOnFeature.h +++ b/ApplicationCode/Commands/ToggleCommands/RicToggleItemsOnFeature.h @@ -21,23 +21,16 @@ #include "cafCmdFeature.h" -namespace caf -{ - //================================================================================================== /// //================================================================================================== -class RicToggleItemsOnFeature : public CmdFeature +class RicToggleItemsOnFeature : public caf::CmdFeature { CAF_CMD_HEADER_INIT; protected: // Overrides - virtual bool isCommandEnabled(); - virtual void onActionTriggered( bool isChecked ); - virtual void setupActionLook( QAction* actionToSetup ); + virtual bool isCommandEnabled() override; + virtual void onActionTriggered( bool isChecked ) override; + virtual void setupActionLook( QAction* actionToSetup ) override; }; - - - -} // end namespace caf diff --git a/ApplicationCode/Commands/WellLogCommands/RicAddWellLogToPlotFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicAddWellLogToPlotFeature.cpp index 45bb637df2..4f040b8252 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicAddWellLogToPlotFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicAddWellLogToPlotFeature.cpp @@ -43,9 +43,7 @@ #include -namespace caf -{ - CAF_CMD_SOURCE_INIT(RicAddWellLogToPlotFeature, "RicAddWellLogToPlotFeature"); +CAF_CMD_SOURCE_INIT(RicAddWellLogToPlotFeature, "RicAddWellLogToPlotFeature"); //-------------------------------------------------------------------------------------------------- @@ -135,5 +133,3 @@ std::vector RicAddWellLogToPlotFeature::selectedWellLogs caf::SelectionManager::instance()->objectsByType(&selection); return selection; } - -} // end namespace caf diff --git a/ApplicationCode/Commands/WellLogCommands/RicAddWellLogToPlotFeature.h b/ApplicationCode/Commands/WellLogCommands/RicAddWellLogToPlotFeature.h index 987000abb8..cd47047e75 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicAddWellLogToPlotFeature.h +++ b/ApplicationCode/Commands/WellLogCommands/RicAddWellLogToPlotFeature.h @@ -28,26 +28,20 @@ class RimWellLogPlotCollection; class RimWellLogPlot; class RimWellLogFileChannel; -namespace caf -{ //================================================================================================== /// //================================================================================================== -class RicAddWellLogToPlotFeature : public CmdFeature +class RicAddWellLogToPlotFeature : public caf::CmdFeature { CAF_CMD_HEADER_INIT; protected: // Overrides - virtual bool isCommandEnabled(); - virtual void onActionTriggered( bool isChecked ); - virtual void setupActionLook( QAction* actionToSetup ); + virtual bool isCommandEnabled() override; + virtual void onActionTriggered( bool isChecked ) override; + virtual void setupActionLook( QAction* actionToSetup ) override; private: std::vector selectedWellLogs(); }; - - - -} // end namespace caf diff --git a/ApplicationCode/Commands/WellLogCommands/RicAsciiExportWellLogPlotFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicAsciiExportWellLogPlotFeature.cpp index 7f0fb08227..f4f8c37791 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicAsciiExportWellLogPlotFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicAsciiExportWellLogPlotFeature.cpp @@ -93,7 +93,7 @@ void RicAsciiExportWellLogPlotFeature::onActionTriggered(bool isChecked) bool writeFiles = caf::Utils::getSaveDirectoryAndCheckOverwriteFiles(defaultDir, fileNames, &saveDir); if (!writeFiles) return; - RiaLogging::debug(QString("Writing to directory %!").arg(saveDir)); + RiaLogging::info(QString("Writing to directory %!").arg(saveDir)); for (RimWellLogPlot* wellLogPlot : selectedWellLogPlots) { QString fileName = saveDir + "/" + caf::Utils::makeValidFileBasename(wellLogPlot->description()) + ".ascii"; diff --git a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogCurveExtractionFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogCurveExtractionFeature.cpp index 6332124856..1ad9176a8f 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogCurveExtractionFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogCurveExtractionFeature.cpp @@ -41,6 +41,8 @@ #include #include +#include "RimEclipseWell.h" +#include "RiuSelectionManager.h" CAF_CMD_SOURCE_INIT(RicNewWellLogCurveExtractionFeature, "RicNewWellLogCurveExtractionFeature"); @@ -51,8 +53,8 @@ CAF_CMD_SOURCE_INIT(RicNewWellLogCurveExtractionFeature, "RicNewWellLogCurveExtr bool RicNewWellLogCurveExtractionFeature::isCommandEnabled() { if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false; - - return (selectedWellLogPlotTrack() != NULL || selectedWellPath() != NULL) && caseAvailable(); + int branchIndex; + return (selectedWellLogPlotTrack() != nullptr || selectedWellPath() != nullptr || selectedSimulationWell(&branchIndex) != nullptr) && caseAvailable(); } //-------------------------------------------------------------------------------------------------- @@ -65,15 +67,17 @@ void RicNewWellLogCurveExtractionFeature::onActionTriggered(bool isChecked) RimWellLogTrack* wellLogPlotTrack = selectedWellLogPlotTrack(); if (wellLogPlotTrack) { - addCurve(wellLogPlotTrack, NULL, NULL); + addCurve(wellLogPlotTrack, NULL, NULL, nullptr, -1); } else { RimWellPath* wellPath = selectedWellPath(); - if (wellPath) + int branchIndex = -1; + RimEclipseWell* simWell = selectedSimulationWell(&branchIndex); + if (wellPath || simWell) { RimWellLogTrack* wellLogPlotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack(); - RimWellLogExtractionCurve* plotCurve = addCurve(wellLogPlotTrack, RiaApplication::instance()->activeReservoirView(), wellPath); + RimWellLogExtractionCurve* plotCurve = addCurve(wellLogPlotTrack, RiaApplication::instance()->activeReservoirView(), wellPath, simWell, branchIndex); plotCurve->loadDataAndUpdate(); @@ -118,6 +122,27 @@ RimWellPath* RicNewWellLogCurveExtractionFeature::selectedWellPath() const return selection.size() > 0 ? selection[0] : NULL; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEclipseWell* RicNewWellLogCurveExtractionFeature::selectedSimulationWell(int * branchIndex) const +{ + RiuSelectionItem* selItem = RiuSelectionManager::instance()->selectedItem(RiuSelectionManager::RUI_TEMPORARY); + RiuSimWellSelectionItem* simWellSelItem = dynamic_cast(selItem); + if (simWellSelItem) + { + (*branchIndex) = static_cast(simWellSelItem->m_branchIndex); + return simWellSelItem->m_simWell; + } + else + { + std::vector selection; + caf::SelectionManager::instance()->objectsByType(&selection); + (*branchIndex) = 0; + return selection.size() > 0 ? selection[0] : NULL; + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -132,14 +157,16 @@ bool RicNewWellLogCurveExtractionFeature::caseAvailable() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimWellLogExtractionCurve* RicNewWellLogCurveExtractionFeature::addCurve(RimWellLogTrack* plotTrack, RimView* view, RimWellPath* wellPath) +RimWellLogExtractionCurve* RicNewWellLogCurveExtractionFeature::addCurve(RimWellLogTrack* plotTrack, RimView* view, RimWellPath* wellPath, const RimEclipseWell* simWell, int branchIndex) { CVF_ASSERT(plotTrack); RimWellLogExtractionCurve* curve = new RimWellLogExtractionCurve(); cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromTable(plotTrack->curveCount()); curve->setColor(curveColor); - curve->setWellPath(wellPath); + if (wellPath) curve->setWellPath(wellPath); + if (simWell) curve->setFromSimulationWellName(simWell->name(), branchIndex); + curve->setPropertiesFromView(view); plotTrack->addCurve(curve); diff --git a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogCurveExtractionFeature.h b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogCurveExtractionFeature.h index 97d33a9b70..223d3ba079 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogCurveExtractionFeature.h +++ b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogCurveExtractionFeature.h @@ -21,10 +21,11 @@ #include "cafCmdFeature.h" +class RimEclipseWell; +class RimView; class RimWellLogExtractionCurve; class RimWellLogTrack; class RimWellPath; -class RimView; //================================================================================================== /// @@ -34,7 +35,7 @@ class RicNewWellLogCurveExtractionFeature : public caf::CmdFeature CAF_CMD_HEADER_INIT; public: - static RimWellLogExtractionCurve* addCurve(RimWellLogTrack* plotTrack, RimView* view, RimWellPath* wellPath); + static RimWellLogExtractionCurve* addCurve(RimWellLogTrack* plotTrack, RimView* view, RimWellPath* wellPath, const RimEclipseWell* simWell, int branchIndex); protected: @@ -46,5 +47,6 @@ protected: private: RimWellLogTrack* selectedWellLogPlotTrack() const; RimWellPath* selectedWellPath() const; + RimEclipseWell* selectedSimulationWell(int * branchIndex) const; bool caseAvailable() const; }; diff --git a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotFeature.cpp index a743d82381..55cef779f9 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotFeature.cpp @@ -51,7 +51,7 @@ bool RicNewWellLogPlotFeature::isCommandEnabled() void RicNewWellLogPlotFeature::onActionTriggered(bool isChecked) { RimWellLogTrack* plotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack(); - RicNewWellLogCurveExtractionFeature::addCurve(plotTrack, NULL, NULL); + RicNewWellLogCurveExtractionFeature::addCurve(plotTrack, NULL, NULL, nullptr, -1); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotTrackFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotTrackFeature.cpp index 47bf135c86..a487cf97de 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotTrackFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogPlotTrackFeature.cpp @@ -57,7 +57,7 @@ void RicNewWellLogPlotTrackFeature::onActionTriggered(bool isChecked) plotTrack->setDescription(QString("Track %1").arg(wellLogPlot->trackCount())); wellLogPlot->updateConnectedEditors(); - RicNewWellLogCurveExtractionFeature::addCurve(plotTrack, NULL, NULL); + RicNewWellLogCurveExtractionFeature::addCurve(plotTrack, NULL, NULL, nullptr, -1); } } diff --git a/ApplicationCode/Commands/WellLogCommands/RicWellLogsImportFileFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicWellLogsImportFileFeature.cpp index bdbdef20ef..0cc2aebcc7 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicWellLogsImportFileFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicWellLogsImportFileFeature.cpp @@ -26,10 +26,7 @@ #include #include -namespace caf -{ - CAF_CMD_SOURCE_INIT(RicWellLogsImportFileFeature, "RicWellLogsImportFileFeature"); - +CAF_CMD_SOURCE_INIT(RicWellLogsImportFileFeature, "RicWellLogsImportFileFeature"); //-------------------------------------------------------------------------------------------------- /// @@ -65,5 +62,3 @@ void RicWellLogsImportFileFeature::setupActionLook(QAction* actionToSetup) actionToSetup->setText("Import Well &Logs from File"); actionToSetup->setIcon(QIcon(":/LasFile16x16.png")); } - -} // end namespace caf diff --git a/ApplicationCode/Commands/WellLogCommands/RicWellLogsImportFileFeature.h b/ApplicationCode/Commands/WellLogCommands/RicWellLogsImportFileFeature.h index c82e9bf70e..11eaec4b12 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicWellLogsImportFileFeature.h +++ b/ApplicationCode/Commands/WellLogCommands/RicWellLogsImportFileFeature.h @@ -21,23 +21,17 @@ #include "cafCmdFeature.h" -namespace caf -{ - //================================================================================================== /// //================================================================================================== -class RicWellLogsImportFileFeature : public CmdFeature +class RicWellLogsImportFileFeature : public caf::CmdFeature { CAF_CMD_HEADER_INIT; + protected: // Overrides - virtual bool isCommandEnabled(); - virtual void onActionTriggered( bool isChecked ); - virtual void setupActionLook( QAction* actionToSetup ); + virtual bool isCommandEnabled() override; + virtual void onActionTriggered( bool isChecked ) override; + virtual void setupActionLook( QAction* actionToSetup ) override; }; - - - -} // end namespace caf diff --git a/ApplicationCode/Commands/WellPathCommands/CMakeLists_files.cmake b/ApplicationCode/Commands/WellPathCommands/CMakeLists_files.cmake index b249623bc5..587e6a7b83 100644 --- a/ApplicationCode/Commands/WellPathCommands/CMakeLists_files.cmake +++ b/ApplicationCode/Commands/WellPathCommands/CMakeLists_files.cmake @@ -6,6 +6,8 @@ endif() set (SOURCE_GROUP_HEADER_FILES ${CEE_CURRENT_LIST_DIR}RicWellPathDeleteFeature.h +${CEE_CURRENT_LIST_DIR}RicWellPathExportCompletionDataFeature.h +${CEE_CURRENT_LIST_DIR}RicWellPathImportCompletionsFileFeature.h ${CEE_CURRENT_LIST_DIR}RicWellPathsImportFileFeature.h ${CEE_CURRENT_LIST_DIR}RicWellPathsImportSsihubFeature.h ${CEE_CURRENT_LIST_DIR}RicWellPathViewerEventHandler.h @@ -13,6 +15,8 @@ ${CEE_CURRENT_LIST_DIR}RicWellPathViewerEventHandler.h set (SOURCE_GROUP_SOURCE_FILES ${CEE_CURRENT_LIST_DIR}RicWellPathDeleteFeature.cpp +${CEE_CURRENT_LIST_DIR}RicWellPathExportCompletionDataFeature.cpp +${CEE_CURRENT_LIST_DIR}RicWellPathImportCompletionsFileFeature.cpp ${CEE_CURRENT_LIST_DIR}RicWellPathsImportFileFeature.cpp ${CEE_CURRENT_LIST_DIR}RicWellPathsImportSsihubFeature.cpp ${CEE_CURRENT_LIST_DIR}RicWellPathViewerEventHandler.cpp diff --git a/ApplicationCode/Commands/WellPathCommands/RicWellPathDeleteFeature.cpp b/ApplicationCode/Commands/WellPathCommands/RicWellPathDeleteFeature.cpp index 9ee57e1033..d419766521 100644 --- a/ApplicationCode/Commands/WellPathCommands/RicWellPathDeleteFeature.cpp +++ b/ApplicationCode/Commands/WellPathCommands/RicWellPathDeleteFeature.cpp @@ -20,19 +20,14 @@ #include "RicWellPathDeleteFeature.h" #include "RimWellPathCollection.h" +#include "RimWellPath.h" #include "cafSelectionManager.h" #include -#include "RimWellPath.h" - -namespace caf -{ - CAF_CMD_SOURCE_INIT(RicWellPathDeleteFeature, "RicWellPathDeleteFeature"); - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -83,5 +78,3 @@ void RicWellPathDeleteFeature::setupActionLook(QAction* actionToSetup) actionToSetup->setText("Delete Well Path(s)"); actionToSetup->setIcon(QIcon(":/Erase.png")); } - -} // end namespace caf diff --git a/ApplicationCode/Commands/WellPathCommands/RicWellPathDeleteFeature.h b/ApplicationCode/Commands/WellPathCommands/RicWellPathDeleteFeature.h index 7f39370eaa..6f8e0bc97b 100644 --- a/ApplicationCode/Commands/WellPathCommands/RicWellPathDeleteFeature.h +++ b/ApplicationCode/Commands/WellPathCommands/RicWellPathDeleteFeature.h @@ -21,23 +21,16 @@ #include "cafCmdFeature.h" -namespace caf -{ - //================================================================================================== /// //================================================================================================== -class RicWellPathDeleteFeature : public CmdFeature +class RicWellPathDeleteFeature : public caf::CmdFeature { CAF_CMD_HEADER_INIT; protected: // Overrides - virtual bool isCommandEnabled(); - virtual void onActionTriggered( bool isChecked ); - virtual void setupActionLook( QAction* actionToSetup ); + virtual bool isCommandEnabled() override; + virtual void onActionTriggered( bool isChecked ) override; + virtual void setupActionLook( QAction* actionToSetup ) override; }; - - - -} // end namespace caf diff --git a/ApplicationCode/Commands/WellPathCommands/RicWellPathExportCompletionDataFeature.cpp b/ApplicationCode/Commands/WellPathCommands/RicWellPathExportCompletionDataFeature.cpp new file mode 100644 index 0000000000..e3aa639ef4 --- /dev/null +++ b/ApplicationCode/Commands/WellPathCommands/RicWellPathExportCompletionDataFeature.cpp @@ -0,0 +1,898 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicWellPathExportCompletionDataFeature.h" + +#include "RiaApplication.h" +#include "RiaLogging.h" + +#include "RimProject.h" +#include "RimWellPath.h" +#include "RimFishbonesMultipleSubs.h" +#include "RimFishbonesCollection.h" +#include "RimExportCompletionDataSettings.h" + +#include "RiuMainWindow.h" + +#include "RigWellLogExtractionTools.h" +#include "RigEclipseCaseData.h" +#include "RigMainGrid.h" +#include "RigWellPath.h" + +#include "cafSelectionManager.h" +#include "cafPdmUiPropertyViewDialog.h" + +#include "cvfPlane.h" + +#include +#include +#include + +CAF_CMD_SOURCE_INIT(RicWellPathExportCompletionDataFeature, "RicWellPathExportCompletionDataFeature"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicWellPathExportCompletionDataFeature::isCommandEnabled() +{ + std::vector objects; + caf::SelectionManager::instance()->objectsByType(&objects); + + if (objects.size() == 1) { + return true; + } + + return false; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicWellPathExportCompletionDataFeature::onActionTriggered(bool isChecked) +{ + std::vector objects; + caf::SelectionManager::instance()->objectsByType(&objects); + + CVF_ASSERT(objects.size() == 1); + + RiaApplication* app = RiaApplication::instance(); + + QString projectFolder = app->currentProjectPath(); + QString defaultDir = RiaApplication::instance()->lastUsedDialogDirectoryWithFallback("COMPLETIONS", projectFolder); + + RimExportCompletionDataSettings exportSettings; + std::vector cases; + app->project()->allCases(cases); + for (auto c : cases) + { + RimEclipseCase* eclipseCase = dynamic_cast(c); + if (eclipseCase != nullptr) + { + exportSettings.caseToApply = eclipseCase; + break; + } + } + + exportSettings.fileName = QDir(defaultDir).filePath("Completions"); + + caf::PdmUiPropertyViewDialog propertyDialog(RiuMainWindow::instance(), &exportSettings, "Export Completion Data", ""); + if (propertyDialog.exec() == QDialog::Accepted) + { + RiaApplication::instance()->setLastUsedDialogDirectory("COMPLETIONS", QFileInfo(exportSettings.fileName).absolutePath()); + + exportToFolder(objects[0], exportSettings); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicWellPathExportCompletionDataFeature::setupActionLook(QAction* actionToSetup) +{ + actionToSetup->setText("Export Completion Data"); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicWellPathExportCompletionDataFeature::exportToFolder(RimWellPath* wellPath, const RimExportCompletionDataSettings& exportSettings) +{ + QFile exportFile(exportSettings.fileName()); + + if (exportSettings.caseToApply() == nullptr) + { + RiaLogging::error("Export Completions Data: Cannot export completions data without specified eclipse case"); + return; + } + + if (!exportFile.open(QIODevice::WriteOnly)) + { + RiaLogging::error(QString("Export Completions Data: Could not open the file: %1").arg(exportSettings.fileName())); + return; + } + + RiaLogging::debug(QString("Exporting completion data for well path %1 to %2 [WPIMULT: %3, REM BORE CELLS: %4]").arg(wellPath->name).arg(exportSettings.fileName()).arg(exportSettings.includeWpimult()).arg(exportSettings.removeLateralsInMainBoreCells())); + + + // Generate data + const RigEclipseCaseData* caseData = exportSettings.caseToApply()->eclipseCaseData(); + std::vector wellSegmentLocations = findWellSegmentLocations(exportSettings.caseToApply, wellPath); + + // Filter out cells where main bore is present + if (exportSettings.removeLateralsInMainBoreCells()) + { + std::vector wellPathCells = findIntersectingCells(caseData, wellPath->wellPathGeometry()->m_wellPathPoints); + markWellPathCells(wellPathCells, &wellSegmentLocations); + } + + // Print data + QTextStream stream(&exportFile); + RifEclipseOutputTableFormatter formatter(stream); + + generateCompdatTable(formatter, wellPath, exportSettings, wellSegmentLocations); + + if (exportSettings.includeWpimult()) + { + std::map lateralsPerCell = computeLateralsPerCell(wellSegmentLocations, exportSettings.removeLateralsInMainBoreCells()); + generateWpimultTable(formatter, wellPath, exportSettings, lateralsPerCell); + } + + generateWelsegsTable(formatter, wellPath, exportSettings, wellSegmentLocations); + generateCompsegsTable(formatter, wellPath, exportSettings, wellSegmentLocations); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicWellPathExportCompletionDataFeature::generateCompdatTable(RifEclipseOutputTableFormatter& formatter, const RimWellPath* wellPath, const RimExportCompletionDataSettings& settings, const std::vector& locations) +{ + RigMainGrid* grid = settings.caseToApply->eclipseCaseData()->mainGrid(); + std::vector header = { + RifEclipseOutputTableColumn("Well"), + RifEclipseOutputTableColumn("I"), + RifEclipseOutputTableColumn("J"), + RifEclipseOutputTableColumn("K1"), + RifEclipseOutputTableColumn("K2"), + RifEclipseOutputTableColumn("Status"), + RifEclipseOutputTableColumn("SAT"), + RifEclipseOutputTableColumn("TR"), + RifEclipseOutputTableColumn("DIAM"), + RifEclipseOutputTableColumn("KH"), + RifEclipseOutputTableColumn("S"), + RifEclipseOutputTableColumn("Df"), + RifEclipseOutputTableColumn("DIR"), + RifEclipseOutputTableColumn("r0") + }; + + formatter.keyword("COMPDAT"); + formatter.header(header); + + for (const WellSegmentLocation& location : locations) + { + for (const WellSegmentLateral& lateral : location.laterals) + { + formatter.comment(QString("Fishbone %1 - Sub: %2 - Lateral: %3").arg(location.fishbonesSubs->name()).arg(location.subIndex).arg(lateral.lateralIndex)); + for (const WellSegmentLateralIntersection& intersection : lateral.intersections) + { + if (settings.removeLateralsInMainBoreCells && intersection.mainBoreCell) continue; + + size_t i, j, k; + grid->ijkFromCellIndex(intersection.cellIndex, &i, &j, &k); + formatter.add(wellPath->name()); + formatter.addZeroBasedCellIndex(i).addZeroBasedCellIndex(j).addZeroBasedCellIndex(k).addZeroBasedCellIndex(k); + formatter.add("'OPEN'").add("1*").add("1*"); + formatter.add(location.fishbonesSubs->holeRadius() / 1000); + formatter.add("1*").add("1*").add("1*"); + switch (intersection.direction) + { + case POS_I: + case NEG_I: + formatter.add("'X'"); + break; + case POS_J: + case NEG_J: + formatter.add("'Y'"); + break; + case POS_K: + case NEG_K: + formatter.add("'Z'"); + break; + } + formatter.add("1*"); + formatter.rowCompleted(); + } + } + } + + formatter.tableCompleted(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicWellPathExportCompletionDataFeature::generateWpimultTable(RifEclipseOutputTableFormatter& formatter, const RimWellPath* wellPath, const RimExportCompletionDataSettings& settings, const std::map& lateralsPerCell) +{ + RigMainGrid* grid = settings.caseToApply->eclipseCaseData()->mainGrid(); + std::vector header = { + RifEclipseOutputTableColumn("Well"), + RifEclipseOutputTableColumn("Mult"), + RifEclipseOutputTableColumn("I"), + RifEclipseOutputTableColumn("J"), + RifEclipseOutputTableColumn("K"), + }; + formatter.keyword("WPIMULT"); + formatter.header(header); + + for (auto lateralsInCell : lateralsPerCell) + { + size_t i, j, k; + grid->ijkFromCellIndex(lateralsInCell.first, &i, &j, &k); + formatter.add(wellPath->name()); + formatter.add(lateralsInCell.second); + formatter.addZeroBasedCellIndex(i).addZeroBasedCellIndex(j).addZeroBasedCellIndex(k); + formatter.rowCompleted(); + } + + formatter.tableCompleted(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicWellPathExportCompletionDataFeature::generateWelsegsTable(RifEclipseOutputTableFormatter& formatter, const RimWellPath* wellPath, const RimExportCompletionDataSettings& settings, const std::vector& locations) +{ + formatter.keyword("WELSEGS"); + + const WellSegmentLocation& firstLocation = locations[0]; + + { + std::vector header = { + RifEclipseOutputTableColumn("Name"), + RifEclipseOutputTableColumn("Dep 1"), + RifEclipseOutputTableColumn("Tlen 1"), + RifEclipseOutputTableColumn("Vol 1"), + RifEclipseOutputTableColumn("Len&Dep"), + RifEclipseOutputTableColumn("PresDrop"), + }; + formatter.header(header); + + formatter.add(wellPath->name()); + formatter.add(firstLocation.trueVerticalDepth); + formatter.add(firstLocation.measuredDepth); + formatter.add("1*"); + formatter.add("INC"); + formatter.add("H--"); + + formatter.rowCompleted(); + } + + { + std::vector header = { + RifEclipseOutputTableColumn("First Seg"), + RifEclipseOutputTableColumn("Last Seg"), + RifEclipseOutputTableColumn("Branch Num"), + RifEclipseOutputTableColumn("Outlet Seg"), + RifEclipseOutputTableColumn("Length"), + RifEclipseOutputTableColumn("Depth Change"), + RifEclipseOutputTableColumn("Diam"), + RifEclipseOutputTableColumn("Rough"), + }; + formatter.header(header); + } + + { + WellSegmentLocation previousLocation = firstLocation; + formatter.comment("Main stem"); + for (size_t i = 0; i < locations.size(); ++i) + { + const WellSegmentLocation& location = locations[i]; + + formatter.comment(QString("Segment for sub %1").arg(location.subIndex)); + formatter.add(location.segmentNumber).add(location.segmentNumber); + formatter.add(1); // All segments on main stem are branch 1 + formatter.add(location.segmentNumber - 1); // All main stem segments are connected to the segment below them + formatter.add(location.fishbonesSubs->locationOfSubs()[location.subIndex] - previousLocation.fishbonesSubs->locationOfSubs()[previousLocation.subIndex]); + formatter.add(location.trueVerticalDepth - previousLocation.trueVerticalDepth); + formatter.add(-1.0); // FIXME : Diam of main stem? + formatter.add(-1.0); // FIXME : Rough of main stem? + formatter.rowCompleted(); + + previousLocation = location; + } + } + + { + formatter.comment("Laterals"); + formatter.comment("Diam: MSW - Tubing Radius"); + formatter.comment("Rough: MSW - Open Hole Roughness Factor"); + for (const WellSegmentLocation& location : locations) + { + for (const WellSegmentLateral& lateral : location.laterals) + { + formatter.comment(QString("%1 : Sub index %2 - Lateral %3").arg(location.fishbonesSubs->name()).arg(location.subIndex).arg(lateral.lateralIndex)); + + for (const WellSegmentLateralIntersection& intersection : lateral.intersections) + { + formatter.add(intersection.segmentNumber); + formatter.add(intersection.segmentNumber); + formatter.add(lateral.branchNumber); + formatter.add(intersection.attachedSegmentNumber); + formatter.add(intersection.length); + formatter.add(intersection.depth); + formatter.add(location.fishbonesSubs->tubingRadius()); + formatter.add(location.fishbonesSubs->openHoleRoughnessFactor()); + formatter.rowCompleted(); + } + } + } + } + + formatter.tableCompleted(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicWellPathExportCompletionDataFeature::generateCompsegsTable(RifEclipseOutputTableFormatter& formatter, const RimWellPath* wellPath, const RimExportCompletionDataSettings& settings, const std::vector& locations) +{ + RigMainGrid* grid = settings.caseToApply->eclipseCaseData()->mainGrid(); + formatter.keyword("COMPSEGS"); + { + std::vector header = { + RifEclipseOutputTableColumn("Name") + }; + formatter.header(header); + formatter.add(wellPath->name()); + formatter.rowCompleted(); + } + + { + std::vector header = { + RifEclipseOutputTableColumn("I"), + RifEclipseOutputTableColumn("J"), + RifEclipseOutputTableColumn("K"), + RifEclipseOutputTableColumn("Branch no"), + RifEclipseOutputTableColumn("Start Length"), + RifEclipseOutputTableColumn("End Length"), + RifEclipseOutputTableColumn("Dir Pen"), + RifEclipseOutputTableColumn("End Range"), + RifEclipseOutputTableColumn("Connection Depth") + }; + formatter.header(header); + } + + for (const WellSegmentLocation& location : locations) + { + for (const WellSegmentLateral& lateral : location.laterals) + { + double length = 0; + for (const WellSegmentLateralIntersection& intersection : lateral.intersections) + { + length += intersection.length; + + if (settings.removeLateralsInMainBoreCells && intersection.mainBoreCell) continue; + + size_t i, j, k; + grid->ijkFromCellIndex(intersection.cellIndex, &i, &j, &k); + + formatter.addZeroBasedCellIndex(i).addZeroBasedCellIndex(j).addZeroBasedCellIndex(k); + formatter.add(lateral.branchNumber); + formatter.add(length); + formatter.add("1*"); + switch (intersection.direction) + { + case POS_I: + case NEG_I: + formatter.add("I"); + break; + case POS_J: + case NEG_J: + formatter.add("J"); + break; + case POS_K: + case NEG_K: + formatter.add("K"); + break; + } + formatter.add(-1); + formatter.rowCompleted(); + } + } + } + + formatter.tableCompleted(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RicWellPathExportCompletionDataFeature::findCloseCells(const RigEclipseCaseData* caseData, const cvf::BoundingBox& bb) +{ + std::vector closeCells; + caseData->mainGrid()->findIntersectingCells(bb, &closeCells); + return closeCells; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RicWellPathExportCompletionDataFeature::getCellIndexRange(const RigMainGrid* grid, const std::vector& cellIndices) +{ + // Retrieve I, J, K indices + std::vector eclipseCellIndices; + for (auto cellIndex : cellIndices) + { + size_t i, j, k; + if (!grid->ijkFromCellIndex(cellIndex, &i, &j, &k)) continue; + eclipseCellIndices.push_back(std::make_tuple(i, j, k)); + } + + // Group cell indices in K-ranges + std::sort(eclipseCellIndices.begin(), eclipseCellIndices.end(), RicWellPathExportCompletionDataFeature::cellOrdering); + std::vector eclipseCellRanges; + size_t lastI = std::numeric_limits::max(); + size_t lastJ = std::numeric_limits::max(); + size_t lastK = std::numeric_limits::max(); + size_t startK = std::numeric_limits::max(); + for (EclipseCellIndex cell : eclipseCellIndices) + { + size_t i, j, k; + std::tie(i, j, k) = cell; + if (i != lastI || j != lastJ || k != lastK + 1) + { + if (startK != std::numeric_limits::max()) + { + EclipseCellIndexRange cellRange = {lastI, lastJ, startK, lastK}; + eclipseCellRanges.push_back(cellRange); + } + lastI = i; + lastJ = j; + lastK = k; + startK = k; + } + else + { + lastK = k; + } + } + // Append last cell range + if (startK != std::numeric_limits::max()) + { + EclipseCellIndexRange cellRange = {lastI, lastJ, startK, lastK}; + eclipseCellRanges.push_back(cellRange); + } + return eclipseCellRanges; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicWellPathExportCompletionDataFeature::cellOrdering(const EclipseCellIndex& cell1, const EclipseCellIndex& cell2) +{ + size_t i1, i2, j1, j2, k1, k2; + std::tie(i1, j1, k1) = cell1; + std::tie(i2, j2, k2) = cell2; + if (i1 == i2) + { + if (j1 == j2) + { + return k1 < k2; + } + else + { + return j1 < j2; + } + } + else + { + return i1 < i2; + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +size_t RicWellPathExportCompletionDataFeature::findCellFromCoords(const RigEclipseCaseData* caseData, const cvf::Vec3d& coords) +{ + const std::vector& nodeCoords = caseData->mainGrid()->nodes(); + + cvf::BoundingBox bb; + bb.add(coords); + std::vector closeCells = findCloseCells(caseData, bb); + cvf::Vec3d hexCorners[8]; + + for (size_t closeCell : closeCells) + { + const RigCell& cell = caseData->mainGrid()->globalCellArray()[closeCell]; + if (cell.isInvalid()) continue; + + setHexCorners(cell, nodeCoords, hexCorners); + + if (RigHexIntersector::isPointInCell(coords, hexCorners, closeCell)) + { + return closeCell; + } + } + + // Coordinate is outside any cells? + CVF_ASSERT(false); + return 0; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RicWellPathExportCompletionDataFeature::findIntersectingCells(const RigEclipseCaseData* caseData, const std::vector& coords) +{ + const std::vector& nodeCoords = caseData->mainGrid()->nodes(); + std::set cells; + + // Find starting cell + if (coords.size() > 0) + { + size_t startCell = findCellFromCoords(caseData, coords[0]); + if (startCell > 0) + { + cells.insert(startCell); + } + } + + std::vector intersections = findIntersections(caseData, coords); + for (auto intersection : intersections) + { + cells.insert(intersection.m_hexIndex); + } + + // Ensure only unique cells are included + std::vector cellsVector; + cellsVector.assign(cells.begin(), cells.end()); + // Sort cells + std::sort(cellsVector.begin(), cellsVector.end()); + return cellsVector; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RicWellPathExportCompletionDataFeature::findIntersections(const RigEclipseCaseData* caseData, const std::vector& coords) +{ + const std::vector& nodeCoords = caseData->mainGrid()->nodes(); + std::vector intersections; + for (size_t i = 0; i < coords.size() - 1; ++i) + { + cvf::BoundingBox bb; + bb.add(coords[i]); + bb.add(coords[i + 1]); + + std::vector closeCells = findCloseCells(caseData, bb); + + cvf::Vec3d hexCorners[8]; + + for (size_t closeCell : closeCells) + { + const RigCell& cell = caseData->mainGrid()->globalCellArray()[closeCell]; + if (cell.isInvalid()) continue; + + setHexCorners(cell, nodeCoords, hexCorners); + + RigHexIntersector::lineHexCellIntersection(coords[i], coords[i + 1], hexCorners, closeCell, &intersections); + } + } + + return intersections; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicWellPathExportCompletionDataFeature::setHexCorners(const RigCell& cell, const std::vector& nodeCoords, cvf::Vec3d* hexCorners) +{ + const caf::SizeTArray8& cornerIndices = cell.cornerIndices(); + + hexCorners[0] = nodeCoords[cornerIndices[0]]; + hexCorners[1] = nodeCoords[cornerIndices[1]]; + hexCorners[2] = nodeCoords[cornerIndices[2]]; + hexCorners[3] = nodeCoords[cornerIndices[3]]; + hexCorners[4] = nodeCoords[cornerIndices[4]]; + hexCorners[5] = nodeCoords[cornerIndices[5]]; + hexCorners[6] = nodeCoords[cornerIndices[6]]; + hexCorners[7] = nodeCoords[cornerIndices[7]]; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicWellPathExportCompletionDataFeature::markWellPathCells(const std::vector& wellPathCells, std::vector* locations) +{ + std::set wellPathCellSet(wellPathCells.begin(), wellPathCells.end()); + for (WellSegmentLocation& location : *locations) + { + for (WellSegmentLateral& lateral : location.laterals) + { + for (WellSegmentLateralIntersection& intersection : lateral.intersections) + { + if (wellPathCellSet.find(intersection.cellIndex) != wellPathCellSet.end()) + { + intersection.mainBoreCell = true; + } + } + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::map RicWellPathExportCompletionDataFeature::computeLateralsPerCell(const std::vector& segmentLocations, bool removeMainBoreCells) +{ + std::map lateralsPerCell; + for (const WellSegmentLocation& location : segmentLocations) + { + for (const WellSegmentLateral& lateral : location.laterals) + { + for (const WellSegmentLateralIntersection& intersection : lateral.intersections) + { + if (removeMainBoreCells && intersection.mainBoreCell) continue; + + auto match = lateralsPerCell.find(intersection.cellIndex); + if (match == lateralsPerCell.end()) + { + lateralsPerCell[intersection.cellIndex] = 1; + } + else + { + lateralsPerCell[intersection.cellIndex] = match->second + 1; + } + } + } + } + return lateralsPerCell; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicWellPathExportCompletionDataFeature::wellSegmentLocationOrdering(const WellSegmentLocation& first, const WellSegmentLocation& second) +{ + return first.measuredDepth < second.measuredDepth; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicWellPathExportCompletionDataFeature::isPointBetween(const cvf::Vec3d& pointA, const cvf::Vec3d& pointB, const cvf::Vec3d& needle) +{ + cvf::Plane plane; + plane.setFromPointAndNormal(needle, pointB - pointA); + return plane.side(pointA) != plane.side(pointB); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicWellPathExportCompletionDataFeature::filterIntersections(std::vector* intersections) +{ + // Erase intersections that are marked as entering + for (auto it = intersections->begin(); it != intersections->end();) + { + if (it->m_isIntersectionEntering) + { + it = intersections->erase(it); + } + else + { + ++it; + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RicWellPathExportCompletionDataFeature::findWellSegmentLocations(const RimEclipseCase* caseToApply, RimWellPath* wellPath) +{ + std::vector wellSegmentLocations; + for (RimFishbonesMultipleSubs* subs : wellPath->fishbonesCollection()->fishbonesSubs()) + { + for (size_t subIndex = 0; subIndex < subs->locationOfSubs().size(); ++subIndex) + { + double measuredDepth = subs->locationOfSubs()[subIndex]; + cvf::Vec3d position = wellPath->wellPathGeometry()->interpolatedPointAlongWellPath(measuredDepth); + WellSegmentLocation location = WellSegmentLocation(subs, measuredDepth, -position.z(), subIndex); + for (size_t lateralIndex = 0; lateralIndex < subs->lateralLengths().size(); ++lateralIndex) + { + location.laterals.push_back(WellSegmentLateral(lateralIndex)); + } + wellSegmentLocations.push_back(location); + } + } + std::sort(wellSegmentLocations.begin(), wellSegmentLocations.end(), wellSegmentLocationOrdering); + + assignBranchAndSegmentNumbers(caseToApply, &wellSegmentLocations); + + return wellSegmentLocations; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicWellPathExportCompletionDataFeature::calculateLateralIntersections(const RimEclipseCase* caseToApply, WellSegmentLocation* location, int* branchNum, int* segmentNum) +{ + for (WellSegmentLateral& lateral : location->laterals) + { + lateral.branchNumber = ++(*branchNum); + std::vector coords = location->fishbonesSubs->coordsForLateral(location->subIndex, lateral.lateralIndex); + std::vector intersections = findIntersections(caseToApply->eclipseCaseData(), coords); + filterIntersections(&intersections); + + const HexIntersectionInfo* prevIntersection = nullptr; + + { + double length = 0; + double depth = 0; + cvf::Vec3d startPoint = coords[0]; + auto intersection = intersections.cbegin(); + int attachedSegmentNumber = location->segmentNumber; + + for (size_t i = 1; i < coords.size() && intersection != intersections.cend(); i++) + { + if (isPointBetween(startPoint, coords[i], intersection->m_intersectionPoint)) + { + cvf::Vec3d between = intersection->m_intersectionPoint - startPoint; + length += between.length(); + depth += intersection->m_intersectionPoint.z() - startPoint.z(); + + // Find the direction of the previous cell + if (prevIntersection != nullptr) + { + std::pair direction = calculateDirectionAndDistanceInCell(caseToApply->eclipseCaseData()->mainGrid(), prevIntersection->m_hexIndex, prevIntersection->m_intersectionPoint, intersection->m_intersectionPoint); + WellSegmentLateralIntersection& lateralIntersection = lateral.intersections[lateral.intersections.size() - 1]; + lateralIntersection.direction = direction.first; + lateralIntersection.directionLength = direction.second; + } + + lateral.intersections.push_back(WellSegmentLateralIntersection(++(*segmentNum), attachedSegmentNumber, intersection->m_hexIndex, length, depth)); + + length = 0; + depth = 0; + startPoint = intersection->m_intersectionPoint; + attachedSegmentNumber = *segmentNum; + ++intersection; + prevIntersection = &*intersection; + } + else + { + const cvf::Vec3d between = coords[i] - startPoint; + length += between.length(); + depth += coords[i].z() - startPoint.z(); + startPoint = coords[i]; + } + } + } + + // Find the direction of the last cell + if (prevIntersection != nullptr && !coords.empty()) + { + std::pair direction = calculateDirectionAndDistanceInCell(caseToApply->eclipseCaseData()->mainGrid(), prevIntersection->m_hexIndex, prevIntersection->m_intersectionPoint, coords[coords.size()-1]); + WellSegmentLateralIntersection& lateralIntersection = lateral.intersections[lateral.intersections.size() - 1]; + lateralIntersection.direction = direction.first; + lateralIntersection.directionLength = direction.second; + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicWellPathExportCompletionDataFeature::assignBranchAndSegmentNumbers(const RimEclipseCase* caseToApply, std::vector* locations) +{ + int segmentNumber = 1; + int branchNumber = 1; + // First loop over the locations so that each segment on the main stem is an incremental number + for (WellSegmentLocation& location : *locations) + { + location.segmentNumber = ++segmentNumber; + } + // Then assign branch and segment numbers to each lateral parts + for (WellSegmentLocation& location : *locations) + { + calculateLateralIntersections(caseToApply, &location, &branchNumber, &segmentNumber); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicWellPathExportCompletionDataFeature::calculateCellMainAxisDirections(const RigMainGrid* grid, size_t cellIndex, cvf::Vec3d* iAxisDirection, cvf::Vec3d* jAxisDirection, cvf::Vec3d* kAxisDirection) +{ + const std::vector& nodeCoords = grid->nodes(); + cvf::Vec3d hexCorners[8]; + const RigCell& cell = grid->globalCellArray()[cellIndex]; + setHexCorners(cell, nodeCoords, hexCorners); + + *iAxisDirection = calculateCellMainAxisDirection(hexCorners, cvf::StructGridInterface::FaceType::NEG_I, cvf::StructGridInterface::POS_I); + *jAxisDirection = calculateCellMainAxisDirection(hexCorners, cvf::StructGridInterface::FaceType::NEG_J, cvf::StructGridInterface::POS_J); + *kAxisDirection = calculateCellMainAxisDirection(hexCorners, cvf::StructGridInterface::FaceType::NEG_K, cvf::StructGridInterface::POS_K); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +cvf::Vec3d RicWellPathExportCompletionDataFeature::calculateCellMainAxisDirection(const cvf::Vec3d* hexCorners, cvf::StructGridInterface::FaceType startFace, cvf::StructGridInterface::FaceType endFace) +{ + cvf::ubyte faceVertexIndices[4]; + + cvf::StructGridInterface::cellFaceVertexIndices(startFace, faceVertexIndices); + + cvf::Vec3d startFaceCenter = cvf::GeometryTools::computeFaceCenter(hexCorners[faceVertexIndices[0]], hexCorners[faceVertexIndices[1]], hexCorners[faceVertexIndices[2]], hexCorners[faceVertexIndices[3]]); + + cvf::StructGridInterface::cellFaceVertexIndices(endFace, faceVertexIndices); + + cvf::Vec3d endFaceCenter = cvf::GeometryTools::computeFaceCenter(hexCorners[faceVertexIndices[0]], hexCorners[faceVertexIndices[1]], hexCorners[faceVertexIndices[2]], hexCorners[faceVertexIndices[3]]); + + return endFaceCenter - startFaceCenter; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::pair RicWellPathExportCompletionDataFeature::calculateDirectionAndDistanceInCell(const RigMainGrid* grid, size_t cellIndex, const cvf::Vec3d& startPoint, const cvf::Vec3d& endPoint) +{ + cvf::Vec3d vec = endPoint - startPoint; + + cvf::Vec3d iAxisDirection; + cvf::Vec3d jAxisDirection; + cvf::Vec3d kAxisDirection; + calculateCellMainAxisDirections(grid, cellIndex, &iAxisDirection, &jAxisDirection, &kAxisDirection); + + double iLength = iAxisDirection.dot(vec); + double jLength = jAxisDirection.dot(vec); + double kLength = kAxisDirection.dot(vec); + + double iNormalizedLength = abs(iLength / iAxisDirection.length()); + double jNormalizedLength = abs(jLength / jAxisDirection.length()); + double kNormalizedLength = abs(kLength / kAxisDirection.length()); + + if (iNormalizedLength > jNormalizedLength && iNormalizedLength > kNormalizedLength) + { + WellSegmentCellDirection direction = POS_I; + if (iLength < 0) + { + direction = NEG_I; + } + return std::make_pair(direction, iLength); + } + else if (jNormalizedLength > iNormalizedLength && jNormalizedLength > kNormalizedLength) + { + WellSegmentCellDirection direction = POS_J; + if (jLength < 0) + { + direction = NEG_J; + } + return std::make_pair(direction, jLength); + } + else + { + WellSegmentCellDirection direction = POS_K; + if (kLength < 0) + { + direction = NEG_K; + } + return std::make_pair(direction, kLength); + } +} diff --git a/ApplicationCode/Commands/WellPathCommands/RicWellPathExportCompletionDataFeature.h b/ApplicationCode/Commands/WellPathCommands/RicWellPathExportCompletionDataFeature.h new file mode 100644 index 0000000000..844e053453 --- /dev/null +++ b/ApplicationCode/Commands/WellPathCommands/RicWellPathExportCompletionDataFeature.h @@ -0,0 +1,166 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RifEclipseOutputTableFormatter.h" + +#include "RigWellLogExtractionTools.h" + +#include "RimExportCompletionDataSettings.h" + +#include "cafCmdFeature.h" + +#include "cvfBoundingBox.h" + + +class RimWellPath; +class RimEclipseCase; +class RigEclipseCaseData; +class RigMainGrid; +class RigCell; +class RimFishbonesMultipleSubs; + +//================================================================================================== +/// +//================================================================================================== +enum WellSegmentCellDirection { + POS_I, + NEG_I, + POS_J, + NEG_J, + POS_K, + NEG_K +}; + +//================================================================================================== +/// +//================================================================================================== +struct WellSegmentLateralIntersection { + WellSegmentLateralIntersection(int segmentNumber, int attachedSegmentNumber, size_t cellIndex, double length, double depth) + : segmentNumber(segmentNumber), + attachedSegmentNumber(attachedSegmentNumber), + cellIndex(cellIndex), + length(length), + depth(depth), + direction(POS_I), + directionLength(-1.0), + mainBoreCell(false) + {} + + int segmentNumber; + int attachedSegmentNumber; + size_t cellIndex; + bool mainBoreCell; + double length; + double depth; + WellSegmentCellDirection direction; + double directionLength; +}; + +//================================================================================================== +/// +//================================================================================================== +struct WellSegmentLateral { + WellSegmentLateral(size_t lateralIndex) : lateralIndex(lateralIndex) {} + + size_t lateralIndex; + int branchNumber; + std::vector intersections; +}; + +//================================================================================================== +/// +//================================================================================================== +struct WellSegmentLocation { + WellSegmentLocation(const RimFishbonesMultipleSubs* subs, double measuredDepth, double trueVerticalDepth, size_t subIndex, int segmentNumber = -1) + : fishbonesSubs(subs), + measuredDepth(measuredDepth), + trueVerticalDepth(trueVerticalDepth), + subIndex(subIndex), + segmentNumber(segmentNumber) + { + } + + const RimFishbonesMultipleSubs* fishbonesSubs; + double measuredDepth; + double trueVerticalDepth; + size_t subIndex; + int segmentNumber; + std::vector laterals; +}; + +//================================================================================================== +/// +//================================================================================================== +struct EclipseCellIndexRange { + size_t i; + size_t j; + size_t k1; + size_t k2; +}; + +//================================================================================================== +/// +//================================================================================================== +typedef std::tuple EclipseCellIndex; + +//================================================================================================== +/// +//================================================================================================== +class RicWellPathExportCompletionDataFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; +protected: + + // Overrides + virtual bool isCommandEnabled() override; + virtual void onActionTriggered(bool isChecked) override; + virtual void setupActionLook(QAction* actionToSetup) override; + +private: + static void exportToFolder(RimWellPath* wellPath, const RimExportCompletionDataSettings& exportSettings); + + static void generateCompdatTable(RifEclipseOutputTableFormatter& formatter, const RimWellPath* wellPath, const RimExportCompletionDataSettings& settings, const std::vector& locations); + static void generateWpimultTable(RifEclipseOutputTableFormatter& formatter, const RimWellPath* wellPath, const RimExportCompletionDataSettings& settings, const std::map& lateralsPerCell); + static void generateWelsegsTable(RifEclipseOutputTableFormatter& formatter, const RimWellPath* wellPath, const RimExportCompletionDataSettings& settings, const std::vector& locations); + static void generateCompsegsTable(RifEclipseOutputTableFormatter& formatter, const RimWellPath* wellPath, const RimExportCompletionDataSettings& settings, const std::vector& locations); + + static std::map computeLateralsPerCell(const std::vector& segmentLocations, bool removeMainBoreCells); + + static std::vector findCloseCells(const RigEclipseCaseData* caseData, const cvf::BoundingBox& bb); + static size_t findCellFromCoords(const RigEclipseCaseData* caseData, const cvf::Vec3d& coords); + + static std::vector getCellIndexRange(const RigMainGrid* grid, const std::vector& cellIndices); + static bool cellOrdering(const EclipseCellIndex& cell1, const EclipseCellIndex& cell2); + static std::vector findIntersectingCells(const RigEclipseCaseData* grid, const std::vector& coords); + static void setHexCorners(const RigCell& cell, const std::vector& nodeCoords, cvf::Vec3d* hexCorners); + static void markWellPathCells(const std::vector& wellPathCells, std::vector* locations); + static bool wellSegmentLocationOrdering(const WellSegmentLocation& first, const WellSegmentLocation& second); + static std::vector findIntersections(const RigEclipseCaseData* caseData, const std::vector& coords); + static bool isPointBetween(const cvf::Vec3d& pointA, const cvf::Vec3d& pointB, const cvf::Vec3d& needle); + static void filterIntersections(std::vector* intersections); + static std::vector findWellSegmentLocations(const RimEclipseCase* caseToApply, RimWellPath* wellPath); + static void calculateLateralIntersections(const RimEclipseCase* caseToApply, WellSegmentLocation* location, int* branchNum, int* segmentNum); + static void assignBranchAndSegmentNumbers(const RimEclipseCase* caseToApply, std::vector* locations); + + // Calculate direction + static void calculateCellMainAxisDirections(const RigMainGrid* grid, size_t cellIndex, cvf::Vec3d* iAxisDirection, cvf::Vec3d* jAxisDirection, cvf::Vec3d* kAxisDirection); + static cvf::Vec3d calculateCellMainAxisDirection(const cvf::Vec3d* hexCorners, cvf::StructGridInterface::FaceType startFace, cvf::StructGridInterface::FaceType endFace); + static std::pair calculateDirectionAndDistanceInCell(const RigMainGrid* grid, size_t cellIndex, const cvf::Vec3d& startPoint, const cvf::Vec3d& endPoint); +}; diff --git a/ApplicationCode/Commands/WellPathCommands/RicWellPathImportCompletionsFileFeature.cpp b/ApplicationCode/Commands/WellPathCommands/RicWellPathImportCompletionsFileFeature.cpp new file mode 100644 index 0000000000..3d11812a51 --- /dev/null +++ b/ApplicationCode/Commands/WellPathCommands/RicWellPathImportCompletionsFileFeature.cpp @@ -0,0 +1,103 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicWellPathImportCompletionsFileFeature.h" + +#include "RiaApplication.h" + +#include "RimFishboneWellPathCollection.h" +#include "RimFishbonesCollection.h" +#include "RimProject.h" +#include "RimWellPath.h" +#include "RimWellPathCompletions.h" + +#include "RiuMainWindow.h" + +#include "cafSelectionManager.h" + +#include +#include + +CAF_CMD_SOURCE_INIT(RicWellPathImportCompletionsFileFeature, "RicWellPathImportCompletionsFileFeature"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicWellPathImportCompletionsFileFeature::isCommandEnabled() +{ + if (RicWellPathImportCompletionsFileFeature::selectedWellPathCollection() != nullptr) + { + return true; + } + + return false; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicWellPathImportCompletionsFileFeature::onActionTriggered(bool isChecked) +{ + RimFishboneWellPathCollection* wellPathCollection = RicWellPathImportCompletionsFileFeature::selectedWellPathCollection(); + CVF_ASSERT(wellPathCollection); + + // Open dialog box to select well path files + RiaApplication* app = RiaApplication::instance(); + QString defaultDir = app->lastUsedDialogDirectory("WELLPATH_DIR"); + QStringList wellPathFilePaths = QFileDialog::getOpenFileNames(RiuMainWindow::instance(), "Import Well Path Completions", defaultDir, "Well Path Completions (*.json *.asc *.asci *.ascii *.dev);;All Files (*.*)"); + + if (wellPathFilePaths.size() < 1) return; + + // Remember the path to next time + app->setLastUsedDialogDirectory("WELLPATH_DIR", QFileInfo(wellPathFilePaths.last()).absolutePath()); + + wellPathCollection->importCompletionsFromFile(wellPathFilePaths); + + if (app->project()) + { + app->project()->createDisplayModelAndRedrawAllViews(); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicWellPathImportCompletionsFileFeature::setupActionLook(QAction* actionToSetup) +{ + actionToSetup->setText("Import Completions from File"); + actionToSetup->setIcon(QIcon(":/Well.png")); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimFishboneWellPathCollection* RicWellPathImportCompletionsFileFeature::selectedWellPathCollection() +{ + std::vector objects; + caf::SelectionManager::instance()->objectsByType(&objects); + + if (objects.size() > 0) + { + RimFishboneWellPathCollection* fbWellColl = nullptr; + objects[0]->firstAncestorOrThisOfType(fbWellColl); + + return fbWellColl; + } + + return nullptr; +} diff --git a/ApplicationCode/Commands/WellPathCommands/RicWellPathImportCompletionsFileFeature.h b/ApplicationCode/Commands/WellPathCommands/RicWellPathImportCompletionsFileFeature.h new file mode 100644 index 0000000000..cc98eed860 --- /dev/null +++ b/ApplicationCode/Commands/WellPathCommands/RicWellPathImportCompletionsFileFeature.h @@ -0,0 +1,41 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +class RimFishboneWellPathCollection; + +//================================================================================================== +/// +//================================================================================================== +class RicWellPathImportCompletionsFileFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; +protected: + + // Overrides + virtual bool isCommandEnabled() override; + virtual void onActionTriggered( bool isChecked ) override; + virtual void setupActionLook( QAction* actionToSetup ) override; + +private: + static RimFishboneWellPathCollection* selectedWellPathCollection(); +}; + diff --git a/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportFileFeature.cpp b/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportFileFeature.cpp index f94a3c0a4d..fc313108fd 100644 --- a/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportFileFeature.cpp +++ b/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportFileFeature.cpp @@ -26,9 +26,7 @@ #include #include -namespace caf -{ - CAF_CMD_SOURCE_INIT(RicWellPathsImportFileFeature, "RicWellPathsImportFileFeature"); +CAF_CMD_SOURCE_INIT(RicWellPathsImportFileFeature, "RicWellPathsImportFileFeature"); //-------------------------------------------------------------------------------------------------- @@ -69,5 +67,3 @@ void RicWellPathsImportFileFeature::setupActionLook(QAction* actionToSetup) actionToSetup->setText("Import &Well Paths from File"); actionToSetup->setIcon(QIcon(":/Well.png")); } - -} // end namespace caf diff --git a/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportFileFeature.h b/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportFileFeature.h index 40bf0afa2f..08d3650e0d 100644 --- a/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportFileFeature.h +++ b/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportFileFeature.h @@ -21,23 +21,16 @@ #include "cafCmdFeature.h" -namespace caf -{ - //================================================================================================== /// //================================================================================================== -class RicWellPathsImportFileFeature : public CmdFeature +class RicWellPathsImportFileFeature : public caf::CmdFeature { CAF_CMD_HEADER_INIT; protected: // Overrides - virtual bool isCommandEnabled(); - virtual void onActionTriggered( bool isChecked ); - virtual void setupActionLook( QAction* actionToSetup ); + virtual bool isCommandEnabled() override; + virtual void onActionTriggered( bool isChecked ) override; + virtual void setupActionLook( QAction* actionToSetup ) override; }; - - - -} // end namespace caf diff --git a/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportSsihubFeature.cpp b/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportSsihubFeature.cpp index b30c57449b..f33403840b 100644 --- a/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportSsihubFeature.cpp +++ b/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportSsihubFeature.cpp @@ -27,13 +27,13 @@ #include "RiuMainWindow.h" #include "RiuWellImportWizard.h" +#include "cafUtils.h" + #include #include #include -namespace caf -{ - CAF_CMD_SOURCE_INIT(RicWellPathsImportSsihubFeature, "RicWellPathsImportSsihubFeature"); +CAF_CMD_SOURCE_INIT(RicWellPathsImportSsihubFeature, "RicWellPathsImportSsihubFeature"); //-------------------------------------------------------------------------------------------------- @@ -47,7 +47,7 @@ bool RicWellPathsImportSsihubFeature::isCommandEnabled() return false; } - if (!QFile::exists(app->project()->fileName())) + if (!caf::Utils::fileExists(app->project()->fileName())) { return false; } @@ -66,7 +66,7 @@ void RicWellPathsImportSsihubFeature::onActionTriggered(bool isChecked) return; } - if (!QFile::exists(app->project()->fileName())) + if (!caf::Utils::fileExists(app->project()->fileName())) { return; } @@ -123,5 +123,3 @@ void RicWellPathsImportSsihubFeature::setupActionLook(QAction* actionToSetup) actionToSetup->setText("Import Well Paths from &SSI-hub"); actionToSetup->setIcon(QIcon(":/WellCollection.png")); } - -} // end namespace caf diff --git a/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportSsihubFeature.h b/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportSsihubFeature.h index 46bfc99c33..ae107e2571 100644 --- a/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportSsihubFeature.h +++ b/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportSsihubFeature.h @@ -21,23 +21,16 @@ #include "cafCmdFeature.h" -namespace caf -{ - //================================================================================================== /// //================================================================================================== -class RicWellPathsImportSsihubFeature : public CmdFeature +class RicWellPathsImportSsihubFeature : public caf::CmdFeature { CAF_CMD_HEADER_INIT; protected: // Overrides - virtual bool isCommandEnabled(); - virtual void onActionTriggered( bool isChecked ); - virtual void setupActionLook( QAction* actionToSetup ); + virtual bool isCommandEnabled() override; + virtual void onActionTriggered( bool isChecked ) override; + virtual void setupActionLook( QAction* actionToSetup ) override; }; - - - -} // end namespace caf diff --git a/ApplicationCode/FileInterface/CMakeLists_files.cmake b/ApplicationCode/FileInterface/CMakeLists_files.cmake index 2c47d6ea42..6ca05c7f1f 100644 --- a/ApplicationCode/FileInterface/CMakeLists_files.cmake +++ b/ApplicationCode/FileInterface/CMakeLists_files.cmake @@ -7,6 +7,7 @@ endif() set (SOURCE_GROUP_HEADER_FILES ${CEE_CURRENT_LIST_DIR}RifEclipseInputFileTools.h ${CEE_CURRENT_LIST_DIR}RifEclipseOutputFileTools.h +${CEE_CURRENT_LIST_DIR}RifEclipseOutputTableFormatter.h ${CEE_CURRENT_LIST_DIR}RifEclipseRestartDataAccess.h ${CEE_CURRENT_LIST_DIR}RifEclipseRestartFilesetAccess.h ${CEE_CURRENT_LIST_DIR}RifEclipseSummaryTools.h @@ -19,6 +20,7 @@ ${CEE_CURRENT_LIST_DIR}RifReaderInterface.h ${CEE_CURRENT_LIST_DIR}RifReaderMockModel.h ${CEE_CURRENT_LIST_DIR}RifReaderSettings.h ${CEE_CURRENT_LIST_DIR}RifEclipseSummaryAddress.h +${CEE_CURRENT_LIST_DIR}RifWellPathImporter.h ${CEE_CURRENT_LIST_DIR}RifEclipseWellCompletionExporter.h ${CEE_CURRENT_LIST_DIR}RifFractureExportTools.h ) @@ -26,6 +28,7 @@ ${CEE_CURRENT_LIST_DIR}RifFractureExportTools.h set (SOURCE_GROUP_SOURCE_FILES ${CEE_CURRENT_LIST_DIR}RifEclipseInputFileTools.cpp ${CEE_CURRENT_LIST_DIR}RifEclipseOutputFileTools.cpp +${CEE_CURRENT_LIST_DIR}RifEclipseOutputTableFormatter.cpp ${CEE_CURRENT_LIST_DIR}RifEclipseRestartDataAccess.cpp ${CEE_CURRENT_LIST_DIR}RifEclipseRestartFilesetAccess.cpp ${CEE_CURRENT_LIST_DIR}RifEclipseUnifiedRestartFileAccess.cpp @@ -38,6 +41,7 @@ ${CEE_CURRENT_LIST_DIR}RifReaderInterface.cpp ${CEE_CURRENT_LIST_DIR}RifReaderMockModel.cpp ${CEE_CURRENT_LIST_DIR}RifReaderSettings.cpp ${CEE_CURRENT_LIST_DIR}RifEclipseSummaryAddress.cpp +${CEE_CURRENT_LIST_DIR}RifWellPathImporter.cpp ${CEE_CURRENT_LIST_DIR}RifEclipseWellCompletionExporter.cpp ${CEE_CURRENT_LIST_DIR}RifFractureExportTools.cpp ) diff --git a/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp b/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp index d4f9478a67..da057819d2 100644 --- a/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp +++ b/ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp @@ -121,22 +121,22 @@ bool RifEclipseInputFileTools::openGridFile(const QString& fileName, RigEclipseC bool allKwReadOk = true; fseek(gridFilePointer, specgridPos, SEEK_SET); - allKwReadOk = allKwReadOk && NULL != (specGridKw = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false , ECL_INT_TYPE)); + allKwReadOk = allKwReadOk && NULL != (specGridKw = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false , ecl_type_create_from_type(ECL_INT_TYPE))); progress.setProgress(1); fseek(gridFilePointer, zcornPos, SEEK_SET); - allKwReadOk = allKwReadOk && NULL != (zCornKw = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false , ECL_FLOAT_TYPE)); + allKwReadOk = allKwReadOk && NULL != (zCornKw = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false , ecl_type_create_from_type(ECL_FLOAT_TYPE))); progress.setProgress(2); fseek(gridFilePointer, coordPos, SEEK_SET); - allKwReadOk = allKwReadOk && NULL != (coordKw = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false , ECL_FLOAT_TYPE)); + allKwReadOk = allKwReadOk && NULL != (coordKw = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false , ecl_type_create_from_type(ECL_FLOAT_TYPE))); progress.setProgress(3); // If ACTNUM is not defined, this pointer will be NULL, which is a valid condition if (actnumPos >= 0) { fseek(gridFilePointer, actnumPos, SEEK_SET); - allKwReadOk = allKwReadOk && NULL != (actNumKw = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false , ECL_INT_TYPE)); + allKwReadOk = allKwReadOk && NULL != (actNumKw = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false , ecl_type_create_from_type(ECL_INT_TYPE))); progress.setProgress(4); } @@ -144,7 +144,7 @@ bool RifEclipseInputFileTools::openGridFile(const QString& fileName, RigEclipseC if (mapaxesPos >= 0) { fseek(gridFilePointer, mapaxesPos, SEEK_SET); - mapAxesKw = ecl_kw_fscanf_alloc_current_grdecl__( gridFilePointer, false , ECL_FLOAT_TYPE); + mapAxesKw = ecl_kw_fscanf_alloc_current_grdecl__( gridFilePointer, false , ecl_type_create_from_type(ECL_FLOAT_TYPE)); } if (!allKwReadOk) @@ -228,7 +228,7 @@ std::map RifEclipseInputFileTools::readProperties(const QStrin fseek(gridFilePointer, fileKeywords[i].filePos, SEEK_SET); - ecl_kw_type* eclipseKeywordData = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false, ECL_FLOAT_TYPE); + ecl_kw_type* eclipseKeywordData = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false, ecl_type_create_from_type(ECL_FLOAT_TYPE)); if (eclipseKeywordData) { QString newResultName = caseData->results(RifReaderInterface::MATRIX_RESULTS)->makeResultNameUnique(fileKeywords[i].keyword); @@ -261,7 +261,7 @@ bool RifEclipseInputFileTools::readProperty(const QString& fileName, RigEclipseC FILE* filePointer = util_fopen(fileName.toLatin1().data(), "r"); if (!filePointer) return false; - ecl_kw_type* eclipseKeywordData = ecl_kw_fscanf_alloc_grdecl_dynamic__(filePointer, eclipseKeyWord.toLatin1().data(), false, ECL_FLOAT_TYPE); + ecl_kw_type* eclipseKeywordData = ecl_kw_fscanf_alloc_grdecl_dynamic__(filePointer, eclipseKeyWord.toLatin1().data(), false, ecl_type_create_from_type(ECL_FLOAT_TYPE)); bool isOk = false; if (eclipseKeywordData) { @@ -474,18 +474,17 @@ bool RifEclipseInputFileTools::writePropertyToTextFile(const QString& fileName, /// Create and write a result vector with values for all cells. /// undefinedValue is used for cells with no result //-------------------------------------------------------------------------------------------------- -bool RifEclipseInputFileTools::writeBinaryResultToTextFile(const QString& fileName, - RigEclipseCaseData* eclipseCase, - RifReaderInterface::PorosityModelResultType porosityModel, - size_t timeStep, - const QString& resultName, - const QString& eclipseKeyWord, +bool RifEclipseInputFileTools::writeBinaryResultToTextFile(const QString& fileName, + RigEclipseCaseData* eclipseCase, + size_t timeStep, + RimEclipseResultDefinition* resultDefinition, + const QString& eclipseKeyWord, const double undefinedValue) { CVF_ASSERT(eclipseCase); - size_t resultIndex = eclipseCase->results(porosityModel)->findScalarResultIndex(resultName); - if (resultIndex == cvf::UNDEFINED_SIZE_T) + cvf::ref resultAccessor = RigResultAccessorFactory::createFromResultDefinition(eclipseCase, eclipseCase->mainGrid()->gridIndex(), timeStep, resultDefinition); + if (resultAccessor.isNull()) { return false; } @@ -496,12 +495,6 @@ bool RifEclipseInputFileTools::writeBinaryResultToTextFile(const QString& fileNa return false; } - cvf::ref resultAccessor = RigResultAccessorFactory::createFromUiResultName(eclipseCase, eclipseCase->mainGrid()->gridIndex(), porosityModel, timeStep, resultName); - if (resultAccessor.isNull()) - { - return false; - } - std::vector resultData; size_t i, j, k; for (k = 0; k < eclipseCase->mainGrid()->cellCountK(); k++) diff --git a/ApplicationCode/FileInterface/RifEclipseInputFileTools.h b/ApplicationCode/FileInterface/RifEclipseInputFileTools.h index 6e14274bc8..f1172c08b6 100644 --- a/ApplicationCode/FileInterface/RifEclipseInputFileTools.h +++ b/ApplicationCode/FileInterface/RifEclipseInputFileTools.h @@ -36,6 +36,7 @@ class RigEclipseCaseData; class QFile; +class RimEclipseResultDefinition; //-------------------------------------------------------------------------------------------------- @@ -76,7 +77,7 @@ public: static bool writePropertyToTextFile(const QString& fileName, RigEclipseCaseData* eclipseCase, size_t timeStep, const QString& resultName, const QString& eclipseKeyWord); - static bool writeBinaryResultToTextFile(const QString& fileName, RigEclipseCaseData* eclipseCase, RifReaderInterface::PorosityModelResultType porosityModel, size_t timeStep, const QString& resultName, const QString& eclipseKeyWord, const double undefinedValue); + static bool writeBinaryResultToTextFile(const QString& fileName, RigEclipseCaseData* eclipseCase, size_t timeStep, RimEclipseResultDefinition* resultdefinition, const QString& eclipseKeyWord, const double undefinedValue); static bool readFaultsAndParseIncludeStatementsRecursively( QFile& file, qint64 startPos, diff --git a/ApplicationCode/FileInterface/RifEclipseOutputFileTools.cpp b/ApplicationCode/FileInterface/RifEclipseOutputFileTools.cpp index 4df896c398..d2dab4a787 100644 --- a/ApplicationCode/FileInterface/RifEclipseOutputFileTools.cpp +++ b/ApplicationCode/FileInterface/RifEclipseOutputFileTools.cpp @@ -115,7 +115,7 @@ void getDayMonthYear(const ecl_kw_type* intehead_kw, int* day, int* month, int* //-------------------------------------------------------------------------------------------------- /// Get list of time step texts (dates) //-------------------------------------------------------------------------------------------------- -void RifEclipseOutputFileTools::timeSteps(ecl_file_type* ecl_file, std::vector* timeSteps) +void RifEclipseOutputFileTools::timeSteps(ecl_file_type* ecl_file, std::vector* timeSteps, std::vector* daysSinceSimulationStart) { if (!ecl_file) return; @@ -127,7 +127,7 @@ void RifEclipseOutputFileTools::timeSteps(ecl_file_type* ecl_file, std::vector dayFractions(numINTEHEAD, 0.0); // Init fraction to zero + std::vector dayValues(numINTEHEAD, 0.0); // Init fraction to zero // Read out fraction of day if number of keywords are identical if (numINTEHEAD == numDOUBHEAD) @@ -137,12 +137,7 @@ void RifEclipseOutputFileTools::timeSteps(ecl_file_type* ecl_file, std::vector(dayFraction * 24.0 * 60.0 * 60.0 * 1000.0); int seconds = milliseconds % 1000; milliseconds -= seconds * 1000; @@ -172,6 +168,7 @@ void RifEclipseOutputFileTools::timeSteps(ecl_file_type* ecl_file, std::vectorbegin(), timeSteps->end(), reportDateTime) == timeSteps->end()) { timeSteps->push_back(reportDateTime); + daysSinceSimulationStart->push_back(dayValue); } } } @@ -382,8 +379,9 @@ void RifEclipseOutputFileTools::createReportStepsMetaData(std::vector* values); static bool keywordData(ecl_file_type* ecl_file, const QString& keyword, size_t fileKeywordOccurrence, std::vector* values); - static void timeSteps(ecl_file_type* ecl_file, std::vector* timeSteps); + static void timeSteps(ecl_file_type* ecl_file, std::vector* timeSteps, std::vector* daysSinceSimulationStart); static bool findSiblingFilesWithSameBaseName(const QString& fileName, QStringList* fileSet); diff --git a/ApplicationCode/FileInterface/RifEclipseOutputTableFormatter.cpp b/ApplicationCode/FileInterface/RifEclipseOutputTableFormatter.cpp new file mode 100644 index 0000000000..454b974f7a --- /dev/null +++ b/ApplicationCode/FileInterface/RifEclipseOutputTableFormatter.cpp @@ -0,0 +1,281 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RifEclipseOutputTableFormatter.h" + +#include "cvfAssert.h" + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifEclipseOutputTableFormatter::RifEclipseOutputTableFormatter(QTextStream& out) : m_out(out) +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifEclipseOutputTableFormatter::~RifEclipseOutputTableFormatter() +{ + CVF_ASSERT(m_buffer.empty()); + CVF_ASSERT(m_columns.empty()); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RifEclipseOutputTableFormatter::outputBuffer() +{ + if (m_columns.size() > 0) + { + m_out << "-- "; + for (RifEclipseOutputTableColumn& column : m_columns) + { + m_out << formatColumn(column.title, column); + } + m_out << "\n"; + } + + for (auto line : m_buffer) + { + if (line.lineType == COMMENT) + { + outputComment(line); + } + else if (line.lineType == CONTENTS) + { + m_out << " "; + for (size_t i = 0; i < line.data.size(); ++i) + { + m_out << formatColumn(line.data[i], m_columns[i]); + } + m_out << " /" << "\n"; + } + } + m_columns.clear(); + m_buffer.clear(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RifEclipseOutputTableFormatter::outputComment(RifEclipseOutputTableLine& comment) +{ + m_out << "-- " << comment.data[0] << "\n"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RifEclipseOutputTableFormatter::tableCompleted() +{ + outputBuffer(); + // Output an "empty" line after a finished table + m_out << "/\n"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifEclipseOutputTableFormatter& RifEclipseOutputTableFormatter::keyword(const QString keyword) +{ + CVF_ASSERT(m_buffer.empty()); + CVF_ASSERT(m_columns.empty()); + m_out << keyword << "\n"; + return *this; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifEclipseOutputTableFormatter& RifEclipseOutputTableFormatter::header(const std::vector header) +{ + outputBuffer(); + m_columns = header; + for (RifEclipseOutputTableColumn& column : m_columns) + { + column.width = measure(column.title); + } + return *this; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifEclipseOutputTableFormatter& RifEclipseOutputTableFormatter::comment(const QString comment) +{ + RifEclipseOutputTableLine line; + line.data.push_back(comment); + line.lineType = COMMENT; + if (m_columns.empty()) + { + outputComment(line); + } + else + { + m_buffer.push_back(line); + } + return *this; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifEclipseOutputTableFormatter& RifEclipseOutputTableFormatter::add(const QString str) +{ + size_t column = m_lineBuffer.size(); + CVF_ASSERT(column < m_columns.size()); + m_columns[column].width = std::max(measure(str), m_columns[column].width); + m_lineBuffer.push_back(str); + return *this; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifEclipseOutputTableFormatter& RifEclipseOutputTableFormatter::add(double num) +{ + size_t column = m_lineBuffer.size(); + CVF_ASSERT(column < m_columns.size()); + m_columns[column].width = std::max(measure(num), m_columns[column].width); + m_lineBuffer.push_back(format(num)); + return *this; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifEclipseOutputTableFormatter& RifEclipseOutputTableFormatter::add(int num) +{ + size_t column = m_lineBuffer.size(); + CVF_ASSERT(column < m_columns.size()); + m_columns[column].width = std::max(measure(num), m_columns[column].width); + m_lineBuffer.push_back(format(num)); + return *this; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifEclipseOutputTableFormatter& RifEclipseOutputTableFormatter::add(size_t num) +{ + size_t column = m_lineBuffer.size(); + CVF_ASSERT(column < m_columns.size()); + m_columns[column].width = std::max(measure(num), m_columns[column].width); + m_lineBuffer.push_back(format(num)); + return *this; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifEclipseOutputTableFormatter& RifEclipseOutputTableFormatter::addZeroBasedCellIndex(size_t index) +{ + size_t column = m_lineBuffer.size(); + CVF_ASSERT(column < m_columns.size()); + + // Increase index by 1 to use Eclipse 1-based cell index instead of ResInsight 0-based + index++; + + m_columns[column].width = std::max(measure(index), m_columns[column].width); + m_lineBuffer.push_back(format(index)); + return *this; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RifEclipseOutputTableFormatter::rowCompleted() +{ + RifEclipseOutputTableLine line; + line.data = m_lineBuffer; + line.lineType = CONTENTS; + m_buffer.push_back(line); + m_lineBuffer.clear(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +int RifEclipseOutputTableFormatter::measure(const QString str) +{ + return str.length(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +int RifEclipseOutputTableFormatter::measure(double num) +{ + return format(num).length(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +int RifEclipseOutputTableFormatter::measure(int num) +{ + return format(num).length(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +int RifEclipseOutputTableFormatter::measure(size_t num) +{ + return format(num).length(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RifEclipseOutputTableFormatter::format(double num) +{ + return QString("%1").arg(num, 0, 'f', m_doubleDecimals); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RifEclipseOutputTableFormatter::format(int num) +{ + return QString("%1").arg(num); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RifEclipseOutputTableFormatter::format(size_t num) +{ + return QString("%1").arg(num); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RifEclipseOutputTableFormatter::formatColumn(const QString str, RifEclipseOutputTableColumn column) +{ + if (column.alignment == LEFT) + { + return str.leftJustified(column.width + m_colSpacing, ' '); + } + else + { + return str.rightJustified(column.width, ' ').leftJustified(m_colSpacing, ' '); + } +} diff --git a/ApplicationCode/FileInterface/RifEclipseOutputTableFormatter.h b/ApplicationCode/FileInterface/RifEclipseOutputTableFormatter.h new file mode 100644 index 0000000000..0c0215c564 --- /dev/null +++ b/ApplicationCode/FileInterface/RifEclipseOutputTableFormatter.h @@ -0,0 +1,112 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include +#include + +#include + +//================================================================================================== +// +//================================================================================================== +enum RifEclipseOutputTableLineType +{ + COMMENT, + CONTENTS +}; + +//================================================================================================== +// +//================================================================================================== +enum RifEclipseOutputTableAlignment +{ + LEFT, + RIGHT +}; + +//================================================================================================== +// +//================================================================================================== +struct RifEclipseOutputTableLine +{ + RifEclipseOutputTableLineType lineType; + std::vector< QString > data; +}; + +//================================================================================================== +// +//================================================================================================== +struct RifEclipseOutputTableColumn +{ + RifEclipseOutputTableColumn(const QString& title, RifEclipseOutputTableAlignment alignment = LEFT, int width = -1) + : title(title), + alignment(alignment), + width(width) + { + } + + QString title; + RifEclipseOutputTableAlignment alignment; + int width; +}; + + +//================================================================================================== +// +//================================================================================================== +class RifEclipseOutputTableFormatter +{ +public: + RifEclipseOutputTableFormatter(QTextStream& out); + virtual ~RifEclipseOutputTableFormatter(); + + RifEclipseOutputTableFormatter& keyword(const QString keyword); + RifEclipseOutputTableFormatter& header(std::vector tableHeader); + RifEclipseOutputTableFormatter& add(const QString str); + RifEclipseOutputTableFormatter& add(double num); + RifEclipseOutputTableFormatter& add(int num); + RifEclipseOutputTableFormatter& add(size_t num); + RifEclipseOutputTableFormatter& addZeroBasedCellIndex(size_t index); + RifEclipseOutputTableFormatter& comment(const QString str); + void rowCompleted(); + void tableCompleted(); + +private: + int measure(const QString str); + int measure(double num); + int measure(int num); + int measure(size_t num); + + QString format(double num); + QString format(int num); + QString format(size_t num); + QString formatColumn(const QString str, RifEclipseOutputTableColumn column); + + void outputBuffer(); + void outputComment(RifEclipseOutputTableLine& comment); + +private: + std::vector m_columns; + std::vector m_buffer; + std::vector m_lineBuffer; + QTextStream& m_out; + int m_doubleDecimals = 5; + int m_colSpacing = 5; +}; diff --git a/ApplicationCode/FileInterface/RifEclipseRestartDataAccess.h b/ApplicationCode/FileInterface/RifEclipseRestartDataAccess.h index 92024f378b..6884afe0bf 100644 --- a/ApplicationCode/FileInterface/RifEclipseRestartDataAccess.h +++ b/ApplicationCode/FileInterface/RifEclipseRestartDataAccess.h @@ -98,7 +98,7 @@ public: virtual void setTimeSteps(const std::vector& timeSteps) {}; virtual size_t timeStepCount() = 0; - virtual std::vector timeSteps() = 0; + virtual void timeSteps(std::vector* timeSteps, std::vector* daysSinceSimulationStart) = 0; virtual std::vector reportNumbers() = 0; virtual void resultNames(QStringList* resultNames, std::vector* resultDataItemCounts) = 0; diff --git a/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.cpp b/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.cpp index 418dce66d9..cc4b1fceb8 100644 --- a/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.cpp +++ b/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.cpp @@ -119,7 +119,7 @@ size_t RifEclipseRestartFilesetAccess::timeStepCount() //-------------------------------------------------------------------------------------------------- /// Get the time steps //-------------------------------------------------------------------------------------------------- -std::vector RifEclipseRestartFilesetAccess::timeSteps() +void RifEclipseRestartFilesetAccess::timeSteps(std::vector* timeSteps, std::vector* daysSinceSimulationStart) { if (m_timeSteps.size() == 0) { @@ -128,24 +128,28 @@ std::vector RifEclipseRestartFilesetAccess::timeSteps() for (i = 0; i < numSteps; i++) { std::vector stepTime; + std::vector stepDays; openTimeStep(i); - RifEclipseOutputFileTools::timeSteps(m_ecl_files[i], &stepTime); + RifEclipseOutputFileTools::timeSteps(m_ecl_files[i], &stepTime, &stepDays); if (stepTime.size() == 1) { m_timeSteps.push_back(stepTime[0]); + m_daysSinceSimulationStart.push_back(stepDays[0]); } else { m_timeSteps.push_back(QDateTime()); + m_daysSinceSimulationStart.push_back(0.0); } } } - return m_timeSteps; + *timeSteps = m_timeSteps; + *daysSinceSimulationStart = m_daysSinceSimulationStart; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.h b/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.h index 494d9378cd..9bb4ac7749 100644 --- a/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.h +++ b/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.h @@ -43,7 +43,7 @@ public: void setTimeSteps(const std::vector& timeSteps); size_t timeStepCount(); - std::vector timeSteps(); + void timeSteps(std::vector* timeSteps, std::vector* daysSinceSimulationStart) override; std::vector reportNumbers(); void resultNames(QStringList* resultNames, std::vector* resultDataItemCounts); @@ -58,6 +58,7 @@ private: private: QStringList m_fileNames; std::vector m_timeSteps; + std::vector m_daysSinceSimulationStart; std::vector< ecl_file_type* > m_ecl_files; }; diff --git a/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.cpp b/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.cpp index 3b486c1351..f5006c4b0f 100644 --- a/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.cpp +++ b/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.cpp @@ -85,23 +85,23 @@ size_t RifEclipseUnifiedRestartFileAccess::timeStepCount() { return 0; } + std::vector timeSteps; + std::vector daysSinceSimulationStart; - return timeSteps().size(); + this->timeSteps(&timeSteps, &daysSinceSimulationStart); + + return timeSteps.size(); } //-------------------------------------------------------------------------------------------------- /// Get the time steps //-------------------------------------------------------------------------------------------------- -std::vector RifEclipseUnifiedRestartFileAccess::timeSteps() +void RifEclipseUnifiedRestartFileAccess::timeSteps(std::vector* timeSteps, std::vector* daysSinceSimulationStart) { - std::vector timeSteps; - if (openFile()) { - RifEclipseOutputFileTools::timeSteps(m_ecl_file, &timeSteps); + RifEclipseOutputFileTools::timeSteps(m_ecl_file, timeSteps, daysSinceSimulationStart); } - - return timeSteps; } diff --git a/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.h b/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.h index 14a0e1d14b..2344ed3266 100644 --- a/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.h +++ b/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.h @@ -46,7 +46,7 @@ public: void close(); size_t timeStepCount(); - std::vector timeSteps(); + void timeSteps(std::vector* timeSteps, std::vector* daysSinceSimulationStart) override; std::vector reportNumbers(); void resultNames(QStringList* resultNames, std::vector* resultDataItemCounts); diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp index 13649d6759..9727079aa2 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp +++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp @@ -657,7 +657,7 @@ void RifReaderEclipseOutput::buildMetaData() progInfo.incrementProgress(); // Get time steps - m_timeSteps = m_dynamicResultsAccess->timeSteps(); + m_dynamicResultsAccess->timeSteps(&m_timeSteps, &m_daysSinceSimulationStart); std::vector reportNumbers = m_dynamicResultsAccess->reportNumbers(); QStringList resultNames; @@ -673,7 +673,7 @@ void RifReaderEclipseOutput::buildMetaData() for (int i = 0; i < matrixResultNames.size(); ++i) { size_t resIndex = matrixModelResults->addEmptyScalarResult(RimDefines::DYNAMIC_NATIVE, matrixResultNames[i], false); - matrixModelResults->setTimeStepDates(resIndex, m_timeSteps, reportNumbers); + matrixModelResults->setTimeStepDates(resIndex, m_timeSteps, m_daysSinceSimulationStart, reportNumbers); } } @@ -686,7 +686,7 @@ void RifReaderEclipseOutput::buildMetaData() for (int i = 0; i < fractureResultNames.size(); ++i) { size_t resIndex = fractureModelResults->addEmptyScalarResult(RimDefines::DYNAMIC_NATIVE, fractureResultNames[i], false); - fractureModelResults->setTimeStepDates(resIndex, m_timeSteps, reportNumbers); + fractureModelResults->setTimeStepDates(resIndex, m_timeSteps, m_daysSinceSimulationStart, reportNumbers); } } @@ -723,12 +723,17 @@ void RifReaderEclipseOutput::buildMetaData() RifEclipseOutputFileTools::findKeywordsAndItemCount(filesUsedToFindAvailableKeywords, &resultNames, &resultNamesDataItemCounts); std::vector staticDate; + std::vector staticDay; std::vector staticReportNumber; { if ( m_timeSteps.size() > 0 ) { staticDate.push_back(m_timeSteps.front()); } + if (m_daysSinceSimulationStart.size() > 0) + { + staticDay.push_back(m_daysSinceSimulationStart.front()); + } std::vector reportNumbers; if (m_dynamicResultsAccess.notNull()) @@ -754,7 +759,7 @@ void RifReaderEclipseOutput::buildMetaData() for (int i = 0; i < matrixResultNames.size(); ++i) { size_t resIndex = matrixModelResults->addEmptyScalarResult(RimDefines::STATIC_NATIVE, matrixResultNames[i], false); - matrixModelResults->setTimeStepDates(resIndex, staticDate, staticReportNumber); + matrixModelResults->setTimeStepDates(resIndex, staticDate, staticDay, staticReportNumber); } } @@ -769,7 +774,7 @@ void RifReaderEclipseOutput::buildMetaData() for (int i = 0; i < fractureResultNames.size(); ++i) { size_t resIndex = fractureModelResults->addEmptyScalarResult(RimDefines::STATIC_NATIVE, fractureResultNames[i], false); - fractureModelResults->setTimeStepDates(resIndex, staticDate, staticReportNumber); + fractureModelResults->setTimeStepDates(resIndex, staticDate, staticDay, staticReportNumber); } } } @@ -908,6 +913,9 @@ RigWellResultPoint RifReaderEclipseOutput::createWellResultPoint(const RigGridBa int cellK = well_conn_get_k( ert_connection ); bool isCellOpen = well_conn_open( ert_connection ); double volumeRate = well_conn_get_volume_rate( ert_connection); + double oilRate = well_conn_get_oil_rate(ert_connection) ; + double gasRate = well_conn_get_gas_rate(ert_connection); + double waterRate = well_conn_get_water_rate(ert_connection); // If a well is defined in fracture region, the K-value is from (cellCountK - 1) -> cellCountK*2 - 1 // Adjust K so index is always in valid grid region @@ -960,6 +968,18 @@ RigWellResultPoint RifReaderEclipseOutput::createWellResultPoint(const RigGridBa resultPoint.m_ertBranchId = ertBranchId; resultPoint.m_ertSegmentId = ertSegmentId; resultPoint.m_flowRate = volumeRate; + resultPoint.m_oilRate = oilRate; + resultPoint.m_waterRate = waterRate; + + // If field unit, the Gas is in Mega ft^3 while the others are in [stb] (barrel) + // we convert gas to stb as well. Based on + // 1 [stb] = 0.15898729492800007 [m^3] + // 1 [ft] = 0.3048 [m] + // megaFt3ToStbFactor = 1.0 / (1.0e-6 * 0.15898729492800007 * ( 1.0 / 0.3048 )^3 ) + double megaFt3ToStbFactor = 178107.60668; + if (m_eclipseCase->unitsType() == RigEclipseCaseData::UNITS_FIELD) gasRate = megaFt3ToStbFactor * gasRate; + + resultPoint.m_gasRate = gasRate; } return resultPoint; @@ -1118,7 +1138,9 @@ void RifReaderEclipseOutput::readWellCells(const ecl_grid_type* mainEclGrid, boo m_dynamicResultsAccess->readWellData(ert_well_info, importCompleteMswData); - std::vector timeSteps = m_dynamicResultsAccess->timeSteps(); + std::vector daysSinceSimulationStart; + std::vector timeSteps; + m_dynamicResultsAccess->timeSteps(&timeSteps, &daysSinceSimulationStart); std::vector reportNumbers = m_dynamicResultsAccess->reportNumbers(); bool sameCount = false; diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.h b/ApplicationCode/FileInterface/RifReaderEclipseOutput.h index c4b31d6c9e..55f0ec81ca 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.h +++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.h @@ -69,7 +69,7 @@ private: std::string ertGridName( size_t gridNr ); - static RigWellResultPoint createWellResultPoint(const RigGridBase* grid, const well_conn_type* ert_connection, int ertBranchId, int ertSegmentId, const char* wellName); + RigWellResultPoint createWellResultPoint(const RigGridBase* grid, const well_conn_type* ert_connection, int ertBranchId, int ertSegmentId, const char* wellName); void importFaults(const QStringList& fileSet, cvf::Collection* faults); @@ -93,6 +93,7 @@ private: RigEclipseCaseData* m_eclipseCase; std::vector m_timeSteps; + std::vector m_daysSinceSimulationStart; ecl_file_type* m_ecl_init_file; // File access to static results cvf::ref m_dynamicResultsAccess; // File access to dynamic results diff --git a/ApplicationCode/FileInterface/RifReaderMockModel.cpp b/ApplicationCode/FileInterface/RifReaderMockModel.cpp index 0872e9b07b..316b536d07 100644 --- a/ApplicationCode/FileInterface/RifReaderMockModel.cpp +++ b/ApplicationCode/FileInterface/RifReaderMockModel.cpp @@ -38,24 +38,28 @@ bool RifReaderMockModel::open(const QString& fileName, RigEclipseCaseData* eclip std::vector dates; + std::vector days; std::vector repNumbers; for (int i = 0; i < static_cast(m_reservoirBuilder.timeStepCount()); i++) { dates.push_back(QDateTime(QDate(2012+i, 6, 1))); + days.push_back(i); repNumbers.push_back(i); } for (size_t i = 0; i < m_reservoirBuilder.resultCount(); i++) { size_t resIdx = cellResults->addEmptyScalarResult(RimDefines::DYNAMIC_NATIVE, QString("Dynamic_Result_%1").arg(i), false); - cellResults->setTimeStepDates(resIdx, dates, repNumbers); + cellResults->setTimeStepDates(resIdx, dates, days, repNumbers); } if (m_reservoirBuilder.timeStepCount() == 0) return true; std::vector staticDates; staticDates.push_back(dates[0]); + std::vector staticDays; + staticDays.push_back(days[0]); std::vector staticRepNumbers; staticRepNumbers.push_back(0); @@ -68,7 +72,7 @@ bool RifReaderMockModel::open(const QString& fileName, RigEclipseCaseData* eclip if (i > 1) resIndex = i; size_t resIdx = cellResults->addEmptyScalarResult(RimDefines::STATIC_NATIVE, QString("Static_Result_%1%2").arg(resIndex).arg(varEnd), false); - cellResults->setTimeStepDates(resIdx, staticDates, staticRepNumbers); + cellResults->setTimeStepDates(resIdx, staticDates, staticDays, staticRepNumbers); } @@ -77,7 +81,7 @@ bool RifReaderMockModel::open(const QString& fileName, RigEclipseCaseData* eclip size_t resIdx; \ QString resultName(Name); \ resIdx = cellResults->addEmptyScalarResult(RimDefines::INPUT_PROPERTY, resultName, false); \ - cellResults->setTimeStepDates(resIdx, staticDates, staticRepNumbers); \ + cellResults->setTimeStepDates(resIdx, staticDates, staticDays, staticRepNumbers); \ cellResults->cellScalarResults(resIdx).resize(1); \ std::vector& values = cellResults->cellScalarResults(resIdx)[0]; \ this->inputProperty(resultName, &values); \ diff --git a/ApplicationCode/FileInterface/RifReaderSettings.cpp b/ApplicationCode/FileInterface/RifReaderSettings.cpp index ed6174d3d1..473a86271c 100644 --- a/ApplicationCode/FileInterface/RifReaderSettings.cpp +++ b/ApplicationCode/FileInterface/RifReaderSettings.cpp @@ -31,13 +31,13 @@ RifReaderSettings::RifReaderSettings() { CAF_PDM_InitObject("RifReaderSettings", "", "", ""); - CAF_PDM_InitField(&importFaults, "importFaults", true, "Import faults", "", "", ""); + CAF_PDM_InitField(&importFaults, "importFaults", true, "Import Faults", "", "", ""); importFaults.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN); CAF_PDM_InitField(&importNNCs, "importSimulationNNCs", true, "Import NNCs", "", "", ""); importNNCs.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN); - CAF_PDM_InitField(&importAdvancedMswData, "importAdvancedMswData", false, "Import advanced MSW data", "", "", ""); + CAF_PDM_InitField(&importAdvancedMswData, "importAdvancedMswData", false, "Import Advanced MSW Data", "", "", ""); importAdvancedMswData.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN); CAF_PDM_InitField(&faultIncludeFileAbsolutePathPrefix, "faultIncludeFileAbsolutePathPrefix", QString(), "Fault Include File Absolute Path Prefix", "", "Path used to prefix absolute UNIX paths in fault include statements on Windows", ""); @@ -52,7 +52,7 @@ void RifReaderSettings::defineEditorAttribute(const caf::PdmFieldHandle* field, field == &importAdvancedMswData || field == &importNNCs) { - caf::PdmUiCheckBoxEditorAttribute* myAttr = static_cast(attribute); + caf::PdmUiCheckBoxEditorAttribute* myAttr = dynamic_cast(attribute); if (myAttr) { myAttr->m_useNativeCheckBoxLabel = true; diff --git a/ApplicationCode/FileInterface/RifWellPathImporter.cpp b/ApplicationCode/FileInterface/RifWellPathImporter.cpp new file mode 100644 index 0000000000..de8199efa0 --- /dev/null +++ b/ApplicationCode/FileInterface/RifWellPathImporter.cpp @@ -0,0 +1,378 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2011- Statoil ASA +// Copyright (C) 2013- Ceetron Solutions AS +// Copyright (C) 2011-2012 Ceetron 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RifWellPathImporter.h" + +#include "RifJsonEncodeDecode.h" + +#include + +#include "cafUtils.h" + +#include + +#include +#include + +#define ASCII_FILE_DEFAULT_START_INDEX 0 + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifWellPathImporter::WellData RifWellPathImporter::readWellData(const QString& filePath, size_t indexInFile) +{ + CVF_ASSERT(caf::Utils::fileExists(filePath)); + + if (isJsonFile(filePath)) + { + return readJsonWellData(filePath); + } + else + { + return readAsciiWellData(filePath, indexInFile); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifWellPathImporter::WellData RifWellPathImporter::readWellData(const QString& filePath) +{ + return readWellData(filePath, ASCII_FILE_DEFAULT_START_INDEX); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifWellPathImporter::WellMetaData RifWellPathImporter::readWellMetaData(const QString& filePath, size_t indexInFile) +{ + CVF_ASSERT(caf::Utils::fileExists(filePath)); + + if (isJsonFile(filePath)) + { + return readJsonWellMetaData(filePath); + } + else + { + return readAsciiWellMetaData(filePath, indexInFile); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifWellPathImporter::WellMetaData RifWellPathImporter::readWellMetaData(const QString& filePath) +{ + return readWellMetaData(filePath, ASCII_FILE_DEFAULT_START_INDEX); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +size_t RifWellPathImporter::wellDataCount(const QString& filePath) +{ + if (isJsonFile(filePath)) + { + // Only support JSON files with single well data currently + return 1; + } + else + { + std::map >::iterator it = m_fileNameToWellDataGroupMap.find(filePath); + + // If we have the file in the map, assume it is already read. + if (it != m_fileNameToWellDataGroupMap.end()) + { + return it->second.size(); + } + + readAllAsciiWellData(filePath); + it = m_fileNameToWellDataGroupMap.find(filePath); + CVF_ASSERT(it != m_fileNameToWellDataGroupMap.end()); + + return it->second.size();; + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RifWellPathImporter::isJsonFile(const QString & filePath) +{ + QFileInfo fileInfo(filePath); + + if (fileInfo.suffix().compare("json") == 0) + { + return true; + } + else + { + return false; + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifWellPathImporter::WellMetaData RifWellPathImporter::readJsonWellMetaData(const QString & filePath) +{ + ResInsightInternalJson::JsonReader jsonReader; + QMap jsonMap = jsonReader.decodeFile(filePath); + WellMetaData metadata; + + metadata.m_id = jsonMap["id"].toString(); + metadata.m_name = jsonMap["name"].toString(); + metadata.m_sourceSystem = jsonMap["sourceSystem"].toString(); + metadata.m_utmZone = jsonMap["utmZone"].toString(); + metadata.m_updateUser = jsonMap["updateUser"].toString(); + metadata.m_surveyType = jsonMap["surveyType"].toString(); + + // Convert updateDate from the following format: + // "Number of milliseconds elapsed since midnight Coordinated Universal Time (UTC) + // of January 1, 1970, not counting leap seconds" + QString updateDateStr = jsonMap["updateDate"].toString().trimmed(); + uint updateDateUint = updateDateStr.toULongLong() / 1000; // Should be within 32 bit, maximum number is 4294967295 which corresponds to year 2106 + metadata.m_updateDate.setTime_t(updateDateUint); + + return metadata; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifWellPathImporter::WellData RifWellPathImporter::readJsonWellData(const QString& filePath) +{ + ResInsightInternalJson::JsonReader jsonReader; + QMap jsonMap = jsonReader.decodeFile(filePath); + + double datumElevation = jsonMap["datumElevation"].toDouble(); + QList pathList = jsonMap["path"].toList(); + WellData wellData; + wellData.m_wellPathGeometry->setDatumElevation(datumElevation); + wellData.m_name = jsonMap["name"].toString(); + + foreach(QVariant point, pathList) + { + QMap coordinateMap = point.toMap(); + cvf::Vec3d vec3d(coordinateMap["east"].toDouble(), coordinateMap["north"].toDouble(), -(coordinateMap["tvd"].toDouble() - datumElevation)); + wellData.m_wellPathGeometry->m_wellPathPoints.push_back(vec3d); + double measuredDepth = coordinateMap["md"].toDouble(); + wellData.m_wellPathGeometry->m_measuredDepths.push_back(measuredDepth); + } + return wellData; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RifWellPathImporter::readAllAsciiWellData(const QString& filePath) +{ + std::map >::iterator it = m_fileNameToWellDataGroupMap.find(filePath); + + // If we have the file in the map, assume it is already read. + if (it != m_fileNameToWellDataGroupMap.end()) + { + return; + } + + // Create the data container + std::vector& fileWellDataArray = m_fileNameToWellDataGroupMap[filePath]; + + std::ifstream stream(filePath.toLatin1().data()); + double x(HUGE_VAL), y(HUGE_VAL), tvd(HUGE_VAL), md(HUGE_VAL); + + bool hasReadWellPointInCurrentWell = false; + + while (stream.good()) + { + // First check if we can read a number + stream >> x; + if (stream.good()) // If we can, assume this line is a well point entry + { + stream >> y >> tvd >> md; + if (!stream.good()) + { + // -999 or otherwise to few numbers before some word + if (x != -999) + { + // Error in file: missing numbers at this line + + } + stream.clear(); + } + else + { + if (!fileWellDataArray.size()) + { + fileWellDataArray.push_back(RifWellPathImporter::WellData()); + fileWellDataArray.back().m_wellPathGeometry = new RigWellPath(); + } + + cvf::Vec3d wellPoint(x, y, -tvd); + fileWellDataArray.back().m_wellPathGeometry->m_wellPathPoints.push_back(wellPoint); + fileWellDataArray.back().m_wellPathGeometry->m_measuredDepths.push_back(md); + + x = HUGE_VAL; + y = HUGE_VAL; + tvd = HUGE_VAL; + md = HUGE_VAL; + + hasReadWellPointInCurrentWell = true; + } + } + else + { + // Could not read one double. + // we assume there is a comment line or a well path description + stream.clear(); + + std::string line; + std::getline(stream, line, '\n'); + // Skip possible comment lines (-- is used in eclipse, so Haakon Høgstøl considered it smart to skip these here as well) + // The first "-" is eaten by the stream >> x above + if (line.find("-") == 0 || line.find("#") == 0) + { + // Comment line, just ignore + } + else + { + // Find the first and the last position of any quotes (and do not care to match quotes) + size_t quoteStartIdx = line.find_first_of("'`´’‘"); + size_t quoteEndIdx = line.find_last_of("'`´’‘"); + + std::string wellName; + bool haveAPossibleWellStart = false; + + if (quoteStartIdx < line.size() -1) + { + // Extract the text between the quotes + wellName = line.substr(quoteStartIdx + 1, quoteEndIdx - 1 - quoteStartIdx); + haveAPossibleWellStart = true; + } + else if (quoteStartIdx > line.length()) + { + // We did not find any quotes + + // Supported alternatives are + // name + // wellname: + std::string lineLowerCase = line; + transform(lineLowerCase.begin(), lineLowerCase.end(), lineLowerCase.begin(), ::tolower); + + std::string tokenName = "name"; + std::size_t foundNameIdx = lineLowerCase.find(tokenName); + if (foundNameIdx != std::string::npos) + { + std::string tokenColon = ":"; + std::size_t foundColonIdx = lineLowerCase.find(tokenColon, foundNameIdx); + if (foundColonIdx != std::string::npos) + { + wellName = line.substr(foundColonIdx + tokenColon.length()); + } + else + { + wellName = line.substr(foundNameIdx + tokenName.length()); + } + + haveAPossibleWellStart = true; + } + else + { + // Interpret the whole line as the well name. + + QString name = line.c_str(); + if (!name.trimmed().isEmpty()) + { + wellName = name.trimmed().toStdString(); + haveAPossibleWellStart = true; + } + } + } + + if (haveAPossibleWellStart) + { + // Create a new Well data if we have read some data into the previous one. + // if not, just overwrite the name + if (hasReadWellPointInCurrentWell || fileWellDataArray.size() == 0) + { + fileWellDataArray.push_back(RifWellPathImporter::WellData()); + fileWellDataArray.back().m_wellPathGeometry = new RigWellPath(); + } + + QString name = wellName.c_str(); + if (!name.trimmed().isEmpty()) + { + // Do not overwrite the name aquired from a line above, if this line is empty + fileWellDataArray.back().m_name = name.trimmed(); + } + hasReadWellPointInCurrentWell = false; + } + } + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifWellPathImporter::WellData RifWellPathImporter::readAsciiWellData(const QString& filePath, size_t indexInFile) +{ + readAllAsciiWellData(filePath); + + std::map >::iterator it = m_fileNameToWellDataGroupMap.find(filePath); + + CVF_ASSERT(it != m_fileNameToWellDataGroupMap.end()); + + if (indexInFile < it->second.size()) + { + return it->second[indexInFile]; + } + else + { + // Error : The ascii well path file does not contain that many well paths + return RifWellPathImporter::WellData(); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RifWellPathImporter::WellMetaData RifWellPathImporter::readAsciiWellMetaData(const QString & filePath, size_t indexInFile) +{ + // No metadata in ASCII files + return WellMetaData(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RifWellPathImporter::clear() +{ + m_fileNameToWellDataGroupMap.clear(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RifWellPathImporter::removeFilePath(const QString& filePath) +{ + m_fileNameToWellDataGroupMap.erase(filePath); +} diff --git a/ApplicationCode/FileInterface/RifWellPathImporter.h b/ApplicationCode/FileInterface/RifWellPathImporter.h new file mode 100644 index 0000000000..fc1db746a3 --- /dev/null +++ b/ApplicationCode/FileInterface/RifWellPathImporter.h @@ -0,0 +1,75 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2011- Statoil ASA +// Copyright (C) 2013- Ceetron Solutions AS +// Copyright (C) 2011-2012 Ceetron 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RigWellPath.h" + +#include "cvfObject.h" + +#include +#include +#include +#include + +//================================================================================================== +/// +/// +//================================================================================================== +class RifWellPathImporter +{ +public: + struct WellData + { + QString m_name; + cvf::ref m_wellPathGeometry; + }; + + struct WellMetaData + { + QString m_name; + QString m_id; + QString m_sourceSystem; + QString m_utmZone; + QString m_updateUser; + QString m_surveyType; + QDateTime m_updateDate; + }; + + WellData readWellData(const QString& filePath, size_t indexInFile); + WellData readWellData(const QString& filePath); + WellMetaData readWellMetaData(const QString& filePath, size_t indexInFile); + WellMetaData readWellMetaData(const QString& filePath); + size_t wellDataCount(const QString& filePath); + + void clear(); + void removeFilePath(const QString& filePath); + +private: + WellData readJsonWellData(const QString& filePath); + WellMetaData readJsonWellMetaData(const QString& filePath); + WellData readAsciiWellData(const QString& filePath, size_t indexInFile); + WellMetaData readAsciiWellMetaData(const QString& filePath, size_t indexInFile); + void readAllAsciiWellData(const QString& filePath); + + inline bool isJsonFile(const QString& filePath); + + std::map > m_fileNameToWellDataGroupMap; +}; diff --git a/ApplicationCode/ModelVisualization/CMakeLists_files.cmake b/ApplicationCode/ModelVisualization/CMakeLists_files.cmake index 64bb259a0a..c03c6137fd 100644 --- a/ApplicationCode/ModelVisualization/CMakeLists_files.cmake +++ b/ApplicationCode/ModelVisualization/CMakeLists_files.cmake @@ -36,9 +36,11 @@ ${CEE_CURRENT_LIST_DIR}RivSimWellPipeSourceInfo.h ${CEE_CURRENT_LIST_DIR}RivWellSpheresPartMgr.h ${CEE_CURRENT_LIST_DIR}RivPartPriority.h ${CEE_CURRENT_LIST_DIR}RivWellConnectionsPartMgr.h +${CEE_CURRENT_LIST_DIR}RivObjectSourceInfo.h +${CEE_CURRENT_LIST_DIR}RivWellConnectionsPartMgr.h +${CEE_CURRENT_LIST_DIR}RivFishbonesSubsPartMgr.h ${CEE_CURRENT_LIST_DIR}RivWellFracturePartMgr.h -${CEE_CURRENT_LIST_DIR}RivObjectSourceInfo.h ) set (SOURCE_GROUP_SOURCE_FILES @@ -70,8 +72,10 @@ ${CEE_CURRENT_LIST_DIR}RivSingleCellPartGenerator.cpp ${CEE_CURRENT_LIST_DIR}RivSimWellPipeSourceInfo.cpp ${CEE_CURRENT_LIST_DIR}RivWellSpheresPartMgr.cpp ${CEE_CURRENT_LIST_DIR}RivWellConnectionsPartMgr.cpp -${CEE_CURRENT_LIST_DIR}RivWellFracturePartMgr.cpp ${CEE_CURRENT_LIST_DIR}RivObjectSourceInfo.cpp +${CEE_CURRENT_LIST_DIR}RivWellConnectionsPartMgr.cpp +${CEE_CURRENT_LIST_DIR}RivFishbonesSubsPartMgr.cpp +${CEE_CURRENT_LIST_DIR}RivWellFracturePartMgr.cpp ) list(APPEND CODE_HEADER_FILES diff --git a/ApplicationCode/ModelVisualization/RivFishbonesSubsPartMgr.cpp b/ApplicationCode/ModelVisualization/RivFishbonesSubsPartMgr.cpp new file mode 100644 index 0000000000..30a7ebab8f --- /dev/null +++ b/ApplicationCode/ModelVisualization/RivFishbonesSubsPartMgr.cpp @@ -0,0 +1,114 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RivFishbonesSubsPartMgr.h" + +#include "RigWellPath.h" + +#include "RimFishbonesMultipleSubs.h" +#include "RimWellPath.h" + +#include "RivObjectSourceInfo.h" +#include "RivPipeGeometryGenerator.h" + +#include "cafDisplayCoordTransform.h" +#include "cafEffectGenerator.h" + +#include "cvfDrawableGeo.h" +#include "cvfModelBasicList.h" +#include "cvfPart.h" +#include "cvfTransform.h" + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RivFishbonesSubsPartMgr::RivFishbonesSubsPartMgr(RimFishbonesMultipleSubs* subs) + : m_rimFishbonesSubs(subs) +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RivFishbonesSubsPartMgr::~RivFishbonesSubsPartMgr() +{ + +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RivFishbonesSubsPartMgr::appendGeometryPartsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize) +{ + clearGeometryCache(); + + if (!m_rimFishbonesSubs->isChecked()) return; + + if (m_parts.size() == 0) + { + buildParts(displayCoordTransform, characteristicCellSize); + } + + for (auto part : m_parts) + { + model->addPart(part.p()); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RivFishbonesSubsPartMgr::clearGeometryCache() +{ + m_parts.clear(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RivFishbonesSubsPartMgr::buildParts(caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize) +{ + RimWellPath* wellPath = nullptr; + m_rimFishbonesSubs->firstAncestorOrThisOfTypeAsserted(wellPath); + + RivPipeGeometryGenerator geoGenerator; + + for (size_t subIndex = 0; subIndex < m_rimFishbonesSubs->locationOfSubs().size(); subIndex++) + { + for (size_t lateralIndex = 0; lateralIndex < m_rimFishbonesSubs->lateralLengths().size(); lateralIndex++) + { + std::vector lateralDomainCoords = m_rimFishbonesSubs->coordsForLateral(subIndex, lateralIndex); + + std::vector displayCoords; + for (auto domainCoord : lateralDomainCoords) + { + displayCoords.push_back(displayCoordTransform->transformToDisplayCoord(domainCoord)); + } + + geoGenerator.cylinderWithCenterLineParts(&m_parts, displayCoords, wellPath->wellPathColor(), wellPath->combinedScaleFactor() * characteristicCellSize * 0.5); + } + } + + cvf::ref objectSourceInfo = new RivObjectSourceInfo(m_rimFishbonesSubs); + for (auto part : m_parts) + { + part->setSourceInfo(objectSourceInfo.p()); + } +} + diff --git a/ApplicationCode/ModelVisualization/RivFishbonesSubsPartMgr.h b/ApplicationCode/ModelVisualization/RivFishbonesSubsPartMgr.h new file mode 100644 index 0000000000..a5d16a53fc --- /dev/null +++ b/ApplicationCode/ModelVisualization/RivFishbonesSubsPartMgr.h @@ -0,0 +1,66 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafPdmPointer.h" + +#include "cvfBase.h" +#include "cvfMatrix4.h" +#include "cvfObject.h" +#include "cvfVector3.h" + +#include "cvfCollection.h" +#include "cvfColor3.h" + + +namespace cvf +{ + class ModelBasicList; + class DrawableGeo; + class Part; + class Transform; +} + +namespace caf +{ + class DisplayCoordTransform; +} + +class RimFishbonesMultipleSubs; + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +class RivFishbonesSubsPartMgr : public cvf::Object +{ +public: + RivFishbonesSubsPartMgr(RimFishbonesMultipleSubs* subs); + ~RivFishbonesSubsPartMgr(); + + void appendGeometryPartsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize); + void clearGeometryCache(); + +private: + void buildParts(caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize); + + +private: + caf::PdmPointer m_rimFishbonesSubs; + cvf::Collection m_parts; +}; diff --git a/ApplicationCode/ModelVisualization/RivPipeGeometryGenerator.cpp b/ApplicationCode/ModelVisualization/RivPipeGeometryGenerator.cpp index f7817d5876..7c766eabb7 100644 --- a/ApplicationCode/ModelVisualization/RivPipeGeometryGenerator.cpp +++ b/ApplicationCode/ModelVisualization/RivPipeGeometryGenerator.cpp @@ -21,6 +21,8 @@ #include "RivPipeGeometryGenerator.h" +#include "RivObjectSourceInfo.h" + #include "cafEffectGenerator.h" #include "cvfDrawableGeo.h" #include "cvfPlane.h" @@ -615,3 +617,43 @@ void RivPipeGeometryGenerator::setFirstSegmentIndex(size_t segmentIndex) m_firstSegmentIndex = segmentIndex; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RivPipeGeometryGenerator::cylinderWithCenterLineParts(cvf::Collection* destinationParts, const std::vector& centerCoords, const cvf::Color3f& color, double radius) +{ + setRadius(radius); + setCrossSectionVertexCount(12); + + cvf::ref cvfCoords = new cvf::Vec3dArray(centerCoords); + setPipeCenterCoords(cvfCoords.p()); + + cvf::ref surfaceGeo = createPipeSurface(); + if (surfaceGeo.notNull()) + { + cvf::Part* part = new cvf::Part; + part->setDrawable(surfaceGeo.p()); + + caf::SurfaceEffectGenerator surfaceGen(cvf::Color4f(color), caf::PO_1); + cvf::ref eff = surfaceGen.generateCachedEffect(); + + part->setEffect(eff.p()); + + destinationParts->push_back(part); + } + + cvf::ref centerLineGeo = createCenterLine(); + if (centerLineGeo.notNull()) + { + cvf::Part* part = new cvf::Part; + part->setDrawable(centerLineGeo.p()); + + caf::SurfaceEffectGenerator surfaceGen(cvf::Color4f(color), caf::PO_1); + cvf::ref eff = surfaceGen.generateCachedEffect(); + + part->setEffect(eff.p()); + + destinationParts->push_back(part); + } +} + diff --git a/ApplicationCode/ModelVisualization/RivPipeGeometryGenerator.h b/ApplicationCode/ModelVisualization/RivPipeGeometryGenerator.h index 8a3bc3d5a3..4efd00df7e 100644 --- a/ApplicationCode/ModelVisualization/RivPipeGeometryGenerator.h +++ b/ApplicationCode/ModelVisualization/RivPipeGeometryGenerator.h @@ -22,6 +22,7 @@ #include "cvfBase.h" #include "cvfArray.h" +#include "cvfPart.h" #include "cvfColor3.h" #include "cvfVector3.h" @@ -32,6 +33,8 @@ namespace cvf { class ScalarMapper; } +class RivObjectSourceInfo; + class RivPipeGeometryGenerator : public cvf::Object { public: @@ -63,6 +66,7 @@ public: size_t segmentIndexFromTriangleIndex(size_t triangleIndex) const; size_t pipeResultIndexFromTriangleIndex(size_t triangleIndex) const; + void cylinderWithCenterLineParts(cvf::Collection* destinationParts, const std::vector& centerCoords, const cvf::Color3f& color, double radius); private: void clearComputedData(); void updateFilteredPipeCenterCoords(); diff --git a/ApplicationCode/ModelVisualization/RivWellConnectionsPartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellConnectionsPartMgr.cpp index 2f22b6e803..f5a1fe8d7e 100644 --- a/ApplicationCode/ModelVisualization/RivWellConnectionsPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellConnectionsPartMgr.cpp @@ -351,4 +351,4 @@ cvf::ref< cvf::DrawableGeo> RivWellConnectionsPartMgr::createArrowGeometry(const geo->computeNormals(); return geo; -} \ No newline at end of file +} diff --git a/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.h b/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.h index 512a7a4e27..cf4fc4821d 100644 --- a/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.h +++ b/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.h @@ -38,7 +38,7 @@ namespace cvf class ModelBasicList; } -namespace caf +namespace caf { class DisplayCoordTransform; } diff --git a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp index 6f24d6a3f8..ba8749eb45 100644 --- a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp @@ -24,19 +24,29 @@ #include "RigWellPath.h" #include "RimFracture.h" +#include "RimFishbonesMultipleSubs.h" #include "RimWellPath.h" #include "RimWellPathCollection.h" #include "RimWellPathFracture.h" #include "RimWellPathFractureCollection.h" +#include "RimFishboneWellPath.h" +#include "RimFishbonesCollection.h" +#include "RimFishboneWellPathCollection.h" +#include "RimPerforationInterval.h" +#include "RimPerforationCollection.h" +#include "RivFishbonesSubsPartMgr.h" +#include "RivPartPriority.h" #include "RivPipeGeometryGenerator.h" #include "RivPartPriority.h" #include "RivWellFracturePartMgr.h" #include "RivWellPathPartMgr.h" #include "RivWellPathSourceInfo.h" +#include "RivObjectSourceInfo.h" #include "cafDisplayCoordTransform.h" #include "cafEffectGenerator.h" +#include "cafDisplayCoordTransform.h" #include "cvfDrawableGeo.h" #include "cvfDrawableText.h" @@ -101,16 +111,124 @@ void RivWellPathPartMgr::appendFracturePartsToModel(cvf::ModelBasicList* model, } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RivWellPathPartMgr::appendFishbonesPartsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize) +{ + if (!m_rimWellPath || !m_rimWellPath->fishbonesCollection()->isChecked()) return; + + // This concept is taken from RivReservoirSimWellsPartMgr, and is required to be able to have + // separate part managers for each view + if (m_fishbonesPartMgrs.size() != m_rimWellPath->fishbonesCollection()->fishbonesSubs.size()) + { + m_fishbonesPartMgrs.clear(); + + for (auto rimFishboneSubs : m_rimWellPath->fishbonesCollection()->fishbonesSubs()) + { + m_fishbonesPartMgrs.push_back(new RivFishbonesSubsPartMgr(rimFishboneSubs)); + } + } + + for (auto rivFishbonesPartManager : m_fishbonesPartMgrs) + { + rivFishbonesPartManager->appendGeometryPartsToModel(model, displayCoordTransform, characteristicCellSize); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RivWellPathPartMgr::appendCompletionsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize) +{ + if (!m_rimWellPath || !m_rimWellPath->fishbonesCollection()->wellPathCollection()->isChecked()) return; + + RivPipeGeometryGenerator geoGenerator; + std::vector fishbonesWellPaths; + m_rimWellPath->descendantsIncludingThisOfType(fishbonesWellPaths); + for (RimFishboneWellPath* fbWellPath : fishbonesWellPaths) + { + if (!fbWellPath->isChecked()) continue; + + std::vector displayCoords; + for (auto lateralDomainCoords : fbWellPath->coordinates()) + { + displayCoords.push_back(displayCoordTransform->transformToDisplayCoord(lateralDomainCoords)); + } + + cvf::ref objectSourceInfo = new RivObjectSourceInfo(fbWellPath); + + cvf::Collection parts; + geoGenerator.cylinderWithCenterLineParts(&parts, displayCoords, m_rimWellPath->wellPathColor(), m_rimWellPath->combinedScaleFactor() * characteristicCellSize * 0.5); + for (auto part : parts) + { + part->setSourceInfo(objectSourceInfo.p()); + model->addPart(part.p()); + } + } + +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RivWellPathPartMgr::appendPerforationsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize) +{ + if (!m_rimWellPath || !m_rimWellPath->perforationIntervalCollection()->isChecked()) return; + + RimWellPathCollection* wellPathCollection = this->wellPathCollection(); + if (!wellPathCollection) return; + + RigWellPath* wellPathGeometry = m_rimWellPath->wellPathGeometry(); + if (!wellPathGeometry) return; + + // Since we're using the index of measured depths to find the index of a point, ensure they're equal + CVF_ASSERT(wellPathGeometry->m_measuredDepths.size() == wellPathGeometry->m_wellPathPoints.size()); + + double wellPathRadius = this->wellPathRadius(characteristicCellSize, wellPathCollection); + double perforationRadius = wellPathRadius * 1.1; + + RivPipeGeometryGenerator geoGenerator; + std::vector perforations; + m_rimWellPath->descendantsIncludingThisOfType(perforations); + for (RimPerforationInterval* perforation : perforations) + { + if (!perforation->isChecked()) continue; + if (perforation->startMD() > perforation->endMD()) continue; + + std::vector displayCoords; + displayCoords.push_back(displayCoordTransform->transformToDisplayCoord(wellPathGeometry->interpolatedPointAlongWellPath(perforation->startMD()))); + for (size_t i = 0; i < wellPathGeometry->m_measuredDepths.size(); ++i) + { + double measuredDepth = wellPathGeometry->m_measuredDepths[i]; + if (measuredDepth > perforation->startMD() && measuredDepth < perforation->endMD()) + { + displayCoords.push_back(displayCoordTransform->transformToDisplayCoord(wellPathGeometry->m_wellPathPoints[i])); + } + } + displayCoords.push_back(displayCoordTransform->transformToDisplayCoord(wellPathGeometry->interpolatedPointAlongWellPath(perforation->endMD()))); + + if (displayCoords.size() < 2) continue; + + cvf::ref objectSourceInfo = new RivObjectSourceInfo(perforation); + + cvf::Collection parts; + geoGenerator.cylinderWithCenterLineParts(&parts, displayCoords, cvf::Color3f::GREEN, perforationRadius); + for (auto part : parts) + { + part->setSourceInfo(objectSourceInfo.p()); + model->addPart(part.p()); + } + } +} + //-------------------------------------------------------------------------------------------------- /// The pipe geometry needs to be rebuilt on scale change to keep the pipes round //-------------------------------------------------------------------------------------------------- void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, double characteristicCellSize, cvf::BoundingBox wellPathClipBoundingBox) { - if (!m_rimWellPath) return; - - RimWellPathCollection* wellPathCollection = NULL; - m_rimWellPath->firstAncestorOrThisOfType(wellPathCollection); + RimWellPathCollection* wellPathCollection = this->wellPathCollection(); if (!wellPathCollection) return; RigWellPath* wellPathGeometry = m_rimWellPath->wellPathGeometry(); @@ -119,7 +237,7 @@ void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, doubl if (wellPathGeometry->m_wellPathPoints.size() < 2) return; clearAllBranchData(); - double wellPathRadius = wellPathCollection->wellPathRadiusScaleFactor() * m_rimWellPath->wellPathRadiusScaleFactor() * characteristicCellSize; + double wellPathRadius = this->wellPathRadius(characteristicCellSize, wellPathCollection); cvf::Vec3d textPosition = wellPathGeometry->m_wellPathPoints[0]; @@ -253,12 +371,10 @@ void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, doubl /// //-------------------------------------------------------------------------------------------------- void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* model, cvf::Vec3d displayModelOffset, - double characteristicCellSize, cvf::BoundingBox wellPathClipBoundingBox, caf::DisplayCoordTransform* displayCoordTransform) + double characteristicCellSize, cvf::BoundingBox wellPathClipBoundingBox, + caf::DisplayCoordTransform* displayCoordTransform) { - if (!m_rimWellPath) return; - - RimWellPathCollection* wellPathCollection = nullptr; - m_rimWellPath->firstAncestorOrThisOfType(wellPathCollection); + RimWellPathCollection* wellPathCollection = this->wellPathCollection(); if (!wellPathCollection) return; if (wellPathCollection->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_OFF) @@ -295,6 +411,10 @@ void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* m } appendFracturePartsToModel(model, displayCoordTransform); + + appendFishbonesPartsToModel(model, displayCoordTransform, characteristicCellSize); + appendCompletionsToModel(model, displayCoordTransform, characteristicCellSize); + appendPerforationsToModel(model, displayCoordTransform, characteristicCellSize); } //-------------------------------------------------------------------------------------------------- @@ -315,6 +435,8 @@ void RivWellPathPartMgr::setScaleTransform( cvf::Transform * scaleTransform ) void RivWellPathPartMgr::scheduleGeometryRegen() { m_needsTransformUpdate = true; + + m_fishbonesPartMgrs.clear(); } //-------------------------------------------------------------------------------------------------- @@ -336,3 +458,24 @@ size_t RivWellPathPartMgr::segmentIndexFromTriangleIndex(size_t triangleIndex) { return m_pipeBranchData.m_pipeGeomGenerator->segmentIndexFromTriangleIndex(triangleIndex); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellPathCollection* RivWellPathPartMgr::wellPathCollection() +{ + if (!m_rimWellPath) return nullptr; + + RimWellPathCollection* wellPathCollection = nullptr; + m_rimWellPath->firstAncestorOrThisOfType(wellPathCollection); + + return wellPathCollection; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RivWellPathPartMgr::wellPathRadius(double characteristicCellSize, RimWellPathCollection* wellPathCollection) +{ + return wellPathCollection->wellPathRadiusScaleFactor() * m_rimWellPath->wellPathRadiusScaleFactor() * characteristicCellSize; +} diff --git a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.h b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.h index 987f6f9874..613965abb4 100644 --- a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.h +++ b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.h @@ -22,6 +22,7 @@ #include "cafPdmPointer.h" #include "cvfBoundingBox.h" +#include "cvfCollection.h" namespace cvf { @@ -41,6 +42,8 @@ namespace caf class RivPipeGeometryGenerator; class RimProject; class RimWellPath; +class RivFishbonesSubsPartMgr; +class RimWellPathCollection; class RivWellPathPartMgr : public cvf::Object { @@ -52,16 +55,21 @@ public: void scheduleGeometryRegen(); - void appendStaticGeometryPartsToModel( cvf::ModelBasicList* model, cvf::Vec3d displayModelOffset, - double characteristicCellSize, cvf::BoundingBox wellPathClipBoundingBox, - caf::DisplayCoordTransform* displayCoordTransform); + void appendStaticGeometryPartsToModel(cvf::ModelBasicList* model, cvf::Vec3d displayModelOffset, + double characteristicCellSize, cvf::BoundingBox wellPathClipBoundingBox, + caf::DisplayCoordTransform* displayCoordTransform); size_t segmentIndexFromTriangleIndex(size_t triangleIndex); private: - void appendFracturePartsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform); + void appendFishbonesPartsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize); + void appendCompletionsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize); + void appendPerforationsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize); void buildWellPathParts(cvf::Vec3d displayModelOffset, double characteristicCellSize, cvf::BoundingBox wellPathClipBoundingBox); + inline RimWellPathCollection* wellPathCollection(); + inline double wellPathRadius(double characteristicCellSize, RimWellPathCollection* wellPathCollection); + void appendFracturePartsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform); void clearAllBranchData(); private: @@ -85,4 +93,6 @@ private: cvf::ref m_scalarMapper; cvf::ref m_scalarMapperSurfaceEffect; cvf::ref m_scalarMapperMeshEffect; + + cvf::Collection m_fishbonesPartMgrs; }; diff --git a/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake b/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake index 02daa2a9a5..ba374697e2 100644 --- a/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake +++ b/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake @@ -7,6 +7,8 @@ endif() set (SOURCE_GROUP_HEADER_FILES ${CEE_CURRENT_LIST_DIR}RimEclipseCaseCollection.h ${CEE_CURRENT_LIST_DIR}RimCaseCollection.h +${CEE_CURRENT_LIST_DIR}RimCaseAndFileExportSettings.h +${CEE_CURRENT_LIST_DIR}RimExportCompletionDataSettings.h ${CEE_CURRENT_LIST_DIR}RimCellFilter.h ${CEE_CURRENT_LIST_DIR}RimEclipsePropertyFilter.h ${CEE_CURRENT_LIST_DIR}RimPropertyFilterCollection.h @@ -16,6 +18,8 @@ ${CEE_CURRENT_LIST_DIR}RimCellRangeFilterCollection.h ${CEE_CURRENT_LIST_DIR}RimDefines.h ${CEE_CURRENT_LIST_DIR}RimLegendConfig.h ${CEE_CURRENT_LIST_DIR}RimOilField.h +${CEE_CURRENT_LIST_DIR}RimPerforationCollection.h +${CEE_CURRENT_LIST_DIR}RimPerforationInterval.h ${CEE_CURRENT_LIST_DIR}RimProject.h ${CEE_CURRENT_LIST_DIR}RimEclipseCase.h ${CEE_CURRENT_LIST_DIR}RimIdenticalGridCaseGroup.h @@ -31,6 +35,8 @@ ${CEE_CURRENT_LIST_DIR}RimEclipseWell.h ${CEE_CURRENT_LIST_DIR}RimEclipseWellCollection.h ${CEE_CURRENT_LIST_DIR}RimWellPath.h ${CEE_CURRENT_LIST_DIR}RimWellPathCollection.h +${CEE_CURRENT_LIST_DIR}RimFishboneWellPath.h +${CEE_CURRENT_LIST_DIR}RimFishboneWellPathCollection.h ${CEE_CURRENT_LIST_DIR}RimScriptCollection.h ${CEE_CURRENT_LIST_DIR}RimEclipseStatisticsCase.h ${CEE_CURRENT_LIST_DIR}RimEclipseStatisticsCaseCollection.h @@ -90,6 +96,7 @@ ${CEE_CURRENT_LIST_DIR}RimCheckableNamedObject.h ${CEE_CURRENT_LIST_DIR}RimGridTimeHistoryCurve.h ${CEE_CURRENT_LIST_DIR}RimGeometrySelectionItem.h ${CEE_CURRENT_LIST_DIR}RimEclipseGeometrySelectionItem.h +${CEE_CURRENT_LIST_DIR}RimWellPathCompletions.h ${CEE_CURRENT_LIST_DIR}RimEllipseFractureTemplate.h ${CEE_CURRENT_LIST_DIR}RimFractureTemplateCollection.h ${CEE_CURRENT_LIST_DIR}RimFracture.h @@ -107,6 +114,8 @@ ${CEE_CURRENT_LIST_DIR}RimStimPlanColors.h set (SOURCE_GROUP_SOURCE_FILES ${CEE_CURRENT_LIST_DIR}RimEclipseCaseCollection.cpp ${CEE_CURRENT_LIST_DIR}RimCaseCollection.cpp +${CEE_CURRENT_LIST_DIR}RimCaseAndFileExportSettings.cpp +${CEE_CURRENT_LIST_DIR}RimExportCompletionDataSettings.cpp ${CEE_CURRENT_LIST_DIR}RimCellFilter.cpp ${CEE_CURRENT_LIST_DIR}RimEclipsePropertyFilter.cpp ${CEE_CURRENT_LIST_DIR}RimPropertyFilterCollection.cpp @@ -116,6 +125,8 @@ ${CEE_CURRENT_LIST_DIR}RimCellRangeFilterCollection.cpp ${CEE_CURRENT_LIST_DIR}RimDefines.cpp ${CEE_CURRENT_LIST_DIR}RimLegendConfig.cpp ${CEE_CURRENT_LIST_DIR}RimOilField.cpp +${CEE_CURRENT_LIST_DIR}RimPerforationCollection.cpp +${CEE_CURRENT_LIST_DIR}RimPerforationInterval.cpp ${CEE_CURRENT_LIST_DIR}RimProject.cpp ${CEE_CURRENT_LIST_DIR}RimEclipseCase.cpp ${CEE_CURRENT_LIST_DIR}RimIdenticalGridCaseGroup.cpp @@ -131,6 +142,8 @@ ${CEE_CURRENT_LIST_DIR}RimEclipseWell.cpp ${CEE_CURRENT_LIST_DIR}RimEclipseWellCollection.cpp ${CEE_CURRENT_LIST_DIR}RimWellPath.cpp ${CEE_CURRENT_LIST_DIR}RimWellPathCollection.cpp +${CEE_CURRENT_LIST_DIR}RimFishboneWellPath.cpp +${CEE_CURRENT_LIST_DIR}RimFishboneWellPathCollection.cpp ${CEE_CURRENT_LIST_DIR}RimScriptCollection.cpp ${CEE_CURRENT_LIST_DIR}RimEclipseStatisticsCase.cpp ${CEE_CURRENT_LIST_DIR}RimEclipseStatisticsCaseCollection.cpp @@ -190,6 +203,7 @@ ${CEE_CURRENT_LIST_DIR}RimCheckableNamedObject.cpp ${CEE_CURRENT_LIST_DIR}RimGridTimeHistoryCurve.cpp ${CEE_CURRENT_LIST_DIR}RimGeometrySelectionItem.cpp ${CEE_CURRENT_LIST_DIR}RimEclipseGeometrySelectionItem.cpp +${CEE_CURRENT_LIST_DIR}RimWellPathCompletions.cpp ${CEE_CURRENT_LIST_DIR}RimEllipseFractureTemplate.cpp ${CEE_CURRENT_LIST_DIR}RimFractureTemplateCollection.cpp ${CEE_CURRENT_LIST_DIR}RimFracture.cpp @@ -214,4 +228,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES} ) + source_group( "ProjectDataModel" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CEE_CURRENT_LIST_DIR}CMakeLists_files.cmake ) diff --git a/ApplicationCode/ProjectDataModel/Fishbones/CMakeLists_files.cmake b/ApplicationCode/ProjectDataModel/Fishbones/CMakeLists_files.cmake new file mode 100644 index 0000000000..85c55ab09f --- /dev/null +++ b/ApplicationCode/ProjectDataModel/Fishbones/CMakeLists_files.cmake @@ -0,0 +1,25 @@ + +# Use this workaround until we're on 2.8.3 on all platforms and can use CMAKE_CURRENT_LIST_DIR directly +if (${CMAKE_VERSION} VERSION_GREATER "2.8.2") + set(CEE_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_DIR}/) +endif() + +set (SOURCE_GROUP_HEADER_FILES +${CEE_CURRENT_LIST_DIR}RimFishbonesMultipleSubs.h +${CEE_CURRENT_LIST_DIR}RimFishbonesCollection.h +) + +set (SOURCE_GROUP_SOURCE_FILES +${CEE_CURRENT_LIST_DIR}RimFishbonesMultipleSubs.cpp +${CEE_CURRENT_LIST_DIR}RimFishbonesCollection.cpp +) + +list(APPEND CODE_HEADER_FILES +${SOURCE_GROUP_HEADER_FILES} +) + +list(APPEND CODE_SOURCE_FILES +${SOURCE_GROUP_SOURCE_FILES} +) + +source_group( "ProjectDataModel\\Fishbones" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CEE_CURRENT_LIST_DIR}CMakeLists_files.cmake ) diff --git a/ApplicationCode/ProjectDataModel/Fishbones/RimFishbonesCollection.cpp b/ApplicationCode/ProjectDataModel/Fishbones/RimFishbonesCollection.cpp new file mode 100644 index 0000000000..f1bf07844b --- /dev/null +++ b/ApplicationCode/ProjectDataModel/Fishbones/RimFishbonesCollection.cpp @@ -0,0 +1,70 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimFishbonesCollection.h" + +#include "RifWellPathImporter.h" + +#include "RigWellPath.h" + +#include "RimFishboneWellPathCollection.h" +#include "RimFishbonesMultipleSubs.h" +#include "RimProject.h" + + +CAF_PDM_SOURCE_INIT(RimFishbonesCollection, "FishbonesCollection"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimFishbonesCollection::RimFishbonesCollection() +{ + CAF_PDM_InitObject("Fishbones", ":/Folder.png", "", ""); + + m_name.uiCapability()->setUiHidden(true); + m_name = "Fishbones"; + + CAF_PDM_InitFieldNoDefault(&fishbonesSubs, "FishbonesSubs", "fishbonesSubs", "", "", ""); + + fishbonesSubs.uiCapability()->setUiHidden(true); + + CAF_PDM_InitFieldNoDefault(&m_wellPathCollection, "WellPathCollection", "Well Paths", "", "", ""); + m_wellPathCollection = new RimFishboneWellPathCollection; + m_wellPathCollection.uiCapability()->setUiHidden(true); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimFishboneWellPathCollection* RimFishbonesCollection::wellPathCollection() const +{ + CVF_ASSERT(m_wellPathCollection); + + return m_wellPathCollection(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFishbonesCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) +{ + RimProject* proj; + this->firstAncestorOrThisOfTypeAsserted(proj); + proj->createDisplayModelAndRedrawAllViews(); +} + diff --git a/ApplicationCode/ProjectDataModel/Fishbones/RimFishbonesCollection.h b/ApplicationCode/ProjectDataModel/Fishbones/RimFishbonesCollection.h new file mode 100644 index 0000000000..3ad0e84eee --- /dev/null +++ b/ApplicationCode/ProjectDataModel/Fishbones/RimFishbonesCollection.h @@ -0,0 +1,50 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RimCheckableNamedObject.h" + +#include "cafPdmChildArrayField.h" +#include "cafPdmChildField.h" + +class RimFishbonesMultipleSubs; +class RimFishboneWellPathCollection; + +//================================================================================================== +// +// +// +//================================================================================================== +class RimFishbonesCollection : public RimCheckableNamedObject +{ + CAF_PDM_HEADER_INIT; + +public: + RimFishbonesCollection(); + + RimFishboneWellPathCollection* wellPathCollection() const; + + caf::PdmChildArrayField fishbonesSubs; + +protected: + virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; + +private: + caf::PdmChildField m_wellPathCollection; +}; diff --git a/ApplicationCode/ProjectDataModel/Fishbones/RimFishbonesMultipleSubs.cpp b/ApplicationCode/ProjectDataModel/Fishbones/RimFishbonesMultipleSubs.cpp new file mode 100644 index 0000000000..e3743ba9c4 --- /dev/null +++ b/ApplicationCode/ProjectDataModel/Fishbones/RimFishbonesMultipleSubs.cpp @@ -0,0 +1,512 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimFishbonesMultipleSubs.h" + +#include "RigFishbonesGeometry.h" +#include "RigWellPath.h" +#include "RimProject.h" +#include "RimWellPath.h" + +#include "cafPdmUiListEditor.h" + +#include "cvfAssert.h" +#include "cvfBoundingBox.h" + +#include + + +CAF_PDM_SOURCE_INIT(RimFishbonesMultipleSubs, "FishbonesMultipleSubs"); + +namespace caf { + template<> + void AppEnum::setUp() + { + addItem(RimFishbonesMultipleSubs::FB_SUB_COUNT_END, "FB_SUB_COUNT", "Start/End/Number of Subs"); + addItem(RimFishbonesMultipleSubs::FB_SUB_SPACING_END, "FB_SUB_SPACING", "Start/End/Spacing"); + addItem(RimFishbonesMultipleSubs::FB_SUB_USER_DEFINED, "FB_SUB_CUSTOM", "User Specification"); + setDefault(RimFishbonesMultipleSubs::FB_SUB_COUNT_END); + } + + template<> + void AppEnum::setUp() + { + addItem(RimFishbonesMultipleSubs::FB_LATERAL_ORIENTATION_FIXED, "FB_LATERAL_ORIENTATION_FIXED", "Fixed Angle"); + addItem(RimFishbonesMultipleSubs::FB_LATERAL_ORIENTATION_RANDOM, "FB_LATERAL_ORIENTATION_RANDOM", "Random Angle"); + setDefault(RimFishbonesMultipleSubs::FB_LATERAL_ORIENTATION_RANDOM); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimFishbonesMultipleSubs::RimFishbonesMultipleSubs() +{ + CAF_PDM_InitObject("FishbonesMultipleSubs", ":/Default.png", "", ""); + + CAF_PDM_InitField(&m_lateralCountPerSub, "LateralCountPerSub", size_t(3), "Laterals Per Sub", "", "", ""); + CAF_PDM_InitField(&m_lateralLength, "LateralLength", QString("12.0"), "Length(s) [m]", "", "Specify multiple length values if the sub lengths differ", ""); + + CAF_PDM_InitField(&m_lateralExitAngle, "LateralExitAngle", 35.0, "Exit Angle [deg]", "", "", ""); + CAF_PDM_InitField(&m_lateralBuildAngle, "LateralBuildAngle", 5.0, "Build Angle [deg/m]", "", "", ""); + + CAF_PDM_InitField(&m_lateralHoleRadius, "LateralHoleRadius", 12.0, "Hole Radius [mm]", "", "", ""); + CAF_PDM_InitField(&m_lateralTubingRadius, "LateralTubingRadius", 8.0, "Tubing Radius [mm]", "", "", ""); + + CAF_PDM_InitField(&m_lateralOpenHoleRoghnessFactor, "LateralOpenHoleRoghnessFactor", 0.001, "Open Hole Roghness Factor [m]", "", "", ""); + CAF_PDM_InitField(&m_lateralTubingRoghnessFactor, "LateralTubingRoghnessFactor", 1e-5, "Tubing Roghness Factor [m]", "", "", ""); + + CAF_PDM_InitField(&m_lateralLengthFraction, "LateralLengthFraction", 0.8, "Length Fraction [0..1]", "", "", ""); + CAF_PDM_InitField(&m_lateralInstallFraction, "LateralInstallFraction", 0.7, "Install Fraction [0..1]", "", "", ""); + CAF_PDM_InitField(&m_skinFactor, "SkinFactor", 1.0, "Skin Factor [0..1]", "", "", ""); + + CAF_PDM_InitField(&m_icdCount, "IcdCount", size_t(2), "ICD Count", "", "", ""); + CAF_PDM_InitField(&m_icdOrificeRadius, "IcdOrificeRadius", 8.0, "ICD Orifice Radius [mm]", "", "", ""); + + CAF_PDM_InitFieldNoDefault(&m_locationOfSubs, "LocationOfSubs", "Measured Depths [m]", "", "", ""); + m_locationOfSubs.uiCapability()->setUiEditorTypeName(caf::PdmUiListEditor::uiEditorTypeName()); + + CAF_PDM_InitField(&m_subsLocationMode, "SubsLocationMode", caf::AppEnum(FB_SUB_COUNT_END), "Location Defined By", "", "", ""); + CAF_PDM_InitField(&m_rangeStart, "RangeStart", 100.0, "Start MD [m]", "", "", ""); + CAF_PDM_InitField(&m_rangeEnd, "RangeEnd", 250.0, "End MD [m]", "", "", ""); + CAF_PDM_InitField(&m_rangeSubSpacing, "RangeSubSpacing", 40.0, "Spacing [m]", "", "", ""); + CAF_PDM_InitField(&m_rangeSubCount, "RangeSubCount", size_t(25), "Number of Subs", "", "", ""); + + CAF_PDM_InitField(&m_subsOrientationMode, "SubsOrientationMode", caf::AppEnum(FB_LATERAL_ORIENTATION_RANDOM), "Orientation", "", "", ""); + + CAF_PDM_InitFieldNoDefault(&m_installationRotationAngles, "InstallationRotationAngles", "Installation Rotation Angles [deg]", "", "", ""); + m_installationRotationAngles.uiCapability()->setUiHidden(true); + CAF_PDM_InitField(&m_fixedInstallationRotationAngle, "FixedInstallationRotationAngle", 0.0, " Fixed Angle [deg]", "", "", ""); + + m_name.uiCapability()->setUiReadOnly(true); + + m_rigFishbonesGeometry = std::unique_ptr(new RigFisbonesGeometry(this)); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimFishbonesMultipleSubs::~RimFishbonesMultipleSubs() +{ + +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFishbonesMultipleSubs::setMeasuredDepthAndCount(double measuredDepth, double spacing, int subCount) +{ + m_subsLocationMode = FB_SUB_SPACING_END; + + m_rangeStart = measuredDepth; + m_rangeEnd = measuredDepth + spacing * subCount; + m_rangeSubCount = subCount; + + computeRangesAndLocations(); + computeRotationAngles(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimFishbonesMultipleSubs::locationOfSubs() const +{ + return m_locationOfSubs; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimFishbonesMultipleSubs::rotationAngle(size_t index) const +{ + if (m_subsOrientationMode == FB_LATERAL_ORIENTATION_FIXED) + { + return m_fixedInstallationRotationAngle; + } + else + { + CVF_ASSERT(index < m_installationRotationAngles().size()); + + return m_installationRotationAngles()[index]; + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimFishbonesMultipleSubs::exitAngle() const +{ + return m_lateralExitAngle; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimFishbonesMultipleSubs::buildAngle() const +{ + return m_lateralBuildAngle; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimFishbonesMultipleSubs::tubingRadius() const +{ + return m_lateralTubingRadius; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimFishbonesMultipleSubs::lateralCountPerSub() const +{ + return m_lateralCountPerSub; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimFishbonesMultipleSubs::lateralLengths() const +{ + QStringList items = m_lateralLength().split(' '); + double currentLength = 0.0; + + std::vector lengths; + for (int i = 0; i < static_cast(m_lateralCountPerSub); i++) + { + if (i < items.size()) + { + bool conversionOk = false; + double candidateValue = items[i].toDouble(&conversionOk); + if (conversionOk) + { + currentLength = candidateValue; + } + } + + lengths.push_back(currentLength); + } + + return lengths; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimFishbonesMultipleSubs::coordsForLateral(size_t subIndex, size_t lateralIndex) const +{ + std::vector> coordsAndMD = m_rigFishbonesGeometry->coordsForLateral(subIndex, lateralIndex); + + std::vector domainCoords; + for (const auto& coordMD : coordsAndMD) + { + domainCoords.push_back(coordMD.first); + } + + return domainCoords; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector> RimFishbonesMultipleSubs::coordsAndMDForLateral(size_t subIndex, size_t lateralIndex) const +{ + return m_rigFishbonesGeometry->coordsForLateral(subIndex, lateralIndex); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFishbonesMultipleSubs::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) +{ + bool recomputeLocations = false; + + if (changedField == &m_subsLocationMode) + { + if (m_subsLocationMode == FB_SUB_COUNT_END || m_subsLocationMode == FB_SUB_SPACING_END) + { + recomputeLocations = true; + } + } + + if (changedField == &m_rangeStart || + changedField == &m_rangeEnd || + changedField == &m_rangeSubCount || + changedField == &m_rangeSubSpacing) + { + recomputeLocations = true; + } + + if (recomputeLocations) + { + computeRangesAndLocations(); + } + + if (recomputeLocations || + changedField == &m_locationOfSubs || + changedField == &m_subsOrientationMode) + { + computeRotationAngles(); + } + + RimProject* proj; + this->firstAncestorOrThisOfTypeAsserted(proj); + proj->createDisplayModelAndRedrawAllViews(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFishbonesMultipleSubs::computeRangesAndLocations() +{ + if (m_subsLocationMode == FB_SUB_COUNT_END) + { + size_t divisor = 1; + if (m_rangeSubCount > 2) divisor = m_rangeSubCount - 1; + + m_rangeSubSpacing = fabs(m_rangeStart - m_rangeEnd) / divisor; + } + else if (m_subsLocationMode == FB_SUB_SPACING_END) + { + m_rangeSubCount = (fabs(m_rangeStart - m_rangeEnd) / m_rangeSubSpacing) + 1; + + if (m_rangeSubCount < 1) + { + m_rangeSubCount = 1; + } + } + + if (m_subsLocationMode == FB_SUB_COUNT_END || m_subsLocationMode == FB_SUB_SPACING_END) + { + std::vector validMeasuredDepths; + { + RimWellPath* wellPath = nullptr; + this->firstAncestorOrThisOfTypeAsserted(wellPath); + + RigWellPath* rigWellPathGeo = wellPath->wellPathGeometry(); + if (rigWellPathGeo && rigWellPathGeo->m_measuredDepths.size() > 1) + { + double firstWellPathMD = rigWellPathGeo->m_measuredDepths.front(); + double lastWellPathMD = rigWellPathGeo->m_measuredDepths.back(); + + for (auto md : locationsFromStartSpacingAndCount(m_rangeStart, m_rangeSubSpacing, m_rangeSubCount)) + { + if (md > firstWellPathMD && md < lastWellPathMD) + { + validMeasuredDepths.push_back(md); + } + } + } + } + + m_locationOfSubs = validMeasuredDepths; + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFishbonesMultipleSubs::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) +{ + { + caf::PdmUiGroup* group = uiOrdering.addNewGroup("Location"); + + group->add(&m_subsLocationMode); + if (m_subsLocationMode() != FB_SUB_USER_DEFINED) + { + group->add(&m_rangeStart); + group->add(&m_rangeEnd); + + if (m_subsLocationMode() == FB_SUB_COUNT_END) + { + group->add(&m_rangeSubCount); + group->add(&m_rangeSubSpacing); + } + else if (m_subsLocationMode() == FB_SUB_SPACING_END) + { + group->add(&m_rangeSubSpacing); + group->add(&m_rangeSubCount); + } + } + + group->add(&m_locationOfSubs); + } + + { + caf::PdmUiGroup* lateralConfigGroup = uiOrdering.addNewGroup("Lateral Configuration"); + + lateralConfigGroup->add(&m_lateralCountPerSub); + lateralConfigGroup->add(&m_lateralLength); + + lateralConfigGroup->add(&m_lateralExitAngle); + lateralConfigGroup->add(&m_lateralBuildAngle); + + lateralConfigGroup->add(&m_subsOrientationMode); + if (m_subsOrientationMode == FB_LATERAL_ORIENTATION_FIXED) + { + lateralConfigGroup->add(&m_fixedInstallationRotationAngle); + } + + { + caf::PdmUiGroup* wellGroup = lateralConfigGroup->addNewGroup("Well Properties"); + + wellGroup->add(&m_lateralHoleRadius); + wellGroup->add(&m_skinFactor); + } + + { + caf::PdmUiGroup* successGroup = lateralConfigGroup->addNewGroup("Installation Success Fractions"); + successGroup->setCollapsedByDefault(true); + + successGroup->add(&m_lateralLengthFraction); + successGroup->add(&m_lateralInstallFraction); + } + } + + { + caf::PdmUiGroup* mswGroup = uiOrdering.addNewGroup("Multi Segment Wells"); + mswGroup->setCollapsedByDefault(true); + mswGroup->add(&m_lateralTubingRadius); + mswGroup->add(&m_lateralOpenHoleRoghnessFactor); + mswGroup->add(&m_lateralTubingRoghnessFactor); + mswGroup->add(&m_icdCount); + mswGroup->add(&m_icdOrificeRadius); + } + + // Visibility + + if (m_subsLocationMode == FB_SUB_USER_DEFINED) + { + m_locationOfSubs.uiCapability()->setUiReadOnly(false); + + m_rangeSubSpacing.uiCapability()->setUiReadOnly(true); + m_rangeSubCount.uiCapability()->setUiReadOnly(true); + m_rangeStart.uiCapability()->setUiReadOnly(true); + m_rangeEnd.uiCapability()->setUiReadOnly(true); + } + else + { + m_locationOfSubs.uiCapability()->setUiReadOnly(true); + + m_rangeSubSpacing.uiCapability()->setUiReadOnly(false); + m_rangeSubCount.uiCapability()->setUiReadOnly(false); + m_rangeStart.uiCapability()->setUiReadOnly(false); + m_rangeEnd.uiCapability()->setUiReadOnly(false); + + if (m_subsLocationMode == FB_SUB_COUNT_END) + { + m_rangeSubSpacing.uiCapability()->setUiReadOnly(true); + m_rangeSubCount.uiCapability()->setUiReadOnly(false); + } + else + { + m_rangeSubSpacing.uiCapability()->setUiReadOnly(false); + m_rangeSubCount.uiCapability()->setUiReadOnly(true); + } + } + + uiOrdering.skipRemainingFields(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFishbonesMultipleSubs::initAfterRead() +{ + if (m_locationOfSubs().size() != m_installationRotationAngles().size()) + { + computeRotationAngles(); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFishbonesMultipleSubs::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/) +{ + caf::PdmChildArrayField* container = dynamic_cast*>(this->parentField()); + CVF_ASSERT(container); + + size_t index = container->index(this); + m_name = QString("Fishbone %1").arg(index); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +cvf::BoundingBox RimFishbonesMultipleSubs::boundingBoxInDomainCoords() +{ + cvf::BoundingBox bb; + + for (size_t i = 0; i < m_locationOfSubs().size(); i++) + { + for (size_t lateralIndex = 0; lateralIndex < m_lateralCountPerSub; lateralIndex++) + { + std::vector coords = coordsForLateral(i, lateralIndex); + + for (auto c : coords) + { + bb.add(c); + } + } + } + + return bb; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFishbonesMultipleSubs::computeRotationAngles() +{ + std::vector vals; + + for (size_t i = 0; i < m_locationOfSubs().size(); i++) + { + vals.push_back(RimFishbonesMultipleSubs::randomValueFromRange(0, 360)); + } + + m_installationRotationAngles = vals; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimFishbonesMultipleSubs::locationsFromStartSpacingAndCount(double start, double spacing, size_t count) +{ + std::vector measuredDepths; + + for (size_t i = 0; i < count; i++) + { + measuredDepths.push_back(start + spacing * i); + } + + return measuredDepths; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +int RimFishbonesMultipleSubs::randomValueFromRange(int min, int max) +{ + int range = abs(max - min); + int random_integer = min + int(range*rand() / (RAND_MAX + 1.0)); + + return random_integer; +} + diff --git a/ApplicationCode/ProjectDataModel/Fishbones/RimFishbonesMultipleSubs.h b/ApplicationCode/ProjectDataModel/Fishbones/RimFishbonesMultipleSubs.h new file mode 100644 index 0000000000..de8c8eff03 --- /dev/null +++ b/ApplicationCode/ProjectDataModel/Fishbones/RimFishbonesMultipleSubs.h @@ -0,0 +1,128 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RimCheckableNamedObject.h" +#include "Rim3dPropertiesInterface.h" + +#include "cvfBase.h" +#include "cvfVector3.h" + +#include +#include + +class RigFisbonesGeometry; + +//================================================================================================== +/// +/// +//================================================================================================== +class RimFishbonesMultipleSubs : public RimCheckableNamedObject, public Rim3dPropertiesInterface +{ + CAF_PDM_HEADER_INIT; + +public: + enum LocationType + { + FB_SUB_COUNT_END, + FB_SUB_SPACING_END, + FB_SUB_USER_DEFINED + }; + + enum LateralsOrientationType + { + FB_LATERAL_ORIENTATION_FIXED, + FB_LATERAL_ORIENTATION_RANDOM + }; + +public: + RimFishbonesMultipleSubs(); + virtual ~RimFishbonesMultipleSubs(); + + + void setMeasuredDepthAndCount(double measuredDepth, double spacing, int subCount); + + std::vector locationOfSubs() const; + + double rotationAngle(size_t index) const; + double exitAngle() const; + double buildAngle() const; + + double tubingRadius() const; + double holeRadius() const { return m_lateralHoleRadius(); } + double openHoleRoughnessFactor() const { return m_lateralOpenHoleRoghnessFactor(); } + double lateralCountPerSub() const; + std::vector lateralLengths() const; + + std::vector coordsForLateral(size_t subIndex, size_t lateralIndex) const; + std::vector> coordsAndMDForLateral(size_t subIndex, size_t lateralIndex) const; + + // Override from Rim3dPropertiesInterface + virtual cvf::BoundingBox boundingBoxInDomainCoords() override; + +protected: + virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; + + virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override; + virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; + virtual void initAfterRead() override; + +private: + void computeRangesAndLocations(); + void computeRotationAngles(); + + static std::vector locationsFromStartSpacingAndCount(double start, double spacing, size_t count); + static int randomValueFromRange(int min, int max); + +private: + caf::PdmField m_lateralCountPerSub; + caf::PdmField m_lateralLength; + + caf::PdmField m_lateralExitAngle; + caf::PdmField m_lateralBuildAngle; + + caf::PdmField m_skinFactor; + + caf::PdmField m_lateralHoleRadius; + caf::PdmField m_lateralTubingRadius; + + caf::PdmField m_lateralOpenHoleRoghnessFactor; + caf::PdmField m_lateralTubingRoghnessFactor; + + caf::PdmField m_lateralLengthFraction; + caf::PdmField m_lateralInstallFraction; + + caf::PdmField m_icdCount; + caf::PdmField m_icdOrificeRadius; + + caf::PdmField > m_subsLocationMode; + caf::PdmField m_rangeStart; + caf::PdmField m_rangeEnd; + caf::PdmField m_rangeSubSpacing; + caf::PdmField m_rangeSubCount; + + caf::PdmField > m_subsOrientationMode; + + caf::PdmField> m_locationOfSubs; // Given in measured depth + + caf::PdmField> m_installationRotationAngles; + caf::PdmField m_fixedInstallationRotationAngle; + + std::unique_ptr m_rigFishbonesGeometry; +}; diff --git a/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp index 09bfa0ffab..db3622ec06 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp @@ -26,6 +26,8 @@ #include "RiuFlowCharacteristicsPlot.h" +#include "cafPdmUiCheckBoxEditor.h" + #include // Needed for HUGE_VAL on Linux @@ -57,6 +59,8 @@ RimFlowCharacteristicsPlot::RimFlowCharacteristicsPlot() CAF_PDM_InitFieldNoDefault(&m_timeStepSelectionType, "TimeSelectionType", "Time Steps", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_selectedTimeSteps, "SelectedTimeSteps", "", "", "", ""); + CAF_PDM_InitField(&m_showLegend, "ShowLegend", true, "Legend", "", "", ""); + this->m_showWindow = false; setAsPlotMdiWindow(); } @@ -167,11 +171,11 @@ QList RimFlowCharacteristicsPlot::calculateValueOptions( RigFlowDiagResults* flowResult = m_flowDiagSolution->flowDiagResults(); std::vector calculatedTimesteps = flowResult->calculatedTimeSteps(); - std::vector timeStepDates = m_case->timeStepDates(); + QStringList timeStepDates = m_case->timeStepStrings(); for ( int tsIdx : calculatedTimesteps ) { - options.push_back(caf::PdmOptionItemInfo(timeStepDates[tsIdx].toString(), tsIdx)); + options.push_back(caf::PdmOptionItemInfo(timeStepDates[tsIdx], tsIdx)); } } } @@ -191,6 +195,8 @@ void RimFlowCharacteristicsPlot::defineUiOrdering(QString uiConfigName, caf::Pdm if (m_timeStepSelectionType == SELECT_AVAILABLE) uiOrdering.add(&m_selectedTimeSteps); + uiOrdering.add(&m_showLegend); + uiOrdering.skipRemainingFields(); } @@ -210,7 +216,6 @@ void RimFlowCharacteristicsPlot::zoomAll() if (m_flowCharPlotWidget) m_flowCharPlotWidget->zoomAll(); } - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -229,7 +234,6 @@ void RimFlowCharacteristicsPlot::fieldChangedByUi(const caf::PdmFieldHandle* cha this->loadDataAndUpdate(); } - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -246,8 +250,6 @@ QImage RimFlowCharacteristicsPlot::snapshotWindowContent() return image; } - - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -277,6 +279,7 @@ void RimFlowCharacteristicsPlot::loadDataAndUpdate() m_currentlyPlottedTimeSteps = calculatedTimesteps; std::vector timeStepDates = m_case->timeStepDates(); + QStringList timeStepStrings = m_case->timeStepStrings(); std::vector lorenzVals(timeStepDates.size(), HUGE_VAL); m_flowCharPlotWidget->removeAllCurves(); @@ -285,7 +288,7 @@ void RimFlowCharacteristicsPlot::loadDataAndUpdate() { lorenzVals[timeStepIdx] = flowResult->flowCharacteristicsResults(timeStepIdx).m_lorenzCoefficient; } - m_flowCharPlotWidget->setLorenzCurve(timeStepDates, lorenzVals); + m_flowCharPlotWidget->setLorenzCurve(timeStepStrings, timeStepDates, lorenzVals); for ( int timeStepIdx: calculatedTimesteps ) { @@ -299,6 +302,7 @@ void RimFlowCharacteristicsPlot::loadDataAndUpdate() flowCharResults.m_sweepEfficiencyCurve.second); } + m_flowCharPlotWidget->showLegend(m_showLegend()); } } diff --git a/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.h b/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.h index c68ea74e19..d8bfafd664 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.h +++ b/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.h @@ -86,6 +86,7 @@ private: caf::PdmPtrField m_flowDiagSolution; caf::PdmField > m_timeStepSelectionType; caf::PdmField > m_selectedTimeSteps; + caf::PdmField m_showLegend; std::vector m_currentlyPlottedTimeSteps; diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp index 86b343ef96..89d9ce4244 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp @@ -250,7 +250,6 @@ void RimWellAllocationPlot::updateFromWell() depthType == RimWellLogPlot::TRUE_VERTICAL_DEPTH ? wfCalculator->trueVerticalDepth(brIdx) : std::vector(); - if ( m_flowDiagSolution ) { std::vector tracerNames = wfCalculator->tracerNames(); for (const QString& tracerName: tracerNames) @@ -273,24 +272,7 @@ void RimWellAllocationPlot::updateFromWell() //TODO: THIs is the data to be plotted... } } - else - { - const std::vector* accFlow = nullptr; - if (depthType == RimWellLogPlot::CONNECTION_NUMBER) - { - accFlow = &(m_flowType == ACCUMULATED ? - wfCalculator->accumulatedFlowPrConnection(brIdx): - wfCalculator->flowPrConnection( brIdx)); - } - else if ( depthType == RimWellLogPlot::PSEUDO_LENGTH || depthType == RimWellLogPlot::TRUE_VERTICAL_DEPTH) - { - accFlow = &(m_flowType == ACCUMULATED ? - wfCalculator->accumulatedFlowPrPseudoLength(brIdx): - wfCalculator->flowPrPseudoLength( brIdx)); - } - addStackedCurve("Total", depthValues, *accFlow, plotTrack); - } updateWellFlowPlotXAxisTitle(plotTrack); @@ -313,10 +295,10 @@ void RimWellAllocationPlot::updateFromWell() for ( const auto& tracerVal : totalTracerFractions ) { cvf::Color3f color; - if ( m_flowDiagSolution ) + if (m_flowDiagSolution) color = m_flowDiagSolution->tracerColor(tracerVal.first); else - color = cvf::Color3f::DARK_GRAY; + color = getTracerColor(tracerVal.first); double tracerPercent = 100*tracerVal.second; @@ -392,7 +374,14 @@ void RimWellAllocationPlot::updateWellFlowPlotXAxisTitle(RimWellLogTrack* plotTr } - plotTrack->setXAxisTitle("Flow Rate " + unitText); + if (m_flowDiagSolution) + { + plotTrack->setXAxisTitle("Reservoir Flow Rate " + unitText); + } + else + { + plotTrack->setXAxisTitle("Surface Flow Rate " + unitText); + } } //-------------------------------------------------------------------------------------------------- @@ -407,10 +396,14 @@ void RimWellAllocationPlot::addStackedCurve(const QString& tracerName, curve->setFlowValuesPrDepthValue(tracerName, depthValues, accFlow); if ( m_flowDiagSolution ) + { curve->setColor(m_flowDiagSolution->tracerColor(tracerName)); + } else - curve->setColor(cvf::Color3f::DARK_GRAY); - + { + curve->setColor(getTracerColor(tracerName)); + } + plotTrack->addCurve(curve); curve->loadDataAndUpdate(); @@ -524,9 +517,9 @@ caf::PdmObject* RimWellAllocationPlot::plotLegend() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimFlowDiagSolution* RimWellAllocationPlot::flowDiagSolution() +RimEclipseResultCase* RimWellAllocationPlot::rimCase() { - return m_flowDiagSolution(); + return m_case(); } //-------------------------------------------------------------------------------------------------- @@ -775,4 +768,15 @@ QWidget* RimWellAllocationPlot::createViewWidget(QWidget* mainWindowParent) return m_wellAllocationPlotWidget; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +cvf::Color3f RimWellAllocationPlot::getTracerColor(const QString& tracerName) +{ + + if (tracerName == RIG_FLOW_OIL_NAME) return cvf::Color3f::DARK_GREEN; + if (tracerName == RIG_FLOW_GAS_NAME) return cvf::Color3f::DARK_RED; + if (tracerName == RIG_FLOW_WATER_NAME) return cvf::Color3f::BLUE; + return cvf::Color3f::DARK_GRAY; +} diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.h b/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.h index 0015a4ecfd..b8261e7d05 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.h +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellAllocationPlot.h @@ -37,6 +37,10 @@ class RiuWellAllocationPlot; class RimWellLogTrack; class RigSingleWellResultsData; +namespace cvf { + class Color3f; +} + namespace caf { class PdmOptionItemInfo; } @@ -61,7 +65,7 @@ public: void setDescription(const QString& description); QString description() const; - void loadDataAndUpdate(); + virtual void loadDataAndUpdate() override; virtual QWidget* viewWidget() override; virtual void zoomAll() override; @@ -69,7 +73,7 @@ public: RimWellLogPlot* accumulatedWellFlowPlot(); RimTotalWellAllocationPlot* totalWellFlowPlot(); caf::PdmObject* plotLegend(); - RimFlowDiagSolution* flowDiagSolution(); + RimEclipseResultCase* rimCase(); int timeStep(); QString wellName() const; @@ -111,6 +115,8 @@ private: virtual QWidget* createViewWidget(QWidget* mainWindowParent) override; virtual void deleteViewWidget() override; + cvf::Color3f getTracerColor(const QString& tracerName); + private: caf::PdmField m_showPlotTitle; caf::PdmField m_userName; diff --git a/ApplicationCode/ProjectDataModel/Rim3dPropertiesInterface.h b/ApplicationCode/ProjectDataModel/Rim3dPropertiesInterface.h new file mode 100644 index 0000000000..694b89ea7a --- /dev/null +++ b/ApplicationCode/ProjectDataModel/Rim3dPropertiesInterface.h @@ -0,0 +1,27 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cvfBoundingBox.h" + +class Rim3dPropertiesInterface +{ +public: + virtual cvf::BoundingBox boundingBoxInDomainCoords() = 0; +}; diff --git a/ApplicationCode/ProjectDataModel/RimBinaryExportSettings.cpp b/ApplicationCode/ProjectDataModel/RimBinaryExportSettings.cpp index fb579ce85b..d130d87ef0 100644 --- a/ApplicationCode/ProjectDataModel/RimBinaryExportSettings.cpp +++ b/ApplicationCode/ProjectDataModel/RimBinaryExportSettings.cpp @@ -43,7 +43,7 @@ void RimBinaryExportSettings::defineEditorAttribute(const caf::PdmFieldHandle* f { if (field == &fileName) { - caf::PdmUiFilePathEditorAttribute* myAttr = static_cast(attribute); + caf::PdmUiFilePathEditorAttribute* myAttr = dynamic_cast(attribute); if (myAttr) { myAttr->m_selectSaveFileName = true; diff --git a/ApplicationCode/ProjectDataModel/RimCaseAndFileExportSettings.cpp b/ApplicationCode/ProjectDataModel/RimCaseAndFileExportSettings.cpp new file mode 100644 index 0000000000..e67f947fe9 --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimCaseAndFileExportSettings.cpp @@ -0,0 +1,68 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017- Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimCaseAndFileExportSettings.h" + +#include "RimTools.h" + +#include "cafPdmUiFilePathEditor.h" + +CAF_PDM_SOURCE_INIT(RimCaseAndFileExportSettings, "RimCaseAndFileExportSettings"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimCaseAndFileExportSettings::RimCaseAndFileExportSettings() +{ + CAF_PDM_InitObject("RimCaseAndFileExportSettings", "", "", ""); + + CAF_PDM_InitFieldNoDefault(&fileName, "Filename", "Export filename", "", "", ""); + fileName.uiCapability()->setUiEditorTypeName(caf::PdmUiFilePathEditor::uiEditorTypeName()); + + CAF_PDM_InitFieldNoDefault(&caseToApply, "CaseToApply", "Case to Apply", "", "", ""); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QList RimCaseAndFileExportSettings::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) +{ + QList options; + + if (fieldNeedingOptions == &caseToApply) + { + RimTools::caseOptionItems(&options); + } + + return options; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimCaseAndFileExportSettings::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) +{ + if (field == &fileName) + { + caf::PdmUiFilePathEditorAttribute* myAttr = static_cast(attribute); + if (myAttr) + { + myAttr->m_selectSaveFileName = true; + } + } +} diff --git a/ApplicationCode/ProjectDataModel/RimCaseAndFileExportSettings.h b/ApplicationCode/ProjectDataModel/RimCaseAndFileExportSettings.h new file mode 100644 index 0000000000..686e075068 --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimCaseAndFileExportSettings.h @@ -0,0 +1,45 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017- Statoil ASA +// Copyright (C) 2017- 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RimEclipseCase.h" + +#include "cafPdmObject.h" +#include "cafPdmField.h" +#include "cafPdmPtrField.h" + +//================================================================================================== +/// +/// +//================================================================================================== +class RimCaseAndFileExportSettings : public caf::PdmObject +{ + CAF_PDM_HEADER_INIT; +public: + + RimCaseAndFileExportSettings(); + + caf::PdmField fileName; + caf::PdmPtrField caseToApply; + + virtual QList calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override; +protected: + virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override; +}; diff --git a/ApplicationCode/ProjectDataModel/RimCellRangeFilter.cpp b/ApplicationCode/ProjectDataModel/RimCellRangeFilter.cpp index 86d1466e93..79cba2b624 100644 --- a/ApplicationCode/ProjectDataModel/RimCellRangeFilter.cpp +++ b/ApplicationCode/ProjectDataModel/RimCellRangeFilter.cpp @@ -171,7 +171,7 @@ RimCellRangeFilterCollection* RimCellRangeFilter::parentContainer() //-------------------------------------------------------------------------------------------------- void RimCellRangeFilter::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) { - caf::PdmUiSliderEditorAttribute* myAttr = static_cast(attribute); + caf::PdmUiSliderEditorAttribute* myAttr = dynamic_cast(attribute); if (!myAttr || !parentContainer()) { return; diff --git a/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp b/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp index 2e61f3509f..d46d1db847 100644 --- a/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp +++ b/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp @@ -343,6 +343,7 @@ QStringList RimContextCommandBuilder::commandsFromSelection() } else if (dynamic_cast(uiItem)) { + commandIds << "RicNewWellLogCurveExtractionFeature"; commandIds << "RicNewSimWellIntersectionFeature"; commandIds << "RicShowWellAllocationPlotFeature"; } @@ -431,6 +432,14 @@ QStringList RimContextCommandBuilder::commandsFromSelection() commandIds << "RicShowTotalAllocationDataFeature"; commandIds << "RicSummaryCurveSwitchAxisFeature"; + + commandIds << "RicNewFishbonesSubsFeature"; + commandIds << "RicNewPerforationIntervalFeature"; + commandIds << "RicEditPerforationCollectionFeature"; + commandIds << "RicExportFishbonesLateralsFeature"; + commandIds << "RicWellPathExportCompletionDataFeature"; + commandIds << "RicWellPathImportCompletionsFileFeature"; + commandIds << "RicFlyToObjectFeature"; // Work in progress -- End @@ -445,6 +454,7 @@ QStringList RimContextCommandBuilder::commandsFromSelection() } else if (dynamic_cast(uiItem)) { + commandIds << "RicReloadCaseFeature"; commandIds << "RicExecuteScriptForCasesFeature"; } else if (dynamic_cast(uiItem)) diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp index 040e22007a..71c1bf2371 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp @@ -42,6 +42,12 @@ #include "RimProject.h" #include "RimMainPlotCollection.h" #include "RimWellLogPlotCollection.h" +#include "RimSummaryPlotCollection.h" +#include "RimFlowPlotCollection.h" +#include "RimWellLogPlot.h" +#include "RimSummaryPlot.h" +#include "RimFlowCharacteristicsPlot.h" +#include "RimWellAllocationPlot.h" #include "cafPdmDocument.h" #include "cafProgressInfo.h" @@ -297,40 +303,7 @@ void RimEclipseCase::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c { if (changedField == &releaseResultMemory) { - if (this->eclipseCaseData()) - { - for (size_t i = 0; i < reservoirViews().size(); i++) - { - RimEclipseView* reservoirView = reservoirViews()[i]; - CVF_ASSERT(reservoirView); - - RimEclipseCellColors* result = reservoirView->cellResult; - CVF_ASSERT(result); - - result->setResultVariable(RimDefines::undefinedResultName()); - result->loadResult(); - - RimCellEdgeColors* cellEdgeResult = reservoirView->cellEdgeResult; - CVF_ASSERT(cellEdgeResult); - - cellEdgeResult->setResultVariable(RimDefines::undefinedResultName()); - cellEdgeResult->loadResult(); - - reservoirView->createDisplayModelAndRedraw(); - } - - RigCaseCellResultsData* matrixModelResults = eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS); - if (matrixModelResults) - { - matrixModelResults->clearAllResults(); - } - - RigCaseCellResultsData* fractureModelResults = eclipseCaseData()->results(RifReaderInterface::FRACTURE_RESULTS); - if (fractureModelResults) - { - fractureModelResults->clearAllResults(); - } - } + reloadDataAndUpdate(); releaseResultMemory = oldValue.toBool(); } @@ -664,6 +637,66 @@ QString RimEclipseCase::timeStepName(int frameIdx) return date.toString(m_timeStepFormatString); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseCase::reloadDataAndUpdate() +{ + if (this->eclipseCaseData()) + { + RigCaseCellResultsData* matrixModelResults = eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS); + if (matrixModelResults) + { + matrixModelResults->clearAllResults(); + } + + RigCaseCellResultsData* fractureModelResults = eclipseCaseData()->results(RifReaderInterface::FRACTURE_RESULTS); + if (fractureModelResults) + { + fractureModelResults->clearAllResults(); + } + + reloadEclipseGridFile(); + + for (size_t i = 0; i < reservoirViews().size(); i++) + { + RimEclipseView* reservoirView = reservoirViews()[i]; + CVF_ASSERT(reservoirView); + reservoirView->loadDataAndUpdate(); + } + + RimProject* project = RiaApplication::instance()->project(); + if (project) + { + if (project->mainPlotCollection()) + { + RimWellLogPlotCollection* wellPlotCollection = project->mainPlotCollection()->wellLogPlotCollection(); + RimSummaryPlotCollection* summaryPlotCollection = project->mainPlotCollection()->summaryPlotCollection(); + RimFlowPlotCollection* flowPlotCollection = project->mainPlotCollection()->flowPlotCollection(); + + if (wellPlotCollection) + { + for (size_t i = 0; i < wellPlotCollection->wellLogPlots().size(); ++i) + { + wellPlotCollection->wellLogPlots()[i]->loadDataAndUpdate(); + } + } + if (summaryPlotCollection) + { + for (size_t i = 0; i < summaryPlotCollection->summaryPlots().size(); ++i) + { + summaryPlotCollection->summaryPlots()[i]->loadDataAndUpdate(); + } + } + if (flowPlotCollection) + { + flowPlotCollection->loadDataAndUpdate(); + } + } + } + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCase.h b/ApplicationCode/ProjectDataModel/RimEclipseCase.h index a156f2dedb..9882f98d2e 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCase.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseCase.h @@ -95,6 +95,9 @@ public: virtual cvf::BoundingBox allCellsBoundingBox() const; virtual cvf::Vec3d displayModelOffset() const; + void reloadDataAndUpdate(); + virtual void reloadEclipseGridFile() = 0; + // Overridden methods from PdmObject public: diff --git a/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp index f84bd630cb..98700b1092 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseInputCase.cpp @@ -228,6 +228,15 @@ bool RimEclipseInputCase::openEclipseGridFile() return true; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseInputCase::reloadEclipseGridFile() +{ + setReservoirData(nullptr); + openReserviorCase(); +} + #define for_all(stdVector, indexName) for (size_t indexName = 0; indexName < stdVector.size(); ++indexName) //-------------------------------------------------------------------------------------------------- /// Loads input property data from the gridFile and additional files diff --git a/ApplicationCode/ProjectDataModel/RimEclipseInputCase.h b/ApplicationCode/ProjectDataModel/RimEclipseInputCase.h index 6be893714d..73d286284b 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseInputCase.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseInputCase.h @@ -53,6 +53,7 @@ public: // RimCase overrides virtual bool openEclipseGridFile(); // Find grid file among file set. Read, Find read and validate property date. Syncronize child property sets. + virtual void reloadEclipseGridFile(); // Overrides from RimCase virtual QString locationOnDisc() const; diff --git a/ApplicationCode/ProjectDataModel/RimEclipsePropertyFilterCollection.cpp b/ApplicationCode/ProjectDataModel/RimEclipsePropertyFilterCollection.cpp index 40d65b47d7..e2c976eab9 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipsePropertyFilterCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipsePropertyFilterCollection.cpp @@ -70,7 +70,10 @@ void RimEclipsePropertyFilterCollection::loadAndInitializePropertyFilters() for (size_t i = 0; i < propertyFilters.size(); i++) { RimEclipsePropertyFilter* propertyFilter = propertyFilters[i]; + propertyFilter->resultDefinition->setEclipseCase(reservoirView()->eclipseCase()); propertyFilter->initAfterRead(); + propertyFilter->resultDefinition->loadResult(); + propertyFilter->computeResultValueRange(); } } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp index cadcfabb64..35a552fa18 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp @@ -41,6 +41,7 @@ #include "cafPdmSettings.h" #include "cafPdmUiPropertyViewDialog.h" #include "cafProgressInfo.h" +#include "cafUtils.h" #include #include @@ -100,7 +101,7 @@ bool RimEclipseResultCase::openEclipseGridFile() } else { - if (!QFile::exists(caseFileName())) + if (!caf::Utils::fileExists(caseFileName())) { return false; } @@ -148,6 +149,17 @@ bool RimEclipseResultCase::openEclipseGridFile() return true; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultCase::reloadEclipseGridFile() +{ + m_gridAndWellDataIsReadFromFile = false; + m_activeCellInfoIsReadFromFile = false; + setReservoirData(nullptr); + openReserviorCase(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -163,7 +175,7 @@ bool RimEclipseResultCase::openAndReadActiveCellData(RigEclipseCaseData* mainEcl } else { - if (!QFile::exists(caseFileName())) + if (!caf::Utils::fileExists(caseFileName())) { return false; } @@ -345,6 +357,15 @@ void RimEclipseResultCase::updateFilePathsFromProjectPath(const QString& newProj // Update filename and folder paths when opening project from a different file location caseFileName = RimTools::relocateFile(caseFileName(), newProjectPath, oldProjectPath, &foundFile, &searchedPaths); + + std::vector relocatedFaultFiles; + for (auto faultFileName : filesContainingFaults()) + { + QString relocatedFaultFile = RimTools::relocateFile(faultFileName, newProjectPath, oldProjectPath, &foundFile, &searchedPaths); + relocatedFaultFiles.push_back(relocatedFaultFile); + } + + filesContainingFaults = relocatedFaultFiles; #if 0 // Output the search path for debugging for (size_t i = 0; i < searchedPaths.size(); ++i) diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultCase.h b/ApplicationCode/ProjectDataModel/RimEclipseResultCase.h index 35243183b2..b55640cbee 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultCase.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultCase.h @@ -44,6 +44,7 @@ public: void setCaseInfo(const QString& userDescription, const QString& caseFileName); virtual bool openEclipseGridFile(); + virtual void reloadEclipseGridFile(); bool openAndReadActiveCellData(RigEclipseCaseData* mainEclipseCase); void readGridDimensions(std::vector< std::vector >& gridDimensions); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp index 084ea432e8..8b6497ec70 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp @@ -37,6 +37,8 @@ #include "RimReservoirCellResultsStorage.h" #include "RimView.h" #include "RimViewLinker.h" +#include "RimGridTimeHistoryCurve.h" +#include "RimWellLogExtractionCurve.h" #include "cafPdmUiListEditor.h" @@ -137,6 +139,8 @@ void RimEclipseResultDefinition::simpleCopy(const RimEclipseResultDefinition* ot void RimEclipseResultDefinition::setEclipseCase(RimEclipseCase* eclipseCase) { m_eclipseCase = eclipseCase; + + assignFlowSolutionFromCase(); } @@ -323,16 +327,15 @@ void RimEclipseResultDefinition::setTofAndSelectTracer(const QString& tracerName //-------------------------------------------------------------------------------------------------- void RimEclipseResultDefinition::assignFlowSolutionFromCase() { - RimEclipseResultCase* eclCase = nullptr; - this->firstAncestorOrThisOfType(eclCase); + RimFlowDiagSolution* defaultFlowDiagSolution = nullptr; + + RimEclipseResultCase* eclCase = dynamic_cast(m_eclipseCase.p()); + if (eclCase) { - RimFlowDiagSolution* defaultFlowDiagSolution = eclCase->defaultFlowDiagSolution(); - if (defaultFlowDiagSolution) - { - this->setFlowSolution(defaultFlowDiagSolution); - } + defaultFlowDiagSolution = eclCase->defaultFlowDiagSolution(); } + this->setFlowSolution(defaultFlowDiagSolution); } //-------------------------------------------------------------------------------------------------- @@ -425,9 +428,11 @@ QList RimEclipseResultDefinition::calculateValueOptions( hasFlowDiagFluxes = eclResCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->hasFlowDiagUsableFluxes(); } - // Do not include flow diag results if not available + RimGridTimeHistoryCurve* timeHistoryCurve; + this->firstAncestorOrThisOfType(timeHistoryCurve); - if ( !hasFlowDiagFluxes ) + // Do not include flow diagnostics results if not available or is a time history curve + if ( !hasFlowDiagFluxes || timeHistoryCurve != nullptr ) { using ResCatEnum = caf::AppEnum< RimDefines::ResultCatType >; for ( size_t i = 0; i < ResCatEnum::size(); ++i ) @@ -464,8 +469,7 @@ QList RimEclipseResultDefinition::calculateValueOptions( } else if (fieldNeedingOptions == &m_flowSolutionUiField) { - RimEclipseResultCase* eclCase; - this->firstAncestorOrThisOfType(eclCase); + RimEclipseResultCase* eclCase = dynamic_cast(m_eclipseCase.p()); if (eclCase) { std::vector flowSols = eclCase->flowDiagSolutions(); @@ -662,6 +666,18 @@ RigFlowDiagResultAddress RimEclipseResultDefinition::flowDiagResAddress() const { timeStep = rimView->currentTimeStep(); } + RimWellLogExtractionCurve* wellLogExtractionCurve = nullptr; + this->firstAncestorOrThisOfType(wellLogExtractionCurve); + if (wellLogExtractionCurve) + { + timeStep = static_cast(wellLogExtractionCurve->currentTimeStep()); + } + + // Time history curves are not supported, since it requires the time + // step to access to be supplied. + RimGridTimeHistoryCurve* timeHistoryCurve = nullptr; + this->firstAncestorOrThisOfType(timeHistoryCurve); + CVF_ASSERT(timeHistoryCurve == nullptr); std::set selTracerNames; if (m_flowTracerSelectionMode == FLOW_TR_BY_SELECTION) diff --git a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp index 4730387c9d..00bfc18079 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.cpp @@ -174,6 +174,15 @@ bool RimEclipseStatisticsCase::openEclipseGridFile() return true; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseStatisticsCase::reloadEclipseGridFile() +{ + setReservoirData(nullptr); + openReserviorCase(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -604,13 +613,19 @@ void RimEclipseStatisticsCase::defineEditorAttribute(const caf::PdmFieldHandle* if (&m_selectionSummary == field) { caf::PdmUiTextEditorAttribute* textEditAttrib = dynamic_cast (attribute); - textEditAttrib->textMode = caf::PdmUiTextEditorAttribute::HTML; + if (textEditAttrib) + { + textEditAttrib->textMode = caf::PdmUiTextEditorAttribute::HTML; + } } if (&m_calculateEditCommand == field) { caf::PdmUiPushButtonEditorAttribute* attrib = dynamic_cast (attribute); - attrib->m_buttonText = hasComputedStatistics() ? "Edit (Will DELETE current results)": "Compute"; + if (attrib) + { + attrib->m_buttonText = hasComputedStatistics() ? "Edit (Will DELETE current results)": "Compute"; + } } } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.h b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.h index 0a2af3edf6..9dd9d434b0 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCase.h @@ -61,6 +61,7 @@ public: void updateConnectedEditorsAndReservoirViews(); virtual bool openEclipseGridFile(); + virtual void reloadEclipseGridFile(); RimCaseCollection* parentStatisticsCaseCollection(); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp index d3e25f35f2..5234ae4313 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseStatisticsCaseEvaluator.cpp @@ -44,12 +44,13 @@ void RimEclipseStatisticsCaseEvaluator::addNamedResult(RigCaseCellResultsData* d CVF_ASSERT(m_sourceCases.size() > 0); std::vector sourceTimeStepDates = m_sourceCases[0]->results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->timeStepDates(0); + std::vector sourceDaysSinceSimulationStart = m_sourceCases[0]->results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->daysSinceSimulationStart(0); std::vector sourceReportStepNumbers = m_sourceCases[0]->results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->reportStepNumbers(0); size_t destinationScalarResultIndex = destinationCellResults->addEmptyScalarResult(resultType, resultName, true); CVF_ASSERT(destinationScalarResultIndex != cvf::UNDEFINED_SIZE_T); - destinationCellResults->setTimeStepDates(destinationScalarResultIndex, sourceTimeStepDates, sourceReportStepNumbers); + destinationCellResults->setTimeStepDates(destinationScalarResultIndex, sourceTimeStepDates, sourceDaysSinceSimulationStart, sourceReportStepNumbers); std::vector< std::vector >& dataValues = destinationCellResults->cellScalarResults(destinationScalarResultIndex); dataValues.resize(sourceTimeStepDates.size()); diff --git a/ApplicationCode/ProjectDataModel/RimExportCompletionDataSettings.cpp b/ApplicationCode/ProjectDataModel/RimExportCompletionDataSettings.cpp new file mode 100644 index 0000000000..ec0f14f726 --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimExportCompletionDataSettings.cpp @@ -0,0 +1,32 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017- Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimExportCompletionDataSettings.h" + +CAF_PDM_SOURCE_INIT(RimExportCompletionDataSettings, "RimExportCompletionDataSettings"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimExportCompletionDataSettings::RimExportCompletionDataSettings() +{ + CAF_PDM_InitObject("RimExportCompletionDataSettings", "", "", ""); + + CAF_PDM_InitField(&includeWpimult, "IncludeWPIMULT", true, "Include WPIMLUT", "", "", ""); + CAF_PDM_InitField(&removeLateralsInMainBoreCells, "RemoveLateralsInMainBoreCells", false, "Remove Laterals in Main Bore Cells", "", "", ""); +} diff --git a/ApplicationCode/ProjectDataModel/RimExportCompletionDataSettings.h b/ApplicationCode/ProjectDataModel/RimExportCompletionDataSettings.h new file mode 100644 index 0000000000..37594a18b2 --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimExportCompletionDataSettings.h @@ -0,0 +1,38 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017- Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RimCaseAndFileExportSettings.h" + +#include "cafPdmField.h" + +//================================================================================================== +/// +/// +//================================================================================================== +class RimExportCompletionDataSettings : public RimCaseAndFileExportSettings +{ + CAF_PDM_HEADER_INIT; +public: + + RimExportCompletionDataSettings(); + + caf::PdmField includeWpimult; + caf::PdmField removeLateralsInMainBoreCells; +}; diff --git a/ApplicationCode/ProjectDataModel/RimExportInputPropertySettings.cpp b/ApplicationCode/ProjectDataModel/RimExportInputPropertySettings.cpp index 72ac153ea7..b7ac2b0bb2 100644 --- a/ApplicationCode/ProjectDataModel/RimExportInputPropertySettings.cpp +++ b/ApplicationCode/ProjectDataModel/RimExportInputPropertySettings.cpp @@ -42,7 +42,7 @@ void RimExportInputSettings::defineEditorAttribute(const caf::PdmFieldHandle* fi { if (field == &fileName) { - caf::PdmUiFilePathEditorAttribute* myAttr = static_cast(attribute); + caf::PdmUiFilePathEditorAttribute* myAttr = dynamic_cast(attribute); if (myAttr) { myAttr->m_selectSaveFileName = true; diff --git a/ApplicationCode/ProjectDataModel/RimFishboneWellPath.cpp b/ApplicationCode/ProjectDataModel/RimFishboneWellPath.cpp new file mode 100644 index 0000000000..9915e8e372 --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimFishboneWellPath.cpp @@ -0,0 +1,108 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2011- Statoil ASA +// Copyright (C) 2013- 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimFishboneWellPath.h" + +#include "RimProject.h" + +#include "cafPdmUiListEditor.h" +#include "cafPdmUiTextEditor.h" + +CAF_PDM_SOURCE_INIT(RimFishboneWellPath, "WellPathCompletion"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimFishboneWellPath::RimFishboneWellPath() +{ + CAF_PDM_InitObject("WellPathCompletion", ":/Well.png", "", ""); + CAF_PDM_InitFieldNoDefault(&m_coordinates, "Coordinates", "Coordinates", "", "", ""); + m_coordinates.uiCapability()->setUiHidden(true); + CAF_PDM_InitFieldNoDefault(&m_measuredDepths, "MeasuredDepth", "MeasuredDepth", "", "", ""); + m_measuredDepths.uiCapability()->setUiHidden(true); + m_name.uiCapability()->setUiHidden(true); + + CAF_PDM_InitFieldNoDefault(&m_displayCoordinates, "DisplayCoordinates", "Coordinates", "", "", ""); + m_displayCoordinates.registerGetMethod(this, &RimFishboneWellPath::displayCoordinates); + m_displayCoordinates.uiCapability()->setUiReadOnly(true); + m_displayCoordinates.uiCapability()->setUiEditorTypeName(caf::PdmUiTextEditor::uiEditorTypeName()); + m_displayCoordinates.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::LabelPosType::TOP); +} + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimFishboneWellPath::~RimFishboneWellPath() +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFishboneWellPath::setCoordinates(std::vector< cvf::Vec3d > coordinates) +{ + m_coordinates = coordinates; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFishboneWellPath::setMeasuredDepths(std::vector< double > measuredDepths) +{ + m_measuredDepths = measuredDepths; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFishboneWellPath::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) +{ + RimProject* proj; + this->firstAncestorOrThisOfType(proj); + if (proj) proj->createDisplayModelAndRedrawAllViews(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFishboneWellPath::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) +{ + uiOrdering.add(&m_displayCoordinates); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimFishboneWellPath::displayCoordinates() const +{ + CVF_ASSERT(m_coordinates().size() == m_measuredDepths().size()); + + QStringList displayValues; + + displayValues.push_back(QString("X\tY\tZ\tMD")); + for (size_t i = 0; i < m_coordinates().size(); i++) + { + const cvf::Vec3d& coords = m_coordinates()[i]; + const double& measuredDepth = m_measuredDepths()[i]; + displayValues.push_back(QString("%1\t%2\t%3\t%4").arg(coords.x(), 0, 'f', 2).arg(coords.y(), 0, 'f', 2).arg(coords.z(), 0, 'f', 2).arg(measuredDepth, 0, 'f', 2)); + } + + return displayValues.join("\n"); +} diff --git a/ApplicationCode/ProjectDataModel/RimFishboneWellPath.h b/ApplicationCode/ProjectDataModel/RimFishboneWellPath.h new file mode 100644 index 0000000000..768755d024 --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimFishboneWellPath.h @@ -0,0 +1,66 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2011- Statoil ASA +// Copyright (C) 2013- 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RimCheckableNamedObject.h" + +#include "cafPdmField.h" +#include "cafPdmObject.h" +#include "cafPdmPointer.h" +#include "cafPdmChildField.h" +#include "cafAppEnum.h" + +// Include to make Pdm work for cvf::Color +#include "cafPdmFieldCvfColor.h" +#include "cafPdmChildArrayField.h" +#include "cafPdmFieldCvfVec3d.h" +#include "cafPdmProxyValueField.h" + +#include "cvfBase.h" +#include "cvfObject.h" +#include "cvfVector3.h" + +//================================================================================================== +/// +/// +//================================================================================================== +class RimFishboneWellPath : public RimCheckableNamedObject +{ + CAF_PDM_HEADER_INIT; +public: + + RimFishboneWellPath(); + virtual ~RimFishboneWellPath(); + + virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; + virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; + + void setCoordinates(std::vector< cvf::Vec3d > coordinates); + void setMeasuredDepths(std::vector< double > measuredDepths); + + std::vector< cvf::Vec3d > coordinates() { return m_coordinates(); } + std::vector< double > measuredDepths() { return m_measuredDepths(); } +private: + QString displayCoordinates() const; + + caf::PdmField< std::vector< cvf::Vec3d> > m_coordinates; + caf::PdmField< std::vector< double > > m_measuredDepths; + caf::PdmProxyValueField< QString > m_displayCoordinates; +}; diff --git a/ApplicationCode/ProjectDataModel/RimFishboneWellPathCollection.cpp b/ApplicationCode/ProjectDataModel/RimFishboneWellPathCollection.cpp new file mode 100644 index 0000000000..db73648f46 --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimFishboneWellPathCollection.cpp @@ -0,0 +1,100 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2015- Statoil ASA +// Copyright (C) 2015- 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimFishboneWellPathCollection.h" + +#include "RimEclipseWell.h" +#include "RimFishboneWellPath.h" +#include "RimView.h" +#include "RimProject.h" + +#include "RigWellPath.h" + +#include "RifWellPathImporter.h" + +#include "RiuMainWindow.h" + + +CAF_PDM_SOURCE_INIT(RimFishboneWellPathCollection, "WellPathCompletionCollection"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimFishboneWellPathCollection::RimFishboneWellPathCollection() +{ + CAF_PDM_InitObject("WellPathCompletions", ":/WellCollection.png", "", ""); + + m_name.uiCapability()->setUiHidden(true); + m_name = "Well Paths"; + + CAF_PDM_InitFieldNoDefault(&m_wellPaths, "WellPaths", "Well Paths", "", "", ""); + m_wellPaths.uiCapability()->setUiHidden(true); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFishboneWellPathCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) +{ + RimProject* proj; + this->firstAncestorOrThisOfTypeAsserted(proj); + proj->createDisplayModelAndRedrawAllViews(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFishboneWellPathCollection::appendCompletion(RimFishboneWellPath* completion) +{ + m_wellPaths.push_back(completion); + + updateConnectedEditors(); + RiuMainWindow::instance()->selectAsCurrentItem(completion); + + RimView* rimView = NULL; + firstAncestorOrThisOfType(rimView); + if (rimView) + { + rimView->scheduleCreateDisplayModelAndRedraw(); + } + + uiCapability()->setUiHidden(!m_wellPaths.empty()); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFishboneWellPathCollection::importCompletionsFromFile(const QStringList& filePaths) +{ + RifWellPathImporter wellPathImporter; + + foreach(const QString& filePath, filePaths) { + size_t wellDataCount = wellPathImporter.wellDataCount(filePath); + + for (size_t i = 0; i < wellDataCount; ++i) + { + RifWellPathImporter::WellData wellData = wellPathImporter.readWellData(filePath, i); + RimFishboneWellPath* wellCompletion = new RimFishboneWellPath(); + wellCompletion->setName(wellData.m_name); + wellCompletion->setCoordinates(wellData.m_wellPathGeometry->m_wellPathPoints); + wellCompletion->setMeasuredDepths(wellData.m_wellPathGeometry->m_measuredDepths); + appendCompletion(wellCompletion); + } + } +} diff --git a/ApplicationCode/ProjectDataModel/RimFishboneWellPathCollection.h b/ApplicationCode/ProjectDataModel/RimFishboneWellPathCollection.h new file mode 100644 index 0000000000..ae19205905 --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimFishboneWellPathCollection.h @@ -0,0 +1,50 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2015- Statoil ASA +// Copyright (C) 2015- 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RimCheckableNamedObject.h" +#include "RimFishboneWellPath.h" + +#include "cafPdmObject.h" +#include "cafPdmChildArrayField.h" +#include "cafPdmField.h" + +//================================================================================================== +// +// +// +//================================================================================================== +class RimFishboneWellPathCollection : public RimCheckableNamedObject +{ + CAF_PDM_HEADER_INIT; + +public: + RimFishboneWellPathCollection(); + + void importCompletionsFromFile(const QStringList& filePaths); + + void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue); + +private: + void appendCompletion(RimFishboneWellPath* completion); + +private: + caf::PdmChildArrayField m_wellPaths; +}; diff --git a/ApplicationCode/ProjectDataModel/RimGeoMechCase.cpp b/ApplicationCode/ProjectDataModel/RimGeoMechCase.cpp index f8c21398ea..47759350be 100644 --- a/ApplicationCode/ProjectDataModel/RimGeoMechCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimGeoMechCase.cpp @@ -40,6 +40,8 @@ #include "RimGeoMechResultDefinition.h" #include "RimGeoMechPropertyFilter.h" +#include "cafUtils.h" + #include CAF_PDM_SOURCE_INIT(RimGeoMechCase, "ResInsightGeoMechCase"); @@ -110,7 +112,7 @@ bool RimGeoMechCase::openGeoMechCase(std::string* errorMessage) // If read already, return if (this->m_geoMechCaseData.notNull()) return true; - if (!QFile::exists(m_caseFileName())) + if (!caf::Utils::fileExists(m_caseFileName())) { return false; } diff --git a/ApplicationCode/ProjectDataModel/RimGeoMechResultDefinition.cpp b/ApplicationCode/ProjectDataModel/RimGeoMechResultDefinition.cpp index 6fe9f60be4..c7f1c50155 100644 --- a/ApplicationCode/ProjectDataModel/RimGeoMechResultDefinition.cpp +++ b/ApplicationCode/ProjectDataModel/RimGeoMechResultDefinition.cpp @@ -114,10 +114,13 @@ void RimGeoMechResultDefinition::defineUiOrdering(QString uiConfigName, caf::Pdm uiOrdering.add(&m_resultPositionTypeUiField); uiOrdering.add(&m_resultVariableUiField); - caf::PdmUiGroup * timeLapseGr = uiOrdering.addNewGroup("Relative Result Options"); - timeLapseGr->add(&m_isTimeLapseResultUiField); - if (m_isTimeLapseResultUiField()) - timeLapseGr->add(&m_timeLapseBaseTimestepUiField); + if ( m_resultPositionTypeUiField() != RIG_FORMATION_NAMES ) + { + caf::PdmUiGroup * timeLapseGr = uiOrdering.addNewGroup("Relative Result Options"); + timeLapseGr->add(&m_isTimeLapseResultUiField); + if ( m_isTimeLapseResultUiField() ) + timeLapseGr->add(&m_timeLapseBaseTimestepUiField); + } uiOrdering.skipRemainingFields(true); } @@ -137,7 +140,9 @@ QList RimGeoMechResultDefinition::calculateValueOptions( std::map > fieldCompNames = getResultMetaDataForUIFieldSetting(); QStringList uiVarNames; QStringList varNames; - getUiAndResultVariableStringList(&uiVarNames, &varNames, fieldCompNames, m_isTimeLapseResultUiField, m_timeLapseBaseTimestepUiField); + bool isNeedingTimeLapseStrings = m_isTimeLapseResultUiField() && (m_resultPositionTypeUiField() != RIG_FORMATION_NAMES); + + getUiAndResultVariableStringList(&uiVarNames, &varNames, fieldCompNames, isNeedingTimeLapseStrings, m_timeLapseBaseTimestepUiField); for (int oIdx = 0; oIdx < uiVarNames.size(); ++oIdx) { @@ -189,7 +194,8 @@ void RimGeoMechResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha std::map > fieldCompNames = getResultMetaDataForUIFieldSetting(); QStringList uiVarNames; QStringList varNames; - getUiAndResultVariableStringList(&uiVarNames, &varNames, fieldCompNames, m_isTimeLapseResultUiField, m_timeLapseBaseTimestepUiField); + bool isNeedingTimeLapseStrings = m_isTimeLapseResultUiField() && (m_resultPositionTypeUiField() != RIG_FORMATION_NAMES); + getUiAndResultVariableStringList(&uiVarNames, &varNames, fieldCompNames, isNeedingTimeLapseStrings, m_timeLapseBaseTimestepUiField); if (m_resultPositionTypeUiField() == m_resultPositionType() && m_isTimeLapseResultUiField() == m_isTimeLapseResult() diff --git a/ApplicationCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp b/ApplicationCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp index f05a9dcf19..e9ac2b3c6f 100644 --- a/ApplicationCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp @@ -294,7 +294,6 @@ void RimGridTimeHistoryCurve::onLoadDataAndUpdate() if (isCurveVisible()) { - std::vector dateTimes; std::vector values; RimEclipseGeometrySelectionItem* eclTopItem = eclipseGeomSelectionItem(); @@ -309,39 +308,43 @@ void RimGridTimeHistoryCurve::onLoadDataAndUpdate() m_geoMechResultDefinition->loadResult(); } - dateTimes = timeStepValues(); values = yValues(); RimSummaryPlot* plot = nullptr; firstAncestorOrThisOfType(plot); bool isLogCurve = plot->isLogarithmicScaleEnabled(this->yAxis()); - if (dateTimes.size() > 0 && dateTimes.size() == values.size()) + if (plot->timeAxisProperties()->timeMode() == RimSummaryTimeAxisProperties::DATE) { - if (plot->timeAxisProperties()->timeMode() == RimSummaryTimeAxisProperties::DATE) + std::vector dateTimes = timeStepValues(); + if (dateTimes.size() > 0 && dateTimes.size() == values.size()) { m_qwtPlotCurve->setSamplesFromTimeTAndValues(dateTimes, values, isLogCurve); } else { - double timeScale = plot->timeAxisProperties()->fromTimeTToDisplayUnitScale(); - - std::vector times; - if (dateTimes.size()) - { - time_t startDate = dateTimes[0]; - for (time_t& date : dateTimes) - { - times.push_back(timeScale*(date - startDate)); - } - } - - m_qwtPlotCurve->setSamplesFromTimeAndValues(times, values, isLogCurve); + m_qwtPlotCurve->setSamplesFromTimeTAndValues(std::vector(), std::vector(), isLogCurve); } } else { - m_qwtPlotCurve->setSamplesFromTimeTAndValues(std::vector(), std::vector(), isLogCurve); + std::vector days = daysSinceSimulationStart(); + if (days.size() > 0 && days.size() == values.size()) + { + double timeScale = plot->timeAxisProperties()->fromDaysToDisplayUnitScale(); + + std::vector times; + for (double day : days) + { + times.push_back(timeScale * day); + } + + m_qwtPlotCurve->setSamplesFromTimeAndValues(times, values, isLogCurve); + } + else + { + m_qwtPlotCurve->setSamplesFromTimeTAndValues(std::vector(), std::vector(), isLogCurve); + } } updateZoomInParentPlot(); @@ -404,6 +407,56 @@ std::vector RimGridTimeHistoryCurve::timeStepValues() const return dateTimes; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimGridTimeHistoryCurve::daysSinceSimulationStart() const +{ + std::vector daysSinceSimulationStart; + RimEclipseGeometrySelectionItem* eclTopItem = eclipseGeomSelectionItem(); + if (eclTopItem && eclTopItem->eclipseCase()) + { + RimReservoirCellResultsStorage* cellResStorage = m_eclipseResultDefinition->currentGridCellResults(); + RigCaseCellResultsData* cellResultsData = cellResStorage->cellResults(); + + daysSinceSimulationStart = cellResultsData->daysSinceSimulationStart(); + } + + RimGeoMechGeometrySelectionItem* geoMechTopItem = geoMechGeomSelectionItem(); + if (geoMechTopItem && geoMechTopItem->geoMechCase()) + { + std::unique_ptr timeHistResultAccessor = femTimeHistoryResultAccessor(); + if (timeHistResultAccessor) + { + std::vector values = timeHistResultAccessor->timeHistoryValues(); + + QStringList stepNames = geoMechTopItem->geoMechCase()->timeStepStrings(); + std::vector dates = RimGeoMechCase::dateTimeVectorFromTimeStepStrings(stepNames); + if (dates.size() == values.size()) + { + if (!dates.empty()) { + time_t startDate = dates[0].toTime_t(); + double secondsToDaysConversion = (24.0 * 60.0 * 60.0); + for (QDateTime dt : dates) + { + double timeDifference = static_cast(dt.toTime_t() - startDate); + daysSinceSimulationStart.push_back(timeDifference / secondsToDaysConversion); + } + } + } + else + { + for (size_t i = 0; i < values.size(); i++) + { + daysSinceSimulationStart.push_back(i); + } + } + } + } + + return daysSinceSimulationStart; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -434,6 +487,7 @@ void RimGridTimeHistoryCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiO caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup("Curve Name"); nameGroup->setCollapsedByDefault(true); + nameGroup->add(&m_showLegend); RimPlotCurve::curveNameUiOrdering(*nameGroup); } diff --git a/ApplicationCode/ProjectDataModel/RimGridTimeHistoryCurve.h b/ApplicationCode/ProjectDataModel/RimGridTimeHistoryCurve.h index e2ec0995be..94e9aa7181 100644 --- a/ApplicationCode/ProjectDataModel/RimGridTimeHistoryCurve.h +++ b/ApplicationCode/ProjectDataModel/RimGridTimeHistoryCurve.h @@ -56,6 +56,7 @@ public: std::vector yValues() const; std::vector timeStepValues() const; + std::vector daysSinceSimulationStart() const; QString quantityName() const; QString caseName() const; diff --git a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp index 58823e4b22..c68751c22d 100644 --- a/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp +++ b/ApplicationCode/ProjectDataModel/RimIdenticalGridCaseGroup.cpp @@ -239,6 +239,7 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() RifReaderInterface::PorosityModelResultType poroModel = RifReaderInterface::MATRIX_RESULTS; std::vector timeStepDates = rigCaseData->results(poroModel)->timeStepDates(0); + std::vector daysSinceSimulationStart = rigCaseData->results(poroModel)->daysSinceSimulationStart(0); std::vector reportStepNumbers = rigCaseData->results(poroModel)->reportStepNumbers(0); const std::vector resultInfos = rigCaseData->results(poroModel)->infoForEachResultIndex(); @@ -264,7 +265,7 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo() if (mustBeCalculated) cellResultsStorage->cellResults()->setMustBeCalculated(scalarResultIndex); - cellResultsStorage->cellResults()->setTimeStepDates(scalarResultIndex, timeStepDates, reportStepNumbers); + cellResultsStorage->cellResults()->setTimeStepDates(scalarResultIndex, timeStepDates, daysSinceSimulationStart, reportStepNumbers); std::vector< std::vector >& dataValues = cellResultsStorage->cellResults()->cellScalarResults(scalarResultIndex); dataValues.resize(timeStepDates.size()); diff --git a/ApplicationCode/ProjectDataModel/RimIntersection.cpp b/ApplicationCode/ProjectDataModel/RimIntersection.cpp index 0afe1b16e7..5506f75758 100644 --- a/ApplicationCode/ProjectDataModel/RimIntersection.cpp +++ b/ApplicationCode/ProjectDataModel/RimIntersection.cpp @@ -553,13 +553,16 @@ void RimIntersection::defineEditorAttribute(const caf::PdmFieldHandle* field, QS { caf::PdmUiPushButtonEditorAttribute* attrib = dynamic_cast (attribute); - if (inputPolyLineFromViewerEnabled) + if (attrib) { - attrib->m_buttonText = "Stop picking points"; - } - else - { - attrib->m_buttonText = "Start picking points"; + if (inputPolyLineFromViewerEnabled) + { + attrib->m_buttonText = "Stop picking points"; + } + else + { + attrib->m_buttonText = "Start picking points"; + } } } else if (field == &m_userPolyline) @@ -574,13 +577,16 @@ void RimIntersection::defineEditorAttribute(const caf::PdmFieldHandle* field, QS { caf::PdmUiPushButtonEditorAttribute* attrib = dynamic_cast (attribute); - if (inputExtrusionPointsFromViewerEnabled) + if (attrib) { - attrib->m_buttonText = "Stop picking points"; - } - else - { - attrib->m_buttonText = "Start picking points"; + if (inputExtrusionPointsFromViewerEnabled) + { + attrib->m_buttonText = "Stop picking points"; + } + else + { + attrib->m_buttonText = "Start picking points"; + } } } else if (field == &m_customExtrusionPoints) diff --git a/ApplicationCode/ProjectDataModel/RimIntersectionBox.cpp b/ApplicationCode/ProjectDataModel/RimIntersectionBox.cpp index 936d5e8d1d..54f543a790 100644 --- a/ApplicationCode/ProjectDataModel/RimIntersectionBox.cpp +++ b/ApplicationCode/ProjectDataModel/RimIntersectionBox.cpp @@ -404,14 +404,18 @@ void RimIntersectionBox::defineEditorAttribute(const caf::PdmFieldHandle* field, { caf::PdmUiPushButtonEditorAttribute* attrib = dynamic_cast (attribute); - if (m_show3DManipulator) + if (attrib) { - attrib->m_buttonText = "Hide 3D manipulator"; - } - else - { - attrib->m_buttonText = "Show 3D manipulator"; + if (m_show3DManipulator) + { + attrib->m_buttonText = "Hide 3D manipulator"; + } + else + { + attrib->m_buttonText = "Show 3D manipulator"; + } } + } } diff --git a/ApplicationCode/ProjectDataModel/RimMultiSnapshotDefinition.cpp b/ApplicationCode/ProjectDataModel/RimMultiSnapshotDefinition.cpp index a01b2d574d..8234936beb 100644 --- a/ApplicationCode/ProjectDataModel/RimMultiSnapshotDefinition.cpp +++ b/ApplicationCode/ProjectDataModel/RimMultiSnapshotDefinition.cpp @@ -62,16 +62,16 @@ RimMultiSnapshotDefinition::RimMultiSnapshotDefinition() CAF_PDM_InitFieldNoDefault(&view, "View", "View", "", "", ""); CAF_PDM_InitFieldNoDefault(&eclipseResultType, "EclipseResultType", "Result Type", "", "", ""); - CAF_PDM_InitFieldNoDefault(&selectedEclipseResults, "SelectedEclipseResults", "Result Name", "", "", ""); + CAF_PDM_InitFieldNoDefault(&selectedEclipseResults, "SelectedEclipseResults", "Properties", "", "", ""); - CAF_PDM_InitField(&timeStepStart, "TimeStepStart", 0, "Timestep Start", "", "", ""); - CAF_PDM_InitField(&timeStepEnd, "TimeStepEnd", 0, "Timestep End", "", "", ""); + CAF_PDM_InitField(&timeStepStart, "TimeStepStart", 0, "Start Time", "", "", ""); + CAF_PDM_InitField(&timeStepEnd, "TimeStepEnd", 0, "End Time", "", "", ""); - CAF_PDM_InitField(&sliceDirection, "SnapShotDirection", caf::AppEnum(NO_RANGEFILTER), "Range Filter direction", "", "", ""); - CAF_PDM_InitField(&startSliceIndex, "RangeFilterStart", 1, "RangeFilter Start", "", "", ""); - CAF_PDM_InitField(&endSliceIndex, "RangeFilterEnd", 1, "RangeFilter End", "", "", ""); + CAF_PDM_InitField(&sliceDirection, "SnapShotDirection", caf::AppEnum(NO_RANGEFILTER), "Range Filter Slice", "", "", ""); + CAF_PDM_InitField(&startSliceIndex, "RangeFilterStart", 1, "Range Start", "", "", ""); + CAF_PDM_InitField(&endSliceIndex, "RangeFilterEnd", 1, "Range End", "", "", ""); - CAF_PDM_InitFieldNoDefault(&additionalCases, "AdditionalCases", "Case List", "", "", ""); + CAF_PDM_InitFieldNoDefault(&additionalCases, "AdditionalCases", "Cases", "", "", ""); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimPerforationCollection.cpp b/ApplicationCode/ProjectDataModel/RimPerforationCollection.cpp new file mode 100644 index 0000000000..b1012729e7 --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimPerforationCollection.cpp @@ -0,0 +1,85 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2015- Statoil ASA +// Copyright (C) 2015- 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimPerforationCollection.h" + +#include "RimEclipseWell.h" +#include "RimPerforationInterval.h" +#include "RimView.h" +#include "RimProject.h" + +#include "RigWellPath.h" + +#include "RifWellPathImporter.h" + +#include "RiuMainWindow.h" + + +CAF_PDM_SOURCE_INIT(RimPerforationCollection, "PerforationCollection"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimPerforationCollection::RimPerforationCollection() +{ + CAF_PDM_InitObject("Perforations", ":/Folder.png", "", ""); + + m_name.uiCapability()->setUiHidden(true); + m_name = "Perforations"; + + CAF_PDM_InitFieldNoDefault(&m_perforations, "Perforations", "Perforations", "", "", ""); + m_perforations.uiCapability()->setUiHidden(true); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimPerforationCollection::~RimPerforationCollection() +{ + m_perforations.deleteAllChildObjects(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimPerforationCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) +{ + RimProject* proj; + this->firstAncestorOrThisOfTypeAsserted(proj); + proj->createDisplayModelAndRedrawAllViews(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimPerforationCollection::appendPerforation(RimPerforationInterval* perforation) +{ + m_perforations.push_back(perforation); + + updateConnectedEditors(); + RiuMainWindow::instance()->selectAsCurrentItem(perforation); + + RimView* rimView = NULL; + firstAncestorOrThisOfType(rimView); + if (rimView) + { + rimView->scheduleCreateDisplayModelAndRedraw(); + } +} + diff --git a/ApplicationCode/ProjectDataModel/RimPerforationCollection.h b/ApplicationCode/ProjectDataModel/RimPerforationCollection.h new file mode 100644 index 0000000000..df612c31bb --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimPerforationCollection.h @@ -0,0 +1,48 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2015- Statoil ASA +// Copyright (C) 2015- 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RimCheckableNamedObject.h" + +#include "cafPdmObject.h" +#include "cafPdmChildArrayField.h" +#include "cafPdmField.h" + +class RimPerforationInterval; + +//================================================================================================== +// +// +// +//================================================================================================== +class RimPerforationCollection : public RimCheckableNamedObject +{ + CAF_PDM_HEADER_INIT; + +public: + RimPerforationCollection(); + ~RimPerforationCollection(); + + void appendPerforation(RimPerforationInterval* perforation); + + void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue); + + caf::PdmChildArrayField m_perforations; +}; diff --git a/ApplicationCode/ProjectDataModel/RimPerforationInterval.cpp b/ApplicationCode/ProjectDataModel/RimPerforationInterval.cpp new file mode 100644 index 0000000000..8a6a8ad40b --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimPerforationInterval.cpp @@ -0,0 +1,113 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2011- Statoil ASA +// Copyright (C) 2013- 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimPerforationInterval.h" + +#include "RigWellPath.h" + +#include "RimProject.h" +#include "RimWellPath.h" + +#include "cafPdmUiListEditor.h" +#include "cafPdmUiTextEditor.h" + +CAF_PDM_SOURCE_INIT(RimPerforationInterval, "Perforation"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimPerforationInterval::RimPerforationInterval() +{ + CAF_PDM_InitObject("Perforation", ":/Default.png", "", ""); + + CAF_PDM_InitField(&m_startMD, "StartMeasuredDepth", 0.0, "Start MD [m]", "", "", ""); + CAF_PDM_InitField(&m_endMD, "EndMeasuredDepth", 0.0, "End MD [m]", "", "", ""); + CAF_PDM_InitField(&m_radius, "Radius", 0.0, "Radius [m]", "", "", ""); + CAF_PDM_InitField(&m_skinFactor, "SkinFactor", 0.0, "Skin Factor", "", "", ""); + + m_name.uiCapability()->setUiReadOnly(true); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimPerforationInterval::~RimPerforationInterval() +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimPerforationInterval::setStartAndEndMD(double startMD, double endMD) +{ + m_startMD = startMD; + m_endMD = endMD; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +cvf::BoundingBox RimPerforationInterval::boundingBoxInDomainCoords() +{ + cvf::BoundingBox bb; + + RimWellPath* wellPath = nullptr; + this->firstAncestorOrThisOfTypeAsserted(wellPath); + + RigWellPath* rigWellPath = wellPath->wellPathGeometry(); + if (rigWellPath) + { + bb.add(rigWellPath->interpolatedPointAlongWellPath(startMD())); + bb.add(rigWellPath->interpolatedPointAlongWellPath(endMD())); + } + + return bb; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimPerforationInterval::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) +{ + RimProject* proj; + this->firstAncestorOrThisOfTypeAsserted(proj); + proj->createDisplayModelAndRedrawAllViews(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimPerforationInterval::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/) +{ + m_name = QString("%1 - %2").arg(m_startMD).arg(m_endMD); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimPerforationInterval::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) +{ + uiOrdering.add(&m_startMD); + uiOrdering.add(&m_endMD); + uiOrdering.add(&m_radius); + uiOrdering.add(&m_skinFactor); + + uiOrdering.skipRemainingFields(); +} + diff --git a/ApplicationCode/ProjectDataModel/RimPerforationInterval.h b/ApplicationCode/ProjectDataModel/RimPerforationInterval.h new file mode 100644 index 0000000000..e73d8a7852 --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimPerforationInterval.h @@ -0,0 +1,56 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2011- Statoil ASA +// Copyright (C) 2013- 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RimCheckableNamedObject.h" +#include "Rim3dPropertiesInterface.h" + +#include "cafPdmField.h" +#include "cafPdmObject.h" + +//================================================================================================== +/// +/// +//================================================================================================== +class RimPerforationInterval : public RimCheckableNamedObject, public Rim3dPropertiesInterface +{ + CAF_PDM_HEADER_INIT; +public: + + RimPerforationInterval(); + virtual ~RimPerforationInterval(); + + void setStartAndEndMD(double startMD, double endMD); + double startMD() { return m_startMD(); } + double endMD() { return m_endMD(); } + + virtual cvf::BoundingBox boundingBoxInDomainCoords() override; + +protected: + virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; + virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; + virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override; + +private: + caf::PdmField< double > m_startMD; + caf::PdmField< double > m_endMD; + caf::PdmField< double > m_radius; + caf::PdmField< double > m_skinFactor; +}; diff --git a/ApplicationCode/ProjectDataModel/RimPlotCurve.cpp b/ApplicationCode/ProjectDataModel/RimPlotCurve.cpp index af9d01e787..65f0a06ccd 100644 --- a/ApplicationCode/ProjectDataModel/RimPlotCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimPlotCurve.cpp @@ -90,6 +90,8 @@ RimPlotCurve::RimPlotCurve() CAF_PDM_InitField(&m_symbolSkipPixelDistance, "SymbolSkipPxDist", 0.0f, "Symbol Skip Distance", "", "Minimum pixel distance between symbols", ""); + CAF_PDM_InitField(&m_showLegend, "ShowLegend", true, "Contribute To Legend", "", "", ""); + m_qwtPlotCurve = new RiuLineSegmentQwtPlotCurve; m_parentQwtPlot = NULL; @@ -139,6 +141,10 @@ void RimPlotCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, con updateCurveName(); } + else if (changedField == &m_showLegend) + { + updateLegendVisibility(); + } if (m_parentQwtPlot) m_parentQwtPlot->replot(); } @@ -255,6 +261,7 @@ void RimPlotCurve::updateCurveName() } m_qwtPlotCurve->setTitle(m_curveName); + updateLegendVisibility(); } //-------------------------------------------------------------------------------------------------- @@ -420,3 +427,37 @@ void RimPlotCurve::setLineThickness(int thickness) m_curveThickness = thickness; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimPlotCurve::showLegend(bool show) +{ + m_showLegend = show; + updateLegendVisibility(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimPlotCurve::updateLegendVisibility() +{ + if (m_showLegend()) { + if (m_curveName().isEmpty()) + { + m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, false); + } + else + { + m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, true); + } + } + else + { + m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, false); + } + + if (m_parentQwtPlot != nullptr) + { + m_parentQwtPlot->updateLegend(); + } +} diff --git a/ApplicationCode/ProjectDataModel/RimPlotCurve.h b/ApplicationCode/ProjectDataModel/RimPlotCurve.h index f199262c2b..f6f3cd802f 100644 --- a/ApplicationCode/ProjectDataModel/RimPlotCurve.h +++ b/ApplicationCode/ProjectDataModel/RimPlotCurve.h @@ -78,6 +78,9 @@ public: QString curveName() const { return m_curveName; } void updateCurveVisibility(); + void updateLegendVisibility(); + + void showLegend(bool show); protected: @@ -107,6 +110,7 @@ protected: caf::PdmField m_showCurve; caf::PdmField m_curveName; caf::PdmField m_customCurveName; + caf::PdmField m_showLegend; caf::PdmField m_isUsingAutoName; caf::PdmField m_curveColor; diff --git a/ApplicationCode/ProjectDataModel/RimProject.cpp b/ApplicationCode/ProjectDataModel/RimProject.cpp index 1d6a2e7b6a..4e0a5c486d 100644 --- a/ApplicationCode/ProjectDataModel/RimProject.cpp +++ b/ApplicationCode/ProjectDataModel/RimProject.cpp @@ -418,20 +418,20 @@ void RimProject::setProjectFileNameAndUpdateDependencies(const QString& fileName } // Update path to well path file cache - for (size_t oilFieldIdx = 0; oilFieldIdx < oilFields().size(); oilFieldIdx++) - { - RimOilField* oilField = oilFields[oilFieldIdx]; - if (oilField == NULL || oilField->wellPathCollection == NULL) continue; - oilField->wellPathCollection->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath); - } - for(RimOilField* oilField: oilFields) { - if(oilField == NULL) continue; - if(oilField->formationNamesCollection() != NULL) + if (oilField == NULL) continue; + if (oilField->wellPathCollection() != NULL) + { + oilField->wellPathCollection()->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath); + } + if (oilField->formationNamesCollection() != NULL) { oilField->formationNamesCollection()->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath); } + if (oilField->summaryCaseCollection() != NULL) { + oilField->summaryCaseCollection()->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath); + } } diff --git a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp index eb7f377c94..05c212aa30 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp +++ b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp @@ -29,6 +29,7 @@ #include "RimTools.h" #include "cafProgressInfo.h" +#include "cafUtils.h" #include "cvfGeometryTools.h" @@ -137,6 +138,7 @@ void RimReservoirCellResultsStorage::setupBeforeSave() cacheEntry->m_resultType = resInfo[rIdx].m_resultType; cacheEntry->m_resultName = resInfo[rIdx].m_resultName; cacheEntry->m_timeStepDates = resInfo[rIdx].m_timeStepDates; + cacheEntry->m_daysSinceSimulationStart = resInfo[rIdx].m_daysSinceSimulationStart; // Take note of the file position for fast lookup later cacheEntry->m_filePosition = cacheFile.pos(); @@ -1393,16 +1395,15 @@ void RimReservoirCellResultsStorage::setCellResults(RigCaseCellResultsData* cell // Get the name of the cache name relative to the current project file position QString newValidCacheFileName = getValidCacheFileName(); - QFile storageFile(newValidCacheFileName); - // Warn if we thought we were to find some data on the storage file - if (!storageFile.exists() && m_resultCacheMetaData.size()) + if (!caf::Utils::fileExists(newValidCacheFileName) && m_resultCacheMetaData.size()) { qWarning() << "Reading stored results: Missing the storage file : " + newValidCacheFileName; return; } + QFile storageFile(newValidCacheFileName); if (!storageFile.open(QIODevice::ReadOnly)) { qWarning() << "Reading stored results: Can't open the file : " + newValidCacheFileName; @@ -1436,7 +1437,7 @@ void RimReservoirCellResultsStorage::setCellResults(RigCaseCellResultsData* cell RimReservoirCellResultsStorageEntryInfo* resInfo = m_resultCacheMetaData[rIdx]; size_t resultIndex = m_cellResults->addEmptyScalarResult(resInfo->m_resultType(), resInfo->m_resultName(), true); - m_cellResults->setTimeStepDates(resultIndex, resInfo->m_timeStepDates(), std::vector()); // Hack: Using no report step numbers. Not really used except for Flow Diagnostics... + m_cellResults->setTimeStepDates(resultIndex, resInfo->m_timeStepDates(), resInfo->m_daysSinceSimulationStart(), std::vector()); // Hack: Using no report step numbers. Not really used except for Flow Diagnostics... progress.setProgressDescription(resInfo->m_resultName); @@ -1531,6 +1532,7 @@ RimReservoirCellResultsStorageEntryInfo::RimReservoirCellResultsStorageEntryInfo CAF_PDM_InitField(&m_resultType, "ResultType", caf::AppEnum(RimDefines::REMOVED), "ResultType", "", "" ,""); CAF_PDM_InitField(&m_resultName, "ResultName", QString(), "ResultName", "", "" ,""); CAF_PDM_InitFieldNoDefault(&m_timeStepDates, "TimeSteps", "TimeSteps", "", "" ,""); + CAF_PDM_InitFieldNoDefault(&m_daysSinceSimulationStart, "DaysSinceSimulationStart", "DaysSinceSimulationStart", "", "", ""); CAF_PDM_InitField(&m_filePosition, "FilePositionDataStart", qint64(-1), "FilePositionDataStart", "", "" ,""); } diff --git a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.h b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.h index 1acdcfd157..9793d7d67f 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.h +++ b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.h @@ -101,6 +101,7 @@ public: caf::PdmField > m_resultType; caf::PdmField m_resultName; caf::PdmField< std::vector > m_timeStepDates; + caf::PdmField< std::vector > m_daysSinceSimulationStart; caf::PdmField m_filePosition; }; diff --git a/ApplicationCode/ProjectDataModel/RimScriptCollection.cpp b/ApplicationCode/ProjectDataModel/RimScriptCollection.cpp index 04908c574c..2ed6cc2778 100644 --- a/ApplicationCode/ProjectDataModel/RimScriptCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimScriptCollection.cpp @@ -87,11 +87,12 @@ void RimScriptCollection::readContentFromDisc() { QString fileName = fileList.at(i); - QFileInfo fi(fileName); - if (fi.exists()) + if (caf::Utils::fileExists(fileName)) { RimCalcScript* calcScript = new RimCalcScript; calcScript->absolutePath = fileName; + + QFileInfo fi(fileName); calcScript->setUiName(fi.baseName()); calcScripts.push_back(calcScript); @@ -187,7 +188,10 @@ void RimScriptCollection::defineEditorAttribute(const caf::PdmFieldHandle* field { if (field == &directory) { - caf::PdmUiFilePathEditorAttribute* myAttr = static_cast(attribute); - myAttr->m_selectDirectory = true; + caf::PdmUiFilePathEditorAttribute* myAttr = dynamic_cast(attribute); + if (myAttr) + { + myAttr->m_selectDirectory = true; + } } } diff --git a/ApplicationCode/ProjectDataModel/RimTools.cpp b/ApplicationCode/ProjectDataModel/RimTools.cpp index e9dc626ea2..2d47f7c43a 100644 --- a/ApplicationCode/ProjectDataModel/RimTools.cpp +++ b/ApplicationCode/ProjectDataModel/RimTools.cpp @@ -30,6 +30,7 @@ #include "RimWellPathCollection.h" #include "cafPdmUiItem.h" +#include "cafUtils.h" #include #include @@ -81,7 +82,7 @@ QString RimTools::relocateFile(const QString& orgFileName, const QString& orgNew bool isWindowsPath = false; if (orgFileName.count("/")) isWindowsPath = false; // "/" are not allowed in a windows path else if (orgFileName.count("\\") - && !QFile::exists(orgFileName)) // To make sure we do not convert single linux files containing "\" + && !caf::Utils::fileExists(orgFileName)) // To make sure we do not convert single linux files containing "\" { isWindowsPath = true; } @@ -93,7 +94,7 @@ QString RimTools::relocateFile(const QString& orgFileName, const QString& orgNew } if (searchedPaths) searchedPaths->push_back(fileName); - if (QFile::exists(fileName)) + if (caf::Utils::fileExists(fileName)) { return fileName; } @@ -104,7 +105,7 @@ QString RimTools::relocateFile(const QString& orgFileName, const QString& orgNew QString candidate = QDir::fromNativeSeparators(newProjectPath + QDir::separator() + fileNameWithoutPath); if (searchedPaths) searchedPaths->push_back(candidate); - if (QFile::exists(candidate)) + if (caf::Utils::fileExists(candidate)) { return candidate; } @@ -130,7 +131,15 @@ QString RimTools::relocateFile(const QString& orgFileName, const QString& orgNew int firstDiffIdx = 0; for (firstDiffIdx = 0; firstDiffIdx < gridPathElements.size() && firstDiffIdx < oldProjPathElements.size(); ++firstDiffIdx) { - if (gridPathElements[firstDiffIdx] == oldProjPathElements[firstDiffIdx]) +#ifdef WIN32 + // When comparing parts of a file path, the drive letter has been seen to be a mix of + // upper and lower cases. Always use case insensitive compare on Windows, as this is a valid approach + // for all parts for a file path + Qt::CaseSensitivity cs = Qt::CaseInsensitive; +#else + Qt::CaseSensitivity cs = Qt::CaseSensitive; +#endif + if (gridPathElements[firstDiffIdx].compare(oldProjPathElements[firstDiffIdx], cs) == 0) { pathStartsAreEqual = pathStartsAreEqual || !gridPathElements[firstDiffIdx].isEmpty(); } @@ -191,7 +200,7 @@ QString RimTools::relocateFile(const QString& orgFileName, const QString& orgNew if (searchedPaths) searchedPaths->push_back(relocatedFileName); - if (QFile::exists(relocatedFileName)) + if (caf::Utils::fileExists(relocatedFileName)) { return relocatedFileName; } diff --git a/ApplicationCode/ProjectDataModel/RimView.cpp b/ApplicationCode/ProjectDataModel/RimView.cpp index 9a80c4e340..66e6784fc2 100644 --- a/ApplicationCode/ProjectDataModel/RimView.cpp +++ b/ApplicationCode/ProjectDataModel/RimView.cpp @@ -693,8 +693,6 @@ void RimView::addWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList, RimWellPathCollection* wellPathCollection = oilFields ? oilFields->wellPathCollection() : NULL; RivWellPathCollectionPartMgr* wellPathCollectionPartMgr = wellPathCollection ? wellPathCollection->wellPathCollectionPartMgr() : NULL; - cvf::ref transForm = displayCoordTransform(); - if (wellPathCollectionPartMgr) { wellPathCollectionPartMgr->appendStaticGeometryPartsToModel(wellPathModelBasicList, @@ -702,7 +700,7 @@ void RimView::addWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList, scaleTransform, characteristicCellSize, wellPathClipBoundingBox, - transForm.p()); + this->displayCoordTransform().p()); } wellPathModelBasicList->updateBoundingBoxesRecursive(); diff --git a/ApplicationCode/ProjectDataModel/RimViewManipulator.cpp b/ApplicationCode/ProjectDataModel/RimViewManipulator.cpp index af213af74e..ac8712139c 100644 --- a/ApplicationCode/ProjectDataModel/RimViewManipulator.cpp +++ b/ApplicationCode/ProjectDataModel/RimViewManipulator.cpp @@ -22,6 +22,7 @@ #include "RimEclipseView.h" #include "RimView.h" +#include "RimCase.h" #include "RiuViewer.h" @@ -36,25 +37,35 @@ //-------------------------------------------------------------------------------------------------- void RimViewManipulator::applySourceViewCameraOnDestinationViews(RimView* sourceView, std::vector& destinationViews) { + bool setPointOfInterest = false; cvf::Vec3d sourceCamUp; cvf::Vec3d sourceCamEye; cvf::Vec3d sourceCamViewRefPoint; + cvf::Vec3d sourcePointOfInterest; sourceView->viewer()->mainCamera()->toLookAt(&sourceCamEye, &sourceCamViewRefPoint, &sourceCamUp); cvf::Vec3d sourceCamGlobalEye = sourceCamEye; cvf::Vec3d sourceCamGlobalViewRefPoint = sourceCamViewRefPoint; + if (sourceView->viewer()->getNavigationPolicy() != nullptr) + { + setPointOfInterest = true; + sourcePointOfInterest = sourceView->viewer()->pointOfInterest(); + } // Source bounding box in global coordinates including scaleZ cvf::BoundingBox sourceSceneBB = sourceView->viewer()->currentScene()->boundingBox(); - - RimEclipseView* eclipseView = dynamic_cast(sourceView); - if (eclipseView && eclipseView->mainGrid()) { - cvf::Vec3d offset = eclipseView->mainGrid()->displayModelOffset(); - offset.z() *= eclipseView->scaleZ(); + cvf::Vec3d offset = cvf::Vec3d::ZERO; + RimCase* sourceOwnerCase = sourceView->ownerCase(); + if (sourceOwnerCase) + { + offset = sourceOwnerCase->displayModelOffset(); + offset.z() *= sourceView->scaleZ(); + } sourceCamGlobalEye += offset; sourceCamGlobalViewRefPoint += offset; + if (setPointOfInterest) sourcePointOfInterest += offset; cvf::Mat4d trans; trans.setTranslation(offset); @@ -74,44 +85,41 @@ void RimViewManipulator::applySourceViewCameraOnDestinationViews(RimView* source // Destination bounding box in global coordinates including scaleZ cvf::BoundingBox destSceneBB = destinationViewer->currentScene()->boundingBox(); + cvf::Vec3d destinationCamEye = sourceCamGlobalEye; + cvf::Vec3d destinationCamViewRefPoint = sourceCamGlobalViewRefPoint; + cvf::Vec3d offset = cvf::Vec3d::ZERO; - RimEclipseView* destEclipseView = dynamic_cast(destinationView); - if (destEclipseView && destEclipseView->mainGrid()) + RimCase* destinationOwnerCase = destinationView->ownerCase(); + if (destinationOwnerCase) { - cvf::Vec3d destOffset = destEclipseView->mainGrid()->displayModelOffset(); - destOffset.z() *= destEclipseView->scaleZ(); + offset = destinationOwnerCase->displayModelOffset(); + offset.z() *= destinationView->scaleZ(); + } - cvf::Vec3d destinationCamEye = sourceCamGlobalEye - destOffset; - cvf::Vec3d destinationCamViewRefPoint = sourceCamGlobalViewRefPoint - destOffset; + destinationCamEye -= offset; + destinationCamViewRefPoint -= offset; - cvf::Mat4d trans; - trans.setTranslation(destOffset); - destSceneBB.transform(trans); + cvf::Mat4d trans; + trans.setTranslation(offset); + destSceneBB.transform(trans); - if (isBoundingBoxesOverlappingOrClose(sourceSceneBB, destSceneBB)) - { - destinationViewer->mainCamera()->setFromLookAt(destinationCamEye, destinationCamViewRefPoint, sourceCamUp); - } - else - { - // Fallback using values from source camera - destinationViewer->mainCamera()->setFromLookAt(sourceCamEye, sourceCamViewRefPoint, sourceCamUp); - } + if (isBoundingBoxesOverlappingOrClose(sourceSceneBB, destSceneBB)) + { + destinationViewer->mainCamera()->setFromLookAt(destinationCamEye, destinationCamViewRefPoint, sourceCamUp); } else { - if (isBoundingBoxesOverlappingOrClose(sourceSceneBB, destSceneBB)) - { - destinationViewer->mainCamera()->setFromLookAt(sourceCamGlobalEye, sourceCamGlobalViewRefPoint, sourceCamUp); - } - else - { - // Fallback using values from source camera - destinationViewer->mainCamera()->setFromLookAt(sourceCamEye, sourceCamViewRefPoint, sourceCamUp); - } + // Fallback using values from source camera + destinationViewer->mainCamera()->setFromLookAt(sourceCamEye, sourceCamViewRefPoint, sourceCamUp); } - destinationViewer->updateParallelProjectionSettings(sourceView->viewer()); + if (setPointOfInterest) + { + cvf::Vec3d pointOfInterest = sourcePointOfInterest; + pointOfInterest -= offset; + destinationViewer->updateParallelProjectionHeightFromMoveZoom(pointOfInterest); + destinationViewer->updateParallelProjectionCameraPosFromPointOfInterestMove(pointOfInterest); + } destinationViewer->update(); } diff --git a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp index 5da8286b36..7182c85e2b 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp @@ -28,6 +28,9 @@ #include "RigGeoMechCaseData.h" #include "RigGeoMechWellLogExtractor.h" #include "RigResultAccessorFactory.h" +#include "RigSimulationWellCenterLineCalculator.h" +#include "RigSimulationWellCoordsAndMD.h" +#include "RigSingleWellResultsData.h" #include "RigWellLogCurveData.h" #include "RigWellPath.h" @@ -38,6 +41,7 @@ #include "RimGeoMechCase.h" #include "RimGeoMechResultDefinition.h" #include "RimGeoMechView.h" +#include "RimMainPlotCollection.h" #include "RimOilField.h" #include "RimProject.h" #include "RimTools.h" @@ -55,6 +59,7 @@ #include "cafUtils.h" #include +#include "RimEclipseWell.h" //================================================================================================== /// @@ -63,6 +68,19 @@ CAF_PDM_SOURCE_INIT(RimWellLogExtractionCurve, "RimWellLogExtractionCurve"); + +namespace caf +{ +template<> +void AppEnum< RimWellLogExtractionCurve::TrajectoryType >::setUp() +{ + addItem(RimWellLogExtractionCurve::WELL_PATH, "WELL_PATH", "Well Path"); + addItem(RimWellLogExtractionCurve::SIMULATION_WELL, "SIMULATION_WELL", "Simulation Well"); + setDefault(RimWellLogExtractionCurve::WELL_PATH); +} +} + + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -70,17 +88,22 @@ RimWellLogExtractionCurve::RimWellLogExtractionCurve() { CAF_PDM_InitObject("Well Log Curve", "", "", ""); - CAF_PDM_InitFieldNoDefault(&m_wellPath, "CurveWellPath", "Well Path", "", "", ""); + CAF_PDM_InitFieldNoDefault(&m_trajectoryType, "TrajectoryType", "Trajectory", "", "", ""); + + CAF_PDM_InitFieldNoDefault(&m_wellPath, "CurveWellPath", " ", "", "", ""); m_wellPath.uiCapability()->setUiTreeChildrenHidden(true); - //m_wellPath.uiCapability()->setUiHidden(true); + + CAF_PDM_InitField(&m_simWellName, "SimulationWellName", QString("None"), " ", "", "", ""); + CAF_PDM_InitField(&m_branchIndex, "Branch", 0, " ", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_case, "CurveCase", "Case", "", "", ""); m_case.uiCapability()->setUiTreeChildrenHidden(true); - //m_case.uiCapability()->setUiHidden(true); + CAF_PDM_InitFieldNoDefault(&m_eclipseResultDefinition, "CurveEclipseResult", "", "", "", ""); m_eclipseResultDefinition.uiCapability()->setUiHidden(true); m_eclipseResultDefinition.uiCapability()->setUiTreeChildrenHidden(true); m_eclipseResultDefinition = new RimEclipseResultDefinition; + m_eclipseResultDefinition->findField("MResultType")->uiCapability()->setUiName("Result Type"); CAF_PDM_InitFieldNoDefault(&m_geomResultDefinition, "CurveGeomechResult", "", "", "", ""); m_geomResultDefinition.uiCapability()->setUiHidden(true); @@ -102,6 +125,8 @@ RimWellLogExtractionCurve::RimWellLogExtractionCurve() //-------------------------------------------------------------------------------------------------- RimWellLogExtractionCurve::~RimWellLogExtractionCurve() { + clearGeneratedSimWellPaths(); + delete m_geomResultDefinition; delete m_eclipseResultDefinition; } @@ -123,12 +148,25 @@ RimWellPath* RimWellLogExtractionCurve::wellPath() const return m_wellPath; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellLogExtractionCurve::setFromSimulationWellName(const QString& simWellName, int branchIndex) +{ + m_trajectoryType = SIMULATION_WELL; + m_simWellName = simWellName; + m_branchIndex = branchIndex; + + clearGeneratedSimWellPaths(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RimWellLogExtractionCurve::setCase(RimCase* rimCase) { m_case = rimCase; + clearGeneratedSimWellPaths(); } //-------------------------------------------------------------------------------------------------- @@ -165,6 +203,8 @@ void RimWellLogExtractionCurve::setPropertiesFromView(RimView* view) m_geomResultDefinition->setResultAddress(geoMechView->cellResultResultDefinition()->resultAddress()); m_timeStep = geoMechView->currentTimeStep(); } + + clearGeneratedSimWellPaths(); } //-------------------------------------------------------------------------------------------------- @@ -181,6 +221,23 @@ void RimWellLogExtractionCurve::clampTimestep() } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellLogExtractionCurve::clampBranchIndex() +{ + int branchCount = static_cast(m_generatedSimulationWellPathBranches.size()); + if ( branchCount > 0 ) + { + if ( m_branchIndex >= branchCount ) m_branchIndex = branchCount - 1; + else if ( m_branchIndex < 0 ) m_branchIndex = 0; + } + else + { + m_branchIndex = -1; + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -191,6 +248,11 @@ void RimWellLogExtractionCurve::fieldChangedByUi(const caf::PdmFieldHandle* chan if (changedField == &m_case) { clampTimestep(); + + auto wellNameSet = findSortedWellNames(); + if (!wellNameSet.count(m_simWellName())) m_simWellName = "None"; + + clearGeneratedSimWellPaths(); this->loadDataAndUpdate(); } @@ -198,6 +260,17 @@ void RimWellLogExtractionCurve::fieldChangedByUi(const caf::PdmFieldHandle* chan { this->loadDataAndUpdate(); } + else if (changedField == &m_simWellName) + { + clearGeneratedSimWellPaths(); + + this->loadDataAndUpdate(); + } + else if (changedField == &m_trajectoryType || + changedField == &m_branchIndex) + { + this->loadDataAndUpdate(); + } else if (changedField == &m_timeStep) { this->loadDataAndUpdate(); @@ -230,12 +303,27 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate() m_eclipseResultDefinition->setEclipseCase(eclipseCase); m_geomResultDefinition->setGeoMechCase(geomCase); - RimWellLogPlotCollection* wellLogCollection = NULL; - this->firstAncestorOrThisOfType(wellLogCollection); - CVF_ASSERT(wellLogCollection); - if (!wellLogCollection) return; + updateGeneratedSimulationWellpath(); + clampBranchIndex(); - cvf::ref eclExtractor = wellLogCollection->findOrCreateExtractor(m_wellPath, eclipseCase); + RimWellLogPlotCollection* wellLogCollection; + this->firstAncestorOrThisOfTypeAsserted(wellLogCollection); + + cvf::ref eclExtractor; + if ( m_trajectoryType == WELL_PATH ) + { + eclExtractor = wellLogCollection->findOrCreateExtractor(m_wellPath, eclipseCase); + } + else + { + if (m_branchIndex >= 0 && m_branchIndex < static_cast(m_generatedSimulationWellPathBranches.size()) ) + { + eclExtractor = wellLogCollection->findOrCreateSimWellExtractor(m_simWellName, + eclipseCase->caseUserDescription(), + m_generatedSimulationWellPathBranches[m_branchIndex].p(), + eclipseCase->eclipseCaseData()); + } + } cvf::ref geomExtractor = wellLogCollection->findOrCreateExtractor(m_wellPath, geomCase); std::vector values; @@ -321,6 +409,94 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate() } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::set RimWellLogExtractionCurve::findSortedWellNames() +{ + std::set sortedWellNames; + RimEclipseCase* eclipseCase = dynamic_cast(m_case.value()); + + if ( eclipseCase && eclipseCase->eclipseCaseData() ) + { + const cvf::Collection& wellRes = eclipseCase->eclipseCaseData()->wellResults(); + + for ( size_t wIdx = 0; wIdx < wellRes.size(); ++wIdx ) + { + sortedWellNames.insert(wellRes[wIdx]->m_wellName); + } + } + + return sortedWellNames; +} + + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellLogExtractionCurve::updateGeneratedSimulationWellpath() +{ + if (m_generatedSimulationWellPathBranches.size()) return; // Already created. Nothing to do + + RimEclipseCase* eclipseCase = dynamic_cast(m_case.value()); + + if (!(!m_simWellName().isEmpty() && m_simWellName() != "None" && eclipseCase && eclipseCase->eclipseCaseData())) + { + return ; + } + + RigEclipseCaseData* eclCaseData = eclipseCase->eclipseCaseData(); + const RigSingleWellResultsData* wellResults = eclCaseData->findWellResult(m_simWellName()); + + if (!wellResults) return; + + std::vector< std::vector > pipeBranchesCLCoords; + std::vector< std::vector > pipeBranchesCellIds; + + RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineFromWellFrame(eclCaseData, + wellResults, + -1, + true, + true, + pipeBranchesCLCoords, + pipeBranchesCellIds); + + + for ( size_t brIdx = 0; brIdx < pipeBranchesCLCoords.size(); ++brIdx ) + { + auto wellMdCalculator = RigSimulationWellCoordsAndMD(pipeBranchesCLCoords[brIdx]); // Todo, branch index + + cvf::ref newWellPath = new RigWellPath(); + newWellPath->m_measuredDepths = wellMdCalculator.measuredDepths(); + newWellPath->m_wellPathPoints = wellMdCalculator.wellPathPoints(); + + m_generatedSimulationWellPathBranches.push_back(newWellPath.p() ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// Clean up existing generated well paths +//-------------------------------------------------------------------------------------------------- +void RimWellLogExtractionCurve::clearGeneratedSimWellPaths() +{ + RimWellLogPlotCollection* wellLogCollection = nullptr; + + // Need to use this approach, and not firstAnchestor because the curve might not be inside the hierarchy when deleted. + + RimProject * proj = RiaApplication::instance()->project(); + if (proj && proj->mainPlotCollection() ) wellLogCollection = proj->mainPlotCollection()->wellLogPlotCollection(); + + if (!wellLogCollection) return; + + for ( size_t wpIdx = 0; wpIdx < m_generatedSimulationWellPathBranches.size(); ++wpIdx ) + { + wellLogCollection->removeExtractors(m_generatedSimulationWellPathBranches[wpIdx].p()); + } + + m_generatedSimulationWellPathBranches.clear(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -335,19 +511,13 @@ QList RimWellLogExtractionCurve::calculateValueOptions(c { RimTools::wellPathOptionItems(&options); - if (options.size() > 0) - { - options.push_front(caf::PdmOptionItemInfo("None", nullptr)); - } + options.push_front(caf::PdmOptionItemInfo("None", nullptr)); } else if (fieldNeedingOptions == &m_case) { RimTools::caseOptionItems(&options); - if (options.size() > 0) - { - options.push_front(caf::PdmOptionItemInfo("None", nullptr)); - } + options.push_front(caf::PdmOptionItemInfo("None", nullptr)); } else if (fieldNeedingOptions == &m_timeStep) { @@ -363,7 +533,37 @@ QList RimWellLogExtractionCurve::calculateValueOptions(c options.push_back(caf::PdmOptionItemInfo(timeStepNames[i], i)); } } + else if (fieldNeedingOptions == &m_simWellName) + { + std::set sortedWellNames = this->findSortedWellNames(); + QIcon simWellIcon(":/Well.png"); + for ( const QString& wname: sortedWellNames ) + { + options.push_back(caf::PdmOptionItemInfo(wname, wname, false, simWellIcon)); + } + + if ( options.size() == 0 ) + { + options.push_front(caf::PdmOptionItemInfo("None", "None")); + } + } + else if (fieldNeedingOptions == &m_branchIndex) + { + updateGeneratedSimulationWellpath(); + + size_t branchCount = m_generatedSimulationWellPathBranches.size(); + + for ( int bIdx = 0; bIdx < static_cast(branchCount); ++bIdx) + { + options.push_back(caf::PdmOptionItemInfo("Branch " + QString::number(bIdx + 1), QVariant::fromValue(bIdx) )); + } + + if (options.size() == 0) + { + options.push_front(caf::PdmOptionItemInfo("None", -1)); + } + } return options; } @@ -377,25 +577,39 @@ void RimWellLogExtractionCurve::defineUiOrdering(QString uiConfigName, caf::PdmU caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup("Curve Data"); - curveDataGroup->add(&m_wellPath); curveDataGroup->add(&m_case); - + RimGeoMechCase* geomCase = dynamic_cast(m_case.value()); RimEclipseCase* eclipseCase = dynamic_cast(m_case.value()); + curveDataGroup->add(&m_trajectoryType); + if (m_trajectoryType() == WELL_PATH) + { + curveDataGroup->add(&m_wellPath); + } + else + { + curveDataGroup->add(&m_simWellName); + if ( m_generatedSimulationWellPathBranches.size() > 1 ) + { + curveDataGroup->add(&m_branchIndex); + } + } + if (eclipseCase) { m_eclipseResultDefinition->uiOrdering(uiConfigName, *curveDataGroup); - if (m_eclipseResultDefinition->hasDynamicResult()) - { - curveDataGroup->add(&m_timeStep); - } } else if (geomCase) { m_geomResultDefinition->uiOrdering(uiConfigName, *curveDataGroup); - + + } + + if ( (eclipseCase && m_eclipseResultDefinition->hasDynamicResult()) + || geomCase) + { curveDataGroup->add(&m_timeStep); } @@ -404,6 +618,7 @@ void RimWellLogExtractionCurve::defineUiOrdering(QString uiConfigName, caf::PdmU caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup("Curve Name"); nameGroup->setCollapsedByDefault(true); + nameGroup->add(&m_showLegend); RimPlotCurve::curveNameUiOrdering(*nameGroup); if (m_isUsingAutoName) @@ -471,9 +686,13 @@ QString RimWellLogExtractionCurve::createCurveAutoName() RimEclipseCase* eclipseCase = dynamic_cast(m_case.value()); QString generatedCurveName; - if (m_addWellNameToCurveName && m_wellPath) + if (m_addWellNameToCurveName ) { generatedCurveName += wellName(); + if (m_trajectoryType == SIMULATION_WELL && m_generatedSimulationWellPathBranches.size() > 1) + { + generatedCurveName += " Br" + QString::number(m_branchIndex + 1); + } } if (m_addCaseNameToCurveName && m_case()) @@ -578,13 +797,20 @@ QString RimWellLogExtractionCurve::wellLogChannelName() const //-------------------------------------------------------------------------------------------------- QString RimWellLogExtractionCurve::wellName() const { - if (m_wellPath) + if ( m_trajectoryType() == WELL_PATH ) { - return m_wellPath->name(); + if ( m_wellPath ) + { + return m_wellPath->name(); + } + else + { + return QString(); + } } else { - return QString(); + return m_simWellName; } } @@ -674,3 +900,11 @@ double RimWellLogExtractionCurve::rkbDiff() const return HUGE_VAL; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +int RimWellLogExtractionCurve::currentTimeStep() const +{ + return m_timeStep(); +} diff --git a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.h b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.h index 2ebf168c03..70734a3414 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.h @@ -23,12 +23,14 @@ #include "cafPdmPtrField.h" #include "cafPdmChildField.h" +#include "cvfCollection.h" class RimCase; class RimEclipseResultDefinition; class RimGeoMechResultDefinition; class RimView; class RimWellPath; +class RigWellPath; //================================================================================================== /// @@ -41,9 +43,13 @@ public: RimWellLogExtractionCurve(); virtual ~RimWellLogExtractionCurve(); + enum TrajectoryType { WELL_PATH, SIMULATION_WELL}; + void setWellPath(RimWellPath* wellPath); RimWellPath* wellPath() const; + void setFromSimulationWellName(const QString& simWellName, int branchIndex); + void setCase(RimCase* rimCase); RimCase* rimCase() const; @@ -57,6 +63,8 @@ public: QString caseName() const; double rkbDiff() const; + int currentTimeStep() const; + protected: virtual QString createCurveAutoName(); virtual void onLoadDataAndUpdate(); @@ -73,9 +81,16 @@ protected: private: void setLogScaleFromSelectedResult(); void clampTimestep(); + void clampBranchIndex(); + std::set findSortedWellNames(); + void updateGeneratedSimulationWellpath(); + void clearGeneratedSimWellPaths(); private: caf::PdmPtrField m_wellPath; + caf::PdmField > m_trajectoryType; + caf::PdmField m_simWellName; + caf::PdmField m_branchIndex; caf::PdmPtrField m_case; caf::PdmChildField m_eclipseResultDefinition; caf::PdmChildField m_geomResultDefinition; @@ -86,5 +101,7 @@ private: caf::PdmField m_addWellNameToCurveName; caf::PdmField m_addTimestepToCurveName; caf::PdmField m_addDateToCurveName; + + cvf::Collection m_generatedSimulationWellPathBranches; }; diff --git a/ApplicationCode/ProjectDataModel/RimWellLogFileCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellLogFileCurve.cpp index fcf1dab8b9..e6811a4ace 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogFileCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogFileCurve.cpp @@ -84,7 +84,7 @@ void RimWellLogFileCurve::onLoadDataAndUpdate() { if (RiaApplication::instance()->preferences()->showLasCurveWithoutTvdWarning()) { - QString tmp = QString("Display of True Vertical Depth (TVD) for LAS curves in not yet supported, and no LAS curve will be displayed in this mode.\n\n"); + QString tmp = QString("Display of True Vertical Depth (TVD) for LAS curves is not yet supported, and the LAS curve will be hidden in this mode.\n\n"); tmp += "Control display of this warning from \"Preferences->Show LAS curve without TVD warning\""; QMessageBox::warning(NULL, "LAS curve without TVD", tmp); @@ -179,6 +179,7 @@ void RimWellLogFileCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrder RimPlotCurve::appearanceUiOrdering(*appearanceGroup); caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup("Curve Name"); + nameGroup->add(&m_showLegend); RimPlotCurve::curveNameUiOrdering(*nameGroup); } diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlotCollection.cpp b/ApplicationCode/ProjectDataModel/RimWellLogPlotCollection.cpp index fe8cbaf0d4..b1f0ac84d4 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlotCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlotCollection.cpp @@ -52,6 +52,34 @@ RimWellLogPlotCollection::~RimWellLogPlotCollection() wellLogPlots.deleteAllChildObjects(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RigEclipseWellLogExtractor* RimWellLogPlotCollection::findOrCreateSimWellExtractor(const QString& simWellName, + const QString& caseUserDescription, + const RigWellPath* wellPathGeom, + const RigEclipseCaseData* eclCaseData) +{ + if (!(wellPathGeom && eclCaseData)) + { + return nullptr; + } + + for (size_t exIdx = 0; exIdx < m_extractors.size(); ++exIdx) + { + if (m_extractors[exIdx]->caseData() == eclCaseData && m_extractors[exIdx]->wellPathData() == wellPathGeom) + { + return m_extractors[exIdx].p(); + } + } + + std::string errorIdName = (simWellName + " " + caseUserDescription).toStdString(); + cvf::ref extractor = new RigEclipseWellLogExtractor(eclCaseData, wellPathGeom, errorIdName); + m_extractors.push_back(extractor.p()); + + return extractor.p(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlotCollection.h b/ApplicationCode/ProjectDataModel/RimWellLogPlotCollection.h index dba85804d5..11990bffbe 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlotCollection.h +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlotCollection.h @@ -45,7 +45,12 @@ class RimWellLogPlotCollection : public caf::PdmObject public: RimWellLogPlotCollection(); virtual ~RimWellLogPlotCollection(); - + + RigEclipseWellLogExtractor* findOrCreateSimWellExtractor(const QString& simWellName, + const QString& caseUserDescription, + const RigWellPath* wellPathGeom, + const RigEclipseCaseData* eclCaseData); + RigEclipseWellLogExtractor* findOrCreateExtractor(RimWellPath* wellPath, RimEclipseCase* eclCase); RigGeoMechWellLogExtractor* findOrCreateExtractor(RimWellPath* wellPath, RimGeoMechCase* eclCase); diff --git a/ApplicationCode/ProjectDataModel/RimWellPath.cpp b/ApplicationCode/ProjectDataModel/RimWellPath.cpp index ff0c6cd63d..050ef81a5b 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPath.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellPath.cpp @@ -20,13 +20,12 @@ #include "RimWellPath.h" -#include "RifJsonEncodeDecode.h" +#include "RifWellPathImporter.h" #include "RigWellPath.h" #include "RimMainPlotCollection.h" #include "RimProject.h" -#include "RimProject.h" #include "RimTools.h" #include "RimWellLogFile.h" #include "RimWellLogPlotCollection.h" @@ -34,11 +33,15 @@ #include "RimWellPathFracture.h" #include "RimWellPathFractureCollection.h" +#include "RimFishbonesMultipleSubs.h" +#include "RimWellPathCompletions.h" + #include "RiuMainWindow.h" #include "RivWellPathPartMgr.h" #include "cafPdmUiTreeOrdering.h" +#include "cafUtils.h" #include #include @@ -101,7 +104,11 @@ RimWellPath::RimWellPath() CAF_PDM_InitField(&wellPathRadiusScaleFactor, "WellPathRadiusScale", 1.0, "Well path radius scale", "", "", ""); CAF_PDM_InitField(&wellPathColor, "WellPathColor", cvf::Color3f(0.999f, 0.333f, 0.999f), "Well path color", "", "", ""); - + + CAF_PDM_InitFieldNoDefault(&m_completions, "Completions", "Completions", "", "", ""); + m_completions = new RimWellPathCompletions; + m_completions.uiCapability()->setUiTreeHidden(true); + CAF_PDM_InitFieldNoDefault(&m_wellLogFile, "WellLogFile", "Well Log File", "", "", ""); m_wellLogFile.uiCapability()->setUiHidden(true); @@ -162,6 +169,26 @@ void RimWellPath::setSurveyType(QString surveyType) wellPathColor = cvf::Color3f(0.0f, 0.333f, 0.999f); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimFishbonesCollection* RimWellPath::fishbonesCollection() +{ + CVF_ASSERT(m_completions); + + return m_completions->fishbonesCollection(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimPerforationCollection* RimWellPath::perforationIntervalCollection() +{ + CVF_ASSERT(m_completions); + + return m_completions->perforationCollection(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -216,27 +243,28 @@ caf::PdmFieldHandle* RimWellPath::objectToggleField() //-------------------------------------------------------------------------------------------------- /// Read JSON or ascii file containing well path data //-------------------------------------------------------------------------------------------------- -bool RimWellPath::readWellPathFile(QString* errorMessage, RifWellPathAsciiFileReader* asciiReader) +bool RimWellPath::readWellPathFile(QString* errorMessage, RifWellPathImporter* wellPathImporter) { - QFileInfo fileInf(filepath()); - - if (fileInf.isFile() && fileInf.exists()) + if (caf::Utils::fileExists(filepath())) { - if (fileInf.suffix().compare("json") == 0) - { - this->readJsonWellPathFile(); - } - else - { - this->readAsciiWellPathFile(asciiReader); - } + RifWellPathImporter::WellData wellData = wellPathImporter->readWellData(filepath(), wellPathIndexInFile()); + RifWellPathImporter::WellMetaData wellMetaData = wellPathImporter->readWellMetaData(filepath(), wellPathIndexInFile()); + // General well info + name = wellData.m_name; + id = wellMetaData.m_id; + sourceSystem = wellMetaData.m_sourceSystem; + utmZone = wellMetaData.m_utmZone; + updateUser = wellMetaData.m_updateUser; + setSurveyType(wellMetaData.m_surveyType); + updateDate = wellMetaData.m_updateDate.toString("d MMMM yyyy"); + + m_wellPath = wellData.m_wellPathGeometry; return true; } else { if (errorMessage) (*errorMessage) = "Could not find the well path file: " + filepath(); - return false; } } @@ -249,69 +277,6 @@ void RimWellPath::setWellPathGeometry(RigWellPath* wellPathModel) m_wellPath = wellPathModel; } -//-------------------------------------------------------------------------------------------------- -/// Read JSON file containing well path data -//-------------------------------------------------------------------------------------------------- -void RimWellPath::readJsonWellPathFile() -{ - RigWellPath* wellPathGeom = new RigWellPath(); - ResInsightInternalJson::JsonReader jsonReader; - QMap jsonMap = jsonReader.decodeFile(filepath); - - // General well info - - name = jsonMap["name"].toString(); - id = jsonMap["id"].toString(); - sourceSystem = jsonMap["sourceSystem"].toString(); - utmZone = jsonMap["utmZone"].toString(); - updateUser = jsonMap["updateUser"].toString(); - - setSurveyType(jsonMap["surveyType"].toString()); - - // Convert updateDate from the following format: - // "Number of milliseconds elapsed since midnight Coordinated Universal Time (UTC) - // of January 1, 1970, not counting leap seconds" - - QString updateDateStr = jsonMap["updateDate"].toString().trimmed(); - uint updateDateUint = updateDateStr.toULongLong() / 1000; // should be within 32 bit, maximum number is 4294967295 which corresponds to year 2106 - QDateTime updateDateTime; - updateDateTime.setTime_t(updateDateUint); - - updateDate = updateDateTime.toString("d MMMM yyyy"); - - // Well path points - - double datumElevation = jsonMap["datumElevation"].toDouble(); - wellPathGeom->setDatumElevation(datumElevation); - - QList pathList = jsonMap["path"].toList(); - foreach (QVariant point, pathList) - { - QMap coordinateMap = point.toMap(); - cvf::Vec3d vec3d(coordinateMap["east"].toDouble(), coordinateMap["north"].toDouble(), -(coordinateMap["tvd"].toDouble() - datumElevation)); - wellPathGeom->m_wellPathPoints.push_back(vec3d); - - double measuredDepth = coordinateMap["md"].toDouble(); - wellPathGeom->m_measuredDepths.push_back(measuredDepth); - } - - //jsonReader.dumpToFile(wellPathGeom->m_wellPathPoints, "c:\\temp\\jsonpoints.txt"); - setWellPathGeometry(wellPathGeom); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimWellPath::readAsciiWellPathFile(RifWellPathAsciiFileReader* asciiReader) -{ - CVF_ASSERT(asciiReader); - - RifWellPathAsciiFileReader::WellData wpData = asciiReader->readWellData(filepath(), wellPathIndexInFile()); - this->name = wpData.m_name; - - setWellPathGeometry(wpData.m_wellPathGeometry.p()); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -346,6 +311,22 @@ void RimWellPath::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiO } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellPath::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) +{ + uiTreeOrdering.add(&m_wellLogFile); + uiTreeOrdering.add(&m_completions); + + // TODO : Move to subobject Completions->Fractures + for (RimWellPathFracture* fracture : fractureCollection()->fractures()) + { + uiTreeOrdering.add(fracture); + } + uiTreeOrdering.skipRemainingChildren(true); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -410,18 +391,6 @@ void RimWellPath::setupBeforeSave() } } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimWellPath::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/) -{ - for (RimWellPathFracture* fracture : fractureCollection()->fractures()) - { - uiTreeOrdering.add(fracture); - } - uiTreeOrdering.skipRemainingChildren(true); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -440,7 +409,7 @@ void RimWellPath::updateFilePathsFromProjectPath(const QString& newProjectPath, { QString newCacheFileName = getCacheFileName(); - if (QFile::exists(newCacheFileName)) + if (caf::Utils::fileExists(newCacheFileName)) { filepath = newCacheFileName; } @@ -451,6 +420,17 @@ void RimWellPath::updateFilePathsFromProjectPath(const QString& newProjectPath, } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimWellPath::combinedScaleFactor() const +{ + RimWellPathCollection* wellPathColl = nullptr; + this->firstAncestorOrThisOfTypeAsserted(wellPathColl); + + return this->wellPathRadiusScaleFactor() * wellPathColl->wellPathRadiusScaleFactor(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimWellPath.h b/ApplicationCode/ProjectDataModel/RimWellPath.h index 8ccee1b92f..9f6f55474b 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPath.h +++ b/ApplicationCode/ProjectDataModel/RimWellPath.h @@ -29,14 +29,20 @@ // Include to make Pdm work for cvf::Color #include "cafPdmFieldCvfColor.h" +#include "cafPdmChildArrayField.h" #include "cvfObject.h" -class RifWellPathAsciiFileReader; +class RifWellPathImporter; class RigWellPath; class RimProject; class RimWellLogFile; +class RimFishboneWellPathCollection; class RivWellPathPartMgr; +class RimFishbonesCollection; +class RimPerforationCollection; +class RimWellPathCompletions; + class RimWellPathFractureCollection; //================================================================================================== @@ -71,6 +77,9 @@ public: caf::PdmChildField m_wellLogFile; + RimFishbonesCollection* fishbonesCollection(); + RimPerforationCollection* perforationIntervalCollection(); + RigWellPath* wellPathGeometry(); const RigWellPath* wellPathGeometry() const; @@ -80,21 +89,19 @@ public: RivWellPathPartMgr* partMgr(); - bool readWellPathFile(QString * errorMessage, RifWellPathAsciiFileReader* asciiReader); + bool readWellPathFile(QString * errorMessage, RifWellPathImporter* wellPathImporter); void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath); -protected: - virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override; + double combinedScaleFactor() const; private: void setWellPathGeometry(RigWellPath* wellPathModel); - void readJsonWellPathFile(); - void readAsciiWellPathFile(RifWellPathAsciiFileReader* asciiReader); QString surveyType() { return m_surveyType; } void setSurveyType(QString surveyType); virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ); + virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override; bool isStoredInCache(); QString getCacheFileName(); @@ -109,6 +116,8 @@ private: caf::PdmField m_surveyType; caf::PdmField m_datumElevation; + + caf::PdmChildField m_completions; cvf::ref m_wellPath; cvf::ref m_wellPathPartMgr; diff --git a/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp b/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp index 2ae1116f90..321a118bb5 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp @@ -22,6 +22,7 @@ #include "RiaApplication.h" #include "RiaPreferences.h" +#include "RiaColorTables.h" #include "RigWellPath.h" @@ -33,6 +34,8 @@ #include "RivWellPathCollectionPartMgr.h" +#include "RifWellPathImporter.h" + #include "cafPdmUiEditorHandle.h" #include "cafProgressInfo.h" @@ -88,9 +91,7 @@ RimWellPathCollection::RimWellPathCollection() m_wellPathCollectionPartManager = new RivWellPathCollectionPartMgr(this); - m_asciiFileReader = new RifWellPathAsciiFileReader; - - + m_wellPathImporter = new RifWellPathImporter; } @@ -100,7 +101,7 @@ RimWellPathCollection::RimWellPathCollection() RimWellPathCollection::~RimWellPathCollection() { wellPaths.deleteAllChildObjects(); - delete m_asciiFileReader; + delete m_wellPathImporter; } @@ -125,7 +126,7 @@ void RimWellPathCollection::readWellPathFiles() if (!wellPaths[wpIdx]->filepath().isEmpty()) { QString errorMessage; - if (!wellPaths[wpIdx]->readWellPathFile(&errorMessage, this->asciiFileReader())) + if (!wellPaths[wpIdx]->readWellPathFile(&errorMessage, m_wellPathImporter)) { QMessageBox::warning(RiuMainWindow::instance(), "File open error", @@ -201,7 +202,7 @@ void RimWellPathCollection::addWellPaths( QStringList filePaths ) else { // Create Well path objects for all the paths in the assumed ascii file - size_t wellPathCount = this->m_asciiFileReader->wellDataCount(filePath); + size_t wellPathCount = m_wellPathImporter->wellDataCount(filePath); for (size_t i = 0; i < wellPathCount; ++i) { RimWellPath* wellPath = new RimWellPath(); @@ -224,10 +225,19 @@ void RimWellPathCollection::readAndAddWellPaths(std::vector& wellP { caf::ProgressInfo progress(wellPathArray.size(), "Reading well paths from file"); + const caf::ColorTable& colorTable = RiaColorTables::wellLogPlotPaletteColors(); + cvf::Color3ubArray wellColors = colorTable.color3ubArray(); + cvf::Color3ubArray interpolatedWellColors = wellColors; + + if (wellPathArray.size() > 1) + { + interpolatedWellColors = caf::ColorTable::interpolateColorArray(wellColors, wellPathArray.size()); + } + for (size_t wpIdx = 0; wpIdx < wellPathArray.size(); wpIdx++) { RimWellPath* wellPath = wellPathArray[wpIdx]; - wellPath->readWellPathFile(NULL, this->asciiFileReader()); + wellPath->readWellPathFile(NULL, m_wellPathImporter); progress.setProgressDescription(QString("Reading file %1").arg(wellPath->name)); @@ -237,12 +247,13 @@ void RimWellPathCollection::readAndAddWellPaths(std::vector& wellP { existingWellPath->filepath = wellPath->filepath; existingWellPath->wellPathIndexInFile = wellPath->wellPathIndexInFile; - existingWellPath->readWellPathFile(NULL, this->asciiFileReader()); + existingWellPath->readWellPathFile(NULL, m_wellPathImporter); delete wellPath; } else { + wellPath->wellPathColor = cvf::Color3f(interpolatedWellColors[wpIdx]); wellPaths.push_back(wellPath); } @@ -348,7 +359,7 @@ void RimWellPathCollection::deleteAllWellPaths() { wellPaths.deleteAllChildObjects(); - m_asciiFileReader->clear(); + m_wellPathImporter->clear(); } //-------------------------------------------------------------------------------------------------- @@ -372,7 +383,7 @@ void RimWellPathCollection::removeWellPath(RimWellPath* wellPath) { // One file can have multiple well paths // If no other well paths are referencing the filepath, remove cached data from the file reader - m_asciiFileReader->removeFilePath(wellPath->filepath); + m_wellPathImporter->removeFilePath(wellPath->filepath); } } @@ -393,211 +404,3 @@ void RimWellPathCollection::sortWellsByName() { std::sort(wellPaths.begin(), wellPaths.end(), lessWellPath); } - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RifWellPathAsciiFileReader::readAllWellData(QString filePath) -{ - std::map >::iterator it = m_fileNameToWellDataGroupMap.find(filePath); - - // If we have the file in the map, assume it is already read. - if (it != m_fileNameToWellDataGroupMap.end()) - { - return; - } - - // Create the data container - std::vector& fileWellDataArray = m_fileNameToWellDataGroupMap[filePath]; - - std::ifstream stream(filePath.toLatin1().data()); - double x(HUGE_VAL), y(HUGE_VAL), tvd(HUGE_VAL), md(HUGE_VAL); - - bool hasReadWellPointInCurrentWell = false; - - while (stream.good()) - { - // First check if we can read a number - stream >> x; - if (stream.good()) // If we can, assume this line is a well point entry - { - stream >> y >> tvd >> md; - if (!stream.good()) - { - // -999 or otherwise to few numbers before some word - if (x != -999) - { - // Error in file: missing numbers at this line - - } - stream.clear(); - } - else - { - if (!fileWellDataArray.size()) - { - fileWellDataArray.push_back(WellData()); - fileWellDataArray.back().m_wellPathGeometry = new RigWellPath(); - } - - cvf::Vec3d wellPoint(x, y, -tvd); - fileWellDataArray.back().m_wellPathGeometry->m_wellPathPoints.push_back(wellPoint); - fileWellDataArray.back().m_wellPathGeometry->m_measuredDepths.push_back(md); - - x = HUGE_VAL; - y = HUGE_VAL; - tvd = HUGE_VAL; - md = HUGE_VAL; - - hasReadWellPointInCurrentWell = true; - } - } - else - { - // Could not read one double. - // we assume there is a comment line or a well path description - stream.clear(); - - std::string line; - std::getline(stream, line, '\n'); - // Skip possible comment lines (-- is used in eclipse, so Haakon Høgstøl considered it smart to skip these here as well) - // The first "-" is eaten by the stream >> x above - if (line.find("-") == 0 || line.find("#") == 0) - { - // Comment line, just ignore - } - else - { - // Find the first and the last position of any quotes (and do not care to match quotes) - size_t quoteStartIdx = line.find_first_of("'`´’‘"); - size_t quoteEndIdx = line.find_last_of("'`´’‘"); - - std::string wellName; - bool haveAPossibleWellStart = false; - - if (quoteStartIdx < line.size() -1) - { - // Extract the text between the quotes - wellName = line.substr(quoteStartIdx + 1, quoteEndIdx - 1 - quoteStartIdx); - haveAPossibleWellStart = true; - } - else if (quoteStartIdx > line.length()) - { - // We did not find any quotes - - // Supported alternatives are - // name - // wellname: - std::string lineLowerCase = line; - transform(lineLowerCase.begin(), lineLowerCase.end(), lineLowerCase.begin(), ::tolower); - - std::string tokenName = "name"; - std::size_t foundNameIdx = lineLowerCase.find(tokenName); - if (foundNameIdx != std::string::npos) - { - std::string tokenColon = ":"; - std::size_t foundColonIdx = lineLowerCase.find(tokenColon, foundNameIdx); - if (foundColonIdx != std::string::npos) - { - wellName = line.substr(foundColonIdx + tokenColon.length()); - } - else - { - wellName = line.substr(foundNameIdx + tokenName.length()); - } - - haveAPossibleWellStart = true; - } - else - { - // Interpret the whole line as the well name. - - QString name = line.c_str(); - if (!name.trimmed().isEmpty()) - { - wellName = name.trimmed().toStdString(); - haveAPossibleWellStart = true; - } - } - } - - if (haveAPossibleWellStart) - { - // Create a new Well data if we have read some data into the previous one. - // if not, just overwrite the name - if (hasReadWellPointInCurrentWell || fileWellDataArray.size() == 0) - { - fileWellDataArray.push_back(WellData()); - fileWellDataArray.back().m_wellPathGeometry = new RigWellPath(); - } - - QString name = wellName.c_str(); - if (!name.trimmed().isEmpty()) - { - // Do not overwrite the name aquired from a line above, if this line is empty - fileWellDataArray.back().m_name = name.trimmed(); - } - hasReadWellPointInCurrentWell = false; - } - } - } - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RifWellPathAsciiFileReader::WellData RifWellPathAsciiFileReader::readWellData(QString filePath, int indexInFile) -{ - this->readAllWellData(filePath); - - std::map >::iterator it = m_fileNameToWellDataGroupMap.find(filePath); - - CVF_ASSERT(it != m_fileNameToWellDataGroupMap.end()); - - if (indexInFile < static_cast(it->second.size())) - { - return it->second[indexInFile]; - } - else - { - // Error : The ascii well path file does not contain that many well paths - return WellData(); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -size_t RifWellPathAsciiFileReader::wellDataCount(QString filePath) -{ - std::map >::iterator it = m_fileNameToWellDataGroupMap.find(filePath); - - // If we have the file in the map, assume it is already read. - if (it != m_fileNameToWellDataGroupMap.end()) - { - return it->second.size(); - } - - this->readAllWellData(filePath); - it = m_fileNameToWellDataGroupMap.find(filePath); - CVF_ASSERT(it != m_fileNameToWellDataGroupMap.end()); - - return it->second.size();; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RifWellPathAsciiFileReader::clear() -{ - m_fileNameToWellDataGroupMap.clear(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RifWellPathAsciiFileReader::removeFilePath(const QString& filePath) -{ - m_fileNameToWellDataGroupMap.erase(filePath); -} diff --git a/ApplicationCode/ProjectDataModel/RimWellPathCollection.h b/ApplicationCode/ProjectDataModel/RimWellPathCollection.h index 3738846877..21dd4789c2 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPathCollection.h +++ b/ApplicationCode/ProjectDataModel/RimWellPathCollection.h @@ -36,7 +36,7 @@ //class RimFractureCollection; class RivWellPathCollectionPartMgr; -class RifWellPathAsciiFileReader; +class RifWellPathImporter; class RimWellPath; class RimProject; class RigWellPath; @@ -88,8 +88,6 @@ public: void removeWellPath(RimWellPath* wellPath); void deleteAllWellPaths(); - RifWellPathAsciiFileReader* asciiFileReader() {return m_asciiFileReader;} - RimWellPath* wellPathByName(const QString& wellPathName) const; void addWellLogs(const QStringList& filePaths); @@ -108,31 +106,5 @@ private: cvf::ref m_wellPathCollectionPartManager; - RifWellPathAsciiFileReader* m_asciiFileReader; -}; - - -//================================================================================================== -/// -/// -//================================================================================================== -class RifWellPathAsciiFileReader -{ -public: - struct WellData - { - QString m_name; - cvf::ref m_wellPathGeometry; - }; - - WellData readWellData(QString filePath, int indexInFile); - size_t wellDataCount(QString filePath); - - void clear(); - void removeFilePath(const QString& filePath); - -private: - void readAllWellData(QString filePath); - - std::map > m_fileNameToWellDataGroupMap; + RifWellPathImporter* m_wellPathImporter; }; diff --git a/ApplicationCode/ProjectDataModel/RimWellPathCompletions.cpp b/ApplicationCode/ProjectDataModel/RimWellPathCompletions.cpp new file mode 100644 index 0000000000..0cf4c93386 --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimWellPathCompletions.cpp @@ -0,0 +1,64 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimWellPathCompletions.h" + +#include "RimFishbonesCollection.h" +#include "RimPerforationCollection.h" + +#include "cvfAssert.h" + + +CAF_PDM_SOURCE_INIT(RimWellPathCompletions, "WellPathCompletions"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellPathCompletions::RimWellPathCompletions() +{ + CAF_PDM_InitObject("Completions", ":/WellCollection.png", "", ""); + + CAF_PDM_InitFieldNoDefault(&m_perforationCollection, "Perforations", "Perforations", "", "", ""); + m_perforationCollection = new RimPerforationCollection; + m_perforationCollection.uiCapability()->setUiHidden(true); + + CAF_PDM_InitFieldNoDefault(&m_fishbonesCollection, "Fishbones", "Fishbones", "", "", ""); + m_fishbonesCollection = new RimFishbonesCollection; + m_fishbonesCollection.uiCapability()->setUiHidden(true); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimFishbonesCollection* RimWellPathCompletions::fishbonesCollection() const +{ + CVF_ASSERT(m_fishbonesCollection); + + return m_fishbonesCollection; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimPerforationCollection* RimWellPathCompletions::perforationCollection() const +{ + CVF_ASSERT(m_perforationCollection); + + return m_perforationCollection; +} + diff --git a/ApplicationCode/ProjectDataModel/RimWellPathCompletions.h b/ApplicationCode/ProjectDataModel/RimWellPathCompletions.h new file mode 100644 index 0000000000..3a26299cd7 --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimWellPathCompletions.h @@ -0,0 +1,44 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafPdmObject.h" +#include "cafPdmChildField.h" + +class RimFishbonesCollection; +class RimPerforationCollection; + +//================================================================================================== +/// +/// +//================================================================================================== +class RimWellPathCompletions : public caf::PdmObject +{ + CAF_PDM_HEADER_INIT; + +public: + RimWellPathCompletions(); + + RimFishbonesCollection* fishbonesCollection() const; + RimPerforationCollection* perforationCollection() const; + +private: + caf::PdmChildField m_fishbonesCollection; + caf::PdmChildField m_perforationCollection; +}; diff --git a/ApplicationCode/ProjectDataModel/Summary/RimFileSummaryCase.cpp b/ApplicationCode/ProjectDataModel/Summary/RimFileSummaryCase.cpp index 41feed1223..101d485c0c 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimFileSummaryCase.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimFileSummaryCase.cpp @@ -17,6 +17,8 @@ ///////////////////////////////////////////////////////////////////////////////// #include "RimFileSummaryCase.h" +#include "RimTools.h" + #include "QFileInfo" @@ -71,3 +73,11 @@ QString RimFileSummaryCase::caseName() return caseFileName.completeBaseName(); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFileSummaryCase::updateFilePathsFromProjectPath(const QString & newProjectPath, const QString & oldProjectPath) +{ + m_summaryHeaderFilename = RimTools::relocateFile(m_summaryHeaderFilename(), newProjectPath, oldProjectPath, nullptr, nullptr); +} diff --git a/ApplicationCode/ProjectDataModel/Summary/RimFileSummaryCase.h b/ApplicationCode/ProjectDataModel/Summary/RimFileSummaryCase.h index 88eedb07f8..64df13c198 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimFileSummaryCase.h +++ b/ApplicationCode/ProjectDataModel/Summary/RimFileSummaryCase.h @@ -35,6 +35,7 @@ public: void setSummaryHeaderFilename(const QString& fileName); virtual QString summaryHeaderFilename() const override; virtual QString caseName() override; + virtual void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath) override; private: }; diff --git a/ApplicationCode/ProjectDataModel/Summary/RimGridSummaryCase.cpp b/ApplicationCode/ProjectDataModel/Summary/RimGridSummaryCase.cpp index 248623cc2e..e0ed20797a 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimGridSummaryCase.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimGridSummaryCase.cpp @@ -154,3 +154,11 @@ QString RimGridSummaryCase::eclipseGridFileName() const return m_eclipseCase()->gridFileName(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimGridSummaryCase::updateFilePathsFromProjectPath(const QString & newProjectPath, const QString & oldProjectPath) +{ + // Shouldn't have to do anything +} + diff --git a/ApplicationCode/ProjectDataModel/Summary/RimGridSummaryCase.h b/ApplicationCode/ProjectDataModel/Summary/RimGridSummaryCase.h index 9baa242e5d..368b233333 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimGridSummaryCase.h +++ b/ApplicationCode/ProjectDataModel/Summary/RimGridSummaryCase.h @@ -41,6 +41,7 @@ public: virtual QString summaryHeaderFilename() const override; virtual QString caseName() override; + virtual void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath) override; private: QString eclipseGridFileName() const; diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCase.h b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCase.h index e572ffa1a5..009004f6d4 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCase.h +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCase.h @@ -48,6 +48,8 @@ public: void loadCase(); RigSummaryCaseData* caseData(); + virtual void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath) = 0; + protected: void updateTreeItemName(); diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCaseCollection.cpp b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCaseCollection.cpp index cbc4ffff3f..b9eba91efd 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCaseCollection.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCaseCollection.cpp @@ -264,3 +264,14 @@ QString RimSummaryCaseCollection::uniqueShortNameForCase(RimSummaryCase* summary return shortName; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimSummaryCaseCollection::updateFilePathsFromProjectPath(const QString & newProjectPath, const QString & oldProjectPath) +{ + for (auto summaryCase : m_cases) + { + summaryCase->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath); + } +} + diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCaseCollection.h b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCaseCollection.h index 5eaaa731a1..14db31be05 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCaseCollection.h +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCaseCollection.h @@ -47,6 +47,8 @@ public: QString uniqueShortNameForCase(RimSummaryCase* summaryCase); + void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath); + private: private: diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index c607cc34f6..ab60c6bbc7 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -452,6 +452,7 @@ void RimSummaryCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup("Curve Name"); nameGroup->setCollapsedByDefault(true); + nameGroup->add(&m_showLegend); RimPlotCurve::curveNameUiOrdering(*nameGroup); if (m_isUsingAutoName) diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveAppearanceCalculator.cpp b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveAppearanceCalculator.cpp index 6e8213b440..cd6ce06d03 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveAppearanceCalculator.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveAppearanceCalculator.cpp @@ -150,7 +150,7 @@ void RimSummaryCurveAppearanceCalculator::updateApperanceIndices() int idx = 0; for (auto& pair : m_caseToAppearanceIdxMap) { - pair.second = static_cast(caseAppearanceIndices[pair.first->caseName().toUtf8().constData()]); + pair.second = static_cast(caseAppearanceIndices[pair.first->summaryHeaderFilename().toUtf8().constData()]); } } { diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveFilter.cpp b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveFilter.cpp index bf17751da4..1af3b1f1ab 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveFilter.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveFilter.cpp @@ -98,7 +98,7 @@ RimSummaryCurveFilter::RimSummaryCurveFilter() m_applyButtonField.uiCapability()->setUiEditorTypeName(caf::PdmUiPushButtonEditor::uiEditorTypeName()); m_applyButtonField.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::LEFT); - CAF_PDM_InitField(&m_autoApplyChangesToPlot, "AutoApplyFilterChanges", false, "Auto Apply Changes", "", "", ""); + CAF_PDM_InitField(&m_autoApplyChangesToPlot, "AutoApplyFilterChanges", true, "Auto Apply Changes", "", "", ""); CAF_PDM_InitField(&m_showCurves, "IsActive", true, "Show Curves", "", "", ""); m_showCurves.uiCapability()->setUiHidden(true); @@ -112,6 +112,7 @@ RimSummaryCurveFilter::RimSummaryCurveFilter() CAF_PDM_InitFieldNoDefault(&m_regionAppearanceType, "RegionAppearanceType", "Region", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_plotAxis, "PlotAxis", "Axis", "", "", ""); + CAF_PDM_InitField(&m_showLegend, "ShowLegend", true, "Contribute To Legend", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_curveNameConfig, "SummaryCurveNameConfig", "SummaryCurveNameConfig", "", "", ""); m_curveNameConfig.uiCapability()->setUiHidden(true); @@ -198,7 +199,7 @@ void RimSummaryCurveFilter::defineUiOrdering(QString uiConfigName, caf::PdmUiOrd uiOrdering.add(&m_plotAxis); - caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup("Appearance settings"); + caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup("Appearance Settings"); appearanceGroup->setCollapsedByDefault(true); appearanceGroup->add(&m_useAutoAppearanceAssignment); appearanceGroup->add(&m_caseAppearanceType); @@ -217,6 +218,7 @@ void RimSummaryCurveFilter::defineUiOrdering(QString uiConfigName, caf::PdmUiOrd caf::PdmUiGroup* autoNameGroup = uiOrdering.addNewGroup("Curve Name Configuration"); autoNameGroup->setCollapsedByDefault(true); + autoNameGroup->add(&m_showLegend); m_curveNameConfig->uiOrdering(uiConfigName, *autoNameGroup); uiOrdering.add(&m_autoApplyChangesToPlot); @@ -271,6 +273,13 @@ void RimSummaryCurveFilter::fieldChangedByUi(const caf::PdmFieldHandle* changedF plotNeedsRedraw = true; } + else if (changedField == &m_showLegend) + { + for (auto curve : m_curves) + { + curve->showLegend(m_showLegend()); + } + } else { plotNeedsRedraw = true; @@ -414,7 +423,10 @@ void RimSummaryCurveFilter::defineEditorAttribute(const caf::PdmFieldHandle* fie if(&m_applyButtonField == field) { caf::PdmUiPushButtonEditorAttribute* attrib = dynamic_cast (attribute); - attrib->m_buttonText = "Apply"; + if (attrib) + { + attrib->m_buttonText = "Apply"; + } } } diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveFilter.h b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveFilter.h index ac4e07b024..c60da52986 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveFilter.h +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurveFilter.h @@ -110,6 +110,7 @@ private: caf::PdmChildArrayField m_curves; caf::PdmField< caf::AppEnum< RimDefines::PlotAxis > > m_plotAxis; + caf::PdmField m_showLegend; // Filter fields diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index e0af1b01ec..4356570764 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -36,6 +36,7 @@ #include "cvfColor3.h" #include "cafPdmUiTreeOrdering.h" +#include "cafPdmUiCheckBoxEditor.h" #include #include @@ -43,6 +44,8 @@ #include "qwt_plot_curve.h" #include "qwt_plot_renderer.h" +#include "qwt_abstract_legend.h" +#include "qwt_legend.h" CAF_PDM_SOURCE_INIT(RimSummaryPlot, "SummaryPlot"); @@ -55,7 +58,10 @@ RimSummaryPlot::RimSummaryPlot() CAF_PDM_InitObject("Summary Plot", ":/SummaryPlotLight16x16.png", "", ""); CAF_PDM_InitField(&m_userName, "PlotDescription", QString("Summary Plot"), "Name", "", "", ""); - CAF_PDM_InitField(&m_showPlotTitle, "ShowPlotTitle", true, "Show Plot Title", "", "", ""); + CAF_PDM_InitField(&m_showPlotTitle, "ShowPlotTitle", true, "Plot Title", "", "", ""); + m_showPlotTitle.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN); + CAF_PDM_InitField(&m_showLegend, "ShowLegend", true, "Legend", "", "", ""); + m_showLegend.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN); CAF_PDM_InitFieldNoDefault(&m_curveFilters, "SummaryCurveFilters", "", "", "", ""); m_curveFilters.uiCapability()->setUiTreeHidden(true); @@ -693,7 +699,8 @@ void RimSummaryPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c RimViewWindow::fieldChangedByUi(changedField, oldValue, newValue); if (changedField == &m_userName || - changedField == &m_showPlotTitle) + changedField == &m_showPlotTitle || + changedField == &m_showLegend) { updateMdiWindowTitle(); } @@ -896,6 +903,18 @@ void RimSummaryPlot::updateMdiWindowTitle() { m_qwtPlot->setTitle(""); } + + + if (m_showLegend) + { + // Will be released in plot destructor or when a new legend is set + QwtLegend* legend = new QwtLegend(m_qwtPlot); + m_qwtPlot->insertLegend(legend, QwtPlot::BottomLegend); + } + else + { + m_qwtPlot->insertLegend(nullptr); + } } } @@ -957,3 +976,18 @@ size_t RimSummaryPlot::curveCount() const { return m_summaryCurves.size() + m_gridTimeHistoryCurves.size(); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimSummaryPlot::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) +{ + if (field == &m_showLegend || field == &m_showPlotTitle) + { + caf::PdmUiCheckBoxEditorAttribute* myAttr = dynamic_cast(attribute); + if (myAttr) + { + myAttr->m_useNativeCheckBoxLabel = true; + } + } +} diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.h b/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.h index fc7d9c2478..d4cd5c2284 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.h +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryPlot.h @@ -64,7 +64,7 @@ public: caf::PdmObject* findRimCurveFromQwtCurve(const QwtPlotCurve* curve) const; size_t curveCount() const; - void loadDataAndUpdate(); + virtual void loadDataAndUpdate() override; void detachAllCurves(); void updateCaseNameHasChanged(); @@ -95,6 +95,7 @@ protected: virtual caf::PdmFieldHandle* userDescriptionField() { return &m_userName; } virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override; + virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute); virtual QImage snapshotWindowContent() override; @@ -118,6 +119,7 @@ private: private: caf::PdmField m_showPlotTitle; + caf::PdmField m_showLegend; caf::PdmField m_userName; caf::PdmChildArrayField m_gridTimeHistoryCurves; diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp b/ApplicationCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp index d42b3ef8ec..42cb6cb51b 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp @@ -278,6 +278,36 @@ double RimSummaryTimeAxisProperties::fromTimeTToDisplayUnitScale() return scale; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimSummaryTimeAxisProperties::fromDaysToDisplayUnitScale() +{ + double scale = 1.0; + switch (m_timeUnit()) + { + case SECONDS: + scale = 60.0 * 60.0 * 24.0; + break; + case MINUTES: + scale = 60.0 * 24.0; + break; + case HOURS: + scale = 24.0; + break; + case DAYS: + break; + case YEARS: + scale = 1.0/365.2425; + break; + default: + CVF_ASSERT(false); + break; + } + + return scale; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.h b/ApplicationCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.h index 3e528c7be9..1f67606a0c 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.h +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.h @@ -69,6 +69,7 @@ public: TimeModeType timeMode() const { return m_timeMode(); } void setTimeMode(TimeModeType val) { m_timeMode = val; } double fromTimeTToDisplayUnitScale(); + double fromDaysToDisplayUnitScale(); double visibleRangeMin() const; double visibleRangeMax() const; diff --git a/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake b/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake index 0a5dfed6f6..7e93e05f9c 100644 --- a/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake +++ b/ApplicationCode/ReservoirDataModel/CMakeLists_files.cmake @@ -53,6 +53,7 @@ ${CEE_CURRENT_LIST_DIR}RigCurveDataTools.h ${CEE_CURRENT_LIST_DIR}RigSummaryCaseData.h ${CEE_CURRENT_LIST_DIR}RigLasFileExporter.h ${CEE_CURRENT_LIST_DIR}RigSimulationWellCoordsAndMD.h +${CEE_CURRENT_LIST_DIR}RigFishbonesGeometry.h ${CEE_CURRENT_LIST_DIR}RigFracture.h ${CEE_CURRENT_LIST_DIR}RigFractureTransCalc.h ${CEE_CURRENT_LIST_DIR}RigFractureTransmissibilityEquations.h @@ -112,6 +113,7 @@ ${CEE_CURRENT_LIST_DIR}RigCurveDataTools.cpp ${CEE_CURRENT_LIST_DIR}RigSummaryCaseData.cpp ${CEE_CURRENT_LIST_DIR}RigLasFileExporter.cpp ${CEE_CURRENT_LIST_DIR}RigSimulationWellCoordsAndMD.cpp +${CEE_CURRENT_LIST_DIR}RigFishbonesGeometry.cpp ${CEE_CURRENT_LIST_DIR}RigFracture.cpp ${CEE_CURRENT_LIST_DIR}RigFractureTransCalc.cpp ${CEE_CURRENT_LIST_DIR}RigFractureTransmissibilityEquations.cpp diff --git a/ApplicationCode/ReservoirDataModel/RigAccWellFlowCalculator.cpp b/ApplicationCode/ReservoirDataModel/RigAccWellFlowCalculator.cpp index 1493a91208..ab18acd9e3 100644 --- a/ApplicationCode/ReservoirDataModel/RigAccWellFlowCalculator.cpp +++ b/ApplicationCode/ReservoirDataModel/RigAccWellFlowCalculator.cpp @@ -46,6 +46,8 @@ size_t RigEclCellIndexCalculator::resultCellIndex(size_t gridIndex, size_t gridC /// //================================================================================================== +#define USE_WELL_PHASE_RATES + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -93,10 +95,19 @@ RigAccWellFlowCalculator::RigAccWellFlowCalculator(const std::vector< std::vecto m_connectionFlowPrBranch.resize(m_pipeBranchesCellIds.size()); m_pseudoLengthFlowPrBranch.resize(m_pipeBranchesCellIds.size()); +#ifdef USE_WELL_PHASE_RATES + m_tracerNames.push_back(RIG_FLOW_OIL_NAME); + m_tracerNames.push_back(RIG_FLOW_GAS_NAME); + m_tracerNames.push_back(RIG_FLOW_WATER_NAME); +#else m_tracerNames.push_back(RIG_FLOW_TOTAL_NAME); - +#endif + calculateAccumulatedFlowPrConnection(0, 1); calculateFlowPrPseudoLength(0, 0.0); +#ifdef USE_WELL_PHASE_RATES + sortTracers(); +#endif } //-------------------------------------------------------------------------------------------------- @@ -107,13 +118,6 @@ const std::vector& RigAccWellFlowCalculator::connectionNumbersFromTop(si return m_connectionFlowPrBranch[branchIdx].depthValuesFromTop; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -const std::vector& RigAccWellFlowCalculator::accumulatedFlowPrConnection(size_t branchIdx) const -{ - return accumulatedTracerFlowPrConnection(RIG_FLOW_TOTAL_NAME, branchIdx); -} //-------------------------------------------------------------------------------------------------- /// @@ -133,13 +137,6 @@ const std::vector& RigAccWellFlowCalculator::accumulatedTracerFlowPrConn } } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -const std::vector& RigAccWellFlowCalculator::flowPrConnection(size_t branchIdx) const -{ - return tracerFlowPrConnection(RIG_FLOW_TOTAL_NAME, branchIdx); -} //-------------------------------------------------------------------------------------------------- /// @@ -176,13 +173,6 @@ const std::vector& RigAccWellFlowCalculator::trueVerticalDepth(size_t br return m_pseudoLengthFlowPrBranch[branchIdx].trueVerticalDepth; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -const std::vector& RigAccWellFlowCalculator::accumulatedFlowPrPseudoLength(size_t branchIdx) const -{ - return accumulatedTracerFlowPrPseudoLength(RIG_FLOW_TOTAL_NAME, branchIdx); -} //-------------------------------------------------------------------------------------------------- /// @@ -202,13 +192,6 @@ const std::vector& RigAccWellFlowCalculator::accumulatedTracerFlowPrPseu } } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -const std::vector& RigAccWellFlowCalculator::flowPrPseudoLength(size_t branchIdx) const -{ - return tracerFlowPrPseudoLength(RIG_FLOW_TOTAL_NAME, branchIdx); -} //-------------------------------------------------------------------------------------------------- /// @@ -273,7 +256,7 @@ std::vector > RigAccWellFlowCalculator::totalTracerFr //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RigAccWellFlowCalculator::isWellFlowConsistent( bool isProducer) const +bool RigAccWellFlowCalculator::isWellFlowConsistent() const { bool isConsistent = true; for (const std::vector & branch : m_pipeBranchesCellIds) @@ -332,6 +315,8 @@ bool RigAccWellFlowCalculator::isConnectionFlowConsistent(const RigWellResultPoi //-------------------------------------------------------------------------------------------------- bool RigAccWellFlowCalculator::isFlowRateConsistent(double flowRate) const { + if (!m_tracerCellFractionValues) return true; // No flow diagnostics. + return (flowRate >= 0.0 && m_isProducer) || (flowRate <= 0.0 && !m_isProducer); } @@ -674,7 +659,13 @@ std::vector RigAccWellFlowCalculator::calculateWellCellFlowPrTracer(cons } else { + #ifdef USE_WELL_PHASE_RATES + flowPrTracer[0] = wellCell.oilRate(); + flowPrTracer[1] = wellCell.gasRate(); + flowPrTracer[2] = wellCell.waterRate(); + #else flowPrTracer[0] = wellCell.flowRate(); + #endif } return flowPrTracer; @@ -787,7 +778,7 @@ void RigAccWellFlowCalculator::groupSmallContributions() std::vector tracersToGroup; { - bool hasConsistentWellFlow = isWellFlowConsistent(m_isProducer); + bool hasConsistentWellFlow = isWellFlowConsistent(); std::vector > totalTracerFractions = this->totalTracerFractions(); diff --git a/ApplicationCode/ReservoirDataModel/RigAccWellFlowCalculator.h b/ApplicationCode/ReservoirDataModel/RigAccWellFlowCalculator.h index 7ffee68554..ea7d3a6d9f 100644 --- a/ApplicationCode/ReservoirDataModel/RigAccWellFlowCalculator.h +++ b/ApplicationCode/ReservoirDataModel/RigAccWellFlowCalculator.h @@ -68,14 +68,11 @@ public: double smallContribThreshold); const std::vector& connectionNumbersFromTop(size_t branchIdx) const; - const std::vector& accumulatedFlowPrConnection( size_t branchIdx) const; const std::vector& accumulatedTracerFlowPrConnection(const QString& tracerName, size_t branchIdx) const; - const std::vector& flowPrConnection( size_t branchIdx) const; const std::vector& tracerFlowPrConnection(const QString& tracerName, size_t branchIdx) const; const std::vector& pseudoLengthFromTop(size_t branchIdx) const; const std::vector& trueVerticalDepth(size_t branchIdx) const; - const std::vector& accumulatedFlowPrPseudoLength( size_t branchIdx) const; const std::vector& accumulatedTracerFlowPrPseudoLength(const QString& tracerName, size_t branchIdx) const; const std::vector& flowPrPseudoLength( size_t branchIdx) const; const std::vector& tracerFlowPrPseudoLength(const QString& tracerName, size_t branchIdx) const; @@ -102,7 +99,7 @@ private: void groupSmallTracers(std::map >* branchFlowSet, const std::vector& tracersToGroup); - bool isWellFlowConsistent(bool isProducer) const; + bool isWellFlowConsistent() const; std::vector calculateAccumulatedFractions(const std::vector& accumulatedFlowPrTracer) const; std::vector wrpToUniqueWrpIndexFromBottom(const std::vector &branchCells) const; static size_t connectionIndexFromTop( const std::vector& resPointToConnectionIndexFromBottom, size_t clSegIdx) ; diff --git a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp index eddd5f422d..60ece82835 100644 --- a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.cpp @@ -420,6 +420,32 @@ std::vector RigCaseCellResultsData::timeStepDates() const return timeStepDates(scalarResWithMostTimeSteps); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RigCaseCellResultsData::daysSinceSimulationStart() const +{ + size_t scalarResWithMostTimeSteps = cvf::UNDEFINED_SIZE_T; + maxTimeStepCount(&scalarResWithMostTimeSteps); + + return daysSinceSimulationStart(scalarResWithMostTimeSteps); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RigCaseCellResultsData::daysSinceSimulationStart(size_t scalarResultIndex) const +{ + if (scalarResultIndex < m_resultInfos.size()) + { + return m_resultInfos[scalarResultIndex].m_daysSinceSimulationStart; + } + else + { + return std::vector(); + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -446,11 +472,12 @@ std::vector RigCaseCellResultsData::reportStepNumbers(size_t scalarResultIn //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RigCaseCellResultsData::setTimeStepDates(size_t scalarResultIndex, const std::vector& dates, const std::vector& reportStepNumbers) +void RigCaseCellResultsData::setTimeStepDates(size_t scalarResultIndex, const std::vector& dates, const std::vector& daysSinceSimulationStart, const std::vector& reportStepNumbers) { CVF_ASSERT(scalarResultIndex < m_resultInfos.size() ); m_resultInfos[scalarResultIndex].m_timeStepDates = dates; + m_resultInfos[scalarResultIndex].m_daysSinceSimulationStart = daysSinceSimulationStart; m_resultInfos[scalarResultIndex].m_timeStepReportNumbers = reportStepNumbers; std::vector< std::vector >& dataValues = this->cellScalarResults(scalarResultIndex); diff --git a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h index 89839fc59d..2723669748 100644 --- a/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h +++ b/ApplicationCode/ReservoirDataModel/RigCaseCellResultsData.h @@ -76,9 +76,11 @@ public: std::vector timeStepDates() const; QDateTime timeStepDate(size_t scalarResultIndex, size_t timeStepIndex) const; std::vector timeStepDates(size_t scalarResultIndex) const; + std::vector daysSinceSimulationStart() const; + std::vector daysSinceSimulationStart(size_t scalarResultIndex) const; int reportStepNumber(size_t scalarResultIndex, size_t timeStepIndex) const; std::vector reportStepNumbers(size_t scalarResultIndex) const; - void setTimeStepDates(size_t scalarResultIndex, const std::vector& dates, const std::vector& reportStepNumbers); + void setTimeStepDates(size_t scalarResultIndex, const std::vector& dates, const std::vector& daysSinceSimulationStart, const std::vector& reportStepNumbers); // Find or create a slot for the results @@ -119,6 +121,7 @@ public: size_t m_gridScalarResultIndex; std::vector m_timeStepDates; std::vector m_timeStepReportNumbers; + std::vector m_daysSinceSimulationStart; }; const std::vector& infoForEachResultIndex() { return m_resultInfos;} diff --git a/ApplicationCode/ReservoirDataModel/RigFishbonesGeometry.cpp b/ApplicationCode/ReservoirDataModel/RigFishbonesGeometry.cpp new file mode 100644 index 0000000000..0801838dfb --- /dev/null +++ b/ApplicationCode/ReservoirDataModel/RigFishbonesGeometry.cpp @@ -0,0 +1,187 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RigFishbonesGeometry.h" + +#include "RimFishbonesMultipleSubs.h" + +#include "cvfAssert.h" +#include "RimWellPath.h" +#include "RigWellPath.h" +#include "cvfMatrix4.h" + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RigFisbonesGeometry::RigFisbonesGeometry(RimFishbonesMultipleSubs* fishbonesSub) + : m_fishbonesSub(fishbonesSub) +{ + +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector> RigFisbonesGeometry::coordsForLateral(size_t subIndex, size_t lateralIndex) const +{ + CVF_ASSERT(subIndex < m_fishbonesSub->locationOfSubs().size()); + CVF_ASSERT(lateralIndex < m_fishbonesSub->lateralLengths().size()); + + cvf::Vec3d position; + cvf::Vec3d lateralInitialDirection; + cvf::Mat4d buildAngleRotationMatrix; + + computeLateralPositionAndOrientation(subIndex, lateralIndex, &position, &lateralInitialDirection, &buildAngleRotationMatrix); + + return computeCoordsAlongLateral(m_fishbonesSub->locationOfSubs()[subIndex], m_fishbonesSub->lateralLengths()[lateralIndex], position, lateralInitialDirection, buildAngleRotationMatrix); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RigFisbonesGeometry::computeLateralPositionAndOrientation(size_t subIndex, size_t lateralIndex, cvf::Vec3d* startCoord, cvf::Vec3d* startDirection, cvf::Mat4d* buildAngleMatrix) const +{ + RimWellPath* wellPath = nullptr; + m_fishbonesSub->firstAncestorOrThisOfTypeAsserted(wellPath); + + RigWellPath* rigWellPath = wellPath->wellPathGeometry(); + CVF_ASSERT(rigWellPath); + + double measuredDepth = m_fishbonesSub->locationOfSubs()[subIndex]; + + cvf::Vec3d position = rigWellPath->interpolatedPointAlongWellPath(measuredDepth); + + cvf::Mat4d buildAngleMat; + cvf::Vec3d lateralDirection; + + { + cvf::Vec3d lateralInitialDirection = cvf::Vec3d::Z_AXIS; + cvf::Vec3d p1 = cvf::Vec3d::UNDEFINED; + cvf::Vec3d p2 = cvf::Vec3d::UNDEFINED; + rigWellPath->twoClosestPoints(position, &p1, &p2); + + CVF_ASSERT(!p1.isUndefined() && !p2.isUndefined()); + + cvf::Vec3d alongWellPath = (p2 - p1).getNormalized(); + + if (RigFisbonesGeometry::closestMainAxis(alongWellPath) == cvf::Vec3d::Z_AXIS) + { + // Use Y-AXIS if well path is heading close to Z-AXIS + lateralInitialDirection = cvf::Vec3d::Y_AXIS; + } + + { + double intialRotationAngle = m_fishbonesSub->rotationAngle(subIndex); + double lateralOffsetDegrees = 360.0 / m_fishbonesSub->lateralLengths().size(); + + double lateralOffsetRadians = cvf::Math::toRadians(intialRotationAngle + lateralOffsetDegrees * lateralIndex); + + cvf::Mat4d lateralOffsetMatrix = cvf::Mat4d::fromRotation(alongWellPath, lateralOffsetRadians); + + lateralInitialDirection = lateralInitialDirection.getTransformedVector(lateralOffsetMatrix); + } + + cvf::Vec3d rotationAxis; + rotationAxis.cross(alongWellPath, lateralInitialDirection); + + double exitAngleRadians = cvf::Math::toRadians(m_fishbonesSub->exitAngle()); + cvf::Mat4d lateralRotationMatrix = cvf::Mat4d::fromRotation(rotationAxis, exitAngleRadians); + + lateralDirection = alongWellPath.getTransformedVector(lateralRotationMatrix); + + double buildAngleRadians = cvf::Math::toRadians(m_fishbonesSub->buildAngle()); + buildAngleMat = cvf::Mat4d::fromRotation(rotationAxis, buildAngleRadians); + } + + *startCoord = position; + *startDirection = lateralDirection; + *buildAngleMatrix = buildAngleMat; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector> RigFisbonesGeometry::computeCoordsAlongLateral(double startMeasuredDepth, double lateralLength, const cvf::Vec3d& startCoord, const cvf::Vec3d& startDirection, const cvf::Mat4d& buildAngleMatrix) +{ + std::vector> coords; + + cvf::Vec3d lateralDirection(startDirection); + + // Compute coordinates along the lateral by modifying the lateral direction by the build angle for + // every unit vector along the lateral + cvf::Vec3d accumulatedPosition = startCoord; + double measuredDepth = startMeasuredDepth; + + double accumulatedLength = 0.0; + while (accumulatedLength < lateralLength) + { + coords.push_back(std::make_pair(accumulatedPosition, measuredDepth)); + + double delta = 1.0; + + if (lateralLength - accumulatedLength < 1.0) + { + delta = lateralLength - accumulatedLength; + } + + accumulatedPosition += delta * lateralDirection; + + // Modify the lateral direction by the build angle for each unit vector + lateralDirection = lateralDirection.getTransformedVector(buildAngleMatrix); + + accumulatedLength += delta; + measuredDepth += delta; + } + + coords.push_back(std::make_pair(accumulatedPosition, measuredDepth)); + + return coords; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +cvf::Vec3d RigFisbonesGeometry::closestMainAxis(const cvf::Vec3d& vec) +{ + size_t maxComponent = 0; + double maxValue = cvf::Math::abs(vec.x()); + if (cvf::Math::abs(vec.y()) > maxValue) + { + maxComponent = 1; + maxValue = cvf::Math::abs(vec.y()); + } + + if (cvf::Math::abs(vec.z()) > maxValue) + { + maxComponent = 2; + maxValue = cvf::Math::abs(vec.z()); + } + + if (maxComponent == 0) + { + return cvf::Vec3d::X_AXIS; + } + else if (maxComponent == 1) + { + return cvf::Vec3d::Y_AXIS; + } + else + { + return cvf::Vec3d::Z_AXIS; + } +} diff --git a/ApplicationCode/ReservoirDataModel/RigFishbonesGeometry.h b/ApplicationCode/ReservoirDataModel/RigFishbonesGeometry.h new file mode 100644 index 0000000000..1cdd5653fa --- /dev/null +++ b/ApplicationCode/ReservoirDataModel/RigFishbonesGeometry.h @@ -0,0 +1,56 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafPdmPointer.h" + +#include "cvfBase.h" +#include "cvfVector3.h" +#include "cvfMatrix4.h" + +#include + +class RimFishbonesMultipleSubs; + +//================================================================================================== +/// +/// +//================================================================================================== +class RigFisbonesGeometry +{ +public: + explicit RigFisbonesGeometry(RimFishbonesMultipleSubs* fishbonesSub); + + std::vector> coordsForLateral(size_t subIndex, size_t lateralIndex) const; + +private: + void computeLateralPositionAndOrientation(size_t subIndex, size_t lateralIndex, + cvf::Vec3d* startCoord, cvf::Vec3d* startDirection, + cvf::Mat4d* buildAngleMatrix) const; + + static std::vector> computeCoordsAlongLateral(double startMeasuredDepth, double lateralLength, + const cvf::Vec3d& startCoord, const cvf::Vec3d& startDirection, + const cvf::Mat4d& buildAngleMatrix); + + static cvf::Vec3d closestMainAxis(const cvf::Vec3d& vec); + +private: + caf::PdmPointer m_fishbonesSub; +}; + diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagInterfaceTools.h b/ApplicationCode/ReservoirDataModel/RigFlowDiagInterfaceTools.h index 8942f7beae..b5292e26eb 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagInterfaceTools.h +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagInterfaceTools.h @@ -18,56 +18,83 @@ namespace RigFlowDiagInterfaceTools { + template inline Opm::FlowDiagnostics::ConnectionValues - extractFluxField(const Opm::ECLGraph& G, const bool compute_fluxes) + extractFluxField(const Opm::ECLGraph& G, + FluxCalc&& getFlux) { using ConnVals = Opm::FlowDiagnostics::ConnectionValues; + + const auto actPh = G.activePhases(); + auto flux = ConnVals(ConnVals::NumConnections{ G.numConnections() }, - ConnVals::NumPhases{ 3 }); - + ConnVals::NumPhases{ actPh.size() }); + auto phas = ConnVals::PhaseID{ 0 }; - - Opm::ECLFluxCalc calc(G); - - const auto phases = { Opm::ECLGraph::PhaseIndex::Aqua , - Opm::ECLGraph::PhaseIndex::Liquid , - Opm::ECLGraph::PhaseIndex::Vapour }; - - for ( const auto& p : phases ) - { - const auto pflux = compute_fluxes ? calc.flux(p) : G.flux(p); - if ( ! pflux.empty() ) - { - assert (pflux.size() == flux.numConnections()); + + for (const auto& p : actPh) { + const auto pflux = getFlux(p); + + if (!pflux.empty()) { + assert(pflux.size() == flux.numConnections()); + auto conn = ConnVals::ConnID{ 0 }; - for ( const auto& v : pflux ) - { + for (const auto& v : pflux) { flux(conn, phas) = v; conn.id += 1; } } + phas.id += 1; } - + return flux; } + inline Opm::FlowDiagnostics::ConnectionValues + extractFluxField(const Opm::ECLGraph& G, + const Opm::ECLRestartData& rstrt, + const bool compute_fluxes) + { + if (compute_fluxes) { + Opm::ECLFluxCalc calc(G); + + auto getFlux = [&calc, &rstrt] + (const Opm::ECLGraph::PhaseIndex p) + { + return calc.flux(rstrt, p); + }; + + return extractFluxField(G, getFlux); + } + + auto getFlux = [&G, &rstrt] + (const Opm::ECLGraph::PhaseIndex p) + { + return G.flux(rstrt, p); + }; + + return extractFluxField(G, getFlux); + } + template Opm::FlowDiagnostics::CellSetValues - extractWellFlows(const Opm::ECLGraph& G, - const WellFluxes& well_fluxes) + extractWellFlows(const Opm::ECLGraph& G, + const WellFluxes& well_fluxes) { Opm::FlowDiagnostics::CellSetValues inflow; for (const auto& well : well_fluxes) { for (const auto& completion : well.completions) { - const int grid_index = completion.grid_index; + const auto& gridName = completion.gridName; const auto& ijk = completion.ijk; - const int cell_index = G.activeCell(ijk, grid_index); + const int cell_index = G.activeCell(ijk, gridName); if (cell_index >= 0) { - auto iterIsInsertedPair = inflow.emplace(cell_index, completion.reservoir_inflow_rate); - if (!iterIsInsertedPair.second){ // Not inserted, We had something there already - iterIsInsertedPair.first->second += completion.reservoir_inflow_rate; // Accumulate the flow at this connection - } + // Since inflow is a std::map, if the key was not + // already present operator[] will insert a + // value-initialized value (as in T() for a type + // T), which is zero for built-in numerical types, + // including double. + inflow[cell_index] += completion.reservoir_inflow_rate; } } } @@ -75,7 +102,6 @@ namespace RigFlowDiagInterfaceTools { return inflow; } - } diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagResultAddress.h b/ApplicationCode/ReservoirDataModel/RigFlowDiagResultAddress.h index 00194712b2..7b0844988e 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagResultAddress.h +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagResultAddress.h @@ -26,6 +26,10 @@ #define RIG_FLD_COMMUNICATION_RESNAME "Communication" #define RIG_FLOW_TOTAL_NAME "Total" +#define RIG_FLOW_OIL_NAME "Oil" +#define RIG_FLOW_GAS_NAME "Gas" +#define RIG_FLOW_WATER_NAME "Water" + #define RIG_RESERVOIR_TRACER_NAME "Reservoir" #define RIG_TINY_TRACER_GROUP_NAME "Other" diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp b/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp index ce61f758ea..1261d74b61 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp @@ -258,6 +258,35 @@ std::vector* RigFlowDiagResults::calculateAverageTOFResult(const RigFlow } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RigFlowDiagResults::calculateSumOfFractionAndFractionMultTOF(size_t activeCellCount, + const std::vector *> & fractions, + const std::vector *> & TOFs, + std::vector *sumOfFractions, + std::vector *fractionMultTOF) +{ + sumOfFractions->resize(activeCellCount, 0.0); + fractionMultTOF->resize(activeCellCount, 0.0); + + for ( size_t iIdx = 0; iIdx < fractions.size() ; ++iIdx ) + { + const std::vector * frInj = fractions[iIdx]; + const std::vector * tofInj = TOFs[iIdx]; + + if ( ! (frInj && tofInj) ) continue; + + for ( size_t acIdx = 0 ; acIdx < activeCellCount; ++acIdx ) + { + if ( (*frInj)[acIdx] == HUGE_VAL ) continue; + + (*sumOfFractions)[acIdx] += (*frInj)[acIdx]; + (*fractionMultTOF)[acIdx] += (*frInj)[acIdx] * (*tofInj)[acIdx]; + } + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -434,35 +463,6 @@ RigFlowDiagResults::findNamedResultsForSelectedTracers(const RigFlowDiagResultAd } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RigFlowDiagResults::calculateSumOfFractionAndFractionMultTOF(size_t activeCellCount, - const std::vector *> & fractions, - const std::vector *> & TOFs, - std::vector *sumOfFractions, - std::vector *fractionMultTOF) -{ - sumOfFractions->resize(activeCellCount, 0.0); - fractionMultTOF->resize(activeCellCount, 0.0); - - for ( size_t iIdx = 0; iIdx < fractions.size() ; ++iIdx ) - { - const std::vector * frInj = fractions[iIdx]; - const std::vector * tofInj = TOFs[iIdx]; - - if ( ! (frInj && tofInj) ) continue; - - for ( size_t acIdx = 0 ; acIdx < activeCellCount; ++acIdx ) - { - if ( (*frInj)[acIdx] == HUGE_VAL ) continue; - - (*sumOfFractions)[acIdx] += (*frInj)[acIdx]; - (*fractionMultTOF)[acIdx] += (*frInj)[acIdx] * (*tofInj)[acIdx]; - } - } -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp index 9fd5b6dfa1..b9e34ea5c5 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp @@ -104,19 +104,25 @@ void RigFlowDiagTimeStepResult::addResult(const RigFlowDiagResultAddress& resAdd } -class RigOpmFldStaticData : public cvf::Object +class RigOpmFlowDiagStaticData : public cvf::Object { public: - RigOpmFldStaticData(const std::string& grid, const std::string& init) : m_eclGraph(Opm::ECLGraph::load(grid, init)), m_hasUnifiedRestartFile(false) + RigOpmFlowDiagStaticData(const std::string& grid, const std::string& init) { - m_poreVolume = m_eclGraph.poreVolume(); + Opm::ECLInitFileData initData(init); + + m_eclGraph.reset(new Opm::ECLGraph(Opm::ECLGraph::load(grid, initData))); + + m_hasUnifiedRestartFile = false; + m_poreVolume = m_eclGraph->poreVolume(); } - Opm::ECLGraph m_eclGraph; + std::unique_ptr m_eclGraph; std::vector m_poreVolume; std::unique_ptr m_fldToolbox; bool m_hasUnifiedRestartFile; - QStringList m_restartFileNames; + std::vector m_singleRestartDataTimeSteps; + std::unique_ptr m_unifiedRestartData; }; @@ -150,9 +156,8 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI RigFlowDiagTimeStepResult result(m_eclipseCase->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->reservoirActiveCellCount()); caf::ProgressInfo progressInfo(8, "Calculating Flow Diagnostics"); - - if ( m_opmFldData.isNull() ) + if ( m_opmFlowDiagStaticData.isNull() ) { progressInfo.setProgressDescription("Grid access"); @@ -165,66 +170,77 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI QString initFileName = RifEclipseOutputFileTools::firstFileNameOfType(m_filesWithSameBaseName, ECL_INIT_FILE); - m_opmFldData = new RigOpmFldStaticData(gridFileName.toStdString(), + m_opmFlowDiagStaticData = new RigOpmFlowDiagStaticData(gridFileName.toStdString(), initFileName.toStdString()); progressInfo.incrementProgress(); progressInfo.setProgressDescription("Calculating Connectivities"); const Opm::FlowDiagnostics::ConnectivityGraph connGraph = - Opm::FlowDiagnostics::ConnectivityGraph{ static_cast(m_opmFldData->m_eclGraph.numCells()), - m_opmFldData->m_eclGraph.neighbours() }; + Opm::FlowDiagnostics::ConnectivityGraph{ static_cast(m_opmFlowDiagStaticData->m_eclGraph->numCells()), + m_opmFlowDiagStaticData->m_eclGraph->neighbours() }; progressInfo.incrementProgress(); progressInfo.setProgressDescription("Initialize Solver"); // Create the Toolbox. - m_opmFldData->m_fldToolbox.reset(new Opm::FlowDiagnostics::Toolbox{ connGraph }); - m_opmFldData->m_fldToolbox->assignPoreVolume( m_opmFldData->m_poreVolume); + m_opmFlowDiagStaticData->m_fldToolbox.reset(new Opm::FlowDiagnostics::Toolbox{ connGraph }); + m_opmFlowDiagStaticData->m_fldToolbox->assignPoreVolume( m_opmFlowDiagStaticData->m_poreVolume); // Look for unified restart file QString restartFileName = RifEclipseOutputFileTools::firstFileNameOfType(m_filesWithSameBaseName, ECL_UNIFIED_RESTART_FILE); if ( !restartFileName.isEmpty() ) { - m_opmFldData->m_eclGraph.assignFluxDataSource(restartFileName.toStdString()); - m_opmFldData->m_hasUnifiedRestartFile = true; + m_opmFlowDiagStaticData->m_unifiedRestartData.reset(new Opm::ECLRestartData(Opm::ECLRestartData(restartFileName.toStdString()))); + m_opmFlowDiagStaticData->m_hasUnifiedRestartFile = true; } else { + QStringList restartFileNames = RifEclipseOutputFileTools::filterFileNamesOfType(m_filesWithSameBaseName, ECL_RESTART_FILE); - m_opmFldData->m_restartFileNames = RifEclipseOutputFileTools::filterFileNamesOfType(m_filesWithSameBaseName, ECL_RESTART_FILE); - - size_t restartFileCount = static_cast(m_opmFldData->m_restartFileNames.size()); + size_t restartFileCount = static_cast(restartFileNames.size()); size_t maxTimeStepCount = m_eclipseCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->maxTimeStepCount(); - if (restartFileCount <= timeStepIndex && restartFileCount != maxTimeStepCount ) + if (restartFileCount <= timeStepIndex && restartFileCount != maxTimeStepCount ) { QMessageBox::critical(nullptr, "ResInsight", "Flow Diagnostics: Could not find all the restart files. Results will not be loaded."); return result; } - m_opmFldData->m_restartFileNames.sort(); // To make sure they are sorted in increasing *.X000N order. Hack. Should probably be actual time stored on file. - m_opmFldData->m_hasUnifiedRestartFile = false; + restartFileNames.sort(); // To make sure they are sorted in increasing *.X000N order. Hack. Should probably be actual time stored on file. + m_opmFlowDiagStaticData->m_hasUnifiedRestartFile = false; + + for (auto restartFileName : restartFileNames) + { + m_opmFlowDiagStaticData->m_singleRestartDataTimeSteps.push_back(Opm::ECLRestartData(restartFileName.toStdString())); + } } } progressInfo.setProgress(3); progressInfo.setProgressDescription("Assigning Flux Field"); - if ( ! m_opmFldData->m_hasUnifiedRestartFile ) + Opm::ECLRestartData* currentRestartData = nullptr; + + if ( ! m_opmFlowDiagStaticData->m_hasUnifiedRestartFile ) { - QString restartFileName = m_opmFldData->m_restartFileNames[static_cast(timeStepIndex)]; - m_opmFldData->m_eclGraph.assignFluxDataSource(restartFileName.toStdString()); + currentRestartData = &(m_opmFlowDiagStaticData->m_singleRestartDataTimeSteps[timeStepIndex]); } + else + { + currentRestartData = m_opmFlowDiagStaticData->m_unifiedRestartData.get(); + } + + CVF_ASSERT(currentRestartData); size_t resultIndexWithMaxTimeSteps = cvf::UNDEFINED_SIZE_T; m_eclipseCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->maxTimeStepCount(&resultIndexWithMaxTimeSteps); int reportStepNumber = m_eclipseCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->reportStepNumber(resultIndexWithMaxTimeSteps, timeStepIndex); - if ( ! m_opmFldData->m_eclGraph.selectReportStep(reportStepNumber) ) + if ( !currentRestartData->selectReportStep(reportStepNumber) ) { QMessageBox::critical(nullptr, "ResInsight", "Flow Diagnostics: Could not find the requested timestep in the result file. Results will not be loaded."); return result; @@ -235,22 +251,25 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI Opm::FlowDiagnostics::CellSetValues sumWellFluxPrCell; { - Opm::FlowDiagnostics::ConnectionValues connectionsVals = RigFlowDiagInterfaceTools::extractFluxField(m_opmFldData->m_eclGraph, false); + Opm::FlowDiagnostics::ConnectionValues connectionsVals = RigFlowDiagInterfaceTools::extractFluxField(*(m_opmFlowDiagStaticData->m_eclGraph), + *currentRestartData, + false); - m_opmFldData->m_fldToolbox->assignConnectionFlux(connectionsVals); + m_opmFlowDiagStaticData->m_fldToolbox->assignConnectionFlux(connectionsVals); progressInfo.incrementProgress(); Opm::ECLWellSolution wsol = Opm::ECLWellSolution{-1.0 , false}; - const std::vector well_fluxes = - wsol.solution(m_opmFldData->m_eclGraph.rawResultData(), m_opmFldData->m_eclGraph.numGrids()); + std::vector gridNames = m_opmFlowDiagStaticData->m_eclGraph->activeGrids(); - sumWellFluxPrCell = RigFlowDiagInterfaceTools::extractWellFlows(m_opmFldData->m_eclGraph, well_fluxes); + const std::vector well_fluxes = wsol.solution(*currentRestartData, gridNames); - m_opmFldData->m_fldToolbox->assignInflowFlux(sumWellFluxPrCell); + sumWellFluxPrCell = RigFlowDiagInterfaceTools::extractWellFlows(*(m_opmFlowDiagStaticData->m_eclGraph), well_fluxes); - // Filter connection cells with inconsistent well in flow direction (Hack, we should do something better) + m_opmFlowDiagStaticData->m_fldToolbox->assignInflowFlux(sumWellFluxPrCell); + + // Start Hack: Filter connection cells with inconsistent well in flow direction (Hack, we should do something better) for ( auto& tracerCellIdxsPair: injectorTracers ) { @@ -259,6 +278,8 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI for (int activeCellIdx : tracerCellIdxsPair.second) { auto activeCellIdxFluxPair = sumWellFluxPrCell.find(activeCellIdx); + CVF_TIGHT_ASSERT(activeCellIdxFluxPair != sumWellFluxPrCell.end()); + if (activeCellIdxFluxPair->second > 0 ) { filteredCellIndices.push_back(activeCellIdx); @@ -275,6 +296,8 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI for (int activeCellIdx : tracerCellIdxsPair.second) { auto activeCellIdxFluxPair = sumWellFluxPrCell.find(activeCellIdx); + CVF_TIGHT_ASSERT(activeCellIdxFluxPair != sumWellFluxPrCell.end()); + if (activeCellIdxFluxPair->second < 0 ) { filteredCellIndices.push_back(activeCellIdx); @@ -282,6 +305,8 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI } if (tracerCellIdxsPair.second.size() != filteredCellIndices.size()) tracerCellIdxsPair.second = filteredCellIndices; } + + // End Hack } progressInfo.incrementProgress(); @@ -299,7 +324,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI std::unique_ptr injectorSolution; try { - injectorSolution.reset(new Toolbox::Forward( m_opmFldData->m_fldToolbox->computeInjectionDiagnostics(injectorCellSets))); + injectorSolution.reset(new Toolbox::Forward( m_opmFlowDiagStaticData->m_fldToolbox->computeInjectionDiagnostics(injectorCellSets))); } catch (const std::exception& e) { @@ -329,7 +354,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI std::unique_ptr producerSolution; try { - producerSolution.reset(new Toolbox::Reverse(m_opmFldData->m_fldToolbox->computeProductionDiagnostics(prodjCellSets))); + producerSolution.reset(new Toolbox::Reverse(m_opmFlowDiagStaticData->m_fldToolbox->computeProductionDiagnostics(prodjCellSets))); } catch ( const std::exception& e ) { @@ -375,7 +400,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI { Graph flowCapStorCapCurve = flowCapacityStorageCapacityCurve(*(injectorSolution.get()), *(producerSolution.get()), - m_opmFldData->m_poreVolume); + m_opmFlowDiagStaticData->m_poreVolume); result.setFlowCapStorageCapCurve(flowCapStorCapCurve); result.setSweepEfficiencyCurve(sweepEfficiency(flowCapStorCapCurve)); diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.h b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.h index 653d9e54d2..81a154b715 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.h +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.h @@ -70,7 +70,7 @@ private: class RigEclipseCaseData; -class RigOpmFldStaticData; +class RigOpmFlowDiagStaticData; class RigFlowDiagSolverInterface : public cvf::Object { @@ -85,7 +85,7 @@ public: private: RimEclipseResultCase * m_eclipseCase; - cvf::ref m_opmFldData; + cvf::ref m_opmFlowDiagStaticData; }; diff --git a/ApplicationCode/ReservoirDataModel/RigLasFileExporter.cpp b/ApplicationCode/ReservoirDataModel/RigLasFileExporter.cpp index 180288a83a..c93b0bc4d7 100644 --- a/ApplicationCode/ReservoirDataModel/RigLasFileExporter.cpp +++ b/ApplicationCode/ReservoirDataModel/RigLasFileExporter.cpp @@ -25,6 +25,7 @@ #include "RimWellLogExtractionCurve.h" #include "cafUtils.h" + #include "cvfAssert.h" #include "laswell.hpp" @@ -390,7 +391,7 @@ bool RigLasFileExporter::writeToFolder(const QString& exportFolder) QDir dir(exportFolder); QString fileName = dir.absoluteFilePath(QString::fromStdString(lasFileDescr.generateFilename())); - if (QFile::exists(fileName)) + if (caf::Utils::fileExists(fileName)) { QString txt = QString("File %1 exists.\n\nDo you want to overwrite the file?").arg(fileName); int ret = QMessageBox::question(NULL, "LAS File Export", diff --git a/ApplicationCode/ReservoirDataModel/RigMainGrid.cpp b/ApplicationCode/ReservoirDataModel/RigMainGrid.cpp index 81612a8ed8..6c1a1b1d0a 100644 --- a/ApplicationCode/ReservoirDataModel/RigMainGrid.cpp +++ b/ApplicationCode/ReservoirDataModel/RigMainGrid.cpp @@ -240,7 +240,7 @@ void RigMainGrid::calculateFaults(const RigActiveCellInfo* activeCellInfo) if (hasFaultWithName(RimDefines::undefinedGridFaultName()) && hasFaultWithName(RimDefines::undefinedGridFaultWithInactiveName())) { - RiaLogging::debug(QString("Calculate faults already run for grid.")); + //RiaLogging::debug(QString("Calculate faults already run for grid.")); return; } m_faultsPrCellAcc = new RigFaultsPrCellAccumulator(m_cells.size()); diff --git a/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.h b/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.h index 7a002a94f8..6b6479f085 100644 --- a/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.h +++ b/ApplicationCode/ReservoirDataModel/RigSingleWellResultsData.h @@ -40,7 +40,10 @@ struct RigWellResultPoint m_ertBranchId(-1), m_ertSegmentId(-1), m_bottomPosition(cvf::Vec3d::UNDEFINED), - m_flowRate(0.0) + m_flowRate(0.0), + m_oilRate(0.0), + m_gasRate(0.0), + m_waterRate(0.0) { } bool isPointValid() const @@ -70,6 +73,42 @@ struct RigWellResultPoint } } + double oilRate() const + { + if ( isCell() && m_isOpen) + { + return m_oilRate; + } + else + { + return 0.0; + } + } + + double gasRate() const + { + if ( isCell() && m_isOpen) + { + return m_gasRate; + } + else + { + return 0.0; + } + } + + double waterRate() const + { + if ( isCell() && m_isOpen) + { + return m_waterRate; + } + else + { + return 0.0; + } + } + bool isEqual(const RigWellResultPoint& other ) const { return ( m_gridIndex == other.m_gridIndex @@ -89,7 +128,10 @@ struct RigWellResultPoint int m_ertSegmentId; cvf::Vec3d m_bottomPosition; //< The estimated bottom position of the well segment, when we have no grid cell connections for the segment. - double m_flowRate; + double m_flowRate; //< Total reservoir rate + double m_oilRate; //< Surface oil rate + double m_gasRate; //< Surface gas rate For Field-unit, converted to [stb/day] to allign with oil and water. + double m_waterRate; //< Surface water rate }; //================================================================================================== diff --git a/ApplicationCode/ReservoirDataModel/RigWellLogExtractionTools.h b/ApplicationCode/ReservoirDataModel/RigWellLogExtractionTools.h index 4232183bf6..ec0b6d5b97 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellLogExtractionTools.h +++ b/ApplicationCode/ReservoirDataModel/RigWellLogExtractionTools.h @@ -21,6 +21,7 @@ #include "cvfBoundingBox.h" #include "cvfGeometryTools.h" #include "cvfStructGrid.h" +#include "cvfRay.h" //================================================================================================== /// Internal class for intersection point info @@ -90,6 +91,28 @@ struct RigHexIntersector return intersectionCount; } + static bool isPointInCell(const cvf::Vec3d point, const cvf::Vec3d hexCorners[8], const size_t hexIndex) + { + cvf::Ray ray; + ray.setOrigin(point); + for (int face = 0; face < 6; ++face) + { + cvf::ubyte faceVertexIndices[4]; + cvf::StructGridInterface::cellFaceVertexIndices(static_cast(face), faceVertexIndices); + cvf::Vec3d faceCenter = cvf::GeometryTools::computeFaceCenter(hexCorners[faceVertexIndices[0]], hexCorners[faceVertexIndices[1]], hexCorners[faceVertexIndices[2]], hexCorners[faceVertexIndices[3]]); + + for (int i = 0; i < 4; ++i) + { + int next = i < 3 ? i + 1 : 0; + if (ray.triangleIntersect(hexCorners[faceVertexIndices[i]], hexCorners[faceVertexIndices[next]], faceCenter)) + { + return true; + } + } + } + return false; + } + static bool isEqualDepth(double d1, double d2) { double depthDiff = d1 - d2; diff --git a/ApplicationCode/ReservoirDataModel/RigWellLogExtractor.cpp b/ApplicationCode/ReservoirDataModel/RigWellLogExtractor.cpp index 8786191416..8475aefc88 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellLogExtractor.cpp +++ b/ApplicationCode/ReservoirDataModel/RigWellLogExtractor.cpp @@ -20,6 +20,7 @@ #include "RigWellLogExtractor.h" #include "RigWellPath.h" #include "cvfTrace.h" +#include "RiaLogging.h" //-------------------------------------------------------------------------------------------------- /// @@ -202,7 +203,7 @@ void RigWellLogExtractor::populateReturnArrays(std::mapfirst.measuredDepth))); + RiaLogging::warning(QString("Well Log Extraction : ") + QString::fromStdString(m_wellCaseErrorMsgName) + (" Discards a point at MD: ") + QString::number((double)(it1->first.measuredDepth))); // Found that 8 to 10 is not connected, after finding 7 to 9 it1 = it21; // Discard 8 by Jumping to 10 @@ -211,7 +212,7 @@ void RigWellLogExtractor::populateReturnArrays(std::mapfirst.measuredDepth))); + RiaLogging::warning(QString("Well Log Extraction : ") + QString::fromStdString(m_wellCaseErrorMsgName) + (" Discards a point at MD: ") + QString::number((double)(it1->first.measuredDepth))); // Found that 10 to 11 is not connected, and not 10 to 12 either ++it1; // Discard 10 and jump to 11 and hope that recovers us diff --git a/ApplicationCode/ReservoirDataModel/RigWellPath.cpp b/ApplicationCode/ReservoirDataModel/RigWellPath.cpp index 842426d66c..6dd8d96397 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellPath.cpp +++ b/ApplicationCode/ReservoirDataModel/RigWellPath.cpp @@ -19,6 +19,8 @@ #include "RigWellPath.h" #include "cvfGeometryTools.h" +#include "cvfGeometryTools.h" + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -150,3 +152,41 @@ double RigWellPath::wellPathAzimuthAngle(const cvf::Vec3d& position) const } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RigWellPath::twoClosestPoints(const cvf::Vec3d& position, cvf::Vec3d* p1, cvf::Vec3d* p2) const +{ + CVF_ASSERT(p1 && p2); + + size_t closestIndex = cvf::UNDEFINED_SIZE_T; + double closestDistance = cvf::UNDEFINED_DOUBLE; + + for (size_t i = 1; i < m_wellPathPoints.size(); i++) + { + cvf::Vec3d p1 = m_wellPathPoints[i - 1]; + cvf::Vec3d p2 = m_wellPathPoints[i - 0]; + + double candidateDistance = cvf::GeometryTools::linePointSquareDist(p1, p2, position); + if (candidateDistance < closestDistance) + { + closestDistance = candidateDistance; + closestIndex = i; + } + } + + if (closestIndex != cvf::UNDEFINED_DOUBLE) + { + if (closestIndex > 0) + { + *p1 = m_wellPathPoints[closestIndex - 1]; + *p2 = m_wellPathPoints[closestIndex - 0]; + } + else + { + *p1 = m_wellPathPoints[closestIndex + 1]; + *p2 = m_wellPathPoints[closestIndex + 0]; + } + } +} + diff --git a/ApplicationCode/ReservoirDataModel/RigWellPath.h b/ApplicationCode/ReservoirDataModel/RigWellPath.h index cb91d73dd0..8c08a6acf6 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellPath.h +++ b/ApplicationCode/ReservoirDataModel/RigWellPath.h @@ -42,6 +42,7 @@ public: double datumElevation() const; cvf::Vec3d interpolatedPointAlongWellPath(double measuredDepth); double wellPathAzimuthAngle(const cvf::Vec3d& position) const; + void twoClosestPoints(const cvf::Vec3d& position, cvf::Vec3d* p1, cvf::Vec3d* p2) const; private: bool m_hasDatumElevation; diff --git a/ApplicationCode/SocketInterface/RiaCaseInfoCommands.cpp b/ApplicationCode/SocketInterface/RiaCaseInfoCommands.cpp index 207037dd8e..3d998de20c 100644 --- a/ApplicationCode/SocketInterface/RiaCaseInfoCommands.cpp +++ b/ApplicationCode/SocketInterface/RiaCaseInfoCommands.cpp @@ -518,26 +518,17 @@ public: return true; } - std::vector timeStepDates = rimCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->timeStepDates(scalarIndexWithMaxTimeStepCount); + std::vector daysSinceSimulationStart = rimCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->daysSinceSimulationStart(scalarIndexWithMaxTimeStepCount); - quint64 timeStepCount = timeStepDates.size(); + quint64 timeStepCount = daysSinceSimulationStart.size(); quint64 byteCount = sizeof(quint64) + timeStepCount * sizeof(qint32); socketStream << byteCount; socketStream << timeStepCount; - if (timeStepCount > 0) + for (double day : daysSinceSimulationStart) { - double secondsInADay = 24 * 60 * 60; - - for (size_t i = 0; i < timeStepCount; i++) - { - double secondsDiff = timeStepDates[0].secsTo(timeStepDates[i]); - - double decimalDaysDiff = secondsDiff / secondsInADay; - - socketStream << decimalDaysDiff; - } + socketStream << day; } return true; diff --git a/ApplicationCode/UnitTests/WellPathAsciiFileReader-Test.cpp b/ApplicationCode/UnitTests/WellPathAsciiFileReader-Test.cpp index 9c974b49be..8577105cac 100644 --- a/ApplicationCode/UnitTests/WellPathAsciiFileReader-Test.cpp +++ b/ApplicationCode/UnitTests/WellPathAsciiFileReader-Test.cpp @@ -1,7 +1,6 @@ #include "gtest/gtest.h" -#include "RimWellPathCollection.h" -#include "RigWellPath.h" +#include "RifWellPathImporter.h" #include #include @@ -21,8 +20,8 @@ TEST(RimWellPathAsciiFileReaderTest, TestWellNameNoColon) out << "1 2 3"; } - RifWellPathAsciiFileReader reader; - RifWellPathAsciiFileReader::WellData wpData = reader.readWellData(file.fileName(), 0); + RifWellPathImporter reader; + RifWellPathImporter::WellData wpData = reader.readWellData(file.fileName(), 0); EXPECT_TRUE(wpData.m_name == wellName); } } @@ -42,8 +41,8 @@ TEST(RimWellPathAsciiFileReaderTest, TestWellNameWithColon) out << "1 2 3"; } - RifWellPathAsciiFileReader reader; - RifWellPathAsciiFileReader::WellData wpData = reader.readWellData(file.fileName(), 0); + RifWellPathImporter reader; + RifWellPathImporter::WellData wpData = reader.readWellData(file.fileName(), 0); EXPECT_TRUE(wpData.m_name == wellName); } } @@ -63,8 +62,8 @@ TEST(RimWellPathAsciiFileReaderTest, TestWellNameWithColonAndSpace) out << "1 2 3"; } - RifWellPathAsciiFileReader reader; - RifWellPathAsciiFileReader::WellData wpData = reader.readWellData(file.fileName(), 0); + RifWellPathImporter reader; + RifWellPathImporter::WellData wpData = reader.readWellData(file.fileName(), 0); EXPECT_TRUE(wpData.m_name == wellName); } } diff --git a/ApplicationCode/UnitTests/opm-flowdiagnostics-Test.cpp b/ApplicationCode/UnitTests/opm-flowdiagnostics-Test.cpp index e1efcac844..7943ee5f39 100644 --- a/ApplicationCode/UnitTests/opm-flowdiagnostics-Test.cpp +++ b/ApplicationCode/UnitTests/opm-flowdiagnostics-Test.cpp @@ -2,6 +2,7 @@ const std::string casePath = "\\\\csfiles\\Store\\ProjectData\\StatoilReservoir\\ReferenceCases\\simple_FlowDiag_Model\\"; +/* #include "exampleSetup.hpp" TEST(opm_flowdiagnostics_test, basic_construction) @@ -9,12 +10,14 @@ TEST(opm_flowdiagnostics_test, basic_construction) try { - + Opm::ECLRestartData rstrt(casePath + "SIMPLE.UNRST"); + Opm::ECLInitFileData initData(casePath + "SIMPLE.INIT"); + Opm::ECLGraph graph = Opm::ECLGraph::load(casePath + "SIMPLE.EGRID", - casePath + "SIMPLE.INIT"); - graph.assignFluxDataSource(casePath + "SIMPLE.UNRST"); + initData); + int step = 2; - if ( ! graph.selectReportStep(step) ) + if ( ! rstrt.selectReportStep(step) ) { std::ostringstream os; @@ -44,3 +47,4 @@ TEST(opm_flowdiagnostics_test, basic_construction) std::cerr << "Caught exception: " << e.what() << '\n'; } } +*/ diff --git a/ApplicationCode/UserInterface/CMakeLists_files.cmake b/ApplicationCode/UserInterface/CMakeLists_files.cmake index a3b595d0d1..8658fd36fb 100644 --- a/ApplicationCode/UserInterface/CMakeLists_files.cmake +++ b/ApplicationCode/UserInterface/CMakeLists_files.cmake @@ -41,6 +41,7 @@ ${CEE_CURRENT_LIST_DIR}RiuWellLogPlot.h ${CEE_CURRENT_LIST_DIR}RiuWellLogTrack.h ${CEE_CURRENT_LIST_DIR}RiuGeoMechXfTensorResultAccessor.h ${CEE_CURRENT_LIST_DIR}RiuFemTimeHistoryResultAccessor.h +${CEE_CURRENT_LIST_DIR}RiuEditPerforationCollectionWidget.h ${CEE_CURRENT_LIST_DIR}RiuExportMultipleSnapshotsWidget.h ${CEE_CURRENT_LIST_DIR}RiuWellAllocationPlot.h ${CEE_CURRENT_LIST_DIR}RiuFlowCharacteristicsPlot.h @@ -86,6 +87,7 @@ ${CEE_CURRENT_LIST_DIR}RiuWellLogPlot.cpp ${CEE_CURRENT_LIST_DIR}RiuWellLogTrack.cpp ${CEE_CURRENT_LIST_DIR}RiuGeoMechXfTensorResultAccessor.cpp ${CEE_CURRENT_LIST_DIR}RiuFemTimeHistoryResultAccessor.cpp +${CEE_CURRENT_LIST_DIR}RiuEditPerforationCollectionWidget.cpp ${CEE_CURRENT_LIST_DIR}RiuExportMultipleSnapshotsWidget.cpp ${CEE_CURRENT_LIST_DIR}RiuWellAllocationPlot.cpp ${CEE_CURRENT_LIST_DIR}RiuFlowCharacteristicsPlot.cpp @@ -119,6 +121,7 @@ ${CEE_CURRENT_LIST_DIR}RiuRecentFileActionProvider.h ${CEE_CURRENT_LIST_DIR}RiuSummaryQwtPlot.h ${CEE_CURRENT_LIST_DIR}RiuQwtScalePicker.h ${CEE_CURRENT_LIST_DIR}RiuQwtPlotWheelZoomer.h +${CEE_CURRENT_LIST_DIR}RiuEditPerforationCollectionWidget.h ${CEE_CURRENT_LIST_DIR}RiuExportMultipleSnapshotsWidget.h ${CEE_CURRENT_LIST_DIR}RiuWellAllocationPlot.h ${CEE_CURRENT_LIST_DIR}RiuFlowCharacteristicsPlot.h diff --git a/ApplicationCode/UserInterface/RiuDragDrop.cpp b/ApplicationCode/UserInterface/RiuDragDrop.cpp index d0e54b3007..bca4bf933f 100644 --- a/ApplicationCode/UserInterface/RiuDragDrop.cpp +++ b/ApplicationCode/UserInterface/RiuDragDrop.cpp @@ -312,7 +312,7 @@ void RiuDragDrop::moveCasesToGridGroup(caf::PdmObjectGroup& objectGroup, RimIden if (RicCloseCaseFeature::userConfirmedGridCaseGroupChange(casesToBeDeleted)) { - caf::RicPasteEclipseCasesFeature::addCasesToGridCaseGroup(objectGroup, gridCaseGroup); + RicPasteEclipseCasesFeature::addCasesToGridCaseGroup(objectGroup, gridCaseGroup); for (size_t i = 0; i < casesToBeDeleted.size(); i++) { @@ -328,7 +328,7 @@ bool RiuDragDrop::handleGridCaseGroupDrop(Qt::DropAction action, caf::PdmObjectG { if (action == Qt::CopyAction) { - caf::RicPasteEclipseCasesFeature::addCasesToGridCaseGroup(objectGroup, gridCaseGroup); + RicPasteEclipseCasesFeature::addCasesToGridCaseGroup(objectGroup, gridCaseGroup); } else if (action == Qt::MoveAction) { diff --git a/ApplicationCode/UserInterface/RiuEditPerforationCollectionWidget.cpp b/ApplicationCode/UserInterface/RiuEditPerforationCollectionWidget.cpp new file mode 100644 index 0000000000..7c43178a04 --- /dev/null +++ b/ApplicationCode/UserInterface/RiuEditPerforationCollectionWidget.cpp @@ -0,0 +1,100 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2016 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RiuEditPerforationCollectionWidget.h" + +#include "RimPerforationCollection.h" + +#include "cafCmdFeatureManager.h" +#include "cafPdmUiTableView.h" +#include "cafSelectionManager.h" + +#include +#include +#include +#include +#include +#include +#include + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiuEditPerforationCollectionWidget::RiuEditPerforationCollectionWidget(QWidget* parent, RimPerforationCollection* perforationCollection) + : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint), + m_perforationCollection(perforationCollection) +{ + setWindowTitle("Edit Perforation Intervals"); + + QVBoxLayout* dialogLayout = new QVBoxLayout; + setLayout(dialogLayout); + + m_pdmTableView = new caf::PdmUiTableView(this); + m_pdmTableView->tableView()->setSelectionMode(QAbstractItemView::ExtendedSelection); + m_pdmTableView->tableView()->setContextMenuPolicy(Qt::CustomContextMenu); + m_pdmTableView->enableHeaderText(false); + + connect(m_pdmTableView->tableView(), SIGNAL(customContextMenuRequested(QPoint)), SLOT(customMenuRequested(QPoint))); + + m_pdmTableView->setListField(&(m_perforationCollection->m_perforations)); + + QHeaderView* verticalHeader = m_pdmTableView->tableView()->verticalHeader(); + verticalHeader->setResizeMode(QHeaderView::Interactive); + + m_pdmTableView->tableView()->resizeColumnsToContents(); + + // Set active child array to be able to use generic delete + caf::SelectionManager::instance()->setActiveChildArrayFieldHandle(&(m_perforationCollection->m_perforations)); + + dialogLayout->addWidget(m_pdmTableView); + + // Buttons + QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); + connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); + connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + + dialogLayout->addWidget(buttonBox); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiuEditPerforationCollectionWidget::~RiuEditPerforationCollectionWidget() +{ + m_pdmTableView->setListField(nullptr); + + caf::SelectionManager::instance()->setActiveChildArrayFieldHandle(nullptr); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiuEditPerforationCollectionWidget::customMenuRequested(QPoint pos) +{ + caf::CmdFeatureManager* commandManager = caf::CmdFeatureManager::instance(); + + QMenu menu; + menu.addAction(commandManager->action("PdmListField_AddItem","New row")); + menu.addAction(commandManager->action("PdmListField_DeleteItem","Delete row")); + + // Qt doc: QAbstractScrollArea and its subclasses that map the context menu event to coordinates of the viewport(). + QPoint globalPos = m_pdmTableView->tableView()->viewport()->mapToGlobal(pos); + + menu.exec(globalPos); +} diff --git a/ApplicationCode/UserInterface/RiuEditPerforationCollectionWidget.h b/ApplicationCode/UserInterface/RiuEditPerforationCollectionWidget.h new file mode 100644 index 0000000000..24aa05e04d --- /dev/null +++ b/ApplicationCode/UserInterface/RiuEditPerforationCollectionWidget.h @@ -0,0 +1,47 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2016 Statoil ASA +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include + +class RimProject; + +class RimPerforationCollection; + +namespace caf { + class PdmUiTableView; +} + +class QWidget; +class QLineEdit; + +class RiuEditPerforationCollectionWidget : public QDialog +{ + Q_OBJECT +public: + RiuEditPerforationCollectionWidget(QWidget* parent, RimPerforationCollection* perforationCollection); + ~RiuEditPerforationCollectionWidget(); + +private slots: + void customMenuRequested(QPoint pos); + +private: + RimPerforationCollection* m_perforationCollection; + caf::PdmUiTableView* m_pdmTableView; +}; diff --git a/ApplicationCode/UserInterface/RiuFlowCharacteristicsPlot.cpp b/ApplicationCode/UserInterface/RiuFlowCharacteristicsPlot.cpp index 4e1324f05b..09a39eaa13 100644 --- a/ApplicationCode/UserInterface/RiuFlowCharacteristicsPlot.cpp +++ b/ApplicationCode/UserInterface/RiuFlowCharacteristicsPlot.cpp @@ -17,27 +17,31 @@ ///////////////////////////////////////////////////////////////////////////////// #include "RiuFlowCharacteristicsPlot.h" -#include "RimFlowCharacteristicsPlot.h" -#include "RiuResultQwtPlot.h" -#include "qwt_plot.h" +#include "RiaColorTables.h" + +#include "RimFlowCharacteristicsPlot.h" + +#include "RiuLineSegmentQwtPlotCurve.h" +#include "RiuQwtPlotWheelZoomer.h" +#include "RiuQwtPlotZoomer.h" +#include "RiuResultQwtPlot.h" +#include "RiuSummaryQwtPlot.h" + #include "cvfBase.h" #include "cvfColor3.h" +#include "qwt_date.h" +#include "qwt_legend.h" +#include "qwt_plot.h" +#include "qwt_plot_zoomer.h" +#include "qwt_symbol.h" + #include #include +#include #include #include -#include "RiuLineSegmentQwtPlotCurve.h" -#include -#include "RiuSummaryQwtPlot.h" -#include "RiuQwtPlotWheelZoomer.h" -#include "qwt_plot_zoomer.h" -#include "RiaColorTables.h" -#include "qwt_plot_zoneitem.h" -#include "qwt_date.h" -#include "RiuQwtPlotZoomer.h" - //-------------------------------------------------------------------------------------------------- @@ -85,6 +89,9 @@ RiuFlowCharacteristicsPlot::RiuFlowCharacteristicsPlot(RimFlowCharacteristicsPlo m_flowCapVsStorageCapPlot->setTitle("Flow Capacity vs Storage Capacity"); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- void RiuFlowCharacteristicsPlot::addWindowZoom(QwtPlot* plot) { auto zoomer = new RiuQwtPlotZoomer(plot->canvas()); @@ -107,50 +114,58 @@ RiuFlowCharacteristicsPlot::~RiuFlowCharacteristicsPlot() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RiuFlowCharacteristicsPlot::setLorenzCurve(const std::vector& dateTimes, const std::vector& timeHistoryValues) +void RiuFlowCharacteristicsPlot::setLorenzCurve(const QStringList& dateTimeStrings, const std::vector& dateTimes, const std::vector& timeHistoryValues) { initializeColors(dateTimes); m_lorenzPlot->detachItems(QwtPlotItem::Rtti_PlotCurve, true); - auto curve = createEmptyCurve(m_lorenzPlot, "Lorenz Coefficient", QColor(0, 0, 0)); - curve->setSamplesFromDateAndValues(dateTimes, timeHistoryValues, false); - //curve->setSymbol(QwtSymbol ) - //size_t tsIdx = 0; - //for ( const QDateTime& dateTime: dateTimes ) - //{ - // auto curve = createEmptyCurve(m_lorenzPlot, dateTime.toString(), m_dateToColorMap[dateTime]); - // std::vector timeStep; - // timeStep.push_back(dateTime); - // std::vector lorCoeff; - // lorCoeff.push_back(timeHistoryValues[tsIdx]); - // - // curve->setSamplesFromDateAndValues(timeStep, lorCoeff, false); - // - // ++tsIdx; - //} - //double milliSecSinceEpoch = QwtDate::toDouble(filteredDateTimes[i]); - - for ( size_t tsIdx = 0; tsIdx < dateTimes.size(); ++tsIdx ) + for (size_t tsIdx = 0; tsIdx < dateTimes.size(); ++tsIdx) { - double currentTsValue = QwtDate::toDouble(dateTimes[tsIdx]); + if (timeHistoryValues[tsIdx] == HUGE_VAL) continue; - double minTsValue = currentTsValue; - if ( tsIdx > 0 ) minTsValue = 0.5 * (currentTsValue + QwtDate::toDouble(dateTimes[tsIdx-1])); - - double maxTsValue = currentTsValue; - if ( tsIdx < dateTimes.size()-1 ) maxTsValue = 0.5 * (currentTsValue + QwtDate::toDouble(dateTimes[tsIdx+1])); + QDateTime dateTime = dateTimes[tsIdx]; + double timeHistoryValue = timeHistoryValues[tsIdx]; - auto plotZone = new QwtPlotZoneItem(); - plotZone->setOrientation(Qt::Vertical); - plotZone->setInterval(minTsValue, maxTsValue); - plotZone->setBrush(QBrush(m_dateToColorMap[dateTimes[tsIdx]])); - plotZone->attach(m_lorenzPlot); + QString curveName = dateTimeStrings[static_cast(tsIdx)]; + + RiuFlowCharacteristicsPlot::addCurveWithLargeSymbol(m_lorenzPlot, curveName, m_dateToColorMap[dateTime], dateTime, timeHistoryValue); } m_lorenzPlot->replot(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiuFlowCharacteristicsPlot::addCurveWithLargeSymbol(QwtPlot* plot, const QString& curveName, const QColor& color, const QDateTime& dateTime, double timeHistoryValue) +{ + auto curve = createEmptyCurve(plot, curveName, color); + + QwtSymbol::Style style = QwtSymbol::Diamond; + QwtSymbol* symbol = new QwtSymbol(style); + + symbol->setSize(15, 15); + symbol->setColor(color); + + curve->setSymbol(symbol); + + // Add date and value twice to avoid a cross as symbol generated by RiuLineSegmentQwtPlotCurve + + std::vector dateTimes; + dateTimes.push_back(dateTime); + dateTimes.push_back(dateTime); + + std::vector timeHistoryValues; + timeHistoryValues.push_back(timeHistoryValue); + timeHistoryValues.push_back(timeHistoryValue); + + curve->setSamplesFromDateAndValues(dateTimes, timeHistoryValues, false); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- RiuLineSegmentQwtPlotCurve* RiuFlowCharacteristicsPlot::createEmptyCurve(QwtPlot* plot, const QString& curveName, const QColor& curveColor ) { RiuLineSegmentQwtPlotCurve* plotCurve = new RiuLineSegmentQwtPlotCurve(curveName); @@ -200,6 +215,9 @@ void RiuFlowCharacteristicsPlot::removeAllCurves() m_dateToColorMap.clear(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- void zoomAllInPlot(QwtPlot * plot) { plot->setAxisAutoScale(QwtPlot::xBottom, true); @@ -217,6 +235,23 @@ void RiuFlowCharacteristicsPlot::zoomAll() zoomAllInPlot(m_flowCapVsStorageCapPlot); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiuFlowCharacteristicsPlot::showLegend(bool show) +{ + if (show) + { + // Will be released in plot destructor or when a new legend is set + QwtLegend* legend = new QwtLegend(m_lorenzPlot); + m_lorenzPlot->insertLegend(legend, QwtPlot::BottomLegend); + } + else + { + m_lorenzPlot->insertLegend(nullptr); + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -225,7 +260,6 @@ RimFlowCharacteristicsPlot* RiuFlowCharacteristicsPlot::ownerPlotDefinition() return m_plotDefinition; } - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -242,7 +276,6 @@ QSize RiuFlowCharacteristicsPlot::minimumSizeHint() const return QSize(0, 100); } - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/UserInterface/RiuFlowCharacteristicsPlot.h b/ApplicationCode/UserInterface/RiuFlowCharacteristicsPlot.h index 79980e0a42..b2f763df59 100644 --- a/ApplicationCode/UserInterface/RiuFlowCharacteristicsPlot.h +++ b/ApplicationCode/UserInterface/RiuFlowCharacteristicsPlot.h @@ -18,13 +18,14 @@ #pragma once -#include "qwt_plot.h" +#include "RiuInterfaceToViewWindow.h" #include "cafPdmPointer.h" -#include +#include "qwt_plot.h" + #include -#include "RiuInterfaceToViewWindow.h" +#include class RimFlowCharacteristicsPlot; class RiuNightchartsWidget; @@ -49,13 +50,15 @@ public: RiuFlowCharacteristicsPlot(RimFlowCharacteristicsPlot* plotDefinition, QWidget* parent = NULL); virtual ~RiuFlowCharacteristicsPlot(); - void setLorenzCurve(const std::vector& dateTimes, const std::vector& timeHistoryValues); + void setLorenzCurve(const QStringList& dateTimeStrings, const std::vector& dateTimes, const std::vector& timeHistoryValues); void addFlowCapStorageCapCurve(const QDateTime& dateTime, const std::vector& xVals, const std::vector& yVals); void addSweepEfficiencyCurve(const QDateTime& dateTime, const std::vector& xVals, const std::vector& yVals); void removeAllCurves(); void zoomAll(); + void showLegend(bool show); + RimFlowCharacteristicsPlot* ownerPlotDefinition(); virtual RimViewWindow* ownerViewWindow() const override; @@ -68,9 +71,9 @@ protected: private: void setDefaults(); - - - void initializeColors(const std::vector& dateTimes); + void initializeColors(const std::vector& dateTimes); + + static void addCurveWithLargeSymbol(QwtPlot* plot, const QString& curveName, const QColor& color, const QDateTime& dateTime, double timeHistoryValue); private: caf::PdmPointer m_plotDefinition; @@ -78,7 +81,6 @@ private: QPointer m_flowCapVsStorageCapPlot; QPointer m_sweepEffPlot; - std::map m_dateToColorMap; }; diff --git a/ApplicationCode/UserInterface/RiuMainPlotWindow.cpp b/ApplicationCode/UserInterface/RiuMainPlotWindow.cpp index e00847420b..12454f36dd 100644 --- a/ApplicationCode/UserInterface/RiuMainPlotWindow.cpp +++ b/ApplicationCode/UserInterface/RiuMainPlotWindow.cpp @@ -138,6 +138,12 @@ void RiuMainPlotWindow::cleanupGuiBeforeProjectClose() void RiuMainPlotWindow::closeEvent(QCloseEvent* event) { RiaApplication* app = RiaApplication::instance(); + + if (app->isMain3dWindowVisible()) + { + return; + } + if (!app->askUserToSaveModifiedProject()) { event->ignore(); diff --git a/ApplicationCode/UserInterface/RiuMainWindow.cpp b/ApplicationCode/UserInterface/RiuMainWindow.cpp index e31450532f..21149dbee1 100644 --- a/ApplicationCode/UserInterface/RiuMainWindow.cpp +++ b/ApplicationCode/UserInterface/RiuMainWindow.cpp @@ -56,6 +56,7 @@ #include "cafPdmUiPropertyViewDialog.h" #include "cafPdmUiTreeView.h" #include "cafSelectionManager.h" +#include "cafUtils.h" #include "cvfTimer.h" @@ -198,6 +199,12 @@ void RiuMainWindow::cleanupGuiBeforeProjectClose() void RiuMainWindow::closeEvent(QCloseEvent* event) { RiaApplication* app = RiaApplication::instance(); + + if (app->isMainPlotWindowVisible()) + { + return; + } + if (!app->askUserToSaveModifiedProject()) { event->ignore(); @@ -631,7 +638,7 @@ void RiuMainWindow::slotRefreshFileActions() { RiaApplication* app = RiaApplication::instance(); - bool projectFileExists = QFile::exists(app->project()->fileName()); + bool projectFileExists = caf::Utils::fileExists(app->project()->fileName()); caf::CmdFeatureManager* cmdFeatureMgr = caf::CmdFeatureManager::instance(); CVF_ASSERT(cmdFeatureMgr); diff --git a/ApplicationCode/UserInterface/RiuMultiCaseImportDialog.cpp b/ApplicationCode/UserInterface/RiuMultiCaseImportDialog.cpp index 7eafd19858..e7d6ea6389 100644 --- a/ApplicationCode/UserInterface/RiuMultiCaseImportDialog.cpp +++ b/ApplicationCode/UserInterface/RiuMultiCaseImportDialog.cpp @@ -76,7 +76,7 @@ private: /// //-------------------------------------------------------------------------------------------------- RiuMultiCaseImportDialog::RiuMultiCaseImportDialog(QWidget *parent /*= 0*/) - : QDialog(parent) + : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint) { ui = new Ui::RiuMultiCaseImportDialog; ui->setupUi(this); diff --git a/ApplicationCode/UserInterface/RiuPropertyViewTabWidget.cpp b/ApplicationCode/UserInterface/RiuPropertyViewTabWidget.cpp index ba2a5eeb07..4aa3cd5a86 100644 --- a/ApplicationCode/UserInterface/RiuPropertyViewTabWidget.cpp +++ b/ApplicationCode/UserInterface/RiuPropertyViewTabWidget.cpp @@ -32,7 +32,7 @@ /// //-------------------------------------------------------------------------------------------------- RiuPropertyViewTabWidget::RiuPropertyViewTabWidget(QWidget* parent, caf::PdmObject* object, const QString& windowTitle, const QStringList& uiConfigNameForTabs) - : QDialog(parent) + : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint) { setWindowTitle(windowTitle); diff --git a/ApplicationCode/UserInterface/RiuTreeViewEventFilter.cpp b/ApplicationCode/UserInterface/RiuTreeViewEventFilter.cpp index eedc2637a5..fdf3c47298 100644 --- a/ApplicationCode/UserInterface/RiuTreeViewEventFilter.cpp +++ b/ApplicationCode/UserInterface/RiuTreeViewEventFilter.cpp @@ -21,12 +21,16 @@ #include "ToggleCommands/RicToggleItemsFeatureImpl.h" +#include "RiaApplication.h" + #include "RimCaseCollection.h" #include "RimEclipseCase.h" #include "RimGeoMechCase.h" #include "RimGeoMechView.h" #include "RimIdenticalGridCaseGroup.h" + #include "RiuMainWindow.h" +#include "RiuMainPlotWindow.h" #include "cafCmdFeature.h" #include "cafCmdFeatureManager.h" @@ -85,7 +89,18 @@ bool RiuTreeViewEventFilter::eventFilter(QObject *obj, QEvent *event) } } - if (!RiuMainWindow::instance()->projectTreeView()->isTreeItemEditWidgetActive()) + // Do not toggle state if currently editing a name in the tree view + bool toggleStateForSelection = true; + if (RiuMainWindow::instance()->projectTreeView()->isTreeItemEditWidgetActive()) + { + toggleStateForSelection = false; + } + else if (RiaApplication::instance()->mainPlotWindow() && RiaApplication::instance()->mainPlotWindow()->projectTreeView()->isTreeItemEditWidgetActive()) + { + toggleStateForSelection = false; + } + + if (toggleStateForSelection) { switch (keyEvent->key()) { diff --git a/ApplicationCode/UserInterface/RiuViewerCommands.cpp b/ApplicationCode/UserInterface/RiuViewerCommands.cpp index 7f2431c645..7d9d21c7e6 100644 --- a/ApplicationCode/UserInterface/RiuViewerCommands.cpp +++ b/ApplicationCode/UserInterface/RiuViewerCommands.cpp @@ -71,6 +71,7 @@ #include "cafCmdExecCommandManager.h" #include "cafCmdFeatureManager.h" +#include "cafDisplayCoordTransform.h" #include "cafSelectionManager.h" #include "cvfDrawableGeo.h" @@ -164,14 +165,8 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event) RimView* activeView = RiaApplication::instance()->activeReservoirView(); CVF_ASSERT(activeView); - RimCase* rimCase = NULL; - activeView->firstAncestorOrThisOfType(rimCase); - if (rimCase) - { - displayModelOffset = rimCase->displayModelOffset(); - } - - m_currentPickPositionInDomainCoords = localIntersectionPoint + displayModelOffset; + cvf::ref transForm = activeView->displayCoordTransform(); + m_currentPickPositionInDomainCoords = transForm->transformToDomainCoord(globalIntersectionPoint); } if (firstHitPart && firstPartTriangleIndex != cvf::UNDEFINED_UINT) @@ -306,9 +301,13 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event) //TODO: Update so these also use RiuWellPathSelectionItem caf::SelectionManager::instance()->setSelectedItem(wellPath); - commandIds << "RicNewWellLogFileCurveFeature"; + commandIds << "RicNewWellLogCurveExtractionFeature"; + commandIds << "RicNewWellLogFileCurveFeature"; + commandIds << "Separator"; commandIds << "RicNewWellPathIntersectionFeature"; + commandIds << "RicNewFishbonesSubsAtMeasuredDepthFeature"; + commandIds << "RicNewPerforationIntervalAtMeasuredDepthFeature"; } } @@ -319,13 +318,19 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event) if (well) { caf::SelectionManager::instance()->setSelectedItem(well); - commandIds << "RicNewSimWellIntersectionFeature"; + + commandIds << "RicNewWellLogCurveExtractionFeature"; commandIds << "RicShowWellAllocationPlotFeature"; - commandIds << "RicShowContributingWellsFeature"; commandIds << "RicPlotProductionRateFeature"; + commandIds << "Separator"; + commandIds << "RicShowContributingWellsFeature"; + commandIds << "Separator"; + commandIds << "RicNewSimWellIntersectionFeature"; + RiuSelectionItem* selItem = new RiuSimWellSelectionItem(eclipseWellSourceInfo->well(), m_currentPickPositionInDomainCoords, eclipseWellSourceInfo->branchIndex()); RiuSelectionManager::instance()->setSelectedItem(selItem, RiuSelectionManager::RUI_TEMPORARY); + commandIds << "RicPlotProductionRateFeature"; commandIds << "RicNewSimWellFractureAtPosFeature"; } } @@ -348,7 +353,7 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event) RimContextCommandBuilder::appendCommandsToMenu(commandIds, &menu); - if (menu.actions().size() > 0) + if (!menu.isEmpty()) { menu.exec(event->globalPos()); } @@ -850,7 +855,6 @@ void RiuViewerCommands::ijkFromCellIndex(size_t gridIdx, size_t cellIndex, size RimEclipseView* eclipseView = dynamic_cast(m_reservoirView.p()); RimGeoMechView* geomView = dynamic_cast(m_reservoirView.p()); - if (eclipseView && eclipseView->eclipseCase()) { eclipseView->eclipseCase()->eclipseCaseData()->grid(gridIdx)->ijkFromCellIndex(cellIndex, i, j, k); diff --git a/ApplicationCode/WellPathImportSsihub/RiuWellImportWizard.cpp b/ApplicationCode/WellPathImportSsihub/RiuWellImportWizard.cpp index 296c6f2d24..e44f32c6f5 100644 --- a/ApplicationCode/WellPathImportSsihub/RiuWellImportWizard.cpp +++ b/ApplicationCode/WellPathImportSsihub/RiuWellImportWizard.cpp @@ -32,6 +32,7 @@ #include "cafPdmUiPropertyView.h" #include "cafPdmUiTreeView.h" #include "cafPdmUiTreeViewEditor.h" +#include "cafUtils.h" #include #include @@ -99,7 +100,7 @@ QString RiuWellImportWizard::jsonWellsFilePath() void RiuWellImportWizard::downloadFields() { QString wellFileName = jsonWellsFilePath(); - if (QFile::exists(wellFileName)) + if (caf::Utils::fileExists(wellFileName)) { QFile::remove(wellFileName); } @@ -355,7 +356,7 @@ void RiuWellImportWizard::updateFieldsModel() { QString fileName = jsonFieldsFilePath(); - if (QFile::exists(fileName)) + if (caf::Utils::fileExists(fileName)) { ResInsightInternalJson::JsonReader jsonReader; QMap jsonMap = jsonReader.decodeFile(fileName); @@ -540,7 +541,7 @@ QStringList RiuWellImportWizard::absoluteFilePathsToWellPaths() const for (size_t i = 0; i < downloadEntities.size(); i++) { - if (QFile::exists(downloadEntities[i].responseFilename)) + if (caf::Utils::fileExists(downloadEntities[i].responseFilename)) { filePaths.push_back(downloadEntities[i].responseFilename); } @@ -582,7 +583,7 @@ void RiuWellImportWizard::parseWellsResponse(RimOilFieldEntry* oilFieldEntry) QStringList surveyNames; QStringList planNames; - if (QFile::exists(oilFieldEntry->wellsFilePath)) + if (caf::Utils::fileExists(oilFieldEntry->wellsFilePath)) { ResInsightInternalJson::JsonReader jsonReader; QMap jsonMap = jsonReader.decodeFile(oilFieldEntry->wellsFilePath); @@ -1056,7 +1057,7 @@ void WellSummaryPage::updateSummaryPage() for (size_t i = 0; i < downloadEntities.size(); i++) { - if (QFile::exists(downloadEntities[i].responseFilename)) + if (caf::Utils::fileExists(downloadEntities[i].responseFilename)) { wellPathCount++; } diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b8cae4532..d2e411a748 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -380,19 +380,19 @@ if (RESINSIGHT_PRIVATE_INSTALL) set(ERT_SHARED_LIB_FILES ${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libecl.so ${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libecl.so.2 - ${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libecl.so.2.1 + ${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libecl.so.2.2 ${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libeclxx.so ${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libeclxx.so.2 - ${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libeclxx.so.2.1 + ${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libeclxx.so.2.2 ${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libecl_well.so ${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libecl_well.so.2 - ${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libecl_well.so.2.1 + ${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libecl_well.so.2.2 ${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libert_geometry.so ${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libert_geometry.so.2 - ${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libert_geometry.so.2.1 + ${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libert_geometry.so.2.2 ${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libert_util.so ${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libert_util.so.2 - ${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libert_util.so.2.1 + ${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libert_util.so.2.2 ) install(FILES ${ERT_SHARED_LIB_FILES} DESTINATION ${RESINSIGHT_INSTALL_FOLDER} ) diff --git a/Fwk/AppFwk/CommonCode/cafUtils.cpp b/Fwk/AppFwk/CommonCode/cafUtils.cpp index f8fb68f254..679170b94b 100644 --- a/Fwk/AppFwk/CommonCode/cafUtils.cpp +++ b/Fwk/AppFwk/CommonCode/cafUtils.cpp @@ -223,4 +223,22 @@ bool Utils::getSaveDirectoryAndCheckOverwriteFiles(const QString& defaultDir, st } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool Utils::fileExists(const QString& fileName) +{ + QFileInfo fi(fileName); + + // QFileInfo::exists returns true for both files and folders + // Also check if the path points to a file + + if (fi.exists() && fi.isFile()) + { + return true; + } + + return false; +} + } // namespace caf diff --git a/Fwk/AppFwk/CommonCode/cafUtils.h b/Fwk/AppFwk/CommonCode/cafUtils.h index 8cbdde125c..cb92cee651 100644 --- a/Fwk/AppFwk/CommonCode/cafUtils.h +++ b/Fwk/AppFwk/CommonCode/cafUtils.h @@ -63,6 +63,8 @@ public: static QString indentString(int numSpacesToIndent, const QString& str); static bool getSaveDirectoryAndCheckOverwriteFiles(const QString& defaultDir, std::vector fileNames, QString* saveDir); + + static bool fileExists(const QString& fileName); }; } diff --git a/Fwk/AppFwk/cafUserInterface/cafAboutDialog.cpp b/Fwk/AppFwk/cafUserInterface/cafAboutDialog.cpp index e75db01d57..ce5716554c 100644 --- a/Fwk/AppFwk/cafUserInterface/cafAboutDialog.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafAboutDialog.cpp @@ -60,7 +60,7 @@ namespace caf { /// //-------------------------------------------------------------------------------------------------- AboutDialog::AboutDialog(QWidget* parent) -: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint) + : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint) { m_isCreated = false; diff --git a/Fwk/AppFwk/cafUserInterface/cafPdmUiListEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiListEditor.cpp index b9869b89d0..1b8e725f8c 100644 --- a/Fwk/AppFwk/cafUserInterface/cafPdmUiListEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiListEditor.cpp @@ -186,6 +186,10 @@ void PdmUiListEditor::configureAndUpdateUi(const QString& uiConfigName) { m_isEditOperationsAvailable = false; } + else + { + m_isEditOperationsAvailable = true; + } PdmUiListEditorAttribute attributes; caf::PdmUiObjectHandle* uiObject = uiObj(field()->fieldHandle()->ownerObject()); diff --git a/Fwk/AppFwk/cafUserInterface/cafPdmUiPropertyView.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiPropertyView.cpp index 09326ee398..1f9408cd1b 100644 --- a/Fwk/AppFwk/cafUserInterface/cafPdmUiPropertyView.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiPropertyView.cpp @@ -91,7 +91,7 @@ PdmUiPropertyView::PdmUiPropertyView(QWidget* parent, Qt::WindowFlags f) scrollArea->setWidget(m_placeholder); m_placeHolderLayout = new QVBoxLayout(); - m_placeHolderLayout->setContentsMargins(5,0,0,0); + m_placeHolderLayout->setContentsMargins(5,5,5,0); m_placeholder->setLayout(m_placeHolderLayout); QVBoxLayout* dummy = new QVBoxLayout(this); diff --git a/Fwk/AppFwk/cafViewer/cafViewer.cpp b/Fwk/AppFwk/cafViewer/cafViewer.cpp index d5f37bdb96..66aa61ddb5 100644 --- a/Fwk/AppFwk/cafViewer/cafViewer.cpp +++ b/Fwk/AppFwk/cafViewer/cafViewer.cpp @@ -461,6 +461,14 @@ void caf::Viewer::setNavigationPolicy(caf::NavigationPolicy* navigationPolicy) if (m_navigationPolicy.notNull()) m_navigationPolicy->setViewer(this); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const caf::NavigationPolicy* caf::Viewer::getNavigationPolicy() const +{ + return m_navigationPolicy.p(); +} + //-------------------------------------------------------------------------------------------------- /// diff --git a/Fwk/AppFwk/cafViewer/cafViewer.h b/Fwk/AppFwk/cafViewer/cafViewer.h index c90fb63721..23db03d2d6 100644 --- a/Fwk/AppFwk/cafViewer/cafViewer.h +++ b/Fwk/AppFwk/cafViewer/cafViewer.h @@ -117,6 +117,7 @@ public: // Set the navigation policy void setNavigationPolicy(caf::NavigationPolicy* navigationPolicy); + const caf::NavigationPolicy* getNavigationPolicy() const; void enableNavigationPolicy(bool enable); void setView( const cvf::Vec3d& alongDirection, const cvf::Vec3d& upDirection ); void zoomAll(); diff --git a/Fwk/VizFwk/LibGuiQt/cvfqtBasicAboutDialog.cpp b/Fwk/VizFwk/LibGuiQt/cvfqtBasicAboutDialog.cpp index d05f149cb5..765f19ee91 100644 --- a/Fwk/VizFwk/LibGuiQt/cvfqtBasicAboutDialog.cpp +++ b/Fwk/VizFwk/LibGuiQt/cvfqtBasicAboutDialog.cpp @@ -62,7 +62,7 @@ namespace cvfqt { /// //-------------------------------------------------------------------------------------------------- BasicAboutDialog::BasicAboutDialog(QWidget* parent) -: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint) + : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint) { m_isCreated = false; diff --git a/OctavePlugin/riSetActiveCellProperty.cpp b/OctavePlugin/riSetActiveCellProperty.cpp index a079ccd0da..1aedda4c5f 100644 --- a/OctavePlugin/riSetActiveCellProperty.cpp +++ b/OctavePlugin/riSetActiveCellProperty.cpp @@ -88,6 +88,13 @@ void setEclipseProperty(const Matrix& propertyFrames, const QString &hostName, q { error("riSetActiveCellProperty : ResInsight refused to accept the data. Maybe the dimensions or porosity model is wrong"); } + +#ifdef WIN32 + // TODO: Due to synchronization issues seen on Windows 10, it is required to do a sleep here to be able to catch disconnect + // signals from the socket. No sleep causes the server to hang. + Sleep(100); +#endif //WIN32 + return; } diff --git a/OctavePlugin/riSetGridProperty.cpp b/OctavePlugin/riSetGridProperty.cpp index 3ef34adda4..890c9f2f51 100644 --- a/OctavePlugin/riSetGridProperty.cpp +++ b/OctavePlugin/riSetGridProperty.cpp @@ -110,6 +110,13 @@ void setEclipseProperty(const NDArray& propertyFrames, const QString &hostName, { error("riSetGridProperty : ResInsight refused to accept the data. Maybe the dimensions or porosity model is wrong.\n"); } + +#ifdef WIN32 + // TODO: Due to synchronization issues seen on Windows 10, it is required to do a sleep here to be able to catch disconnect + // signals from the socket. No sleep causes the server to hang. + Sleep(100); +#endif //WIN32 + return; } diff --git a/README.md b/README.md index 0e4137db44..a83b1fee87 100644 --- a/README.md +++ b/README.md @@ -9,15 +9,15 @@ The main input data is *.GRID and *.EGRID files along with their *.INIT and rest ResInsight has been co-developed by Statoil ASA, Ceetron Solutions AS, and Ceetron AS with the aim to provide a versatile tool for professionals who need to visualize and process reservoir models. The software is copyrighted by Ceetron and Statoil and licensed under GPL 3+. See COPYING for details. ### Dependencies -ResInsight uses the Ensambles/ert library to access Eclipse result files, and the two projects collaborates closely. The source code of the approved ert library version is embedded in the ResInsight source code tree, making downloading and building simple. +ResInsight uses the Statoil/libecl (formerly Ensambles/ert) library to access Eclipse result files, and the two projects collaborates closely. The source code of the approved libecl version is embedded in the ResInsight source code tree, making downloading and building simple. ResInsight also features an interface to Octave for retrieval of data from ResInsight, processing using Octave, and communication of data back into ResInsight for further handling and visualization. Octave : [http://www.gnu.org/software/octave/](http://www.gnu.org/software/octave/) -Ensembles/ert : [https://github.com/Ensembles/ert](https://github.com/Ensembles/ert) +Statoil/libecl : [https://github.com/Statoil/libecl](https://github.com/Statoil/libecl) ### Supported Platforms -ResInsight is designed cross-platform from the start. Efforts have been made to ensure that code will compile and run on Linux and Windows platforms. Tested platforms are currently 64 bit RHEL6 and Windows 7. +ResInsight is designed cross-platform from the start. Efforts have been made to ensure that code will compile and run on Linux and Windows platforms. Tested platforms are currently 64 bit RHEL6 and Windows 7/8/10, and we have also received reports on successful builds on Ubuntu based systems. ### Documentation @@ -38,4 +38,4 @@ Release branches that might pop up are dedicated bug fix branches for the releas ### Building ResInsight -See [ Build Instructions ] (http://resinsight.org/docs/buildinstructions/) +See [ Build Instructions ](http://resinsight.org/docs/buildinstructions/) diff --git a/ResInsightVersion.cmake b/ResInsightVersion.cmake index 6ab4eaffb5..62276cd19a 100644 --- a/ResInsightVersion.cmake +++ b/ResInsightVersion.cmake @@ -7,15 +7,17 @@ set(RESINSIGHT_INCREMENT_VERSION "pre-proto.12") # https://github.com/CRAVA/crava/tree/master/libs/nrlib set(NRLIB_GITHUB_SHA "ba35d4359882f1c6f5e9dc30eb95fe52af50fd6f") -# https://github.com/Ensembles/ert -set(ERT_GITHUB_SHA "e2a5a9cc20705537d07822958d925e092a323367") +# https://github.com/Statoil/libecl +set(ERT_GITHUB_SHA "06a39878636af0bc52582430ad0431450e51139c") -set(OPM_COMMON_GITHUB_SHA "1216bc052542f24ec6fcfbe1947d52e6300ff754") -set(OPM_PARSER_GITHUB_SHA "a3496df501a4369fd827fbf0ff893d03deff425f") +# https://github.com/OPM/opm-flowdiagnostics +set(OPM_FLOWDIAGNOSTICS_SHA "2c5fb55db4c4ded49c14161dd16463e1207da049") -set(OPM_FLOWDIAGNOSTICS_SHA "a14dc4ba1302bcc1e0aeb35c5de6b4bd39bce98") -set(OPM_FLOWDIAGNOSTICS_APPLICATIONS_SHA "afd3f6c454f52dcfa0a6aa96be9823176a6daa48") +# https://github.com/OPM/opm-flowdiagnostics-applications +set(OPM_FLOWDIAGNOSTICS_APPLICATIONS_SHA "570601718e7197b751bc3cba60c1e5fb7d842842") +# https://github.com/OPM/opm-parser/blob/master/opm/parser/eclipse/Units/Units.hpp +# This file was moved from opm-core to opm-parser october 2016 # sha for Units.hpp 9a679071dd0066236154852c39a9e0b3c3ac4873 set(STRPRODUCTVER ${RESINSIGHT_MAJOR_VERSION}.${RESINSIGHT_MINOR_VERSION}.${RESINSIGHT_INCREMENT_VERSION}) diff --git a/ThirdParty/Ert/.gitignore b/ThirdParty/Ert/.gitignore index b0601e3c62..b835bff007 100644 --- a/ThirdParty/Ert/.gitignore +++ b/ThirdParty/Ert/.gitignore @@ -22,6 +22,5 @@ python/lib64 scratch.sparsebundle *.iml *.DS_Store -__ert_lib_path.py -__ert_lib_info.py - +__ecl_lib_path.py +__ecl_lib_info.py diff --git a/ThirdParty/Ert/.travis.yml b/ThirdParty/Ert/.travis.yml index a9693afcdb..81671386ce 100644 --- a/ThirdParty/Ert/.travis.yml +++ b/ThirdParty/Ert/.travis.yml @@ -1,65 +1,38 @@ +dist: trusty +sudo: false language: c -matrix: - fast_finish: true - allow_failures: - - os: osx - include: - - os: osx - osx_image: xcode7.3 - compiler: clang - - os: linux - compiler: gcc - addons: apt: sources: - - ubuntu-toolchain-r-test + - ubuntu-toolchain-r-test packages: - - liblapack-dev - - valgrind - - gcc-4.8 - - g++-4.8 - - clang - -install: - - if [[ "$CC" == "gcc" ]]; then export CXX="g++-4.8"; fi - - - export TRAVIS_PYTHON_VERSION="2.7" - # We do this conditionally because it saves us some downloading if the version is the same. - - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - wget https://repo.continuum.io/miniconda/Miniconda-latest-MacOSX-x86_64.sh -O miniconda.sh; - else - wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh; - fi - else - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh; - else - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; - fi - fi - - - bash miniconda.sh -b -p $HOME/miniconda - - export CONDA_HOME="$HOME/miniconda" - - export PATH="$CONDA_HOME/bin:$PATH" - - hash -r - - conda config --set always_yes yes --set changeps1 no - - conda update -q conda - # Useful for debugging any issues with conda - - conda info -a - - conda install pyqt=4 scipy=0.16.1 numpy pandas matplotlib + - liblapack-dev + - valgrind + - gcc-4.8 + - g++-4.8 env: global: - - ERT_SHOW_BACKTRACE=1 + - ERT_SHOW_BACKTRACE=1 + +install: +- if [[ "$CC" == "gcc" ]]; then export CXX="g++-4.8"; fi +- wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh +- bash miniconda.sh -b -p $HOME/miniconda +- export CONDA_HOME="$HOME/miniconda" +- export PATH="$CONDA_HOME/bin:$PATH" +- hash -r +- conda config --set always_yes yes --set changeps1 no +- conda update -q conda +- conda info -a # Useful for debugging any issues with conda +- conda install pylint numpy pandas before_script: - - mkdir build - - cd build - - cmake -DBUILD_ERT=ON -DERT_BUILD_GUI=ON -DBUILD_TESTS=ON -DBUILD_APPLICATIONS=ON -DBUILD_PYTHON=ON -DERT_USE_OPENMP=ON -DERT_DOC=OFF -DERT_BUILD_CXX=ON .. +- mkdir build +- cd build +- cmake -DBUILD_TESTS=ON -DBUILD_PYTHON=ON -DERT_BUILD_CXX=ON -DBUILD_APPLICATIONS=ON .. script: - - make - - ctest --output-on-failure +- make +- ctest --output-on-failure -E ert_util_ping diff --git a/ThirdParty/Ert/CMakeLists.txt b/ThirdParty/Ert/CMakeLists.txt index 0e213519f9..cb4d90eb8f 100644 --- a/ThirdParty/Ert/CMakeLists.txt +++ b/ThirdParty/Ert/CMakeLists.txt @@ -8,7 +8,7 @@ endif() #----------------------------------------------------------------- set( ERT_VERSION_MAJOR 2 ) # Remember to update release notes whenever -set( ERT_VERSION_MINOR 1 ) # you change the ERT_VERSION_MINOR or MAJOR +set( ERT_VERSION_MINOR 2 ) # you change the ERT_VERSION_MINOR or MAJOR set( ERT_VERSION_MICRO git ) # with "new in Ert Version X.X.X"! # If the micro version is not integer, that should be interpreted as a @@ -16,14 +16,12 @@ set( ERT_VERSION_MICRO git ) # with "new in Ert Version X.X.X"! #----------------------------------------------------------------- -option( BUILD_ERT "Build the full ERT application - Linux only" OFF) option( BUILD_TESTS "Should the tests be built" OFF) option( BUILD_APPLICATIONS "Should we build small utility applications" OFF) option( BUILD_ECL_SUMMARY "Build the commandline application ecl_summary" OFF) option( BUILD_PYTHON "Run py_compile on the python wrappers" ON ) option( BUILD_SHARED_LIBS "Build shared libraries" ON ) option( INSTALL_ERT "Should anything be installed when issuing make install?" ON ) -option( ERT_BUILD_GUI "Should the PyQt based GUI be compiled and installed" OFF) option( ERT_USE_OPENMP "Use OpenMP" OFF ) option( ERT_DOC "Build ERT documantation" OFF) option( ERT_BUILD_CXX "Build some CXX wrappers" ON) @@ -131,17 +129,6 @@ set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/bin) -if (BUILD_SHARED_LIBS) - set( LIBRARY_TYPE SHARED ) -else() - set( LIBRARY_TYPE STATIC ) - if (BUILD_ERT) - message(FATAL_ERROR "The full ERT application must be built with shared libraries") - endif() - if (BUILD_PYTHON) - message(FATAL_ERROR "The Python wrappers require shared libraries") - endif() -endif() if (MSVC) add_definitions( -D__func__="\\"????\\"") @@ -181,44 +168,14 @@ endif() include_directories( ${PROJECT_SOURCE_DIR}/libecl_well/include ) add_subdirectory( libecl_well ) - -#----------------------------------------------------------------- -if (BUILD_ERT) -#----------------------------------------------------------------- - if (BUILD_TESTS) - option( ERT_LSF_SUBMIT_TEST "Build and run tests of LSF submit" OFF) - endif() - add_subdirectory( bin ) - - include(cmake/ert_module_name.cmake) - - include_directories( ${PROJECT_SOURCE_DIR}/libconfig/include ) - add_subdirectory( libconfig ) - - include_directories( ${PROJECT_SOURCE_DIR}/libsched/include ) - add_subdirectory( libsched ) - - include_directories( ${PROJECT_SOURCE_DIR}/librms/include ) - add_subdirectory( librms ) - - include_directories( ${PROJECT_SOURCE_DIR}/libanalysis/include ) - add_subdirectory( libanalysis ) - - include_directories( ${PROJECT_SOURCE_DIR}/libjob_queue/include ) - add_subdirectory( libjob_queue ) - - include_directories( ${PROJECT_SOURCE_DIR}/libenkf/include ) - add_subdirectory( libenkf ) - - install(DIRECTORY ${PROJECT_SOURCE_DIR}/share DESTINATION ${CMAKE_INSTALL_PREFIX}) -endif() - - if (BUILD_PYTHON) if (ERT_WINDOWS) - message(STATUS "Python is not supported on Windows") + message(WARNING "Python is not supported on Windows") + set( BUILD_PYTHON OFF ) else() - include(cmake/python.cmake2) + # If finding the Python interpreter and required packages + # fails in the python/CMakeLists.txt file the BUILD_PYTHON + # will be set to OFF. add_subdirectory( python ) if(ERT_DOC) @@ -227,3 +184,16 @@ if (BUILD_PYTHON) endif() endif() +if (BUILD_PYTHON) + if (NOT ${BUILD_SHARED_LIBS}) + message(FATAL_ERROR "The Python wrappers require shared libraries") + endif() +endif() + + + +configure_file( cmake/libecl-config.cmake.in libecl-config.cmake @ONLY) +configure_file( cmake/libecl-config-version.cmake.in libecl-config-version.cmake @ONLY) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libecl-config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/libecl-config-version.cmake + DESTINATION lib/libecl ) diff --git a/ThirdParty/Ert/README b/ThirdParty/Ert/README deleted file mode 100644 index dcae8cff53..0000000000 --- a/ThirdParty/Ert/README +++ /dev/null @@ -1,341 +0,0 @@ -Coming from OPM?? ------------------ - -ERT is a package for handling an ensemble of reservoir models, an -important part of that is beeing able to read and write the files from -standard reservoir applications; ert has quite extensive support for -reading and writing the result files from the ECLIPSE reservoir -simulator. The capabilities to read and write ECLIPSE result files is -used by the OPM simulator codes. - -The ERT build system has many configuration options, but when -compiling for OPM you should be able to use the all defaults route: - - git clone https://github.com/Ensembles/ert.git - cd ert - mkdir build - cd build - cmake .. - make - -The OPM build system can find an ERT distribution in the sibling -location, i.e. if you have cloned ert beside the opm modules like: - - ert/ - opm-common/ - opm-parser/ - opm-material/ - .... - -The opm build system will find the ert distribution in-place, -otherwise you should install ert with 'make install' and the normal -cmake machinery of the opm build system should find it. - - ------------------------------------------------------------------------- - - _________________________________ - / \ - | ______ ______ _______ | - | | ____| | __ \ |__ __| | - | | |__ | |__) | | | | - | | __| | _ / | | | - | | |____ | | \ \ | | | - | |______| |_| \_\ |_| | - | | - | Ensemble based Reservoir Tool | - \_________________________________/ - - ------------------------------------------------------------------------- - - 1. ERT - 2. ECLIPSE utilities. - 3. Building ERT - 3.1 CMake settings you might want to adjust - 4. The code: - 4.1 The different libraries - 4.2 The general structure - 4.3 Python wrappers - 5. Tests - ------------------------------------------------------------------------- - -1. ERT - -ERT - Ensemble based Reservoir Tool is a tool for managing an ensemble -of reservoir models. The initial motivation for creating ERT was a as -tool to do assisted history matching with the Ensemble Kalman Filter -(EnKF). Very briefly, the process of using EnKF for history matching -can be summarized as: - - 1. Sample initial reservoir parameters from a (Gaussian) initial - distribution. - - 2. Simulate the ensemble of of reservoir forward in time through a - part of the historical period for which data is available. - - 3. Load the results, compare with the observed data, update the - parameters and the state of reservoir by filtering out the most - inacurate results, and restart the forward simulations. - -This recipe is quite complex technically, and in particular involves -the ability to read and write input and output files from the -reservoir simulator (i.e. ECLIPSE in the case of ERT), run simulations -with arbitrary external programs, plotting data and so on. This -implies that a quite significant technical machinery must be in place -before the EnKF algorithm as such can be utilizied. This in particular -applies to real industry reservoir models, where typically -imperfections of all kinds flourish. - -Despite the fact that the initial motivation for creating ERT was to -be able to use the EnKF algorithm for history matching, ERT is -currently more used with the Ensemble Smoother and also purely as a -workflow manager, i.e. herding a large collection of reservoir models -through the required simulations steps. - - -2. ECLIPSE Utilities - -ERT has a quite large amount of code devoted to reading and writing -the ECLIPSE output files (grid/rft/restart/init/summary). In addition, -there is also reasonable support for reading and writing the grdecl -input files, but there is no general .DATA file parser. The ability to -read and write ECLIPSE output files is valuable in many reservoir -applications, and it is possible to only build and use the libecl -(with support libraries) library for working with ECLIPSE files. In -fact, the default build setup is to only build the ECLIPSE related -library and utilities. This part of the ERT distribution can also be -built on Windows with Visual Studio (albeit with maaaany warnings) and -with MinGW. - - -3. Building ERT - -CMake is the build system for ERT. The top level CMakeLists.txt file -is located in the top level directory of the repository, and this -CMakeLists.txt file includes individual CMakeLists.txt files for the -different libraries. - -Building with CMake is performed like this: - - 1. Create a build directory, this can in principle be anywhere in - the filesystem. One level above the toplevel source directory is - a practical choice. - - 2. Go to the build directory and invoke the command: - - ccmake - - Go through several 'configure' steps with CMake and generate - native build files. - - 3. Exit ccmake and invoke the native build system, i.e. ordinarily - 'make' on Linux. - - 4. Subsequent builds can be performed using just the native make - command, as in step 3. - -3.1 CMake settings you might want to adjust - -The main setting you should adjust is BUILD_ERT which is default to -OFF, i.e. by default only the ECLIPSE related utilities will be -built. The build system has numerous configurations checks; the -ECLIPSE utilities should build on Windows, but to build all of ERT you -will need a Linux (Posix) system. - - -4. The code - -The code is mainly a collection of libraries written in C. - -4.1 The different libraries - -The provided libraries are: - - libert_util: This library is a collection of utilities of various - sorts; if C++ had been chosen as implementation language, most of - these utilities could probably be replaced by standard C++ classes. - - libgeometry: This is a very small geometry library; the main code - is a small implementantion of an alorithm to determine whether a - point is inside a polyhedron. The ECLIPSE library has some - geometry related code which should be moved here. - - libwell: This library will load well information from an ECLIPSE - restart file. This is mainly for the purpose of visualization - of the existing wells, and can not be used to update or model - the well configuration. - - libecl: This library will read and (partly) write the various - binary ECLIPSE files, including GRID/EGRID, summary, INIT, - restart and RFT files. There is also support for reading an - writing grdecl formatted files, but there is no support for - general parsing of the ECLIPSE input format. - - ---------------------------------------------------------------------------- - - librms: This is a library for reading and writing RMS Roff - files. It turns out that ECLIPSE file formats is by far the most - common external file format for RMS and that the ROFF support is - not essential for this reason. - - libconfig: This library implements a parser for the ERT config file - format, this format is used in the main ERT configuration file, - and also in several small special-purpose configuration files used - by ERT. The config format parsed by this library was inspired by - the ECLIPSE format, in retrospect that was a mistake - it should - have been based on a standard format like xml. - - To confuse things even further, the libconfig library implements - /two/ formats for configuration files -- the 'second format' is - implemented in the file conf.c, and only used as format for the - observations in ERT. - - libplot: A *very* simple library for creating plots which only - satisfies the needs of ERT. - - libanalysis: The EnKF algorithm is implemented in this library. - - libjob_queue: This library implements a system to manage and run - simulations in the form of external programs. The library has a - queue manager, and a system with drivers which communicate with - the underlying system. Currently, the library has a LSF driver - to work with LSF, a LOCAL driver which starts simulations on the - current workstation and a RSH driver which submits jobs to a - 'cluster' of workstation using ssh. - - libenkf: This is the main functionality which is ERT specific; this - library is too large. - - -4.2 General structure - -The code is written in C, but conventions give a 'scent of object -orientation'. Most of the code is uses the following conventions: - - - Every file 'xxx' implements a data type 'xxx_type' - this naming - convention is quite strong. - - - All the structure definitions are in the source files, - i.e. external scopes must access the data of a structure - through accessor functions. - - - All functions which operate on a type 'xxx_type' take a pointer - to xxx_type as their first argument, the structure closely - resemble the 'self' argument used when implementing Python - classes. - - - Memory management is manual; however there are some conventions: - * Functions allocating storage have _alloc_ as part of the name. - * For all functions xxx_alloc() which allocate memory, there - should be a matching xxx_free() function to discard the objects. - * Containers can optionally destroy their content if the content - is installed with a destructor. - - - In libert_util/src/type_macros.h there is a macro based - 'type-system' which is used to runtime check casts of (void *). - - -4.3 Python wrappers - -Some of the code, in particular the ECLIPSE related functionality, has -been wrapped for usage in Python. Using these wrappers, it is quite -easy work with ECLIPSE files. The python wrappers are quite well -documented both in the directory python/docs and in the Python classes -themselves. - - -5. Tests - -The ERT codebase has a small but increasing test coverage. The tests -are typically located in a per-library subdirectory tests/. The test -framework is based on ctest which basically works like this: - - 1. In the CMakeLists.txt file testing is enabled with - ENABLE_TESTING(). - - 2. Tests are added with: - - add_test( test_name test_executable arg1 arg2 arg3 ... ) - - If the executable exits with status 0 the test has passed, - otherwise it has failed. The executable run by the test can - typically be an executable built as part of the solution, but can - in principle be an arbitrary executable like a dedicated test - runner or e.g. the Python interpreter. - -5.1 Testing of C code - -The main part of the testing infrastructure are small C applications -which are added like this: - - add_executable( test_exe test_source.c ) - target_link_libraries( test_exe lib ) - add_test( test_name ${EXECUTABLE_OUTPUT_PATH}/test_exe commandline_arg1 commandline_arg2 ) - -Where the first two lines create the test executable in the normal -way, and the last line adds it as a test. - -5.2 Testing of Python Code - -In python/test there are several files with Python tests, these files -are executable files and they are invoked directly from the command -line. A limited number of the tests have been integrated in the ctest -system. - -5.3 Test names - -The tests in the cmake build system follow the naming convention of -the library regarding the functionality which they are testing: For -example, all tests for the libecl library use a name starting with -'ecl' and all tests for the tests for the config library are prefixed -by 'config'. The ctest options -R and -E can be used to include and -exclude tests based on their name - - ctest -R ecl # Run all tests containing the regular expression 'ecl' - ctest -E ecl # Run all tests NOT containing the regular expression 'ecl' - - -5.4 Test labels - -Using the cmake set_property() function it is possible to assign -labels to the test, and the -L and -LE options to ctest can be used to -limit which tests to run. A test can only have one label; in the -current ctest setup different labels are combined into one composite -label with a ":" separator, e.g. - - set_property( TEST test_xxx PROPERTY LABELS StatoilData:Python) - -will set the 'StatoilData' and 'Python' properties on test_xxx. The -labels currently available in the ERT test setup are: - - StatoilData: This implies that the test makes use of Statoil - internal data. If you are work for the Bergen office of Statoil, - you can read the the file test-data/README for instructions on - how to make this data available. - - If you are not for Statoil in Bergen, you must pass the option: - "-EL StatoilData" to ctest to skip all the tests which require - Statoil internal data. - - StatoilBuild: There is one python test which makes use of Statoil - internal configuration data, this test is labeled with - StatoilBuild. If you want to run this test, you must set the - cmake option ECL_LOCAL_TARGET to point to a file which contains - these local configuration settings, e.g. where the ECLIPSE binary - is installed. - - Python: This label is used to indicate that the test uses Python. - - LSF: This labels indicates that the test needs a working LSF - environment to run. - - -5.5 ctest examples - - ctest -L Statoil # Run all tests labeled with Statoil - both - # StatoilData and StatoilBuild - - ctest -EL "Statoil|LSF" # Exclude all tests labeled with Statoil or LSF. - diff --git a/ThirdParty/Ert/README.md b/ThirdParty/Ert/README.md new file mode 100644 index 0000000000..b63800a9ba --- /dev/null +++ b/ThirdParty/Ert/README.md @@ -0,0 +1,302 @@ +# libecl [![Build Status](https://travis-ci.org/Statoil/libecl.svg?branch=master)](https://travis-ci.org/Statoil/libecl) + + +## Coming from OPM? + +`libecl` is a package for handling an ensemble of reservoir models, an +important part of that is beeing able to read and write the files from +standard reservoir applications; `libecl` has quite extensive support for +reading and writing the result files from the ECLIPSE reservoir +simulator. The capabilities to read and write ECLIPSE result files is +used by the OPM simulator codes. + +The `libecl` build system has many configuration options, but when +compiling for OPM you should be able to use the all defaults route: + +```bash +git clone https://github.com/Statoil/libecl.git +cd libecl +mkdir build +cd build +cmake .. +make +``` + +The OPM build system can find an `libecl` distribution in the sibling +location, i.e. if you have cloned ert beside the opm modules like: + +``` +libecl/ +opm-common/ +opm-parser/ +opm-material/ +... +``` + +The opm build system will find the ert distribution in-place, +otherwise you should install ert with 'make install' and the normal +cmake machinery of the opm build system should find it. + +``` +------------------------------------------------------------------------ + + _________________________________ + / \ + | ______ ______ _______ | + | | ____| | __ \ |__ __| | + | | |__ | |__) | | | | + | | __| | _ / | | | + | | |____ | | \ \ | | | + | |______| |_| \_\ |_| | + | | + | Ensemble based Reservoir Tool | + \_________________________________/ + + +------------------------------------------------------------------------ +``` + +1. `libecl` +2. ECLIPSE utilities. +3. Building `libecl` + 1. CMake settings you might want to adjust +4. The code: + 1. The different libraries + 2. The general structure + 3. Python wrappers +5. Tests + +------------------------------------------------------------------------ + +## 1. `libecl` + +`libecl` - Ensemble based Reservoir Tool is a tool for managing an ensemble +of reservoir models. The initial motivation for creating `libecl` was a as +tool to do assisted history matching with the Ensemble Kalman Filter +(EnKF). Very briefly, the process of using EnKF for history matching +can be summarized as: + +1. Sample initial reservoir parameters from a (Gaussian) initial +distribution. +2. Simulate the ensemble of of reservoir forward in time through a +part of the historical period for which data is available. +3. Load the results, compare with the observed data, update the +parameters and the state of reservoir by filtering out the most +inacurate results, and restart the forward simulations. + +This recipe is quite complex technically, and in particular involves +the ability to read and write input and output files from the +reservoir simulator (i.e. ECLIPSE in the case of `libecl`), run simulations +with arbitrary external programs, plotting data and so on. This +implies that a quite significant technical machinery must be in place +before the EnKF algorithm as such can be utilizied. This in particular +applies to real industry reservoir models, where typically +imperfections of all kinds flourish. + +Despite the fact that the initial motivation for creating `libecl` was to +be able to use the EnKF algorithm for history matching, `libecl` is +currently more used with the Ensemble Smoother and also purely as a +workflow manager, i.e. herding a large collection of reservoir models +through the required simulations steps. + + +## 2. ECLIPSE Utilities + +`libecl` has a quite large amount of code devoted to reading and writing +the ECLIPSE output files (grid/rft/restart/init/summary). In addition, +there is also reasonable support for reading and writing the grdecl +input files, but there is no general .DATA file parser. The ability to +read and write ECLIPSE output files is valuable in many reservoir +applications, and it is possible to only build and use the libecl +(with support libraries) library for working with ECLIPSE files. In +fact, the default build setup is to only build the ECLIPSE related +library and utilities. This part of the `libecl` distribution can also be +built on Windows with Visual Studio (albeit with maaaany warnings) and +with MinGW. + + +## 3. Building `libecl` + +CMake is the build system for `libecl`. The top level CMakeLists.txt file +is located in the top level directory of the repository, and this +CMakeLists.txt file includes individual CMakeLists.txt files for the +different libraries. + +Building with CMake is performed like this: + +1. Create a build directory, this can in principle be anywhere in the +filesystem. One level above the toplevel source directory is a practical choice. +2. Go to the build directory and invoke the command: +``` +ccmake +``` +Go through several 'configure' steps with CMake and generate native build files. + +3. Exit ccmake and invoke the native build system, i.e. ordinarily 'make' on +Linux. +4. Subsequent builds can be performed using just the native make command, as in +step 3. + +### 3.1 CMake settings you might want to adjust + +The main setting you should adjust is `BUILD_ERT` which is default to +`OFF`, i.e. by default only the ECLIPSE related utilities will be +built. The build system has numerous configurations checks; the +ECLIPSE utilities should build on Windows, but to build all of `libecl` you +will need a Linux (Posix) system. + + +## 4. The code + +The code is mainly a collection of libraries written in C. + +### 4.1 The different libraries + +The _provided libraries_ are: + +* `libert_util`: This library is a collection of utilities of various sorts; if +C++ had been chosen as implementation language, most of these utilities could +probably be replaced by standard C++ classes. +* `libgeometry`: This is a very small geometry library; the main code is a small +implementantion of an alorithm to determine whether a point is inside a +polyhedron. The ECLIPSE library has some geometry related code which should be +moved here. +* `libwell`: This library will load well information from an ECLIPSE restart +file. This is mainly for the purpose of visualization of the existing wells, +and can not be used to update or model the well configuration. +* `libecl`: This library will read and (partly) write the various binary ECLIPSE +files, including `GRID/EGRID`, summary, `INIT`, restart and `RFT` files. There +is also support for reading an writing grdecl formatted files, but there is no +support for general parsing of the _ECLIPSE_ input format. + + + +### 4.2 General structure + +The code is written in C, but conventions give a 'scent of object +orientation'. Most of the code is uses the following conventions: + +* Every file 'xxx' implements a data type 'xxx_type' - this naming convention is +quite strong. +* All the structure definitions are in the source files, i.e. external scopes +must access the data of a structure through accessor functions. +* All functions which operate on a type 'xxx_type' take a pointer to xxx_type as +their first argument, the structure closely resemble the 'self' argument used +when implementing Python classes. +* Memory management is manual; however there are some conventions: + * Functions allocating storage have _alloc_ as part of the name. + * For all functions xxx_alloc() which allocate memory, there +should be a matching xxx_free() function to discard the objects. + * Containers can optionally destroy their content if the content +is installed with a destructor. +* In `libert_util/src/type_macros.h` there is a macro based +'type-system' which is used to runtime check casts of (void *). + + +### 4.3 Python wrappers + +Some of the code, in particular the ECLIPSE related functionality, has +been wrapped for usage in Python. Using these wrappers, it is quite +easy work with ECLIPSE files. The python wrappers are quite well +documented both in the directory python/docs and in the Python classes +themselves. + + +## 5. Tests + +The `libecl` codebase has a small but increasing test coverage. The tests +are typically located in a per-library subdirectory tests/. The test +framework is based on ctest which basically works like this: + +1. In the CMakeLists.txt file testing is enabled with `ENABLE_TESTING()`. +2. Tests are added with: +```python +add_test( test_name test_executable arg1 arg2 arg3 ... ) +``` + +If the executable exits with status 0 the test has passed, +otherwise it has failed. The executable run by the test can +typically be an executable built as part of the solution, but can +in principle be an arbitrary executable like a dedicated test +runner or e.g. the Python interpreter. + +### 5.1 Testing of C code + +The main part of the testing infrastructure are small C applications +which are added like this: + +``` +add_executable( test_exe test_source.c ) +target_link_libraries( test_exe lib ) +add_test( test_name ${EXECUTABLE_OUTPUT_PATH}/test_exe commandline_arg1 commandline_arg2 ) +``` + +Where the first two lines create the test executable in the normal +way, and the last line adds it as a test. + +### 5.2 Testing of Python Code + +In python/test there are several files with Python tests, these files +are executable files and they are invoked directly from the command +line. A limited number of the tests have been integrated in the ctest +system. + +### 5.3 Test names + +The tests in the cmake build system follow the naming convention of +the library regarding the functionality which they are testing: For +example, all tests for the libecl library use a name starting with +'ecl' and all tests for the tests for the config library are prefixed +by 'config'. The ctest options -R and -E can be used to include and +exclude tests based on their name + +``` +ctest -R ecl # Run all tests containing the regular expression 'ecl' +ctest -E ecl # Run all tests NOT containing the regular expression 'ecl' +``` + +### 5.4 Test labels + +Using the cmake set_property() function it is possible to assign +labels to the test, and the -L and -LE options to ctest can be used to +limit which tests to run. A test can only have one label; in the +current ctest setup different labels are combined into one composite +label with a ":" separator, e.g. + +``` +set_property( TEST test_xxx PROPERTY LABELS StatoilData:Python) +``` + +will set the 'StatoilData' and 'Python' properties on test_xxx. The +labels currently available in the `libecl` test setup are: + + StatoilData: This implies that the test makes use of Statoil + internal data. If you are work for the Bergen office of Statoil, + you can read the the file test-data/README for instructions on + how to make this data available. + + If you are not for Statoil in Bergen, you must pass the option: + "-EL StatoilData" to ctest to skip all the tests which require + Statoil internal data. + + StatoilBuild: There is one python test which makes use of Statoil + internal configuration data, this test is labeled with + StatoilBuild. If you want to run this test, you must set the + cmake option ECL_LOCAL_TARGET to point to a file which contains + these local configuration settings, e.g. where the ECLIPSE binary + is installed. + + Python: This label is used to indicate that the test uses Python. + + LSF: This labels indicates that the test needs a working LSF + environment to run. + + +### 5.5 ctest examples + +``` +ctest -L Statoil # Run all tests labeled with Statoil - both + # StatoilData and StatoilBuild + +ctest -EL "Statoil|LSF" # Exclude all tests labeled with Statoil or LSF. +``` diff --git a/ThirdParty/Ert/cmake/cmake_pyc b/ThirdParty/Ert/cmake/cmake_pyc deleted file mode 100644 index 03fd6507e2..0000000000 --- a/ThirdParty/Ert/cmake/cmake_pyc +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python -import py_compile -import os -import os.path -import sys - -# Small 'python compiler' used in the build system for ert. The -# commandline arguments should be: -# -# cmake_pyc.py src1.py src2.py src3.py /path/to/pyc/files -# -# The input source files can contain a path component like -# path/src1.py, but the path will not be recreated in the target -# domain. - - -def compile_file(src_file , target_file): - path = os.path.dirname( target_file ) - if not os.path.exists( path ): - os.makedirs( path ) - try: - py_compile.compile( src_file , cfile = target_file , doraise = True) - except Exception,error: - sys.exit(1) - - -target_path = sys.argv[-1] -for src_file in sys.argv[1:-1]: - compile_file( src_file , "%s/%sc" % (target_path , os.path.basename(src_file))) - -sys.exit(0) - - - - diff --git a/ThirdParty/Ert/cmake/cmake_pyc2 b/ThirdParty/Ert/cmake/cmake_pyc2 deleted file mode 100644 index 885720d4a0..0000000000 --- a/ThirdParty/Ert/cmake/cmake_pyc2 +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python -import py_compile -import os -import os.path -import sys -import shutil - - -src_file = sys.argv[1] -target_file = sys.argv[2] - -(target_path , tail) = os.path.split( target_file ) -if not os.path.exists( target_path ): - try: - os.makedirs( target_path ) - except: - # When running with make -j 4 there might be a race to create this directory. - pass - -shutil.copyfile( src_file , target_file ) -shutil.copystat( src_file , target_file ) -try: - py_compile.compile( target_file , doraise = True) -except Exception as error: - sys.exit("py_compile(%s) failed:%s" % (target_file , error)) - - -sys.exit(0) - - - - diff --git a/ThirdParty/Ert/cmake/cmake_pyc_file b/ThirdParty/Ert/cmake/cmake_pyc_file deleted file mode 100644 index 9304f69c0f..0000000000 --- a/ThirdParty/Ert/cmake/cmake_pyc_file +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python -import py_compile -import os -import sys -import os.path - -# Small 'python compiler' used in the build system for ert. - -for file in sys.argv[1:]: - try: - py_compile.compile( file , doraise = True ) - except Exception,error: - sys.exit("py_compile(%s) failed:%s" % (file , error)) - - -sys.exit(0) - - - - diff --git a/ThirdParty/Ert/cmake/cmake_pyc_tree b/ThirdParty/Ert/cmake/cmake_pyc_tree deleted file mode 100644 index eeeaa389b6..0000000000 --- a/ThirdParty/Ert/cmake/cmake_pyc_tree +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python -import py_compile -import os -import sys -import os.path - -# Small 'python compiler' used in the build system for ert. The -# commandline argument should be the top level name of directory -# containing python source code. The 'compiler' will walk through the -# tree and in-place compile all the python files. - - -root_path = sys.argv[1] -for (root , dir_list , file_list) in os.walk( root_path ): - for file in file_list: - full_path = os.path.join( root , file ) - (tmp , ext) = os.path.splitext( full_path ) - if ext == ".py": - py_file = full_path - pyc_file = full_path + "c" - if os.path.exists( pyc_file ): - os.unlink( pyc_file ) - - try: - print "Compiling: %s" % py_file - py_compile.compile( py_file , doraise = True ) - except Exception,error: - sys.exit("py_compile(%s) failed:%s" % (py_file , error)) - - -sys.exit(0) - - - - diff --git a/ThirdParty/Ert/cmake/ert_api_check.cmake b/ThirdParty/Ert/cmake/ert_api_check.cmake index 972ae76eb5..1362cd0235 100644 --- a/ThirdParty/Ert/cmake/ert_api_check.cmake +++ b/ThirdParty/Ert/cmake/ert_api_check.cmake @@ -16,6 +16,8 @@ endif() find_library( LAPACK_LIBRARY NAMES lapack) if (LAPACK_LIBRARY) set(ERT_HAVE_LAPACK ON) +else() + set(ERT_HAVE_LAPACK OFF) endif() #----------------------------------------------------------------- @@ -25,9 +27,13 @@ find_path( ZLIB_HEADER zlib.h /usr/include ) if (ZLIB_LIBRARY AND ZLIB_HEADER) set( ERT_HAVE_ZLIB ON ) else() - message("ZLib not found - zlib support will not be included." ) + if(NOT DEFINED ZLIB_LIBRARY) + message(STATUS "ZLib library not found - zlib support will not be included." ) + endif() + if(NOT DEFINED ZLIB_HEADER) + message(STATUS "zlib.h not found - zlib support will not be included.") + endif() endif() - #----------------------------------------------------------------- try_compile( ERT_HAVE_ISFINITE ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/cmake/Tests/test_isfinite.c ) @@ -70,5 +76,4 @@ endif() find_program(PING_PATH NAMES ping) if (PING_PATH) set( ERT_HAVE_PING ON ) - add_definitions( -DPING_CMD="${PING_PATH}" ) -endif() \ No newline at end of file +endif() diff --git a/ThirdParty/Ert/cmake/ert_build_check.cmake b/ThirdParty/Ert/cmake/ert_build_check.cmake index 6abfd821f1..ea9d7b9c14 100644 --- a/ThirdParty/Ert/cmake/ert_build_check.cmake +++ b/ThirdParty/Ert/cmake/ert_build_check.cmake @@ -73,4 +73,8 @@ if (NOT HAVE_CXX_SHARED_PTR) set( BUILD_CXX OFF ) endif() +if (HAVE_FORK AND HAVE_PTHREAD AND HAVE_EXECINFO AND HAVE_GETPWUID) + set( HAVE_UTIL_ABORT_INTERCEPT ON) + set( HAVE_BACKTRACE ON) +endif() diff --git a/ThirdParty/Ert/cmake/libecl-config-version.cmake.in b/ThirdParty/Ert/cmake/libecl-config-version.cmake.in new file mode 100644 index 0000000000..3a8e633c45 --- /dev/null +++ b/ThirdParty/Ert/cmake/libecl-config-version.cmake.in @@ -0,0 +1,14 @@ +set(PACKAGE_VERSION @ERT_VERSION_MAJOR@.@ERT_VERSION_MINOR@.@ERT_VERSION_PATCH@) +set(PACKAGE_VERSION_MAJOR @ERT_VERSION_MAJOR@) +set(PACKAGE_VERSION_MINOR @ERT_VERSION_MINOR@) +set(PACKAGE_VERSION_PATCH @ERT_VERSION_MICRO@) + +set(libecl_INCLUDE_DIRS @CMAKE_INSTALL_PREFIX@/include) +set(libecl_LIBRARIES -lecl_well -lecl -lert_geometry -lert_util) +link_directories( @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@ ) +include_directories( @CMAKE_INSTALL_PREFIX@/include ) + +set( CMAKE_MODULE_PATH @CMAKE_INSTALL_PREFIX@/share/cmake/Modules ${CMAKE_MODULE_PATH}) +if (@BUILD_PYTHON@) + set(libecl_PYTHONPATH @CMAKE_INSTALL_PREFIX@/@PYTHON_INSTALL_PREFIX@ ) +endif() \ No newline at end of file diff --git a/ThirdParty/Ert/cmake/libecl-config.cmake.in b/ThirdParty/Ert/cmake/libecl-config.cmake.in new file mode 100644 index 0000000000..318a35c20b --- /dev/null +++ b/ThirdParty/Ert/cmake/libecl-config.cmake.in @@ -0,0 +1,10 @@ +set(libecl_INCLUDE_DIRS @CMAKE_INSTALL_PREFIX@/include) +set(libecl_LIBRARIES -lecl_well -lecl -lert_geometry -lert_util) + +set( CMAKE_MODULE_PATH @CMAKE_INSTALL_PREFIX@/share/cmake/Modules ${CMAKE_MODULE_PATH}) +link_directories( @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@ ) +include_directories( @CMAKE_INSTALL_PREFIX@/include ) + +if (@BUILD_PYTHON@) + set(libecl_PYTHONPATH @CMAKE_INSTALL_PREFIX@/@PYTHON_INSTALL_PREFIX@ ) +endif() \ No newline at end of file diff --git a/ThirdParty/Ert/cmake/python.cmake b/ThirdParty/Ert/cmake/python.cmake deleted file mode 100644 index 6b567a8d35..0000000000 --- a/ThirdParty/Ert/cmake/python.cmake +++ /dev/null @@ -1,25 +0,0 @@ -macro(add_python_target tgt PYTHON_INSTALL_PATH) - SET(OUT_FILES "") - foreach(file ${python_source_files}) - set(OUT ${CMAKE_CURRENT_BINARY_DIR}/${file}.pyc) - list(APPEND OUT_FILES ${OUT}) -#------------------------------------------------------ - ADD_CUSTOM_COMMAND( - OUTPUT ${OUT} - COMMAND ${PROJECT_SOURCE_DIR}/cmake/cmake_pyc - ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.py ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PATH} - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.py) -#------------------------------------------------------ - if (INSTALL_ERT) - install(FILES ${PROJECT_BINARY_DIR}/${PYTHON}/${file}.pyc DESTINATION ${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTALL_PATH}) - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${file}.py DESTINATION ${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTALL_PATH}) - endif() - endforeach(file) - list(REMOVE_DUPLICATES OUT_FILES) - - ADD_CUSTOM_TARGET( - ${tgt} ALL DEPENDS ${OUT_FILES}) - -endmacro() - - diff --git a/ThirdParty/Ert/docs/course/config/jobs/snake_oil_diff.py b/ThirdParty/Ert/docs/course/config/jobs/snake_oil_diff.py index afabb261f9..51ef5d472f 100644 --- a/ThirdParty/Ert/docs/course/config/jobs/snake_oil_diff.py +++ b/ThirdParty/Ert/docs/course/config/jobs/snake_oil_diff.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -from ert.ecl import EclSum +from ecl.ecl import EclSum def writeDiff(filename, vector1, vector2): with open(filename, "w") as f: diff --git a/ThirdParty/Ert/docs/course/config/jobs/snake_oil_npv.py b/ThirdParty/Ert/docs/course/config/jobs/snake_oil_npv.py index 4ff61251bc..126c917725 100644 --- a/ThirdParty/Ert/docs/course/config/jobs/snake_oil_npv.py +++ b/ThirdParty/Ert/docs/course/config/jobs/snake_oil_npv.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -from ert.ecl import EclSum +from ecl.ecl import EclSum OIL_PRICES = {"2010-01-01": 78.33, "2010-02-01": 76.39, diff --git a/ThirdParty/Ert/docs/course/config/jobs/snake_oil_simulator.py b/ThirdParty/Ert/docs/course/config/jobs/snake_oil_simulator.py index 1724cea874..40b4d4a6a1 100644 --- a/ThirdParty/Ert/docs/course/config/jobs/snake_oil_simulator.py +++ b/ThirdParty/Ert/docs/course/config/jobs/snake_oil_simulator.py @@ -3,13 +3,13 @@ from datetime import datetime import os import sys -from ert.ecl import EclSum, EclSumTStep -from ert.test import ExtendedTestCase +from ecl.ecl import EclSum, EclSumTStep +from ecl.test import ExtendedTestCase try: from synthesizer import OilSimulator except ImportError as e: - share_lib_path = os.path.join(ExtendedTestCase.findShareRoot(), "lib") + share_lib_path = ExtendedTestCase.createShareRoot("lib") sys.path.insert(0, share_lib_path) synthesizer_module = __import__("synthesizer") diff --git a/ThirdParty/Ert/docs/user/distributions/index.rst b/ThirdParty/Ert/docs/user/distributions/index.rst deleted file mode 100644 index eb52a90a2d..0000000000 --- a/ThirdParty/Ert/docs/user/distributions/index.rst +++ /dev/null @@ -1,172 +0,0 @@ -.. toctree:: - :maxdepth: 1 - -.. _prior_distributions: - -Prior distributions avaliable in ERT -==================================== - -The :ref:`GEN_KW ` keyword is typically used in sensitivy -studies and as parameters which are updated with the Ensemble Smoother -in a model updating project. In your configuration file the -:ref:`GEN_KW ` keyword is configured as: - -:: - - GEN_KW ID my_template.txt my_eclipse_include.txt my_priors.txt - -The file ``my_priors.txt`` contains the names of the variables -you are considering, and specifies the distribution which should be -used for the initial sampling. - - -NORMAL ------- -To set a normal (Gaussian) prior, use the keyword NORMAL. It takes two -arguments, a mean value and a standard deviation. Thus, the following -example will assign a normal prior with mean 0 and standard deviation -1 to the variable VAR1: - -:: - - VAR1 NORMAL 0 1 - -LOGNORMAL ---------- -A stochastic variable is log normally distributed if the logarithm of -the variable is normally distributed. In other words, if X is normally -distributed, then Y = exp(X) is log normally distributed. - -A log normal prior is suited to model positive quanties with a heavy -tail (tendency to take large values). To set a log normal prior, use -the keyword LOGNORMAL. It takes two arguments, the mean and standard -deviation of the *logarithm* of the variable: - -:: - - VAR2 LOGNORMAL 0 - -TRUNCATED_NORMAL ------------------ - -This *TRUNCATED_NORMAL* distribution works as follows: - - 1. Draw random variable X ~ N(mu,std) - 2. Clamp X to the interval [min, max] - -This is **not** a proper truncated normal distribution; hence the -clamping to ``[min,max]` should be an exceptional event. To configure -this distribution for a situation with mean 1, standard deviation 0.25 -and hard limits 0 and 10: - -:: - - VAR3 TRUNCATED_NORMAL 1 0.25 0 10 - - -UNIFORM -------- - -A stochastic variable is uniformly distributed if has a constant -probability density on a closed interval. Thus, the uniform -distribution is completely characterized by it's minimum and maximum -value. To assign a uniform distribution to a variable, use the keyword -UNIFORM, which takes a minimum and a maximum value for a the -variable. Here is an example, which assigns a uniform distribution -between 0 and 1 to a variable ``VAR4``: - -:: - - VAR4 UNIFORM 0 1 - -It can be shown that among all distributions bounded below by a and -above by b, the uniform distribution with parameters a and b has the -maximal entropy (contains the least information). Thus, the uniform -distribution should be your preferred prior distribution for robust -modeling of bounded variables. - - -LOGUNIF -------- - -A stochastic variable is log uniformly distributed if it's logarithm -is uniformly distributed on the interval [a,b]. To assign a log -uniform distribution to a a variable, use the keyword LOGUNIF, which -takes a minimum and a maximum value for the output variable as -arguments. The example - -:: - - VAR5 LOGUNIF 0.00001 1 - -will give values in the range [0.00001,1] - with considerably more -weight towards the lower limit. The log uniform distribution is useful -when modeling a bounded positive variable who has most of it's -probability weight towards one of the bounds. - -CONST ------ - -The keyword CONST is used to assign a Dirac distribution to a -variable, i.e. set it to a constant value. Here is an example of use: - -:: - - CONST 1.0 - -DUNIF ------ - -The keyword DUNIF is used to assign a discrete uniform distribution. It takes three arguments, the number bins, a minimum and maximum value. Here is an example which creates a discrete uniform distribution on [0,1] with 25 bins: - -:: - - DUNIF 25 0 1 - -ERRF ------ - -The ERRF keyword is used to define a prior resulting from applying the error function to a normally distributed variable with mean 0 and variance 1. The keyword takes four arguments: - -:: - - ERRF MIN MAX SKEWNESS WIDTH - -The arguments MIN and MAX sets the minimum and maximum value of the transform. Zero SKEWNESS results in a symmetric distribution, whereas negative SKEWNESS will shift the distribution towards the left and positive SKEWNESS will shift it towards the right. Letting WIDTH be larger than one will cause the distribution to be unimodal, whereas WIDTH less than one will create a bi-modal distribution. - - -DERRF ------ - -The keyword DERRF is similar to ERRF, but will create a discrete output. DERRF takes 5 arguments: - -:: - - DERRF NBINS MIN MAX SKEWNESS WIDTH - -NBINS set the number of discrete values, and the other arguments have the same effect as in ERRF. - - -Priors and transformations -========================== - -The Ensemble Smoother method, which ERT uses for updating of -parameters, works with normally distributed variables. So internally -in ERT the interplay between ``GEN_KW`` variables and updates is as -follows: - - 1. ERT samples a random variable ``x ~ N(0,1)`` - before outputing - to the forward model this is *transformed* to ``y ~ F(Y)`` where - the the distribution ``F(Y)`` is the correct prior distribution. - - 2. When the prior simulations are complete ERT calculates misfits - between simulated and observed values and *updates* the - parameters; hence the variables ``x`` now represent samples from - a posterior distribution which is Normal with mean and standard - deviation *different from (0,1)*. - -The transformation prescribed by ``F(y)`` still "works" - but it no -longer maps to a distribution in the same family as initially -specified by the prior. A consequence of this is that the update -process can *not* give you a posterior with updated parameters in the -same distribution family as the Prior. diff --git a/ThirdParty/Ert/docs/user/index.rst b/ThirdParty/Ert/docs/user/index.rst deleted file mode 100644 index 79949d3ae5..0000000000 --- a/ThirdParty/Ert/docs/user/index.rst +++ /dev/null @@ -1,15 +0,0 @@ -User documentation for ERT -========================== - -Contents: - -.. toctree:: - :maxdepth: 1 - - tutorial/index - keywords/index - workflows/index - magic_strings/index - observations/index - distributions/index - localization/index diff --git a/ThirdParty/Ert/docs/user/keywords/index.rst b/ThirdParty/Ert/docs/user/keywords/index.rst deleted file mode 100644 index 3d0befe551..0000000000 --- a/ThirdParty/Ert/docs/user/keywords/index.rst +++ /dev/null @@ -1,1869 +0,0 @@ -.. _ert_kw_full_doc: - -Keywords for the configuration file -=================================== - -:ref:`Go to main ERT page ` - - -General overview ----------------- -The enkf application is started with a single argument, which is the name of the configuration file to be used. The enkf configuration file serves several purposes, which are: - -* Defining which ECLIPSE model to use, i.e. giving a data, grid and schedule file. -* Defining which observation file to use. -* Defining how to run simulations. -* Defining where to store results. -* Creating a parametrization of the ECLIPSE model. - -The configuration file is a plain text file, with one statement per line. The first word on each line is a keyword, which then is followed by a set of arguments that are unique to the particular keyword. Except for the DEFINE keyword, ordering of the keywords is not significant. Similarly to ECLIPSE data files, lines starting with "--" are treated as comments. - -The keywords in the enkf configuration file can roughly be divded into two groups: - -* Basic required keywords not related to parametrization. I.e., keywords giving the data, grid, schedule and observation file, defining how to run simulations and how to store results. These keywords are described in :ref:`Basic required keywords.` -* Basic optional keywords not related to parametrization. These keywords are described in :ref:`Basic optional keywords `. -* Keywords related to parametrization of the ECLIPSE model. These keywords are described in :ref:`Parametrization keywords`. -* Advanced keywords not related to parametrization. These keywords are described in :ref:`Advanced optional keywords`. - - -List of keywords ----------------- - -===================================================================== ====================================== ============================== ============================================================================================================================================== -Keyword name Required by user? Default value Purpose -===================================================================== ====================================== ============================== ============================================================================================================================================== -:ref:`ADD_FIXED_LENGTH_SCHEDULE_KW ` NO Supporting unknown SCHEDULE keywords. -:ref:`ANALYSIS_COPY ` NO Create new instance of analysis module -:ref:`ANALYSIS_LOAD ` NO Load analysis module -:ref:`ANALYSIS_SET_VAR ` NO Set analysis module internal state variable -:ref:`ANALYSIS_SELECT ` NO STD_ENKF Select analysis module to use in update -:ref:`CASE_TABLE ` NO For running sensitivities you can give the cases descriptive names -:ref:`CONTAINER ` NO ... -:ref:`CUSTOM_KW ` NO Ability to load arbitrary values from the forward model. -:ref:`DATA_FILE ` YES Provide an ECLIPSE data file for the problem. -:ref:`DATA_KW ` NO Replace strings in ECLIPSE .DATA files -:ref:`DBASE_TYPE ` NO BLOCK_FS Which 'database' system should be used for storage -:ref:`DEFINE ` NO Define keywords with config scope -:ref:`DELETE_RUNPATH ` NO Explicitly tell ert to delete the runpath when a job is complete -:ref:`ECLBASE ` YES Define a name for the ECLIPSE simulations. -:ref:`END_DATE ` NO You can tell ERT how lon the simulations should be - for error check -:ref:`ENKF_ALPHA ` NO 1.50 Parameter controlling outlier behaviour in EnKF algorithm -:ref:`ENKF_BOOTSTRAP ` NO FALSE Should we bootstrap the Kalman gain estimate -:ref:`ENKF_CROSS_VALIDATION ` NO ... -:ref:`ENKF_CV_FOLDS ` NO 10 Number of folds used in the Cross-Validation scheme -:ref:`ENKF_KERNEL_PARAM ` NO 1 -:ref:`ENKF_LOCAL_CV ` NO FALSE Should we estimate the subspace dimenseion using Cross-Validation -:ref:`ENKF_MERGE_OBSERVATIONS ` NO FALSE Should observations from many times be merged together -:ref:`ENKF_MODE ` NO STANDARD Which EnKF should be used -:ref:`ENKF_PEN_PRESS ` NO FALSE Should we want to use a penalised PRESS statistic in model selection? -:ref:`ENKF_RERUN ` NO FALSE Should the simulations be restarted from time zero after each update. -:ref:`ENKF_SCALING ` NO TRUE Do we want to normalize the data ensemble to have unit variance? -:ref:`ENKF_TRUNCATION ` NO 0.99 Cutoff used on singular value spectrum. -:ref:`ENSPATH ` NO storage Folder used for storage of simulation results. -:ref:`FIELD ` NO Ads grid parameters -:ref:`FORWARD_MODEL ` NO Add the running of a job to the simulation forward model. -:ref:`GEN_DATA ` NO Specify a general type of data created/updated by the forward model. -:ref:`GEN_KW ` NO Add a scalar parameter. -:ref:`GEN_KW_TAG_FORMAT ` NO <%s> Format used to add keys in the GEN_KW template files. -:ref:`GEN_KW_EXPORT_FILE ` NO parameter.txt Name of file to export GEN_KW parameters to. -:ref:`GEN_PARAM ` NO Add a general parameter. -:ref:`GRID ` NO Provide an ECLIPSE grid for the reservoir model. -:ref:`HISTORY_SOURCE ` NO REFCASE_HISTORY Source used for historical values. -:ref:`HOOK_WORKFLOW ` NO Install a workflow to be run automatically. -:ref:`IGNORE_SCHEDULE ` NO -:ref:`INSTALL_JOB ` NO Install a job for use in a forward model. -:ref:`ITER_CASE ` NO IES%d Case name format - iterated ensemble smoother -:ref:`ITER_COUNT ` NO 4 Number of iterations - iterated ensemble smoother -:ref:`ITER_RETRY_COUNT ` NO 4 Number of retries for a iteration - iterated ensemble smoother -:ref:`JOBNAME ` NO Name used for simulation files. An alternative to ECLBASE. -:ref:`JOB_SCRIPT ` NO Python script managing the forward model. -:ref:`LOAD_SEED ` NO Load random seed from given file. -:ref:`LOAD_WORKFLOW ` NO Load a workflow into ERT. -:ref:`LOAD_WORKFLOW_JOB ` NO Load a workflow job into ERT. -:ref:`LICENSE_PATH ` NO A path where ert-licenses to e.g. RMS are stored. -:ref:`LOCAL_CONFIG ` NO A file with configuration information for local analysis. -:ref:`LOG_FILE ` NO log Name of log file -:ref:`LOG_LEVEL ` NO 1 How much logging? -:ref:`LSF_QUEUE ` NO normal Name of LSF queue. -:ref:`LSF_RESOURCES ` NO -:ref:`LSF_SERVER ` NO Set server used when submitting LSF jobs. -:ref:`MAX_ITER_COUNT ` NO Maximal number of iterations - iterated ensemble smoother. -:ref:`MAX_RESAMPLE ` NO 1 How many times should ert resample & retry a simulation. -:ref:`MAX_RUNNING_RSH ` NO The maximum number of running jobs when using RSH queue system. -:ref:`MAX_RUNTIME ` NO 0 Set the maximum runtime in seconds for a realization. -:ref:`MAX_SUBMIT ` NO 2 How many times should the queue system retry a simulation. -:ref:`MIN_REALIZATIONS ` NO 0 Set the number of minimum reservoir realizations to run before long running realizations are stopped. Keyword STOP_LONG_RUNNING must be set to TRUE when MIN_REALIZATIONS are set. -:ref:`NUM_REALIZATIONS ` YES Set the number of reservoir realizations to use. -:ref:`OBS_CONFIG ` NO File specifying observations with uncertainties. -:ref:`PLOT_SETTINGS ` NO Possibility to configure some aspects of plotting. -:ref:`PRE_CLEAR_RUNPATH ` NO FALSE Should the runpath be cleared before initializing? -:ref:`QUEUE_SYSTEM ` NO System used for running simulation jobs. -:ref:`REFCASE ` NO (see HISTORY_SOURCE and SUMMARY) Reference case used for observations and plotting. -:ref:`REFCASE_LIST ` NO Full path to Eclipse .DATA files containing completed runs (which you can add to plots) -:ref:`RERUN_PATH ` NO ... -:ref:`RERUN_START ` NO 0 ... -:ref:`RFT_CONFIG ` NO Config file specifying wellnames and dates for rft-measurments. Used for plotting. The format has to be name day month year (ex. Q-2FI 02 08 1973), with a new entry on a new line. -:ref:`RFTPATH ` NO rft Path to where the rft well observations are stored -:ref:`RSH_COMMAND ` NO Command used for remote shell operations. -:ref:`RSH_HOST ` NO Remote host used to run forward model. -:ref:`RUNPATH ` NO simulations/realization%d Directory to run simulations -:ref:`RUN_TEMPLATE ` NO Install arbitrary files in the runpath directory. -:ref:`STD_SCALE_CORRELATED_OBS ` NO FALSE Try to estimate the correlations in the data to inflate the observation std. -:ref:`SCHEDULE_FILE ` NO Provide an ECLIPSE schedule file for the problem. -:ref:`SCHEDULE_PREDICTION_FILE ` NO Schedule prediction file. -:ref:`SETENV ` NO You can modify the UNIX environment with SETENV calls. -:ref:`SINGLE_NODE_UPDATE ` NO FALSE ... -:ref:`STOP_LONG_RUNNING ` NO FALSE Stop long running realizations after minimum number of realizations (MIN_REALIZATIONS) have run. -:ref:`STORE_SEED ` NO File where the random seed used is stored. -:ref:`SUMMARY ` NO Add summary variables for internalization. -:ref:`SURFACE ` NO Surface parameter read from RMS IRAP file. -:ref:`TORQUE_QUEUE ` NO ... -:ref:`TIME_MAP ` NO Ability to manually enter a list of dates to establish report step <-> dates mapping. -:ref:`UMASK ` NO Control the permissions on files created by ERT. -:ref:`UPDATE_LOG_PATH ` NO update_log Summary of the EnKF update steps are stored in this directory. -:ref:`UPDATE_PATH ` NO Modify a UNIX path variable like LD_LIBRARY_PATH. -:ref:`UPDATE_SETTINGS ` NO Possibility to configure some common aspects of the Smoother update.| -:ref:`WORKFLOW_JOB_DIRECTORY ` NO Directory containing workflow jobs. -===================================================================== ====================================== ============================== ============================================================================================================================================== - - -:ref:` <>` - -Basic required keywords ------------------------ -.. _basic_required_keywords: - -These keywords must be set to make the enkf function properly. - -.. _data_file: -.. topic:: DATA_FILE - - | This is the name of ECLIPSE data file used to control the simulations. The data file should be prepared according to the guidelines given in Preparing an ECLIPSE reservoir model for use with enkf. - - *Example:* - - :: - - -- Load the data file called ECLIPSE.DATA - DATA_FILE ECLIPSE.DATA - - - - -.. _eclbase: -.. topic:: ECLBASE - - | The ECLBASE keyword sets the basename used for the ECLIPSE simulations. It can (and should, for your convenience) contain a %d specifier, which will be replaced with the realization numbers when running ECLIPSE. Note that due to limitations in ECLIPSE, the ECLBASE string must be in strictly upper or lower case. - - *Example:* - - :: - - -- Use MY_VERY_OWN_OIL_FIELD-0 etc. as basename. - -- When ECLIPSE is running, the %d will be, - -- replaced with realization number, giving: - -- - -- MY_VERY_OWN_OIL_FIELD-0 - -- MY_VERY_OWN_OIL_FIELD-1 - -- MY_VERY_OWN_OIL_FIELD-2 - -- ... - -- and so on. - ECLBASE MY_VERY_OWN_OIL_FIELD-%d - -.. _jobname: -.. topic:: JOBNAME - - As an alternative to the ECLBASE keyword you can use the JOBNAME keyword; in particular in cases where your forward model does not include ECLIPSE at all that makes more sense. If JOBANME is used instead of ECLBASE the same rules of no-mixed-case apply. - -.. _grid: -.. topic:: GRID - - This is the name of an existing GRID/EGRID file for your ECLIPSE model. If you had to create a new grid file when preparing your ECLIPSE reservoir model for use with enkf, this should point to the new .EGRID file. - - *Example:* - - :: - - -- Load the .EGRID file called MY_GRID.EGRID - GRID MY_GRID.EGRID - - -.. _num_realizations: -.. topic:: NUM_REALIZATIONS - - This is just the size of the ensemble, i.e. the number of realizations/members in the ensemble. - - *Example:* - - :: - - -- Use 200 realizations/members - NUM_REALIZATIONS 200 - - -.. _schedule_file: -.. topic:: SCHEDULE_FILE - - This keyword should be the name a text file containing the SCHEDULE section of the ECLIPSE data file. It should be prepared in accordance with the guidelines given in Preparing an ECLIPSE reservoir model for use with enkf. This SCHEDULE section will be used to control the ECLIPSE simulations. You can optionally give a second filename, which is the name of file which will be written into the directories for running ECLIPSE. - - *Example:* - - :: - - -- Parse MY_SCHEDULE.SCH, call the generated file ECLIPSE_SCHEDULE.SCH - SCHEDULE_FILE MY_SCHEDULE.SCH ECLIPSE_SCHEDULE.SCH - - Observe that the SCHEDULE_FILE keyword is only required when you need ERT to stop and restart your simulations; i.e. when you are using the EnKF algorithm. If you are only using ERT to your simulations; or using smoother update it is recommended to leave the SCHEDULE_FILE keyword out. In that case you must make sure that the ECLIPSE datafile correctly includes the SCHEDULE section. - - -Basic optional keywords ------------------------ -.. _basic_optional_keywords: - -These keywords are optional. However, they serve many useful purposes, and it is recommended that you read through this section to get a thorough idea of what's possible to do with the enkf application. - -.. _data_kw: -.. topic:: DATA_KW - - The keyword DATA_KW can be used for inserting strings into placeholders in the ECLIPSE data file. For instance, it can be used to insert include paths. - - *Example:* - - :: - - -- Define the alias MY_PATH using DATA_KW. Any instances of (yes, with brackets) - -- in the ECLIPSE data file will now be replaced with /mnt/my_own_disk/my_reservoir_model - -- when running the ECLIPSE jobs. - DATA_KW MY_PATH /mnt/my_own_disk/my_reservoir_model - - The DATA_KW keyword is of course optional. Note also that the enkf has some built in magic strings. - -.. _delete_runpath: -.. topic:: DELETE_RUNPATH - - When the ert application is running it creates directories for - the forward model simulations, one for each realization. When - the simulations are done, ert will load the results into the - internal database. By default the realization folders will be - left intact after ert has loaded the results, but using the - keyword DELETE_RUNPATH you can request to have (some of) the - directories deleted after results have been loaded. - - *Example A:* - - :: - - -- Delete simulation directories 0 to 99 - DELETE_RUNPATH 0-99 - - *Example B:* - - :: - - -- Delete simulation directories 0 to 10 as well as 12, 15 and 20. - DELETE_RUNPATH 0 - 10, 12, 15, 20 - - The DELETE_RUNPATH keyword is optional. - - -.. _end_date: -.. topic:: END_DATE - - When running a set of models from beginning to end ERT does - not now in advance how long the simulation is supposed to be, - it is therefor impossible beforehand to determine which - restart file number should be used as target file, and the - procedure used for EnKF runs can not be used to verify that an - ECLIPSE simulation has run to the end. - - By using the END_DATE keyword you can tell ERT that the - simulation should go at least up to the date given by - END_DATE, otherwise they will be regarded as failed. The - END_DATE does not need to correspond exactly to the end date - of the simulation, it must just be set so that all simulations - which go to or beyond END_DATE are regarded as successfull. - - *Example:* - - :: - END_DATE 10/10/2010 - - With this END_DATE setting all simulations which have gone to - at least 10.th of October 2010 are OK. - - -.. _enspath: -.. topic:: ENSPATH - - The ENSPATH should give the name of a folder that will be used - for storage by the enkf application. Note that the contents of - this folder is not intended for human inspection. By default, - ENSPATH is set to "storage". - - *Example:* - - :: - - -- Use internal storage in /mnt/my_big_enkf_disk - ENSPATH /mnt/my_big_enkf_disk - - The ENSPATH keyword is optional. - - -.. _history_source: -.. topic:: HISTORY_SOURCE - - In the observation configuration file you can enter - observations with the keyword HISTORY_OBSERVATION; this means - that ERT will the observed 'true' values from the model - history. Practically the historical values can be fetched - either from the SCHEDULE file or from a reference case. What - source to use for the historical values can be controlled with - the HISTORY_SOURCE keyword. The different possible values for - the HISTORY_SOURCE keyword are: - - - REFCASE_HISTORY - This is the default value for HISTORY_SOURCE, - ERT will fetch the historical values from the *xxxH* - keywords in the refcase summary, e.g. observations of - WGOR:OP_1 is based the WGORH:OP_1 vector from the - refcase summary. - - REFCASE_SIMULATED - In this case the historical values are based on the simulated values from the refcase, this is mostly relevant when a you want compare with another case which serves as 'the truth'. - - SCHEDULE - Load historical values from the WCONHIST and WCONINJE keywords in the Schedule file. - - - When setting HISTORY_SOURCE to either REFCASE_SIMULATED or REFCASE_HISTORY you must also set the REFCASE variable to point to the ECLIPSE data file in an existing reference case (should be created with the same schedule file as you are using now). - - *Example:* - - :: - - -- Use historic data from reference case - HISTORY_SOURCE REFCASE_HISTORY - REFCASE /somefolder/ECLIPSE.DATA - - The HISTORY_SOURCE keyword is optional. - -.. _refcase: -.. topic:: REFCASE - - With the REFCASE key you can supply ert with a reference case which can be used for observations (see HISTORY_SOURCE), if you want to use wildcards with the SUMMARY keyword you also must supply a REFCASE keyword. The REFCASE keyword should just point to an existing ECLIPSE data file; ert will then look up and load the corresponding summary results. - - *Example:* - - :: - - -- The REFCASE keyword points to the datafile of an existing ECLIPSE simulation. - REFCASE /path/to/somewhere/SIM_01_BASE.DATA - - -.. _install_job: -.. topic:: INSTALL_JOB - - The INSTALL_JOB keyword is used to learn the enkf application how to run external applications and scripts, i.e. defining a job. After a job has been defined with INSTALL_JOB, it can be used with the FORWARD_MODEL keyword. For example, if you have a script which generates relative permeability curves from a set of parameters, it can be added as a job, allowing you to do history matching and sensitivity analysis on the parameters defining the relative permeability curves. - - The INSTALL_JOB keyword takes two arguments, a job name and the name of a configuration file for that particular job. - - *Example:* - - :: - - -- Define a Lomeland relative permeabilty job. - -- The file jobs/lomeland.txt contains a detailed - -- specification of the job. - INSTALL_JOB LOMELAND jobs/lomeland.txt - - The configuration file used to specify an external job is easy to use and very flexible. It is documented in Customizing the simulation workflow in enkf. - - The INSTALL_JOB keyword is optional. - -.. _obs_config: -.. topic:: OBS_CONFIG - - The OBS_CONFIG key should point to a file defining observations and associated uncertainties. The file should be in plain text and formatted according to the guidelines given in Creating an observation file for use with enkf. - - *Example:* - - :: - - -- Use the observations in my_observations.txt - OBS_CONFIG my_observations.txt - - The OBS_CONFIG keyword is optional, but for your own convenience, it is strongly recommended to provide an observation file. - -.. _result_path: -.. topic:: RESULT_PATH - - The enkf application will print some simple tabulated results at each report step. The RESULT_PATH keyword should point to a folder where the tabulated results are to be written. It can contain a %d specifier, which will be replaced with the report step by enkf. The default value for RESULT_PATH is "results/step_%d". - - *Example:* - - :: - - -- Changing RESULT_PATH - RESULT_PATH my_nice_results/step-%d - - The RESULT_PATH keyword is optional. - -.. _runpath: -.. topic:: RUNPATH - - The RUNPATH keyword should give the name of the folders where the ECLIPSE simulations are executed. It should contain at least one %d specifier, which will be replaced by the realization number when the enkf creates the folders. Optionally, it can contain one more %d specifier, which will be replaced by the iteration number. - - By default, RUNPATH is set to "simulations/realization-%d". - - *Example A:* - - :: - -- Giving a RUNPATH with just one %d specifer. - RUNPATH /mnt/my_scratch_disk/realization-%d - - *Example B:* - - :: - - -- Giving a RUNPATH with two %d specifers. - RUNPATH /mnt/my_scratch_disk/realization-%d/iteration-%d - - The RUNPATH keyword is optional. - - -.. _runpath_file: -.. topic:: RUNPATH_FILE - -When running workflows based on external scripts it is necessary to 'tell' the external script in some way or another were all the realisations are located in the filesystem. Since the number of realisations can be quite high this will easily overflow the commandline buffer; the solution which is used is therefor to let ert write a reagular file which looks like this:: - - 0 /path/to/realisation0 CASE0 iter - 1 /path/to/realisation1 CASE1 iter - ... - N /path/to/realisationN CASEN iter - -The path to this file can then be passed to the scripts using the -magic string . The RUNPATH_FILE will by default be -stored as .ert_runpath_list in the same directory as the configuration -file, but you can set it to something else with the RUNPATH_FILE key. - -Keywords controlling the simulations ------------------------------------- -.. _keywords_controlling_the_simulations: - -.. _min_realizations: -.. topic:: MIN_REALIZATIONS - - MIN_REALIZATIONS is the minimum number of realizations that must have succeeded for the simulation to be regarded as a success. - - MIN_REALIZATIONS can also be used in combination with STOP_LONG_RUNNING, see the documentation for STOP_LONG_RUNNING for a description of this. - - *Example:* - - :: - - MIN_REALIZATIONS 20 - - The MIN_REALIZATIONS key can also be set as a percentage of NUM_REALIZATIONS - - :: - - MIN_REALIZATIONS 10% - - The MIN_REALIZATIONS key is optional. - - -.. _stop_long_running: -.. topic:: STOP_LONG_RUNNING - - The STOP_LONG_RUNNING key is used in combination with the MIN_REALIZATIONS key to control the runtime of simulations. When STOP_LONG_RUNNING is set to TRUE, MIN_REALIZATIONS is the minimum number of realizations run before the simulation is stopped. After MIN_REALIZATIONS have succeded successfully, the realizatons left are allowed to run for 25% of the average runtime for successfull realizations, and then killed. - - *Example:* - - :: - - -- Stop long running realizations after 20 realizations have succeeded - MIN_REALIZATIONS 20 - STOP_LONG_RUNNING TRUE - - The STOP_LONG_RUNNING key is optional. The MIN_REALIZATIONS key must be set when STOP_LONG_RUNNING is set to TRUE. - - -.. _max_runtime: -.. topic:: MAX_RUNTIME - - The MAX_RUNTIME keyword is used to control the runtime of simulations. When MAX_RUNTIME is set, a job is only allowed to run for MAX_RUNTIME, given in seconds. A value of 0 means unlimited runtime. - - *Example:* - - :: - - -- Let each realizations run for 50 seconds - MAX_RUNTIME 50 - - The MAX_RUNTIME key is optional. - - -Parameterization keywords -------------------------- -.. _parameterization_keywords: - -The keywords in this section are used to define a parametrization of the ECLIPSE model. I.e., defining which parameters to change in a sensitivity analysis and/or history matching project. For some parameters, it necessary to specify a prior distribution. See Prior distributions available in enkf for a complete list of available priors. - -.. _field: -.. topic:: FIELD - - The FIELD keyword is used to parametrize quantities which have extent over the full grid. Both dynamic properties like pressure, and static properties like porosity, are implemented in terms of FIELD objects. When adding fields in the config file the syntax is a bit different for dynamic fields (typically solution data from ECLIPSE) and parameter fields like permeability and porosity. - - **Dynamic fields** - - To add a dynamic field the entry in the configuration file looks like this: - - :: - FIELD DYNAMIC MIN:X MAX:Y - - In this case ID is not an arbitrary string; it must coincide with the keyword name found in the ECLIPSE restart file, e.g. PRESSURE. Optionally, you can add a minimum and/or a maximum value with MIN:X and MAX:Y. - - *Example A:* - - :: - - -- Adding pressure field (unbounded) - FIELD PRESSURE DYNAMIC - - *Example B:* - - :: - - -- Adding a bounded water saturation field - FIELD SWAT DYNAMIC MIN:0.2 MAX:0.95 - - **Parameter fields** - - A parameter field (e.g. porosity or permeability) is defined as follows: - - :: - - FIELD ID PARAMETER INIT_FILES:/path/%d MIN:X MAX:Y OUTPUT_TRANSFORM:FUNC INIT_TRANSFORM:FUNC - - Here ID is again an arbitrary string, ECLIPSE_FILE is the name of the file the enkf will export this field to when running simulations. Note that there should be an IMPORT statement in the ECLIPSE data file corresponding to the name given with ECLIPSE_FILE. INIT_FILES is a filename (with an embedded %d) to load the initial field from. Can be RMS ROFF format, ECLIPSE restart format or ECLIPSE GRDECL format. - - The input arguments MIN, MAX, INIT_TRANSFORM and OUTPUT_TRANSFORM are all optional. MIN and MAX are as for dynamic fields. - - For Assisted history matching, the variables in ERT should be normally distributed internally - the purpose of the transformations is to enable working with normally distributed variables internally in ERT. Thus, the optional arguments INIT_TRANSFORM:FUNC and OUTPUT_TRANSFORM:FUNC are used to transform the user input of parameter distribution. INIT_TRANSFORM:FUNC is a function which will be applied when they are loaded to ERT. OUTPUT_TRANSFORM:FUNC is a function which will be applied to the field when it is exported from ERT, and FUNC is the name of a transformation function to be applied. The avaialble functions are listed below: - - "POW10" : This function will raise x to the power of 10: y = 10^x. - "TRUNC_POW10" : This function will raise x to the power of 10 - and truncate lower values at 0.001. - "LOG" : This function will take the NATURAL logarithm of x: y = ln(x). - "LN" : This function will take the NATURAL logarithm of x: y = ln(x). - "LOG10" : This function will take the log10 logarithm of x: y = log10(x). - "EXP" : This function will calculate y = exp(x). - "LN0" : This function will calculate y = ln(x + 0.000001 - "EXP0" : This function will calculate y = exp(x) - 0.000001 - - For example, the most common scenario is that underlying log-normal distributed permeability in RMS are transformed to normally distributted in ERT, then you do: - - INIT_TRANSFORM:LOG To ensure that the variables which were initially log-normal distributed are transformed to normal distribution when they are loaded into ert. - - OUTPUT_TRANSFORM:EXP To ensure that the variables are reexponentiated to be log-normal distributed before going out to Eclipse. - - If users specify the wrong function name (e.g INIT_TRANSFORM:I_DONT_KNOW), ERT will stop and print all the valid function names. - - Regarding format of ECLIPSE_FILE: The default format for the parameter fields is binary format of the same type as used in the ECLIPSE restart files. This requires that the ECLIPSE datafile contains an IMPORT statement. The advantage with using a binary format is that the files are smaller, and reading/writing is faster than for plain text files. If you give the ECLIPSE_FILE with the extension .grdecl (arbitrary case), enkf will produce ordinary .grdecl files, which are loaded with an INCLUDE statement. This is probably what most users are used to beforehand - but we recomend the IMPORT form. - - **General fields** - - In addition to dynamic and parameter field there is also a general field, where you have fine grained control over input/output. Use of the general field type is only relevant for advanced features. The arguments for the general field type are as follows: - - :: - - FIELD ID GENERAL FILE_GENERATED_BY_ENKF FILE_LOADED_BY_ENKF - - The OPTIONS argument is the same as for the parameter field. - -.. _gen_data: -.. topic:: GEN_DATA - - The GEN_DATA keyword is used when estimating data types which enkf does not know anything about. GEN_DATA is very similar to GEN_PARAM, but GEN_DATA is used for data which are updated/created by the forward model like e.g. seismic data. In the main configuration file the input for a GEN_DATA instance is as follows: - - :: - - GEN_DATA ID RESULT_FILE:yyy INPUT_FORMAT:xx REPORT_STEPS:10,20 ECL_FILE:xxx OUTPUT_FORMAT:xx INIT_FILES:/path/files%d TEMPLATE:/template_file TEMPLATE_KEY:magic_string - - The GEN_DATA keyword has many options; in many cases you can leave many of them off. We therefor list the required and the optional options separately: - - **Required GEN_DATA options** - - * RESULT_FILE - This if the name the file generated by the forward model and read by ERT. This filename _must_ have a %d as part of the name, that %d will be replaced by report step when loading. - * INPUT_FORMAT - The format of the file written by the forward model (i.e. RESULT_FILE) and read by ERT, valid values are ASCII, BINARY_DOUBLE and BINARY_FLOAT. - * REPORT_STEPS A list of the report step(s) where you expect the forward model to create a result file. I.e. if the forward model should create a result file for report steps 50 and 100 this setting should be: REPORT_STEPS:50,100. If you have observations of this GEN_DATA data the RESTART setting of the corresponding GENERAL_OBSERVATION must match one of the values given by REPORT_STEPS. - - **Optional GEN_DATA options** - - * ECL_FILE - This is the name of file written by enkf to be read by the forward model. - * OUTPUT_FORMAT - The format of the files written by enkf and read by the forward model, valid values are ASCII, BINARY_DOUBLE, BINARY_FLOAT and ASCII_TEMPLATE. If you use ASCII_TEMPLATE you must also supply values for TEMPLATE and TEMPLATE_KEY. - * INIT_FILES - Format string with '%d' of files to load the initial data from. - - *Example:* - - :: - - GEN_DATA 4DWOC INPUT_FORMAT:ASCII RESULT_FILE:SimulatedWOC%d.txt REPORT_STEPS:10,100 - - Here we introduce a GEN_DATA instance with name 4DWOC. When the forward model has run it should create two files with name SimulatedWOC10.txt and SimulatedWOC100.txt. The result files are in ASCII format, ERT will look for these files and load the content. The files should be pure numbers - without any header. - - **Observe that the GEN_DATA RESULT_FILE setting must have a %d format specifier, that will be replaced with the report step..** - - -.. _custom_kw: -.. topic:: CUSTOM_KW - - The keyword CUSTOM_KW enables custom data key:value pairs - to be stored in ERT storage. Custom KW has many - similarities to Gen KW and Gen Data but is fully defined by - the user and contain only key_value pairs. - - *Example:* - - :: - - CUSTOM_KW GROUP_NAME - - --GROUP_NAME - This is similar to Gen KW where every keyword is prefixed with the GROUP_NAME like this: GROUP_NAME:KEYWORD - - --input_file - This is the input file expected to be generated by a forward model. - - --Example - CUSTOM_KW COMPOSITION composition.txt - - With this setup ERT will expect the file composition.txt to be present in the runpath. - This file may look like this - - :: - - oil 0.5 - water 0.2 - gas 0.2 - unknown 0.1 - state good - - Every key-value pair must be a string followed by a space and a value. - The value can either be a number or a string (all numbers are interpreted as floats). - - After a successful run, ERT will store the COMPOSITION - Custom KW in its filesystem and will be available for every - realization. An export will present the values produced as: - - * COMPOSITION:oil - * COMPOSITION:water - * COMPOSITION:gas - * COMPOSITION:unknown - * COMPOSITION:state - - -.. _gen_kw: -.. topic:: GEN_KW - - The GEN_KW (abbreviation of general keyword) parameter is based on a template file and substitution. In the main config file a GEN_KW instance is defined as follows: - - :: - - GEN_KW ID my_template.txt my_eclipse_include.txt my_priors.txt - - Here ID is an (arbitrary) unique string, my_template.txt is - the name of a template file, my_eclipse_include.txt is the - name of the file which is made for each member based on - my_template.txt and my_priors.txt is a file containing a list - of parametrized keywords and a prior distribution for - each. Note that you must manually edit the ECLIPSE data file - so that my_eclipse_include.txt is included. - - Let us consider an example where the GEN_KW parameter type is - used to estimate pore volume multipliers. We would then - declare a GEN_KW instance in the main enkf configuration file: - - :: - - GEN_KW PAR_MULTPV multpv_template.txt multpv.txt multpv_priors.txt - - In the GRID or EDIT section of the ECLIPSE data file, we would - insert the following include statement: - - :: - - INCLUDE - 'multpv.txt' / - - The template file multpv_template.txt would contain some - parametrized ECLIPSE statements: - - :: - - BOX - 1 10 1 30 13 13 / - MULTPV - 300* / - ENDBOX - - BOX - 1 10 1 30 14 14 / - MULTPV - 300* / - ENDBOX - - Here, and will act as magic - strings. Note that the '<' '>' must be present around the - magic strings. In this case, the parameter configuration file - multpv_priors.txt could look like this: - - :: - - MULTPV_BOX2 UNIFORM 0.98 1.03 - MULTPV_BOX1 UNIFORM 0.85 1.00 - - In general, the first keyword on each line in the parameter - configuration file defines a key, which when found in the - template file enclosed in '<' and '>', is replaced with a - value. The rest of the line defines a prior distribution for - the key. See Prior distributions available in enkf for a list - of available prior distributions. - - **Example: Using GEN_KW to estimate fault transmissibility multipliers** - - Previously enkf supported a datatype MULTFLT for estimating - fault transmissibility multipliers. This has now been - depreceated, as the functionality can be easily achieved with - the help of GEN_KW. In th enkf config file: - - :: - - GEN_KW MY-FAULTS MULTFLT.tmpl MULTFLT.INC MULTFLT.txt - - Here MY-FAULTS is the (arbitrary) key assigned to the fault - multiplers, MULTFLT.tmpl is the template file, which can look - like this: - - :: - - MULTFLT - 'FAULT1' / - 'FAULT2' / - / - - and finally the initial distribution of the parameters FAULT1 - and FAULT2 are defined in the file MULTFLT.txt: - - :: - - FAULT1 LOGUNIF 0.00001 0.1 - FAULT2 UNIFORM 0.00 1.0 - - The various prior distributions available for the ``GEN_KW`` - keyword are here :ref:`prior distributions available in ERT ` - - - Loading GEN_KW values from an external file - - The default use of the GEN_KW keyword is to let the ERT - application sample random values for the elements in the - GEN_KW instance, but it is also possible to tell ERT to load a - precreated set of data files, this can for instance be used as - a component in a experimental design based workflow. When - using external files to initialize the GEN_KW instances you - supply an extra keyword ``INIT_FILE:/path/to/priors/files%d`` - which tells where the prior files are: - - :: - - GEN_KW MY-FAULTS MULTFLT.tmpl MULTFLT.INC MULTFLT.txt INIT_FILES:priors/multflt/faults%d - - In the example above you must prepare files - priors/multflt/faults0, priors/multflt/faults1, - ... priors/multflt/faultsn which ert will load when you - initialize the case. The format of the GEN_KW input files can - be of two varieties: - - 1. The files can be plain ASCII text files with a list of numbers: - - :: - - 1.25 - 2.67 - - The numbers will be assigned to parameters in the order found in the MULTFLT.txt file. - - 2. Alternatively values and keywords can be interleaved as in: - - :: - - FAULT1 1.25 - FAULT2 2.56 - - in this case the ordering can differ in the init files and the parameter file. - - The heritage of the ERT program is based on the EnKF algorithm, and the EnKF algorithm evolves around Gaussian variables - internally the GEN_KW variables are assumed to be samples from the N(0,1) distribution, and the distributions specified in the parameters file are based on transformations starting with a N(0,1) distributed variable. The slightly awkward consequence of this is that to let your sampled values pass through ERT unmodified you must configure the distribution NORMAL 0 1 in the parameter file; alternatively if you do not intend to update the GEN_KW variable you can use the distribution RAW. - - -.. _gen_param: -.. topic:: GEN_PARAM - - The GEN_PARAM parameter type is used to estimate parameters which do not really fit into any of the other categories. As an example, consider the following situation: - - Some external Software (e.g. Cohiba) makes a large vector of random numbers which will serve as input to the forward model. (It is no requirement that the parameter set is large, but if it only consists of a few parameters the GEN_KW type will be easier to use.) - We want to update this parameter with enkf. - In the main configuration file the input for a GEN_PARAM instance is as follows: - - :: - - GEN_PARAM ID ECLIPSE_FILE INPUT_FORMAT:xx OUTPUT_FORMAT:xx INIT_FILES:/path/to/init/files%d (TEMPLATE:/template_file KEY:magic_string) - - here ID is the usual unique string identifying this instance and ECLIPSE_FILE is the name of the file which is written into the run directories. The three arguments GEN_PARAM, ID and ECLIPSE_FILE must be the three first arguments. In addition you must have three additional arguments, INPUT_FORMAT, OUTPUT_FORMAT and INIT_FILES. INPUT_FORMAT is the format of the files enkf should load to initialize, and OUTPUT_FORMAT is the format of the files enkf writes for the forward model. The valid values are: - - * ASCII - This is just text file with formatted numbers. - * ASCII_TEMPLATE - An plain text file with formatted numbers, and an arbitrary header/footer. - * BINARY_FLOAT - A vector of binary float numbers. - * BINARY_DOUBLE - A vector of binary double numbers. - - Regarding the different formats - observe the following: - - #. Except the format ASCII_TEMPLATE the files contain no header information. - #. The format ASCII_TEMPLATE can only be used as output format. - #. If you use the output format ASCII_TEMPLATE you must also supply a TEMPLATE:X and KEY:Y option. See documentation of this below. - #. For the binary formats files generated by Fortran can not be used - can easily be supported on request. - - **Regarding templates:** If you use OUTPUT_FORMAT:ASCII_TEMPLATE you must also supply the arguments TEMPLATE:/template/file and KEY:MaGiCKEY. The template file is an arbitrary existing text file, and KEY is a magic string found in this file. When enkf is running the magic string is replaced with parameter data when the ECLIPSE_FILE is written to the directory where the simulation is run from. Consider for example the follwing configuration: - - :: - - TEMPLATE:/some/file KEY:Magic123 - - The template file can look like this (only the Magic123 is special): - - :: - - Header line1 - Header line2 - ============ - Magic123 - ============ - Footer line1 - Footer line2 - - When enkf is running the string Magic123 is replaced with parameter values, and the resulting file will look like this: - - :: - - Header line1 - Header line2 - ============ - 1.6723 - 5.9731 - 4.8881 - ..... - ============ - Footer line1 - Footer line2 - -.. _surface: -.. topic:: SURFACE - - The SURFACE keyword can be used to work with surface from RMS in the irap format. The surface keyword is configured like this: - - :: - - SURFACE TOP OUTPUT_FILE:surf.irap INIT_FILES:Surfaces/surf%d.irap BASE_SURFACE:Surfaces/surf0.irap - - The first argument, TOP in the example above, is the identifier you want to use for this surface in ert. The OUTPUT_FILE key is the name of surface file which ERT will generate for you, INIT_FILES points to a list of files which are used to initialize, and BASE_SURFACE must point to one existing surface file. When loading the surfaces ERT will check that all the headers are compatible. An example of a surface IRAP file is: - - :: - - -996 511 50.000000 50.000000 - 444229.9688 457179.9688 6809537.0000 6835037.0000 - 260 -30.0000 444229.9688 6809537.0000 - 0 0 0 0 0 0 0 - 2735.7461 2734.8909 2736.9705 2737.4048 2736.2539 2737.0122 - 2740.2644 2738.4014 2735.3770 2735.7327 2733.4944 2731.6448 - 2731.5454 2731.4810 2730.4644 2730.5591 2729.8997 2726.2217 - 2721.0996 2716.5913 2711.4338 2707.7791 2705.4504 2701.9187 - .... - - The surface data will typically be fed into other programs like Cohiba or RMS. The data can be updated using e.g. the Smoother. - - **Initializing from the FORWARD MODEL** - - All the parameter types like FIELD,GEN_KW,GEN_PARAM and SURFACE can be initialized from the forward model. To achieve this you just add the setting FORWARD_INIT:True to the configuration. When using forward init the initialization will work like this: - - #. The explicit initialization from the case menu, or when you start a simulation, will be ignored. - #. When the FORWARD_MODEL is complete ERT will try to initialize the node based on files created by the forward model. If the init fails the job as a whole will fail. - #. If a node has been initialized, it will not be initialized again if you run again. [Should be possible to force this ....] - - When using FORWARD_INIT:True ERT will consider the INIT_FILES setting to find which file to initialize from. If the INIT_FILES setting contains a relative filename, it will be interpreted relativt to the runpath directory. In the example below we assume that RMS has created a file petro.grdecl which contains both the PERMX and the PORO fields in grdecl format; we wish to initialize PERMX and PORO nodes from these files: - - :: - - FIELD PORO PARAMETER poro.grdecl INIT_FILES:petro.grdecl FORWARD_INIT:True - FIELD PERMX PARAMETER permx.grdecl INIT_FILES:petro.grdecl FORWARD_INIT:True - - Observe that forward model has created the file petro.grdecl and the nodes PORO and PERMX create the ECLIPSE input files poro.grdecl and permx.grdecl, to ensure that ECLIPSE finds the input files poro.grdecl and permx.grdecl the forward model should contain a job which will copy/convert petro.grdecl -> (poro.grdecl,permx.grdecl), this job should not overwrite existing versions of permx.grdecl and poro.grdecl. This extra hoops is not strictly needed in all cases, but strongly recommended to ensure that you have control over which data is used, and that everything is consistent in the case where the forward model is run again. - - -.. _summary: -.. topic:: SUMMARY - - The SUMMARY keyword is used to add variables from the ECLIPSE summary file to the parametrization. The keyword expects a string, which should have the format VAR:WGRNAME. Here, VAR should be a quantity, such as WOPR, WGOR, RPR or GWCT. Moreover, WGRNAME should refer to a well, group or region. If it is a field property, such as FOPT, WGRNAME need not be set to FIELD. - - *Example:* - - :: - - -- Using the SUMMARY keyword to add diagnostic variables - SUMMARY WOPR:MY_WELL - SUMMARY RPR:8 - SUMMARY F* -- Use of wildcards requires that you have entered a REFCASE. - - The SUMMARY keyword has limited support for '*' wildcards, if your key contains one or more '*' characters all matching variables from the refcase are selected. Observe that if your summary key contains wildcards you must supply a refcase with the REFCASE key - otherwise it will fail hard. - - **Note:** Properties added using the SUMMARY keyword are only diagnostic. I.e., they have no effect on the sensitivity analysis or history match. - - -Keywords controlling the ES algorithm ------------------------------------------ -.. _keywords_controlling_the_es_algorithm: - -.. _enkf_alpha: -.. topic:: ENKF_ALPHA - -See the sub keyword :code:`OVERLAP_LIMIT` under the :code:`UPDATE_SETTINGS`keyword. - -.. _enkf_bootstrap: -.. topic:: ENKF_BOOTSTRAP - - Boolean specifying if we want to resample the Kalman gain matrix in the update step. The purpose is to avoid that the ensemble covariance collapses. When this keyword is true each ensemble member will be updated based on a Kalman gain matrix estimated from a resampling with replacement of the full ensemble. - - In theory and in practice this has worked well when one uses a small number of ensemble members. - - -.. _enkf_cv_folds: -.. topic:: ENKF_CV_FOLDS - - Integer specifying how many folds we should use in the Cross-Validation (CV) scheme. Possible choices are the integers between 2 and the ensemble size (2-fold CV and leave-one-out CV respectively). However, a robust choice for the number of CV-folds is 5 or 10 (depending on the ensemble size). - - *Example:* - - :: - - -- Setting the number of CV folds equal to 5 - ENKF_CV_FOLDS 5 - - Requires that the ENKF_LOCAL_CV keyword is set to TRUE - - -.. _enkf_force_ncomp: -.. topic:: ENKF_FORCE_NCOMP - - Bool specifying if we want to force the subspace dimension we want to use in the EnKF updating scheme (SVD-based) to a specific integer. This is an alternative to selecting the dimension using ENKF_TRUNCATION or ENKF_LOCAL_CV. - - *Example:* - - :: - - -- Setting the the subspace dimension to 2 - ENKF_FORCE_NCOMP TRUE - ENKF_NCOMP 2 - - - -.. _enkf_local_cv: -.. topic:: ENKF_LOCAL_CV - - Boolean specifying if we want to select the subspace dimension in the SVD-based EnKF algorithm using Cross-Validation (CV) [1]. This is a more robust alternative to selecting the subspace dimension based on the estimated singular values (See ENKF_TRUNCATION), because the predictive power of the estimated Kalman gain matrix is taken into account. - - *Example:* - - :: - - -- Select the subspace dimension using Cross-Validation - ENKF_LOCAL_CV TRUE - - - -.. _enkf_pen_press: -.. topic:: ENKF_PEN_PRESS - - Boolean specifying if we want to select the subspace dimension in the SVD-based EnKF algorithm using Cross-Validation (CV), and a penalised version of the predictive error sum of squares (PRESS) statistic [2]. This is recommended when overfitting is a severe problem (and when the number of ensemble members is small) - - *Example:* - - :: - - -- Select the subspace dimension using Cross-Validation - ENKF_LOCAL_CV TRUE - - -- Using penalised PRESS statistic - ENKF_PEN_PRESS TRUE - - - -.. _enkf_mode: -.. topic:: ENKF_MODE - - The ENKF_MODE keyword is used to select which EnKF algorithm to use. Use the value STANDARD for the original EnKF algorithm, or SQRT for the so-called square root scheme. The default value for ENKF_MODE is STANDARD. - - *Example A:* - - :: - - -- Using the square root update - ENKF_MODE SQRT - - *Example B:* - - :: - - -- Using the standard update - ENKF_MODE STANDARD - - The ENKF_MODE keyword is optional. - - -.. _enkf_merge_observations: -.. topic:: ENKF_MERGE_OBSERVATIONS - - If you use the ENKF_SCHED_FILE option to jump over several dates at a time you can choose whether you want to use all the observations in between, or just the final. If set to TRUE, all observations will be used. If set to FALSE, only the final observation is used. The default value for ENKF_MERGE_OBSERVATIONS is FALSE. - - *Example:* - - :: - - -- Merge observations - ENKF_MERGE_OBSERVATIONS TRUE - - -.. _enkf_ncomp: -.. topic:: ENKF_NCOMP - - Integer specifying the subspace dimension. Requires that ENKF_FORCE_NCOMP is TRUE. - -.. _enkf_rerun: -.. topic:: ENKF_RERUN - - This is a boolean switch - TRUE or FALSE. Should the simulation start from time zero after each update. - - - -.. _enkf_scaling: -.. topic:: ENKF_SCALING - - This is a boolean switch - TRUE (Default) or FALSE. If TRUE, we scale the data ensemble matrix to unit variance. This is generally recommended because the SVD-based EnKF algorithm is not scale invariant. - - -.. _enkf_truncation: -.. topic:: ENKF_TRUNCATION - - Truncation factor for the SVD-based EnKF algorithm (see Evensen, 2007). In this algorithm, the forecasted data will be projected into a low dimensional subspace before assimilation. This can substantially improve on the results obtained with the EnKF, especially if the data ensemble matrix is highly collinear (Saetrom and Omre, 2010). The subspace dimension, p, is selected such that - - :: - - \frac{\sum_{i=1}^{p} s_i^2}{\sum_{i=1}^r s_i^2} \geq \mathrm{ENKF\_TRUNCATION}, - - where si is the ith singular value of the centered data ensemble matrix and r is the rank of this matrix. This criterion is similar to the explained variance criterion used in Principal Component Analysis (see e.g. Mardia et al. 1979). - - The default value of ENKF_TRUNCATION is 0.99. If ensemble collapse is a big problem, a smaller value should be used (e.g 0.90 or smaller). However, this does not guarantee that the problem of ensemble collapse will disappear. Note that setting the truncation factor to 1.00, will recover the Standard-EnKF algorithm if and only if the covariance matrix for the observation errors is proportional to the identity matrix. - - -.. _std_scale_correlated_obs: -.. topic:: STD_SCALE_CORRELATED_OBS - - With this kewyord you can instruct ERT to use the simulated - data to estimate the correlations in the observations, and - then inflate the observation standard deviation as a way to - estimate the real information content in the observations. The - method is based on PCA, the scaling factor is calculated as: - - :: - - \sqrt{\frac{N_{\sigma}}{N_{\mathrm{obs}}} - - where $N_{\sigma}$ is the number of singular components, at - (fixed) truncation 0.95 and $N_{\mathrm{obs}}$ is the number - of observations. The STD_SCALE_CORRELATED_OBS keyword will - flatten all your observations, including temporal and spatial - correlations. For more fine grained control you can use the - STD_CALE_CORRELATED_OBS workflow job, or even write your own - plugins. - - - -.. _update_log_path: -.. topic:: UPDATE_LOG_PATH - - A summary of the data used for updates are stored in this directory. - - -**References** - -* Evensen, G. (2007). "Data Assimilation, the Ensemble Kalman Filter", Springer. -* Mardia, K. V., Kent, J. T. and Bibby, J. M. (1979). "Multivariate Analysis", Academic Press. -* Saetrom, J. and Omre, H. (2010). "Ensemble Kalman filtering with shrinkage regression techniques", Computational Geosciences (online first). - - -Analysis module ---------------- -.. _analysis_module: - -The final EnKF linear algebra is performed in an analysis module. The keywords to load, select and modify the analysis modules are documented here. - -.. _analysis_load: -.. topic:: ANALYSIS_LOAD - - The ANALYSIS_LOAD key is the main key to load an analysis module: - - :: - - ANALYSIS_LOAD ANAME analysis.so - - The first argument ANAME is just an arbitrary unique name which you want to use to refer to the module later. The second argument is the name of the shared library file implementing the module, this can either be an absolute path as /path/to/my/module/ana.so or a relative file name as analysis.so. The module is loaded with dlopen() and the normal shared library search semantics applies. - - -.. _analysis_select: -.. topic:: ANALYSIS_SELECT - - This command is used to select which analysis module to actually use in the updates: - - :: - - ANALYSIS_SELECT ANAME - - Here ANAME is the name you have assigned to the module when loading it with ANALYSIS_LOAD. - - -.. _analysis_set_var: -.. topic:: ANALYSIS_SET_VAR - - The analysis modules can have internal state, like e.g. truncation cutoff values, these values can be manipulated from the config file using the ANALYSIS_SET_VAR keyword: - - :: - - ANALYSIS_SET_VAR ANAME ENKF_TRUNCATION 0.97 - - To use this you must know which variables the module supports setting this way. If you try to set an unknown variable you will get an error message on stderr. - - -.. _analysis_copy: -.. topic:: ANALYSIS_COPY - - With the ANALYSIS_COPY keyword you can create a new instance of a module. This can be convenient if you want to run the same algorithm with the different settings: - - :: - - ANALYSIS_LOAD A1 analysis.so - ANALYISIS_COPY A1 A2 - - We load a module analysis.so and assign the name A1; then we copy A1 -> A2. The module A1 and A2 are now 100% identical. We then set the truncation to two different values: - - :: - - ANALYSIS_SET_VAR A1 ENKF_TRUNCATION 0.95 - ANALYSIS_SET_VAR A2 ENKF_TRUNCATION 0.98 - -**Developing analysis modules** - -In the analysis module the update equations are formulated based on familiar matrix expressions, and no knowledge of the innards of the ERT program are required. Some more details of how modules work can be found here modules.txt. In principle a module is 'just' a shared library following some conventions, and if you are sufficiently savy with gcc you can build them manually, but along with the ert installation you should have utility script ert_module which can be used to build a module; just write ert_module without any arguments to get a brief usage description. - -Advanced optional keywords --------------------------- -.. _advanced_optional_keywords: - -The keywords in this section, controls advanced features of the enkf application. Insight in the internals of the enkf application and/or ECLIPSE may be required to fully understand their effect. Moreover, many of these keywords are defined in the site configuration, and thus optional to set for the user, but required when installing the enkf application at a new site. - - -.. _add_fixed_length_schedule_kw: -.. topic:: ADD_FIXED_LENGTH_SCHEDULE_KW - - Real low level fix for some SCHEDULE parsing problems. - - -.. _define: -.. topic:: DEFINE - - With the DEFINE keyword you can define key-value pairs which will be substituted in the rest of the configuration file. The DEFINE keyword expects two arguments: A key and a value to replace for that key. Later instances of the key enclosed in '<' and '>' will be substituted with the value. The value can consist of several strings, in that case they will be joined by one single space. - - *Example:* - - :: - - -- Define ECLIPSE_PATH and ECLIPSE_BASE - DEFINE ECLIPSE_PATH /path/to/eclipse/run - DEFINE ECLIPSE_BASE STATF02 - DEFINE KEY VALUE1 VALUE2 VALUE3 VALUE4 - - -- Set the GRID in terms of the ECLIPSE_PATH - -- and ECLIPSE_BASE keys. - GRID /.EGRID - - Observe that when you refer to the keys later in the config file they must be enclosed in '<' and '>'. Furthermore, a key-value pair must be defined in the config file before it can be used. The final key define above KEY, will be replaced with VALUE1 VALUE2 VALUE3 VALUE4 - i.e. the extra spaces will be discarded. - - -.. _time_map: -.. topic:: TIME_MAP - - Normally the mapping between report steps and true dates is - inferred by ERT indirectly by loading the ECLIPSE summary - files. In cases where you do not have any ECLIPSE summary - files you can use the TIME_MAP keyword to specify a file with - dates which are used to establish this mapping: - - *Example:* - - :: - - -- Load a list of dates from external file: "time_map.txt" - TIME_MAP time_map.txt - - The format of the TIME_MAP file should just be a list of dates - formatted as dd/mm/yyyy. The example file below has four dates: - - :: - - 01/01/2000 - 01/07/2000 - 01/01/2001 - 01/07/2001 - - - -.. _schedule_prediction_file: -.. topic:: SCHEDULE_PREDICTION_FILE - - This is the name of a schedule prediction file. It can contain %d to get different files for different members. Observe that the ECLIPSE datafile should include only one schedule file, even if you are doing predictions. - - -Keywords related to running the forward model ---------------------------------------------- -.. _keywords_related_to_running_the_forward_model: - - - -.. _forward_model: -.. topic:: FORWARD_MODEL - - The FORWARD_MODEL keyword is used to define how the simulations are executed. E.g., which version of ECLIPSE to use, which rel.perm script to run, which rock physics model to use etc. Jobs (i.e. programs and scripts) that are to be used in the FORWARD_MODEL keyword must be defined using the INSTALL_JOB keyword. A set of default jobs are available, and by default FORWARD_MODEL takes the value ECLIPSE100. - - The FORWARD_MODEL keyword expects a series of keywords, each defined with INSTALL_JOB. The enkf will execute the jobs in sequentially in the order they are entered. Note that the ENKF_SCHED_FILE keyword can be used to change the FORWARD_MODEL for sub-sequences of the run. - - *Example A:* - - :: - - -- Suppose that "MY_RELPERM_SCRIPT" has been defined with - -- the INSTALL_JOB keyword. This FORWARD_MODEL will execute - -- "MY_RELPERM_SCRIPT" before ECLIPSE100. - FORWARD_MODEL MY_RELPERM_SCRIPT ECLIPSE100 - - *Example B:* - - :: - - -- Suppose that "MY_RELPERM_SCRIPT" and "MY_ROCK_PHYSICS_MODEL" - -- has been defined with the INSTALL_JOB keyword. - -- This FORWARD_MODEL will execute "MY_RELPERM_SCRIPT", then - -- "ECLIPSE100" and in the end "MY_ROCK_PHYSICS_MODEL". - FORWARD_MODEL MY_RELPERM_SCRIPT ECLIPSE100 MY_ROCK_PHYSICS_MODEL - - For advanced jobs you can pass string arguments to the job using a KEY=VALUE based approach, this is further described in: passing arguments. In available jobs in enkf you can see a list of the jobs which are available. - - -.. _job_script: -.. topic:: JOB_SCRIPT - - Running the forward model from enkf is a multi-level process which can be summarized as follows: - - #. A Python module called jobs.py is written and stored in the directory where the forward simulation is run. The jobs.py module contains a list of job-elements, where each element is a Python representation of the code entered when installing the job. - #. The enkf application submits a Python script to the enkf queue system, this script then loads the jobs.py module to find out which programs to run, and how to run them. - #. The job_script starts and monitors the individual jobs in the jobs.py module. - - The JOB_SCRIPT variable should point at the Python script which is managing the forward model. This should normally be set in the site wide configuration file. - - -.. _queue_system: -.. topic:: QUEUE_SYSTEM - - The keyword QUEUE_SYSTEM can be used to control where the - simulation jobs are executed. It can take the values LSF, - TORQUE, RSH and LOCAL. - - The LSF option will submit jobs to the LSF cluster at your - location, and is recommended whenever LSF is available. - - The TORQUE option will submit jobs to the TORQUE a torque - based system, using the commands qsub, qstat etc., if - available. - - If you do not have access to LSF or TORQUE you can submit to - your local workstation using the LOCAL option and to homemade - cluster of workstations using the RSH option. All of the queue - systems can be further configured, see separate sections. - - *Example:* - - :: - - -- Tell ert to use the LSF cluster. - QUEUE_SYSTEM LSF - - The QUEUE_SYSTEM keyword is optional, and usually defaults to - LSF (this is site dependent). - -Configuring LSF access ----------------------- -.. _configuring_lsf_access: - -The LSF system is the most useful of the queue alternatives, and also -the alternative with most options. The most important options are -related to how ert should submit jobs to the LSF system. Essentially -there are two methods ert can use when submitting jobs to the LSF -system: - -#. For workstations which have direct access to LSF ert can submit - directly with no further configuration. This is preferred solution, - but unfortunately not very common. -#. Alternatively ert can issue shell commands to bsub/bjobs/bkill to - submit jobs. These shell commands can be issued on the current - workstation, or alternatively on a remote workstation using ssh. - -The main switch between alternatives 1 and 2 above is the LSF_SERVER -option. - -.. _lsf_server: -.. topic:: LSF_SERVER - - By using the LSF_SERVER option you essentially tell ert two - things about how jobs should be submitted to LSF: - - #. You tell ert that jobs should be submitted using shell - commands. - #. You tell ert which server should be used when submitting - - So when your configuration file has the setting: - - :: - - LSF_SERVER be-grid01 - - ert will use ssh to submit your jobs using shell commands on - the server be-grid01. For this to work you must have - passwordless ssh to the server be-grid01. If you give the - special server name LOCAL ert will submit using shell commands - on the current workstation. - - **bsub/bjobs/bkill options** - - By default ert will use the shell commands bsub,bjobs and - bkill to interact with the queue system, i.e. whatever - binaries are first in your PATH will be used. For fine grained - control of the shell based submission you can tell ert which - programs to use: - - :: - - QUEUE_OPTION LSF BJOBS_CMD /path/to/my/bjobs - QUEUE_OPTION LSF BSUB_CMD /path/to/my/bsub - - *Example 1* - - :: - - LSF_SERVER be-grid01 - QUEUE_OPTION LSF BJOBS_CMD /path/to/my/bjobs - QUEUE_OPTION LSF BSUB_CMD /path/to/my/bsub - - In this example we tell ert to submit jobs from the - workstation be-grid01 using custom binaries for bsub and - bjobs. - - *Example 2* - - :: - - LSF_SERVER LOCAL - - In this example we will submit on the current workstation, - without using ssh first, and we will use the default bsub and - bjobs executables. The remaining LSF options apply - irrespective of which method has been used to submit the jobs. - - -.. _lsf_queue: -.. topic:: LSF_QUEUE - - The name of the LSF queue you are running ECLIPSE simulations in. - - -Configuring TORQUE access -------------------------- -.. _configuring_torque_access: - -The TORQUE system is the only available system on some clusters. The -most important options are related to how ert should submit jobs to -the TORQUE system. - -* Currently, the TORQUE option only works when the machine you are - logged into have direct access to the queue system. ert then submit - directly with no further configuration. - -The most basic invocation is in other words: - -:: - - QUEUE_SYSTEM TORQUE - -**qsub/qstat/qdel options** - -By default ert will use the shell commands qsub,qstat and qdel to -interact with the queue system, i.e. whatever binaries are first in -your PATH will be used. For fine grained control of the shell based -submission you can tell ert which programs to use: - -:: - - QUEUE_SYSTEM TORQUE - QUEUE_OPTION TORQUE QSUB_CMD /path/to/my/qsub - QUEUE_OPTION TORQUE QSTAT_CMD /path/to/my/qstat - QUEUE_OPTION TORQUE QDEL_CMD /path/to/my/qdel - -In this example we tell ert to submit jobs using custom binaries for -bsub and bjobs. - -**Name of queue** - -The name of the TORQUE queue you are running ECLIPSE simulations in. - -:: - - QUEUE_OPTION TORQUE QUEUE name_of_queue - -**Name of cluster (label)** - -The name of the TORQUE cluster you are running ECLIPSE simulations -in. This might be a label (serveral clusters), or a single one, as in -this example baloo. - -:: - - QUEUE_OPTION TORQUE CLUSTER_LABEL baloo - -**Max running jobs** - -The queue option MAX_RUNNING controls the maximum number of -simultaneous jobs submitted to the queue when using (in this case) the -TORQUE option in QUEUE_SYSTEM. - -:: - - QUEUE_SYSTEM TORQUE - -- Submit no more than 30 simultaneous jobs - -- to the TORQUE cluster. - QUEUE_OPTION TORQUE MAX_RUNNING 30 - -**Queue options controlling number of nodes and CPUs** - -When using TORQUE, you must specify how many nodes a single job is -should to use, and how many CPUs per node. The default setup in ert -will use one node and one CPU. These options are called NUM_NODES and -NUM_CPUS_PER_NODE. - -If the numbers specified is higher than supported by the cluster -(i.e. use 32 CPUs, but no node has more than 16), the job will not -start. - -If you wish to increase these number, the program running (typically -ECLIPSE) will usually also have to be told to correspondingly use more -processing units (keyword PARALLEL) - -:: - - QUEUE_SYSTEM TORQUE - -- Use more nodes and CPUs - -- in the TORQUE cluster per job submitted - -- This should (in theory) allow for 24 processing - -- units to be used by eg. ECLIPSE - QUEUE_OPTION TORQUE NUM_NODES 3 - QUEUE_OPTION TORQUE NUM_CPUS_PER_NODE 8 - -**Keep output from qsub** - -Sometimes the error messages from qsub can be useful, if something is -seriously wrong with the environment or setup. To keep this output -(stored in your home folder), use this: - -:: - - QUEUE_OPTION TORQUE KEEP_QSUB_OUTPUT 1 - - -** Slow submit to torque ** - -To be more gentle with the torqueue system you can instruct the driver -to sleep for every submit request. The argument to the SUBMIT_SLEEP is -the number of seconds to sleep for every submit, can be a fraction -like 0.5. - -:: - - QUEUE_OPTION TORQUE SUBMIT_SLEEP 0.25 - - -** Torque debug log ** - -You can ask the torqueu driver to store a debug log of the jobs -submitted, and the resulting job id. This is done with the queue -option DEBUG_OUTPUT: - -:: - - QUEUE_OPTION TORQUE DEBUG_OUTPUT torque_log.txt - - -Configuring the RSH queue -------------------------- -.. _configuring_the_rsh_queue: - -.. _rsh_host: -.. topic:: RSH_HOST - - You can run the forward model in enkf on workstations using remote-shell commands. To use the RSH queue system you must first set a list of computers which enkf can use for running jobs: - - :: - - RSH_HOST computer1:2 computer2:2 large_computer:8 - - Here you tell enkf that you can run on three different computers: computer1, computer2 and large_computer. The two first computers can accept two jobs from enkf, and the last can take eight jobs. Observe the following when using RSH: - - You must have passwordless login to the computers listed in RSH_HOST otherwise it will fail hard. enkf will not consider total load on the various computers; if have said it can take two jobs, it will get two jobs, irrespective of the existing load. - -.. _rsh_command: -.. topic:: RSH_COMMAND - - This is the name of the executable used to invoke remote shell operations. Will typically be either rsh or ssh. The command given to RSH_COMMAND must either be in PATH or an absolute path. - - :: - - MAX_RUNNING_RSH - - The keyword MAX_RUNNING_RSH controls the maximum number of simultaneous jobs running when using the RSH option in QUEUE_SYSTEM. It MAX_RUNNING_RSH exceeds the total capacity defined in RSH_HOST, it will automatically be truncated to that capacity. - - *Example:* - - :: - - -- No more than 10 simultaneous jobs - -- running via RSH. - MAX_RUNNING_RSH 10 - - - -Keywords related to plotting ----------------------------- -.. _keywords_related_to_plotting: - - -.. _plot_driver: -.. topic:: PLOT_DRIVER - - This is the name of the sub system used for creating plots. The default system is called 'PLPLOT' - all the other options regarding plotting are sub options which are only relevant when you are using PLPLOT. In addition to PLPLOT you can chose the value 'TEXT'; this will actually not produce any plots, just textfiles which can be used for plotting with your favorite plotting program. This is particularly relevant if you have some special requirements to the plots. - - -.. _plot_errorbar: -.. topic:: PLOT_ERRORBAR - - Should errorbars on the observations be plotted? - - -.. _plot_errorbar_max: -.. topic:: PLOT_ERRORBAR_MAX - - When plotting summary vectors for which observations have been 'installed' with the OBS_CONFIG keyword, ert will plot the observed values. If you have less than PLOT_ERRORBAR_MAX observations ert will use errorbars to show the observed values, otherwise it will use two dashed lines indicating +/- one standard deviation. This option is only meaningful when PLOT_PLOT_ERRORBAR is activated. - - To ensure that you always get errorbars you can set PLOT_ERRORBAR_MAX to a very large value, on the other hand setting PLOT_ERRORBAR_MAX to 0 will ensure that ert always plots observation uncertainty using dashed lines of +/- one standard deviation. - - The setting here will also affect the output when you are using the TEXT driver to plot. - - -.. _plot_height: -.. topic:: PLOT_HEIGHT - - When the PLPLOT driver creates a plot file, it will have the height (in pixels) given by the PLOT_HEIGHT keyword. The default value for PLOT_HEIGHT is 768 pixels. - - -.. _plot_refcase: -.. topic:: PLOT_REFCASE - - Boolean variable which is TRUE if you want to add the refcases to the plots. - - *Example:* - - :: - - PLOT_REFCASE TRUE - - - -.. refcase_list: -.. topic:: REFCASE_LIST - - Provide one or more Eclipse .DATA files for a refcase to be added in the plots. This refcase will be plotted in different colours. The summary files related to the refcase should be in the same folder as the refcase. - - *Example:* - - :: - - REFCASE_LIST /path/to/refcase1/file1.DATA /path/to/refcase2/file2.DATA - - - - - - -.. _plot_settings: -.. topic:: PLOT_SETTINGS - - The :code:`PLOT_SETTINGS` keyword is a "master keyword" which - can be used to configure some aspects of the plotting. These - settings will affect the default behaviour when you create a - new plot, you can still changes these settings interactively. - - When using the :code:`PLOT_SETTINGS` keyword you supply a - secondary keyword and a values as the tow arguments: - - :: - - PLOT_SETTINGS SHOW_REFCASE False - - Will make sure that your plots are created without the refcase - plotted as default. The available secondary keys are: - - SHOW_REFCASE : Default True - SHOW_HISTORY : Default True - - - - -.. _rft_config: -.. topic:: RFT_CONFIG - - RFT_CONFIGS argument is a file with the name of the rfts followed by date (day month year) Ex. - - :: - - RFT_CONFIG ../models/wells/rft/WELLNAME_AND_RFT_TIME.txt - - Where the contents of the file is something like - - :: - - be-linapp16(inmyr) -/models/wells/rft 34> more WELLNAME_AND_RFT_TIME.txt - A-1HP 06 05 1993 - A-9HW 31 07 1993 - C-1HP 11 12 2007 - C-5HP 21 12 1999 - C-6HR 09 11 1999 - D-4HP 10 07 2003 - K-3HW 09 02 2003 - K-6HW 08 11 2002 - K-7HW 21 04 2005 - D-6HP 22 04 2006 - - - -.. _rftpath: -.. topic:: RFTPATH - - - RFTPATHs argument is the path to where the rft-files are located - - :: - - RFTPATH ../models/wells/rft/ - - - - -.. _hook_workflow: -.. topic:: HOOK_WORKFLOW - -With the keyword :code:`HOOK_WORKFLOW` you can configure workflow -'hooks'; meaning workflows which will be run automatically at certain -points during ERTs execution. Currently there are four points in ERTs -flow of execution where you can hook in a workflow, before -the simulations start, :code:`PRE_SIMULATION`; after all the -simulations have completed :code:`POST_SIMULATION`; -before the update step, :code:`PRE_UPDATE` and after the update step, :code:`POST_UPDATE`. The -:code:`POST_SIMULATION` hook is typically used to trigger QC -workflows: - -:: - - HOOK_WORKFLOW initWFLOW PRE_SIMULATION - HOOK_WORKFLOW preUpdateWFLOW PRE_UPDATE - HOOK_WORKFLOW postUpdateWFLOW POST_UPDATE - HOOK_WORKFLOW QC_WFLOW1 POST_SIMULATION - HOOK_WORKFLOW QC_WFLOW2 POST_SIMULATION - - -In this example the workflow :code:`initWFLOW` will run after all -the simulation directories have been created, just before the forward -model is submitted to the queue. The workflow :code:`preUpdateWFLOW` will be run before the -update step and :code:`postUpdateWFLOW` will be run after the -update step. When all the simulations are complete -the two workflows :code:`QC_WFLOW1` and :code:`QC_WFLOW2` will be -run. - -Observe that the workflows being 'hooked in' with the -:code:`HOOK_WORKFLOW` must be loaded with the :code:`LOAD_WORKFLOW` -keyword. - -Currently, :code:`PRE_UPDATE` and :code:`POST_UPDATE` are only -available from python. - -Manipulating the Unix environment ---------------------------------- -.. _manipulating_the_unix_environment: - -The two keywords SETENV and UPDATE_PATH can be used to manipulate the Unix environment of the ERT process, tha manipulations only apply to the running ERT instance, and are not applied to the shell. - - -.. _setenv: -.. topic:: SETENV - - You can use the SETENV keyword to alter the unix environment enkf is running in. This is probably most relevant for setting up the environment for the external jobs invoked by enkf. - - *Example:* - - :: - - -- Setting up LSF - SETENV LSF_BINDIR /prog/LSF/7.0/linux2.6-glibc2.3-x86_64/bin - SETENV LSF_LIBDIR /prog/LSF/7.0/linux2.6-glibc2.3-x86_64/lib - SETENV LSF_UIDDIR /prog/LSF/7.0/linux2.6-glibc2.3-x86_64/lib/uid - SETENV LSF_SERVERDIR /prog/LSF/7.0/linux2.6-glibc2.3-x86_64/etc - SETENV LSF_ENVDIR /prog/LSF/conf - - Observe that the SETENV command is not as powerful as the corresponding shell utility. In particular you can not use $VAR to refer to the existing value of an environment variable. To add elements to the PATH variable it is easier to use the UPDATE_PATH keyword. - - -.. _update_path: -.. topic:: UPDATE_PATH - - The UPDATE_PATH keyword will prepend a new element to an existing PATH variable. I.e. the config - - :: - - UPDATE_PATH PATH /some/funky/path/bin - - will be equivalent to the shell command: - - :: - - setenv PATH /some/funky/path/bin:$PATH - - The whole thing is just a workaround because we can not use $PATH. - -.. _update_settings: -.. topic:: UPDATE_SETTINGS - -The :code:`UPDATE_SETTINGS` keyword is a *super-keyword* which can be -used to control parameters which apply to the Ensemble Smoother update -algorithm. The :code:`UPDATE_SETTINGS`currently supports the two -subkeywords: - - OVERLAP_LIMIT - Scaling factor used when detecting outliers. Increasing - this factor means that more observations will potentially be - included in the assimilation. The default value is 3.00.. - - Including outliers in the Smoother algorithm can dramatically - increase the coupling between the ensemble members. It is - therefore important to filter out these outlier data prior to - data assimilation. An observation, \textstyle d^o_i, will be - classified as an outlier if - - :: - - |d^o_i - \bar{d}_i| > \mathrm{ENKF\_ALPHA} \left(s_{d_i} + \sigma_{d^o_i}\right), - - where \textstyle\boldsymbol{d}^o is the vector of observed - data, \textstyle\boldsymbol{\bar{d}} is the average of the - forcasted data ensemble, \textstyle\boldsymbol{s_{d}} is the - vector of estimated standard deviations for the forcasted data - ensemble, and \textstyle\boldsymbol{s_{d}^o} is the vector - standard deviations for the observation error (specified a - priori). - - - STD_CUTOFF - If the ensemble variation for one particular measurment is - below this limit the observation will be deactivated. he - default value for this cutoff is 1e-6. - -Observe that for the updates many settings should be applied on the -analysis module in question. - - -.. _umask: -.. topic:: UMASK - - The `umask` is a concept used by Linux to controll the - permissions on newly created files. By default the files - created by ert will have the default permissions of your - account, but by using the keyword `UMASK` you can alter the - permissions of files created by ert. - - To determine the initial permissions on newly created files - start with the initial permissions `-rw-rw-rw-` (octal 0666) - for files and `-rwxrwxrwx` (octal 0777) for directories, and - then *~subtract* the current umask setting. So if you wish the - newly created files to have permissions `-rw-r-----` you need - to subtract write permissions for group and read and write - permissions for others - corresponding to `umask - 0026`. - - :: - - UMASK 0022 - - We remove write permissions from group and others, implying - that everyone can read the files and directories created by - ert, but only the owner can write to them. Also everyone can - execute the directories (i.e. list the content). - - :: - - UMASK 0 - - No permissions are removed, i.e. everyone can do everything - with the files and directories created by ert. - - The umask setting in ert is passed on to the forward model, - and should apply to the files/directories created by the - forward model also. However - the executables in the forward - model can in principle set it's own umask setting or alter - permissions in another way - so there is no guarantee that the - umask setting will apply to all files created by the forward - model. - - The octal permissions are based on three octal numbers for - owner, group and others, where each value is based on adding - the constants: - - 1: Execute permission - 2: Write permission - 4: Read permission - - So an octal permission of 0754 means: - - - Owner(7) can execute(1), write(2) and read(4). - - Group(5) can execute(1) and read(4). - - Others(2) can read(4) diff --git a/ThirdParty/Ert/docs/user/localization/index.rst b/ThirdParty/Ert/docs/user/localization/index.rst deleted file mode 100644 index 47ad720563..0000000000 --- a/ThirdParty/Ert/docs/user/localization/index.rst +++ /dev/null @@ -1,602 +0,0 @@ - -Keywords for the local configuration file -========================================= - - - -General overview ----------------- - -To create a configuration for localization you must "program" your own -local config commands by writing a Python script, and invoking it from a workflow. - - -**Local config python script example:** - -:: - - from ert.enkf import ErtScript - from ert.enkf import LocalConfig, LocalObsdata, LocalObsdataNode, LocalMinistep, LocalUpdateStep, LocalDataset, ActiveList - from ert.ecl import EclGrid, EclRegion, Ecl3DKW, EclFile, EclInitFile, EclKW, EclTypeEnum - - class LocalConfigJob(ErtScript): - - - def run(self): - - # This example can be used with the REEK data set from the ERT tutorial - - # Get the ert object - ert = self.ert() - - # Get local config object - local_config = ert.getLocalConfig() - - # Reset internal local config structure. From now you need to specify what to localize - local_config.clear() - - # There is only one update step - updatestep = local_config.getUpdatestep() - - # A ministep - ministep = local_config.createMinistep("MINISTEP" ) - - # Add some dataset you want to localize here. - dataset_multflt = local_config.createDataset("DATASET_MULTFLT") - - # Add some field and localize inside a box - data_poro = local_config.createDataset("DATA_PORO") - ecl_grid = local_config.getGrid() - ecl_region = EclRegion(ecl_grid, False) - ecl_region.select_box((0,0,0),(3,3,3)) - data_poro.addField("PORO", ecl_region) - - - # Add some index from MULTFLT to the dataset - dataset_multflt.addNode("MULTFLT") - active_list = dataset_multflt.getActiveList("MULTFLT") - active_list.addActiveIndex(0) - - # Add existing observations from WOPR:OP_1. Alternatively, use getObservations and filter the observations you want to use for this ministep. - obsdata_wopr = local_config.createObsdata("WOPR:OP_1_10") - for i in range(1,10): - obsdata_wopr.addNode("OBS"+str(i)) - - # Attach the created dataset and obsset to the ministep - ministep.attachDataset(dataset_multflt) - ministep.attachObsset(obsdata_wopr) - - # Then attach the ministep to the update step - updatestep.attachMinistep(ministep) - - # Write a .csv file for debugging. The generated file can be imported into Excel for better tabulation of the setup - local_config.writeSummaryFile("tmp/summary_local_config.csv") - -=========================================================================================== ============================================================================================================================================== -ERT script function Purpose -=========================================================================================== ============================================================================================================================================== -:ref:`getObservations ` Get the observations currently imported, use to filter the observations to localize -:ref:`getGrid ` Get the underlying grid use to define active cells in a field -:ref:`getUpdatestep ` Creates and gets default updatestep -:ref:`createMinistep ` Creates ministep -:ref:`createDataset ` Creates dataset -:ref:`copyDataset ` Deep copy of dataset -:ref:`createObsdata ` Creates observation set -:ref:`copyObsdata ` Deep copy of observation set -:ref:`attachMinistep ` Attaches ministep to update step -:ref:`attachDataset ` Attaches dataset to mini step -:ref:`attachObsset ` Attaches observation set to mini step -:ref:`addNode ` Adds data node to dataset -:ref:`del (data) ` Deletes observation node from dataset -:ref:`addNode, addNodeAndRange ` Adds observation node to observation set for all times or in a given time range -:ref:`del (obs) ` Deletes observation node from observation set -:ref:`clear ` Delete all the data keys from a dataset -:ref:`addActiveIndex (data) ` Adds several data indices to the list of active indices -:ref:`addActiveIndex (obs) ` Adds several observation indices to the list of active indices -:ref:`addField ` Adds field node to dataset -:ref:`EclGrid, EclInitFile ` Loads eclipse file in restart format -:ref:`EclRegion ` Creates a new region for use when defining active regions for fields -:ref:`select_active ` Selects or deselects cells in a region -:ref:`select_equal ` Selects or deselects cells in a region equal to given value -:ref:`select_less ` Selects or deselects cells in a region equal less than a given value -:ref:`select_more ` Selects or deselects cells in a region equal greater than a given value -:ref:`select_box ` Selects or deselects cells in a box -:ref:`select_islice, _jslice,_kslice ` Selects or deselects cells in a slice -:ref:`select_below_plane ` Selects or deselects cells in a half space defined by a plane -:ref:`select_inside_polygon ` Selects or deselects cells in region inside polygon -:ref:`Example create polygon ` Creates a geo-polygon based on coordinate list -:ref:`Example load polygon ` Loads polygon in Irap RMS format from file - -=========================================================================================== ============================================================================================================================================== - - -.. ########################################################################################################### - -.. _create_updatestep: -.. topic:: getUpdatestep - - | This function will create the default updatestep. - | Observe that you must get, otherwise it will not be able to do anything. - - *Example:* - - :: - - updatestep = local_config.getUpdatestep() - -.. ########################################################################################################### - -.. _all_obs: -.. topic:: getObservations - - | This function will retrieve ERT's observations - - *Example:* - - :: - - all_obs = local_config.getObservations() - -.. ########################################################################################################### - -.. _ert_grid: -.. topic:: getGrid - - | This function will retrieve ERT's grid - - *Example:* - - :: - - grid = local_config.getGrid() - -.. ########################################################################################################### - - -.. _create_ministep: -.. topic:: createMinistep - - | This function will create a new ministep with a given name and an optional analysis module. The default analysis module for this ministep is ERT's current analysis module. - | A given observation set can be attached to a given ministep with attachObsset.The ministep is then ready for adding data. Before the ministep can be used you must attach it to an updatestep with the attachMinistep command - - *Example:* - - :: - - ministep = local_config.createMinistep("MINISTEP") - - *Example:* - - :: - - analysis_config = ert.analysisConfig() - std_enkf_analysis_module = analysis_config.getModule("STD_ENKF") - ministep_using_std_enkf = local_config.createMinistep("MINISTEP", std_enkf_analysis_module) - - -.. ########################################################################################################### - -.. _create_dataset: -.. topic:: createDataset - - | This function will create a new dataset with a given name, i.e. a collection of enkf_nodes which should be updated together. Before you can actually use a dataset you must attach it to a ministep with the attachDataset command. - - - *Example:* - - :: - - dataset_multflt = local_config.createDataset("DATASET_MULTFLT") - -.. ########################################################################################################### - -.. _copy_dataset: -.. topic:: copyDataset - - | Will create a new local_obsset instance which is a copy of the - source dataset; this is a deep copy where also the lowest level active_list instances are copied, and can then subsequently be updated independently of each other. - - - *Example:* - - :: - - dataset_multflt_copy = local_config.copyDataset("DATASET_MULTFLT","DATASET_MULTFLT_COPY") - -.. ########################################################################################################### - -.. _create_obsset: -.. topic:: createObsdata - - | This function will create an observation set, i.e. a collection of observation keys which will be used as the observations in one ministep. Before the obsset can be used it must be attached to a ministep with the attachDataset command. - - - *Example:* - - :: - - obsset_obs_well = local_config.createObsdata("OBS_WELL") - - -.. ########################################################################################################### - -.. _copy_obsset: -.. topic:: copyObsdata - - | Will create a new local_obsset instance which is a copy of the - source dataset; this is a deep copy where also the lowest level active_list instances are copied, and can then subsequently be updated independently of each other. - - - *Example:* - - :: - - obsset_obs_well_copy = local_config.copyObsdata("OBS_WELL", "OBS_WELL_COPY") - -.. ########################################################################################################### - -.. _attach_ministep: -.. topic:: attachMinistep - - | This function will attach the ministep to the default updatestep. - - *Example:* - - :: - - update_step.attachMinistep(ministep) - - -.. ########################################################################################################### - -.. _attach_dataset: -.. topic:: attachDataset - - | Will attach the given dataset to the ministep. - - - *Example:* - - :: - - ministep.attachDataset(dataset_multflt) - - -.. ########################################################################################################### - -.. _attach_obsset: -.. topic:: attachObsset - - | Will attach the given obsset to the ministep. - - *Example:* - - :: - - ministep.attachObsset(obsset_obs_well) - - -.. ########################################################################################################### - -.. _add_data: -.. topic:: addNode - - | This function will add the data KEY as one enkf node which should be updated in this dataset. If you do not manipulate the KEY further with addActiveIndex, the KEY will be added as 'ALL_ACTIVE', i.e. all elements will be updated. - - - *Example:* - - :: - - dataset_multflt.addNode("MULTFLT") - -.. ########################################################################################################### - -.. _del_data: -.. topic:: del (data) - - | This function will delete the data 'KEY' from the dataset. - - - *Example:* - - :: - - del dataset_multflt["MULTFLT"] - - -.. ########################################################################################################### - -.. _add_obs: -.. topic:: addNode - - | This function will install the observation 'OBS_KEY' as an observation for this obsset - similarly to the addNode function. - - *Example:* - - :: - - -- The obsset has a time range - obsset_obs_well.addNodeAndRange("WOPR:OBS_WELL", 0, 1) - - -- All times are active - obsset_obs_well.addNode("WOPR:OBS_WELL") - - -.. ########################################################################################################### - -.. _del_obs: -.. topic:: del (obs) - - | This function will delete the obs 'OBS_KEY' from the obsset 'NAME_OF_OBSSET'. - - - *Example:* - - :: - - del obsset_obs_well["WOPR:OBS_WELL"] - - -.. ########################################################################################################### - -.. _dataset_del_all_data: -.. topic:: clear - - | This function will delete all the data keys from the dataset. - - *Example:* - - :: - - dataset_multflt.clear() - -.. ########################################################################################################### - -.. _active_list_add_data_index: -.. topic:: addActiveIndex (data) - - | This function will say that the data with name 'DATA_KEY' in dataset with name 'DATASTEP_NAME' should have the index 'INDEX' active. - - - *Example:* - - :: - - active_list = dataset_multflt.getActiveList("MULTFLT") - active_list.addActiveIndex(0); - -.. ########################################################################################################### - -.. _active_list_add_obs_index: -.. topic:: addActiveIndex (obs) - - | This function will say that the observation with name 'OBS_KEY' in obsset with name 'OBSSET_NAME' should have the index 'INDEX' active. - - *Example:* - - :: - - active_list = obsset_obs_well.getActiveList("WOPR:OBS_WELL") - active_list.addActiveIndex(0); - - -.. ########################################################################################################### - -.. _add_field: -.. topic:: addField - - | This function will install the node with name 'FIELD_NAME' in the dataset 'DATASET_NAME'. It will in addition select all the (currently) active cells in the region 'ECLREGION_NAME' as active for this field/ministep combination. The ADD_FIELD command is actually a shortcut of: ADD_DATA DATASET FIELD_NAME; followed by: ACTIVE_LIST_ADD_MANY_DATA_INDEX - - *Example:* - - :: - - # Load Eclipse grid - ecl_grid = EclGrid("path/to/LOCAL.GRDECL") - - with open("path/to/LOCAL.GRDECL","r") as fileH: - local_kw = Ecl3DKW.read_grdecl(ecl_grid, fileH, "LOCAL") - - # Define Eclipse region - eclreg_poro = EclRegion(ecl_grid, False) - eclreg_poro.select_more(local_kw, 1) - - # Create dataset and add field to dataset - data_poro = local_config.createDataset("DATA_PORO") - data_poro.addField("PORO", eclreg_poro) - - -.. ########################################################################################################### - -.. _load_file: -.. topic:: EclGrid, EclInitFile - - | This function will load an ECLIPSE file in restart format (i.e. restart file or INIT file), the keywords in this file can then subsequently be used in ECLREGION_SELECT_VALUE_XXX commands below. The 'KEY' argument is a string which will be used later when we refer to the content of this file. - - *Example:* - - :: - - # Load Eclipse grid and init file - ecl_grid = EclGrid("path/to/FULLMODEL.GRDECL") - refinit_file = EclInitFile(grid , "path/to/somefile.init") - -.. ########################################################################################################### - -.. _create_eclregion: -.. topic:: EclRegion - - | This function will create a new region 'ECLREGION_NAME', which can subsequently be used when defining active regions for fields. The second argument, SELECT_ALL, is a boolean value. If this value is set to true the region will start with all cells selected, if set to false the region will start with no cells selected. - - *Example:* - - :: - - # Define Eclipse region - eclreg_poro = EclRegion(ecl_grid, False) - -.. ########################################################################################################### - -.. _eclregion_select_all: -.. topic:: select_active - - | Will select all the cells in the region (or deselect if SELECT == FALSE). - - - *Example:* - - :: - - eclreg_poro.select_active() - - -.. ########################################################################################################### - -.. _eclregion_select_value_equal: -.. topic:: select_equal - - | This function will compare an ecl_kw instance loaded from file with a user supplied value, and select (or deselect) all cells which match this value. It is assumed that the ECLIPSE keyword is an INTEGER keyword, for float comparisons use the ECLREGION_SELECT_VALUE_LESS and ECLREGION_SELECT_VALUE_MORE functions. - - *Example:* - - :: - - # Load Eclipse grid - ecl_grid = EclGrid("path/to/LOCAL.GRDECL") - - with open("path/to/LOCAL.GRDECL","r") as fileH: - local_kw = Ecl3DKW.read_grdecl(ecl_grid, fileH, "LOCAL", ecl_type= EclTypeEnum.ECL_INT_TYPE) - - # Define Eclipse region - eclreg_poro = EclRegion(ecl_grid, False) - eclreg_poro.select_equal(local_kw, 1) - print 'GRID LOADED%s' % ecl_grid - print ecl_grid.getDims() - print local_kw.header - - - -.. ########################################################################################################### - -.. _eclregion_select_value_less: -.. topic:: select_less - - | This function will compare an ecl_kw instance loaded from disc with a numerical value, and select all cells which have numerical below the limiting value. The ecl_kw value should be a floating point value like e.g. PRESSURE or PORO. The arguments are just as for ECLREGION_SELECT_VALUE_EQUAL. - - *Example:* - - :: - - eclreg_poro.select_less(local_kw, 1) - - -.. ########################################################################################################### - -.. _eclregion_select_value_more: -.. topic:: select_more - - | This function will compare an ecl_kw instance loaded from disc with a numerical value, and select all cells which have numerical above the limiting value. The ecl_kw value should be a floating point value like e.g. PRESSURE or PORO. The arguments are just as for ECLREGION_SELECT_VALUE_EQUAL. - - - *Example:* - - :: - - eclreg_poro.select_more(local_kw, 1) - -.. ########################################################################################################### - -.. _eclregion_select_box: -.. topic:: select_box - - | This function will select (or deselect) all the cells in the box defined by the six coordinates i1 i2 j1 j2 k1 k2. The coordinates are inclusive, and the counting starts at 1. - - - *Example:* - - :: - - eclreg_poro.select_box((0,2,4),(1,3,5)) - - - -.. ########################################################################################################### - -.. _eclregion_select_slice: -.. topic:: select_islice, _jslice,_kslice - - | This function will select a slice in the direction given by 'dir', which can 'x', 'y' or 'z'. Depending on the value of 'dir' the numbers n1 and n2 are interpreted as (i1 i2), (j1 j2) or (k1 k2) respectively. The numbers n1 and n2 are inclusice and the counting starts at 1. It is OK to use very high/low values to imply "the rest of the cells" in one direction. - - - *Example:* - - :: - - eclreg_poro.select_kslice(2,3) - - -.. ########################################################################################################### - -.. _eclregion_select_plane: -.. topic:: select_below_plane - - | Will select all points which have positive (sign > 0) distance to the plane defined by normal vector n = (nx,ny,nz) and point p = (px,py,pz). If sign < 0 all cells with negative distance to plane will be selected. - - *Example:* - - :: - - eclreg_poro.select_below_plane((1,1,1),(0,0,0)) - - -.. ########################################################################################################### - -.. _eclregion_select_in_polygon: -.. topic:: select_inside_polygon - - | Well select all the points which are inside the polygon with name 'POLYGON_NAME'. The polygon should have been created with command CREATE_POLYGON or loaded with command 'LOAD_POLYGON' first. - - - - *Example:* - - :: - - polygon = [(0,0) , (0,1) , (1,0)] - eclreg_poro.select_inside_polygon(polygon) - -.. ########################################################################################################### - -.. _create_polygon: -.. topic:: Example create polygon - - | Will create a geo_polygon instance based on the coordinate list: (x1,y1), (x2,y2), (x3,y3), ... The polygon should not be explicitly closed - i.e. you should in general have (x1,y1) != (xn,yn). The polygon will be stored under the name 'POLYGON_NAME' - which should later be used when referring to the polygon in region select operations. - - - - *Example:* - - :: - - polygon = [(0,0) , (0,1) , (1,0)] - -.. ########################################################################################################### - -.. _load_polygon: -.. topic:: Example load polygon - - | Will load a polygon instance from the file 'FILENAME' - the file should be in irap RMS format. The polygon will be stored under the name 'POLYGON_NAME' which can then later be used to refer to the polygon for e.g. select operations. - - - *Example:* - - :: - - polygon = [] - with open("polygon.ply","r") as fileH: - for line in fileH.readlines(): - tmp = line.split() - polygon.append( (float(tmp[0]) , float(tmp[1]))) - - diff --git a/ThirdParty/Ert/docs/user/magic_strings/index.rst b/ThirdParty/Ert/docs/user/magic_strings/index.rst deleted file mode 100644 index 9252b0a1aa..0000000000 --- a/ThirdParty/Ert/docs/user/magic_strings/index.rst +++ /dev/null @@ -1,30 +0,0 @@ -.. _ert_magic_strings_full_doc: - -Magic Strings -=================================== - -Magic strings are special keywords that can be used in configuration files and templates which have special meanings. - -ERT Config ----------- - -These magic strings are available in the ERT config file. - -**** - -Inserts the config file name with extension into the config file. - -:: - - ENSPATH storage//ensemble - -If the config file is named *config.ert* then the resulting storage path will be: - -:: - - storage/config.ert/ensemble - - -**** - -Same as but inserts the config file name without the extension into the config file. diff --git a/ThirdParty/Ert/docs/user/observations/index.rst b/ThirdParty/Ert/docs/user/observations/index.rst deleted file mode 100644 index 47c019dafc..0000000000 --- a/ThirdParty/Ert/docs/user/observations/index.rst +++ /dev/null @@ -1,463 +0,0 @@ -Configuring observations for ERT -================================ - -General overview ----------------- - -When using ERT to condition on dynamic data, it is necessary to -specify which data to condition on. In particular, for a given piece -of data to condition on, the ERT application needs to know: - - - The actual measured value of the data. - - The uncertainty of the measured data. - - The time of measurement. - - How to simulate a response of the data given a parametrized ECLIPSE model. - - -To provide this observation to ERT, an observation file must be -created. The observation file is a plain text file, and is in essence -built around for different classes of observations and has an -associated keyword for each class: - - - Well or group rates from an existing ECLIPSE reference case: The - HISTORY_OBSERVATION keyword. - - - Well logs, RFTS and PLTs: The BLOCK_OBSERVATION keyword. - - - Separator tests, region pressures, etc.: The SUMMARY_OBSERVATION - keyword. - - - Exotic observations (e.g. data from 4D seismic): The - GENERAL_OBSERVATION keyword. - - -The HISTORY_OBSERVATION keyword -------------------------------- - -The keyword HISTORY_OBSERVATION is used to condition on observations -from the WCONHIST and WCONINJH keywords in schedule file provided to -the enkf project (or alternatively an ECLIPSE summary file if you have -changed the HISTORY_SOURCE keyword in the enkf project). The keyword -is typically used to condition on production and injection rates for -groups and wells, as well as bottom hole and tubing head pressures. An -observation entered with the HISTORY_OBSERVATION keyword will be -active at all report steps where data for the observation can be -found. - -In it's simplest form, a history observation is created as follows:: - - HISTORY_OBSERVATION WOPR:P1; - -This will condition on WOPR in well P1 using a default observation -error. The default observation error is a relative error of 10% to the -measurement with a minimum error of 0.10. See below on how explicitly -set the error. - -In general, to condition on variable VAR in well or group WGNAME, one -uses:: - - HISTORY_OBSERVATION VAR:WGNAME; - -Note that there must be a colon ":" between VAR and WGNAME and that -the statement shall end with a semi-colon ";". Thus, to condition on -WOPR, WWCT and WGOR in well C-17, and for the GOPR for the whole -field, one would add the following to the observation configuration:: - - HISTORY_OBSERVATION WOPR:C-17; - HISTORY_OBSERVATION WWCT:C-17; - HISTORY_OBSERVATION WGOR:C-17; - - HISTORY_OBSERVATION GOPR:FIELD; - -By default, the observation error is set to 10% of the observed value, -with a minimum of 0.10. It can be changed as follows:: - - HISTORY_OBSERVATION GOPR:FIELD - { - ERROR = 1000; - ERROR_MODE = ABS; - }; - -This will set the observation error to 1000 for all observations of -GOPR:FIELD. Note that both the items ERROR and ERROR_MODE as well as -the whole definition shall end with a semi-colon. - -The item ERROR_MODE can take three different values: ABS, REL or -RELMIN. If set to REL, all observation errors will be set to the -observed values multiplied by ERROR. Thus, the following will -condition on water injection rate for the whole field with 20% -observation uncertainity:: - - HISTORY_OBSERVATION GWIR:FIELD - { - ERROR = 0.20; - ERROR_MODE = REL; - }; - -If you do not want the observation error to drop below a given -threshold, say 100, you can use RELMIN and the keyword ERROR_MIN:: - - HISTORY_OBSERVATION GWIR:FIELD - { - ERROR = 0.20; - ERROR_MODE = RELMIN; - ERROR_MIN = 100; - }; - -Note that the configuration parser does not threat carriage return -different from space. Thus, the following statement is equivalent to -the previous:: - - HISTORY_OBSERVATION GWIR:FIELD { ERROR = 0.20; ERROR_MODE = RELMIN; ERROR_MIN = 100; }; - - -Also note that the special keyword include can be used to read an -external file. This can be very useful if you want to change the -standard configuration for a lot of observations in one go. For -example, consider the following code:: - - HISTORY_OBSERVATION WOPR:P1 { include "hist_obs_wells.txt"; }; - HISTORY_OBSERVATION WOPR:P2 { include "hist_obs_wells.txt"; }; - HISTORY_OBSERVATION WOPR:P3 { include "hist_obs_wells.txt"; }; - HISTORY_OBSERVATION WOPR:P4 { include "hist_obs_wells.txt"; }; - HISTORY_OBSERVATION WOPR:P5 { include "hist_obs_wells.txt"; }; - -Where the contents of the file hist_obs_wells.txt may be something -like:: - - ERROR_MODE = RELMIN; - ERROR = 0.25; - ERROR_MIN = 100; - -In this case, changing the file hist_obs_wells.txt will affect all of -the observations. - -Note that the keyword include can be used anywhere in the -configuration file. However, nested inclusion (use of include in a -file that has already been included with include) is not allowed. - -By default, an observation entered with the HISTORY_OBSERVATION -keyword will get the observed values, i.e. the 'true' values, from the -WCONHIST and WCONINJH keywords in the schedule file provided to the -ERT project. However it also possible to get the observed values from -a reference case. In that case you must set set HISTORY_SOURCE -variable in the ERT configuration file, see Creating a configuration -file for ERT. - -To change the observation error for a HISTORY_OBSERVATION for one or -more segments of the historic period, you can use the SEGMENT -keyword. For example:: - - HISTORY_OBSERVATION GWIR:FIELD - { - ERROR = 0.20; - ERROR_MODE = RELMIN; - ERROR_MIN = 100; - - SEGMENT FIRST_YEAR - { - START = 0; - STOP = 10; - ERROR = 0.50; - ERROR_MODE = REL; - }; - - SEGMENT SECOND_YEAR - { - START = 11; - STOP = 20; - ERRROR = 1000; - ERROR_MODE = ABS; - }; - }; - -The items START and STOP sets the start and stop of the segment in -terms of ECLIPSE restart steps. The keywords ERROR, ERROR_MODE and -ERROR_MIN behaves like before. If the segments overlap, they are -computed in alphabetical order. Error covariance for "merged" updates - -When merging the historical observations from several report steps -together in one update the different steps are not independent, and it -is beneficial to use a error covariance matrix, by using the keywords -AUTO_CORRF and AUTO_CORRF_PARAM ERT will automatically estimate a -error-covariance matrix based on the auto correlation function -specified by the AUTO_CORRF keyword, with the parameter given by the -AUTO_CORRF_PARAM parameter (i.e. the auto correlation length). The -currently available auto correlation functions are: - - EXP ~ exp(-x) - GAUSS ~ exp(-x*x/2) - -where the parameter x is given as: - - x = (t2 - t1) / AUTO_CORRF_PARAM - - -The SUMMARY_OBSERVATION keyword -------------------------------- - -The keyword SUMMARY_OBSERVATION can be used to condition on any -observation whos simulated value is written to the ECLIPSE summary -file, e.g. well rates, region properties, group and field rates etc. A -quite typical usage of SUMMARY_OBSERVATION is to condition on the -results of a separator test. - -Note: Although it is possible to condition on well and group rates -with SUMMARY_OBSERVATION, it is usually easier to use -HISTORY_OBSERVATION for this. - -In order to create a summary observation, four pieces of information -are needed: The observed value, the observation error, the time of -observation and a summary key. A typical summary observation is -created as follows:: - - SUMMARY_OBSERVATION SEP_TEST_2005 - { - VALUE = 100; - ERROR = 5; - DATE = 21/08/2005; - KEY = GOPR:BRENT; - }; - -This will create an observation of group oil production for the brent -group on 21th of august 2005. The observed value was 100 with a -standard deviation of 5. The name SEP_TEST_2005 will be used as a -label for the observation within the ERT and must be unique. - -Similarly to the name of a HISTORY_OBSERVATION, the item KEY in a -SUMMARY_OBSERVATION is used to look up the simulated value from the -summary file. And again, as when declaring a HISTORY_OBSERVATION, to -condition on VAR in well, group or region WGRNAME, one uses:: - - KEY = VAR:WGRNAME; - -For example, to condition on RPPW in region 8, one uses:: - - KEY = RPPW:8; - -It is also possible to give the observation time as a restart number -using the RESTART item or as time in days from simulation start using -the DAYS item. Here are two examples:: - - -- Giving the observation time in terms of restart number. - SUMMARY_OBSERVATION SEP_TEST_2005 - { - VALUE = 100; - ERROR = 5; - RESTART = 42; - KEY = GOPR:BRENT; - }; - - - -- Giving the observation time in terms of days - -- from simulation start. - SUMMARY_OBSERVATION SEP_TEST_2008 - { - VALUE = 213; - ERROR = 10; - DAYS = 911; - KEY = GOPR:NESS; - }; - - - -The BLOCK_OBSERVATION keyword ------------------------------- - -This is observations of variables in grid blocks/cells. The -observations can be of arbitrary ECLIPSE fields like PRESSURE -(typically for an RFT), PORO or PERM. A block observation is entered -with the BLOCK_OBSERVATION keyword. Here is an example of a typical -block observation:: - - BLOCK_OBSERVATION RFT_2006 - { - FIELD = PRESSURE; - DATE = 22/10/2006; - - OBS P1 { I = 1; J = 1; K = 1; VALUE = 100; ERROR = 5; }; - OBS P2 { I = 2; J = 2; K = 1; VALUE = 101; ERROR = 5; }; - OBS P3 { I = 2; J = 3; K = 1; VALUE = 102; ERROR = 5; }; - }; - -This will condition on observations of the pressure in grid blocks -(1,1,1), (2,2,1) and (2,3,1) on the 22/10/2006. - -By default the BLOCK_OBSERVATION requires that the specific field -which has been observed (e.g. PRESSURE in the example above) must have -been specified in main ERT configuration file using the FIELD keyword, -and ECLIPSE must be configured to produce a restart file for this -particular time. Alternatively it is possible to tell ERT to use the -summary vector as source of the data:: - - BLOCK_OBSERVATION RFT_2006 - { - FIELD = PRESSURE; - DATE = 22/10/2006; - SOURCE = SUMMARY; - - OBS P1 { I = 1; J = 1; K = 1; VALUE = 100; ERROR = 5; }; - OBS P2 { I = 2; J = 2; K = 1; VALUE = 101; ERROR = 5; }; - OBS P3 { I = 2; J = 3; K = 1; VALUE = 102; ERROR = 5; }; - }; - -In this case the data will be loaded from the BPR vectors in the -summary file. - -Note the use of the sub class OBS to specify the actUal observed -values, the observation errors and their grid location. Each OBS shall -have a unique key within the BLOCK_OBSERVATION instance, and is -required to have the items I, J, K, VALUE and ERROR. These are the -grid i,j and k indicies for the observation point, the observed value -and it's standard deviation. - -As with a SUMMARY_OBSERVATION, the observation time can be given as -either a date, days since simulation start or restart number. The -respective keys for setting giving it as date, days or restart number -are DATE, DAYS and RESTART. Note that each BLOCK_OBSERVATION instance -must have an unique global name (RFT_2006 in the example above). - -Block observations can often be quite long. Thus, it is often a good -idea to use the special keyword include in order to store the OBS -structures in a different file. This is done as follows:: - - BLOCK_OBSERVATION RFT_2006 - { - FIELD = PRESSURE; - RESTART = 20; - - include 'RFT_2006_OBS_DATA.txt'; - }; - -Where the file RFT_2006_OBS_DATA.txt contains the OBS instances:: - - OBS P1 { I = 1; J = 1; K = 1; VALUE = 100; ERROR = 5; }; - OBS P2 { I = 2; J = 2; K = 1; VALUE = 101; ERROR = 5; }; - OBS P3 { I = 2; J = 3; K = 1; VALUE = 112; ERROR = 5; }; - OBS P4 { I = 3; J = 3; K = 1; VALUE = 122; ERROR = 5; }; - OBS P5 { I = 4; J = 3; K = 1; VALUE = 112; ERROR = 5; }; - OBS P6 { I = 5; J = 3; K = 1; VALUE = 122; ERROR = 5; }; - - - -The GENERAL_OBSERVATION keyword --------------------------------- - -The GENERAL_OBSERVATION keyword is used together with the GEN_DATA and -GEN_PARAM type. This pair of observation and data types are typically -used when you want to update something special which does not fit into -any of the predefined enkf types. The ERT application just treats -GENERAL_OBSERVATION (and also GEN_DATA) as a range of number with no -particular structure, this is very flexible, but of course also a bit -more complex to use:: - - GENERAL_OBSERVATION GEN_OBS1{ - DATA = SOME_FIELD; - RESTART = 20; - OBS_FILE = some_file.txt; - }; - -This example a minimum GENERAL_OBSERVATION. The keyword DATA points to -the GEN_DATA instance this observation is 'observing', RESTART gives -the report step when this observation is active. OBS_FILE should be -the name of a file with observation values, and the corresponding -uncertainties. The file with observations should just be a plain text -file with numbers in it, observations and corresponding uncertainties -interleaved. An example of an OBS_FILE:: - - 1.46 0.26 - 25.0 5.0 - 5.00 1.00 - -This OBS_FILE has three observations: 1.46 +/- 0.26, 25.0 +/- 5.0 and -5.00 +/- 1.00. In the example above it is assumed that the DATA -instance we are observing (i.e. comparing with) has the same number of -elements as the observation, i.e. three in this case. By using the -keywords INDEX_LIST or INDEX_FILE you can select the elements of the -GEN_DATA instance you are interested in. Consider for example:: - - GENERAL_OBSERVATION GEN_OBS1{ - DATA = SOME_FIELD; - INDEX_LIST = 0,3,9; - RESTART = 20; - OBS_FILE = some_file.txt; - }; - -Here we use INDEX_LIST to indicate that we are interested in element -0,3 and 9 of the GEN_DATA instance:: - - GEN_DATA GEN_OBS1 - ======== =========== - 1.56 <---------------------> 1.46 0.26 - 23.0 /--------------> 25.0 5.00 - 56.0 | /---------> 5.00 1.00 - 27.0 <------/ | =========== - 0.2 | - 1.56 | - 1.78 | - 6.78 | - 9.00 | - 4.50 <-----------/ - ======== - -In addition to INDEX_LIST it is possible to use INDEX_FILE which -should just point at an plain text file with indexes (without any ',' -or anything). Finally, if your observation only has one value, you can -embed it in the config object with VALUE and ERROR. - -Matching GEN_OBS and GEN_DATA -............................. - -It is important to match up the GEN_OBS observations with the -corresponding GEN_DATA simulation data correctly. The GEN_DATA result -files must have an embedded '%d' to indicate the report step in them - -in the case of smoother based workflows the actual numerical value -here is not important. To ensure that GEN_OBS and corresponding -GEN_DATA values match up correctly only the RESTART method is allowed -for GEN_OBS when specifying the time. So consider a setup like this:: - - -- Config file: - GEN_DATA RFT_BH67 INPUT_FORMAT:ASCII RESULT_FILE:rft_BH67_%d REPORT_STEPS:20 - ... /|\ /|\ - ... | | - -- Observation file: | | - GENERAL_OBSERVATION GEN_OBS1{ +------------------/ - DATA = RFT_BH67; | - RESTART = 20; <------------------------------------/ - OBS_FILE = some_file.txt; - }; - -Here we see that the observation is active at report step 20, and we -expect the forward model to create a file rft_BH67_20 in each -realization directory. Error covariance - -The optional keyword ERROR_COVAR can be used to point to an existing -file, containing an error covariance matrix. The file should contain -the elements of the matrix as formatted numbers; newline formatting is -allowed but not necessary. Since the matrix should by construction be -symmetric there is no difference between column-major and row-major -order! The covariance matrix - - [ 1 0.75 -0.25] -C = [ 0.75 1.25 -0.50] - [-0.25 -0.50 0.85] - -Can be represented by the file:: - - 1 - 0.75 - -0.25 - 0.75 - 1.25 - -0.50 - -0.25 - -0.50 - 0.85 - -without newlines, or alternatively:: - - 1 0.75 -0.25 - 0.75 1.25 -0.50 - -0.25 -0.50 0.85 - -with newlines. diff --git a/ThirdParty/Ert/docs/user/tutorial/index.rst b/ThirdParty/Ert/docs/user/tutorial/index.rst deleted file mode 100644 index fdcc65dfe1..0000000000 --- a/ThirdParty/Ert/docs/user/tutorial/index.rst +++ /dev/null @@ -1,3 +0,0 @@ -ERT Tutorial -============ -Tutorial for ert diff --git a/ThirdParty/Ert/docs/user/workflows/built_in.rst b/ThirdParty/Ert/docs/user/workflows/built_in.rst deleted file mode 100644 index 60edeb4fa9..0000000000 --- a/ThirdParty/Ert/docs/user/workflows/built_in.rst +++ /dev/null @@ -1,401 +0,0 @@ -.. _built_in_workflow_jobs: - -Built in workflow jobs -====================== - - -ERT comes with a list of default workflow jobs which invoke internal -ERT functionality. The internal workflows include: - -Jobs related to case management -------------------------------- - -**SELECT_CASE** - -The job SELECT_CASE can be used to change the currently selected -case. The SELECT_CASE job should be used as: - -:: - - SELECT_CASE newCase - -if the case newCase does not exist it will be created. - -**CREATE_CASE** - -The job CREATE_CASE can be used to create a new case without selecting -it. The CREATE_CASE job should be used as: - -:: - - CREATE_CASE newCase - - -**INIT_CASE_FROM_EXISTING** - -The job INIT_CASE_FROM_EXISTING can be used to initialize a case from -an existing case. The argument to the workflow should be the name of -the workflow you are initializing from; so to initialize the current -case from the existing case "oldCase": - -:: - - INIT_CASE_FROM_EXISTING oldCase - -By default the job will initialize the 'current case', but optionally -you can give the name of a second case which should be initialized. In -this example we will initialize "newCase" from "oldCase": - -:: - - INIT_CASE_FROM_EXISTING oldCase newCase - -When giving the name of a second case as target for the initialization -job the 'current' case will not be affected. - - -Jobs related to export ----------------------- - -**EXPORT_FIELD** - -The EXPORT_FIELD workflow job exports field data to roff or grdecl -format dependent on the extension of the export file argument.The job -takes the following arguments: - -#. Field to be exported -#. Filename for export file, must contain %d -#. Report_step -#. Realization range - -The filename must contain a %d. This will be replaced with the -realization number. - -The realization range parameter is optional. Default is all -realizations. - - -Example use of this job in a workflow: - -:: - - EXPORT_FIELD PERMZ path_to_export/filename%d.grdecl 0 0,2 - -**EXPORT_FIELD_RMS_ROFF** - -The EXPORT_FIELD_RMS_ROFF workflow job exports field data to roff -format. The job takes the following arguments: - -#. Field to be exported -#. Filename for export file, must contain %d -#. Report_step -#. Realization range - -The filename must contain a %d. This will be replaced with the -realization number. - -The realization range parameter is optional. Default is all realizations. - - -Example uses of this job in a workflow: - -:: - - EXPORT_FIELD_RMS_ROFF PERMZ path_to_export/filename%d.roff 0 - EXPORT_FIELD_RMS_ROFF PERMX path_to_export/filename%d 0 0-5 - - -**EXPORT_FIELD_ECL_GRDECL** - -The EXPORT_FIELD_ECL_GRDECL workflow job exports field data to grdecl -format. The job takes the following arguments: - -#. Field to be exported -#. Filename for export file, must contain %d -#. Report_step -#. Realization range - -The filename must contain a %d. This will be replaced with the realization number. - -The realization range parameter is optional. Default is all realizations. - - -Example uses of this job in a workflow: - -:: - - EXPORT_FIELD_ECL_GRDECL PERMZ path_to_export/filename%d.grdecl 0 - EXPORT_FIELD_ECL_GRDECL PERMX path_to_export/filename%d 0 0-5 - - -**EXPORT_RUNPATH** - -The EXPORT_RUNPATH workflow job writes the runpath file RUNPATH_FILE -for the selected case. - -The job can have no arguments, or one can set a range of realizations -and a range of iterations as arguments. - -Example uses of this job in a workflow: - -:: - - EXPORT_RUNPATH - -With no arguments, entries for all realizations are written to the -runpath file. If the runpath supports iterations, entries for all -realizations in iter0 are written to the runpath file. - -:: - - EXPORT_RUNPATH 0-5 | * - -A range of realizations and a range of iterations can be given. "|" is -used as a delimiter to separate realizations and iterations. "*" can -be used to select all realizations or iterations. In the example -above, entries for realizations 0-5 for all iterations are written to -the runpath file. - - -Jobs related to analysis update -------------------------------- - -**ANALYSIS_UPDATE** - -This job will perform a update and store the updated parameters as -initial parameters of a different case. The name of the source case -and the target case must be given as arguments: - -:: - - ANALYSIS_UPDATE prior posterior - -Will fetch prior parameters and simulated responses from the -case:`prior` and store updated parameters in the case:`posterior`. If -you have configured local updates that will be respected, otherwise -all available data will be used - and all parameters will be updated. - - -Jobs related to running simulations - including updates -------------------------------------------------------- - -**RUN_SMOOTHER** - -The RUN_SMOOTHER job will run a simulation and perform an update. The -job has one required argument - the name of a case where the updated -parameters are stored. Optionally the job can take a second boolean -argument, if the second argument is set to true the job will rerun -based on the updated parameters. - -Run a simulation and an update. Store the updated parameters in the -specified case. This case is created if it does not exist: - -:: - - RUN_SMOOTHER new_case - - -Run a simulation and an update. Store the updated parameters in the -specified case, then run a simulation on this case: - -:: - - RUN_SMOOTHER new_case true - - - -**RUN_SMOOTHER_WITH_ITER** - -This is exactly like the RUN_SMOOTHER job, but it has an additional -first argumeent iter which can be used to control the iter number in -the RUNPATH. When using the RUN_SMOOTHER job the iter number will be -defaultetd to zero, and one in the optional rerun. - -**ENSEMBLE_RUN** - -The ENSEMBLE_RUN job will run a simulation, no update. The job take as -optional arguments a range and/or list of which realizations to run. - -:: - - ENSEMBLE_RUN - -:: - - ENSEMBLE_RUN 1-5, 8 - - -**LOAD_RESULTS** - -The LOAD_RESULTS loads result from simulation(s). The job takes as -optional arguments a range and/or list of which realizations to load -results from. If no realizations are specified, results for all -realizations are loaded. - -:: - - LOAD_RESULTS - -:: - - LOAD_RESULTS 1-5, 8 - -In the case of multi iteration jobs, like e.g. the integrated smoother -update, the LOAD_RESULTS job will load the results from iter==0. To -control which iteration is loaded from you can use the -LOAD_RESULTS_ITER job. - - -**LOAD_RESULTS_ITER** - -The LOAD_RESULTS_ITER job is similar to the LOAD_RESULTS job, but it -takes an additional first argument which is the iteration number to -load from. This should be used when manually loading results from a -multi iteration workflow: - -:: - - LOAD_RESULTS_ITER - -:: - - LOAD_RESULTS_ITER 3 1-3, 8-10 - -Will load the realisations 1,2,3 and 8,9,10 from the fourth iteration -(counting starts at zero). - - -**MDA_ES** - -This workflow job (plugin) is used to run the *Multiple Data -Assimilation Ensemble Smoother* :code:`MDA ES`. Only two arguments -are required to start the MDA ES process; target case format and -iteration weights. The weights implicitly indicate the number of -iterations and the normalized global standard deviation scaling -applied to the update step. - -:: - - MDA_ES target_case_%d observations/obs.txt - -This command will use the weights specified in the obs.txt file. This -file should have a single floating point number per line. -Alternatively the weights can be given as arguments as shown here. - -:: - - MDA_ES target_case_%d 8,4,2,1 - -This command will use the normalized version of the weights 8,4,2,1 -and run for four iterations. The prior will be in *target_case_0* and -the results from the last iteration will be in *target_case_4*. -**Note: the weights must be listed with no spaces and separated with -commas.** - -If this is run as a plugin from Ertshell or the GUI a convenient user -interface can be shown. - - -Jobs for ranking realizations ------------------------------ - -**OBSERVATION_RANKING** - -The OBSERVATION_RANKING job will rank realizations based on the delta -between observed and simulated values for selected variables and time -steps. The data for selected variables and time steps are summarized -for both observed and simulated values, and then the simulated versus -observed delta is used for ranking the realizations in increasing -order. The job takes a name for the ranking as the first parameter, -then the time steps, a "|" character and then variables to rank on. If -no time steps and/or no variables are given, all time steps and -variables are taken into account. - - -Rank the realizations on observation/simulation delta value for all -WOPR data for time steps 0-20: - -:: - - OBSERVATION_RANKING Ranking1 0-20 | WOPR:* - - -Rank the simulations on observation/simulation delta value for all -WOPR and WWCT data for time steps 1 and 10-50 - -:: - - OBSERVATION_RANKING Ranking2 1, 10-50 | WOPR:* WWCT:* - - -Rank the realizations on observation/simulation delta value for -WOPR:OP-1 data for all time steps - -:: - - OBSERVATION_RANKING Ranking3 | WOPR:OP-1 - -**DATA_RANKING** - -The DATA_RANKING job will rank realizations in increasing or -decreasing order on selected data value for a selected time step. The -job takes as parameters the name of the ranking, the data key to rank -on, increasing order and selected time steps. If no time step is -given, the default is the last timestep. - -Rank the realizations on PORO:1,2,3 on time step 0 in decreasing order - -:: - - DATA_RANKING Dataranking1 PORO:1,2,3 false 0 - - -**EXPORT_RANKING** - -The EXPORT_RANKING job exports ranking results to file. The job takes -two parameters; the name of the ranking to export and the file to -export to. - -:: - - EXPORT_RANKING Dataranking1 /tmp/dataranking1.txt - - -**INIT_MISFIT_TABLE** - -Calculating the misfit for all observations and all timesteps can -potentially be a bit timeconsuming, the results are therefor cached -internally. If you need to force the recalculation of this cache you -can use the INIT_MISFIT_TABLE job to initialize the misfit table that -is used in observation ranking. - -:: - - INIT_MISFIT_TABLE - - -**STD_SCALE_CORRELATED_OBS** - -The workflow job :code:`STD_SCALE_CORRELATED_OBS` is used to scale the -observation standard deviation in an attempt to reduce the effect of -correlations in the observed data. The job expects the observation -keys you want to consider as arguments: - -:: - - STD_SCALE_CORRELATED_OBS WWCT:OP_1 WWCT:OP_2 - -In this example the observation uncertainty corresponding to -:code:`WWCT:OP_1` and :code:`WWCT:OP_2` will be scaled. Observe that -the :code:`STD_SCALE_CORRELATED_OBS` keyword will "flatten" in both -time and spatial direction. Wildcards are allow, i.e. - -:: - - STD_SCALE_CORRELATED_OBS W*:OP_1 - -Will scale based on all the observations of well 'OP_1'. For more -advanced selections of observations, where you only want to scale -based on parts of the observation - spatially or temporaly you must -write your own plugin. - diff --git a/ThirdParty/Ert/docs/user/workflows/index.rst b/ThirdParty/Ert/docs/user/workflows/index.rst deleted file mode 100644 index 8a0f541975..0000000000 --- a/ThirdParty/Ert/docs/user/workflows/index.rst +++ /dev/null @@ -1,30 +0,0 @@ -Workflows and plugins -===================== - -Contents - -.. toctree:: - :maxdepth: 1 - - workflows - plugins - built_in - -The Forward Model in ERT runs in the context of a single realization, -i.e. there is no communication between the different processes, and -the jobs are run outside of the main ERT process. - -As an alternative to the forward model ERT has a system with -*workflows*. Using workflows way you can automate cumbersome normal -ERT processes, and also invoke external programs. The workflows are -run serially on the workstation actually running ERT, and should not -be used for computationally heavy tasks. - -In addition to workflows ERT has a system for *plugins*, a plugin is -quite similar to a workflow job, but the plugin appears in a gui -dropdown, and can even have a gui of it's own. A plugin is written in -Python and has *full access* to ERT internals. The plugins hook into -the running Python process, and can only be invoked from the gui or -:code:`ertshell`. - - diff --git a/ThirdParty/Ert/docs/user/workflows/plugins.rst b/ThirdParty/Ert/docs/user/workflows/plugins.rst deleted file mode 100644 index b3e6f93d14..0000000000 --- a/ThirdParty/Ert/docs/user/workflows/plugins.rst +++ /dev/null @@ -1,246 +0,0 @@ -Python plugins -============== - -When you are using one of the python based frontends :code:`gert` or -:code:`ertshell` you can write plugins to ert in Python. The plugins -will run as part of the running ert process, and can do anything ert -can do itself. Writing a plugin is quite similar to writing an -:ref:`ert_script` - the main difference is that the class should -inherit from :code:`ErtPlugin`. This plugin will print the ensemble -size in the console: - -.. code:: python - - from ert.util import DoubleVector - from ert.enkf import ErtScript - - class PrintEnsembleSize(ErtPlugin): - - # The run method is the entry point which is called - # when the plugin is invoked. - def run(self): - ert = self.ert() - print("Ensemble size: %d" % ert.getEnsembleSize( )) - - - # This is the name of the plugin which will appear in the - # "Plugin" menu in the gui. - def getName(self): - return "Size plugin" - - - -The plugins should be *installed* with a small configuration -file. Assume that the small code above is implemented in the script -file :code:`script/ens_size.py` then it is installed in ert as: - - INTERNAL TRUE -- The job will call an internal function of the current running ERT instance. - SCRIPT sripts/ens_size.py -- An existing Python script - -ERT will detect that the class inherits from :code:`ErtPlugin`, and -the functionality will be available as :code:`Size plugin` in the plugin menu. - -As an example of a more complete plugin is the :code:`CSV export` -plugin from the ert code, this code can be used to export simulated -results, parameters and observations to a CSV file[#csv_export]_. - -.. code:: python - - import os - import re - - import pandas - from PyQt4.QtGui import QCheckBox - - from ert.enkf import ErtPlugin, CancelPluginException - from ert.enkf.export import SummaryCollector, GenKwCollector, MisfitCollector, DesignMatrixReader, CustomKWCollector - from ert_gui.ertwidgets.customdialog import CustomDialog - from ert_gui.ertwidgets.listeditbox import ListEditBox - from ert_gui.ertwidgets.models.path_model import PathModel - from ert_gui.ertwidgets.pathchooser import PathChooser - - - class CSVExportJob(ErtPlugin): - """ - Export of summary, custom_kw, misfit, design matrix data and gen kw into a single CSV file. - - The script expects a single argument: - - output_file: this is the path to the file to output the CSV data to - - Optional arguments: - - case_list: a comma separated list of cases to export (no spaces allowed) - if no list is provided the current case is exported - a single * can be used to export all cases - - design_matrix: a path to a file containing the design matrix - - infer_iteration: If True the script will try to infer the iteration number by looking at the suffix of the case name - (i.e. default_2 = iteration 2) - If False the script will use the ordering of the case list: the first item will be iteration 0, - the second item will be iteration 1... - - The script also looks for default values for output path and design matrix path to present in the GUI. These can - be specified with DATA_KW keyword in the config file: - DATA_KW CSV_OUTPUT_PATH - DATA_KW DESIGN_MATRIX_PATH - """ - - INFER_HELP = ("" - "If this is checked the iteration number will be inferred from the name i.e.:" - "
    " - "
  • case_name -> iteration: 0
  • " - "
  • case_name_0 -> iteration: 0
  • " - "
  • case_name_2 -> iteration: 2
  • " - "
  • case_0, case_2, case_5 -> iterations: 0, 2, 5
  • " - "
" - "Leave this unchecked to set iteration number to the order of the listed cases:" - "
  • case_0, case_2, case_5 -> iterations: 0, 1, 2
" - "
" - "") - - def getName(self): - return "CSV Export" - - def getDescription(self): - return "Export GenKW, CustomKW, design matrix, misfit data and summary data into a single CSV file." - - def inferIterationNumber(self, case_name): - pattern = re.compile("_([0-9]+$)") - match = pattern.search(case_name) - - if match is not None: - return int(match.group(1)) - return 0 - - - def run(self, output_file, case_list=None, design_matrix_path=None, infer_iteration=True): - cases = [] - - if case_list is not None: - if case_list.strip() == "*": - cases = self.getAllCaseList() - else: - cases = case_list.split(",") - - if case_list is None or len(cases) == 0: - cases = [self.ert().getEnkfFsManager().getCurrentFileSystem().getCaseName()] - - if design_matrix_path is not None: - if not os.path.exists(design_matrix_path): - raise UserWarning("The design matrix file does not exists!") - - if not os.path.isfile(design_matrix_path): - raise UserWarning("The design matrix is not a file!") - - data = pandas.DataFrame() - - for index, case in enumerate(cases): - case = case.strip() - - if not self.ert().getEnkfFsManager().caseExists(case): - raise UserWarning("The case '%s' does not exist!" % case) - - if not self.ert().getEnkfFsManager().caseHasData(case): - raise UserWarning("The case '%s' does not have any data!" % case) - - if infer_iteration: - iteration_number = self.inferIterationNumber(case) - else: - iteration_number = index - - case_data = GenKwCollector.loadAllGenKwData(self.ert(), case) - - custom_kw_data = CustomKWCollector.loadAllCustomKWData(self.ert(), case) - if not custom_kw_data.empty: - case_data = case_data.join(custom_kw_data, how='outer') - - if design_matrix_path is not None: - design_matrix_data = DesignMatrixReader.loadDesignMatrix(design_matrix_path) - if not design_matrix_data.empty: - case_data = case_data.join(design_matrix_data, how='outer') - - misfit_data = MisfitCollector.loadAllMisfitData(self.ert(), case) - if not misfit_data.empty: - case_data = case_data.join(misfit_data, how='outer') - - summary_data = SummaryCollector.loadAllSummaryData(self.ert(), case) - if not summary_data.empty: - case_data = case_data.join(summary_data, how='outer') - else: - case_data["Date"] = None - case_data.set_index(["Date"], append=True, inplace=True) - - case_data["Iteration"] = iteration_number - case_data["Case"] = case - case_data.set_index(["Case", "Iteration"], append=True, inplace=True) - - data = pandas.concat([data, case_data]) - - data = data.reorder_levels(["Realization", "Iteration", "Date", "Case"]) - data.to_csv(output_file) - - export_info = "Exported %d rows and %d columns to %s." % (len(data.index), len(data.columns), output_file) - return export_info - - - def getArguments(self, parent=None): - description = "The CSV export requires some information before it starts:" - dialog = CustomDialog("CSV Export", description, parent) - - default_csv_output_path = self.getDataKWValue("CSV_OUTPUT_PATH", default="output.csv") - output_path_model = PathModel(default_csv_output_path) - output_path_chooser = PathChooser(output_path_model) - - design_matrix_default = self.getDataKWValue("DESIGN_MATRIX_PATH", default="") - design_matrix_path_model = PathModel(design_matrix_default, is_required=False, must_exist=True) - design_matrix_path_chooser = PathChooser(design_matrix_path_model) - - list_edit = ListEditBox(self.getAllCaseList()) - - infer_iteration_check = QCheckBox() - infer_iteration_check.setChecked(True) - infer_iteration_check.setToolTip(CSVExportJob.INFER_HELP) - - dialog.addLabeledOption("Output file path", output_path_chooser) - dialog.addLabeledOption("Design Matrix path", design_matrix_path_chooser) - dialog.addLabeledOption("List of cases to export", list_edit) - dialog.addLabeledOption("Infer iteration number", infer_iteration_check) - - dialog.addButtons() - - success = dialog.showAndTell() - - if success: - design_matrix_path = design_matrix_path_model.getPath() - if design_matrix_path.strip() == "": - design_matrix_path = None - - case_list = ",".join(list_edit.getItems()) - - return [output_path_model.getPath(), case_list, design_matrix_path, infer_iteration_check.isChecked()] - - raise CancelPluginException("User cancelled!") - - - def getDataKWValue(self, name, default): - data_kw = self.ert().getDataKW() - if name in data_kw: - return data_kw[data_kw.indexForKey(name)][1] - return default - - def getAllCaseList(self): - fs_manager = self.ert().getEnkfFsManager() - all_case_list = fs_manager.getCaseList() - all_case_list = [case for case in all_case_list if fs_manager.caseHasData(case)] - return all_case_list - - -.. rubric:: Footnotes - -.. [csv_export] There are many solutions for CSV export; this plugin - is an example which is implemented based on the - internal ert datastructures, other - probably more - widely used alterantives are based on an external - process running through the simulation folders. diff --git a/ThirdParty/Ert/docs/user/workflows/workflows.rst b/ThirdParty/Ert/docs/user/workflows/workflows.rst deleted file mode 100644 index b599aa5b5e..0000000000 --- a/ThirdParty/Ert/docs/user/workflows/workflows.rst +++ /dev/null @@ -1,369 +0,0 @@ -.. _workflows: - -Configuring workflows in ERT consists of two steps: *installing the -jobs* which should be available for ERT to use in workflows, and then -subsequently assemble one or more jobs, with arguments, in a -workflow. You can use predefined workflow jobs, or create your -own. There are no predefined complete workflows. - - - -Workflow jobs -============= - -The workflow jobs are quite similar to the jobs in the forward model, -in particular the jobs are described by a configuration file which -resembles the one used by the forward model jobs. The workflow jobs -can be of two fundamentally different types - *external* and *internal*. - - -External workflow jobs ----------------------- - -These jobs invoke an external program/script to do the job, this is -very similar to the jobs of the forward model, but instead of running -as separate jobs on the cluster - one for each realization, the -workflow jobs will be invoked on the workstation running ert, and -typically go through all the realizations in one loop. - -The executable invoked by the workflow job can be an executable you -have written yourself - in any language, or it can be an existing -Linux command like e.g. :code:`cp` or :code:`mv`. - -Internal workflow jobs ----------------------- - -These jobs invoke a function in the address space of the ERT program -itself; i.e. they are run as part of the running ERT process - and can -in principle do anything that ERT can do itself. There are two two -varieties of the internal workflow jobs: - - -Invoke a pre exported function -.............................. - -This is the simplest, where you can invoke a a predefined ERT -function. The function must already have been marked as *exported* in -the ert code base. The list of predefined workflow jobs based on this -method can be found here: :ref:`built_in_workflow_jobs`. Marking a new -function as exported is quite simple, but it requires changes to the -core code and a new version must be installed. - -.. _ert_script: -Run a Python Script -................... - -If you are using one of the Python based frontends, *gert* or -*erthsell*, you can write your own Python script which is run as part -of the existing process. By using the full ert Python api you get -access to powerful customization/automization features. Below is an -example of :code:`ErtScript` which calculates the misfit for all -observations and prints the result to a text file. All Python scripts -of this kind must: - - 1. Be implemented as a class which iherits from :code:`ErtScript` - 2. Have a method :code:`run(self)` which does the actual job - - -.. code:: python - - from ert.util import DoubleVector - from ert.enkf import ErtScript - - class ExportMisfit(ErtScript): - - def run(self): - # Get a handle to running ert instance - ert = self.ert() - - - # Get a handle to the case / filesystem we are interested in; - # this should ideally come as an argument - not just use current. - fs = ert.getEnkfFsManager().getCurrentFileSystem() - - - # How many realisations: - ens_size = ert.getEnsembleSize( ) - - - # Get a handle to all the observations - observations = ert.getObservations() - - - # Iterate through all the observations; each element in this - # iteration corresponds to one key in the observations file. - for obs in observations: - misfit = DoubleVector() - for iens in range(ens_size): - chi2 = obs.getTotalChi2( fs , iens ) - misfit[iens] = chi2 - - permutation = misfit.permutationSort( ) - - print " # Realisation Misfit:%s" % obs.getObservationKey() - print "-----------------------------------" - for index in range(len(misfit)): - iens = permutation[index] - print "%2d %2d %10.5f" % (index , iens , misfit[iens]) - - print "-----------------------------------\n" - - - - -Configuring workflow jobs -------------------------- - -Workflow jobs are configured with a small configuration file much like -the configuration file used to install forward model jobs. The -keywords used in the configuration file are in two *clases* - those -related to how the job should located/run and the arguments which -should passed from the workflow to the job. - - -Configure an internal job -......................... - -When configuring an internal workflow job the keyword :code:`INTERNAL` -is given the value :code:`TRUE` to indicate that this is an internal -job. In addition you give the name of the C function you wish to -invoke. By default the workflow job will search for the function -symbol in the current process space, but by passing the :code:`MODULE` -keyword you can request the loading of an external shared library: - -:: - - INTERNAL TRUE -- The job will call an internal function of the current running ERT instance. - FUNCTION enkf_main_plot_all -- Name of the ERT function we are calling; must be marked exportable. - MODULE /name/of/shared/library -- Very optional - to load an extra shared library. - - -Configure a an internal job: Python -................................... - -If you wish to implement your job as a Python class, derived from -:code:`ErtScript` you should use the :code:`SCRIPT` keyword instead of -:code:`FUNCTION`, to point to an existing Python script: - -:: - - INTERNAL TRUE -- The job will call an internal function of the current running ERT instance. - SCRIPT sripts/my_script.py -- An existing Python script - -Observe that the important thing here is the fact that we are writing -an *internal* Python script; if you are writing an external script to -loop through all your realization folders that will typically be an -*external* script, and in that case the implementation language - -i.e. Python, Perl, C++, F77 ... has no relevance. - - -Configure an external job -......................... - -An *external* job is a workflow job which is implemented in an -external executable, i.e. typically a script written in for instance -Python. When configuring an external job the most important keyword is -:code:`EXECUTABLE` which is used to give the path to the external -executable: - -:: - - INTERNAL FALSE -- This is the default - not necessary to include. - EXECUTABLE path/to/program -- Path to a program/script which will be invoked by the job. - - -Configuring the arguments -......................... - -In addition to the INTERNAL, FUNCTION, MODULE and EXECUTABLE keys -which are used to configure what the job should do there are some keys -which can be used to configure the number of arguments and their -type. These arguments apply to both internal and external jobs: - -:: - - MIN_ARG 2 -- The job should have at least 2 arguments. - MAX_ARG 3 -- The job should have maximum 3 arguments. - ARG_TYPE 0 INT -- The first argument should be an integer - ARG_TYPE 1 FLOAT -- The second argument should be a float value - ARG_TYPE 2 STRING -- The third argument should be a string - the default. - -The MIN_ARG,MAX_ARG and ARG_TYPE arguments are used to validate workflows. - - -**Example 1 : Plot variables** - -:: - - -- FILE: PLOT -- - INTERNAL TRUE - FUNCTION ert_tui_plot_JOB - MIN_ARG 1 - -This job will use the ERT internal function ert_tui_plot_JOB to plot -an ensemble of an arbitrary ERT variable. The job needs at least one -argument; there is no upper limit on the number of arguments. - - -**Example 2 : Run external script** - -:: - - -- FILE: ECL_HIST -- - EXECUTABLE Script/ecl_hist.py - MIN_ARG 3 - -This job will invoke the external script Script/ecl_host.py; the -script should have at least three commandline arguments. The path to -the script, Script/ecl_hist.py is interpreted relative to the location -of the configuration file. - - -Loading workflow jobs into ERT ------------------------------- - -Before the jobs can be used in workflows they must be 'loaded' into -ERT. This is done with two different ERT keywords: - -:: - - LOAD_WORKFLOW_JOB jobConfigFile JobName - -The LOAD_WORKFLOW_JOB keyword will load one workflow job. The name of -the job is optional, if not provided the job will get name from the -configuration file. Alternatively you can use the command -WORKFLOW_JOB_DIRECTORY which will load all the jobs in a -directory. The command: - -:: - - WORKFLOW_JOB_DIRECTORY /path/to/jobs - -will load all the workflow jobs in the /path/to/jobs -directory. Observe that all the files in the /path/to/jobs directory -should be job configuration files. The jobs loaded in this way will -all get the name of the file as the name of the job. The -:code:`WORKFLOW_OB_DIRECTORY` keyword will *not* load configuration -files recursively. - - - - -Complete Workflows -================== - -A workflow is a list of calls to jobs, with additional arguments. The -job name should be the first element on each line. Based on the two -jobs PLOT and ECL_HIST we can create a small workflow example: - -:: - - PLOT WWCT:OP_1 WWCT:OP_3 PRESSURE:10,10,10 - PLOT FGPT FOPT - ECL_HIST //wwct_hist WWCT:OP_1 WWCT:OP_2 - -In this workflow we create plots of the nodes -WWCT:OP_1;WWCT:OP_3,PRESSURE:10,10,10,FGPT and FOPT. The plot job we -have created in this example is completely general, if we limited -ourselves to ECLIPSE summary variables we could get wildcard -support. Then we invoke the ECL_HIST example job to create a -histogram. See below for documentation of , and -. - - -Loading workflows ------------------ - -Workflows are loaded with the configuration option LOAD_WORKFLOW: - -:: - - LOAD_WORKFLOW /path/to/workflow/WFLOW1 - LOAD_WORKFLOW /path/to/workflow/workflow2 WFLOW2 - -The LOAD_WORKFLOW takes the path to a workflow file as the first -argument. By default the workflow will be labeled with the filename -internally in ERT, but optionally you can supply a second extra -argument which will be used as name for the workflow. Alternatively -you can load a workflow interactively. - - -Automatically run workflows : HOOK_WORKFLOW -------------------------------------------- -.. _hook_workflow: -.. topic:: HOOK_WORKFLOW - -With the keyword :code:`HOOK_WORKFLOW` you can configure workflow -'hooks'; meaning workflows which will be run automatically at certain -points during ERTs execution. Currently there are four points in ERTs -flow of execution where you can hook in a workflow, before -the simulations start, :code:`PRE_SIMULATION`; after all the -simulations have completed :code:`POST_SIMULATION`; -before the update step, :code:`PRE_UPDATE` and after the update step, :code:`POST_UPDATE`. The -:code:`POST_SIMULATION` hook is typically used to trigger QC -workflows: - -:: - - HOOK_WORKFLOW initWFLOW PRE_SIMULATION - HOOK_WORKFLOW preUpdateWFLOW PRE_UPDATE - HOOK_WORKFLOW postUpdateWFLOW POST_UPDATE - HOOK_WORKFLOW QC_WFLOW1 POST_SIMULATION - HOOK_WORKFLOW QC_WFLOW2 POST_SIMULATION - - -In this example the workflow :code:`initWFLOW` will run after all -the simulation directories have been created, just before the forward -model is submitted to the queue. The workflow :code:`preUpdateWFLOW` will be run before the -update step and :code:`postUpdateWFLOW` will be run after the -update step. When all the simulations are complete -the two workflows :code:`QC_WFLOW1` and :code:`QC_WFLOW2` will be -run. - -Observe that the workflows being 'hooked in' with the -:code:`HOOK_WORKFLOW` must be loaded with the :code:`LOAD_WORKFLOW` -keyword. - -Currently, :code:`PRE_UPDATE` and :code:`POST_UPDATE` are only -available from python. - -Locating the realisations: ------------------------------------------ - -Context must be passed between the main ERT process and the script -through the use of string substitution, in particular the 'magic' key - has been introduced for this purpose. - -Many of the external workflow jobs involve looping over all the -realisations in a construction like this: - -:: - - for each realisation: - // Do something for realisation - summarize() - -When running an external job in a workflow there is no direct transfer -of information between the main ERT process and the external -script. We therefor must have a convention for transfering the -information of which realisations we have simulated on, and where they -are located in the filesystem. This is done through a file which looks -like this: - -:: - - 0 /path/to/real0 CASE_0000 - 1 /path/to/real1 CASE_0001 - ... - 9 /path/to/real9 CASE_0009 - -The name and location of this file is available as the magical string - and that is typically used as the first argument to -external workflow jobs which should iterate over all realisations. The -realisations referred to in the are meant to be last -simulations you have run; the file is updated every time you run -simulations. This implies that it is (currently) not so convenient to -alter which directories should be used when running a workflow. - - - diff --git a/ThirdParty/Ert/etc-example/ERT/Scripts/job_dispatch.py b/ThirdParty/Ert/etc-example/ERT/Scripts/job_dispatch.py deleted file mode 100644 index 147c6ad409..0000000000 --- a/ThirdParty/Ert/etc-example/ERT/Scripts/job_dispatch.py +++ /dev/null @@ -1,308 +0,0 @@ -#!/usr/bin/python -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'job_dispatch.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - - -import sys -import os -import os.path -import socket -import time -import random - - -OK_file = "OK" -EXIT_file = "EXIT" -STATUS_file = "STATUS" -run_path = sys.argv[1] -sleep_time = 10 # Time to sleep before exiting the script - to let the disks sync up. -short_sleep = 2 - -################################################################# - -def redirect(file , fd , open_mode): - new_fd = os.open(file , open_mode , 0644) - os.dup2(new_fd , fd) - os.close(new_fd) - - -def cond_symlink(target , src): - if not os.path.exists(src): - os.symlink( target , src ) - - -def cond_unlink(file): - if os.path.exists(file): - os.unlink(file) - - - -def exec_job(job , executable): - if job["stdin"]: - redirect(job["stdin"] , 0 , os.O_RDONLY) - - if job["stdout"]: - redirect(job["stdout"] , 1 , os.O_WRONLY | os.O_TRUNC | os.O_CREAT ) - - if job["stderr"]: - redirect(job["stderr"] , 2 , os.O_WRONLY | os.O_TRUNC | os.O_CREAT ) - - if job["environment"]: - env = job["environment"] - for key in env.keys(): - os.putenv(key , env[key]) - os.execvp(executable , [executable] + job["argList"]) - - - -def unlink_empty(file): - if os.path.exists(file): - st = os.stat( file ) - if st.st_size == 0: - os.unlink( file ) - - - -def cleanup( job ): - if job["stdout"]: - unlink_empty( job["stdout"] ) - if job["stderr"]: - unlink_empty( job["stderr"] ) - - if job["license_link"]: - os.unlink(job["license_link"]) - - - -# This function implements a simple "personal license" system limiting -# how many instances of this job can run concurrently. Observe that the -# limiting is based on pr. invocation of the queue system (i.e. ERT -# binary) and pr user. The system works as follows: -# -# 1. The job is initilized with a license_path and a max_running -# variable. -# -# 2. In the licens_path directory a license file is made. -# -# 3. For each instance a random hard-link is created to the license -# file - this is how the number of concurrent uses is counted. -# -# 4. When the external program is finished the hard link is removed. - - -def license_check( job ): - job["license_link"] = None - if job.has_key("max_running"): - if job["max_running"]: - job["license_file"] = "%s/%s" % (job["license_path"] , job["name"]) - max_running = job["max_running"] - license_file = job["license_file"] - while True: - job["license_link"] = "%s/%d" % (job["license_path"] , random.randint(100000,999999)) - if not os.path.exists(job["license_link"]): - break - - - if not os.path.exists(license_file): - fileH = open(license_file , "w") - fileH.write("This is a license file for job:%s" % job["name"]) - fileH.close() - - - stat_info = os.stat(license_file) - currently_running = stat_info[3] - 1 - - while True: - stat_info = os.stat(license_file) - currently_running = stat_info[3] - 1 - if currently_running < max_running: - break - else: - time.sleep(5) - - os.link(license_file , job["license_link"]) - - while True: - stat_info = os.stat(license_file) - currently_running = stat_info[3] - 1 - if currently_running <= max_running: - break # OK - now we can leave the building - and let the job start - else: - time.sleep(5) - - -# Compatibility mode which must be retained until all ert prior to -# svn 2709 has been removed. - -def get_executable( job ): - executable = job.get("executable") - if not executable: - executable = job.get("portable_exe") - if not executable: - cpu = os.uname()[4] - if job["platform_exe"].has_key(cpu): - executable = job["platform_exe"][cpu] - else: - return (False, 0 , "%s : did not recognize platform:%s" % (job["name"] , cpu)) - - return executable - - - -def run_one(job): - license_check( job ) - if job["stdin"]: - if not os.path.exists(job["stdin"]): - return (False , 0 , "Could not locate stdin file: %s" % job["stdin"]) - - if job["start_file"]: - if not os.path.exists(job["start_file"]): - return (False , -1 , "Could not locate start_file:%s" % job["start_file"]) - - - - executable = get_executable( job ) - start_time = time.time() - pid = os.fork() - if pid == 0: - exec_job(job , executable) - else: - if job["max_running_minutes"]: - proc_path = "/proc/%d" % pid - # There is max run time on the job. - while True: - time.sleep( short_sleep ) - if os.path.exists( proc_path ): # Checking if the - run_time = time.time() - start_time - if run_time > (60 * job["max_running_minutes"]): - return (False , 0 , "Run time of %d minutes exceeded for job:%s" % ( job["max_running_minutes"] , job["name"])) - else: - break # The job is no longer running - - else: - (return_pid , exit_status) = os.waitpid(pid , 0) - - - if job["target_file"]: - if os.path.exists(job["target_file"]): - stat = os.stat(job["target_file"]) - if stat.st_ctime > start_time: - cleanup(job) - return (True , 0 , "") - else: - cleanup(job) - return (True , 0 , "Hmmm - seems the target file has not been updated - let the job suceed anyway...??") - else: - cleanup(job) - return (False , exit_status , "%s : could not find target_file:%s" % (job["name"] , job["target_file"])) - else: - cleanup(job) - return (True , exit_status , "Target file not speced") # Do not really look at exit status yet... - - - -################################################################# - -################################################################# - -os.nice(19) -if not os.path.exists( run_path ): - sys.stderr.write("*****************************************************************\n"); - sys.stderr.write("** FATAL Error: Could not find dirctory: %s \n" % run_path) - sys.stderr.write("** CWD: %s\n" % os.getcwd()) - sys.stderr.write("*****************************************************************\n"); - - fileH = open(EXIT_file , "w") - fileH.write("Could not locate:%s " % run_path) - fileH.write("CWD: %s" % os.getcwd()) - fileH.close() - sys.exit(-1) - -os.chdir( run_path ) -cond_unlink(EXIT_file) -cond_unlink(STATUS_file) -cond_unlink(OK_file) -fileH = open(STATUS_file , "a") -fileH.write("%-40s: %s/%s\n" % ("Current host:" , socket.gethostname() , os.uname()[4])) -fileH.close() - -sys.path.append( os.getcwd() ) -import jobs -random.seed() - -for job in jobs.jobList: - # To ensure compatibility with old versions. - if not job.has_key("max_running_minutes"): - job["max_running_minutes"] = None - -if len(sys.argv) == 2: - # Normal batch run. - for job in jobs.jobList: - fileH = open(STATUS_file , "a") - now = time.localtime() - fileH.write("%-32s: %02d:%02d:%02d .... " % (job["name"] , now.tm_hour , now.tm_min , now.tm_sec)) - fileH.close() - (OK , exit_status, error_msg) = run_one(job) - now = time.localtime() - if OK: - fileH = open(STATUS_file , "a") - fileH.write("%02d:%02d:%02d \n" % (now.tm_hour , now.tm_min , now.tm_sec)) - fileH.close() - else: - fileH = open(EXIT_file , "w") - fileH.write("%02d:%02d:%02d \n" % (now.tm_hour , now.tm_min , now.tm_sec)) - fileH.write("%s : failed\n" % job["name"]) - fileH.write("%s\n" % error_msg) - fileH.close() - sys.exit(exit_status) - - - if OK: - fileH = open("OK" , "w") - fileH.write("All jobs complete") - fileH.close() - time.sleep( sleep_time ) # Let the disks sync up -else: - #Interactive run - jobHash = {} - for job in jobs.jobList: - jobHash[job["name"]] = job - - for job_name in sys.argv[2:]: - if jobHash.has_key( job_name ): - job = jobHash[job_name] - print "Running job: %s ... " % job_name, - sys.stdout.flush() - (OK , exit_status, error_msg) = run_one( job ) - if OK: - print "OK" - else: - print "failed ...." - print "-----------------------------------------------------------------" - if job["stderr"]: - print "Error:%s " % error_msg - if os.path.exists(job["stderr"]): - fileH = open(job["stderr"],"r") - for line in fileH.readlines(): - print line, - fileH.close() - print "-----------------------------------------------------------------" - sys.exit() - else: - print "Job: %s does not exist. Available jobs:" % job_name - for j in jobs.jobList: - print " %s" % j["name"] - diff --git a/ThirdParty/Ert/etc-example/ERT/Scripts/run_RMS_20xx b/ThirdParty/Ert/etc-example/ERT/Scripts/run_RMS_20xx deleted file mode 100644 index 0fb8b6d027..0000000000 --- a/ThirdParty/Ert/etc-example/ERT/Scripts/run_RMS_20xx +++ /dev/null @@ -1,394 +0,0 @@ -#!/usr/bin/python -import sys -import os -import re -import random -import time - -if os.path.exists( "dot_master.py" ): - sys.path += [ os.getcwd() ] - import dot_master -else: - dot_master = None - -dot_master_fmt = "%-39s = %s\n" -error_file = "RMS_20XX_ERRORS_" -multi_seed_file = "random.seeds" - - -################################################################## -# -# The purpose of this script is to run a per-instance RMS workflow in -# batch from eg ERT. The script expects the following input as arguments -# on the commandline -# -# : The path to where the simulation should run. Directory -# must exist. -# -# : An integer saying which realiziton number this is. -# -# : This is a string which indicates which RMS version -# should be run. The allowed versions are the keys in -# the dictionary rms_version_table below, there should -# be no problems adding more versions to this table. -# -# : This is the (full) path to the source RMS project. -# -# -# : The absolute path (set in the RMS project) part which -# should be replaced with the current directory. -# -# : This is the name of the workflow we want to run. -# -# : This is the name of the workflow we want to run. -# -# : This is the name of the workflow we want to run. -# -# -# Example: -# -# bash% run_RMS_20xx.py 0 2009.3 /d/MyField/models/rms/geomodel.pro /OLDPATH WorkFlow1 WorkFlow2 ... -# -# The script works as follows: -# -# 1. The first commandline argument is the runpath of the script, and -# it will start by chdir() there. -# -# -# 2. The script recursively walks through the original project -# directory, and does the following: -# -# a) All directories found in the original project are created -# in the copy project, thus creating a empty project -# skeleton. -# If a non-directory entry with the same name is found in the -# copy project the script will exit (this is maybe a bit over -# the top strict??) -# -# b) For files in the source directory the script will do the -# following: -# -# o If the name of the file is ".master" the script will -# _copy_ the file from the source project to the copy -# project, and on the way it will perform the string -# substitutions asked for. -# -# or -# -# o If a file with this name already exists in the target -# project nothing will be done. -# -# else -# -# o A symlink will be created from the copy project to the -# original source project. -# -# -# 3. The lockfiles "project-lock-file" and ".lock" are removed. -# -# -# 4. The program loops as follows: -# o Updating the global seed (incrementing by one with each subsequent iteration). -# o Running the rms binary for each workflow. -# -# -# Observe that this script has no explicit built in support for -# per-instance files (i.e. IPL scripts). The way that is meant to be -# solved is that an external program writes those files to the target -# project (creating necessary directories on the way) prior to calling -# this script. -# -################################################################ - - -rms_license_file = "/prog/roxar/licensing/geomaticLM.lic" - - -rms_version_table = {"2010.1.1" : "/PATH/RMS/2010.1.1/linux-amd64-gcc_3_4-release/bin/rms", - "2010" : "/PATH/RMS/2010/linux-amd64-gcc_3_2-release/bin/rms", - "2009" : "/PATH/RMS/2009/linux-amd64-gcc_3_2-release/bin/rms", - "2009.2" : "/PATH/RMS/2009.2/linux-amd64-gcc_3_2-release/bin/rms", - "2009.3" : "/PATH/RMS/2009.3/linux-amd64-gcc_3_2-release/bin/rms", - "9.0.7.4" : "/PATH/RMS/9.0.7.4/linux-amd64-gcc_3_2-release/bin/rms"} - - - -# This function will write the error message on both "RMS_20XX_ERRORS_" and -# stderr, and then exit. -def fatal_error( msg ): - fileH = open(error_file , "w") - fileH.write( msg ) - fileH.close() - - sys.exit( msg ) - - -# This function will copy the file @src_entry to the file -# @target_entry, and on the way it will perform two different string -# substitutions. The .master file is organized like a key value list: -# -# key1 = Value1 -# key2 = Value2 -# ...... -# -# The input argument @value_subst is a list of tuples, where each -# occurence of the first element in the tuple is replaced with the -# second element in the tuple. -# -# The input argument @set_list is a dictionary, if the key in the -# .master file is in the @set_list dictionary the value in the .master -# will be replaced with the value in the set_List dictionary. - -def copy_dot_master( src_entry , target_entry , subst_list , set_list): - print "Copying %s -> %s" % (src_entry , target_entry) - if os.path.exists( target_entry ): - os.unlink( target_entry ) - - srcH = open( src_entry , "r") - targetH = open( target_entry , "w") - - for line in srcH.readlines(): - for (old , new) in subst_list: - line = line.replace( old , new ) - - tmp = re.split( "\s*=\s*" , line) - key = tmp[0] - if set_list.has_key( key) : - targetH.write( dot_master_fmt % (key , set_list[key])) - else: - targetH.write( line ) - - srcH.close() - targetH.close() - - - - -def create_project_directory( arg_dict , path , entries ): - offset = arg_dict["offset"] - target_root = arg_dict["target_root"] - src_path = arg_dict["src_path"] - subst = arg_dict["subst_list"] - set_list = arg_dict["set_list"] - - newpath = "%s/%s" % ( target_root , path[offset:] ) - - #Creating all the directories of the project - if not os.path.exists( newpath ): - os.makedirs( newpath ) - else: - if os.path.islink( newpath ): - fatal_error("Entry:%s already exists as a symbolic link. Clean up first..." % newpath) - - if not os.path.isdir( newpath ): - fatal_error("Entry:%s already exists - and it is not a directory. Clean up first..." % newpath) - - # Linking in all the files - for entry in entries: - src_entry = "%s/%s" % (path , entry) - if os.path.isfile( src_entry ): - target_entry = "%s/%s" % (newpath , entry) - if entry == ".master": - copy_dot_master( src_entry , target_entry , subst , set_list) - else: - if not os.path.exists( target_entry ): - os.symlink( src_entry , target_entry ) - - - - - -# This function duplicate the directory structure of the project -# located in src_path. The newly created project will be created in -# the current directory. All files are symlinked. - -def create_project_directories( src_path , project , target_path , subst_list , set_list): - src_project = os.path.join( src_path , project ) - arg_dict = {"offset" : len(src_path) , - "target_root": target_path , - "src_path" : src_path , - "subst_list" : subst_list , - "set_list" : set_list} - print "Creating all project directories: %s/%s" % (arg_dict["target_root"] , project ) - os.path.walk( src_project , create_project_directory , arg_dict) - print "Setting up RMS project complete." - - -################################################################# -# This function will update the seed in the master_file. The function -# will update the following lines in the master_file: -# -# global_seed = 12345678 -# seeds(n) = 09999999 -# -# All the lines will be updated with the __same_seed__. This function is -# only called once, with the root level .master file as argument, if -# there are other random seeds around they are not touched. -# -# -# What seed to use: -# ----------------- -# -# There are three different systems for choosing seed to use; the three -# methods are tried out in the following order: -# -# 1. If the file "RMS_SEED" exists in current working directory the -# script will use the value found in that file as seed. -# -# 2. If the file random.seeds exists the script will use integer -# nr @iens as seed. The format of the @multi_seed_file is just a -# list of integer, each on a separate line. The first integer should be the number of seeds -# -# 3. If neither of the seed files exist the script will use -# /dev/urandom to initialize the python rng, and then -# random.randint() to get a seed. -# -# The seed which is actually used in the end is appended to the file -# RMS_SEED_USED. Observe that for both the files RMS_SEED and -# @multi_seed_file the format "better" be right - the script will fail -# hard if these files are not formatted correctly. - - -def get_seed( target_path , project , iens): - single_seed_file = "%s/RMS_SEED" % target_path - if os.path.exists( single_seed_file ): - # Using existing single seed file - fileH = open( single_seed_file , "r" ) - new_seed = int( fileH.readline( ) ) - fileH.close() - elif os.path.exists( multi_seed_file ): - fileH = open( multi_seed_file , "r") - seed_list = [ int(x) for x in fileH.readlines() ] - fileH.close() - if seed_list[0] <= iens: - fatal_error("Asking for seed:%d seed_file:%s only has %d seeds\n" % (iens , multi_seed_file , seed_list[0])) - new_seed = seed_list[iens + 1] - else: - # Generate a seed from /dev/urandom - fileH = open( "/dev/urandom" , "r") - buffer = fileH.read( 64 ) - fileH.close() - random.seed( buffer ) - new_seed = random.randint( 0 , 21047483000 ) - - fileH = open("%s/RMS_SEED_USED" % target_path , "a+") - fileH.write("%s ... %d\n" % (time.strftime("%d-%m-%Y %H:%M:%S" , time.localtime(time.time())) , new_seed)) - fileH.close() - return new_seed - - -def set_seed( seed ): - master_file = "%s/%s/.master" % ( target_path , project ) - if not os.path.exists( master_file ): - fatal_error("Could not find rms master file: %s - seems like a broken project" % master_file ) - - fileH = open(master_file , "r") - linelist = fileH.readlines() - fileH.close() - - fileH = open( master_file , "w" ) - for line in linelist: - line = re.sub("^global_seed\s+=\s+\d+" , "global_seed = %d" % seed , line) - line = re.sub("^seeds\((\d+)\)\s+=\s+\d+" , "seeds(\1) = %d" % seed , line) - fileH.write( line ) - fileH.close() - - -################################################################# - -def init( arglist ): - if len(arglist) < 7: - msg = """ -The run_RMS_20xx script needs the following arguments -\n cwd iens rms_version path_to_project replace_path workflow1 | workflow2 workflow3 ... - -The available rms_versions are:%s -""" % rms_version_table.keys() - fatal_error( msg ) - - cwd = sys.argv[1] - iens = int( sys.argv[2] ) - - rms_version = sys.argv[3] - if rms_version_table.has_key( rms_version ): - rms_executable = rms_version_table[ rms_version ] - else: - fatal_error("Sorry: rms_version:%s not recognized - available:%s" % ( rms_version , rms_version_table.keys())) - - - src_project = arglist[4] - if os.path.exists( src_project ): - if os.path.isdir( src_project ): - (src_path , project) = os.path.split( src_project ) - else: - fatal_error("Fatal error - %s is not a directory" % src_project) - else: - fatal_error("Fatal error - project:%s does not exist" % src_project) - - replace_path = sys.argv[5] - - rms_workflows = sys.argv[6:] - - return (cwd , iens , rms_executable , src_path , project , replace_path , rms_workflows ) - - -################################################################# - - - -def unlink_lockfiles( project ): - lock_file1 = "%s/.lock" % project - if os.path.exists( lock_file1 ): - os.unlink( lock_file1 ) - - lock_file2 = "%s/project_lock_file" % project - if os.path.exists( lock_file2 ): - os.unlink( lock_file2 ) - - - -################################################################# - -def run_rms( rms_executable , project , workflow ): - os.environ["LM_LICENSE_FILE"] = rms_license_file - cmd = "%s -nomesa -project %s -batch %s" % ( rms_executable , project , workflow ) - print "Starting rms with command: \"%s\"" % cmd - os.system( cmd ) - print "RMS run is complete" - - - -################################################################# -################################################################# -# Main program starting: - -(target_path , iens , rms_executable , src_path , project , replace_path , rms_workflows) = init( sys.argv ) -if os.path.exists( target_path ): - os.chdir( target_path ) -else: - fatal_error("Directory:%s does not exist \n" % target_path ) - -subst_list = [(replace_path , target_path)] - -# If the dot_master module is present we ignore the replace_path commandline argument -if dot_master: - subst_list = dot_master.subst_list - set_list = dot_master.set_list -else: - set_list = {} - -create_project_directories( src_path , project , target_path , subst_list , set_list) -unlink_lockfiles( project ) -global_seed = get_seed( target_path , project , iens) -for workflow in rms_workflows: - set_seed( global_seed ) - run_rms( rms_executable , project , workflow ) - global_seed += 1 - - - - - - - - diff --git a/ThirdParty/Ert/etc-example/ERT/Scripts/run_eclipse.py b/ThirdParty/Ert/etc-example/ERT/Scripts/run_eclipse.py deleted file mode 100644 index c1ceb59ee6..0000000000 --- a/ThirdParty/Ert/etc-example/ERT/Scripts/run_eclipse.py +++ /dev/null @@ -1,228 +0,0 @@ -#!/usr/bin/python -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'run_eclipse.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - - -import os -import sys -import socket -################################################################# -# -# This is a small script used to run ECLIPSE simulations from ERT. The -# script will set up some environment variables, initialize file -# descriptors and then exec() to the ECLIPSE executable (or to mpirun in -# the case of parallell simulations). -# -# The script expects three commandline arguments: -# -# run_eclipse.py version eclipse_name -# -# The @version argument is one of the keys in the the dictionary -# version_table, below. @num_cpu is optional, it will default to one if -# not set. -# -# -################################################################# - - -# The first element in the tuple is the single CPU version to use, and -# the second element is the MPI version to use. - -version_table = {"2007.1" : ("/PATH/ECLIPSE/2007.1/bin/linux_x86_64/eclipse.exe" , "/PATH/ECLIPSE/2007.1/bin/linux_x86_64/eclipse_scampi.exe"), - "2007.2" : ("/PATH/ECLIPSE/2007.2/bin/linux_x86_64/eclipse.exe" , "/PATH/ECLIPSE/2007.2/bin/linux_x86_64/eclipse_scampi.exe"), - "2008.1" : ("/PATH/ECLIPSE/2008.1/bin/linux_x86_64/eclipse.exe" , "/PATH/ECLIPSE/2008.1/bin/linux_x86_64/eclipse_scampi.exe"), - "2008.2" : ("/PATH/ECLIPSE/2008.2/bin/linux_x86_64/eclipse.exe" , "/PATH/ECLIPSE/2008.2/bin/linux_x86_64/eclipse_scampi.exe"), - "2009.1" : ("/PATH/ECLIPSE/2009.1/bin/linux_x86_64/eclipse.exe" , "/PATH/ECLIPSE/2009.1/bin/linux_x86_64/eclipse_scampi.exe"), - "2009.2" : ("/PATH/ECLIPSE/2009.2/bin/linux_x86_64/eclipse.exe" , "/PATH/ECLIPSE/2009.2/bin/linux_x86_64/eclipse_scampi.exe")} - -scali_path = "/opt/scali" -ecldir = "/PATH/ECLIPSE" - -mpirun = "%s/bin/mpirun" % scali_path -config_file = "%s/macros/CONFIG.ECL" % ecldir - -config_link = "ECL.CFG" -env_variables = {"F_UFMTENDIAN" : "big", - "LM_LICENSE_FILE" : "flexlm.server.com" } - -max_cpu_sec = 10000000 -max_wall_sec = 99999999 - -stdin_file = "eclipse.stdin" -stdout_file = "eclipse.stdout" -stderr_file = "eclipse.stderr" - -# End of configuration options -################################################################# - - -# Will take a version string as input, and return the path to the -# executable file. If num_cpu == 1 it will return the serial version, -# whereas the Scali MPI version will be used if num_cpu > 1. -# -# If the @version input argument can not be found in the version_table -# dictionary, or the corresponding file does not exist, the function -# will fail with a fatal error. -def get_executable( version , num_cpu ): - t = version_table.get( version , None ) - if t: - if num_cpu == 1: - executable = t[0] - else: - executable = t[1] - else: - fatal_error("Eclipse version:\'%s\' not recognized. Available versions:%s" % (version , version_table.keys())) - - if not os.path.exists( executable ): - fatal_error("The executable:%s could not be found" % executable) - - return executable - - - - -def init_mpi( base_name , num_cpu ): - # Before the SCALI MPI executable can run we must update the path by prepending - # ECL_SCALI_LOC/bin and ECL_SCALI_LOC/lib64 to the $PATH and $LD_LIBRARY_PATH - # environment variables. - - env_variables["PATH"] = "%s/bin:%s" % ( scali_path , os.getenv("PATH")) - env_variables["LD_LIBRARY_PATH"] = "%s/lib64:%s" % ( scali_path , os.getenv("LD_LIBRARY_PATH")) - machine_list = [] - - - # If the environment variable LSB_HOSTS is set we assume the job is - # running on LSF - otherwise we assume it is running on the current host. - # - # If the LSB_HOSTS variable is indeed set it will be a string like this: - # - # host1 host1 host2 host3 - # - # i.e. each processs is listed with one hostname entry (i.e. NOT - # the :num_proc syntax which is used in LSB_MCPU_HOSTS variable. - - machine_file = "%s.mpi" % base_name - fileH = open( machine_file , "w") - - LSB_HOSTS = os.getenv("LSB_HOSTS") - if LSB_HOSTS: - for host in LSB_HOSTS.split(): - fileH.write("%s\n" % host) - else: - localhost = socket.gethostname() - for i in (range(num_cpu)): - fileH.write("%s\n" % localhost) - - fileH.close() - return machine_file - - - -def fatal_error( msg ): - fileH = open( stderr_file , "w") - fileH.write( msg ) - fileH.close() - sys.exit() - - - -def init_fd( base_name ): - # Creating a stupid input file which is connected to stdin - fileH = open(stdin_file , "w") - fileH.write("%s\n" % base_name); - fileH.write("%s\n" % base_name); - fileH.write("%d\n" % max_cpu_sec); - fileH.write("%d\n\n" % max_wall_sec); - fileH.close() - - # Redirecting stdin / stdout / stderr - fd_stdin = os.open(stdin_file , os.O_RDONLY , 0644) - fd_stdout = os.open(stdout_file , os.O_WRONLY | os.O_TRUNC | os.O_CREAT , 0644); - fd_stderr = os.open(stderr_file , os.O_WRONLY | os.O_TRUNC | os.O_CREAT , 0644); - - os.dup2(fd_stdin , 0) - os.dup2(fd_stdout , 1) - os.dup2(fd_stderr , 2) - - os.close(fd_stdin) - os.close(fd_stdout) - os.close(fd_stderr) - - - -def init_path( base_name ): - smspec_file = "%s.SMSPEC" % base_name - fsmspec_file = "%s.FSMSPEC" % base_name - - if os.path.exists( smspec_file ): - os.unlink( smspec_file ); - - if os.path.exists( fsmspec_file ): - os.unlink( fsmspec_file ); - - if not os.path.exists( config_link ): - os.symlink( config_file , config_link ) - - -def exec_single(executable , env_variables): - os.execve(executable , [ executable ] , env_variables) - - -def exec_mpi(executable , base_name , num_cpu , env_variables): - machine_file = init_mpi( base_name , num_cpu ) - os.execve( mpirun , [mpirun , "-np" , "%s" % num_cpu , "-machinefile" , machine_file , executable , base_name ] , env_variables) - - -################################################################# -# Main program starts. - -if len(sys.argv) < 3 or len(sys.argv) > 4: - fatal_error("The run_eclipse script needs two/three arguments: eclipse_version eclipse_base [num_cpu]") - - -version = sys.argv[1] -(run_path , file) = os.path.split( sys.argv[2] ) -(base_name , ext ) = os.path.splitext( file ) -if run_path: - try: - os.chdir( run_path ) - except: - fatal_error("The run_eclipse script could not change to directory:%s" % run_path) - -if len(sys.argv) == 4: - - # Must support older (svn version before ~ 2844) versions of ERT - # which do not provide a value for the the argument, so - # in this case the run_eclipse.py script will just get the string - # "", we catch the ValueError when converting to int, and - # use the default value num_cpu = 1. - - try: - num_cpu = int( sys.argv[3] ) - except ValueError: - num_cpu = 1 -else: - num_cpu = 1 - -executable = get_executable(version , num_cpu) -init_path( base_name ) -init_fd( base_name ) -if num_cpu == 1: - exec_single( executable , env_variables) -else: - exec_mpi( executable , base_name , num_cpu , env_variables ) - - diff --git a/ThirdParty/Ert/etc-example/ERT/jobs/ECLIPSE b/ThirdParty/Ert/etc-example/ERT/jobs/ECLIPSE deleted file mode 100644 index 5620171d37..0000000000 --- a/ThirdParty/Ert/etc-example/ERT/jobs/ECLIPSE +++ /dev/null @@ -1,3 +0,0 @@ -PORTABLE_EXE ../Scripts/run_eclipse.py -TARGET_FILE -ARGLIST diff --git a/ThirdParty/Ert/etc-example/ERT/jobs/ECLIPSE100_2009.2 b/ThirdParty/Ert/etc-example/ERT/jobs/ECLIPSE100_2009.2 deleted file mode 100644 index 79f5137a0c..0000000000 --- a/ThirdParty/Ert/etc-example/ERT/jobs/ECLIPSE100_2009.2 +++ /dev/null @@ -1,3 +0,0 @@ -PORTABLE_EXE ../Scripts/run_eclipse.py -TARGET_FILE -ARGLIST 2009.2 diff --git a/ThirdParty/Ert/etc-example/ERT/jobs/ECLIPSE100_2009.2_NOTARGET b/ThirdParty/Ert/etc-example/ERT/jobs/ECLIPSE100_2009.2_NOTARGET deleted file mode 100644 index a6d4718354..0000000000 --- a/ThirdParty/Ert/etc-example/ERT/jobs/ECLIPSE100_2009.2_NOTARGET +++ /dev/null @@ -1,2 +0,0 @@ -PORTABLE_EXE ../Scripts/run_eclipse.py -ARGLIST 2009.2 diff --git a/ThirdParty/Ert/etc-example/ERT/jobs/RUN_RMS_20XX b/ThirdParty/Ert/etc-example/ERT/jobs/RUN_RMS_20XX deleted file mode 100644 index 2870b39abd..0000000000 --- a/ThirdParty/Ert/etc-example/ERT/jobs/RUN_RMS_20XX +++ /dev/null @@ -1,8 +0,0 @@ -STDERR rms.stderr -STDOUT rms.stdout - -PORTABLE_EXE /project/res/etc/ERT/Scripts/run_RMS_20xx --- RMS_PROJECT should be the full path to the rms project -ARGLIST /ROXAR -TARGET_FILE -ENV LM_LICENSE_FILE /prog/roxar/licensing/geomaticLM.lic diff --git a/ThirdParty/Ert/etc-example/ERT/site-config b/ThirdParty/Ert/etc-example/ERT/site-config deleted file mode 100644 index a4a979f65f..0000000000 --- a/ThirdParty/Ert/etc-example/ERT/site-config +++ /dev/null @@ -1,79 +0,0 @@ --- This file is an example of site-wide configuration file for --- ERT. Observe that the user can override/add to everything which is set --- in this file in her per-project configuration file. Observe that --- prior to parsing this file ERT will issue a chdir() system call to --- the location of this file, i.e. you can safely use paths relative --- to the location of this file. - - --- Setting configuration information about the LSF system: -LSF_QUEUE normal -MAX_RUNNING_LSF 20 -LSF_RESOURCES select[cs && x86_64Linux] rusage[ecl100v2000=1:duration=5] - - --- Setting configuration information for running with rsh/ssh between --- workstations. Observe that to actually use this option the user --- must in addition specify which workstations to use in her project --- specific configuration file like: --- RSH_HOST_LIST host1:2 host2:4 host3:4 --- Which will run up to two jobs on 'host1' and four jobs on 'host2' --- and 'host3'; in addition it is essential to have passwordless login --- to the hosts 'hostx'. -MAX_RUNNING_RSH 100 -- You will never get more than the hosts allow anyway. -RSH_COMMAND /usr/bin/ssh - - --- Configuration for running the local workstation: -MAX_RUNNING_LOCAL 4 - - --- Which queue system will we use? -QUEUE_SYSTEM LSF - --- How many times will we submit a job before failing it. Setting this --- to two means first one submit, and then one more. -MAX_SUBMIT 2 - --- Not related to the conventional idea of a license - forget about it .... -LICENSE_PATH license - - --- The script used to run through the jobs in the forward model - a --- very important script. -JOB_SCRIPT Scripts/job_dispatch.py - - --- Installing a couple of jobs. A site will typically have a much --- longer list of available jobs. The arguments of the INSTALL_JOB --- command are first the short name of the job, which will be used --- to refer to the job when setting up the forward, and secondly a --- file with more details on how to run this job. Each of these files --- are used to populate on instance of ext_job_type which is --- implemented in libjob_queue/src/ext_job.c. -INSTALL_JOB RUN_RMS_20XX Config/jobs/RUN_RMS_20XX -INSTALL_JOB ECLIPSE100 Config/jobs/ECLIPSE100 -INSTALL_JOB ECLIPSE100_2009.2 Config/jobs/ECLIPSE100_2009.2 -INSTALL_JOB ECLIPSE100_2009.2_NOTARGET Config/jobs/ECLIPSE100_2009.2_NOTARGET - - - --- You can set environment variables with the SETENV command. The --- SETENV command understands $VAR, so you can also update variables. - --- The LSF variables must be set for LSF to work, this is similar to --- sourcing a LSF configuration file. -SETENV LSF_BINDIR /LSF_PATH/bin -SETENV LSF_LIBDIR /LSF_PATH/lib -SETENV XLSF_UIDDIR /LSF_PATH/lib/uid -SETENV LSF_SERVERDIR /LSF_PATH/etc -SETENV LSF_ENVDIR /LS_PATH/conf - --- In addition to SETENV you can also use UPDATE_PATH to update ':' --- separated path related environment variables. UPDATE_PATH will --- prepend the existing value of PATH with the new value. - -UPDATE_PATH PATH /funky/path/bin -SETENV LD_LIBRARY_PATH /funky/path/lib:$LD_LIBRARY_PATH - - diff --git a/ThirdParty/Ert/etc-example/README b/ThirdParty/Ert/etc-example/README deleted file mode 100644 index 9c12ddd5e2..0000000000 --- a/ThirdParty/Ert/etc-example/README +++ /dev/null @@ -1,42 +0,0 @@ -This directory contains some example configuration files / scripts for -ERT. This directory should typically be installed in shared location -where it is readably for everyone. The files/directories are: - -ERT/site-config ---------------- -This is the shared configuration file for all ERT users. - - -ERT/Scripts ------------ -This is a collection of scripts. These are: - - o ERT/Scripts/job_dispatch.py - the executable program started by - ERT, which again will start and run the other programs in the - forward model. A very important script; the path to this script is - set with the JOB_SCRIPT variable in the site-config file. - - o ERT/Scripts/run_eclipse.py: This a script to run ECLIPSE - nothing - special about this. If you want to use this script, you must at the - very least update the paths to the ECLIPSE binary. - - o ERT/Scripts/run_RMS_20xx: A script to run version 20xx of - RMS. Observe that this script is specifically designed to work - around a bug with exporting RMS datasets to a relative path; that - bug is now fixed in RMS. - - -ERT/jobs/*** -------------- -The files in directory ERT/jobs are job-description files which are -used to 'install' jobs into ERT. The directory ERT/jobs/ contains -small config files to install three different ECLIPSE jobs. (Make the -effort and understand the difference between ECLIPSE100_2009.2 and -ECLIPSE100_2009.2_NOTARGET, this will serve you well when debugging -problems with failed jobs). - -The jobs in ERT/jobs are installed into ERT with the INSTALL_JOB -commands in the sitewide configuration file. - - - diff --git a/ThirdParty/Ert/libanalysis/CMakeLists.txt b/ThirdParty/Ert/libanalysis/CMakeLists.txt deleted file mode 100644 index 883682c544..0000000000 --- a/ThirdParty/Ert/libanalysis/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -include(cmake/ert_module.cmake) - -add_subdirectory( script ) -add_subdirectory( src ) -add_subdirectory( modules ) - -if (BUILD_TESTS) - add_subdirectory( tests ) -endif() - -if (BUILD_APPLICATIONS) - add_subdirectory( applications ) -endif() - diff --git a/ThirdParty/Ert/libanalysis/applications/CMakeLists.txt b/ThirdParty/Ert/libanalysis/applications/CMakeLists.txt deleted file mode 100644 index 48241603c4..0000000000 --- a/ThirdParty/Ert/libanalysis/applications/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -add_executable( ert_module_test ert_module_test.c ) -target_link_libraries( ert_module_test analysis ert_util ) - -if (USE_RUNPATH) - add_runpath( ert_module_test ) -endif() - -set (destination ${CMAKE_INSTALL_PREFIX}/bin) - -install(TARGETS ert_module_test DESTINATION ${destination}) - -if (INSTALL_GROUP) - install(CODE "EXECUTE_PROCESS(COMMAND chgrp ${INSTALL_GROUP} ${destination}/ert_module_test)") - install(CODE "EXECUTE_PROCESS(COMMAND chmod g+w ${destination}/ert_module_test)") -endif() - -if (BUILD_TESTS) - ert_module_name( VAR_RML rml_enkf ${LIBRARY_OUTPUT_PATH} ) - add_test( analysis_module_test_RML ${EXECUTABLE_OUTPUT_PATH}/ert_module_test ${VAR_RML}) -endif() diff --git a/ThirdParty/Ert/libanalysis/applications/ert_module_test.c b/ThirdParty/Ert/libanalysis/applications/ert_module_test.c deleted file mode 100644 index b6ddd9be74..0000000000 --- a/ThirdParty/Ert/libanalysis/applications/ert_module_test.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'module_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include - -#include - -#include - - -int check_module( rng_type * rng , const char * lib_name ) { - analysis_module_load_status_enum load_status; - analysis_module_type * module = analysis_module_alloc_external__( rng , lib_name , false , &load_status); - if (module != NULL) { - printf("Module loaded successfully\n"); - analysis_module_free( module ); - return 0; - } else { - if (load_status == DLOPEN_FAILURE) { - printf("\ndlerror(): %s\n\n",dlerror()); - printf("The runtime linker could not open the library:%s.\n", lib_name); - printf("For the runtime linker to succesfully open your library\n"); - printf("at least one of two must be satisfied: \n\n"); - printf(" 1. You give the FULL PATH to library - including .so extension\n\n"); - printf(" 2. The path containing the library is in LD_LIBRARY_PATH.\n\n"); - printf("In addition all libraries needed by your module must be found\n"); - } else if (load_status == LOAD_SYMBOL_TABLE_NOT_FOUND) { - printf("\nThe library %s was loaded successfully, however\n",lib_name); - printf("the symbol table:\'%s\' was not found. You must make sure\n",EXTERNAL_MODULE_NAME); - printf("that the \'analysis_table_type\' structure at the bottom\n"); - printf("of the source file is named exactly: \'analysis_table\'.\n"); - printf("See documentation of \'symbol_table\' in modules.txt.\n\n"); - } - } - return 1; -} - - - -int main( int argc , char ** argv) { - exit( check_module( NULL , argv[1] ) ); -} diff --git a/ThirdParty/Ert/libanalysis/applications/main_test.c b/ThirdParty/Ert/libanalysis/applications/main_test.c deleted file mode 100644 index 7f0449909e..0000000000 --- a/ThirdParty/Ert/libanalysis/applications/main_test.c +++ /dev/null @@ -1,32 +0,0 @@ -#include -#include -#include -#include - - -int main( int argc , char ** argv) { - rng_type * rng = NULL; - if (0) - { - analysis_module_type * module = analysis_module_alloc_external( rng , "./simple_enkf.so" , "SimpleEnKF" ); - if (module != NULL) { - analysis_module_set_var( module , "FLAG" , "42" ); - analysis_module_set_var( module , "VarX" , "42.77" ); - analysis_module_free( module ); - } else - fprintf(stderr,"Hmmmm - failed to load external analysis module. \n"); - - } - - - { - analysis_module_type * module = analysis_module_alloc_internal( rng , "simple_enkf_symbol_table", "SimpleEnKF" ); - if (module != NULL) { - analysis_module_set_var( module , "FLAG" , "42" ); - analysis_module_set_var( module , "VarX" , "42.7708" ); - analysis_module_free( module ); - } else - fprintf(stderr,"Hmmmm - failed to load internal analysis module. \n"); - } - -} diff --git a/ThirdParty/Ert/libanalysis/cmake/ert_module.cmake b/ThirdParty/Ert/libanalysis/cmake/ert_module.cmake deleted file mode 100644 index db3857f401..0000000000 --- a/ThirdParty/Ert/libanalysis/cmake/ert_module.cmake +++ /dev/null @@ -1,23 +0,0 @@ -function( ert_module target args source_files ) - - set( build_file ${target}.so ) - set( depends analysis ) - set( arg_string "${target} ${args}") - separate_arguments( arg_list UNIX_COMMAND "${arg_string}") - foreach (src_file ${source_files} ) - list(APPEND arg_list ${CMAKE_CURRENT_SOURCE_DIR}/${src_file} ) - list(APPEND depends ${CMAKE_CURRENT_SOURCE_DIR}/${src_file} ) - endforeach() - - add_custom_command( - OUTPUT ${build_file} - COMMAND ${PROJECT_SOURCE_DIR}/libanalysis/script/ert_module - ARGS ${arg_list} - DEPENDS ${depends}) - - install(FILES ${build_file} DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - get_filename_component( module ${target} NAME ) - add_custom_target( ${module} ALL DEPENDS ${build_file} ) - -endfunction() diff --git a/ThirdParty/Ert/libanalysis/include/ert/analysis/analysis_module.h b/ThirdParty/Ert/libanalysis/include/ert/analysis/analysis_module.h deleted file mode 100644 index a20937786f..0000000000 --- a/ThirdParty/Ert/libanalysis/include/ert/analysis/analysis_module.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'analysis_module.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ANALYSIS_MODULE_H -#define ERT_ANALYSIS_MODULE_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -#include - -/* - These are option flag values which are used by the core ert code to - query the module of it's needs and capabilities. For instance to to - determine whether the data should be scaled prior to analysis the - core code will issue the call: - - if (analysis_module_get_option( module, ANALYSIS_SCALE_DATA)) - obs_data_scale( obs_data , S , E , D , R , dObs ); - - It is the responsability of the module to set the various flags. -*/ - - -typedef enum { - ANALYSIS_NEED_ED = 1, - ANALYSIS_USE_A = 4, // The module will read the content of A - but not modify it. - ANALYSIS_UPDATE_A = 8, // The update will be based on modifying A directly, and not on an X matrix. - ANALYSIS_SCALE_DATA = 16, - ANALYSIS_ITERABLE = 32 // The module can bu used as an iterative smoother. -} analysis_module_flag_enum; - - -#define ANALYSIS_MODULE_FLAG_ENUM_SIZE 5 -#define ANALYSIS_MODULE_FLAG_ENUM_DEFS {.value = ANALYSIS_NEED_ED , .name = "ANALYSIS_NEED_ED"},\ - {.value = ANALYSIS_USE_A , .name = "ANALYSIS_USE_A"},\ - {.value = ANALYSIS_UPDATE_A , .name = "ANALYSIS_UPDATE_A"},\ - {.value = ANALYSIS_SCALE_DATA , .name = "ANALYSIS_SCALE_DATA"},\ - {.value = ANALYSIS_ITERABLE , .name = "ANALYSIS_ITERABLE"} - - -#define EXTERNAL_MODULE_NAME "analysis_table" -#define EXTERNAL_MODULE_SYMBOL analysis_table - - typedef enum { - LOAD_OK = 0, - DLOPEN_FAILURE = 1, - LOAD_SYMBOL_TABLE_NOT_FOUND = 2 - } analysis_module_load_status_enum; - - - typedef struct analysis_module_struct analysis_module_type; - - analysis_module_type * analysis_module_alloc_internal__( rng_type * rng , const char * symbol_table , bool verbose , analysis_module_load_status_enum * load_status); - analysis_module_type * analysis_module_alloc_internal( rng_type * rng , const char * symbol_table ); - - analysis_module_type * analysis_module_alloc_external__(rng_type * rng , const char * lib_name , bool verbose , analysis_module_load_status_enum * load_status); - analysis_module_type * analysis_module_alloc_external( rng_type * rng , const char * libname ); - - void analysis_module_free( analysis_module_type * module ); - void analysis_module_free__( void * arg); - - void analysis_module_initX(analysis_module_type * module , - matrix_type * X , - matrix_type * A , - matrix_type * S , - matrix_type * R , - matrix_type * dObs , - matrix_type * E , - matrix_type * D); - - - void analysis_module_updateA(analysis_module_type * module , - matrix_type * A , - matrix_type * S , - matrix_type * R , - matrix_type * dObs , - matrix_type * E , - matrix_type * D , - const module_info_type* module_info); - - - void analysis_module_init_update( analysis_module_type * module , - const bool_vector_type * ens_mask , - const matrix_type * S , - const matrix_type * R , - const matrix_type * dObs , - const matrix_type * E , - const matrix_type * D ); - - - const char * analysis_module_get_lib_name( const analysis_module_type * module); - bool analysis_module_internal( const analysis_module_type * module ); - bool analysis_module_set_var( analysis_module_type * module , const char * var_name , const char * string_value ); - const char * analysis_module_get_table_name( const analysis_module_type * module); - const char * analysis_module_get_name( const analysis_module_type * module ); - void analysis_module_set_name( analysis_module_type * module , const char * name); - bool analysis_module_check_option( const analysis_module_type * module , long flag); - void analysis_module_complete_update( analysis_module_type * module ); - - bool analysis_module_has_var( const analysis_module_type * module , const char * var ); - double analysis_module_get_double( const analysis_module_type * module , const char * var); - int analysis_module_get_int( const analysis_module_type * module , const char * var); - bool analysis_module_get_bool( const analysis_module_type * module , const char * var); - void * analysis_module_get_ptr( const analysis_module_type * module , const char * var); - const char * analysis_module_flag_enum_iget( int index, int * value); - - - - UTIL_IS_INSTANCE_HEADER( analysis_module ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libanalysis/include/ert/analysis/analysis_table.h b/ThirdParty/Ert/libanalysis/include/ert/analysis/analysis_table.h deleted file mode 100644 index bbbbc7993e..0000000000 --- a/ThirdParty/Ert/libanalysis/include/ert/analysis/analysis_table.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef ERT_ANALYSIS_TABLE_H -#define ERT_ANALYSIS_TABLE_H - -#ifdef __cplusplus -extern "C" { -#endif - - -#include -#include -#include - -#include - - - typedef void (analysis_updateA_ftype) (void * module_data , - matrix_type * A , - matrix_type * S , - matrix_type * R , - matrix_type * dObs , - matrix_type * E , - matrix_type * D , - const module_info_type* module_info); - - - typedef void (analysis_initX_ftype) (void * module_data , - matrix_type * X , - matrix_type * A , - matrix_type * S , - matrix_type * R , - matrix_type * dObs , - matrix_type * E , - matrix_type * D ); - - - typedef bool (analysis_set_int_ftype) (void * module_data , const char * flag , int value); - typedef bool (analysis_set_bool_ftype) (void * module_data , const char * flag , bool value); - typedef bool (analysis_set_double_ftype) (void * module_data , const char * var , double value); - typedef bool (analysis_set_string_ftype) (void * module_data , const char * var , const char * value); - typedef void (analysis_free_ftype) (void * ); - typedef void * (analysis_alloc_ftype) ( rng_type * rng ); - - - typedef void (analysis_init_update_ftype) (void * module_data, - const bool_vector_type * ens_mask , - const matrix_type * S , - const matrix_type * R , - const matrix_type * dObs , - const matrix_type * E , - const matrix_type * D); - - typedef void (analysis_complete_update_ftype) (void * module_data ); - - typedef long (analysis_get_options_ftype) (void * module_data , long option); - - typedef bool (analysis_has_var_ftype) (const void * module_data , const char * var_name); - typedef int (analysis_get_int_ftype) (const void * module_data , const char * var_name ); - typedef double (analysis_get_double_ftype) (const void * module_data , const char * var_name ); - typedef bool (analysis_get_bool_ftype) (const void * module_data , const char * var_name ); - typedef void * (analysis_get_ptr_ftype) (const void * module_data , const char * var_name ); - -/*****************************************************************/ - - -typedef struct { - const char * name; - analysis_updateA_ftype * updateA; - analysis_initX_ftype * initX; - analysis_init_update_ftype * init_update; - analysis_complete_update_ftype * complete_update; - - analysis_free_ftype * freef; - analysis_alloc_ftype * alloc; - - analysis_set_int_ftype * set_int; - analysis_set_double_ftype * set_double; - analysis_set_bool_ftype * set_bool; - analysis_set_string_ftype * set_string; - analysis_get_options_ftype * get_options; - - analysis_has_var_ftype * has_var; - analysis_get_int_ftype * get_int; - analysis_get_double_ftype * get_double; - analysis_get_bool_ftype * get_bool; - analysis_get_ptr_ftype * get_ptr; -} analysis_table_type; - - - - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libanalysis/include/ert/analysis/cv_enkf.h b/ThirdParty/Ert/libanalysis/include/ert/analysis/cv_enkf.h deleted file mode 100644 index 1f5d518859..0000000000 --- a/ThirdParty/Ert/libanalysis/include/ert/analysis/cv_enkf.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'cv_enkf.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -typedef struct cv_enkf_data_struct cv_enkf_data_type; - -void * cv_enkf_data_alloc( rng_type * rng ); -void cv_enkf_data_free( void * arg ); - -void cv_enkf_init_update( void * arg , - const bool_vector_type * ens_mask , - const matrix_type * S , - const matrix_type * R , - const matrix_type * dObs , - const matrix_type * E , - const matrix_type * D ); - -void cv_enkf_initX(void * module_data , - matrix_type * X , - matrix_type * A , - matrix_type * S , - matrix_type * R , - matrix_type * dObs , - matrix_type * E , - matrix_type * D); - -bool cv_enkf_set_double( void * arg , const char * var_name , double value); -bool cv_enkf_set_int( void * arg , const char * var_name , int value); -bool cv_enkf_set_bool( void * arg , const char * var_name , bool value ); - -void cv_enkf_set_truncation( cv_enkf_data_type * data , double truncation ); -void cv_enkf_set_pen_press( cv_enkf_data_type * data , bool value ); -void cv_enkf_set_subspace_dimension( cv_enkf_data_type * data , int subspace_dimension); - diff --git a/ThirdParty/Ert/libanalysis/include/ert/analysis/enkf_linalg.h b/ThirdParty/Ert/libanalysis/include/ert/analysis/enkf_linalg.h deleted file mode 100644 index c4affb895e..0000000000 --- a/ThirdParty/Ert/libanalysis/include/ert/analysis/enkf_linalg.h +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef ERT_ENKF_LINALG_H -#define ERT_ENKF_LINALG_H - -#include -#include -#include - - -int enkf_linalg_get_PC( const matrix_type * S0, - const matrix_type * dObs , - double truncation, - int ncomp, - matrix_type * PC, - matrix_type * PC_obs , - double_vector_type * singular_values); - -int enkf_linalg_num_PC(const matrix_type * S , double truncation ); - - -void enkf_linalg_init_stdX( matrix_type * X , - const matrix_type * S , - const matrix_type * D , - const matrix_type * W , - const double * eig , - bool bootstrap); - - -void enkf_linalg_init_sqrtX(matrix_type * X5 , - const matrix_type * S , - const matrix_type * randrot , - const matrix_type * innov , - const matrix_type * W , - const double * eig , - bool bootstrap); - - -void enkf_linalg_Cee(matrix_type * B, int nrens , const matrix_type * R , const matrix_type * U0 , const double * inv_sig0); - - -int enkf_linalg_svd_truncation(const matrix_type * S , - double truncation , - int ncomp , - dgesvd_vector_enum store_V0T , - double * sig0, - matrix_type * U0 , - matrix_type * V0T); - - -int enkf_linalg_svdS(const matrix_type * S , - double truncation , - int ncomp , - dgesvd_vector_enum jobVT , - double * sig0, - matrix_type * U0 , - matrix_type * V0T); - - - -matrix_type * enkf_linalg_alloc_innov( const matrix_type * dObs , const matrix_type * S); - -void enkf_linalg_lowrankCinv__(const matrix_type * S , - const matrix_type * R , - matrix_type * V0T , - matrix_type * Z, - double * eig , - matrix_type * U0, - double truncation, - int ncomp); - - - -void enkf_linalg_lowrankCinv(const matrix_type * S , - const matrix_type * R , - matrix_type * W , /* Corresponding to X1 from Eq. 14.29 */ - double * eig , /* Corresponding to 1 / (1 + Lambda_1) (14.29) */ - double truncation , - int ncomp); - -void enkf_linalg_lowrankE(const matrix_type * S , /* (nrobs x nrens) */ - const matrix_type * E , /* (nrobs x nrens) */ - matrix_type * W , /* (nrobs x nrmin) Corresponding to X1 from Eqs. 14.54-14.55 */ - double * eig , /* (nrmin) Corresponding to 1 / (1 + Lambda1^2) (14.54) */ - double truncation , - int ncomp); - -void enkf_linalg_genX2(matrix_type * X2 , const matrix_type * S , const matrix_type * W , const double * eig); -void enkf_linalg_genX3(matrix_type * X3 , const matrix_type * W , const matrix_type * D , const double * eig); - -void enkf_linalg_meanX5(const matrix_type * S , - const matrix_type * W , - const double * eig , - const matrix_type * innov , - matrix_type * X5); - - -void enkf_linalg_X5sqrt(matrix_type * X2 , matrix_type * X5 , const matrix_type * randrot, int nrobs); - -matrix_type * enkf_linalg_alloc_mp_randrot(int ens_size , rng_type * rng); -void enkf_linalg_set_randrot( matrix_type * Q , rng_type * rng); -void enkf_linalg_checkX(const matrix_type * X , bool bootstrap); - - -//rml_enkf functions - -void enkf_linalg_rml_enkfX1(matrix_type *X1, matrix_type * Udr ,matrix_type * S ,matrix_type *R); -void enkf_linalg_rml_enkfX2(matrix_type *X2, double *Wdr, matrix_type * X1 ,double a , int nsign); -void enkf_linalg_rml_enkfX3(matrix_type *X3, matrix_type *VdTr, double *Wdr,matrix_type *X2, int nsign); - -double enkf_linalg_data_mismatch(matrix_type *D , matrix_type *R , matrix_type *Sk); -void enkf_linalg_Covariance(matrix_type *Cd, const matrix_type *E, double nsc ,int nrobs); -void enkf_linalg_rml_enkfAm(matrix_type * Um, const double * Wm,int nsign1); - -void enkf_linalg_rml_enkfX7(matrix_type * X7, matrix_type * VdT, double * Wdr, double a,matrix_type * X6); - -#endif diff --git a/ThirdParty/Ert/libanalysis/include/ert/analysis/fwd_step_enkf.h b/ThirdParty/Ert/libanalysis/include/ert/analysis/fwd_step_enkf.h deleted file mode 100644 index 627ae5efd4..0000000000 --- a/ThirdParty/Ert/libanalysis/include/ert/analysis/fwd_step_enkf.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'fwd_step_enkf.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include - -typedef struct fwd_step_enkf_data_struct fwd_step_enkf_data_type; - -void * fwd_step_enkf_data_alloc( rng_type * rng ); -void fwd_step_enkf_data_free( void * arg ); - -void fwd_step_enkf_updateA(void * module_data , - matrix_type * A , - matrix_type * S , - matrix_type * R , - matrix_type * dObs , - matrix_type * E , - matrix_type * D , - const module_info_type* module_info); - - - diff --git a/ThirdParty/Ert/libanalysis/include/ert/analysis/fwd_step_log.h b/ThirdParty/Ert/libanalysis/include/ert/analysis/fwd_step_log.h deleted file mode 100644 index d48e587f98..0000000000 --- a/ThirdParty/Ert/libanalysis/include/ert/analysis/fwd_step_log.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2016 Statoil ASA, Norway. - - The file 'fwd_step_log.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef FWD_STEP_LOG_H -#define FWD_STEP_LOG_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - - typedef struct fwd_step_log_struct fwd_step_log_type; - - fwd_step_log_type * fwd_step_log_alloc(); - void fwd_step_log_free(fwd_step_log_type * fwd_step_log); - bool fwd_step_log_get_clear_log( const fwd_step_log_type * data ); - void fwd_step_log_set_clear_log( fwd_step_log_type * data , bool clear_log); - void fwd_step_log_set_log_file( fwd_step_log_type * data , const char * log_file ); - const char * fwd_step_log_get_log_file( const fwd_step_log_type * data); - void fwd_step_log_open( fwd_step_log_type * fwd_step_log ); - void fwd_step_log_close( fwd_step_log_type * fwd_step_log ); - void fwd_step_log_line( fwd_step_log_type * fwd_step_log , const char * fmt , ...); - bool fwd_step_log_is_open( const fwd_step_log_type * fwd_step_log ); - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/ThirdParty/Ert/libanalysis/include/ert/analysis/module_data_block.h b/ThirdParty/Ert/libanalysis/include/ert/analysis/module_data_block.h deleted file mode 100644 index aecac5803f..0000000000 --- a/ThirdParty/Ert/libanalysis/include/ert/analysis/module_data_block.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright (C) 2016 Statoil ASA, Norway. - - The file 'module_data_blocks.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef MODULE_DATA_BLOCKS_H -#define MODULE_DATA_BLOCKS_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - - struct module_data_block_struct { - UTIL_TYPE_ID_DECLARATION; - char * key; - const int * index_list; - int A_row_start; - int n_active; - }; - - typedef struct module_data_block_struct module_data_block_type; - - module_data_block_type * module_data_block_alloc( const char * key, const int * index_list , const int row_start, const int n_active); - const char * module_data_block_get_key(const module_data_block_type * module_data_block); - const int module_data_block_get_row_start(const module_data_block_type * module_data_block); - const int module_data_block_get_row_end(const module_data_block_type * module_data_block); - const int * module_data_block_get_active_indices(const module_data_block_type * module_data_block ); - void module_data_block_free(module_data_block_type * module_data_block); - void module_data_block_free__( void * arg ); - - UTIL_IS_INSTANCE_HEADER( module_data_block ); - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/ThirdParty/Ert/libanalysis/include/ert/analysis/module_data_block_vector.h b/ThirdParty/Ert/libanalysis/include/ert/analysis/module_data_block_vector.h deleted file mode 100644 index 9ab86fbf8b..0000000000 --- a/ThirdParty/Ert/libanalysis/include/ert/analysis/module_data_block_vector.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright (C) 2016 Statoil ASA, Norway. - - The file 'module_data_block_vector.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#ifndef ERT_MODULE_DATA_BLOCK_VECTOR_H -#define ERT_MODULE_DATA_BLOCK_VECTOR_H - -#ifdef __cplusplus -extern "C" { -#endif - - - -#include - - typedef struct module_data_block_vector_struct module_data_block_vector_type; - - module_data_block_vector_type * module_data_block_vector_alloc(); - void module_data_block_vector_free(); - void module_data_block_vector_add_data_block( module_data_block_vector_type * module_data_block_vector , const module_data_block_type * data_block); - module_data_block_type * module_data_block_vector_iget_module_data_block(const module_data_block_vector_type * module_data_block_vector, int index); - int module_data_block_vector_get_size(const module_data_block_vector_type * module_data_block_vector); - - UTIL_IS_INSTANCE_HEADER( module_data_block_vector ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libanalysis/include/ert/analysis/module_info.h b/ThirdParty/Ert/libanalysis/include/ert/analysis/module_info.h deleted file mode 100644 index a5783d17a3..0000000000 --- a/ThirdParty/Ert/libanalysis/include/ert/analysis/module_info.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright (C) 2016 Statoil ASA, Norway. - - The file 'module_info.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#ifndef ERT_MODULE_INFO_H -#define ERT_MODULE_INFO_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - - - typedef struct module_info_struct module_info_type; - - module_info_type * module_info_alloc(const char* ministep_name); - void module_info_free(); - char * module_info_get_ministep_name(const module_info_type * module_info); - module_data_block_vector_type * module_info_get_data_block_vector(const module_info_type * module_info); - module_obs_block_vector_type * module_info_get_obs_block_vector(const module_info_type * module_info); - - UTIL_IS_INSTANCE_HEADER( module_info ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libanalysis/include/ert/analysis/module_obs_block.h b/ThirdParty/Ert/libanalysis/include/ert/analysis/module_obs_block.h deleted file mode 100644 index e838e8ea16..0000000000 --- a/ThirdParty/Ert/libanalysis/include/ert/analysis/module_obs_block.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright (C) 2016 Statoil ASA, Norway. - - The file 'module_obs_blocks.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef MODULE_OBS_BLOCKS_H -#define MODULE_OBS_BLOCKS_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - - struct module_obs_block_struct { - UTIL_TYPE_ID_DECLARATION; - char * key; - const int * index_list; - int D_row_start; - int n_active; - }; - - typedef struct module_obs_block_struct module_obs_block_type; - - module_obs_block_type * module_obs_block_alloc( const char * key, const int * index_list, const int row_start, const int n_active); - const char * module_obs_block_get_key(const module_obs_block_type * module_obs_block); - const int module_obs_block_get_row_start(const module_obs_block_type * module_obs_block); - const int module_obs_block_get_row_end(const module_obs_block_type * module_obs_block); - const int * module_obs_block_get_active_indices(const module_obs_block_type * module_obs_block ); - void module_obs_block_free(module_obs_block_type * module_obs_block); - void module_obs_block_free__( void * arg ); - - UTIL_IS_INSTANCE_HEADER( module_obs_block ); - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/ThirdParty/Ert/libanalysis/include/ert/analysis/module_obs_block_vector.h b/ThirdParty/Ert/libanalysis/include/ert/analysis/module_obs_block_vector.h deleted file mode 100644 index 75063e643c..0000000000 --- a/ThirdParty/Ert/libanalysis/include/ert/analysis/module_obs_block_vector.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright (C) 2016 Statoil ASA, Norway. - - The file 'module_obs_block_vector.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#ifndef ERT_MODULE_OBS_BLOCK_VECTOR_H -#define ERT_MODULE_OBS_BLOCK_VECTOR_H - -#ifdef __cplusplus -extern "C" { -#endif - - - -#include - - typedef struct module_obs_block_vector_struct module_obs_block_vector_type; - - module_obs_block_vector_type * module_obs_block_vector_alloc(); - void module_obs_block_vector_free(); - void module_obs_block_vector_add_obs_block( module_obs_block_vector_type * module_obs_block_vector , module_obs_block_type * obs_block); - module_obs_block_type * module_obs_block_vector_iget_module_obs_block(const module_obs_block_vector_type * module_obs_block_vector, int index); - const module_obs_block_type * module_obs_block_vector_search_module_obs_block(const module_obs_block_vector_type * module_obs_block_vector, int global_index); - int module_obs_block_vector_get_size(const module_obs_block_vector_type * module_obs_block_vector); - - UTIL_IS_INSTANCE_HEADER( module_obs_block_vector ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libanalysis/include/ert/analysis/std_enkf.h b/ThirdParty/Ert/libanalysis/include/ert/analysis/std_enkf.h deleted file mode 100644 index fabaa9969f..0000000000 --- a/ThirdParty/Ert/libanalysis/include/ert/analysis/std_enkf.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef ERT_STD_ENKF_H -#define ERT_STD_ENKF_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include -#include - -#define DEFAULT_ENKF_TRUNCATION_ 0.98 -#define ENKF_TRUNCATION_KEY_ "ENKF_TRUNCATION" -#define ENKF_NCOMP_KEY_ "ENKF_NCOMP" -#define USE_EE_KEY_ "USE_EE" -#define USE_GE_KEY_ "USE_GE" -#define ANALYSIS_SCALE_DATA_KEY_ "ANALYSIS_SCALE_DATA" - - typedef struct std_enkf_data_struct std_enkf_data_type; - - - bool std_enkf_set_double( void * arg , const char * var_name , double value); - - int std_enkf_get_subspace_dimension( std_enkf_data_type * data ); - void std_enkf_set_truncation( std_enkf_data_type * data , double truncation ); - void std_enkf_set_subspace_dimension( std_enkf_data_type * data , int subspace_dimension); - void std_enkf_set_lambda0( std_enkf_data_type * data , double lambda0 ); - bool std_enkf_has_var( const void * arg, const char * var_name); - - double std_enkf_get_truncation( std_enkf_data_type * data ); - void * std_enkf_data_alloc( rng_type * rng); - void std_enkf_data_free( void * module_data ); - - bool std_enkf_get_bool( const void * arg, const char * var_name); - int std_enkf_get_int( const void * arg, const char * var_name); - double std_enkf_get_double( const void * arg, const char * var_name); - bool std_enkf_has_var( const void * arg, const char * var_name); - long std_enkf_get_options( void * arg , long flag ); - bool std_enkf_set_bool( void * arg , const char * var_name , bool value); - bool std_enkf_set_int( void * arg , const char * var_name , int value); - bool std_enkf_set_double( void * arg , const char * var_name , double value); - void std_enkf_initX(void * module_data , - matrix_type * X , - matrix_type * A , - matrix_type * S , - matrix_type * R , - matrix_type * dObs , - matrix_type * E , - matrix_type * D); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libanalysis/modules/CMakeLists.txt b/ThirdParty/Ert/libanalysis/modules/CMakeLists.txt deleted file mode 100644 index 799d533169..0000000000 --- a/ThirdParty/Ert/libanalysis/modules/CMakeLists.txt +++ /dev/null @@ -1,49 +0,0 @@ -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) - -set( RML_SOURCE_FILES - rml_enkf_config.c - rml_enkf_log.c - rml_enkf.c - rml_enkf_common.c ) - -set( header_files analysis_module.h enkf_linalg.h analysis_table.h std_enkf.h rml_enkf_common.h) -add_library( rml_enkf SHARED ${RML_SOURCE_FILES} ) -add_library( std_enkf_debug SHARED std_enkf_debug.c ) - -set_target_properties( rml_enkf PROPERTIES VERSION 1.0 SOVERSION 1.0 PREFIX "") -set_target_properties( std_enkf_debug PROPERTIES VERSION 1.0 SOVERSION 1.0 PREFIX "") - -target_link_libraries( rml_enkf analysis dl ) -target_link_libraries( std_enkf_debug analysis dl ) - -if (USE_RUNPATH) - add_runpath( rml_enkf ) - add_runpath( std_enkf_debug ) -endif() - -if (BUILD_TESTS) - add_subdirectory( tests ) -endif() - -if (INSTALL_ERT) - install(TARGETS rml_enkf DESTINATION ${CMAKE_INSTALL_LIBDIR}) - install(TARGETS std_enkf_debug DESTINATION ${CMAKE_INSTALL_LIBDIR}) -endif() - - -#----------------------------------------------------------------- - -# Alternative script based build: -#if (BUILD_TESTS) -# if (BUILD_APPLICATIONS) -#set( args "--silent --exclude-ert -I${PROJECT_SOURCE_DIR}/libanalysis/include -I${PROJECT_SOURCE_DIR}/libert_util/include -I${CMAKE_CURRENT_SOURCE_DIR} -I${PROJECT_BINARY_DIR}/libert_util/include") - - -#set( RML_SOURCE_FILES -# rml_enkf.c -# rml_enkf_common.c ) - -#ert_module( ${LIBRARY_OUTPUT_PATH}/rml_enkf ${args} "${RML_SOURCE_FILES}") - - - diff --git a/ThirdParty/Ert/libanalysis/modules/deprecated/rml_enkf.c b/ThirdParty/Ert/libanalysis/modules/deprecated/rml_enkf.c deleted file mode 100644 index d86ca89341..0000000000 --- a/ThirdParty/Ert/libanalysis/modules/deprecated/rml_enkf.c +++ /dev/null @@ -1,427 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rml_enkf.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -/* - A random 'magic' integer id which is used for run-time type checking - of the input data. -*/ -#define RML_ENKF_TYPE_ID 261123 - - - - -/* - Observe that only one of the settings subspace_dimension and - truncation can be valid at a time; otherwise the svd routine will - fail. This implies that the set_truncation() and - set_subspace_dimension() routines will set one variable, AND - INVALIDATE THE OTHER. For most situations this will be OK, but if - you have repeated calls to both of these functions the end result - might be a surprise. -*/ -#define INVALID_SUBSPACE_DIMENSION -1 -#define INVALID_TRUNCATION -1 -#define DEFAULT_SUBSPACE_DIMENSION INVALID_SUBSPACE_DIMENSION - - - - - -/* - The configuration data used by the rml_enkf module is contained in a - rml_enkf_data_struct instance. The data type used for the rml_enkf - module is quite simple; with only a few scalar variables, but there - are essentially no limits to what you can pack into such a datatype. - - All the functions in the module have a void pointer as the first - argument, this will immediately be casted to a rml_enkf_data_type - instance, to get some type safety the UTIL_TYPE_ID system should be - used (see documentation in util.h) - - The data structure holding the data for your analysis module should - be created and initialized by a constructor, which should be - registered with the '.alloc' element of the analysis table; in the - same manner the desctruction of this data should be handled by a - destructor or free() function registered with the .freef field of - the analysis table. -*/ - - -typedef struct rml_enkf_data_struct rml_enkf_data_type; - -struct rml_enkf_data_struct { - UTIL_TYPE_ID_DECLARATION; - double truncation; // Controlled by config key: ENKF_TRUNCATION_KEY - int subspace_dimension; // Controlled by config key: ENKF_NCOMP_KEY (-1: use Truncation instead) - long option_flags; - - int iteration_nr; // Keep track of the outer iteration loop - double lambda; // parameter to control the search direction in Marquardt levenberg optimization - double lambda0; // Initial lambda value - double Sk; // Objective function value - double Std; // Standard Deviation of the Objective function - matrix_type *state; - bool_vector_type * ens_mask; -}; - - -/* - This is a macro which will expand to generate a function: - - rml_enkf_data_type * rml_enkf_data_safe_cast( void * arg ) {} - - which is used for runtime type checking of all the functions which - accept a void pointer as first argument. -*/ -static UTIL_SAFE_CAST_FUNCTION( rml_enkf_data , RML_ENKF_TYPE_ID ) -static UTIL_SAFE_CAST_FUNCTION_CONST( rml_enkf_data , RML_ENKF_TYPE_ID ) - - -double rml_enkf_get_truncation( rml_enkf_data_type * data ) { - return data->truncation; -} - -int rml_enkf_get_subspace_dimension( rml_enkf_data_type * data ) { - return data->subspace_dimension; -} - -void rml_enkf_set_truncation( rml_enkf_data_type * data , double truncation ) { - data->truncation = truncation; - if (truncation > 0.0) - data->subspace_dimension = INVALID_SUBSPACE_DIMENSION; -} - -void rml_enkf_set_lambda0(rml_enkf_data_type * data , double lambda0 ) { - data->lambda0 = lambda0; -} - -void rml_enkf_set_subspace_dimension( rml_enkf_data_type * data , int subspace_dimension) { - data->subspace_dimension = subspace_dimension; - if (subspace_dimension > 0) - data->truncation = INVALID_TRUNCATION; -} - -void rml_enkf_set_iteration_number( rml_enkf_data_type *data , int iteration_number ) { - data->iteration_nr = iteration_number; -} - - -void * rml_enkf_data_alloc( rng_type * rng) { - rml_enkf_data_type * data = util_malloc( sizeof * data ); - UTIL_TYPE_ID_INIT( data , RML_ENKF_TYPE_ID ); - - rml_enkf_set_truncation( data , DEFAULT_ENKF_TRUNCATION_ ); - rml_enkf_set_subspace_dimension( data , DEFAULT_SUBSPACE_DIMENSION ); - data->option_flags = ANALYSIS_NEED_ED + ANALYSIS_UPDATE_A + ANALYSIS_ITERABLE + ANALYSIS_SCALE_DATA; - data->iteration_nr = 0; - data->Std = 0; - data->state = matrix_alloc(1,1); // This will be resized under use; but we need a valid instance - data->lambda0 = -1.0; - data->ens_mask = bool_vector_alloc(0,false); - return data; -} - - -void rml_enkf_data_free( void * module_data ) { - rml_enkf_data_type * data = rml_enkf_data_safe_cast( module_data ); - matrix_free( data->state ); - bool_vector_free(data->ens_mask); - free( data ); -} - - - - - -/* - About the matrix Cd: The matrix Cd is calculated based on the content - of the E input matrix. In the original implementation this matrix was - only calculated in the first iteration, and then reused between subsequent - iterations. - - Due to deactivating outliers the number of active observations can change - from one iteration to the next, if the matrix Cd is then reused between - iterations we will get a matrix size mismatch in the linear algebra. In the - current implementation the Cd matrix is recalculated based on the E input - for each iteration. - */ - -void rml_enkf_updateA(void * module_data , - matrix_type * A , - matrix_type * S , - matrix_type * R , - matrix_type * dObs , - matrix_type * E , - matrix_type * D) { - - - rml_enkf_data_type * data = rml_enkf_data_safe_cast( module_data ); - double truncation = data->truncation; - double Sk_new; - double Std_new; - - int ens_size = matrix_get_columns( S ); - int nrobs = matrix_get_rows( S ); - matrix_type * Cd = matrix_alloc( nrobs , nrobs); - double nsc = 1/sqrt(ens_size-1); - matrix_type * Skm = matrix_alloc(matrix_get_columns(D),matrix_get_columns(D)); - FILE *fp = util_fopen("rml_enkf_output","a"); - - int nrmin = util_int_min( ens_size , nrobs); - matrix_type * Ud = matrix_alloc( nrobs , nrmin ); /* Left singular vectors. */ - matrix_type * VdT = matrix_alloc( nrmin , ens_size ); /* Right singular vectors. */ - double * Wd = util_calloc( nrmin , sizeof * Wd ); - - - Cd = matrix_alloc( nrobs, nrobs ); - enkf_linalg_Covariance(Cd ,E ,nsc, nrobs); - matrix_inv(Cd); - - if (data->iteration_nr == 0) { - Sk_new = enkf_linalg_data_mismatch(D,Cd,Skm); //Calculate the intitial data mismatch term - Std_new = matrix_diag_std(Skm,Sk_new); - rml_enkf_common_store_state( data->state , A , data->ens_mask ); - - - - if (data->lambda0 < 0) - data->lambda = pow(10,floor(log10(Sk_new/(2*nrobs)))); - else - data->lambda = data->lambda0; - - rml_enkf_common_initA__(A,S,Cd,E,D,truncation,data->lambda,Ud,Wd,VdT); - data->Sk = Sk_new; - data->Std = Std_new; - printf("Prior Objective function value is %5.3f \n", data->Sk); - - fprintf(fp,"Iteration number\t Lamda Value \t Current Mean (OB FN) \t Old Mean\t Current Stddev\n"); - fprintf(fp, "\n\n"); - fprintf(fp,"%d \t\t NA \t %5.5f \t \t %5.5f \n",data->iteration_nr, Sk_new, Std_new); - - } else { - Sk_new = enkf_linalg_data_mismatch(D , Cd , Skm); //Calculate the intitial data mismatch term - Std_new= matrix_diag_std(Skm,Sk_new); - printf(" Current Objective function value is %5.3f \n\n",Sk_new); - printf("The old Objective function value is %5.3f \n", data->Sk); - - - if ((Sk_new< (data->Sk)) && (Std_new< (data->Std))) - { - if ( (1- (Sk_new/data->Sk)) < .0001) // check convergence ** model change norm has to be added in this!! - data-> iteration_nr = 16; - - - fprintf(fp,"%d \t\t %5.5f \t %5.5f \t %5.5f \t %5.5f \n",data->iteration_nr,data->lambda, Sk_new,data->Sk, Std_new); - data->lambda = data->lambda / 10 ; - data->Std = Std_new; - - rml_enkf_common_store_state( data->state , A , data->ens_mask ); - - data->Sk = Sk_new; - rml_enkf_common_initA__(A,S,Cd,E,D,truncation,data->lambda,Ud,Wd,VdT); - } - else if((Sk_new< (data->Sk)) && (Std_new > (data->Std))) - { - if ( (1- (Sk_new/data->Sk)) < .0001) // check convergence ** model change norm has to be added in this!! - data-> iteration_nr = 16; - - - fprintf(fp,"%d \t\t %5.5f \t %5.5f \t %5.5f \t %5.5f \n",data->iteration_nr,data->lambda, Sk_new,data->Sk, Std_new); - data->Std=Std_new; - - rml_enkf_common_store_state( data->state , A , data->ens_mask ); - - data->Sk = Sk_new; - rml_enkf_common_initA__(A,S,Cd,E,D,truncation,data->lambda,Ud,Wd,VdT); - } - else { - fprintf(fp,"%d \t\t %5.5f \t %5.5f \t %5.5f \t %5.5f \n",data->iteration_nr,data->lambda, Sk_new,data->Sk, Std_new); - printf("The previous step is rejected !!\n"); - data->lambda = data ->lambda * 4; - - rml_enkf_common_recover_state( data->state , A , data->ens_mask ); - - rml_enkf_common_initA__(A,S,Cd,E,D,truncation,data->lambda,Ud,Wd,VdT); - data->iteration_nr--; - } - } - data->iteration_nr++; - - // setting the lower bound for lambda - if (data->lambda <.01) - data->lambda= .01; - - - printf ("The current iteration number is %d \n ", data->iteration_nr); - - - matrix_free(Cd); - matrix_free(Ud); - matrix_free(VdT); - matrix_free(Skm); - free(Wd); - fclose(fp); -} - - -void rml_enkf_init_update(void * arg , - const bool_vector_type * ens_mask , - const matrix_type * S , - const matrix_type * R , - const matrix_type * dObs , - const matrix_type * E , - const matrix_type * D ) { - rml_enkf_data_type * module_data = rml_enkf_data_safe_cast( arg ); - bool_vector_memcpy( module_data->ens_mask , ens_mask ); -} - - - -bool rml_enkf_set_double( void * arg , const char * var_name , double value) { - rml_enkf_data_type * module_data = rml_enkf_data_safe_cast( arg ); - { - bool name_recognized = true; - - if (strcmp( var_name , ENKF_TRUNCATION_KEY_) == 0) - rml_enkf_set_truncation( module_data , value ); - else if (strcmp( var_name , ENKF_LAMBDA0_KEY_) == 0) - rml_enkf_set_lambda0( module_data , value ); - else - name_recognized = false; - - return name_recognized; - } -} - - -bool rml_enkf_set_int( void * arg , const char * var_name , int value) { - rml_enkf_data_type * module_data = rml_enkf_data_safe_cast( arg ); - { - bool name_recognized = true; - - if (strcmp( var_name , ENKF_NCOMP_KEY_) == 0) - rml_enkf_set_subspace_dimension( module_data , value ); - else if(strcmp( var_name , ENKF_ITER_KEY_) == 0) - rml_enkf_set_iteration_number( module_data , value ); - else - name_recognized = false; - - return name_recognized; - } -} - - -long rml_enkf_get_options( void * arg , long flag ) { - rml_enkf_data_type * module_data = rml_enkf_data_safe_cast( arg ); - { - return module_data->option_flags; - } -} - - - - bool rml_enkf_has_var( const void * arg, const char * var_name) { - bool ret = false; - - if ((strcmp(var_name , ENKF_ITER_KEY_) == 0) || - (strcmp(var_name , ENKF_TRUNCATION_KEY_) == 0) || - (strcmp(var_name , ENKF_LAMBDA0_KEY_) == 0)) { - ret = true; - } - return ret; - } - - - - - int rml_enkf_get_int( const void * arg, const char * var_name) { - const rml_enkf_data_type * module_data = rml_enkf_data_safe_cast_const( arg ); - { - if (strcmp(var_name , ENKF_ITER_KEY_) == 0) - return module_data->iteration_nr; - else - return -1; - } - } - - double rml_enkf_get_double( const void * arg, const char * var_name) { - const rml_enkf_data_type * module_data = rml_enkf_data_safe_cast_const( arg ); - { - if (strcmp(var_name , ENKF_TRUNCATION_KEY_) == 0) - return module_data->truncation; - else if (strcmp(var_name , ENKF_LAMBDA0_KEY_) == 0) - return module_data->lambda0; - else - return -1.0; - } - } - - - - -/** - gcc -fpic -c -I?? - gcc -shared -o -*/ - - - -#ifdef INTERNAL_LINK -#define SYMBOL_TABLE rml_enkf_symbol_table -#else -#define SYMBOL_TABLE EXTERNAL_MODULE_SYMBOL -#endif - - -analysis_table_type SYMBOL_TABLE = { - .alloc = rml_enkf_data_alloc, - .freef = rml_enkf_data_free, - .set_int = rml_enkf_set_int , - .set_double = rml_enkf_set_double , - .set_bool = NULL , - .set_string = NULL , - .get_options = rml_enkf_get_options , - .initX = NULL, - .updateA = rml_enkf_updateA , - .init_update = rml_enkf_init_update , - .complete_update = NULL, - .has_var = rml_enkf_has_var, - .get_int = rml_enkf_get_int, - .get_double = rml_enkf_get_double, - .get_ptr = NULL, -}; - diff --git a/ThirdParty/Ert/libanalysis/modules/rml_enkf.c b/ThirdParty/Ert/libanalysis/modules/rml_enkf.c deleted file mode 100644 index efba06b83d..0000000000 --- a/ThirdParty/Ert/libanalysis/modules/rml_enkf.c +++ /dev/null @@ -1,824 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rml_enkf.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -typedef struct rml_enkf_data_struct rml_enkf_data_type; - - - -//********************************************** -// DEFAULT PARAMS -//********************************************** -/* - Observe that only one of the settings subspace_dimension and - truncation can be valid at a time; otherwise the svd routine will - fail. This implies that the set_truncation() and - set_subspace_dimension() routines will set one variable, AND - INVALIDATE THE OTHER. For most situations this will be OK, but if - you have repeated calls to both of these functions the end result - might be a surprise. -*/ - - - -#define USE_PRIOR_KEY "USE_PRIOR" -#define LAMBDA_REDUCE_FACTOR_KEY "LAMBDA_REDUCE" -#define LAMBDA_INCREASE_FACTOR_KEY "LAMBDA_INCREASE" -#define LAMBDA0_KEY "LAMBDA0" -#define LAMBDA_MIN_KEY "LAMBDA_MIN" -#define LAMBDA_RECALCULATE_KEY "LAMBDA_RECALCULATE" -#define ITER_KEY "ITER" -#define LOG_FILE_KEY "LOG_FILE" -#define CLEAR_LOG_KEY "CLEAR_LOG" - - - - -#define RML_ENKF_TYPE_ID 261123 - - -//********************************************** -// RML "object" data definition -//********************************************** -/* - The configuration data used by the rml_enkf module is contained in a - rml_enkf_data_struct instance. The data type used for the rml_enkf - module is quite simple; with only a few scalar variables, but there - are essentially no limits to what you can pack into such a datatype. - - All the functions in the module have a void pointer as the first - argument, this will immediately be casted to a rml_enkf_data_type - instance, to get some type safety the UTIL_TYPE_ID system should be - used (see documentation in util.h) - - The data structure holding the data for your analysis module should - be created and initialized by a constructor, which should be - registered with the '.alloc' element of the analysis table; in the - same manner the desctruction of this data should be handled by a - destructor or free() function registered with the .freef field of - the analysis table. -*/ - - - - - -struct rml_enkf_data_struct { - UTIL_TYPE_ID_DECLARATION; - - int iteration_nr; // Keep track of the outer iteration loop - double Sk; // Objective function value - double Std; // Standard Deviation of the Objective function - double * Csc; - bool_vector_type * ens_mask; - - matrix_type *Am; // Scaled right singular vectors of ensemble anomalies. - - matrix_type *global_prior; // m_pr - matrix_type *previous_state; // m_l - - - double lambda; // parameter to control the setp length in Marquardt levenberg optimization - - - rml_enkf_log_type * rml_log; - rml_enkf_config_type * config; -}; - - - -static UTIL_SAFE_CAST_FUNCTION( rml_enkf_data , RML_ENKF_TYPE_ID ) -static UTIL_SAFE_CAST_FUNCTION_CONST( rml_enkf_data , RML_ENKF_TYPE_ID ) - - - - - - -//********************************************** -// Set / Get -//********************************************** - - -void rml_enkf_set_iteration_nr( rml_enkf_data_type * data , int iteration_nr) { - data->iteration_nr = iteration_nr; -} - -int rml_enkf_get_iteration_nr( const rml_enkf_data_type * data ) { - return data->iteration_nr; -} - - - - - -//********************************************** -// Log-file related stuff -//********************************************** - - -static void rml_enkf_write_log_header( rml_enkf_data_type * data, const char * format) { - if (rml_enkf_log_is_open( data->rml_log )) { - const char * column1 = "Iter#"; - const char * column2 = "Lambda"; - const char * column3 = "Sk old"; - const char * column4 = "Sk_new"; - const char * column5 = "std(Sk)"; - - rml_enkf_log_line(data->rml_log, format, column1, column2, column3, column4, column5); - } -} - -static void rml_enkf_write_iter_info( rml_enkf_data_type * data , double prev_Sk , double Sk_new, double Std_new ) { - if (rml_enkf_log_is_open( data->rml_log )) { - - const char * format = "\n%2d-->%-2d %-7.3f %-7.3f --> %-7.3f %-7.3f"; - const char * format_headers = "\n%-7s %-7s %-7s --> %-7s %-7s"; - static bool has_printed_header = false; - - if (!has_printed_header) { - rml_enkf_write_log_header( data, format_headers ); - has_printed_header = true; - } - - rml_enkf_log_line( data->rml_log , format, data->iteration_nr, data->iteration_nr+1, data->lambda, prev_Sk, Sk_new, Std_new); - } -} - - - - - -//********************************************** -// Memory -//********************************************** -void * rml_enkf_data_alloc( rng_type * rng) { - rml_enkf_data_type * data = util_malloc( sizeof * data); - UTIL_TYPE_ID_INIT( data , RML_ENKF_TYPE_ID ); - - data->config = rml_enkf_config_alloc(); - data->rml_log = rml_enkf_log_alloc(); - - data->Csc = NULL; - data->iteration_nr = 0; - data->Std = 0; - data->previous_state = matrix_alloc(1,1); - data->global_prior = NULL; - data->ens_mask = NULL; - return data; -} - -void rml_enkf_data_free( void * arg ) { - rml_enkf_data_type * data = rml_enkf_data_safe_cast( arg ); - - matrix_free( data->previous_state ); - if (data->global_prior) - matrix_free( data->global_prior ); - - rml_enkf_log_free( data->rml_log ); - rml_enkf_config_free( data->config ); - free( data ); -} - - - - - -//********************************************** -// Notation -//********************************************** -/* - * X1-X7, intermediate calculations in iterations. See D.Oliver algorithm - * - * Variable name in code <-> D.Oliver notation <-> Description - * ------------------------------------------------------------------------------------------------------------- - * A <-> m_l <-> Ensemble matrix. Updated in-place by iterations. - * data->previous_state <-> m_(l-1) <-> "A" from the previous iteration. Backs up A in case the update is bad. - * data->global_prior <-> <-> Previously: "active_prior". Stores A from before iter0, i.e. the actual prior. - * Acopy <-> <-> Eliminated from code. Copy of A (at each iteration, before acceptance/rejection decision) - - * - * Am <-> A_m <-> Am = Um*Wm^(-1) - * Csc <-> C_sc^(1/2) <-> State scalings. Note the square root. - * Dm (in init1__) <-> Delta m <-> Anomalies of prior wrt. its mean (row i scaled by 1/(Csc[i]*sqrt(N-1))) - * Dm (in initA__) <-> Csc * Delta m <-> Anomalies of A wrt. its mean (only scaled by 1/sqrt(N-1)) - * Dk1 (in init2__) <-> Delta m <-> Anomailes of A (row i scaled by 1/(Csc[i]*sqrt(N-1))) - * Dk (in init2__) <-> C_sc^(-1) * (m - m_pr ) <-> Anomalies wrt. prior (as opposed to the mean; only scaled by Csc) - * dA1 (in initA__) <-> delta m_1 <-> Ensemble updates coming from data mismatch - * dA2 (in init2__) <-> delta m_2 <-> Ensemble updates coming from prior mismatch -*/ - - - - -//********************************************** -// Actual Algorithm, called through updateA() -//********************************************** - -// Just (pre)calculates data->Am = Um*Wm^(-1). -static void rml_enkf_init1__( rml_enkf_data_type * data) { - // Differentiate this routine from init2__, which actually calculates the prior mismatch update. - // This routine does not change any ensemble matrix. - // Um*Wm^(-1) are the scaled, truncated, right singular vectors of data->global_prior - - matrix_type * prior = matrix_alloc_column_compressed_copy( data->global_prior , data->ens_mask); - int state_size = matrix_get_rows( prior ); - int ens_size = matrix_get_columns( prior ); - int nrmin = util_int_min( ens_size , state_size); - matrix_type * Dm = matrix_alloc_copy( prior ); - matrix_type * Um = matrix_alloc( state_size , nrmin ); /* Left singular vectors. */ - matrix_type * VmT = matrix_alloc( nrmin , ens_size ); /* Right singular vectors. */ - double * Wm = util_calloc( nrmin , sizeof * Wm ); - double nsc = 1/sqrt(ens_size - 1); - - matrix_subtract_row_mean(Dm); - { - const double * Csc = data->Csc; - for (int i=0; i < state_size; i++){ - double sc = nsc / (Csc[i]); - matrix_scale_row( Dm , i , sc); - } - } - - // Um Wm VmT = Dm; nsign1 = num of non-zero singular values. - int nsign1 = enkf_linalg_svd_truncation(Dm , rml_enkf_config_get_truncation( data->config ) , -1 , DGESVD_MIN_RETURN , Wm , Um , VmT); - - // Am = Um*Wm^(-1). I.e. scale *columns* of Um - enkf_linalg_rml_enkfAm(Um, Wm, nsign1); - - data->Am = matrix_alloc_copy( Um ); - matrix_free(Um); - matrix_free(VmT); - matrix_free(Dm); - matrix_free(prior); - free(Wm); -} - - - -// Creates state scaling matrix -void rml_enkf_init_Csc(const rml_enkf_data_type * data ){ - // This seems a strange choice of scaling matrix. Review? - matrix_type * prior = matrix_alloc_column_compressed_copy( data->global_prior , data->ens_mask ); - { - int state_size = matrix_get_rows( prior ); - int ens_size = matrix_get_columns( prior ); - - for (int row=0; row < state_size; row++) { - double sumrow = matrix_get_row_sum(prior , row); - double tmp = sumrow / ens_size; - - if (abs(tmp)< 1) - data->Csc[row] = 0.05; - else - data->Csc[row] = 1.00; - - } - matrix_free( prior ); - } -} - -// Calculates update from data mismatch (delta m_1). Also provides SVD for later use. -static void rml_enkf_initA__(rml_enkf_data_type * data, matrix_type * A, matrix_type * S, matrix_type * Cd, matrix_type * E, matrix_type * D, matrix_type * Udr, double * Wdr, matrix_type * VdTr) { - - int ens_size = matrix_get_columns( S ); - int state_size = matrix_get_rows( A ); - double nsc = 1/sqrt(ens_size-1); - int nsign; - - // Perform SVD of tmp, where: tmp = diag_sqrt(Cd^(-1)) * centered(S) / sqrt(N-1) = Ud * Wd * Vd(T) - { - int nrobs = matrix_get_rows( S ); - matrix_type *tmp = matrix_alloc (nrobs, ens_size); - matrix_subtract_row_mean( S ); // Center S - matrix_inplace_diag_sqrt(Cd); // Assumes that Cd is diag! - matrix_matmul(tmp , Cd , S ); // - matrix_scale(tmp , nsc); // - - nsign = enkf_linalg_svd_truncation(tmp , rml_enkf_config_get_truncation( data->config ) , -1 , DGESVD_MIN_RETURN , Wdr , Udr , VdTr); - matrix_free( tmp ); - } - - // Calc X3 - { - matrix_type * X3 = matrix_alloc( ens_size, ens_size ); - { - matrix_type * X1 = matrix_alloc( nsign, ens_size); - matrix_type * X2 = matrix_alloc( nsign, ens_size ); - - - // See LM-EnRML algorithm in Oliver'2013 (Comp. Geo.) for meaning - enkf_linalg_rml_enkfX1(X1, Udr ,D ,Cd ); // X1 = Ud(T)*Cd(-1/2)*D -- D= -(dk-d0) - enkf_linalg_rml_enkfX2(X2, Wdr ,X1 ,data->lambda + 1 , nsign); // X2 = ((a*Ipd)+Wd^2)^-1 * X1 - enkf_linalg_rml_enkfX3(X3, VdTr ,Wdr,X2, nsign); // X3 = Vd *Wd*X2 - - matrix_free(X2); - matrix_free(X1); - } - - // Update A - { - matrix_type * dA1 = matrix_alloc( state_size , ens_size); - matrix_type * Dm = matrix_alloc_copy( A ); - - matrix_subtract_row_mean( Dm ); /* Remove the mean from the ensemble of model parameters*/ - matrix_scale(Dm, nsc); - - matrix_matmul(dA1, Dm , X3); - matrix_inplace_add(A,dA1); // dA - - matrix_free(Dm); - matrix_free(dA1); - } - matrix_free(X3); - - } -} - -// Calculate prior mismatch update (delta m_2). -void rml_enkf_init2__( rml_enkf_data_type * data, matrix_type *A, double * Wdr, matrix_type * VdTr) { - // Distinguish from init1__ which only makes preparations, and is only called at iter=0 - - - int state_size = matrix_get_rows( A ); - int ens_size = matrix_get_columns( A ); - double nsc = 1/sqrt(ens_size-1); - - matrix_type *Am = matrix_alloc_copy(data->Am); - matrix_type *Apr = matrix_alloc_column_compressed_copy(data->global_prior , data->ens_mask ); - - // fprintf(stdout,"\n"); - // fprintf(stdout,"A: %d x %d\n", matrix_get_rows(A), matrix_get_columns(A)); - // fprintf(stdout,"prior : %d x %d\n", matrix_get_rows(data->global_prior), matrix_get_columns(data->global_prior)); - // fprintf(stdout,"state : %d x %d\n", matrix_get_rows(data->previous_state), matrix_get_columns(data->previous_state)); - // fprintf(stdout,"Apr : %d x %d\n", matrix_get_rows(Apr), matrix_get_columns(Apr)); - // fprintf(stdout,"Am : %d x %d\n", matrix_get_rows(Am), matrix_get_columns(Am)); - // Example: - // A : 27760 x 10 - // prior : 27760 x 10 - // state : 27760 x 50 - // prior0 : 27760 x 50 - // Apr : 27760 x 10 - // Am : 27760 x 1 - - - int nsign1 = matrix_get_columns(data->Am); - - - matrix_type * X4 = matrix_alloc(nsign1,ens_size); - matrix_type * X5 = matrix_alloc(state_size,ens_size); - matrix_type * X6 = matrix_alloc(ens_size,ens_size); - matrix_type * X7 = matrix_alloc(ens_size,ens_size); - matrix_type * dA2 = matrix_alloc(state_size , ens_size); - matrix_type * Dk1 = matrix_alloc_copy( A ); - - // Dk = Csc^(-1) * (A - Aprior) - // X4 = Am' * Dk - { - matrix_type * Dk = matrix_alloc_copy( A ); - - matrix_inplace_sub( Dk , Apr ); - rml_enkf_common_scaleA(Dk , data->Csc , true); - - matrix_dgemm(X4 , Am , Dk , true, false, 1.0, 0.0); - matrix_free(Dk); - } - // X5 = Am * X4 - matrix_matmul(X5 , Am , X4); - - // Dk1 = Csc^(-1)/sqrt(N-1) * A*(I - 1/N*ones(m,N)) - matrix_subtract_row_mean(Dk1); // Dk1 = Dk1 * (I - 1/N*ones(m,N)) - rml_enkf_common_scaleA(Dk1 , data->Csc , true); // Dk1 = Csc^(-1) * Dk1 - matrix_scale(Dk1,nsc); // Dk1 = Dk1 / sqrt(N-1) - - // X6 = Dk1' * X5 - matrix_dgemm(X6, Dk1, X5, true, false, 1.0, 0.0); - - // X7 - enkf_linalg_rml_enkfX7(X7, VdTr , Wdr , data->lambda + 1, X6); - - // delta m_2 - rml_enkf_common_scaleA(Dk1 , data->Csc , false); - matrix_matmul(dA2 , Dk1 , X7); - matrix_inplace_sub(A, dA2); - - matrix_free(Am); - matrix_free(Apr); - matrix_free(X4); - matrix_free(X5); - matrix_free(X6); - matrix_free(X7); - matrix_free(dA2); - matrix_free(Dk1); -} - -// Initialize state and prior from A. Initialize lambda0, lambda. Call initA__, init1__ -static void rml_enkf_updateA_iter0(rml_enkf_data_type * data, matrix_type * A, matrix_type * S, matrix_type * R, matrix_type * dObs, matrix_type * E, matrix_type * D, matrix_type * Cd) { - - int ens_size = matrix_get_columns( S ); - int nrobs = matrix_get_rows( S ); - int nrmin = util_int_min( ens_size , nrobs); - int state_size = matrix_get_rows( A ); - matrix_type * Skm = matrix_alloc(ens_size, ens_size); // Mismatch - matrix_type * Ud = matrix_alloc( nrobs , nrmin ); /* Left singular vectors. */ - matrix_type * VdT = matrix_alloc( nrmin , ens_size ); /* Right singular vectors. */ - double * Wd = util_calloc( nrmin , sizeof * Wd ); - - data->Csc = util_calloc(state_size , sizeof * data->Csc); - data->Sk = enkf_linalg_data_mismatch(D,Cd,Skm); - data->Std = matrix_diag_std(Skm,data->Sk); - - { - double lambda0 = rml_enkf_config_get_lambda0( data->config ); - if (lambda0 < 0) - data->lambda = pow(10 , floor(log10(data->Sk/(2*nrobs))) ); - else - data->lambda = lambda0; - } - - - // state = A - rml_enkf_common_store_state( data->previous_state , A , data->ens_mask ); - - // prior = A - data->global_prior = matrix_alloc_copy( data->previous_state ); - - // Update dependant on data mismatch - rml_enkf_initA__(data , A, S , Cd , E , D , Ud , Wd , VdT); - // Update dependant on prior mismatch. This should be zero (coz iter0). - // Therefore the purpose of init1__ is just to prepare some matrices. - if (rml_enkf_config_get_use_prior(data->config)) { - rml_enkf_init_Csc( data ); - rml_enkf_init1__( data ); - } - - rml_enkf_write_iter_info(data, data->Sk , data->Sk, data->Std); - - matrix_free( Skm ); - matrix_free( Ud ); - matrix_free( VdT ); - free( Wd ); -} - - -void rml_enkf_updateA(void * module_data, matrix_type * A, matrix_type * S, matrix_type * R, matrix_type * dObs, matrix_type * E, matrix_type * D, const module_info_type* module_info) { -// A : ensemble matrix -// R : (Inv?) Obs error cov. -// S : measured ensemble -// dObs: observed data -// E : perturbations for obs -// D = dObs + E - S : Innovations (wrt pert. obs) -// module_info: Information on parameters/data for internal logging - - - - double Sk_new; // Mismatch - double Std_new; // Std dev(Mismatch) - rml_enkf_data_type * data = rml_enkf_data_safe_cast( module_data ); - int nrobs = matrix_get_rows( S ); // Num obs - int ens_size = matrix_get_columns( S ); // N - double nsc = 1/sqrt(ens_size-1); // Scale factor - matrix_type * Cd = matrix_alloc( nrobs, nrobs ); // Cov(E), where E = measurement perturbations? - - - // Empirical error covar. R is left unused. Investigate? - enkf_linalg_Covariance(Cd ,E ,nsc, nrobs); // Cd = SampCov(E) (including (N-1) normalization) - matrix_inv(Cd); // In-place inversion - - rml_enkf_log_open(data->rml_log , data->iteration_nr); - fprintf(stdout,"\nIter %d --> %d", data->iteration_nr, data->iteration_nr + 1); - - - if (data->iteration_nr == 0) { - // IF ITERATION 0 - rml_enkf_updateA_iter0(data , A , S , R , dObs , E , D , Cd); - data->iteration_nr++; - } else { - // IF ITERATION 1, 2, ... - int nrmin = util_int_min( ens_size , nrobs); // Min(p,N) - matrix_type * Ud = matrix_alloc( nrobs , nrmin ); // Left singular vectors. */ - matrix_type * VdT = matrix_alloc( nrmin , ens_size ); // Right singular vectors. */ - double * Wd = util_calloc( nrmin , sizeof * Wd ); // Singular values, vector - matrix_type * Skm = matrix_alloc(ens_size,ens_size); // Mismatch - Sk_new = enkf_linalg_data_mismatch(D,Cd,Skm); // Skm = D'*inv(Cd)*D; Sk_new = trace(Skm)/N - Std_new = matrix_diag_std(Skm,Sk_new); // Standard deviation of mismatches. - - - // Lambda = Normalized data mismatch (rounded) - if (rml_enkf_config_get_lambda_recalculate( data->config )) - data->lambda = pow(10 , floor(log10(Sk_new / (2*nrobs))) ); - - // Accept/Reject update? Lambda calculation. - { - bool mismatch_reduced = false; - bool std_reduced = false; - - if (Sk_new < data->Sk) - mismatch_reduced = true; - - if (Std_new <= data->Std) - std_reduced = true; - - rml_enkf_write_iter_info(data, data->Sk , Sk_new, Std_new); - - if (mismatch_reduced) { - /* - Stop check: if ( (1- (Sk_new/data->Sk)) < .0001) // check convergence ** model change norm has to be added in this!! - */ - - // Reduce Lambda - if (std_reduced) - data->lambda = data->lambda * rml_enkf_config_get_lambda_decrease_factor( data->config ); - - rml_enkf_common_store_state(data->previous_state , A , data->ens_mask ); - - data->Sk = Sk_new; - data->Std=Std_new; - data->iteration_nr++; - } else { - // Increase lambda - data->lambda = data->lambda * rml_enkf_config_get_lambda_increase_factor( data->config ); - // A = data->previous_state - rml_enkf_common_recover_state( data->previous_state , A , data->ens_mask ); - } - } - - // Update dependant on data mismatch (delta m_1) - rml_enkf_initA__(data , A , S , Cd , E , D , Ud , Wd , VdT); - - // Update dependant on prior mismatch (delta m_2) - if (rml_enkf_config_get_use_prior(data->config)) { - rml_enkf_init_Csc( data ); - rml_enkf_init2__(data , A , Wd , VdT); - } - - // Free - matrix_free(Skm); - matrix_free( Ud ); - matrix_free( VdT ); - free( Wd ); - } - - { - double lambda_min = rml_enkf_config_get_lambda_min( data->config ); - if (data->lambda < lambda_min) - data->lambda = lambda_min; - } - - - rml_enkf_log_close( data->rml_log ); - matrix_free(Cd); -} - - - -void rml_enkf_init_update(void * arg, const bool_vector_type * ens_mask, const matrix_type * S, const matrix_type * R, const matrix_type * dObs, const matrix_type * E, const matrix_type * D ) { - rml_enkf_data_type * module_data = rml_enkf_data_safe_cast( arg ); - - if (module_data->ens_mask) - bool_vector_free( module_data->ens_mask ); - - module_data->ens_mask = bool_vector_alloc_copy( ens_mask ); -} - - - - - - - -//********************************************** -// Set / Get basic types -//********************************************** -bool rml_enkf_set_int( void * arg , const char * var_name , int value) { - rml_enkf_data_type * module_data = rml_enkf_data_safe_cast( arg ); - { - bool name_recognized = true; - - if (strcmp( var_name , ENKF_NCOMP_KEY_) == 0) - rml_enkf_config_set_subspace_dimension(module_data->config , value); - else if (strcmp( var_name , ITER_KEY) == 0) - rml_enkf_set_iteration_nr( module_data , value ); - else - name_recognized = false; - - return name_recognized; - } -} - -int rml_enkf_get_int( const void * arg, const char * var_name) { - const rml_enkf_data_type * module_data = rml_enkf_data_safe_cast_const( arg ); - { - if (strcmp(var_name , ITER_KEY) == 0) - return module_data->iteration_nr; - else - return -1; - } -} - -bool rml_enkf_set_bool( void * arg , const char * var_name , bool value) { - rml_enkf_data_type * module_data = rml_enkf_data_safe_cast( arg ); - { - bool name_recognized = true; - - if (strcmp( var_name , USE_PRIOR_KEY) == 0) - rml_enkf_config_set_use_prior( module_data->config , value); - else if (strcmp( var_name , CLEAR_LOG_KEY) == 0) - rml_enkf_log_set_clear_log( module_data->rml_log , value ); - else if (strcmp( var_name , LAMBDA_RECALCULATE_KEY) == 0) - rml_enkf_config_set_lambda_recalculate( module_data->config , value ); - else - name_recognized = false; - - return name_recognized; - } -} - -bool rml_enkf_get_bool( const void * arg, const char * var_name) { - const rml_enkf_data_type * module_data = rml_enkf_data_safe_cast_const( arg ); - { - if (strcmp(var_name , USE_PRIOR_KEY) == 0) - return rml_enkf_config_get_use_prior( module_data->config ); - else if (strcmp(var_name , CLEAR_LOG_KEY) == 0) - return rml_enkf_log_get_clear_log( module_data->rml_log ); - else if (strcmp(var_name , LAMBDA_RECALCULATE_KEY) == 0) - return rml_enkf_config_get_lambda_recalculate( module_data->config ); - else - return false; - } -} - -bool rml_enkf_set_double( void * arg , const char * var_name , double value) { - rml_enkf_data_type * module_data = rml_enkf_data_safe_cast( arg ); - { - bool name_recognized = true; - - if (strcmp( var_name , ENKF_TRUNCATION_KEY_) == 0) - rml_enkf_config_set_truncation( module_data->config , value ); - else if (strcmp( var_name , LAMBDA_INCREASE_FACTOR_KEY) == 0) - rml_enkf_config_set_lambda_increase_factor( module_data->config , value ); - else if (strcmp( var_name , LAMBDA_REDUCE_FACTOR_KEY) == 0) - rml_enkf_config_set_lambda_decrease_factor( module_data->config , value ); - else if (strcmp( var_name , LAMBDA0_KEY) == 0) - rml_enkf_config_set_lambda0( module_data->config , value ); - else if (strcmp( var_name , LAMBDA_MIN_KEY) == 0) - rml_enkf_config_set_lambda_min( module_data->config , value ); - else - name_recognized = false; - - return name_recognized; - } -} - -double rml_enkf_get_double( const void * arg, const char * var_name) { - const rml_enkf_data_type * module_data = rml_enkf_data_safe_cast_const( arg ); - { - if (strcmp(var_name , LAMBDA_REDUCE_FACTOR_KEY) == 0) - return rml_enkf_config_get_lambda_decrease_factor(module_data->config); - - if (strcmp(var_name , LAMBDA_INCREASE_FACTOR_KEY) == 0) - return rml_enkf_config_get_lambda_increase_factor(module_data->config); - - if (strcmp(var_name , LAMBDA0_KEY) == 0) - return rml_enkf_config_get_lambda0(module_data->config); - - if (strcmp(var_name , LAMBDA_MIN_KEY) == 0) - return rml_enkf_config_get_lambda_min(module_data->config); - - if (strcmp(var_name , ENKF_TRUNCATION_KEY_) == 0) - return rml_enkf_config_get_truncation( module_data->config ); - - return -1; - } -} - - -bool rml_enkf_set_string( void * arg , const char * var_name , const char * value) { - rml_enkf_data_type * module_data = rml_enkf_data_safe_cast( arg ); - { - bool name_recognized = true; - - if (strcmp( var_name , LOG_FILE_KEY) == 0) - rml_enkf_log_set_log_file( module_data->rml_log , value ); - else - name_recognized = false; - - return name_recognized; - } -} - -long rml_enkf_get_options( void * arg , long flag ) { - rml_enkf_data_type * module_data = rml_enkf_data_safe_cast( arg ); - { - return rml_enkf_config_get_option_flags( module_data->config ); - } -} - -bool rml_enkf_has_var( const void * arg, const char * var_name) { - { - if (strcmp(var_name , ITER_KEY) == 0) - return true; - else if (strcmp(var_name , USE_PRIOR_KEY) == 0) - return true; - else if (strcmp(var_name , LAMBDA_INCREASE_FACTOR_KEY) == 0) - return true; - else if (strcmp(var_name , LAMBDA_REDUCE_FACTOR_KEY) == 0) - return true; - else if (strcmp(var_name , LAMBDA0_KEY) == 0) - return true; - else if (strcmp(var_name , LAMBDA_MIN_KEY) == 0) - return true; - else if (strcmp(var_name , LAMBDA_RECALCULATE_KEY) == 0) - return true; - else if (strcmp(var_name , ENKF_TRUNCATION_KEY_) == 0) - return true; - else if (strcmp(var_name , LOG_FILE_KEY) == 0) - return true; - else if (strcmp(var_name , CLEAR_LOG_KEY) == 0) - return true; - else - return false; - } -} - -void * rml_enkf_get_ptr( const void * arg , const char * var_name ) { - const rml_enkf_data_type * module_data = rml_enkf_data_safe_cast_const( arg ); - { - if (strcmp(var_name , LOG_FILE_KEY) == 0) - return (void *) rml_enkf_log_get_log_file( module_data->rml_log ); - else - return NULL; - } -} - - - - - - -//********************************************** -// Symbol table -//********************************************** -#ifdef INTERNAL_LINK -#define LINK_NAME RML_ENKF -#else -#define LINK_NAME EXTERNAL_MODULE_SYMBOL -#endif - - -analysis_table_type LINK_NAME = { - .name = "RML_ENKF", - .alloc = rml_enkf_data_alloc, - .freef = rml_enkf_data_free, - .set_int = rml_enkf_set_int , - .set_double = rml_enkf_set_double , - .set_bool = rml_enkf_set_bool, - .set_string = rml_enkf_set_string, - .get_options = rml_enkf_get_options , - .initX = NULL, - .updateA = rml_enkf_updateA , - .init_update = rml_enkf_init_update , - .complete_update = NULL, - .has_var = rml_enkf_has_var, - .get_int = rml_enkf_get_int, - .get_double = rml_enkf_get_double, - .get_bool = rml_enkf_get_bool, - .get_ptr = rml_enkf_get_ptr, -}; - diff --git a/ThirdParty/Ert/libanalysis/modules/rml_enkf_common.c b/ThirdParty/Ert/libanalysis/modules/rml_enkf_common.c deleted file mode 100644 index fdc541bfbc..0000000000 --- a/ThirdParty/Ert/libanalysis/modules/rml_enkf_common.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rml_enkf.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include - - -// Explanation -// zzz_enkf_common_store_state( state , A ,ens_mask) assigns A to state. RESIZES state to rows(A)-by-LEN(ens_mask) -// zzz_enkf_common_recover_state(state , A ,ens_mask) assigns state to A. RESIZES A to rows(state)-by-SUM(ens_mask) - - -void rml_enkf_common_store_state( matrix_type * state , const matrix_type * A , const bool_vector_type * ens_mask ) { - matrix_resize( state , matrix_get_rows( A ) , bool_vector_size( ens_mask ) , false); - { - const int ens_size = bool_vector_size( ens_mask ); - int active_index = 0; - for (int iens = 0; iens < ens_size; iens++) { - if (bool_vector_iget( ens_mask , iens )) { - matrix_copy_column( state , A , iens , active_index ); - active_index++; - } else - matrix_set_const_column( state , iens , 0); - } - } -} - - - -void rml_enkf_common_recover_state( const matrix_type * state , matrix_type * A , const bool_vector_type * ens_mask ) { - const int ens_size = bool_vector_size( ens_mask ); - const int active_size = bool_vector_count_equal( ens_mask , true ); - const int rows = matrix_get_rows( state ); - - matrix_resize( A , rows , active_size , false ); - { - int active_index = 0; - for (int iens = 0; iens < ens_size; iens++) { - if (bool_vector_iget( ens_mask , iens )) { - matrix_copy_column( A , state , active_index , iens ); - active_index++; - } - } - } -} - - - -// Scale rows by the entries in the vector Csc -void rml_enkf_common_scaleA(matrix_type *A , const double * Csc, bool invert ){ - int nrows = matrix_get_rows(A); - if (invert) { - for (int i=0; i< nrows ; i++) { - double sc= 1/Csc[i]; - matrix_scale_row(A, i, sc); - } - } else { - for (int i=0; i< nrows ; i++) { - double sc= Csc[i]; - matrix_scale_row(A, i, sc); - } - } -} diff --git a/ThirdParty/Ert/libanalysis/modules/rml_enkf_common.h b/ThirdParty/Ert/libanalysis/modules/rml_enkf_common.h deleted file mode 100644 index f288b56419..0000000000 --- a/ThirdParty/Ert/libanalysis/modules/rml_enkf_common.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef ERT_RML_ENKF_COMMON_H -#define ERT_RML_ENKF_COMMON_H - -#include - -#include -#include -#include - - -void rml_enkf_common_store_state( matrix_type * state , const matrix_type * A , const bool_vector_type * ens_mask ); -void rml_enkf_common_recover_state( const matrix_type * state , matrix_type * A , const bool_vector_type * ens_mask ); -void rml_enkf_common_scaleA(matrix_type *A , const double * Csc, bool invert ); - -#endif diff --git a/ThirdParty/Ert/libanalysis/modules/rml_enkf_config.c b/ThirdParty/Ert/libanalysis/modules/rml_enkf_config.c deleted file mode 100644 index 6e9ff18287..0000000000 --- a/ThirdParty/Ert/libanalysis/modules/rml_enkf_config.c +++ /dev/null @@ -1,168 +0,0 @@ -/* - Copyright (C) 2015 Statoil ASA, Norway. - - The file 'rml_enkf_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include - -#include -#include - -#include - - -#define INVALID_SUBSPACE_DIMENSION -1 -#define INVALID_TRUNCATION -1 - -#define DEFAULT_SUBSPACE_DIMENSION INVALID_SUBSPACE_DIMENSION -#define DEFAULT_USE_PRIOR true - -#define DEFAULT_LAMBDA_INCREASE_FACTOR 4 -#define DEFAULT_LAMBDA_REDUCE_FACTOR 0.1 -#define DEFAULT_LAMBDA0 -1 -#define DEFAULT_LAMBDA_MIN 0.01 -#define DEFAULT_LAMBDA_RECALCULATE false - - - -#define RML_ENKF_CONFIG_TYPE_ID 61400061 - -struct rml_enkf_config_struct { - UTIL_TYPE_ID_DECLARATION; - double truncation; // Controlled by config key: ENKF_TRUNCATION_KEY - int subspace_dimension; // Controlled by config key: ENKF_NCOMP_KEY (-1: use Truncation instead) - long option_flags; - bool use_prior; // Use exact/approximate scheme? Approximate scheme drops the "prior" term in the LM step. - - - double lambda0; - double lambda_min; - double lambda_decrease_factor; - double lambda_increase_factor; - bool lambda_recalculate; -}; - - - - - - - -rml_enkf_config_type * rml_enkf_config_alloc() { - rml_enkf_config_type * config = util_malloc( sizeof * config ); - UTIL_TYPE_ID_INIT( config , RML_ENKF_CONFIG_TYPE_ID ); - - rml_enkf_config_set_truncation( config , DEFAULT_ENKF_TRUNCATION_); - rml_enkf_config_set_subspace_dimension( config , DEFAULT_SUBSPACE_DIMENSION); - rml_enkf_config_set_use_prior( config , DEFAULT_USE_PRIOR ); - rml_enkf_config_set_option_flags( config , ANALYSIS_NEED_ED + ANALYSIS_UPDATE_A + ANALYSIS_ITERABLE + ANALYSIS_SCALE_DATA); - - rml_enkf_config_set_lambda_min( config , DEFAULT_LAMBDA_MIN ); - rml_enkf_config_set_lambda0( config , DEFAULT_LAMBDA0 ); - rml_enkf_config_set_lambda_decrease_factor( config , DEFAULT_LAMBDA_REDUCE_FACTOR ); - rml_enkf_config_set_lambda_increase_factor( config , DEFAULT_LAMBDA_INCREASE_FACTOR ); - rml_enkf_config_set_lambda_recalculate( config , DEFAULT_LAMBDA_RECALCULATE ); - - return config; -} - - -bool rml_enkf_config_get_use_prior( const rml_enkf_config_type * config ) { - return config->use_prior; -} - -void rml_enkf_config_set_use_prior( rml_enkf_config_type * config , bool use_prior) { - config->use_prior = use_prior; -} - - -double rml_enkf_config_get_truncation( rml_enkf_config_type * config ) { - return config->truncation; -} - -void rml_enkf_config_set_truncation( rml_enkf_config_type * config , double truncation) { - config->truncation = truncation; - if (truncation > 0.0) - config->subspace_dimension = INVALID_SUBSPACE_DIMENSION; -} - -int rml_enkf_config_get_subspace_dimension( rml_enkf_config_type * config ) { - return config->subspace_dimension; -} - -void rml_enkf_config_set_subspace_dimension( rml_enkf_config_type * config , int subspace_dimension) { - config->subspace_dimension = subspace_dimension; - if (subspace_dimension > 0) - config->truncation = INVALID_TRUNCATION; -} - -void rml_enkf_config_set_option_flags( rml_enkf_config_type * config , long flags) { - config->option_flags = flags; -} - -long rml_enkf_config_get_option_flags( const rml_enkf_config_type * config ) { - return config->option_flags; -} - -double rml_enkf_config_get_lambda0( rml_enkf_config_type * config ) { - return config->lambda0; -} - -void rml_enkf_config_set_lambda0( rml_enkf_config_type * config , double lambda0) { - config->lambda0 = lambda0; -} - - -double rml_enkf_config_get_lambda_min( rml_enkf_config_type * config ) { - return config->lambda_min; -} - -void rml_enkf_config_set_lambda_min( rml_enkf_config_type * config , double lambda_min) { - config->lambda_min = lambda_min; -} - - -double rml_enkf_config_get_lambda_increase_factor( rml_enkf_config_type * config ) { - return config->lambda_increase_factor; -} - -void rml_enkf_config_set_lambda_increase_factor( rml_enkf_config_type * config , double lambda_increase_factor) { - config->lambda_increase_factor = lambda_increase_factor; -} - -double rml_enkf_config_get_lambda_decrease_factor( rml_enkf_config_type * config ) { - return config->lambda_decrease_factor; -} - -void rml_enkf_config_set_lambda_decrease_factor( rml_enkf_config_type * config , double lambda_decrease_factor) { - config->lambda_decrease_factor = lambda_decrease_factor; -} - - -bool rml_enkf_config_get_lambda_recalculate( const rml_enkf_config_type * config ) { - return config->lambda_recalculate; -} - -void rml_enkf_config_set_lambda_recalculate( rml_enkf_config_type * config , bool lambda_recalculate) { - config->lambda_recalculate = lambda_recalculate; -} - - -void rml_enkf_config_free(rml_enkf_config_type * config) { - free( config ); -} diff --git a/ThirdParty/Ert/libanalysis/modules/rml_enkf_config.h b/ThirdParty/Ert/libanalysis/modules/rml_enkf_config.h deleted file mode 100644 index 8173b9f7e6..0000000000 --- a/ThirdParty/Ert/libanalysis/modules/rml_enkf_config.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - Copyright (C) 2015 Statoil ASA, Norway. - - The file 'rml_enkf_config.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef RML_ENKF_CONFIG_H -#define RML_ENKF_CONFIG_H - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef struct rml_enkf_config_struct rml_enkf_config_type; - - - rml_enkf_config_type * rml_enkf_config_alloc(); - void rml_enkf_config_free(rml_enkf_config_type * config); - - int rml_enkf_config_get_subspace_dimension( rml_enkf_config_type * config ); - void rml_enkf_config_set_subspace_dimension( rml_enkf_config_type * config , int subspace_dimension); - - double rml_enkf_config_get_truncation( rml_enkf_config_type * config ); - void rml_enkf_config_set_truncation( rml_enkf_config_type * config , double truncation); - - bool rml_enkf_config_get_use_prior( const rml_enkf_config_type * config ); - void rml_enkf_config_set_use_prior( rml_enkf_config_type * config , bool use_prior); - - void rml_enkf_config_set_option_flags( rml_enkf_config_type * config , long flags); - long rml_enkf_config_get_option_flags( const rml_enkf_config_type * config ); - - double rml_enkf_config_get_lambda0( rml_enkf_config_type * config ); - void rml_enkf_config_set_lambda0( rml_enkf_config_type * config , double lambda0); - - double rml_enkf_config_get_lambda_min( rml_enkf_config_type * config ); - void rml_enkf_config_set_lambda_min( rml_enkf_config_type * config , double lambda_min); - - double rml_enkf_config_get_lambda_increase_factor( rml_enkf_config_type * config ); - void rml_enkf_config_set_lambda_increase_factor( rml_enkf_config_type * config , double lambda_increase_factor); - - double rml_enkf_config_get_lambda_decrease_factor( rml_enkf_config_type * config ); - void rml_enkf_config_set_lambda_decrease_factor( rml_enkf_config_type * config , double lambda_decrease_factor); - - bool rml_enkf_config_get_lambda_recalculate( const rml_enkf_config_type * config ); - void rml_enkf_config_set_lambda_recalculate( rml_enkf_config_type * config , bool lambda_recalculate); - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libanalysis/modules/rml_enkf_log.c b/ThirdParty/Ert/libanalysis/modules/rml_enkf_log.c deleted file mode 100644 index 108c3734c5..0000000000 --- a/ThirdParty/Ert/libanalysis/modules/rml_enkf_log.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - Copyright (C) 2015 Statoil ASA, Norway. - - The file 'rml_enkf_log.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include - -#include - -#include - -#define DEFAULT_LOG_FILE "rml_enkf.out" -#define DEFAULT_CLEAR_LOG true - -struct rml_enkf_log_struct { - bool clear_log; - char * log_file; - FILE * log_stream; -}; - - -rml_enkf_log_type * rml_enkf_log_alloc() { - rml_enkf_log_type * rml_log = util_malloc( sizeof * rml_log ); - rml_log->log_file = NULL; - rml_log->log_stream = NULL; - rml_enkf_log_set_clear_log( rml_log , DEFAULT_CLEAR_LOG ); - - rml_enkf_log_set_log_file( rml_log, DEFAULT_LOG_FILE ); - return rml_log; -} - -bool rml_enkf_log_get_clear_log( const rml_enkf_log_type * data ) { - return data->clear_log; -} - -void rml_enkf_log_set_clear_log( rml_enkf_log_type * data , bool clear_log) { - data->clear_log = clear_log; -} - -void rml_enkf_log_set_log_file( rml_enkf_log_type * data , const char * log_file ) { - data->log_file = util_realloc_string_copy( data->log_file , log_file ); -} - -const char * rml_enkf_log_get_log_file( const rml_enkf_log_type * data) { - return data->log_file; -} - - -void rml_enkf_log_free(rml_enkf_log_type * rml_log) { - rml_enkf_log_close( rml_log ); - util_safe_free( rml_log->log_file ); - free( rml_log ); -} - - -void rml_enkf_log_open( rml_enkf_log_type * rml_log , int iteration_nr ) { - if (rml_log->log_file) { - if ( iteration_nr == 0) { - - if (rml_log->clear_log) - rml_log->log_stream = util_mkdir_fopen( rml_log->log_file , "w"); - else - rml_log->log_stream = util_mkdir_fopen( rml_log->log_file , "a"); - - } else - rml_log->log_stream = util_fopen( rml_log->log_file , "a"); - } -} - - -bool rml_enkf_log_is_open( const rml_enkf_log_type * rml_log ) { - if (rml_log->log_stream) - return true; - else - return false; -} - - -void rml_enkf_log_close( rml_enkf_log_type * rml_log ) { - if (rml_log->log_stream) - fclose( rml_log->log_stream ); - - rml_log->log_stream = NULL; -} - - -void rml_enkf_log_line( rml_enkf_log_type * rml_log , const char * fmt , ...) { - if (rml_log->log_stream) { - va_list ap; - va_start(ap , fmt); - vfprintf( rml_log->log_stream , fmt , ap ); - va_end( ap ); - } -} - diff --git a/ThirdParty/Ert/libanalysis/modules/rml_enkf_log.h b/ThirdParty/Ert/libanalysis/modules/rml_enkf_log.h deleted file mode 100644 index 2c61d655e7..0000000000 --- a/ThirdParty/Ert/libanalysis/modules/rml_enkf_log.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2015 Statoil ASA, Norway. - - The file 'rml_enkf_log.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef RML_ENKF_LOG_H -#define RML_ENKF_LOG_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - - typedef struct rml_enkf_log_struct rml_enkf_log_type; - - rml_enkf_log_type * rml_enkf_log_alloc(); - void rml_enkf_log_free(rml_enkf_log_type * rml_log); - bool rml_enkf_log_get_clear_log( const rml_enkf_log_type * data ); - void rml_enkf_log_set_clear_log( rml_enkf_log_type * data , bool clear_log); - void rml_enkf_log_set_log_file( rml_enkf_log_type * data , const char * log_file ); - const char * rml_enkf_log_get_log_file( const rml_enkf_log_type * data); - void rml_enkf_log_open( rml_enkf_log_type * rml_log , int iteration_nr ); - void rml_enkf_log_close( rml_enkf_log_type * rml_log ); - void rml_enkf_log_line( rml_enkf_log_type * rml_log , const char * fmt , ...); - bool rml_enkf_log_is_open( const rml_enkf_log_type * rml_log ); - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/ThirdParty/Ert/libanalysis/modules/std_enkf_debug.c b/ThirdParty/Ert/libanalysis/modules/std_enkf_debug.c deleted file mode 100644 index 8ae6a8b1b7..0000000000 --- a/ThirdParty/Ert/libanalysis/modules/std_enkf_debug.c +++ /dev/null @@ -1,245 +0,0 @@ -/* - Copyright (C) 2016 Statoil ASA, Norway. - - This file is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#define PREFIX_KEY "PREFIX" -#define DEFAULT_PREFIX "debug" - -/* - A random 'magic' integer id which is used for run-time type checking - of the input data. -*/ -#define STD_ENKF_DEBUG_TYPE_ID 269923 - -typedef struct std_enkf_debug_data_struct std_enkf_debug_data_type; - -struct std_enkf_debug_data_struct { - UTIL_TYPE_ID_DECLARATION; - std_enkf_data_type * std_data; - char * prefix; - int update_count; -}; - - -static UTIL_SAFE_CAST_FUNCTION_CONST( std_enkf_debug_data , STD_ENKF_DEBUG_TYPE_ID ) -static UTIL_SAFE_CAST_FUNCTION( std_enkf_debug_data , STD_ENKF_DEBUG_TYPE_ID ) - - -void std_enkf_debug_data_set_prefix( std_enkf_debug_data_type * data , const char * prefix ) { - data->prefix = util_realloc_string_copy( data->prefix , prefix ); -} - - -void * std_enkf_debug_data_alloc( rng_type * rng) { - std_enkf_debug_data_type * data = util_malloc( sizeof * data ); - UTIL_TYPE_ID_INIT( data , STD_ENKF_DEBUG_TYPE_ID ); - data->std_data = std_enkf_data_alloc( rng ); - - data->update_count = 0; - data->prefix = NULL; - std_enkf_debug_data_set_prefix( data , DEFAULT_PREFIX ); - return data; -} - - -void std_enkf_debug_data_free( void * arg ) { - std_enkf_debug_data_type * data = std_enkf_debug_data_safe_cast( arg ); - std_enkf_data_free( data->std_data ); - free( data ); -} - -void std_enkf_debug_save_matrix( const matrix_type * m , const char * path , const char * file, bool transpose) { - char * filename = util_alloc_filename( path , file , NULL ); - - if (transpose) { - matrix_type * mt = matrix_alloc_transpose( m ); - matrix_dump_csv(mt,filename); - matrix_free( mt ); - } else - matrix_dump_csv(m , filename); - - - free( filename ); -} - - - -void std_enkf_debug_initX(void * module_data , - matrix_type * X , - matrix_type * A , - matrix_type * S , - matrix_type * R , - matrix_type * dObs , - matrix_type * E , - matrix_type * D) { - - std_enkf_debug_data_type * data = std_enkf_debug_data_safe_cast( module_data ); - char * debug_path = util_alloc_sprintf( "%s/%d" , data->prefix , data->update_count ); - std_enkf_data_type * std_data = data->std_data; - util_make_path( debug_path ); - std_enkf_debug_save_matrix( A , debug_path , "prior_ert.csv" , true); - - std_enkf_debug_save_matrix( S , debug_path , "S.csv" , true); - std_enkf_debug_save_matrix( S , debug_path , "simResponses.csv" , true); - - std_enkf_debug_save_matrix( E , debug_path , "E.csv" , true); - std_enkf_debug_save_matrix( E , debug_path , "measurementErrors.csv" , true); - - std_enkf_debug_save_matrix( R , debug_path , "R.csv" , true); - std_enkf_debug_save_matrix( D , debug_path , "D.csv" , true); - { - matrix_type * value = matrix_alloc_sub_copy( dObs , 0 , 0 , matrix_get_rows( dObs ) , 1 ); - matrix_type * std = matrix_alloc_sub_copy( dObs , 0 , 1 , matrix_get_rows( dObs ) , 1 ); - - std_enkf_debug_save_matrix( value , debug_path , "observations.csv", true); - std_enkf_debug_save_matrix( std , debug_path , "observations_std.csv", true); - - matrix_free( value ); - matrix_free( std ); - } - std_enkf_initX( std_data , X , A , S , R , dObs , E , D ); - { - matrix_type * posterior = matrix_alloc_matmul( A , X ); - std_enkf_debug_save_matrix( posterior , debug_path , "posterior_ert.csv" , true); - matrix_free( posterior ); - } - - data->update_count++; -} - - - - - - - -bool std_enkf_debug_set_double( void * arg , const char * var_name , double value) { - std_enkf_debug_data_type * module_data = std_enkf_debug_data_safe_cast( arg ); - return std_enkf_set_double( module_data->std_data , var_name , value ); -} - - -bool std_enkf_debug_set_int( void * arg , const char * var_name , int value) { - std_enkf_debug_data_type * module_data = std_enkf_debug_data_safe_cast( arg ); - return std_enkf_set_int( module_data->std_data , var_name , value ); -} - - -bool std_enkf_debug_set_bool( void * arg , const char * var_name , bool value) { - std_enkf_debug_data_type * module_data = std_enkf_debug_data_safe_cast( arg ); - return std_enkf_set_bool( module_data->std_data , var_name , value ); -} - - -bool std_enkf_debug_set_string( void * arg , const char * var_name , const char * value) { - std_enkf_debug_data_type * module_data = std_enkf_debug_data_safe_cast( arg ); - if (strcmp(var_name, PREFIX_KEY) == 0) { - std_enkf_debug_data_set_prefix( module_data , value ); - return true; - } else - return false; -} - - - -long std_enkf_debug_get_options( void * arg , long flag ) { - const std_enkf_debug_data_type * module_data = std_enkf_debug_data_safe_cast_const( arg ); - long options = std_enkf_get_options( module_data->std_data , flag ); - options |= ANALYSIS_USE_A; - return options; -} - - -bool std_enkf_debug_has_var( const void * arg, const char * var_name) { - if (strcmp(var_name , PREFIX_KEY) == 0) - return true; - else { - const std_enkf_debug_data_type * module_data = std_enkf_debug_data_safe_cast_const( arg ); - return std_enkf_has_var( module_data->std_data , var_name ); - } -} - - -double std_enkf_debug_get_double( const void * arg, const char * var_name) { - const std_enkf_debug_data_type * module_data = std_enkf_debug_data_safe_cast_const( arg ); - return std_enkf_get_double( module_data->std_data , var_name ); -} - -int std_enkf_debug_get_int( const void * arg, const char * var_name) { - const std_enkf_debug_data_type * module_data = std_enkf_debug_data_safe_cast_const( arg ); - return std_enkf_get_int( module_data->std_data , var_name ); -} - - -bool std_enkf_debug_get_bool( const void * arg, const char * var_name) { - const std_enkf_debug_data_type * module_data = std_enkf_debug_data_safe_cast_const( arg ); - return std_enkf_get_bool( module_data->std_data , var_name ); -} - - -void * std_enkf_debug_get_ptr( const void * arg, const char * var_name) { - const std_enkf_debug_data_type * module_data = std_enkf_debug_data_safe_cast_const( arg ); - if (strcmp( var_name , PREFIX_KEY) == 0) - return (void *) module_data->prefix; - else - return NULL; -} - - - -#ifdef INTERNAL_LINK -#define LINK_NAME STD_ENKF_DEBUG -#else -#define LINK_NAME EXTERNAL_MODULE_SYMBOL -#endif - - -analysis_table_type LINK_NAME = { - .name = "STD_ENKF_DEBUG_DEBUG", - .alloc = std_enkf_debug_data_alloc, - .freef = std_enkf_debug_data_free, - .set_int = std_enkf_debug_set_int , - .set_double = std_enkf_debug_set_double , - .set_bool = std_enkf_debug_set_bool, - .set_string = std_enkf_debug_set_string, - .get_options = std_enkf_debug_get_options , - .initX = std_enkf_debug_initX , - .updateA = NULL, - .init_update = NULL, - .complete_update = NULL, - .has_var = std_enkf_debug_has_var, - .get_int = std_enkf_debug_get_int, - .get_double = std_enkf_debug_get_double, - .get_bool = std_enkf_debug_get_bool, - .get_ptr = std_enkf_debug_get_ptr -}; - diff --git a/ThirdParty/Ert/libanalysis/modules/tests/CMakeLists.txt b/ThirdParty/Ert/libanalysis/modules/tests/CMakeLists.txt deleted file mode 100644 index 6463497ffa..0000000000 --- a/ThirdParty/Ert/libanalysis/modules/tests/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_executable(analysis_rml_enkf_common analysis_rml_enkf_common.c ../rml_enkf_common.c) -target_link_libraries( analysis_rml_enkf_common analysis util test_util ) - -add_test( analysis_rml_enkf_common ${EXECUTABLE_OUTPUT_PATH}/analysis_rml_enkf_common ) - diff --git a/ThirdParty/Ert/libanalysis/modules/tests/analysis_rml_enkf_common.c b/ThirdParty/Ert/libanalysis/modules/tests/analysis_rml_enkf_common.c deleted file mode 100644 index 355eeaca1f..0000000000 --- a/ThirdParty/Ert/libanalysis/modules/tests/analysis_rml_enkf_common.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'analysis_rml_common.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include - -#include - - - -void test_store_recover_state() { - rng_type * rng = rng_alloc( MZRAN , INIT_DEFAULT ); - int ens_size = 10; - int active_size = 8; - int rows = 100; - matrix_type * state = matrix_alloc(1,1); - bool_vector_type * ens_mask = bool_vector_alloc(ens_size , false); - matrix_type * A = matrix_alloc( rows , active_size); - matrix_type * A2 = matrix_alloc( rows, active_size ); - matrix_type * A3 = matrix_alloc( 1,1 ); - - for (int i=0; i < active_size; i++) - bool_vector_iset( ens_mask , i + 1 , true ); - - matrix_random_init(A , rng); - rml_enkf_common_store_state( state , A , ens_mask ); - - test_assert_int_equal( matrix_get_rows( state ) , rows ); - test_assert_int_equal( matrix_get_columns( state ) , ens_size ); - - { - int g; - int a = 0; - for (g=0; g < ens_size; g++) { - if (bool_vector_iget( ens_mask , g )) { - test_assert_true( matrix_columns_equal( state , g , A , a )); - a++; - } - } - } - - rml_enkf_common_recover_state( state , A2 , ens_mask); - rml_enkf_common_recover_state( state , A3 , ens_mask); - test_assert_true( matrix_equal( A , A2 )); - test_assert_true( matrix_equal( A , A3 )); - - bool_vector_free( ens_mask ); - matrix_free( state ); - matrix_free( A ); -} - - - - - -void test_scaleA() { - const int N = 10; - matrix_type * m1 = matrix_alloc(N , N); - matrix_type * m2 = matrix_alloc(N , N); - double * csc = util_calloc( N , sizeof * csc ); - rng_type * rng = rng_alloc( MZRAN , INIT_DEFAULT ); - - matrix_random_init( m1 , rng ); - matrix_assign(m2 , m1); - test_assert_true( matrix_equal(m1 , m2)); - - { - for (int i=0; i < N; i++) - csc[i] = (i + 2); - } - rml_enkf_common_scaleA( m1 , csc , false ); - { - int row,col; - for (row = 0; row < N; row++) { - for (col=0; col < N; col++) { - double v1 = matrix_iget(m1 , row , col); - double v2 = matrix_iget(m2 , row , col); - - test_assert_double_equal( v1 , v2 * csc[row] ); - } - } - } - rml_enkf_common_scaleA( m2 , csc , false ); - test_assert_true( matrix_equal(m1 , m2)); - - rml_enkf_common_scaleA( m2 , csc , true ); - { - int row,col; - for (row = 0; row < N; row++) { - for (col=0; col < N; col++) { - double v1 = matrix_iget(m1 , row , col); - double v2 = matrix_iget(m2 , row , col); - - test_assert_double_equal( v1 , v2 * csc[row] ); - } - } - } - rml_enkf_common_scaleA( m1 , csc , true ); - test_assert_true( matrix_equal(m1 , m2)); - - - rng_free( rng ); - matrix_free(m1); - matrix_free(m2); - free( csc ); -} - - - -int main(int argc , char ** argv) { - test_store_recover_state(); - test_scaleA(); - exit(0); -} - diff --git a/ThirdParty/Ert/libanalysis/script/CMakeLists.txt b/ThirdParty/Ert/libanalysis/script/CMakeLists.txt deleted file mode 100644 index ce8e9028fb..0000000000 --- a/ThirdParty/Ert/libanalysis/script/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -set (destination ${CMAKE_INSTALL_PREFIX}/bin) - -install(PROGRAMS ert_module DESTINATION ${destination}) - -if (INSTALL_GROUP) - install(CODE "EXECUTE_PROCESS(COMMAND chgrp ${INSTALL_GROUP} ${destination}/ert_module)") - install(CODE "EXECUTE_PROCESS(COMMAND chmod g+w ${destination}/ert_module)") -endif() diff --git a/ThirdParty/Ert/libanalysis/script/ert_module b/ThirdParty/Ert/libanalysis/script/ert_module deleted file mode 100644 index 57a4d34683..0000000000 --- a/ThirdParty/Ert/libanalysis/script/ert_module +++ /dev/null @@ -1,239 +0,0 @@ -#!/usr/bin/env python -import sys -import os -import os.path -from optparse import OptionParser - -ert_root = os.path.realpath( os.path.join(os.path.dirname( os.path.realpath( os.path.abspath( __file__))) , "../") ) - -#----------------------------------------------------------------- - -default_lib_list = ["analysis" , "ert_util"] -default_define_list = ["HAVE_PTHREAD" , "COMPILER_GCC"] - - -CFLAGS = "-std=gnu99 -O2 -Wall -fpic -g" -LDFLAGS_list = ["-shared"] -CC = "gcc" -LD = CC - -#----------------------------------------------------------------- - - -c_file = 0 -header_file = 1 -object_file = 2 -other = 3 - -file_types = {".o" : object_file , - ".h" : header_file , - ".c" : c_file } - -def base_name(file): - (name,ext) = os.path.split( file ) - return name - - -def file_type( file ): - name,ext = os.path.splitext( file ) - return file_types.get( ext , other ) - - -def object_file_name( file ): - (name,ext) = os.path.splitext( file ) - return "%s.o" % name - - -def make_LDFLAGS( use_rpath , lib_path_list): - if use_rpath: - LDFLAGS_list.append("-Wl,--enable-new-dtags") - for path in lib_path_list: - LDFLAGS_list.append("-Wl,-rpath,%s" % path) - LDFLAGS_list.append("-Wl,-soname,") - - return " ".join(LDFLAGS_list) - - -def make_XFLAG( X , def_list ): - FLAG = "" - for d in def_list: - FLAG += "-%s%s " % (X , d) - return FLAG - - -def compile_file( file , IFLAG , DFLAG , verbose): - target = object_file_name( file ) - if os.path.exists( target ): - os.unlink( target ) - - cmd = "%s %s %s %s -c %s -o %s" % (CC , CFLAGS , IFLAG , DFLAG , file , target) - if verbose: - print "Compiling: %s" % cmd - os.system( cmd ) - if os.path.exists( target ): - return target - else: - sys.exit("Compile cmd:%s failed" % cmd) - - -def link( soname , filename , object_list , LDFLAGS , LFLAG , lFLAG , verbose): - object_string = "" - for obj in object_list: - object_string += "%s " % obj - - cmd = "%s %s%s -o %s %s %s %s" % ( LD , LDFLAGS , soname , filename , object_string , LFLAG , lFLAG) - if verbose: - print "Linking : %s" % cmd - if os.path.exists( filename ): - os.unlink( filename ) - os.system(cmd) - if os.path.exists( filename ): - return True - else: - return False - - -usage = """ -The ert_module script is a small convenience script to -compile C source code into an analysis module which can -be loaded by ert. The script is controlled by commandline -arguments: - - 1. The first argument should be the name of the module - you are creating, an extension .so will be appended. - - 2. List the source files you want to include, the - files should have extension .c. In addition you can - include object files which have been compiled by - other means, the object files should have - extension .o - - 3. Optionally you can pass -I and -D options which are - passed to the compiler; and -l and -L options which - are passed to the linker. - -Example: - - ert_module my_module my_src1.c my_src2.c f90_object1.o f90_object2.o -I/path -DFAST=Yes -L/path/to/lib -lfm -lz - -Will create a module 'my_module' based on the src files my_src1.c -and my_src2.c; in addition the object files f90_object1.o and -f90_object2.o will be included in the final module. - ------------------------------------------------------------------ - -To compile the module code you will typically need the include files -and libraries from an existing ert installation. By default the -ert_module script will locate the ert installation based on the -location of the script, but you can pass the option: - - --ert-root=/path/where/ert/is/installed - -The --ert-root option should point to a directory containing the -lib64/ and include/ directories of a binary etr distribution. In -addition to --ert-root you can use the normal -L/path/to/lib option to -send in additional link path arguments. - -By default the path to shared libraries will not be embedded in the -resulting module, but by passing the option --use-rpath you can tell -the script to embed these paths in the final shared object. - ------------------------------------------------------------------ - -Options summary: - - -L/path/to/lib: Include the path /path/to/lib in the linker path - - -llib1 : Link with the library lib1 - - -I/include : Include the path /include in the compiler include path. - - --ert-root=/path/to/ert : Use this is as root for ert headers - and libraries. [Default: inferred from location of script] - - --use-rpath : Embed library paths in shared objects. Default off. - - --exclude-ert: Do not use any ert default libraries or headers - - -Default flags: - -Compile: %s %s %s -Link: %s %s %s -""" % (CC, - make_XFLAG( "I" , ["./" , "%s/include" % ert_root]) , - make_XFLAG( "D" , default_define_list) , - LD , - make_XFLAG("L" , ["%s/lib64" % ert_root]) , - make_XFLAG("l" , default_lib_list)) - -parser = OptionParser( usage ) -parser.add_option("--ert-root" , dest="ert_root" , action="store") -parser.add_option("-I" , dest = "include_path_list", action = "append" , default = []) -parser.add_option("-D" , dest = "define_list" , action = "append" , default = []) -parser.add_option("-L" , dest = "lib_path_list" , action = "append" , default = []) -parser.add_option("-l" , dest = "lib_list" , action = "append" , default = []) -parser.add_option("--exclude-ert" , dest = "exclude_ert" , action="store_true" , default = False) -parser.add_option("--use-rpath" , dest="use_rpath" , action="store_true" , default = False) -parser.add_option("--silent" , dest="silent" , action="store_true" , default = False) - -(options , args) = parser.parse_args() -if len(args) == 0: - sys.exit( usage ) - -if options.ert_root: - ert_root = options.ert_root - -if options.exclude_ert: - default_include_path_list = ["./"] - default_lib_path_list = [] - default_lib_list = [] -else: - default_include_path_list = ["./" , "%s/include" % ert_root] - default_lib_path_list = ["%s/lib64" % ert_root] - default_lib_list = default_lib_list - - -# What is supplied as commandline options should take presedence, this -# implies that it should be first OR last on the commandline. -include_path_list = options.include_path_list + default_include_path_list -define_list = default_define_list + options.define_list -lib_list = options.lib_list + default_lib_list -lib_path_list = options.lib_path_list + default_lib_path_list - - -verbose = not options.silent -LDFLAGS = make_LDFLAGS( options.use_rpath , lib_path_list) -input_name = args[0] -(path , tmp ) = os.path.split( input_name ) -(module , ext) = os.path.splitext( tmp ) - -soname = "%s.so" % module -if path: - filename = "%s/%s.so" % (path , module) - if not os.path.exists( path ): - os.makedirs( path ) -else: - filename = "%s.so" % module - -#----------------------------------------------------------------- - -IFLAG = make_XFLAG( "I" , include_path_list ) -DFLAG = make_XFLAG( "D" , define_list ) -LFLAG = make_XFLAG( "L" , lib_path_list ) -lFLAG = make_XFLAG( "l" , lib_list ) - -object_list = [] -for arg in args[1:]: - if file_type( arg ) == c_file: - object_list.append( compile_file( arg , IFLAG , DFLAG , verbose) ) - elif file_type( arg ) == object_file: - object_list.append( arg ) - else: - print "** Warning: ignoring file:%s" % arg - - -if link( soname , filename , object_list , LDFLAGS , LFLAG , lFLAG , verbose): - sys.exit() -else: - sys.exit("Creating library failed") diff --git a/ThirdParty/Ert/libanalysis/src/CMakeLists.txt b/ThirdParty/Ert/libanalysis/src/CMakeLists.txt deleted file mode 100644 index 76c2586960..0000000000 --- a/ThirdParty/Ert/libanalysis/src/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -# Common libanalysis library -set( source_files analysis_module.c enkf_linalg.c std_enkf.c sqrt_enkf.c cv_enkf.c bootstrap_enkf.c null_enkf.c fwd_step_enkf.c fwd_step_log.c module_data_block.c module_data_block_vector.c module_obs_block.c module_obs_block_vector.c module_info.c) -set( header_files analysis_module.h enkf_linalg.h analysis_table.h std_enkf.h fwd_step_enkf.h fwd_step_log.h module_data_block.h module_data_block_vector.h module_obs_block.h module_obs_block_vector.h module_info.h) -add_library( analysis SHARED ${source_files} ) -set_target_properties( analysis PROPERTIES COMPILE_DEFINITIONS INTERNAL_LINK) -set_target_properties( analysis PROPERTIES VERSION ${ERT_VERSION_MAJOR}.${ERT_VERSION_MINOR} SOVERSION ${ERT_VERSION_MAJOR} ) - -target_link_libraries( analysis ert_util ) -target_link_libraries( analysis dl ) - -if (USE_RUNPATH) - add_runpath( analysis ) -endif() - - -#----------------------------------------------------------------- - -if (ERT_USE_OPENMP) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${OpenMP_SHARED_LINKER_FLAGS}") -endif() - - -if (INSTALL_ERT) - install(TARGETS analysis DESTINATION ${CMAKE_INSTALL_LIBDIR}) - #install(TARGETS rml_enkf DESTINATION ${CMAKE_INSTALL_LIBDIR}) - foreach(header ${header_files}) - install(FILES ../include/ert/analysis/${header} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/ert/analysis) - endforeach() -endif() - diff --git a/ThirdParty/Ert/libanalysis/src/analysis_module.c b/ThirdParty/Ert/libanalysis/src/analysis_module.c deleted file mode 100644 index 59aec768a0..0000000000 --- a/ThirdParty/Ert/libanalysis/src/analysis_module.c +++ /dev/null @@ -1,463 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'analysis_module.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -#define ANALYSIS_MODULE_TYPE_ID 6610123 - -struct analysis_module_struct { - UTIL_TYPE_ID_DECLARATION; - void * lib_handle; - void * module_data; - char * symbol_table; - char * lib_name; - - analysis_free_ftype * freef; - analysis_alloc_ftype * alloc; - analysis_initX_ftype * initX; - analysis_updateA_ftype * updateA; - analysis_init_update_ftype * init_update; - analysis_complete_update_ftype * complete_update; - - analysis_get_options_ftype * get_options; - analysis_set_int_ftype * set_int; - analysis_set_double_ftype * set_double; - analysis_set_bool_ftype * set_bool; - analysis_set_string_ftype * set_string; - - analysis_has_var_ftype * has_var; - analysis_get_int_ftype * get_int; - analysis_get_double_ftype * get_double; - analysis_get_bool_ftype * get_bool; - analysis_get_ptr_ftype * get_ptr; - - bool internal; - char * user_name; /* String used to identify this module for the user; not used in - the linking process. */ -}; - - - -static analysis_module_type * analysis_module_alloc_empty( const char * symbol_table , const char * lib_name) { - analysis_module_type * module = util_malloc( sizeof * module ); - UTIL_TYPE_ID_INIT( module , ANALYSIS_MODULE_TYPE_ID ); - - module->lib_handle = NULL; - module->initX = NULL; - module->updateA = NULL; - module->set_int = NULL; - module->set_bool = NULL; - module->set_double = NULL; - module->set_string = NULL; - module->module_data = NULL; - module->init_update = NULL; - module->complete_update = NULL; - module->has_var = NULL; - module->get_int = NULL; - module->get_double = NULL; - module->get_bool = NULL; - module->get_ptr = NULL; - module->alloc = NULL; - - module->user_name = NULL; - module->symbol_table = util_alloc_string_copy( symbol_table ); - module->lib_name = util_alloc_string_copy( lib_name ); - - return module; -} - - -static bool analysis_module_internal_check( analysis_module_type * module ) { - if (!module->user_name) - fprintf(stderr,"Invalid module loaded from lib:%s / symbol_table:%s - name not set\n", module->lib_name , module->symbol_table); - - return true; -} - - -static analysis_module_type * analysis_module_alloc__( rng_type * rng , - const analysis_table_type * table , - const char * symbol_table , - const char * lib_name , - void * lib_handle ) { - - analysis_module_type * module = analysis_module_alloc_empty( symbol_table , lib_name ); - - module->lib_handle = lib_handle; - module->initX = table->initX; - module->updateA = table->updateA; - module->init_update = table->init_update; - module->complete_update = table->complete_update; - module->set_int = table->set_int; - module->set_double = table->set_double; - module->set_string = table->set_string; - module->set_bool = table->set_bool; - module->alloc = table->alloc; - module->freef = table->freef; - module->get_options = table->get_options; - module->has_var = table->has_var; - module->get_int = table->get_int; - module->get_double = table->get_double; - module->get_bool = table->get_bool; - module->get_ptr = table->get_ptr; - analysis_module_set_name( module , table->name ); - - if (module->alloc) - module->module_data = module->alloc( rng ); - - if (!analysis_module_internal_check( module )) { - fprintf(stderr,"** Warning loading module: %s failed - internal inconsistency\n", module->user_name); - analysis_module_free( module ); - module = NULL; - } - - return module; -} - - - - - -static analysis_module_type * analysis_module_alloc( rng_type * rng , - const char * libname , - const char * table_name , - bool verbose, - analysis_module_load_status_enum * load_status) { - analysis_module_type * module = NULL; - void * lib_handle = dlopen( libname , RTLD_NOW ); - if (lib_handle != NULL) { - analysis_table_type * analysis_table = (analysis_table_type *) dlsym( lib_handle , table_name ); - if (analysis_table != NULL) { - *load_status = LOAD_OK; - module = analysis_module_alloc__( rng , analysis_table , table_name , libname , lib_handle ); - } else { - *load_status = LOAD_SYMBOL_TABLE_NOT_FOUND; - if (verbose) - fprintf(stderr , "Failed to load symbol table:%s Error:%s \n",table_name , dlerror()); - } - - if (module == NULL) - dlclose( lib_handle ); - } else { - *load_status = DLOPEN_FAILURE; - if (verbose) - fprintf(stderr , "Failed to load library:%s Error:%s \n",libname , dlerror()); - } - - if (module != NULL) { - if (libname == NULL) - module->internal = true; - else - module->internal = false; - } - - return module; -} - -analysis_module_type * analysis_module_alloc_internal__( rng_type * rng , const char * symbol_table , bool verbose , analysis_module_load_status_enum * load_status) { - return analysis_module_alloc( rng , NULL , symbol_table , verbose , load_status); -} - -analysis_module_type * analysis_module_alloc_internal( rng_type * rng , const char * symbol_table ) { - analysis_module_load_status_enum load_status; - return analysis_module_alloc_internal__( rng , symbol_table , true , &load_status); -} - - -analysis_module_type * analysis_module_alloc_external__(rng_type * rng , const char * lib_name , bool verbose , analysis_module_load_status_enum * load_status) { - return analysis_module_alloc( rng , lib_name , EXTERNAL_MODULE_NAME , verbose , load_status); -} - - -analysis_module_type * analysis_module_alloc_external( rng_type * rng , const char * lib_name) { - analysis_module_load_status_enum load_status; - return analysis_module_alloc_external__( rng , lib_name , true , &load_status); -} - -/*****************************************************************/ - -const char * analysis_module_get_name( const analysis_module_type * module ) { - return module->user_name; -} - -void analysis_module_set_name( analysis_module_type * module , const char * name) { - module->user_name = util_realloc_string_copy( module->user_name , name ); -} - - -const char * analysis_module_get_table_name( const analysis_module_type * module) { - return module->symbol_table; -} - -const char * analysis_module_get_lib_name( const analysis_module_type * module) { - return module->lib_name; -} - -bool analysis_module_internal( const analysis_module_type * module ) { - return module->internal; -} - -/*****************************************************************/ - -static UTIL_SAFE_CAST_FUNCTION( analysis_module , ANALYSIS_MODULE_TYPE_ID ) -UTIL_IS_INSTANCE_FUNCTION( analysis_module , ANALYSIS_MODULE_TYPE_ID ) - - -void analysis_module_free( analysis_module_type * module ) { - if (module->freef != NULL) - module->freef( module->module_data ); - - util_safe_free( module->lib_name ); - free( module->user_name ); - free( module->symbol_table ); - dlclose( module->lib_handle ); - free( module ); -} - - -void analysis_module_free__( void * arg) { - analysis_module_type * module = analysis_module_safe_cast( arg ); - analysis_module_free( module ); -} - -/*****************************************************************/ -/* Update functions */ - - -void analysis_module_initX(analysis_module_type * module , - matrix_type * X , - matrix_type * A , - matrix_type * S , - matrix_type * R , - matrix_type * dObs , - matrix_type * E , - matrix_type * D ) { - - - module->initX(module->module_data , X , A , S , R , dObs , E , D ); -} - - -void analysis_module_updateA(analysis_module_type * module , - matrix_type * A , - matrix_type * S , - matrix_type * R , - matrix_type * dObs , - matrix_type * E , - matrix_type * D , - const module_info_type* module_info) { - - module->updateA(module->module_data , A , S , R , dObs , E , D, module_info); -} - - - - -void analysis_module_init_update( analysis_module_type * module , - const bool_vector_type * ens_mask , - const matrix_type * S , - const matrix_type * R , - const matrix_type * dObs , - const matrix_type * E , - const matrix_type * D ) { - if (module->init_update != NULL) - module->init_update( module->module_data , ens_mask , S , R , dObs , E , D); -} - - -void analysis_module_complete_update( analysis_module_type * module ) { - if (module->complete_update != NULL) - module->complete_update( module->module_data ); -} - -/*****************************************************************/ - - -static bool analysis_module_set_int(analysis_module_type * module , const char * flag , int value) { - if (module->set_int != NULL) - return module->set_int( module->module_data , flag , value ); - else - return false; -} - -static bool analysis_module_set_double(analysis_module_type * module , const char * var , double value) { - if (module->set_double != NULL) - return module->set_double( module->module_data , var , value ); - else - return false; -} - - -static bool analysis_module_set_bool(analysis_module_type * module , const char * var , bool value) { - if (module->set_bool != NULL) - return module->set_bool( module->module_data , var , value ); - else - return false; -} - - -static bool analysis_module_set_string(analysis_module_type * module , const char * var , const char * value) { - if (module->set_string != NULL) - return module->set_string( module->module_data , var , value ); - else - return false; -} - - - -/* - The input value typically comes from the configuration system and - is in terms of a string, irrespective of the fundamental type of - the underlying parameter. The algorithm for setting the parameter - tries datatypes as follows: integer - double - string. - - For the numeric datatypes the algorithm is two step: - - 1. Try the conversion string -> numeric. - 2. Try calling the analysis_module_set_xxx() function. - - Observe that this implies that the same variable name can NOT be - used for different variable types. -*/ - -bool analysis_module_set_var( analysis_module_type * module , const char * var_name , const char * string_value ) { - bool set_ok = false; - { - int int_value; - - if (util_sscanf_int( string_value , &int_value )) - set_ok = analysis_module_set_int( module , var_name , int_value ); - - - if (set_ok) - return true; - } - - { - double double_value; - if (util_sscanf_double( string_value , &double_value )) - set_ok = analysis_module_set_double( module , var_name , double_value ); - - if (set_ok) - return true; - } - - { - bool bool_value; - if (util_sscanf_bool( string_value , &bool_value)) - set_ok = analysis_module_set_bool( module , var_name , bool_value ); - - if (set_ok) - return true; - } - - - set_ok = analysis_module_set_string( module , var_name , string_value ); - if (!set_ok) - fprintf(stderr,"** Warning: failed to set %s=%s for analysis module:%s\n", var_name , string_value , module->user_name); - - return set_ok; -} - - -bool analysis_module_check_option( const analysis_module_type * module , long flag) { - if ((flag & module->get_options( module->module_data , flag )) == flag) - return true; - else - return false; -} - - -bool analysis_module_has_var( const analysis_module_type * module , const char * var) { - if (module->has_var) - return module->has_var( module->module_data , var ); - else - return false; -} - - -int analysis_module_get_int( const analysis_module_type * module , const char * var) { - if (analysis_module_has_var( module , var )) { - if (module->get_int != NULL) - return module->get_int( module->module_data , var ); - else - util_exit("%s: Tried to get integer variable:%s from module:%s - get_int() method not implemented for this module\n" , __func__ , var , module->user_name); - } else - util_exit("%s: Tried to get integer variable:%s from module:%s - module does not support this variable \n" , __func__ , var , module->user_name); - - return 0; -} - - -bool analysis_module_get_bool( const analysis_module_type * module , const char * var) { - if (analysis_module_has_var( module , var )) { - if (module->get_bool != NULL) - return module->get_bool( module->module_data , var ); - else - util_exit("%s: Tried to get bool variable:%s from module:%s - get_int() method not implemented for this module\n" , __func__ , var , module->user_name); - } else - util_exit("%s: Tried to get bool variable:%s from module:%s - module does not support this variable \n" , __func__ , var , module->user_name); - - return false; -} - - -double analysis_module_get_double( const analysis_module_type * module , const char * var) { - if (analysis_module_has_var( module , var )) { - if (module->get_double != NULL) - return module->get_double( module->module_data , var ); - else - util_exit("%s: Tried to get double variable:%s from module:%s - get_double() method not implemented for this module\n" , __func__ , var , module->user_name); - } else - util_exit("%s: Tried to get double variable:%s from module:%s - module does not support this variable \n" , __func__ , var , module->user_name); - - return 0; -} - - -void * analysis_module_get_ptr( const analysis_module_type * module , const char * var) { - if (analysis_module_has_var( module , var )) { - if (module->get_double != NULL) - return module->get_ptr( module->module_data , var ); - else - util_exit("%s: Tried to get pointer variable:%s from module:%s - get_ptr() method not implemented for this module\n" , __func__ , var , module->user_name); - } else - util_exit("%s: Tried to get pointer variable:%s from module:%s - module does not support this variable \n" , __func__ , var , module->user_name); - - return NULL; -} - - -/*****************************************************************/ - -const char * analysis_module_flag_enum_iget( int index, int * value) { - return util_enum_iget( index , ANALYSIS_MODULE_FLAG_ENUM_SIZE , (const util_enum_element_type []) { ANALYSIS_MODULE_FLAG_ENUM_DEFS }, value); -} - diff --git a/ThirdParty/Ert/libanalysis/src/bootstrap_enkf.c b/ThirdParty/Ert/libanalysis/src/bootstrap_enkf.c deleted file mode 100644 index 29c7980b53..0000000000 --- a/ThirdParty/Ert/libanalysis/src/bootstrap_enkf.c +++ /dev/null @@ -1,300 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'bootstrap_enkf.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - - -#define BOOTSTRAP_ENKF_TYPE_ID 741223 - -#define INVALID_SUBSPACE_DIMENSION -1 -#define INVALID_TRUNCATION -1 -#define DEFAULT_TRUNCATION 0.95 -#define DEFAULT_NCOMP INVALID_SUBSPACE_DIMENSION - -#define DEFAULT_DO_CV false -#define DEFAULT_NFOLDS 10 -#define NFOLDS_KEY "BOOTSTRAP_NFOLDS" - - -typedef struct { - UTIL_TYPE_ID_DECLARATION; - std_enkf_data_type * std_enkf_data; - cv_enkf_data_type * cv_enkf_data; - rng_type * rng; - long option_flags; - bool doCV; -} bootstrap_enkf_data_type; - - -static UTIL_SAFE_CAST_FUNCTION( bootstrap_enkf_data , BOOTSTRAP_ENKF_TYPE_ID ) -static UTIL_SAFE_CAST_FUNCTION_CONST( bootstrap_enkf_data , BOOTSTRAP_ENKF_TYPE_ID ) - - -void bootstrap_enkf_set_doCV( bootstrap_enkf_data_type * data , bool doCV) { - data->doCV = doCV; -} - - - -void bootstrap_enkf_set_truncation( bootstrap_enkf_data_type * boot_data , double truncation ) { - std_enkf_set_truncation( boot_data->std_enkf_data , truncation ); - cv_enkf_set_truncation( boot_data->cv_enkf_data , truncation ); -} - - -void bootstrap_enkf_set_subspace_dimension( bootstrap_enkf_data_type * boot_data , int ncomp) { - std_enkf_set_subspace_dimension( boot_data->std_enkf_data , ncomp ); - cv_enkf_set_subspace_dimension( boot_data->cv_enkf_data , ncomp ); -} - - -void * bootstrap_enkf_data_alloc( rng_type * rng ) { - bootstrap_enkf_data_type * boot_data = util_malloc( sizeof * boot_data ); - UTIL_TYPE_ID_INIT( boot_data , BOOTSTRAP_ENKF_TYPE_ID ); - - boot_data->std_enkf_data = std_enkf_data_alloc( NULL ); - boot_data->cv_enkf_data = cv_enkf_data_alloc( rng ); - - boot_data->rng = rng; - bootstrap_enkf_set_truncation( boot_data , DEFAULT_TRUNCATION ); - bootstrap_enkf_set_subspace_dimension( boot_data , DEFAULT_NCOMP ); - bootstrap_enkf_set_doCV( boot_data , DEFAULT_DO_CV); - boot_data->option_flags = ANALYSIS_NEED_ED + ANALYSIS_UPDATE_A + ANALYSIS_SCALE_DATA; - return boot_data; -} - - - - - -void bootstrap_enkf_data_free( void * arg ) { - bootstrap_enkf_data_type * boot_data = bootstrap_enkf_data_safe_cast( arg ); - { - std_enkf_data_free( boot_data->std_enkf_data ); - cv_enkf_data_free( boot_data->cv_enkf_data ); - } - free( boot_data ); -} - - -static int ** alloc_iens_resample( rng_type * rng , int ens_size ) { - int ** iens_resample; - int iens; - - iens_resample = util_calloc( ens_size , sizeof * iens_resample ); - for (iens = 0; iens < ens_size; iens++) - iens_resample[iens] = util_calloc( ens_size , sizeof( ** iens_resample ) ); - - { - int i,j; - for (i=0; i < ens_size; i++) - for (j=0; j < ens_size; j++) - iens_resample[i][j] = rng_get_int( rng , ens_size ); - } - return iens_resample; -} - - -static void free_iens_resample( int ** iens_resample, int ens_size ) { - for (int i=0; i < ens_size; i++) - free( iens_resample[i] ); - free( iens_resample ); -} - - - -void bootstrap_enkf_updateA(void * module_data , - matrix_type * A , - matrix_type * S , - matrix_type * R , - matrix_type * dObs , - matrix_type * E , - matrix_type * D , - const module_info_type* module_info) { - - bootstrap_enkf_data_type * bootstrap_data = bootstrap_enkf_data_safe_cast( module_data ); - { - const int num_cpu_threads = 4; - int ens_size = matrix_get_columns( A ); - matrix_type * X = matrix_alloc( ens_size , ens_size ); - matrix_type * A0 = matrix_alloc_copy( A ); - matrix_type * S_resampled = matrix_alloc_copy( S ); - matrix_type * A_resampled = matrix_alloc( matrix_get_rows(A0) , matrix_get_columns( A0 )); - int ** iens_resample = alloc_iens_resample( bootstrap_data->rng , ens_size ); - { - int ensemble_members_loop; - for ( ensemble_members_loop = 0; ensemble_members_loop < ens_size; ensemble_members_loop++) { - int unique_bootstrap_components; - int ensemble_counter; - /* Resample A and meas_data. Here we are careful to resample the working copy.*/ - { - { - int_vector_type * bootstrap_components = int_vector_alloc( ens_size , 0); - for (ensemble_counter = 0; ensemble_counter < ens_size; ensemble_counter++) { - int random_column = iens_resample[ ensemble_members_loop][ensemble_counter]; - int_vector_iset( bootstrap_components , ensemble_counter , random_column ); - matrix_copy_column( A_resampled , A0 , ensemble_counter , random_column ); - matrix_copy_column( S_resampled , S , ensemble_counter , random_column ); - } - int_vector_select_unique( bootstrap_components ); - unique_bootstrap_components = int_vector_size( bootstrap_components ); - int_vector_free( bootstrap_components ); - } - - if (bootstrap_data->doCV) { - const bool_vector_type * ens_mask = NULL; - cv_enkf_init_update( bootstrap_data->cv_enkf_data , ens_mask , S_resampled , R , dObs , E , D); - cv_enkf_initX( bootstrap_data->cv_enkf_data , X , A_resampled , S_resampled , R , dObs , E , D); - } else - std_enkf_initX(bootstrap_data->std_enkf_data , X , NULL , S_resampled,R, dObs, E,D ); - - - matrix_inplace_matmul_mt1( A_resampled , X , num_cpu_threads ); - matrix_inplace_add( A_resampled , A0 ); - matrix_copy_column( A , A_resampled, ensemble_members_loop, ensemble_members_loop); - - } - } - } - - - free_iens_resample( iens_resample , ens_size); - matrix_free( X ); - matrix_free( S_resampled ); - matrix_free( A_resampled ); - matrix_free( A0 ); - } -} - - - - - - -long bootstrap_enkf_get_options( void * arg , long flag) { - bootstrap_enkf_data_type * bootstrap_data = bootstrap_enkf_data_safe_cast( arg ); - { - return bootstrap_data->option_flags; - } -} - - -bool bootstrap_enkf_set_double( void * arg , const char * var_name , double value) { - bootstrap_enkf_data_type * bootstrap_data = bootstrap_enkf_data_safe_cast( arg ); - { - if (std_enkf_set_double( bootstrap_data->std_enkf_data , var_name , value )) - return true; - else { - return false; - } - } -} - - -bool bootstrap_enkf_set_int( void * arg , const char * var_name , int value) { - bootstrap_enkf_data_type * bootstrap_data = bootstrap_enkf_data_safe_cast( arg ); - { - if (std_enkf_set_int( bootstrap_data->std_enkf_data , var_name , value )) - return true; - else { - return false; - } - } -} - - -bool bootstrap_enkf_set_bool( void * arg , const char * var_name , bool value) { - bootstrap_enkf_data_type * bootstrap_data = bootstrap_enkf_data_safe_cast( arg ); - { - bool name_recognized = true; - - if (strcmp( var_name , "CV" ) == 0) - bootstrap_data->doCV = value; - else - name_recognized = false; - - return name_recognized; - } -} - - -bool bootstrap_enkf_has_var( const void * arg, const char * var_name) { - const bootstrap_enkf_data_type * module_data = bootstrap_enkf_data_safe_cast_const( arg ); - { - return std_enkf_has_var(module_data->std_enkf_data, var_name); - } -} - -double bootstrap_enkf_get_double( const void * arg, const char * var_name) { - const bootstrap_enkf_data_type * module_data = bootstrap_enkf_data_safe_cast_const( arg ); - { - return std_enkf_get_double( module_data->std_enkf_data , var_name); - } -} - -int bootstrap_enkf_get_int( const void * arg, const char * var_name) { - const bootstrap_enkf_data_type * module_data = bootstrap_enkf_data_safe_cast_const( arg ); - { - return std_enkf_get_int( module_data->std_enkf_data , var_name); - } -} - - - - -#ifdef INTERNAL_LINK -#define LINK_NAME BOOTSTRAP_ENKF -#else -#define LINK_NAME EXTERNAL_MODULE_SYMBOL -#endif - - -analysis_table_type LINK_NAME = { - .name = "BOOTSTRAP_ENKF", - .alloc = bootstrap_enkf_data_alloc, - .freef = bootstrap_enkf_data_free, - .set_int = bootstrap_enkf_set_int , - .set_double = bootstrap_enkf_set_double , - .set_bool = bootstrap_enkf_set_bool , - .set_string = NULL , - .get_options = bootstrap_enkf_get_options , - .initX = NULL, - .updateA = bootstrap_enkf_updateA, - .init_update = NULL, - .complete_update = NULL, - .has_var = bootstrap_enkf_has_var, - .get_int = bootstrap_enkf_get_int, - .get_double = bootstrap_enkf_get_double, - .get_bool = NULL, - .get_ptr = NULL, -}; diff --git a/ThirdParty/Ert/libanalysis/src/cv_enkf.c b/ThirdParty/Ert/libanalysis/src/cv_enkf.c deleted file mode 100644 index b00574c83d..0000000000 --- a/ThirdParty/Ert/libanalysis/src/cv_enkf.c +++ /dev/null @@ -1,721 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'cv_enkf.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#define CV_ENKF_TYPE_ID 765523 - -#define INVALID_SUBSPACE_DIMENSION -1 -#define INVALID_TRUNCATION -1 -#define DEFAULT_SUBSPACE_DIMENSION INVALID_SUBSPACE_DIMENSION - -#define DEFAULT_NFOLDS 10 -#define DEFAULT_PEN_PRESS false -#define NFOLDS_KEY "CV_NFOLDS" -#define CV_PEN_PRESS_KEY "CV_PEN_PRESS" - - - - -struct cv_enkf_data_struct { - UTIL_TYPE_ID_DECLARATION; - matrix_type * Z; - matrix_type * Rp; - matrix_type * Dp; - rng_type * rng; - double truncation; - int nfolds; - int subspace_dimension; // ENKF_NCOMP_KEY (-1: use Truncation instead) - long option_flags; - bool penalised_press; -}; - - - -static UTIL_SAFE_CAST_FUNCTION( cv_enkf_data , CV_ENKF_TYPE_ID ) -static UTIL_SAFE_CAST_FUNCTION_CONST( cv_enkf_data , CV_ENKF_TYPE_ID ) - - -void cv_enkf_set_truncation( cv_enkf_data_type * data , double truncation ) { - data->truncation = truncation; - if (truncation > 0.0) - data->subspace_dimension = INVALID_SUBSPACE_DIMENSION; -} - - -void cv_enkf_set_subspace_dimension( cv_enkf_data_type * data , int subspace_dimension) { - data->subspace_dimension = subspace_dimension; - if (subspace_dimension > 0) - data->truncation = INVALID_TRUNCATION; -} - - -void cv_enkf_set_nfolds( cv_enkf_data_type * data , int nfolds ) { - data->nfolds = nfolds; -} - -void cv_enkf_set_pen_press( cv_enkf_data_type * data , bool value ) { - data->penalised_press = value; -} - - -void * cv_enkf_data_alloc( rng_type * rng ) { - cv_enkf_data_type * data = util_malloc( sizeof * data); - UTIL_TYPE_ID_INIT( data , CV_ENKF_TYPE_ID ); - - data->Z = NULL; - data->Rp = NULL; - data->Dp = NULL; - data->rng = rng; - - data->penalised_press = DEFAULT_PEN_PRESS; - data->option_flags = ANALYSIS_NEED_ED + ANALYSIS_USE_A + ANALYSIS_SCALE_DATA; - data->nfolds = DEFAULT_NFOLDS; - cv_enkf_set_truncation( data , DEFAULT_ENKF_TRUNCATION_ ); - - return data; -} - - - -void cv_enkf_data_free( void * arg ) { - cv_enkf_data_type * cv_data = cv_enkf_data_safe_cast( arg ); - { - matrix_safe_free( cv_data->Z ); - matrix_safe_free( cv_data->Rp ); - matrix_safe_free( cv_data->Dp ); - } - free( cv_data ); -} - - - - - - -void cv_enkf_init_update( void * arg , - const bool_vector_type * ens_mask , - const matrix_type * S , - const matrix_type * R , - const matrix_type * dObs , - const matrix_type * E , - const matrix_type * D ) { - - cv_enkf_data_type * cv_data = cv_enkf_data_safe_cast( arg ); - { - int i, j; - const int nrobs = matrix_get_rows( S ); - const int nrens = matrix_get_columns( S ); - const int nrmin = util_int_min( nrobs , nrens ); - - cv_data->Z = matrix_alloc( nrmin , nrens ); - cv_data->Rp = matrix_alloc( nrmin , nrmin ); - cv_data->Dp = matrix_alloc( nrmin , nrens ); - - /* - Compute SVD(S) - */ - matrix_type * U0 = matrix_alloc( nrobs , nrmin ); /* Left singular vectors. */ - matrix_type * V0T = matrix_alloc( nrmin , nrens ); /* Right singular vectors. */ - - double * inv_sig0 = util_calloc( nrmin , sizeof * inv_sig0 ); - double * sig0 = inv_sig0; - - printf("Computing svd using truncation %0.4f\n",cv_data->truncation); - - enkf_linalg_svdS(S , cv_data->truncation , cv_data->subspace_dimension , DGESVD_MIN_RETURN , inv_sig0 , U0 , V0T); - - /* Need to use the original non-inverted singular values. */ - for(i = 0; i < nrmin; i++) - if ( inv_sig0[i] > 0 ) - sig0[i] = 1.0 / inv_sig0[i]; - - /* - Compute the actual principal components, Z = sig0 * VOT - NOTE: Z contains potentially alot of redundant zeros, but - we do not care about this for now - */ - - for(i = 0; i < nrmin; i++) - for(j = 0; j < nrens; j++) - matrix_iset( cv_data->Z , i , j , sig0[i] * matrix_iget( V0T , i , j ) ); - - /* Also compute Rp */ - { - matrix_type * X0 = matrix_alloc( nrmin , matrix_get_rows( R )); - matrix_dgemm(X0 , U0 , R , true , false , 1.0 , 0.0); /* X0 = U0^T * R */ - matrix_dgemm(cv_data->Rp , X0 , U0 , false , false , 1.0 , 0.0); /* Rp = X0 * U0 */ - matrix_free(X0); - } - - /*We also need to compute the reduced "Innovation matrix" Dp = U0' * D */ - matrix_dgemm(cv_data->Dp , U0 , D , true , false , 1.0 , 0.0); - - - free(inv_sig0); - matrix_free(U0); - matrix_free(V0T); - - /* - 2: Diagonalize the S matrix; singular vectors etc. needed later in the local CV: - (V0T = transposed right singular vectors of S, Z = scaled principal components, - eig = scaled, inverted singular vectors, U0 = left singular vectors of S - eig = inv(I+Lambda1),(Eq.14.30, and 14.29, Evensen, 2007, respectively) - */ - } -} - - - -/*Function that computes the PRESS for different subspace dimensions using - m-fold CV - INPUT : - A : State-Vector ensemble matrix - Z : Ensemble matrix of principal components - Rp : Reduced order Observation error matrix - indexTrain: index of training ensemble - indexTest: index of test ensemble - nTest : number of members in the training ensemble - nTrain . number of members in the test ensemble - foldIndex: integer specifying which "cv-fold" we are considering - - OUTPUT: - cvErr : UPDATED MATRIX OF PRESS VALUES - -*/ - -static void cv_enkf_get_cv_error_prin_comp( cv_enkf_data_type * cv_data , - matrix_type * cvErr , - const matrix_type * A , - const int * indexTest, - const int * indexTrain , - const int nTest , - const int nTrain , - const int foldIndex, - const int maxP) { - /* - We need to predict ATest(p), for p = 1,...,nens -1, based on the estimated regression model: - AHatTest(p) = A[:,indexTrain] * Z[1:p,indexTrain]'* inv( Z[1:p,indexTrain] * Z[1:p,indexTrain]' + (nens-1) * Rp[1:p,1:p] ) * Z[1:p,indexTest]; - */ - - - const int nx = matrix_get_rows( A ); - matrix_type * AHat = matrix_alloc(nx , nTest ); - matrix_type * ATrain = matrix_alloc( nx , nTrain ); - - int p,i,j; - - - /* Copy elements*/ - for (i = 0; i < nx; i++) - for (j = 0; j < nTrain; j++) - matrix_iset(ATrain , i , j , matrix_iget( A , i , indexTrain[j])); - - - for (p = 0; p < maxP; p++) { - matrix_type * ZpTrain = matrix_alloc( p + 1, nTrain ); - matrix_type *SigDp = matrix_alloc( p + 1 , p + 1); - - - for (i = 0; i <= p ; i++) - for (j = 0; j < nTrain; j++) - matrix_iset(ZpTrain , i , j , matrix_iget(cv_data->Z , i , indexTrain[j])); - - /* SigDp = ZpTrain * ZpTrain' */ - matrix_dgemm( SigDp , ZpTrain , ZpTrain, false , true , 1.0, 0.0); - - /* SigDp += (nTrain - 1) * Rp */ - for(i = 0; i <= p; i++) - for( j = 0; j <= p; j++) - matrix_iadd( SigDp , i , j , (nTrain - 1) * matrix_iget(cv_data->Rp, i, j)); - - - /* Invert the covariance matrix for the principal components */ - { - int inv_ok = matrix_inv( SigDp ); - if ( inv_ok != 0 ) - util_abort("%s: inversion of covariance matrix for the principal components failed for subspace dimension p = %d\n - aborting \n",__func__,p+1); - } - - - { - matrix_type * W = matrix_alloc(p + 1 , nTest ); - matrix_type * W2 = matrix_alloc(nTrain , nTest ); - - /* W = inv(SigDp) * ZTest */ - for (i = 0; i <= p; i++) { - for (j = 0; j < nTest; j++) { - double ksum = 0.0; - for (int k = 0; k <= p; k++) - ksum += matrix_iget(SigDp , i , k) * matrix_iget(cv_data->Z , k , indexTest[j]); - - matrix_iset(W , i , j , ksum); - } - } - - /* W2 = ZpTrain' * W */ - matrix_dgemm( W2 , ZpTrain , W , true , false , 1.0 , 0.0); - - /* Estimate the state-vector */ - matrix_matmul( AHat , ATrain , W2 ); - - matrix_free( W2 ); - matrix_free( W ); - } - - - /*Compute Press Statistic: */ - { - double R2Sum = 0; - - for (i = 0; i < nx; i++) { - for (j = 0; j < nTest; j++) { - double tmp = matrix_iget(A , i , indexTest[j]) - matrix_iget(AHat , i , j); - R2Sum += tmp * tmp; - } - } - matrix_iset( cvErr , p , foldIndex , R2Sum ); - } - - - - matrix_free( ZpTrain ); - matrix_free( SigDp ); - } /*end for p */ - - matrix_free( AHat ); - matrix_free( ATrain ); -} - - - - - - -int cv_enkf_get_optimal_numb_comp(cv_enkf_data_type * cv_data , - const matrix_type * cvErr , - const int maxP ) { - - - double * cvMean = util_calloc( maxP , sizeof * cvMean ); - double * cvStd = util_calloc( maxP , sizeof * cvStd ); - int optP; - - { - for (int p = 0; p < maxP; p++ ){ - double err_sum = 0; - for (int folds = 0; folds < cv_data->nfolds; folds++ ) - err_sum += matrix_iget( cvErr , p, folds ); - - cvMean[p] = err_sum / cv_data->nfolds; - } - - for ( int p = 0; p < maxP; p++){ - double err_sum2 = 0; - for ( int folds = 0; folds < cv_data->nfolds; folds++) - err_sum2 += pow( matrix_iget( cvErr , p , folds ) - cvMean[p] , 2); - - cvStd[p] = sqrt( err_sum2 / (cv_data->nfolds - 1) ); - } - } - - { - double minErr = cvMean[0]; - int i; - optP = 1; - - printf("PRESS:\n"); - printf("%f\n",cvMean[0]); - for (i = 1; i < maxP; i++) { - printf("%f\n",cvMean[i]); - if ((cvMean[i] < minErr) && (cvMean[i] > 0.0)) { - minErr = cvMean[i]; - optP = i+1; - } - } - - - - - if (cv_data->penalised_press) { - for ( i = 0; i < optP; i++){ - if( cvMean[i] - cvStd[i] <= minErr ){ - optP = i+1; - break; - } - } - } - } - - free( cvStd ); - free( cvMean ); - return optP; -} - - - - - - -/* Function that performs cross-validation to find the optimal subspace dimension, */ - - -static int get_optimal_principal_components( cv_enkf_data_type * cv_data , - const matrix_type * A) { - - - const int nrens = matrix_get_columns( cv_data->Z ); - const int nrmin = matrix_get_rows( cv_data->Z ); - - - - matrix_type * cvError; - int * randperms = util_calloc( nrens , sizeof * randperms); - - int maxP = nrmin; - int optP; - - - /* We only want to search the non-zero eigenvalues */ - for (int i = 0; i < nrmin; i++) { - if (matrix_iget(cv_data->Z,i,1) == 0.0) { - maxP = i; - break; - } - } - - if (maxP > nrmin) - maxP = nrmin - 1; // <- Change by Joakim; using nrmin here will load to out - // bounds access oc cv_data->Z at line 460. - - - - - if ( nrens < cv_data->nfolds ) - util_abort("%s: number of ensemble members %d need to be larger than the number of cv-folds - aborting \n", - __func__, - nrens, - cv_data->nfolds); - - for (int i=0; i < nrens; i++) - randperms[i] = i; - - rng_shuffle_int( cv_data->rng , randperms , nrens ); - - cvError = matrix_alloc( maxP , cv_data->nfolds ); - { - int ntest, ntrain, k,j,i; - int * indexTest = util_calloc( nrens , sizeof * indexTest ); - int * indexTrain = util_calloc( nrens , sizeof * indexTrain ); - for (i = 0; i < cv_data->nfolds; i++) { - ntest = 0; - ntrain = 0; - k = i; - /*extract members for the training and test ensembles */ - for (j = 0; j < nrens; j++) { - if (j == k) { - indexTest[ntest] = randperms[j]; - k += cv_data->nfolds; - ntest++; - } else { - indexTrain[ntrain] = randperms[j]; - ntrain++; - } - } - - /*Perform CV for each subspace dimension p */ - cv_enkf_get_cv_error_prin_comp( cv_data , cvError , A , indexTest , indexTrain, ntest, ntrain , i , maxP); - } - free( indexTest ); - free( indexTrain ); - } - - - /* find optimal truncation value for the cv-scheme */ - optP = cv_enkf_get_optimal_numb_comp( cv_data , cvError , maxP); - - matrix_free( cvError ); - free( randperms ); - return optP; -} - - - -/*NB! HERE WE COUNT optP from 0,1,2,... */ -static void getW_prin_comp(cv_enkf_data_type * cv_data , matrix_type *W , const int optP) { - - int i, j; - double tmp2; - int nrens = matrix_get_columns( cv_data->Z ); - - /* Finally, compute W = Z(1:p,:)' * inv(Z(1:p,:) * Z(1:p,:)' + (n -1) * Rp) */ - matrix_type *Zp = matrix_alloc( optP, nrens ); - matrix_type *SigZp = matrix_alloc( optP ,optP); - - // This loop will fail with i to large whcn accessing cv_data->Z - // if we do not limit maxP to nrmin - 1? - for (i = 0; i < optP ; i++) - for (j = 0; j < nrens; j++) - matrix_iset_safe(Zp , i , j , matrix_iget_safe(cv_data->Z , i ,j)); - - // Matrix copy_block should be used in stead of the double (i,j) loop; - // however that failed because the cv_data->Z matrix had one row too few? - // matrix_copy_block( Zp , 0 , 0 , optP , nrens , cv_data->Z , 0 , 0 ); - - /*Compute SigZp = Zp * Zp' */ - matrix_dgemm( SigZp , Zp , Zp, false , true , 1.0, 0.0); - - /*Add (ntrain-1) * Rp*/ - for(i = 0; i < optP; i++) { - for( j = 0; j < optP; j++) { - tmp2 = matrix_iget(SigZp , i , j) + (nrens - 1) * matrix_iget(cv_data->Rp, i, j); - matrix_iset( SigZp , i , j , tmp2 ); - } - } - - - /* Invert the covariance matrix for the principal components */ - int inv_ok = matrix_inv( SigZp ); - - /*Check if the inversion went ok */ - if ( inv_ok != 0 ) - util_abort("%s: inversion of covariance matrix for the principal components failed for subspace dimension p = %d\n - aborting \n",__func__,optP); - - - - - /*Compute W = Zp' * inv(SigZp) */ - matrix_dgemm( W , Zp , SigZp , true , false , 1.0 , 0.0); - - matrix_free( Zp ); - matrix_free( SigZp ); -} - - - - -void cv_enkf_initX(void * module_data , - matrix_type * X , - matrix_type * A , - matrix_type * S , - matrix_type * R , - matrix_type * dObs , - matrix_type * E , - matrix_type * D) { - - - cv_enkf_data_type * cv_data = cv_enkf_data_safe_cast( module_data ); - printf("Running CV\n"); - { - int optP; - int ens_size = matrix_get_columns( S ); - - /* Get the optimal number of principal components - where p is found minimizing the PRESS statistic */ - - { - matrix_type * workA = matrix_alloc_copy( A ); - matrix_subtract_row_mean( workA ); - optP = get_optimal_principal_components(cv_data , workA ); - printf("Optimal subspace dimension found %d\n",optP); - matrix_free( workA ); - } - - { - matrix_type * W = matrix_alloc(ens_size , optP); - - /* Compute W = Z(1:p,:)' * inv(Z(1:p,:) * Z(1:p,:)' + (ens_size-1) * Rp(1:p,1:p))*/ - getW_prin_comp( cv_data , W , optP); - - /*Compute the actual X5 matrix: */ - /*Compute X5 = W * Dp (The hard way) */ - for( int i = 0; i < ens_size; i++) { - for( int j = 0; j < ens_size; j++) { - double tmp = 0.0; - - for( int k = 0; k < optP; k++) - tmp += matrix_iget( W , i , k) * matrix_iget( cv_data->Dp , k , j); - - matrix_iset(X , i , j ,tmp); - } - matrix_iadd( X , i , i , 1.0); /* X5 = I + X5 */ - } - - matrix_free( W ); - } - } -} - - - -void cv_enkf_complete_update( void * arg ) { - cv_enkf_data_type * cv_data = cv_enkf_data_safe_cast( arg ); - { - matrix_free( cv_data->Z ); - matrix_free( cv_data->Rp ); - matrix_free( cv_data->Dp ); - - cv_data->Z = NULL; - cv_data->Rp = NULL; - cv_data->Dp = NULL; - } -} - - - -bool cv_enkf_set_double( void * arg , const char * var_name , double value) { - cv_enkf_data_type * module_data = cv_enkf_data_safe_cast( arg ); - { - bool name_recognized = true; - - if (strcmp( var_name , ENKF_TRUNCATION_KEY_) == 0) - cv_enkf_set_truncation( module_data , value ); - else - name_recognized = false; - - return name_recognized; - } -} - - -bool cv_enkf_set_int( void * arg , const char * var_name , int value) { - cv_enkf_data_type * module_data = cv_enkf_data_safe_cast( arg ); - { - bool name_recognized = true; - - if (strcmp( var_name , ENKF_NCOMP_KEY_) == 0) - cv_enkf_set_subspace_dimension( module_data , value ); - else if (strcmp( var_name , NFOLDS_KEY) == 0) - cv_enkf_set_nfolds( module_data , value); - else - name_recognized = false; - - return name_recognized; - } -} - - -bool cv_enkf_set_bool( void * arg , const char * var_name , bool value) { - cv_enkf_data_type * module_data = cv_enkf_data_safe_cast( arg ); - { - bool name_recognized = true; - if (strcmp( var_name , CV_PEN_PRESS_KEY) == 0) - cv_enkf_set_pen_press( module_data , value ); - else - name_recognized = false; - - return name_recognized; - } -} - - -long cv_enkf_get_options( void * arg , long flag) { - cv_enkf_data_type * cv_data = cv_enkf_data_safe_cast( arg ); - { - return cv_data->option_flags; - } -} - -bool cv_enkf_has_var( const void * arg, const char * var_name) { - { - if (strcmp(var_name , ENKF_NCOMP_KEY_) == 0) - return true; - else if (strcmp(var_name , ENKF_TRUNCATION_KEY_) == 0) - return true; - else if (strcmp(var_name , NFOLDS_KEY) == 0) - return true; - else if (strcmp(var_name , CV_PEN_PRESS_KEY) == 0) - return true; - else - return false; - } -} - -double cv_enkf_get_double( const void * arg, const char * var_name) { - const cv_enkf_data_type * module_data = cv_enkf_data_safe_cast_const( arg ); - { - if (strcmp(var_name , ENKF_TRUNCATION_KEY_) == 0) - return module_data->truncation; - else - return -1; - } -} - -int cv_enkf_get_int( const void * arg, const char * var_name) { - const cv_enkf_data_type * module_data = cv_enkf_data_safe_cast_const( arg ); - { - if (strcmp(var_name , ENKF_NCOMP_KEY_) == 0) - return module_data->subspace_dimension; - else if (strcmp(var_name , NFOLDS_KEY) == 0) - return module_data->nfolds; - else - return -1; - } -} - -bool cv_enkf_get_bool( const void * arg, const char * var_name) { - const cv_enkf_data_type * module_data = cv_enkf_data_safe_cast_const( arg ); - { - if (strcmp(var_name , CV_PEN_PRESS_KEY) == 0) - return module_data->penalised_press; - else - return false; - } -} - - -#ifdef INTERNAL_LINK -#define LINK_NAME CV_ENKF -#else -#define LINK_NAME EXTERNAL_MODULE_SYMBOL -#endif - - -analysis_table_type LINK_NAME = { - .name = "CV_ENKF", - .alloc = cv_enkf_data_alloc, - .freef = cv_enkf_data_free, - .set_int = cv_enkf_set_int , - .set_double = cv_enkf_set_double , - .set_bool = cv_enkf_set_bool , - .set_string = NULL , - .get_options = cv_enkf_get_options , - .initX = cv_enkf_initX , - .updateA = NULL, - .init_update = cv_enkf_init_update , - .complete_update = cv_enkf_complete_update , - .has_var = cv_enkf_has_var, - .get_int = cv_enkf_get_int, - .get_double = cv_enkf_get_double, - .get_bool = cv_enkf_get_bool, - .get_ptr = NULL, -}; diff --git a/ThirdParty/Ert/libanalysis/src/enkf_linalg.c b/ThirdParty/Ert/libanalysis/src/enkf_linalg.c deleted file mode 100644 index b3caf21637..0000000000 --- a/ThirdParty/Ert/libanalysis/src/enkf_linalg.c +++ /dev/null @@ -1,860 +0,0 @@ -#include -#include -#include - -#include -#include -#include -#include - -#include - -void enkf_linalg_genX3(matrix_type * X3 , const matrix_type * W , const matrix_type * D , const double * eig) { - const int nrobs = matrix_get_rows( D ); - const int nrens = matrix_get_columns( D ); - const int nrmin = util_int_min( nrobs , nrens ); - int i,j; - matrix_type * X1 = matrix_alloc(nrmin , nrobs); - matrix_type * X2 = matrix_alloc(nrmin , nrens); - - /* X1 = (I + Lambda1)^(-1) * W'*/ - for (i=0; i < nrmin; i++) - for (j=0; j < nrobs; j++) - matrix_iset(X1 , i , j , eig[i] * matrix_iget(W , j , i)); - - matrix_matmul(X2 , X1 , D); /* X2 = X1 * D (Eq. 14.31) */ - matrix_matmul(X3 , W , X2); /* X3 = W * X2 = X1 * X2 (Eq. 14.31) */ - - matrix_free( X1 ); - matrix_free( X2 ); -} - - -void enkf_linalg_genX2(matrix_type * X2 , const matrix_type * S , const matrix_type * W , const double * eig) { - const int nrens = matrix_get_columns( S ); - const int idim = matrix_get_rows( X2 ); - matrix_dgemm(X2 , W , S , true , false , 1.0 , 0.0); - { - int i,j; - for (j=0; j < nrens; j++) - for (i=0; i < idim; i++) - matrix_imul(X2 , i,j , sqrt(eig[i])); - } -} - - - -/** - This function calculates the svd of the input matrix S. The number - of significant singular values to retain can either be forced to a - fixed number, or a cutoff on small singular values can be - used. This behaviour is regulated by the @ncomp and @truncation - parameters: - - ncomp > 0 , truncation < 0: Use ncomp parameters. - ncomp < 0 , truncation > 0: Truncate at level 'truncation'. - - The singular values are returned in the inv_sig0 vector; the values - we retain are inverted and the remaining elements in are explicitly - set to zero. - - The left-hand singular vectors are returned in the matrix - U0. Depending on the value of the flag @store_V0T the right hand - singular vectors are stored in the V0T matrix, or just - discarded. If you do not intend to use the right hand vectors at - all, i.e. store_V0T == DGESVD_NONE, the V0T matrix will not be - accessed. - - The input S matrix should have been shifted to zero mean prior to - calling this function. -*/ - - - -/*This function is similar to enkf_linalg_svdS but it returns the eigen values without its inverse and also give the matrices truncated U VT and Sig0*/ - -// Trunc.SVD(S) = U0 * Sig0 * V0T -int enkf_linalg_svd_truncation(const matrix_type * S , - double truncation , - int ncomp , - dgesvd_vector_enum store_V0T , - double * sig0, - matrix_type * U0 , - matrix_type * V0T) { - - int num_significant = -1; - int nrows = matrix_get_rows(S); - int ncolumns= matrix_get_columns(S); - - if (((truncation > 0) && (ncomp < 0)) || - ((truncation < 0) && (ncomp > 0))) { - - int num_singular_values = util_int_min( matrix_get_rows( S ) , matrix_get_columns( S )); - { - matrix_type * workS = matrix_alloc_copy( S ); - matrix_dgesvd(DGESVD_MIN_RETURN , store_V0T , workS , sig0 , U0 , V0T); - matrix_free( workS ); - } - int i; - - if (ncomp > 0) - num_significant = ncomp; - else { - double total_sigma2 = 0; - for (i=0; i < num_singular_values; i++) - total_sigma2 += sig0[i]; - - /* - Determine the number of singular values by enforcing that - less than a fraction @truncation of the total variance be - accounted for. - */ - num_significant = 0; - { - double running_sigma2 = 0; - for (i=0; i < num_singular_values; i++) { - if (running_sigma2 / total_sigma2 < truncation) { /* Include one more singular value ? */ - num_significant++; - running_sigma2 += sig0[i]; - } else - break; - } - } - } - if (num_significant > 0) { - matrix_resize(U0 , nrows , num_significant , true); - matrix_resize(V0T , num_significant , ncolumns , true); - } else - util_abort("%s: zero significant singular values\n",__func__); - } - else - util_abort("%s: truncation:%g ncomp:%d - invalid ambigous input.\n",__func__ , truncation , ncomp ); - - return num_significant; -} - - -static int enkf_linalg_num_significant(int num_singular_values , const double * sig0 , double truncation ) { - int num_significant = 0; - double total_sigma2 = 0; - for (int i=0; i < num_singular_values; i++) - total_sigma2 += sig0[i] * sig0[i]; - - /* - Determine the number of singular values by enforcing that - less than a fraction @truncation of the total variance be - accounted for. - */ - { - double running_sigma2 = 0; - for (int i=0; i < num_singular_values; i++) { - if (running_sigma2 / total_sigma2 < truncation) { /* Include one more singular value ? */ - num_significant++; - running_sigma2 += sig0[i] * sig0[i]; - } else - break; - } - } - - return num_significant; -} - - -int enkf_linalg_svdS(const matrix_type * S , - double truncation , - int ncomp , - dgesvd_vector_enum store_V0T , - double * inv_sig0, - matrix_type * U0 , - matrix_type * V0T) { - - double * sig0 = inv_sig0; - int num_significant = 0; - - - if (((truncation > 0) && (ncomp < 0)) || - ((truncation < 0) && (ncomp > 0))) { - int num_singular_values = util_int_min( matrix_get_rows( S ) , matrix_get_columns( S )); - { - matrix_type * workS = matrix_alloc_copy( S ); - matrix_dgesvd(DGESVD_MIN_RETURN , store_V0T , workS , sig0 , U0 , V0T); - matrix_free( workS ); - } - - if (ncomp > 0) - num_significant = ncomp; - else - num_significant = enkf_linalg_num_significant( num_singular_values , sig0 , truncation ); - - { - int i; - /* Inverting the significant singular values */ - for (i = 0; i < num_significant; i++) - inv_sig0[i] = 1.0 / sig0[i]; - - /* Explicitly setting the insignificant singular values to zero. */ - for (i=num_significant; i < num_singular_values; i++) - inv_sig0[i] = 0; - } - } else - - util_abort("%s: truncation:%g ncomp:%d - invalid ambigous input.\n",__func__ , truncation , ncomp ); - - return num_significant; -} - - -int enkf_linalg_num_PC(const matrix_type * S , double truncation ) { - int num_singular_values = util_int_min( matrix_get_rows( S ) , matrix_get_columns( S )); - int num_significant; - double * sig0 = util_calloc( num_singular_values , sizeof * sig0); - - { - matrix_type * workS = matrix_alloc_copy( S ); - matrix_dgesvd(DGESVD_NONE , DGESVD_NONE , workS , sig0 , NULL , NULL); - matrix_free( workS ); - } - - num_significant = enkf_linalg_num_significant( num_singular_values , sig0 , truncation ); - free( sig0 ); - return num_significant; -} - - - -/* -**************************************************************************************************** - Routine computes X1 and eig corresponding to Eqs 14.54-14.55 - Geir Evensen -*/ -void enkf_linalg_lowrankE(const matrix_type * S , /* (nrobs x nrens) */ - const matrix_type * E , /* (nrobs x nrens) */ - matrix_type * W , /* (nrobs x nrmin) Corresponding to X1 from Eqs. 14.54-14.55 */ - double * eig , /* (nrmin) Corresponding to 1 / (1 + Lambda1^2) (14.54) */ - double truncation , - int ncomp) { - - - const int nrobs = matrix_get_rows( S ); - const int nrens = matrix_get_columns( S ); - const int nrmin = util_int_min( nrobs , nrens ); - - matrix_type * U0 = matrix_alloc( nrobs , nrmin ); - double * inv_sig0 = util_calloc( nrmin , sizeof * inv_sig0); - matrix_type * X0 = matrix_alloc( nrmin , nrens ); - - - matrix_type * U1 = matrix_alloc( nrmin , nrmin ); - double * sig1 = util_calloc( nrmin , sizeof * sig1); - - int i ,j; - - -/* Compute SVD of S=HA` -> U0, invsig0=sig0^(-1) */ - enkf_linalg_svdS(S , truncation , ncomp , DGESVD_NONE , inv_sig0, U0 , NULL); - -/* X0(nrmin x nrens) = Sigma0^(+) * U0'* E (14.51) */ - matrix_dgemm(X0 , U0 , E , true , false , 1.0 , 0.0); /* X0 = U0^T * E (14.51) */ - - -/* Multiply X0 with sig0^(-1) from left X0 = S^(-1) * X0 */ - for (j=0; j < matrix_get_columns( X0 ) ; j++) - for (i=0; i < matrix_get_rows( X0 ); i++) - matrix_imul(X0 , i , j , inv_sig0[j]); - - -/* Compute SVD of X0-> U1*eig*V1 14.52 */ - matrix_dgesvd(DGESVD_MIN_RETURN , DGESVD_NONE, X0 , sig1, U1 , NULL); - - /* Lambda1 = 1/(I + Lambda^2) in 14.56 */ - for (i=0; i < nrmin; i++) - eig[i] = 1.0 / (1.0 + sig1[i]*sig1[i]); - - -/* Compute sig0^+ U1 (14:55) */ - for (j=0; j < nrmin; j++) - for (i=0; i < nrmin; i++) - matrix_imul(U1 , i , j , inv_sig0[i]); - - -/* Compute X1 = W = U0 * (U1=sig0^+ U1) = U0 * Sigma0^(+') * U1 (14:55) */ - matrix_matmul(W , U0 , U1); - - - matrix_free( X0 ); - matrix_free( U0 ); - util_safe_free( inv_sig0 ); - - matrix_free( U1 ); - util_safe_free( sig1 ); - -} - - - - -void enkf_linalg_Cee(matrix_type * B, int nrens , const matrix_type * R , const matrix_type * U0 , const double * inv_sig0) { - const int nrmin = matrix_get_rows( B ); - { - matrix_type * X0 = matrix_alloc( nrmin , matrix_get_rows( R )); - matrix_dgemm(X0 , U0 , R , true , false , 1.0 , 0.0); /* X0 = U0^T * R */ - matrix_dgemm(B , X0 , U0 , false , false , 1.0 , 0.0); /* B = X0 * U0 */ - matrix_free( X0 ); - } - - { - int i ,j; - - /* Funny code ?? - Multiply B with S^(-1)from left and right - BHat = S^(-1) * B * S^(-1) - */ - for (j=0; j < matrix_get_columns( B ) ; j++) - for (i=0; i < matrix_get_rows( B ); i++) - matrix_imul(B , i , j , inv_sig0[i]); - - for (j=0; j < matrix_get_columns( B ) ; j++) - for (i=0; i < matrix_get_rows( B ); i++) - matrix_imul(B , i , j , inv_sig0[j]); - } - - matrix_scale(B , nrens - 1.0); -} - - - - -void enkf_linalg_lowrankCinv__(const matrix_type * S , - const matrix_type * R , - matrix_type * V0T , - matrix_type * Z, - double * eig , - matrix_type * U0, - double truncation, - int ncomp) { - - const int nrobs = matrix_get_rows( S ); - const int nrens = matrix_get_columns( S ); - const int nrmin = util_int_min( nrobs , nrens ); - - double * inv_sig0 = util_calloc( nrmin , sizeof * inv_sig0); - - if (V0T != NULL) - enkf_linalg_svdS(S , truncation , ncomp , DGESVD_MIN_RETURN , inv_sig0 , U0 , V0T ); - else - enkf_linalg_svdS(S , truncation , ncomp , DGESVD_NONE , inv_sig0, U0 , NULL); - - { - matrix_type * B = matrix_alloc( nrmin , nrmin ); - enkf_linalg_Cee( B , nrens , R , U0 , inv_sig0); /* B = Xo = (N-1) * Sigma0^(+) * U0'* Cee * U0 * Sigma0^(+') (14.26)*/ - matrix_dgesvd(DGESVD_MIN_RETURN , DGESVD_NONE, B , eig, Z , NULL); - matrix_free( B ); - } - - { - int i,j; - /* Lambda1 = (I + Lambda)^(-1) */ - - for (i=0; i < nrmin; i++) - eig[i] = 1.0 / (1 + eig[i]); - - for (j=0; j < nrmin; j++) - for (i=0; i < nrmin; i++) - matrix_imul(Z , i , j , inv_sig0[i]); /* Z2 = Sigma0^(+) * Z; */ - } - util_safe_free( inv_sig0 ); -} - - -void enkf_linalg_lowrankCinv(const matrix_type * S , - const matrix_type * R , - matrix_type * W , /* Corresponding to X1 from Eq. 14.29 */ - double * eig , /* Corresponding to 1 / (1 + Lambda_1) (14.29) */ - double truncation , - int ncomp) { - - const int nrobs = matrix_get_rows( S ); - const int nrens = matrix_get_columns( S ); - const int nrmin = util_int_min( nrobs , nrens ); - - matrix_type * U0 = matrix_alloc( nrobs , nrmin ); - matrix_type * Z = matrix_alloc( nrmin , nrmin ); - - enkf_linalg_lowrankCinv__( S , R , NULL , Z , eig , U0 , truncation , ncomp); - matrix_matmul(W , U0 , Z); /* X1 = W = U0 * Z2 = U0 * Sigma0^(+') * Z */ - - matrix_free( U0 ); - matrix_free( Z ); -} - - -void enkf_linalg_meanX5(const matrix_type * S , - const matrix_type * W , - const double * eig , - const matrix_type * dObs, - matrix_type * X5) { - - - const int nrens = matrix_get_columns( S ); - const int nrobs = matrix_get_rows( S ); - const int nrmin = util_int_min( nrobs , nrens ); - double * work = util_calloc( (2 * nrmin + nrobs + nrens) , sizeof * work ); - matrix_type * innov = enkf_linalg_alloc_innov( dObs , S ); - { - double * y1 = &work[0]; - double * y2 = &work[nrmin]; - double * y3 = &work[2*nrmin]; - double * y4 = &work[2*nrmin + nrobs]; - - if (nrobs == 1) { - /* Is this special casing necessary ??? */ - y1[0] = matrix_iget(W , 0,0) * matrix_iget( innov , 0 , 0); - y2[0] = eig[0] * y1[0]; - y3[0] = matrix_iget(W , 0, 0) *y2[0]; - for (int iens = 0; iens < nrens; iens++) - y4[iens] = y3[0] * matrix_iget(S , 0, iens); - } else { - matrix_dgemv(W , matrix_get_data( innov ) , y1 , true , 1.0, 0.0); /* y1 = Trans(W) * innov */ - for (int i= 0; i < nrmin; i++) - y2[i] = eig[i] * y1[i]; /* y2 = eig * y1 */ - matrix_dgemv(W , y2 , y3 , false , 1.0 , 0.0); /* y3 = W * y2; */ - matrix_dgemv(S , y3 , y4 , true , 1.0 , 0.0); /* y4 = Trans(S) * y3 */ - } - - for (int iens = 0; iens < nrens; iens++) - matrix_set_column(X5 , y4 , iens ); - - matrix_shift(X5 , 1.0/nrens); - } - free( work ); - matrix_free( innov ); -} - - - -void enkf_linalg_X5sqrt(matrix_type * X2 , matrix_type * X5 , const matrix_type * randrot, int nrobs) { - const int nrens = matrix_get_columns( X5 ); - const int nrmin = util_int_min( nrobs , nrens ); - matrix_type * VT = matrix_alloc( nrens , nrens ); - double * sig = util_calloc( nrmin , sizeof * sig ); - double * isig = util_calloc( nrmin , sizeof * sig ); - - matrix_dgesvd(DGESVD_NONE , DGESVD_ALL , X2 , sig , NULL , VT); - { - matrix_type * X3 = matrix_alloc( nrens , nrens ); - matrix_type * X33 = matrix_alloc( nrens , nrens ); - matrix_type * X4 = matrix_alloc( nrens , nrens ); - matrix_type * IenN = matrix_alloc( nrens , nrens ); - int i,j; - for (i = 0; i < nrmin; i++) - isig[i] = sqrt( util_double_max( 1.0 - sig[i]*sig[i] ,0.0)); - - for (j = 0; j < nrens; j++) - for (i = 0; i < nrens; i++) - matrix_iset(X3 , i , j , matrix_iget(VT , j , i)); - - for (j=0; j< nrmin; j++) - matrix_scale_column(X3 , j , isig[j]); - - matrix_dgemm(X33 , X3 , VT , false , false , 1.0 , 0.0); /* X33 = X3 * VT */ - if (randrot != NULL) - matrix_dgemm(X4 , X33 , randrot , false, false , 1.0 , 0.0); /* X4 = X33 * Randrot */ - else - matrix_assign(X4 , X33); - - matrix_set(IenN , -1.0/ nrens); - for (i = 0; i < nrens; i++) - matrix_iadd(IenN , i , i , 1.0); - - matrix_dgemm(X5 , IenN , X4 , false , false , 1.0 , 1.0); /* X5 = IenN * X4 + X5 */ - - matrix_free( X3 ); - matrix_free( X33 ); - matrix_free( X4 ); - matrix_free( IenN ); - } - - free(sig); - free(isig); - matrix_free( VT ); -} - - -matrix_type * enkf_linalg_alloc_innov( const matrix_type * dObs , const matrix_type * S) { - matrix_type * innov = matrix_alloc_copy( dObs ); - - for (int iobs =0; iobs < matrix_get_row_sum( dObs , iobs); iobs++) - matrix_isub( innov , iobs , 0 , matrix_get_row_sum( S , iobs )); - - return innov; -} - - -void enkf_linalg_init_stdX( matrix_type * X , const matrix_type * S , const matrix_type * D , - const matrix_type * W , const double * eig , bool bootstrap) { - - int nrobs = matrix_get_rows( W ); - int ens_size = matrix_get_rows( X ); - - matrix_type * X3 = matrix_alloc(nrobs , ens_size); - enkf_linalg_genX3(X3 , W , D , eig ); /* X2 = diag(eig) * W' * D (Eq. 14.31, Evensen (2007)) */ - /* X3 = W * X2 = X1 * X2 (Eq. 14.31, Evensen (2007)) */ - - matrix_dgemm( X , S , X3 , true , false , 1.0 , 0.0); /* X = S' * X3 */ - if (!bootstrap) { - for (int i = 0; i < ens_size ; i++) - matrix_iadd( X , i , i , 1.0); /*X = I + X */ - } - - matrix_free( X3 ); -} - - - -void enkf_linalg_init_sqrtX(matrix_type * X5 , - const matrix_type * S , - const matrix_type * randrot , - const matrix_type * innov , - const matrix_type * W , - const double * eig , - bool bootstrap) { - - const int nrobs = matrix_get_rows( S ); - const int nrens = matrix_get_columns( S ); - const int nrmin = util_int_min( nrobs , nrens ); - - matrix_type * X2 = matrix_alloc(nrmin , nrens); - - if (bootstrap) - util_exit("%s: Sorry bootstrap support not fully implemented for SQRT scheme\n",__func__); - - enkf_linalg_meanX5( S , W , eig , innov , X5 ); - enkf_linalg_genX2(X2 , S , W , eig); - enkf_linalg_X5sqrt(X2 , X5 , randrot , nrobs); - - matrix_free( X2 ); -} - -/*****************************************************************/ - - - - - -/** - This routine generates a real orthogonal random matrix. - The algorithm is the one by - Francesco Mezzadri (2007), How to generate random matrices from the classical - compact groups, Notices of the AMS, Vol. 54, pp 592-604. - 1. First a matrix with independent random normal numbers are simulated. - 2. Then the QR decomposition is computed, and Q will then be a random orthogonal matrix. - 3. The diagonal elements of R are extracted and we construct the diagonal matrix X(j,j)=R(j,j)/|R(j,j)| - 4. An updated Q'=Q X is computed, and this is now a random orthogonal matrix with a Haar measure. - - The implementation is a plain reimplementation/copy of the old m_randrot.f90 function. -*/ - - - -/** - NB: This should rather use the implementation in m_mean_preserving_rotation.f90. -*/ - -void enkf_linalg_set_randrot( matrix_type * Q , rng_type * rng) { - int ens_size = matrix_get_rows( Q ); - double * tau = util_calloc( ens_size , sizeof * tau ); - int * sign = util_calloc( ens_size , sizeof * sign); - - for (int i = 0; i < ens_size; i++) - for (int j = 0; j < ens_size; j++) - matrix_iset(Q , i , j , rng_std_normal( rng )); - - matrix_dgeqrf( Q , tau ); /* QR factorization */ - for (int i=0; i < ens_size; i++) { - double Qii = matrix_iget( Q , i,i); - sign[i] = Qii / abs(Qii); - } - - matrix_dorgqr( Q , tau , ens_size ); - for (int i = 0; i < ens_size; i++) { - if (sign[i] < 0) - matrix_scale_column( Q , i , -1 ); - } - - free( sign ); - free( tau ); -} - - - - -/** - Generates the mean preserving random rotation for the EnKF SQRT algorithm - using the algorithm from Sakov 2006-07. I.e, generate rotation Up such that - Up*Up^T=I and Up*1=1 (all rows have sum = 1) see eq 17. - From eq 18, Up=B * Upb * B^T - B is a random orthonormal basis with the elements in the first column equals 1/sqrt(nrens) - - Upb = | 1 0 | - | 0 U | - - where U is an arbitrary orthonormal matrix of dim nrens-1 x nrens-1 (eq. 19) -*/ - -matrix_type * enkf_linalg_alloc_mp_randrot(int ens_size , rng_type * rng) { - matrix_type * Up = matrix_alloc( ens_size , ens_size ); /* The return value. */ - { - matrix_type * B = matrix_alloc( ens_size , ens_size ); - matrix_type * Upb = matrix_alloc( ens_size , ens_size ); - matrix_type * U = matrix_alloc_shared(Upb , 1 , 1 , ens_size - 1, ens_size - 1); - - - { - int k,j; - matrix_type * R = matrix_alloc( ens_size , ens_size ); - matrix_random_init( B , rng); /* B is filled up with U(0,1) numbers. */ - matrix_set_const_column( B , 1.0 / sqrt( ens_size ) , 0 ); - - /* modified_gram_schmidt is used to create the orthonormal basis in B.*/ - for (k=0; k < ens_size; k++) { - double Rkk = sqrt( matrix_column_column_dot_product( B , k , B , k)); - matrix_iset(R , k , k , Rkk); - matrix_scale_column(B , k , 1.0/Rkk); - for (j=k+1; j < ens_size; j++) { - double Rkj = matrix_column_column_dot_product(B , k , B , j); - matrix_iset(R , k , j , Rkj); - { - int i; - for (i=0; i < ens_size; i++) { - double Bij = matrix_iget(B , i , j); - double Bik = matrix_iget(B , i , k); - matrix_iset(B , i , j , Bij - Bik * Rkj); - } - } - } - } - matrix_free( R ); - } - - enkf_linalg_set_randrot( U , rng ); - matrix_iset( Upb , 0 , 0 , 1); - - - { - matrix_type * Q = matrix_alloc( ens_size , ens_size ); - matrix_dgemm( Q , B , Upb , false , false , 1, 0); /* Q = B * Ubp */ - matrix_dgemm( Up , Q , B , false , true , 1, 0); /* Up = Q * T(B) */ - matrix_free( Q ); - } - - matrix_free( B ); - matrix_free( Upb ); - matrix_free( U ); - } - - return Up; -} - - -/*****************************************************************/ - -/** - Checking that the sum through one row in the X matrix equals - @target_sum. @target_sum will be 1 normally, and zero if we are doing - bootstrap. -*/ - -void enkf_linalg_checkX(const matrix_type * X , bool bootstrap) { - matrix_assert_finite( X ); - { - int target_sum; - if (bootstrap) - target_sum = 0; - else - target_sum = 1; - - for (int icol = 0; icol < matrix_get_columns( X ); icol++) { - double col_sum = matrix_get_column_sum(X , icol); - if (fabs(col_sum - target_sum) > 0.0001) - util_abort("%s: something is seriously broken. col:%d col_sum = %g != %g - ABORTING\n",__func__ , icol , col_sum , target_sum); - } - } -} - - -/*****************************************************************/ - -int enkf_linalg_get_PC( const matrix_type * S0, - const matrix_type * dObs , - double truncation, - int ncomp, - matrix_type * PC, - matrix_type * PC_obs, - double_vector_type * singular_values) { - - const int nrobs = matrix_get_rows( S0 ); - const int nrens = matrix_get_columns( S0 ); - const int nrmin = util_int_min( nrobs , nrens ); - - matrix_type * U0 = matrix_alloc( nrobs , nrens ); - matrix_type * S = matrix_alloc_copy( S0 ); - double * inv_sig0; - int num_PC; - - double_vector_iset( singular_values , nrmin - 1 , 0 ); - matrix_subtract_row_mean( S ); - ncomp = util_int_min( ncomp , nrmin ); - inv_sig0 = double_vector_get_ptr( singular_values ); - { - matrix_type * S_mean = matrix_alloc( nrobs , 1 ); - num_PC = enkf_linalg_svdS(S , truncation , ncomp, DGESVD_NONE , inv_sig0 , U0 , NULL); - - matrix_assign( S , S0); // The svd routine will overwrite S - we therefor must pick it up again from S0. - matrix_subtract_and_store_row_mean( S , S_mean); - - /* Multiply with inverted singular values. */ - matrix_resize( U0 , nrobs , num_PC , true); - for (int i=0; i < num_PC; i++) - matrix_imul_col( U0 , i , inv_sig0[i] ); - - /* The simulated components / projections */ - { - matrix_resize( PC , num_PC , nrens , false ); - matrix_dgemm( PC , U0 , S , true , false , 1.0 , 0.0 ); - } - - - /* The observer projections. */ - { - matrix_scale( S_mean , -1.0); - matrix_inplace_add_column( S_mean , dObs , 0 , 0 ); - matrix_resize( PC_obs , num_PC , 1 , false ); - matrix_dgemm( PC_obs , U0 , S_mean , true , false , 1.0 , 0.0 ); - } - - for (int i=0; i < double_vector_size( singular_values ); i++) - inv_sig0[i] = 1.0 / inv_sig0[i]; - - matrix_free( S_mean ); - } - matrix_free( S ); - matrix_free( U0 ); - - return num_PC; -} - - - -void enkf_linalg_rml_enkfX1(matrix_type *X1, matrix_type *Udr, matrix_type *D, matrix_type *R) -{ - /* - This routine computes X1 for RML_EnKF module as X1 = Ud(T)*Cd(-1/2)*D -- D= (dk-do) - here the negative sign cancels with one needed in X3 matrix computation - */ - matrix_type * tmp = matrix_alloc(matrix_get_columns(Udr),matrix_get_rows(R)); - - matrix_matmul_with_transpose( tmp, Udr, R, true, false); - matrix_matmul( X1 , tmp, D); - - matrix_free(tmp); -} - - - -void enkf_linalg_rml_enkfX2(matrix_type *X2 , double *Wdr , matrix_type * X1 , double a , int nsign) -{ - /* - This routine computes X2 for RML_EnKF module as X2 = ((a*Ipd)+Wd^2)^-1 * X1 - Since a+Ipd & Wd are diagonal in nature the computation is reduced to array operations - */ - - for (int i=0; i< nsign ; i++) { - double scale_factor = 1 / (a + (Wdr[i]*Wdr[i])); - matrix_scale_row(X1 , i , scale_factor); - } - matrix_assign(X2,X1); - -} - - -void enkf_linalg_rml_enkfX3(matrix_type *X3, matrix_type *VdTr, double *Wdr, matrix_type *X2, int nsign) -{ - /* - This routine computes X3 for RML_EnKF module as X3 = Vd *Wd*X2 - */ - - printf("\nWd: "); - matrix_type *tmp = matrix_alloc_copy(VdTr); - for (int i=0; i< nsign ; i++) { - printf("%5.2f ", Wdr[i]); - matrix_scale_row(tmp, i, Wdr[i]); - } - printf("\n\n"); - - matrix_matmul_with_transpose( X3 , tmp , X2 , true, false); - matrix_free(tmp); -} - - - - -double enkf_linalg_data_mismatch(matrix_type *D , matrix_type *R , matrix_type *Sk) -{ - matrix_type * tmp = matrix_alloc (matrix_get_columns(D), matrix_get_columns(R)); - double mismatch; - matrix_matmul_with_transpose(tmp, D, R,true, false); // tmp = D' * R, i.e. N-by-p - matrix_matmul(Sk, tmp, D); // Sk = D' * R * D - // Calculate the mismatch - mismatch = matrix_trace(Sk)/(matrix_get_columns(D)); - - return mismatch; -} - -// Cd = SampCov(E) (including (N-1) normalization) -void enkf_linalg_Covariance(matrix_type *Cd, const matrix_type *E, double nsc ,int nrobs) -{ - matrix_matmul_with_transpose(Cd, E, E,false,true); - for (int i=0; i< nrobs; i++) { - for (int j=0;j< nrobs; j++) { - if (i!=j) - matrix_iset(Cd, i, j, 0.0); - } - } - nsc = nsc*nsc; - matrix_scale(Cd,nsc); -} - - - -// Scale columns (not rows!) of Um by entries in diagonal Wm -void enkf_linalg_rml_enkfAm(matrix_type * Um, const double * Wm,int nsign1){ - for (int i=0; i< nsign1 ; i++) { - double sc = 1 / Wm[i]; - matrix_scale_column(Um, i, sc); - } -} - - - - -void enkf_linalg_rml_enkfX7(matrix_type * X7, matrix_type * VdT, double * Wdr, double a, matrix_type * X6){ - - int nsign = matrix_get_rows(VdT); - int ens_size = matrix_get_columns(VdT); - matrix_type *tmp1 = matrix_alloc_copy(VdT); - matrix_type *tmp2 = matrix_alloc(ens_size,ens_size); - - - for (int i=0; i < nsign ; i++) { - double scale_factor = 1 / ( a + (Wdr[i]*Wdr[i])); - matrix_scale_row( tmp1 , i , scale_factor); - } - - - matrix_matmul_with_transpose(tmp2, tmp1, VdT, true, false); - matrix_matmul(X7, tmp2, X6); - matrix_free(tmp1); - matrix_free(tmp2); -} - - diff --git a/ThirdParty/Ert/libanalysis/src/fwd_step_enkf.c b/ThirdParty/Ert/libanalysis/src/fwd_step_enkf.c deleted file mode 100644 index 6f41935d56..0000000000 --- a/ThirdParty/Ert/libanalysis/src/fwd_step_enkf.c +++ /dev/null @@ -1,549 +0,0 @@ -/* - copyright (C) 2011 Statoil ASA, Norway. - - The file 'fwd_step_enkf.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - -#if defined(_OPENMP) -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#define FWD_STEP_ENKF_TYPE_ID 765524 - -#define DEFAULT_NFOLDS 5 -#define DEFAULT_R2_LIMIT 0.99 -#define DEFAULT_NUM_THREADS -1 - -#define NFOLDS_KEY "CV_NFOLDS" -#define R2_LIMIT_KEY "FWD_STEP_R2_LIMIT" -#define DEFAULT_VERBOSE false -#define VERBOSE_KEY "VERBOSE" -#define NUM_THREADS_KEY "NUM_THREADS" -#define LOG_FILE_KEY "LOG_FILE" -#define CLEAR_LOG_KEY "CLEAR_LOG" - - -struct fwd_step_enkf_data_struct { - UTIL_TYPE_ID_DECLARATION; - stepwise_type * stepwise_data; - rng_type * rng; - int nfolds; - long option_flags; - double r2_limit; - bool verbose; - int num_threads; - fwd_step_log_type * fwd_step_log; -}; - - -static UTIL_SAFE_CAST_FUNCTION_CONST( fwd_step_enkf_data , FWD_STEP_ENKF_TYPE_ID ) -static UTIL_SAFE_CAST_FUNCTION( fwd_step_enkf_data , FWD_STEP_ENKF_TYPE_ID ) - - -void fwd_step_enkf_set_nfolds( fwd_step_enkf_data_type * data , int nfolds ) { - data->nfolds = nfolds; -} - -void fwd_step_enkf_set_r2_limit( fwd_step_enkf_data_type * data , double limit ) { - data->r2_limit = limit; -} - -void fwd_step_enkf_set_verbose( fwd_step_enkf_data_type * data , bool verbose ) { - data->verbose = verbose; -} - -void fwd_step_enkf_set_num_threads( fwd_step_enkf_data_type * data , int threads ) { - data->num_threads = threads; -} - - -void * fwd_step_enkf_data_alloc( rng_type * rng ) { - fwd_step_enkf_data_type * data = util_malloc( sizeof * data ); - UTIL_TYPE_ID_INIT( data , FWD_STEP_ENKF_TYPE_ID ); - - data->stepwise_data = NULL; - data->rng = rng; - data->nfolds = DEFAULT_NFOLDS; - data->r2_limit = DEFAULT_R2_LIMIT; - data->option_flags = ANALYSIS_NEED_ED + ANALYSIS_UPDATE_A + ANALYSIS_SCALE_DATA; - data->verbose = DEFAULT_VERBOSE; - data->num_threads = DEFAULT_NUM_THREADS; - data->fwd_step_log = fwd_step_log_alloc(); - return data; -} - -void fwd_step_enkf_data_free( void * arg ) { - fwd_step_enkf_data_type * fwd_step_data = fwd_step_enkf_data_safe_cast( arg ); - { - - if (fwd_step_data != NULL) { - if (fwd_step_data->stepwise_data != NULL) { - stepwise_free( fwd_step_data->stepwise_data ); - } - } - } - fwd_step_log_free( fwd_step_data->fwd_step_log ); - free( fwd_step_data ); -} - - -//********************************************** -// Log-file related stuff -//********************************************** - - -static void fwd_step_enkf_write_log_header( fwd_step_enkf_data_type * fwd_step_data, const char * ministep_name, const int nx, const int nd, const int ens_size) { - const char * format = "%-25s%-25s%-25s%-25s\n"; - const char * column1 = "Parameter(ActiveIndex)"; - const char * column2 = "GlobalIndex"; - const char * column3 = "NumAttached"; - const char * column4 = "AttachedObs(ActiveIndex)[Percentage sensitivity]"; - int nfolds = fwd_step_data->nfolds; - int num_threads = fwd_step_data->num_threads; - double r2_limit = fwd_step_data->r2_limit; - - if (fwd_step_log_is_open( fwd_step_data->fwd_step_log )) { - fwd_step_log_line(fwd_step_data->fwd_step_log, "===============================================================================================================================\n"); - fwd_step_log_line(fwd_step_data->fwd_step_log, "Ministep : %s\n",ministep_name); - fwd_step_log_line(fwd_step_data->fwd_step_log, "Total number of parameters : %d\n",nx); - fwd_step_log_line(fwd_step_data->fwd_step_log, "Total number of observations: %d\n",nd); - fwd_step_log_line(fwd_step_data->fwd_step_log, "Number of ensembles : %d\n",ens_size); - fwd_step_log_line(fwd_step_data->fwd_step_log, "CV folds : %d\n",nfolds); - fwd_step_log_line(fwd_step_data->fwd_step_log, "Relative R2 tolerance : %f\n",r2_limit); - fwd_step_log_line(fwd_step_data->fwd_step_log, "===============================================================================================================================\n"); - fwd_step_log_line(fwd_step_data->fwd_step_log, format, column1, column2, column3, column4); - fwd_step_log_line(fwd_step_data->fwd_step_log, "===============================================================================================================================\n"); - } - - printf("===============================================================================================================================\n"); - printf("Ministep : %s\n",ministep_name); - printf("Total number of parameters : %d\n",nx); - printf("Total number of observations: %d\n",nd); - printf("Number of ensembles : %d\n",ens_size); - printf("CV folds : %d\n",nfolds); - printf("Number of threads : %d\n",num_threads); - printf("Relative R2 tolerance : %f\n",r2_limit); - printf("===============================================================================================================================\n"); - printf(format, column1, column2, column3, column4); - printf("===============================================================================================================================\n"); -} - -static void fwd_step_enkf_write_iter_info( fwd_step_enkf_data_type * data , stepwise_type * stepwise, const char* key, const int data_active_index, const int global_index, const module_info_type * module_info ) { - - const char * format = "%-25s%-25d%-25d"; - int n_active = stepwise_get_n_active( stepwise); - bool_vector_type * active_set = stepwise_get_active_set(stepwise); - bool has_log = fwd_step_log_is_open( data->fwd_step_log ); - module_obs_block_vector_type * module_obs_block_vector = module_info_get_obs_block_vector(module_info); - char * loc_key = util_alloc_string_copy(key); - char * data_active_index_str = util_alloc_sprintf( "(%d)" , data_active_index ); - char * cat = util_strcat_realloc(loc_key , data_active_index_str ); - if (has_log) - fwd_step_log_line( data->fwd_step_log , format, cat, global_index, n_active); - - printf(format, cat, global_index,n_active); - - const double sum_beta = stepwise_get_sum_beta(stepwise); - int obs_active_index = 0; - stringlist_type * obs_list = stringlist_alloc_new( ); - double_vector_type * r_list = double_vector_alloc(0, 0); - - const char * format1 = "%s(%d)[%.1f] "; - for (int ivar = 0; ivar < bool_vector_size( active_set); ivar++) { - if (!bool_vector_iget( active_set , ivar)) - continue; - - const module_obs_block_type * module_obs_block = module_obs_block_vector_search_module_obs_block(module_obs_block_vector, ivar); - const int* active_indices = module_obs_block_get_active_indices(module_obs_block); - bool all_active = active_indices == NULL; /* Inactive are not present in D */ - int row_start = module_obs_block_get_row_start(module_obs_block); - int row_end = module_obs_block_get_row_end(module_obs_block); - const char* obs_key = module_obs_block_get_key(module_obs_block); - const double var_beta = stepwise_iget_beta(stepwise, ivar); - const double var_beta_percent = 100.0 * fabs(var_beta) / sum_beta; - - int local_index = 0; - for (int i = row_start; i < row_end; i++) { - if (i == ivar){ - if (all_active) - obs_active_index = local_index; - else - obs_active_index = active_indices[local_index]; - break; - } - local_index ++; - } - - char * obs_list_entry = util_alloc_sprintf(format1 , obs_key, obs_active_index,var_beta_percent); - stringlist_append_copy(obs_list, obs_list_entry); - double_vector_append(r_list, var_beta_percent); - free( obs_list_entry ); - } - - { - /* Sorting with respect to sensitivity */ - perm_vector_type * sort_perm = double_vector_alloc_rsort_perm(r_list); - for (int i = 0; i < stringlist_get_size( obs_list); i++) { - const char * obs_list_entry = stringlist_iget(obs_list, perm_vector_iget(sort_perm, i)); - if (has_log) - fwd_step_log_line( data->fwd_step_log , "%s", obs_list_entry); - - printf("%s", obs_list_entry); - } - perm_vector_free(sort_perm); - } - - - - if (has_log) - fwd_step_log_line( data->fwd_step_log , "\n"); - - printf("\n"); - - stringlist_free(obs_list); - util_safe_free(data_active_index_str); - util_safe_free(cat); -} - -/*Main function: */ -void fwd_step_enkf_updateA(void * module_data , - matrix_type * A , - matrix_type * S , - matrix_type * R , - matrix_type * dObs , - matrix_type * E , - matrix_type * D , - const module_info_type* module_info) { - - - - fwd_step_enkf_data_type * fwd_step_data = fwd_step_enkf_data_safe_cast( module_data ); - fwd_step_log_open(fwd_step_data->fwd_step_log); - module_data_block_vector_type * data_block_vector = module_info_get_data_block_vector(module_info); - printf("Running Forward Stepwise regression:\n"); - { - - int ens_size = matrix_get_columns( S ); - int nx = matrix_get_rows( A ); - int nd = matrix_get_rows( S ); - int nfolds = fwd_step_data->nfolds; - double r2_limit = fwd_step_data->r2_limit; - bool verbose = fwd_step_data->verbose; - int num_kw = module_data_block_vector_get_size(data_block_vector); - -#if defined(_OPENMP) - #pragma omp parallel - #pragma omp master - if (fwd_step_data->num_threads == DEFAULT_NUM_THREADS) - fwd_step_data->num_threads = omp_get_num_threads(); -#else - fwd_step_data->num_threads = 1; -#endif - - if ( ens_size <= nfolds) - util_abort("%s: The number of ensembles must be larger than the CV fold - aborting\n", __func__); - - - { - - matrix_type * St = matrix_alloc( ens_size , nd ); - matrix_type * Et = matrix_alloc( ens_size , nd ); - - /*workS = S' */ - matrix_subtract_row_mean( S ); /* Shift away the mean */ - St = matrix_alloc_transpose( S ); - Et = matrix_alloc_transpose( E ); - - matrix_type * di = matrix_alloc( 1 , nd ); - - if (verbose){ - char * ministep_name = module_info_get_ministep_name(module_info); - fwd_step_enkf_write_log_header(fwd_step_data, ministep_name, nx, nd, ens_size); - } - - int kw,i; - - /* This is to avoid a global-to-block search function since the number of parameters could be very large*/ - int_vector_type * kw_list = int_vector_alloc(nx, -1); - int_vector_type * local_index_list = int_vector_alloc(nx, -1); - for (kw = 0; kw < num_kw; kw++) { - module_data_block_type * data_block = module_data_block_vector_iget_module_data_block(data_block_vector, kw); - int row_start = module_data_block_get_row_start(data_block); - int row_end = module_data_block_get_row_end(data_block); - for (i = row_start; i < row_end; i++) { - int_vector_iset(kw_list, i, kw); - int_vector_iset(local_index_list, i, i - row_start); - } - } - - - // ============================================= - #pragma omp parallel for schedule(dynamic, 1) num_threads(fwd_step_data->num_threads) - for (i = 0; i < nx; i++) { - int kw_ind = int_vector_iget(kw_list, i); - module_data_block_type * data_block = module_data_block_vector_iget_module_data_block(data_block_vector, kw_ind); - const char * key = module_data_block_get_key(data_block); - const int* active_indices = module_data_block_get_active_indices(data_block); - int active_index = 0; - bool all_active = active_indices == NULL; /* Inactive are not present in A */ - stepwise_type * stepwise_data = stepwise_alloc1(ens_size, nd , fwd_step_data->rng, St, Et); - - /*Update values of y */ - /*Start of the actual update */ - matrix_type * y = matrix_alloc( ens_size , 1 ); - - for (int j = 0; j < ens_size; j++) { - matrix_iset(y , j , 0 , matrix_iget( A, i , j ) ); - } - - stepwise_set_Y0( stepwise_data , y ); - - stepwise_estimate(stepwise_data , r2_limit , nfolds ); - - /*manipulate A directly*/ - for (int j = 0; j < ens_size; j++) { - for (int k = 0; k < nd; k++) { - matrix_iset(di , 0 , k , matrix_iget( D , k , j ) ); - } - double aij = matrix_iget( A , i , j ); - double xHat = stepwise_eval(stepwise_data , di ); - matrix_iset(A , i , j , aij + xHat); - } - - if (verbose){ - int loc_ind = int_vector_iget(local_index_list, i ); - if (all_active) - active_index = loc_ind; - else - active_index = active_indices[loc_ind]; - - fwd_step_enkf_write_iter_info(fwd_step_data, stepwise_data, key, active_index, i, module_info); - - } - - stepwise_free( stepwise_data ); - } - - if (verbose) - printf("===============================================================================================================================\n"); - - printf("Done with stepwise regression enkf\n"); - - - matrix_free( di ); - int_vector_free(kw_list); - int_vector_free(local_index_list); - } - - - - } - - fwd_step_log_close( fwd_step_data->fwd_step_log ); -} - - - - - - -bool fwd_step_enkf_set_double( void * arg , const char * var_name , double value) { - fwd_step_enkf_data_type * module_data = fwd_step_enkf_data_safe_cast( arg ); - { - bool name_recognized = true; - - if (strcmp( var_name , R2_LIMIT_KEY ) == 0) - fwd_step_enkf_set_r2_limit( module_data , value ); - else - name_recognized = false; - - return name_recognized; - } -} - - -bool fwd_step_enkf_set_int( void * arg , const char * var_name , int value) { - fwd_step_enkf_data_type * module_data = fwd_step_enkf_data_safe_cast( arg ); - { - bool name_recognized = true; - - - if (strcmp( var_name , NFOLDS_KEY) == 0) - fwd_step_enkf_set_nfolds( module_data , value); /*Set number of CV folds */ - else if (strcmp( var_name , NUM_THREADS_KEY) == 0) - fwd_step_enkf_set_num_threads( module_data , value); /*Set number of OMP threads */ - else - name_recognized = false; - - return name_recognized; - } -} - -bool fwd_step_enkf_set_bool( void * arg , const char * var_name , bool value) { - fwd_step_enkf_data_type * module_data = fwd_step_enkf_data_safe_cast( arg ); - { - bool name_recognized = true; - - /*Set verbose */ - if (strcmp( var_name , VERBOSE_KEY) == 0) - fwd_step_enkf_set_verbose( module_data , value); - else if (strcmp( var_name , CLEAR_LOG_KEY) == 0) - fwd_step_log_set_clear_log( module_data->fwd_step_log , value ); - else - name_recognized = false; - - return name_recognized; - } -} - -bool fwd_step_enkf_set_string( void * arg , const char * var_name , const char * value) { - fwd_step_enkf_data_type * module_data = fwd_step_enkf_data_safe_cast( arg ); - { - bool name_recognized = true; - - if (strcmp( var_name , LOG_FILE_KEY) == 0) - fwd_step_log_set_log_file( module_data->fwd_step_log , value ); - else - name_recognized = false; - - return name_recognized; - } -} - -long fwd_step_enkf_get_options( void * arg , long flag) { - fwd_step_enkf_data_type * fwd_step_data = fwd_step_enkf_data_safe_cast( arg ); - { - return fwd_step_data->option_flags; - } -} - -bool fwd_step_enkf_has_var( const void * arg, const char * var_name) { - { - if (strcmp(var_name , NFOLDS_KEY) == 0) - return true; - else if (strcmp(var_name , R2_LIMIT_KEY ) == 0) - return true; - else if (strcmp(var_name , VERBOSE_KEY ) == 0) - return true; - else if (strcmp(var_name , LOG_FILE_KEY) == 0) - return true; - else if (strcmp(var_name , CLEAR_LOG_KEY) == 0) - return true; - else if (strcmp(var_name , NUM_THREADS_KEY) == 0) - return true; - else - return false; - } -} - -double fwd_step_enkf_get_double( const void * arg, const char * var_name) { - const fwd_step_enkf_data_type * module_data = fwd_step_enkf_data_safe_cast_const( arg ); - { - if (strcmp(var_name , R2_LIMIT_KEY ) == 0) - return module_data->r2_limit; - else - return -1; - } -} - -int fwd_step_enkf_get_int( const void * arg, const char * var_name) { - const fwd_step_enkf_data_type * module_data = fwd_step_enkf_data_safe_cast_const( arg ); - { - if (strcmp(var_name , NFOLDS_KEY) == 0) - return module_data->nfolds; - if (strcmp(var_name , NUM_THREADS_KEY) == 0) - return module_data->num_threads; - else - return -1; - } -} - -bool fwd_step_enkf_get_bool( const void * arg, const char * var_name) { - const fwd_step_enkf_data_type * module_data = fwd_step_enkf_data_safe_cast_const( arg ); - { - if (strcmp(var_name , VERBOSE_KEY) == 0) - return module_data->verbose; - else if (strcmp(var_name , CLEAR_LOG_KEY) == 0) - return fwd_step_log_get_clear_log( module_data->fwd_step_log ); - else - return false; - } -} - -void * fwd_step_enkf_get_ptr( const void * arg , const char * var_name ) { - const fwd_step_enkf_data_type * module_data = fwd_step_enkf_data_safe_cast_const( arg ); - { - if (strcmp(var_name , LOG_FILE_KEY) == 0) - return (void *) fwd_step_log_get_log_file( module_data->fwd_step_log ); - else - return NULL; - } -} - - - - - -#ifdef INTERNAL_LINK -#define LINK_NAME FWD_STEP_ENKF -#else -#define LINK_NAME EXTERNAL_MODULE_SYMBOL -#endif - - -analysis_table_type LINK_NAME = { - .name = "FWD_STEP_ENKF", - .alloc = fwd_step_enkf_data_alloc, - .freef = fwd_step_enkf_data_free, - .set_int = fwd_step_enkf_set_int , - .set_double = fwd_step_enkf_set_double , - .set_bool = fwd_step_enkf_set_bool , - .set_string = fwd_step_enkf_set_string , - .get_options = fwd_step_enkf_get_options , - .initX = NULL , - .updateA = fwd_step_enkf_updateA, - .init_update = NULL , - .complete_update = NULL , - .has_var = fwd_step_enkf_has_var, - .get_int = fwd_step_enkf_get_int , - .get_double = fwd_step_enkf_get_double , - .get_bool = fwd_step_enkf_get_bool , - .get_ptr = fwd_step_enkf_get_ptr -}; - - diff --git a/ThirdParty/Ert/libanalysis/src/fwd_step_log.c b/ThirdParty/Ert/libanalysis/src/fwd_step_log.c deleted file mode 100644 index d8c585e9a6..0000000000 --- a/ThirdParty/Ert/libanalysis/src/fwd_step_log.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - Copyright (C) 2016 Statoil ASA, Norway. - - The file 'fwd_step_log.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include - -#include - -#include - -#define DEFAULT_LOG_FILE "fwd_step.out" -#define DEFAULT_CLEAR_LOG false - -struct fwd_step_log_struct { - bool clear_log; - char * log_file; - FILE * log_stream; -}; - - -fwd_step_log_type * fwd_step_log_alloc() { - fwd_step_log_type * fwd_step_log = util_malloc( sizeof * fwd_step_log ); - fwd_step_log->log_file = NULL; - fwd_step_log->log_stream = NULL; - fwd_step_log_set_log_file( fwd_step_log , DEFAULT_LOG_FILE); - fwd_step_log_set_clear_log( fwd_step_log , DEFAULT_CLEAR_LOG ); - return fwd_step_log; -} - -bool fwd_step_log_get_clear_log( const fwd_step_log_type * data ) { - return data->clear_log; -} - -void fwd_step_log_set_clear_log( fwd_step_log_type * data , bool clear_log) { - data->clear_log = clear_log; -} - -void fwd_step_log_set_log_file( fwd_step_log_type * data , const char * log_file ) { - data->log_file = util_realloc_string_copy( data->log_file , log_file ); -} - -const char * fwd_step_log_get_log_file( const fwd_step_log_type * data) { - return data->log_file; -} - - -void fwd_step_log_free(fwd_step_log_type * fwd_step_log) { - fwd_step_log_close( fwd_step_log ); - util_safe_free( fwd_step_log->log_file ); - free( fwd_step_log ); -} - - -void fwd_step_log_open( fwd_step_log_type * fwd_step_log ) { - if (fwd_step_log->log_file) { - if (fwd_step_log->clear_log) - fwd_step_log->log_stream = util_mkdir_fopen( fwd_step_log->log_file , "w"); - else - fwd_step_log->log_stream = util_mkdir_fopen( fwd_step_log->log_file , "a"); - } -} - - -bool fwd_step_log_is_open( const fwd_step_log_type * fwd_step_log ) { - if (fwd_step_log->log_stream) - return true; - else - return false; -} - - -void fwd_step_log_close( fwd_step_log_type * fwd_step_log ) { - if (fwd_step_log->log_stream) - fclose( fwd_step_log->log_stream ); - - fwd_step_log->log_stream = NULL; -} - - -void fwd_step_log_line( fwd_step_log_type * fwd_step_log , const char * fmt , ...) { - if (fwd_step_log->log_stream) { - va_list ap; - va_start(ap , fmt); - vfprintf( fwd_step_log->log_stream , fmt , ap ); - va_end( ap ); - } -} - - diff --git a/ThirdParty/Ert/libanalysis/src/module_data_block.c b/ThirdParty/Ert/libanalysis/src/module_data_block.c deleted file mode 100644 index ebe9d34c23..0000000000 --- a/ThirdParty/Ert/libanalysis/src/module_data_block.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - Copyright (C) 2016 Statoil ASA, Norway. - - The file 'module_data_block.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include - -#include -#include - -#include - -#define MODULE_DATA_BLOCK_TYPE_ID 73217801 -static UTIL_SAFE_CAST_FUNCTION( module_data_block , MODULE_DATA_BLOCK_TYPE_ID); -UTIL_IS_INSTANCE_FUNCTION( module_data_block , MODULE_DATA_BLOCK_TYPE_ID) - -module_data_block_type * module_data_block_alloc( const char * key, const int * index_list , const int row_start, const int n_active) { - module_data_block_type * module_data_block = util_malloc( sizeof * module_data_block ); - UTIL_TYPE_ID_INIT( module_data_block , MODULE_DATA_BLOCK_TYPE_ID ); - module_data_block->key = util_alloc_string_copy( key ); - module_data_block->index_list = index_list; - module_data_block->A_row_start = row_start; - module_data_block->n_active = n_active; - return module_data_block; -} - - -const char * module_data_block_get_key(const module_data_block_type * module_data_block){ - return module_data_block->key; -} - -const int module_data_block_get_row_start(const module_data_block_type * module_data_block){ - return module_data_block->A_row_start; -} - -const int module_data_block_get_row_end(const module_data_block_type * module_data_block){ - return module_data_block->A_row_start + module_data_block->n_active; -} - -const int * module_data_block_get_active_indices(const module_data_block_type * module_data_block ){ - return module_data_block->index_list; -} - -void module_data_block_free( module_data_block_type * module_data_block ) { - util_safe_free(module_data_block->key); - free( module_data_block ); -} - -void module_data_block_free__( void * arg ) { - module_data_block_type * data_block = module_data_block_safe_cast( arg ); - module_data_block_free( data_block ); -} diff --git a/ThirdParty/Ert/libanalysis/src/module_data_block_vector.c b/ThirdParty/Ert/libanalysis/src/module_data_block_vector.c deleted file mode 100644 index 33ff3a86cc..0000000000 --- a/ThirdParty/Ert/libanalysis/src/module_data_block_vector.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - Copyright (C) 2016 Statoil ASA, Norway. - - The file 'module_data_block_vector.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include -#include - -#include -#include - -#define MODULE_DATA_BLOCK_VECTOR_TYPE_ID 732178012 - -struct module_data_block_vector_struct { - UTIL_TYPE_ID_DECLARATION; - vector_type * data_block_vector; -}; - -UTIL_IS_INSTANCE_FUNCTION( module_data_block_vector , MODULE_DATA_BLOCK_VECTOR_TYPE_ID) - -module_data_block_vector_type * module_data_block_vector_alloc( ) { - module_data_block_vector_type * module_data_block_vector = util_malloc( sizeof * module_data_block_vector ); - UTIL_TYPE_ID_INIT( module_data_block_vector , MODULE_DATA_BLOCK_VECTOR_TYPE_ID ); - module_data_block_vector->data_block_vector = vector_alloc_new(); - return module_data_block_vector; -} - - -void module_data_block_vector_free( module_data_block_vector_type * module_data_block_vector ) { - vector_free( module_data_block_vector->data_block_vector ); - free( module_data_block_vector ); -} - -void module_data_block_vector_add_data_block( module_data_block_vector_type * module_data_block_vector , const module_data_block_type * data_block) { - vector_append_owned_ref(module_data_block_vector->data_block_vector, data_block , module_data_block_free__); -} - - -module_data_block_type * module_data_block_vector_iget_module_data_block(const module_data_block_vector_type * module_data_block_vector, int index){ - return vector_iget(module_data_block_vector->data_block_vector, index); -} - -int module_data_block_vector_get_size(const module_data_block_vector_type * module_data_block_vector){ - return vector_get_size(module_data_block_vector->data_block_vector); -} - - diff --git a/ThirdParty/Ert/libanalysis/src/module_info.c b/ThirdParty/Ert/libanalysis/src/module_info.c deleted file mode 100644 index 969df3792a..0000000000 --- a/ThirdParty/Ert/libanalysis/src/module_info.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright (C) 2016 Statoil ASA, Norway. - - The file 'module_info.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include -#include - -#include - -#define MODULE_INFO_TYPE_ID 73780123 - -struct module_info_struct { - UTIL_TYPE_ID_DECLARATION; - char * ministep_name; - module_data_block_vector_type * data_block_vector; - module_obs_block_vector_type * obs_block_vector; -}; - -UTIL_IS_INSTANCE_FUNCTION( module_info , MODULE_INFO_TYPE_ID) - -module_info_type * module_info_alloc( const char* ministep_name ) { - module_info_type * module_info = util_malloc( sizeof * module_info ); - UTIL_TYPE_ID_INIT( module_info , MODULE_INFO_TYPE_ID ); - module_info->ministep_name = util_alloc_string_copy( ministep_name ); - module_info->data_block_vector = module_data_block_vector_alloc(); - module_info->obs_block_vector = module_obs_block_vector_alloc(); - return module_info; -} - - -void module_info_free( module_info_type * module_info ) { - util_safe_free(module_info->ministep_name); - module_data_block_vector_free( module_info->data_block_vector ); - module_obs_block_vector_free( module_info->obs_block_vector ); - free( module_info ); -} - -module_data_block_vector_type * module_info_get_data_block_vector(const module_info_type * module_info){ - return module_info->data_block_vector; -} - -module_obs_block_vector_type * module_info_get_obs_block_vector(const module_info_type * module_info){ - return module_info->obs_block_vector; -} - -char * module_info_get_ministep_name(const module_info_type * module_info){ - return module_info->ministep_name; -} diff --git a/ThirdParty/Ert/libanalysis/src/module_obs_block.c b/ThirdParty/Ert/libanalysis/src/module_obs_block.c deleted file mode 100644 index 7960919528..0000000000 --- a/ThirdParty/Ert/libanalysis/src/module_obs_block.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - Copyright (C) 2016 Statoil ASA, Norway. - - The file 'module_obs_block.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include - -#include -#include - -#include - -#define MODULE_OBS_BLOCK_TYPE_ID 73217901 -static UTIL_SAFE_CAST_FUNCTION( module_obs_block , MODULE_OBS_BLOCK_TYPE_ID); -UTIL_IS_INSTANCE_FUNCTION( module_obs_block , MODULE_OBS_BLOCK_TYPE_ID) - -module_obs_block_type * module_obs_block_alloc( const char * key, const int * index_list, const int row_start, const int n_active) { - module_obs_block_type * module_obs_block = util_malloc( sizeof * module_obs_block ); - UTIL_TYPE_ID_INIT( module_obs_block , MODULE_OBS_BLOCK_TYPE_ID ); - module_obs_block->key = util_alloc_string_copy( key ); - module_obs_block->index_list = index_list; - module_obs_block->D_row_start = row_start; - module_obs_block->n_active = n_active; - return module_obs_block; -} - - -const char * module_obs_block_get_key(const module_obs_block_type * module_obs_block){ - return module_obs_block->key; -} - -const int module_obs_block_get_row_start(const module_obs_block_type * module_obs_block){ - return module_obs_block->D_row_start; -} - -const int module_obs_block_get_row_end(const module_obs_block_type * module_obs_block){ - return module_obs_block->D_row_start + module_obs_block->n_active; -} - -const int * module_obs_block_get_active_indices(const module_obs_block_type * module_obs_block ){ - return module_obs_block->index_list; -} - -void module_obs_block_free( module_obs_block_type * module_obs_block ) { - util_safe_free(module_obs_block->key); - free( module_obs_block ); -} - -void module_obs_block_free__( void * arg ) { - module_obs_block_type * obs_block = module_obs_block_safe_cast( arg ); - module_obs_block_free( obs_block ); -} diff --git a/ThirdParty/Ert/libanalysis/src/module_obs_block_vector.c b/ThirdParty/Ert/libanalysis/src/module_obs_block_vector.c deleted file mode 100644 index dc076d0523..0000000000 --- a/ThirdParty/Ert/libanalysis/src/module_obs_block_vector.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - Copyright (C) 2016 Statoil ASA, Norway. - - The file 'module_obs_block_vector.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include -#include - -#include -#include - -#define MODULE_OBS_BLOCK_VECTOR_TYPE_ID 732188012 - -struct module_obs_block_vector_struct { - UTIL_TYPE_ID_DECLARATION; - vector_type * obs_block_vector; -}; - -UTIL_IS_INSTANCE_FUNCTION( module_obs_block_vector , MODULE_OBS_BLOCK_VECTOR_TYPE_ID) - -module_obs_block_vector_type * module_obs_block_vector_alloc() { - module_obs_block_vector_type * module_obs_block_vector = util_malloc( sizeof * module_obs_block_vector ); - UTIL_TYPE_ID_INIT( module_obs_block_vector , MODULE_OBS_BLOCK_VECTOR_TYPE_ID ); - module_obs_block_vector->obs_block_vector = vector_alloc_new(); - return module_obs_block_vector; -} - - -void module_obs_block_vector_free( module_obs_block_vector_type * module_obs_block_vector ) { - vector_free( module_obs_block_vector->obs_block_vector ); - free( module_obs_block_vector ); -} - -void module_obs_block_vector_add_obs_block( module_obs_block_vector_type * module_obs_block_vector , module_obs_block_type * obs_block) { - vector_append_owned_ref(module_obs_block_vector->obs_block_vector, obs_block , module_obs_block_free__); -} - - -module_obs_block_type * module_obs_block_vector_iget_module_obs_block(const module_obs_block_vector_type * module_obs_block_vector, int block_index){ - return vector_iget(module_obs_block_vector->obs_block_vector, block_index); -} - -const module_obs_block_type * module_obs_block_vector_search_module_obs_block(const module_obs_block_vector_type * module_obs_block_vector, int global_index){ - /* This function maps from a global index to an observation information block. Will return NULL if block is not found */ - int block_nr = 0; - while (true) { - if (block_nr >= module_obs_block_vector_get_size( module_obs_block_vector )) - break; - - module_obs_block_type * module_obs_block = module_obs_block_vector_iget_module_obs_block (module_obs_block_vector, block_nr); - int row_start = module_obs_block_get_row_start(module_obs_block); - int row_end = module_obs_block_get_row_end(module_obs_block); - if (global_index >= row_start && global_index < row_end) - return module_obs_block; - - block_nr++; - } - return NULL; -} - -int module_obs_block_vector_get_size(const module_obs_block_vector_type * module_obs_block_vector){ - return vector_get_size(module_obs_block_vector->obs_block_vector); -} - - diff --git a/ThirdParty/Ert/libanalysis/src/modules.txt b/ThirdParty/Ert/libanalysis/src/modules.txt deleted file mode 100644 index 906a777b9c..0000000000 --- a/ThirdParty/Ert/libanalysis/src/modules.txt +++ /dev/null @@ -1,212 +0,0 @@ -Overview --------- -The ERT application has evolved into a quite complex beast. Originally -the actual EnKF algorithm was located very deep down in the code, and -changes to the EnKF algorithm required detailed knowledge about the -enkf_node objects, the datatype for measurements and observations, -serialisation and so on. Quite complex and fragile stuff. - -To facilitate easier development and testing of new update schemes the -core EnKF update step has been factored out as analysis modules, which -are called from the enkf_main scope. The update functions in the -module get ordinary matrices as input, and do not need to know -anything about the internals of the ERT application. - -The modules can either be built in, or you can compile your own module -as a shared library and load it runtime. Apart from the initial -loading internal modules and external modules are treated 100% -identically. - - -How modules work ----------------- -The modules are instances of the object type analysis_module_type, and -the enkf_main layer interacts with the module through the -analyis_module instance. The most important part of the -analysis_module type is a list of function pointers to functions which -"actually do the work". In addition to some functions for setting -internal module variables the most core functions are: - - init_update() - initX() - updateA() - complete_update() - -Of these functions a module should have ONLY ONE of initX() and -updateA(); the initX() function will initialize an X matrix which is -then subsequently used to update the ensemble matrix A. Alternatively -the updateA() function should will directly manipulate the A matrix. - -The init_update() and complete_update() functions are optional, they -can be used to avoid repeated initialization calculations. These -functions interact quite closely with the scheme used for local -analysis; so you should understand that in detail before deciding -whether it is worthwile to implement init_update() and -complete_update() functions. - - -Loading modules ---------------- - -The loading of modules is based on the dlopen() function to open a -shared a library and map it into the adress space of the current -process, and then the dlsym() function to locate a symbol table which -is a list of function pointers. The only difference between internal -and external modules is in the arguments passed to the dlopen() and -dlsym() function calls: - - Loading internal modules - ------------------------ - Internal modules means modules which have been compiled into the - libanalyis library, i.e. they are already part of the ERT - executable, however before we have "loaded" these modules we have - no way to access them. The current executable is loaded by - passing NULL as argument to dlopen(). - - When dlopen() has succeded we must use dlsym() to get a handle to - the symbol table. The symbol table is essentially a global - variable in the ERT adress space, and must have a unique name for - each module. - - - Loading external modules - ------------------------ - External modules are ordinary shared libraries. To load an external - module the name of the shared library must be given to the dlopen() - function, normal rules for runtime loading of dynamic libraries - apply - i.e. the shared library must be in a location where the - dynamic linker can find it. The name of module should be a - filename, including the .so extension. undo - - When dlopen() has succeded we must use dlsym() to get a handle to - the symbol table; when the module loading is hidden behind a - dlopen() call we have essentially created a module namespace, and - the symbol tables from the different modules can have the same - name. For convenience we assume that the symbol table is given by - the name defined by the symbol EXTERNAL_MODULE_TABLE in - analysis_module.h. - -In practice all of is handled by the functions: - - analysis_module_type * analysis_module_alloc_internal( ); - analysis_module_type * analysis_module_alloc_external( ); - -symbol_table ------------- - -Interacting with modules ------------------------- -The modules can implement four different functions to set a scalar -value. The four functions have signature: - - bool set_int (void * module_data, const char * var_name , int value) - bool set_double( void * module_data , const char * var_name , double value) - bool set_bool( void * module_data , const char * var_name , bool value ) - bool set_string( void * module_data , const char * var_name , const char * value ) - -Common for all these functions is: - - 1. It is not necessary to implement these functions; if you know - that the module has no internal integer variables which should be - user-modifiable you can just set the set_int function pointer to - NULL. - - 2. If the module recognizes the variable name and actually sets an - internal variable it should return true, otherwise return false. - - 3. The set_xxx() functions are called from the wrapper function - analysis_module_set_var(); when calling the wrapper function the - value variable is a string which we try to convert to int, double - and bool respectively and then cascade through the functions in - the order listed above. This involves two things: - - a) A module has an internal variable namespace which is shared - among all variable types. - - b) If the string value argument is incorrectly formatted, - i.e. an integer is passed as "12x" the correct low level - function will not be called. - -The method to get information out from the module is much more -limited. Each module should contain an internal variable: - - long option_flags; - -And when instantiating the module data you should initialize the -option_flags variable by adding together the relevant option flags -from analysis_module.h. The enkf_main_UPDATE() method which invokes -the module functions will inspect the option_flags to see which -variables to pass to the module, and which module functions to invoke, -so this must be correct. - -Example -------- -The module/file std_enkf.c is commented quite heavily to serve as an -example. - ---------------------------------------------------------------------- - -With the analysis modules we have essentially got a three layer -design: - - 1. The ert core layer which creates/loads a list of analysis_module - instances. - - 2. analysis_module instances are a thing layer which: - - a) Hold on to specific analysis implementations like e.g. the - std_enkf implementation on one side. - - b) Present a uniform module interface to the ert layer on the - 'other side'. - - 3. Specific analysis module implementations like the std_enkf. - - -In fine ASCII art: - . - +----------------------+ . +---------------------------+ - | Analysis module | . | Implementation std_enkf | - +----------------------+ . +---------------------------+ - | | /------> | std_enkf_alloc() | - ----------------------> | | / . | std_enkf_free() | - / | X |o--------> | std_enkf_get_options() | - / | | \ . | std_enkf_initX() | - +------------------------------------------+ / | | \------> | std_enkf_set_int() | - | The ert core layer; in particular | / | | . | std_enkf_set_double() | - | the following functions: | / +----------------------+ . +---------------------------+ - | - analysis_config_load_external_module() |o . - | - analysis_config_load_internal_module() | \ +----------------------+ . +---------------------------+ - | - enkf_main_module_update() | \ | Analysis module | . | Implementation sqrt_enkf | - +------------------------------------------+ \ +----------------------+ . +---------------------------+ - \ | | /------> | sqrt_enkf_alloc() | - \ | | / . | sqrt_enkf_free() | - \---------------------> | |o--------> | sqrt_enkf_get_options() | - \ | X | \ . | sqrt_enkf_initX() | - \ | | \------> | sqrt_enkf_set_int() | - \ | | . | sqrt_enkf_set_double() | - \ +----------------------+ . +---------------------------+ - \ . - In the ert core layer the \ +----------------------+ . +---------------------------+ - different analysis module \ | Analysis module | . | Implementation cv_enkf | - instances are collected in \ +----------------------+ . +---------------------------+ - a hash table, and all function \ | | /------> | cv_enkf_alloc() | - invocations go through the \ | | / . | cv_enkf_free() | - functions in the analysis_module -----------> | |o--------> | cv_enkf_get_options() | - layer. | X | \ . | cv_enkf_initX() | - | | \------> | cv_enkf_set_int() | - | | . | cv_enkf_set_double() | - +----------------------+ . +---------------------------+ - . - . - . - . - . - The links between the analysis - modules and the std_enkf, sqrt_enkf - and cv_enkf implementations are - in terms of function pointers. These - links are established runtime, and - the vertical dotted line represents - an opaque wall which ert core layer - can not see through. diff --git a/ThirdParty/Ert/libanalysis/src/null_enkf.c b/ThirdParty/Ert/libanalysis/src/null_enkf.c deleted file mode 100644 index 295ab53ada..0000000000 --- a/ThirdParty/Ert/libanalysis/src/null_enkf.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'null_enkf.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - - - - -void null_enkf_initX(void * module_data , - matrix_type * X , - matrix_type * A , - matrix_type * S , - matrix_type * R , - matrix_type * dObs , - matrix_type * E , - matrix_type * D) { - - matrix_diag_set_scalar( X , 1.0 ); - -} - - -long null_enkf_get_options( void * arg , long flag ) { - return 0L; -} - - - -/** - gcc -fpic -c -I?? - gcc -shared -o -*/ - - - -#ifdef INTERNAL_LINK -#define LINK_NAME NULL_ENKF -#else -#define LINK_NAME EXTERNAL_MODULE_SYMBOL -#endif - -analysis_table_type LINK_NAME = { - .name = "NULL_ENKF", - .alloc = NULL , - .freef = NULL , - .set_int = NULL , - .set_double = NULL , - .set_bool = NULL , - .set_string = NULL , - .get_options = null_enkf_get_options, - .initX = null_enkf_initX , - .updateA = NULL, - .init_update = NULL, - .complete_update = NULL, - .has_var = NULL, - .get_int = NULL, - .get_double = NULL, - .get_ptr = NULL, -}; - diff --git a/ThirdParty/Ert/libanalysis/src/sqrt_enkf.c b/ThirdParty/Ert/libanalysis/src/sqrt_enkf.c deleted file mode 100644 index 082a57bc29..0000000000 --- a/ThirdParty/Ert/libanalysis/src/sqrt_enkf.c +++ /dev/null @@ -1,223 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sqrt_enkf.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include - - -/* - The sqrt_enkf module performs a EnKF update based on the square root - scheme. Observe that this module shares quite a lot of - implementation with the std_enkf module. -*/ - -#define SQRT_ENKF_TYPE_ID 268823 - -typedef struct { - UTIL_TYPE_ID_DECLARATION; - std_enkf_data_type * std_data; - matrix_type * randrot; - rng_type * rng; - long options; -} sqrt_enkf_data_type; - - -static UTIL_SAFE_CAST_FUNCTION( sqrt_enkf_data , SQRT_ENKF_TYPE_ID ) -static UTIL_SAFE_CAST_FUNCTION_CONST( sqrt_enkf_data , SQRT_ENKF_TYPE_ID ) - - -void * sqrt_enkf_data_alloc( rng_type * rng ) { - sqrt_enkf_data_type * data = util_malloc( sizeof * data ); - UTIL_TYPE_ID_INIT( data , SQRT_ENKF_TYPE_ID ); - - data->std_data = std_enkf_data_alloc( rng ); - data->randrot = NULL; - data->rng = rng; - data->options = ANALYSIS_SCALE_DATA; - - return data; -} - - - -void sqrt_enkf_data_free( void * data ) { - sqrt_enkf_data_type * module_data = sqrt_enkf_data_safe_cast( data ); - { - std_enkf_data_free( module_data->std_data ); - free( module_data ); - } -} - - - -bool sqrt_enkf_set_double( void * arg , const char * var_name , double value) { - sqrt_enkf_data_type * module_data = sqrt_enkf_data_safe_cast( arg ); - { - if (std_enkf_set_double( module_data->std_data , var_name , value )) - return true; - else { - /* Could in principle set sqrt specific variables here. */ - return false; - } - } -} - - -bool sqrt_enkf_set_int( void * arg , const char * var_name , int value) { - sqrt_enkf_data_type * module_data = sqrt_enkf_data_safe_cast( arg ); - { - if (std_enkf_set_int( module_data->std_data , var_name , value )) - return true; - else { - /* Could in principle set sqrt specific variables here. */ - return false; - } - } -} - - - - - -void sqrt_enkf_initX(void * module_data , - matrix_type * X , - matrix_type * A , - matrix_type * S , - matrix_type * R , - matrix_type * dObs , - matrix_type * E , - matrix_type *D ) { - - sqrt_enkf_data_type * data = sqrt_enkf_data_safe_cast( module_data ); - { - int ncomp = std_enkf_get_subspace_dimension( data->std_data ); - double truncation = std_enkf_get_truncation( data->std_data ); - int nrobs = matrix_get_rows( S ); - int ens_size = matrix_get_columns( S ); - int nrmin = util_int_min( ens_size , nrobs); - matrix_type * W = matrix_alloc(nrobs , nrmin); - double * eig = util_calloc( nrmin , sizeof * eig ); - - matrix_subtract_row_mean( S ); /* Shift away the mean */ - enkf_linalg_lowrankCinv( S , R , W , eig , truncation , ncomp); - enkf_linalg_init_sqrtX( X , S , data->randrot , dObs , W , eig , false); - matrix_free( W ); - free( eig ); - - enkf_linalg_checkX( X , false ); - } -} - - -long sqrt_enkf_get_options( void * arg , long flag ) { - sqrt_enkf_data_type * module_data = sqrt_enkf_data_safe_cast( arg ); - { - return module_data->options; - } -} - - - -// Called from analysis_module.c: analysis_module_init_update() -void sqrt_enkf_init_update( void * arg , - const bool_vector_type * ens_mask, - const matrix_type * S , - const matrix_type * R , - const matrix_type * dObs , - const matrix_type * E , - const matrix_type * D ) { - - sqrt_enkf_data_type * sqrt_data = sqrt_enkf_data_safe_cast( arg ); - { - int ens_size = matrix_get_columns( S ); - sqrt_data->randrot = enkf_linalg_alloc_mp_randrot( ens_size , sqrt_data->rng ); - } -} - - -void sqrt_enkf_complete_update( void * arg ) { - sqrt_enkf_data_type * sqrt_data = sqrt_enkf_data_safe_cast( arg ); - { - matrix_free( sqrt_data->randrot ); - sqrt_data->randrot = NULL; - } -} - -bool sqrt_enkf_has_var( const void * arg, const char * var_name) { - const sqrt_enkf_data_type * module_data = sqrt_enkf_data_safe_cast_const( arg ); - { - return std_enkf_has_var(module_data->std_data, var_name); - } -} - -double sqrt_enkf_get_double( const void * arg, const char * var_name) { - const sqrt_enkf_data_type * module_data = sqrt_enkf_data_safe_cast_const( arg ); - { - return std_enkf_get_double( module_data->std_data , var_name); - } -} - -int sqrt_enkf_get_int( const void * arg, const char * var_name) { - const sqrt_enkf_data_type * module_data = sqrt_enkf_data_safe_cast_const( arg ); - { - return std_enkf_get_int( module_data->std_data , var_name); - } -} - - - -/*****************************************************************/ - -#ifdef INTERNAL_LINK -#define LINK_NAME SQRT_ENKF -#else -#define LINK_NAME EXTERNAL_MODULE_SYMBOL -#endif - - - -analysis_table_type LINK_NAME = { - .name = "SQRT_ENKF", - .alloc = sqrt_enkf_data_alloc, - .freef = sqrt_enkf_data_free, - .set_int = sqrt_enkf_set_int , - .set_double = sqrt_enkf_set_double , - .set_bool = NULL , - .set_string = NULL , - .initX = sqrt_enkf_initX , - .updateA = NULL, - .init_update = sqrt_enkf_init_update, - .complete_update = sqrt_enkf_complete_update, - .get_options = sqrt_enkf_get_options, - .has_var = sqrt_enkf_has_var, - .get_int = sqrt_enkf_get_int, - .get_double = sqrt_enkf_get_double, - .get_bool = NULL, - .get_ptr = NULL -}; - diff --git a/ThirdParty/Ert/libanalysis/src/std_enkf.c b/ThirdParty/Ert/libanalysis/src/std_enkf.c deleted file mode 100644 index 52ed793e1f..0000000000 --- a/ThirdParty/Ert/libanalysis/src/std_enkf.c +++ /dev/null @@ -1,368 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'std_enkf.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - - -/* - A random 'magic' integer id which is used for run-time type checking - of the input data. -*/ -#define STD_ENKF_TYPE_ID 261123 - - - -/* - Observe that only one of the settings subspace_dimension and - truncation can be valid at a time; otherwise the svd routine will - fail. This implies that the set_truncation() and - set_subspace_dimension() routines will set one variable, AND - INVALIDATE THE OTHER. For most situations this will be OK, but if - you have repeated calls to both of these functions the end result - might be a surprise. -*/ -#define INVALID_SUBSPACE_DIMENSION -1 -#define INVALID_TRUNCATION -1 -#define DEFAULT_SUBSPACE_DIMENSION INVALID_SUBSPACE_DIMENSION -#define DEFAULT_USE_EE false -#define DEFAULT_USE_GE false -#define DEFAULT_ANALYSIS_SCALE_DATA true - - - - - -/* - The configuration data used by the std_enkf module is contained in a - std_enkf_data_struct instance. The data type used for the std_enkf - module is quite simple; with only a few scalar variables, but there - are essentially no limits to what you can pack into such a datatype. - - All the functions in the module have a void pointer as the first - argument, this will immediately be casted to a std_enkf_data_type - instance, to get some type safety the UTIL_TYPE_ID system should be - used (see documentation in util.h) - - The data structure holding the data for your analysis module should - be created and initialized by a constructor, which should be - registered with the '.alloc' element of the analysis table; in the - same manner the desctruction of this data should be handled by a - destructor or free() function registered with the .freef field of - the analysis table. -*/ - - - - -struct std_enkf_data_struct { - UTIL_TYPE_ID_DECLARATION; - double truncation; // Controlled by config key: ENKF_TRUNCATION_KEY - int subspace_dimension; // Controlled by config key: ENKF_NCOMP_KEY (-1: use Truncation instead) - long option_flags; - bool use_EE; - bool use_GE; - bool analysis_scale_data; -}; - -static UTIL_SAFE_CAST_FUNCTION_CONST( std_enkf_data , STD_ENKF_TYPE_ID ) - - -/* - This is a macro which will expand to generate a function: - - std_enkf_data_type * std_enkf_data_safe_cast( void * arg ) {} - - which is used for runtime type checking of all the functions which - accept a void pointer as first argument. -*/ -static UTIL_SAFE_CAST_FUNCTION( std_enkf_data , STD_ENKF_TYPE_ID ) - - -double std_enkf_get_truncation( std_enkf_data_type * data ) { - return data->truncation; -} - -int std_enkf_get_subspace_dimension( std_enkf_data_type * data ) { - return data->subspace_dimension; -} - -void std_enkf_set_truncation( std_enkf_data_type * data , double truncation ) { - data->truncation = truncation; - if (truncation > 0.0) - data->subspace_dimension = INVALID_SUBSPACE_DIMENSION; -} - -void std_enkf_set_subspace_dimension( std_enkf_data_type * data , int subspace_dimension) { - data->subspace_dimension = subspace_dimension; - if (subspace_dimension > 0) - data->truncation = INVALID_TRUNCATION; -} - - - -void * std_enkf_data_alloc( rng_type * rng) { - std_enkf_data_type * data = util_malloc( sizeof * data ); - UTIL_TYPE_ID_INIT( data , STD_ENKF_TYPE_ID ); - - std_enkf_set_truncation( data , DEFAULT_ENKF_TRUNCATION_ ); - std_enkf_set_subspace_dimension( data , DEFAULT_SUBSPACE_DIMENSION ); - data->option_flags = ANALYSIS_NEED_ED; - data->use_EE = DEFAULT_USE_EE; - data->use_GE = DEFAULT_USE_GE; - data->analysis_scale_data = DEFAULT_ANALYSIS_SCALE_DATA; - return data; -} - - -void std_enkf_data_free( void * data ) { - free( data ); -} - - - - -static void std_enkf_initX__( matrix_type * X , - matrix_type * S , - matrix_type * R , - matrix_type * E , - matrix_type * D , - double truncation, - int ncomp, - bool bootstrap , - bool use_EE , - bool use_GE) { - - int nrobs = matrix_get_rows( S ); - int ens_size = matrix_get_columns( S ); - int nrmin = util_int_min( ens_size , nrobs); - - matrix_type * W = matrix_alloc(nrobs , nrmin); - double * eig = util_calloc( nrmin , sizeof * eig); - - matrix_subtract_row_mean( S ); /* Shift away the mean */ - - if (use_EE) { - if (use_GE) { - enkf_linalg_lowrankE( S , E , W , eig , truncation , ncomp); - } - else { - matrix_type * Et = matrix_alloc_transpose( E ); - matrix_type * Cee = matrix_alloc_matmul( E , Et ); - matrix_scale( Cee , 1.0 / (ens_size - 1)); - - enkf_linalg_lowrankCinv( S , Cee , W , eig , truncation , ncomp); - - matrix_free( Et ); - matrix_free( Cee ); - } - - } - else { - enkf_linalg_lowrankCinv( S , R , W , eig , truncation , ncomp); - } - - enkf_linalg_init_stdX( X , S , D , W , eig , bootstrap); - - matrix_free( W ); - free( eig ); - enkf_linalg_checkX( X , bootstrap ); -} - - - - - -void std_enkf_initX(void * module_data , - matrix_type * X , - matrix_type * A , - matrix_type * S , - matrix_type * R , - matrix_type * dObs , - matrix_type * E , - matrix_type * D) { - - - std_enkf_data_type * data = std_enkf_data_safe_cast( module_data ); - { - int ncomp = data->subspace_dimension; - double truncation = data->truncation; - - std_enkf_initX__(X,S,R,E,D,truncation,ncomp,false,data->use_EE,data->use_GE); - } -} - - - - - - - -bool std_enkf_set_double( void * arg , const char * var_name , double value) { - std_enkf_data_type * module_data = std_enkf_data_safe_cast( arg ); - { - bool name_recognized = true; - - if (strcmp( var_name , ENKF_TRUNCATION_KEY_) == 0) - std_enkf_set_truncation( module_data , value ); - else - name_recognized = false; - - return name_recognized; - } -} - - -bool std_enkf_set_int( void * arg , const char * var_name , int value) { - std_enkf_data_type * module_data = std_enkf_data_safe_cast( arg ); - { - bool name_recognized = true; - - if (strcmp( var_name , ENKF_NCOMP_KEY_) == 0) - std_enkf_set_subspace_dimension( module_data , value ); - else - name_recognized = false; - - return name_recognized; - } -} - - -bool std_enkf_set_bool( void * arg , const char * var_name , bool value) { - std_enkf_data_type * module_data = std_enkf_data_safe_cast( arg ); - { - bool name_recognized = true; - - if (strcmp( var_name , USE_EE_KEY_) == 0) - module_data->use_EE = value; - else if (strcmp( var_name , USE_GE_KEY_) == 0) - module_data->use_GE = value; - else if (strcmp( var_name , ANALYSIS_SCALE_DATA_KEY_) == 0) - module_data->analysis_scale_data = value; - else - name_recognized = false; - - return name_recognized; - } -} - - - -long std_enkf_get_options( void * arg , long flag ) { - std_enkf_data_type * module_data = std_enkf_data_safe_cast( arg ); - int scale_option = (module_data->analysis_scale_data) ? ANALYSIS_SCALE_DATA : 0; - return module_data->option_flags + scale_option; -} - -bool std_enkf_has_var( const void * arg, const char * var_name) { - { - if (strcmp(var_name , ENKF_NCOMP_KEY_) == 0) - return true; - else if (strcmp(var_name , ENKF_TRUNCATION_KEY_) == 0) - return true; - else if (strcmp(var_name , USE_EE_KEY_) == 0) - return true; - else if (strcmp(var_name , USE_GE_KEY_) == 0) - return true; - else if (strcmp(var_name , ANALYSIS_SCALE_DATA_KEY_) == 0) - return true; - else - return false; - } -} - -double std_enkf_get_double( const void * arg, const char * var_name) { - const std_enkf_data_type * module_data = std_enkf_data_safe_cast_const( arg ); - { - if (strcmp(var_name , ENKF_TRUNCATION_KEY_) == 0) - return module_data->truncation; - else - return -1; - } -} - -int std_enkf_get_int( const void * arg, const char * var_name) { - const std_enkf_data_type * module_data = std_enkf_data_safe_cast_const( arg ); - { - if (strcmp(var_name , ENKF_NCOMP_KEY_) == 0) - return module_data->subspace_dimension; - else - return -1; - } -} - - -bool std_enkf_get_bool( const void * arg, const char * var_name) { - const std_enkf_data_type * module_data = std_enkf_data_safe_cast_const( arg ); - { - if (strcmp(var_name , USE_EE_KEY_) == 0) - return module_data->use_EE; - else if (strcmp(var_name , USE_GE_KEY_) == 0) - return module_data->use_GE; - else if (strcmp(var_name , ANALYSIS_SCALE_DATA_KEY_) == 0) - return module_data->analysis_scale_data; - else - return false; - } -} - - -/** - gcc -fpic -c -I?? - gcc -shared -o -*/ - - -#ifdef INTERNAL_LINK -#define LINK_NAME STD_ENKF -#else -#define LINK_NAME EXTERNAL_MODULE_SYMBOL -#endif - - -analysis_table_type LINK_NAME = { - .name = "STD_ENKF", - .alloc = std_enkf_data_alloc, - .freef = std_enkf_data_free, - .set_int = std_enkf_set_int , - .set_double = std_enkf_set_double , - .set_bool = std_enkf_set_bool, - .set_string = NULL , - .get_options = std_enkf_get_options , - .initX = std_enkf_initX , - .updateA = NULL, - .init_update = NULL, - .complete_update = NULL, - .has_var = std_enkf_has_var, - .get_int = std_enkf_get_int, - .get_double = std_enkf_get_double, - .get_bool = std_enkf_get_bool, - .get_ptr = NULL, -}; - diff --git a/ThirdParty/Ert/libanalysis/tests/CMakeLists.txt b/ThirdParty/Ert/libanalysis/tests/CMakeLists.txt deleted file mode 100644 index ff75b8e0d0..0000000000 --- a/ThirdParty/Ert/libanalysis/tests/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -ert_module_name( VAR_RML rml_enkf ${LIBRARY_OUTPUT_PATH} ) - -add_executable(analysis_test_external_module analysis_test_external_module.c ) -target_link_libraries( analysis_test_external_module analysis util test_util ) - -add_test( analysis_module_rml ${EXECUTABLE_OUTPUT_PATH}/analysis_test_external_module "RML_ENKF" ${VAR_RML} 41 - ITER:45 - USE_PRIOR:False - LAMBDA_REDUCE:0.10 - LAMBDA_INCREASE:2.5 - ENKF_TRUNCATION:0.77 - LAMBDA0:0.25 - LAMBDA_MIN:0.01 - LOG_FILE:LogFile.txt - CLEAR_LOG:True - LAMBDA_RECALCULATE:True ) - - -add_executable( analysis_test_module_info analysis_test_module_info.c ) -target_link_libraries( analysis_test_module_info analysis util test_util) -add_test( analysis_test_module_info ${EXECUTABLE_OUTPUT_PATH}/analysis_test_module_info ) diff --git a/ThirdParty/Ert/libanalysis/tests/analysis_test_external_module.c b/ThirdParty/Ert/libanalysis/tests/analysis_test_external_module.c deleted file mode 100644 index 01f5a661f8..0000000000 --- a/ThirdParty/Ert/libanalysis/tests/analysis_test_external_module.c +++ /dev/null @@ -1,106 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'analysis_test_external_module.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -#include -#include -#include - -#include - - - -void test_set_get(analysis_module_type * module , const char * var_value) { - char * var , *string_value; - util_binary_split_string( var_value , ":" , false , &var , &string_value); - - if (var && string_value) { - printf("Testing variable:%s \n",var); - while (true) { - int int_value; - double double_value; - bool bool_value; - test_assert_true(analysis_module_has_var( module , var )); - - if (util_sscanf_int( string_value , &int_value)) { - test_assert_true(analysis_module_set_var( module , var , string_value )); - test_assert_int_equal( int_value , analysis_module_get_int( module , var )); - break; - } - - if (util_sscanf_double( string_value , &double_value)) { - test_assert_true(analysis_module_set_var( module , var , string_value )); - test_assert_double_equal( double_value , analysis_module_get_double( module , var )); - break; - } - - if (util_sscanf_bool( string_value , &bool_value)) { - test_assert_true(analysis_module_set_var( module , var , string_value )); - test_assert_bool_equal( bool_value , analysis_module_get_bool( module , var )); - break; - } - - - test_assert_true(analysis_module_set_var( module , var , string_value )); - test_assert_string_equal( string_value , (const char *) analysis_module_get_ptr( module , var )); - break; - } - } else { - fprintf(stderr,"Invalid test input data: %s -> could not split in var:value\n" , var_value); - exit(1); - } -} - - - -void load_module( rng_type * rng , const char * user_name , const char * lib_name, const char * options_str , int nvar , const char ** var_list) { - long flags = strtol(options_str , NULL , 10); - analysis_module_type * analysis_module = analysis_module_alloc_external(rng , lib_name); - - printf("Loading:%s \n" , lib_name); - test_assert_string_equal( EXTERNAL_MODULE_NAME , analysis_module_get_table_name(analysis_module)); - if (util_is_abs_path(lib_name)) - test_assert_string_equal( lib_name , analysis_module_get_lib_name(analysis_module)); - - test_assert_true( analysis_module_is_instance( analysis_module)); - { - for (int i=0; i < nvar; i++) - test_set_get( analysis_module , var_list[i] ); - } - test_assert_false( analysis_module_has_var(analysis_module , "DoesNotHaveThisVariable")); - - test_assert_true( analysis_module_check_option( analysis_module , flags)); - flags += 1; - test_assert_false( analysis_module_check_option( analysis_module , flags)); - analysis_module_free( analysis_module); -} - - -int main(int argc , char ** argv) { - const char * user_name = argv[1]; - const char * lib_name = argv[2]; - const char * options_str = argv[3]; - int nvar = argc - 4; - rng_type * rng = rng_alloc( MZRAN , INIT_DEFAULT); - - load_module(rng , user_name , lib_name , options_str , nvar , (const char **) &argv[4]); - rng_free( rng ); - - exit(0); -} diff --git a/ThirdParty/Ert/libanalysis/tests/analysis_test_module_info.c b/ThirdParty/Ert/libanalysis/tests/analysis_test_module_info.c deleted file mode 100644 index 6924263441..0000000000 --- a/ThirdParty/Ert/libanalysis/tests/analysis_test_module_info.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright (C) 2016 Statoil ASA, Norway. - - The file 'analysis_test_module_info.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -#include - - -int main(int argc , char ** argv) { - - const char* ministep_name = "SOME MINISTEP"; - module_info_type * module_info = module_info_alloc( ministep_name ); - test_assert_true( module_info_is_instance( module_info )); - - module_data_block_vector_type * module_data_block_vector = module_info_get_data_block_vector(module_info); - test_assert_true( module_data_block_vector_is_instance( module_data_block_vector )); - - module_obs_block_vector_type * module_obs_block_vector = module_info_get_obs_block_vector(module_info); - test_assert_true( module_obs_block_vector_is_instance( module_obs_block_vector )); - - int index_list[1] = { 1 }; - module_data_block_type * module_data_block = module_data_block_alloc( "PARAMETER", &index_list[0], 0, 1 ); - test_assert_true( module_data_block_is_instance( module_data_block )); - module_data_block_vector_add_data_block(module_data_block_vector, module_data_block); - - - module_obs_block_type * module_obs_block = module_obs_block_alloc( "OBS", &index_list[0], 0, 1 ); - test_assert_true( module_obs_block_is_instance( module_obs_block )); - module_obs_block_vector_add_obs_block(module_obs_block_vector, module_obs_block); - - module_info_free( module_info ); - exit(0); -} - - diff --git a/ThirdParty/Ert/libconfig/CMakeLists.txt b/ThirdParty/Ert/libconfig/CMakeLists.txt deleted file mode 100644 index 6d8bd6b946..0000000000 --- a/ThirdParty/Ert/libconfig/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory( src ) -if (BUILD_TESTS) - add_subdirectory( tests ) -endif() diff --git a/ThirdParty/Ert/libconfig/applications/conf_test.c b/ThirdParty/Ert/libconfig/applications/conf_test.c deleted file mode 100644 index 31aa43222f..0000000000 --- a/ThirdParty/Ert/libconfig/applications/conf_test.c +++ /dev/null @@ -1,213 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'conf_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -int main() -{ - const char * enkf_conf_help = "The main enkf conf shall contain neccessary infomation to run the enkf."; - conf_class_type * enkf_conf_class = conf_class_alloc_empty("ENKF_conf", true, false, enkf_conf_help); - conf_class_set_help(enkf_conf_class, enkf_conf_help); - - /** Create and insert HISTORY_OBSERVATION class. */ - { - const char * help_class_history_observation = "The class HISTORY_OBSERVATION is used to condition on a time series from the production history. The name of the an instance is used to define the item to condition on, and should be in summary.x syntax. E.g., creating a HISTORY_OBSERVATION instance with name GOPR:P4 conditions on GOPR for group P4."; - conf_class_type * history_observation_class = conf_class_alloc_empty("HISTORY_OBSERVATION", false, false, help_class_history_observation); - conf_class_set_help(history_observation_class, help_class_history_observation); - - - const char * help_item_spec_error_mode = "The string ERROR_MODE gives the error mode for the observation."; - conf_item_spec_type * item_spec_error_mode = conf_item_spec_alloc("ERROR_MODE", true, DT_STR, help_item_spec_error_mode); - conf_item_spec_set_help(item_spec_error_mode, help_item_spec_error_mode); - - conf_item_spec_add_restriction(item_spec_error_mode, "rel"); - conf_item_spec_add_restriction(item_spec_error_mode, "abs"); - conf_item_spec_add_restriction(item_spec_error_mode, "relmin"); - - conf_item_spec_set_default_value(item_spec_error_mode, "rel"); - - - const char * help_item_spec_error = "The positive floating number ERROR gives the standard deviation (abs) or the relative uncertainty (rel/relmin) of the observations."; - conf_item_spec_type * item_spec_error = conf_item_spec_alloc("ERROR", true, DT_POSFLOAT, help_item_spec_error); - conf_item_spec_set_default_value(item_spec_error, "0.10"); - conf_item_spec_set_help(item_spec_error, help_item_spec_error); - - const char * help_item_spec_error_min = "The positive floating point number ERROR_MIN gives the minimum value for the standard deviation of the observation when relmin is used."; - conf_item_spec_type * item_spec_error_min = conf_item_spec_alloc("ERROR_MIN", true, DT_POSFLOAT, help_item_spec_error_min); - conf_item_spec_set_default_value(item_spec_error_min, "0.10"); - conf_item_spec_set_help(item_spec_error_min, help_item_spec_error_min); - - - conf_class_insert_owned_item_spec(history_observation_class, item_spec_error_mode); - conf_class_insert_owned_item_spec(history_observation_class, item_spec_error); - conf_class_insert_owned_item_spec(history_observation_class, item_spec_error_min); - - conf_class_insert_owned_sub_class(enkf_conf_class, history_observation_class); - } - - - - /** Create and insert SUMMARY_OBSERVATION class. */ - { - const char * help_class_summary_observation = "The class SUMMARY_OBSERVATION can be used to condition on any observation whos simulated value is written to the summary file."; - conf_class_type * summary_observation_class = conf_class_alloc_empty("SUMMARY_OBSERVATION", false, false, help_class_summary_observation); - conf_class_set_help(summary_observation_class, help_class_summary_observation); - - const char * help_item_spec_value = "The floating point number VALUE gives the observed value."; - conf_item_spec_type * item_spec_value = conf_item_spec_alloc("VALUE", true, DT_FLOAT, help_item_spec_value); - conf_item_spec_set_help(item_spec_value, help_item_spec_value); - - - const char * help_item_spec_error = "The positive floating point number ERROR is the standard deviation of the observed value."; - conf_item_spec_type * item_spec_error = conf_item_spec_alloc("ERROR", true, DT_POSFLOAT, help_item_spec_error); - conf_item_spec_set_help(item_spec_error, help_item_spec_error); - - const char * help_item_spec_date = "The DATE item gives the date of the observation. Format is dd/mm/yyyy."; - conf_item_spec_type * item_spec_date = conf_item_spec_alloc("DATE", false, DT_DATE, help_item_spec_date); - conf_item_spec_set_help(item_spec_date, help_item_spec_date); - - const char * help_item_spec_days = "The DAYS item gives the observation time as days after simulation start."; - conf_item_spec_type * item_spec_days = conf_item_spec_alloc("DAYS", false, DT_POSFLOAT, help_item_spec_days); - conf_item_spec_set_help(item_spec_days, help_item_spec_days); - - const char * help_item_spec_restart = "The RESTART item gives the observation time as the ECLIPSE restart nr."; - conf_item_spec_type * item_spec_restart = conf_item_spec_alloc("RESTART", false, DT_POSINT, help_item_spec_restart); - conf_item_spec_set_help(item_spec_restart, help_item_spec_restart); - - const char * help_item_spec_sumkey = "The string SUMMARY_KEY is used to look up the simulated value in the summary file. It has the same format as the summary.x program, e.g. WOPR:P4"; - conf_item_spec_type * item_spec_sumkey = conf_item_spec_alloc("KEY", true, DT_STR, help_item_spec_sumkey); - conf_item_spec_set_help(item_spec_sumkey, help_item_spec_sumkey); - - conf_class_insert_owned_item_spec(summary_observation_class, item_spec_value); - conf_class_insert_owned_item_spec(summary_observation_class, item_spec_error); - conf_class_insert_owned_item_spec(summary_observation_class, item_spec_date); - conf_class_insert_owned_item_spec(summary_observation_class, item_spec_days); - conf_class_insert_owned_item_spec(summary_observation_class, item_spec_restart); - conf_class_insert_owned_item_spec(summary_observation_class, item_spec_sumkey); - - /** Create a mutex on DATE, DAYS and RESTART. */ - conf_item_mutex_type * time_mutex = conf_class_new_item_mutex(summary_observation_class , true , false); - - conf_item_mutex_add_item_spec(time_mutex, item_spec_date); - conf_item_mutex_add_item_spec(time_mutex, item_spec_days); - conf_item_mutex_add_item_spec(time_mutex, item_spec_restart); - - - - - conf_class_insert_owned_sub_class(enkf_conf_class, summary_observation_class); - } - - - - /** Create and insert BLOCK_OBSERVATION class. */ - { - const char * help_class_block_observation = "The class BLOCK_OBSERVATION can be used to condition on an observation whos simulated values are block/cell values of a field, e.g. RFT tests."; - conf_class_type * block_observation_class = conf_class_alloc_empty("BLOCK_OBSERVATION", false, false, help_class_block_observation); - conf_class_set_help(block_observation_class, help_class_block_observation); - - const char * help_item_spec_field = "The item FIELD gives the observed field. E.g., ECLIPSE fields such as PRESSURE, SGAS or any user defined fields such as PORO or PERMX."; - conf_item_spec_type * item_spec_field = conf_item_spec_alloc("FIELD", true, DT_STR, help_item_spec_field); - conf_item_spec_set_help(item_spec_field, help_item_spec_field); - - const char * help_item_spec_date = "The DATE item gives the date of the observation. Format is dd/mm/yyyy."; - conf_item_spec_type * item_spec_date = conf_item_spec_alloc("DATE", true, DT_DATE, help_item_spec_date); - conf_item_spec_set_help(item_spec_date, help_item_spec_date); - - conf_class_insert_owned_item_spec(block_observation_class, item_spec_field); - conf_class_insert_owned_item_spec(block_observation_class, item_spec_date); - - /** Create and insert the sub class OBS. */ - { - const char * help_class_obs = "The class OBS is used to specify a single observed point."; - conf_class_type * obs_class = conf_class_alloc_empty("OBS", true, true , help_class_obs); - conf_class_set_help(obs_class, help_class_obs); - - const char * help_item_i = "The item I gives the I index of the block observation."; - conf_item_spec_type * item_spec_i = conf_item_spec_alloc("I", true, DT_POSINT, help_item_i); - conf_item_spec_set_help(item_spec_i, help_item_i); - - const char * help_item_j = "The item J gives the J index of the block observation."; - conf_item_spec_type * item_spec_j = conf_item_spec_alloc("J", true, DT_POSINT, help_item_j); - conf_item_spec_set_help(item_spec_j, help_item_j); - - const char * help_item_k = "The item K gives the K index of the block observation."; - conf_item_spec_type * item_spec_k = conf_item_spec_alloc("K", true, DT_POSINT, help_item_k); - conf_item_spec_set_help(item_spec_k, help_item_k); - - const char * help_item_spec_value = "The floating point number VALUE gives the observed value."; - conf_item_spec_type * item_spec_value = conf_item_spec_alloc("VALUE", true, DT_FLOAT, help_item_spec_value); - conf_item_spec_set_help(item_spec_value, help_item_spec_value); - - const char * help_item_spec_error = "The positive floating point number ERROR is the standard deviation of the observed value."; - conf_item_spec_type * item_spec_error = conf_item_spec_alloc("ERROR", true, DT_POSFLOAT, help_item_spec_error); - conf_item_spec_set_help(item_spec_error, help_item_spec_error); - - conf_class_insert_owned_item_spec(obs_class, item_spec_i); - conf_class_insert_owned_item_spec(obs_class, item_spec_j); - conf_class_insert_owned_item_spec(obs_class, item_spec_k); - conf_class_insert_owned_item_spec(obs_class, item_spec_value); - conf_class_insert_owned_item_spec(obs_class, item_spec_error); - - conf_class_insert_owned_sub_class(block_observation_class, obs_class); - } - - conf_class_insert_owned_sub_class(enkf_conf_class, block_observation_class); - } - - - - /** Try to create an instance of the enkf_conf_class. */ - - conf_instance_type * enkf_conf = conf_instance_alloc_from_file(enkf_conf_class, "enkf_conf", "testcase/test.txt"); - conf_instance_type * enkf_conf2 = conf_instance_alloc_from_file(enkf_conf_class, "enkf_conf2", "testcase/test2.txt"); - - /** Validate enkf_conf_class. */ - - conf_instance_validate(enkf_conf); - conf_instance_validate(enkf_conf2); - - /** Overload. */ - conf_instance_overload(enkf_conf, enkf_conf2); - - - /** Print the name of the HISTORY_OBSERVATION instances. */ - { - stringlist_type * history_observations = conf_instance_alloc_list_of_sub_instances_of_class_by_name(enkf_conf, "HISTORY_OBSERVATION"); - - int num_history_observations = stringlist_get_size(history_observations); - - for(int obs_nr = 0; obs_nr < num_history_observations ; obs_nr++) - { - printf("%2i. %s\n", obs_nr, stringlist_iget(history_observations, obs_nr)); - const conf_instance_type * sched_obs = conf_instance_get_sub_instance_ref(enkf_conf, stringlist_iget(history_observations, obs_nr)); - double error = conf_instance_get_item_value_double(sched_obs, "ERROR"); - printf(" std.dev : %f\n", error); - } - - stringlist_free(history_observations); - } - - - /** Clean up. */ - - conf_instance_free(enkf_conf); - conf_instance_free(enkf_conf2); - conf_class_free(enkf_conf_class); - -} diff --git a/ThirdParty/Ert/libconfig/applications/config_test.c b/ThirdParty/Ert/libconfig/applications/config_test.c deleted file mode 100644 index 7a2a14ff77..0000000000 --- a/ThirdParty/Ert/libconfig/applications/config_test.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'config_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - - -int main(void) { - const char * config_file = "config_test_input"; - config_parser_type * config = config_alloc(); - config_schema_item_type * item; - - item = config_add_schema_item(config , "KEY1" , true , true); - item = config_add_schema_item(config , "KEY2" , true , false); - config_schema_item_set_argc_minmax(item , 1 , 4 , 4 , (const config_item_types [4]) {CONFIG_EXECUTABLE , CONFIG_EXISTING_FILE , CONFIG_BOOLEAN , CONFIG_BOOLEAN}); - - - item = config_add_schema_item(config , "FATHER" , false , false); - { - stringlist_type * children = stringlist_alloc_argv_ref( (const char *[2]) {"CHILD1" , "CHILD2"} , 2); - config_schema_item_set_required_children(item , children); - stringlist_free(children); - } - item = config_add_schema_item(config , "CHILD1" , false , false); - config_schema_item_set_argc_minmax(item , 1 , 1 , 1 , (const config_item_types [1]) {CONFIG_INT}); - - config_parse(config , config_file , "--" , "INCLUDE" , NULL , true, true); - - - - { - stringlist_type * sl = config_alloc_complete_stringlist(config , "KEY1"); - char * s = stringlist_alloc_joined_string(sl , "|"); - printf("KEY1 -> \"%s\" \n",s); - printf("CONFIG_IGET:%s\n" , config_iget(config , "KEY2" , 0 , 0)); - free(s); - stringlist_free(sl); - } - - - config_free(config); -} diff --git a/ThirdParty/Ert/libconfig/include/ert/config/conf.h b/ThirdParty/Ert/libconfig/include/ert/config/conf.h deleted file mode 100644 index aad3e275ab..0000000000 --- a/ThirdParty/Ert/libconfig/include/ert/config/conf.h +++ /dev/null @@ -1,354 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'conf.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_CONF_H -#define ERT_CONF_H - -/* libconfig: lightweight configuration parser - * - * - * - * Introduction - * - * This library provides a lightweight configuration parser for the - * enkf application. The goal of the library is to provide the - * developer with a tool for rapid specification of configuration - * files, automatic checking of user provided configuration files - * and typed access to configuration items. - * - * - * - * A Simple Example - * - * Let us consider a simple example of user provided configuration - * file that can be used with the parser: - * - * - * res_sim FrontSim2007 - * { - * executable = /bin/frontsim2007; - * version = 2007; - * - * run_host bgo179lin - * { - * hostname = bgo179lin.nho.hydro.com; - * num_jobs = 4; - * }; - * }; - * - * - * Note that the newlines are not neccessary. In the example above, - * the user has provided an instance of the class "res_sim" with name - * FrontSim2007. Further, the user has set the items executable and version. - * He has also provided a instance of the sub class "run_host" with name - * bgo179lin and allocated 4 jobs to this machine. - * - * - * - * Structure - * - * The system is built around four basic objects: - * - * - Class definitions. - * - Item specifications. - * - Instances of classes. - * - Instances of item specifications, i.e. items. - * - * The relationship between the objects is as follows : - * - * - Class: - * . Can have contain both classes and item specifications. - * . Can not contain items or class instances. - * - * - Item specifications: - * . Can not contain any of the other objects. - * - * - Instances of classes: - * . Can contain class instances and items. - * - * - Items: - * . Can not contain any of the other objects. - * - * - * - * General Use - * - * The parser is designed to be used in the following way: - * - * - The developer creates the classes and item specifications needed. - * - Using the library and the classes, user provided configuration - * files are read and validated. - * - If the validation fails, the developer can choose to exit. - * - Using the library, the devloper has typed access to all - * information provided by the user. - * - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include -#include - -#include - - - -typedef struct conf_class_struct conf_class_type; -typedef struct conf_instance_struct conf_instance_type; -typedef struct conf_item_spec_struct conf_item_spec_type; -typedef struct conf_item_struct conf_item_type; -typedef struct conf_item_mutex_struct conf_item_mutex_type; - - -/** D E F A U L T A L L O C / F R E E F U N C T I O N S */ - - - -conf_class_type * conf_class_alloc_empty( - const char * class_name, - bool require_instance, - bool singleton, - const char * help); - -void conf_class_free( - conf_class_type * conf_class); - -void conf_class_free__( - void * conf_class); - - - -conf_instance_type * conf_instance_alloc_default( - const conf_class_type * conf_class, - const char * name); - -conf_instance_type * conf_instance_copyc( - const conf_instance_type * conf_instance); - -void conf_instance_free( - conf_instance_type * conf_instance); - -void conf_instance_free__( - void * conf_instance); - - - -conf_item_spec_type * conf_item_spec_alloc( - char * name, - bool required_set, - dt_enum dt, - const char * help); - -void conf_item_spec_free( - conf_item_spec_type * conf_item_spec); - -void conf_item_spec_free__( - void * conf_item_spec); - - - -conf_item_type * conf_item_alloc( - const conf_item_spec_type * conf_item_spec, - const char * value); - -conf_item_type * conf_item_copyc( - const conf_item_type * conf_item); - -void conf_item_free( - conf_item_type * conf_item); - -void conf_item_free__( - void * conf_item); - - - -void conf_item_mutex_free( - conf_item_mutex_type * conf_item_mutex); - -void conf_item_mutex_free__( - void * conf_item_mutex); - - - -/** M A N I P U L A T O R S , I N S E R T I O N */ - - - -void conf_class_insert_owned_sub_class( - conf_class_type * conf_class, - conf_class_type * sub_conf_class); - -void conf_class_insert_owned_item_spec( - conf_class_type * conf_class, - conf_item_spec_type * item_spec); - -void conf_instance_insert_owned_sub_instance( - conf_instance_type * conf_instance, - conf_instance_type * sub_conf_instance); - -void conf_instance_insert_owned_item( - conf_instance_type * conf_instance, - conf_item_type * conf_item); - -void conf_instance_insert_item( - conf_instance_type * conf_instance, - const char * item_name, - const char * value); - -void conf_instance_overload( - conf_instance_type * conf_instance_target, - const conf_instance_type * conf_instance_source); - -conf_item_mutex_type * conf_class_new_item_mutex( - conf_class_type * conf_class, - bool require_one, - bool inverse); - -void conf_item_mutex_add_item_spec( - conf_item_mutex_type * conf_item_mutex, - const conf_item_spec_type * conf_item_spec); - - - -/** M A N I P U L A T O R S , C L A S S A N D I T E M S P E C I F I C A T I O N */ - - - -void conf_class_set_help( - conf_class_type * conf_class, - const char * help); - - - -void conf_item_spec_add_restriction( - conf_item_spec_type * conf_item_spec, - const char * restriction); - -void conf_item_spec_set_default_value( - conf_item_spec_type * conf_item_spec, - const char * default_value); - -void conf_item_spec_set_help( - conf_item_spec_type * conf_item_spec, - const char * help); - - - -/** A C C E S S O R S */ - - - -bool conf_class_has_item_spec( - const conf_class_type * conf_class, - const char * item_name); - -bool conf_class_has_sub_class( - const conf_class_type * conf_class, - const char * sub_class_name); - -const conf_item_spec_type * conf_class_get_item_spec_ref( - const conf_class_type * conf_class, - const char * item_name); - -const conf_class_type * conf_class_get_sub_class_ref( - const conf_class_type * conf_class, - const char * sub_class_name); - - - -const char * conf_instance_get_name_ref( - const conf_instance_type * conf_instance); - -bool conf_instance_is_of_class( - const conf_instance_type * conf_instance, - const char * class_name); - -bool conf_instance_has_item( - const conf_instance_type * conf_instance, - const char * item_name); - -bool conf_instance_has_sub_instance( - const conf_instance_type * conf_instance, - const char * sub_instance_name); - -const conf_instance_type * conf_instance_get_sub_instance_ref( - const conf_instance_type * conf_instance, - const char * sub_instance_name); - -stringlist_type * conf_instance_alloc_list_of_sub_instances_of_class( - const conf_instance_type * conf_instance, - const conf_class_type * conf_class); - -stringlist_type * conf_instance_alloc_list_of_sub_instances_of_class_by_name( - const conf_instance_type * conf_instance, - const char * sub_class_name); - -const conf_class_type * conf_instance_get_class_ref( - const conf_instance_type * conf_instance); - -const char * conf_instance_get_class_name_ref( - const conf_instance_type * conf_instance); - -const char * conf_instance_get_item_value_ref( - const conf_instance_type * conf_instance, - const char * item_name); - -/** If the dt supports it, these functions will parse the item - value to the requested types. - - NOTE: - If the dt does not support it, or the conf_instance - does not have the item, the functions will abort your program. -*/ -int conf_instance_get_item_value_int( - const conf_instance_type * conf_instance, - const char * item_name); - -double conf_instance_get_item_value_double( - const conf_instance_type * conf_instance, - const char * item_name); - -time_t conf_instance_get_item_value_time_t( - const conf_instance_type * conf_instance, - const char * item_name); - -/** V A L I D A T O R S */ - - - -bool conf_instance_validate( - const conf_instance_type * conf_instance); - - - -/** A L L O C F R O M F I L E */ - - -conf_instance_type * conf_instance_alloc_from_file( - const conf_class_type * conf_class, - const char * name, - const char * file_name); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libconfig/include/ert/config/conf_data.h b/ThirdParty/Ert/libconfig/include/ert/config/conf_data.h deleted file mode 100644 index 96f3c79377..0000000000 --- a/ThirdParty/Ert/libconfig/include/ert/config/conf_data.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'conf_data.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_CONF_DATA_H -#define ERT_CONF_DATA_H -#include -#include - -typedef enum { - DT_STR, - DT_INT, - DT_POSINT, - DT_FLOAT, - DT_POSFLOAT, - DT_FILE, - DT_EXEC, - DT_FOLDER, - DT_DATE - } dt_enum; - -dt_enum conf_data_get_dt_from_string( - const char * str); - -bool conf_data_string_is_dt( - const char * str); - -const char * conf_data_get_dt_name_ref( - dt_enum dt); - -bool conf_data_validate_string_as_dt_value( - dt_enum dt, - const char * str); - -int conf_data_get_int_from_string( - dt_enum dt, - const char * str); - -double conf_data_get_double_from_string( - dt_enum dt, - const char * str); - -time_t conf_data_get_time_t_from_string( - dt_enum dt, - const char * str); - -#endif diff --git a/ThirdParty/Ert/libconfig/include/ert/config/conf_util.h b/ThirdParty/Ert/libconfig/include/ert/config/conf_util.h deleted file mode 100644 index 9fbc5dfb93..0000000000 --- a/ThirdParty/Ert/libconfig/include/ert/config/conf_util.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'conf_util.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_CONF_UTIL_H -#define ERT_CONF_UTIL_H - -char * conf_util_fscanf_alloc_token_buffer( const char * file_name ); - -char * conf_util_alloc_next_token( char ** buffer_position ); - -#endif diff --git a/ThirdParty/Ert/libconfig/include/ert/config/config_content.h b/ThirdParty/Ert/libconfig/include/ert/config/config_content.h deleted file mode 100644 index dc86388407..0000000000 --- a/ThirdParty/Ert/libconfig/include/ert/config/config_content.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - Copyright (C) 2015 Statoil ASA, Norway. - - The file 'config_content.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#ifndef ERT_CONFIG_CONTENT_H -#define ERT_CONFIG_CONTENT_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -#include -#include -#include -#include - -typedef struct config_content_struct config_content_type; - - - config_content_type * config_content_alloc(const char * filename); - void config_content_free( config_content_type * content ); - void config_content_set_valid( config_content_type * content); - bool config_content_is_valid( const config_content_type * content ); - bool config_content_has_item( const config_content_type * content , const char * key); - void config_content_add_item( config_content_type * content , const config_schema_item_type * schema_item , const config_path_elm_type * path_elm); - config_content_item_type * config_content_get_item( const config_content_type * content , const char * key); - void config_content_add_node( config_content_type * content , config_content_node_type * content_node ); - config_error_type * config_content_get_errors( const config_content_type * content); - - const char * config_content_iget( const config_content_type * content , const char * key , int occurence , int index); - int config_content_iget_as_int( const config_content_type * content , const char * key , int occurence , int index); - bool config_content_iget_as_bool( const config_content_type * content , const char * key , int occurence , int index); - double config_content_iget_as_double( const config_content_type * content , const char * key , int occurence , int index); - const char * config_content_iget_as_path( const config_content_type * content , const char * key , int occurence , int index); - const char * config_content_safe_iget(const config_content_type * content , const char *kw, int occurence , int index); - int config_content_get_occurences(const config_content_type * content, const char * kw); - - bool config_content_get_value_as_bool(const config_content_type * config , const char * kw); - int config_content_get_value_as_int(const config_content_type * config , const char * kw); - double config_content_get_value_as_double(const config_content_type * config , const char * kw); - const char * config_content_get_value_as_path( const config_content_type * config , const char * kw); - const char * config_content_get_value_as_abspath( const config_content_type * config , const char * kw); - const char * config_content_get_value_as_relpath( const config_content_type * config , const char * kw); - const char * config_content_get_value(const config_content_type * config , const char * kw); - char * config_content_alloc_joined_string(const config_content_type * content , const char * kw, const char * sep); - stringlist_type * config_content_alloc_complete_stringlist(const config_content_type * content , const char * kw); - const stringlist_type * config_content_iget_stringlist_ref(const config_content_type * content , const char * kw, int occurence); - config_content_node_type * config_content_get_value_node( const config_content_type * content , const char * kw); - void config_content_add_define( config_content_type * content , const char * key , const char * value ); - subst_list_type * config_content_get_define_list( config_content_type * content ); - const char * config_content_get_config_file( const config_content_type * content , bool abs_path ); - int config_content_get_size(const config_content_type * content); - const config_content_node_type * config_content_iget_node( const config_content_type * content , int index); - bool config_content_add_file( config_content_type * content , const char * config_file); - config_root_path_type * config_content_get_invoke_path( config_content_type * content ); - config_path_elm_type * config_content_add_path_elm( config_content_type * content , const char * path ); - void config_content_pop_path_stack( config_content_type * content ); - const stringlist_type * config_content_get_warnings( const config_content_type * content); - - UTIL_IS_INSTANCE_HEADER( config_content ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libconfig/include/ert/config/config_content_item.h b/ThirdParty/Ert/libconfig/include/ert/config/config_content_item.h deleted file mode 100644 index 40b843ff93..0000000000 --- a/ThirdParty/Ert/libconfig/include/ert/config/config_content_item.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'config_content_item.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#ifndef ERT_CONFIG_CONTENT_ITEM_H -#define ERT_CONFIG_CONTENT_ITEM_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -#include -#include -#include -#include - -typedef struct config_content_item_struct config_content_item_type; - - int config_content_item_get_size(const config_content_item_type * item); - config_content_node_type * config_content_item_get_last_node(const config_content_item_type * item); - config_content_node_type * config_content_item_iget_node(const config_content_item_type * item , int index); - const config_content_node_type * config_content_item_get_last_node_const(const config_content_item_type * item); - const config_content_node_type * config_content_item_iget_node_const(const config_content_item_type * item , int index); - char * config_content_item_ialloc_joined_string(const config_content_item_type * item , const char * sep , int occurence); - char * config_content_item_alloc_joined_string(const config_content_item_type * item , const char * sep); - const stringlist_type * config_content_item_iget_stringlist_ref(const config_content_item_type * item, int occurence); - const stringlist_type * config_content_item_get_stringlist_ref(const config_content_item_type * item); - stringlist_type * config_content_item_alloc_complete_stringlist(const config_content_item_type * item, bool copy); - stringlist_type * config_content_item_alloc_stringlist(const config_content_item_type * item, bool copy); - hash_type * config_content_item_alloc_hash(const config_content_item_type * item , bool copy); - const char * config_content_item_iget(const config_content_item_type * item , int occurence , int index); - bool config_content_item_iget_as_bool(const config_content_item_type * item, int occurence , int index); - int config_content_item_iget_as_int(const config_content_item_type * item, int occurence , int index); - double config_content_item_iget_as_double(const config_content_item_type * item, int occurence , int index); - void config_content_item_clear( config_content_item_type * item ); - void config_content_item_free( config_content_item_type * item ); - void config_content_item_free__( void * arg ); - config_content_item_type * config_content_item_alloc( const config_schema_item_type * schema , const config_path_elm_type * path_elm); - void config_content_item_validate(const config_content_item_type * item, config_error_type * error); - config_content_node_type * config_content_item_alloc_node( const config_content_item_type * item , const config_path_elm_type * path_elm); - const config_schema_item_type * config_content_item_get_schema( const config_content_item_type * item ); - const config_path_elm_type * config_content_item_get_path_elm( const config_content_item_type * item ); - - UTIL_IS_INSTANCE_HEADER( config_content_item ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libconfig/include/ert/config/config_content_node.h b/ThirdParty/Ert/libconfig/include/ert/config/config_content_node.h deleted file mode 100644 index 954777c430..0000000000 --- a/ThirdParty/Ert/libconfig/include/ert/config/config_content_node.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'config_content_node.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#ifndef ERT_CONFIG_CONTENT_NODE_H -#define ERT_CONFIG_CONTENT_NODE_H - -#ifdef __cplusplus -define extern "C" { -#endif - -#include - -#include -#include - -typedef struct config_content_node_struct config_content_node_type; - - config_item_types config_content_node_iget_type( const config_content_node_type * node , int index); - config_content_node_type * config_content_node_alloc( const config_schema_item_type * schema , const config_path_elm_type * cwd); - void config_content_node_add_value(config_content_node_type * node , const char * value); - void config_content_node_set(config_content_node_type * node , const stringlist_type * token_list); - char * config_content_node_alloc_joined_string(const config_content_node_type * node, const char * sep); - void config_content_node_free(config_content_node_type * node); - void config_content_node_free__(void * arg); - const char * config_content_node_get_full_string( config_content_node_type * node , const char * sep ); - const char * config_content_node_iget(const config_content_node_type * node , int index); - bool config_content_node_iget_as_bool(const config_content_node_type * node , int index); - int config_content_node_iget_as_int(const config_content_node_type * node , int index); - double config_content_node_iget_as_double(const config_content_node_type * node , int index); - const char * config_content_node_iget_as_path(config_content_node_type * node , int index); - const char * config_content_node_iget_as_abspath( config_content_node_type * node , int index); - const char * config_content_node_iget_as_relpath( config_content_node_type * node , int index); - time_t config_content_node_iget_as_isodate(const config_content_node_type * node , int index); - const stringlist_type * config_content_node_get_stringlist( const config_content_node_type * node ); - const char * config_content_node_safe_iget(const config_content_node_type * node , int index); - int config_content_node_get_size( const config_content_node_type * node ); - const char * config_content_node_get_kw( const config_content_node_type * node ); - void config_content_node_assert_key_value( const config_content_node_type * node ); - const config_path_elm_type * config_content_node_get_path_elm( const config_content_node_type * node ); - void config_content_node_init_opt_hash( const config_content_node_type * node , hash_type * opt_hash , int elm_offset); - void config_content_node_fprintf( const config_content_node_type * node , FILE * stream ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libconfig/include/ert/config/config_error.h b/ThirdParty/Ert/libconfig/include/ert/config/config_error.h deleted file mode 100644 index d634a2859d..0000000000 --- a/ThirdParty/Ert/libconfig/include/ert/config/config_error.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'config_error.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_CONFIG_ERROR_H -#define ERT_CONFIG_ERROR_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -typedef struct config_error_struct config_error_type; - - - config_error_type * config_error_alloc(); - config_error_type * config_error_alloc_copy( const config_error_type * src_error); - void config_error_free(config_error_type * error); - const char * config_error_iget(const config_error_type * error , int index); - void config_error_add( config_error_type * error , char * new_error ); - void config_error_clear( config_error_type * error ); - int config_error_count( const config_error_type * error ); - void config_error_fprintf( const config_error_type * error , bool add_count , FILE * stream ); - bool config_error_equal( const config_error_type * error1 , const config_error_type * error2); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libconfig/include/ert/config/config_parser.h b/ThirdParty/Ert/libconfig/include/ert/config/config_parser.h deleted file mode 100644 index 52f77bef65..0000000000 --- a/ThirdParty/Ert/libconfig/include/ert/config/config_parser.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'config.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_CONFIG_H -#define ERT_CONFIG_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include - -#define ECL_COM_KW "--" -#define ENKF_COM_KW "--" - - - - - -typedef struct config_parser_struct config_parser_type; - - - void config_free(config_parser_type *); - config_parser_type * config_alloc( ); - char ** config_alloc_active_list(const config_parser_type * , int * ); - config_content_type * config_parse(config_parser_type * config, const char * filename, const char * comment_string, const char * include_kw, const char * define_kw, const hash_type * pre_defined_kw_map, config_schema_unrecognized_enum unrecognized_behaviour , bool validate); - bool config_has_schema_item(const config_parser_type * config , const char * kw); - -/*****************************************************************/ - - config_schema_item_type * config_get_schema_item(const config_parser_type *, const char *); - bool config_item_set(const config_parser_type * , const char * ); - void config_add_alias(config_parser_type * , const char * , const char * ); - void config_install_message(config_parser_type * , const char * , const char * ); - const char * config_safe_get(const config_parser_type * , const char *); - char * config_alloc_joined_string(const config_parser_type * , const char * , const char * ); - - void config_add_define( config_parser_type * config , const char * key , const char * value ); - - /* - bool config_schema_item_is_set(const config_schema_item_type * ); - void config_schema_item_set_argc_minmax(config_schema_item_type * , int , int , int type_map_size , const config_item_types * ); - void config_schema_item_set_common_selection_set(config_schema_item_type * , int argc , const char ** argv); - void config_schema_item_set_indexed_selection_set(config_schema_item_type * item , int , int , const char ** ); - void config_schema_item_set_required_children(config_schema_item_type * , stringlist_type * ); - void config_schema_item_set_required_children_on_value(config_schema_item_type * , const char * , stringlist_type * ); - void config_schema_item_add_required_children(config_schema_item_type * item , const char * child_key); - */ - - config_schema_item_type * config_add_schema_item(config_parser_type * config, - const char * kw, - bool required); - - - stringlist_type * config_alloc_complete_stringlist(const config_parser_type * , const char * ); - stringlist_type * config_alloc_stringlist(const config_parser_type * config , const char * ); - hash_type * config_alloc_hash(const config_parser_type * , const char * ); - const stringlist_type * config_iget_stringlist_ref(const config_parser_type * , const char * , int ); - - int config_get_occurences(const config_parser_type * , const char * ); - int config_get_occurence_size( const config_parser_type * config , const char * kw , int occurence); - - bool config_has_content_item( const config_parser_type * config , const char * input_kw); - config_content_item_type * config_get_content_item( const config_parser_type * config , const char * input_kw); - config_schema_item_type * config_add_key_value( config_parser_type * config , const char * key , bool required , config_item_types item_type); -; - const char * config_get_value_as_relpath( const config_parser_type * config , const char * kw); - const char * config_get_value_as_path( const config_parser_type * config , const char * kw); - const char * config_get_value(const config_parser_type * config , const char * kw); - - const subst_list_type * config_get_define_list( const config_parser_type * config); - int config_get_schema_size( const config_parser_type * config ); - config_content_node_type * config_get_value_node( const config_parser_type * config , const char * kw); - void config_parser_deprecate(config_parser_type * config , const char * kw, const char * msg); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libconfig/include/ert/config/config_path_elm.h b/ThirdParty/Ert/libconfig/include/ert/config/config_path_elm.h deleted file mode 100644 index 7a50066d0a..0000000000 --- a/ThirdParty/Ert/libconfig/include/ert/config/config_path_elm.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'config_path_elm.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_CONFIG_PATH_ELM_H -#define ERT_CONFIG_PATH_ELM_H - -#ifdef __cplusplus -extern "C" -#endif - -#include - -typedef struct config_path_elm_struct config_path_elm_type; - -void config_path_elm_free( config_path_elm_type * path_elm ); -void config_path_elm_free__( void * arg ); -config_path_elm_type * config_path_elm_alloc( const config_root_path_type * root_path , const char * path); -const char * config_path_elm_get_abspath( const config_path_elm_type * path_elm ); -const char * config_path_elm_get_relpath( const config_path_elm_type * path_elm ); -const config_root_path_type * config_path_elm_get_rootpath( const config_path_elm_type * path_elm ); -char * config_path_elm_alloc_abspath(const config_path_elm_type * path_elm , const char * input_path); -char * config_path_elm_alloc_relpath(const config_path_elm_type * path_elm , const char * input_path); -char * config_path_elm_alloc_path(const config_path_elm_type * path_elm , const char * input_path); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libconfig/include/ert/config/config_root_path.h b/ThirdParty/Ert/libconfig/include/ert/config/config_root_path.h deleted file mode 100644 index 723b64ed25..0000000000 --- a/ThirdParty/Ert/libconfig/include/ert/config/config_root_path.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'config_root_path.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_CONFIG_ROOT_PATH_H -#define ERT_CONFIG_ROOT_PATH_H - -#ifdef __cplusplus -extern "C" -#endif - - -typedef struct config_root_path_struct config_root_path_type; - -void config_root_path_free( config_root_path_type * root_path ); -config_root_path_type * config_root_path_alloc( const char * input_path ); -void config_root_path_printf( const config_root_path_type * root_path ); -const char * config_root_path_get_input_path( const config_root_path_type * root_path ); -const char * config_root_path_get_rel_path( const config_root_path_type * root_path ); -const char * config_root_path_get_abs_path( const config_root_path_type * root_path ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libconfig/include/ert/config/config_schema_item.h b/ThirdParty/Ert/libconfig/include/ert/config/config_schema_item.h deleted file mode 100644 index 695f2cfef7..0000000000 --- a/ThirdParty/Ert/libconfig/include/ert/config/config_schema_item.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'config_schema_item.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#ifndef ERT_CONFIG_SCHEMA_ITEM_H -#define ERT_CONFIG_SCHEMA_ITEM_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include -#include - -/** - Types used for validation of config items. -*/ -typedef enum { - CONFIG_STRING = 1, - CONFIG_INT = 2, - CONFIG_FLOAT = 4, - CONFIG_PATH = 8, - CONFIG_EXISTING_PATH = 16, - CONFIG_BOOL = 32, - CONFIG_CONFIG = 64, - CONFIG_BYTESIZE = 128, - CONFIG_EXECUTABLE = 256, - CONFIG_ISODATE = 512, - CONFIG_INVALID = 1024 -} config_item_types; - - -typedef enum { - CONFIG_UNRECOGNIZED_IGNORE = 0, - CONFIG_UNRECOGNIZED_WARN = 1, - CONFIG_UNRECOGNIZED_ERROR = 2 -} config_schema_unrecognized_enum; - - - -#define CONFIG_DEFAULT_ARG_MIN -1 -#define CONFIG_DEFAULT_ARG_MAX -1 - - - - typedef struct config_schema_item_struct config_schema_item_type; - - - config_schema_item_type * config_schema_item_alloc(const char * kw , bool required); - bool config_schema_item_validate_set(const config_schema_item_type * item , - stringlist_type * token_list , - const char * config_file, - const config_path_elm_type * path_elm, - config_error_type * error_list); - - void config_schema_item_free( config_schema_item_type * item); - void config_schema_item_free__ (void * void_item); - - void config_schema_item_set_required_children_on_value(config_schema_item_type * item , const char * value , stringlist_type * child_list); - void config_schema_item_set_common_selection_set(config_schema_item_type * item , int argc , const char ** argv); - void config_schema_item_set_indexed_selection_set(config_schema_item_type * item , int index , int argc , const char ** argv); - void config_schema_item_add_indexed_alternative(config_schema_item_type * item , int index , const char * value); - void config_schema_item_set_required_children(config_schema_item_type * item , stringlist_type * stringlist); - void config_schema_item_add_required_children(config_schema_item_type * item , const char * child_key); - void config_schema_item_set_envvar_expansion( config_schema_item_type * item , bool expand_envvar ); - void config_schema_item_set_argc_minmax(config_schema_item_type * item , - int argc_min , - int argc_max); - void config_schema_item_assure_type(const config_schema_item_type * item , int index , int type_mask); - - int config_schema_item_num_required_children(const config_schema_item_type * item); - const char * config_schema_item_iget_required_child( const config_schema_item_type * item , int index); - const char * config_schema_item_get_kw( const config_schema_item_type * item ); - bool config_schema_item_required( const config_schema_item_type * item ); - bool config_schema_item_expand_envvar( const config_schema_item_type * item ); - void config_schema_item_get_argc( const config_schema_item_type * item , int *argc_min , int *argc_max); - bool config_schema_item_has_required_children_value( const config_schema_item_type * item ); - stringlist_type * config_schema_item_get_required_children_value(const config_schema_item_type * item , const char * value); - - void config_schema_item_iset_type( config_schema_item_type * item , int index , config_item_types type); - config_item_types config_schema_item_iget_type(const config_schema_item_type * item , int index ); - void config_schema_item_set_default_type( config_schema_item_type * item , config_item_types type); - bool config_schema_item_is_deprecated( const config_schema_item_type * item); - const char * config_schema_item_get_deprecate_msg( const config_schema_item_type * item); - void config_schema_item_set_deprecated( config_schema_item_type * item , const char * msg); - bool config_schema_item_valid_string(config_item_types value_type , const char * value); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libconfig/include/ert/config/config_settings.h b/ThirdParty/Ert/libconfig/include/ert/config/config_settings.h deleted file mode 100644 index cde4938332..0000000000 --- a/ThirdParty/Ert/libconfig/include/ert/config/config_settings.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - Copyright (C) 2017 Statoil ASA, Norway. - - The file 'config_settings.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_CONFIG_SETTINGS_H -#define ERT_CONFIG_SETTINGS_H - -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include - -#include -#include -#include - -typedef struct config_settings_struct config_settings_type; - -config_settings_type * config_settings_alloc( const char * root_key ); -void config_settings_free( config_settings_type * settings); -bool config_settings_has_key( const config_settings_type * settings , const char * key); -config_item_types config_settings_get_value_type( const config_settings_type * config_settings , const char * key); -bool config_settings_set_value( const config_settings_type * config_settings , const char * key, const char * value); -void config_settings_init_parser( const config_settings_type * config_settings, config_parser_type * config , bool required); -void config_settings_init_parser__( const char * root_key , config_parser_type * config , bool required); -void config_settings_apply(config_settings_type * config_settings , const config_content_type * config ); -stringlist_type * config_settings_alloc_keys( const config_settings_type * config_settings ); - -bool config_settings_add_setting(config_settings_type * settings , const char* key, config_item_types value_type , const char* initial_value); -void config_settings_add_int_setting(config_settings_type * settings , const char* key, int initial_value); -void config_settings_add_double_setting(config_settings_type * settings , const char* key, double initial_value); -void config_settings_add_string_setting(config_settings_type * settings , const char* key, const char * initial_value); -void config_settings_add_bool_setting(config_settings_type * settings , const char* key, bool initial_value); - - -const char * config_settings_get_value( const config_settings_type * config_settings , const char * key); -const char * config_settings_get_string_value( const config_settings_type * config_settings , const char * key); -int config_settings_get_int_value( const config_settings_type * config_settings , const char * key); -bool config_settings_get_bool_value( const config_settings_type * config_settings , const char * key); -double config_settings_get_double_value( const config_settings_type * config_settings , const char * key); - -bool config_settings_set_value( const config_settings_type * config_settings , const char * key, const char * value); -bool config_settings_set_int_value( const config_settings_type * config_settings , const char * key, int value); -bool config_settings_set_double_value( const config_settings_type * config_settings , const char * key, double value); -bool config_settings_set_bool_value( const config_settings_type * config_settings , const char * key, bool value); -bool config_settings_set_string_value( const config_settings_type * config_settings , const char * key, const char * value); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libconfig/src/CMakeLists.txt b/ThirdParty/Ert/libconfig/src/CMakeLists.txt deleted file mode 100644 index 8d60cec151..0000000000 --- a/ThirdParty/Ert/libconfig/src/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -set( source_files config_parser.c config_content.c config_error.c config_schema_item.c config_content_item.c config_content_node.c config_root_path.c config_path_elm.c conf.c conf_util.c conf_data.c config_settings.c) -set( header_files config_parser.h config_content.h config_error.h config_schema_item.h config_content_item.h config_content_node.h config_root_path.h config_path_elm.h conf.h conf_data.h config_settings.h) - -add_library( config ${LIBRARY_TYPE} ${source_files} ) -set_target_properties( config PROPERTIES VERSION ${ERT_VERSION_MAJOR}.${ERT_VERSION_MINOR} SOVERSION ${ERT_VERSION_MAJOR} ) - -target_link_libraries( config ert_util ) -if (USE_RUNPATH) - add_runpath( config ) -endif() - -if (INSTALL_ERT) - install(TARGETS config DESTINATION ${CMAKE_INSTALL_LIBDIR}) - foreach(header ${header_files}) - install(FILES ../include/ert/config/${header} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/ert/config) - endforeach() -endif() diff --git a/ThirdParty/Ert/libconfig/src/conf.c b/ThirdParty/Ert/libconfig/src/conf.c deleted file mode 100644 index 7ec931c97e..0000000000 --- a/ThirdParty/Ert/libconfig/src/conf.c +++ /dev/null @@ -1,1569 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'conf.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include -#include -#include - -#include -#include - - - -/** S T R U C T D E F I N I T I O N S */ - - - -struct conf_class_struct -{ - const conf_class_type * super_class; /** Can be NULL. */ - char * class_name; - char * help; /** Can be NULL if not given. */ - bool require_instance; - bool singleton; - - hash_type * sub_classes; /** conf_class_types */ - hash_type * item_specs; /** conf_item_spec_types */ - vector_type * item_mutexes; /** item_mutex_types */ -}; - - - -struct conf_instance_struct -{ - const conf_class_type * conf_class; - char * name; - - hash_type * sub_instances; /** conf_instance_types */ - hash_type * items; /** conf_item_types */ -}; - - - -struct conf_item_spec_struct -{ - const conf_class_type * super_class; /** NULL if not inserted into a class. */ - char * name; - bool required_set; /** Require the item to take a valid value. */ - char * default_value; /** Can be NULL if not given. */ - dt_enum dt; /** Data type. See conf_data.* */ - set_type * restriction; /** If non-empty, allowable values. */ - char * help; /** Can be NULL if not given. */ -}; - - - -struct conf_item_struct -{ - const conf_item_spec_type * conf_item_spec; - char * value; -}; - - - -struct conf_item_mutex_struct -{ - const conf_class_type * super_class; - bool require_one; - bool inverse; /* if inverse == true the 'mutex' implements: if A then ALSO B, C and D. */ - hash_type * item_spec_refs; -}; - - - -/** D E F A U L T A L L O C / F R E E F U N C T I O N S */ - - - -conf_class_type * conf_class_alloc_empty( - const char * class_name, - bool require_instance, - bool singleton, - const char * help) -{ - assert(class_name != NULL); - - conf_class_type * conf_class = util_malloc(sizeof *conf_class); - - conf_class->super_class = NULL; - conf_class->class_name = util_alloc_string_copy(class_name); - conf_class->help = NULL; - conf_class->require_instance = require_instance; - conf_class->singleton = singleton; - conf_class->sub_classes = hash_alloc(); - conf_class->item_specs = hash_alloc(); - conf_class->item_mutexes = vector_alloc_new(); - - - conf_class_set_help( conf_class , help ); - return conf_class; -} - - - -void conf_class_free( - conf_class_type * conf_class) -{ - free(conf_class->class_name); - util_safe_free(conf_class->help); - hash_free(conf_class->sub_classes); - hash_free(conf_class->item_specs); - vector_free(conf_class->item_mutexes); - free(conf_class); -} - - - -void conf_class_free__( - void * conf_class) -{ - conf_class_free( (conf_class_type *) conf_class); -} - - - -conf_instance_type * conf_instance_alloc_default( - const conf_class_type * conf_class, - const char * name) -{ - assert(conf_class != NULL); - assert(name != NULL); - - conf_instance_type * conf_instance = util_malloc(sizeof * conf_instance); - - conf_instance->conf_class = conf_class; - conf_instance->name = util_alloc_string_copy(name); - conf_instance->sub_instances = hash_alloc(); - conf_instance->items = hash_alloc(); - - { - /** Insert items that have a default value in their specs. */ - int num_item_specs = hash_get_size(conf_class->item_specs); - char ** item_spec_keys = hash_alloc_keylist(conf_class->item_specs); - - for(int item_spec_nr = 0; item_spec_nr < num_item_specs; item_spec_nr++) - { - const char * item_spec_name = item_spec_keys[item_spec_nr]; - const conf_item_spec_type * conf_item_spec = hash_get(conf_class->item_specs, item_spec_name); - if(conf_item_spec->default_value != NULL) - { - conf_item_type * conf_item = conf_item_alloc(conf_item_spec, conf_item_spec->default_value); - conf_instance_insert_owned_item(conf_instance, conf_item); - } - } - - util_free_stringlist(item_spec_keys, num_item_specs); - } - - return conf_instance; -} - - - -static -void conf_instance_copy_items( - conf_instance_type * conf_instance_target, - const conf_instance_type * conf_instance_source) -{ - int num_items = hash_get_size(conf_instance_source->items); - char ** item_keys = hash_alloc_keylist(conf_instance_source->items); - - for(int item_nr = 0; item_nr < num_items; item_nr++) - { - const char * item_name = item_keys[item_nr]; - const conf_item_type * conf_item = hash_get(conf_instance_source->items, item_name); - conf_item_type * conf_item_copy = conf_item_copyc(conf_item); - conf_instance_insert_owned_item(conf_instance_target, conf_item_copy); - } - - util_free_stringlist(item_keys, num_items); -} - - - -static -void conf_instance_copy_sub_instances( - conf_instance_type * conf_instance_target, - const conf_instance_type * conf_instance_source) -{ - int num_sub_instances = hash_get_size(conf_instance_source->sub_instances); - char ** sub_instance_keys = hash_alloc_keylist(conf_instance_source->sub_instances); - - for(int sub_nr = 0; sub_nr < num_sub_instances; sub_nr++) - { - const char * sub_name = sub_instance_keys[sub_nr]; - const conf_instance_type * sub_conf_instance = hash_get(conf_instance_source->sub_instances, sub_name); - conf_instance_type * sub_conf_instance_copy = conf_instance_copyc(sub_conf_instance); - conf_instance_insert_owned_sub_instance(conf_instance_target, sub_conf_instance_copy); - } - - util_free_stringlist(sub_instance_keys, num_sub_instances); -} - - - -conf_instance_type * conf_instance_copyc( - const conf_instance_type * conf_instance) -{ - conf_instance_type * conf_instance_copy = util_malloc(sizeof * conf_instance_copy); - - conf_instance_copy->conf_class = conf_instance->conf_class; - conf_instance_copy->name = util_alloc_string_copy(conf_instance->name); - conf_instance_copy->sub_instances = hash_alloc(); - conf_instance_copy->items = hash_alloc(); - - conf_instance_copy_items( conf_instance_copy, conf_instance); - conf_instance_copy_sub_instances(conf_instance_copy, conf_instance); - - return conf_instance_copy; -} - - - -void conf_instance_free( - conf_instance_type * conf_instance) -{ - free(conf_instance->name); - hash_free(conf_instance->sub_instances); - hash_free(conf_instance->items); - free(conf_instance); -} - - - -void conf_instance_free__( - void * conf_instance) -{ - conf_instance_free( (conf_instance_type *) conf_instance); -} - - - -conf_item_spec_type * conf_item_spec_alloc( - char * name, - bool required_set, - dt_enum dt, - const char * help) -{ - assert(name != NULL); - - conf_item_spec_type * conf_item_spec = util_malloc(sizeof * conf_item_spec); - - conf_item_spec->super_class = NULL; - conf_item_spec->name = util_alloc_string_copy(name); - conf_item_spec->required_set = required_set; - conf_item_spec->dt = dt; - conf_item_spec->default_value = NULL; - conf_item_spec->restriction = set_alloc_empty(); - conf_item_spec->help = NULL; - conf_item_spec_set_help( conf_item_spec , help ); - return conf_item_spec; -} - - - -void conf_item_spec_free( - conf_item_spec_type * conf_item_spec) -{ - free(conf_item_spec->name); - util_safe_free(conf_item_spec->default_value); - util_safe_free(conf_item_spec->help); - set_free(conf_item_spec->restriction); - free(conf_item_spec); -} - - - -void conf_item_spec_free__( - void * conf_item_spec) -{ - conf_item_spec_free( (conf_item_spec_type *) conf_item_spec); -} - - - -conf_item_type * conf_item_alloc( - const conf_item_spec_type * conf_item_spec, - const char * value) -{ - conf_item_type * conf_item = util_malloc(sizeof * conf_item); - - assert(conf_item_spec != NULL); - assert(value != NULL); - - conf_item->conf_item_spec = conf_item_spec; - conf_item->value = util_alloc_string_copy(value); - - return conf_item; -} - - - -conf_item_type * conf_item_copyc( - const conf_item_type * conf_item) -{ - return conf_item_alloc(conf_item->conf_item_spec, conf_item->value); -} - - - -void conf_item_free( - conf_item_type * conf_item) -{ - free(conf_item->value); - free(conf_item); -} - - - -void conf_item_free__( - void * conf_item) -{ - conf_item_free( (conf_item_type *) conf_item); -} - - - -static -conf_item_mutex_type * conf_item_mutex_alloc( - const conf_class_type * super_class, - bool require_one, - bool inverse) -{ - conf_item_mutex_type * conf_item_mutex = util_malloc(sizeof * conf_item_mutex); - - conf_item_mutex->super_class = super_class; - conf_item_mutex->require_one = require_one; - conf_item_mutex->inverse = inverse; - conf_item_mutex->item_spec_refs = hash_alloc(); - - return conf_item_mutex; -} - - - -void conf_item_mutex_free( - conf_item_mutex_type * conf_item_mutex) -{ - hash_free(conf_item_mutex->item_spec_refs); - free(conf_item_mutex); -} - - - -void conf_item_mutex_free__( - void * conf_item_mutex) -{ - conf_item_mutex_free( (conf_item_mutex_type *) conf_item_mutex); -} - - - - - - -/** M A N I P U L A T O R S , I N S E R T I O N */ - - - -static -bool conf_class_has_super_class( - const conf_class_type * conf_class, - const conf_class_type * super_class) -{ - assert(conf_class != NULL); - assert(super_class != NULL); - - const conf_class_type * parent = conf_class->super_class; - - while(parent != NULL) - { - if(parent == super_class) - return true; - else - parent = parent->super_class; - } - return false; -} - - - -void conf_class_insert_owned_sub_class( - conf_class_type * conf_class, - conf_class_type * sub_conf_class) -{ - assert(conf_class != NULL); - assert(sub_conf_class != NULL); - - /** Abort if conf_class already has an item with the same name. */ - if(hash_has_key(conf_class->item_specs, sub_conf_class->class_name)) - util_abort("%s: Internal error. conf class already has an item with name \"%s\".\n", - __func__, sub_conf_class->class_name); - - /** Abort if sub_conf_class is equal to conf_class. */ - if(sub_conf_class == conf_class) - util_abort("%s: Internal error. Trying to make a class it's own super class.\n", __func__); - - /** Abort if sub_conf_class is a super class to conf_class. */ - if(conf_class_has_super_class(conf_class, sub_conf_class)) - util_abort("%s: Internal error. Trying to make a class it's own super class .\n", __func__); - - /** Abort if sub_conf_class already has a super class. */ - if(sub_conf_class->super_class != NULL) - util_abort("%s: Internal error. Inserted class already has a super class.\n", __func__); - - hash_insert_hash_owned_ref(conf_class->sub_classes, sub_conf_class->class_name, - sub_conf_class, conf_class_free__); - - sub_conf_class->super_class = conf_class; -} - - - -void conf_class_insert_owned_item_spec( - conf_class_type * conf_class, - conf_item_spec_type * item_spec) -{ - assert(conf_class != NULL); - assert(item_spec != NULL); - - - /** Abort if item_spec already has a super class. */ - if(item_spec->super_class != NULL) - util_abort("%s: Internal error: item is already assigned to another class.\n", __func__); - - - /** Abort if the class has a sub class with the same name.. */ - if(hash_has_key(conf_class->sub_classes, item_spec->name)) - util_abort("%s: Internal error. conf class already has a sub class with name \"%s\".\n", __func__, item_spec->name); - - - hash_insert_hash_owned_ref(conf_class->item_specs, item_spec->name, - item_spec, conf_item_spec_free__); - - item_spec->super_class = conf_class; -} - - - -conf_item_mutex_type * conf_class_new_item_mutex(conf_class_type * conf_class , bool require_one , bool inverse) -{ - assert(conf_class != NULL); - conf_item_mutex_type * mutex = conf_item_mutex_alloc( conf_class , require_one , inverse); - vector_append_owned_ref(conf_class->item_mutexes, mutex, conf_item_mutex_free__); - return mutex; -} - - - -void conf_instance_insert_owned_sub_instance( - conf_instance_type * conf_instance, - conf_instance_type * sub_conf_instance) -{ - assert(conf_instance != NULL); - assert(sub_conf_instance != NULL); - - /** Abort if the instance is of unknown type. */ - if(sub_conf_instance->conf_class->super_class != conf_instance->conf_class) - util_abort("%s: Internal error. Trying to insert instance of unknown type.\n", __func__); - - - /** Check if the instance's class is singleton. If so, remove the old instance. */ - if(sub_conf_instance->conf_class->singleton) - { - stringlist_type * instances = conf_instance_alloc_list_of_sub_instances_of_class(conf_instance, - sub_conf_instance->conf_class); - int num_instances = stringlist_get_size(instances); - - for(int i = 0; i < num_instances; i++) - { - const char * key = stringlist_iget(instances, i); - printf("WARNING: Class \"%s\" is of singleton type. Overwriting instance \"%s\" with \"%s\".\n", - sub_conf_instance->conf_class->class_name, key, sub_conf_instance->name); - hash_del(conf_instance->sub_instances, key); - } - - stringlist_free(instances); - } - - - /** Warn if the sub_instance already exists and is overwritten. */ - if(hash_has_key(conf_instance->sub_instances, sub_conf_instance->name)) - { - printf("WARNING: Overwriting instance \"%s\" of class \"%s\" in instance \"%s\" of class \"%s\"\n", - sub_conf_instance->name, conf_instance_get_class_name_ref(sub_conf_instance), - conf_instance->name, conf_instance_get_class_name_ref(conf_instance)); - } - - hash_insert_hash_owned_ref(conf_instance->sub_instances, - sub_conf_instance->name, - sub_conf_instance, - conf_instance_free__); -} - - - -void conf_instance_insert_owned_item( - conf_instance_type * conf_instance, - conf_item_type * conf_item) -{ - assert(conf_instance != NULL); - assert(conf_item != NULL); - - const char * item_name = conf_item->conf_item_spec->name; - - /** Check that the inserted item is of known type. */ - { - const hash_type * item_spec_hash = conf_instance->conf_class->item_specs; - const conf_item_spec_type * conf_item_spec = hash_get(item_spec_hash, item_name); - if(conf_item_spec != conf_item->conf_item_spec) - util_abort("%s: Internal error.\n", __func__); - } - - hash_insert_hash_owned_ref(conf_instance->items, item_name, conf_item, conf_item_free__); -} - - - -void conf_instance_insert_item( - conf_instance_type * conf_instance, - const char * item_name, - const char * value) -{ - assert(conf_instance != NULL); - assert(item_name != NULL); - assert(value != NULL); - - conf_item_type * conf_item; - const conf_class_type * conf_class = conf_instance->conf_class; - const conf_item_spec_type * conf_item_spec; - - if(!conf_class_has_item_spec(conf_class, item_name)) - util_abort("%s: Internal error. Unkown item \"%s\" in class \"%s\".\n", - __func__, item_name, conf_instance->conf_class->class_name); - - conf_item_spec = conf_class_get_item_spec_ref(conf_class, item_name); - - conf_item = conf_item_alloc(conf_item_spec, value); - conf_instance_insert_owned_item(conf_instance, conf_item); -} - - - -void conf_instance_overload( - conf_instance_type * conf_instance_target, - const conf_instance_type * conf_instance_source) -{ - assert(conf_instance_target != NULL); - assert(conf_instance_source != NULL); - - if(conf_instance_target->conf_class != conf_instance_source->conf_class) - util_abort("%s: Internal error. Invalid overloading.\n", __func__); - - conf_instance_copy_items( conf_instance_target, conf_instance_source); - conf_instance_copy_sub_instances(conf_instance_target, conf_instance_source); -} - - - -void conf_item_mutex_add_item_spec( - conf_item_mutex_type * conf_item_mutex, - const conf_item_spec_type * conf_item_spec) -{ - - if(conf_item_mutex->super_class != NULL) - { - const conf_class_type * conf_class = conf_item_mutex->super_class; - const char * item_key = conf_item_spec->name; - - if(!hash_has_key(conf_class->item_specs, item_key)) - { - util_abort("%s: Internal error. Trying to insert a mutex on item \"%s\", which class \"%s\" does not have.\n", - __func__, item_key, conf_class->class_name); - } - else - { - const conf_item_spec_type * conf_item_spec_class = hash_get(conf_class->item_specs, item_key); - if(conf_item_spec_class != conf_item_spec) - { - util_abort("Internal error. Trying to insert a mutex on item \"%s\", which class \"%s\" has a different implementation of.\n", - __func__, item_key, conf_class->class_name); - } - } - } - - if(conf_item_mutex->require_one && conf_item_spec->required_set) - util_abort("%s: Trying to add item \"%s\" to a mutex, but it is required set!\n", - __func__, conf_item_spec->name); - - hash_insert_ref(conf_item_mutex->item_spec_refs, conf_item_spec->name, conf_item_spec); -} - - - -/** M A N I P U L A T O R S , C L A S S A N D I T E M S P E C I F I C A T I O N */ - - - -void conf_class_set_help( - conf_class_type * conf_class, - const char * help) -{ - conf_class->help = util_realloc_string_copy(conf_class->help , help); -} - - - -void conf_item_spec_add_restriction( - conf_item_spec_type * conf_item_spec, - const char * restriction) -{ - set_add_key(conf_item_spec->restriction, restriction); -} - - - -void conf_item_spec_set_default_value( - conf_item_spec_type * conf_item_spec, - const char * default_value) -{ - if(conf_item_spec->default_value != NULL) - free(conf_item_spec->default_value); - if(default_value != NULL) - conf_item_spec->default_value = util_alloc_string_copy(default_value); - else - conf_item_spec->default_value = NULL; -} - - - -void conf_item_spec_set_help( - conf_item_spec_type * conf_item_spec, - const char * help) -{ - conf_item_spec->help = util_realloc_string_copy( conf_item_spec->help , help); -} - - - - -/** A C C E S S O R S */ - - - -bool conf_class_has_item_spec( - const conf_class_type * conf_class, - const char * item_name) -{ - if(!hash_has_key(conf_class->item_specs, item_name)) - return false; - else - return true; -} - - - -bool conf_class_has_sub_class( - const conf_class_type * conf_class, - const char * sub_class_name) -{ - if(!hash_has_key(conf_class->sub_classes, sub_class_name)) - return false; - else - return true; -} - - - -const conf_item_spec_type * conf_class_get_item_spec_ref( - const conf_class_type * conf_class, - const char * item_name) -{ - if(!hash_has_key(conf_class->item_specs, item_name)) - util_abort("%s: Internal error.\n", __func__); - - return hash_get(conf_class->item_specs, item_name); -} - - - -const conf_class_type * conf_class_get_sub_class_ref( - const conf_class_type * conf_class, - const char * sub_class_name) -{ - if(!hash_has_key(conf_class->sub_classes, sub_class_name)) - util_abort("%s: Internal error.\n", __func__); - - return hash_get(conf_class->sub_classes, sub_class_name); -} - - - -const char * conf_instance_get_name_ref( - const conf_instance_type * conf_instance) -{ - return conf_instance->name; -} - - - -bool conf_instance_is_of_class( - const conf_instance_type * conf_instance, - const char * class_name) -{ - if(strcmp(conf_instance->conf_class->class_name, class_name) == 0) - return true; - else - return false; -} - - - -bool conf_instance_has_item( - const conf_instance_type * conf_instance, - const char * item_name) -{ - if(!hash_has_key(conf_instance->items, item_name)) - return false; - else - return true; -} - - - -bool conf_instance_has_sub_instance( - const conf_instance_type * conf_instance, - const char * sub_instance_name) -{ - if(!hash_has_key(conf_instance->sub_instances, sub_instance_name)) - return false; - else - return true; -} - - - -const conf_instance_type * conf_instance_get_sub_instance_ref( - const conf_instance_type * conf_instance, - const char * sub_instance_name) -{ - if(!hash_has_key(conf_instance->sub_instances, sub_instance_name)) - { - util_abort("%s: Instance %s of type %s has no sub instance named %s.\n", - __func__, conf_instance->name, - conf_instance->conf_class->class_name, - sub_instance_name); - } - return hash_get(conf_instance->sub_instances, sub_instance_name); -} - - - -stringlist_type * conf_instance_alloc_list_of_sub_instances_of_class( - const conf_instance_type * conf_instance, - const conf_class_type * conf_class) -{ - stringlist_type * instances = stringlist_alloc_new(); - int num_sub_instances = hash_get_size(conf_instance->sub_instances); - char ** sub_instance_keys = hash_alloc_keylist(conf_instance->sub_instances); - - for(int key_nr = 0; key_nr < num_sub_instances; key_nr++) - { - const conf_instance_type * sub_instance = hash_get(conf_instance->sub_instances, - sub_instance_keys[key_nr]); - - const conf_class_type * sub_instance_class = sub_instance->conf_class; - - if(sub_instance_class == conf_class) - stringlist_append_copy(instances, sub_instance_keys[key_nr]); - } - - util_free_stringlist(sub_instance_keys, num_sub_instances); - - return instances; -} - - - -stringlist_type * conf_instance_alloc_list_of_sub_instances_of_class_by_name( - const conf_instance_type * conf_instance, - const char * sub_class_name) -{ - if(!conf_class_has_sub_class(conf_instance->conf_class, sub_class_name)) - util_abort("%s: Instance \"%s\" is of class \"%s\" which has no sub class with name \"%s\"\n", - conf_instance->name, conf_instance->conf_class->class_name, sub_class_name); - - const conf_class_type * conf_class = conf_class_get_sub_class_ref(conf_instance->conf_class, sub_class_name); - - return conf_instance_alloc_list_of_sub_instances_of_class(conf_instance, conf_class); -} - - - -const conf_class_type * conf_instance_get_class_ref( - const conf_instance_type * conf_instance) -{ - return conf_instance->conf_class; -} - - - -const char * conf_instance_get_class_name_ref( - const conf_instance_type * conf_instance) -{ - return conf_instance->conf_class->class_name; -} - - - -const char * conf_instance_get_item_value_ref( - const conf_instance_type * conf_instance, - const char * item_name) -{ - if(!hash_has_key(conf_instance->items, item_name)) - { - util_abort("%s: Instance %s of type %s has no item %s.\n", - __func__, conf_instance->name, - conf_instance->conf_class->class_name, - item_name); - } - const conf_item_type * conf_item = hash_get(conf_instance->items, item_name); - return conf_item->value; -} - - - -/** If the dt supports it, this function shall return the item value as an int. - If the dt does not support it, the function will abort. -*/ -int conf_instance_get_item_value_int( - const conf_instance_type * conf_instance, - const char * item_name) -{ - if(!hash_has_key(conf_instance->items, item_name)) - util_abort("%s: Instance %s of type %s has no item %s.\n", - __func__, conf_instance->name, - conf_instance->conf_class->class_name, - item_name); - - const conf_item_type * conf_item = hash_get(conf_instance->items, item_name); - const conf_item_spec_type * conf_item_spec = conf_item->conf_item_spec; - - return conf_data_get_int_from_string(conf_item_spec->dt, conf_item->value); -} - - - -/** If the dt supports it, this function shall return the item value as a double. - If the dt does not support it, the function will abort. -*/ -double conf_instance_get_item_value_double( - const conf_instance_type * conf_instance, - const char * item_name) -{ - if(!hash_has_key(conf_instance->items, item_name)) - util_abort("%s: Instance %s of type %s has no item %s.\n", - __func__, conf_instance->name, - conf_instance->conf_class->class_name, - item_name); - - const conf_item_type * conf_item = hash_get(conf_instance->items, item_name); - const conf_item_spec_type * conf_item_spec = conf_item->conf_item_spec; - - return conf_data_get_double_from_string(conf_item_spec->dt, conf_item->value); -} - - - -/** If the dt supports it, this function shall return the item value as a time_t. - If the dt does not support it, the function will abort. -*/ -time_t conf_instance_get_item_value_time_t( - const conf_instance_type * conf_instance, - const char * item_name) -{ - if(!hash_has_key(conf_instance->items, item_name)) - util_abort("%s: Instance %s of type %s has no item %s.\n", - __func__, conf_instance->name, - conf_instance->conf_class->class_name, - item_name); - - const conf_item_type * conf_item = hash_get(conf_instance->items, item_name); - const conf_item_spec_type * conf_item_spec = conf_item->conf_item_spec; - - return conf_data_get_time_t_from_string(conf_item_spec->dt, conf_item->value); -} - - - - - -/** V A L I D A T O R S */ - - - -static -void conf_item_spec_printf_help( - const conf_item_spec_type * conf_item_spec) -{ - assert(conf_item_spec->super_class != NULL); - int num_restrictions = set_get_size(conf_item_spec->restriction); - - printf("\n Help on item \"%s\" in class \"%s\":\n\n", - conf_item_spec->name, conf_item_spec->super_class->class_name); - printf(" - Data type : %s\n\n", conf_data_get_dt_name_ref(conf_item_spec->dt)); - if(conf_item_spec->default_value != NULL) - printf(" - Default value: %s\n\n", conf_item_spec->default_value); - if(conf_item_spec->help != NULL) - printf(" - %s\n", conf_item_spec->help); - - if(num_restrictions > 0) - { - printf("\n The item \"%s\" is restricted to the following values:\n\n", - conf_item_spec->name); - char ** restriction_keys = set_alloc_keylist(conf_item_spec->restriction); - - for(int key_nr = 0; key_nr < num_restrictions; key_nr++) - { - printf(" %i. %s\n", key_nr + 1, restriction_keys[key_nr]); - } - - util_free_stringlist(restriction_keys, num_restrictions); - } - printf("\n"); -} - - - -static -void conf_class_printf_help( - const conf_class_type * conf_class) -{ - /** TODO Should print info on the required sub classes and items. */ - - if(conf_class->help != NULL) - { - if(conf_class->super_class != NULL) - printf("\n Help on class \"%s\" with super class \"%s\":\n\n", - conf_class->class_name, conf_class->super_class->class_name); - else - printf("\n Help on class \"%s\":\n\n", - conf_class->class_name); - - printf(" %s\n", conf_class->help); - } - printf("\n"); -} - - - -static -bool conf_item_validate( - const conf_item_type * conf_item) -{ - assert(conf_item != NULL); - - bool ok = true; - const conf_item_spec_type * conf_item_spec = conf_item->conf_item_spec; - int num_restrictions = set_get_size(conf_item_spec->restriction); - - if(!conf_data_validate_string_as_dt_value(conf_item_spec->dt, conf_item->value)) - { - ok = false; - printf("ERROR: Failed to validate \"%s\" as a %s for item \"%s\".\n", - conf_item->value, conf_data_get_dt_name_ref(conf_item_spec->dt), - conf_item_spec->name); - } - - if(num_restrictions > 0 && ok) - { - char ** restriction_keys = set_alloc_keylist(conf_item_spec->restriction); - - /** Legacy work-around when removing the vector supprt. */ - const int num_tokens = 1; - const char ** tokens = (const char **) &conf_item->value; - - for(int token_nr = 0; token_nr < num_tokens; token_nr++) - { - bool valid = false; - - for(int key_nr = 0; key_nr < num_restrictions; key_nr++) - { - if(strcmp(tokens[token_nr], restriction_keys[key_nr]) == 0) - valid = true; - } - - if(valid == false) - { - ok = false; - printf("ERROR: Failed to validate \"%s\" as a valid value for item \"%s\".\n", - conf_item->value, conf_item_spec->name); - } - } - util_free_stringlist(restriction_keys, num_restrictions); - } - - if(!ok) - conf_item_spec_printf_help(conf_item_spec); - - - return ok; -} - - - -static -bool conf_instance_has_required_items( - const conf_instance_type * conf_instance) -{ - bool ok = true; - const conf_class_type * conf_class = conf_instance->conf_class; - - int num_item_specs = hash_get_size(conf_class->item_specs); - char ** item_spec_keys = hash_alloc_keylist(conf_class->item_specs); - - for(int item_spec_nr = 0; item_spec_nr < num_item_specs; item_spec_nr++) - { - const char * item_spec_name = item_spec_keys[item_spec_nr]; - const conf_item_spec_type * conf_item_spec = hash_get(conf_class->item_specs, item_spec_name); - if(conf_item_spec->required_set) - { - if(!hash_has_key(conf_instance->items, item_spec_name)) - { - ok = false; - printf("ERROR: Missing item \"%s\" in instance \"%s\" of class \"%s\"\n", - item_spec_name, conf_instance->name, conf_instance->conf_class->class_name); - conf_item_spec_printf_help(conf_item_spec); - } - } - } - - util_free_stringlist(item_spec_keys, num_item_specs); - - return ok; -} - - - -static -bool conf_instance_has_valid_items( - const conf_instance_type * conf_instance) -{ - bool ok = true; - - int num_items = hash_get_size(conf_instance->items); - char ** item_keys = hash_alloc_keylist(conf_instance->items); - - for(int item_nr = 0; item_nr < num_items; item_nr++) - { - const conf_item_type * conf_item = hash_get(conf_instance->items, item_keys[item_nr]); - if(!conf_item_validate(conf_item)) - ok = false; - } - - util_free_stringlist(item_keys, num_items); - - return ok; -} - - -static -bool conf_instance_check_item_mutex( - const conf_instance_type * conf_instance, - const conf_item_mutex_type * conf_item_mutex) -{ - bool ok = true; - int num_items_set = 0; - set_type * items_set = set_alloc_empty(); - int num_items = hash_get_size(conf_item_mutex->item_spec_refs); - char ** item_keys = hash_alloc_keylist(conf_item_mutex->item_spec_refs); - - for(int item_nr = 0; item_nr < num_items; item_nr++) - { - const char * item_key = item_keys[item_nr]; - if(conf_instance_has_item(conf_instance, item_key)) - { - set_add_key(items_set, item_key); - } - } - - num_items_set = set_get_size(items_set); - - if (conf_item_mutex->inverse) - { - /** This is an inverse mutex - all (or none) items should be set. */ - if (!((num_items_set == 0) || (num_items_set == num_items))) - { - ok = false; - char ** items_set_keys = set_alloc_keylist(items_set); - printf("ERROR: Failed to validate mutal inclusion in instance \"%s\" of class \"%s\".\n\n", - conf_instance->name, conf_instance->conf_class->class_name); - printf(" When using one or more of the following items, all must be set:\n"); - for(int item_nr = 0; item_nr < num_items; item_nr++) - printf(" %i : %s\n", item_nr, item_keys[item_nr]); - printf("\n"); - printf(" However, only the following items were set:\n"); - for(int item_nr = 0; item_nr < num_items_set; item_nr++) - printf(" %i : %s\n", item_nr, items_set_keys[item_nr]); - printf("\n"); - - util_free_stringlist(items_set_keys, num_items_set); - } - } - else - { - if(num_items_set > 1) - { - ok = false; - char ** items_set_keys = set_alloc_keylist(items_set); - - printf("ERROR: Failed to validate mutex in instance \"%s\" of class \"%s\".\n\n", - conf_instance->name, conf_instance->conf_class->class_name); - printf(" Only one of the following items may be set:\n"); - for(int item_nr = 0; item_nr < num_items; item_nr++) - printf(" %i : %s\n", item_nr, item_keys[item_nr]); - - printf("\n"); - printf(" However, all the following items were set:\n"); - for(int item_nr = 0; item_nr < num_items_set; item_nr++) - printf(" %i : %s\n", item_nr, items_set_keys[item_nr]); - printf("\n"); - - util_free_stringlist(items_set_keys, num_items_set); - } - } - - if(num_items_set == 0 && conf_item_mutex->require_one && num_items > 0) - { - ok = false; - printf("ERROR: Failed to validate mutex in instance \"%s\" of class \"%s\".\n\n", - conf_instance->name, conf_instance->conf_class->class_name); - printf(" One of the following items MUST be set:\n"); - for(int item_nr = 0; item_nr < num_items; item_nr++) - printf(" %i : %s\n", item_nr, item_keys[item_nr]); - printf("\n"); - } - - util_free_stringlist(item_keys, num_items); - set_free(items_set); - - return ok; -} - - - -static -bool conf_instance_has_valid_mutexes( - const conf_instance_type * conf_instance) -{ - bool ok = true; - const conf_class_type * conf_class = conf_instance->conf_class; - const vector_type * item_mutexes = conf_class->item_mutexes; - int num_mutexes = vector_get_size(item_mutexes); - - for(int mutex_nr = 0; mutex_nr < num_mutexes; mutex_nr++) - { - const conf_item_mutex_type * conf_item_mutex = vector_iget( item_mutexes, mutex_nr ); - if(!conf_instance_check_item_mutex(conf_instance, conf_item_mutex)) - ok = false; - } - - return ok; -} - -static bool __instance_has_sub_instance_of_type( - const conf_class_type * __conf_class, int num_sub_instances, conf_class_type ** class_signatures) -{ - for(int sub_instance_nr = 0; sub_instance_nr < num_sub_instances; sub_instance_nr++) - { - if(class_signatures[sub_instance_nr] == __conf_class) - return true; - } - return false; -} - -static -bool conf_instance_has_required_sub_instances( - const conf_instance_type * conf_instance) -{ - /** U G L Y B U G L Y U G L Y B U G LY U G L Y B U G LY U G L Y B U G LY */ - /** This function is really ugly. It could be smoother if set_type supported size_t's. */ - /** U G L Y B U G L Y U G L Y B U G LY U G L Y B U G LY U G L Y B U G LY */ - - bool ok = true; - - - /** This first part is just concerned with creating the function __instance_has_sub_instance_of_type. */ - int num_sub_instances = hash_get_size(conf_instance->sub_instances); - conf_class_type ** class_signatures = util_calloc(num_sub_instances , sizeof * class_signatures); - { - char ** sub_instance_keys = hash_alloc_keylist(conf_instance->sub_instances); - for(int sub_instance_nr = 0; sub_instance_nr < num_sub_instances; sub_instance_nr++) - { - const char * sub_instance_name = sub_instance_keys[sub_instance_nr]; - const conf_instance_type * sub_conf_instance = hash_get(conf_instance->sub_instances, sub_instance_name); - class_signatures[sub_instance_nr] = (conf_class_type *) sub_conf_instance->conf_class; - } - util_free_stringlist(sub_instance_keys, num_sub_instances); - } - - - - - - - /** OK, we now check that the sub classes that have require_instance true have at least one instance. */ - { - const conf_class_type * conf_class = conf_instance->conf_class; - int num_sub_classes = hash_get_size(conf_class->sub_classes); - char ** sub_class_keys = hash_alloc_keylist(conf_class->sub_classes); - - for(int sub_class_nr = 0; sub_class_nr < num_sub_classes; sub_class_nr ++) - { - const char * sub_class_name = sub_class_keys[sub_class_nr]; - const conf_class_type * sub_conf_class = hash_get(conf_class->sub_classes, sub_class_name); - if(sub_conf_class->require_instance) - { - if(!__instance_has_sub_instance_of_type(sub_conf_class, num_sub_instances, class_signatures)) - { - printf("ERROR: Missing required instance of sub class \"%s\" in instance \"%s\" of class \"%s\".\n", - sub_conf_class->class_name, conf_instance->name, conf_instance->conf_class->class_name); - conf_class_printf_help(sub_conf_class); - ok = false; - } - } - } - - util_free_stringlist(sub_class_keys, num_sub_classes); - } - - free(class_signatures); - - return ok; -} - - - -static -bool conf_instance_validate_sub_instances( - const conf_instance_type * conf_instance) -{ - bool ok = true; - - int num_sub_instances = hash_get_size(conf_instance->sub_instances); - char ** sub_instance_keys = hash_alloc_keylist(conf_instance->sub_instances); - - for(int sub_instance_nr = 0; sub_instance_nr < num_sub_instances; sub_instance_nr++) - { - const char * sub_instances_key = sub_instance_keys[sub_instance_nr]; - const conf_instance_type * sub_conf_instance = hash_get(conf_instance->sub_instances, sub_instances_key); - if(!conf_instance_validate(sub_conf_instance)) - ok = false; - } - - util_free_stringlist(sub_instance_keys, num_sub_instances); - - return ok; -} - - - -bool conf_instance_validate( - const conf_instance_type * conf_instance) -{ - bool ok = true; - - if(conf_instance == NULL) - { - printf("%s: Trying to dereference NULL pointer.\n", __func__); - return false; - } - - if(!conf_instance_has_required_items(conf_instance)) - ok = false; - - if(!conf_instance_has_valid_mutexes(conf_instance)) - ok = false; - - if(!conf_instance_has_valid_items(conf_instance)) - ok = false; - - if(!conf_instance_has_required_sub_instances(conf_instance)) - ok = false; - - if(!conf_instance_validate_sub_instances(conf_instance)) - ok = false; - - return ok; -} - - - -/** A L L O C F R O M F I L E */ - - - -static -void conf_instance_parser_add_item( - conf_instance_type * conf_instance, - const char * item_name, - char ** buffer_pos) -{ - char * token_assign; - char * token_value; - char * token_end; - - char * buffer_pos_loc = *buffer_pos; - - token_assign = conf_util_alloc_next_token(&buffer_pos_loc); - if(token_assign == NULL) - { - /** This will fail. Give up. */ - printf("WARNING: Unexpected EOF after \"%s\". Giving up on this item.\n\n", item_name); - return; - } - else if(strcmp(token_assign, "=") != 0) - { - /** This will fail. Give up. */ - printf("WARNING: Unexpected \"%s\" after \"%s\". Giving up on this item.\n\n", token_assign, item_name); - free(token_assign); - *buffer_pos = buffer_pos_loc; - return; - } - - token_value = conf_util_alloc_next_token(&buffer_pos_loc); - if(token_value == NULL) - { - /** This will fail. Give up. */ - printf("WARNING: Unexpected EOF after \"%s = \". Giving up on this item.\n\n", item_name); - free(token_assign); - return; - } - else - conf_instance_insert_item(conf_instance, item_name, token_value); - - *buffer_pos = buffer_pos_loc; - - token_end = conf_util_alloc_next_token(&buffer_pos_loc); - if(token_end == NULL) - { - /** We've already alloc'd the token. Print a warning to the user. */ - printf("WARNING: Unexpected EOF after \"%s = %s \".\n\n", item_name, token_value); - free(token_assign); - free(token_value); - return; - } - else if(strcmp(token_end, ";") != 0) - { - printf("WARNING: Unexpected \"%s\" after \"%s = %s \". Probably a missing \";\".\n\n", - token_end, item_name, token_value); - } - else - { - *buffer_pos = buffer_pos_loc; - } - - free(token_assign); - free(token_value); - free(token_end); -} - - - -static -void conf_instance_parser_skip_unknown_class( - char ** buffer_pos) -{ - int depth_in_unkown_class = 1; - char * token = conf_util_alloc_next_token(buffer_pos); - - while(token != NULL) - { - if(strcmp(token, "{") == 0) - depth_in_unkown_class++; - else if(strcmp(token, "}") == 0) - depth_in_unkown_class--; - - printf("WARNING: Skipping token \"%s\" in unknown class.\n", token); - free(token); - if(depth_in_unkown_class == 0) - break; - else - token = conf_util_alloc_next_token(buffer_pos); - } -} - - - -static -void conf_instance_add_data_from_token_buffer( - conf_instance_type * conf_instance, - char ** buffer_pos, - bool allow_inclusion, - bool is_root) -{ - const conf_class_type * conf_class = conf_instance->conf_class; - char * token = conf_util_alloc_next_token(buffer_pos); - - bool scope_start_set = false; - bool scope_end_set = false; - - while(token != NULL) - { - if(conf_class_has_item_spec(conf_class, token) && (scope_start_set || is_root)) - conf_instance_parser_add_item(conf_instance, token, buffer_pos); - else if(conf_class_has_sub_class(conf_class, token) && (scope_start_set || is_root)) - { - char * name = conf_util_alloc_next_token(buffer_pos); - const conf_class_type * sub_conf_class = conf_class_get_sub_class_ref(conf_class, token); - if(name != NULL) - { - conf_instance_type * sub_conf_instance = conf_instance_alloc_default(sub_conf_class, name); - free(name); - conf_instance_insert_owned_sub_instance(conf_instance, sub_conf_instance); - conf_instance_add_data_from_token_buffer(sub_conf_instance, buffer_pos, allow_inclusion, false); - } - else - printf("WARNING: Unexpected EOF after \"%s\".\n\n", token); - } - else if(strcmp(token, "}") == 0) - { - if(scope_start_set) - { - scope_end_set = true; - free(token); - break; - } - else - printf("WARNING: Skipping unexpected token \"%s\".\n\n", token); - } - else if(strcmp(token, "{") == 0) - { - if(!scope_start_set && !is_root) - scope_start_set = true; - else - conf_instance_parser_skip_unknown_class(buffer_pos); - } - else if(strcmp(token, ";") == 0) - { - if(!scope_start_set) - { - free(token); - break; - } - else - printf("WARNING: Skipping unexpected token \"%s\".\n\n", token); - } - else if(strcmp(token, "include") == 0) - { - char * file_name = conf_util_alloc_next_token(buffer_pos); - char * buffer_pos_lookahead = *buffer_pos; - char * token_end; - - if(file_name == NULL) - { - printf("WARNING: Unexpected EOF after \"%s\".\n\n", token); - free(token); - break; - } - else if(!allow_inclusion) - { - printf("WARNING: No support for nested inclusion. Skipping file \"%s\".\n\n", file_name); - } - else - { - char * buffer_new = conf_util_fscanf_alloc_token_buffer(file_name); - char * buffer_pos_new = buffer_new; - - conf_instance_add_data_from_token_buffer(conf_instance, &buffer_pos_new, false, true); - - free(buffer_new); - } - - /** Check that the filename is followed by a ; */ - token_end = conf_util_alloc_next_token(&buffer_pos_lookahead); - if(token_end == NULL) - { - printf("WARNING: Unexpected EOF after inclusion of file \"%s\".\n\n", file_name); - free(token); - free(file_name); - break; - } - else if(strcmp(token_end, ";") != 0) - { - printf("WARNING: Unexpected \"%s\" after inclusion of file \"%s\". Probably a missing \";\".\n\n", - token_end, file_name); - } - else - { - *buffer_pos = buffer_pos_lookahead; - } - free(token_end); - free(file_name); - } - else - { - printf("WARNING: Skipping unexpected token \"%s\".\n\n", token); - } - - free(token); - token = conf_util_alloc_next_token(buffer_pos); - } - - - if(scope_end_set) - { - token = conf_util_alloc_next_token(buffer_pos); - if(token == NULL) - { - printf("WARNING: Unexpected EOF. Missing terminating \";\".\n"); - } - else if(strcmp(token, ";") != 0) - { - printf("WARNING: Missing terminating \";\" at the end of \"%s\".\n", conf_instance->name); - free(token); - } - else - free(token); - } -} - - - -conf_instance_type * conf_instance_alloc_from_file( - const conf_class_type * conf_class, - const char * name, - const char * file_name) -{ - conf_instance_type * conf_instance = conf_instance_alloc_default(conf_class, name); - - char * buffer = conf_util_fscanf_alloc_token_buffer(file_name); - char * buffer_pos = buffer; - - conf_instance_add_data_from_token_buffer(conf_instance, &buffer_pos, true, true); - - free(buffer); - - return conf_instance; -} - - diff --git a/ThirdParty/Ert/libconfig/src/conf_data.c b/ThirdParty/Ert/libconfig/src/conf_data.c deleted file mode 100644 index eb0867c6d2..0000000000 --- a/ThirdParty/Ert/libconfig/src/conf_data.c +++ /dev/null @@ -1,259 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'conf_data.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include - -#include - - - -#define DT_STR_STRING "string" -#define DT_INT_STRING "integer" -#define DT_POSINT_STRING "positive integer" -#define DT_FLOAT_STRING "floating point number" -#define DT_POSFLOAT_STRING "positive floating foint number" -#define DT_FILE_STRING "file" -#define DT_EXEC_STRING "executable" -#define DT_FOLDER_STRING "folder" -#define DT_DATE_STRING "date" - - - -#define RETURN_TYPE_IF_MATCH(STRING,TYPE) if(strcmp(STRING, TYPE ##_STRING) == 0){ return TYPE;} -dt_enum conf_data_get_dt_from_string( - const char * str) -{ - RETURN_TYPE_IF_MATCH(str, DT_STR); - RETURN_TYPE_IF_MATCH(str, DT_INT); - RETURN_TYPE_IF_MATCH(str, DT_POSINT); - RETURN_TYPE_IF_MATCH(str, DT_FLOAT); - RETURN_TYPE_IF_MATCH(str, DT_POSFLOAT); - RETURN_TYPE_IF_MATCH(str, DT_FILE); - RETURN_TYPE_IF_MATCH(str, DT_EXEC); - RETURN_TYPE_IF_MATCH(str, DT_FOLDER); - RETURN_TYPE_IF_MATCH(str, DT_DATE); - - util_abort("%s: Data type \"%s\" is unkown.\n", __func__, str); - return 0; -} -#undef RETURN_TYPE_IF_MATCH - - - -bool conf_data_string_is_dt( - const char * str) -{ - if( !strcmp(str, DT_STR_STRING )) return true; - else if(!strcmp(str, DT_INT_STRING )) return true; - else if(!strcmp(str, DT_POSINT_STRING )) return true; - else if(!strcmp(str, DT_FLOAT_STRING )) return true; - else if(!strcmp(str, DT_POSFLOAT_STRING )) return true; - else if(!strcmp(str, DT_FILE_STRING )) return true; - else if(!strcmp(str, DT_EXEC_STRING )) return true; - else if(!strcmp(str, DT_FOLDER_STRING )) return true; - else if(!strcmp(str, DT_DATE_STRING )) return true; - else return false; -} - - - -const char * conf_data_get_dt_name_ref( - dt_enum dt) -{ - switch(dt) - { - case(DT_STR): - return DT_STR_STRING; - case(DT_INT): - return DT_INT_STRING; - case(DT_POSINT): - return DT_POSINT_STRING; - case(DT_FLOAT): - return DT_FLOAT_STRING; - case(DT_POSFLOAT): - return DT_POSFLOAT_STRING; - case(DT_FILE): - return DT_FILE_STRING; - case(DT_EXEC): - return DT_EXEC_STRING; - case(DT_FOLDER): - return DT_FOLDER_STRING; - case(DT_DATE): - return DT_DATE_STRING; - default: - util_abort("%s: Internal error.\n", __func__); - return ""; - } -} - - - -bool conf_data_validate_string_as_dt_value( - dt_enum dt, - const char * str) -{ - if(str == NULL) - return false; - - switch(dt) - { - case(DT_STR): - return true; - case(DT_INT): - return util_sscanf_int(str, NULL); - case(DT_POSINT): - { - int val; - bool ok = util_sscanf_int(str, &val); - if(!ok) - return false; - else - return val > 0; - } - case(DT_FLOAT): - return util_sscanf_double(str, NULL); - case(DT_POSFLOAT): - { - double val; - bool ok = util_sscanf_double(str, &val); - if(!ok) - return false; - else - return val >= 0.0; - } - case(DT_FILE): - { - return util_file_exists(str); - } - case(DT_EXEC): - { - bool ok; - char * exec = util_alloc_PATH_executable(str); - ok = exec != NULL; - free(exec); - return ok; - } - case(DT_FOLDER): - { - return util_is_directory(str); - } - case(DT_DATE): - { - time_t date; - return util_sscanf_date_utc(str, &date); - } - default: - util_abort("%s: Internal error.\n", __func__); - } - return true; -} - - - - - -int conf_data_get_int_from_string( - dt_enum dt, - const char * str) -{ - int value = 0; - bool ok = true; - - switch(dt) - { - case(DT_INT): - ok = util_sscanf_int(str, &value); - break; - case(DT_POSINT): - ok = util_sscanf_int(str, &value); - break; - default: - ok = false; - } - - if(!ok) - util_abort("%s: Can not get an int from \"%s\".\n", - __func__, str); - - return value; -} - - - -double conf_data_get_double_from_string( - dt_enum dt, - const char * str) -{ - double value = 0; - bool ok = true; - - switch(dt) - { - case(DT_INT): - ok = util_sscanf_double(str, &value); - break; - case(DT_POSINT): - ok = util_sscanf_double(str, &value); - break; - case(DT_FLOAT): - ok = util_sscanf_double(str, &value); - break; - case(DT_POSFLOAT): - ok = util_sscanf_double(str, &value); - break; - default: - ok = false; - } - - if(!ok) - util_abort("%s: Can not get a double from \"%s\".\n", - __func__, str); - - return value; -} - - - -time_t conf_data_get_time_t_from_string( - dt_enum dt, - const char * str) -{ - time_t value = 0; - bool ok = true; - - switch(dt) - { - case(DT_DATE): - ok = util_sscanf_date_utc(str, &value); - break; - default: - ok = false; - } - - if(!ok) - util_abort("%s: Can not get a time_t from \"%s\".\n", - __func__, str); - return value; -} - - - diff --git a/ThirdParty/Ert/libconfig/src/conf_util.c b/ThirdParty/Ert/libconfig/src/conf_util.c deleted file mode 100644 index f634b784ad..0000000000 --- a/ThirdParty/Ert/libconfig/src/conf_util.c +++ /dev/null @@ -1,161 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'conf_util.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include - -#include - - -/* - This function creates a string buffer from a file. Furthermore, if the strings in pad_keys are found in the buffer, - they are padded with a space before and after. - - I.e., if the file contains - - key=value - - and "=" is in pad_keys, then the buffer will read - - key = value -*/ -static -char * __conf_util_fscanf_alloc_token_buffer( - const char * file, - const char * comment, - int num_pad_keys, - const char ** pad_keys) -{ - char * buffer_wrk = basic_parser_fread_alloc_file_content( file , NULL /* quote_set */ , NULL /* delete_set */ , "--" /* Comment start*/ , "\n" /* Comment end */); - char ** padded_keys = util_calloc(num_pad_keys , sizeof * padded_keys); - for(int key_nr = 0; key_nr < num_pad_keys; key_nr++) - { - assert(pad_keys[key_nr] != NULL); - - int key_len = strlen(pad_keys[key_nr]); - padded_keys[key_nr] = util_calloc((key_len + 3) , sizeof * padded_keys[key_nr]); - padded_keys[key_nr][0] = ' '; - for(int i=0; i 0) - found = true; - else if(len_token == 0 && !quoted) - return NULL; - else if(len_token == 0 && quoted) - *buff_pos += 1; - } - - char * token = util_calloc( (len_token + 1) , sizeof * token); - memmove(token, *buff_pos, len_token); - token[len_token] = '\0'; - *buff_pos += len_token; - - if(quoted) - *buff_pos += 1; - - return token; -} diff --git a/ThirdParty/Ert/libconfig/src/config_content.c b/ThirdParty/Ert/libconfig/src/config_content.c deleted file mode 100644 index d218dbfd43..0000000000 --- a/ThirdParty/Ert/libconfig/src/config_content.c +++ /dev/null @@ -1,424 +0,0 @@ -/* - Copyright (C) 2015 Statoil ASA, Norway. - - The file 'config_content.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - - -#define CONFIG_CONTENT_TYPE_ID 6612520 - -struct config_content_struct { - UTIL_TYPE_ID_DECLARATION; - set_type * parsed_files; /* A set of config files whcih have been parsed - to protect against circular includes. */ - vector_type * nodes; - hash_type * items; - config_error_type * parse_errors; - stringlist_type * warnings; - subst_list_type * define_list; - char * config_file; - char * abs_path; - - config_root_path_type * invoke_path; - vector_type * path_elm_storage; - vector_type * path_elm_stack; - bool valid; -}; - - -UTIL_IS_INSTANCE_FUNCTION( config_content , CONFIG_CONTENT_TYPE_ID ) - -config_content_type * config_content_alloc(const char * filename) { - config_content_type * content = util_malloc( sizeof * content ); - UTIL_TYPE_ID_INIT( content , CONFIG_CONTENT_TYPE_ID ); - content->valid = false; - content->items = hash_alloc(); - content->nodes = vector_alloc_new(); - content->parse_errors = config_error_alloc(); - content->define_list = subst_list_alloc( NULL ); - content->parsed_files = set_alloc_empty(); - content->warnings = stringlist_alloc_new(); - - content->path_elm_storage = vector_alloc_new(); - content->path_elm_stack = vector_alloc_new(); - - content->config_file = util_alloc_string_copy( filename ); - content->abs_path = util_alloc_abs_path( filename ); - { - char * path = util_split_alloc_dirname( filename ); - content->invoke_path = config_root_path_alloc( NULL ); - free( path ); - } - - - return content; -} - - -bool config_content_has_item( const config_content_type * content , const char * key) { - return hash_has_key( content->items , key ); -} - - -config_content_item_type * config_content_get_item( const config_content_type * content , const char * key) { - return hash_get( content->items , key ); -} - - -void config_content_add_item( config_content_type * content , const config_schema_item_type * schema_item , const config_path_elm_type * path_elm) { - - const char * kw = config_schema_item_get_kw( schema_item ); - config_content_item_type * content_item = config_content_item_alloc( schema_item , path_elm ); - hash_insert_hash_owned_ref( content->items , kw , content_item , config_content_item_free__ ); - - if (config_schema_item_is_deprecated(schema_item)) - stringlist_append_copy( content->warnings , config_schema_item_get_deprecate_msg(schema_item)); -} - -void config_content_add_node( config_content_type * content , config_content_node_type * content_node ) { - vector_append_ref( content->nodes , content_node ); -} - - -void config_content_set_valid( config_content_type * content) { - content->valid = true; -} - -bool config_content_is_valid( const config_content_type * content ) { - return content->valid; -} - - -config_error_type * config_content_get_errors( const config_content_type * content) { - return content->parse_errors; -} - - -const stringlist_type * config_content_get_warnings( const config_content_type * content) { - return content->warnings; -} - - - -void config_content_free( config_content_type * content ) { - stringlist_free( content->warnings ); - vector_free( content->nodes ); - vector_free( content->path_elm_stack ); - vector_free( content->path_elm_storage ); - hash_free( content->items ); - config_error_free( content->parse_errors ); - subst_list_free( content->define_list ); - util_safe_free( content->config_file ); - util_safe_free( content->abs_path ); - set_free( content->parsed_files ); - if (content->invoke_path != NULL) - config_root_path_free( content->invoke_path ); - - free( content ); -} - -bool config_content_add_file( config_content_type * content , const char * config_file) { - return set_add_key( content->parsed_files , config_file); -} - -config_root_path_type * config_content_get_invoke_path( config_content_type * content ) { - return content->invoke_path; -} - - - - - -/*****************************************************************/ - -/* - Here comes some xxx_get() functions - many of them will fail if - the item has not been added in the right way (this is to ensure that - the xxx_get() request is unambigous. -*/ - - -/** - This function can be used to get the value of a config - parameter. But to ensure that the get is unambigous we set the - following requirements to the item corresponding to 'kw': - - * argc_minmax has been set to 1,1 - - If this is not the case - we die. -*/ - -/** - Assume we installed a key 'KEY' which occurs three times in the final - config file: - - KEY 1 2 3 - KEY 11 22 33 - KEY 111 222 333 - - - Now when accessing these values the occurence variable will - correspond to the linenumber, and the index will index along a line: - - config_iget_as_int( config , "KEY" , 0 , 2) => 3 - config_iget_as_int( config , "KEY" , 2 , 1) => 222 -*/ - -const char * config_content_iget( const config_content_type * content , const char * key , int occurence , int index) { - config_content_item_type * item = config_content_get_item(content , key); - return config_content_item_iget(item , occurence , index); -} - - -int config_content_iget_as_int( const config_content_type * content , const char * key , int occurence , int index) { - config_content_item_type * item = config_content_get_item(content , key); - return config_content_item_iget_as_int(item , occurence , index); -} - - -bool config_content_iget_as_bool( const config_content_type * content , const char * key , int occurence , int index) { - config_content_item_type * item = config_content_get_item(content , key); - return config_content_item_iget_as_bool(item , occurence , index); -} - - -double config_content_iget_as_double( const config_content_type * content , const char * key , int occurence , int index) { - config_content_item_type * item = config_content_get_item(content , key); - return config_content_item_iget_as_double(item , occurence , index); -} - -const char * config_content_iget_as_path( const config_content_type * content , const char * key , int occurence , int index) { - config_content_item_type * item = config_content_get_item(content , key); - config_content_node_type * node = config_content_item_iget_node( item , index ); - return config_content_node_iget_as_path(node , index); -} - - -/** - This function will return NULL is the item has not been set, - however it must be installed with config_add_schema_item(). -*/ - -const char * config_content_safe_iget(const config_content_type * content , const char *kw, int occurence , int index) { - const char * value = NULL; - - if (config_content_has_item( content , kw )) { - config_content_item_type * item = config_content_get_item(content , kw); - if (occurence < config_content_item_get_size( item )) { - config_content_node_type * node = config_content_item_iget_node( item , occurence ); - value = config_content_node_safe_iget( node , index ); - } - } - return value; -} - - -/** - Return the number of times a keyword has been set - dies on unknown - 'kw'. If the append_arg attribute has been set to false the - function will return 0 or 1 irrespective of how many times the item - has been set in the config file. -*/ - - -int config_content_get_occurences(const config_content_type * content, const char * kw) { - if (config_content_has_item( content , kw )) - return config_content_item_get_size( config_content_get_item(content , kw) ); - else - return 0; -} - - - -const config_content_node_type * config_content_iget_node( const config_content_type * content , int index) { - const config_content_node_type * node = vector_iget_const(content->nodes , index ); - return node; -} - - -int config_content_get_size(const config_content_type * content) { - return vector_get_size( content->nodes ); -} - -/*****************************************************************/ -/* All the get_value functions will operate on the last item which has - been set with a particular key value. So assuming the config file - looks like: - - KEY VALUE1 - KEY VALUE2 OPTIONAL - KEY 100 VALUE3 OPTIONAL ERROR - - these functions will all operate on the last line in the config file: - - KEY 100 VALUE3 OPTIONAL ERROR -*/ - - - -static config_content_node_type * config_content_get_value_node__( const config_content_type * config , const char * kw) { - config_content_node_type * node = config_content_get_value_node( config , kw ); - if (node == NULL) - util_abort("Tried to get value node from unset kw:%s \n",__func__ , kw ); - - return node; -} - -config_content_node_type * config_content_get_value_node( const config_content_type * content , const char * kw) { - config_content_item_type * item = config_content_get_item(content , kw); - config_content_node_type * node = config_content_item_get_last_node( item ); - config_content_node_assert_key_value( node ); - return node; -} - - -bool config_content_get_value_as_bool(const config_content_type * config , const char * kw) { - config_content_node_type * node = config_content_get_value_node__( config , kw ); - return config_content_node_iget_as_bool(node , 0); -} - -int config_content_get_value_as_int(const config_content_type * config , const char * kw) { - config_content_node_type * node = config_content_get_value_node__( config , kw ); - return config_content_node_iget_as_int(node , 0); -} - -double config_content_get_value_as_double(const config_content_type * config , const char * kw) { - config_content_node_type * node = config_content_get_value_node__( config , kw ); - return config_content_node_iget_as_double(node , 0); -} - -const char * config_content_get_value_as_path( const config_content_type * config , const char * kw) { - config_content_node_type * node = config_content_get_value_node__( config , kw ); - return config_content_node_iget_as_path(node , 0); -} - -const char * config_content_get_value_as_abspath( const config_content_type * config , const char * kw) { - config_content_node_type * node = config_content_get_value_node__( config , kw ); - return config_content_node_iget_as_abspath(node , 0); -} - -const char * config_content_get_value_as_relpath( const config_content_type * config , const char * kw) { - config_content_node_type * node = config_content_get_value_node__( config , kw ); - return config_content_node_iget_as_relpath(node , 0); -} - - -const char * config_content_get_value(const config_content_type * config , const char * kw) { - config_content_node_type * node = config_content_get_value_node__( config , kw ); - return config_content_node_iget(node , 0); -} - -/*****************************************************************/ - -char * config_content_alloc_joined_string(const config_content_type * content , const char * kw, const char * sep) { - config_content_item_type * item = config_content_get_item(content , kw); - return config_content_item_alloc_joined_string(item , sep); -} - - -/** - This function allocates a new stringlist containing *ALL* the - arguements for an item. With reference to the illustrated example at - the top the function call: - - config_alloc_complete_strtinglist(config , "KEY1"); - - would produce the list: ("ARG1" "ARG2" "ARG2" "VERBOSE"), i.e. the - arguments for the various occurences of "KEY1" are collapsed to one - stringlist. -*/ - - -stringlist_type * config_content_alloc_complete_stringlist(const config_content_type * content , const char * kw) { - bool copy = true; - config_content_item_type * item = config_content_get_item(content , kw); - return config_content_item_alloc_complete_stringlist(item , copy); -} - - - -const stringlist_type * config_content_iget_stringlist_ref(const config_content_type * content , const char * kw, int occurence) { - config_content_item_type * item = config_content_get_item(content , kw); - - return config_content_item_iget_stringlist_ref(item , occurence); -} - -void config_content_add_define( config_content_type * content , const char * key , const char * value ) { - subst_list_append_copy( content->define_list , key , value , NULL ); -} - -subst_list_type * config_content_get_define_list( config_content_type * content ) { - return content->define_list; -} - - -/*****************************************************************/ - - - - -const char * config_content_get_config_file( const config_content_type * content , bool abs_path ) { - if (abs_path) - return content->abs_path; - else - return content->config_file; -} - - -config_path_elm_type * config_content_add_path_elm( config_content_type * content , const char * path ) { - const config_path_elm_type * current_path_elm; - - if (vector_get_size( content->path_elm_stack ) == 0) - current_path_elm = NULL; - else - current_path_elm = vector_get_last_const(content->path_elm_stack); - - { - config_path_elm_type * new_path_elm; - - { - char * rel_path = NULL; - config_root_path_type * invoke_path = config_content_get_invoke_path( content ); - if (path != NULL) { - if (current_path_elm == NULL) - rel_path = util_alloc_rel_path( config_root_path_get_abs_path(invoke_path) , path); - else - rel_path = config_path_elm_alloc_relpath( current_path_elm , path ); - } - new_path_elm = config_path_elm_alloc( invoke_path , rel_path ); - util_safe_free( rel_path ); - } - vector_append_owned_ref( content->path_elm_storage , new_path_elm , config_path_elm_free__); - vector_append_ref( content->path_elm_stack , new_path_elm ); - return new_path_elm; - } -} - -void config_content_pop_path_stack( config_content_type * content ) { - vector_pop_back( content->path_elm_stack ); -} diff --git a/ThirdParty/Ert/libconfig/src/config_content_item.c b/ThirdParty/Ert/libconfig/src/config_content_item.c deleted file mode 100644 index b6d4873f30..0000000000 --- a/ThirdParty/Ert/libconfig/src/config_content_item.c +++ /dev/null @@ -1,293 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'config_content_item.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - - -#define CONFIG_CONTENT_ITEM_ID 8876752 -struct config_content_item_struct { - UTIL_TYPE_ID_DECLARATION; - const config_schema_item_type * schema; - vector_type * nodes; - const config_path_elm_type * path_elm; -}; - - - - - - - - -/*****************************************************************/ - -/** - This function counts the number of times a config item has been - set. Referring again to the example at the top: - - config_content_item_get_occurences( "KEY1" ) - - will return 2. -*/ - - - -int config_content_item_get_size(const config_content_item_type * item) { - return vector_get_size( item->nodes ); -} - - -config_content_node_type * config_content_item_get_last_node(const config_content_item_type * item) { - return vector_get_last( item->nodes ); -} - -config_content_node_type * config_content_item_iget_node(const config_content_item_type * item , int index) { - return vector_iget( item->nodes , index ); -} - -const config_content_node_type * config_content_item_get_last_node_const(const config_content_item_type * item) { - return vector_get_last( item->nodes ); -} - -const config_content_node_type * config_content_item_iget_node_const(const config_content_item_type * item , int index) { - return vector_iget( item->nodes , index ); -} - - -char * config_content_item_ialloc_joined_string(const config_content_item_type * item , const char * sep , int occurence) { - const config_content_node_type * node = config_content_item_iget_node(item , occurence); - return config_content_node_alloc_joined_string(node , sep); -} - - - -char * config_content_item_alloc_joined_string(const config_content_item_type * item , const char * sep) { - const int occurences = config_content_item_get_size( item ); - char * joined_string = NULL; - - for (int i =0; i < occurences ; i++) { - char * element = config_content_item_ialloc_joined_string(item , sep , i); - joined_string = util_strcat_realloc( joined_string , element); - if (i < (occurences - 1)) - joined_string = util_strcat_realloc( joined_string , sep ); - free( element ); - } - - return joined_string; -} - -const stringlist_type * config_content_item_iget_stringlist_ref(const config_content_item_type * item, int occurence) { - const config_content_node_type * node = config_content_item_iget_node(item , occurence); - return config_content_node_get_stringlist( node ); -} - - -const stringlist_type * config_content_item_get_stringlist_ref(const config_content_item_type * item) { - const config_content_node_type * node = config_content_item_get_last_node( item ); - return config_content_node_get_stringlist( node ); -} - - -/** - If copy == false - the stringlist will break down when/if the - config object is freed - your call. -*/ - -stringlist_type * config_content_item_alloc_complete_stringlist(const config_content_item_type * item, bool copy) { - int inode; - stringlist_type * stringlist = stringlist_alloc_new(); - for (inode = 0; inode < vector_get_size( item->nodes ); inode++) { - const config_content_node_type * node = config_content_item_iget_node(item , inode); - const stringlist_type * src_list = config_content_node_get_stringlist( node ); - - if (copy) - stringlist_append_stringlist_copy( stringlist , src_list ); - else - stringlist_append_stringlist_ref( stringlist , src_list ); - - } - - return stringlist; -} - - -/** - If copy == false - the stringlist will break down when/if the - config object is freed - your call. -*/ - -stringlist_type * config_content_item_alloc_stringlist(const config_content_item_type * item, bool copy) { - const config_content_node_type * node = config_content_item_get_last_node( item ); - stringlist_type * stringlist = stringlist_alloc_new(); - const stringlist_type * src_list = config_content_node_get_stringlist( node ); - - if (copy) - stringlist_append_stringlist_copy( stringlist , src_list ); - else - stringlist_append_stringlist_ref( stringlist , src_list ); - - return stringlist; -} - - -/** - If copy == false - the hash will break down when/if the - config object is freed - your call. -*/ - -hash_type * config_content_item_alloc_hash(const config_content_item_type * item , bool copy) { - hash_type * hash = hash_alloc(); - if (item != NULL) { - int inode; - for (inode = 0; inode < vector_get_size( item->nodes ); inode++) { - const config_content_node_type * node = config_content_item_iget_node(item , inode); - const stringlist_type * src_list = config_content_node_get_stringlist( node ); - const char * key = stringlist_iget(src_list , 0); - const char * value = stringlist_iget(src_list , 1); - - if (copy) { - hash_insert_hash_owned_ref(hash , - key , - util_alloc_string_copy(value) , - free); - } else - hash_insert_ref(hash , key , value ); - - } - } - return hash; -} - - -/******************************************************************/ - - - - -const char * config_content_item_iget(const config_content_item_type * item , int occurence , int index) { - const config_content_node_type * node = config_content_item_iget_node(item , occurence); - const stringlist_type * src_list = config_content_node_get_stringlist( node ); - return stringlist_iget( src_list , index ); -} - -bool config_content_item_iget_as_bool(const config_content_item_type * item, int occurence , int index) { - bool value; - config_schema_item_assure_type(item->schema , index , CONFIG_BOOL); - util_sscanf_bool( config_content_item_iget(item , occurence ,index) , &value ); - return value; -} - - - - -int config_content_item_iget_as_int(const config_content_item_type * item, int occurence , int index) { - int value; - config_schema_item_assure_type(item->schema , index , CONFIG_INT); - util_sscanf_int( config_content_item_iget(item , occurence , index) , &value ); - return value; -} - - -double config_content_item_iget_as_double(const config_content_item_type * item, int occurence , int index) { - double value; - config_schema_item_assure_type(item->schema , index , CONFIG_FLOAT); - util_sscanf_double( config_content_item_iget(item , occurence , index) , &value ); - return value; -} - - -/** - Used to reset an item is the special string 'CLEAR_STRING' - is found as the only argument: - - OPTION V1 - OPTION V2 V3 V4 - OPTION __RESET__ - OPTION V6 - - In this case OPTION will get the value 'V6'. The example given - above is a bit contrived; this option is designed for situations - where several config files are parsed serially; and the user can - not/will not update the first. -*/ - -void config_content_item_clear( config_content_item_type * item ) { - vector_clear( item->nodes ); -} - - - -void config_content_item_free( config_content_item_type * item ) { - vector_free( item->nodes ); - free(item); -} - - - -UTIL_SAFE_CAST_FUNCTION( config_content_item , CONFIG_CONTENT_ITEM_ID) -UTIL_IS_INSTANCE_FUNCTION( config_content_item , CONFIG_CONTENT_ITEM_ID) - - -void config_content_item_free__( void * arg ) { - config_content_item_type * content_item = config_content_item_safe_cast( arg ); - config_content_item_free( content_item ); -} - - -config_content_item_type * config_content_item_alloc( const config_schema_item_type * schema , const config_path_elm_type * path_elm) { - config_content_item_type * content_item = util_malloc( sizeof * content_item ); - UTIL_TYPE_ID_INIT( content_item , CONFIG_CONTENT_ITEM_ID ); - content_item->schema = schema; - content_item->nodes = vector_alloc_new(); - content_item->path_elm = path_elm; - return content_item; -} - - - - - -config_content_node_type * config_content_item_alloc_node( const config_content_item_type * item , const config_path_elm_type * path_elm) { - config_content_node_type * node = config_content_node_alloc( item->schema , path_elm ); - vector_append_owned_ref( item->nodes , node , config_content_node_free__); - return node; -} - - - -const config_schema_item_type * config_content_item_get_schema( const config_content_item_type * item ) { - return item->schema; -} - - - - -const config_path_elm_type * config_content_item_get_path_elm( const config_content_item_type * item ) { - return item->path_elm; -} diff --git a/ThirdParty/Ert/libconfig/src/config_content_node.c b/ThirdParty/Ert/libconfig/src/config_content_node.c deleted file mode 100644 index ba9673cb93..0000000000 --- a/ThirdParty/Ert/libconfig/src/config_content_node.c +++ /dev/null @@ -1,242 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'config_content_node.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -#include -#include -#include - -#include -#include -#include - - -#define CONFIG_CONTENT_NODE_ID 6752887 -struct config_content_node_struct { - UTIL_TYPE_ID_DECLARATION; - const config_schema_item_type * schema; - stringlist_type * stringlist; /* The values which have been set. */ - const config_path_elm_type * cwd; - stringlist_type * string_storage; -}; - - -static UTIL_SAFE_CAST_FUNCTION( config_content_node , CONFIG_CONTENT_NODE_ID ) - - - -config_content_node_type * config_content_node_alloc( const config_schema_item_type * schema , const config_path_elm_type * cwd) { - config_content_node_type * node = util_malloc(sizeof * node ); - UTIL_TYPE_ID_INIT( node , CONFIG_CONTENT_NODE_ID ); - node->stringlist = stringlist_alloc_new(); - node->cwd = cwd; - node->schema = schema; - node->string_storage = NULL; - return node; -} - - -void config_content_node_add_value(config_content_node_type * node , const char * value) { - stringlist_append_copy( node->stringlist , value); -} - - -void config_content_node_set(config_content_node_type * node , const stringlist_type * token_list) { - int argc = stringlist_get_size( token_list ) - 1; - for (int iarg=0; iarg < argc; iarg++) - config_content_node_add_value( node , stringlist_iget( token_list , iarg + 1)); -} - - - -char * config_content_node_alloc_joined_string(const config_content_node_type * node, const char * sep) { - return stringlist_alloc_joined_string(node->stringlist , sep); -} - - - -void config_content_node_free(config_content_node_type * node) { - stringlist_free(node->stringlist); - if (node->string_storage != NULL) - stringlist_free( node->string_storage ); - free(node); -} - - - -void config_content_node_free__(void * arg) { - config_content_node_type * node = config_content_node_safe_cast( arg ); - config_content_node_free( node ); -} - -static void config_content_node_push_string( config_content_node_type * node , char * string) { - if (node->string_storage == NULL) - node->string_storage = stringlist_alloc_new( ); - - stringlist_append_owned_ref( node->string_storage , string ); -} - -const char * config_content_node_get_full_string( config_content_node_type * node , const char * sep ) { - char * full_string = stringlist_alloc_joined_string(node->stringlist , sep); - config_content_node_push_string( node , full_string ); - return full_string; -} - -const char * config_content_node_iget(const config_content_node_type * node , int index) { - return stringlist_iget( node->stringlist , index ); -} - - -const char * config_content_node_safe_iget(const config_content_node_type * node , int index) { - if (index >= stringlist_get_size( node->stringlist )) - return NULL; - else - return stringlist_iget( node->stringlist , index ); -} - - -config_item_types config_content_node_iget_type( const config_content_node_type * node , int index) { - return config_schema_item_iget_type( node->schema , index ); -} - - -time_t config_content_node_iget_as_isodate(const config_content_node_type * node , int index) { - time_t value; - config_schema_item_assure_type(node->schema , index , CONFIG_ISODATE); - util_sscanf_isodate( config_content_node_iget(node , index) , &value ); - return value; -} - - -bool config_content_node_iget_as_bool(const config_content_node_type * node , int index) { - bool value; - config_schema_item_assure_type(node->schema , index , CONFIG_BOOL); - util_sscanf_bool( config_content_node_iget(node , index) , &value ); - return value; -} - - -int config_content_node_iget_as_int(const config_content_node_type * node , int index) { - int value; - config_schema_item_assure_type(node->schema , index , CONFIG_INT); - util_sscanf_int( config_content_node_iget(node , index) , &value ); - return value; -} - - - -double config_content_node_iget_as_double(const config_content_node_type * node , int index) { - double value; - config_schema_item_assure_type(node->schema , index , CONFIG_FLOAT + CONFIG_INT); - util_sscanf_double( config_content_node_iget(node , index) , &value ); - return value; -} - - - - -const char * config_content_node_iget_as_path(config_content_node_type * node , int index) { - config_schema_item_assure_type(node->schema , index , CONFIG_PATH + CONFIG_EXISTING_PATH); - { - const char * config_value = config_content_node_iget(node , index); - char * path_value = config_path_elm_alloc_path( node->cwd , config_value ); - config_content_node_push_string( node , path_value ); - - return path_value; - } -} - - -const char * config_content_node_iget_as_abspath( config_content_node_type * node , int index) { - config_schema_item_assure_type(node->schema , index , CONFIG_PATH + CONFIG_EXISTING_PATH); - { - const char * config_value = config_content_node_iget(node , index); - char * path_value = config_path_elm_alloc_abspath( node->cwd , config_value ); - config_content_node_push_string( node , path_value ); - - return path_value; - } -} - - -const char * config_content_node_iget_as_relpath( config_content_node_type * node , int index) { - config_schema_item_assure_type(node->schema , index , CONFIG_PATH + CONFIG_EXISTING_PATH); - { - const char * config_value = config_content_node_iget(node , index); - char * path_value = config_path_elm_alloc_relpath( node->cwd , config_value ); - config_content_node_push_string( node , path_value ); - - return path_value; - } -} - - -const stringlist_type * config_content_node_get_stringlist( const config_content_node_type * node ) { - return node->stringlist; -} - - -const char * config_content_node_get_kw( const config_content_node_type * node ) { - return config_schema_item_get_kw( node->schema ); -} - - - - -int config_content_node_get_size( const config_content_node_type * node ) { - return stringlist_get_size( node->stringlist ); -} - - -void config_content_node_assert_key_value( const config_content_node_type * node ) { - int argc_min , argc_max; - config_schema_item_get_argc( node->schema , &argc_min , &argc_max); - - if (!((argc_min == 1) && (argc_min == 1))) - util_abort("%s: item:%s before calling config_get_value() functions *without* index you must set argc_min == argc_max = 1 \n",__func__ , config_schema_item_get_kw( node->schema )); -} - - -const config_path_elm_type * config_content_node_get_path_elm( const config_content_node_type * node ) { - return node->cwd; -} - -/** - The node should contain elements of the type: - - KEY1:VALUE1 KEY2:Value2 XX Key3:Val3 Ignored - - Which will be inserted in the opt_hash dictionary as : {"KEY1" : - "VALUE1" , ... } Elements which do not conform to this syntax are - ignored. -*/ - - -void config_content_node_init_opt_hash( const config_content_node_type * node , hash_type * opt_hash , int elm_offset) { - int i; - for (i = elm_offset; i < config_content_node_get_size( node ); i++) - hash_add_option( opt_hash , config_content_node_iget( node , i )); -} - - -void config_content_node_fprintf( const config_content_node_type * node , FILE * stream ) { - fprintf(stream , "%s: {" , config_schema_item_get_kw( node->schema )); - stringlist_fprintf( node->stringlist , ", " , stream ); - fprintf(stream , "}\n"); -} diff --git a/ThirdParty/Ert/libconfig/src/config_error.c b/ThirdParty/Ert/libconfig/src/config_error.c deleted file mode 100644 index 9924e94b62..0000000000 --- a/ThirdParty/Ert/libconfig/src/config_error.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'config_error.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include - -#include -#include - -#include - -struct config_error_struct { - stringlist_type * error_list; -}; - - - -config_error_type * config_error_alloc() { - config_error_type * error = util_malloc( sizeof * error ); - error->error_list = stringlist_alloc_new(); - return error; -} - - -config_error_type * config_error_alloc_copy( const config_error_type * src_error) { - config_error_type * config_error = config_error_alloc(); - stringlist_deep_copy( config_error->error_list , src_error->error_list ); - return config_error; -} - - -bool config_error_equal( const config_error_type * error1 , const config_error_type * error2) { - return stringlist_equal( error1->error_list , error2->error_list ); -} - -void config_error_free( config_error_type * error ) { - stringlist_free( error->error_list ); - free( error ); -} - - - -void config_error_add( config_error_type * error , char * new_error) { - stringlist_append_copy( error->error_list , new_error ); -} - - - -void config_error_clear( config_error_type * error ) { - stringlist_clear( error->error_list ); -} - - -int config_error_count( const config_error_type * error ) { - return stringlist_get_size( error->error_list ); -} - - -const char * config_error_iget( const config_error_type * error , int index) { - return stringlist_iget( error->error_list , index ); -} - - -void config_error_fprintf( const config_error_type * error , bool add_count , FILE * stream ) { - int error_nr; - - for (error_nr = 0; error_nr < stringlist_get_size( error->error_list ); error_nr++) { - if (add_count) - fprintf(stream , " %02d: " , error_nr); - - fprintf( stream , "%s\n" , stringlist_iget( error->error_list , error_nr)); - } -} diff --git a/ThirdParty/Ert/libconfig/src/config_get.c b/ThirdParty/Ert/libconfig/src/config_get.c deleted file mode 100644 index ea331b7c06..0000000000 --- a/ThirdParty/Ert/libconfig/src/config_get.c +++ /dev/null @@ -1,103 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'config_get.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -/*****************************************************************/ -/* All the functions in this block will operate on the last item - which has been set with a particular key value. So assuming the - config file looks like: - - KEY VALUE1 - KEY VALUE2 OPTIONAL - KEY 100 VALUE3 OPTIONAL ERROR - - these functions will all operate on the last line in the config file: - - KEY 100 VALUE3 OPTIONAL ERROR -*/ - - -/*config_content_node_type * config_get_value_node( const config_parser_type * config , const char * kw) { - config_content_item_type * item = config_get_content_item(config , kw); - if (item != NULL) { - config_content_node_type * node = config_content_item_get_last_node( item ); - config_content_node_assert_key_value( node ); - return node; - } else - return NULL; // Will return NULL on unset keywords - must check NULL return value?! -} - -static config_content_node_type * config_get_value_node__( const config_parser_type * config , const char * kw) { - config_content_node_type * node = config_get_value_node( config , kw ); - if (node == NULL) - util_abort("Tried to get value node from unset kw:%s \n",__func__ , kw ); - - return node; -} - -bool config_get_value_as_bool(const config_parser_type * config , const char * kw) { - config_content_node_type * node = config_get_value_node__( config , kw ); - return config_content_node_iget_as_bool(node , 0); -} - -int config_get_value_as_int(const config_parser_type * config , const char * kw) { - config_content_node_type * node = config_get_value_node__( config , kw ); - return config_content_node_iget_as_int(node , 0); -} - -double config_get_value_as_double(const config_parser_type * config , const char * kw) { - config_content_node_type * node = config_get_value_node__( config , kw ); - return config_content_node_iget_as_double(node , 0); -} - -const char * config_get_value_as_path( const config_parser_type * config , const char * kw) { - config_content_node_type * node = config_get_value_node__( config , kw ); - return config_content_node_iget_as_path(node , 0); -} - -const char * config_get_value_as_abspath( const config_parser_type * config , const char * kw) { - config_content_node_type * node = config_get_value_node__( config , kw ); - return config_content_node_iget_as_abspath(node , 0); -} - -const char * config_get_value_as_relpath( const config_parser_type * config , const char * kw) { - config_content_node_type * node = config_get_value_node__( config , kw ); - return config_content_node_iget_as_relpath(node , 0); -} - - -const char * config_get_value(const config_parser_type * config , const char * kw) { - config_content_node_type * node = config_get_value_node__( config , kw ); - return config_content_node_iget(node , 0); -} -*/ - -/*****************************************************************/ - - - - - - -int config_get_schema_size( const config_parser_type * config ) { - return hash_get_size( config->schema_items ); -} - - - - diff --git a/ThirdParty/Ert/libconfig/src/config_parser.c b/ThirdParty/Ert/libconfig/src/config_parser.c deleted file mode 100644 index 10be6237d2..0000000000 --- a/ThirdParty/Ert/libconfig/src/config_parser.c +++ /dev/null @@ -1,719 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#define CLEAR_STRING "__RESET__" - - - -/** -Structure to parse configuration files of this type: - -KEYWORD1 ARG2 ARG2 ARG3 -KEYWORD2 ARG1-2 -.... -KEYWORDN ARG1 ARG2 - -A keyword can occure many times. - -*/ - - - -/** - - - ============================= - | config_type object | - | | - | Contains 'all' the | - | configuration information.| - | | - ============================= - | | - | \________________________ - | \ - KEY1 KEY2 - | | - \|/ \|/ - ========================= ========================= - | config_item object | | config_item object | - | | | | - | Indexed by a keyword | | Indexed by a keyword | - | which is the first | | which is the first | - | string in the | | string in the | - | config file. | | config file. | - | | | | - ========================= ========================= - | | | - | | | - \|/ \|/ \|/ -============================ ============================ ============================ -| config_item_node object | | config_item_node object | | config_item_node object | -| | | | | | -| Only containing the | | Only containing the | | Only containing the | -| stringlist object | | stringlist object | | stringlist object | -| directly parsed from the | | directly parsed from the | | directly parsed from the | -| file. | | file. | | file. | -|--------------------------| |--------------------------| |--------------------------| -| ARG1 ARG2 ARG3 | | VERBOSE | | DEBUG | -============================ ============================ ============================ - - -The example illustrated above would correspond to the following config -file (invariant under line-permutations): - -KEY1 ARG1 ARG2 ARG3 -KEY1 VERBOSE -KEY2 DEBUG - - -Example config file(2): - -OUTFILE filename -INPUT filename -OPTIONS store -OPTIONS verbose -OPTIONS optimize cache=1 - -In this case the whole config object will contain three items, -corresponding to the keywords OUTFILE, INPUT and OPTIONS. The two -first will again only contain one node each, whereas the OPTIONS item -will contain three nodes, corresponding to the three times the keyword -"OPTIONS" appear in the config file. -*/ - - - - - - - - - - - -struct config_parser_struct { - hash_type * schema_items; - hash_type * messages; /* Can print a (warning) message when a keyword is encountered. */ -}; - - - - - - - - - - - - - - - - - - -/* - The last argument (config_file) is only used for printing - informative error messages, and can be NULL. The config_cwd is - essential if we are looking up a filename, otherwise it can be NULL. - - Returns a string with an error description, or NULL if the supplied - arguments were OK. The string is allocated here, but is assumed that - calling scope will free it. -*/ - -static config_content_node_type * config_content_item_set_arg__(subst_list_type * define_list , - config_error_type * parse_errors , - config_content_item_type * item , - stringlist_type * token_list , - const config_path_elm_type * path_elm , - const char * config_file ) { - - config_content_node_type * new_node = NULL; - int argc = stringlist_get_size( token_list ) - 1; - - if (argc == 1 && (strcmp(stringlist_iget(token_list , 1) , CLEAR_STRING) == 0)) { - config_content_item_clear(item); - } else { - const config_schema_item_type * schema_item = config_content_item_get_schema( item ); - - /* Filtering based on DEFINE statements */ - if (subst_list_get_size( define_list ) > 0) { - int iarg; - for (iarg = 0; iarg < argc; iarg++) { - char * filtered_copy = subst_list_alloc_filtered_string( define_list , stringlist_iget(token_list , iarg + 1)); - stringlist_iset_owned_ref( token_list , iarg + 1 , filtered_copy); - } - } - - - /* Filtering based on environment variables */ - if (config_schema_item_expand_envvar( schema_item )) { - int iarg; - for (iarg = 0; iarg < argc; iarg++) { - int env_offset = 0; - while (true) { - char * env_var = util_isscanf_alloc_envvar( stringlist_iget(token_list , iarg + 1) , env_offset ); - if (env_var == NULL) - break; - - { - const char * env_value = getenv( &env_var[1] ); - if (env_value != NULL) { - char * new_value = util_string_replace_alloc( stringlist_iget( token_list , iarg + 1 ) , env_var , env_value ); - stringlist_iset_owned_ref( token_list , iarg + 1 , new_value ); - } else { - env_offset += 1; - fprintf(stderr,"** Warning: environment variable: %s is not defined \n", env_var); - } - } - - free( env_var ); - } - } - } - - { - if (config_schema_item_validate_set(schema_item , token_list , config_file, path_elm , parse_errors)) { - new_node = config_content_item_alloc_node( item , config_content_item_get_path_elm( item )); - config_content_node_set(new_node , token_list); - } - } - } - return new_node; -} - - - - - -/*****************************************************************/ - - - -config_parser_type * config_alloc() { - config_parser_type *config = util_malloc(sizeof * config ); - config->schema_items = hash_alloc(); - config->messages = hash_alloc(); - return config; -} - - - - - - - - - - -void config_free(config_parser_type * config) { - - hash_free(config->schema_items); - hash_free(config->messages); - - free(config); -} - - - -static void config_insert_schema_item(config_parser_type * config , const char * kw , const config_schema_item_type * item , bool ref) { - if (ref) - hash_insert_ref(config->schema_items , kw , item); - else - hash_insert_hash_owned_ref(config->schema_items , kw , item , config_schema_item_free__); -} - - -/** - This function allocates a simple item with all values - defaulted. The item is added to the config object, and a pointer is - returned to the calling scope. If you want to change the properties - of the item you can do that with config_schema_item_set_xxxx() functions - from the calling scope. -*/ - - -config_schema_item_type * config_add_schema_item(config_parser_type * config , - const char * kw, - bool required) { - - config_schema_item_type * item = config_schema_item_alloc( kw , required ); - config_insert_schema_item(config , kw , item , false); - return item; -} - - - -/** - This is a minor wrapper for adding an item with the properties. - - 1. It has argc_minmax = {1,1} - - The value can than be extracted with config_get_value() and - config_get_value_as_xxxx functions. -*/ - -config_schema_item_type * config_add_key_value( config_parser_type * config , const char * key , bool required , config_item_types item_type) { - config_schema_item_type * item = config_add_schema_item( config , key , required ); - config_schema_item_set_argc_minmax( item , 1 , 1 ); - config_schema_item_iset_type( item , 0 , item_type ); - return item; -} - - - -bool config_has_schema_item(const config_parser_type * config , const char * kw) { - return hash_has_key(config->schema_items , kw); -} - - -config_schema_item_type * config_get_schema_item(const config_parser_type * config , const char * kw) { - return hash_get(config->schema_items , kw); -} - -/* - Due to the possibility of aliases we must go through the canonical - keyword which is internalized in the schema_item. -*/ - - - - - - - - - -static void config_validate_content_item(const config_parser_type * config , config_content_type * content , const config_content_item_type * item) { - const config_schema_item_type * schema_item = config_content_item_get_schema( item ); - const char * schema_kw = config_schema_item_get_kw( schema_item ); - - { - int i; - for (i = 0; i < config_schema_item_num_required_children(schema_item); i++) { - const char * required_child = config_schema_item_iget_required_child( schema_item , i ); - if (!config_content_has_item(content , required_child)) { - char * error_message = util_alloc_sprintf("When:%s is set - you also must set:%s.",schema_kw , required_child); - config_error_add( config_content_get_errors( content ) , error_message ); - free( error_message ); - } - } - - if (config_schema_item_has_required_children_value( schema_item )) { - int inode; - for (inode = 0; inode < config_content_item_get_size(item); inode++) { - config_content_node_type * node = config_content_item_iget_node(item , inode); - const stringlist_type * values = config_content_node_get_stringlist( node ); - int is; - - for (is = 0; is < stringlist_get_size(values); is++) { - const char * value = stringlist_iget(values , is); - stringlist_type * required_children = config_schema_item_get_required_children_value( schema_item , value ); - - if (required_children != NULL) { - int ic; - for (ic = 0; ic < stringlist_get_size( required_children ); ic++) { - const char * req_child = stringlist_iget( required_children , ic ); - if (!config_content_has_item(content , req_child )) { - char * error_message = util_alloc_sprintf("When:%s is set to:%s - you also must set:%s.",schema_kw , value , req_child ); - config_error_add( config_content_get_errors( content ) , error_message ); - free( error_message ); - } - } - } - } - } - } - } -} - - - -static void config_validate(config_parser_type * config, config_content_type * content , const char * filename) { - int size = hash_get_size(config->schema_items); - char ** key_list = hash_alloc_keylist(config->schema_items); - int ikey; - for (ikey = 0; ikey < size; ikey++) { - const config_schema_item_type * schema_item = config_get_schema_item( config , key_list[ikey]); - const char * content_key = config_schema_item_get_kw( schema_item ); - if (config_content_has_item( content , content_key)) { - const config_content_item_type * item = config_content_get_item(content , content_key); - config_validate_content_item(config , content , item ); - } else { - if (config_schema_item_required( schema_item)) { /* The item is not set ... */ - char * error_message = util_alloc_sprintf("Item:%s must be set - parsing:%s",content_key , config_content_get_config_file( content , true )); - config_error_add( config_content_get_errors( content ) , error_message ); - free( error_message ); - } - } - } - util_free_stringlist(key_list , size); -} - - - - - - - -/** - This function parses the config file 'filename', and updated the - internal state of the config object as parsing proceeds. If - comment_string != NULL everything following 'comment_string' on a - line is discarded. - - include_kw is a string identifier for an include functionality, if - an include is encountered, the included file is parsed immediately - (through a recursive call to config_parse__). if include_kw == NULL, - include files are not supported. - - Observe that use of include, relative paths and all that shit is - quite tricky. The following is currently implemented: - - 1. The front_end function will split the path to the config file - in a path_name component and a file component. - - 2. Recursive calls to config_parse__() will keep control of the - parsers notion of cwd (note that the real OS'wise cwd never - changes), and every item is tagged with the config_cwd - currently active. - - 3. When an item has been entered with type CONFIG_FILE / - CONFIG_DIRECTORY / CONFIG_EXECUTABLE - the item is updated to - reflect to be relative (iff it is relative in the first place) - to the path of the root config file. - - These are not strict rules - it is possible to get other things to - work as well, but the problem is that it very quickly becomes - dependant on 'arbitrariness' in the parsing configuration. - - validate: whether we should validate when complete, that should - typically only be done at the last parsing. - - - define_kw: This a string which can serve as a "#define" for the - parsing. The define_kw keyword should have two arguments - a key - and a value. If the define_kw is present all __subsequent__ - occurences of 'key' are replaced with 'value'. alloc_new_key - is an optinal function (can be NULL) which is used to alloc a new - key, i.e. add leading and trailing 'magic' characters. - - - Example: - -------- - - char * add_angular_brackets(const char * key) { - char * new_key = util_alloc_sprintf("<%s>" , key); - } - - - - config_parse(... , "myDEF" , add_angular_brackets , ...) - - - Config file: - ------------- - myDEF Name BJARNE - myDEF sexual-pref Dogs - ... - ... - PERSON 28 - ... - ------------ - - After parsing we will have an entry: "NAME" , "Bjarne" , "28" , "Dogs". - - The key-value pairs internalized during the config parsing are NOT - returned to the calling scope in any way. -*/ - - -static void config_parse__(config_parser_type * config , - config_content_type * content , - path_stack_type * path_stack , - const char * config_input , - const char * comment_string , - const char * include_kw , - const char * define_kw , - config_schema_unrecognized_enum unrecognized, - bool validate) { - - /* Guard against circular includes. */ - { - char * abs_filename = util_alloc_realpath(config_input); - if (!config_content_add_file( content , abs_filename )) - util_exit("%s: file:%s already parsed - circular include ? \n",__func__ , abs_filename); - free( abs_filename ); - } - config_path_elm_type * current_path_elm; - - char * config_file; - { - /* Extract the path component of the current input file and chdir() */ - char * config_path; - { - char * config_base; - char * config_ext; - util_alloc_file_components( config_input , &config_path , &config_base , &config_ext); - config_file = util_alloc_filename( NULL , config_base , config_ext ); - free( config_base ); - util_safe_free( config_ext ); - } - current_path_elm = config_content_add_path_elm( content , config_path ); - path_stack_push_cwd( path_stack ); - if (config_path != NULL) { - util_chdir( config_path ); - free( config_path ); - } - } - - - { - const char * comment_end = comment_string ? "\n" : NULL; - basic_parser_type * parser = basic_parser_alloc(" \t" , "\"", NULL , NULL , comment_string , comment_end); - FILE * stream = util_fopen(config_file , "r"); - bool at_eof = false; - - while (!at_eof) { - int active_tokens; - stringlist_type * token_list; - char *line_buffer; - - - line_buffer = util_fscanf_alloc_line(stream , &at_eof); - if (line_buffer != NULL) { - token_list = basic_parser_tokenize_buffer(parser , line_buffer , true); - active_tokens = stringlist_get_size( token_list ); - - /* - util_split_string(line_buffer , " \t" , &tokens , &token_list); - active_tokens = tokens; - for (i = 0; i < tokens; i++) { - char * comment_ptr = NULL; - if(comment_string != NULL) - comment_ptr = strstr(token_list[i] , comment_string); - - if (comment_ptr != NULL) { - if (comment_ptr == token_list[i]) - active_tokens = i; - else - active_tokens = i + 1; - break; - } - } - */ - - if (active_tokens > 0) { - const char * kw = stringlist_iget( token_list , 0 ); - - /*Treating the include keyword. */ - if (include_kw != NULL && (strcmp(include_kw , kw) == 0)) { - if (active_tokens != 2) - util_abort("%s: keyword:%s must have exactly one argument. \n",__func__ ,include_kw); - { - const char *include_file = stringlist_iget( token_list , 1); - if (util_file_exists( include_file )) - config_parse__(config , content , path_stack , include_file , comment_string , include_kw , define_kw , unrecognized, false); /* Recursive call */ - else { - char * error_message = util_alloc_sprintf("%s file:%s not found" , include_kw , include_file); - config_error_add( config_content_get_errors( content ) , error_message ); - free( error_message ); - } - } - } else if ((define_kw != NULL) && (strcmp(define_kw , kw) == 0)) { - /* Treating the define keyword. */ - if (active_tokens < 3) - util_abort("%s: keyword:%s must have exactly one (or more) arguments. \n",__func__ , define_kw); - { - char * key = util_alloc_string_copy( stringlist_iget(token_list ,1) ); - char * value = stringlist_alloc_joined_substring( token_list , 2 , active_tokens , " "); - - { - char * filtered_value = subst_list_alloc_filtered_string( config_content_get_define_list( content ) , value); - config_content_add_define( content , key , filtered_value ); - free( filtered_value ); - } - free(key); - free(value); - } - } else { - if (hash_has_key(config->messages , kw)) - printf("%s \n", (const char *) hash_get(config->messages , kw)); - - if (!config_has_schema_item(config , kw)) { - if (unrecognized == CONFIG_UNRECOGNIZED_WARN) - fprintf(stderr,"** Warning keyword:%s not recognized when parsing:%s --- \n" , kw , config_input); - else if (unrecognized == CONFIG_UNRECOGNIZED_ERROR) { - char * error_message = util_alloc_sprintf("Keyword:%s is not recognized" , kw); - config_error_add( config_content_get_errors( content ) , error_message ); - free( error_message ); - } - } - - if (config_has_schema_item(config , kw)) { - config_schema_item_type * schema_item = config_get_schema_item( config , kw ); - char * config_cwd; - util_alloc_file_components( config_file , &config_cwd , NULL , NULL ); - - if (!config_content_has_item( content , kw )) - config_content_add_item( content , schema_item , current_path_elm); - - - { - subst_list_type * define_list = config_content_get_define_list( content ); - config_content_item_type * content_item = config_content_get_item( content , config_schema_item_get_kw( schema_item ) ); - config_content_node_type * new_node = config_content_item_set_arg__(define_list , config_content_get_errors( content ) , content_item , token_list , current_path_elm , config_file ); - if (new_node) - config_content_add_node( content , new_node ); - - } - } - } - } - stringlist_free(token_list); - free(line_buffer); - } - } - if (validate) - config_validate(config , content , config_file); - fclose(stream); - basic_parser_free( parser ); - } - free(config_file); - path_stack_pop( path_stack ); - config_content_pop_path_stack( content ); -} - - - - - - - - - - - - -config_content_type * config_parse(config_parser_type * config , - const char * filename, - const char * comment_string , - const char * include_kw , - const char * define_kw , - const hash_type * pre_defined_kw_map, - config_schema_unrecognized_enum unrecognized_behaviour, - bool validate) { - - config_content_type * content = config_content_alloc( filename ); - - if(pre_defined_kw_map != NULL) { - hash_iter_type * keys = hash_iter_alloc(pre_defined_kw_map); - - while(!hash_iter_is_complete(keys)) { - const char * key = hash_iter_get_next_key(keys); - const char * value = hash_get(pre_defined_kw_map, key); - config_content_add_define( content , key , value ); - } - - hash_iter_free(keys); - } - - - if (util_file_readable( filename )) { - path_stack_type * path_stack = path_stack_alloc(); - config_parse__(config , content , path_stack , filename , comment_string , include_kw , define_kw , unrecognized_behaviour , validate); - path_stack_free( path_stack ); - } else { - char * error_message = util_alloc_sprintf("Could not open file:%s for parsing" , filename); - config_error_add( config_content_get_errors( content ) , error_message ); - free( error_message ); - } - - if (config_error_count( config_content_get_errors( content ) ) == 0) - config_content_set_valid( content ); - - return content; -} - - - - -/*****************************************************************/ - - - - -/** - This function adds an alias to an existing item; so that the - value+++ of an item can be referred to by two different names. -*/ - - -void config_add_alias(config_parser_type * config , const char * src , const char * alias) { - if (config_has_schema_item(config , src)) { - config_schema_item_type * item = config_get_schema_item(config , src); - config_insert_schema_item(config , alias , item , true); - } else - util_abort("%s: item:%s not recognized \n",__func__ , src); -} - - - -void config_install_message(config_parser_type * config , const char * kw, const char * message) { - hash_insert_hash_owned_ref(config->messages , kw , util_alloc_string_copy(message) , free); -} - - -void config_parser_deprecate(config_parser_type * config , const char * kw, const char * msg) { - if (config_has_schema_item(config , kw)) { - config_schema_item_type * item = config_get_schema_item(config , kw); - config_schema_item_set_deprecated(item , msg); - } else - util_abort("%s: item:%s not recognized \n",__func__ , kw); -} - - -#include "config_get.c" - - diff --git a/ThirdParty/Ert/libconfig/src/config_path_elm.c b/ThirdParty/Ert/libconfig/src/config_path_elm.c deleted file mode 100644 index ca0f8dfbe3..0000000000 --- a/ThirdParty/Ert/libconfig/src/config_path_elm.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'config_path_elm.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include -#include -#include - -#include -#include - -#include -#include - -#define CONFIG_PATH_ELM_TYPE_ID 7100063 - -struct config_path_elm_struct { - UTIL_TYPE_ID_DECLARATION; - char * abs_path; // This will always be absolute - char * rel_path; // This will always be relative to the root path. - const config_root_path_type * root_path; -}; - -static UTIL_SAFE_CAST_FUNCTION( config_path_elm , CONFIG_PATH_ELM_TYPE_ID ) - - -config_path_elm_type * config_path_elm_alloc( const config_root_path_type * root_path , const char * path) { - if (root_path != NULL) { - config_path_elm_type * path_elm = util_malloc( sizeof * path_elm ); - UTIL_TYPE_ID_INIT(path_elm , CONFIG_PATH_ELM_TYPE_ID); - path_elm->root_path = root_path; - if (path == NULL) { - path_elm->rel_path = NULL; - path_elm->abs_path = util_alloc_string_copy( config_root_path_get_abs_path(root_path) ); - } else { - if (util_is_abs_path( path )) { - path_elm->abs_path = util_alloc_string_copy( path ); - path_elm->rel_path = util_alloc_rel_path( config_root_path_get_abs_path(root_path) , path ); - } else { - { - char * tmp_abs_path = util_alloc_filename( config_root_path_get_abs_path(root_path) , path , NULL ); - path_elm->abs_path = util_alloc_abs_path( tmp_abs_path ); - free( tmp_abs_path ); - } - path_elm->rel_path = util_alloc_string_copy( path ); - } - } - return path_elm; - } else { - util_abort("%s: root_path input argument == NULL - invalid \n",__func__); - return NULL; - } -} - - - - -void config_path_elm_free( config_path_elm_type * path_elm ) { - util_safe_free( path_elm->rel_path ); - util_safe_free( path_elm->abs_path ); - free( path_elm ); -} - - - -void config_path_elm_free__( void * arg ) { - config_path_elm_type * path_elm = config_path_elm_safe_cast( arg ); - config_path_elm_free( path_elm ); -} - -const config_root_path_type * config_path_elm_get_rootpath( const config_path_elm_type * path_elm ) { - return path_elm->root_path; -} - -const char * config_path_elm_get_relpath( const config_path_elm_type * path_elm ) { - return path_elm->rel_path; -} - -const char * config_path_elm_get_abspath( const config_path_elm_type * path_elm ) { - return path_elm->abs_path; -} - - -/*****************************************************************/ - - -char * config_path_elm_alloc_path(const config_path_elm_type * path_elm , const char * path) { - if (util_is_abs_path( path )) - return util_alloc_string_copy( path ); - else { - /* This will be relative or absolute depending on the relative/absolute - status of the root_path. */ - const char * input_root = config_root_path_get_input_path( path_elm->root_path ); - if (input_root == NULL) - return util_alloc_filename( path_elm->rel_path , path , NULL); - else - return util_alloc_joined_string( (const char *[3]) { input_root , path_elm->rel_path , path } , 3 , UTIL_PATH_SEP_STRING ); - } -} - - -char * config_path_elm_alloc_relpath(const config_path_elm_type * path_elm , const char * input_path) { - if (util_is_abs_path( input_path )) - return util_alloc_rel_path( config_root_path_get_rel_path( path_elm->root_path ) , input_path); - else { - char * abs_path = config_path_elm_alloc_abspath( path_elm , input_path ); - char * rel_path = util_alloc_rel_path( config_root_path_get_abs_path( path_elm->root_path ) , abs_path ); - free( abs_path ); - return rel_path; - } -} - - -char * config_path_elm_alloc_abspath(const config_path_elm_type * path_elm , const char * input_path) { - if (util_is_abs_path( input_path )) - return util_alloc_string_copy( input_path ); - else { - char * abs_path1 = util_alloc_filename( path_elm->abs_path , input_path , NULL ); - char * abs_path = util_alloc_realpath__( abs_path1 ); // The util_alloc_realpath__() will work also for nonexsting paths - free( abs_path1 ); - return abs_path; - } -} diff --git a/ThirdParty/Ert/libconfig/src/config_root_path.c b/ThirdParty/Ert/libconfig/src/config_root_path.c deleted file mode 100644 index ba251bbc6f..0000000000 --- a/ThirdParty/Ert/libconfig/src/config_root_path.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'config_root_path.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include -#include -#include - -#include - -#include - -struct config_root_path_struct { - char * input_path; - char * abs_path; - char * rel_path; -}; - - -/** - Input must be an existing directory, which will be used as the - root; or NULL in which case cwd will be used as root. The input - directory can be both realtive or absolute. -*/ - -config_root_path_type * config_root_path_alloc( const char * input_path ) { - if (input_path == NULL || util_is_directory( input_path )) { - config_root_path_type * root_path = util_malloc( sizeof * root_path ); - { - char * cwd = util_alloc_cwd(); - - root_path->input_path = util_alloc_string_copy( input_path ); - if (input_path == NULL) { - root_path->rel_path = NULL; - root_path->abs_path = util_alloc_string_copy( cwd ); - } else { - if (util_is_abs_path( input_path )) { - root_path->abs_path = util_alloc_string_copy( input_path ); - root_path->rel_path = util_alloc_rel_path( cwd , root_path->abs_path); - } else { - root_path->rel_path = util_alloc_string_copy( input_path ); - { - char * abs_path = util_alloc_filename( cwd , input_path , NULL ); - root_path->abs_path = util_alloc_realpath( abs_path ); - free( abs_path ); - } - } - } - free( cwd ); - } - return root_path; - } else - return NULL; -} - - -void config_root_path_free( config_root_path_type * root_path ) { - util_safe_free( root_path->rel_path ); - util_safe_free( root_path->abs_path ); - util_safe_free( root_path->input_path ); - free( root_path ); -} - -const char * config_root_path_get_input_path( const config_root_path_type * root_path ) { - return root_path->input_path; -} - - -const char * config_root_path_get_rel_path( const config_root_path_type * root_path ) { - return root_path->rel_path; -} - - -const char * config_root_path_get_abs_path( const config_root_path_type * root_path ) { - return root_path->abs_path; -} - - -void config_root_path_printf( const config_root_path_type * root_path ) { - printf("input_path : %s \n" , root_path->input_path); - printf("abs_path : %s \n" , root_path->abs_path); - printf("rel_path : %s \n" , root_path->rel_path); -} - - diff --git a/ThirdParty/Ert/libconfig/src/config_schema_item.c b/ThirdParty/Ert/libconfig/src/config_schema_item.c deleted file mode 100644 index 897d360fd5..0000000000 --- a/ThirdParty/Ert/libconfig/src/config_schema_item.c +++ /dev/null @@ -1,583 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'config_schema_item.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -typedef struct validate_struct validate_type; - -/** - This is a 'support-struct' holding various pieces of information - needed during the validation process. Observe the following about - validation: - - 1. It is atomic, in the sense that if you try to an item like this: - - KW ARG1 ARG2 ARG3 - - where ARG1 and ARG2 are valid, whereas there is something wrong - with ARG3, NOTHING IS SET. - - 2. Validation is a two-step process, the first step is run when an - item is parsed. This includes checking: - - o The number of argument. - o That the arguments have the right type. - o That the values match the selection set. - - The second validation step is done when the pasing is complete, - in this pass we check dependencies - i.e. required_children and - required_children_on_value. - - - Observe that nothing has-to be set in this struct. There are some dependencies: - - 1. Only _one_ of common_selection_set and indexed_selection_set - can be set. - - 2. If setting indexed_selection_set or type_map, you MUST set - argc_max first. -*/ - - -struct validate_struct { - int argc_min; /* The minimum number of arguments: -1 means no lower limit. */ - int argc_max; /* The maximum number of arguments: -1 means no upper limit. */ - set_type * common_selection_set; /* A selection set which will apply uniformly to all the arguments. */ - int_vector_type * type_map; /* A list of types for the items. Set along with argc_minmax(); */ - stringlist_type * required_children; /* A list of item's which must also be set (if this item is set). (can be NULL) */ - hash_type * required_children_value; /* A list of item's which must also be set - depending on the value of this item. (can be NULL) (This one is complex). */ - vector_type * indexed_selection_set; /* A vector of set_type instances which will apply for specific (indexed) arguments. */ -}; - - - - - -#define CONFIG_SCHEMA_ITEM_ID 6751 -struct config_schema_item_struct { - UTIL_TYPE_ID_DECLARATION; - char * kw; /* The kw which identifies this item */ - - - bool required_set; - stringlist_type * required_children; /* A list of item's which must also be set (if this item is set). (can be NULL) */ - hash_type * required_children_value; /* A list of item's which must also be set - depending on the value of this item. (can be NULL) */ - validate_type * validate; /* Information need during validation. */ - bool expand_envvar; /* Should environment variables like $HOME be expanded?*/ - bool deprecated; - char * deprecate_msg; -}; - - -/*****************************************************************/ - - -/*****************************************************************/ -static void validate_set_default_type( validate_type * validate , config_item_types item_type) { - int_vector_set_default(validate->type_map , item_type); -} - -static validate_type * validate_alloc() { - validate_type * validate = util_malloc(sizeof * validate ); - validate->argc_min = CONFIG_DEFAULT_ARG_MIN; - validate->argc_max = CONFIG_DEFAULT_ARG_MAX; - validate->common_selection_set = NULL; - validate->indexed_selection_set = vector_alloc_new(); - validate->required_children = NULL; - validate->required_children_value = NULL; - validate->type_map = int_vector_alloc(0 , 0); - validate_set_default_type( validate , CONFIG_STRING ); - return validate; -} - - -static void validate_free(validate_type * validate) { - if (validate->common_selection_set != NULL) set_free(validate->common_selection_set); - - vector_free( validate->indexed_selection_set ); - int_vector_free( validate->type_map ); - if (validate->required_children != NULL) stringlist_free(validate->required_children); - if (validate->required_children_value != NULL) hash_free(validate->required_children_value); - free(validate); -} - - -static void validate_iset_type( validate_type * validate , int index , config_item_types type) { - int_vector_iset( validate->type_map , index , type); -} - - -static config_item_types validate_iget_type( const validate_type * validate , int index) { - return int_vector_safe_iget( validate->type_map , index ); -} - - -static void validate_set_argc_minmax(validate_type * validate , int argc_min , int argc_max) { - if (validate->argc_min != CONFIG_DEFAULT_ARG_MIN) - util_abort("%s: sorry - current implementation does not allow repeated calls to: %s \n",__func__ , __func__); - - if (argc_min == CONFIG_DEFAULT_ARG_MIN) - argc_min = 0; - - validate->argc_min = argc_min; - validate->argc_max = argc_max; - - if ((argc_max != CONFIG_DEFAULT_ARG_MAX) && (argc_max < argc_min)) - util_abort("%s invalid arg min/max values. argc_min:%d argc_max:%d \n",__func__ , argc_min , argc_max); - - { - int internal_type_size = 0; /* Should end up in the range [argc_min,argc_max] */ - - if (argc_max > 0) - internal_type_size = argc_max; - else - internal_type_size = argc_min; - } - -} - - - -static void validate_set_common_selection_set(validate_type * validate , int argc , const char ** argv) { - if (validate->common_selection_set != NULL) - set_free(validate->common_selection_set); - validate->common_selection_set = set_alloc( argc , argv ); -} - - -static set_type * validate_iget_selection_set( validate_type * validate , int index) { - return vector_safe_iget( validate->indexed_selection_set , index); -} - -static void validate_add_indexed_alternative(validate_type * validate , int index , const char * value) { - set_type * set = validate_iget_selection_set( validate , index ); - - if (!set) { - vector_safe_iset_owned_ref( validate->indexed_selection_set , index , set_alloc(0,NULL) , set_free__ ); - set = vector_safe_iget( validate->indexed_selection_set , index); - } - - set_add_key( set , value ); -} - - - -static void validate_set_indexed_selection_set(validate_type * validate , int index , int argc , const char ** argv) { - - if (validate->indexed_selection_set == NULL) - util_abort("%s: must call xxx_set_argc_minmax() first - aborting \n",__func__); - - if (index >= validate->argc_min) - util_abort("%s: When not not setting argc_max selection set can only be applied to indices up to argc_min\n",__func__); - - vector_safe_iset_owned_ref( validate->indexed_selection_set , index , set_alloc(argc,argv) , set_free__ ); -} - - -/*****************************************************************/ - - -static UTIL_SAFE_CAST_FUNCTION( config_schema_item , CONFIG_SCHEMA_ITEM_ID) - -void config_schema_item_assure_type(const config_schema_item_type * item , int index , int type_mask) { - bool OK = false; - - if (int_vector_safe_iget( item->validate->type_map , index) & type_mask) - OK = true; - - if (!OK) - util_abort("%s: failed - wrong installed type \n" , __func__); -} - - -config_schema_item_type * config_schema_item_alloc(const char * kw , bool required) { - config_schema_item_type * item = util_malloc(sizeof * item ); - UTIL_TYPE_ID_INIT( item , CONFIG_SCHEMA_ITEM_ID); - item->kw = util_alloc_string_copy(kw); - - item->required_set = required; - item->deprecated = false; - item->deprecate_msg = NULL; - item->required_children = NULL; - item->required_children_value = NULL; - item->expand_envvar = true; /* Default is to expand $VAR expressions; can be turned off with - config_schema_item_set_envvar_expansion( item , false ); */ - item->validate = validate_alloc(); - return item; -} - - - -static char * __alloc_relocated__(const config_path_elm_type * path_elm , const char * value) { - char * file; - - if (util_is_abs_path(value)) - file = util_alloc_string_copy( value ); - else - file = util_alloc_filename(config_path_elm_get_relpath( path_elm ) , value , NULL); - - return file; -} - -bool config_schema_item_valid_string(config_item_types value_type , const char * value) -{ - switch(value_type) { - case(CONFIG_ISODATE): - return util_sscanf_isodate( value , NULL ); - break; - case(CONFIG_INT): - return util_sscanf_int( value , NULL ); - break; - case(CONFIG_FLOAT): - return util_sscanf_double( value , NULL ); - break; - case(CONFIG_BOOL): - return util_sscanf_bool( value , NULL ); - break; - case(CONFIG_BYTESIZE): - return util_sscanf_bytesize( value , NULL); - break; - default: - return true; - } -} - - -bool config_schema_item_validate_set(const config_schema_item_type * item , stringlist_type * token_list , const char * config_file, const config_path_elm_type * path_elm , config_error_type * error_list) { - bool OK = true; - int argc = stringlist_get_size( token_list ) - 1; - if (item->validate->argc_min >= 0) { - if (argc < item->validate->argc_min) { - OK = false; - { - char * error_message; - if (config_file != NULL) - error_message = util_alloc_sprintf("Error when parsing config_file:\"%s\" Keyword:%s must have at least %d arguments.",config_file , item->kw , item->validate->argc_min); - else - error_message = util_alloc_sprintf("Error:: Keyword:%s must have at least %d arguments.",item->kw , item->validate->argc_min); - - config_error_add( error_list , error_message ); - } - } - } - - if (item->validate->argc_max >= 0) { - if (argc > item->validate->argc_max) { - OK = false; - { - char * error_message; - - if (config_file != NULL) - error_message = util_alloc_sprintf("Error when parsing config_file:\"%s\" Keyword:%s must have maximum %d arguments.",config_file , item->kw , item->validate->argc_max); - else - error_message = util_alloc_sprintf("Error:: Keyword:%s must have maximum %d arguments.",item->kw , item->validate->argc_max); - - config_error_add( error_list , error_message ); - } - } - } - - /* - OK - now we have verified that the number of arguments is correct. Then - we start actually looking at the values. - */ - if (OK) { - /* Validating selection set - first common, then indexed */ - if (item->validate->common_selection_set) { - for (int iarg = 0; iarg < argc; iarg++) { - if (!set_has_key(item->validate->common_selection_set , stringlist_iget( token_list , iarg + 1))) { - config_error_add( error_list , util_alloc_sprintf("%s: is not a valid value for: %s.",stringlist_iget( token_list , iarg + 1) , item->kw)); - OK = false; - } - } - } else if (item->validate->indexed_selection_set != NULL) { - for (int iarg = 0; iarg < argc; iarg++) { - if ((item->validate->argc_max > 0) || (iarg < item->validate->argc_min)) { /* Without this test we might go out of range on the indexed selection set. */ - const set_type * selection_set = validate_iget_selection_set( item->validate , iarg); - if (selection_set) { - if (!set_has_key( selection_set, stringlist_iget( token_list , iarg + 1))) { - config_error_add( error_list , util_alloc_sprintf("%s: is not a valid value for item %d of \'%s\'.",stringlist_iget( token_list , iarg + 1) , iarg + 1 , item->kw)); - OK = false; - } - } - } - } - } - - /* - Observe that the following code might rewrite the content of - argv for arguments referring to path locations. - */ - - - /* Validate the TYPE of the various argumnents */ - { - for (int iarg = 0; iarg < argc; iarg++) { - const char * value = stringlist_iget(token_list , iarg + 1); - switch (validate_iget_type( item->validate , iarg)) { - case(CONFIG_STRING): /* This never fails ... */ - break; - case(CONFIG_ISODATE): - if (!util_sscanf_isodate( value , NULL )) - config_error_add( error_list , util_alloc_sprintf("Failed to parse:%s as an ISO date: YYYY-MM-DD.",value)); - break; - case(CONFIG_INT): - if (!util_sscanf_int( value , NULL )) - config_error_add( error_list , util_alloc_sprintf("Failed to parse:%s as an integer.",value)); - break; - case(CONFIG_FLOAT): - if (!util_sscanf_double( value , NULL )) { - config_error_add( error_list , util_alloc_sprintf("Failed to parse:%s as a floating point number.", value)); - OK = false; - } - break; - case(CONFIG_PATH): - // As long as we do not reuqire the path to exist it is just a string. - break; - case(CONFIG_EXISTING_PATH): - { - char * path = config_path_elm_alloc_abspath( path_elm , value ); - if (!util_entry_exists(path)) { - config_error_add( error_list , util_alloc_sprintf("Can not find entry %s in %s ",value , config_path_elm_get_relpath( path_elm) )); - OK = false; - } - free( path ); - } - break; - case(CONFIG_EXECUTABLE): - { - /* - 1. If the supplied value is an abolute path - do nothing. - 2. If the supplied is _not_ an absolute path: - - a. Try if the relocated exists - then use that. - b. Else - try if the util_alloc_PATH_executable() exists. - */ - if (!util_is_abs_path( value )) { - char * relocated = __alloc_relocated__(path_elm , value); - char * path_exe = util_alloc_PATH_executable( value ); - - if (util_file_exists(relocated)) { - if (util_is_executable(relocated)) - stringlist_iset_copy( token_list , iarg , relocated); - } else if (path_exe != NULL) - stringlist_iset_copy( token_list , iarg , path_exe); - else - config_error_add( error_list , util_alloc_sprintf("Could not locate executable:%s ", value)); - - free(relocated); - util_safe_free(path_exe); - } else { - if (!util_is_executable( value )) - config_error_add( error_list , util_alloc_sprintf("Could not locate executable:%s ", value)); - } - } - break; - case(CONFIG_BOOL): - if (!util_sscanf_bool( value , NULL )) { - config_error_add( error_list , util_alloc_sprintf("Failed to parse:%s as a boolean.", value)); - OK = false; - } - break; - case(CONFIG_BYTESIZE): - if (!util_sscanf_bytesize( value , NULL)) { - config_error_add( error_list , util_alloc_sprintf("Failed to parse:\"%s\" as number of bytes." , value)); - OK = false; - } - break; - default: - util_abort("%s: config_item_type:%d not recognized \n",__func__ , validate_iget_type(item->validate , iarg)); - } - } - } - } - return OK; -} - - -void config_schema_item_free( config_schema_item_type * item) { - free(item->kw); - free( item->deprecate_msg ); - if (item->required_children != NULL) stringlist_free(item->required_children); - if (item->required_children_value != NULL) hash_free(item->required_children_value); - validate_free(item->validate); - free(item); -} - - -void config_schema_item_free__ (void * void_item) { - config_schema_item_type * item = config_schema_item_safe_cast( void_item ); - config_schema_item_free( item ); -} - - - -void config_schema_item_set_required_children_on_value(config_schema_item_type * item , const char * value , stringlist_type * child_list) { - if (item->required_children_value == NULL) - item->required_children_value = hash_alloc(); - hash_insert_hash_owned_ref( item->required_children_value , value , stringlist_alloc_deep_copy(child_list) , stringlist_free__); -} - - - -/** - This function is used to set the minimum and maximum number of - arguments for an item. In addition you can pass in a pointer to an - array of config_schema_item_types values which will be used for validation - of the input. This vector must be argc_max elements long; it can be - NULL. -*/ - - -void config_schema_item_set_argc_minmax(config_schema_item_type * item , - int argc_min , - int argc_max) { - - validate_set_argc_minmax(item->validate , argc_min , argc_max); - -} - -void config_schema_item_iset_type( config_schema_item_type * item , int index , config_item_types type) { - validate_iset_type( item->validate , index , type ); -} - -void config_schema_item_set_default_type( config_schema_item_type * item , config_item_types type) { - validate_set_default_type( item->validate , type ); -} - - -config_item_types config_schema_item_iget_type(const config_schema_item_type * item , int index ) { - return validate_iget_type( item->validate , index ); -} - - - - -void config_schema_item_set_envvar_expansion( config_schema_item_type * item , bool expand_envvar ) { - item->expand_envvar = expand_envvar; -} - - - -void config_schema_item_set_common_selection_set(config_schema_item_type * item , int argc , const char ** argv) { - validate_set_common_selection_set(item->validate , argc , argv); -} - -void config_schema_item_set_indexed_selection_set(config_schema_item_type * item , int index , int argc , const char ** argv) { - validate_set_indexed_selection_set(item->validate , index , argc , argv); -} - -void config_schema_item_add_indexed_alternative(config_schema_item_type * item , int index , const char * value) { - validate_add_indexed_alternative(item->validate , index , value); -} - - - -void config_schema_item_set_required_children(config_schema_item_type * item , stringlist_type * stringlist) { - item->required_children = stringlist_alloc_deep_copy(stringlist); -} - -void config_schema_item_add_required_children(config_schema_item_type * item , const char * child_key) { - if (item->required_children == NULL) - item->required_children = stringlist_alloc_new(); - - stringlist_append_copy( item->required_children , child_key ); -} - - -int config_schema_item_num_required_children(const config_schema_item_type * item) { - if (item->required_children == NULL) - return 0; - else - return stringlist_get_size( item->required_children ); -} - - -const char * config_schema_item_iget_required_child( const config_schema_item_type * item , int index) { - return stringlist_iget( item->required_children , index ); -} - - -const char * config_schema_item_get_kw( const config_schema_item_type * item ) { - return item->kw; -} - - -bool config_schema_item_required( const config_schema_item_type * item ) { - return item->required_set; -} - - -bool config_schema_item_expand_envvar( const config_schema_item_type * item ) { - return item->expand_envvar; -} - - -void config_schema_item_get_argc( const config_schema_item_type * item , int *argc_min , int *argc_max) { - *argc_min = item->validate->argc_min; - *argc_max = item->validate->argc_max; -} - - - -bool config_schema_item_has_required_children_value( const config_schema_item_type * item ) { - if (item->required_children_value == NULL) - return false; - else - return true; -} - - - -stringlist_type * config_schema_item_get_required_children_value(const config_schema_item_type * item , const char * value) { - return hash_safe_get( item->required_children_value , value ); -} - -bool config_schema_item_is_deprecated( const config_schema_item_type * item) { - return item->deprecated; -} - -const char * config_schema_item_get_deprecate_msg( const config_schema_item_type * item) { - return item->deprecate_msg; -} - -void config_schema_item_set_deprecated( config_schema_item_type * item , const char * msg) { - item->deprecated = true; - item->deprecate_msg = util_realloc_string_copy(item->deprecate_msg, msg); -} - - -/*****************************************************************/ -/* Small functions to support enum introspection. */ - diff --git a/ThirdParty/Ert/libconfig/src/config_settings.c b/ThirdParty/Ert/libconfig/src/config_settings.c deleted file mode 100644 index ef9c175251..0000000000 --- a/ThirdParty/Ert/libconfig/src/config_settings.c +++ /dev/null @@ -1,340 +0,0 @@ -/* - Copyright (C) 2017 Statoil ASA, Norway. - - The file 'config_settings.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include - -#include -#include -#include - -#include -#include - - -#define CONFIG_SETTINGS_TYPE_ID 68621527 -#define SETTING_NODE_TYPE_ID 76254096 - - -struct config_settings_struct { - UTIL_TYPE_ID_DECLARATION; - char * root_key; - hash_type * settings; -}; - -/*****************************************************************/ - -typedef struct setting_node_struct setting_node_type; - -struct setting_node_struct { - UTIL_TYPE_ID_DECLARATION; - config_item_types value_type; - char * key; - char * string_value; -}; - -static void setting_node_assert_type( const setting_node_type * node , config_item_types expected_type) { - if (node->value_type != expected_type) - util_abort("%s: internal error. Asked for type:%d is of type:%d \n",__func__ , expected_type , node->value_type); -} - -UTIL_SAFE_CAST_FUNCTION( setting_node , SETTING_NODE_TYPE_ID ) - -static setting_node_type * setting_node_alloc( const char * key, config_item_types value_type, const char * initial_value) { - if (!config_schema_item_valid_string( value_type , initial_value)) - return NULL; - - { - setting_node_type * node = util_malloc( sizeof * node ); - UTIL_TYPE_ID_INIT( node , SETTING_NODE_TYPE_ID ); - node->value_type = value_type; - node->string_value = util_alloc_string_copy( initial_value ); - node->key = util_alloc_string_copy( key ); - return node; - } -} - - -static void setting_node_free( setting_node_type * node ) { - free( node->key ); - free( node->string_value ); - free( node ); -} - - -static void setting_node_free__( void * arg ) { - setting_node_type * node = setting_node_safe_cast( arg ); - setting_node_free( node ); -} - - -static bool setting_node_set_value( setting_node_type * node, const char * value) { - if (config_schema_item_valid_string(node->value_type , value)) { - node->string_value = util_realloc_string_copy( node->string_value , value ); - return true; - } else - return false; -} - - -static void setting_node_set_string_value( setting_node_type * node, const char * value) { - setting_node_assert_type( node , CONFIG_STRING ); - setting_node_set_value( node , value ); -} - - -static void setting_node_set_int_value( setting_node_type * node, int value) { - setting_node_assert_type( node , CONFIG_INT ); - { - char * string_value = util_alloc_sprintf("%d" , value); - setting_node_set_value( node , string_value ); - free( string_value ); - } -} - -static void setting_node_set_double_value( setting_node_type * node, double value) { - setting_node_assert_type( node , CONFIG_FLOAT ); - { - char * string_value = util_alloc_sprintf("%g" , value); - setting_node_set_value( node , string_value ); - free( string_value ); - } -} - - -static void setting_node_set_bool_value( setting_node_type * node, bool value) { - bool bool_value; - setting_node_assert_type( node , CONFIG_BOOL ); - if (value) - setting_node_set_value( node , "True"); - else - setting_node_set_value( node , "False"); -} - - -static const char * setting_node_get_value( const setting_node_type * node) { - return node->string_value; -} - - -static const char * setting_node_get_string_value( const setting_node_type * node) { - setting_node_assert_type( node , CONFIG_STRING ); - return node->string_value; -} - -static int setting_node_get_int_value( const setting_node_type * node) { - setting_node_assert_type( node , CONFIG_INT ); - return strtol( node->string_value , NULL , 10 ); -} - -static double setting_node_get_double_value( const setting_node_type * node) { - setting_node_assert_type( node , CONFIG_FLOAT ); - return strtod( node->string_value , NULL ); -} - - -static bool setting_node_get_bool_value( const setting_node_type * node) { - bool bool_value; - setting_node_assert_type( node , CONFIG_BOOL ); - util_sscanf_bool( node->string_value , &bool_value ); - return bool_value; -} - - - - -/*****************************************************************/ - -config_settings_type * config_settings_alloc( const char * root_key ) { - config_settings_type * settings = util_malloc( sizeof * settings ); - settings->root_key = util_alloc_string_copy( root_key ); - settings->settings = hash_alloc(); - return settings; -} - - -void config_settings_free( config_settings_type * settings) { - free( settings->root_key ); - hash_free( settings->settings ); - free( settings ); -} - - - -bool config_settings_add_setting(config_settings_type * settings , const char* key, config_item_types value_type , const char* initial_value) { - setting_node_type * node = setting_node_alloc( key , value_type , initial_value); - if (node) { - hash_insert_hash_owned_ref( settings->settings , key , node , setting_node_free__ ); - return true; - } else - return false; -} - - -void config_settings_add_bool_setting(config_settings_type * settings , const char* key, bool initial_value) { - if (initial_value) - config_settings_add_setting( settings , key , CONFIG_BOOL , "True"); - else - config_settings_add_setting( settings , key , CONFIG_BOOL , "False"); -} - - -void config_settings_add_int_setting(config_settings_type * settings , const char* key, int initial_value) { - char * string_value = util_alloc_sprintf("%d" , initial_value); - config_settings_add_setting( settings , key , CONFIG_INT , string_value); - free( string_value ); -} - - -void config_settings_add_double_setting(config_settings_type * settings , const char* key, double initial_value) { - char * string_value = util_alloc_sprintf("%g" , initial_value); - config_settings_add_setting( settings , key , CONFIG_FLOAT , string_value); - free( string_value ); -} - - -void config_settings_add_string_setting(config_settings_type * settings , const char* key, const char * initial_value) { - config_settings_add_setting( settings , key , CONFIG_STRING , initial_value); -} - - - - -bool config_settings_has_key( const config_settings_type * settings , const char * key) { - return hash_has_key( settings->settings , key ); -} - -static setting_node_type * config_settings_get_node( const config_settings_type * config_settings, const char * key){ - return hash_get( config_settings->settings , key ); -} - - -const char * config_settings_get_value( const config_settings_type * config_settings , const char * key) { - setting_node_type * node = config_settings_get_node( config_settings , key ); - return setting_node_get_value( node ); -} - -const char * config_settings_get_string_value( const config_settings_type * config_settings , const char * key) { - setting_node_type * node = config_settings_get_node( config_settings , key ); - return setting_node_get_string_value( node ); -} - -double config_settings_get_double_value( const config_settings_type * config_settings , const char * key) { - setting_node_type * node = config_settings_get_node( config_settings , key ); - return setting_node_get_double_value( node ); -} - -int config_settings_get_int_value( const config_settings_type * config_settings , const char * key) { - setting_node_type * node = config_settings_get_node( config_settings , key ); - return setting_node_get_int_value( node ); -} - - -bool config_settings_get_bool_value( const config_settings_type * config_settings , const char * key) { - setting_node_type * node = config_settings_get_node( config_settings , key ); - return setting_node_get_bool_value( node ); -} - -config_item_types config_settings_get_value_type( const config_settings_type * config_settings , const char * key) { - setting_node_type * node = config_settings_get_node( config_settings , key ); - return node->value_type; -} - - -bool config_settings_set_value( const config_settings_type * config_settings , const char * key, const char * value) { - if (config_settings_has_key( config_settings , key )) { - setting_node_type * node = config_settings_get_node( config_settings , key ); - return setting_node_set_value( node, value ); - } - - return false; -} - - -bool config_settings_set_int_value( const config_settings_type * config_settings , const char * key, int value) { - if (config_settings_has_key( config_settings , key )) { - setting_node_type * node = config_settings_get_node( config_settings , key ); - setting_node_set_int_value( node, value ); - return true; - } - - return false; -} - - -bool config_settings_set_double_value( const config_settings_type * config_settings , const char * key, double value) { - if (config_settings_has_key( config_settings , key )) { - setting_node_type * node = config_settings_get_node( config_settings , key ); - setting_node_set_double_value( node, value ); - return true; - } - - return false; -} - - -bool config_settings_set_bool_value( const config_settings_type * config_settings , const char * key, bool value) { - if (config_settings_has_key( config_settings , key )) { - setting_node_type * node = config_settings_get_node( config_settings , key ); - setting_node_set_bool_value( node, value ); - return true; - } - - return false; -} - - -bool config_settings_set_string_value( const config_settings_type * config_settings , const char * key, const char * value) { - if (config_settings_has_key( config_settings , key )) { - setting_node_type * node = config_settings_get_node( config_settings , key ); - setting_node_set_string_value( node, value ); - return true; - } - - return false; -} - - - - -void config_settings_init_parser__( const char * root_key , config_parser_type * config , bool required) { - config_schema_item_type * item = config_add_schema_item(config, root_key , required); - config_schema_item_set_argc_minmax(item, 2, 2); -} - - - -void config_settings_init_parser( const config_settings_type * config_settings, config_parser_type * config , bool required) { - config_settings_init_parser__( config_settings->root_key , config , required ); -} - - -void config_settings_apply(config_settings_type * config_settings , const config_content_type * config ) { - for (int i = 0; i < config_content_get_occurences(config, config_settings->root_key); i++) { - const stringlist_type * tokens = config_content_iget_stringlist_ref(config, config_settings->root_key , i); - const char * setting = stringlist_iget(tokens, 0); - const char * value = stringlist_iget(tokens, 1); - - bool set_ok = config_settings_set_value( config_settings , setting , value ); - if (!set_ok) - fprintf(stderr," ** Warning: failed to apply CONFIG_SETTING %s=%s \n",setting,value); - } -} - - -stringlist_type * config_settings_alloc_keys( const config_settings_type * config_settings ) { - return hash_alloc_stringlist(config_settings->settings); -} diff --git a/ThirdParty/Ert/libconfig/src/testcase/test.txt b/ThirdParty/Ert/libconfig/src/testcase/test.txt deleted file mode 100644 index 075a883f95..0000000000 --- a/ThirdParty/Ert/libconfig/src/testcase/test.txt +++ /dev/null @@ -1,76 +0,0 @@ --- Dette er en OK kommentar. - - - - - -" " -HISTORY_OBSERVATION C-17:WOPR -{ - ERROR = 0.10; - ERROR_MODE = "rel"; - ERROR_MIN = 0.10; -}; - - - -HISTORY_OBSERVATION C-17:WGOR; -HISTORY_OBSERVATION C-17:WWCT; - - - - -SUMMARY_OBSERVATION SEP_TEST_2006 -{ - VALUE = 1; - ERROR = 0.1; --- DATE = 22/10/2006; --- DAYS = 100; - RESTART = 10; - KEY = GOPR:G4; -}; - - - -SUMMARY_OBSERVATION SEP_TEST_2007 -{ - VALUE = 1; - ERROR = 0.1; - RESTART = 10; - KEY = GOPR:G4; -}; - - - -BLOCK_OBSERVATION RFT_2005 -{ - DATE = 22/10/2005; - - OBS P1 { I=1; J=1; K=1; VALUE=10; ERROR=1;}; - OBS P2 { I=2; J=1; K=1; VALUE=10; ERROR=1;}; - OBS P3 { I=3; J=1; K=1; VALUE=10; ERROR=1;}; - OBS P4 { I=4; J=1; K=1; VALUE=10; ERROR=1;}; - OBS P5 { I=5; J=1; K=1; VALUE=10; ERROR=1;}; - OBS P6 { I=6; J=1; K=1; VALUE=10; ERROR=1;}; - OBS P7 { I=7; J=1; K=1; VALUE=10; ERROR=1;}; - OBS P8 { I=8; J=1; K=1; VALUE=10; ERROR=1;}; - OBS P9 { I=9; J=1; K=1; VALUE=10; ERROR=1;}; - OBS P10 { I=10; J=1; K=1; VALUE=10; ERROR=1;}; - OBS P11 { I=11; J=1; K=1; VALUE=10; ERROR=1;}; - OBS P12 { I=12; J=1; K=1; VALUE=10; ERROR=1;}; - - - FIELD = SWAT; -}; - -INTVEC = -[ -0 -1 -2 -3 -]; - -DOUBLEVEC = [0.1, 0.2, 10.1, 3.14]; - -SINGLETON svada; diff --git a/ThirdParty/Ert/libconfig/src/testcase/test2.txt b/ThirdParty/Ert/libconfig/src/testcase/test2.txt deleted file mode 100644 index b0f1e1a668..0000000000 --- a/ThirdParty/Ert/libconfig/src/testcase/test2.txt +++ /dev/null @@ -1,9 +0,0 @@ --- Dette er en OK kommentar. - - -HISTORY_OBSERVATION C-18:WOPR -{ - ERROR = 0.10; - ERROR_MODE = "rel"; - ERROR_MIN = 0.10; -}; diff --git a/ThirdParty/Ert/libconfig/tests/CMakeLists.txt b/ThirdParty/Ert/libconfig/tests/CMakeLists.txt deleted file mode 100644 index 456b59144b..0000000000 --- a/ThirdParty/Ert/libconfig/tests/CMakeLists.txt +++ /dev/null @@ -1,61 +0,0 @@ -add_executable( config_append_test config_append_test.c ) -target_link_libraries( config_append_test config test_util ) - -add_executable( config_node_test config_node_test.c ) -target_link_libraries( config_node_test config test_util ) - -add_executable( config_typeOK config_typeOK.c ) -target_link_libraries( config_typeOK config test_util ) - -add_executable( config_typeFail config_typeFail.c ) -target_link_libraries( config_typeFail config test_util ) - -add_executable( config_path_elm config_path_elm.c ) -target_link_libraries( config_path_elm config test_util ) - -add_executable( config_root_path config_root_path.c ) -target_link_libraries( config_root_path config test_util ) - -add_executable( config_include_test config_include_test.c) -target_link_libraries( config_include_test config test_util ) - -add_executable( config_content_node config_content_node.c) -target_link_libraries( config_content_node config test_util ) - -add_executable( config_content_item config_content_item.c) -target_link_libraries( config_content_item config test_util ) - -add_executable( config_argc config_argc.c) -target_link_libraries( config_argc config test_util ) - -add_executable( config_define config_define.c) -target_link_libraries( config_define config test_util ) - -add_executable( config_error config_error.c) -target_link_libraries( config_error config test_util ) -add_test( config_error ${EXECUTABLE_OUTPUT_PATH}/config_error ) - -add_executable( config_content config_content.c) -target_link_libraries( config_content config test_util ) -add_test( config_content ${EXECUTABLE_OUTPUT_PATH}/config_content ) - - -add_executable( config_config config_config.c) -target_link_libraries( config_config config test_util ) -add_test( config_config ${EXECUTABLE_OUTPUT_PATH}/config_config ) - -add_executable( config_schema_item config_schema_item.c) -target_link_libraries( config_schema_item config test_util ) -add_test( config_schema_item ${EXECUTABLE_OUTPUT_PATH}/config_schema_item ) - -add_test( config_typeOK ${EXECUTABLE_OUTPUT_PATH}/config_typeOK ${CMAKE_CURRENT_SOURCE_DIR}/data/type_testOK ) -add_test( config_typeFail ${EXECUTABLE_OUTPUT_PATH}/config_typeFail ${CMAKE_CURRENT_SOURCE_DIR}/data/type_testFail ) -add_test( config_append_test ${EXECUTABLE_OUTPUT_PATH}/config_append_test ${CMAKE_CURRENT_SOURCE_DIR}/data/append_test ) -add_test( config_node_test ${EXECUTABLE_OUTPUT_PATH}/config_node_test ${CMAKE_CURRENT_SOURCE_DIR}/data/append_test ) -add_test( config_define ${EXECUTABLE_OUTPUT_PATH}/config_define ${CMAKE_CURRENT_SOURCE_DIR}/data/define_test ) -add_test( config_path_elm ${EXECUTABLE_OUTPUT_PATH}/config_path_elm ) -add_test( config_content_node ${EXECUTABLE_OUTPUT_PATH}/config_content_node ) -add_test( config_content_item ${EXECUTABLE_OUTPUT_PATH}/config_content_item ${CMAKE_CURRENT_SOURCE_DIR}/data/content_item_test) -add_test( config_include_test ${EXECUTABLE_OUTPUT_PATH}/config_include_test ${CMAKE_CURRENT_SOURCE_DIR}/data include_test ) -add_test( config_root_path ${EXECUTABLE_OUTPUT_PATH}/config_root_path ${CMAKE_CURRENT_SOURCE_DIR}/data ) -add_test( config_argc ${EXECUTABLE_OUTPUT_PATH}/config_argc ${CMAKE_CURRENT_SOURCE_DIR}/data/argc_OK ${CMAKE_CURRENT_SOURCE_DIR}/data/argc_less ${CMAKE_CURRENT_SOURCE_DIR}/data/argc_more) diff --git a/ThirdParty/Ert/libconfig/tests/config_append_test.c b/ThirdParty/Ert/libconfig/tests/config_append_test.c deleted file mode 100644 index 4c89d18853..0000000000 --- a/ThirdParty/Ert/libconfig/tests/config_append_test.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'config_append_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include - -#include - -#include -#include - - - - -int main(int argc , char ** argv) { - const char * config_file = argv[1]; - config_parser_type * config = config_alloc(); - config_schema_item_type * item = config_add_schema_item(config , "APPEND" , false ); - config_schema_item_set_argc_minmax( item , 1 , 1); - - { - config_content_type * content = config_parse(config , config_file , "--" , NULL , NULL , NULL , false , true ); - test_assert_true(config_content_is_instance( content )); - test_assert_true(config_content_is_valid( content )); - test_assert_int_equal( config_content_get_occurences( content , "APPEND" ) , 3); - - { - const char * value = config_content_get_value( content , "APPEND"); - test_assert_string_equal( value , "VALUE3"); - } - - config_content_free( content ); - } - - { - config_content_type * content = config_parse( config , "DoesNotExist" , "--" , NULL , NULL , NULL , false , true); - test_assert_false( config_content_is_valid( content )); - config_content_free( content ); - } - exit(0); -} diff --git a/ThirdParty/Ert/libconfig/tests/config_argc.c b/ThirdParty/Ert/libconfig/tests/config_argc.c deleted file mode 100644 index 067023672e..0000000000 --- a/ThirdParty/Ert/libconfig/tests/config_argc.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'config_argc.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -void install_SIGNALS(void) { - signal(SIGSEGV , util_abort_signal); /* Segmentation violation, i.e. overwriting memory ... */ - signal(SIGINT , util_abort_signal); /* Control C */ - signal(SIGTERM , util_abort_signal); /* If killing the program with SIGTERM (the default kill signal) you will get a backtrace. - Killing with SIGKILL (-9) will not give a backtrace.*/ -} - - - -int main(int argc , char ** argv) { - install_SIGNALS(); - { - const char * argc_OK = argv[1]; - const char * argc_less = argv[2]; - const char * argc_more = argv[3]; - - config_parser_type * config = config_alloc(); - config_schema_item_type * schema_item = config_add_schema_item( config , "ITEM" , false ); - config_schema_item_set_argc_minmax( schema_item , 2 , 2 ); - - { - config_content_type * content = config_parse( config , argc_OK , "--" , NULL , NULL , NULL , CONFIG_UNRECOGNIZED_ERROR , true); - test_assert_true( config_content_is_instance( content )); - test_assert_true(config_content_is_valid( content )); - config_content_free( content ); - } - - { - config_content_type * content = config_parse( config , argc_less , "--" , NULL , NULL , NULL , CONFIG_UNRECOGNIZED_ERROR , true); - test_assert_true( config_content_is_instance( content )); - test_assert_false( config_content_is_valid( content )); - - { - const config_error_type * config_error = config_content_get_errors( content ); - const char * error_msg = "Error when parsing config_file:\"argc_less\" Keyword:ITEM must have at least 2 arguments."; - - test_assert_int_equal( config_error_count( config_error ) , 1); - test_assert_string_equal( config_error_iget( config_error , 0 ) , error_msg); - } - config_content_free( content ); - } - - { - config_content_type * content = config_parse( config , argc_more , "--" , NULL , NULL , NULL , CONFIG_UNRECOGNIZED_ERROR , true); - test_assert_true( config_content_is_instance( content )); - test_assert_false( config_content_is_valid( content )); - { - const config_error_type * config_error = config_content_get_errors( content ); - const char * error_msg = "Error when parsing config_file:\"argc_more\" Keyword:ITEM must have maximum 2 arguments."; - - test_assert_int_equal( config_error_count( config_error ) , 1); - test_assert_string_equal( config_error_iget( config_error , 0 ) , error_msg); - } - config_content_free( content ); - } - - config_free( config ); - exit(0); - } -} diff --git a/ThirdParty/Ert/libconfig/tests/config_config.c b/ThirdParty/Ert/libconfig/tests/config_config.c deleted file mode 100644 index 8d10c89cf5..0000000000 --- a/ThirdParty/Ert/libconfig/tests/config_config.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'config_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include - -#include -#include - - -int main(int argc , char ** argv) { - config_parser_type * config = config_alloc(); - config_add_schema_item( config , "KEYWORD" , false ); - config_free( config ); - exit(0); -} - diff --git a/ThirdParty/Ert/libconfig/tests/config_content.c b/ThirdParty/Ert/libconfig/tests/config_content.c deleted file mode 100644 index 4caa608d12..0000000000 --- a/ThirdParty/Ert/libconfig/tests/config_content.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright (C) 2015 Statoil ASA, Norway. - - The file 'config_content.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -#include - - -void test_create() { - config_content_type * content = config_content_alloc( "filename" ); - test_assert_true( config_content_is_instance( content ) ); - config_content_free( content ); -} - - - - - - -int main( int argc , char ** argv) { - test_create(); -} diff --git a/ThirdParty/Ert/libconfig/tests/config_content_item.c b/ThirdParty/Ert/libconfig/tests/config_content_item.c deleted file mode 100644 index 0b8ab1aa41..0000000000 --- a/ThirdParty/Ert/libconfig/tests/config_content_item.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'config_content_item.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include - - -int main(int argc , char ** argv) { - const char * config_file = argv[1]; - config_parser_type * config = config_alloc(); - - config_add_schema_item( config , "SET" , true ); - config_add_schema_item( config , "NOTSET" , false ); - - { - config_content_type * content = config_parse( config , config_file , "--" , "INCLUDE" , NULL , NULL , CONFIG_UNRECOGNIZED_IGNORE , true ); - test_assert_true( config_content_is_instance( content )); - test_assert_true(config_content_is_valid( content )); - - test_assert_true( config_content_has_item( content , "SET" )); - test_assert_false( config_content_has_item( content , "NOTSET" ) ); - test_assert_false( config_content_has_item( content , "UNKNOWN" ) ); - - test_assert_true( config_has_schema_item( config , "SET" )); - test_assert_true( config_has_schema_item( config , "NOTSET" )); - test_assert_false( config_has_schema_item( config , "UNKNOWN" )); - - config_content_free( content ); - } - - exit(0); -} - diff --git a/ThirdParty/Ert/libconfig/tests/config_content_node.c b/ThirdParty/Ert/libconfig/tests/config_content_node.c deleted file mode 100644 index f7289f60de..0000000000 --- a/ThirdParty/Ert/libconfig/tests/config_content_node.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'config_content_node.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - - -int main(int argc , char ** argv) { - config_schema_item_type * schema = config_schema_item_alloc("TEST" , true); - config_root_path_type * root_path = config_root_path_alloc( NULL ); - config_path_elm_type * cwd = config_path_elm_alloc( root_path , NULL ); - { - config_content_node_type * node = config_content_node_alloc( schema , cwd ); - config_content_node_add_value( node , "KEY1:VALUE1" ); - config_content_node_add_value( node , "KEY2:VALUE2" ); - config_content_node_add_value( node , "KEY3:VALUE3" ); - config_content_node_add_value( node , "KEYVALUE" ); - - test_assert_int_equal( config_content_node_get_size( node ) , 4 ); - test_assert_string_equal( config_content_node_iget( node , 0 ) , "KEY1:VALUE1" ); - test_assert_string_equal( config_content_node_iget( node , 2 ) , "KEY3:VALUE3" ); - - test_assert_string_equal( config_content_node_get_full_string( node , ",") , "KEY1:VALUE1,KEY2:VALUE2,KEY3:VALUE3,KEYVALUE"); - - { - hash_type * opt_hash = hash_alloc( ); - { - config_content_node_init_opt_hash( node , opt_hash , 0 ); - test_assert_int_equal( hash_get_size( opt_hash ) , 3 ); - test_assert_string_equal( hash_get( opt_hash , "KEY1" ) , "VALUE1" ); - test_assert_string_equal( hash_get( opt_hash , "KEY3" ) , "VALUE3" ); - } - - hash_clear( opt_hash ); - test_assert_int_equal( hash_get_size( opt_hash ) , 0 ); - config_content_node_init_opt_hash( node , opt_hash , 1 ); - test_assert_int_equal( hash_get_size( opt_hash ) , 2 ); - test_assert_string_equal( hash_get( opt_hash , "KEY2" ) , "VALUE2" ); - test_assert_string_equal( hash_get( opt_hash , "KEY3" ) , "VALUE3" ); - test_assert_false( hash_has_key( opt_hash , "KEY1" ) ); - test_assert_false( hash_has_key( opt_hash , "KEYVALUE" ) ); - hash_free( opt_hash ); - } - - - config_content_node_free( node ); - } - config_path_elm_free( cwd ); - config_root_path_free( root_path ); - config_schema_item_free( schema ); - exit(0); -} - diff --git a/ThirdParty/Ert/libconfig/tests/config_define.c b/ThirdParty/Ert/libconfig/tests/config_define.c deleted file mode 100644 index 386ab0c655..0000000000 --- a/ThirdParty/Ert/libconfig/tests/config_define.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'config_define.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include - -void test_define(config_parser_type * config , const char * config_file) { - hash_type * pre_defined_kw_map = hash_alloc(); - hash_insert_string(pre_defined_kw_map, "", "TEST_VALUE"); - config_content_type * content = config_parse( config , config_file , NULL , NULL , "DEFINE" , pre_defined_kw_map , CONFIG_UNRECOGNIZED_IGNORE , true ); - hash_free(pre_defined_kw_map); - test_assert_true( config_content_is_instance( content )); - test_assert_true(config_content_is_valid( content )); - { - const subst_list_type * define_list = config_content_get_define_list( content ); - test_assert_true( subst_list_has_key( define_list , "VAR1")); - test_assert_true( subst_list_has_key( define_list , "VAR2")); - test_assert_true( subst_list_has_key( define_list , "VARX")); - test_assert_true( subst_list_has_key( define_list , "")); - test_assert_false( subst_list_has_key( define_list , "VARY")); - - - test_assert_string_equal( subst_list_get_value( define_list , "VAR1") , "100"); - test_assert_string_equal( subst_list_get_value( define_list , "VAR2") , "10"); - test_assert_string_equal( subst_list_get_value( define_list , "VARX") , "1"); - test_assert_string_equal( subst_list_get_value( define_list , "") , "TEST_VALUE"); - } - - config_content_free( content ); -} - - - -config_parser_type * config_create_schema() { - config_parser_type * config = config_alloc(); - - config_add_schema_item( config , "SET" , true ); - config_add_schema_item( config , "NOTSET" , false ); - - return config; -} - - -int main(int argc , char ** argv) { - util_install_signals(); - { - const char * config_file = argv[1]; - config_parser_type * config = config_create_schema(); - - test_define( config , config_file ); - - config_free( config ); - exit(0); - } -} - diff --git a/ThirdParty/Ert/libconfig/tests/config_error.c b/ThirdParty/Ert/libconfig/tests/config_error.c deleted file mode 100644 index 5312d937d9..0000000000 --- a/ThirdParty/Ert/libconfig/tests/config_error.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'config_error.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include - -#include - -int main(int argc , char ** argv) { - config_error_type * config_error = config_error_alloc(); - - { - config_error_type * error_copy = config_error_alloc_copy( config_error ); - - test_assert_true( config_error_equal( config_error , error_copy )); - test_assert_ptr_not_equal( config_error , error_copy ); - - config_error_free( error_copy ); - } - - config_error_free( config_error ); - exit(0); -} - diff --git a/ThirdParty/Ert/libconfig/tests/config_include_test.c b/ThirdParty/Ert/libconfig/tests/config_include_test.c deleted file mode 100644 index 593a34af5b..0000000000 --- a/ThirdParty/Ert/libconfig/tests/config_include_test.c +++ /dev/null @@ -1,135 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'config_include_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -void parse_test(config_parser_type * config , - const char * root_path , // The new working directory - the test will start by chdir() here. - const char * config_file ) { // The config_file, either as an absolute path - or relative from root_path - -#ifdef ERT_LINUX - const char * path0 = "PATH0"; - const char * path1 = "path/PATH1"; - const char * path2 = "path/PATH2"; - const char * path3 = "path/subpath/PATH3"; - const char * path4 = "path/subpath/subsubpath/PATH4"; -#endif - - - char * config_path, *config_rel_path,*config_abs_path; - path_stack_type * path_stack = path_stack_alloc(); - - util_alloc_file_components( config_file , &config_path , NULL , NULL); - path_stack_push( path_stack , NULL ); - if (root_path != NULL) - util_chdir( root_path ); - - config_abs_path = util_alloc_abs_path( config_path ); - config_rel_path = util_alloc_rel_path( NULL , config_abs_path); - - { - config_content_type * content = config_parse( config , config_file , "--" , "INCLUDE" , NULL , NULL , CONFIG_UNRECOGNIZED_IGNORE , true ); - if (config_content_is_valid( content )) { - - char * relpath0 = util_alloc_filename( config_rel_path , path0, NULL); - char * relpath1 = util_alloc_filename( config_rel_path , path1, NULL); - char * relpath2 = util_alloc_filename( config_rel_path , path2, NULL); - char * relpath3 = util_alloc_filename( config_rel_path , path3, NULL); - char * relpath4 = util_alloc_filename( config_rel_path , path4, NULL); - - char * abspath0 = util_alloc_filename( config_abs_path , path0, NULL); - char * abspath1 = util_alloc_filename( config_abs_path , path1, NULL); - char * abspath2 = util_alloc_filename( config_abs_path , path2, NULL); - char * abspath3 = util_alloc_filename( config_abs_path , path3, NULL); - char * abspath4 = util_alloc_filename( config_abs_path , path4, NULL); - - test_assert_string_equal(config_content_get_value_as_relpath(content , "PATH0") , relpath0 ); - test_assert_string_equal(config_content_get_value_as_relpath(content , "PATH1") , relpath1 ); - test_assert_string_equal(config_content_get_value_as_relpath(content , "PATH2") , relpath2 ); - test_assert_string_equal(config_content_get_value_as_relpath(content , "PATH3") , relpath3 ); - test_assert_string_equal(config_content_get_value_as_relpath(content , "PATH4") , relpath4 ); - - test_assert_string_equal(config_content_get_value_as_abspath(content , "PATH0") , abspath0 ); - test_assert_string_equal(config_content_get_value_as_abspath(content , "PATH1") , abspath1 ); - test_assert_string_equal(config_content_get_value_as_abspath(content , "PATH2") , abspath2 ); - test_assert_string_equal(config_content_get_value_as_abspath(content , "PATH3") , abspath3 ); - test_assert_string_equal(config_content_get_value_as_abspath(content , "PATH4") , abspath4 ); - - } else { - const config_error_type * error = config_content_get_errors( content ); - config_error_fprintf( error , true , stdout ); - test_error_exit("Hmm - parsing %s failed \n", config_file ); - } - config_content_free( content ); - } - path_stack_pop( path_stack ); -} - - -int main(int argc , char ** argv) { - const char * abs_path = argv[1]; - const char * config_file = argv[2]; - char * abs_config_file = util_alloc_filename( abs_path , config_file , NULL); - config_parser_type * config = config_alloc(); - - { - config_schema_item_type * schema_item; - - schema_item = config_add_schema_item( config , "PATH0" , true ); - config_schema_item_set_argc_minmax( schema_item , 1 , 1 ); - config_schema_item_iset_type( schema_item , 0 , CONFIG_PATH ); - - schema_item = config_add_schema_item( config , "PATH1" , true ); - config_schema_item_set_argc_minmax( schema_item , 1 , 1 ); - config_schema_item_iset_type( schema_item , 0 , CONFIG_PATH ); - - schema_item = config_add_schema_item( config , "PATH2" , true ); - config_schema_item_set_argc_minmax( schema_item , 1 , 1 ); - config_schema_item_iset_type( schema_item , 0 , CONFIG_PATH ); - - schema_item = config_add_schema_item( config , "PATH3" , true ); - config_schema_item_set_argc_minmax( schema_item , 1 , 1 ); - config_schema_item_iset_type( schema_item , 0 , CONFIG_PATH ); - - schema_item = config_add_schema_item( config , "PATH4" , true ); - config_schema_item_set_argc_minmax( schema_item , 1 , 1 ); - config_schema_item_iset_type( schema_item , 0 , CONFIG_PATH ); - } - - parse_test( config , abs_path , config_file ); - parse_test( config , abs_path , abs_config_file ); - parse_test( config , NULL , abs_config_file ); - parse_test( config , "../../" , abs_config_file ); - - config_free( config ); - exit(0); -} - - - - diff --git a/ThirdParty/Ert/libconfig/tests/config_node_test.c b/ThirdParty/Ert/libconfig/tests/config_node_test.c deleted file mode 100644 index 7f18c4fd7e..0000000000 --- a/ThirdParty/Ert/libconfig/tests/config_node_test.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'config_node_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include - -#include -#include - - - -int main(int argc , char ** argv) { - const char * config_file = argv[1]; - config_parser_type * config = config_alloc(); - { - config_schema_item_type * item = config_add_schema_item(config , "APPEND" , false ); - config_schema_item_set_argc_minmax( item , 1 , 1); - } - config_add_schema_item(config , "NEXT" , false ); - - config_content_type * content = config_parse(config , config_file , "--" , NULL , NULL , NULL , false , true ); - - if (config_content_is_valid( content )) { - if (config_content_get_size( content ) == 4) { - const config_content_node_type * node0 = config_content_iget_node( content , 0 ); - if (strcmp( config_content_node_get_kw( node0 ) , "APPEND") == 0) { - if (config_content_node_get_size(node0) == 1) { - const config_content_node_type * node3 = config_content_iget_node( content , 3 ); - if (strcmp( config_content_node_get_kw( node3 ) , "NEXT") == 0) { - if (config_content_node_get_size(node3) == 2) { - config_content_free( content ); - exit(0); - } else printf("Size error node3\n"); - } else printf("kw error node3 \n"); - } else printf("Size error node0\n"); - } else printf("kw error node0 kw:%s \n", config_content_node_get_kw( node0 )); - } else printf("Size error \n"); - } else printf("Parse error"); - - config_content_free( content ); - exit(1); -} - diff --git a/ThirdParty/Ert/libconfig/tests/config_path_elm.c b/ThirdParty/Ert/libconfig/tests/config_path_elm.c deleted file mode 100644 index e6b4ea50f1..0000000000 --- a/ThirdParty/Ert/libconfig/tests/config_path_elm.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'config_path_elm.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -int main(int argc , char ** argv) { -#ifdef ERT_LINUX - const char * rel_path = "rel/path"; - const char * rel_true = "rel/path/XXX"; - const char * path_true1 = "rel/path/XXX"; - - -#endif - test_work_area_type * work_area = test_work_area_alloc( "config_path_elm" ); - const char * root = test_work_area_get_cwd( work_area ); - char * abs_path = util_alloc_filename( root , "rel/path" , NULL); - char * abs_true = util_alloc_filename( root , "rel/path/XXX" , NULL); - char * path_true2 = util_alloc_filename( root , "rel/path/XXX" , NULL); - - util_chdir( test_work_area_get_original_cwd( work_area )); - config_root_path_type * root_path = config_root_path_alloc( root ); - { - config_path_elm_type * path_elm = config_path_elm_alloc( root_path , rel_path ); - - test_assert_string_equal( config_path_elm_get_relpath( path_elm ) , rel_path ); - test_assert_string_equal( config_path_elm_get_abspath( path_elm ) , abs_path ); - - test_assert_string_equal( config_path_elm_alloc_relpath( path_elm , "XXX" ) , rel_true); - test_assert_string_equal( config_path_elm_alloc_abspath( path_elm , "XXX" ) , abs_true); - test_assert_string_equal( config_path_elm_alloc_path( path_elm , "XXX" ) , path_true2 ); - - - config_path_elm_free( path_elm ); - } - { - config_path_elm_type * path_elm = config_path_elm_alloc( root_path , abs_path ); - - test_assert_string_equal( config_path_elm_get_relpath( path_elm ) , rel_path ); - test_assert_string_equal( config_path_elm_get_abspath( path_elm ) , abs_path ); - - test_assert_string_equal( config_path_elm_alloc_relpath( path_elm , "XXX" ) , rel_true); - test_assert_string_equal( config_path_elm_alloc_abspath( path_elm , "XXX" ) , abs_true); - test_assert_string_equal( config_path_elm_alloc_path( path_elm , "XXX" ) , path_true2 ); - - config_path_elm_free( path_elm ); - } - config_root_path_free( root_path ); - - util_chdir( root ); - root_path = config_root_path_alloc( NULL ); - { - config_path_elm_type * path_elm = config_path_elm_alloc( root_path , rel_path ); - - test_assert_string_equal( config_path_elm_get_relpath( path_elm ) , rel_path ); - test_assert_string_equal( config_path_elm_get_abspath( path_elm ) , abs_path ); - - test_assert_string_equal( config_path_elm_alloc_relpath( path_elm , "XXX" ) , rel_true); - test_assert_string_equal( config_path_elm_alloc_abspath( path_elm , "XXX" ) , abs_true); - test_assert_string_equal( config_path_elm_alloc_path( path_elm , "XXX" ) , path_true1 ); - - - config_path_elm_free( path_elm ); - } - - exit(0); -} - diff --git a/ThirdParty/Ert/libconfig/tests/config_root_path.c b/ThirdParty/Ert/libconfig/tests/config_root_path.c deleted file mode 100644 index 60bbe9be69..0000000000 --- a/ThirdParty/Ert/libconfig/tests/config_root_path.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'config_root_path.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include - -#include -#include - -#include -#include - - -int main(int argc , char ** argv) { - char * cwd = util_alloc_cwd(); - - { - config_root_path_type * root_path = config_root_path_alloc( NULL ); - - if (!test_check_string_equal( config_root_path_get_abs_path( root_path ) , cwd )) - test_error_exit("abs:path:%s expeceted:%s \n",config_root_path_get_abs_path( root_path ) , cwd ); - - if (!test_check_string_equal( config_root_path_get_input_path( root_path ) , NULL )) - test_error_exit("input:path:%s expeceted:%s \n",config_root_path_get_input_path( root_path ) , NULL ); - - if (!test_check_string_equal( config_root_path_get_rel_path( root_path ) , NULL )) - test_error_exit("rel:path:%s expeceted:%s \n",config_root_path_get_rel_path( root_path ) , NULL ); - - - config_root_path_free( root_path ); - } - - - { - config_root_path_type * root_path = config_root_path_alloc( "/does/not/exist" ); - if (root_path != NULL) - test_error_exit("Created root_path instance for not-existing input \n"); - } - - - - { - const char * input_path = argv[1]; - char * cwd = util_alloc_cwd(); - char * rel_path = util_alloc_rel_path( cwd , input_path ); - - config_root_path_type * root_path1 = config_root_path_alloc( input_path ); - config_root_path_type * root_path2 = config_root_path_alloc( rel_path ); - - if (!test_check_string_equal( config_root_path_get_rel_path( root_path1 ) , config_root_path_get_rel_path( root_path2 ))) - test_error_exit("Rel: %s != %s \n",config_root_path_get_rel_path( root_path1 ) , config_root_path_get_rel_path( root_path2)); - - if (!test_check_string_equal( config_root_path_get_abs_path( root_path1 ) , config_root_path_get_abs_path( root_path2 ))) - test_error_exit("Abs: %s != %s \n",config_root_path_get_abs_path( root_path1 ) , config_root_path_get_abs_path( root_path2 )); - - config_root_path_free( root_path1 ); - config_root_path_free( root_path2 ); - } - - - exit(0); -} - diff --git a/ThirdParty/Ert/libconfig/tests/config_schema_item.c b/ThirdParty/Ert/libconfig/tests/config_schema_item.c deleted file mode 100644 index 69dc55238c..0000000000 --- a/ThirdParty/Ert/libconfig/tests/config_schema_item.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'config_schema_item.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include - -#include - -#include - - - -int main(int argc , char ** argv) { - config_schema_item_type * schema_item = config_schema_item_alloc( "KW" , false ); - - test_assert_int_equal( config_schema_item_iget_type( schema_item , 1 ) , CONFIG_STRING ); - test_assert_int_equal( config_schema_item_iget_type( schema_item , 2 ) , CONFIG_STRING ); - - config_schema_item_iset_type( schema_item , 0 , CONFIG_INT ); - config_schema_item_iset_type( schema_item , 5 , CONFIG_BOOL ); - - - test_assert_int_equal( config_schema_item_iget_type( schema_item , 0 ) , CONFIG_INT ); - test_assert_int_equal( config_schema_item_iget_type( schema_item , 1 ) , CONFIG_STRING ); - test_assert_int_equal( config_schema_item_iget_type( schema_item , 2 ) , CONFIG_STRING ); - test_assert_int_equal( config_schema_item_iget_type( schema_item , 5 ) , CONFIG_BOOL ); - - config_schema_item_set_default_type( schema_item , CONFIG_FLOAT ); - test_assert_int_equal( config_schema_item_iget_type( schema_item , 7 ) , CONFIG_FLOAT ); - - config_schema_item_free( schema_item ); - exit(0); -} - diff --git a/ThirdParty/Ert/libconfig/tests/config_typeFail.c b/ThirdParty/Ert/libconfig/tests/config_typeFail.c deleted file mode 100644 index c3a113adf7..0000000000 --- a/ThirdParty/Ert/libconfig/tests/config_typeFail.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'config_parser_typeFail.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include - -#include - -#include -#include -#include - - -void error(char * msg) { - fprintf(stderr , msg); - exit(1); -} - - -int main(int argc , char ** argv) { - const char * config_file = argv[1]; - config_parser_type * config = config_alloc(); - { - config_schema_item_type * item = config_add_schema_item(config , "TYPES_KEY" , false ); - config_schema_item_set_argc_minmax( item , 4 , 4 ); - config_schema_item_iset_type( item , 0 , CONFIG_INT ); - config_schema_item_iset_type( item , 1 , CONFIG_FLOAT ); - config_schema_item_iset_type( item , 2 , CONFIG_BOOL ); - - item = config_add_schema_item( config , "SHORT_KEY" , false ); - config_schema_item_set_argc_minmax( item , 1 , 1 ); - - item = config_add_schema_item( config , "LONG_KEY" , false ); - config_schema_item_set_argc_minmax( item , 3 , CONFIG_DEFAULT_ARG_MAX); - } - - { - config_content_type * content = config_parse(config , config_file , "--" , NULL , NULL , NULL , false , true ); - - if (config_content_is_valid( content )) { - error("Parse error\n"); - } else { - const config_error_type * cerror = config_content_get_errors( content ); - if (config_error_count( cerror ) > 0) { - int i; - for (i=0; i < config_error_count( cerror ); i++) { - printf("Error %d: %s \n",i , config_error_iget( cerror , i )); - } - } - test_assert_int_equal( 5 , config_error_count( cerror )); - } - config_content_free( content ); - } - printf("OK \n"); - exit(0); -} - diff --git a/ThirdParty/Ert/libconfig/tests/config_typeOK.c b/ThirdParty/Ert/libconfig/tests/config_typeOK.c deleted file mode 100644 index e68c4e929c..0000000000 --- a/ThirdParty/Ert/libconfig/tests/config_typeOK.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'config_parser_typeOK.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include - -#include -#include -#include - - - - -int main(int argc , char ** argv) { - const char * config_file = argv[1]; - config_parser_type * config = config_alloc(); - { - config_schema_item_type * item = config_add_schema_item(config , "TYPE_KEY" , false ); - config_schema_item_set_argc_minmax( item , 4 , 4 ); - config_schema_item_iset_type( item , 0 , CONFIG_INT ); - config_schema_item_iset_type( item , 1 , CONFIG_FLOAT ); - config_schema_item_iset_type( item , 2 , CONFIG_BOOL ); - - item = config_add_schema_item( config , "SHORT_KEY" , false ); - config_schema_item_set_argc_minmax( item , 1 , 1 ); - - item = config_add_schema_item( config , "LONG_KEY" , false ); - config_schema_item_set_argc_minmax( item , 3 , CONFIG_DEFAULT_ARG_MAX ); - } - { - config_content_type * content = config_parse(config , config_file , "--" , NULL , NULL , NULL , false , true ); - test_assert_true( config_content_is_valid( content )); - config_content_free( content ); - } - - - exit(0); -} - diff --git a/ThirdParty/Ert/libconfig/tests/data/append_test b/ThirdParty/Ert/libconfig/tests/data/append_test deleted file mode 100644 index 8af962aaa2..0000000000 --- a/ThirdParty/Ert/libconfig/tests/data/append_test +++ /dev/null @@ -1,4 +0,0 @@ -APPEND VALUE1 -APPEND VALUE2 -APPEND VALUE3 -NEXT VALUE4 VALUE5 \ No newline at end of file diff --git a/ThirdParty/Ert/libconfig/tests/data/argc_OK b/ThirdParty/Ert/libconfig/tests/data/argc_OK deleted file mode 100644 index 771501c380..0000000000 --- a/ThirdParty/Ert/libconfig/tests/data/argc_OK +++ /dev/null @@ -1 +0,0 @@ -ITEM Arg1 Arg2 diff --git a/ThirdParty/Ert/libconfig/tests/data/argc_less b/ThirdParty/Ert/libconfig/tests/data/argc_less deleted file mode 100644 index 26c79f150b..0000000000 --- a/ThirdParty/Ert/libconfig/tests/data/argc_less +++ /dev/null @@ -1 +0,0 @@ -ITEM Arg1 diff --git a/ThirdParty/Ert/libconfig/tests/data/argc_more b/ThirdParty/Ert/libconfig/tests/data/argc_more deleted file mode 100644 index bd026bbdc4..0000000000 --- a/ThirdParty/Ert/libconfig/tests/data/argc_more +++ /dev/null @@ -1,2 +0,0 @@ -ITEM Arg1 ARG2 Arg3 - diff --git a/ThirdParty/Ert/libconfig/tests/data/content_item_test b/ThirdParty/Ert/libconfig/tests/data/content_item_test deleted file mode 100644 index 403ef6ae3e..0000000000 --- a/ThirdParty/Ert/libconfig/tests/data/content_item_test +++ /dev/null @@ -1 +0,0 @@ -SET SetValue diff --git a/ThirdParty/Ert/libconfig/tests/data/define_test b/ThirdParty/Ert/libconfig/tests/data/define_test deleted file mode 100644 index 6976c4853f..0000000000 --- a/ThirdParty/Ert/libconfig/tests/data/define_test +++ /dev/null @@ -1,5 +0,0 @@ -DEFINE VAR1 100 -DEFINE VAR2 10 -DEFINE VARX 1 - -SET VAR1 100 diff --git a/ThirdParty/Ert/libconfig/tests/data/include_test b/ThirdParty/Ert/libconfig/tests/data/include_test deleted file mode 100644 index 9717f9dcaf..0000000000 --- a/ThirdParty/Ert/libconfig/tests/data/include_test +++ /dev/null @@ -1,3 +0,0 @@ -PATH0 PATH0 -INCLUDE path/include1 -INCLUDE path/subpath/include2 \ No newline at end of file diff --git a/ThirdParty/Ert/libconfig/tests/data/path/include1 b/ThirdParty/Ert/libconfig/tests/data/path/include1 deleted file mode 100644 index 24c1ce46d0..0000000000 --- a/ThirdParty/Ert/libconfig/tests/data/path/include1 +++ /dev/null @@ -1,5 +0,0 @@ -PATH1 PATH1 -PATH2 PATH2 - -INCLUDE subpath/include3 -INCLUDE subpath/subsubpath/include4 \ No newline at end of file diff --git a/ThirdParty/Ert/libconfig/tests/data/path/subpath/include2 b/ThirdParty/Ert/libconfig/tests/data/path/subpath/include2 deleted file mode 100644 index df203e9835..0000000000 --- a/ThirdParty/Ert/libconfig/tests/data/path/subpath/include2 +++ /dev/null @@ -1 +0,0 @@ -PATH2 PATH2 \ No newline at end of file diff --git a/ThirdParty/Ert/libconfig/tests/data/path/subpath/include3 b/ThirdParty/Ert/libconfig/tests/data/path/subpath/include3 deleted file mode 100644 index 85a8dae08a..0000000000 --- a/ThirdParty/Ert/libconfig/tests/data/path/subpath/include3 +++ /dev/null @@ -1 +0,0 @@ -PATH3 PATH3 \ No newline at end of file diff --git a/ThirdParty/Ert/libconfig/tests/data/path/subpath/subsubpath/include4 b/ThirdParty/Ert/libconfig/tests/data/path/subpath/subsubpath/include4 deleted file mode 100644 index 9bb116f3a4..0000000000 --- a/ThirdParty/Ert/libconfig/tests/data/path/subpath/subsubpath/include4 +++ /dev/null @@ -1 +0,0 @@ -PATH4 PATH4 \ No newline at end of file diff --git a/ThirdParty/Ert/libconfig/tests/data/type_testFail b/ThirdParty/Ert/libconfig/tests/data/type_testFail deleted file mode 100644 index f54ebe9a10..0000000000 --- a/ThirdParty/Ert/libconfig/tests/data/type_testFail +++ /dev/null @@ -1,6 +0,0 @@ -TYPES_KEY 100 0.75 rue String -TYPES_KEY 100 0.75 True String -TYPES_KEY 100 0.75X True String -TYPES_KEY 100X 0.75 True String -SHORT_KEY 100 100 -LONG_KEY 100 100 diff --git a/ThirdParty/Ert/libconfig/tests/data/type_testOK b/ThirdParty/Ert/libconfig/tests/data/type_testOK deleted file mode 100644 index 7801b99a58..0000000000 --- a/ThirdParty/Ert/libconfig/tests/data/type_testOK +++ /dev/null @@ -1,4 +0,0 @@ -TYPES_KEY 100 0.75 True String -SHORT_KEY 100 -LONG_KEY 100 100 100 -LONG_KEY asc asc asc asc asc asc as asc sac asc sac sca sca sa sac \ No newline at end of file diff --git a/ThirdParty/Ert/libecl/applications/ecl_pack.c b/ThirdParty/Ert/libecl/applications/ecl_pack.c index 0dacd92249..34ae853cda 100644 --- a/ThirdParty/Ert/libecl/applications/ecl_pack.c +++ b/ThirdParty/Ert/libecl/applications/ecl_pack.c @@ -25,6 +25,7 @@ #include #include #include +#include @@ -67,7 +68,7 @@ int main(int argc, char ** argv) { if (target_type == ECL_UNIFIED_RESTART_FILE) { int dummy; - seqnum_kw = ecl_kw_alloc_new("SEQNUM" , 1 , ECL_INT_TYPE , &dummy); + seqnum_kw = ecl_kw_alloc_new("SEQNUM" , 1 , ECL_INT , &dummy); } { diff --git a/ThirdParty/Ert/libecl/applications/grdecl_grid.c b/ThirdParty/Ert/libecl/applications/grdecl_grid.c index e510ff8e45..f961118ef6 100644 --- a/ThirdParty/Ert/libecl/applications/grdecl_grid.c +++ b/ThirdParty/Ert/libecl/applications/grdecl_grid.c @@ -28,10 +28,10 @@ int main(int argc , char ** argv) { FILE * stream = util_fopen( argv[1] , "r"); - ecl_kw_type * gridhead_kw = ecl_kw_fscanf_alloc_grdecl_dynamic__( stream , SPECGRID_KW , false , ECL_INT_TYPE ); - ecl_kw_type * zcorn_kw = ecl_kw_fscanf_alloc_grdecl_dynamic( stream , ZCORN_KW , ECL_FLOAT_TYPE ); - ecl_kw_type * coord_kw = ecl_kw_fscanf_alloc_grdecl_dynamic( stream , COORD_KW , ECL_FLOAT_TYPE ); - ecl_kw_type * actnum_kw = ecl_kw_fscanf_alloc_grdecl_dynamic( stream , ACTNUM_KW , ECL_INT_TYPE ); + ecl_kw_type * gridhead_kw = ecl_kw_fscanf_alloc_grdecl_dynamic__( stream , SPECGRID_KW , false , ECL_INT ); + ecl_kw_type * zcorn_kw = ecl_kw_fscanf_alloc_grdecl_dynamic( stream , ZCORN_KW , ECL_FLOAT ); + ecl_kw_type * coord_kw = ecl_kw_fscanf_alloc_grdecl_dynamic( stream , COORD_KW , ECL_FLOAT ); + ecl_kw_type * actnum_kw = ecl_kw_fscanf_alloc_grdecl_dynamic( stream , ACTNUM_KW , ECL_INT ); { int nx = ecl_kw_iget_int( gridhead_kw , SPECGRID_NX_INDEX ); diff --git a/ThirdParty/Ert/libecl/applications/grdecl_test.c b/ThirdParty/Ert/libecl/applications/grdecl_test.c index a503f515b0..8e73a7db4c 100644 --- a/ThirdParty/Ert/libecl/applications/grdecl_test.c +++ b/ThirdParty/Ert/libecl/applications/grdecl_test.c @@ -32,7 +32,7 @@ int main(int argc , char ** argv) { while (true) { ecl_kw_type * grdecl_kw; timer_start( timer ); - grdecl_kw = ecl_kw_fscanf_alloc_current_grdecl( stream , ECL_FLOAT_TYPE ); + grdecl_kw = ecl_kw_fscanf_alloc_current_grdecl( stream , ECL_FLOAT ); timer_stop( timer ); if (grdecl_kw != NULL) { diff --git a/ThirdParty/Ert/libecl/include/ert/ecl/ecl_file.h b/ThirdParty/Ert/libecl/include/ert/ecl/ecl_file.h index c0c1a682ff..d7186ada55 100644 --- a/ThirdParty/Ert/libecl/include/ert/ecl/ecl_file.h +++ b/ThirdParty/Ert/libecl/include/ert/ecl/ecl_file.h @@ -32,6 +32,7 @@ extern "C" { #include #include #include +#include @@ -76,11 +77,11 @@ extern "C" { ecl_file_kw_type * ecl_file_iget_file_kw( const ecl_file_type * file , int global_index); ecl_file_kw_type * ecl_file_iget_named_file_kw( const ecl_file_type * file , const char * kw, int ith); ecl_kw_type * ecl_file_iget_kw( const ecl_file_type * file , int global_index); - ecl_type_enum ecl_file_iget_type( const ecl_file_type * file , int global_index); + ecl_data_type ecl_file_iget_data_type( const ecl_file_type * file , int global_index); int ecl_file_iget_size( const ecl_file_type * file , int global_index); const char * ecl_file_iget_header( const ecl_file_type * file , int global_index); ecl_kw_type * ecl_file_iget_named_kw( const ecl_file_type * file , const char * kw, int ith); - ecl_type_enum ecl_file_iget_named_type( const ecl_file_type * file , const char * kw , int ith); + ecl_data_type ecl_file_iget_named_data_type( const ecl_file_type * file , const char * kw , int ith); int ecl_file_iget_named_size( const ecl_file_type * file , const char * kw , int ith); void ecl_file_indexed_read(const ecl_file_type * file , const char * kw, int index, const int_vector_type * index_map, char* buffer); diff --git a/ThirdParty/Ert/libecl/include/ert/ecl/ecl_file_kw.h b/ThirdParty/Ert/libecl/include/ert/ecl/ecl_file_kw.h index 9965354171..bfd6b5e8e5 100644 --- a/ThirdParty/Ert/libecl/include/ert/ecl/ecl_file_kw.h +++ b/ThirdParty/Ert/libecl/include/ert/ecl/ecl_file_kw.h @@ -45,7 +45,7 @@ typedef struct inv_map_struct inv_map_type; ecl_file_kw_type * ecl_file_kw_alloc_copy( const ecl_file_kw_type * src ); const char * ecl_file_kw_get_header( const ecl_file_kw_type * file_kw ); int ecl_file_kw_get_size( const ecl_file_kw_type * file_kw ); - ecl_type_enum ecl_file_kw_get_type( const ecl_file_kw_type * file_kw); + ecl_data_type ecl_file_kw_get_data_type(const ecl_file_kw_type *); offset_type ecl_file_kw_get_offset(const ecl_file_kw_type * file_kw); bool ecl_file_kw_ptr_eq( const ecl_file_kw_type * file_kw , const ecl_kw_type * ecl_kw); void ecl_file_kw_replace_kw( ecl_file_kw_type * file_kw , fortio_type * target , ecl_kw_type * new_kw ); diff --git a/ThirdParty/Ert/libecl/include/ert/ecl/ecl_file_view.h b/ThirdParty/Ert/libecl/include/ert/ecl/ecl_file_view.h index e44d332919..8e363158da 100644 --- a/ThirdParty/Ert/libecl/include/ert/ecl/ecl_file_view.h +++ b/ThirdParty/Ert/libecl/include/ert/ecl/ecl_file_view.h @@ -25,6 +25,7 @@ #include #include +#include #ifdef __cplusplus @@ -63,11 +64,11 @@ typedef struct ecl_file_view_struct ecl_file_view_type; const char * ecl_file_view_iget_distinct_kw( const ecl_file_view_type * ecl_file_view , int index); int ecl_file_view_get_num_distinct_kw( const ecl_file_view_type * ecl_file_view ); int ecl_file_view_get_size( const ecl_file_view_type * ecl_file_view ); - ecl_type_enum ecl_file_view_iget_type( const ecl_file_view_type * ecl_file_view , int index); + ecl_data_type ecl_file_view_iget_data_type( const ecl_file_view_type * ecl_file_view , int index); int ecl_file_view_iget_size( const ecl_file_view_type * ecl_file_view , int index); const char * ecl_file_view_iget_header( const ecl_file_view_type * ecl_file_view , int index); ecl_kw_type * ecl_file_view_iget_named_kw( const ecl_file_view_type * ecl_file_view , const char * kw, int ith); - ecl_type_enum ecl_file_view_iget_named_type( const ecl_file_view_type * ecl_file_view , const char * kw , int ith); + ecl_data_type ecl_file_view_iget_named_data_type( const ecl_file_view_type * ecl_file_view , const char * kw , int ith); int ecl_file_view_iget_named_size( const ecl_file_view_type * ecl_file_view , const char * kw , int ith); void ecl_file_view_replace_kw( ecl_file_view_type * ecl_file_view , ecl_kw_type * old_kw , ecl_kw_type * new_kw , bool insert_copy); bool ecl_file_view_load_all( ecl_file_view_type * ecl_file_view ); diff --git a/ThirdParty/Ert/libecl/include/ert/ecl/ecl_grid.h b/ThirdParty/Ert/libecl/include/ert/ecl/ecl_grid.h index af5e23fe39..fdea668183 100644 --- a/ThirdParty/Ert/libecl/include/ert/ecl/ecl_grid.h +++ b/ThirdParty/Ert/libecl/include/ert/ecl/ecl_grid.h @@ -32,6 +32,9 @@ extern "C" { #include #include +#define ECL_GRID_COORD_SIZE(nx,ny) (((nx) + 1) * ((ny) + 1) * 6) +#define ECL_GRID_ZCORN_SIZE(nx,ny,nz) (((nx) * (ny) * (nz) * 8)) + #define ECL_GRID_GLOBAL_GRID "Global" // used as key in hash tables over grids. #define ECL_GRID_MAINGRID_LGR_NR 0 @@ -46,6 +49,8 @@ extern "C" { ecl_coarse_cell_type * ecl_grid_get_cell_coarse_group1( const ecl_grid_type * ecl_grid , int global_index); ecl_coarse_cell_type * ecl_grid_get_cell_coarse_group3( const ecl_grid_type * ecl_grid , int i , int j , int k); + int ecl_grid_get_cell_twist1( const ecl_grid_type * ecl_grid, int global_index ); + int ecl_grid_get_cell_twist3( const ecl_grid_type * ecl_grid, int i , int j , int k); void ecl_grid_get_column_property(const ecl_grid_type * ecl_grid , const ecl_kw_type * ecl_kw , int i , int j, double_vector_type * column); int ecl_grid_get_global_index_from_xy_top( const ecl_grid_type * ecl_grid , double x , double y); @@ -84,6 +89,7 @@ extern "C" { bool ecl_grid_cell_contains1(const ecl_grid_type * grid , int global_index , double x , double y , double z); bool ecl_grid_cell_contains3(const ecl_grid_type * grid , int i , int j ,int k , double x , double y , double z); int ecl_grid_get_global_index_from_xyz(ecl_grid_type * grid , double x , double y , double z , int start_index); + bool ecl_grid_get_ijk_from_xyz(ecl_grid_type * grid , double x , double y , double z , int start_index, int *i, int *j, int *k ); bool ecl_grid_get_ij_from_xy( const ecl_grid_type * grid , double x , double y , int k , int* i, int* j); const char * ecl_grid_get_name( const ecl_grid_type * ); int ecl_grid_get_active_index3(const ecl_grid_type * ecl_grid , int i , int j , int k); @@ -130,9 +136,14 @@ extern "C" { void ecl_grid_get_ijk1(const ecl_grid_type * , int global_index , int *, int * , int *); void ecl_grid_get_ijk1A(const ecl_grid_type * , int active_index, int *, int * , int *); void ecl_grid_get_ijk_from_active_index(const ecl_grid_type *, int , int *, int * , int * ); + void ecl_grid_get_xyz3(const ecl_grid_type * , int , int , int , double * , double * , double *); void ecl_grid_get_xyz1(const ecl_grid_type * grid , int global_index , double *xpos , double *ypos , double *zpos); void ecl_grid_get_xyz1A(const ecl_grid_type * grid , int active_index , double *xpos , double *ypos , double *zpos); + + bool ecl_grid_get_xyz_inside1(const ecl_grid_type * grid , int global_index , double *xpos , double *ypos , double *zpos); + bool ecl_grid_get_xyz_inside3(const ecl_grid_type * grid , int i , int j , int k , double *xpos , double *ypos , double *zpos); + int ecl_grid_get_global_size( const ecl_grid_type * ecl_grid ); bool ecl_grid_compare(const ecl_grid_type * g1 , const ecl_grid_type * g2 , bool include_lgr, bool include_nnc , bool verbose); int ecl_grid_get_active_size( const ecl_grid_type * ecl_grid ); @@ -205,6 +216,7 @@ extern "C" { void ecl_grid_fprintf_grdecl( ecl_grid_type * grid , FILE * stream ); void ecl_grid_fprintf_grdecl2( ecl_grid_type * grid , FILE * stream , ert_ecl_unit_enum output_unit); + int ecl_grid_zcorn_index__(int nx, int ny , int i, int j , int k , int c); int ecl_grid_zcorn_index(const ecl_grid_type * grid , int i, int j , int k , int c); ecl_grid_type * ecl_grid_alloc_EGRID(const char * grid_file, bool apply_mapaxes ); ecl_grid_type * ecl_grid_alloc_GRID(const char * grid_file, bool apply_mapaxes ); diff --git a/ThirdParty/Ert/libecl/include/ert/ecl/ecl_kw.h b/ThirdParty/Ert/libecl/include/ert/ecl/ecl_kw.h index 25accc5926..72a74fd20f 100644 --- a/ThirdParty/Ert/libecl/include/ert/ecl/ecl_kw.h +++ b/ThirdParty/Ert/libecl/include/ert/ecl/ecl_kw.h @@ -31,6 +31,7 @@ extern "C" { #include #include +#include UTIL_IS_INSTANCE_HEADER(ecl_kw); @@ -39,8 +40,7 @@ extern "C" { typedef enum { ECL_KW_READ_OK = 0, - ECL_KW_READ_FAIL = 1, - ECL_KW_READ_SKIP = 2 + ECL_KW_READ_FAIL = 1 } ecl_read_status_enum; /* @@ -55,13 +55,24 @@ extern "C" { #define ECL_KW_MAX_SIZE INT_MAX +/* + Character data in ECLIPSE files comes as an array of fixed-length + string. Each of these strings is 8 characters long. The type name, + i.e. 'REAL', 'INTE', ... , come as 4 character strings. +*/ +#define ECL_KW_HEADER_DATA_SIZE ECL_STRING8_LENGTH + ECL_TYPE_LENGTH + 4 +#define ECL_KW_HEADER_FORTIO_SIZE ECL_KW_HEADER_DATA_SIZE + 8 + + + int ecl_kw_first_different( const ecl_kw_type * kw1 , const ecl_kw_type * kw2 , int offset, double abs_epsilon , double rel_epsilon); size_t ecl_kw_fortio_size( const ecl_kw_type * ecl_kw ); void * ecl_kw_get_ptr(const ecl_kw_type *ecl_kw); void ecl_kw_set_data_ptr(ecl_kw_type * ecl_kw , void * data); void ecl_kw_fwrite_data(const ecl_kw_type *_ecl_kw , fortio_type *fortio); bool ecl_kw_fread_realloc_data(ecl_kw_type *ecl_kw, fortio_type *fortio); - ecl_type_enum ecl_kw_get_type(const ecl_kw_type *); + ecl_data_type ecl_kw_get_data_type(const ecl_kw_type *); + size_t ecl_kw_get_sizeof_ctype(const ecl_kw_type *); const char * ecl_kw_get_header8(const ecl_kw_type *); const char * ecl_kw_get_header(const ecl_kw_type * ecl_kw ); ecl_kw_type * ecl_kw_alloc_empty(void); @@ -78,7 +89,7 @@ extern "C" { void ecl_kw_fread(ecl_kw_type * , fortio_type * ); ecl_kw_type * ecl_kw_fread_alloc(fortio_type *); void ecl_kw_free_data(ecl_kw_type *); - void ecl_kw_fread_indexed_data(fortio_type * fortio, offset_type data_offset, ecl_type_enum ecl_type, int element_count, const int_vector_type* index_map, char* buffer); + void ecl_kw_fread_indexed_data(fortio_type * fortio, offset_type data_offset, ecl_data_type, int element_count, const int_vector_type* index_map, char* buffer); void ecl_kw_free(ecl_kw_type *); void ecl_kw_free__(void *); ecl_kw_type * ecl_kw_alloc_copy (const ecl_kw_type *); @@ -99,15 +110,17 @@ extern "C" { void ecl_kw_iset(ecl_kw_type *ecl_kw , int i , const void *iptr); void ecl_kw_iset_char_ptr( ecl_kw_type * ecl_kw , int index, const char * s); void ecl_kw_iset_string8(ecl_kw_type * ecl_kw , int index , const char *s8); + void ecl_kw_iset_string_ptr(ecl_kw_type*, int, const char*); + const char * ecl_kw_iget_string_ptr(const ecl_kw_type *, int); const char * ecl_kw_iget_char_ptr( const ecl_kw_type * ecl_kw , int i); void * ecl_kw_iget_ptr(const ecl_kw_type *, int); int ecl_kw_get_size(const ecl_kw_type *); bool ecl_kw_ichar_eq(const ecl_kw_type *, int , const char *); - ecl_kw_type * ecl_kw_alloc( const char * header , int size , ecl_type_enum ecl_type ); - ecl_kw_type * ecl_kw_alloc_new(const char * , int , ecl_type_enum , const void * ); - ecl_kw_type * ecl_kw_alloc_new_shared(const char * , int , ecl_type_enum , void * ); - void ecl_kw_fwrite_param(const char * , bool , const char * , ecl_type_enum , int , void * ); - void ecl_kw_fwrite_param_fortio(fortio_type *, const char * , ecl_type_enum , int , void * ); + ecl_kw_type * ecl_kw_alloc( const char * header , int size , ecl_data_type ); + ecl_kw_type * ecl_kw_alloc_new(const char * , int , ecl_data_type , const void * ); + ecl_kw_type * ecl_kw_alloc_new_shared(const char * , int , ecl_data_type , void * ); + void ecl_kw_fwrite_param(const char * , bool , const char * , ecl_data_type , int , void * ); + void ecl_kw_fwrite_param_fortio(fortio_type *, const char * , ecl_data_type , int , void * ); void ecl_kw_summarize(const ecl_kw_type * ecl_kw); void ecl_kw_fread_double_param(const char * , bool , double *); float ecl_kw_iget_as_float(const ecl_kw_type * ecl_kw , int i); @@ -123,7 +136,7 @@ extern "C" { bool ecl_kw_block_equal( const ecl_kw_type * ecl_kw1 , const ecl_kw_type * ecl_kw2 , int cmp_elements); bool ecl_kw_data_equal( const ecl_kw_type * ecl_kw , const void * data); bool ecl_kw_content_equal( const ecl_kw_type * ecl_kw1 , const ecl_kw_type * ecl_kw2); - bool ecl_kw_fskip_data__( ecl_type_enum ecl_type , int size , fortio_type * fortio); + bool ecl_kw_fskip_data__( ecl_data_type, int, fortio_type *); bool ecl_kw_fskip_data(ecl_kw_type *ecl_kw, fortio_type *fortio); bool ecl_kw_fread_data(ecl_kw_type *ecl_kw, fortio_type *fortio); void ecl_kw_fskip_header( fortio_type * fortio); diff --git a/ThirdParty/Ert/libecl/include/ert/ecl/ecl_kw_grdecl.h b/ThirdParty/Ert/libecl/include/ert/ecl/ecl_kw_grdecl.h index 8174a1e5ea..6c5afabcb1 100644 --- a/ThirdParty/Ert/libecl/include/ert/ecl/ecl_kw_grdecl.h +++ b/ThirdParty/Ert/libecl/include/ert/ecl/ecl_kw_grdecl.h @@ -32,17 +32,17 @@ extern "C" { bool ecl_kw_grdecl_fseek_kw(const char * , bool , FILE * ); - ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_dynamic__( FILE * stream , const char * kw , bool strict , ecl_type_enum ecl_type); - ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_dynamic( FILE * stream , const char * kw , ecl_type_enum ecl_type); + ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_dynamic__( FILE * stream , const char * kw , bool strict , ecl_data_type ); + ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_dynamic( FILE * stream , const char * kw , ecl_data_type); - ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_data__(FILE * stream , bool strict , int size, ecl_type_enum ecl_type ); - ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_data( FILE * stream , int size , ecl_type_enum ecl_type); + ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_data__(FILE * stream , bool strict , int size, ecl_data_type data_type ); + ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_data( FILE * stream , int size , ecl_data_type data_type); - ecl_kw_type * ecl_kw_fscanf_alloc_grdecl__(FILE * stream, const char * kw , bool strict , int size, ecl_type_enum ecl_type); - ecl_kw_type * ecl_kw_fscanf_alloc_grdecl(FILE * stream , const char * kw, int size, ecl_type_enum ecl_type); + ecl_kw_type * ecl_kw_fscanf_alloc_grdecl__(FILE * stream, const char * kw , bool strict , int size, ecl_data_type data_type); + ecl_kw_type * ecl_kw_fscanf_alloc_grdecl(FILE * stream , const char * kw, int size, ecl_data_type data_type); - ecl_kw_type * ecl_kw_fscanf_alloc_current_grdecl__( FILE * stream , bool strict , ecl_type_enum ecl_type); - ecl_kw_type * ecl_kw_fscanf_alloc_current_grdecl( FILE * stream , ecl_type_enum ecl_type); + ecl_kw_type * ecl_kw_fscanf_alloc_current_grdecl__( FILE * stream , bool strict , ecl_data_type data_type); + ecl_kw_type * ecl_kw_fscanf_alloc_current_grdecl( FILE * stream , ecl_data_type data_type); bool ecl_kw_grdecl_fseek_next_kw( FILE * stream ); char * ecl_kw_grdecl_alloc_next_header( FILE * stream ); diff --git a/ThirdParty/Ert/libecl/include/ert/ecl/ecl_kw_magic.h b/ThirdParty/Ert/libecl/include/ert/ecl/ecl_kw_magic.h index 8bdd9512b6..846ad40765 100644 --- a/ThirdParty/Ert/libecl/include/ert/ecl/ecl_kw_magic.h +++ b/ThirdParty/Ert/libecl/include/ert/ecl/ecl_kw_magic.h @@ -414,6 +414,7 @@ values (2e20) are denoted with '*'. #define MINISTEP_KW "MINISTEP" #define STARTDAT_KW "STARTDAT" /* Intgere keyword containing day,month,year. */ #define WGNAMES_KW "WGNAMES" /* The names of wells/groups for the summary vectors. */ +#define NAMES_KW "NAMES" /* Alias for WGNAMES_KW. */ #define KEYWORDS_KW "KEYWORDS" /* The variable type for the various summary vectors. */ #define UNITS_KW "UNITS" /* The units, i.e SM^3/DAY the summary vectors. */ #define DIMENS_KW "DIMENS" /* The dimensions of the grid - also used in the GRID files. */ diff --git a/ThirdParty/Ert/libecl/include/ert/ecl/ecl_nnc_geometry.h b/ThirdParty/Ert/libecl/include/ert/ecl/ecl_nnc_geometry.h new file mode 100644 index 0000000000..743d45f33a --- /dev/null +++ b/ThirdParty/Ert/libecl/include/ert/ecl/ecl_nnc_geometry.h @@ -0,0 +1,50 @@ +/* + Copyright (C) 2017 Statoil ASA, Norway. + + The file 'ecl_nnc_geometry.h' is part of ERT - Ensemble based Reservoir Tool. + + ERT 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. + + ERT 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 + for more details. +*/ + +#ifndef ERT_NNC_GEOMETRY_H +#define ERT_NNC_GEOMETRY_H +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#include + +typedef struct ecl_nnc_geometry_struct ecl_nnc_geometry_type; +typedef struct ecl_nnc_pair_struct ecl_nnc_pair_type; + +struct ecl_nnc_pair_struct { + int grid_nr1; + int global_index1; + int grid_nr2; + int global_index2; + + int input_index; /* corresponds to the input ordering of this nnc */ +}; + +UTIL_IS_INSTANCE_HEADER( ecl_nnc_geometry); +void ecl_nnc_geometry_free( ecl_nnc_geometry_type * nnc_geo); +ecl_nnc_geometry_type * ecl_nnc_geometry_alloc( const ecl_grid_type * grid ); +int ecl_nnc_geometry_size( const ecl_nnc_geometry_type * nnc_geo ); +const ecl_nnc_pair_type * ecl_nnc_geometry_iget( const ecl_nnc_geometry_type * nnc_geo , int index); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/ThirdParty/Ert/libecl/include/ert/ecl/ecl_type.h b/ThirdParty/Ert/libecl/include/ert/ecl/ecl_type.h new file mode 100644 index 0000000000..7a596ddcf3 --- /dev/null +++ b/ThirdParty/Ert/libecl/include/ert/ecl/ecl_type.h @@ -0,0 +1,154 @@ +/* + Copyright (C) 2017 Statoil ASA, Norway. + + The file 'ecl_type.h' is part of ERT - Ensemble based Reservoir Tool. + + ERT 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. + + ERT 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 + for more details. +*/ + +#ifndef ERT_ECL_TYPE_H +#define ERT_ECL_TYPE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +/* + The type of an eclipse keyword is carried by a struct + ecl_type_struct which contains a type enum, and the size in bytes of + one such element. These structs are for the most part handled with + value semantics, and created with macros ECL_INT, ECL_FLOAT and so + on. + + The macros in C use designated initializers, whereas the C++ macros + use a constructor, for this reason this file has two slightly + different code paths for C and C++. +*/ + +#define ECL_STRING8_LENGTH 8 +#define ECL_TYPE_LENGTH 4 + +typedef enum { + ECL_CHAR_TYPE = 0, + ECL_FLOAT_TYPE = 1, + ECL_DOUBLE_TYPE = 2, + ECL_INT_TYPE = 3, + ECL_BOOL_TYPE = 4, + ECL_MESS_TYPE = 5, + ECL_STRING_TYPE = 7 +} ecl_type_enum; + +#define ECL_TYPE_ENUM_DEFS {.value = 0 , .name = "ECL_CHAR_TYPE"}, \ +{.value = 1 , .name = "ECL_FLOAT_TYPE"} , \ +{.value = 2 , .name = "ECL_DOUBLE_TYPE"}, \ +{.value = 3 , .name = "ECL_INT_TYPE"}, \ +{.value = 4 , .name = "ECL_BOOL_TYPE"}, \ +{.value = 5 , .name = "ECL_MESS_TYPE"}, \ +{.value = 7 , .name = "ECL_STRING_TYPE"} + +#define ECL_TYPE_ENUM_SIZE 7 + +/* + Character data in ECLIPSE files comes as an array of fixed-length + string. Each of these strings is 8 characters long. The type name, + i.e. 'REAL', 'INTE', ... , come as 4 character strings. +*/ + +#define ECL_STRING8_LENGTH 8 // 'Normal' 8 characters 'CHAR' type. +#define ECL_STRING10_LENGTH 10 // 'Normal' 8 characters 'CHAR' type. +#define ECL_TYPE_LENGTH 4 + + +#ifdef __cplusplus +} +#endif + + +#ifdef __cplusplus + +struct ecl_type_struct { + const ecl_type_enum type; + const size_t element_size; + + ecl_type_struct( ecl_type_enum t, size_t es) : + type( t ), + element_size( es ) + {} +}; + +#define ECL_INT ecl_data_type( ECL_INT_TYPE, sizeof(int)) +#define ECL_FLOAT ecl_data_type( ECL_FLOAT_TYPE, sizeof(float)) +#define ECL_DOUBLE ecl_data_type( ECL_DOUBLE_TYPE, sizeof(double)) +#define ECL_BOOL ecl_data_type( ECL_BOOL_TYPE, sizeof(int)) +#define ECL_CHAR ecl_data_type( ECL_CHAR_TYPE, ECL_STRING8_LENGTH + 1) +#define ECL_MESS ecl_data_type( ECL_MESS_TYPE, 0) +#define ECL_STRING(size) ecl_data_type(ECL_STRING_TYPE, size + 1) + +#else + +struct ecl_type_struct { + const ecl_type_enum type; + const size_t element_size; +}; + +#define ECL_CHAR (ecl_data_type) {.type = ECL_CHAR_TYPE, .element_size = ECL_STRING8_LENGTH + 1} +#define ECL_INT (ecl_data_type) {.type = ECL_INT_TYPE, .element_size = sizeof(int)} +#define ECL_FLOAT (ecl_data_type) {.type = ECL_FLOAT_TYPE, .element_size = sizeof(float)} +#define ECL_DOUBLE (ecl_data_type) {.type = ECL_DOUBLE_TYPE, .element_size = sizeof(double)} +#define ECL_BOOL (ecl_data_type) {.type = ECL_BOOL_TYPE, .element_size = sizeof(int)} +#define ECL_MESS (ecl_data_type) {.type = ECL_MESS_TYPE, .element_size = 0} +#define ECL_STRING(size) (ecl_data_type) {.type = ECL_STRING_TYPE, .element_size = size + 1} + +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ecl_type_struct ecl_data_type; + +ecl_data_type ecl_type_create_from_name(const char *); +ecl_data_type ecl_type_create(const ecl_type_enum, const size_t); +ecl_data_type ecl_type_create_from_type(const ecl_type_enum); + +ecl_type_enum ecl_type_get_type(const ecl_data_type); +char * ecl_type_alloc_name(const ecl_data_type); + +int ecl_type_get_sizeof_ctype(const ecl_data_type); +int ecl_type_get_sizeof_ctype_fortio(const ecl_data_type); + +bool ecl_type_is_equal(const ecl_data_type, const ecl_data_type); + +bool ecl_type_is_numeric(const ecl_data_type); +bool ecl_type_is_alpha(const ecl_data_type); +bool ecl_type_is_char(const ecl_data_type); +bool ecl_type_is_int(const ecl_data_type); +bool ecl_type_is_float(const ecl_data_type); +bool ecl_type_is_double(const ecl_data_type); +bool ecl_type_is_mess(const ecl_data_type); +bool ecl_type_is_bool(const ecl_data_type); +bool ecl_type_is_string(const ecl_data_type); + +// Temporary fixup for OPM. +char * ecl_type_get_name(const ecl_data_type); + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/ThirdParty/Ert/libecl/include/ert/ecl/ecl_units.h b/ThirdParty/Ert/libecl/include/ert/ecl/ecl_units.h new file mode 100644 index 0000000000..ecee98a662 --- /dev/null +++ b/ThirdParty/Ert/libecl/include/ert/ecl/ecl_units.h @@ -0,0 +1,46 @@ +/* + Copyright (C) 2017 Statoil ASA, Norway. + + The file 'ecl_units.h' is part of ERT - Ensemble based Reservoir Tool. + + ERT 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. + + ERT 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 + for more details. +*/ + +#ifndef ECL_UNITS_H +#define ECL_UNITS_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define ECL_UNITS_CUBIC(x) ((x)*(x)*(x)) +#define ECL_UNITS_MILLI(x) ((x)*0.001) +#define ECL_UNITS_MEGA(x) ((x)*1000000) + +#define ECL_UNITS_LENGTH_INCH 0.0254 +#define ECL_UNITS_LENGTH_FEET 12 * ECL_UNITS_LENGTH_INCH + +#define ECL_UNITS_VOLUME_GALLON 231 * ECL_UNITS_CUBIC( ECL_UNITS_LENGTH_INCH ) +#define ECL_UNITS_VOLUME_BARREL ECL_UNITS_VOLUME_GALLON * 42 +#define ECL_UNITS_VOLUME_LITER 0.001 +#define ECL_UNITS_VOLUME_MILLI_LITER ECL_UNITS_MILLI( ECL_UNITS_VOLUME_LITER ) +#define ECL_UNITS_VOLUME_GAS_FIELD ECL_UNITS_MEGA( ECL_UNITS_CUBIC( ECL_UNITS_LENGTH_FEET ) ) + +#define ECL_UNITS_TIME_HOUR 3600 +#define ECL_UNITS_TIME_DAY 24 * ECL_UNITS_TIME_HOUR + + +#ifdef __cplusplus +} +#endif +#endif diff --git a/ThirdParty/Ert/libecl/include/ert/ecl/ecl_util.h b/ThirdParty/Ert/libecl/include/ert/ecl/ecl_util.h index f7aeabc996..67cca9cde2 100644 --- a/ThirdParty/Ert/libecl/include/ert/ecl/ecl_util.h +++ b/ThirdParty/Ert/libecl/include/ert/ecl/ecl_util.h @@ -27,6 +27,7 @@ extern "C" { #include #include #include +#include typedef enum { ECL_OTHER_FILE = 0 , @@ -55,68 +56,6 @@ typedef enum { ECL_OTHER_FILE = 0 , ECL_BINARY_NON_UNIFIED = 4, ECL_FORMATTED_NON_UNIFIED = 8} ecl_storage_enum; -/* - Character data in ECLIPSE files comes as an array of fixed-length - string. Each of these strings is 8 characters long. The type name, - i.e. 'REAL', 'INTE', ... , come as 4 character strings. -*/ - -#define ECL_STRING10_LENGTH 10 // Initial guess that the type C010 type is a10 character string. -#define ECL_STRING8_LENGTH 8 -#define ECL_TYPE_LENGTH 4 -#define ECL_KW_HEADER_DATA_SIZE ECL_STRING8_LENGTH + ECL_TYPE_LENGTH + 4 -#define ECL_KW_HEADER_FORTIO_SIZE ECL_KW_HEADER_DATA_SIZE + 8 - -/*****************************************************************/ -/* - Observe that these type identidiers are (ab)used in both the rms and - ert/enkf libraries in situations where ECLIPSE is not at all involved. - - Regarding the type ECL_C010_TYPE: In an SMSPEC file generated by IX - there was a keyword with header: - - NAMES 316 C010 - - i.e. the type identifier was the string 'C010'. Have not found any - further documentation of that type, but assuming it is a 10 - character long string the file loads ok. The ECL_C010_TYPE is - implemented on a very loose basis it is not clear if the - ten-character-long-string implementation makes sense, or if that - just happened to work for the one example we have encountered so - far. For this reason the support for this keyword type is very - limited: - - - keywords of this type are not propertly internalized; they are - just cleanly skipped by ecl_kw/ecl_file implementation when - loading a file. - - - it is not possible to instantiate a keyword of this type with - ecl_kw_alloc( ). - - - The type is not exported to Python. -*/ - -typedef enum { - ECL_CHAR_TYPE = 0, - ECL_FLOAT_TYPE = 1, - ECL_DOUBLE_TYPE = 2, - ECL_INT_TYPE = 3, - ECL_BOOL_TYPE = 4, - ECL_MESS_TYPE = 5, - ECL_C010_TYPE = 6 // See comment immediately above about the limited support of this type. -} ecl_type_enum; - -#define ECL_TYPE_ENUM_DEFS {.value = 0 , .name = "ECL_CHAR_TYPE"}, \ -{.value = 1 , .name = "ECL_FLOAT_TYPE"} , \ -{.value = 2 , .name = "ECL_DOUBLE_TYPE"}, \ -{.value = 3 , .name = "ECL_INT_TYPE"}, \ -{.value = 4 , .name = "ECL_BOOL_TYPE"}, \ -{.value = 5 , .name = "ECL_MESS_TYPE"} - -#define ECL_TYPE_ENUM_SIZE 6 - - - /* The libecl library has been built and tested 99.5% with ECLIPSE100 as context, but in thye gravity code there is some very limited @@ -173,10 +112,6 @@ typedef enum { #define ECL_COMMENT_CHAR '-' // Need to consecutive to make an ECLIPSE comment #define ECL_DATA_TERMINATION "/" -int ecl_util_get_sizeof_ctype_fortio(ecl_type_enum ecl_type); -int ecl_util_get_sizeof_ctype(ecl_type_enum ); -ecl_type_enum ecl_util_get_type_from_name( const char * type_name ); -const char * ecl_util_get_type_name( ecl_type_enum ecl_type ); /*****************************************************************/ bool ecl_util_unified_file(const char *filename); @@ -187,7 +122,7 @@ ecl_file_enum ecl_util_get_file_type(const char * , bool * , int * ); ecl_file_enum ecl_util_inspect_extension(const char * ext , bool *_fmt_file, int * _report_nr); char * ecl_util_alloc_filename(const char * /* path */, const char * /* base */, ecl_file_enum , bool /* fmt_file */ , int /*report_nr*/); char * ecl_util_alloc_exfilename(const char * /* path */, const char * /* base */, ecl_file_enum , bool /* fmt_file */ , int /*report_nr*/); -void ecl_util_memcpy_typed_data(void *, const void * , ecl_type_enum , ecl_type_enum , int ); +void ecl_util_memcpy_typed_data(void *, const void * , ecl_data_type , ecl_data_type , int ); void ecl_util_escape_kw(char * kw); bool ecl_util_alloc_summary_files(const char * , const char * , const char * , char ** , stringlist_type * ); void ecl_util_alloc_summary_data_files(const char * path , const char * base , bool fmt_file , stringlist_type * filelist); diff --git a/ThirdParty/Ert/libecl/src/CMakeLists.txt b/ThirdParty/Ert/libecl/src/CMakeLists.txt index 3c3994b174..dcbf36677a 100644 --- a/ThirdParty/Ert/libecl/src/CMakeLists.txt +++ b/ThirdParty/Ert/libecl/src/CMakeLists.txt @@ -2,85 +2,91 @@ include_directories( ext ) file(GLOB ext_source "ext/*.c" ) file(GLOB ext_header "ext/*.h" ) -set( source_files - ecl_rsthead.c - ecl_sum_tstep.c - ecl_rst_file.c - ecl_init_file.c - ecl_grid_cache.c - smspec_node.c - ecl_kw_grdecl.c +set( source_files + ecl_rsthead.c + ecl_sum_tstep.c + ecl_rst_file.c + ecl_init_file.c + ecl_grid_cache.c + smspec_node.c + ecl_kw_grdecl.c ecl_file_kw.c - ecl_file_view.c - ecl_grav.c - ecl_grav_calc.c - ecl_smspec.c - ecl_sum_data.c - ecl_util.c - ecl_kw.c + ecl_file_view.c + ecl_grav.c + ecl_grav_calc.c + ecl_smspec.c + ecl_sum_data.c + ecl_util.c + ecl_kw.c ecl_sum.c ecl_sum_vector.c - fortio.c - ecl_rft_file.c - ecl_rft_node.c - ecl_rft_cell.c - ecl_grid.c - ecl_coarse_cell.c - ecl_box.c - ecl_io_config.c - ecl_file.c - ecl_region.c - ecl_subsidence.c - ecl_grid_dims.c - grid_dims.c - nnc_info.c - ecl_grav_common.c - nnc_vector.c - ecl_nnc_export.c + fortio.c + ecl_rft_file.c + ecl_rft_node.c + ecl_rft_cell.c + ecl_grid.c + ecl_coarse_cell.c + ecl_box.c + ecl_io_config.c + ecl_file.c + ecl_region.c + ecl_subsidence.c + ecl_grid_dims.c + grid_dims.c + nnc_info.c + ecl_grav_common.c + nnc_vector.c + ecl_nnc_export.c + ecl_nnc_geometry.c layer.c fault_block_layer.c + ecl_type.c + ecl_type_python.c ${ext_source}) -set( header_files - ecl_rsthead.h - ecl_sum_tstep.h - ecl_rst_file.h - ecl_init_file.h - smspec_node.h - ecl_grid_cache.h - ecl_kw_grdecl.h - ecl_file_kw.h - ecl_grav.h - ecl_grav_calc.h - ecl_endian_flip.h - ecl_smspec.h - ecl_sum_data.h - ecl_util.h - ecl_kw.h +set( header_files + ecl_units.h + ecl_rsthead.h + ecl_sum_tstep.h + ecl_rst_file.h + ecl_init_file.h + smspec_node.h + ecl_grid_cache.h + ecl_kw_grdecl.h + ecl_file_kw.h + ecl_grav.h + ecl_grav_calc.h + ecl_endian_flip.h + ecl_smspec.h + ecl_sum_data.h + ecl_util.h + ecl_kw.h ecl_sum.h ecl_sum_vector.h - fortio.h - ecl_rft_file.h - ecl_rft_node.h - ecl_rft_cell.h - ecl_box.h - ecl_coarse_cell.h - ecl_grid.h - ecl_io_config.h + fortio.h + ecl_rft_file.h + ecl_rft_node.h + ecl_rft_cell.h + ecl_box.h + ecl_coarse_cell.h + ecl_grid.h + ecl_io_config.h ecl_file.h - ecl_file_view.h - ecl_region.h - ecl_kw_magic.h - ecl_subsidence.h - ecl_grid_dims.h - grid_dims.h - nnc_info.h - nnc_vector.h - ecl_grav_common.h - ecl_nnc_export.h + ecl_file_view.h + ecl_region.h + ecl_kw_magic.h + ecl_subsidence.h + ecl_grid_dims.h + grid_dims.h + nnc_info.h + nnc_vector.h + ecl_grav_common.h + ecl_nnc_export.h + ecl_nnc_geometry.h layer.h fault_block.h fault_block_layer.h + ecl_type.h ${ext_header}) if (ERT_USE_OPENMP) @@ -90,7 +96,7 @@ if (ERT_USE_OPENMP) set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${OpenMP_SHARED_LINKER_FLAGS}") endif() -add_library( ecl ${LIBRARY_TYPE} ${source_files} ) +add_library( ecl ${source_files} ) set_target_properties( ecl PROPERTIES VERSION ${ERT_VERSION_MAJOR}.${ERT_VERSION_MINOR} SOVERSION ${ERT_VERSION_MAJOR}) if (USE_RUNPATH) add_runpath( ecl ) @@ -98,7 +104,7 @@ endif() target_link_libraries( ecl ert_geometry ert_util ) #----------------------------------------------------------------- -if (INSTALL_ERT) +if (INSTALL_ERT) install(TARGETS ecl DESTINATION ${CMAKE_INSTALL_LIBDIR}) foreach(header ${header_files}) install(FILES ../include/ert/ecl/${header} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/ert/ecl) diff --git a/ThirdParty/Ert/libecl/src/ecl_file.c b/ThirdParty/Ert/libecl/src/ecl_file.c index 0559f1d796..5a5f3c695f 100644 --- a/ThirdParty/Ert/libecl/src/ecl_file.c +++ b/ThirdParty/Ert/libecl/src/ecl_file.c @@ -36,6 +36,7 @@ #include #include #include +#include /** This file implements functionality to load an ECLIPSE file in @@ -418,8 +419,8 @@ ecl_kw_type * ecl_file_iget_kw( const ecl_file_type * file , int global_index) { return ecl_file_view_iget_kw( file->active_view , global_index); } -ecl_type_enum ecl_file_iget_type( const ecl_file_type * file , int global_index) { - return ecl_file_view_iget_type( file->active_view , global_index); +ecl_data_type ecl_file_iget_data_type( const ecl_file_type * file , int global_index) { + return ecl_file_view_iget_data_type( file->active_view , global_index); } int ecl_file_iget_size( const ecl_file_type * file , int global_index) { @@ -446,8 +447,8 @@ void ecl_file_indexed_read(const ecl_file_type * file , const char * kw, int ind ecl_file_view_index_fload_kw(file->active_view, kw, index, index_map, buffer); } -ecl_type_enum ecl_file_iget_named_type( const ecl_file_type * file , const char * kw , int ith) { - return ecl_file_view_iget_named_type( file->active_view , kw , ith ); +ecl_data_type ecl_file_iget_named_data_type( const ecl_file_type * file , const char * kw , int ith) { + return ecl_file_view_iget_named_data_type( file->active_view , kw , ith ); } int ecl_file_iget_named_size( const ecl_file_type * file , const char * kw , int ith) { @@ -515,7 +516,7 @@ static bool ecl_file_scan( ecl_file_type * ecl_file ) { bool scan_ok = false; fortio_fseek( ecl_file->fortio , 0 , SEEK_SET ); { - ecl_kw_type * work_kw = ecl_kw_alloc_new("WORK-KW" , 0 , ECL_INT_TYPE , NULL); + ecl_kw_type * work_kw = ecl_kw_alloc_new("WORK-KW" , 0 , ECL_INT , NULL); while (true) { if (fortio_read_at_eof(ecl_file->fortio)) { @@ -538,13 +539,6 @@ static bool ecl_file_scan( ecl_file_type * ecl_file ) { else break; } - - if (read_status == ECL_KW_READ_SKIP) { - bool skip_ok = ecl_kw_fskip_data( work_kw , ecl_file->fortio ); - fprintf(stderr,"** Warning: keyword %s is of type \'C010\' - will be skipped when loading file. skip_ok:%d\n" , ecl_kw_get_header( work_kw ) , skip_ok); - if (!skip_ok) - break; - } } } diff --git a/ThirdParty/Ert/libecl/src/ecl_file_kw.c b/ThirdParty/Ert/libecl/src/ecl_file_kw.c index 64e106589a..4a137974c2 100644 --- a/ThirdParty/Ert/libecl/src/ecl_file_kw.c +++ b/ThirdParty/Ert/libecl/src/ecl_file_kw.c @@ -57,7 +57,7 @@ struct inv_map_struct { struct ecl_file_kw_struct { UTIL_TYPE_ID_DECLARATION; offset_type file_offset; - ecl_type_enum ecl_type; + ecl_data_type data_type; int kw_size; char * header; ecl_kw_type * kw; @@ -135,13 +135,13 @@ UTIL_IS_INSTANCE_FUNCTION( ecl_file_kw , ECL_FILE_KW_TYPE_ID ) -static ecl_file_kw_type * ecl_file_kw_alloc__( const char * header , ecl_type_enum ecl_type , int size , offset_type offset) { +static ecl_file_kw_type * ecl_file_kw_alloc__( const char * header , ecl_data_type data_type , int size , offset_type offset) { ecl_file_kw_type * file_kw = util_malloc( sizeof * file_kw ); UTIL_TYPE_ID_INIT( file_kw , ECL_FILE_KW_TYPE_ID ); file_kw->header = util_alloc_string_copy( header ); + memcpy(&file_kw->data_type, &data_type, sizeof data_type); file_kw->kw_size = size; - file_kw->ecl_type = ecl_type; file_kw->file_offset = offset; file_kw->kw = NULL; @@ -161,7 +161,7 @@ static ecl_file_kw_type * ecl_file_kw_alloc__( const char * header , ecl_type_en */ ecl_file_kw_type * ecl_file_kw_alloc( const ecl_kw_type * ecl_kw , offset_type offset ) { - return ecl_file_kw_alloc__( ecl_kw_get_header( ecl_kw ) , ecl_kw_get_type( ecl_kw ) , ecl_kw_get_size( ecl_kw ) , offset ); + return ecl_file_kw_alloc__( ecl_kw_get_header( ecl_kw ) , ecl_kw_get_data_type( ecl_kw ) , ecl_kw_get_size( ecl_kw ) , offset ); } @@ -169,7 +169,7 @@ ecl_file_kw_type * ecl_file_kw_alloc( const ecl_kw_type * ecl_kw , offset_type o Does NOT copy the kw pointer which must be reloaded. */ ecl_file_kw_type * ecl_file_kw_alloc_copy( const ecl_file_kw_type * src ) { - return ecl_file_kw_alloc__( src->header , src->ecl_type , src->kw_size , src->file_offset ); + return ecl_file_kw_alloc__( src->header , ecl_file_kw_get_data_type(src) , src->kw_size , src->file_offset ); } @@ -193,7 +193,10 @@ void ecl_file_kw_free__( void * arg ) { static void ecl_file_kw_assert_kw( const ecl_file_kw_type * file_kw ) { - if (file_kw->ecl_type != ecl_kw_get_type( file_kw->kw )) + if(!ecl_type_is_equal( + ecl_file_kw_get_data_type(file_kw), + ecl_kw_get_data_type(file_kw->kw) + )) util_abort("%s: type mismatch between header and file.\n",__func__); if (file_kw->kw_size != ecl_kw_get_size( file_kw->kw )) @@ -265,18 +268,20 @@ bool ecl_file_kw_ptr_eq( const ecl_file_kw_type * file_kw , const ecl_kw_type * void ecl_file_kw_replace_kw( ecl_file_kw_type * file_kw , fortio_type * target , ecl_kw_type * new_kw ) { - if ((file_kw->ecl_type == ecl_kw_get_type( new_kw )) && - (file_kw->kw_size == ecl_kw_get_size( new_kw ))) { + if (!ecl_type_is_equal( + ecl_file_kw_get_data_type(file_kw), + ecl_kw_get_data_type(new_kw) + )) + util_abort("%s: sorry type mismatch between in-file keyword and new keyword \n",__func__); + if((file_kw->kw_size == ecl_kw_get_size( new_kw ))) + util_abort("%s: sorry size mismatch between in-file keyword and new keyword \n",__func__); - if (file_kw->kw != NULL) - ecl_kw_free( file_kw->kw ); + if (file_kw->kw != NULL) + ecl_kw_free( file_kw->kw ); - file_kw->kw = new_kw; - fortio_fseek( target , file_kw->file_offset , SEEK_SET ); - ecl_kw_fwrite( file_kw->kw , target ); - - } else - util_abort("%s: sorry size/type mismatch between in-file keyword and new keyword \n",__func__); + file_kw->kw = new_kw; + fortio_fseek( target , file_kw->file_offset , SEEK_SET ); + ecl_kw_fwrite( file_kw->kw , target ); } @@ -289,8 +294,8 @@ int ecl_file_kw_get_size( const ecl_file_kw_type * file_kw ) { return file_kw->kw_size; } -ecl_type_enum ecl_file_kw_get_type( const ecl_file_kw_type * file_kw) { - return file_kw->ecl_type; +ecl_data_type ecl_file_kw_get_data_type(const ecl_file_kw_type * file_kw) { + return file_kw->data_type; } offset_type ecl_file_kw_get_offset(const ecl_file_kw_type * file_kw) { @@ -298,7 +303,7 @@ offset_type ecl_file_kw_get_offset(const ecl_file_kw_type * file_kw) { } bool ecl_file_kw_fskip_data( const ecl_file_kw_type * file_kw , fortio_type * fortio) { - return ecl_kw_fskip_data__( file_kw->ecl_type , file_kw->kw_size , fortio ); + return ecl_kw_fskip_data__( ecl_file_kw_get_data_type(file_kw) , file_kw->kw_size , fortio ); } diff --git a/ThirdParty/Ert/libecl/src/ecl_file_view.c b/ThirdParty/Ert/libecl/src/ecl_file_view.c index 38f6921270..8798a90caf 100644 --- a/ThirdParty/Ert/libecl/src/ecl_file_view.c +++ b/ThirdParty/Ert/libecl/src/ecl_file_view.c @@ -27,6 +27,7 @@ #include #include #include +#include struct ecl_file_view_struct { @@ -166,10 +167,10 @@ void ecl_file_view_index_fload_kw(const ecl_file_view_type * ecl_file_view, cons if (fortio_assert_stream_open( ecl_file_view->fortio )) { offset_type offset = ecl_file_kw_get_offset(file_kw); - ecl_type_enum ecl_type = ecl_file_kw_get_type(file_kw); + ecl_data_type data_type = ecl_file_kw_get_data_type(file_kw); int element_count = ecl_file_kw_get_size(file_kw); - ecl_kw_fread_indexed_data(ecl_file_view->fortio, offset + ECL_KW_HEADER_FORTIO_SIZE, ecl_type, element_count, index_map, buffer); + ecl_kw_fread_indexed_data(ecl_file_view->fortio, offset + ECL_KW_HEADER_FORTIO_SIZE, data_type, element_count, index_map, buffer); } } @@ -204,9 +205,9 @@ int ecl_file_view_get_size( const ecl_file_view_type * ecl_file_view ) { } -ecl_type_enum ecl_file_view_iget_type( const ecl_file_view_type * ecl_file_view , int index) { +ecl_data_type ecl_file_view_iget_data_type( const ecl_file_view_type * ecl_file_view , int index) { ecl_file_kw_type * file_kw = ecl_file_view_iget_file_kw( ecl_file_view , index ); - return ecl_file_kw_get_type( file_kw ); + return ecl_file_kw_get_data_type( file_kw ); } int ecl_file_view_iget_size( const ecl_file_view_type * ecl_file_view , int index) { @@ -235,9 +236,9 @@ ecl_kw_type * ecl_file_view_iget_named_kw( const ecl_file_view_type * ecl_file_v return ecl_kw; } -ecl_type_enum ecl_file_view_iget_named_type( const ecl_file_view_type * ecl_file_view , const char * kw , int ith) { +ecl_data_type ecl_file_view_iget_named_data_type( const ecl_file_view_type * ecl_file_view , const char * kw , int ith) { ecl_file_kw_type * file_kw = ecl_file_view_iget_named_file_kw( ecl_file_view , kw, ith); - return ecl_file_kw_get_type( file_kw ); + return ecl_file_kw_get_data_type( file_kw ); } int ecl_file_view_iget_named_size( const ecl_file_view_type * ecl_file_view , const char * kw , int ith) { @@ -357,10 +358,12 @@ void ecl_file_view_fprintf_kw_list(const ecl_file_view_type * ecl_file_view , FI int i; for (i=0; i < vector_get_size( ecl_file_view->kw_list ); i++) { const ecl_file_kw_type * file_kw = vector_iget_const( ecl_file_view->kw_list , i ); + char * type_name = ecl_type_alloc_name(ecl_file_kw_get_data_type(file_kw)); fprintf(stream , "%-8s %7d:%s\n", ecl_file_kw_get_header( file_kw ) , ecl_file_kw_get_size( file_kw ) , - ecl_util_get_type_name( ecl_file_kw_get_type( file_kw ))); + type_name); + free(type_name); } } diff --git a/ThirdParty/Ert/libecl/src/ecl_grid.c b/ThirdParty/Ert/libecl/src/ecl_grid.c index d0eff2fd99..0e2dd610ef 100644 --- a/ThirdParty/Ert/libecl/src/ecl_grid.c +++ b/ThirdParty/Ert/libecl/src/ecl_grid.c @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -492,45 +493,55 @@ Warning: The main author of this code suspects that the coordinate system can be right-handed as well, giving a z axis which will increase 'towards the sky'; the safest is probaly to check this explicitly if it matters for the case at hand. + +Method 0 corresponds to a tetrahedron decomposition which will split +the lower layer along the 1-2 diagonal and the upper layer along the +4-7 diagonal, method 1 corresponds to the alternative decomposition +which splits the lower face along the 0-3 diagnoal and the upper face +along the 5-6 diagonal. */ -static const int tetrahedron_permutations[2][12][3] = {{{0,1,2}, + +static const int tetrahedron_permutations[2][12][3] = {{ + // K- + {0,1,2}, {3,2,1}, - {0,4,1}, - {5,1,4}, + // J+ + {6,2,7}, + {3,7,2}, + // I- {0,2,4}, {6,4,2}, - {3,7,2}, - {6,2,7}, + // I+ {3,1,7}, {5,7,1}, + // J- + {0,4,1}, + {5,1,4}, + // K+ {5,4,7}, - {6,7,4}}, - {{1,5,3}, + {6,7,4} + }, + { + // K- {1,3,0}, - {1,0,5}, {2,0,3}, - {2,6,0}, + // J+ {2,3,6}, - {4,5,0}, - {4,6,5}, + {7,6,3}, + // I- + {2,6,0}, {4,0,6}, - {7,5,6}, + // I+ {7,3,5}, - {7,6,3}}}; - - - - - - - -static const int bounding_planes[6][3] = {{0,1,2}, - {0,2,4}, - {0,4,1}, - {4,6,5}, - {2,3,6}, - {1,5,3}}; + {1,5,3}, + // J- + {1,0,5}, + {4,5,0}, + // K+ + {7,5,6}, + {4,6,5} + }}; @@ -605,37 +616,6 @@ static double point_dot_product( const point_type * v1 , const point_type * v2) return v1->x*v2->x + v1->y*v2->y + v1->z*v2->z; } -static bool point_equal( const point_type *p1 , const point_type * p2) { - return (memcmp( p1 , p2 , sizeof * p1 ) == 0); -} - -/** - This function calculates the (signed) distance from point 'p' to - the plane specifed by the plane vector 'n' and the point - 'plane_point' which is part of the plane. -*/ - -static double point_plane_distance(const point_type * p , const point_type * n , const point_type * plane_point) { - point_type diff = *p; - point_inplace_sub( &diff, plane_point ); - return point_dot_product( n, &diff ); -} - -static void point_normal_vector(point_type * n, const point_type * p0, const point_type * p1 , const point_type * p2) { - point_type v1 = *p1; - point_type v2 = *p2; - - point_inplace_sub( &v1, p0 ); - point_inplace_sub( &v2, p0 ); - - point_vector_cross( n, &v1, &v2 ); -} - -static double point3_plane_distance(const point_type * p0 , const point_type * p1 , const point_type * p2 , const point_type * x) { - point_type n; - point_normal_vector( &n , p0 , p1 , p2 ); - return point_plane_distance( x , &n , p0 ) / sqrt( n.x*n.x + n.y*n.y + n.z*n.z); -} static void point_compare( const point_type *p1 , const point_type * p2, bool * equal) { const double tolerance = 0.001; @@ -1066,6 +1046,21 @@ static void ecl_cell_taint_cell( ecl_cell_type * cell ) { } + +static int ecl_cell_get_twist( const ecl_cell_type * cell ) { + int twist_count = 0; + + for (int c = 0; c < 4; c++) { + const point_type * p1 = &cell->corner_list[c]; + const point_type * p2 = &cell->corner_list[c + 4]; + if ((p2->z - p1->z) < 0) + twist_count += 1; + } + return twist_count; +} + + + /*****************************************************************/ @@ -1113,6 +1108,7 @@ static void ecl_cell_set_center( ecl_cell_type * cell) { } + static void ecl_cell_assert_center( ecl_cell_type * cell) { if (!GET_CELL_FLAG(cell , CELL_FLAG_CENTER)) ecl_cell_set_center( cell ); @@ -1230,6 +1226,35 @@ static inline double tetrahedron_volume6( tetrahedron_type tet ) { return tet.p0.x*bxc.x + tet.p0.y*bxc.y + tet.p0.z*bxc.z; } +/* + Returns true if and only if the point p is inside the tetrahedron tet. +*/ +static bool tetrahedron_contains(tetrahedron_type tet, const point_type p) { + const double epsilon = 1e-9; + double tetra_volume = fabs(tetrahedron_volume6(tet)); + + if(tetra_volume < epsilon) + return false; + + // Decomposes tetrahedron into 4 new tetrahedrons + point_type tetra_points[4] = {tet.p0, tet.p1, tet.p2, tet.p3}; + double decomposition_volume = 0; + for(int i = 0; i < 4; ++i) { + const point_type tmp = tetra_points[i]; + tetra_points[i] = p; + + // Compute volum of decomposition tetrahedron + tetrahedron_type dec_tet; + dec_tet.p0 = tetra_points[0]; dec_tet.p1 = tetra_points[1]; + dec_tet.p2 = tetra_points[2]; dec_tet.p3 = tetra_points[3]; + decomposition_volume += fabs(tetrahedron_volume6(dec_tet)); + + tetra_points[i] = tmp; + } + + return (fabs(tetra_volume - decomposition_volume) < epsilon); +} + /* * This function used to account for a significant amount of execution time * when used in opm-parser and has been optimised significantly. This means @@ -1340,6 +1365,52 @@ static bool triangle_contains(const point_type *p0 , const point_type * p1 , con } } +static double parallelogram_area3d(const point_type * p0, const point_type * p1, const point_type * p2) { + point_type a = *p1; + point_type b = *p2; + point_inplace_sub(&a, p0); + point_inplace_sub(&b, p0); + + point_type c; + point_vector_cross(&c, &a, &b); + return sqrt(point_dot_product(&c, &c)); +} + +/* + * Returns true if and only if point p is contained in the triangle denoted by + * p0, p1 and p2. Note that if the triangle is a line, the function will still + * return true if the point lies on the line segment. + */ +static bool triangle_contains3d(const point_type *p0 , const point_type * p1 , const point_type *p2 , const point_type *p) { + double epsilon = 1e-10; + double vt = parallelogram_area3d(p0, p1, p2); + + double v1 = parallelogram_area3d(p0, p1, p); + double v2 = parallelogram_area3d(p0, p2, p); + double v3 = parallelogram_area3d(p1, p2, p); + + // p0, p1, p2 represents a line segment and + // p lies on the line this segment represents + if(vt < epsilon && fabs(v1+v2+v3) < epsilon) { + double x_min = util_double_min(p0->x, util_double_min(p1->x, p2->x)); + double x_max = util_double_max(p0->x, util_double_max(p1->x, p2->x)); + + double y_min = util_double_min(p0->y, util_double_min(p1->y, p2->y)); + double y_max = util_double_max(p0->y, util_double_max(p1->y, p2->y)); + + double z_min = util_double_min(p0->z, util_double_min(p1->z, p2->z)); + double z_max = util_double_max(p0->z, util_double_max(p1->z, p2->z)); + + return ( + x_min-epsilon <= p->x && p->x <= x_max+epsilon && + y_min-epsilon <= p->y && p->y <= y_max+epsilon && + z_min-epsilon <= p->z && p->z <= z_max+epsilon + ); + } + + return (fabs( vt - (v1 + v2 + v3 )) < epsilon); +} + @@ -2153,10 +2224,7 @@ static void ecl_grid_set_lgr_name_GRID(ecl_grid_type * lgr_grid , const ecl_file the zcorn vector. */ -int ecl_grid_zcorn_index(const ecl_grid_type * grid , int i, int j , int k , int c) { - int nx = grid->nx; - int ny = grid->ny; - +int ecl_grid_zcorn_index__(int nx, int ny , int i, int j , int k , int c) { int zcorn_index = k*8*nx*ny + j*4*nx + 2*i; if ((c % 2) == 1) zcorn_index += 1; @@ -2173,6 +2241,9 @@ int ecl_grid_zcorn_index(const ecl_grid_type * grid , int i, int j , int k , int return zcorn_index; } +int ecl_grid_zcorn_index(const ecl_grid_type * grid , int i, int j , int k , int c) { + return ecl_grid_zcorn_index__( grid->nx, grid->ny , i , j , k , c ); +} static void ecl_grid_init_GRDECL_data_jslice(ecl_grid_type * ecl_grid , const float * zcorn , const float * coord , const int * actnum, const int * corsnum , int j) { @@ -2274,7 +2345,7 @@ static ecl_grid_type * ecl_grid_alloc_GRDECL_data__(ecl_grid_type * global_grid if (corsnum != NULL) ecl_grid->coarsening_active = true; - ecl_grid->coord_kw = ecl_kw_alloc_new("COORD" , 6*(nx + 1) * (ny + 1) , ECL_FLOAT_TYPE , coord ); + ecl_grid->coord_kw = ecl_kw_alloc_new("COORD" , 6*(nx + 1) * (ny + 1) , ECL_FLOAT , coord ); ecl_grid_init_GRDECL_data( ecl_grid , zcorn , coord , actnum , corsnum); ecl_grid_init_coarse_cells( ecl_grid ); @@ -2652,9 +2723,16 @@ static void ecl_grid_init_nnc(ecl_grid_type * main_grid, ecl_file_type * ecl_fil int num_nnchead_kw = ecl_file_get_num_named_kw( ecl_file , NNCHEAD_KW ); int i; - if(num_nnchead_kw > 0 && main_grid->eclipse_version == 2015){ - return; //Eclipse 2015 has an error with nnc. - } + /* + NB: There is a bug in Eclipse version 2015.1, for MPI runs with + six or more processors (I think ...) the NNC datastructures + are in an internally inconsistent state; and will lead to a + hard crash. The issue has been fixed in version 2015.2, but + unfortunately it is not possible to test for micro version. + + if(num_nnchead_kw > 0 && main_grid->eclipse_version == 2015) + return; + */ for (i = 0; i < num_nnchead_kw; i++) { ecl_file_view_type * lgr_view = ecl_file_alloc_global_blockview(ecl_file , NNCHEAD_KW , i); @@ -3750,143 +3828,268 @@ bool ecl_grid_compare(const ecl_grid_type * g1 , const ecl_grid_type * g2 , bool /*****************************************************************/ -bool ecl_grid_cell_contains_xyz1( const ecl_grid_type * ecl_grid , int global_index , double x , double y , double z) { - const double min_volume = 1e-9; - point_type p; - ecl_cell_type * cell = ecl_grid_get_cell( ecl_grid , global_index ); +typedef enum {NOT_ON_FACE, BELONGS_TO_CELL, BELONGS_TO_OTHER} face_status_enum; - point_set( &p , x , y , z); - /* - 1. first check if the point z value is below the deepest point of - the cell, or above the shallowest => return false. - - 2. should do similar fast checks in x/y direction. - - 3. full geometric verification. - */ - if (GET_CELL_FLAG(cell , CELL_FLAG_TAINTED)) +/* + Returns whether the given point is contained within the minimal cube + encapsulating the cell that has all faces parallel to a coordinate plane. +*/ +static bool ecl_grid_cube_contains(const ecl_cell_type * cell, const point_type * p) { + if (p->z < ecl_cell_min_z( cell )) return false; - if (p.z < ecl_cell_min_z( cell )) + if (p->z > ecl_cell_max_z( cell )) return false; - if (p.z > ecl_cell_max_z( cell )) + if (p->x < ecl_cell_min_x( cell )) return false; - if (p.x < ecl_cell_min_x( cell )) + if (p->x > ecl_cell_max_x( cell )) return false; - if (p.x > ecl_cell_max_x( cell )) + if (p->y < ecl_cell_min_y( cell )) return false; - if (p.y < ecl_cell_min_y( cell )) + if (p->y > ecl_cell_max_y( cell )) return false; - if (p.y > ecl_cell_max_y( cell )) - return false; + return true; +} - { - int i,j,k; - ecl_grid_get_ijk1( ecl_grid , global_index , &i , &j , &k); - ecl_cell_assert_center( cell ); +/* + Returns true if and only if p is on plane "plane" of cell when decomposed by "method". +*/ +static bool ecl_grid_on_plane(const ecl_cell_type * cell, const int method, + const int plane, const point_type * p) { + const point_type * p0 = &cell->corner_list[ tetrahedron_permutations[method][plane][0] ]; + const point_type * p1 = &cell->corner_list[ tetrahedron_permutations[method][plane][1] ]; + const point_type * p2 = &cell->corner_list[ tetrahedron_permutations[method][plane][2] ]; + return triangle_contains3d(p0, p1, p2, p); +} - /* - Special case checks for the corner points. - */ - if (point_equal( &p , &cell->corner_list[0])) - return true; +/* + Returns true if and only if p is on one of the cells faces and + "belongs" to this cell. This is done such that every point is contained in at most + one point. - if (point_equal( &p , &cell->corner_list[1] )) { - if (i == (ecl_grid->nx - 1)) - return true; - else + Known caveats when using this function: + - if a point is on the surface of a/many cells, but for all of these cells + the point is contained on two opposite sides of the cell. Imagine a cake + being cut as a cake should be cut. To which of the slices does the center + point of the cake belong? This is a somewhat obscure situation and it is + not possible to circumvent by only considering the grid cell by cell. + - if there is a fault and this cell is on the border of the grid. + - if a cells projection to the xy-plane is concave, this method might give + false positives. + + Note: The correctness of this function relies *HEAVILY* on the permutation of the + tetrahedrons in the decompositions. +*/ +static face_status_enum ecl_grid_on_cell_face(const ecl_cell_type * cell, const int method, + const point_type * p, + const bool max_i, const bool max_j, const bool max_k) { + + int k_minus = 0, j_pluss = 1, i_minus = 2, i_pluss = 3, j_minus = 4, k_pluss = 5; + bool on[6]; + for(int i = 0; i < 6; ++i) { + on[i] = ( + ecl_grid_on_plane(cell, method, 2*i, p) || + ecl_grid_on_plane(cell, method, 2*i+1, p) + ); + } + + // Not on any of the cell sides + if(!on[k_minus] && !on[k_pluss] && !on[j_pluss] && !on[j_minus] && !on[i_minus] && !on[i_pluss]) + return NOT_ON_FACE; + + // Handles side collapses, i.e. the point is contained on opposite sides. + // Cell passes on the responsibility if not on border of grid. + bool i_collapse = (on[i_minus] && on[i_pluss]); + bool j_collapse = (on[j_minus] && on[j_pluss]); + bool k_collapse = (on[k_minus] && on[k_pluss]); + + for(int i = 0; i < 6; ++i) + on[i] &= (!i_collapse || max_i) && (!j_collapse || max_j) && (!k_collapse || max_k); + + on[i_minus] &= !on[i_pluss]; + on[j_minus] &= !on[j_pluss]; + on[k_minus] &= !on[k_pluss]; + + // Removed from all sides + if(!on[k_minus] && !on[k_pluss] && !on[j_pluss] && !on[j_minus] && !on[i_minus] && !on[i_pluss]) + return BELONGS_TO_OTHER; + + // Not on any of the lower priority sides + if(!on[k_pluss] && !on[j_pluss] && !on[i_pluss]) + return BELONGS_TO_CELL; + + // Contained in cell due to border conditions + // NOTE: One should read X <= Y as X "implies" Y + if((on[i_pluss] <= max_i) && (on[j_pluss] <= max_j) && (on[k_pluss] <= max_k)) + return BELONGS_TO_CELL; + + return BELONGS_TO_OTHER; +} + +/* + Returns true if and only if the tetrahedron defined by p0, p1, p2, p3 + contains p. + + The sole purpose of this functions is to make concave_cell_contains + more readable. +*/ +static bool tetrahedron_by_points_contains(const point_type * p0, + const point_type * p1, + const point_type * p2, + const point_type * p3, + const point_type * p) { + + tetrahedron_type pro_tet; + pro_tet.p0 = *p0; + pro_tet.p1 = *p1; + pro_tet.p2 = *p2; + pro_tet.p3 = *p3; + + return tetrahedron_contains(pro_tet, *p); +} + +static bool tetrahedron_positive_volume(const point_type * p0, + const point_type * p1, + const point_type * p2, + const point_type * p3) { + + tetrahedron_type pro_tet; + pro_tet.p0 = *p0; + pro_tet.p1 = *p1; + pro_tet.p2 = *p2; + pro_tet.p3 = *p3; + + return tetrahedron_volume6(pro_tet) >= 0; +} + +/* + Returns true if and only if the cell "cell" decomposed by "method" contains the point "p". + This is done by decomposing the cell into 5 tetrahedrons according to the decomposition + method for the faces. + + Assumes the cell to not be self-intersecting! + + Note: This function relies *HEAVILY* on the permutation of tetrahedron_permutations. +*/ +static bool concave_cell_contains( const ecl_cell_type * cell, int method, const point_type * p) { + + const point_type * dia[2][2] = { + { + &cell->corner_list[tetrahedron_permutations[method][0][1]], + &cell->corner_list[tetrahedron_permutations[method][0][2]] + }, + { + &cell->corner_list[tetrahedron_permutations[method][10][1]], + &cell->corner_list[tetrahedron_permutations[method][10][2]] + } + }; + + const point_type * extra[2][2] = { + { + &cell->corner_list[tetrahedron_permutations[method][0][0]], + &cell->corner_list[tetrahedron_permutations[method][1][0]] + }, + { + &cell->corner_list[tetrahedron_permutations[method][10][0]], + &cell->corner_list[tetrahedron_permutations[method][11][0]] + } + }; + + // Test for containment in cell core + bool contained = tetrahedron_by_points_contains(dia[0][0], dia[1][0], dia[0][1], dia[1][1], p); + + // Test for containment in protrusions + for(int i = 0; i < 2; ++i) { + if(tetrahedron_by_points_contains(dia[i][0], dia[i][1], dia[(i+1)%2][0], extra[i][0], p)) { + contained = true; + + bool on_inner_faces = false; + on_inner_faces |= triangle_contains3d(dia[i][0], dia[(i+1)%2][0], extra[i][0], p); + on_inner_faces |= triangle_contains3d(dia[i][1], dia[(i+1)%2][0], extra[i][0], p); + + if(!on_inner_faces && !tetrahedron_positive_volume(dia[i][0], dia[i][1], dia[(i+1)%2][0], extra[i][0])) return false; } - if (point_equal( &p , &cell->corner_list[2])) { - if (j == (ecl_grid->ny - 1)) - return true; - else - return false; - } + if(tetrahedron_by_points_contains(dia[i][0], dia[(i+1)%2][1], dia[i][1], extra[i][1], p)) { + contained = true; - if (point_equal( &p , &cell->corner_list[3])) { - if ((j == (ecl_grid->ny - 1)) && - (i == (ecl_grid->nx - 1))) - return true; - else - return false; - } + bool on_inner_faces = false; + on_inner_faces |= triangle_contains3d(dia[i][0], dia[(i+1)%2][1], extra[i][1], p); + on_inner_faces |= triangle_contains3d(dia[i][1], dia[(i+1)%2][1], extra[i][1], p); - if (point_equal( &p , &cell->corner_list[4])) { - if (k == (ecl_grid->nz - 1)) - return true; - else - return false; - } - - if (point_equal( &p , &cell->corner_list[5] )) { - if ((i == (ecl_grid->nx - 1)) && - (k == (ecl_grid->nz - 1))) - return true; - else - return false; - } - - if (point_equal( &p , &cell->corner_list[6] )) { - if ((j == (ecl_grid->ny - 1)) && - (k == (ecl_grid->nz - 1))) - return true; - else - return false; - } - - if (point_equal( &p , &cell->corner_list[7] )) { - if ((i == (ecl_grid->nx - 1)) && - (j == (ecl_grid->ny - 1)) && - (k == (ecl_grid->nz - 1))) - return true; - else - return false; - } - - { - double sign = 1.0; - int plane_nr = 0; - double signed_volume = ecl_cell_get_signed_volume( cell ); - if (fabs(signed_volume) > min_volume) { - point_type * p0; - point_type * p1; - point_type * p2; - - if (signed_volume < 0) - sign = -1; - { - while (true) { - p0 = &cell->corner_list[ bounding_planes[plane_nr][0] ]; - p1 = &cell->corner_list[ bounding_planes[plane_nr][1] ]; - p2 = &cell->corner_list[ bounding_planes[plane_nr][2] ]; - - if (point_equal(p0, p1) || point_equal(p0,p2) || point_equal(p1,p2)) - return false; - - if (sign * point3_plane_distance(p0 , p1 , p2 , &p ) < 0) - return false; - - plane_nr++; - if (plane_nr == 6) - return true; - } - } - } else + if(!on_inner_faces && !tetrahedron_positive_volume(dia[i][0], dia[(i+1)%2][1], dia[i][1], extra[i][1])) return false; } } + + return contained; } -bool ecl_grid_cell_contains_xyz3( const ecl_grid_type * ecl_grid , int i , int j , int k, double x , double y , double z) { - int global_index = ecl_grid_get_global_index3( ecl_grid , i , j , k ); - return ecl_grid_cell_contains_xyz1( ecl_grid , global_index , x ,y , z); +/* + Observe the following quirks with this functions: + + - It is quite simple to create a cell where the center point is + actually *not* inside the cell - that might come as a surprise! + + - Cells with nonzero twist are completely discarded from the search, + if the point (x,y,z) "should" have been found on the inside of a + twisted cell the algorithm will incorrectly return false; a + warning will be printed on stderr if a cell is discarded due to + twist. + + - See the documentation of ecl_grid_on_cell_face for caveats regarding + containtment of points of cell faces. +*/ +bool ecl_grid_cell_contains_xyz3( const ecl_grid_type * ecl_grid , int i, int j , int k, double x , double y , double z) { + point_type p; + ecl_cell_type * cell = ecl_grid_get_cell( ecl_grid , ecl_grid_get_global_index3( ecl_grid , i, j , k )); + point_set( &p , x , y , z); + int method = (i + j + k) % 2; // Chooses the approperiate decomposition method for the cell + + if (GET_CELL_FLAG(cell , CELL_FLAG_TAINTED)) + return false; + + // Pruning + if (!ecl_grid_cube_contains(cell, &p)) + return false; + + // Checks if point is on one of the faces of the cell, and if so whether it + // "belongs" to this cell. + bool max_i = (i == ecl_grid->nx-1); + bool max_j = (j == ecl_grid->ny-1); + bool max_k = (k == ecl_grid->nz-1); + face_status_enum face_status = ecl_grid_on_cell_face(cell, method, &p, max_i, max_j, max_k); + + if(face_status != NOT_ON_FACE) { + // Since we might get false positives in the case when the cells + // projections to the xy-plane is concave, we still check whether + // the point is contained in the cell if it face_status is + // BELONGS_TO_CELL. + if(face_status == BELONGS_TO_OTHER) + return false; + } + + // Twisted cells + if (ecl_cell_get_twist(cell) > 0) { + fprintf(stderr, "** Warning: Point (%g,%g,%g) is in vicinity of twisted cell: (%d,%d,%d) - function:%s might be mistaken.\n", x,y,z,i,j,k, __func__); + return false; + } + + // We now check whether the point is strictly inside the cell + return concave_cell_contains(cell, method, &p); +} + + +bool ecl_grid_cell_contains_xyz1( const ecl_grid_type * ecl_grid , int global_index, double x , double y , double z) { + int i,j,k; + ecl_grid_get_ijk1( ecl_grid , global_index , &i , &j , &k); + return ecl_grid_cell_contains_xyz3( ecl_grid , i,j,k,x ,y , z); } /** @@ -4036,6 +4239,15 @@ int ecl_grid_get_global_index_from_xyz(ecl_grid_type * grid , double x , double return -1; } +bool ecl_grid_get_ijk_from_xyz(ecl_grid_type * grid , double x , double y , double z , int start_index, int *i, int *j, int *k ) { + int g = ecl_grid_get_global_index_from_xyz(grid, x, y, z, start_index); + if (g < 0) + return false; + + ecl_grid_get_ijk1( grid , g , i,j,k); + return true; +} + static bool ecl_grid_sublayer_contanins_xy__(const ecl_grid_type * grid , double x , double y , int k , int i1 , int i2 , int j1 , int j2, geo_polygon_type * polygon) { int i,j; @@ -4430,11 +4642,14 @@ void ecl_grid_get_ijk1A(const ecl_grid_type *ecl_grid , int active_index , int * /******************************************************************/ /* Functions to get the 'true' (i.e. UTM or whatever) position (x,y,z). + + The cell center is calculated as the plain average of the eight + corner positions, it is quite simple to construct cells where this + average position is on the outside of the cell - hence there is no + guarantee that the (x,y,z) position returned from this function + actually is on the inside of the cell. */ -/* - ijk are C-based zero offset. -*/ void ecl_grid_get_xyz1(const ecl_grid_type * grid , int global_index , double *xpos , double *ypos , double *zpos) { ecl_cell_type * cell = ecl_grid_get_cell( grid , global_index); @@ -4448,6 +4663,7 @@ void ecl_grid_get_xyz1(const ecl_grid_type * grid , int global_index , double *x + void ecl_grid_get_xyz3(const ecl_grid_type * grid , int i, int j , int k, double *xpos , double *ypos , double *zpos) { const int global_index = ecl_grid_get_global_index__(grid , i , j , k ); ecl_grid_get_xyz1( grid , global_index , xpos , ypos , zpos); @@ -4455,8 +4671,6 @@ void ecl_grid_get_xyz3(const ecl_grid_type * grid , int i, int j , int k, double - - /** This function will return (by reference) the x,y,z values of corner nr 'corner_nr' in cell 'global_index'. See the documentation of @@ -5044,7 +5258,31 @@ bool ecl_grid_cell_regular3( const ecl_grid_type * ecl_grid, int i,int j,int k) return ecl_grid_cell_regular1( ecl_grid , global_index ); } +/* + The function ecl_grid_get_cell_twist() is an attempt to measure how + twisted or deformed a cell is. For a 'normal' cell the corners + [0..3] will z value <= the corners [4..7]. This function will count + the number of times the z value from the [4..7] is lower than the + corresponding z value from the [0..3] layer. + The purpose of the function is to detect twisted cells before + embarking on cell contains calculation. The current + ecl_cell_contains_xyz( ) implementation will fail badly for twisted + cells. + + If the function return 4 you probably have an inverted z-axis! +*/ + +int ecl_grid_get_cell_twist1( const ecl_grid_type * ecl_grid, int global_index ) { + ecl_cell_type * cell = ecl_grid_get_cell( ecl_grid , global_index ); + return ecl_cell_get_twist( cell ); +} + + +int ecl_grid_get_cell_twist3(const ecl_grid_type * ecl_grid, int i, int j , int k) { + int global_index = ecl_grid_get_global_index3( ecl_grid , i , j , k); + return ecl_grid_get_cell_twist1( ecl_grid , global_index ); +} double ecl_grid_get_cell_volume1( const ecl_grid_type * ecl_grid, int global_index ) { @@ -5152,8 +5390,8 @@ static int ecl_grid_get_property_index__(const ecl_grid_type * ecl_grid , const static bool ecl_grid_get_property__(const ecl_grid_type * ecl_grid , const ecl_kw_type * ecl_kw , int i , int j , int k, void * value) { - ecl_type_enum ecl_type = ecl_kw_get_type( ecl_kw ); - if ((ecl_type == ECL_FLOAT_TYPE) || (ecl_type == ECL_INT_TYPE) || (ecl_type == ECL_DOUBLE_TYPE)) { + ecl_data_type data_type = ecl_kw_get_data_type( ecl_kw ); + if (ecl_type_is_numeric(data_type)) { int lookup_index = ecl_grid_get_property_index__( ecl_grid , ecl_kw , i , j , k ); if (lookup_index >= 0) { @@ -5163,15 +5401,15 @@ static bool ecl_grid_get_property__(const ecl_grid_type * ecl_grid , const ecl_k return false; } else { - util_abort("%s: sorry - can not lookup ECLIPSE type:%s with %s.\n",__func__ , ecl_util_get_type_name( ecl_type ) , __func__); + util_abort("%s: sorry - can not lookup ECLIPSE type:%s with %s.\n",__func__ , ecl_type_alloc_name( data_type ) , __func__); return false; } } double ecl_grid_get_double_property(const ecl_grid_type * ecl_grid , const ecl_kw_type * ecl_kw , int i , int j , int k) { - ecl_type_enum ecl_type = ecl_kw_get_type( ecl_kw ); - if (ecl_type == ECL_DOUBLE_TYPE) { + ecl_data_type data_type = ecl_kw_get_data_type( ecl_kw ); + if (ecl_type_is_double(data_type)) { double value; if (ecl_grid_get_property__( ecl_grid , ecl_kw , i , j , k , &value)) return value; @@ -5185,8 +5423,8 @@ double ecl_grid_get_double_property(const ecl_grid_type * ecl_grid , const ecl_k int ecl_grid_get_int_property(const ecl_grid_type * ecl_grid , const ecl_kw_type * ecl_kw , int i , int j , int k) { - ecl_type_enum ecl_type = ecl_kw_get_type( ecl_kw ); - if (ecl_type == ECL_INT_TYPE) { + ecl_data_type data_type = ecl_kw_get_data_type( ecl_kw ); + if (ecl_type_is_int(data_type)) { int value; if (ecl_grid_get_property__( ecl_grid , ecl_kw , i , j , k , &value)) @@ -5202,8 +5440,8 @@ int ecl_grid_get_int_property(const ecl_grid_type * ecl_grid , const ecl_kw_type float ecl_grid_get_float_property(const ecl_grid_type * ecl_grid , const ecl_kw_type * ecl_kw , int i , int j , int k) { - ecl_type_enum ecl_type = ecl_kw_get_type( ecl_kw ); - if (ecl_type == ECL_FLOAT_TYPE) { + ecl_data_type data_type = ecl_kw_get_data_type( ecl_kw ); + if (ecl_type_is_float(data_type)) { float value; if (ecl_grid_get_property__( ecl_grid , ecl_kw , i , j , k , &value)) @@ -5218,8 +5456,8 @@ float ecl_grid_get_float_property(const ecl_grid_type * ecl_grid , const ecl_kw_ } double ecl_grid_get_property(const ecl_grid_type * ecl_grid , const ecl_kw_type * ecl_kw , int i , int j , int k) { - ecl_type_enum ecl_type = ecl_kw_get_type( ecl_kw ); - if ((ecl_type == ECL_FLOAT_TYPE) || (ecl_type == ECL_INT_TYPE) || (ecl_type == ECL_DOUBLE_TYPE)) { + ecl_data_type data_type = ecl_kw_get_data_type( ecl_kw ); + if (ecl_type_is_numeric(data_type)) { int lookup_index = ecl_grid_get_property_index__( ecl_grid , ecl_kw , i , j , k ); if (lookup_index >= 0) @@ -5228,7 +5466,7 @@ double ecl_grid_get_property(const ecl_grid_type * ecl_grid , const ecl_kw_type return -1; /* Tried to lookup an inactive cell. */ } else { - util_abort("%s: sorry - can not lookup ECLIPSE type:%s with %s.\n",__func__ , ecl_util_get_type_name( ecl_type ) , __func__); + util_abort("%s: sorry - can not lookup ECLIPSE type:%s with %s.\n",__func__ , ecl_type_alloc_name( data_type ) , __func__); return -1; } } @@ -5252,8 +5490,8 @@ double ecl_grid_get_property(const ecl_grid_type * ecl_grid , const ecl_kw_type void ecl_grid_get_column_property(const ecl_grid_type * ecl_grid , const ecl_kw_type * ecl_kw , int i , int j, double_vector_type * column) { - ecl_type_enum ecl_type = ecl_kw_get_type( ecl_kw ); - if ((ecl_type == ECL_FLOAT_TYPE) || (ecl_type == ECL_INT_TYPE) || (ecl_type == ECL_DOUBLE_TYPE)) { + ecl_data_type data_type = ecl_kw_get_data_type(ecl_kw); + if (ecl_type_is_numeric(data_type)) { int kw_size = ecl_kw_get_size( ecl_kw ); bool use_global_index = false; @@ -5279,7 +5517,7 @@ void ecl_grid_get_column_property(const ecl_grid_type * ecl_grid , const ecl_kw_ } } } else - util_abort("%s: sorry - can not lookup ECLIPSE type:%s with %s.\n",__func__ , ecl_util_get_type_name( ecl_type ) , __func__); + util_abort("%s: sorry - can not lookup ECLIPSE type:%s with %s.\n",__func__ , ecl_type_alloc_name( data_type ) , __func__); } @@ -5316,7 +5554,7 @@ void ecl_grid_get_column_property(const ecl_grid_type * ecl_grid , const ecl_kw_ int ecl_grid_get_region_cells(const ecl_grid_type * ecl_grid , const ecl_kw_type * region_kw , int region_value , bool active_only, bool export_active_index , int_vector_type * index_list) { int cells_found = 0; if (ecl_kw_get_size( region_kw ) == ecl_grid->size) { - if (ecl_kw_get_type( region_kw ) == ECL_INT_TYPE) { + if (ecl_type_is_int(ecl_kw_get_data_type( region_kw ))) { const int * region_ptr = ecl_kw_iget_ptr( region_kw , 0); int_vector_reset( index_list ); @@ -5359,7 +5597,7 @@ void ecl_grid_grdecl_fprintf_kw( const ecl_grid_type * ecl_grid , const ecl_kw_t float float_default; int int_default; int bool_default; - ecl_type_enum ecl_type = ecl_kw_get_type( ecl_kw ); + ecl_type_enum ecl_type = ecl_type_get_type(ecl_kw_get_data_type( ecl_kw )); if (ecl_type == ECL_FLOAT_TYPE) { float_default = (float) double_default; @@ -5575,11 +5813,11 @@ static const float * ecl_grid_get_mapaxes( const ecl_grid_type * grid ) { } static ecl_kw_type * ecl_grid_alloc_mapaxes_kw( const float * mapaxes ) { - return ecl_kw_alloc_new( MAPAXES_KW , 6 , ECL_FLOAT_TYPE , mapaxes); + return ecl_kw_alloc_new( MAPAXES_KW , 6 , ECL_FLOAT , mapaxes); } static ecl_kw_type * ecl_grid_alloc_mapunits_kw( ert_ecl_unit_enum output_unit ) { - ecl_kw_type * mapunits_kw = ecl_kw_alloc( MAPUNITS_KW , 1 , ECL_CHAR_TYPE); + ecl_kw_type * mapunits_kw = ecl_kw_alloc( MAPUNITS_KW , 1 , ECL_CHAR); if (output_unit == ECL_FIELD_UNITS) ecl_kw_iset_string8( mapunits_kw , 0 , "FEET" ); @@ -5594,7 +5832,7 @@ static ecl_kw_type * ecl_grid_alloc_mapunits_kw( ert_ecl_unit_enum output_unit ) } static ecl_kw_type * ecl_grid_alloc_gridunits_kw( ert_ecl_unit_enum output_unit ) { - ecl_kw_type * gridunits_kw = ecl_kw_alloc( GRIDUNIT_KW , 2 , ECL_CHAR_TYPE); + ecl_kw_type * gridunits_kw = ecl_kw_alloc( GRIDUNIT_KW , 2 , ECL_CHAR); if (output_unit == ECL_FIELD_UNITS) ecl_kw_iset_string8( gridunits_kw , 0 , "FEET" ); @@ -5666,14 +5904,14 @@ static void ecl_grid_fwrite_main_GRID_headers( const ecl_grid_type * ecl_grid , static void ecl_grid_fwrite_GRID__( const ecl_grid_type * grid , int coords_size , fortio_type * fortio, ert_ecl_unit_enum output_unit) { if (grid->parent_grid != NULL) { - ecl_kw_type * lgr_kw = ecl_kw_alloc(LGR_KW , 1 , ECL_CHAR_TYPE ); + ecl_kw_type * lgr_kw = ecl_kw_alloc(LGR_KW , 1 , ECL_CHAR); ecl_kw_iset_string8( lgr_kw , 0 , grid->name ); ecl_kw_fwrite( lgr_kw , fortio ); ecl_kw_free( lgr_kw ); } { - ecl_kw_type * dimens_kw = ecl_kw_alloc(DIMENS_KW , 3 , ECL_INT_TYPE ); + ecl_kw_type * dimens_kw = ecl_kw_alloc(DIMENS_KW , 3 , ECL_INT); ecl_kw_iset_int( dimens_kw , 0 , grid->nx ); ecl_kw_iset_int( dimens_kw , 1 , grid->ny ); if (grid->dualp_flag == FILEHEAD_SINGLE_POROSITY) @@ -5689,15 +5927,15 @@ static void ecl_grid_fwrite_GRID__( const ecl_grid_type * grid , int coords_size ecl_grid_fwrite_main_GRID_headers( grid , fortio , output_unit); { - ecl_kw_type * radial_kw = ecl_kw_alloc( RADIAL_KW , 1 , ECL_CHAR_TYPE); + ecl_kw_type * radial_kw = ecl_kw_alloc( RADIAL_KW , 1 , ECL_CHAR); ecl_kw_iset_string8( radial_kw , 0 , "FALSE" ); ecl_kw_fwrite( radial_kw , fortio ); ecl_kw_free( radial_kw ); } { - ecl_kw_type * coords_kw = ecl_kw_alloc( COORDS_KW , coords_size , ECL_INT_TYPE ); - ecl_kw_type * corners_kw = ecl_kw_alloc( CORNERS_KW , 24 , ECL_FLOAT_TYPE ); + ecl_kw_type * coords_kw = ecl_kw_alloc( COORDS_KW , coords_size , ECL_INT); + ecl_kw_type * corners_kw = ecl_kw_alloc( CORNERS_KW , 24 , ECL_FLOAT); int i,j,k; for (k=0; k < grid->nz; k++) { for (j=0; j < grid->ny; j++) { @@ -5781,7 +6019,7 @@ static void ecl_grid_fwrite_main_EGRID_header( const ecl_grid_type * grid , fort const float * mapaxes = ecl_grid_get_mapaxes( grid ); { - ecl_kw_type * filehead_kw = ecl_kw_alloc( FILEHEAD_KW , 100 , ECL_INT_TYPE ); + ecl_kw_type * filehead_kw = ecl_kw_alloc( FILEHEAD_KW , 100 , ECL_INT); ecl_kw_scalar_set_int( filehead_kw , 0 ); ecl_kw_iset_int( filehead_kw , FILEHEAD_VERSION_INDEX , EGRID_VERSION ); @@ -5970,21 +6208,19 @@ void ecl_grid_init_coord_data_double( const ecl_grid_type * grid , double * coor float * ecl_grid_alloc_coord_data( const ecl_grid_type * grid ) { - float * coord = util_calloc( (grid->nx + 1) * (grid->ny + 1) * 6 , sizeof * coord ); + float * coord = util_calloc( ecl_grid_get_coord_size(grid) , sizeof * coord ); ecl_grid_init_coord_data( grid , coord ); return coord; } void ecl_grid_assert_coord_kw( ecl_grid_type * grid ) { if (grid->coord_kw == NULL) { - grid->coord_kw = ecl_kw_alloc( COORD_KW , (grid->nx + 1) * (grid->ny + 1) * 6 , ECL_FLOAT_TYPE ); + grid->coord_kw = ecl_kw_alloc( COORD_KW , ecl_grid_get_coord_size( grid ) , ECL_FLOAT); ecl_grid_init_coord_data( grid , ecl_kw_get_void_ptr( grid->coord_kw )); } } -int ecl_grid_get_coord_size( const ecl_grid_type * ecl_grid) { - return (ecl_grid->nx + 1) * (ecl_grid->ny + 1) * 6; -} + @@ -6050,14 +6286,19 @@ float * ecl_grid_alloc_zcorn_data( const ecl_grid_type * grid ) { ecl_kw_type * ecl_grid_alloc_zcorn_kw( const ecl_grid_type * grid ) { - ecl_kw_type * zcorn_kw = ecl_kw_alloc( ZCORN_KW , 8 * grid->size , ECL_FLOAT_TYPE ); + ecl_kw_type * zcorn_kw = ecl_kw_alloc( ZCORN_KW , 8 * grid->size , ECL_FLOAT); ecl_grid_init_zcorn_data( grid , ecl_kw_get_void_ptr( zcorn_kw )); return zcorn_kw; } +int ecl_grid_get_coord_size( const ecl_grid_type * grid) { + return ECL_GRID_COORD_SIZE( grid->nx , grid->ny ); +} + + int ecl_grid_get_zcorn_size( const ecl_grid_type * grid ) { - return 8 * grid->size; + return ECL_GRID_ZCORN_SIZE( grid->nx , grid->ny, grid->nz ); } /*****************************************************************/ @@ -6109,7 +6350,7 @@ int * ecl_grid_alloc_actnum_data( const ecl_grid_type * grid ) { ecl_kw_type * ecl_grid_alloc_actnum_kw( const ecl_grid_type * grid ) { - ecl_kw_type * actnum_kw = ecl_kw_alloc( ACTNUM_KW , grid->size , ECL_INT_TYPE ); + ecl_kw_type * actnum_kw = ecl_kw_alloc( ACTNUM_KW , grid->size , ECL_INT); ecl_grid_init_actnum_data( grid , ecl_kw_get_void_ptr( actnum_kw )); return actnum_kw; } @@ -6163,7 +6404,7 @@ int * ecl_grid_alloc_hostnum_data( const ecl_grid_type * grid ) { ecl_kw_type * ecl_grid_alloc_hostnum_kw( const ecl_grid_type * grid ) { - ecl_kw_type * hostnum_kw = ecl_kw_alloc( HOSTNUM_KW , grid->size , ECL_INT_TYPE ); + ecl_kw_type * hostnum_kw = ecl_kw_alloc( HOSTNUM_KW , grid->size , ECL_INT); ecl_grid_init_hostnum_data( grid , ecl_kw_get_void_ptr( hostnum_kw )); return hostnum_kw; } @@ -6186,7 +6427,7 @@ int * ecl_grid_alloc_corsnum_data( const ecl_grid_type * grid ) { ecl_kw_type * ecl_grid_alloc_corsnum_kw( const ecl_grid_type * grid ) { - ecl_kw_type * corsnum_kw = ecl_kw_alloc( CORSNUM_KW , grid->size , ECL_INT_TYPE ); + ecl_kw_type * corsnum_kw = ecl_kw_alloc( CORSNUM_KW , grid->size , ECL_INT); ecl_grid_init_corsnum_data( grid , ecl_kw_get_void_ptr( corsnum_kw )); return corsnum_kw; } @@ -6195,7 +6436,7 @@ ecl_kw_type * ecl_grid_alloc_corsnum_kw( const ecl_grid_type * grid ) { ecl_kw_type * ecl_grid_alloc_gridhead_kw( int nx, int ny , int nz , int grid_nr) { - ecl_kw_type * gridhead_kw = ecl_kw_alloc( GRIDHEAD_KW , GRIDHEAD_SIZE , ECL_INT_TYPE ); + ecl_kw_type * gridhead_kw = ecl_kw_alloc( GRIDHEAD_KW , GRIDHEAD_SIZE , ECL_INT); ecl_kw_scalar_set_int( gridhead_kw , 0 ); ecl_kw_iset_int( gridhead_kw , GRIDHEAD_TYPE_INDEX , GRIDHEAD_GRIDTYPE_CORNERPOINT ); ecl_kw_iset_int( gridhead_kw , GRIDHEAD_NX_INDEX , nx); @@ -6244,9 +6485,9 @@ static void ecl_grid_fwrite_self_nnc( const ecl_grid_type * grid , fortio_type } { int num_nnc = int_vector_size( g1 ); - ecl_kw_type * nnc1_kw = ecl_kw_alloc_new_shared( NNC1_KW , num_nnc , ECL_INT_TYPE , int_vector_get_ptr( g1 )); - ecl_kw_type * nnc2_kw = ecl_kw_alloc_new_shared( NNC2_KW , num_nnc , ECL_INT_TYPE , int_vector_get_ptr( g2 )); - ecl_kw_type * nnchead_kw = ecl_kw_alloc( NNCHEAD_KW , NNCHEAD_SIZE , ECL_INT_TYPE ); + ecl_kw_type * nnc1_kw = ecl_kw_alloc_new_shared( NNC1_KW , num_nnc , ECL_INT , int_vector_get_ptr( g1 )); + ecl_kw_type * nnc2_kw = ecl_kw_alloc_new_shared( NNC2_KW , num_nnc , ECL_INT , int_vector_get_ptr( g2 )); + ecl_kw_type * nnchead_kw = ecl_kw_alloc( NNCHEAD_KW , NNCHEAD_SIZE , ECL_INT); ecl_kw_scalar_set_int( nnchead_kw , 0 ); ecl_kw_iset_int( nnchead_kw , NNCHEAD_NUMNNC_INDEX , num_nnc ); @@ -6276,14 +6517,14 @@ static void ecl_grid_fwrite_EGRID__( ecl_grid_type * grid , fortio_type * fortio ecl_grid_fwrite_main_EGRID_header( grid , fortio , output_unit ); } else { { - ecl_kw_type * lgr_kw = ecl_kw_alloc(LGR_KW , 1 , ECL_CHAR_TYPE ); + ecl_kw_type * lgr_kw = ecl_kw_alloc(LGR_KW , 1 , ECL_CHAR); ecl_kw_iset_string8( lgr_kw , 0 , grid->name ); ecl_kw_fwrite( lgr_kw , fortio ); ecl_kw_free( lgr_kw ); } { - ecl_kw_type * lgr_parent_kw = ecl_kw_alloc(LGR_PARENT_KW , 1 , ECL_CHAR_TYPE ); + ecl_kw_type * lgr_parent_kw = ecl_kw_alloc(LGR_PARENT_KW , 1 , ECL_CHAR); if (grid->parent_name != NULL) ecl_kw_iset_string8( lgr_parent_kw , 0 , grid->parent_name ); else @@ -6329,14 +6570,14 @@ static void ecl_grid_fwrite_EGRID__( ecl_grid_type * grid , fortio_type * fortio } { - ecl_kw_type * endgrid_kw = ecl_kw_alloc( ENDGRID_KW , 0 , ECL_INT_TYPE ); + ecl_kw_type * endgrid_kw = ecl_kw_alloc( ENDGRID_KW , 0 , ECL_INT); ecl_kw_fwrite( endgrid_kw , fortio ); ecl_kw_free( endgrid_kw ); } } if (is_lgr) { - ecl_kw_type * endlgr_kw = ecl_kw_alloc( ENDLGR_KW , 0 , ECL_INT_TYPE ); + ecl_kw_type * endlgr_kw = ecl_kw_alloc( ENDLGR_KW , 0 , ECL_INT); ecl_kw_fwrite( endlgr_kw , fortio ); ecl_kw_free( endlgr_kw ); } @@ -6380,7 +6621,7 @@ void ecl_grid_fwrite_EGRID( ecl_grid_type * grid , const char * filename, bool o void ecl_grid_fwrite_depth( const ecl_grid_type * grid , fortio_type * init_file , ert_ecl_unit_enum output_unit) { - ecl_kw_type * depth_kw = ecl_kw_alloc("DEPTH" , ecl_grid_get_nactive(grid) , ECL_FLOAT_TYPE ); + ecl_kw_type * depth_kw = ecl_kw_alloc("DEPTH" , ecl_grid_get_nactive(grid) , ECL_FLOAT); { float * depth_ptr = ecl_kw_get_ptr(depth_kw); for (int i = 0; i < ecl_grid_get_nactive( grid ); i++) @@ -6393,9 +6634,9 @@ void ecl_grid_fwrite_depth( const ecl_grid_type * grid , fortio_type * init_file void ecl_grid_fwrite_dims( const ecl_grid_type * grid , fortio_type * init_file, ert_ecl_unit_enum output_unit) { - ecl_kw_type * dx = ecl_kw_alloc("DX" , ecl_grid_get_nactive(grid) , ECL_FLOAT_TYPE ); - ecl_kw_type * dy = ecl_kw_alloc("DY" , ecl_grid_get_nactive(grid) , ECL_FLOAT_TYPE ); - ecl_kw_type * dz = ecl_kw_alloc("DZ" , ecl_grid_get_nactive(grid) , ECL_FLOAT_TYPE ); + ecl_kw_type * dx = ecl_kw_alloc("DX" , ecl_grid_get_nactive(grid) , ECL_FLOAT); + ecl_kw_type * dy = ecl_kw_alloc("DY" , ecl_grid_get_nactive(grid) , ECL_FLOAT); + ecl_kw_type * dz = ecl_kw_alloc("DZ" , ecl_grid_get_nactive(grid) , ECL_FLOAT); { { float * dx_ptr = ecl_kw_get_ptr(dx); @@ -6548,7 +6789,7 @@ int ecl_grid_get_num_nnc( const ecl_grid_type * grid ) { static ecl_kw_type * ecl_grid_alloc_volume_kw_active( const ecl_grid_type * grid) { - ecl_kw_type * volume_kw = ecl_kw_alloc("VOLUME" , ecl_grid_get_active_size(grid) , ECL_DOUBLE_TYPE); + ecl_kw_type * volume_kw = ecl_kw_alloc("VOLUME" , ecl_grid_get_active_size(grid) , ECL_DOUBLE); { double * volume_data = ecl_kw_get_ptr( volume_kw ); int active_index; @@ -6562,7 +6803,7 @@ static ecl_kw_type * ecl_grid_alloc_volume_kw_active( const ecl_grid_type * grid static ecl_kw_type * ecl_grid_alloc_volume_kw_global( const ecl_grid_type * grid) { - ecl_kw_type * volume_kw = ecl_kw_alloc("VOLUME" , ecl_grid_get_global_size(grid) , ECL_DOUBLE_TYPE); + ecl_kw_type * volume_kw = ecl_kw_alloc("VOLUME" , ecl_grid_get_global_size(grid) , ECL_DOUBLE); { double * volume_data = ecl_kw_get_ptr( volume_kw ); int global_index; diff --git a/ThirdParty/Ert/libecl/src/ecl_init_file.c b/ThirdParty/Ert/libecl/src/ecl_init_file.c index 6f50bbaaa4..eb20dc8674 100644 --- a/ThirdParty/Ert/libecl/src/ecl_init_file.c +++ b/ThirdParty/Ert/libecl/src/ecl_init_file.c @@ -38,9 +38,10 @@ #include #include #include +#include static ecl_kw_type * ecl_init_file_alloc_INTEHEAD( const ecl_grid_type * ecl_grid , ert_ecl_unit_enum unit_system, int phases, time_t start_date , int simulator) { - ecl_kw_type * intehead_kw = ecl_kw_alloc( INTEHEAD_KW , INTEHEAD_INIT_SIZE , ECL_INT_TYPE ); + ecl_kw_type * intehead_kw = ecl_kw_alloc( INTEHEAD_KW , INTEHEAD_INIT_SIZE , ECL_INT ); ecl_kw_scalar_set_int( intehead_kw , 0 ); ecl_kw_iset_int( intehead_kw , INTEHEAD_UNIT_INDEX , unit_system ); @@ -89,7 +90,7 @@ static ecl_kw_type * ecl_init_file_alloc_LOGIHEAD( int simulator ) { bool scale_gas_PC_at_max_sat = false; - ecl_kw_type * logihead_kw = ecl_kw_alloc( LOGIHEAD_KW , LOGIHEAD_INIT_SIZE , ECL_BOOL_TYPE ); + ecl_kw_type * logihead_kw = ecl_kw_alloc( LOGIHEAD_KW , LOGIHEAD_INIT_SIZE , ECL_BOOL ); ecl_kw_scalar_set_bool( logihead_kw , false ); @@ -120,7 +121,7 @@ static ecl_kw_type * ecl_init_file_alloc_LOGIHEAD( int simulator ) { static ecl_kw_type * ecl_init_file_alloc_DOUBHEAD( ) { - ecl_kw_type * doubhead_kw = ecl_kw_alloc( DOUBHEAD_KW , DOUBHEAD_INIT_SIZE , ECL_DOUBLE_TYPE ); + ecl_kw_type * doubhead_kw = ecl_kw_alloc( DOUBHEAD_KW , DOUBHEAD_INIT_SIZE , ECL_DOUBLE ); ecl_kw_scalar_set_double( doubhead_kw , 0); @@ -147,7 +148,7 @@ static ecl_kw_type * ecl_init_file_alloc_DOUBHEAD( ) { static void ecl_init_file_fwrite_poro( fortio_type * fortio , const ecl_grid_type * ecl_grid , const ecl_kw_type * poro ) { { - ecl_kw_type * porv = ecl_kw_alloc( PORV_KW , ecl_grid_get_global_size( ecl_grid ) , ECL_FLOAT_TYPE); + ecl_kw_type * porv = ecl_kw_alloc( PORV_KW , ecl_grid_get_global_size( ecl_grid ) , ECL_FLOAT); int global_index; bool global_poro = (ecl_kw_get_size( poro ) == ecl_grid_get_global_size( ecl_grid )) ? true : false; for ( global_index = 0; global_index < ecl_grid_get_global_size( ecl_grid ); global_index++) { diff --git a/ThirdParty/Ert/libecl/src/ecl_kw.c b/ThirdParty/Ert/libecl/src/ecl_kw.c index a23c841a65..d562f1a09a 100644 --- a/ThirdParty/Ert/libecl/src/ecl_kw.c +++ b/ThirdParty/Ert/libecl/src/ecl_kw.c @@ -27,9 +27,9 @@ #include #include -#include #include #include +#include #define ECL_KW_TYPE_ID 6111098 @@ -41,8 +41,7 @@ struct ecl_kw_struct { UTIL_TYPE_ID_DECLARATION; int size; - int sizeof_ctype; - ecl_type_enum ecl_type; + ecl_data_type data_type; char * header8; /* Header which is right padded with ' ' to become exactly 8 characters long. Should only be used internally.*/ char * header; /* Header which is trimmed to no-space. */ char * data; /* The actual data vector. */ @@ -62,7 +61,6 @@ UTIL_IS_INSTANCE_FUNCTION(ecl_kw , ECL_KW_TYPE_ID ) #define BLOCKSIZE_NUMERIC 1000 #define BLOCKSIZE_CHAR 105 -#define BLOCKSIZE_C010 105 @@ -114,7 +112,6 @@ UTIL_IS_INSTANCE_FUNCTION(ecl_kw , ECL_KW_TYPE_ID ) */ #define READ_FMT_CHAR "%8c" -#define READ_FMT_C010 "%10c" #define READ_FMT_FLOAT "%gE" #define READ_FMT_INT "%d" #define READ_FMT_MESS "%8c" @@ -123,7 +120,6 @@ UTIL_IS_INSTANCE_FUNCTION(ecl_kw , ECL_KW_TYPE_ID ) #define WRITE_FMT_CHAR " '%-8s'" -#define WRITE_FMT_C010 " '%-10s'" #define WRITE_FMT_INT " %11d" #define WRITE_FMT_FLOAT " %11.8fE%+03d" #define WRITE_FMT_DOUBLE " %17.14fD%+03d" @@ -159,102 +155,93 @@ UTIL_IS_INSTANCE_FUNCTION(ecl_kw , ECL_KW_TYPE_ID ) #define BOOL_FALSE_CHAR 'F' +ecl_type_enum ecl_kw_get_type(const ecl_kw_type *); +void ecl_kw_set_data_type(ecl_kw_type * ecl_kw, ecl_data_type data_type); -static const char * get_read_fmt( ecl_type_enum ecl_type ) { - switch(ecl_type) { +static char * alloc_read_fmt_string(const ecl_data_type ecl_type) { + return util_alloc_sprintf( + "%%%dc", + ecl_type_get_sizeof_ctype_fortio(ecl_type) + ); +} + +static char * alloc_read_fmt(const ecl_data_type data_type ) { + switch(ecl_type_get_type(data_type)) { case(ECL_CHAR_TYPE): - return READ_FMT_CHAR; - break; - case(ECL_C010_TYPE): - return READ_FMT_C010; - break; + return util_alloc_string_copy(READ_FMT_CHAR); case(ECL_INT_TYPE): - return READ_FMT_INT; - break; + return util_alloc_string_copy(READ_FMT_INT); case(ECL_FLOAT_TYPE): - return READ_FMT_FLOAT; - break; + return util_alloc_string_copy(READ_FMT_FLOAT); case(ECL_DOUBLE_TYPE): - return READ_FMT_DOUBLE; - break; + return util_alloc_string_copy(READ_FMT_DOUBLE); case(ECL_BOOL_TYPE): - return READ_FMT_BOOL; - break; + return util_alloc_string_copy(READ_FMT_BOOL); case(ECL_MESS_TYPE): - return READ_FMT_MESS; - break; + return util_alloc_string_copy(READ_FMT_MESS); + case(ECL_STRING_TYPE): + return alloc_read_fmt_string(data_type); default: - util_abort("%s: invalid ecl_type:%d \n",__func__ , ecl_type); + util_abort("%s: invalid ecl_type:%s \n",__func__ , ecl_type_alloc_name(data_type)); return NULL; } } +static char * alloc_write_fmt_string(const ecl_data_type ecl_type) { + return util_alloc_sprintf( + " '%%-%ds'", + ecl_type_get_sizeof_ctype_fortio(ecl_type) + ); +} -const char * ecl_kw_get_write_fmt( ecl_type_enum ecl_type ) { - switch(ecl_type) { +static char * alloc_write_fmt(const ecl_data_type data_type) { + switch(ecl_type_get_type(data_type)) { case(ECL_CHAR_TYPE): - return WRITE_FMT_CHAR; - break; - case(ECL_C010_TYPE): - return WRITE_FMT_C010; - break; + return util_alloc_string_copy(WRITE_FMT_CHAR); case(ECL_INT_TYPE): - return WRITE_FMT_INT; - break; + return util_alloc_string_copy(WRITE_FMT_INT); case(ECL_FLOAT_TYPE): - return WRITE_FMT_FLOAT; - break; + return util_alloc_string_copy(WRITE_FMT_FLOAT); case(ECL_DOUBLE_TYPE): - return WRITE_FMT_DOUBLE; - break; + return util_alloc_string_copy(WRITE_FMT_DOUBLE); case(ECL_BOOL_TYPE): - return WRITE_FMT_BOOL; - break; + return util_alloc_string_copy(WRITE_FMT_BOOL); case(ECL_MESS_TYPE): - return WRITE_FMT_MESS; - break; + return util_alloc_string_copy(WRITE_FMT_MESS); + case(ECL_STRING_TYPE): + return alloc_write_fmt_string(data_type); default: - util_abort("%s: invalid ecl_type:%d \n",__func__ , ecl_type); + util_abort("%s: invalid ecl_type: %s\n",__func__ , ecl_type_alloc_name(data_type)); return NULL; } } -static int get_blocksize( ecl_type_enum ecl_type ) { - if (ecl_type == ECL_CHAR_TYPE) +static int get_blocksize( ecl_data_type data_type ) { + if (ecl_type_is_alpha(data_type)) return BLOCKSIZE_CHAR; - if (ecl_type == ECL_MESS_TYPE) - return BLOCKSIZE_CHAR; - - if (ecl_type == ECL_C010_TYPE) - return BLOCKSIZE_C010; - - return BLOCKSIZE_NUMERIC; + return BLOCKSIZE_NUMERIC; } -static int get_columns( ecl_type_enum ecl_type ) { - switch(ecl_type) { +static int get_columns(const ecl_data_type data_type) { + switch(ecl_type_get_type(data_type)) { case(ECL_CHAR_TYPE): return COLUMNS_CHAR; - break; case(ECL_INT_TYPE): return COLUMNS_INT; - break; case(ECL_FLOAT_TYPE): return COLUMNS_FLOAT; - break; case(ECL_DOUBLE_TYPE): return COLUMNS_DOUBLE; - break; case(ECL_BOOL_TYPE): return COLUMNS_BOOL; - break; case(ECL_MESS_TYPE): return COLUMNS_MESSAGE; - break; + case(ECL_STRING_TYPE): + return COLUMNS_CHAR; // TODO: Is this correct? default: - util_abort("%s: invalid ecl_type:%d \n",__func__ , ecl_type); + util_abort("%s: invalid ecl_type: %s\n",__func__ , ecl_type_alloc_name(data_type)); return -1; } } @@ -271,8 +258,8 @@ static void ecl_kw_assert_index(const ecl_kw_type *ecl_kw , int index, const cha static void ecl_kw_endian_convert_data(ecl_kw_type *ecl_kw) { - if (ecl_kw->ecl_type != ECL_CHAR_TYPE && ecl_kw->ecl_type != ECL_MESS_TYPE) - util_endian_flip_vector(ecl_kw->data , ecl_kw->sizeof_ctype , ecl_kw->size); + if (ecl_type_is_numeric(ecl_kw->data_type) || ecl_type_is_bool(ecl_kw->data_type)) + util_endian_flip_vector(ecl_kw->data , ecl_kw_get_sizeof_ctype(ecl_kw) , ecl_kw->size); } @@ -294,35 +281,35 @@ bool ecl_kw_name_equal( const ecl_kw_type * ecl_kw , const char * name) { void ecl_kw_get_memcpy_data(const ecl_kw_type *ecl_kw , void *target) { - memcpy(target , ecl_kw->data , ecl_kw->size * ecl_kw->sizeof_ctype); + memcpy(target , ecl_kw->data , ecl_kw->size * ecl_kw_get_sizeof_ctype(ecl_kw)); } void ecl_kw_get_memcpy_int_data(const ecl_kw_type *ecl_kw , int * target) { - if (ecl_kw->ecl_type == ECL_INT_TYPE) + if (ecl_type_is_int(ecl_kw->data_type)) ecl_kw_get_memcpy_data( ecl_kw , target ); } void ecl_kw_get_memcpy_float_data(const ecl_kw_type *ecl_kw , float *target) { - if (ecl_kw->ecl_type == ECL_FLOAT_TYPE) + if (ecl_type_is_float(ecl_kw->data_type)) ecl_kw_get_memcpy_data( ecl_kw , target ); } void ecl_kw_get_memcpy_double_data(const ecl_kw_type *ecl_kw , double *target) { -if (ecl_kw->ecl_type == ECL_DOUBLE_TYPE) +if (ecl_type_is_double(ecl_kw->data_type)) ecl_kw_get_memcpy_data( ecl_kw , target ); } /** Allocates a untyped buffer with exactly the same content as the ecl_kw instances data. */ void * ecl_kw_alloc_data_copy(const ecl_kw_type * ecl_kw) { - void * buffer = util_alloc_copy( ecl_kw->data , ecl_kw->size * ecl_kw->sizeof_ctype ); + void * buffer = util_alloc_copy( ecl_kw->data , ecl_kw->size * ecl_kw_get_sizeof_ctype(ecl_kw) ); return buffer; } void ecl_kw_set_memcpy_data(ecl_kw_type *ecl_kw , const void *src) { if (src != NULL) - memcpy(ecl_kw->data , src , ecl_kw->size * ecl_kw->sizeof_ctype); + memcpy(ecl_kw->data , src , ecl_kw->size * ecl_kw_get_sizeof_ctype(ecl_kw)); } @@ -358,14 +345,8 @@ bool ecl_kw_ichar_eq(const ecl_kw_type *ecl_kw , int i , const char *value) { bool ecl_kw_size_and_type_equal( const ecl_kw_type *ecl_kw1 , const ecl_kw_type * ecl_kw2 ) { - bool equal = true; - - if (ecl_kw1->size != ecl_kw2->size) - equal = false; - else if (ecl_kw1->ecl_type != ecl_kw2->ecl_type) - equal = false; - - return equal; + return (ecl_kw1->size == ecl_kw2->size && + ecl_type_is_equal(ecl_kw1->data_type, ecl_kw2->data_type)); } @@ -381,7 +362,7 @@ bool ecl_kw_header_eq(const ecl_kw_type *ecl_kw1 , const ecl_kw_type * ecl_kw2) } static bool ecl_kw_data_equal__( const ecl_kw_type * ecl_kw , const void * data , int cmp_elements) { - int cmp = memcmp( ecl_kw->data , data , cmp_elements * ecl_kw->sizeof_ctype); + int cmp = memcmp( ecl_kw->data , data , cmp_elements * ecl_kw_get_sizeof_ctype(ecl_kw)); if (cmp == 0) return true; else @@ -455,22 +436,15 @@ ECL_KW_NUMERIC_CMP( double ) */ bool ecl_kw_numeric_equal(const ecl_kw_type *ecl_kw1, const ecl_kw_type *ecl_kw2 , double abs_diff , double rel_diff) { - bool equal = true; - if ( ecl_kw1->ecl_type != ecl_kw2->ecl_type) - equal = false; + if(!ecl_kw_size_and_type_equal(ecl_kw1, ecl_kw2)) + return false; - if ( ecl_kw1->size != ecl_kw2->size) - equal = false; - - if (equal) { - if (ecl_kw1->ecl_type == ECL_FLOAT_TYPE) - equal = ecl_kw_numeric_equal_float( ecl_kw1 , ecl_kw2 , abs_diff , rel_diff ); - else if (ecl_kw1->ecl_type == ECL_DOUBLE_TYPE) - equal = ecl_kw_numeric_equal_double( ecl_kw1 , ecl_kw2 , abs_diff , rel_diff ); - else - equal = ecl_kw_data_equal( ecl_kw1 , ecl_kw2->data ); - } - return equal; + if (ecl_type_is_float(ecl_kw1->data_type)) + return ecl_kw_numeric_equal_float( ecl_kw1 , ecl_kw2 , abs_diff , rel_diff ); + else if (ecl_type_is_double(ecl_kw1->data_type)) + return ecl_kw_numeric_equal_double( ecl_kw1 , ecl_kw2 , abs_diff , rel_diff ); + else + return ecl_kw_data_equal( ecl_kw1 , ecl_kw2->data ); } @@ -498,9 +472,8 @@ static void ecl_kw_set_shared_ref(ecl_kw_type * ecl_kw , void *data_ptr) { -static void ecl_kw_initialize(ecl_kw_type * ecl_kw , const char *header , int size , ecl_type_enum ecl_type) { - ecl_kw->ecl_type = ecl_type; - ecl_kw->sizeof_ctype = ecl_util_get_sizeof_ctype(ecl_kw->ecl_type); +static void ecl_kw_initialize(ecl_kw_type * ecl_kw , const char *header , int size , ecl_data_type data_type) { + ecl_kw_set_data_type(ecl_kw, data_type); if (strlen(header) > ECL_STRING8_LENGTH) util_abort("%s: Fatal error: ecl_header_name:%s is longer than eight characters - aborting \n",__func__,header); @@ -509,11 +482,11 @@ static void ecl_kw_initialize(ecl_kw_type * ecl_kw , const char *header , int s } static size_t ecl_kw_fortio_data_size( const ecl_kw_type * ecl_kw) { - const int blocksize = get_blocksize( ecl_kw->ecl_type ); + const int blocksize = get_blocksize( ecl_kw->data_type ); const int num_blocks = ecl_kw->size / blocksize + (ecl_kw->size % blocksize == 0 ? 0 : 1); return num_blocks * (4 + 4) + // Fortran fluff for each block - ecl_kw->size * ecl_util_get_sizeof_ctype_fortio( ecl_kw->ecl_type ); // Actual data + ecl_kw->size * ecl_type_get_sizeof_ctype_fortio( ecl_kw->data_type ); // Actual data } @@ -534,10 +507,10 @@ size_t ecl_kw_fortio_size( const ecl_kw_type * ecl_kw ) { /** The data is copied from the input argument to the ecl_kw; data can be NULL. */ -ecl_kw_type * ecl_kw_alloc_new(const char * header , int size, ecl_type_enum ecl_type , const void * data) { +ecl_kw_type * ecl_kw_alloc_new(const char * header , int size, ecl_data_type data_type , const void * data) { ecl_kw_type *ecl_kw; ecl_kw = ecl_kw_alloc_empty(); - ecl_kw_initialize(ecl_kw , header , size , ecl_type); + ecl_kw_initialize(ecl_kw , header , size , data_type); if (data != NULL) { ecl_kw_alloc_data(ecl_kw); ecl_kw_set_memcpy_data(ecl_kw , data); @@ -547,26 +520,22 @@ ecl_kw_type * ecl_kw_alloc_new(const char * header , int size, ecl_type_enum ec -ecl_kw_type * ecl_kw_alloc( const char * header , int size , ecl_type_enum ecl_type ) { - if (ecl_type == ECL_C010_TYPE) - return NULL; - { - ecl_kw_type *ecl_kw; +ecl_kw_type * ecl_kw_alloc( const char * header , int size , ecl_data_type data_type ) { + ecl_kw_type *ecl_kw; - ecl_kw = ecl_kw_alloc_empty(); - ecl_kw_initialize(ecl_kw , header , size , ecl_type); - ecl_kw_alloc_data(ecl_kw); + ecl_kw = ecl_kw_alloc_empty(); + ecl_kw_initialize(ecl_kw , header , size , data_type); + ecl_kw_alloc_data(ecl_kw); - return ecl_kw; - } + return ecl_kw; } -ecl_kw_type * ecl_kw_alloc_new_shared(const char * header , int size, ecl_type_enum ecl_type , void * data) { +ecl_kw_type * ecl_kw_alloc_new_shared(const char * header , int size, ecl_data_type data_type , void * data) { ecl_kw_type *ecl_kw; ecl_kw = ecl_kw_alloc_empty(); - ecl_kw_initialize(ecl_kw , header , size , ecl_type); + ecl_kw_initialize(ecl_kw , header , size , data_type); ecl_kw_set_shared_ref(ecl_kw , data); return ecl_kw; } @@ -582,7 +551,6 @@ ecl_kw_type * ecl_kw_alloc_empty() { ecl_kw->data = NULL; ecl_kw->shared_data = false; ecl_kw->size = 0; - ecl_kw->sizeof_ctype = 0; UTIL_TYPE_ID_INIT(ecl_kw , ECL_KW_TYPE_ID); @@ -604,19 +572,17 @@ void ecl_kw_free__(void *void_ecl_kw) { void ecl_kw_memcpy_data( ecl_kw_type * target , const ecl_kw_type * src) { - if (!ecl_kw_assert_binary( target , src )) + if (!ecl_kw_size_and_type_equal( target , src )) util_abort("%s: type/size mismatch \n",__func__); - memcpy(target->data , src->data , target->size * target->sizeof_ctype); + memcpy(target->data , src->data , target->size * ecl_kw_get_sizeof_ctype(target)); } void ecl_kw_memcpy(ecl_kw_type *target, const ecl_kw_type *src) { target->size = src->size; - target->sizeof_ctype = src->sizeof_ctype; - target->ecl_type = src->ecl_type; - + ecl_kw_set_data_type(target, src->data_type); ecl_kw_set_header_name( target , src->header ); ecl_kw_alloc_data(target); @@ -664,7 +630,7 @@ ecl_kw_type * ecl_kw_alloc_slice_copy( const ecl_kw_type * src, int index1, int } if (new_size > 0) { new_kw = ecl_kw_alloc_empty(); - ecl_kw_initialize(new_kw , src->header , new_size , src->ecl_type); + ecl_kw_initialize(new_kw , src->header , new_size , src->data_type); ecl_kw_alloc_data(new_kw); /* 2: Copy over the elements. */ @@ -673,7 +639,7 @@ ecl_kw_type * ecl_kw_alloc_slice_copy( const ecl_kw_type * src, int index1, int int target_index = 0; const char * src_ptr = src->data; char * new_ptr = new_kw->data; - int sizeof_ctype = new_kw->sizeof_ctype; + int sizeof_ctype = ecl_kw_get_sizeof_ctype(new_kw); while ( src_index < index2 ) { memcpy( &new_ptr[ target_index * sizeof_ctype ] , &src_ptr[ src_index * sizeof_ctype ] , sizeof_ctype ); @@ -694,8 +660,8 @@ void ecl_kw_resize( ecl_kw_type * ecl_kw, int new_size) { util_abort("%s: trying to allocate data for ecl_kw object which has been declared with shared storage - aborting \n",__func__); if (new_size != ecl_kw->size) { - size_t old_byte_size = ecl_kw->size * ecl_kw->sizeof_ctype; - size_t new_byte_size = new_size * ecl_kw->sizeof_ctype; + size_t old_byte_size = ecl_kw->size * ecl_kw_get_sizeof_ctype(ecl_kw); + size_t new_byte_size = new_size * ecl_kw_get_sizeof_ctype(ecl_kw); ecl_kw->data = util_realloc(ecl_kw->data , new_byte_size ); if (new_byte_size > old_byte_size) { @@ -727,7 +693,7 @@ ecl_kw_type * ecl_kw_alloc_sub_copy( const ecl_kw_type * src, const char * new_k { void * src_data = ecl_kw_iget_ptr( src , offset ); - return ecl_kw_alloc_new( new_kw , count , src->ecl_type , src_data ); + return ecl_kw_alloc_new( new_kw , count , src->data_type , src_data ); } } @@ -739,18 +705,18 @@ const void * ecl_kw_copyc__(const void * void_kw) { static void * ecl_kw_iget_ptr_static(const ecl_kw_type *ecl_kw , int i) { ecl_kw_assert_index(ecl_kw , i , __func__); - return &ecl_kw->data[i * ecl_kw->sizeof_ctype]; + return &ecl_kw->data[i * ecl_kw_get_sizeof_ctype(ecl_kw)]; } static void ecl_kw_iget_static(const ecl_kw_type *ecl_kw , int i , void *iptr) { - memcpy(iptr , ecl_kw_iget_ptr_static(ecl_kw , i) , ecl_kw->sizeof_ctype); + memcpy(iptr , ecl_kw_iget_ptr_static(ecl_kw , i) , ecl_kw_get_sizeof_ctype(ecl_kw)); } static void ecl_kw_iset_static(ecl_kw_type *ecl_kw , int i , const void *iptr) { ecl_kw_assert_index(ecl_kw , i , __func__); - memcpy(&ecl_kw->data[i * ecl_kw->sizeof_ctype] , iptr, ecl_kw->sizeof_ctype); + memcpy(&ecl_kw->data[i * ecl_kw_get_sizeof_ctype(ecl_kw)] , iptr, ecl_kw_get_sizeof_ctype(ecl_kw)); } @@ -764,11 +730,11 @@ void ecl_kw_iget(const ecl_kw_type *ecl_kw , int i , void *iptr) { float and int. */ double ecl_kw_iget_as_double(const ecl_kw_type * ecl_kw , int index) { - if (ecl_kw->ecl_type == ECL_FLOAT_TYPE) + if (ecl_type_is_float(ecl_kw->data_type)) return ecl_kw_iget_float( ecl_kw , index); /* Here the compiler will silently insert a float -> double conversion. */ - else if (ecl_kw->ecl_type == ECL_DOUBLE_TYPE) + else if (ecl_type_is_double(ecl_kw->data_type)) return ecl_kw_iget_double( ecl_kw, index); - else if (ecl_kw->ecl_type == ECL_INT_TYPE) + else if (ecl_type_is_int(ecl_kw->data_type)) return ecl_kw_iget_int( ecl_kw, index); /* */ else { util_abort("%s: can not be converted to double - no data for you! \n",__func__); @@ -781,9 +747,9 @@ double ecl_kw_iget_as_double(const ecl_kw_type * ecl_kw , int index) { */ float ecl_kw_iget_as_float(const ecl_kw_type * ecl_kw , int i) { - if (ecl_kw->ecl_type == ECL_FLOAT_TYPE) + if (ecl_type_is_float(ecl_kw->data_type)) return ecl_kw_iget_float( ecl_kw , i); - else if (ecl_kw->ecl_type == ECL_DOUBLE_TYPE) + else if (ecl_type_is_double(ecl_kw->data_type)) return (float) ecl_kw_iget_double( ecl_kw, i); else { util_abort("%s: can not be converted to float - no data for you! \n",__func__); @@ -828,6 +794,12 @@ const char * ecl_kw_iget_char_ptr( const ecl_kw_type * ecl_kw , int i) { return ecl_kw_iget_ptr( ecl_kw , i ); } +const char * ecl_kw_iget_string_ptr( const ecl_kw_type * ecl_kw, int i) { + if (ecl_kw_get_type(ecl_kw) != ECL_STRING_TYPE) + util_abort("%s: Keyword: %s is wrong type - aborting \n",__func__ , ecl_kw_get_header8(ecl_kw)); + return ecl_kw_iget_ptr( ecl_kw , i ); +} + /** This will set the elemnts of the ecl_kw data storage in index to @@ -880,6 +852,30 @@ void ecl_kw_iset_char_ptr( ecl_kw_type * ecl_kw , int index, const char * s) { } } +/** + * This function will verify that the given string is of approperiate length + * (0 <= lenght <= data_type.element_size). If so, the elements of @s will be + * written to the @ecl_kw string array starting at @index. + */ +void ecl_kw_iset_string_ptr( ecl_kw_type * ecl_kw, int index, const char * s) { + if(!ecl_type_is_alpha(ecl_kw_get_data_type(ecl_kw))) { + char * type_name = ecl_type_alloc_name(ecl_kw_get_data_type(ecl_kw)); + util_abort("%s: Expected alphabetic data type (CHAR, CXXX or MESS), was %s\n", __func__, type_name); + } + + size_t input_len = strlen(s); + size_t type_len = ecl_type_get_sizeof_ctype_fortio(ecl_kw_get_data_type(ecl_kw)); + + if(input_len > type_len) + util_abort("%s: String of length %d cannot hold input string of length %d\n", __func__, type_len, input_len); + + char * ecl_string = (char *) ecl_kw_iget_ptr(ecl_kw, index); + for(int i = 0; i < input_len; ++i) + ecl_string[i] = s[i]; + + ecl_string[input_len] = '\0'; +} + /** This function will compare the string at position @index with the @@ -1091,10 +1087,10 @@ bool ecl_kw_fread_data(ecl_kw_type *ecl_kw, fortio_type *fortio) { const char null_char = '\0'; bool fmt_file = fortio_fmt_file( fortio ); if (ecl_kw->size > 0) { - const int blocksize = get_blocksize( ecl_kw->ecl_type ); + const int blocksize = get_blocksize( ecl_kw->data_type ); if (fmt_file) { const int blocks = ecl_kw->size / blocksize + (ecl_kw->size % blocksize == 0 ? 0 : 1); - const char * read_fmt = get_read_fmt( ecl_kw->ecl_type ); + char * read_fmt = alloc_read_fmt( ecl_kw->data_type ); FILE * stream = fortio_get_FILE(fortio); int offset = 0; int index = 0; @@ -1102,15 +1098,23 @@ bool ecl_kw_fread_data(ecl_kw_type *ecl_kw, fortio_type *fortio) { for (ib = 0; ib < blocks; ib++) { int read_elm = util_int_min((ib + 1) * blocksize , ecl_kw->size) - ib * blocksize; for (ir = 0; ir < read_elm; ir++) { - switch(ecl_kw->ecl_type) { + switch(ecl_kw_get_type(ecl_kw)) { case(ECL_CHAR_TYPE): ecl_kw_fscanf_qstring(&ecl_kw->data[offset] , read_fmt , 8, stream); break; + case(ECL_STRING_TYPE): + ecl_kw_fscanf_qstring( + &ecl_kw->data[offset], + read_fmt, + ecl_type_get_sizeof_ctype_fortio(ecl_kw_get_data_type(ecl_kw)), + stream + ); + break; case(ECL_INT_TYPE): { int iread = fscanf(stream , read_fmt , (int *) &ecl_kw->data[offset]); if (iread != 1) - util_abort("%s: after reading %d values reading of keyword:%s from:%s failed - aborting \n",__func__ , offset / ecl_kw->sizeof_ctype , ecl_kw->header8 , fortio_filename_ref(fortio)); + util_abort("%s: after reading %d values reading of keyword:%s from:%s failed - aborting \n",__func__ , offset / ecl_kw_get_sizeof_ctype(ecl_kw) , ecl_kw->header8 , fortio_filename_ref(fortio)); } break; case(ECL_FLOAT_TYPE): @@ -1118,7 +1122,7 @@ bool ecl_kw_fread_data(ecl_kw_type *ecl_kw, fortio_type *fortio) { int iread = fscanf(stream , read_fmt , (float *) &ecl_kw->data[offset]); if (iread != 1) { util_abort("%s: after reading %d values reading of keyword:%s from:%s failed - aborting \n",__func__ , - offset / ecl_kw->sizeof_ctype , + offset / ecl_kw_get_sizeof_ctype(ecl_kw) , ecl_kw->header8 , fortio_filename_ref(fortio)); } @@ -1148,19 +1152,20 @@ bool ecl_kw_fread_data(ecl_kw_type *ecl_kw, fortio_type *fortio) { ecl_kw_fscanf_qstring(&ecl_kw->data[offset] , read_fmt , 8 , stream); break; default: - util_abort("%s: Internal error: internal eclipse_type: %d not recognized - aborting \n",__func__ , ecl_kw->ecl_type); + util_abort("%s: Internal error: internal eclipse_type: %d not recognized - aborting \n",__func__ , ecl_kw_get_type(ecl_kw)); } - offset += ecl_kw->sizeof_ctype; + offset += ecl_kw_get_sizeof_ctype(ecl_kw); index++; } } /* Skip the trailing newline */ fortio_fseek( fortio , 1 , SEEK_CUR); + free(read_fmt); return true; } else { bool read_ok = true; - if (ecl_kw->ecl_type == ECL_CHAR_TYPE || ecl_kw->ecl_type == ECL_MESS_TYPE) { + if (ecl_type_is_char(ecl_kw->data_type) || ecl_type_is_mess(ecl_kw->data_type) || ecl_type_is_string(ecl_kw->data_type)) { const int blocks = ecl_kw->size / blocksize + (ecl_kw->size % blocksize == 0 ? 0 : 1); int ib = 0; while (true) { @@ -1173,9 +1178,11 @@ bool ecl_kw_fread_data(ecl_kw_type *ecl_kw, fortio_type *fortio) { int record_size = fortio_init_read(fortio); if (record_size >= 0) { int ir; + const int sizeof_ctype = ecl_type_get_sizeof_ctype(ecl_kw->data_type); + const int sizeof_ctype_fortio = ecl_type_get_sizeof_ctype_fortio(ecl_kw->data_type); for (ir = 0; ir < read_elm; ir++) { - util_fread( &ecl_kw->data[(ib * blocksize + ir) * ecl_kw->sizeof_ctype] , 1 , ECL_STRING8_LENGTH , stream , __func__); - ecl_kw->data[(ib * blocksize + ir) * ecl_kw->sizeof_ctype + ECL_STRING8_LENGTH] = null_char; + util_fread( &ecl_kw->data[(ib * blocksize + ir) * sizeof_ctype] , 1 , sizeof_ctype_fortio , stream , __func__); + ecl_kw->data[(ib * blocksize + ir) * sizeof_ctype + sizeof_ctype_fortio] = null_char; } read_ok = fortio_complete_read(fortio , record_size); } else @@ -1193,7 +1200,7 @@ bool ecl_kw_fread_data(ecl_kw_type *ecl_kw, fortio_type *fortio) { This function handles the fuc***g blocks transparently at a low level. */ - read_ok = fortio_fread_buffer(fortio , ecl_kw->data , ecl_kw->size * ecl_kw->sizeof_ctype); + read_ok = fortio_fread_buffer(fortio , ecl_kw->data , ecl_kw->size * ecl_kw_get_sizeof_ctype(ecl_kw)); if (read_ok && ECL_ENDIAN_FLIP) ecl_kw_endian_convert_data(ecl_kw); } @@ -1205,13 +1212,13 @@ bool ecl_kw_fread_data(ecl_kw_type *ecl_kw, fortio_type *fortio) { } -void ecl_kw_fread_indexed_data(fortio_type * fortio, offset_type data_offset, ecl_type_enum ecl_type, int element_count, const int_vector_type* index_map, char* buffer) { - const int block_size = get_blocksize( ecl_type ); +void ecl_kw_fread_indexed_data(fortio_type * fortio, offset_type data_offset, ecl_data_type data_type, int element_count, const int_vector_type* index_map, char* buffer) { + const int block_size = get_blocksize(data_type); FILE *stream = fortio_get_FILE( fortio ); int index; - int element_size = ecl_util_get_sizeof_ctype(ecl_type); + int element_size = ecl_type_get_sizeof_ctype(data_type); - if(ecl_type == ECL_CHAR_TYPE || ecl_type == ECL_MESS_TYPE) { + if(ecl_type_is_char(data_type) || ecl_type_is_mess(data_type)) { element_size = ECL_STRING8_LENGTH; } @@ -1243,37 +1250,33 @@ bool ecl_kw_fread_realloc_data(ecl_kw_type *ecl_kw, fortio_type *fortio) { Static method without a class instance. */ -bool ecl_kw_fskip_data__( ecl_type_enum ecl_type , const int element_count , fortio_type * fortio) { +bool ecl_kw_fskip_data__( ecl_data_type data_type , const int element_count , fortio_type * fortio) { + if (element_count <= 0) + return true; + bool fmt_file = fortio_fmt_file(fortio); - bool skip_ok = true; - if (element_count > 0) { - if (fmt_file) { - /* Formatted skipping actually involves reading the data - nice ??? */ - ecl_kw_type * tmp_kw = ecl_kw_alloc_empty( ); - ecl_kw_initialize( tmp_kw , "WORK" , element_count , ecl_type ); - ecl_kw_alloc_data(tmp_kw); - ecl_kw_fread_data(tmp_kw , fortio); - ecl_kw_free( tmp_kw ); - } else { - const int blocksize = get_blocksize( ecl_type ); - const int block_count = element_count / blocksize + (element_count % blocksize == 0 ? 0 : 1); + if (fmt_file) { + /* Formatted skipping actually involves reading the data - nice ??? */ + ecl_kw_type * tmp_kw = ecl_kw_alloc_empty( ); + ecl_kw_initialize( tmp_kw , "WORK" , element_count , data_type ); + ecl_kw_alloc_data(tmp_kw); + ecl_kw_fread_data(tmp_kw , fortio); + ecl_kw_free( tmp_kw ); + } else { + const int blocksize = get_blocksize( data_type ); + const int block_count = element_count / blocksize + (element_count % blocksize != 0); + int element_size = ecl_type_get_sizeof_ctype_fortio(data_type); - int element_size = ecl_util_get_sizeof_ctype(ecl_type ); - if(ecl_type == ECL_CHAR_TYPE) - element_size = ECL_STRING8_LENGTH; - - if(ecl_type == ECL_C010_TYPE) - element_size = ECL_STRING10_LENGTH; - - skip_ok = fortio_data_fskip(fortio, element_size, element_count, block_count); - } + if(!fortio_data_fskip(fortio, element_size, element_count, block_count)) + return false; } - return skip_ok; + + return true; } bool ecl_kw_fskip_data(ecl_kw_type *ecl_kw, fortio_type *fortio) { - return ecl_kw_fskip_data__( ecl_kw->ecl_type , ecl_kw->size , fortio ); + return ecl_kw_fskip_data__( ecl_kw_get_data_type(ecl_kw) , ecl_kw->size , fortio ); } @@ -1305,51 +1308,47 @@ ecl_read_status_enum ecl_kw_fread_header(ecl_kw_type *ecl_kw , fortio_type * for char ecl_type_str[ECL_TYPE_LENGTH + 1]; int record_size; int size; - bool OK = true; if (fmt_file) { - OK = ecl_kw_fscanf_qstring(header , "%8c" , 8 , stream); - if (OK) { - int read_count = fscanf(stream , "%d" , &size); - if (read_count == 1) { - ecl_kw_fscanf_qstring(ecl_type_str , "%4c" , 4 , stream); - fgetc(stream); /* Reading the trailing newline ... */ - } else - util_abort("%s: reading failed - at end of file?\n",__func__); - } - } else { - header[ECL_STRING8_LENGTH] = null_char; + if(!ecl_kw_fscanf_qstring(header , "%8c" , 8 , stream)) + return ECL_KW_READ_FAIL; + + int read_count = fscanf(stream , "%d" , &size); + if (read_count != 1) + util_abort("%s: reading failed - at end of file?\n",__func__); + + ecl_kw_fscanf_qstring(ecl_type_str , "%4c" , 4 , stream); + fgetc(stream); /* Reading the trailing newline ... */ + } + else { + header[ECL_STRING8_LENGTH] = null_char; ecl_type_str[ECL_TYPE_LENGTH] = null_char; record_size = fortio_init_read(fortio); - if (record_size > 0) { - char buffer[ECL_KW_HEADER_DATA_SIZE]; - size_t read_bytes = fread(buffer , 1 , ECL_KW_HEADER_DATA_SIZE , stream); - if (read_bytes == ECL_KW_HEADER_DATA_SIZE) { - memcpy( header , &buffer[0] , ECL_STRING8_LENGTH); - size = *( (int *) &buffer[ECL_STRING8_LENGTH] ); - memcpy( ecl_type_str , &buffer[ECL_STRING8_LENGTH + sizeof(size)] , ECL_TYPE_LENGTH); + if (record_size <= 0) + return ECL_KW_READ_FAIL; - OK = fortio_complete_read(fortio , record_size); - } else - OK = false; + char buffer[ECL_KW_HEADER_DATA_SIZE]; + size_t read_bytes = fread(buffer , 1 , ECL_KW_HEADER_DATA_SIZE , stream); - if (OK && ECL_ENDIAN_FLIP) - util_endian_flip_vector(&size , sizeof size , 1); - } else - OK = false; + if (read_bytes != ECL_KW_HEADER_DATA_SIZE) + return ECL_KW_READ_FAIL; + + memcpy( header , &buffer[0] , ECL_STRING8_LENGTH); + size = *( (int *) &buffer[ECL_STRING8_LENGTH] ); + memcpy( ecl_type_str , &buffer[ECL_STRING8_LENGTH + sizeof(size)] , ECL_TYPE_LENGTH); + + if(!fortio_complete_read(fortio , record_size)) + return ECL_KW_READ_FAIL; + + if (ECL_ENDIAN_FLIP) + util_endian_flip_vector(&size , sizeof size , 1); } - if (OK) { - ecl_type_enum ecl_type = ecl_util_get_type_from_name( ecl_type_str ); - ecl_kw_initialize( ecl_kw , header , size , ecl_type); + ecl_data_type data_type = ecl_type_create_from_name( ecl_type_str ); + ecl_kw_initialize( ecl_kw , header , size , data_type); - if (ecl_type == ECL_C010_TYPE) - return ECL_KW_READ_SKIP; - - return ECL_KW_READ_OK; - } else - return ECL_KW_READ_FAIL; + return ECL_KW_READ_OK; } @@ -1456,7 +1455,7 @@ void ecl_kw_alloc_data(ecl_kw_type *ecl_kw) { util_abort("%s: trying to allocate data for ecl_kw object which has been declared with shared storage - aborting \n",__func__); { - size_t byte_size = ecl_kw->size * ecl_kw->sizeof_ctype; + size_t byte_size = ecl_kw->size * ecl_kw_get_sizeof_ctype(ecl_kw); ecl_kw->data = util_realloc(ecl_kw->data , byte_size ); memset(ecl_kw->data , 0 , byte_size); } @@ -1483,6 +1482,9 @@ void ecl_kw_set_header_name(ecl_kw_type * ecl_kw , const char * header) { } +void ecl_kw_set_data_type(ecl_kw_type * ecl_kw, ecl_data_type data_type) { + memcpy(&ecl_kw->data_type, &data_type, sizeof data_type); +} bool ecl_kw_fread_realloc(ecl_kw_type *ecl_kw , fortio_type *fortio) { @@ -1533,28 +1535,29 @@ static void ecl_kw_fwrite_data_unformatted( ecl_kw_type * ecl_kw , fortio_type * ecl_kw_endian_convert_data(ecl_kw); { - const int blocksize = get_blocksize( ecl_kw->ecl_type ); + const int blocksize = get_blocksize( ecl_kw->data_type ); const int num_blocks = ecl_kw->size / blocksize + (ecl_kw->size % blocksize == 0 ? 0 : 1); int block_nr; for (block_nr = 0; block_nr < num_blocks; block_nr++) { int this_blocksize = util_int_min((block_nr + 1)*blocksize , ecl_kw->size) - block_nr*blocksize; - if (ecl_kw->ecl_type == ECL_CHAR_TYPE || ecl_kw->ecl_type == ECL_MESS_TYPE) { + if (ecl_type_is_char(ecl_kw->data_type) || ecl_type_is_mess(ecl_kw->data_type) || ecl_type_is_string(ecl_kw->data_type)) { /* Due to the terminating \0 characters there is not a continous file/memory mapping - the \0 characters arel skipped. */ - FILE *stream = fortio_get_FILE(fortio); - int record_size = this_blocksize * ECL_STRING8_LENGTH; /* The total size in bytes of the record written by the fortio layer. */ - int i; + FILE *stream = fortio_get_FILE(fortio); + int word_size = ecl_type_get_sizeof_ctype_fortio(ecl_kw->data_type); + int record_size = this_blocksize * word_size; /* The total size in bytes of the record written by the fortio layer. */ + int i; fortio_init_write(fortio , record_size ); for (i = 0; i < this_blocksize; i++) - fwrite(&ecl_kw->data[(block_nr * blocksize + i) * ecl_kw->sizeof_ctype] , 1 , ECL_STRING8_LENGTH , stream); + fwrite(&ecl_kw->data[(block_nr * blocksize + i) * ecl_kw_get_sizeof_ctype(ecl_kw)] , 1 , word_size , stream); fortio_complete_write(fortio , record_size); } else { - int record_size = this_blocksize * ecl_kw->sizeof_ctype; /* The total size in bytes of the record written by the fortio layer. */ - fortio_fwrite_record(fortio , &ecl_kw->data[block_nr * blocksize * ecl_kw->sizeof_ctype] , record_size); + int record_size = this_blocksize * ecl_kw_get_sizeof_ctype(ecl_kw); /* The total size in bytes of the record written by the fortio layer. */ + fortio_fwrite_record(fortio , &ecl_kw->data[block_nr * blocksize * ecl_kw_get_sizeof_ctype(ecl_kw)] , record_size); } } } @@ -1606,9 +1609,9 @@ static void ecl_kw_fwrite_data_formatted( ecl_kw_type * ecl_kw , fortio_type * f { FILE * stream = fortio_get_FILE( fortio ); - const int blocksize = get_blocksize( ecl_kw->ecl_type ); - const int columns = get_columns( ecl_kw->ecl_type ); - const char * write_fmt = ecl_kw_get_write_fmt( ecl_kw->ecl_type ); + const int blocksize = get_blocksize( ecl_kw->data_type ); + const int columns = get_columns( ecl_kw->data_type ); + char * write_fmt = alloc_write_fmt( ecl_kw->data_type ); const int num_blocks = ecl_kw->size / blocksize + (ecl_kw->size % blocksize == 0 ? 0 : 1); int block_nr; @@ -1622,11 +1625,11 @@ static void ecl_kw_fwrite_data_formatted( ecl_kw_type * ecl_kw , fortio_type * f for (col_nr =0; col_nr < num_columns; col_nr++) { int data_index = block_nr * blocksize + line_nr * columns + col_nr; void * data_ptr = ecl_kw_iget_ptr_static( ecl_kw , data_index ); - switch (ecl_kw->ecl_type) { + switch (ecl_kw_get_type(ecl_kw)) { case(ECL_CHAR_TYPE): fprintf(stream , write_fmt , data_ptr); break; - case(ECL_C010_TYPE): + case(ECL_STRING_TYPE): fprintf(stream , write_fmt , data_ptr); break; case(ECL_INT_TYPE): @@ -1664,6 +1667,8 @@ static void ecl_kw_fwrite_data_formatted( ecl_kw_type * ecl_kw , fortio_type * f fprintf(stream , "\n"); } } + + free(write_fmt); } } @@ -1683,8 +1688,10 @@ void ecl_kw_fwrite_data(const ecl_kw_type *_ecl_kw , fortio_type *fortio) { void ecl_kw_fwrite_header(const ecl_kw_type *ecl_kw , fortio_type *fortio) { FILE *stream = fortio_get_FILE(fortio); bool fmt_file = fortio_fmt_file(fortio); + char * type_name = ecl_type_alloc_name(ecl_kw->data_type); + if (fmt_file) - fprintf(stream , WRITE_HEADER_FMT , ecl_kw->header8 , ecl_kw->size , ecl_util_get_type_name( ecl_kw->ecl_type )); + fprintf(stream , WRITE_HEADER_FMT , ecl_kw->header8 , ecl_kw->size , type_name); else { int size = ecl_kw->size; if (ECL_ENDIAN_FLIP) @@ -1694,11 +1701,13 @@ void ecl_kw_fwrite_header(const ecl_kw_type *ecl_kw , fortio_type *fortio) { fwrite(ecl_kw->header8 , sizeof(char) , ECL_STRING8_LENGTH , stream); fwrite(&size , sizeof(int) , 1 , stream); - fwrite(ecl_util_get_type_name( ecl_kw->ecl_type ) , sizeof(char) , ECL_TYPE_LENGTH , stream); + fwrite(type_name , sizeof(char) , ECL_TYPE_LENGTH , stream); fortio_complete_write(fortio , ECL_KW_HEADER_DATA_SIZE); } + + free(type_name); } @@ -1724,7 +1733,17 @@ int ecl_kw_get_size(const ecl_kw_type * ecl_kw) { return ecl_kw->size; } -ecl_type_enum ecl_kw_get_type(const ecl_kw_type * ecl_kw) { return ecl_kw->ecl_type; } +ecl_type_enum ecl_kw_get_type(const ecl_kw_type * ecl_kw) { + return ecl_type_get_type(ecl_kw->data_type); +} + +ecl_data_type ecl_kw_get_data_type(const ecl_kw_type * ecl_kw) { + return ecl_kw->data_type; +} + +size_t ecl_kw_get_sizeof_ctype(const ecl_kw_type * ecl_kw) { + return ecl_type_get_sizeof_ctype(ecl_kw->data_type); +} /******************************************************************/ @@ -1734,37 +1753,39 @@ ecl_kw_type * ecl_kw_buffer_alloc(buffer_type * buffer) { const char * header = buffer_fread_string( buffer ); int size = buffer_fread_int( buffer ); ecl_type_enum ecl_type = buffer_fread_int( buffer ); - { - ecl_kw_type * ecl_kw = ecl_kw_alloc_empty(); - ecl_kw_initialize( ecl_kw , header , size , ecl_type ); - ecl_kw_alloc_data(ecl_kw); - buffer_fread(buffer , ecl_kw->data , ecl_kw->sizeof_ctype , ecl_kw->size); - return ecl_kw; - } + size_t element_size = buffer_fread_int( buffer ); + + ecl_data_type data_type = ecl_type_create(ecl_type, element_size); + ecl_kw_type * ecl_kw = ecl_kw_alloc_empty(); + ecl_kw_initialize( ecl_kw , header , size , data_type ); + ecl_kw_alloc_data(ecl_kw); + buffer_fread(buffer , ecl_kw->data , ecl_kw_get_sizeof_ctype(ecl_kw) , ecl_kw->size); + return ecl_kw; } void ecl_kw_buffer_store(const ecl_kw_type * ecl_kw , buffer_type * buffer) { buffer_fwrite_string( buffer , ecl_kw->header8 ); buffer_fwrite_int( buffer , ecl_kw->size ); - buffer_fwrite_int( buffer , ecl_kw->ecl_type ); - buffer_fwrite( buffer , ecl_kw->data , ecl_kw->sizeof_ctype , ecl_kw->size); + buffer_fwrite_int( buffer , ecl_type_get_type(ecl_kw->data_type) ); + buffer_fwrite_int( buffer , ecl_type_get_sizeof_ctype(ecl_kw->data_type)); + buffer_fwrite( buffer , ecl_kw->data , ecl_kw_get_sizeof_ctype(ecl_kw) , ecl_kw->size); } -void ecl_kw_fwrite_param_fortio(fortio_type * fortio, const char * header , ecl_type_enum ecl_type , int size, void * data) { - ecl_kw_type * ecl_kw = ecl_kw_alloc_new_shared(header , size , ecl_type , data); +void ecl_kw_fwrite_param_fortio(fortio_type * fortio, const char * header , ecl_data_type data_type , int size, void * data) { + ecl_kw_type * ecl_kw = ecl_kw_alloc_new_shared(header , size , data_type , data); ecl_kw_fwrite(ecl_kw , fortio); ecl_kw_free(ecl_kw); } -void ecl_kw_fwrite_param(const char * filename , bool fmt_file , const char * header , ecl_type_enum ecl_type , int size, void * data) { +void ecl_kw_fwrite_param(const char * filename , bool fmt_file , const char * header , ecl_data_type data_type , int size, void * data) { fortio_type * fortio = fortio_open_writer(filename , fmt_file , ECL_ENDIAN_FLIP); - ecl_kw_fwrite_param_fortio(fortio , header , ecl_type , size , data); + ecl_kw_fwrite_param_fortio(fortio , header , data_type , size , data); fortio_fclose(fortio); } @@ -1772,14 +1793,14 @@ void ecl_kw_fwrite_param(const char * filename , bool fmt_file , const char * he void ecl_kw_get_data_as_double(const ecl_kw_type * ecl_kw , double * double_data) { - if (ecl_kw->ecl_type == ECL_DOUBLE_TYPE) + if (ecl_type_is_double(ecl_kw->data_type)) // Direct memcpy - no conversion ecl_kw_get_memcpy_data(ecl_kw , double_data); else { - if (ecl_kw->ecl_type == ECL_FLOAT_TYPE) { + if (ecl_type_is_float(ecl_kw->data_type)) { const float * float_data = (const float *) ecl_kw->data; util_float_to_double(double_data , float_data , ecl_kw->size); - } else if (ecl_kw->ecl_type == ECL_INT_TYPE) { + } else if (ecl_type_is_int(ecl_kw->data_type)) { const int * int_data = (const int *) ecl_kw->data; int i; for (i=0; i < ecl_kw->size; i++) @@ -1795,14 +1816,14 @@ void ecl_kw_get_data_as_double(const ecl_kw_type * ecl_kw , double * double_data void ecl_kw_get_data_as_float(const ecl_kw_type * ecl_kw , float * float_data) { - if (ecl_kw->ecl_type == ECL_FLOAT_TYPE) + if (ecl_type_is_float(ecl_kw->data_type)) // Direct memcpy - no conversion ecl_kw_get_memcpy_data(ecl_kw , float_data); else { - if (ecl_kw->ecl_type == ECL_DOUBLE_TYPE) { + if (ecl_type_is_double(ecl_kw->data_type)) { const double * double_data = (const double *) ecl_kw->data; util_double_to_float(float_data , double_data , ecl_kw->size); - } else if (ecl_kw->ecl_type == ECL_INT_TYPE) { + } else if (ecl_type_is_int(ecl_kw->data_type)) { const int * int_data = (const int *) ecl_kw->data; int i; for (i=0; i < ecl_kw->size; i++) @@ -1838,13 +1859,13 @@ ecl_kw_type * ecl_kw_alloc_scatter_copy( const ecl_kw_type * src_kw , int target float default_float = 0; int default_bool = ECL_BOOL_FALSE_INT; const char * default_char = ""; - ecl_kw_type * new_kw = ecl_kw_alloc( src_kw->header , target_size , src_kw->ecl_type ); + ecl_kw_type * new_kw = ecl_kw_alloc( src_kw->header , target_size , src_kw->data_type ); if (def_value != NULL) ecl_kw_scalar_set__( new_kw , def_value ); else { /** Initialize with defaults .*/ - switch (src_kw->ecl_type) { + switch (ecl_kw_get_type(src_kw)) { case(ECL_INT_TYPE): ecl_kw_scalar_set__( new_kw , &default_int ); break; @@ -1861,12 +1882,12 @@ ecl_kw_type * ecl_kw_alloc_scatter_copy( const ecl_kw_type * src_kw , int target ecl_kw_scalar_set__( new_kw , default_char ); break; default: - util_abort("%s: unsupported type:%d \n", __func__ , src_kw->ecl_type); + util_abort("%s: unsupported type:%d \n", __func__ , ecl_kw_get_type(src_kw)); } } { - int sizeof_ctype = ecl_util_get_sizeof_ctype( src_kw->ecl_type ); + int sizeof_ctype = ecl_type_get_sizeof_ctype( src_kw->data_type ); int i; for( i =0; i < src_kw->size; i++) { int target_index = mapping[i]; @@ -1893,9 +1914,11 @@ void ecl_kw_fread_double_param(const char * filename , bool fmt_file , double * void ecl_kw_summarize(const ecl_kw_type * ecl_kw) { + char * type_name = ecl_type_alloc_name(ecl_kw->data_type); printf("%8s %10d:%4s \n",ecl_kw_get_header8(ecl_kw), ecl_kw_get_size(ecl_kw), - ecl_util_get_type_name( ecl_kw->ecl_type)); + type_name); + free(type_name); } @@ -1906,7 +1929,7 @@ void ecl_kw_summarize(const ecl_kw_type * ecl_kw) { #define ECL_KW_SCALAR_SET_TYPED( ctype , ECL_TYPE ) \ void ecl_kw_scalar_set_ ## ctype( ecl_kw_type * ecl_kw , ctype value){ \ - if (ecl_kw->ecl_type == ECL_TYPE) { \ + if (ecl_kw_get_type(ecl_kw) == ECL_TYPE) { \ ctype * data = ecl_kw_get_data_ref(ecl_kw); \ int i; \ for (i=0;i < ecl_kw->size; i++) \ @@ -1952,7 +1975,7 @@ void ecl_kw_scalar_set_float_or_double( ecl_kw_type * ecl_kw , double value ) { Untyped - low level alternative. */ void ecl_kw_scalar_set__(ecl_kw_type * ecl_kw , const void * value) { - int sizeof_ctype = ecl_util_get_sizeof_ctype( ecl_kw->ecl_type ); + int sizeof_ctype = ecl_type_get_sizeof_ctype( ecl_kw->data_type ); int i; for (i=0;i < ecl_kw->size; i++) memcpy( &ecl_kw->data[ i * sizeof_ctype ] , value , sizeof_ctype); @@ -1965,12 +1988,12 @@ void ecl_kw_scalar_set__(ecl_kw_type * ecl_kw , const void * value) { void ecl_kw_alloc_double_data(ecl_kw_type * ecl_kw , double * values) { ecl_kw_alloc_data(ecl_kw); - memcpy(ecl_kw->data , values , ecl_kw->size * ecl_kw->sizeof_ctype); + memcpy(ecl_kw->data , values , ecl_kw->size * ecl_kw_get_sizeof_ctype(ecl_kw)); } void ecl_kw_alloc_float_data(ecl_kw_type * ecl_kw , float * values) { ecl_kw_alloc_data(ecl_kw); - memcpy(ecl_kw->data , values , ecl_kw->size * ecl_kw->sizeof_ctype); + memcpy(ecl_kw->data , values , ecl_kw->size * ecl_kw_get_sizeof_ctype(ecl_kw)); } /*****************************************************************/ @@ -2034,40 +2057,17 @@ void ecl_kw_shift_float_or_double( ecl_kw_type * ecl_kw , double shift_value ) { util_abort("%s: wrong type \n",__func__); } - - -bool ecl_kw_assert_numeric( const ecl_kw_type * kw ) { - if ((kw->ecl_type == ECL_INT_TYPE) || (kw->ecl_type == ECL_FLOAT_TYPE) || (kw->ecl_type == ECL_DOUBLE_TYPE)) - return true; - else - return false; -} - - -bool ecl_kw_assert_binary( const ecl_kw_type * kw1, const ecl_kw_type * kw2) { - if (kw1->size != kw2->size) - return false; /* Size mismatch */ - if (kw1->ecl_type != kw2->ecl_type) - return false; /* Type mismatch */ - - return true; -} - - -bool ecl_kw_assert_binary_numeric( const ecl_kw_type * kw1, const ecl_kw_type * kw2) { - if (!ecl_kw_assert_binary( kw1 , kw2)) - return false; - else - return ecl_kw_assert_numeric( kw1 ); +bool ecl_kw_size_and_numeric_type_equal( const ecl_kw_type * kw1, const ecl_kw_type * kw2) { + return ecl_kw_size_and_type_equal(kw1, kw2) && ecl_type_is_numeric(kw1->data_type); } #define ECL_KW_ASSERT_TYPED_BINARY_OP( ctype , ECL_TYPE ) \ bool ecl_kw_assert_binary_ ## ctype( const ecl_kw_type * kw1 , const ecl_kw_type * kw2) { \ - if (!ecl_kw_assert_binary_numeric( kw1 , kw2)) \ + if (!ecl_kw_size_and_numeric_type_equal( kw1 , kw2)) \ return false; \ - if (kw1->ecl_type != ECL_TYPE) \ + if (ecl_kw_get_type(kw1) != ECL_TYPE) \ return false; /* Type mismatch */ \ return true; \ } @@ -2079,12 +2079,12 @@ ECL_KW_ASSERT_TYPED_BINARY_OP( double , ECL_DOUBLE_TYPE ) void ecl_kw_copy_indexed( ecl_kw_type * target_kw , const int_vector_type * index_set , const ecl_kw_type * src_kw) { - if (!ecl_kw_assert_binary( target_kw , src_kw )) + if (!ecl_kw_size_and_type_equal( target_kw , src_kw )) util_abort("%s: type/size mismatch\n",__func__); { char * target_data = ecl_kw_get_data_ref( target_kw ); const char * src_data = ecl_kw_get_data_ref( src_kw ); - int sizeof_ctype = ecl_util_get_sizeof_ctype(target_kw->ecl_type); + int sizeof_ctype = ecl_type_get_sizeof_ctype(target_kw->data_type); int set_size = int_vector_size( index_set ); const int * index_data = int_vector_get_const_ptr( index_set ); int i; @@ -2133,7 +2133,7 @@ void ecl_kw_inplace_add_indexed( ecl_kw_type * target_kw , const int_vector_type ecl_kw_inplace_add_indexed_int( target_kw , index_set , add_kw ); break; default: - util_abort("%s: inplace add not implemented for type:%s \n",__func__ , ecl_util_get_type_name( type )); + util_abort("%s: inplace add not implemented for type:%s \n",__func__ , ecl_type_alloc_name( ecl_kw_get_data_type(target_kw) )); } } @@ -2171,7 +2171,7 @@ void ecl_kw_inplace_add( ecl_kw_type * target_kw , const ecl_kw_type * add_kw) { ecl_kw_inplace_add_int( target_kw , add_kw ); break; default: - util_abort("%s: inplace add not implemented for type:%s \n",__func__ , ecl_util_get_type_name( type )); + util_abort("%s: inplace add not implemented for type:%s \n",__func__ , ecl_type_alloc_name( ecl_kw_get_data_type(target_kw) )); } } @@ -2210,7 +2210,7 @@ void ecl_kw_inplace_sub( ecl_kw_type * target_kw , const ecl_kw_type * sub_kw) { ecl_kw_inplace_sub_int( target_kw , sub_kw ); break; default: - util_abort("%s: inplace sub not implemented for type:%s \n",__func__ , ecl_util_get_type_name( type )); + util_abort("%s: inplace sub not implemented for type:%s \n",__func__ , ecl_type_alloc_name( ecl_kw_get_data_type(target_kw) )); } } @@ -2250,7 +2250,7 @@ void ecl_kw_inplace_sub_indexed( ecl_kw_type * target_kw , const int_vector_type ecl_kw_inplace_sub_indexed_int( target_kw , index_set , sub_kw ); break; default: - util_abort("%s: inplace sub not implemented for type:%s \n",__func__ , ecl_util_get_type_name( type )); + util_abort("%s: inplace sub not implemented for type:%s \n",__func__ , ecl_type_alloc_name( ecl_kw_get_data_type(target_kw) )); } } @@ -2285,7 +2285,7 @@ void ecl_kw_inplace_abs( ecl_kw_type * kw ) { ecl_kw_inplace_abs_int( kw ); break; default: - util_abort("%s: inplace abs not implemented for type:%s \n",__func__ , ecl_util_get_type_name( type )); + util_abort("%s: inplace abs not implemented for type:%s \n",__func__ , ecl_type_alloc_name( ecl_kw_get_data_type(kw) )); } } @@ -2322,7 +2322,7 @@ void ecl_kw_inplace_mul( ecl_kw_type * target_kw , const ecl_kw_type * mul_kw) { ecl_kw_inplace_mul_int( target_kw , mul_kw ); break; default: - util_abort("%s: inplace mul not implemented for type:%s \n",__func__ , ecl_util_get_type_name( type )); + util_abort("%s: inplace mul not implemented for type:%s \n",__func__ , ecl_type_alloc_name( ecl_kw_get_data_type(target_kw) )); } } @@ -2362,7 +2362,7 @@ void ecl_kw_inplace_mul_indexed( ecl_kw_type * target_kw , const int_vector_type ecl_kw_inplace_mul_indexed_int( target_kw , index_set , mul_kw ); break; default: - util_abort("%s: inplace mul not implemented for type:%s \n",__func__ , ecl_util_get_type_name( type )); + util_abort("%s: inplace mul not implemented for type:%s \n",__func__ , ecl_type_alloc_name( ecl_kw_get_data_type(target_kw) )); } } @@ -2400,7 +2400,7 @@ void ecl_kw_inplace_div( ecl_kw_type * target_kw , const ecl_kw_type * div_kw) { ecl_kw_inplace_div_int( target_kw , div_kw ); break; default: - util_abort("%s: inplace div not implemented for type:%s \n",__func__ , ecl_util_get_type_name( type )); + util_abort("%s: inplace div not implemented for type:%s \n",__func__ , ecl_type_alloc_name( ecl_kw_get_data_type(target_kw) )); } } @@ -2441,7 +2441,7 @@ void ecl_kw_inplace_div_indexed( ecl_kw_type * target_kw , const int_vector_type ecl_kw_inplace_div_indexed_int( target_kw , index_set , div_kw ); break; default: - util_abort("%s: inplace div not implemented for type:%s \n",__func__ , ecl_util_get_type_name( type )); + util_abort("%s: inplace div not implemented for type:%s \n",__func__ , ecl_type_alloc_name( ecl_kw_get_data_type(target_kw) )); } } @@ -2496,7 +2496,7 @@ void ecl_kw_inplace_update_file(const ecl_kw_type * ecl_kw , const char * filena ecl_kw_fread_header(file_kw , fortio); fortio_fseek( fortio , current_pos , SEEK_SET ); - if (!((file_kw->size == ecl_kw->size) && (file_kw->ecl_type == ecl_kw->ecl_type))) + if (!ecl_kw_size_and_type_equal(ecl_kw, file_kw)) util_abort("%s: header mismatch when trying to update:%s in %s \n",__func__ , ecl_kw_get_header8(ecl_kw) , filename); ecl_kw_free(file_kw); } @@ -2544,14 +2544,14 @@ bool ecl_kw_is_kw_file(fortio_type * fortio) { int i; \ for (i=1; i < ecl_kw_get_size(ecl_kw); i++) \ util_update_ ## type ## _max_min(data[i] , &max , &min); \ - memcpy(_max , &max , ecl_kw->sizeof_ctype); \ - memcpy(_min , &min , ecl_kw->sizeof_ctype); \ + memcpy(_max , &max , ecl_kw_get_sizeof_ctype(ecl_kw)); \ + memcpy(_min , &min , ecl_kw_get_sizeof_ctype(ecl_kw)); \ } void ecl_kw_max_min(const ecl_kw_type * ecl_kw , void * _max , void *_min) { - switch (ecl_kw->ecl_type) { + switch (ecl_kw_get_type(ecl_kw)) { case(ECL_FLOAT_TYPE): KW_MAX_MIN(float); break; @@ -2609,20 +2609,20 @@ ECL_KW_MIN( double ) -#define KW_SUM(type) \ -{ \ - type * data = ecl_kw_get_data_ref(ecl_kw); \ - type sum = 0; \ - int i; \ - for (i=0; i < ecl_kw_get_size(ecl_kw); i++) \ - sum += data[i]; \ - memcpy(_sum , &sum , ecl_kw->sizeof_ctype); \ +#define KW_SUM(type) \ +{ \ + type * data = ecl_kw_get_data_ref(ecl_kw); \ + type sum = 0; \ + int i; \ + for (i=0; i < ecl_kw_get_size(ecl_kw); i++) \ + sum += data[i]; \ + memcpy(_sum , &sum , ecl_kw_get_sizeof_ctype(ecl_kw)); \ } void ecl_kw_element_sum(const ecl_kw_type * ecl_kw , void * _sum) { - switch (ecl_kw->ecl_type) { + switch (ecl_kw_get_type(ecl_kw)) { case(ECL_FLOAT_TYPE): KW_SUM(float); break; @@ -2644,18 +2644,18 @@ double ecl_kw_element_sum_float( const ecl_kw_type * ecl_kw ) { double double_sum; void * sum_ptr = NULL; - if (ecl_kw->ecl_type == ECL_DOUBLE_TYPE) + if (ecl_type_is_double(ecl_kw->data_type)) sum_ptr = &double_sum; - else if (ecl_kw->ecl_type == ECL_FLOAT_TYPE) + else if (ecl_type_is_float(ecl_kw->data_type)) sum_ptr = &float_sum; else util_abort("%s: invalid type: \n",__func__); ecl_kw_element_sum( ecl_kw , sum_ptr ); - if (ecl_kw->ecl_type == ECL_DOUBLE_TYPE) + if (ecl_type_is_double(ecl_kw->data_type)) return double_sum; - else if (ecl_kw->ecl_type == ECL_FLOAT_TYPE) + else if (ecl_type_is_float(ecl_kw->data_type)) return float_sum; else return 0; @@ -2697,24 +2697,24 @@ static void ecl_kw_fprintf_data_bool( const ecl_kw_type * ecl_kw , const char * } -static void ecl_kw_fprintf_data_char( const ecl_kw_type * ecl_kw , const char * fmt , FILE * stream) { +static void ecl_kw_fprintf_data_string( const ecl_kw_type * ecl_kw , const char * fmt , FILE * stream) { int i; for (i=0; i < ecl_kw->size; i++) - fprintf(stream , fmt , &ecl_kw->data[ i * ecl_kw->sizeof_ctype]); + fprintf(stream , fmt , &ecl_kw->data[ i * ecl_kw_get_sizeof_ctype(ecl_kw)]); } void ecl_kw_fprintf_data( const ecl_kw_type * ecl_kw , const char * fmt , FILE * stream) { - if (ecl_kw->ecl_type == ECL_DOUBLE_TYPE) + if (ecl_type_is_double(ecl_kw->data_type)) ecl_kw_fprintf_data_double( ecl_kw , fmt , stream ); - else if (ecl_kw->ecl_type == ECL_FLOAT_TYPE) + else if (ecl_type_is_float(ecl_kw->data_type)) ecl_kw_fprintf_data_float( ecl_kw , fmt , stream ); - else if (ecl_kw->ecl_type == ECL_INT_TYPE) + else if (ecl_type_is_int(ecl_kw->data_type)) ecl_kw_fprintf_data_int( ecl_kw , fmt , stream ); - else if (ecl_kw->ecl_type == ECL_BOOL_TYPE) + else if (ecl_type_is_bool(ecl_kw->data_type)) ecl_kw_fprintf_data_bool( ecl_kw , fmt , stream ); - else if (ecl_kw->ecl_type == ECL_CHAR_TYPE) - ecl_kw_fprintf_data_char( ecl_kw , fmt , stream ); + else if (ecl_type_is_char(ecl_kw->data_type) || ecl_type_is_string(ecl_kw->data_type)) + ecl_kw_fprintf_data_string( ecl_kw , fmt , stream ); } @@ -2727,8 +2727,8 @@ static bool ecl_kw_elm_equal_numeric__( const ecl_kw_type * ecl_kw1 , const ecl_ static bool ecl_kw_elm_equal__( const ecl_kw_type * ecl_kw1 , const ecl_kw_type * ecl_kw2 , int offset) { - size_t data_offset = ecl_kw1->sizeof_ctype * offset; - int cmp = memcmp( &ecl_kw1->data[ data_offset ] , &ecl_kw2->data[ data_offset ] , ecl_kw1->sizeof_ctype); + size_t data_offset = ecl_kw_get_sizeof_ctype(ecl_kw1) * offset; + int cmp = memcmp( &ecl_kw1->data[ data_offset ] , &ecl_kw2->data[ data_offset ] , ecl_kw_get_sizeof_ctype(ecl_kw1)); if (cmp == 0) return true; else @@ -2767,5 +2767,4 @@ int ecl_kw_first_different( const ecl_kw_type * ecl_kw1 , const ecl_kw_type * ec } } - #include "ecl_kw_functions.c" diff --git a/ThirdParty/Ert/libecl/src/ecl_kw_grdecl.c b/ThirdParty/Ert/libecl/src/ecl_kw_grdecl.c index 42fb0711fc..bf44d6cff3 100644 --- a/ThirdParty/Ert/libecl/src/ecl_kw_grdecl.c +++ b/ThirdParty/Ert/libecl/src/ecl_kw_grdecl.c @@ -22,6 +22,7 @@ #include #include +#include #include @@ -41,7 +42,7 @@ formatted numbers it is in general impossible to determine whether the underlying datatype should be integer, float or double. Therefor all the file-reading routines here expect an - ecl_type_enum variable as input. + ecl_data_type as input. 2. The files can have comment sections; even in the data block. @@ -333,13 +334,13 @@ static void iset_range( char * data , int data_offset , int sizeof_ctype , void Observe that no-spaces-are-allowed-around-the-* */ -static char * fscanf_alloc_grdecl_data( const char * header , bool strict , ecl_type_enum ecl_type , int * kw_size , FILE * stream ) { +static char * fscanf_alloc_grdecl_data( const char * header , bool strict , ecl_data_type data_type , int * kw_size , FILE * stream ) { char newline = '\n'; bool atEOF = false; int init_size = 32; int buffer_size = 64; int data_index = 0; - int sizeof_ctype = ecl_util_get_sizeof_ctype( ecl_type ); + int sizeof_ctype = ecl_type_get_sizeof_ctype( data_type ); int data_size = init_size; char * buffer = util_calloc( (buffer_size + 1) , sizeof * buffer ); char * data = util_calloc( sizeof_ctype * data_size , sizeof * data ); @@ -369,7 +370,7 @@ static char * fscanf_alloc_grdecl_data( const char * header , bool strict , ecl_ void * value_ptr = NULL; bool char_input = false; - if (ecl_type == ECL_INT_TYPE) { + if (ecl_type_is_int(data_type)) { int value; if (sscanf(buffer , "%d*%d" , &multiplier , &value) == 2) @@ -383,7 +384,7 @@ static char * fscanf_alloc_grdecl_data( const char * header , bool strict , ecl_ } value_ptr = &value; - } else if (ecl_type == ECL_FLOAT_TYPE) { + } else if (ecl_type_is_float(data_type)) { float value; if (sscanf(buffer , "%d*%g" , &multiplier , &value) == 2) @@ -397,7 +398,7 @@ static char * fscanf_alloc_grdecl_data( const char * header , bool strict , ecl_ } value_ptr = &value; - } else if (ecl_type == ECL_DOUBLE_TYPE) { + } else if (ecl_type_is_double(data_type)) { double value; if (sscanf(buffer , "%d*%lg" , &multiplier , &value) == 2) @@ -412,7 +413,7 @@ static char * fscanf_alloc_grdecl_data( const char * header , bool strict , ecl_ value_ptr = &value; } else - util_abort("%s: sorry type:%s not supported \n",__func__ , ecl_util_get_type_name(ecl_type)); + util_abort("%s: sorry type:%s not supported \n",__func__ , ecl_type_alloc_name(data_type)); /* Removing this warning on user request: @@ -515,9 +516,8 @@ static char * fscanf_alloc_grdecl_data( const char * header , bool strict , ecl_ if there is something wrong it can be difficult to detect. */ - -static ecl_kw_type * __ecl_kw_fscanf_alloc_grdecl__(FILE * stream , const char * header , bool strict , int size , ecl_type_enum ecl_type) { - if (! (ecl_type == ECL_FLOAT_TYPE || ecl_type == ECL_INT_TYPE || ecl_type == ECL_DOUBLE_TYPE)) +static ecl_kw_type * __ecl_kw_fscanf_alloc_grdecl__(FILE * stream , const char * header , bool strict , int size , ecl_data_type data_type) { + if (!ecl_type_is_numeric(data_type)) util_abort("%s: sorry only types FLOAT, INT and DOUBLE supported\n",__func__); if (header != NULL) @@ -528,7 +528,7 @@ static ecl_kw_type * __ecl_kw_fscanf_alloc_grdecl__(FILE * stream , const char * char file_header[9]; if (fscanf(stream , "%s" , file_header) == 1) { int kw_size; - char * data = fscanf_alloc_grdecl_data( file_header , strict , ecl_type , &kw_size , stream ); + char * data = fscanf_alloc_grdecl_data( file_header , strict , data_type , &kw_size , stream ); // Verify size if (size > 0) @@ -539,7 +539,7 @@ static ecl_kw_type * __ecl_kw_fscanf_alloc_grdecl__(FILE * stream , const char * } { - ecl_kw_type * ecl_kw = ecl_kw_alloc_new( file_header , kw_size , ecl_type , NULL ); + ecl_kw_type * ecl_kw = ecl_kw_alloc_new( file_header , kw_size , data_type , NULL ); ecl_kw_set_data_ptr( ecl_kw , data ); return ecl_kw; } @@ -569,14 +569,14 @@ static ecl_kw_type * __ecl_kw_fscanf_alloc_grdecl__(FILE * stream , const char * /*****************************************************************/ -ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_data__(FILE * stream , bool strict , int size , ecl_type_enum ecl_type) { - return __ecl_kw_fscanf_alloc_grdecl__( stream , NULL , strict , size , ecl_type ); +ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_data__(FILE * stream , bool strict , int size , ecl_data_type data_type) { + return __ecl_kw_fscanf_alloc_grdecl__( stream , NULL , strict , size , data_type ); } -ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_data(FILE * stream , int size , ecl_type_enum ecl_type) { +ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_data(FILE * stream , int size , ecl_data_type data_type) { bool strict = true; - return ecl_kw_fscanf_alloc_grdecl_data__( stream , strict , size , ecl_type ); + return ecl_kw_fscanf_alloc_grdecl_data__( stream , strict , size , data_type ); } /*****************************************************************/ @@ -591,13 +591,13 @@ ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_data(FILE * stream , int size , ecl_typ the whole keyword is loaded, and then return. */ -ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_dynamic__( FILE * stream , const char * kw , bool strict , ecl_type_enum ecl_type) { - return __ecl_kw_fscanf_alloc_grdecl__( stream , kw , strict , 0 , ecl_type ); +ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_dynamic__( FILE * stream , const char * kw , bool strict , ecl_data_type data_type) { + return __ecl_kw_fscanf_alloc_grdecl__( stream , kw , strict , 0 , data_type ); } -ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_dynamic( FILE * stream , const char * kw , ecl_type_enum ecl_type) { +ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_dynamic( FILE * stream , const char * kw , ecl_data_type data_type) { bool strict = true; - return ecl_kw_fscanf_alloc_grdecl_dynamic__( stream , kw , strict , ecl_type ); + return ecl_kw_fscanf_alloc_grdecl_dynamic__( stream , kw , strict , data_type ); } /*****************************************************************/ @@ -615,14 +615,14 @@ ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_dynamic( FILE * stream , const char * k size == 0. */ -ecl_kw_type * ecl_kw_fscanf_alloc_grdecl__( FILE * stream , const char * kw , bool strict , int size , ecl_type_enum ecl_type) { - return __ecl_kw_fscanf_alloc_grdecl__( stream , kw , strict , size , ecl_type ); +ecl_kw_type * ecl_kw_fscanf_alloc_grdecl__( FILE * stream , const char * kw , bool strict , int size , ecl_data_type data_type) { + return __ecl_kw_fscanf_alloc_grdecl__( stream , kw , strict , size , data_type ); } -ecl_kw_type * ecl_kw_fscanf_alloc_grdecl( FILE * stream , const char * kw , int size , ecl_type_enum ecl_type) { +ecl_kw_type * ecl_kw_fscanf_alloc_grdecl( FILE * stream , const char * kw , int size , ecl_data_type data_type) { bool strict = true; - return ecl_kw_fscanf_alloc_grdecl__( stream , kw , strict , size , ecl_type ); + return ecl_kw_fscanf_alloc_grdecl__( stream , kw , strict , size , data_type ); } /*****************************************************************/ @@ -636,14 +636,14 @@ ecl_kw_type * ecl_kw_fscanf_alloc_grdecl( FILE * stream , const char * kw , int input file is well formatted. */ -ecl_kw_type * ecl_kw_fscanf_alloc_current_grdecl__( FILE * stream , bool strict , ecl_type_enum ecl_type) { - return __ecl_kw_fscanf_alloc_grdecl__( stream , NULL , strict , 0 , ecl_type ); +ecl_kw_type * ecl_kw_fscanf_alloc_current_grdecl__( FILE * stream , bool strict , ecl_data_type data_type) { + return __ecl_kw_fscanf_alloc_grdecl__( stream , NULL , strict , 0 , data_type ); } -ecl_kw_type * ecl_kw_fscanf_alloc_current_grdecl( FILE * stream , ecl_type_enum ecl_type) { +ecl_kw_type * ecl_kw_fscanf_alloc_current_grdecl( FILE * stream , ecl_data_type data_type) { bool strict = true; - return ecl_kw_fscanf_alloc_current_grdecl__( stream , strict , ecl_type ); + return ecl_kw_fscanf_alloc_current_grdecl__( stream , strict , data_type ); } @@ -676,4 +676,3 @@ void ecl_kw_fprintf_grdecl__(const ecl_kw_type * ecl_kw , const char * special_h void ecl_kw_fprintf_grdecl(const ecl_kw_type * ecl_kw , FILE * stream) { ecl_kw_fprintf_grdecl__(ecl_kw , NULL , stream ); } - diff --git a/ThirdParty/Ert/libecl/src/ecl_nnc_geometry.c b/ThirdParty/Ert/libecl/src/ecl_nnc_geometry.c new file mode 100644 index 0000000000..378112cced --- /dev/null +++ b/ThirdParty/Ert/libecl/src/ecl_nnc_geometry.c @@ -0,0 +1,126 @@ +/* + Copyright (c) 2017 statoil asa, norway. + + The file 'ecl_nnc_geometry.c' is part of ert - ensemble based reservoir tool. + + ERT 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. + + ERT 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 + for more details. +*/ + +#include + +#include + +#define ECL_NNC_GEOMETRY_TYPE_ID 6124343 + +struct ecl_nnc_geometry_struct { + UTIL_TYPE_ID_DECLARATION; + struct_vector_type * data; +}; + + +UTIL_IS_INSTANCE_FUNCTION( ecl_nnc_geometry, ECL_NNC_GEOMETRY_TYPE_ID ) + + +int ecl_nnc_geometry_size( const ecl_nnc_geometry_type * nnc_geo ) { + return struct_vector_get_size( nnc_geo->data ); +} + +/* + Will go through the grid and add links for all NNC connections in + the grid. The endpoints of an NNC are defined by the tuple: + + (grid_nr, global_index), + + and a NNC link is defined by a pair of such connections, linking + cells (grid_nr1, global_index1) and (grid_nr2, global_index2). +*/ + +static void ecl_nnc_geometry_add_pairs( const ecl_nnc_geometry_type * nnc_geo , const ecl_grid_type * grid ) { + int lgr_nr1 = ecl_grid_get_lgr_nr( grid ); + const ecl_grid_type * global_grid = ecl_grid_get_global_grid( grid ); + + if (!global_grid) + global_grid = grid; + + + for (int global_index1 = 0; global_index1 < ecl_grid_get_global_size( grid ); global_index1++) { + const nnc_info_type * nnc_info = ecl_grid_get_cell_nnc_info1( grid , global_index1 ); + if (!nnc_info) + continue; + + for (int lgr_index2 = 0; lgr_index2 < nnc_info_get_size( nnc_info ); lgr_index2++) { + const nnc_vector_type * nnc_vector = nnc_info_iget_vector( nnc_info , lgr_index2 ); + const int_vector_type * grid2_index_list = nnc_vector_get_grid_index_list( nnc_vector ); + const int_vector_type * nnc_index_list = nnc_vector_get_nnc_index_list( nnc_vector ); + int lgr_nr2 = nnc_vector_get_lgr_nr( nnc_vector ); + + for (int index2 = 0; index2 < nnc_vector_get_size( nnc_vector ); index2++) { + ecl_nnc_pair_type pair = {.grid_nr1 = lgr_nr1, + .global_index1 = global_index1, + .grid_nr2 = lgr_nr2, + .global_index2 = int_vector_iget( grid2_index_list , index2 ), + .input_index = int_vector_iget( nnc_index_list, index2 )}; + + struct_vector_append( nnc_geo->data , &pair); + } + } + } +} + + +static int ecl_nnc_cmp(const void * _nnc1 , const void * _nnc2) { + const ecl_nnc_pair_type * nnc1 = (const ecl_nnc_pair_type * ) _nnc1; + const ecl_nnc_pair_type * nnc2 = (const ecl_nnc_pair_type * ) _nnc2; + + if (nnc1->grid_nr1 != nnc2->grid_nr1) + return nnc1->grid_nr1 - nnc2->grid_nr1; + + if (nnc1->grid_nr2 != nnc2->grid_nr2) + return nnc1->grid_nr2 - nnc2->grid_nr2; + + if (nnc1->global_index1 != nnc2->global_index1) + return nnc1->global_index1 - nnc2->global_index1; + + if (nnc1->global_index2 != nnc2->global_index2) + return nnc1->global_index2 - nnc2->global_index2; + + return 0; +} + + + +ecl_nnc_geometry_type * ecl_nnc_geometry_alloc( const ecl_grid_type * grid ) { + ecl_nnc_geometry_type * nnc_geo = util_malloc( sizeof * nnc_geo ); + UTIL_TYPE_ID_INIT( nnc_geo , ECL_NNC_GEOMETRY_TYPE_ID ); + nnc_geo->data = struct_vector_alloc( sizeof( struct ecl_nnc_pair_struct )); + + ecl_nnc_geometry_add_pairs( nnc_geo , grid ); + for (int lgr_index = 0; lgr_index < ecl_grid_get_num_lgr(grid); lgr_index++) { + ecl_grid_type * igrid = ecl_grid_iget_lgr( grid , lgr_index ); + ecl_nnc_geometry_add_pairs( nnc_geo, igrid ); + } + struct_vector_sort( nnc_geo->data , ecl_nnc_cmp ); + return nnc_geo; +} + + +void ecl_nnc_geometry_free( ecl_nnc_geometry_type * nnc_geo) { + struct_vector_free( nnc_geo->data ); + free( nnc_geo ); +} + + +const ecl_nnc_pair_type * ecl_nnc_geometry_iget( const ecl_nnc_geometry_type * nnc_geo , int index) { + return struct_vector_iget_ptr( nnc_geo->data , index ); + +} diff --git a/ThirdParty/Ert/libecl/src/ecl_region.c b/ThirdParty/Ert/libecl/src/ecl_region.c index 88e2b8372e..ca1a2faeb7 100644 --- a/ThirdParty/Ert/libecl/src/ecl_region.c +++ b/ThirdParty/Ert/libecl/src/ecl_region.c @@ -306,7 +306,7 @@ void ecl_region_deselect_cell( ecl_region_type * region , int i , int j , int k) static void ecl_region_select_equal__( ecl_region_type * region , const ecl_kw_type * ecl_kw, int value , bool select) { bool global_kw; ecl_region_assert_kw( region , ecl_kw , &global_kw); - if (ecl_kw_get_type( ecl_kw ) != ECL_INT_TYPE) + if (!ecl_type_is_int(ecl_kw_get_data_type( ecl_kw ))) util_abort("%s: sorry - select by equality is only supported for integer keywords \n",__func__); { const int * kw_data = ecl_kw_get_int_ptr( ecl_kw ); @@ -344,7 +344,7 @@ void ecl_region_deselect_equal( ecl_region_type * region , const ecl_kw_type * e static void ecl_region_select_bool_equal__( ecl_region_type * region , const ecl_kw_type * ecl_kw, bool value , bool select) { bool global_kw; ecl_region_assert_kw( region , ecl_kw , &global_kw); - if (ecl_kw_get_type( ecl_kw ) != ECL_BOOL_TYPE) + if (!ecl_type_is_bool(ecl_kw_get_data_type( ecl_kw ))) util_abort("%s: sorry - select by equality is only supported for boolean keywords \n",__func__); { if (global_kw) { @@ -392,7 +392,7 @@ void ecl_region_deselect_false( ecl_region_type * region , const ecl_kw_type * e static void ecl_region_select_in_interval__( ecl_region_type * region , const ecl_kw_type * ecl_kw, float min_value , float max_value , bool select) { bool global_kw; ecl_region_assert_kw( region , ecl_kw , &global_kw); - if (ecl_kw_get_type( ecl_kw ) != ECL_FLOAT_TYPE) + if (!ecl_type_is_float(ecl_kw_get_data_type( ecl_kw ))) util_abort("%s: sorry - select by in_interval is only supported for float keywords \n",__func__); { const float * kw_data = ecl_kw_get_float_ptr( ecl_kw ); @@ -439,13 +439,13 @@ void ecl_region_deselect_in_interval( ecl_region_type * region , const ecl_kw_ty */ static void ecl_region_select_with_limit__( ecl_region_type * region , const ecl_kw_type * ecl_kw, float limit , bool select_less , bool select) { bool global_kw; - ecl_type_enum ecl_type = ecl_kw_get_type( ecl_kw ); + ecl_data_type data_type = ecl_kw_get_data_type( ecl_kw ); ecl_region_assert_kw( region , ecl_kw , &global_kw); - if (!((ecl_type == ECL_FLOAT_TYPE) || (ecl_type == ECL_INT_TYPE) || (ecl_type == ECL_DOUBLE_TYPE))) + if (!ecl_type_is_numeric(data_type)) util_abort("%s: sorry - select by in_interval is only supported for float and integer keywords \n",__func__); { - if (ecl_type == ECL_FLOAT_TYPE) { + if (ecl_type_is_float(data_type)) { const float * kw_data = ecl_kw_get_float_ptr( ecl_kw ); float float_limit = limit; if (global_kw) { @@ -475,7 +475,7 @@ static void ecl_region_select_with_limit__( ecl_region_type * region , const ecl } } } - } else if (ecl_type == ECL_INT_TYPE) { + } else if (ecl_type_is_int(data_type)) { const int * kw_data = ecl_kw_get_int_ptr( ecl_kw ); int int_limit = (int) limit; if (global_kw) { @@ -505,7 +505,7 @@ static void ecl_region_select_with_limit__( ecl_region_type * region , const ecl } } } - } else if (ecl_type == ECL_DOUBLE_TYPE) { + } else if (ecl_type_is_double(data_type)) { const double * kw_data = ecl_kw_get_double_ptr( ecl_kw ); double double_limit = (double) limit; if (global_kw) { @@ -566,11 +566,10 @@ void ecl_region_deselect_larger( ecl_region_type * ecl_region , const ecl_kw_typ static void ecl_region_cmp_select__( ecl_region_type * region , const ecl_kw_type * kw1 , const ecl_kw_type * kw2 , bool select_less , bool select) { bool global_kw; ecl_region_assert_kw( region , kw1 , &global_kw); - if (ecl_kw_get_type( kw1 ) != ECL_FLOAT_TYPE) + if (!ecl_type_is_float(ecl_kw_get_data_type( kw1 ))) util_abort("%s: sorry - select by cmp() is only supported for float keywords \n",__func__); { - if ((ecl_kw_get_size( kw1 ) == ecl_kw_get_size( kw2 )) && - (ecl_kw_get_type( kw1 ) == ecl_kw_get_type( kw2 ))) { + if (ecl_kw_size_and_type_equal(kw1, kw2)) { const float * kw1_data = ecl_kw_get_float_ptr( kw1 ); const float * kw2_data = ecl_kw_get_float_ptr( kw2 ); diff --git a/ThirdParty/Ert/libecl/src/ecl_rft_node.c b/ThirdParty/Ert/libecl/src/ecl_rft_node.c index 5ab5508b3e..72cf1b33d2 100644 --- a/ThirdParty/Ert/libecl/src/ecl_rft_node.c +++ b/ThirdParty/Ert/libecl/src/ecl_rft_node.c @@ -34,6 +34,7 @@ #include #include #include +#include /** @@ -537,14 +538,14 @@ void ecl_rft_node_fwrite(const ecl_rft_node_type * rft_node, fortio_type * forti util_abort("%s: sorry - only writing of simple RFT is currently implemented",__func__); { - ecl_kw_type * time = ecl_kw_alloc(TIME_KW, 1, ECL_FLOAT_TYPE); + ecl_kw_type * time = ecl_kw_alloc(TIME_KW, 1, ECL_FLOAT); ecl_kw_iset_float(time, 0, ecl_rft_node_get_days(rft_node)); ecl_kw_fwrite(time, fortio); ecl_kw_free(time); } { - ecl_kw_type * datevalue = ecl_kw_alloc(DATE_KW, 3, ECL_INT_TYPE); + ecl_kw_type * datevalue = ecl_kw_alloc(DATE_KW, 3, ECL_INT); time_t date = ecl_rft_node_get_date(rft_node); int day; int month; @@ -558,7 +559,7 @@ void ecl_rft_node_fwrite(const ecl_rft_node_type * rft_node, fortio_type * forti } { - ecl_kw_type * welletc = ecl_kw_alloc(WELLETC_KW, 16, ECL_CHAR_TYPE); + ecl_kw_type * welletc = ecl_kw_alloc(WELLETC_KW, 16, ECL_CHAR); ecl_rft_enum type = ecl_rft_node_get_type(rft_node); ecl_kw_iset_string8(welletc, 1, ecl_rft_node_get_well_name(rft_node)); @@ -577,14 +578,14 @@ void ecl_rft_node_fwrite(const ecl_rft_node_type * rft_node, fortio_type * forti { int size_cells = ecl_rft_node_get_size(rft_node); - ecl_kw_type * conipos = ecl_kw_alloc(CONIPOS_KW, size_cells, ECL_INT_TYPE); - ecl_kw_type * conjpos = ecl_kw_alloc(CONJPOS_KW, size_cells, ECL_INT_TYPE); - ecl_kw_type * conkpos = ecl_kw_alloc(CONKPOS_KW, size_cells, ECL_INT_TYPE); - ecl_kw_type * hostgrid = ecl_kw_alloc(HOSTGRID_KW, size_cells, ECL_CHAR_TYPE); - ecl_kw_type * depth = ecl_kw_alloc(DEPTH_KW, size_cells, ECL_FLOAT_TYPE); - ecl_kw_type * pressure = ecl_kw_alloc(PRESSURE_KW, size_cells, ECL_FLOAT_TYPE); - ecl_kw_type * swat = ecl_kw_alloc(SWAT_KW, size_cells, ECL_FLOAT_TYPE); - ecl_kw_type * sgas = ecl_kw_alloc(SGAS_KW, size_cells, ECL_FLOAT_TYPE); + ecl_kw_type * conipos = ecl_kw_alloc(CONIPOS_KW, size_cells, ECL_INT); + ecl_kw_type * conjpos = ecl_kw_alloc(CONJPOS_KW, size_cells, ECL_INT); + ecl_kw_type * conkpos = ecl_kw_alloc(CONKPOS_KW, size_cells, ECL_INT); + ecl_kw_type * hostgrid = ecl_kw_alloc(HOSTGRID_KW, size_cells, ECL_CHAR); + ecl_kw_type * depth = ecl_kw_alloc(DEPTH_KW, size_cells, ECL_FLOAT); + ecl_kw_type * pressure = ecl_kw_alloc(PRESSURE_KW, size_cells, ECL_FLOAT); + ecl_kw_type * swat = ecl_kw_alloc(SWAT_KW, size_cells, ECL_FLOAT); + ecl_kw_type * sgas = ecl_kw_alloc(SGAS_KW, size_cells, ECL_FLOAT); int i; for(i =0;i #include #include +#include struct ecl_rst_file_struct { fortio_type * fortio; @@ -101,7 +102,7 @@ ecl_rst_file_type * ecl_rst_file_open_write_seek( const char * filename , int re fortio_fseek( rst_file->fortio , 0 , SEEK_SET ); { - ecl_kw_type * work_kw = ecl_kw_alloc_new("WORK-KW" , 0 , ECL_INT_TYPE , NULL); + ecl_kw_type * work_kw = ecl_kw_alloc_new("WORK-KW" , 0 , ECL_INT, NULL); while (true) { offset_type current_offset = fortio_ftell( rst_file->fortio ); @@ -157,20 +158,20 @@ void ecl_rst_file_close( ecl_rst_file_type * rst_file ) { /*****************************************************************/ static void ecl_rst_file_fwrite_SEQNUM( ecl_rst_file_type * rst_file , int seqnum ) { - ecl_kw_type * seqnum_kw = ecl_kw_alloc( SEQNUM_KW , 1 , ECL_INT_TYPE ); + ecl_kw_type * seqnum_kw = ecl_kw_alloc( SEQNUM_KW , 1 , ECL_INT ); ecl_kw_iset_int( seqnum_kw , 0 , seqnum ); ecl_kw_fwrite( seqnum_kw , rst_file->fortio ); ecl_kw_free( seqnum_kw ); } void ecl_rst_file_start_solution( ecl_rst_file_type * rst_file ) { - ecl_kw_type * startsol_kw = ecl_kw_alloc( STARTSOL_KW , 0 , ECL_MESS_TYPE ); + ecl_kw_type * startsol_kw = ecl_kw_alloc( STARTSOL_KW , 0 , ECL_MESS ); ecl_kw_fwrite( startsol_kw , rst_file->fortio ); ecl_kw_free( startsol_kw ); } void ecl_rst_file_end_solution( ecl_rst_file_type * rst_file ) { - ecl_kw_type * endsol_kw = ecl_kw_alloc( ENDSOL_KW , 0 , ECL_MESS_TYPE ); + ecl_kw_type * endsol_kw = ecl_kw_alloc( ENDSOL_KW , 0 , ECL_MESS ); ecl_kw_fwrite( endsol_kw , rst_file->fortio ); ecl_kw_free( endsol_kw ); } @@ -180,7 +181,7 @@ void ecl_rst_file_end_solution( ecl_rst_file_type * rst_file ) { static ecl_kw_type * ecl_rst_file_alloc_INTEHEAD( ecl_rst_file_type * rst_file, ecl_rsthead_type * rsthead, int simulator ) { - ecl_kw_type * intehead_kw = ecl_kw_alloc( INTEHEAD_KW , INTEHEAD_RESTART_SIZE , ECL_INT_TYPE ); + ecl_kw_type * intehead_kw = ecl_kw_alloc( INTEHEAD_KW , INTEHEAD_RESTART_SIZE , ECL_INT ); ecl_kw_scalar_set_int( intehead_kw , 0 ); ecl_kw_iset_int( intehead_kw , INTEHEAD_UNIT_INDEX , rsthead->unit_system ); @@ -230,7 +231,7 @@ static ecl_kw_type * ecl_rst_file_alloc_LOGIHEAD( int simulator ) { bool radial_grid_ECLIPSE100 = false; bool radial_grid_ECLIPSE300 = false; - ecl_kw_type * logihead_kw = ecl_kw_alloc( LOGIHEAD_KW , LOGIHEAD_RESTART_SIZE , ECL_BOOL_TYPE ); + ecl_kw_type * logihead_kw = ecl_kw_alloc( LOGIHEAD_KW , LOGIHEAD_RESTART_SIZE , ECL_BOOL ); ecl_kw_scalar_set_bool( logihead_kw , false ); @@ -245,7 +246,7 @@ static ecl_kw_type * ecl_rst_file_alloc_LOGIHEAD( int simulator ) { static ecl_kw_type * ecl_rst_file_alloc_DOUBHEAD( ecl_rst_file_type * rst_file , double days) { - ecl_kw_type * doubhead_kw = ecl_kw_alloc( DOUBHEAD_KW , DOUBHEAD_RESTART_SIZE , ECL_DOUBLE_TYPE ); + ecl_kw_type * doubhead_kw = ecl_kw_alloc( DOUBHEAD_KW , DOUBHEAD_RESTART_SIZE , ECL_DOUBLE ); ecl_kw_scalar_set_double( doubhead_kw , 0); ecl_kw_iset_double( doubhead_kw , DOUBHEAD_DAYS_INDEX , days ); diff --git a/ThirdParty/Ert/libecl/src/ecl_rsthead.c b/ThirdParty/Ert/libecl/src/ecl_rsthead.c index e382cc18de..e515df45fd 100644 --- a/ThirdParty/Ert/libecl/src/ecl_rsthead.c +++ b/ThirdParty/Ert/libecl/src/ecl_rsthead.c @@ -88,8 +88,8 @@ ecl_rsthead_type * ecl_rsthead_alloc_from_kw( int report_step , const ecl_kw_typ // The only derived quantity rsthead->sim_time = rsthead_date( rsthead->day , rsthead->month , rsthead->year ); } - if (doubhead_kw) - rsthead->sim_days = ecl_kw_iget_double( doubhead_kw , DOUBHEAD_DAYS_INDEX ); + if (doubhead_kw) + rsthead->sim_days = ecl_kw_iget_double( doubhead_kw , DOUBHEAD_DAYS_INDEX ); if (logihead_kw) rsthead->dualp = ecl_kw_iget_bool( logihead_kw , LOGIHEAD_DUALP_INDEX); @@ -116,8 +116,8 @@ ecl_rsthead_type * ecl_rsthead_alloc( const ecl_file_view_type * rst_view, int r if (ecl_file_view_has_kw(rst_view, LOGIHEAD_KW)) logihead_kw = ecl_file_view_iget_named_kw( rst_view , LOGIHEAD_KW , 0); - if (ecl_file_view_has_kw(rst_view, DOUBHEAD_KW)) - doubhead_kw = ecl_file_view_iget_named_kw(rst_view, DOUBHEAD_KW, 0); + if (ecl_file_view_has_kw(rst_view, DOUBHEAD_KW)) + doubhead_kw = ecl_file_view_iget_named_kw(rst_view, DOUBHEAD_KW, 0); if (ecl_file_view_has_kw( rst_view , SEQNUM_KW)) { const ecl_kw_type * seqnum_kw = ecl_file_view_iget_named_kw( rst_view , SEQNUM_KW , 0); @@ -233,3 +233,13 @@ void ecl_rsthead_fprintf_struct( const ecl_rsthead_type * header , FILE * stream void ecl_rsthead_free( ecl_rsthead_type * rsthead ) { free( rsthead ); } + + +int ecl_rsthead_get_nxconz( const ecl_rsthead_type * rsthead ) { + return rsthead->nxconz; +} + + +int ecl_rsthead_get_ncwmax( const ecl_rsthead_type * rsthead ) { + return rsthead->ncwmax; +} diff --git a/ThirdParty/Ert/libecl/src/ecl_smspec.c b/ThirdParty/Ert/libecl/src/ecl_smspec.c index ed6490484a..07e86b53d6 100644 --- a/ThirdParty/Ert/libecl/src/ecl_smspec.c +++ b/ThirdParty/Ert/libecl/src/ecl_smspec.c @@ -35,6 +35,7 @@ #include #include #include +#include #ifdef HAVE_FNMATCH #include @@ -233,11 +234,14 @@ static const char* special_vars[] = {"NEWTON", this simple list. */ -static const char* smspec_required_keywords[] = {WGNAMES_KW, - KEYWORDS_KW, - STARTDAT_KW, - UNITS_KW, - DIMENS_KW}; +static const size_t num_req_keywords = 5; +static const char* smspec_required_keywords[] = { + WGNAMES_KW, + KEYWORDS_KW, + STARTDAT_KW, + UNITS_KW, + DIMENS_KW + }; /*****************************************************************/ @@ -332,6 +336,21 @@ void ecl_smspec_lock( ecl_smspec_type * smspec ) { smspec->locked = true; } +/** + * Returns an ecl data type for which all names will fit. If the maximum name + * length is at most 8, an ECL_CHAR is returned and otherwise a large enough + * ECL_STRING. + */ +static ecl_data_type get_wgnames_type(const ecl_smspec_type * smspec) { + size_t max_len = 0; + for(int i = 0; i < ecl_smspec_num_nodes(smspec); ++i) { + const char * name = smspec_node_get_wgname(ecl_smspec_iget_node(smspec, i)); + if(name != NULL) + max_len = util_size_t_max(max_len, strlen(name)); + } + + return max_len <= 8 ? ECL_CHAR : ECL_STRING(max_len); +} // DIMENS // KEYWORDS @@ -344,7 +363,7 @@ void ecl_smspec_lock( ecl_smspec_type * smspec ) { static void ecl_smspec_fortio_fwrite( const ecl_smspec_type * smspec , fortio_type * fortio) { int num_nodes = ecl_smspec_num_nodes( smspec ); { - ecl_kw_type * restart_kw = ecl_kw_alloc( RESTART_KW , SUMMARY_RESTART_SIZE , ECL_CHAR_TYPE ); + ecl_kw_type * restart_kw = ecl_kw_alloc( RESTART_KW , SUMMARY_RESTART_SIZE , ECL_CHAR ); int i; for (i=0; i < SUMMARY_RESTART_SIZE; i++) ecl_kw_iset_string8( restart_kw , i , ""); @@ -353,7 +372,7 @@ static void ecl_smspec_fortio_fwrite( const ecl_smspec_type * smspec , fortio_ty ecl_kw_free( restart_kw ); } { - ecl_kw_type * dimens_kw = ecl_kw_alloc( DIMENS_KW , DIMENS_SIZE , ECL_INT_TYPE ); + ecl_kw_type * dimens_kw = ecl_kw_alloc( DIMENS_KW , DIMENS_SIZE , ECL_INT ); ecl_kw_iset_int( dimens_kw , DIMENS_SMSPEC_SIZE_INDEX , num_nodes ); ecl_kw_iset_int( dimens_kw , DIMENS_SMSPEC_NX_INDEX , smspec->grid_dims[0] ); ecl_kw_iset_int( dimens_kw , DIMENS_SMSPEC_NY_INDEX , smspec->grid_dims[1] ); @@ -369,13 +388,21 @@ static void ecl_smspec_fortio_fwrite( const ecl_smspec_type * smspec , fortio_ty { - ecl_kw_type * keywords_kw = ecl_kw_alloc( KEYWORDS_KW , num_nodes , ECL_CHAR_TYPE ); - ecl_kw_type * wgnames_kw = ecl_kw_alloc( WGNAMES_KW , num_nodes , ECL_CHAR_TYPE ); - ecl_kw_type * units_kw = ecl_kw_alloc( UNITS_KW , num_nodes , ECL_CHAR_TYPE ); + ecl_kw_type * keywords_kw = ecl_kw_alloc( KEYWORDS_KW , num_nodes , ECL_CHAR ); + ecl_kw_type * units_kw = ecl_kw_alloc( UNITS_KW , num_nodes , ECL_CHAR ); ecl_kw_type * nums_kw = NULL; + // If the names_type is an ECL_STRING we expect this to be an INTERSECT + // summary, otherwise an ECLIPSE summary. + ecl_data_type names_type = get_wgnames_type(smspec); + ecl_kw_type * wgnames_kw = ecl_kw_alloc( + ecl_type_is_char(names_type) ? WGNAMES_KW : NAMES_KW, + num_nodes, + names_type + ); + if (smspec->need_nums) - nums_kw = ecl_kw_alloc( NUMS_KW , num_nodes , ECL_INT_TYPE); + nums_kw = ecl_kw_alloc( NUMS_KW , num_nodes , ECL_INT); { int i; for (i=0; i < ecl_smspec_num_nodes( smspec ); i++) { @@ -402,7 +429,7 @@ static void ecl_smspec_fortio_fwrite( const ecl_smspec_type * smspec , fortio_ty if (smspec_node_get_var_type( smspec_node ) == ECL_SMSPEC_INVALID_VAR) { ecl_kw_iset_string8( keywords_kw , i , "WWCT" ); ecl_kw_iset_string8( units_kw , i , "????????"); - ecl_kw_iset_string8( wgnames_kw , i , DUMMY_WELL); + ecl_kw_iset_string_ptr( wgnames_kw , i , DUMMY_WELL); } else { ecl_kw_iset_string8( keywords_kw , i , smspec_node_get_keyword( smspec_node )); ecl_kw_iset_string8( units_kw , i , smspec_node_get_unit( smspec_node )); @@ -410,7 +437,7 @@ static void ecl_smspec_fortio_fwrite( const ecl_smspec_type * smspec , fortio_ty const char * wgname = DUMMY_WELL; if (smspec_node_get_wgname( smspec_node ) != NULL) wgname = smspec_node_get_wgname( smspec_node ); - ecl_kw_iset_string8( wgnames_kw , i , wgname); + ecl_kw_iset_string_ptr( wgnames_kw , i , wgname); } } @@ -435,7 +462,7 @@ static void ecl_smspec_fortio_fwrite( const ecl_smspec_type * smspec , fortio_ty } { - ecl_kw_type * startdat_kw = ecl_kw_alloc( STARTDAT_KW , STARTDAT_SIZE , ECL_INT_TYPE ); + ecl_kw_type * startdat_kw = ecl_kw_alloc( STARTDAT_KW , STARTDAT_SIZE , ECL_INT ); int day,month,year; ecl_util_set_date_values( smspec->sim_start_time , &day, &month , &year); @@ -957,7 +984,7 @@ bool ecl_smspec_equal( const ecl_smspec_type * self , const ecl_smspec_type * ot static void ecl_smspec_load_restart( ecl_smspec_type * ecl_smspec , const ecl_file_type * header ) { if (ecl_file_has_kw( header , RESTART_KW )) { - const ecl_kw_type * restart_kw = ecl_file_iget_kw( header , 0 ); + const ecl_kw_type * restart_kw = ecl_file_iget_named_kw(header, RESTART_KW , 0); char tmp_base[73]; /* To accomodate a maximum of 9 items which consist of 8 characters each. */ char * restart_base; int i; @@ -1057,16 +1084,25 @@ const int_vector_type * ecl_smspec_get_index_map( const ecl_smspec_type * smspec return smspec->index_map; } +/** + * This function is to support the NAMES alias for WGNAMES. If similar + * situations occur in the future, this is a sane starting point for general + * support. + */ +static const char * get_active_keyword_alias(ecl_file_type * header, const char * keyword) { + if (strcmp(keyword, WGNAMES_KW) == 0 || strcmp(keyword, NAMES_KW) == 0) + return ecl_file_has_kw(header, WGNAMES_KW) ? WGNAMES_KW : NAMES_KW; + + return keyword; +} + static bool ecl_smspec_check_header( ecl_file_type * header ) { bool OK = true; - int num_required = sizeof( smspec_required_keywords ) / sizeof( smspec_required_keywords[0] ); - int i; - - for (i=0; i < num_required; i++) { - if (!ecl_file_has_kw( header , smspec_required_keywords[i])) { - OK = false; - break; - } + for (int i=0; i < num_req_keywords && OK; i++) { + OK &= ecl_file_has_kw( + header, + get_active_keyword_alias(header, smspec_required_keywords[i]) + ); } return OK; @@ -1076,16 +1112,18 @@ static bool ecl_smspec_check_header( ecl_file_type * header ) { static bool ecl_smspec_fread_header(ecl_smspec_type * ecl_smspec, const char * header_file , bool include_restart) { ecl_file_type * header = ecl_file_open( header_file , 0); if (header && ecl_smspec_check_header( header )) { - ecl_kw_type *wells = ecl_file_iget_named_kw(header, WGNAMES_KW , 0); - ecl_kw_type *keywords = ecl_file_iget_named_kw(header, KEYWORDS_KW , 0); - ecl_kw_type *startdat = ecl_file_iget_named_kw(header, STARTDAT_KW , 0); - ecl_kw_type *units = ecl_file_iget_named_kw(header, UNITS_KW , 0); - ecl_kw_type *dimens = ecl_file_iget_named_kw(header, DIMENS_KW , 0); - ecl_kw_type *nums = NULL; - ecl_kw_type *lgrs = NULL; - ecl_kw_type *numlx = NULL; - ecl_kw_type *numly = NULL; - ecl_kw_type *numlz = NULL; + const char * names_alias = get_active_keyword_alias(header, WGNAMES_KW); + ecl_kw_type *wells = ecl_file_iget_named_kw(header, names_alias , 0); + ecl_kw_type *keywords = ecl_file_iget_named_kw(header, KEYWORDS_KW , 0); + ecl_kw_type *startdat = ecl_file_iget_named_kw(header, STARTDAT_KW , 0); + ecl_kw_type *units = ecl_file_iget_named_kw(header, UNITS_KW , 0); + ecl_kw_type *dimens = ecl_file_iget_named_kw(header, DIMENS_KW , 0); + ecl_kw_type *nums = NULL; + ecl_kw_type *lgrs = NULL; + ecl_kw_type *numlx = NULL; + ecl_kw_type *numly = NULL; + ecl_kw_type *numlz = NULL; + int params_index; ecl_smspec->num_regions = 0; if (startdat == NULL) diff --git a/ThirdParty/Ert/libecl/src/ecl_subsidence.c b/ThirdParty/Ert/libecl/src/ecl_subsidence.c index 9b3f30b893..4fe053f6f9 100644 --- a/ThirdParty/Ert/libecl/src/ecl_subsidence.c +++ b/ThirdParty/Ert/libecl/src/ecl_subsidence.c @@ -179,9 +179,9 @@ static double ecl_subsidence_survey_eval_geertsma( const ecl_subsidence_survey_t for (int index = 0; index < size; index++) { if (monitor_survey) { - weight[index] = - scale_factor * cell_volume[index] * (monitor_survey->pressure[index] - base_survey->pressure[index]); + weight[index] = scale_factor * cell_volume[index] * (base_survey->pressure[index] - monitor_survey->pressure[index]); } else { - weight[index] = - scale_factor * cell_volume[index] * (base_survey->pressure[index] ); + weight[index] = scale_factor * cell_volume[index] * (base_survey->pressure[index] ); } } diff --git a/ThirdParty/Ert/libecl/src/ecl_sum_data.c b/ThirdParty/Ert/libecl/src/ecl_sum_data.c index cad70f8c14..c8871fb84d 100644 --- a/ThirdParty/Ert/libecl/src/ecl_sum_data.c +++ b/ThirdParty/Ert/libecl/src/ecl_sum_data.c @@ -324,7 +324,7 @@ ecl_sum_data_type * ecl_sum_data_alloc_writer( ecl_smspec_type * smspec ) { static void ecl_sum_data_fwrite_report__( const ecl_sum_data_type * data , int report_step , fortio_type * fortio) { { - ecl_kw_type * seqhdr_kw = ecl_kw_alloc( SEQHDR_KW , SEQHDR_SIZE , ECL_INT_TYPE ); + ecl_kw_type * seqhdr_kw = ecl_kw_alloc( SEQHDR_KW , SEQHDR_SIZE , ECL_INT ); ecl_kw_iset_int( seqhdr_kw , 0 , 0 ); ecl_kw_fwrite( seqhdr_kw , fortio ); ecl_kw_free( seqhdr_kw ); diff --git a/ThirdParty/Ert/libecl/src/ecl_sum_tstep.c b/ThirdParty/Ert/libecl/src/ecl_sum_tstep.c index cd209fbe46..8228400d02 100644 --- a/ThirdParty/Ert/libecl/src/ecl_sum_tstep.c +++ b/ThirdParty/Ert/libecl/src/ecl_sum_tstep.c @@ -26,6 +26,7 @@ #include #include #include +#include #define ECL_SUM_TSTEP_ID 88631 @@ -270,7 +271,7 @@ int ecl_sum_tstep_get_ministep(const ecl_sum_tstep_type * ministep) { void ecl_sum_tstep_fwrite( const ecl_sum_tstep_type * ministep , const int_vector_type * index_map , fortio_type * fortio) { { - ecl_kw_type * ministep_kw = ecl_kw_alloc( MINISTEP_KW , 1 , ECL_INT_TYPE ); + ecl_kw_type * ministep_kw = ecl_kw_alloc( MINISTEP_KW , 1 , ECL_INT ); ecl_kw_iset_int( ministep_kw , 0 , ministep->ministep ); ecl_kw_fwrite( ministep_kw , fortio ); ecl_kw_free( ministep_kw ); @@ -278,7 +279,7 @@ void ecl_sum_tstep_fwrite( const ecl_sum_tstep_type * ministep , const int_vecto { int compact_size = int_vector_size( index_map ); - ecl_kw_type * params_kw = ecl_kw_alloc( PARAMS_KW , compact_size , ECL_FLOAT_TYPE ); + ecl_kw_type * params_kw = ecl_kw_alloc( PARAMS_KW , compact_size , ECL_FLOAT ); const int * index = int_vector_get_ptr( index_map ); float * data = ecl_kw_get_ptr( params_kw ); diff --git a/ThirdParty/Ert/libecl/src/ecl_type.c b/ThirdParty/Ert/libecl/src/ecl_type.c new file mode 100644 index 0000000000..a259bb5428 --- /dev/null +++ b/ThirdParty/Ert/libecl/src/ecl_type.c @@ -0,0 +1,210 @@ +/* + Copyright (C) 2017 Statoil ASA, Norway. + + The file 'ecl_type.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT 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. + + ERT 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 + for more details. +*/ + +#include +#include +#include + +#include +#include + +/*****************************************************************/ +/* The string names for the different ECLIPSE low-level + types. +*/ +#define ECL_TYPE_NAME_CHAR "CHAR" +#define ECL_TYPE_NAME_FLOAT "REAL" +#define ECL_TYPE_NAME_INT "INTE" +#define ECL_TYPE_NAME_DOUBLE "DOUB" +#define ECL_TYPE_NAME_BOOL "LOGI" +#define ECL_TYPE_NAME_MESSAGE "MESS" + +static char * alloc_string_name(const ecl_data_type ecl_type) { + return util_alloc_sprintf( + "C%03d", + ecl_type_get_sizeof_ctype_fortio(ecl_type) + ); +} + +static bool is_ecl_string_name(const char * type_name) { + return (type_name[0] == 'C' && + isdigit(type_name[1]) && + isdigit(type_name[2]) && + isdigit(type_name[3]) + ); +} + +static size_t get_ecl_string_length(const char * type_name) { + if(!is_ecl_string_name(type_name)) + util_abort("%s: Expected eclipse string (CXXX), received %s\n", + __func__, type_name); + + return atoi(type_name+1); +} + +ecl_data_type ecl_type_create(const ecl_type_enum type, const size_t element_size) { + ecl_data_type ecl_type = ( + type == ECL_STRING_TYPE ? + ECL_STRING(element_size) : + ecl_type_create_from_type(type) + ); + + if(ecl_type_get_sizeof_ctype_fortio(ecl_type) != element_size) + util_abort( + "%s: element_size mismatch for type %d, was: %d, expected: %d\n", + __func__, type, + element_size, ecl_type_get_sizeof_ctype_fortio(ecl_type) + ); + + return ecl_type; +} + +ecl_data_type ecl_type_create_from_type(const ecl_type_enum type) { + switch(type) { + case(ECL_CHAR_TYPE): + return ECL_CHAR; + case(ECL_INT_TYPE): + return ECL_INT; + case(ECL_FLOAT_TYPE): + return ECL_FLOAT; + case(ECL_DOUBLE_TYPE): + return ECL_DOUBLE; + case(ECL_BOOL_TYPE): + return ECL_BOOL; + case(ECL_MESS_TYPE): + return ECL_MESS; + case(ECL_STRING_TYPE): + util_abort("%s: Variable length string type cannot be created" + " from type alone!\n" , __func__); + return ECL_STRING(0); /* Dummy */ + default: + util_abort("%s: invalid ecl_type: %d\n", __func__, type); + return ECL_INT; /* Dummy */ + } +} + +ecl_type_enum ecl_type_get_type(const ecl_data_type ecl_type) { + return ecl_type.type; +} + +char * ecl_type_alloc_name(const ecl_data_type ecl_type) { + switch (ecl_type.type) { + case(ECL_CHAR_TYPE): + return util_alloc_string_copy(ECL_TYPE_NAME_CHAR); + case(ECL_STRING_TYPE): + return alloc_string_name(ecl_type); + case(ECL_FLOAT_TYPE): + return util_alloc_string_copy(ECL_TYPE_NAME_FLOAT); + case(ECL_DOUBLE_TYPE): + return util_alloc_string_copy(ECL_TYPE_NAME_DOUBLE); + case(ECL_INT_TYPE): + return util_alloc_string_copy(ECL_TYPE_NAME_INT); + case(ECL_BOOL_TYPE): + return util_alloc_string_copy(ECL_TYPE_NAME_BOOL); + case(ECL_MESS_TYPE): + return util_alloc_string_copy(ECL_TYPE_NAME_MESSAGE); + default: + util_abort("Internal error in %s - internal eclipse_type: %d not recognized - aborting \n",__func__ , ecl_type.type); + return NULL; /* Dummy */ + } +} + +ecl_data_type ecl_type_create_from_name( const char * type_name ) { + if (strncmp( type_name , ECL_TYPE_NAME_FLOAT , ECL_TYPE_LENGTH) == 0) + return ECL_FLOAT; + else if (strncmp( type_name , ECL_TYPE_NAME_INT , ECL_TYPE_LENGTH) == 0) + return ECL_INT; + else if (strncmp( type_name , ECL_TYPE_NAME_DOUBLE , ECL_TYPE_LENGTH) == 0) + return ECL_DOUBLE; + else if (strncmp( type_name , ECL_TYPE_NAME_CHAR , ECL_TYPE_LENGTH) == 0) + return ECL_CHAR; + else if (is_ecl_string_name(type_name)) + return ECL_STRING(get_ecl_string_length(type_name)); + else if (strncmp( type_name , ECL_TYPE_NAME_MESSAGE , ECL_TYPE_LENGTH) == 0) + return ECL_MESS; + else if (strncmp( type_name , ECL_TYPE_NAME_BOOL , ECL_TYPE_LENGTH) == 0) + return ECL_BOOL; + else { + util_abort("%s: unrecognized type name:%s \n",__func__ , type_name); + return ECL_INT; /* Dummy */ + } +} + + +int ecl_type_get_sizeof_ctype_fortio(const ecl_data_type ecl_type) { + if(ecl_type_is_char(ecl_type) || ecl_type_is_string(ecl_type)) + return ecl_type.element_size - 1; + else + return ecl_type_get_sizeof_ctype(ecl_type); +} + +int ecl_type_get_sizeof_ctype(const ecl_data_type ecl_type) { + return ecl_type.element_size; +} + +bool ecl_type_is_numeric(const ecl_data_type ecl_type) { + return (ecl_type_is_int(ecl_type) || + ecl_type_is_float(ecl_type) || + ecl_type_is_double(ecl_type)); +} + +bool ecl_type_is_alpha(const ecl_data_type ecl_type) { + return (ecl_type_is_char(ecl_type) || + ecl_type_is_mess(ecl_type) || + ecl_type_is_string(ecl_type)); +} + +bool ecl_type_is_equal(const ecl_data_type ecl_type1, + const ecl_data_type ecl_type2) { + return (ecl_type1.type == ecl_type2.type && + ecl_type1.element_size == ecl_type2.element_size); +} + +bool ecl_type_is_char(const ecl_data_type ecl_type) { + return (ecl_type.type == ECL_CHAR_TYPE); +} + +bool ecl_type_is_int(const ecl_data_type ecl_type) { + return (ecl_type.type == ECL_INT_TYPE); +} + +bool ecl_type_is_float(const ecl_data_type ecl_type) { + return (ecl_type.type == ECL_FLOAT_TYPE); +} + +bool ecl_type_is_double(const ecl_data_type ecl_type) { + return (ecl_type.type == ECL_DOUBLE_TYPE); +} + +bool ecl_type_is_mess(const ecl_data_type ecl_type) { + return (ecl_type.type == ECL_MESS_TYPE); +} + +bool ecl_type_is_bool(const ecl_data_type ecl_type) { + return (ecl_type.type == ECL_BOOL_TYPE); +} + +bool ecl_type_is_string(const ecl_data_type ecl_type) { + return (ecl_type.type == ECL_STRING_TYPE); +} + +// Temporary fixup for OPM. + char * ecl_type_get_name(const ecl_data_type ecl_type) { + return ecl_type_alloc_name( ecl_type ); + } + diff --git a/ThirdParty/Ert/libecl/src/ecl_type_python.c b/ThirdParty/Ert/libecl/src/ecl_type_python.c new file mode 100644 index 0000000000..8e5f843dd9 --- /dev/null +++ b/ThirdParty/Ert/libecl/src/ecl_type_python.c @@ -0,0 +1,108 @@ +#include +#include +#include + +/** + * + * Functions only to be used by the *PYTHON* prototype for EclDataType + * + */ +ecl_data_type * ecl_type_alloc_copy_python(const ecl_data_type * src_type) { + ecl_data_type * data_type = util_malloc(sizeof * src_type); + memcpy(data_type, src_type, sizeof * data_type); + return data_type; +} + +ecl_data_type * ecl_type_alloc_python(const ecl_type_enum type, const size_t element_size) { + ecl_data_type src_type = ecl_type_create(type, element_size); + return ecl_type_alloc_copy_python(&src_type); +} + +ecl_data_type * ecl_type_alloc_from_type_python(const ecl_type_enum type) { + ecl_data_type src_type = ecl_type_create_from_type(type); + return ecl_type_alloc_copy_python(&src_type); +} + +ecl_data_type * ecl_type_alloc_from_name_python(const char * name) { + ecl_data_type src_type = ecl_type_create_from_name(name); + return ecl_type_alloc_copy_python(&src_type); +} + +void ecl_type_free_python(ecl_data_type * data_type) { + free(data_type); +} + +ecl_type_enum ecl_type_get_type_python(const ecl_data_type * ecl_type) { + return ecl_type_get_type(*ecl_type); +} + +const char * ecl_type_alloc_name_python(const ecl_data_type * ecl_type) { + return ecl_type_alloc_name(*ecl_type); +} + +int ecl_type_get_sizeof_ctype_fortio_python(const ecl_data_type * ecl_type) { + return ecl_type_get_sizeof_ctype_fortio(*ecl_type); +} + +int ecl_type_get_sizeof_ctype_python(const ecl_data_type * ecl_type) { + return ecl_type_get_sizeof_ctype(*ecl_type); +} + +bool ecl_type_is_numeric_python(const ecl_data_type * ecl_type) { + return ecl_type_is_numeric(*ecl_type); +} + +bool ecl_type_is_equal_python(const ecl_data_type * ecl_type1, + const ecl_data_type * ecl_type2) { + return ecl_type_is_equal(*ecl_type1, *ecl_type2); +} + +bool ecl_type_is_char_python(const ecl_data_type * ecl_type) { + return ecl_type_is_char(*ecl_type); +} + +bool ecl_type_is_int_python(const ecl_data_type * ecl_type) { + return ecl_type_is_int(*ecl_type); +} + +bool ecl_type_is_float_python(const ecl_data_type * ecl_type) { + return ecl_type_is_float(*ecl_type); +} + +bool ecl_type_is_double_python(const ecl_data_type * ecl_type) { + return ecl_type_is_double(*ecl_type); +} + +bool ecl_type_is_mess_python(const ecl_data_type * ecl_type) { + return ecl_type_is_mess(*ecl_type); +} + +bool ecl_type_is_bool_python(const ecl_data_type * ecl_type) { + return ecl_type_is_bool(*ecl_type); +} + +bool ecl_type_is_string_python(const ecl_data_type * ecl_type) { + return ecl_type_is_string(*ecl_type); +} + +/** + * + * Functions for the EclKw prototype + * + */ +ecl_kw_type * ecl_kw_fscanf_alloc_grdecl_dynamic_python( FILE * stream , const char * kw , bool strict , const ecl_data_type * data_type) { + return ecl_kw_fscanf_alloc_grdecl_dynamic__( stream , kw , strict, *data_type ); +} + +ecl_kw_type * ecl_kw_alloc_python( const char * header , int size , const ecl_data_type * data_type ) { + return ecl_kw_alloc(header, size, *data_type); +} + +ecl_data_type * ecl_kw_get_data_type_python( const ecl_kw_type * ecl_kw ) { + ecl_data_type data_type = ecl_kw_get_data_type(ecl_kw); + return ecl_type_alloc_copy_python(&data_type); +} + +void ecl_kw_fread_indexed_data_python(fortio_type * fortio, offset_type data_offset, const ecl_data_type * data_type, int element_count, const int_vector_type* index_map, char* buffer) { + return ecl_kw_fread_indexed_data(fortio, data_offset, *data_type, element_count, index_map, buffer); +} diff --git a/ThirdParty/Ert/libecl/src/ecl_util.c b/ThirdParty/Ert/libecl/src/ecl_util.c index 4b2e4c6842..6b1dae13f9 100644 --- a/ThirdParty/Ert/libecl/src/ecl_util.c +++ b/ThirdParty/Ert/libecl/src/ecl_util.c @@ -30,21 +30,7 @@ #include #include - - -/*****************************************************************/ -/* The string names for the different ECLIPSE low-level - types. -*/ - - -#define ECL_TYPE_NAME_CHAR "CHAR" -#define ECL_TYPE_NAME_C010 "C010" -#define ECL_TYPE_NAME_FLOAT "REAL" -#define ECL_TYPE_NAME_INT "INTE" -#define ECL_TYPE_NAME_DOUBLE "DOUB" -#define ECL_TYPE_NAME_BOOL "LOGI" -#define ECL_TYPE_NAME_MESSAGE "MESS" +#include #define ECL_PHASE_NAME_OIL "SOIL" // SHould match the keywords found in restart file @@ -106,121 +92,6 @@ const char * ecl_util_get_phase_name( ecl_phase_enum phase ) { } - - - -const char * ecl_util_get_type_name( ecl_type_enum ecl_type ) { - switch (ecl_type) { - case(ECL_CHAR_TYPE): - return ECL_TYPE_NAME_CHAR ; - break; - case(ECL_C010_TYPE): - return ECL_TYPE_NAME_C010; - break; - case(ECL_FLOAT_TYPE): - return ECL_TYPE_NAME_FLOAT; - break; - case(ECL_DOUBLE_TYPE): - return ECL_TYPE_NAME_DOUBLE; - break; - case(ECL_INT_TYPE): - return ECL_TYPE_NAME_INT; - break; - case(ECL_BOOL_TYPE): - return ECL_TYPE_NAME_BOOL; - break; - case(ECL_MESS_TYPE): - return ECL_TYPE_NAME_MESSAGE; - break; - default: - util_abort("Internal error in %s - internal eclipse_type: %d not recognized - aborting \n",__func__ , ecl_type); - } - return NULL; /* Dummy */ -} - - -ecl_type_enum ecl_util_get_type_from_name( const char * type_name ) { - ecl_type_enum ecl_type; - - if (strncmp( type_name , ECL_TYPE_NAME_FLOAT , ECL_TYPE_LENGTH) == 0) - ecl_type = ECL_FLOAT_TYPE; - else if (strncmp( type_name , ECL_TYPE_NAME_INT , ECL_TYPE_LENGTH) == 0) - ecl_type = ECL_INT_TYPE; - else if (strncmp( type_name , ECL_TYPE_NAME_DOUBLE , ECL_TYPE_LENGTH) == 0) - ecl_type = ECL_DOUBLE_TYPE; - else if (strncmp( type_name , ECL_TYPE_NAME_CHAR , ECL_TYPE_LENGTH) == 0) - ecl_type = ECL_CHAR_TYPE; - else if (strncmp( type_name , ECL_TYPE_NAME_C010 , ECL_TYPE_LENGTH) == 0) - ecl_type = ECL_C010_TYPE; - else if (strncmp( type_name , ECL_TYPE_NAME_MESSAGE , ECL_TYPE_LENGTH) == 0) - ecl_type = ECL_MESS_TYPE; - else if (strncmp( type_name , ECL_TYPE_NAME_BOOL , ECL_TYPE_LENGTH) == 0) - ecl_type = ECL_BOOL_TYPE; - else { - util_abort("%s: unrecognized type name:%s \n",__func__ , type_name); - ecl_type = -1; /* Dummy */ - } - return ecl_type; -} - - -int ecl_util_get_sizeof_ctype_fortio(ecl_type_enum ecl_type) { - int size = ecl_util_get_sizeof_ctype ( ecl_type ); - if (ecl_type == ECL_CHAR_TYPE) - size = ECL_STRING8_LENGTH * sizeof(char); - - if (ecl_type == ECL_C010_TYPE) - size = ECL_STRING10_LENGTH * sizeof(char); - - return size; -} - -int ecl_util_get_sizeof_ctype(ecl_type_enum ecl_type) { - int sizeof_ctype = -1; - switch (ecl_type) { - case(ECL_CHAR_TYPE): - /* - One element of character data is a string section of 8 - characters + \0. Observe that the return value here - corresponds to the size requirements of ECL_CHAR_TYPE instance - in memory; on disk the trailing \0 is not stored. - */ - sizeof_ctype = (ECL_STRING8_LENGTH + 1) * sizeof(char); - break; - case(ECL_C010_TYPE): - /* - One element of character data is a string section of 8 - characters + \0. Observe that the return value here - corresponds to the size requirements of ECL_CHAR_TYPE instance - in memory; on disk the trailing \0 is not stored. - */ - sizeof_ctype = (ECL_STRING10_LENGTH + 1) * sizeof(char); - break; - case(ECL_FLOAT_TYPE): - sizeof_ctype = sizeof(float); - break; - case(ECL_DOUBLE_TYPE): - sizeof_ctype = sizeof(double); - break; - case(ECL_INT_TYPE): - sizeof_ctype = sizeof(int); - break; - case(ECL_BOOL_TYPE): - sizeof_ctype = sizeof(int); // The ECL_BOOL_TYPE type is internally implemented as an integer - and not a bool. - break; - case(ECL_MESS_TYPE): - sizeof_ctype = sizeof(char); - break; - default: - util_abort("Internal error in %s - internal eclipse_type: %d not recognized - aborting \n",__func__ , ecl_type); - } - return sizeof_ctype; -} - - - - - /*****************************************************************/ @@ -741,7 +612,7 @@ bool ecl_util_fmt_file(const char *filename , bool * __fmt_file) { int report_nr; ecl_file_enum file_type; bool status = true; - bool fmt_file; + bool fmt_file = 0; if (util_file_exists(filename)) { file_type = ecl_util_get_file_type(filename , &fmt_file , &report_nr); @@ -774,17 +645,17 @@ bool ecl_util_fmt_file(const char *filename , bool * __fmt_file) { appropriate numerical conversion is applied. */ -void ecl_util_memcpy_typed_data(void *_target_data , const void * _src_data , ecl_type_enum target_type , ecl_type_enum src_type, int size) { +void ecl_util_memcpy_typed_data(void *_target_data , const void * _src_data , ecl_data_type target_type , ecl_data_type src_type, int size) { int i; - if (target_type == src_type) - memcpy(_target_data , _src_data , size * ecl_util_get_sizeof_ctype(src_type)); + if (ecl_type_is_equal(target_type, src_type)) + memcpy(_target_data , _src_data , size * ecl_type_get_sizeof_ctype(src_type)); else { - switch (target_type) { + switch (ecl_type_get_type(target_type)) { case(ECL_DOUBLE_TYPE): { double * target_data = (double *) _target_data; - switch(src_type) { + switch(ecl_type_get_type(src_type)) { case(ECL_FLOAT_TYPE): util_float_to_double(target_data , (const float *) _src_data , size); break; @@ -800,7 +671,7 @@ void ecl_util_memcpy_typed_data(void *_target_data , const void * _src_data , ec case(ECL_FLOAT_TYPE): { float * target_data = (float *) _target_data; - switch(src_type) { + switch(ecl_type_get_type(src_type)) { case(ECL_FLOAT_TYPE): util_double_to_float(target_data , (const double *) _src_data , size); break; @@ -814,7 +685,7 @@ void ecl_util_memcpy_typed_data(void *_target_data , const void * _src_data , ec break; } default: - util_abort("%s con not convert %d -> %d \n",__func__ , src_type , target_type); + util_abort("%s con not convert %s -> %s \n",__func__ , ecl_type_alloc_name(src_type) , ecl_type_alloc_name(target_type)); } } } diff --git a/ThirdParty/Ert/libecl/src/fault_block_layer.c b/ThirdParty/Ert/libecl/src/fault_block_layer.c index 0c458eb470..87c899f118 100644 --- a/ThirdParty/Ert/libecl/src/fault_block_layer.c +++ b/ThirdParty/Ert/libecl/src/fault_block_layer.c @@ -130,7 +130,7 @@ bool fault_block_layer_scan_kw( fault_block_layer_type * layer , const ecl_kw_ty if (ecl_kw_get_size( fault_block_kw) != ecl_grid_get_global_size(layer->grid)) return false; - else if (ecl_kw_get_type( fault_block_kw ) != ECL_INT_TYPE) + else if (!ecl_type_is_int(ecl_kw_get_data_type( fault_block_kw ))) return false; else { int i,j; @@ -171,7 +171,7 @@ bool fault_block_layer_scan_kw( fault_block_layer_type * layer , const ecl_kw_ty bool fault_block_layer_load_kw( fault_block_layer_type * layer , const ecl_kw_type * fault_block_kw) { if (ecl_kw_get_size( fault_block_kw) != ecl_grid_get_global_size(layer->grid)) return false; - else if (ecl_kw_get_type( fault_block_kw ) != ECL_INT_TYPE) + else if (!ecl_type_is_int(ecl_kw_get_data_type( fault_block_kw ))) return false; else { int i,j; @@ -316,7 +316,7 @@ void fault_block_layer_insert_block_content( fault_block_layer_type * layer , co bool fault_block_layer_export( const fault_block_layer_type * layer , ecl_kw_type * faultblock_kw) { - if ((ecl_kw_get_type( faultblock_kw ) == ECL_INT_TYPE) && (ecl_kw_get_size( faultblock_kw ) == ecl_grid_get_global_size( layer->grid ))) { + if (ecl_type_is_int(ecl_kw_get_data_type( faultblock_kw )) && (ecl_kw_get_size( faultblock_kw ) == ecl_grid_get_global_size( layer->grid ))) { int i,j; for (j=0; j < ecl_grid_get_ny( layer->grid ); j++) { diff --git a/ThirdParty/Ert/libecl/src/smspec_node.c b/ThirdParty/Ert/libecl/src/smspec_node.c index 2d4bd373f0..e009a53272 100644 --- a/ThirdParty/Ert/libecl/src/smspec_node.c +++ b/ThirdParty/Ert/libecl/src/smspec_node.c @@ -407,20 +407,12 @@ smspec_node_type * smspec_node_alloc_new(int params_index, float default_value) } -/** - Observe that the wellname can have max 8 characters; anything - beyond that is silently dropped. -*/ - static void smspec_node_set_wgname( smspec_node_type * index , const char * wgname ) { if (wgname == NULL) { util_safe_free( index->wgname ); index->wgname = NULL; } else { - if (strlen(wgname) > 8) - index->wgname = util_realloc_substring_copy(index->wgname , wgname , 8); - else - index->wgname = util_realloc_string_copy(index->wgname , wgname ); + index->wgname = util_realloc_string_copy(index->wgname , wgname ); } } diff --git a/ThirdParty/Ert/libecl/tests/CMakeLists.txt b/ThirdParty/Ert/libecl/tests/CMakeLists.txt index edad35ed31..62aa9a50c2 100644 --- a/ThirdParty/Ert/libecl/tests/CMakeLists.txt +++ b/ThirdParty/Ert/libecl/tests/CMakeLists.txt @@ -1,4 +1,9 @@ if (BUILD_TESTS) + + # Common test binary used in both the Statoil internal tests and the open tests. + add_executable( ecl_grid_cell_contains ecl_grid_cell_contains.c ) + target_link_libraries( ecl_grid_cell_contains ecl ) + include( tests.cmake ) if (STATOIL_TESTDATA_ROOT) include (statoil_tests.cmake) diff --git a/ThirdParty/Ert/libecl/tests/ecl_alloc_cpgrid.c b/ThirdParty/Ert/libecl/tests/ecl_alloc_cpgrid.c new file mode 100644 index 0000000000..e9417f887b --- /dev/null +++ b/ThirdParty/Ert/libecl/tests/ecl_alloc_cpgrid.c @@ -0,0 +1,112 @@ +/* + Copyright (C) 2017 Statoil ASA, Norway. + + The file 'ecl_alloc_cpgrid.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT 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. + + ERT 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 + for more details. +*/ + +#include +#include +#include + +#include +#include +#include +#include +#include + + +void test_grid(int nx, int ny, int nz) { + ecl_kw_type * coord_kw = ecl_kw_alloc( COORD_KW , ECL_GRID_COORD_SIZE( nx , ny ) , ECL_FLOAT ); + ecl_kw_type * zcorn_kw = ecl_kw_alloc( ZCORN_KW , ECL_GRID_ZCORN_SIZE( nx , ny , nz) , ECL_FLOAT ); + int i,j,k; + double a = 1.0; + for (j= 0; j < ny; j++) { + for (i = 0; i < nx; i++) { + int offset = 6*(i + j*nx); + ecl_kw_iset_float( coord_kw , offset , a*i); + ecl_kw_iset_float( coord_kw , offset + 1, a*j); + ecl_kw_iset_float( coord_kw , offset + 2, -1); + + ecl_kw_iset_float( coord_kw , offset + 3, a*i); + ecl_kw_iset_float( coord_kw , offset + 4, a*j); + ecl_kw_iset_float( coord_kw , offset + 5, -1); + + for (k=0; k < nz; k++) { + for (int c = 0; c < 4; c++) { + int zi1 = ecl_grid_zcorn_index__( nx , ny , i , j , k , c); + int zi2 = ecl_grid_zcorn_index__( nx , ny , i , j , k , c + 4); + + double z1 = k*a; + double z2 = (k + 1) * a; + + ecl_kw_iset_float( zcorn_kw , zi1 , z1 ); + ecl_kw_iset_float( zcorn_kw , zi2 , z2 ); + } + } + } + } + + + { + ecl_grid_type * grid = ecl_grid_alloc_GRDECL_kw( nx,ny,nz, zcorn_kw , coord_kw , NULL, NULL ); + test_assert_int_equal( ecl_grid_get_cell_twist3( grid , 0,0,0) , 0 ); + ecl_grid_free( grid ); + } + + + { + int zi1 = ecl_grid_zcorn_index__( nx , ny , 0 , 0 , 0 , 0); + int zi2 = ecl_grid_zcorn_index__( nx , ny , 0 , 0 , 0 , 4); + + double z1 = 0; + double z2 = -0.25; + + ecl_kw_iset_float( zcorn_kw , zi1 , z1 ); + ecl_kw_iset_float( zcorn_kw , zi2 , z2 ); + + { + ecl_grid_type * grid = ecl_grid_alloc_GRDECL_kw( nx,ny,nz, zcorn_kw , coord_kw , NULL, NULL ); + test_assert_int_equal( ecl_grid_get_cell_twist3( grid , 0,0,0) , 1 ); + ecl_grid_free( grid ); + } + + zi1 = ecl_grid_zcorn_index__( nx , ny , 0 , 0 , 0 , 3); + zi2 = ecl_grid_zcorn_index__( nx , ny , 0 , 0 , 0 , 7); + + ecl_kw_iset_float( zcorn_kw , zi1 , z1 ); + ecl_kw_iset_float( zcorn_kw , zi2 , z2 ); + + { + ecl_grid_type * grid = ecl_grid_alloc_GRDECL_kw( nx,ny,nz, zcorn_kw , coord_kw , NULL, NULL ); + test_assert_int_equal( ecl_grid_get_cell_twist3( grid , 0,0,0) , 2 ); + ecl_grid_free( grid ); + } + } + + + ecl_kw_free( coord_kw ); + ecl_kw_free( zcorn_kw ); +} + + +int main(int argc , char ** argv) { + int nx = 10; + int ny = 7; + int nz = 8; + + test_grid( nx,ny,nz ); + + exit(0); +} diff --git a/ThirdParty/Ert/libecl/tests/ecl_fault_block_layer.c b/ThirdParty/Ert/libecl/tests/ecl_fault_block_layer.c index 08917065df..37e0184688 100644 --- a/ThirdParty/Ert/libecl/tests/ecl_fault_block_layer.c +++ b/ThirdParty/Ert/libecl/tests/ecl_fault_block_layer.c @@ -26,6 +26,7 @@ #include #include #include +#include @@ -62,7 +63,7 @@ void test_create( const ecl_grid_type * grid , ecl_kw_type * fault_block_kw) { void test_create_invalid( const ecl_grid_type * grid ) { - ecl_kw_type * fault_blk_kw = ecl_kw_alloc("FAULTBLK" , ecl_grid_get_global_size( grid ) - 1, ECL_INT_TYPE ); + ecl_kw_type * fault_blk_kw = ecl_kw_alloc("FAULTBLK" , ecl_grid_get_global_size( grid ) - 1, ECL_INT); test_assert_NULL( fault_block_layer_alloc( grid , 7 )); @@ -105,9 +106,9 @@ void test_trace_edge( const ecl_grid_type * grid) { void test_export( const ecl_grid_type * grid) { fault_block_layer_type * layer = fault_block_layer_alloc( grid , 0 ); - ecl_kw_type * ecl_kw1 = ecl_kw_alloc("FAULTBLK" , ecl_grid_get_global_size( grid ) , ECL_INT_TYPE ); - ecl_kw_type * ecl_kw2 = ecl_kw_alloc("FAULTBLK" , ecl_grid_get_global_size( grid ) + 1 , ECL_INT_TYPE ); - ecl_kw_type * ecl_kw3 = ecl_kw_alloc("FAULTBLK" , ecl_grid_get_global_size( grid ) , ECL_FLOAT_TYPE ); + ecl_kw_type * ecl_kw1 = ecl_kw_alloc("FAULTBLK" , ecl_grid_get_global_size( grid ) , ECL_INT); + ecl_kw_type * ecl_kw2 = ecl_kw_alloc("FAULTBLK" , ecl_grid_get_global_size( grid ) + 1 , ECL_INT); + ecl_kw_type * ecl_kw3 = ecl_kw_alloc("FAULTBLK" , ecl_grid_get_global_size( grid ) , ECL_FLOAT); fault_block_type * block = fault_block_layer_add_block( layer , 10 ); fault_block_add_cell( block , 0 , 0 ); @@ -141,7 +142,7 @@ void test_neighbours( const ecl_grid_type * grid) { const int k = 0; fault_block_layer_type * layer = fault_block_layer_alloc( grid , k ); geo_polygon_collection_type * polylines = geo_polygon_collection_alloc(); - ecl_kw_type * ecl_kw = ecl_kw_alloc("FAULTBLK" , ecl_grid_get_global_size( grid ) , ECL_INT_TYPE ); + ecl_kw_type * ecl_kw = ecl_kw_alloc("FAULTBLK" , ecl_grid_get_global_size( grid ) , ECL_INT); ecl_kw_iset_int( ecl_kw , 0 , 1); ecl_kw_iset_int( ecl_kw , ecl_grid_get_global_index3( grid , 3,3,k) , 2); @@ -181,7 +182,7 @@ void test_neighbours( const ecl_grid_type * grid) { int main(int argc , char ** argv) { ecl_grid_type * ecl_grid = ecl_grid_alloc_rectangular( 9 , 9 , 2 , 1 , 1 , 1 , NULL ); - ecl_kw_type * fault_blk_kw = ecl_kw_alloc("FAULTBLK" , ecl_grid_get_global_size( ecl_grid ) , ECL_INT_TYPE ); + ecl_kw_type * fault_blk_kw = ecl_kw_alloc("FAULTBLK" , ecl_grid_get_global_size( ecl_grid ) , ECL_INT); test_create( ecl_grid , fault_blk_kw ); test_create_invalid( ecl_grid ); diff --git a/ThirdParty/Ert/libecl/tests/ecl_fault_block_layer_statoil.c b/ThirdParty/Ert/libecl/tests/ecl_fault_block_layer_statoil.c index c14b094090..9fc2581572 100644 --- a/ThirdParty/Ert/libecl/tests/ecl_fault_block_layer_statoil.c +++ b/ThirdParty/Ert/libecl/tests/ecl_fault_block_layer_statoil.c @@ -74,7 +74,7 @@ int main(int argc , char ** argv) { ecl_kw_type * fault_blk_kw; { FILE * stream = util_fopen( fault_blk_file , "r"); - fault_blk_kw = ecl_kw_fscanf_alloc_grdecl( stream , "FAULTBLK" , ecl_grid_get_global_size( ecl_grid ) , ECL_INT_TYPE); + fault_blk_kw = ecl_kw_fscanf_alloc_grdecl( stream , "FAULTBLK" , ecl_grid_get_global_size( ecl_grid ) , ECL_INT); fclose( stream ); } diff --git a/ThirdParty/Ert/libecl/tests/ecl_fortio.c b/ThirdParty/Ert/libecl/tests/ecl_fortio.c index d675c9f2a3..c722d49abd 100644 --- a/ThirdParty/Ert/libecl/tests/ecl_fortio.c +++ b/ThirdParty/Ert/libecl/tests/ecl_fortio.c @@ -19,7 +19,6 @@ #include #include -#include #include #include #include diff --git a/ThirdParty/Ert/libecl/tests/ecl_grid_cell_contains.c b/ThirdParty/Ert/libecl/tests/ecl_grid_cell_contains.c index fe9b17a2fe..b2aa88e501 100644 --- a/ThirdParty/Ert/libecl/tests/ecl_grid_cell_contains.c +++ b/ThirdParty/Ert/libecl/tests/ecl_grid_cell_contains.c @@ -1,29 +1,70 @@ /* - Copyright (C) 2014 Statoil ASA, Norway. - + Copyright (C) 2014 Statoil ASA, Norway. + The file 'ecl_grid_cell_contains.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. + + ERT 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. + + ERT 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 + for more details. */ #include #include +#include #include #include +bool get_test_point1(const ecl_grid_type * grid , int global_index, double *_xpos , double *_ypos , double *_zpos) { + const int corners[4] = {1,2,5,6}; + double xpos = 0; + double ypos = 0; + double zpos = 0; + const double min_volume = 1e-8; + + if (fabs(ecl_grid_get_cell_volume1( grid , global_index )) <= min_volume) + return false; + + if (ecl_grid_get_cell_twist1( grid , global_index ) > 0) + return false; + + if (!ecl_grid_cell_regular1( grid , global_index )) + return false; + + + for (int ci = 0; ci < 4; ci++) { + int corner = corners[ci]; + double x,y,z; + ecl_grid_get_cell_corner_xyz1( grid , global_index, corner , &x, &y , &z); + xpos += x; + ypos += y; + zpos += z; + } + + *_xpos = xpos * 0.25; + *_ypos = ypos * 0.25; + *_zpos = zpos * 0.25; + + return ecl_grid_cell_contains_xyz1(grid, global_index, *_xpos, *_ypos, *_zpos); +} + + +bool get_test_point3(const ecl_grid_type * grid , int i , int j ,int k, double *_xpos , double *_ypos , double *_zpos) { + const int global_index = ecl_grid_get_global_index3(grid , i , j , k ); + return get_test_point1( grid , global_index , _xpos , _ypos , _zpos); +} + + void test_grid_covering( const ecl_grid_type * grid) { const int nx = ecl_grid_get_nx( grid ); const int ny = ecl_grid_get_ny( grid ); @@ -44,12 +85,12 @@ void test_grid_covering( const ecl_grid_type * grid) { test_assert_true( p1[ 1 ] == p2[ 1 ] ); test_assert_true( p1[ 2 ] == p2[ 2 ] ); } - - + + for (int l=0; l < 4; l++) { ecl_grid_get_cell_corner_xyz1( grid , g1 , l, &p1[0], &p1[1], &p1[2] ); ecl_grid_get_cell_corner_xyz1( grid , g1 , l + 4 , &p2[0], &p2[1], &p2[2] ); - + test_assert_true( p2[2] >= p1[2] ); } } @@ -59,53 +100,54 @@ void test_grid_covering( const ecl_grid_type * grid) { -void test_contains_count( const ecl_grid_type * grid ) { - int error_count = 0; +void assert_contains( const ecl_grid_type * grid , int i , int j , int k , double x , double y , double z) { + if (!ecl_grid_cell_contains_xyz3( grid , i,j,k , x,y, z )) + fprintf(stderr," Point: (%g,%g,%g) not found in cell: (%d,%d,%d) \n",x,y,z,i,j,k); + + test_assert_true( ecl_grid_cell_contains_xyz3( grid , i,j,k , x,y, z )); +} + + +void test_contains( const ecl_grid_type * grid ) { const int nx = ecl_grid_get_nx( grid ); const int ny = ecl_grid_get_ny( grid ); const int nz = ecl_grid_get_nz( grid ); for (int k=0; k < nz; k++) { - printf("k: %d/%d \n", k , nz - 1); for (int j=0; j < ny; j++) { for (int i=0; i < nx; i++) { - double x,y,z; - ecl_grid_get_xyz3( grid , i,j,k , &x,&y,&z); - { - int i2,j2,k2; - int contains_count = 0; - int kmin = util_int_max( 0 , k - 1 ); - int kmax = util_int_min( nz , k + 1 ); - - int jmin = util_int_max( 0 , j - 1 ); - int jmax = util_int_min( ny , j + 1 ); + if (!ecl_grid_get_cell_twist3( grid , i,j,k) == 0) { + double x,y,z; + if (get_test_point3( grid , i,j,k , &x,&y,&z)) { + assert_contains( grid , i , j , k , x , y , z); + { + int i2,j2,k2; + int kmin = util_int_max( 0 , k - 1 ); + int kmax = util_int_min( nz , k + 1 ); - int imin = util_int_max( 0 , i - 1 ); - int imax = util_int_min( nx , i + 1 ); - + int jmin = util_int_max( 0 , j - 1 ); + int jmax = util_int_min( ny , j + 1 ); - for (k2 = kmin; k2 < kmax; k2++) { - for (j2 = jmin; j2 < jmax; j2++) { - for (i2 = imin; i2 < imax; i2++) { - if (ecl_grid_cell_contains_xyz3( grid , i2,j2,k2 , x,y, z )) { - contains_count++; + int imin = util_int_max( 0 , i - 1 ); + int imax = util_int_min( nx , i + 1 ); + + + for (k2 = kmin; k2 < kmax; k2++) { + for (j2 = jmin; j2 < jmax; j2++) { + for (i2 = imin; i2 < imax; i2++) { + if ( (i != i2) && (j != j2 ) && (k != k2)) { + if (ecl_grid_get_cell_twist3( grid , i2,j2,k2) == 0) + test_assert_false( ecl_grid_cell_contains_xyz3( grid , i2,j2,k2 , x,y, z ) ); + } + } } } } } - - if (contains_count != 1) { - if (contains_count > 1) - error_count += 1; - else - if (ecl_grid_cell_regular3( grid , i,j,k)) - error_count += 1; - } } } } } - test_assert_int_equal( error_count , 0 ); } @@ -115,91 +157,30 @@ void test_find( ecl_grid_type * grid ) { int find_count = 100; int delta = util_int_max(1 , ecl_grid_get_global_size( grid ) / find_count); for (init_index = 0; init_index < ecl_grid_get_global_size( grid ); init_index += delta) { - printf("find index:%d \n",init_index / delta); - if (!ecl_grid_cell_invalid1(grid , init_index) && ecl_grid_cell_regular1( grid , init_index) ) { + if (ecl_grid_get_cell_twist1( grid , init_index ) == 0) { double x,y,z; int find_index; int start_index = 0; - - ecl_grid_get_xyz1( grid , init_index , &x,&y,&z); - find_index = ecl_grid_get_global_index_from_xyz(grid , x, y , z , start_index ); - test_assert_int_equal(init_index , find_index ); + + if (get_test_point1( grid , init_index , &x,&y,&z)) { + find_index = ecl_grid_get_global_index_from_xyz(grid , x, y , z , start_index ); + if (init_index != find_index) { + int i1,j1,k1,i2,j2,k2; + + ecl_grid_get_ijk1( grid , init_index , &i1,&j1,&k1); + ecl_grid_get_ijk1( grid , find_index , &i2,&j2,&k2); + printf(" point: %14.7f %14.7f %14.7f \n",x,y,z); + printf(" Regular: %d / %d \n",ecl_grid_cell_regular3(grid , i1,j1,k1) , ecl_grid_cell_regular3(grid , i2,j2,k2)); + printf(" init: contains(%7d) : %d (%d,%d,%d) V:%g \n",init_index , ecl_grid_cell_contains_xyz1( grid , init_index ,x , y , z), i1+1,j1+1,k1+1, ecl_grid_get_cell_volume1( grid , init_index)); + printf("ERROR: find: contains(%7d) : %d (%d,%d,%d) V:%g \n\n",find_index , ecl_grid_cell_contains_xyz1( grid , find_index ,x , y , z), i2+1,j2+1,k2+1,ecl_grid_get_cell_volume1( grid , find_index)); + test_assert_int_equal(init_index , find_index ); + } + } } } } -// /* -// Will indeed answer yes when asked if it contains it's own center. -// */ -// test_assert_true( ecl_grid_cell_contains_xyz1( grid , init_index , x,y,z) ); -// -// if (1) -// { -// int start_index = 0; -// -// if (find_index != init_index) { -// int init_ijk[3]; -// int find_ijk[3]; -// -// ecl_grid_get_ijk1( grid , find_index , &find_ijk[0] , &find_ijk[1] , &find_ijk[2]); -// ecl_grid_get_ijk1( grid , init_index , &init_ijk[0] , &init_ijk[1] , &init_ijk[2]); -// -// printf("ijk: %d:(%2d,%2d,%2d) -> %d:(%2d,%2d,%2d) \n",init_index , init_ijk[0] , init_ijk[1] , init_ijk[2] , find_index , find_ijk[0] , find_ijk[1], find_ijk[2]); -// global_error += 1; -// } -// -// if (0) { -// //if (find_index != init_index) { -// int init_ijk[3]; -// int find_ijk[3]; -// -// ecl_grid_get_ijk1( grid , find_index , &find_ijk[0] , &find_ijk[1] , &find_ijk[2]); -// ecl_grid_get_ijk1( grid , init_index , &init_ijk[0] , &init_ijk[1] , &init_ijk[2]); -// -// { -// printf("ijk: (%2d,%2d,%2d) -> (%2d,%2d,%2d) \n",init_ijk[0] , init_ijk[1] , init_ijk[2] , find_ijk[0] , find_ijk[1], find_ijk[2]); -// -// if (0) { -// printf(" ecl_grid_cell_contains_xyz3(%d,%d,%d) : %d Volume:%g \n",init_ijk[0] , init_ijk[1], init_ijk[2] , -// ecl_grid_cell_contains_xyz3( grid , init_ijk[0] , init_ijk[1], init_ijk[2] , x , y , z ), -// ecl_grid_get_cell_volume1( grid , init_index)); -// -// printf(" ecl_grid_cell_contains_xyz3(%d,%d,%d) : %d Volume:%g \n",find_ijk[0] , find_ijk[1], find_ijk[2] , -// ecl_grid_cell_contains_xyz3( grid , find_ijk[0] , find_ijk[1], find_ijk[2] , x , y , z ), -// ecl_grid_get_cell_volume1( grid , find_index)); -// } -// -// { -// int find_index2 = ecl_grid_get_global_index_from_xyz(grid , x, y , z , init_index ); -// printf("find_index2:%d \n",find_index2); -// } -// -// printf("init_index:%d find_index:%d \n",init_index , find_index); -// if (find_index >= 0) -// printf("Vrengte: %d\n",ecl_grid_cell_inside_out1( grid , find_index)); -// printf("Vrengte: %d\n",ecl_grid_cell_inside_out1( grid , init_index)); -// -// { -// bool init_cell_inside_out = ecl_grid_cell_inside_out1( grid , init_index); -// bool find_cell_inside_out = false; -// -// if (find_index >= 0) -// find_cell_inside_out = ecl_grid_cell_inside_out1( grid , find_index ); -// else -// test_assert_int_not_equal( -1 , find_index ); -// -// if (find_cell_inside_out == init_cell_inside_out) { -// if (init_cell_inside_out == false) -// test_assert_int_equal( init_index , find_index ); -// } -// } -// } -// } -// } -// } -// } -//} void test_corners() { @@ -225,7 +206,7 @@ void test_corners() { ecl_grid_get_cell_corner_xyz3( grid , 0, 0, 0 , i , &x , &y , &z); test_assert_int_not_equal( 0 , ecl_grid_get_global_index_from_xyz( grid , x,y,z,0)); } - + // Corner 1 ecl_grid_get_cell_corner_xyz3(grid , 2,0,0,1 , &x,&y,&z); test_assert_int_equal( ecl_grid_get_global_index3( grid , 2,0,0 ) , ecl_grid_get_global_index_from_xyz( grid , x,y,z,0)); @@ -254,7 +235,7 @@ void test_corners() { ecl_grid_get_cell_corner_xyz3(grid , 2,2,2,7 , &x,&y,&z); test_assert_int_equal( ecl_grid_get_global_index3( grid , 2,2,2 ) , ecl_grid_get_global_index_from_xyz( grid , x,y,z,0)); } - + ecl_grid_free( grid ); } @@ -265,19 +246,17 @@ void test_corners() { int main(int argc , char ** argv) { ecl_grid_type * grid; - int case_nr; util_install_signals(); - util_sscanf_int( argv[1] , &case_nr ); - if (argc == 2) { + if (argc == 1) { grid = ecl_grid_alloc_rectangular(6,6,6,1,2,3,NULL); } else - grid = ecl_grid_alloc( argv[2] ); - + grid = ecl_grid_alloc( argv[1] ); + test_grid_covering( grid ); - test_contains_count( grid ); - + test_contains( grid ); + test_find(grid); test_corners(); diff --git a/ThirdParty/Ert/libecl/tests/ecl_grid_cell_contains_wellpath.c b/ThirdParty/Ert/libecl/tests/ecl_grid_cell_contains_wellpath.c new file mode 100644 index 0000000000..0afc83b1c1 --- /dev/null +++ b/ThirdParty/Ert/libecl/tests/ecl_grid_cell_contains_wellpath.c @@ -0,0 +1,101 @@ +/* + Copyright (C) 2017 Statoil ASA, Norway. + + The file 'ecl_grid_cell_contains_wellpath.c' is part of ERT - + Ensemble based Reservoir Tool. + + ERT 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. + + ERT 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 + for more details. +*/ + +#include +#include +#include + +#include +#include +#include + + +typedef struct { + double x; + double y; + double z; + + int g; + int i; + int j; + int k; + + bool skip; +} point_type; + + + +vector_type * load_expected( const ecl_grid_type * grid, const char * filename ) { + FILE * stream = util_fopen( filename , "r"); + vector_type * expected = vector_alloc_new(); + + while (true) { + double x,y,z; + int i,j,k,skip; + + if (fscanf( stream , "%lg %lg %lg %d %d %d %d" , &x,&y,&z,&i,&j,&k,&skip) == 7) { + point_type * p = util_malloc( sizeof * p ); + p->x = x; + p->y = y; + p->z = z; + + p->i = i-1; + p->j = j-1; + p->k = k-1; + p->skip = skip; + p->g = ecl_grid_get_global_index3(grid, p->i, p->j, p->k); + vector_append_owned_ref( expected, p , free ); + } else + break; + } + + fclose( stream ); + test_assert_int_equal( 10 , vector_get_size( expected )); + return expected; +} + + + +int main(int argc , char ** argv) { + util_install_signals(); + { + ecl_grid_type * grid = ecl_grid_alloc( argv[1] ); + vector_type * expected = load_expected( grid, argv[2] ); + + for (int c=0; c < vector_get_size( expected ); c++) { + const point_type * p = vector_iget_const( expected , c ); + int g = ecl_grid_get_global_index_from_xyz(grid , p->x, p->y , p->z , 0 ); + if (g != ecl_grid_get_global_index3(grid, p->i,p->j, p->k)) { + int i,j,k; + ecl_grid_get_ijk1(grid, g, &i, &j, &k); + fprintf(stderr,"point:%d (%g,%g,%g), Simulated: %d:(%d,%d,%d) Expected: %d:(%d,%d,%d) contains:%d\n", + c , p->x, p->y, p->z, g, i,j,k, p->g, p->i, p->j, p->k, ecl_grid_cell_contains_xyz1( grid, p->g , p->x , p->y, p->z)); + } + if (!p->skip) + test_assert_int_equal( g , ecl_grid_get_global_index3(grid, p->i,p->j, p->k)); + else { + if ( g != ecl_grid_get_global_index3(grid, p->i,p->j, p->k)) + fprintf(stderr," ** Skipping failed test for point:%d \n",c); + } + } + ecl_grid_free( grid ); + vector_free( expected ); + } + exit(0); +} diff --git a/ThirdParty/Ert/libecl/tests/ecl_grid_corner.c b/ThirdParty/Ert/libecl/tests/ecl_grid_corner.c index eb98690b22..b4adf52270 100644 --- a/ThirdParty/Ert/libecl/tests/ecl_grid_corner.c +++ b/ThirdParty/Ert/libecl/tests/ecl_grid_corner.c @@ -19,7 +19,6 @@ #include #include -#include #include diff --git a/ThirdParty/Ert/libecl/tests/ecl_init_file.c b/ThirdParty/Ert/libecl/tests/ecl_init_file.c index 12493ce49b..0e3d3978d8 100644 --- a/ThirdParty/Ert/libecl/tests/ecl_init_file.c +++ b/ThirdParty/Ert/libecl/tests/ecl_init_file.c @@ -28,6 +28,7 @@ #include #include #include +#include void test_write_header() { @@ -48,7 +49,7 @@ void test_write_header() { // Write poro with global size. { fortio_type * f = fortio_open_writer( "FOO1.INIT" , false , ECL_ENDIAN_FLIP ); - ecl_kw_type * poro = ecl_kw_alloc( "PORO" , ecl_grid_get_global_size( ecl_grid ) , ECL_FLOAT_TYPE ); + ecl_kw_type * poro = ecl_kw_alloc( "PORO" , ecl_grid_get_global_size( ecl_grid ) , ECL_FLOAT); ecl_kw_scalar_set_float( poro , 0.10 ); ecl_init_file_fwrite_header( f , ecl_grid , poro , ECL_FIELD_UNITS, 7 , start_time ); ecl_kw_free( poro ); @@ -59,7 +60,7 @@ void test_write_header() { // Write poro with nactive size. { fortio_type * f = fortio_open_writer( "FOO2.INIT" , false , ECL_ENDIAN_FLIP ); - ecl_kw_type * poro = ecl_kw_alloc( "PORO" , ecl_grid_get_global_size( ecl_grid ) , ECL_FLOAT_TYPE ); + ecl_kw_type * poro = ecl_kw_alloc( "PORO" , ecl_grid_get_global_size( ecl_grid ) , ECL_FLOAT); ecl_kw_scalar_set_float( poro , 0.10 ); ecl_init_file_fwrite_header( f , ecl_grid , poro , ECL_FIELD_UNITS, 7 , start_time ); ecl_kw_free( poro ); diff --git a/ThirdParty/Ert/libecl/tests/ecl_kw_cmp_string.c b/ThirdParty/Ert/libecl/tests/ecl_kw_cmp_string.c index 934a931654..c12009dbc5 100644 --- a/ThirdParty/Ert/libecl/tests/ecl_kw_cmp_string.c +++ b/ThirdParty/Ert/libecl/tests/ecl_kw_cmp_string.c @@ -21,11 +21,12 @@ #include #include +#include void test_cmp_string() { - ecl_kw_type * ecl_kw = ecl_kw_alloc( "HEADER" , 1 , ECL_CHAR_TYPE ); + ecl_kw_type * ecl_kw = ecl_kw_alloc( "HEADER" , 1 , ECL_CHAR); ecl_kw_iset_string8( ecl_kw , 0 , "ABCD"); diff --git a/ThirdParty/Ert/libecl/tests/ecl_kw_equal.c b/ThirdParty/Ert/libecl/tests/ecl_kw_equal.c index 4ec147e84e..3e00c26c3e 100644 --- a/ThirdParty/Ert/libecl/tests/ecl_kw_equal.c +++ b/ThirdParty/Ert/libecl/tests/ecl_kw_equal.c @@ -21,10 +21,11 @@ #include #include #include +#include int main(int argc , char ** argv) { - ecl_kw_type * ecl_kw1 = ecl_kw_alloc( "KW" , 10 , ECL_INT_TYPE ); + ecl_kw_type * ecl_kw1 = ecl_kw_alloc( "KW" , 10 , ECL_INT ); int data[10]; int i; for (i=0; i < 10; i++) { @@ -49,8 +50,8 @@ int main(int argc , char ** argv) { } { - ecl_kw_type * ecl_ikw = ecl_kw_alloc_new_shared( "KW" , 10 , ECL_INT_TYPE , data); - ecl_kw_type * ecl_fkw = ecl_kw_alloc_new_shared( "KW" , 10 , ECL_FLOAT_TYPE , data); + ecl_kw_type * ecl_ikw = ecl_kw_alloc_new_shared( "KW" , 10 , ECL_INT , data); + ecl_kw_type * ecl_fkw = ecl_kw_alloc_new_shared( "KW" , 10 , ECL_FLOAT , data); test_assert_true( ecl_kw_content_equal( ecl_kw1 , ecl_ikw )); test_assert_false( ecl_kw_content_equal( ecl_kw1 , ecl_fkw )); diff --git a/ThirdParty/Ert/libecl/tests/ecl_kw_fread.c b/ThirdParty/Ert/libecl/tests/ecl_kw_fread.c index 69871c8562..be6fd6569b 100644 --- a/ThirdParty/Ert/libecl/tests/ecl_kw_fread.c +++ b/ThirdParty/Ert/libecl/tests/ecl_kw_fread.c @@ -44,7 +44,7 @@ void test_truncated(const char * filename , offset_type truncate_size) { void test_fread_alloc() { test_work_area_type * work_area = test_work_area_alloc("ecl_kw_fread" ); { - ecl_kw_type * kw1 = ecl_kw_alloc( "INT" , 100 , ECL_INT_TYPE ); + ecl_kw_type * kw1 = ecl_kw_alloc( "INT" , 100 , ECL_INT ); int i; for (i=0; i < 100; i++) ecl_kw_iset_int( kw1 , i , i ); diff --git a/ThirdParty/Ert/libecl/tests/ecl_kw_grdecl.c b/ThirdParty/Ert/libecl/tests/ecl_kw_grdecl.c index 6dafd0a90d..bf3a3185b2 100644 --- a/ThirdParty/Ert/libecl/tests/ecl_kw_grdecl.c +++ b/ThirdParty/Ert/libecl/tests/ecl_kw_grdecl.c @@ -26,7 +26,7 @@ int main(int argc , char ** argv) { int i; - ecl_kw_type * ecl_kw = ecl_kw_alloc("HEAD" , 10 , ECL_INT_TYPE); + ecl_kw_type * ecl_kw = ecl_kw_alloc("HEAD" , 10 , ECL_INT); for (i=0; i < 10; i++) ecl_kw_iset_int(ecl_kw , i , i ); @@ -40,7 +40,7 @@ int main(int argc , char ** argv) { stream = util_fopen( "FILE.grdecl" , "r"); { - ecl_kw_type * ecl_kw2 = ecl_kw_fscanf_alloc_grdecl( stream , "HEAD" , 10 , ECL_INT_TYPE); + ecl_kw_type * ecl_kw2 = ecl_kw_fscanf_alloc_grdecl( stream , "HEAD" , 10 , ECL_INT); test_assert_not_NULL( ecl_kw2 ); test_assert_true( ecl_kw_equal( ecl_kw , ecl_kw2)); @@ -54,10 +54,10 @@ int main(int argc , char ** argv) { stream = util_fopen( "FILE.grdecl" , "r"); { - ecl_kw_type * ecl_kw2 = ecl_kw_fscanf_alloc_grdecl( stream , "HEAD" , 10 , ECL_INT_TYPE); + ecl_kw_type * ecl_kw2 = ecl_kw_fscanf_alloc_grdecl( stream , "HEAD" , 10 , ECL_INT); test_assert_NULL( ecl_kw2 ); - ecl_kw2 = ecl_kw_fscanf_alloc_grdecl( stream , "HEAD1234" , 10 , ECL_INT_TYPE); + ecl_kw2 = ecl_kw_fscanf_alloc_grdecl( stream , "HEAD1234" , 10 , ECL_INT); test_assert_not_NULL( ecl_kw2 ); test_assert_string_equal( ecl_kw_get_header( ecl_kw2 ) , "HEAD1234" ); diff --git a/ThirdParty/Ert/libecl/tests/ecl_kw_init.c b/ThirdParty/Ert/libecl/tests/ecl_kw_init.c index 79da2ef774..9a95fdfe7e 100644 --- a/ThirdParty/Ert/libecl/tests/ecl_kw_init.c +++ b/ThirdParty/Ert/libecl/tests/ecl_kw_init.c @@ -27,7 +27,7 @@ void test_int() { size_t N = 1000; int i; - ecl_kw_type * kw = ecl_kw_alloc("KW" , N , ECL_INT_TYPE); + ecl_kw_type * kw = ecl_kw_alloc("KW" , N , ECL_INT); for (i=0; i < N; i++) test_assert_int_equal( 0 , ecl_kw_iget_int( kw , i )); @@ -38,7 +38,7 @@ void test_int() { void test_double() { size_t N = 1000; double i; - ecl_kw_type * kw = ecl_kw_alloc("KW" , N , ECL_DOUBLE_TYPE); + ecl_kw_type * kw = ecl_kw_alloc("KW" , N , ECL_DOUBLE); for (i=0; i < N; i++) test_assert_double_equal( 0 , ecl_kw_iget_double( kw , i )); @@ -49,7 +49,7 @@ void test_double() { void test_float() { size_t N = 1000; int i; - ecl_kw_type * kw = ecl_kw_alloc("KW" , N , ECL_FLOAT_TYPE); + ecl_kw_type * kw = ecl_kw_alloc("KW" , N , ECL_FLOAT); for (i=0; i < N; i++) test_assert_int_equal( 0 , ecl_kw_iget_float( kw , i )); diff --git a/ThirdParty/Ert/libecl/tests/ecl_kw_ix_types.c b/ThirdParty/Ert/libecl/tests/ecl_kw_ix_types.c deleted file mode 100644 index 9c2dec9164..0000000000 --- a/ThirdParty/Ert/libecl/tests/ecl_kw_ix_types.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright (C) 2017 Statoil ASA, Norway. - - The file 'ecl_kw_ix_types.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include - -#include - -#include -#include - - -/* - The behaviour of the ECL_C010_TYPE is quite unclear; we therefor do - not alloaw instanstiation of keywords with this type. -*/ - - -void test_create_ECL_C010_TYPE() { - ecl_kw_type * ecl_kw = ecl_kw_alloc("TEST" , 1000 , ECL_C010_TYPE ); - test_assert_NULL( ecl_kw ); -} - - -int main( int argc , char ** argv) { - test_create_ECL_C010_TYPE(); -} diff --git a/ThirdParty/Ert/libecl/tests/ecl_layer.c b/ThirdParty/Ert/libecl/tests/ecl_layer.c index 891cefff07..e6420cecc4 100644 --- a/ThirdParty/Ert/libecl/tests/ecl_layer.c +++ b/ThirdParty/Ert/libecl/tests/ecl_layer.c @@ -19,7 +19,6 @@ #include #include -#include #include #include diff --git a/ThirdParty/Ert/libecl/tests/ecl_layer_statoil.c b/ThirdParty/Ert/libecl/tests/ecl_layer_statoil.c index 9969aab104..df41e92c53 100644 --- a/ThirdParty/Ert/libecl/tests/ecl_layer_statoil.c +++ b/ThirdParty/Ert/libecl/tests/ecl_layer_statoil.c @@ -28,7 +28,7 @@ ecl_kw_type * alloc_faultblock_kw( const char * filename, int grid_size) { FILE * stream = util_fopen( filename , "r"); - ecl_kw_type * kw = ecl_kw_fscanf_alloc_grdecl( stream , "FAULTBLK" , grid_size , ECL_INT_TYPE ); + ecl_kw_type * kw = ecl_kw_fscanf_alloc_grdecl( stream , "FAULTBLK" , grid_size , ECL_INT ); fclose( stream ); return kw; diff --git a/ThirdParty/Ert/libecl/tests/ecl_lfs.c b/ThirdParty/Ert/libecl/tests/ecl_lfs.c index 871b7bfa0a..d89181e6fe 100644 --- a/ThirdParty/Ert/libecl/tests/ecl_lfs.c +++ b/ThirdParty/Ert/libecl/tests/ecl_lfs.c @@ -23,6 +23,7 @@ #include #include #include +#include @@ -30,7 +31,7 @@ int main( int argc , char ** argv) { int num_kw = 1000; // Total file size should roughly exceed 2GB int kw_size = 600000; - ecl_kw_type * kw = ecl_kw_alloc("KW" , kw_size , ECL_INT_TYPE ); + ecl_kw_type * kw = ecl_kw_alloc("KW" , kw_size , ECL_INT ); rng_type * rng = rng_alloc( MZRAN , INIT_DEFAULT ); int i; offset_type file_size; diff --git a/ThirdParty/Ert/libecl/tests/ecl_nnc_export.c b/ThirdParty/Ert/libecl/tests/ecl_nnc_export.c index 33845e49a3..527530435a 100644 --- a/ThirdParty/Ert/libecl/tests/ecl_nnc_export.c +++ b/ThirdParty/Ert/libecl/tests/ecl_nnc_export.c @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -231,6 +232,20 @@ void test_export(const char * name, bool have_tran_data) { for (int i =0; i < ecl_nnc_export_get_size( grid ); i++) test_assert_true( ecl_nnc_equal( &nnc_data1[i] , &nnc_data2[i] )); + { + ecl_nnc_geometry_type * nnc_geo = ecl_nnc_geometry_alloc( grid ); + test_assert_int_equal( ecl_nnc_export_get_size( grid ), ecl_nnc_geometry_size( nnc_geo )); + for (int i=0; i < ecl_nnc_geometry_size( nnc_geo ); i++) { + const ecl_nnc_pair_type *nnc_pair = ecl_nnc_geometry_iget( nnc_geo , i ); + ecl_nnc_type * nnc1 = &nnc_data1[i]; + + test_assert_int_equal( nnc_pair->grid_nr1 , nnc1->grid_nr1 ); + test_assert_int_equal( nnc_pair->grid_nr2 , nnc1->grid_nr2 ); + test_assert_int_equal( nnc_pair->global_index1 , nnc1->global_index1 ); + test_assert_int_equal( nnc_pair->global_index2 , nnc1->global_index2 ); + } + ecl_nnc_geometry_free( nnc_geo ); + } free( nnc_data2 ); free( nnc_data1 ); diff --git a/ThirdParty/Ert/libecl/tests/ecl_nnc_geometry.c b/ThirdParty/Ert/libecl/tests/ecl_nnc_geometry.c new file mode 100644 index 0000000000..276a7a30c1 --- /dev/null +++ b/ThirdParty/Ert/libecl/tests/ecl_nnc_geometry.c @@ -0,0 +1,60 @@ +/* + Copyright (C) 2017 Statoil ASA, Norway. + + The file 'ecl_nnc_geometry.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT 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. + + ERT 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 + for more details. +*/ +#include +#include + +#include +#include +#include +#include +#include +#include + + +void test_create_empty() { + ecl_grid_type * grid = ecl_grid_alloc_rectangular(10,10,10,1,1,1,NULL); + ecl_nnc_geometry_type * nnc_geo = ecl_nnc_geometry_alloc( grid ); + test_assert_true( ecl_nnc_geometry_is_instance( nnc_geo )); + test_assert_int_equal( ecl_nnc_geometry_size( nnc_geo ) , 0 ); + ecl_nnc_geometry_free( nnc_geo ); + ecl_grid_free( grid ); +} + +void test_create_simple() { + int nx = 10; + int ny = 10; + int nz = 10; + ecl_grid_type * grid0 = ecl_grid_alloc_rectangular(nx,ny,nz,1,1,1,NULL); + + ecl_grid_add_self_nnc(grid0, 0 ,nx*ny + 0, 0 ); + ecl_grid_add_self_nnc(grid0, 1 ,nx*ny + 1, 1 ); + ecl_grid_add_self_nnc(grid0, 2 ,nx*ny + 2, 2 ); + { + ecl_nnc_geometry_type * nnc_geo = ecl_nnc_geometry_alloc( grid0 ); + test_assert_int_equal( ecl_nnc_geometry_size( nnc_geo ) , 3 ); + ecl_nnc_geometry_free( nnc_geo ); + } + ecl_grid_free( grid0 ); +} + + +int main(int argc , char ** argv) { + util_install_signals( ); + test_create_empty( ); + test_create_simple( ); +} diff --git a/ThirdParty/Ert/libecl/tests/ecl_rst_file.c b/ThirdParty/Ert/libecl/tests/ecl_rst_file.c index 5be806b92b..7d9c149180 100644 --- a/ThirdParty/Ert/libecl/tests/ecl_rst_file.c +++ b/ThirdParty/Ert/libecl/tests/ecl_rst_file.c @@ -25,18 +25,19 @@ #include #include #include +#include -void write_keyword( fortio_type * fortio , const char * kw, ecl_type_enum ecl_type ) { - ecl_kw_type * ecl_kw = ecl_kw_alloc( kw , 1000 , ecl_type ); +void write_keyword( fortio_type * fortio , const char * kw, ecl_data_type data_type ) { + ecl_kw_type * ecl_kw = ecl_kw_alloc( kw , 1000 , data_type ); ecl_kw_fwrite( ecl_kw , fortio ); ecl_kw_free( ecl_kw ); } void write_seqnum( fortio_type * fortio , int report_step ) { - ecl_kw_type * ecl_kw = ecl_kw_alloc( SEQNUM_KW , 1 , ECL_INT_TYPE ); + ecl_kw_type * ecl_kw = ecl_kw_alloc( SEQNUM_KW , 1 , ECL_INT); ecl_kw_iset_int( ecl_kw , 0 , report_step ); ecl_kw_fwrite( ecl_kw , fortio ); ecl_kw_free( ecl_kw ); @@ -68,13 +69,13 @@ void test_Xfile() { { fortio_type * f = fortio_open_writer( "TEST.X0010" , false , ECL_ENDIAN_FLIP); - write_keyword( f , "INTEHEAD" , ECL_INT_TYPE ); - write_keyword( f , "PRESSURE" , ECL_FLOAT_TYPE ); - write_keyword( f , "SWAT" , ECL_FLOAT_TYPE ); + write_keyword( f , "INTEHEAD" , ECL_INT); + write_keyword( f , "PRESSURE" , ECL_FLOAT); + write_keyword( f , "SWAT" , ECL_FLOAT); - write_keyword( f , "INTEHEAD" , ECL_INT_TYPE ); - write_keyword( f , "PRESSURE" , ECL_FLOAT_TYPE ); - write_keyword( f , "SWAT" , ECL_FLOAT_TYPE ); + write_keyword( f , "INTEHEAD" , ECL_INT); + write_keyword( f , "PRESSURE" , ECL_FLOAT); + write_keyword( f , "SWAT" , ECL_FLOAT); fortio_fclose( f ); } @@ -92,21 +93,21 @@ void test_UNRST0() { { fortio_type * f = fortio_open_writer( "TEST.UNRST" , false , ECL_ENDIAN_FLIP); write_seqnum( f , 0 ); - write_keyword( f , "INTEHEAD" , ECL_INT_TYPE ); - write_keyword( f , "PRESSURE" , ECL_FLOAT_TYPE ); - write_keyword( f , "SWAT" , ECL_FLOAT_TYPE ); + write_keyword( f , "INTEHEAD" , ECL_INT); + write_keyword( f , "PRESSURE" , ECL_FLOAT); + write_keyword( f , "SWAT" , ECL_FLOAT); pos10 = fortio_ftell( f ); write_seqnum( f , 10 ); - write_keyword( f , "INTEHEAD" , ECL_INT_TYPE ); - write_keyword( f , "PRESSURE" , ECL_FLOAT_TYPE ); - write_keyword( f , "SWAT" , ECL_FLOAT_TYPE ); + write_keyword( f , "INTEHEAD" , ECL_INT); + write_keyword( f , "PRESSURE" , ECL_FLOAT); + write_keyword( f , "SWAT" , ECL_FLOAT); pos20 = fortio_ftell( f ); write_seqnum( f , 20 ); - write_keyword( f , "INTEHEAD" , ECL_INT_TYPE ); - write_keyword( f , "PRESSURE" , ECL_FLOAT_TYPE ); - write_keyword( f , "SWAT" , ECL_FLOAT_TYPE ); + write_keyword( f , "INTEHEAD" , ECL_INT); + write_keyword( f , "PRESSURE" , ECL_FLOAT); + write_keyword( f , "SWAT" , ECL_FLOAT); pos_end = fortio_ftell( f ); fortio_fclose( f ); @@ -131,21 +132,21 @@ void test_UNRST1() { fortio_type * f = fortio_open_writer( "TEST.UNRST" , false , ECL_ENDIAN_FLIP); pos5 = fortio_ftell( f ); write_seqnum( f , 5 ); - write_keyword( f , "INTEHEAD" , ECL_INT_TYPE ); - write_keyword( f , "PRESSURE" , ECL_FLOAT_TYPE ); - write_keyword( f , "SWAT" , ECL_FLOAT_TYPE ); + write_keyword( f , "INTEHEAD" , ECL_INT); + write_keyword( f , "PRESSURE" , ECL_FLOAT); + write_keyword( f , "SWAT" , ECL_FLOAT); pos10 = fortio_ftell( f ); write_seqnum( f , 10 ); - write_keyword( f , "INTEHEAD" , ECL_INT_TYPE ); - write_keyword( f , "PRESSURE" , ECL_FLOAT_TYPE ); - write_keyword( f , "SWAT" , ECL_FLOAT_TYPE ); + write_keyword( f , "INTEHEAD" , ECL_INT); + write_keyword( f , "PRESSURE" , ECL_FLOAT); + write_keyword( f , "SWAT" , ECL_FLOAT); pos20 = fortio_ftell( f ); write_seqnum( f , 20 ); - write_keyword( f , "INTEHEAD" , ECL_INT_TYPE ); - write_keyword( f , "PRESSURE" , ECL_FLOAT_TYPE ); - write_keyword( f , "SWAT" , ECL_FLOAT_TYPE ); + write_keyword( f , "INTEHEAD" , ECL_INT); + write_keyword( f , "PRESSURE" , ECL_FLOAT); + write_keyword( f , "SWAT" , ECL_FLOAT); pos_end = fortio_ftell( f ); fortio_fclose( f ); diff --git a/ThirdParty/Ert/libecl/tests/statoil_tests.cmake b/ThirdParty/Ert/libecl/tests/statoil_tests.cmake index 0681181613..8962b49fa2 100644 --- a/ThirdParty/Ert/libecl/tests/statoil_tests.cmake +++ b/ThirdParty/Ert/libecl/tests/statoil_tests.cmake @@ -1,21 +1,21 @@ add_executable( ecl_coarse_test ecl_coarse_test.c ) -target_link_libraries( ecl_coarse_test ecl test_util ) +target_link_libraries( ecl_coarse_test ecl ) add_test( ecl_coarse_test ${EXECUTABLE_OUTPUT_PATH}/ecl_coarse_test ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/LGCcase/LGC_TESTCASE2 ) add_executable( ecl_grid_layer_contains ecl_grid_layer_contains.c ) -target_link_libraries( ecl_grid_layer_contains ecl test_util ) +target_link_libraries( ecl_grid_layer_contains ecl ) add_test( ecl_grid_layer_contains1 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_layer_contains ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.EGRID ) add_test( ecl_grid_layer_contains2 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_layer_contains ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Mariner/MARINER.EGRID ) add_executable( ecl_restart_test ecl_restart_test.c ) -target_link_libraries( ecl_restart_test ecl test_util ) +target_link_libraries( ecl_restart_test ecl ) add_test( ecl_restart_test ${EXECUTABLE_OUTPUT_PATH}/ecl_restart_test ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.UNRST ) add_executable( ecl_nnc_export ecl_nnc_export.c ) -target_link_libraries( ecl_nnc_export ecl test_util ) +target_link_libraries( ecl_nnc_export ecl ) add_test (ecl_nnc_export1 ${EXECUTABLE_OUTPUT_PATH}/ecl_nnc_export ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE TRUE) add_test (ecl_nnc_export2 ${EXECUTABLE_OUTPUT_PATH}/ecl_nnc_export ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/10kcase/TEST10K_FLT_LGR_NNC TRUE) add_test (ecl_nnc_export3 ${EXECUTABLE_OUTPUT_PATH}/ecl_nnc_export ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Troll/MSW_LGR/2BRANCHES-CCEWELLPATH-NEW-SCH-TUNED-AR3 TRUE) @@ -25,17 +25,17 @@ add_test (ecl_nnc_export6 ${EXECUTABLE_OUTPUT_PATH}/ecl_nnc_export ${PROJECT_SO add_test (ecl_nnc_export7 ${EXECUTABLE_OUTPUT_PATH}/ecl_nnc_export ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/TYRIHANS/BASE20150218_MULTFLT FALSE) add_executable( ecl_nnc_export_get_tran ecl_nnc_export_get_tran.c ) -target_link_libraries( ecl_nnc_export_get_tran ecl test_util ) +target_link_libraries( ecl_nnc_export_get_tran ecl ) add_test (ecl_nnc_export_get_tran ${EXECUTABLE_OUTPUT_PATH}/ecl_nnc_export_get_tran ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Troll/MSW_LGR/2BRANCHES-CCEWELLPATH-NEW-SCH-TUNED-AR3) add_executable( ecl_util_make_date_shift ecl_util_make_date_shift.c ) -target_link_libraries( ecl_util_make_date_shift ecl test_util ) +target_link_libraries( ecl_util_make_date_shift ecl ) add_test( ecl_util_make_date_shift ${EXECUTABLE_OUTPUT_PATH}/ecl_util_make_date_shift ) add_executable( ecl_sum_case_exists ecl_sum_case_exists.c ) -target_link_libraries( ecl_sum_case_exists ecl test_util ) +target_link_libraries( ecl_sum_case_exists ecl ) add_test( ecl_sum_case_exists ${EXECUTABLE_OUTPUT_PATH}/ecl_sum_case_exists ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/GurbatSummary/missingHeader/ECLIPSE @@ -43,62 +43,61 @@ add_test( ecl_sum_case_exists ${EXECUTABLE_OUTPUT_PATH}/ecl_sum_case_exists add_executable( ecl_grid_lgr_name ecl_grid_lgr_name.c ) -target_link_libraries( ecl_grid_lgr_name ecl test_util ) +target_link_libraries( ecl_grid_lgr_name ecl ) set_target_properties( ecl_grid_lgr_name PROPERTIES COMPILE_FLAGS "-Werror") add_test( ecl_grid_lgr_name ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_lgr_name ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Troll/MSW_LGR/2BRANCHES-CCEWELLPATH-NEW-SCH-TUNED-AR3.EGRID) add_executable( ecl_region ecl_region.c ) -target_link_libraries( ecl_region ecl test_util ) +target_link_libraries( ecl_region ecl ) add_test( ecl_region ${EXECUTABLE_OUTPUT_PATH}/ecl_region ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.EGRID ) add_executable( ecl_grid_fwrite ecl_grid_fwrite.c ) -target_link_libraries( ecl_grid_fwrite ecl test_util ) +target_link_libraries( ecl_grid_fwrite ecl ) add_test( ecl_grid_fwrite ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_fwrite ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.EGRID ) -add_executable( ecl_grid_cell_contains ecl_grid_cell_contains.c ) -target_link_libraries( ecl_grid_cell_contains ecl test_util ) -add_test( ecl_grid_cell_contains1 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_cell_contains 1 ) -add_test( ecl_grid_cell_contains2 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_cell_contains 2 ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.EGRID ) -add_test( ecl_grid_cell_contains3 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_cell_contains 3 ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/FF12/FF12_2013B2.EGRID ) +add_test( ecl_grid_cell_contains2 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_cell_contains ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.EGRID ) +add_test( ecl_grid_cell_contains3 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_cell_contains ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/FF12/FF12_2013B2.EGRID ) +add_test( ecl_grid_cell_contains4 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_cell_contains ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Brazil/R3_ICD.EGRID ) -add_test( ecl_grid_cell_contains4 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_cell_contains 4 ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Brazil/R3_ICD.EGRID ) +add_executable( ecl_grid_cell_contains_wellpath ecl_grid_cell_contains_wellpath.c ) +target_link_libraries( ecl_grid_cell_contains_wellpath ecl ) +add_test( ecl_grid_cell_contains_wellpath1 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_cell_contains_wellpath ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/CellContains/model/SMS-0.EGRID ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/CellContains/R_PB-4H.jira ) add_executable( ecl_grid_cell_volume ecl_grid_cell_volume.c ) -target_link_libraries( ecl_grid_cell_volume ecl test_util ) +target_link_libraries( ecl_grid_cell_volume ecl ) add_test( ecl_grid_cell_volume1 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_cell_volume) add_test( ecl_grid_cell_volume2 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_cell_volume ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.EGRID ) add_test( ecl_grid_cell_volume3 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_cell_volume ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Heidrun/Summary/FF12_2013B3_CLEAN_RS.EGRID ) add_executable( ecl_region2region ecl_region2region_test.c ) -target_link_libraries( ecl_region2region ecl test_util ) +target_link_libraries( ecl_region2region ecl ) add_test( ecl_region2region ${EXECUTABLE_OUTPUT_PATH}/ecl_region2region ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/R2R/R2R.SMSPEC ) add_executable( ecl_grid_case ecl_grid_case.c ) -target_link_libraries( ecl_grid_case ecl test_util ) +target_link_libraries( ecl_grid_case ecl ) add_test( ecl_grid_case ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_case ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.EGRID ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE ) add_executable( ecl_lgr_test ecl_lgr_test.c ) -target_link_libraries( ecl_lgr_test ecl test_util ) +target_link_libraries( ecl_lgr_test ecl ) add_test( ecl_lgr_test1 ${EXECUTABLE_OUTPUT_PATH}/ecl_lgr_test ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/10kcase/TEST10K_FLT_LGR_NNC.EGRID) add_test( ecl_lgr_test2 ${EXECUTABLE_OUTPUT_PATH}/ecl_lgr_test ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/10kcase/TEST10K_FLT_LGR_NNC.GRID) add_test( ecl_lgr_test3 ${EXECUTABLE_OUTPUT_PATH}/ecl_lgr_test ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Troll/MSW_LGR/2BRANCHES-CCEWELLPATH-NEW-SCH-TUNED-AR3.EGRID ) add_executable( ecl_grid_simple ecl_grid_simple.c ) -target_link_libraries( ecl_grid_simple ecl test_util ) +target_link_libraries( ecl_grid_simple ecl ) add_test( ecl_grid_simple ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_simple ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.EGRID ) -add_test( ecl_grid_ecl2015_1 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_simple ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Eclipse2015_NNC_BUG/FF15_2015B2_LGRM_RDI15_HIST_RDIREAL1_NOSIM_GRID.EGRID ) add_test( ecl_grid_ecl2015_2 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_simple ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Eclipse2015_NNC_BUG/FF15_2015B2_LGRM_RDI15_HIST_RDIREAL1_20142.EGRID ) add_executable( ecl_grid_export_statoil ecl_grid_export.c ) -target_link_libraries( ecl_grid_export_statoil ecl test_util ) +target_link_libraries( ecl_grid_export_statoil ecl ) add_test( ecl_grid_export_statoil ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_export_statoil ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.EGRID ) add_executable( ecl_grid_volume ecl_grid_volume.c ) -target_link_libraries( ecl_grid_volume ecl test_util ) +target_link_libraries( ecl_grid_volume ecl ) add_test( ecl_grid_volume1 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_volume ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE ) add_test( ecl_grid_volume2 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_volume ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/VolumeTest/TEST1 ) add_test( ecl_grid_volume3 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_volume ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/OsebergSyd/Omega/OMEGA-0) @@ -112,7 +111,7 @@ add_test( ecl_grid_volume4 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_volume ${PROJECT_ # add_test( ecl_grid_volume5 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_volume ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Heidrun/Summary/FF12_2013B3_CLEAN_RS) add_executable( ecl_grid_dims ecl_grid_dims.c ) -target_link_libraries( ecl_grid_dims ecl test_util ) +target_link_libraries( ecl_grid_dims ecl ) add_test( ecl_grid_dims0 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_dims ) add_test( ecl_grid_dims1 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_dims ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.EGRID ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.INIT ) @@ -124,7 +123,7 @@ add_test( ecl_grid_dims5 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_dims ${PROJECT_SOUR add_executable( ecl_nnc_test ecl_nnc_test.c ) -target_link_libraries( ecl_nnc_test ecl test_util ) +target_link_libraries( ecl_nnc_test ecl ) add_test (ecl_nnc_test1 ${EXECUTABLE_OUTPUT_PATH}/ecl_nnc_test ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.EGRID ) add_test (ecl_nnc_test2 ${EXECUTABLE_OUTPUT_PATH}/ecl_nnc_test ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/10kcase/TEST10K_FLT_LGR_NNC.EGRID ) add_test (ecl_nnc_test3 ${EXECUTABLE_OUTPUT_PATH}/ecl_nnc_test ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Troll/MSW_LGR/2BRANCHES-CCEWELLPATH-NEW-SCH-TUNED-AR3.EGRID) @@ -133,21 +132,21 @@ add_test (ecl_nnc_test5 ${EXECUTABLE_OUTPUT_PATH}/ecl_nnc_test ${PROJECT_SOURCE add_executable( ecl_layer_statoil ecl_layer_statoil.c ) -target_link_libraries( ecl_layer_statoil ecl test_util ) +target_link_libraries( ecl_layer_statoil ecl ) add_test(ecl_layer_statoil ${EXECUTABLE_OUTPUT_PATH}/ecl_layer_statoil ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Mariner/MARINER.EGRID ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Mariner/faultblock.grdecl) add_executable( ecl_dualp ecl_dualp.c ) -target_link_libraries( ecl_dualp ecl test_util ) +target_link_libraries( ecl_dualp ecl ) add_test( ecl_dualp ${EXECUTABLE_OUTPUT_PATH}/ecl_dualp ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/LGCcase/LGC_TESTCASE2 ) add_executable( ecl_sum_test ecl_sum_test.c ) -target_link_libraries( ecl_sum_test ecl test_util ) +target_link_libraries( ecl_sum_test ecl ) add_test( ecl_sum_test ${EXECUTABLE_OUTPUT_PATH}/ecl_sum_test ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE ) add_executable( ecl_sum_report_step_equal ecl_sum_report_step_equal.c ) -target_link_libraries( ecl_sum_report_step_equal ecl test_util ) +target_link_libraries( ecl_sum_report_step_equal ecl ) add_test( ecl_sum_report_step_equal1 ${EXECUTABLE_OUTPUT_PATH}/ecl_sum_report_step_equal ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Snorre/SNORRE FALSE) add_test( ecl_sum_report_step_equal2 ${EXECUTABLE_OUTPUT_PATH}/ecl_sum_report_step_equal ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE TRUE) add_test( ecl_sum_report_step_equal3 ${EXECUTABLE_OUTPUT_PATH}/ecl_sum_report_step_equal ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/modGurbat/extraMinistep/ECLIPSE TRUE) @@ -156,7 +155,7 @@ add_test( ecl_sum_report_step_equal5 ${EXECUTABLE_OUTPUT_PATH}/ecl_sum_report_st add_test( ecl_sum_report_step_equal6 ${EXECUTABLE_OUTPUT_PATH}/ecl_sum_report_step_equal ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Snorre/SNORRE ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Snorre2/SNORRE2 FALSE) add_executable( ecl_sum_report_step_compatible ecl_sum_report_step_compatible.c ) -target_link_libraries( ecl_sum_report_step_compatible ecl test_util ) +target_link_libraries( ecl_sum_report_step_compatible ecl ) add_test( ecl_sum_report_step_compatible1 ${EXECUTABLE_OUTPUT_PATH}/ecl_sum_report_step_compatible ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Snorre/SNORRE FALSE) add_test( ecl_sum_report_step_compatible2 ${EXECUTABLE_OUTPUT_PATH}/ecl_sum_report_step_compatible ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE TRUE) add_test( ecl_sum_report_step_compatible3 ${EXECUTABLE_OUTPUT_PATH}/ecl_sum_report_step_compatible ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/modGurbat/extraMinistep/ECLIPSE TRUE) @@ -166,40 +165,40 @@ add_test( ecl_sum_report_step_compatible6 ${EXECUTABLE_OUTPUT_PATH}/ecl_sum_repo if (HAVE_UTIL_ABORT_INTERCEPT) add_executable( ecl_fortio ecl_fortio.c ) - target_link_libraries( ecl_fortio ecl test_util ) + target_link_libraries( ecl_fortio ecl ) add_test( ecl_fortio ${EXECUTABLE_OUTPUT_PATH}/ecl_fortio ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.UNRST ) set_property( TEST ecl_fortio PROPERTY LABELS StatoilData) endif() add_executable( ecl_file ecl_file.c ) -target_link_libraries( ecl_file ecl test_util ) +target_link_libraries( ecl_file ecl ) add_test( ecl_file ${EXECUTABLE_OUTPUT_PATH}/ecl_file ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.UNRST ECLIPSE.UNRST) add_executable( ecl_fmt ecl_fmt.c ) -target_link_libraries( ecl_fmt ecl test_util ) +target_link_libraries( ecl_fmt ecl ) add_test( ecl_fmt ${EXECUTABLE_OUTPUT_PATH}/ecl_fmt ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.UNRST ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.DATA) add_executable( ecl_rsthead ecl_rsthead.c ) -target_link_libraries( ecl_rsthead ecl test_util ) +target_link_libraries( ecl_rsthead ecl ) add_test( ecl_rsthead ${EXECUTABLE_OUTPUT_PATH}/ecl_rsthead ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.UNRST ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/DualPoro/DUALPORO.X0005 ) add_executable( ecl_smspec ecl_smspec.c ) -target_link_libraries( ecl_smspec ecl test_util ) +target_link_libraries( ecl_smspec ecl ) add_test( ecl_smspec ${EXECUTABLE_OUTPUT_PATH}/ecl_smspec ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.SMSPEC ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Heidrun/Summary/FF12_2013B3_CLEAN_RS.SMSPEC ) add_executable( ecl_rft ecl_rft.c ) -target_link_libraries( ecl_rft ecl test_util ) +target_link_libraries( ecl_rft ecl ) add_test( ecl_rft_rft ${EXECUTABLE_OUTPUT_PATH}/ecl_rft ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.RFT RFT) add_test( ecl_rft_rft_rw ${EXECUTABLE_OUTPUT_PATH}/ecl_rft ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.RFT RFT_RW) add_test( ecl_rft_plt ${EXECUTABLE_OUTPUT_PATH}/ecl_rft ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/RFT/TEST1_1A.RFT PLT) add_test( ecl_rft_plt ${EXECUTABLE_OUTPUT_PATH}/ecl_rft ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/RFT/RFT2.RFT MSW-PLT) add_executable( ecl_grid_copy_statoil ecl_grid_copy_statoil.c ) -target_link_libraries( ecl_grid_copy_statoil ecl test_util ) +target_link_libraries( ecl_grid_copy_statoil ecl ) add_test( ecl_grid_copy_statoil1 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_copy_statoil ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.EGRID ) @@ -213,7 +212,7 @@ add_test( ecl_grid_copy_statoil4 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_copy_statoil add_executable( ecl_fault_block_layer_statoil ecl_fault_block_layer_statoil.c ) -target_link_libraries( ecl_fault_block_layer_statoil ecl test_util ) +target_link_libraries( ecl_fault_block_layer_statoil ecl ) add_test( ecl_fault_block_layer_statoil ${EXECUTABLE_OUTPUT_PATH}/ecl_fault_block_layer_statoil ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Mariner/MARINER.EGRID ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Mariner/faultblock.grdecl) @@ -293,5 +292,4 @@ set_property( TEST ecl_grid_copy_statoil4 PROPERTY LABELS StatoilData ) set_property( TEST ecl_layer_statoil PROPERTY LABELS StatoilData ) set_property( TEST ecl_grid_layer_contains1 PROPERTY LABELS StatoilData ) set_property( TEST ecl_grid_layer_contains2 PROPERTY LABELS StatoilData ) -set_property( TEST ecl_grid_ecl2015_1 PROPERTY LABELS StatoilData ) set_property( TEST ecl_grid_ecl2015_2 PROPERTY LABELS StatoilData ) diff --git a/ThirdParty/Ert/libecl/tests/tests.cmake b/ThirdParty/Ert/libecl/tests/tests.cmake index bc8105323d..9da02ab0f8 100644 --- a/ThirdParty/Ert/libecl/tests/tests.cmake +++ b/ThirdParty/Ert/libecl/tests/tests.cmake @@ -1,99 +1,103 @@ +add_executable( ecl_nnc_geometry ecl_nnc_geometry.c ) +target_link_libraries( ecl_nnc_geometry ecl ) +add_test( ecl_nnc_geometry ${EXECUTABLE_OUTPUT_PATH}/ecl_nnc_geometry ) + add_executable( ecl_alloc_grid_dxv_dyv_dzv ecl_alloc_grid_dxv_dyv_dzv.c ) -target_link_libraries( ecl_alloc_grid_dxv_dyv_dzv ecl test_util ) +target_link_libraries( ecl_alloc_grid_dxv_dyv_dzv ecl ) add_test( ecl_alloc_grid_dxv_dyv_dzv ${EXECUTABLE_OUTPUT_PATH}/ecl_alloc_grid_dxv_dyv_dzv ) +add_executable( ecl_alloc_cpgrid ecl_alloc_cpgrid.c ) +target_link_libraries( ecl_alloc_cpgrid ecl ) +add_test( ecl_alloc_cpgrid ${EXECUTABLE_OUTPUT_PATH}/ecl_alloc_cpgrid ) + add_executable( ecl_kw_init ecl_kw_init.c ) -target_link_libraries( ecl_kw_init ecl test_util ) +target_link_libraries( ecl_kw_init ecl ) add_test( ecl_kw_init ${EXECUTABLE_OUTPUT_PATH}/ecl_kw_init ) -add_executable( ecl_kw_ix_types ecl_kw_ix_types.c ) -target_link_libraries( ecl_kw_ix_types ecl test_util ) -add_test( ecl_kw_ix_types ${EXECUTABLE_OUTPUT_PATH}/ecl_kw_ix_types ) - add_executable( ecl_grid_init_fwrite ecl_grid_init_fwrite.c ) -target_link_libraries( ecl_grid_init_fwrite ecl test_util ) +target_link_libraries( ecl_grid_init_fwrite ecl ) add_test( ecl_grid_init_fwrite ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_init_fwrite ) add_executable( ecl_init_file ecl_init_file.c ) -target_link_libraries( ecl_init_file ecl test_util ) +target_link_libraries( ecl_init_file ecl ) add_test( ecl_init_file ${EXECUTABLE_OUTPUT_PATH}/ecl_kw_init ) add_executable( ecl_kw_fread ecl_kw_fread.c ) -target_link_libraries( ecl_kw_fread ecl test_util ) +target_link_libraries( ecl_kw_fread ecl ) add_test( ecl_kw_fread ${EXECUTABLE_OUTPUT_PATH}/ecl_kw_fread ) add_executable( ecl_valid_basename ecl_valid_basename.c ) -target_link_libraries( ecl_valid_basename ecl test_util ) +target_link_libraries( ecl_valid_basename ecl ) add_test( ecl_valid_basename ${EXECUTABLE_OUTPUT_PATH}/ecl_valid_basename) add_executable( ecl_util_make_date_no_shift ecl_util_make_date_no_shift.c ) -target_link_libraries( ecl_util_make_date_no_shift ecl test_util ) +target_link_libraries( ecl_util_make_date_no_shift ecl ) add_test( ecl_util_make_date_no_shift ${EXECUTABLE_OUTPUT_PATH}/ecl_util_make_date_no_shift ) add_executable( ecl_sum_writer ecl_sum_writer.c ) -target_link_libraries( ecl_sum_writer ecl test_util ) +target_link_libraries( ecl_sum_writer ecl ) add_test( ecl_sum_writer ${EXECUTABLE_OUTPUT_PATH}/ecl_sum_writer ) add_executable( ecl_grid_add_nnc ecl_grid_add_nnc.c ) -target_link_libraries( ecl_grid_add_nnc ecl test_util ) +target_link_libraries( ecl_grid_add_nnc ecl ) add_test( ecl_grid_add_nnc ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_add_nnc ) add_executable( ecl_grid_create ecl_grid_create.c ) -target_link_libraries( ecl_grid_create ecl test_util ) +target_link_libraries( ecl_grid_create ecl ) add_test( ecl_grid_create ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_create ) add_executable( ecl_grid_DEPTHZ ecl_grid_DEPTHZ.c ) -target_link_libraries( ecl_grid_DEPTHZ ecl test_util ) +target_link_libraries( ecl_grid_DEPTHZ ecl ) add_test( ecl_grid_DEPTHZ ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_DEPTHZ ) add_executable( ecl_grid_reset_actnum ecl_grid_reset_actnum.c ) -target_link_libraries( ecl_grid_reset_actnum ecl test_util ) +target_link_libraries( ecl_grid_reset_actnum ecl ) add_test( ecl_grid_reset_actnum ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_reset_actnum ) add_executable( ecl_nnc_info_test ecl_nnc_info_test.c ) -target_link_libraries( ecl_nnc_info_test ecl test_util ) +target_link_libraries( ecl_nnc_info_test ecl ) add_test (ecl_nnc_info_test ${EXECUTABLE_OUTPUT_PATH}/ecl_nnc_info_test ) add_executable( ecl_nnc_vector ecl_nnc_vector.c ) -target_link_libraries( ecl_nnc_vector ecl test_util ) +target_link_libraries( ecl_nnc_vector ecl ) add_test(ecl_nnc_vector ${EXECUTABLE_OUTPUT_PATH}/ecl_nnc_vector ) add_executable( ecl_kw_grdecl ecl_kw_grdecl.c ) -target_link_libraries( ecl_kw_grdecl ecl test_util ) +target_link_libraries( ecl_kw_grdecl ecl ) add_test( ecl_kw_grdecl ${EXECUTABLE_OUTPUT_PATH}/ecl_kw_grdecl ) add_executable( ecl_kw_equal ecl_kw_equal.c ) -target_link_libraries( ecl_kw_equal ecl test_util ) +target_link_libraries( ecl_kw_equal ecl ) add_test( ecl_kw_equal ${EXECUTABLE_OUTPUT_PATH}/ecl_kw_equal ) add_executable( ecl_kw_cmp_string ecl_kw_cmp_string.c ) -target_link_libraries( ecl_kw_cmp_string ecl test_util ) +target_link_libraries( ecl_kw_cmp_string ecl ) add_test( ecl_kw_cmp_string ${EXECUTABLE_OUTPUT_PATH}/ecl_kw_cmp_string ) add_executable( ecl_util_month_range ecl_util_month_range.c ) -target_link_libraries( ecl_util_month_range ecl test_util ) +target_link_libraries( ecl_util_month_range ecl ) add_test( ecl_util_month_range ${EXECUTABLE_OUTPUT_PATH}/ecl_util_month_range ) if (HAVE_UTIL_ABORT_INTERCEPT) add_executable( ecl_grid_corner ecl_grid_corner.c ) - target_link_libraries( ecl_grid_corner ecl test_util ) + target_link_libraries( ecl_grid_corner ecl ) add_test( ecl_grid_corner ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_corner ) add_executable( ecl_layer ecl_layer.c ) - target_link_libraries( ecl_layer ecl test_util ) + target_link_libraries( ecl_layer ecl ) add_test(ecl_layer ${EXECUTABLE_OUTPUT_PATH}/ecl_layer ) endif() add_executable( ecl_rft_cell ecl_rft_cell.c ) -target_link_libraries( ecl_rft_cell ecl test_util ) +target_link_libraries( ecl_rft_cell ecl ) add_test( ecl_rft_cell ${EXECUTABLE_OUTPUT_PATH}/ecl_rft_cell ) add_executable( ecl_grid_copy ecl_grid_copy.c ) -target_link_libraries( ecl_grid_copy ecl test_util ) +target_link_libraries( ecl_grid_copy ecl ) add_test( ecl_grid_copy ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_copy ) add_executable( ecl_get_num_cpu ecl_get_num_cpu_test.c ) -target_link_libraries( ecl_get_num_cpu ecl test_util ) +target_link_libraries( ecl_get_num_cpu ecl ) add_test( ecl_get_num_cpu ${EXECUTABLE_OUTPUT_PATH}/ecl_get_num_cpu ${PROJECT_SOURCE_DIR}/libecl/tests/data/num_cpu1 ${PROJECT_SOURCE_DIR}/libecl/tests/data/num_cpu2 @@ -101,13 +105,15 @@ add_test( ecl_get_num_cpu ${EXECUTABLE_OUTPUT_PATH}/ecl_get_num_cpu ${PROJECT_SOURCE_DIR}/libecl/tests/data/num_cpu4 ) add_executable( ecl_fault_block_layer ecl_fault_block_layer.c ) -target_link_libraries( ecl_fault_block_layer ecl test_util ) +target_link_libraries( ecl_fault_block_layer ecl ) add_test( ecl_fault_block_layer ${EXECUTABLE_OUTPUT_PATH}/ecl_fault_block_layer ) add_executable( ecl_grid_export ecl_grid_export.c ) -target_link_libraries( ecl_grid_export ecl test_util ) +target_link_libraries( ecl_grid_export ecl ) add_test( ecl_grid_export ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_export ) add_executable( ecl_rst_file ecl_rst_file.c ) -target_link_libraries( ecl_rst_file ecl test_util ) +target_link_libraries( ecl_rst_file ecl ert_util ) add_test( ecl_rst_file ${EXECUTABLE_OUTPUT_PATH}/ecl_rst_file ) + +add_test( ecl_grid_cell_contains1 ${EXECUTABLE_OUTPUT_PATH}/ecl_grid_cell_contains ) diff --git a/ThirdParty/Ert/libecl_well/include/ert/ecl_well/well_const.h b/ThirdParty/Ert/libecl_well/include/ert/ecl_well/well_const.h index ddca00c01a..41a2ade9f2 100644 --- a/ThirdParty/Ert/libecl_well/include/ert/ecl_well/well_const.h +++ b/ThirdParty/Ert/libecl_well/include/ert/ecl_well/well_const.h @@ -105,9 +105,9 @@ extern "C" { #define SCON_CF_INDEX 0 -#define XCON_WRAT_INDEX 46 -#define XCON_GRAT_INDEX 47 -#define XCON_ORAT_INDEX 48 +#define XCON_ORAT_INDEX 0 +#define XCON_WRAT_INDEX 1 +#define XCON_GRAT_INDEX 2 #define XCON_QR_INDEX 49 #define RSEG_LENGTH_INDEX 0 diff --git a/ThirdParty/Ert/libecl_well/include/ert/ecl_well/well_state.h b/ThirdParty/Ert/libecl_well/include/ert/ecl_well/well_state.h index d0042c8e29..1afe9eb488 100644 --- a/ThirdParty/Ert/libecl_well/include/ert/ecl_well/well_state.h +++ b/ThirdParty/Ert/libecl_well/include/ert/ecl_well/well_state.h @@ -82,6 +82,7 @@ extern "C" { bool well_state_is_open( const well_state_type * well_state ); int well_state_get_well_nr( const well_state_type * well_state ); + const well_conn_type * well_state_get_global_wellhead( const well_state_type * well_state ); const well_conn_type * well_state_iget_wellhead( const well_state_type * well_state , int grid_nr); const well_conn_type * well_state_get_wellhead( const well_state_type * well_state , const char * grid_name); diff --git a/ThirdParty/Ert/libecl_well/src/CMakeLists.txt b/ThirdParty/Ert/libecl_well/src/CMakeLists.txt index f71887f102..84eacde50a 100644 --- a/ThirdParty/Ert/libecl_well/src/CMakeLists.txt +++ b/ThirdParty/Ert/libecl_well/src/CMakeLists.txt @@ -32,7 +32,7 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ) include_directories( ${libgeometry_src_path} ) -add_library( ecl_well ${LIBRARY_TYPE} ${source_files} ) +add_library( ecl_well ${source_files} ) set_target_properties( ecl_well PROPERTIES VERSION ${ERT_VERSION_MAJOR}.${ERT_VERSION_MINOR} SOVERSION ${ERT_VERSION_MAJOR} ) target_link_libraries( ecl_well ecl ) if (USE_RUNPATH) diff --git a/ThirdParty/Ert/libecl_well/src/well_conn.c b/ThirdParty/Ert/libecl_well/src/well_conn.c index e084127cba..74e87521b7 100644 --- a/ThirdParty/Ert/libecl_well/src/well_conn.c +++ b/ThirdParty/Ert/libecl_well/src/well_conn.c @@ -227,6 +227,7 @@ well_conn_type * well_conn_alloc_from_kw( const ecl_kw_type * icon_kw , if (xcon_kw) { const int xcon_offset = header->nxconz * (header->ncwmax * well_nr + conn_nr); + conn->water_rate = ecl_kw_iget_as_double(xcon_kw, xcon_offset + XCON_WRAT_INDEX); conn->gas_rate = ecl_kw_iget_as_double(xcon_kw, xcon_offset + XCON_GRAT_INDEX); conn->oil_rate = ecl_kw_iget_as_double(xcon_kw, xcon_offset + XCON_ORAT_INDEX); diff --git a/ThirdParty/Ert/libecl_well/src/well_state.c b/ThirdParty/Ert/libecl_well/src/well_state.c index 20f38214d0..06baf2e8be 100644 --- a/ThirdParty/Ert/libecl_well/src/well_state.c +++ b/ThirdParty/Ert/libecl_well/src/well_state.c @@ -37,6 +37,8 @@ #include #include #include +#include +#include #include #include @@ -173,7 +175,7 @@ struct well_state_struct { double gas_rate; double water_rate; double volume_rate; - + ert_ecl_unit_enum unit_system; hash_type * connections; // hash well_segment_collection_type * segments; @@ -210,7 +212,7 @@ well_state_type * well_state_alloc(const char * well_name , int global_well_nr , well_state->gas_rate = 0; well_state->water_rate = 0; well_state->volume_rate = 0; - + well_state->unit_system = ECL_METRIC_UNITS; /* See documentation of the 'IWEL_UNDOCUMENTED_ZERO' in well_const.h */ if ((type == ECL_WELL_ZERO) && open) @@ -240,17 +242,44 @@ double well_state_get_volume_rate( const well_state_type * well_state) { } double well_state_get_oil_rate_si( const well_state_type * well_state ) { - return well_state->oil_rate; + double conversion_factor = 1; + + if (well_state->unit_system == ECL_METRIC_UNITS) + conversion_factor = 1.0 / ECL_UNITS_TIME_DAY; + else if (well_state->unit_system == ECL_FIELD_UNITS) + conversion_factor = ECL_UNITS_VOLUME_BARREL / ECL_UNITS_TIME_DAY; + else if (well_state->unit_system == ECL_LAB_UNITS) + conversion_factor = ECL_UNITS_VOLUME_MILLI_LITER / ECL_UNITS_TIME_HOUR; + + return well_state->oil_rate * conversion_factor; } double well_state_get_gas_rate_si( const well_state_type * well_state ) { - return well_state->gas_rate; + double conversion_factor = 1; + + if (well_state->unit_system == ECL_METRIC_UNITS) + conversion_factor = 1.0 / ECL_UNITS_TIME_DAY; + else if (well_state->unit_system == ECL_FIELD_UNITS) + conversion_factor = ECL_UNITS_VOLUME_GAS_FIELD / ECL_UNITS_TIME_DAY; + else if (well_state->unit_system == ECL_LAB_UNITS) + conversion_factor = ECL_UNITS_VOLUME_MILLI_LITER / ECL_UNITS_TIME_HOUR; + + return well_state->gas_rate * conversion_factor; } double well_state_get_water_rate_si( const well_state_type * well_state) { - return well_state->water_rate; + double conversion_factor = 1; + + if (well_state->unit_system == ECL_METRIC_UNITS) + conversion_factor = 1.0 / ECL_UNITS_TIME_DAY; + else if (well_state->unit_system == ECL_FIELD_UNITS) + conversion_factor = ECL_UNITS_VOLUME_BARREL / ECL_UNITS_TIME_DAY; + else if (well_state->unit_system == ECL_LAB_UNITS) + conversion_factor = ECL_UNITS_VOLUME_MILLI_LITER / ECL_UNITS_TIME_HOUR; + + return well_state->water_rate * conversion_factor; } double well_state_get_volume_rate_si( const well_state_type * well_state) { @@ -278,6 +307,7 @@ static bool well_state_add_rates( well_state_type * well_state , ecl_rsthead_type *header = ecl_rsthead_alloc(rst_view, -1); int offset = header->nxwelz * well_nr; + well_state->unit_system = header->unit_system; well_state->oil_rate = ecl_kw_iget_double(xwel_kw, offset + XWEL_RES_ORAT_ITEM); well_state->gas_rate = ecl_kw_iget_double(xwel_kw, offset + XWEL_RES_GRAT_ITEM); well_state->water_rate = ecl_kw_iget_double(xwel_kw, offset + XWEL_RES_WRAT_ITEM); @@ -611,6 +641,13 @@ const well_conn_type * well_state_get_wellhead( const well_state_type * well_sta return NULL; } +const well_conn_type * well_state_get_global_wellhead( const well_state_type * well_state ) { + if (hash_has_key( well_state->name_wellhead , ECL_GRID_GLOBAL_GRID)) + return hash_get( well_state->name_wellhead , ECL_GRID_GLOBAL_GRID ); + else + return NULL; +} + well_type_enum well_state_get_type( const well_state_type * well_state){ return well_state->type; diff --git a/ThirdParty/Ert/libecl_well/tests/statoil_tests.cmake b/ThirdParty/Ert/libecl_well/tests/statoil_tests.cmake index 35cbae9e30..85be1f7494 100644 --- a/ThirdParty/Ert/libecl_well/tests/statoil_tests.cmake +++ b/ThirdParty/Ert/libecl_well/tests/statoil_tests.cmake @@ -1,9 +1,9 @@ add_executable( well_state_load well_state_load.c ) -target_link_libraries( well_state_load ecl_well test_util ) +target_link_libraries( well_state_load ecl_well ) set_target_properties( well_state_load PROPERTIES COMPILE_FLAGS "-Werror") add_executable( well_state_load_missing_RSEG well_state_load_missing_RSEG.c ) -target_link_libraries( well_state_load_missing_RSEG ecl_well test_util ) +target_link_libraries( well_state_load_missing_RSEG ecl_well ) set_target_properties( well_state_load_missing_RSEG PROPERTIES COMPILE_FLAGS "-Werror") add_test( well_state_load1 ${EXECUTABLE_OUTPUT_PATH}/well_state_load ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.EGRID @@ -29,28 +29,28 @@ add_test( well_state_load_missing_RSEG2 ${EXECUTABLE_OUTPUT_PATH}/well_state_loa add_executable( well_segment_load well_segment_load.c ) -target_link_libraries( well_segment_load ecl_well test_util ) +target_link_libraries( well_segment_load ecl_well ) set_target_properties( well_segment_load PROPERTIES COMPILE_FLAGS "-Werror") add_test( well_segment_load ${EXECUTABLE_OUTPUT_PATH}/well_segment_load ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/MSWcase/MSW_CASE.X0021) add_executable( well_segment_branch_conn_load well_segment_branch_conn_load.c ) -target_link_libraries( well_segment_branch_conn_load ecl_well test_util ) +target_link_libraries( well_segment_branch_conn_load ecl_well ) set_target_properties( well_segment_branch_conn_load PROPERTIES COMPILE_FLAGS "-Werror") add_test( well_segment_branch_conn_load ${EXECUTABLE_OUTPUT_PATH}/well_segment_branch_conn_load ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/MSWcase/MSW_CASE.X0021) add_executable( well_info well_info.c ) -target_link_libraries( well_info ecl_well test_util ) +target_link_libraries( well_info ecl_well ) set_target_properties( well_info PROPERTIES COMPILE_FLAGS "-Werror") add_test( well_info ${EXECUTABLE_OUTPUT_PATH}/well_info ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.EGRID ) add_executable( well_conn_CF well_conn_CF.c ) -target_link_libraries( well_conn_CF ecl_well test_util ) +target_link_libraries( well_conn_CF ecl_well ) add_test( well_conn_CF ${EXECUTABLE_OUTPUT_PATH}/well_conn_CF ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.X0060) add_executable( well_conn_load well_conn_load.c ) -target_link_libraries( well_conn_load ecl_well test_util ) +target_link_libraries( well_conn_load ecl_well ) set_target_properties( well_conn_load PROPERTIES COMPILE_FLAGS "-Werror") add_test( well_conn_load1 ${EXECUTABLE_OUTPUT_PATH}/well_conn_load ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.X0030 F) add_test( well_conn_load2 ${EXECUTABLE_OUTPUT_PATH}/well_conn_load ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/10kcase/TEST10K_FLT_LGR_NNC.X0021 F) @@ -60,17 +60,17 @@ add_test( well_conn_load5 ${EXECUTABLE_OUTPUT_PATH}/well_conn_load ${PROJECT_SOU add_test( well_conn_load6 ${EXECUTABLE_OUTPUT_PATH}/well_conn_load ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/0.9.2_LGR/BASE_REF_XY3Z1_T30_WI.X0003 F) add_executable( well_ts well_ts.c ) -target_link_libraries( well_ts ecl_well test_util ) +target_link_libraries( well_ts ecl_well ) add_test( well_ts ${EXECUTABLE_OUTPUT_PATH}/well_ts ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/CO2case/BASE_CASE ) add_executable( well_dualp well_dualp.c ) -target_link_libraries( well_dualp ecl_well test_util ) +target_link_libraries( well_dualp ecl_well ) add_test( well_dualp ${EXECUTABLE_OUTPUT_PATH}/well_dualp ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.UNRST ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/DualPoro/DUALPORO.X0005 ) add_executable( well_lgr_load well_lgr_load.c ) -target_link_libraries( well_lgr_load ecl_well test_util ) +target_link_libraries( well_lgr_load ecl_well ) add_test( well_lgr_load1 ${EXECUTABLE_OUTPUT_PATH}/well_lgr_load ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/0.9.2_LGR/BASE_REF_XY3Z1_T30_WI.EGRID ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/0.9.2_LGR/BASE_REF_XY3Z1_T30_WI.X0003) add_test( well_lgr_load2 ${EXECUTABLE_OUTPUT_PATH}/well_lgr_load ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/AmalgLGRcase/TESTCASE_AMALG_LGR.EGRID ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/AmalgLGRcase/TESTCASE_AMALG_LGR.X0016) diff --git a/ThirdParty/Ert/libecl_well/tests/tests.cmake b/ThirdParty/Ert/libecl_well/tests/tests.cmake index bce5831ece..20dc5381ba 100644 --- a/ThirdParty/Ert/libecl_well/tests/tests.cmake +++ b/ThirdParty/Ert/libecl_well/tests/tests.cmake @@ -1,35 +1,35 @@ add_executable( well_conn_collection well_conn_collection.c ) -target_link_libraries( well_conn_collection ecl_well test_util ) +target_link_libraries( well_conn_collection ecl_well ) set_target_properties( well_conn_collection PROPERTIES COMPILE_FLAGS "-Werror") add_test( well_conn_collection ${EXECUTABLE_OUTPUT_PATH}/well_conn_collection ) add_executable( well_branch_collection well_branch_collection.c ) -target_link_libraries( well_branch_collection ecl_well test_util ) +target_link_libraries( well_branch_collection ecl_well ) set_target_properties( well_branch_collection PROPERTIES COMPILE_FLAGS "-Werror") add_test( well_branch_collection ${EXECUTABLE_OUTPUT_PATH}/well_branch_collection ) add_executable( well_conn well_conn.c ) -target_link_libraries( well_conn ecl_well test_util ) +target_link_libraries( well_conn ecl_well ) set_target_properties( well_conn PROPERTIES COMPILE_FLAGS "-Werror") add_test( well_conn ${EXECUTABLE_OUTPUT_PATH}/well_conn ) add_executable( well_state well_state.c ) -target_link_libraries( well_state ecl_well test_util ) +target_link_libraries( well_state ecl_well ) set_target_properties( well_state PROPERTIES COMPILE_FLAGS "-Werror") add_test( well_state ${EXECUTABLE_OUTPUT_PATH}/well_state ) add_executable( well_segment well_segment.c ) -target_link_libraries( well_segment ecl_well test_util ) +target_link_libraries( well_segment ecl_well ) set_target_properties( well_segment PROPERTIES COMPILE_FLAGS "-Werror") add_test( well_segment ${EXECUTABLE_OUTPUT_PATH}/well_segment ) add_executable( well_segment_conn well_segment_conn.c ) -target_link_libraries( well_segment_conn ecl_well test_util ) +target_link_libraries( well_segment_conn ecl_well ) set_target_properties( well_segment_conn PROPERTIES COMPILE_FLAGS "-Werror") add_test( well_segment_conn ${EXECUTABLE_OUTPUT_PATH}/well_segment_conn ) add_executable( well_segment_collection well_segment_collection.c ) -target_link_libraries( well_segment_collection ecl_well test_util ) +target_link_libraries( well_segment_collection ecl_well ) set_target_properties( well_segment_collection PROPERTIES COMPILE_FLAGS "-Werror") add_test( well_segment_collection ${EXECUTABLE_OUTPUT_PATH}/well_segment_collection ) diff --git a/ThirdParty/Ert/libeclxx/include/ert/ecl/EclKW.hpp b/ThirdParty/Ert/libeclxx/include/ert/ecl/EclKW.hpp index 079b2c2551..d703a71751 100644 --- a/ThirdParty/Ert/libeclxx/include/ert/ecl/EclKW.hpp +++ b/ThirdParty/Ert/libeclxx/include/ert/ecl/EclKW.hpp @@ -28,11 +28,11 @@ #include #include +#include #include #include - namespace ERT { template< typename > struct ecl_type {}; @@ -55,7 +55,7 @@ namespace ERT { class EclKW_ref { public: explicit EclKW_ref( ecl_kw_type* kw ) : m_kw( kw ) { - if( ecl_kw_get_type( kw ) != ecl_type< T >::type ) + if( ecl_type_get_type(ecl_kw_get_data_type( kw )) != ecl_type< T >::type ) throw std::invalid_argument("Type error"); } @@ -132,7 +132,7 @@ class EclKW : public EclKW_ref< T > { } EclKW( const std::string& kw, int size_ ) : - base( ecl_kw_alloc( kw.c_str(), size_, ecl_type< T >::type ) ) + base( ecl_kw_alloc( kw.c_str(), size_, ecl_type_create_from_type(ecl_type< T >::type) ) ) {} EclKW( const std::string& kw, const std::vector< T >& data ) : diff --git a/ThirdParty/Ert/libeclxx/src/CMakeLists.txt b/ThirdParty/Ert/libeclxx/src/CMakeLists.txt index 8dc07fc2dd..4a108238a8 100644 --- a/ThirdParty/Ert/libeclxx/src/CMakeLists.txt +++ b/ThirdParty/Ert/libeclxx/src/CMakeLists.txt @@ -12,7 +12,7 @@ set( header_files ) -add_library( eclxx ${LIBRARY_TYPE} ${source_files} ) +add_library( eclxx ${source_files} ) set_target_properties( eclxx PROPERTIES VERSION ${ERT_VERSION_MAJOR}.${ERT_VERSION_MINOR} SOVERSION ${ERT_VERSION_MAJOR}) if (USE_RUNPATH) add_runpath( eclxx ) diff --git a/ThirdParty/Ert/libeclxx/src/EclFilename.cpp b/ThirdParty/Ert/libeclxx/src/EclFilename.cpp index 0476ad2d34..225ad52b46 100644 --- a/ThirdParty/Ert/libeclxx/src/EclFilename.cpp +++ b/ThirdParty/Ert/libeclxx/src/EclFilename.cpp @@ -16,6 +16,7 @@ for more details. */ +#include #include #include @@ -23,11 +24,17 @@ namespace ERT { std::string EclFilename( const std::string& path, const std::string& base, ecl_file_enum file_type , int report_step, bool fmt_file) { - return ecl_util_alloc_filename( path.c_str(), base.c_str(), file_type, fmt_file , report_step ); + char* tmp = ecl_util_alloc_filename( path.c_str(), base.c_str(), file_type, fmt_file , report_step ); + std::string retval = tmp; + free(tmp); + return retval; } std::string EclFilename( const std::string& base, ecl_file_enum file_type , int report_step, bool fmt_file) { - return ecl_util_alloc_filename( nullptr, base.c_str(), file_type, fmt_file , report_step ); + char* tmp = ecl_util_alloc_filename( nullptr, base.c_str(), file_type, fmt_file , report_step ); + std::string retval = tmp; + free(tmp); + return retval; } namespace { @@ -42,16 +49,24 @@ namespace { std::string EclFilename( const std::string& path, const std::string& base, ecl_file_enum file_type , bool fmt_file) { if (require_report_step( file_type )) throw std::runtime_error("Must use overload with report step for this file type"); - else - return ecl_util_alloc_filename( path.c_str(), base.c_str(), file_type, fmt_file , -1); + else { + char* tmp = ecl_util_alloc_filename( path.c_str(), base.c_str(), file_type, fmt_file , -1); + std::string retval = tmp; + free(tmp); + return retval; + } } std::string EclFilename( const std::string& base, ecl_file_enum file_type , bool fmt_file) { if (require_report_step( file_type )) throw std::runtime_error("Must use overload with report step for this file type"); - else - return ecl_util_alloc_filename( nullptr , base.c_str(), file_type, fmt_file , -1); + else { + char* tmp = ecl_util_alloc_filename( nullptr , base.c_str(), file_type, fmt_file , -1); + std::string retval = tmp; + free(tmp); + return retval; + } } diff --git a/ThirdParty/Ert/libeclxx/tests/CMakeLists.txt b/ThirdParty/Ert/libeclxx/tests/CMakeLists.txt index 89b67e4432..be233b2ae3 100644 --- a/ThirdParty/Ert/libeclxx/tests/CMakeLists.txt +++ b/ThirdParty/Ert/libeclxx/tests/CMakeLists.txt @@ -1,15 +1,19 @@ add_executable(eclxx_kw eclxx_kw.cpp) -target_link_libraries(eclxx_kw eclxx test_util ert_utilxx) +target_link_libraries(eclxx_kw eclxx ert_utilxx) add_test(eclxx_kw ${EXECUTABLE_OUTPUT_PATH}/eclxx_kw) add_executable(eclxx_fortio eclxx_fortio.cpp) -target_link_libraries(eclxx_fortio eclxx test_util ert_utilxx) +target_link_libraries(eclxx_fortio eclxx ert_utilxx) add_test(eclxx_fortio ${EXECUTABLE_OUTPUT_PATH}/eclxx_fortio) add_executable(eclxx_smspec eclxx_smspec.cpp) -target_link_libraries(eclxx_smspec eclxx test_util ert_utilxx) +target_link_libraries(eclxx_smspec eclxx ert_utilxx) add_test(eclxx_smspec ${EXECUTABLE_OUTPUT_PATH}/eclxx_smspec) add_executable(eclxx_filename eclxx_filename.cpp) -target_link_libraries(eclxx_filename eclxx test_util ert_utilxx) +target_link_libraries(eclxx_filename eclxx ert_utilxx) add_test(eclxx_filename ${EXECUTABLE_OUTPUT_PATH}/eclxx_filename) + +add_executable(eclxx_types eclxx_types.cpp) +target_link_libraries(eclxx_types eclxx ert_utilxx) +add_test(eclxx_types ${EXECUTABLE_OUTPUT_PATH}/eclxx_types) diff --git a/ThirdParty/Ert/libeclxx/tests/eclxx_kw.cpp b/ThirdParty/Ert/libeclxx/tests/eclxx_kw.cpp index 14c7fe51da..3191250797 100644 --- a/ThirdParty/Ert/libeclxx/tests/eclxx_kw.cpp +++ b/ThirdParty/Ert/libeclxx/tests/eclxx_kw.cpp @@ -78,7 +78,7 @@ void test_move_semantics_no_crash() { } void test_exception_assing_ref_wrong_type() { - auto* ptr = ecl_kw_alloc( "XYZ", 1, ECL_INT_TYPE ); + auto* ptr = ecl_kw_alloc( "XYZ", 1, ECL_INT ); try { ERT::EclKW< double > kw( ptr ); diff --git a/ThirdParty/Ert/libeclxx/tests/eclxx_types.cpp b/ThirdParty/Ert/libeclxx/tests/eclxx_types.cpp new file mode 100644 index 0000000000..2ecd3add39 --- /dev/null +++ b/ThirdParty/Ert/libeclxx/tests/eclxx_types.cpp @@ -0,0 +1,63 @@ +/* + Copyright (C) 2017 Statoil ASA, Norway. + + This file is part of ERT - Ensemble based Reservoir Tool. + + ERT 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. + + ERT 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 + for more details. +*/ + +#include +#include + + +#include +#include +#include +#include + + +void test_ECL_INT() { + ecl_data_type dt = ECL_INT; + test_assert_int_equal( dt.element_size , sizeof(int) ); + test_assert_int_equal( dt.type , ECL_INT_TYPE ); +} + + +void test_ECL_FLOAT() { + ecl_data_type dt = ECL_FLOAT; + test_assert_int_equal( dt.element_size , sizeof(float) ); + test_assert_int_equal( dt.type , ECL_FLOAT_TYPE ); +} + + +void test_ECL_DOUBLE() { + ecl_data_type dt = ECL_DOUBLE; + test_assert_int_equal( dt.element_size , sizeof(double) ); + test_assert_int_equal( dt.type , ECL_DOUBLE_TYPE ); +} + + +void test_ECL_CHAR() { + ecl_data_type dt = ECL_CHAR; + test_assert_int_equal( dt.element_size , ECL_STRING8_LENGTH + 1 ); + test_assert_int_equal( dt.type , ECL_CHAR_TYPE ); +} + + + +int main(int argc , char ** argv) { + test_ECL_INT(); + test_ECL_FLOAT(); + test_ECL_DOUBLE(); + test_ECL_CHAR(); +} diff --git a/ThirdParty/Ert/libenkf/CMakeLists.txt b/ThirdParty/Ert/libenkf/CMakeLists.txt deleted file mode 100644 index d6f06317db..0000000000 --- a/ThirdParty/Ert/libenkf/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_subdirectory( src ) -add_subdirectory( applications/ert_tui ) -if (BUILD_TESTS) - add_subdirectory( tests ) -endif() diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/CMake/config/ert_build_config_file.h.in b/ThirdParty/Ert/libenkf/applications/ert_tui/CMake/config/ert_build_config_file.h.in deleted file mode 100644 index 89829a9a18..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/CMake/config/ert_build_config_file.h.in +++ /dev/null @@ -1,3 +0,0 @@ -#define SITE_CONFIG_FILE "@SITE_CONFIG_FILE@" -#define COMPILE_TIME_STAMP "@COMPILE_TIME_STAMP@" -#define SVN_VERSION "@SVN_VERSION@" diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/CMakeLists.txt b/ThirdParty/Ert/libenkf/applications/ert_tui/CMakeLists.txt deleted file mode 100644 index 10b40fc1f4..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ) - -set( src_list main.c enkf_tui_main.c enkf_tui_fs.c enkf_tui_ranking.c enkf_tui_misc.c enkf_tui_table.c - enkf_tui_run.c enkf_tui_util.c enkf_tui_init.c enkf_tui_export.c enkf_tui_analysis.c enkf_tui_help.c enkf_tui_simple.c enkf_tui_workflow.c) - -execute_process(COMMAND date "+%Y-%m-%d %H:%M:%S" OUTPUT_VARIABLE BUILD_TIME ) -string(STRIP ${BUILD_TIME} BUILD_TIME) - -find_package(Git) -if(GIT_EXECUTABLE) - execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse HEAD - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" - OUTPUT_VARIABLE GIT_COMMIT) - string(STRIP "${GIT_COMMIT}" GIT_COMMIT) -else() - set(GIT_COMMIT) -endif() - -set_source_files_properties( main.c PROPERTIES COMPILE_DEFINITIONS "COMPILE_TIME_STAMP=\"${BUILD_TIME}\";GIT_COMMIT=\"${GIT_COMMIT}\"") - -add_executable( ert_tui ${src_list} ) -target_link_libraries( ert_tui enkf sched rms ecl config job_queue analysis ert_util ) -if (USE_RUNPATH) - add_runpath( ert_tui ) -endif() - -set (destination ${CMAKE_INSTALL_PREFIX}/bin) - -if (INSTALL_ERT) - install(TARGETS ert_tui DESTINATION ${destination}) - if (INSTALL_GROUP) - install(CODE "EXECUTE_PROCESS(COMMAND chgrp ${INSTALL_GROUP} ${destination}/ert_tui)") - install(CODE "EXECUTE_PROCESS(COMMAND chmod g+w ${destination}/ert_tui)") - endif() -endif() diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/ERT.h b/ThirdParty/Ert/libenkf/applications/ert_tui/ERT.h deleted file mode 100644 index 5993a6b4a0..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/ERT.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'ERT.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#define SPLASH_LENGTH 11 -const char * splash_text[SPLASH_LENGTH] = { - " _________________________________ ", - " / \\", - " | ______ ______ _______ |", - " | | ____| | __ \\ |__ __| |", - " | | |__ | |__) | | | |", - " | | __| | _ / | | |", - " | | |____ | | \\ \\ | | |", - " | |______| |_| \\_\\ |_| |", - " | |", - " | Ensemble based Reservoir Tool |", - " \\_________________________________/"}; - - - diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_QC.h b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_QC.h deleted file mode 100644 index 137de3cb05..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_QC.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'enkf_tui_QC.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_TUI_QC_H -#define ERT_ENKF_TUI_QC_H - - - -void enkf_tui_QC_menu(void * ); - - - -#endif diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_analysis.c b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_analysis.c deleted file mode 100644 index 577b151a72..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_analysis.c +++ /dev/null @@ -1,160 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_analysis.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include -#include -#include - - - -void enkf_tui_analysis_scale_observation_std__(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast(arg); - - double scale_factor = enkf_tui_util_scanf_double_with_lower_limit("Global scaling factor", PROMPT_LEN, 0); - - if (enkf_main_have_obs(enkf_main)) { - enkf_obs_type * observations = enkf_main_get_obs(enkf_main); - enkf_obs_scale_std(observations, scale_factor); - } -} - - - - - - -static void enkf_tui_analysis_update_title( enkf_main_type * enkf_main , menu_type * menu ) { - analysis_config_type * analysis_config = enkf_main_get_analysis_config( enkf_main ); - analysis_module_type * analysis_module = analysis_config_get_active_module( analysis_config ); - char * title = util_alloc_sprintf("Analysis menu [Current module:%s]" , analysis_module_get_name( analysis_module )); - menu_set_title( menu , title ); - free( title ); -} - - -void enkf_tui_analysis_select_module__(void * arg) { - int prompt_len = 50; - arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); - enkf_main_type * enkf_main = arg_pack_iget_ptr( arg_pack , 0 ); - menu_type * menu = arg_pack_iget_ptr( arg_pack , 1 ); - - { - analysis_config_type * analysis_config = enkf_main_get_analysis_config( enkf_main ); - char module_name[256]; - util_printf_prompt("Name module to select" , prompt_len , '=' , "=> "); - scanf("%s", module_name); - if (analysis_config_select_module( analysis_config , module_name )) - enkf_tui_analysis_update_title( enkf_main , menu ); - } -} - - -void enkf_tui_analysis_list_modules__(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - analysis_config_type * analysis_config = enkf_main_get_analysis_config( enkf_main ); - - printf("Available modules: "); - { - stringlist_type * modules = analysis_config_alloc_module_names( analysis_config ); - stringlist_fprintf( modules , " " , stdout ); - printf("\n"); - stringlist_free( modules ); - } -} - - -void enkf_tui_analysis_reload_module__(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - analysis_config_type * analysis_config = enkf_main_get_analysis_config( enkf_main ); - analysis_config_reload_module( analysis_config , NULL ); -} - - -void enkf_tui_analysis_update_module__(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - int prompt_len = 50; - { - analysis_config_type * analysis_config = enkf_main_get_analysis_config( enkf_main ); - analysis_module_type * analysis_module = analysis_config_get_active_module( analysis_config ); - char var_name[256]; - char value[256]; - - util_printf_prompt("Variable to modify" , prompt_len , '=' , "=> "); - scanf("%s", var_name); - { - char * value_prompt = util_alloc_sprintf("New value for %s" , var_name); - util_printf_prompt(value_prompt , prompt_len , '=' , "=> "); - free( value_prompt ); - } - scanf("%s", value); - - if (analysis_module_set_var( analysis_module , var_name , value)) - printf("\'%s\' successfully set to \'%s\' \n",var_name , value); - else - printf("** Variable/type combination: %s/%s not recognized \n", var_name , value); - - } -} - - - - -void enkf_tui_analysis_menu(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - menu_type * menu = menu_alloc( "Analysis menu" , "Back" , "bB"); - - arg_pack_type * arg_pack = arg_pack_alloc(); - arg_pack_append_ptr( arg_pack , enkf_main ); - arg_pack_append_ptr( arg_pack , menu ); - - { - enkf_tui_analysis_update_title(enkf_main, menu); - - if (enkf_main_have_obs(enkf_main)) { - menu_add_item(menu, "Global scaling of uncertainty", "gG", enkf_tui_analysis_scale_observation_std__, enkf_main, NULL); - menu_add_separator(menu); - } - - menu_add_item(menu, "Select analysis module", "sS", enkf_tui_analysis_select_module__, arg_pack, NULL); - menu_add_item(menu, "List available modules", "lL", enkf_tui_analysis_list_modules__, enkf_main, NULL); - menu_add_item(menu, "Modify analysis module parameters", "mM", enkf_tui_analysis_update_module__, enkf_main, NULL); - menu_add_item(menu, "Reload current module (external only)", "rR", enkf_tui_analysis_reload_module__, enkf_main, NULL); - } - menu_run(menu); - menu_free(menu); - arg_pack_free(arg_pack); -} - diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_analysis.h b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_analysis.h deleted file mode 100644 index c38c7c93ca..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_analysis.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_analysis.h' is part of ERT - Ensemble based - Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_TUI_ANALYSIS_H -#define ERT_ENKF_TUI_ANALYSIS_H - -void enkf_tui_analysis_menu(void *); - - -#endif - diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_export.c b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_export.c deleted file mode 100644 index cfe9e0b69b..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_export.c +++ /dev/null @@ -1,687 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_export.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#define PROMPT_LEN 60 - - -void enkf_tui_export_field(const enkf_main_type * enkf_main , field_file_format_type file_type) { - const ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main); - const bool output_transform = true; - const enkf_config_node_type * config_node; - const int last_report = enkf_main_get_history_length( enkf_main ); - int iens1 , iens2 , iens , report_step; - path_fmt_type * export_path; - - config_node = enkf_tui_util_scanf_key(ensemble_config , PROMPT_LEN , FIELD , INVALID_VAR ); - - report_step = util_scanf_int_with_limits("Report step: ", PROMPT_LEN , 0 , last_report); - enkf_tui_util_scanf_iens_range("Realizations members to export(0 - %d)" , enkf_main_get_ensemble_size( enkf_main ) , PROMPT_LEN , &iens1 , &iens2); - - { - char * path_fmt; - util_printf_prompt("Filename to store files in (with %d) in: " , PROMPT_LEN , '=' , "=> "); - path_fmt = util_alloc_stdin_line(); - export_path = path_fmt_alloc_path_fmt( path_fmt ); - free( path_fmt ); - } - - { - enkf_fs_type * fs = enkf_main_tui_get_fs(enkf_main); - enkf_node_type * node = enkf_node_alloc(config_node); - - for (iens = iens1; iens <= iens2; iens++) { - node_id_type node_id = {.report_step = report_step , .iens = iens }; - if (enkf_node_try_load(node , fs , node_id)) { - char * filename = path_fmt_alloc_path( export_path , false , iens); - { - char * path; - util_alloc_file_components(filename , &path , NULL , NULL); - if (path != NULL) { - util_make_path( path ); - free( path ); - } - } - - { - const field_type * field = enkf_node_value_ptr(node); - field_export(field , filename , NULL , file_type , output_transform, NULL); - } - free(filename); - } else - printf("Warning: could not load realization:%d \n", iens); - } - enkf_node_free(node); - } -} - - -void enkf_tui_export_grdecl(void * enkf_main) { - enkf_tui_export_field(enkf_main , ECL_GRDECL_FILE); -} - - - -void enkf_tui_export_roff(void * enkf_main) { - enkf_tui_export_field(enkf_main , RMS_ROFF_FILE); -} - - -void enkf_tui_export_restart_active(void * enkf_main) { - enkf_tui_export_field(enkf_main , ECL_KW_FILE_ACTIVE_CELLS); -} - - -void enkf_tui_export_restart_all(void * enkf_main) { - enkf_tui_export_field(enkf_main , ECL_KW_FILE_ALL_CELLS); -} - - -void enkf_tui_export_gen_data(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - const ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main); - { - enkf_var_type var_type; - int report_step; - int iens1 , iens2; - const int last_report = enkf_main_get_history_length( enkf_main ); - - const enkf_config_node_type * config_node; - path_fmt_type * file_fmt; - - config_node = enkf_tui_util_scanf_key(ensemble_config , PROMPT_LEN , GEN_DATA , INVALID_VAR); - var_type = enkf_config_node_get_var_type(config_node); - - - report_step = util_scanf_int_with_limits("Report step: ", PROMPT_LEN , 0 , last_report); - enkf_tui_util_scanf_iens_range("Realizations members to export(0 - %d)" , enkf_main_get_ensemble_size( enkf_main ) , PROMPT_LEN , &iens1 , &iens2); - { - char path_fmt[512]; - util_printf_prompt("Filename to store files in (with %d) in: " , PROMPT_LEN , '=' , "=> "); - scanf("%s" , path_fmt); - file_fmt = path_fmt_alloc_path_fmt( path_fmt ); - } - - { - msg_type * msg = msg_alloc("Writing file: " , false); - enkf_fs_type * fs = enkf_main_tui_get_fs(enkf_main); - enkf_node_type * node = enkf_node_alloc(config_node); - gen_data_file_format_type export_type = gen_data_guess_export_type( enkf_node_value_ptr(node) ); - int iens; - - msg_show( msg ); - for (iens = iens1; iens <= iens2; iens++) { - node_id_type node_id = {.report_step = report_step , .iens = iens}; - if (enkf_node_try_load(node , fs, node_id)) { - char * full_path = path_fmt_alloc_path( file_fmt , false , iens); - char * path; - util_alloc_file_components(full_path , &path , NULL , NULL); - if (path != NULL) util_make_path( path ); - - { - const gen_data_type * gen_data = enkf_node_value_ptr(node); - msg_update(msg , full_path); - gen_data_export(gen_data , full_path , export_type , NULL); - } - - free(full_path); - util_safe_free(path); - } - } - enkf_node_free(node); - msg_free( msg , true ); - } - } -} - - - -void enkf_tui_export_profile(void * enkf_main) { - const ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main); - { - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - int iens1 , iens2; - const int last_report = enkf_main_get_history_length( enkf_main ); - bool * iens_active ; - bool * report_active; - - const enkf_config_node_type * config_node; - int direction; /* 0: i running, 1: j running, 2: k running */ - int total_cells; - int *cell_list; - path_fmt_type * file_fmt; - - config_node = enkf_tui_util_scanf_key(ensemble_config , PROMPT_LEN , FIELD , INVALID_VAR); - iens_active = enkf_tui_util_scanf_alloc_iens_active( ens_size , PROMPT_LEN , &iens1 , &iens2); /* Not used yet ... */ - report_active = enkf_tui_util_scanf_alloc_report_active( last_report , PROMPT_LEN ); - direction = util_scanf_int_with_limits("Give scan direction 0:i 1:j 2:k" , PROMPT_LEN , 0 , 2); - - { - const field_config_type * field_config = enkf_config_node_get_ref( config_node ); - int nx,ny,nz; - int i1,i2,j1,j2,k1,k2; - field_config_get_dims( field_config , &nx , &ny , &nz); - i2 = j2 = k2 = 0; /* Dummy for compiler */ - - /* i1,i2,j1,j2,k1 and k2 should be incluseive */ - switch (direction) { - case(0): - i1 = 0; i2 = nx-1; - enkf_tui_util_scanf_ijk__(field_config , PROMPT_LEN , NULL , &j1 , &k1); - j2 = j1; - k2 = k1; - break; - case(1): - j1 = 0; j2 = ny-1; - enkf_tui_util_scanf_ijk__(field_config , PROMPT_LEN , &i1 , NULL , &k1); - i2 = i1; - k2 = k1; - break; - case(2): - k1 = 0; k2 = nz-1; - enkf_tui_util_scanf_ijk__(field_config , PROMPT_LEN , &i1 , &j1 , NULL); - i2 = i1; - j2 = j1; - break; - default: - util_abort("%s: internal error \n",__func__); - } - total_cells = (i2 - i1 + 1) * (j2 - j1 + 1) * (k2 - k1 + 1); - cell_list = util_calloc(total_cells , sizeof * cell_list ); - { - int cell_index = 0; - int i,j,k; - for (i=i1; i<=i2; i++) - for (j= j1; j <=j2; j++) - for (k=k1; k <= k2; k++) { - cell_list[cell_index] = field_config_active_index(field_config , i,j,k); - cell_index++; - } - } - - file_fmt = path_fmt_scanf_alloc("Give filename to store profiles (with TWO %d specifiers) =>" , 0 , NULL , false); - { - double * profile = util_calloc(total_cells , sizeof * profile ); - int iens , report_step; - enkf_node_type * node = enkf_node_alloc( config_node ); - enkf_fs_type * fs = enkf_main_tui_get_fs(enkf_main); - - for (report_step = 0; report_step <= last_report; report_step++) { - if (report_active[report_step]) { - for (iens = iens1; iens <= iens2; iens++) { - node_id_type node_id = {.report_step = report_step , .iens = iens }; - if (enkf_node_try_load(node , fs, node_id)) { - { - const field_type * field = enkf_node_value_ptr( node ); - int field_index; - for (field_index = 0 ; field_index < total_cells; field_index++) - profile[field_index] = field_iget_double(field , cell_list[field_index]); - { - char * filename = path_fmt_alloc_file(file_fmt , true , report_step , iens); - FILE * stream = util_fopen(filename , "w"); - for (field_index = 0; field_index < total_cells; field_index++) - fprintf(stream, "%d %g\n",field_index , profile[field_index]); - - fclose(stream); - free(filename); - } - } - } else - fprintf(stderr," ** Warning field:%s is missing for member,report: %d,%d \n",enkf_config_node_get_key(config_node) , iens , report_step); - } - } - } - free(iens_active); - free(report_active); - free(profile); - } - } - free(cell_list); - } -} - - - - - - -void enkf_tui_export_cell(void * enkf_main) { - const ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main); - { - const enkf_config_node_type * config_node; - int cell_nr; - - config_node = enkf_tui_util_scanf_key(ensemble_config , PROMPT_LEN , FIELD , INVALID_VAR); - cell_nr = enkf_tui_util_scanf_ijk(enkf_config_node_get_ref(config_node) , PROMPT_LEN); - { - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - const int last_report = enkf_main_get_history_length( enkf_main ); - int iens1 , iens2; - bool * iens_active = enkf_tui_util_scanf_alloc_iens_active( ens_size , PROMPT_LEN , &iens1 , &iens2); /* Not used yet ... */ - bool * report_active = enkf_tui_util_scanf_alloc_report_active( last_report , PROMPT_LEN); - double * cell_data = util_calloc(ens_size , sizeof * cell_data); - int iens , report_step; /* Observe that iens and report_step loops below should be inclusive.*/ - enkf_node_type * node = enkf_node_alloc( config_node ); - enkf_fs_type * fs = enkf_main_tui_get_fs(enkf_main); - path_fmt_type * file_fmt = path_fmt_scanf_alloc("Give filename to store historgrams (with %d for report step) =>" , 0 , NULL , false); - - - for (report_step = 0; report_step <= last_report; report_step++) { - if (report_active[report_step]) { - node_id_type node_id = {.report_step = report_step , .iens = iens1 }; - if (enkf_node_try_load(node , fs , node_id)) { - for (iens = iens1; iens <= iens2; iens++) { - node_id.iens = iens; - if (enkf_node_try_load(node , fs , node_id )) { - { - const field_type * field = enkf_node_value_ptr( node ); - cell_data[iens] = field_iget_double(field , cell_nr); - } - } else { - fprintf(stderr," ** Warning field:%s is missing for member,report: %d,%d \n",enkf_config_node_get_key(config_node) , iens , report_step); - cell_data[iens] = -1; - } - } - { - char * filename = path_fmt_alloc_file(file_fmt , true , report_step); - FILE * stream = util_fopen(filename , "w"); - for (iens = iens1; iens <= iens2; iens++) - fprintf(stream,"%g\n",cell_data[iens]); - - fclose(stream); - free(filename); - } - } else printf("Skipping report_step:%d \n",report_step); - } - } - free(iens_active); - free(report_active); - free(cell_data); - path_fmt_free(file_fmt); - } - } -} - - - - -void enkf_tui_export_time(void * enkf_main) { - const ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main); - { - const enkf_config_node_type * config_node; - int cell_nr; - - config_node = enkf_tui_util_scanf_key(ensemble_config , PROMPT_LEN , FIELD ,INVALID_VAR); - cell_nr = enkf_tui_util_scanf_ijk(enkf_config_node_get_ref(config_node) , PROMPT_LEN); - { - const int last_report = enkf_main_get_history_length( enkf_main ); - const int step1 = util_scanf_int_with_limits("First report step",PROMPT_LEN , 0 , last_report); - const int step2 = util_scanf_int_with_limits("Last report step",PROMPT_LEN , step1 , last_report); - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - int iens1 , iens2; - bool * iens_active = enkf_tui_util_scanf_alloc_iens_active( ens_size , PROMPT_LEN , &iens1 , &iens2); /* Not used yet ... */ - double * x, *y; - int iens; /* Observe that iens and report_step loops below should be inclusive.*/ - enkf_node_type * node = enkf_node_alloc( config_node ); - enkf_fs_type * fs = enkf_main_tui_get_fs(enkf_main); - path_fmt_type * file_fmt = path_fmt_scanf_alloc("Give filename to store line (with %d for report iens) =>" , 0 , NULL , false); - - - { - x = util_calloc( (step2 - step1 + 1) , sizeof * x); - y = util_calloc( (step2 - step1 + 1) , sizeof * y); - } - - - for (iens = iens1; iens <= iens2; iens++) { - enkf_tui_util_get_time(fs , config_node , node , cell_nr , step1 , step2 , iens , x ,y); - { - char * filename = path_fmt_alloc_file(file_fmt , true , iens); - FILE * stream = util_fopen(filename , "w"); - int index = 0; - int report_step; - for (report_step = step1; report_step <= step2; report_step++) { - fprintf(stream , "%g %g \n",x[index] , y[index]); - index++; - } - fclose(stream); - free(filename); - } - } - free(iens_active); - free(x); - free(y); - path_fmt_free(file_fmt); - } - } -} - - -/*****************************************************************/ - -void enkf_tui_export_fieldP(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - const ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main); - const enkf_config_node_type * config_node = enkf_tui_util_scanf_key(ensemble_config , PROMPT_LEN , FIELD , INVALID_VAR ); - int iens1 = 0; - int iens2 = enkf_main_get_ensemble_size( enkf_main ); - const int last_report = enkf_main_get_history_length( enkf_main ); - int report_step = util_scanf_int_with_limits("Report step: ", PROMPT_LEN , 0 , last_report); - double lower_limit = util_scanf_double("Lower limit", PROMPT_LEN); - double upper_limit = util_scanf_double("Upper limit", PROMPT_LEN); - char * export_file; - util_printf_prompt("Filename to store file: " , PROMPT_LEN , '=' , "=> "); - export_file = util_alloc_stdin_line(); - { - enkf_fs_type * fs = enkf_main_tui_get_fs(enkf_main); - enkf_node_type ** ensemble = enkf_node_load_alloc_ensemble( config_node , fs , report_step , iens1 , iens2 ); - enkf_node_type * sum = enkf_node_alloc( config_node ); - int active_ens_size = 0; - int iens; - - enkf_node_clear( sum ); - { - /* OK going low level */ - field_type * sum_field = enkf_node_value_ptr( sum ); - - for (iens = iens1; iens < iens2; iens++) { - if (ensemble[iens - iens1] != NULL) { - field_type * field = enkf_node_value_ptr( ensemble[iens - iens1] ); - field_update_sum( sum_field , field , lower_limit , upper_limit); - active_ens_size++; - } - } - if (active_ens_size > 0) { - field_scale( sum_field , 1.0 / active_ens_size ); - { - char * path; - util_alloc_file_components( export_file , &path , NULL , NULL); - if (path != NULL) { - util_make_path( path ); - free( path ); - } - } - field_export(sum_field , export_file , NULL , RMS_ROFF_FILE , false, NULL); - } else fprintf(stderr,"Warning: no data found \n"); - } - - for (iens = iens1; iens < iens2; iens++) { - if (ensemble[iens - iens1] != NULL) - enkf_node_free( ensemble[iens - iens1] ); - } - - free( ensemble ); - enkf_node_free( sum ); - } - free( export_file ); -} - - -/*****************************************************************/ - - -/** - This is a very simple function for exporting a scalar value for all - member/report steps to a CSV file. The file is characterized by: - - * Missing elements are represented with an empty string. - - * The header strings are quoted with "". - - * End of line is \r\n - - Unfortunately Excel does not seem to recognize the csv format, and - it is necessary to go through a text import wizard in excel. To - import this file you go through the following hoops in excel: - - 1. [Data> - [Import external data> - [Import data> - - 2. Select the file to import from. - - 3. The text import wizard from excel should pop up: - - 1. Select (*) Delimited - press next. - 2. Select delimiter "Comma" - press next. - 3. press finish. - - Finally you are asked where in the excel workbook you want to - insert the data. -*/ - - -#define CSV_NEWLINE "\r\n" -#define CSV_MISSING_VALUE "" -#define CSV_SEP "," - - -void enkf_tui_export_scalar2csv(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - const ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main); - const enkf_config_node_type * config_node; - char * user_key, *key_index; - - util_printf_prompt("Scalar to export (KEY:INDEX)" , PROMPT_LEN , '=' , "=> "); user_key = util_alloc_stdin_line(); - config_node = ensemble_config_user_get_node( ensemble_config , user_key , &key_index); - if (config_node != NULL) { - int report_step , first_report, last_report; - int iens1 , iens2, iens; - char * csv_file; - - iens2 = enkf_main_get_ensemble_size( enkf_main ) - 1; - iens1 = 0; - first_report = 0; - last_report = enkf_main_get_history_length( enkf_main ); - { - char * path; - char * prompt = util_alloc_sprintf("File to store \'%s\'", user_key); - util_printf_prompt(prompt , PROMPT_LEN , '=' , "=> "); - csv_file = util_alloc_stdin_line(); - - util_alloc_file_components( csv_file , &path , NULL , NULL); - if (path != NULL) { - if (util_entry_exists( path )) { - if (!util_is_directory( path )) { - /* The path component already exists in the filesystem - and it is not a directory - we leave the building. */ - fprintf(stderr,"Sorry: %s already exists - and is not a directory.\n",path); - free(path); - free(csv_file); - free(user_key); - return ; - } - } else { - /* The path does not exist - we make it. */ - enkf_tui_util_msg("Creating new directory: %s\n" , path); - util_make_path( path ); - } - } - free(prompt); - } - { - /* Seriously manual creation of csv file. */ - enkf_fs_type * fs = enkf_main_tui_get_fs(enkf_main); - enkf_node_type * node = enkf_node_alloc( config_node ); - FILE * stream = util_fopen( csv_file , "w"); - msg_type * msg = msg_alloc("Exporting report_step/member: " , false); - node_id_type node_id; - - - /* Header line */ - fprintf(stream , "\"Report step\""); - for (iens = iens1; iens <= iens2; iens++) - fprintf(stream , "%s\"%s(%d)\"" , CSV_SEP , user_key , iens); - fprintf(stream , CSV_NEWLINE); - - msg_show(msg); - for (report_step = first_report; report_step <= last_report; report_step++) { - fprintf(stream , "%6d" , report_step); - node_id.report_step = report_step; - for (iens = iens1; iens <= iens2; iens++) { - double value; - char label[32]; - /* - Have not implemented a choice on forecast/analyzed. Tries - analyzed first, then forecast. - */ - node_id.iens = iens; - sprintf(label , "%03d/%03d" , report_step , iens); - msg_update( msg , label); - - if (enkf_node_user_get( node , fs , key_index , node_id , &value)) - fprintf(stream , "%s%g" , CSV_SEP , value); - else - fprintf(stream , "%s%s" , CSV_SEP , CSV_MISSING_VALUE); - - } - fprintf(stream , CSV_NEWLINE); - } - - msg_free( msg , true ); - enkf_node_free( node ); - fclose(stream); - } - } else - fprintf(stderr,"Sorry - could not find any nodes with key:%s\n",user_key); - - free(user_key); -} - - -#undef CSV_NEWLINE -#undef CSV_MISSING_VALUE -#undef CSV_SEP - -/*****************************************************************/ - -void enkf_tui_export_stat(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - { - const ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main); - const enkf_config_node_type * config_node; - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - const int last_report = enkf_main_get_history_length( enkf_main ); - int report_step; - - config_node = enkf_tui_util_scanf_key( ensemble_config , PROMPT_LEN , INVALID , INVALID_VAR ); - report_step = util_scanf_int_with_limits("Report step: ", PROMPT_LEN , 0 , last_report); - { - char * mean_file , * mean_path; - char * std_file , * std_path; - - util_printf_prompt("Filename to store mean in " , PROMPT_LEN , '=' , "=> "); - { - char * tmp = util_alloc_stdin_line(); - char * mean_base , * mean_ext; - util_alloc_file_components( tmp , &mean_path , &mean_base , &mean_ext ); - if (mean_path != NULL) - util_make_path( mean_path ); - mean_file = util_alloc_filename( NULL , mean_base , mean_ext ); - util_safe_free( mean_base ); - util_safe_free( mean_ext ); - free( tmp ); - } - - util_printf_prompt("Filename to store std in " , PROMPT_LEN , '=' , "=> "); - { - char * tmp = util_alloc_stdin_line(); - char * std_base , * std_ext; - util_alloc_file_components( tmp , &std_path , &std_base , &std_ext ); - if (std_path != NULL) - util_make_path( std_path ); - std_file = util_alloc_filename( NULL , std_base , std_ext ); - util_safe_free( std_base ); - util_safe_free( std_ext ); - free( tmp ); - } - - { - enkf_node_type ** ensemble = enkf_main_get_node_ensemble( enkf_main , - enkf_main_tui_get_fs( enkf_main ) , - enkf_config_node_get_key( config_node ) , - report_step ); - enkf_node_type * mean = enkf_node_copyc( ensemble[0] ); - enkf_node_type * std = enkf_node_copyc( ensemble[0] ); - - /* Calculating */ - enkf_main_node_mean( (const enkf_node_type **) ensemble , ens_size , mean ); - enkf_main_node_std( (const enkf_node_type **) ensemble , ens_size , mean , std ); - - { - ecl_write_ftype * ecl_write_func = enkf_node_get_func_pointer( mean ); - ecl_write_func( enkf_node_value_ptr( mean ) , mean_path , mean_file , NULL ); - ecl_write_func( enkf_node_value_ptr( std ) , std_path , std_file , NULL ); - } - - free( ensemble ); - util_safe_free( std_file ); - util_safe_free( std_path ); - util_safe_free( mean_file ); - util_safe_free( mean_path ); - enkf_node_free( mean ); - enkf_node_free( std ); - } - } - } -} - - - - -void enkf_tui_export_menu(void * arg) { - - enkf_main_type * enkf_main = enkf_main_safe_cast(arg); - menu_type * menu = menu_alloc("Export data to other formats" , "Back" , "bB"); - menu_add_item(menu , "Export scalar value to CSV file" , "xX" , enkf_tui_export_scalar2csv , enkf_main , NULL); - menu_add_separator(menu); - menu_add_item(menu , "Export fields to RMS Roff format" , "rR" , enkf_tui_export_roff , enkf_main , NULL); - menu_add_item(menu , "Export fields to ECLIPSE grdecl format" , "gG" , enkf_tui_export_grdecl , enkf_main , NULL); - menu_add_item(menu , "Export fields to ECLIPSE restart format (active cells)" , "aA" , enkf_tui_export_restart_active , enkf_main , NULL); - menu_add_item(menu , "Export fields to ECLIPSE restart format (all cells)" , "lL" , enkf_tui_export_restart_all , enkf_main , NULL); - menu_add_separator(menu); - menu_add_item(menu , "Export P( a =< x < b )" , "sS" , enkf_tui_export_fieldP , enkf_main , NULL); - menu_add_separator(menu); - menu_add_item(menu , "Export cell values to text file(s)" , "cC" , enkf_tui_export_cell , enkf_main , NULL); - menu_add_item(menu , "Export line profile of a field to text file(s)" , "pP" , enkf_tui_export_profile , enkf_main , NULL); - menu_add_item(menu , "Export time development in one cell to text file(s)" , "tT" , enkf_tui_export_time , enkf_main , NULL); - menu_add_separator(menu); - menu_add_item(menu , "Export GEN_DATA/GEN_PARAM to file" , "dD" , enkf_tui_export_gen_data , enkf_main , NULL); - menu_add_separator( menu ); - menu_add_item(menu , "EclWrite mean and std" , "mM" , enkf_tui_export_stat , enkf_main , NULL ); - menu_add_item(menu , "Help" , "hH" , enkf_tui_help_menu_export , enkf_main , NULL ); - menu_run(menu); - menu_free(menu); -} diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_export.h b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_export.h deleted file mode 100644 index c7aa3021bd..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_export.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_export.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_TUI_EXPORT_H -#define ERT_ENKF_TUI_EXPORT_H - -void enkf_tui_export_menu(void *); - - - -#endif diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_fs.c b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_fs.c deleted file mode 100644 index e415060278..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_fs.c +++ /dev/null @@ -1,354 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_fs.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - - -void enkf_tui_fs_ls_case(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - stringlist_type * dirlist = enkf_main_alloc_caselist( enkf_main ); - int idir; - - printf("Available cases: "); - for (idir = 0; idir < stringlist_get_size( dirlist ); idir++) - printf("%s ",stringlist_iget( dirlist , idir )); - - printf("\n"); - stringlist_free( dirlist ); -} - - -void enkf_tui_fs_create_case(void * arg) -{ - int prompt_len = 50; - char new_case[256]; - char * menu_title; - - arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); - enkf_main_type * enkf_main = enkf_main_safe_cast( arg_pack_iget_ptr(arg_pack, 0) ); - menu_type * menu = arg_pack_iget_ptr(arg_pack, 1); - - util_printf_prompt("Name of new case" , prompt_len , '=' , "=> "); - if (fgets(new_case, prompt_len, stdin) != NULL){ - char *newline = strchr(new_case, '\n'); - if (newline) - *newline = 0; - - if(strlen(new_case) != 0) - enkf_main_select_fs( enkf_main , new_case ); - - } - menu_title = util_alloc_sprintf("Manage cases. Current: %s", enkf_main_get_current_fs(enkf_main)); - menu_set_title(menu, menu_title); - free(menu_title); -} - - - -/** - Return NULL if no action should be performed. -*/ -static char * enkf_tui_fs_alloc_existing_case(enkf_main_type * enkf_main , const char * prompt , int prompt_len) { - char * name; - while (true) { - util_printf_prompt(prompt , prompt_len , '=' , "=> "); - name = util_alloc_stdin_line(); - - if (name == NULL) /* The user entered a blank string */ - break; - else { - char * mount_point = enkf_main_alloc_mount_point( enkf_main , name ); - - if (enkf_fs_exists( mount_point )) - break; - else { - printf("** can not find case: \"%s\" \n",name); - free(name); - } - - free( mount_point ); - } - - } - - return name; -} - - - - -void enkf_tui_fs_select_case(void * arg) -{ - int prompt_len = 40; - char * new_case; - char * menu_title; - - arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); - enkf_main_type * enkf_main = enkf_main_safe_cast( arg_pack_iget_ptr(arg_pack, 0) ); - menu_type * menu = arg_pack_iget_ptr(arg_pack, 1); - new_case = enkf_tui_fs_alloc_existing_case( enkf_main , "Name of case" , prompt_len); - if (new_case != NULL) { - enkf_main_select_fs( enkf_main , new_case ); - - menu_title = util_alloc_sprintf("Manage cases. Current: %s", enkf_main_get_current_fs( enkf_main )); - menu_set_title(menu, menu_title); - free(menu_title); - free(new_case); - } -} - - - - - - -static void enkf_tui_fs_copy_ensemble__( - enkf_main_type * enkf_main, - const char * source_case, - const char * target_case, - int report_step_from, - int report_step_to, - bool only_parameters) -{ - msg_type * msg = msg_alloc("Copying: " , false); - ensemble_config_type * config = enkf_main_get_ensemble_config(enkf_main); - int ens_size = enkf_main_get_ensemble_size(enkf_main); - char * ranking_key; - const perm_vector_type * ranking_permutation = NULL; - int * identity_permutation_raw; - ranking_table_type * ranking_table = enkf_main_get_ranking_table( enkf_main ); - - - if (ranking_table_get_size( ranking_table ) > 0) { - util_printf_prompt("Name of ranking to resort by (or blank)" , 50 , '=' , "=> "); - ranking_key = util_alloc_stdin_line(); - if (ranking_table_has_ranking( ranking_table , ranking_key )) - ranking_permutation = ranking_table_get_permutation( ranking_table , ranking_key ); - else { - fprintf(stderr," Sorry: ranking:%s does not exist \n", ranking_key ); - return; - } - } - identity_permutation_raw = util_calloc( ens_size , sizeof * identity_permutation_raw ); - { - int iens; - for (iens =0; iens < ens_size; iens++) - identity_permutation_raw[iens] = iens; - } - - if (ranking_permutation == NULL) - ranking_permutation = perm_vector_alloc(identity_permutation_raw, ens_size); - - - { - /* If the current target_case does not exist it is automatically created by the select_write_dir function */ - enkf_fs_type * src_fs = enkf_main_mount_alt_fs( enkf_main , source_case , false ); - enkf_fs_type * target_fs = enkf_main_mount_alt_fs( enkf_main , target_case , true ); - - stringlist_type * nodes = ensemble_config_alloc_keylist_from_var_type(config, PARAMETER); - - { - int num_nodes = stringlist_get_size(nodes); - msg_show(msg); - for(int i = 0; i < num_nodes; i++) { - const char * key = stringlist_iget(nodes, i); - enkf_config_node_type * config_node = ensemble_config_get_node(config , key); - msg_update(msg , key); - enkf_node_copy_ensemble(config_node, src_fs , target_fs , report_step_from, report_step_to , ens_size , ranking_permutation); - } - } - - enkf_fs_decref( src_fs ); - enkf_fs_decref( target_fs ); - - msg_free(msg , true); - stringlist_free(nodes); - } - free( identity_permutation_raw ); -} - - - - - -void enkf_tui_fs_initialize_case_from_copy(void * arg) -{ - int prompt_len =50; - char * source_case; - int ens_size; - int last_report; - int src_step; - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - - ens_size = enkf_main_get_ensemble_size( enkf_main ); - - - last_report = enkf_main_get_history_length( enkf_main ); - - source_case = enkf_tui_fs_alloc_existing_case( enkf_main , "Initialize from case" , prompt_len); - if (source_case != NULL) { - src_step = util_scanf_int_with_limits("Source report step",prompt_len , 0 , last_report); - enkf_fs_type * source_fs = enkf_main_mount_alt_fs( enkf_main , source_case , false ); - enkf_main_init_current_case_from_existing(enkf_main, source_fs , src_step); - enkf_fs_decref(source_fs); - } - util_safe_free( source_case ); -} - - - -void enkf_tui_fs_copy_ensemble(void * arg) -{ - int prompt_len = 35; - char * source_case; - - int last_report; - int report_step_from; - char * report_step_from_as_char; - int report_step_to; - - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - - source_case = util_alloc_string_copy(enkf_main_get_current_fs( enkf_main )); - last_report = enkf_main_get_history_length( enkf_main ); - - report_step_from_as_char = util_scanf_int_with_limits_return_char("Source report step",prompt_len , 0 , last_report); - if(strlen(report_step_from_as_char) !=0){ - util_sscanf_int(report_step_from_as_char , &report_step_from); - { - util_printf_prompt("Target case" , prompt_len , '=' , "=> "); - char target_case[256]; - - if ( fgets(target_case, prompt_len, stdin)) { - char *newline = strchr(target_case, '\n'); - if (newline) - *newline = 0; - } - - if (strlen(target_case)) { - char * report_step_to_as_char = util_scanf_int_with_limits_return_char("Target report step",prompt_len , 0 , last_report); - if (strlen(report_step_to_as_char)) { - util_sscanf_int(report_step_to_as_char , &report_step_to); - enkf_tui_fs_copy_ensemble__(enkf_main, source_case, target_case, report_step_from, report_step_to, false); - } - free(report_step_to_as_char); - } - } - } - free(source_case); - free(report_step_from_as_char); -} - - - -void enkf_tui_fs_copy_ensemble_of_parameters(void * arg) -{ - int prompt_len = 35; - char * source_case; - - int last_report; - int report_step_from; - char * report_step_from_as_char; - int report_step_to; - - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - - source_case = util_alloc_string_copy(enkf_main_get_current_fs( enkf_main )); - last_report = enkf_main_get_history_length( enkf_main ); - - report_step_from_as_char = util_scanf_int_with_limits_return_char("Source report step",prompt_len , 0 , last_report); - if(strlen(report_step_from_as_char) !=0){ - util_sscanf_int(report_step_from_as_char , &report_step_from); - { - - util_printf_prompt("Target case" , prompt_len , '=' , "=> "); - char target_case[256]; - - if ( fgets(target_case, prompt_len, stdin) ) { - char *newline = strchr(target_case, '\n'); - if (newline) - *newline = 0; - } - - if (strlen(target_case)) { - char * report_step_to_as_char = util_scanf_int_with_limits_return_char("Target report step",prompt_len , 0 , last_report); - if(strlen(report_step_to_as_char) !=0){ - util_sscanf_int(report_step_to_as_char , &report_step_to); - enkf_tui_fs_copy_ensemble__(enkf_main, source_case, target_case, report_step_from, report_step_to, true); - } - free(report_step_to_as_char); - } - } - } - free(source_case); - free(report_step_from_as_char); -} - - -void enkf_tui_fs_menu(void * arg) { - - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - - const char * menu_title = util_alloc_sprintf("Manage cases - current: %s", enkf_main_get_current_fs( enkf_main )); - menu_type * menu = menu_alloc(menu_title , "Back" , "bB"); - - menu_add_item(menu , "List available cases" , "lL" , enkf_tui_fs_ls_case , enkf_main , NULL); - - { - arg_pack_type * arg_pack = arg_pack_alloc(); - arg_pack_append_ptr(arg_pack , enkf_main); - arg_pack_append_ptr(arg_pack , menu); - menu_add_item(menu , "Create and select new case" , "cC" , enkf_tui_fs_create_case, arg_pack , arg_pack_free__); - } - - { - arg_pack_type * arg_pack = arg_pack_alloc(); - arg_pack_append_ptr(arg_pack , enkf_main); - arg_pack_append_ptr(arg_pack , menu); - menu_add_item(menu , "Select case" , "sS" , enkf_tui_fs_select_case, arg_pack , arg_pack_free__); - } - - menu_add_separator(menu); - menu_add_item(menu, "Initialize case from scratch" , "iI" , enkf_tui_init_menu , enkf_main , NULL); - menu_add_item(menu, "Initialize case from existing case" , "aA" , enkf_tui_fs_initialize_case_from_copy , enkf_main , NULL); - - menu_add_separator(menu); - /* Are these two in use??? */ - menu_add_item(menu, "Copy full ensemble to another case", "eE", enkf_tui_fs_copy_ensemble, enkf_main, NULL); - menu_add_item(menu, "Copy ensemble of parameters to another case", "oO", enkf_tui_fs_copy_ensemble_of_parameters, enkf_main, NULL); - menu_add_item(menu , "Help" , "hH" , enkf_tui_help_menu_cases , enkf_main , NULL); - - menu_run(menu); - menu_free(menu); -} - diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_fs.h b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_fs.h deleted file mode 100644 index 49b8f1efc3..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_fs.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_fs.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_TUI_FS_H -#define ERT_ENKF_TUI_FS_H - -void enkf_tui_fs_menu(void * ); - -#endif diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_help.c b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_help.c deleted file mode 100644 index 6297ad91aa..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_help.c +++ /dev/null @@ -1,232 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'enkf_tui_QC.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - - -void enkf_tui_help_manual_main( void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - const site_config_type * site_config = enkf_main_get_site_config ( enkf_main ); - const char * manual_url = site_config_get_manual_url( site_config ); - const char * browser = getenv("BROWSER"); - - if (browser == NULL) - browser = site_config_get_default_browser( site_config ); - - { - char * cmd = util_alloc_sprintf("%s %s &" , browser , manual_url); - system(cmd); - free( cmd ); - } -} - -void enkf_tui_help_menu_main(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - { - menu_type * menu = menu_alloc("Help: Main menu" , "Back" , "bB"); - menu_add_helptext(menu , "Choose the different options from the main menu to read more about the different options."); - menu_add_item(menu , "Open manual (firefox)" , "mM" , enkf_tui_help_manual_main , enkf_main , NULL); - menu_run(menu); - menu_free(menu); - } -} - -void enkf_tui_help_manual_cases( void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - const site_config_type * site_config = enkf_main_get_site_config ( enkf_main ); - const char * manual_url = site_config_get_manual_url( site_config ); - const char * browser = getenv("BROWSER"); - - if (browser == NULL) - browser = site_config_get_default_browser( site_config ); - - { - char * cmd = util_alloc_sprintf("%s %s%s &" , browser , manual_url , "#Manage_cases"); - system(cmd); - free( cmd ); - } -} - -void enkf_tui_help_menu_cases(void * arg) { - - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - menu_type * menu = menu_alloc("Help: Manage cases" , "Back" , "bB"); - menu_add_helptext(menu , "Use this menu to navgate between cases and to initialize cases. A case has to be initialized before it can be used."); - menu_add_item(menu , "Open manual (firefox)" , "mM" , enkf_tui_help_manual_cases , enkf_main , NULL); - menu_run(menu); - menu_free(menu); -} - -void enkf_tui_help_manual_run( void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - const site_config_type * site_config = enkf_main_get_site_config ( enkf_main ); - const char * manual_url = site_config_get_manual_url( site_config ); - const char * browser = getenv("BROWSER"); - - if (browser == NULL) - browser = site_config_get_default_browser( site_config ); - - { - char * cmd = util_alloc_sprintf("%s %s%s &" , browser , manual_url , "#Run_or_restart_experiment"); - system(cmd); - free( cmd ); - } -} - -void enkf_tui_help_menu_run(void * arg) { - - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - menu_type * menu = menu_alloc("Help: Run menu" , "Back" , "bB"); - menu_add_helptext(menu , "This menu is used to do the main work in ERT. The first option, x: Ensemble run: history, will just run the case without any data conditioning. Options r and s will initiate classical enkf runs. The two options i and t invokes the ensemble kalman smoother."); - menu_add_item(menu , "Open manual (firefox)" , "mM" , enkf_tui_help_manual_run , enkf_main , NULL); - menu_run(menu); - menu_free(menu); -} - - -void enkf_tui_help_manual_rank( void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - const site_config_type * site_config = enkf_main_get_site_config ( enkf_main ); - const char * manual_url = site_config_get_manual_url( site_config ); - const char * browser = getenv("BROWSER"); - - if (browser == NULL) - browser = site_config_get_default_browser( site_config ); - - { - char * cmd = util_alloc_sprintf("%s %s%s &" , browser , manual_url , "#Rank_Results"); - system(cmd); - free( cmd ); - } -} - -void enkf_tui_help_menu_rank(void * arg) { - - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - menu_type * menu = menu_alloc("Help: Rank results" , "Back" , "bB"); - menu_add_helptext(menu , "Use this option to rank results after the case has been run."); - menu_add_item(menu , "Open manual (firefox)" , "mM" , enkf_tui_help_manual_rank , enkf_main , NULL); - menu_run(menu); - menu_free(menu); -} - -void enkf_tui_help_manual_export( void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - const site_config_type * site_config = enkf_main_get_site_config ( enkf_main ); - const char * manual_url = site_config_get_manual_url( site_config ); - const char * browser = getenv("BROWSER"); - - if (browser == NULL) - browser = site_config_get_default_browser( site_config ); - - { - char * cmd = util_alloc_sprintf("%s %s%s &" , browser , manual_url , "#Export_data_to_other_formats"); - system(cmd); - free( cmd ); - } -} - -void enkf_tui_help_menu_export(void * arg) { - - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - menu_type * menu = menu_alloc("Help: Export results" , "Back" , "bB"); - menu_add_helptext(menu , "Use this option to export results after the case has been run."); - menu_add_item(menu , "Open manual (firefox)" , "mM" , enkf_tui_help_manual_export , enkf_main , NULL); - menu_run(menu); - menu_free(menu); -} - -void enkf_tui_help_manual_table( void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - const site_config_type * site_config = enkf_main_get_site_config ( enkf_main ); - const char * manual_url = site_config_get_manual_url( site_config ); - const char * browser = getenv("BROWSER"); - - if (browser == NULL) - browser = site_config_get_default_browser( site_config ); - - { - char * cmd = util_alloc_sprintf("%s %s%s &" , browser , manual_url , "#Table_of_results"); - system(cmd); - free( cmd ); - } -} - -void enkf_tui_help_menu_table(void * arg) { - - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - menu_type * menu = menu_alloc("Help: Table of results" , "Back" , "bB"); - menu_add_helptext(menu , "This option can generate a table of results after the case has been run."); - menu_add_item(menu , "Open manual (firefox)" , "mM" , enkf_tui_help_manual_table , enkf_main , NULL); - menu_run(menu); - menu_free(menu); -} - -void enkf_tui_help_manual_misc( void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - const site_config_type * site_config = enkf_main_get_site_config ( enkf_main ); - const char * manual_url = site_config_get_manual_url( site_config ); - const char * browser = getenv("BROWSER"); - - if (browser == NULL) - browser = site_config_get_default_browser( site_config ); - - { - char * cmd = util_alloc_sprintf("%s %s%s &" , browser , manual_url , "#Miscellaneous"); - system(cmd); - free( cmd ); - } -} - -void enkf_tui_help_menu_misc(void * arg) { - - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - menu_type * menu = menu_alloc("Help: Miscellanous" , "Back" , "bB"); - menu_add_helptext(menu , "This option contains miscellaneous options."); - menu_add_item(menu , "Open manual (firefox)" , "mM" , enkf_tui_help_manual_misc , enkf_main , NULL); - menu_run(menu); - menu_free(menu); -} - -void enkf_tui_help_menu_simple(void * arg) { - - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - menu_type * menu = menu_alloc("Help: Simple menu" , "Back" , "bB"); - menu_add_helptext(menu , "The top four options in the simple menu will run eclipse simulations. Option s: Sensitivity run: No data conditioning, will initialize all parameters and run one eclipse simulation for each set of different parameters. e: Assimilation run: EnKF updates, will initialize all parameters and run one eclipse simulation for each set of different parameters. The eclipse simulations will run until the first data time step is encountered and condition on data before continuing. a: Assimilation run: Smoother update, will do one pass of the sensitivity run, then condition the parameters to all the data and rerun all experiments. i: Assimilation run: Iterated smoother [RML-EnKF] will iterate the smoother run several times."); - menu_add_item(menu , "Open manual (firefox)" , "mM" , enkf_tui_help_manual_main , enkf_main , NULL); - menu_run(menu); - menu_free(menu); -} - diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_help.h b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_help.h deleted file mode 100644 index b9f0a5ec0b..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_help.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'enkf_tui_QC.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_TUI_HELP_H -#define ERT_ENKF_TUI_HELP_H - - - -void enkf_tui_help_menu_main(void * ); -void enkf_tui_help_menu_cases(void * ); -void enkf_tui_help_menu_run(void * ); -void enkf_tui_help_menu_plot(void * ); -void enkf_tui_help_menu_rank(void * ); -void enkf_tui_help_menu_export(void * ); -void enkf_tui_help_menu_table(void * ); -void enkf_tui_help_menu_misc(void * ); -void enkf_tui_help_menu_simple(void * ); -#endif diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_init.c b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_init.c deleted file mode 100644 index b028caefa7..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_init.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_init.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - - - - -void enkf_tui_init(enkf_main_type * enkf_main, bool all_members , bool all_parameters , bool interval ) { - const int prompt_len = 35; - const ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main); - int ens_size = enkf_main_get_ensemble_size( enkf_main ); - int iens1, iens2; - init_mode_type init_mode = INIT_FORCE; - bool iens_valid = false; - - /* iens2 should be interpreted as __inclusive__ */ - if ( all_members ) { - iens1 = 0; - iens2 = ens_size - 1; - iens_valid = true; - } else { - if( interval ) { - char * iens1char = util_scanf_int_with_limits_return_char("First ensemble member in interval" , prompt_len , 0 , ens_size - 1); - if (strlen(iens1char)) { - util_sscanf_int(iens1char , &iens1); - char * iens2char = util_scanf_int_with_limits_return_char("Second ensemble member in interval" , prompt_len , iens1 , ens_size - 1); - if (strlen(iens2char)) { - util_sscanf_int(iens2char , &iens2); - iens_valid = true; - } - free(iens2char); - } - free(iens1char); - } else { - char * iens1char = util_scanf_int_with_limits_return_char("Initialize ensemble member" , prompt_len , 0 , ens_size - 1); - if (strlen(iens1char)) { - util_sscanf_int(iens1char , &iens1); - iens2 = iens1; - iens_valid = true; - } - free(iens1char); - } - } - - if (iens_valid) { - stringlist_type * param_list = NULL; - if (all_parameters) - param_list = ensemble_config_alloc_keylist_from_var_type( ensemble_config , PARAMETER ); - else { - const enkf_config_node_type * config_node = NULL; - param_list = stringlist_alloc_new(); - config_node = enkf_tui_util_scanf_key(ensemble_config , prompt_len , INVALID , INVALID_VAR); - if( config_node != NULL ) - stringlist_append_copy( param_list , enkf_config_node_get_key(config_node)); - } - - if (param_list != NULL) { - enkf_fs_type * init_fs = enkf_main_tui_get_fs( enkf_main ); - bool_vector_type * iens_mask = bool_vector_alloc( ens_size , false ); - bool_vector_iset_block( iens_mask , iens1 , iens2 - iens1 + 1, true ); - enkf_main_initialize_from_scratch(enkf_main , init_fs , param_list , iens_mask , init_mode); - bool_vector_free( iens_mask ); - stringlist_free( param_list ); - } - } -} - - -static void enkf_tui_init1(void * enkf_main) { - enkf_tui_init(enkf_main, true , true , false); -} - -static void enkf_tui_init2(void * enkf_main) { - enkf_tui_init(enkf_main , true , false , false); -} - -static void enkf_tui_init3(void * enkf_main) { - enkf_tui_init(enkf_main , false , true , false); -} - -static void enkf_tui_init4(void * enkf_main) { - enkf_tui_init(enkf_main , false , false, false); -} - -static void enkf_tui_init5(void * enkf_main) { - enkf_tui_init(enkf_main , false , true, true); -} - -static void enkf_tui_init6(void * enkf_main) { - enkf_tui_init(enkf_main , false , false, true); -} - -void enkf_tui_init_menu(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast(arg); - - menu_type * menu = menu_alloc("Initialize from scratch" , "Back" , "bB"); - menu_add_item(menu , "Initialize all members/all parameters" , "1" , enkf_tui_init1 , enkf_main , NULL); - menu_add_item(menu , "Initialize all members/one parameter" , "2" , enkf_tui_init2 , enkf_main , NULL); - menu_add_item(menu , "Initialize one member/all parameters" , "3" , enkf_tui_init3 , enkf_main , NULL); - menu_add_item(menu , "Initialize one member/one parameter" , "4" , enkf_tui_init4 , enkf_main , NULL); - menu_add_item(menu , "Initialize interval of ensemble members/all parameters" , "5" , enkf_tui_init5 , enkf_main , NULL); - menu_add_item(menu , "Initialize interval of ensemble members/one parameter" , "6" , enkf_tui_init6 , enkf_main , NULL); - menu_run(menu); - menu_free(menu); - -} diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_init.h b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_init.h deleted file mode 100644 index 73bc1f78c2..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_init.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_init.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_TUI_INIT_H -#define ERT_ENKF_TUI_INIT_H - - -void enkf_tui_init_menu(void * ); - - -#endif diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_main.c b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_main.c deleted file mode 100644 index 0741f7c9c0..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_main.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_main.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -/** - This file implements the (text based) user interface in the enkf - system. -*/ - - - -/** - The main loop. -*/ - - - - - -void enkf_tui_main_menu(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - menu_type * menu = menu_alloc("Main menu" , "Quit" , "qQ"); - - menu_add_item(menu , "Manage cases" , "cC" , enkf_tui_fs_menu , enkf_main , NULL); - menu_add_item(menu , "Run, restart or analyse experiment" , "rR" , enkf_tui_run_menu , enkf_main , NULL); - menu_add_item(menu , "Rank results" , "aA" , enkf_tui_ranking_menu , enkf_main , NULL); - menu_add_item(menu , "Export data to other formats" , "eE" , enkf_tui_export_menu , enkf_main , NULL); - menu_add_item(menu , "Table of results" , "tT" , enkf_tui_table_menu , enkf_main , NULL); - menu_add_item(menu , "Miscellanous" , "mM" , enkf_tui_misc_menu , enkf_main , NULL); - menu_add_item(menu , "Workflows" , "wW" , enkf_tui_workflow_menu , enkf_main , NULL); - menu_add_item(menu , "Help" , "hH" , enkf_tui_help_menu_main , enkf_main , NULL); - menu_add_item(menu , "Simple menu" , "sS" , enkf_tui_simple_menu , enkf_main , NULL); - menu_run(menu); - menu_free(menu); -} - - diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_main.h b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_main.h deleted file mode 100644 index 0016bb50c4..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_main.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_main.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_INTER_MAIN_H -#define ERT_ENKF_INTER_MAIN_H -#include - - -void enkf_tui_main_menu(void * arg); - - -#endif diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_misc.c b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_misc.c deleted file mode 100644 index 790cbe26da..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_misc.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_misc.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include - -#include -#include - -#include -#include -#include - -#include -#include - -static void enkf_tui_misc_printf_subst_list(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - - /* These could/should be user input ... */ - int step1 = 0; /* < 0 => no reinitializtion of the dynamic substitutions. */ - int step2 = 10; - int iens = 0; - - enkf_state_type * enkf_state = enkf_main_iget_state( enkf_main , iens ); - enkf_state_printf_subst_list( enkf_state , step1 , step2 ); -} - - -static void enkf_tui_misc_list_jobs(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - const ext_joblist_type * installed_jobs = enkf_main_get_installed_jobs( enkf_main ); - stringlist_type * job_names = ext_joblist_alloc_list( installed_jobs ); - int job_nr; - stringlist_sort( job_names , NULL ); - printf("================================================================================\n"); - printf("%-30s : Arguments\n" , "Job name"); - printf("--------------------------------------------------------------------------------\n"); - for (job_nr = 0; job_nr < stringlist_get_size( job_names ); job_nr++) { - const ext_job_type * job = ext_joblist_get_job( installed_jobs , stringlist_iget( job_names , job_nr )); - const stringlist_type * arglist = ext_job_get_arglist( job ); - printf("%-30s : " , stringlist_iget( job_names , job_nr )); - if (arglist != NULL) - stringlist_fprintf( arglist , " " , stdout ); - printf("\n"); - } - printf("================================================================================\n"); - stringlist_free( job_names ); -} - - - - -void enkf_tui_misc_menu( void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - menu_type * menu = menu_alloc( "Misceallanous stuff" , "Back" , "bB"); - menu_add_item(menu , "List all \'magic\' <...> strings" , "lL" , enkf_tui_misc_printf_subst_list , enkf_main , NULL); - menu_add_item(menu , "List all available forward model jobs","jJ" , enkf_tui_misc_list_jobs , enkf_main , NULL ); - menu_add_item(menu , "Help","hH" , enkf_tui_help_menu_misc , enkf_main , NULL ); - menu_run(menu); - menu_free(menu); -} diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_misc.h b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_misc.h deleted file mode 100644 index 0a260649ab..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_misc.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_misc.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_TUI_MISC_H -#define ERT_ENKF_TUI_MISC_H - - -void enkf_tui_misc_menu( void * arg); - - -#endif diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_ranking.c b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_ranking.c deleted file mode 100644 index d4267c7227..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_ranking.c +++ /dev/null @@ -1,220 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_ranking.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -static void enkf_tui_ranking_make_misfit_ensemble( void * arg) { - arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); - enkf_main_type * enkf_main = arg_pack_iget_ptr( arg_pack , 0 ); - - enkf_fs_type * fs = enkf_main_tui_get_fs(enkf_main); - enkf_obs_type * enkf_obs = enkf_main_get_obs( enkf_main ); - const ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main); - const int history_length = enkf_main_get_history_length( enkf_main ); - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - - - misfit_ensemble_type * misfit_ensemble = enkf_fs_get_misfit_ensemble( fs ); - misfit_ensemble_initialize( misfit_ensemble , ensemble_config , enkf_obs , fs , ens_size , history_length , false); - { - menu_item_type * obs_item = arg_pack_iget_ptr( arg_pack , 1 ); - menu_item_enable( obs_item ); - } -} - - -static void enkf_tui_ranking_create_obs( void * arg ) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - enkf_obs_type * enkf_obs = enkf_main_get_obs( enkf_main ); - enkf_fs_type * fs = enkf_main_tui_get_fs( enkf_main ); - misfit_ensemble_type * misfit_ensemble = enkf_fs_get_misfit_ensemble( fs ); - - if (!misfit_ensemble_initialized( misfit_ensemble )) { - fprintf(stderr,"Sorry: must initialzie the misfit table first \n"); - return; - } else { - ranking_table_type * ranking_table = enkf_main_get_ranking_table( enkf_main ); - const int history_length = enkf_main_get_history_length( enkf_main ); - const int prompt_len = 50; - const char * prompt1 = "Observations to use for ranking"; - const char * prompt2 = "Name to store ranking under"; - const char * store_prompt = "Name of file to store ranking"; - int step1,step2; - stringlist_type * ranking_keys; - char * obs_keys_input; - char * ranking_key; - char * ranking_file; - util_printf_prompt(prompt1 , prompt_len , '=' , "=> "); - obs_keys_input = util_alloc_stdin_line(); - ranking_keys = enkf_obs_alloc_matching_keylist( enkf_obs , obs_keys_input ); - enkf_tui_util_scanf_report_steps(history_length , prompt_len , &step1 , &step2); - - util_printf_prompt(prompt2 , prompt_len , '=' , "=> "); - ranking_key = util_alloc_stdin_line(); - if (ranking_key == NULL) - ranking_key = util_alloc_string_copy( MISFIT_DEFAULT_RANKING_KEY ); - - util_printf_prompt(store_prompt , prompt_len , '=' , "=> "); - ranking_file = util_alloc_stdin_line(); - - char * report_steps = util_alloc_sprintf("%d-%d", step1, step2); - int_vector_type * steps_vector = string_util_alloc_value_list(report_steps); - - if (stringlist_get_size( ranking_keys ) > 0) { - ranking_table_add_misfit_ranking( ranking_table , misfit_ensemble , ranking_keys , steps_vector, ranking_key ); - ranking_table_display_ranking( ranking_table , ranking_key); - } else - fprintf(stderr,"The input string : \"%s\" did not resolve to any valid observation keys \n", obs_keys_input); - - free(report_steps); - int_vector_free(steps_vector); - free( obs_keys_input ); - stringlist_free( ranking_keys ); - free( ranking_key ); - util_safe_free( ranking_file ); - } -} - - - - -static void enkf_tui_ranking_create_data__( void * arg , bool sort_increasing) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - ranking_table_type * ranking_table = enkf_main_get_ranking_table( enkf_main ); - enkf_fs_type * fs = enkf_main_tui_get_fs( enkf_main ); - ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config( enkf_main ); - time_map_type * time_map = enkf_fs_get_time_map( fs ); - const int prompt_len = 60; - const char * prompt1 = "Data key to use for ranking"; - const char * prompt2 = "Report step of data [Blank: last step]"; - const char * ranking_name = "Name of new ranking"; - - char * user_key; - - util_printf_prompt(prompt1 , prompt_len , '=' , "=> "); - user_key = util_alloc_stdin_line(); - if (user_key != NULL) { - util_printf_prompt( prompt2 , prompt_len , '=' , "=> "); - { - int step = -1; - { - char * step_char = util_alloc_stdin_line(); - - if (step_char == NULL) - step = time_map_get_last_step( time_map ); - else { - util_sscanf_int( step_char , &step ); - free( step_char ); - } - } - - if (step >= 0) { - const enkf_config_node_type * config_node; - char * key_index; - config_node = ensemble_config_user_get_node( ensemble_config , user_key , &key_index); - if (config_node) { - util_printf_prompt(ranking_name , prompt_len , '=' , "=> "); - char * ranking_key = util_alloc_stdin_line(); - if (ranking_key != NULL) { - ranking_table_add_data_ranking( ranking_table , sort_increasing , ranking_key , user_key , key_index , fs , config_node, step ); - ranking_table_display_ranking( ranking_table , ranking_key ); - } - util_safe_free( ranking_key ); - } - } - } - } - util_safe_free( user_key ); -} - -static void enkf_tui_ranking_create_data_increasing( void * arg ) { - enkf_tui_ranking_create_data__( arg , true ); -} - - -static void enkf_tui_ranking_create_data_decreasing( void * arg ) { - enkf_tui_ranking_create_data__( arg , false ); -} - - - -static void enkf_tui_ranking_display( void * arg ) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - ranking_table_type * ranking_table = enkf_main_get_ranking_table( enkf_main ); - - const int prompt_len = 50; - const char * prompt1 = "Ranking to display"; - char * ranking_key; - - util_printf_prompt(prompt1 , prompt_len , '=' , "=> "); - ranking_key = util_alloc_stdin_line(); - if (ranking_key == NULL) - ranking_key = util_alloc_string_copy( MISFIT_DEFAULT_RANKING_KEY); - if (ranking_table_has_ranking( ranking_table , ranking_key)) - ranking_table_display_ranking( ranking_table , ranking_key); - else - fprintf(stderr,"Sorry: could not find ranking key: %s \n", ranking_key ); - - free( ranking_key ); -} - - -void enkf_tui_ranking_menu(void * arg) { - - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - { - menu_type * menu = menu_alloc("Ranking of results" , "Back" , "bB"); - menu_item_type * obs_item; - { - arg_pack_type * arg_pack = arg_pack_alloc(); - arg_pack_append_ptr( arg_pack , enkf_main ); - menu_add_item(menu , "Create/update misfit table" , "cC" , enkf_tui_ranking_make_misfit_ensemble , arg_pack , arg_pack_free__); - menu_add_separator( menu ); - obs_item = menu_add_item(menu , "New observation based ranking" , "nN" , enkf_tui_ranking_create_obs , enkf_main , NULL); - arg_pack_append_ptr( arg_pack , obs_item ); - } - menu_add_item(menu , "New data based ranking (Sort: increasing)" , "iI" , enkf_tui_ranking_create_data_increasing , enkf_main , NULL); - menu_add_item(menu , "New data based ranking (Sort: decreasing)" , "dD" , enkf_tui_ranking_create_data_decreasing , enkf_main , NULL); - menu_add_item(menu , "Show ranking" , "sS" , enkf_tui_ranking_display , enkf_main , NULL); - { - enkf_fs_type * fs = enkf_main_tui_get_fs( enkf_main ); - misfit_ensemble_type * misfit_ensemble = enkf_fs_get_misfit_ensemble( fs ); - if (!misfit_ensemble_initialized( misfit_ensemble )) - menu_item_disable( obs_item ); - } - menu_add_item(menu , "Help" , "hH" , enkf_tui_help_menu_rank , enkf_main , NULL); - menu_run(menu); - menu_free(menu); - } - -} diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_ranking.h b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_ranking.h deleted file mode 100644 index 36fbed1505..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_ranking.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_ranking.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_TUI_RANKING_H -#define ERT_ENKF_TUI_RANKING_H - - - -void enkf_tui_ranking_menu(void * ); - - - -#endif diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_run.c b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_run.c deleted file mode 100644 index 64e3354236..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_run.c +++ /dev/null @@ -1,242 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_run.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - - - - - -void enkf_tui_run_smoother(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - int ens_size = enkf_main_get_ensemble_size( enkf_main ); - bool_vector_type * iactive = bool_vector_alloc( ens_size , true ); - enkf_fs_type * source_fs = enkf_main_tui_get_fs( enkf_main ); - enkf_main_run_smoother(enkf_main , source_fs , "AUTO-SMOOTHER" , iactive , 0 , true ); - bool_vector_free( iactive ); -} - - - -void enkf_tui_run_iterated_ES(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - const analysis_config_type * analysis_config = enkf_main_get_analysis_config(enkf_main); - analysis_iter_config_type * iter_config = analysis_config_get_iter_config(analysis_config); - int num_iter = analysis_iter_config_get_num_iterations(iter_config); - enkf_main_run_iterated_ES(enkf_main , num_iter ); -} - - -/** - Experiments will always start with the parameters at time == 0; if - you want to simulate with updated (posterior) parameters, you - ensure that by initializing from a report_step > 0 from an - existing case. - - Prediction part is included if it exists. -*/ - -void enkf_tui_run_exp(void * enkf_main) { - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - bool_vector_type * iactive = bool_vector_alloc(0,false); - bool ok = false; // is active_list select_string within range (< ens_size) - { - - char * prompt = util_alloc_sprintf("Which realizations [0,%d) to simulate (Ex: 1,3-5) [M to return to menu] : " , ens_size); - char * select_string; - - util_printf_prompt(prompt , PROMPT_LEN , '=' , "=> "); - select_string = util_alloc_stdin_line(); - ok = enkf_tui_util_sscanf_active_list( iactive , select_string , ens_size); - util_safe_free( select_string ); - free( prompt ); - } - if (ok && bool_vector_count_equal(iactive , true)) - enkf_main_run_tui_exp(enkf_main , iactive ); - - bool_vector_free(iactive); -} - - - -void enkf_tui_run_create_runpath__(void * __enkf_main) { - enkf_main_type * enkf_main = enkf_main_safe_cast(__enkf_main); - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - bool_vector_type * iactive = bool_vector_alloc(0,false); - - { - char * prompt = util_alloc_sprintf("Which realizations to create[ensemble size:%d] : " , ens_size); - char * select_string; - - util_printf_prompt(prompt , PROMPT_LEN , '=' , "=> "); - select_string = util_alloc_stdin_line(); - enkf_tui_util_sscanf_active_list( iactive , select_string , ens_size ); - - util_safe_free( select_string ); - free( prompt ); - } - enkf_main_create_run_path(enkf_main , iactive , 0 ); - bool_vector_free(iactive); -} - - - -static void enkf_tui_display_load_msg( int iens , const stringlist_type * msg_list ) { - for (int i=0; i < stringlist_get_size( msg_list ); i++) - printf("[%03d] : %s \n", iens , stringlist_iget( msg_list , i )); -} - - -void enkf_tui_run_manual_load__( void * arg ) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - bool_vector_type * iactive = bool_vector_alloc( 0 , false ); - int iter = 0; - - { - char * prompt = util_alloc_sprintf("Which realizations to load (Ex: 1,3-5) [M to return to menu] : [ensemble size:%d] : " , ens_size); - char * select_string; - util_printf_prompt(prompt , PROMPT_LEN , '=' , "=> "); - select_string = util_alloc_stdin_line(); - - enkf_tui_util_sscanf_active_list( iactive , select_string , ens_size ); - util_safe_free( select_string ); - - free( prompt ); - } - - { - const model_config_type * model_config = enkf_main_get_model_config( enkf_main ); - if (model_config_runpath_requires_iter( model_config )) { - const char * prompt = "Which iteration to load from [0...?) : "; - char * input; - bool OK; - util_printf_prompt(prompt , PROMPT_LEN , '=' , "=> "); - - input = util_alloc_stdin_line(); - if (input == NULL) - return; - - OK = util_sscanf_int( input , &iter ); - - free( input ); - if (!OK) - return; - } - } - - - if (bool_vector_count_equal( iactive , true )) { - stringlist_type ** realizations_msg_list = util_calloc( ens_size , sizeof * realizations_msg_list ); - int iens = 0; - for (; iens < ens_size; ++iens) { - realizations_msg_list[iens] = stringlist_alloc_new(); - } - - enkf_main_load_from_forward_model(enkf_main, iter , iactive, realizations_msg_list); - - for (iens = 0; iens < ens_size; ++iens) { - stringlist_type * msg_list = realizations_msg_list[iens]; - if (bool_vector_iget(iactive, iens)) { - if (stringlist_get_size( msg_list )) { - enkf_tui_display_load_msg( iens , msg_list ); - } - } - stringlist_free(msg_list); - } - free(realizations_msg_list); - } - - bool_vector_free( iactive ); -} - - - - - - -/*****************************************************************/ - -void enkf_tui_run_menu(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - model_config_type * model_config = enkf_main_get_model_config( enkf_main ); - path_fmt_type * runpath_fmt = model_config_get_runpath_fmt( model_config ); - menu_type * menu; - - { - char * title = util_alloc_sprintf("Run menu [case:%s Runpath:%s]" , enkf_main_get_current_fs( enkf_main ) , path_fmt_get_fmt ( runpath_fmt )); - menu = menu_alloc(title , "Back" , "bB"); - free(title); - } - menu_add_item(menu , "Ensemble run: history" , "xX" , enkf_tui_run_exp , enkf_main , NULL); - { - const analysis_config_type * analysis_config = enkf_main_get_analysis_config(enkf_main); - const enkf_obs_type * enkf_obs = enkf_main_get_obs( enkf_main ); - - - menu_item_type * ES_item = menu_add_item(menu , "Integrated smoother update" , "iI" , enkf_tui_run_smoother , enkf_main , NULL); - menu_item_type * it_ES_item = menu_add_item(menu , "Iterated smoother [RML-EnKF]" , "tT" , enkf_tui_run_iterated_ES , enkf_main , NULL); - - if (!analysis_config_get_module_option(analysis_config , ANALYSIS_ITERABLE)) { - menu_item_disable( it_ES_item ); - } else - menu_item_disable( ES_item ); - - if (!enkf_obs_have_obs( enkf_obs )) { - menu_item_disable( it_ES_item ); - menu_item_disable( ES_item ); - } - } - menu_add_separator(menu); - menu_add_item(menu , "Create runpath directories - NO simulation" , "cC" , enkf_tui_run_create_runpath__ , enkf_main , NULL ); - menu_add_item(menu , "Load results manually" , "lL" , enkf_tui_run_manual_load__ , enkf_main , NULL); - menu_add_separator(menu); - { - menu_item_type * analysis_item = menu_add_item(menu , "Analysis menu" , "aA" , enkf_tui_analysis_menu , enkf_main , NULL); - - if (!enkf_main_have_obs( enkf_main )) - menu_item_disable( analysis_item ); - } - menu_add_item(menu , "Help" , "hH" , enkf_tui_help_menu_run , enkf_main , NULL); - menu_run(menu); - menu_free(menu); -} diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_run.h b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_run.h deleted file mode 100644 index 331aefc993..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_run.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_run.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_TUI_RUN_H -#define ERT_ENKF_TUI_RUN_H - -void enkf_tui_run_menu(void *); -void enkf_tui_run_exp(void *); -void enkf_tui_run_start(void *); -void enkf_tui_run_smoother(void *); -void enkf_tui_run_iterated_ES(void *); - -#endif diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_simple.c b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_simple.c deleted file mode 100644 index 5e8fd2f5c7..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_simple.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_init.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - - -void enkf_tui_simple_menu(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast(arg); - menu_type * menu = menu_alloc("Simple menu" , "Quit" , "qQ"); - menu_add_item(menu , "Sensitivity run: No data conditioning" , "sS" , enkf_tui_run_exp , enkf_main , NULL); - const model_config_type * model_config = enkf_main_get_model_config( enkf_main ); - menu_item_type * ES_item = menu_add_item(menu , "Assimilation run: Smoother update" , "aA" , enkf_tui_run_smoother , enkf_main , NULL); - menu_item_type * it_ES_item = menu_add_item(menu , "Assimilation run: Iterated smoother [RML-EnKF]" , "iI" , enkf_tui_run_iterated_ES , enkf_main , NULL); - - if (!model_config_has_history( model_config )) { - menu_item_disable( it_ES_item ); - menu_item_disable( ES_item ); - } - menu_add_separator( menu ); - menu_add_item(menu , "Help" , "hH" , enkf_tui_help_menu_simple , enkf_main , NULL); - menu_add_item(menu , "Advanced menu" , "dD" , enkf_tui_main_menu , enkf_main , NULL); - menu_run(menu); - menu_free(menu); - -} diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_simple.h b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_simple.h deleted file mode 100644 index 36d612ade7..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_simple.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_main.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_TUI_SIMPLE_H -#define ERT_ENKF_TUI_SIMPLE_H - - -void enkf_tui_simple_menu(void * ); - - -#endif diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_table.c b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_table.c deleted file mode 100644 index 36fc097a23..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_table.c +++ /dev/null @@ -1,248 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_table.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - - - - -static void enkf_tui_table__(enkf_main_type * enkf_main , bool gen_kw_table , bool ens_plot) { - const ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main); - enkf_fs_type * fs = enkf_main_tui_get_fs(enkf_main); - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - const int last_report = enkf_main_get_history_length( enkf_main ); - int iens1, iens2, step1 , step2; - int ikey , num_keys; - int length; - FILE * stream = NULL; - int * index; - char ** user_keys; - char ** index_keys; - double ** data; - bool * active; - enkf_config_node_type ** config_nodes; - enkf_node_type ** nodes; - - const int prompt_len = 50; - const char * keylist_prompt = "Table headings: KEY1:INDEX1 KEY2:INDEX2 ...."; - const char * gen_kw_prompt = "GEN_KW Parameter"; - const char * file_prompt = "File to save in (blank for nothing) "; - - if (gen_kw_table) { - char * key; - enkf_config_node_type * config_node; - util_printf_prompt(gen_kw_prompt , prompt_len , '=' , "=> "); - key = util_alloc_stdin_line(); - if (ensemble_config_has_key( ensemble_config , key )) { - config_node = ensemble_config_get_node( ensemble_config , key ); - if (enkf_config_node_get_impl_type( config_node ) == GEN_KW) { - gen_kw_config_type * gen_kw_config = enkf_config_node_get_ref( config_node ); - num_keys = gen_kw_config_get_data_size( gen_kw_config ); - - user_keys = util_calloc( num_keys , sizeof * user_keys ); - for (int i=0; i < num_keys; i++) - user_keys[i] = gen_kw_config_alloc_user_key( gen_kw_config , i); - - } else { - fprintf(stderr,"wrong type of: %s \n",key); - free( key ); - return; /* going home on invalid input */ - } - } else { - fprintf(stderr,"** warning: do not have key:%s \n", key); - free( key ); - return ; /* going home on invalid input */ - } - free( key ); - } else { - char * input_keys; - util_printf_prompt(keylist_prompt , prompt_len , '=' , "=> "); - input_keys = util_alloc_stdin_line(); - util_split_string(input_keys , " " , &num_keys , &user_keys); - free( input_keys ); - } - - - util_printf_prompt(file_prompt , prompt_len , '=' , "=> "); - { - char * filename = util_alloc_stdin_line( ); - if (filename != NULL) - stream = util_mkdir_fopen( filename , "w"); - free( filename ); - } - - active = util_calloc( num_keys , sizeof * active ); - nodes = util_calloc( num_keys , sizeof * nodes ); - config_nodes = util_calloc( num_keys , sizeof * config_nodes ); - index_keys = util_calloc( num_keys , sizeof * index_keys ); - for (ikey = 0; ikey < num_keys; ikey++) { - config_nodes[ikey] = (enkf_config_node_type *) ensemble_config_user_get_node( ensemble_config , user_keys[ikey] , &index_keys[ikey]); - if (config_nodes[ikey] != NULL) { - nodes[ikey] = enkf_node_alloc( config_nodes[ikey] ); - active[ikey] = true; - } else { - fprintf(stderr,"** Warning: could not lookup node: %s \n",user_keys[ikey]); - nodes[ikey] = NULL; - active[ikey] = false; - } - } - - if (ens_plot) { - iens1 = 0; - iens2 = enkf_main_get_ensemble_size( enkf_main ); - step1 = util_scanf_int_with_limits("report step",prompt_len , 0 , last_report); - step2 = step1 + 1; - length = (iens2 - iens1); - } else { - iens1 = util_scanf_int_with_limits("ensemble member",prompt_len , 0 , ens_size - 1); - iens2 = iens1 + 1; - step1 = 0; - step2 = last_report + 1; - length = (step2 - step1); - } - index = util_calloc( length , sizeof * index ); - data = util_calloc( num_keys , sizeof * data ); - { - int i; - for (i = 0; i < num_keys; i++) - data[i] = util_calloc( length , sizeof * data[i] ); - } - - { - int active_length = 0; - int total_line_count = 0; - double line[num_keys]; - int iens, step; - - for (iens = iens1; iens < iens2; iens ++) { - for (step = step1; step < step2; step++) { - int line_count = 0; - - for (ikey = 0; ikey < num_keys; ikey++) { - if (active[ikey]) { - node_id_type node_id = {.report_step = step, - .iens = iens }; - if (enkf_node_user_get( nodes[ikey] , fs , index_keys[ikey] , node_id , &line[ikey])) - line_count++; - else - line[ikey] = -1; - } - } - - if (line_count > 0) { - for (ikey=0; ikey < num_keys; ikey++) - data[ikey][active_length] = line[ikey]; - index[active_length] = total_line_count; - active_length++; - } - - total_line_count++; - } - } - - if (stream != NULL) { - if (ens_plot) - enkf_util_fprintf_data( index , (const double **) data , "Realization" , (const char **) user_keys , active_length , num_keys , active , true , stream); - else - enkf_util_fprintf_data( index , (const double **) data , "Report-step" , (const char **) user_keys , active_length , num_keys , active , false , stream); - fclose(stream); - } - - printf("\n\n"); - if (ens_plot) - enkf_util_fprintf_data( index , (const double **) data , "Realization" , (const char **) user_keys , active_length , num_keys , active , true , stdout); - else - enkf_util_fprintf_data( index , (const double **) data , "Report-step" , (const char **) user_keys , active_length , num_keys , active , false , stdout); - } - - for (ikey = 0; ikey < num_keys; ikey++) { - if (active[ikey]) - enkf_node_free( nodes[ikey] ); - - free(index_keys[ikey]); - free(user_keys[ikey]); - free(data[ikey]); - } - free( user_keys ); - free( active ); - free( index_keys); - free( data ); - free( nodes ); - free( config_nodes ); -} - - - - - -static void enkf_tui_table_ensemble(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - enkf_tui_table__(enkf_main , false , true); -} - - -static void enkf_tui_table_GEN_KW_ensemble(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - enkf_tui_table__(enkf_main , true , true); -} - - -static void enkf_tui_table_time(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - enkf_tui_table__(enkf_main , false , false); -} - - - - - -void enkf_tui_table_menu(void * arg) { - - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - { - menu_type * menu = menu_alloc("Table of results" , "Back" , "bB"); - menu_add_item(menu , "Ensemble of parameters" , "eE" , enkf_tui_table_ensemble , enkf_main , NULL); - menu_add_item(menu , "GEN_KW ensemble" , "gG" , enkf_tui_table_GEN_KW_ensemble , enkf_main , NULL); - menu_add_item(menu , "Time development of parameters" , "tT" , enkf_tui_table_time , enkf_main , NULL); - menu_add_item(menu , "Help" , "hH" , enkf_tui_help_menu_table , enkf_main , NULL); - menu_run(menu); - menu_free(menu); - } -} diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_table.h b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_table.h deleted file mode 100644 index 304ee727ab..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_table.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_table.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_TUI_TABLE -#define ERT_ENKF_TUI_TABLE - -void enkf_tui_table_menu(void * ); - -#endif diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_util.c b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_util.c deleted file mode 100644 index 54dd60fc36..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_util.c +++ /dev/null @@ -1,401 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_util.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - - -/** - This file implements various small utility functions for the (text - based) EnKF user interface. -*/ - - - - - -/** - Very simple function which is in interactive functions. Used to - query the user: - - - Key identifying a field. - - An integer report step. - - Whether we are considering the analyzed state or the forecast. - - The config_node is returned, and in addition the report_step, iens - and analysis_state are returned by reference. It is OK the pass in - NULL for these pointers; in that case the user is not queried for - these values. - - The keyword is checked for existence; but it is not checked whether - the report_step actually exists. If impl_type == INVALID, any - implementation type will be accepted, otherwise we loop until the - keyword is of type impl_type. -*/ - -const enkf_config_node_type * enkf_tui_util_scanf_key(const ensemble_config_type * config , int prompt_len , ert_impl_type impl_type , enkf_var_type var_type) { - char * kw; - bool OK; - const enkf_config_node_type * config_node = NULL; - do { - OK = true; - util_printf_prompt("Keyword" , prompt_len , '=' , "=> "); - kw = util_alloc_stdin_line(); - if(kw==NULL){ - OK = true; - } - else if (ensemble_config_has_key(config , kw)) { - config_node = ensemble_config_get_node(config , kw); - - if (impl_type != INVALID) - if (enkf_config_node_get_impl_type(config_node) != impl_type) - OK = false; - - if (var_type != INVALID_VAR) - if (enkf_config_node_get_var_type(config_node) != var_type) - OK = false; - } else OK = false; - free(kw); - } while (!OK); - return config_node; -} - - -/** - Present the user with the queries: - - First ensemble member ==> - Last ensemble member ===> - - It then allocates (bool *) pointer [0..ens_size-1], where the - interval gven by the user is true (i.e. actve), and the rest is - false. It s the responsiibility of the calling scope to free this. -*/ - - -bool * enkf_tui_util_scanf_alloc_iens_active(int ens_size, int prompt_len , int * _iens1 , int * _iens2) { - bool * iactive = util_calloc(ens_size , sizeof * iactive ); - int iens1 = util_scanf_int_with_limits("First ensemble member" , prompt_len , 0 , ens_size - 1); - int iens2 = util_scanf_int_with_limits("Last ensemble member" , prompt_len , iens1 , ens_size - 1); - int iens; - - for (iens = 0; iens < ens_size; iens++) - iactive[iens] = false; - - for (iens = iens1; iens <= iens2; iens++) - iactive[iens] = true; - - - *_iens1 = iens1; - *_iens2 = iens2; - return iactive; -} - - - -/** - Presents the reader with a prompt, and reads a string containing - two integers separated by a character(s) in the set: " ,-:". If the - user enters a blank string that is interpreted as "all - realizations", and the return variabels are set to: - - iens1 = 0 iens2 = ens_size - 1 - - Will not return before the user has actually presented a valid - string. -*/ - - -void enkf_tui_util_scanf_iens_range(const char * prompt_fmt , int ens_size , int prompt_len , int * iens1 , int * iens2) { - char * prompt = util_alloc_sprintf(prompt_fmt , ens_size - 1); - bool OK = false; - - util_printf_prompt(prompt , prompt_len , '=' , "=> "); - - while (!OK) { - char * input = util_alloc_stdin_line(); - const char * current_ptr = input; - OK = true; - - if (input != NULL) { - current_ptr = util_parse_int(current_ptr , iens1 , &OK); - current_ptr = util_skip_sep(current_ptr , " ,-:" , &OK); - current_ptr = util_parse_int(current_ptr , iens2 , &OK); - - if (!OK) - printf("Failed to parse two integers from: \"%s\". Example: \"0 - 19\" to get the 20 first members.\n",input); - free(input); - } else { - *iens1 = 0; - *iens2 = ens_size - 1; - } - } - free(prompt); -} - - -void enkf_tui_util_scanf_report_steps(int last_report , int prompt_len , int * __step1 , int * __step2) { - char * prompt = util_alloc_sprintf("Report steps (0 - %d)" , last_report); - bool OK = false; - - util_printf_prompt(prompt , prompt_len , '=' , "=> "); - - while (!OK) { - char * input = util_alloc_stdin_line(); - const char * current_ptr = input; - int step1 , step2; - OK = true; - if(input == NULL){ - step1=0; - step2=last_report; - } - else{ - current_ptr = util_parse_int(current_ptr , &step1 , &OK); - current_ptr = util_skip_sep(current_ptr , " ,-:" , &OK); - current_ptr = util_parse_int(current_ptr , &step2 , &OK); - } - if (!OK) - printf("Failed to parse two integers from: \"%s\". Example: \"0 - 19\" to get the 20 first report steps.\n",input); - free(input); - - step1 = util_int_min(step1 , last_report); - step2 = util_int_min(step2 , last_report); - if (step1 > step2) - util_exit("%s: ohh come on - must have a finite interval forward in time - no plots for you.\n",__func__); - *__step1 = step1; - *__step2 = step2; - - } - free(prompt); -} - - - -/** - Similar to enkf_tui_util_scanf_alloc_iens_active(), but based on report steps. -*/ - -bool * enkf_tui_util_scanf_alloc_report_active(int last_step, int prompt_len) { - bool * iactive = util_calloc((last_step + 1) , sizeof * iactive ); - int step1 = util_scanf_int_with_limits("First report step" , prompt_len , 0 , last_step); - int step2 = util_scanf_int_with_limits("Last report step" , prompt_len , step1 , last_step); - int step; - - for (step = 0; step <= last_step; step++) - iactive[step] = false; - - for (step = step1; step <= step2; step++) - iactive[step] = true; - - return iactive; -} - - -/** - This functions reads i,j,k and returns them be reference; if the - reference pointer is NULL, that coordinate is skipped. I.e. - - enkf_tui_util_scanf_ijk__(config , 100 , &i , &j , NULL); - - Will read i and j. If your are interested in all three coordinates - you should use enkf_tui_util_scanf_ijk() which has a more flexible - parser. -*/ - - -void enkf_tui_util_scanf_ijk__(const field_config_type * config, int prompt_len , int *i , int *j , int *k) { - int nx,ny,nz; - - field_config_get_dims(config , &nx , &ny , &nz); - if (i != NULL) (*i) = util_scanf_int_with_limits("Give i-index" , prompt_len , 1 , nx) - 1; - if (j != NULL) (*j) = util_scanf_int_with_limits("Give j-index" , prompt_len , 1 , ny) - 1; - if (k != NULL) (*k) = util_scanf_int_with_limits("Give k-index" , prompt_len , 1 , nz) - 1; -} - - - - -/** - The function reads ijk, but it returns a global 1D index. Observe - that the user is supposed to enter an index starting at one - whichs - is immediately shifted down to become zero based. - - The function will loop until the user has entered ijk corresponding - to an active cell. -*/ - -int enkf_tui_util_scanf_ijk(const field_config_type * config, int prompt_len) { - int global_index; - field_config_scanf_ijk(config , true , "Give (i,j,k) indices" , prompt_len , NULL , NULL , NULL , &global_index); - return global_index; -} - - - - - - - - - -/** - This function runs through all the report steps [step1:step2] for - member iens, and gets the value of the cell 'get_index'. Current - implementation assumes that the config_node/node combination are of - field type - this should be generalized to use the enkf_node_iget() - function. - - The value is returned (by reference) in y, and the corresponding - time (currently report_step) is returned in 'x'. -*/ - - -void enkf_tui_util_get_time(enkf_fs_type * fs , const enkf_config_node_type * config_node, enkf_node_type * node , int get_index , int step1 , int step2 , int iens , double * x , double * y ) { - const char * key = enkf_config_node_get_key(config_node); - int report_step; - int index = 0; - for (report_step = step1; report_step <= step2; report_step++) { - node_id_type node_id = {.report_step = report_step , .iens = iens }; - if (enkf_node_try_load(node , fs , node_id)) { - const field_type * field = enkf_node_value_ptr( node ); - y[index] = field_iget_double(field , get_index); - } else { - fprintf(stderr," ** Warning field:%s is missing for member,report: %d,%d \n",key , iens , report_step); - y[index] = -1; - } - x[index] = report_step; - index++; - } -} - - -int enkf_tui_util_scanf_report_step(int last_report, const char * prompt , int prompt_len) { - int report_step = util_scanf_int_with_limits(prompt , prompt_len , 0 , last_report); - return report_step; -} - -char * enkf_tui_util_scanf_report_step_as_char(int last_report, const char * prompt , int prompt_len) { - char * report_step = util_scanf_int_with_limits_return_char(prompt , prompt_len , 0 , last_report); - return report_step; -} - -int enkf_tui_util_scanf_int_with_default(const char * prompt , int prompt_len , bool * default_used) { - bool OK; - int value; - *default_used = false; - do { - char * input; - - util_printf_prompt(prompt , prompt_len , '=' , "=> "); - input = util_alloc_stdin_line(); - if (input == NULL) { - *default_used = true; - OK = true; - value = -1; - } else { - OK = util_sscanf_int( input , &value ); - free( input ); - } - } while (!OK); - return value; -} - -int enkf_tui_util_scanf_int_with_default_return_to_menu(const char * prompt , int prompt_len , bool * default_used) { - bool OK; - int value; - *default_used = false; - do { - char * input; - - util_printf_prompt(prompt , prompt_len , '=' , "=> "); - input = util_alloc_stdin_line(); - if (input == NULL) { - *default_used = true; - OK = true; - value = -1; - } - else if (strcmp(input,"M")==0 || strcmp(input,"m")==0){ - OK = true; - value = -2; - } - else { - OK = util_sscanf_int( input , &value ); - free( input ); - } - } while (!OK); - return value; -} - -bool enkf_tui_util_sscanf_active_list( bool_vector_type * iactive , const char * select_string , int ens_size ) { - if (select_string == NULL) { - bool_vector_set_default( iactive , true ); - bool_vector_iset( iactive , ens_size - 1 , true ); - return true; - } else { - bool OK; - OK = string_util_init_active_mask( select_string , iactive ); - - if (bool_vector_size( iactive ) < ens_size) - bool_vector_iset( iactive , ens_size - 1 , false ); - else if (bool_vector_size( iactive ) > ens_size) - return false; - return OK; - } -} - -/** - The limit is not inclusive -*/ -double enkf_tui_util_scanf_double_with_lower_limit(const char * prompt , int prompt_len , double min_value) { - double value; - char * new_prompt = util_alloc_sprintf("%s (greater than %g)" , prompt , min_value ); - do { - value = util_scanf_double(new_prompt , prompt_len); - } while (value <= min_value); - free(new_prompt); - return value; -} - - -/*****************************************************************/ - - -/* Minimum wrapping of vfprintf */ -void enkf_tui_util_msg(const char * fmt , ...) { - va_list ap; - va_start(ap , fmt); - vfprintf(stdout , fmt , ap); - va_end(ap); -} - - diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_util.h b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_util.h deleted file mode 100644 index 6e74bdbb06..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_util.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_tui_util.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_TUI_UTIL_H -#define ERT_ENKF_TUI_UTIL_H - -#include - -#include -#include -#include -#include -#include - -void enkf_tui_util_scanf_report_steps(int , int , int * , int * ); -const enkf_config_node_type * enkf_tui_util_scanf_key(const ensemble_config_type * , int , ert_impl_type , enkf_var_type); -int enkf_tui_util_scanf_ijk(const field_config_type * , int); -void enkf_tui_util_scanf_ijk__(const field_config_type * , int , int * , int * , int *); -bool * enkf_tui_util_scanf_alloc_report_active(int , int ); -bool * enkf_tui_util_scanf_alloc_iens_active(int , int , int * , int *); -void enkf_tui_util_get_time(enkf_fs_type * , const enkf_config_node_type * , enkf_node_type * , int , int , int , int , double * , double * ); -void enkf_tui_util_scanf_iens_range(const char * , int , int , int * , int * ); -int enkf_tui_util_scanf_report_step(int , const char * , int ); -char * enkf_tui_util_scanf_report_step_as_char(int , const char * , int ); -void enkf_tui_util_msg(const char * , ...); -int enkf_tui_util_scanf_int_with_default(const char * prompt , int prompt_len , bool * default_used); -int enkf_tui_util_scanf_int_with_default_return_to_menu(const char * prompt , int prompt_len , bool * default_used); -double enkf_tui_util_scanf_double_with_lower_limit(const char * prompt , int prompt_len , double min_value); -bool enkf_tui_util_sscanf_active_list( bool_vector_type * iactive , const char * select_string , int ens_size ); -#endif diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_workflow.c b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_workflow.c deleted file mode 100644 index f4a5a96576..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_workflow.c +++ /dev/null @@ -1,112 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'enkf_tui_workflow.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - - -void enkf_tui_workflow_run( void * arg ) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - { - ert_workflow_list_type * workflow_list = enkf_main_get_workflow_list( enkf_main ); - util_printf_prompt("Name of workflow" , PROMPT_LEN , '=' , "=> "); - { - char * workflow_name = util_alloc_stdin_line(); - if (workflow_name != NULL) { - if (ert_workflow_list_has_workflow( workflow_list , workflow_name )) { - bool runOK = ert_workflow_list_run_workflow_blocking( workflow_list , workflow_name , enkf_main); - if (!runOK) { - printf("Errors in workflow:%s \n", workflow_name ); - printf("-----------------------------------------------------------------\n"); - config_error_fprintf( ert_workflow_list_get_last_error( workflow_list ) , true , stdout); - printf("-----------------------------------------------------------------\n"); - } - } - } - util_safe_free( workflow_name ); - } - } -} - - -void enkf_tui_workflow_load( void * arg ) { - // ... -} - - -void enkf_tui_workflow_list( void * arg ) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - { - ert_workflow_list_type * workflow_list = enkf_main_get_workflow_list( enkf_main ); - stringlist_type * name_list = ert_workflow_list_alloc_namelist( workflow_list ); - - printf("Available workflows: \n"); - { - int i; - for (i=0; i < stringlist_get_size( name_list ); i++) { - if ((i % 5) == 0) - printf("\n "); - else - printf(" "); - - printf("%s", stringlist_iget( name_list , i )); - } - } - stringlist_free( name_list ); - printf("\n\n"); - } -} - - -void enkf_tui_workflow_menu(void * arg) { - enkf_main_type * enkf_main = enkf_main_safe_cast( arg ); - menu_type * menu = menu_alloc("Workflows" , "Back" , "bB"); - - menu_add_item(menu , "Run workflow" , "rR" , enkf_tui_workflow_run , enkf_main , NULL ); - menu_add_item(menu , "Load workflow" , "lL" , enkf_tui_workflow_load , enkf_main , NULL ); - menu_add_item(menu , "List available workflows" , "iI" , enkf_tui_workflow_list , enkf_main , NULL ); - - menu_add_item(menu , "Help" , "hH" , enkf_tui_help_menu_run , enkf_main , NULL); - menu_run(menu); - menu_free(menu); - -} - diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_workflow.h b/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_workflow.h deleted file mode 100644 index fe6cc12720..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/enkf_tui_workflow.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'enkf_tui_workflow.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_TUI_WORKFLOW_H -#define ERT_ENKF_TUI_WORKFLOW_H - -void enkf_tui_workflow_menu(void *); - -#endif diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/ert_tui_const.h b/ThirdParty/Ert/libenkf/applications/ert_tui/ert_tui_const.h deleted file mode 100644 index 4f2981569e..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/ert_tui_const.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'ert_tui_const.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_TUI_CONST -#ifdef __cplusplus -extern "C" { -#endif - -#define PROMPT_LEN 80 - - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/main.c b/ThirdParty/Ert/libenkf/applications/ert_tui/main.c deleted file mode 100644 index e86be1850e..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/main.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'main.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - -#define WORKFLOW_OPTION "-wf" - -void text_splash() { - const int usleep_time = 1000; - int i; - { -#include "ERT.h" - printf("\n\n"); - for (i = 0; i < SPLASH_LENGTH; i++) { - printf("%s\n" , splash_text[i]); - util_usleep(usleep_time); - } - printf("\n\n"); - - sleep(1); -#undef SPLASH_LENGTH - } -} - - -/* - GIT_COMMIT and COMPILE_TIME_STAMP are env variables set by the - makefile. Will exit if the config file does not exist. -*/ -void enkf_welcome(const char * config_file) { - if (util_file_exists( config_file )) { - char * abs_path = util_alloc_realpath( config_file ); - char * config_file_msg = util_alloc_sprintf("Configuration file...: %s \n",abs_path); - - /* This will be printed if/when util_abort() is called on a later stage. */ - /* The svn_version and compile_time are added with the functione enkf_main_init_debug(). */ - util_abort_append_version_info(config_file_msg); - - free(config_file_msg); - free(abs_path); - } else util_exit(" ** Sorry: can not locate configuration file: %s \n\n" , config_file); -} - - -void enkf_usage() { - printf("\n"); - printf(" *********************************************************************\n"); - printf(" ** **\n"); - printf(" ** E R T **\n"); - printf(" ** **\n"); - printf(" **-----------------------------------------------------------------**\n"); - printf(" ** You have successfully started the ert program developed at **\n"); - printf(" ** Statoil. Before you can actually start using the program, you **\n"); - printf(" ** must create a configuration file. When the configuration file **\n"); - printf(" ** has been created, you can start the ert application with: **\n"); - printf(" ** **\n"); - printf(" ** bash> ert config_file **\n"); - printf(" ** **\n"); - printf(" ** Instructions on how to create the configuration file can be **\n"); - printf(" ** found at: http://ert.nr.no **\n"); - printf(" *********************************************************************\n"); -} - - - - -static void init_debug( const char * argv0) { - char * git_commit = util_alloc_sprintf("git commit...........: %s \n",GIT_COMMIT); - char * compile_time = util_alloc_sprintf("Compile time.........: %s \n",COMPILE_TIME_STAMP); - - /* This will be printed if/when util_abort() is called on a later stage. */ - util_abort_append_version_info( git_commit ); - util_abort_append_version_info( compile_time ); - - free(git_commit); - free(compile_time); - - util_abort_set_executable( argv0 ); -} - - - -void parse_workflows(int argc , char ** argv , stringlist_type * workflows) { - /* bool workflow_on = false; */ - for (int iarg = 2; iarg < argc; iarg++) { - stringlist_append_copy( workflows , argv[iarg]); - - /*if (strcmp( argv[iarg] , WORKFLOW_OPTION) == 0) - workflow_on = true; - else { - if (workflow_on) - stringlist_append_copy( workflows , argv[iarg]); - else - fprintf(stderr,"**Warning - option:\'%s\' ignored\n",argv[iarg]); - } - */ - } -} - - - - -int main (int argc , char ** argv) { - text_splash(); - init_debug( argv[0] ); - printf("\n"); - printf("Documentation : %s \n","http://ert.nr.no"); - printf("git commit : %s \n",GIT_COMMIT); - printf("compile time : %s \n",COMPILE_TIME_STAMP); - printf("site config : %s \n", site_config_get_location()); - - enkf_main_install_SIGNALS(); /* Signals common to both tui and gui. */ - signal(SIGINT , util_abort_signal); /* Control C - tui only. */ - if (argc < 2) { - enkf_usage(); - exit(1); - } else { - const char * model_config_file = argv[1]; - stringlist_type * workflow_list = stringlist_alloc_new(); - - parse_workflows( argc , argv , workflow_list ); - if ( !(util_entry_readable(model_config_file) && util_is_file(model_config_file)) ) - util_exit("Can not read file %s - exiting \n", model_config_file); - - { - char * abs_config = util_alloc_realpath( model_config_file ); - printf("model config : %s \n\n", abs_config); - free(abs_config); - } - enkf_welcome( model_config_file ); - { - enkf_main_type * enkf_main = enkf_main_bootstrap(model_config_file , true , true); - enkf_main_run_workflows( enkf_main , workflow_list ); - enkf_tui_main_menu(enkf_main); - enkf_main_free(enkf_main); - } - - stringlist_free( workflow_list ); - util_abort_free_version_info(); /* No fucking leaks ... */ - } - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/applications/ert_tui/upgrade_fs104.c b/ThirdParty/Ert/libenkf/applications/ert_tui/upgrade_fs104.c deleted file mode 100644 index 0a96b2a825..0000000000 --- a/ThirdParty/Ert/libenkf/applications/ert_tui/upgrade_fs104.c +++ /dev/null @@ -1,320 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'main.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#define BLOCK_FS_DRIVER_INDEX_ID 3002 - - -config_type * create_config( ) { - config_type * config = config_alloc( ); - config_schema_item_type * item; - - item = config_add_schema_item(config , ENSPATH_KEY , true , false); - config_schema_item_set_argc_minmax(item , 1 , 1 , 0 , NULL); - - item = config_add_schema_item(config , NUM_REALIZATIONS_KEY , true , false); - config_schema_item_set_argc_minmax(item , 1 , 1 , 1, (const config_item_types [1]) {CONFIG_INT}); - - item = config_add_schema_item(config , REFCASE_KEY , true , false); - config_schema_item_set_argc_minmax(item , 1 , 1 , 1 , NULL ); - - return config; -} - - -void fskip_block_fs( FILE * stream ) { - util_fread_int( stream ); - util_fread_int( stream ); -} - - -void fskip_block_fs_index( FILE * stream ) { - return; -} - - -char * check_enspath( const char * ens_path , stringlist_type * case_list ) { - char * mount_file = util_alloc_filename( ens_path , "enkf_mount_info" , NULL); - FILE * stream = util_fopen( mount_file , "r"); - int version; - - util_fread_long( stream ); - version = util_fread_int( stream ); - - if (version != 104) - util_exit("This application is only for upgrading fs from version 104\n"); - - { - for (int driver_nr = 0; driver_nr < 5; driver_nr++) { - int driver_id; - util_fread_int( stream ); - - driver_id = util_fread_int( stream ); - if (driver_id == BLOCK_FS_DRIVER_ID) - fskip_block_fs(stream); - else if (driver_id == BLOCK_FS_DRIVER_INDEX_ID) - fskip_block_fs_index(stream); - else - util_abort("%s: sorry can only convert BLOCK_FS cases\n",__func__); - } - } - - { - int num_case = util_fread_int( stream ); - for (int icase = 0; icase < num_case; icase++) { - char * case_name = util_fread_alloc_string( stream ); - stringlist_append_owned_ref( case_list , case_name ); - } - } - - - fclose( stream ); - return mount_file; -} - - - - - -void upgrade_case( int ens_size , const ecl_sum_type * refcase , const char * enspath , const char * case_path , const char * file) { - int num_drivers = 32; - int length = ecl_sum_get_last_report_step( refcase ); - block_fs_type ** fs_list = util_calloc( num_drivers , sizeof * fs_list ); - buffer_type * buffer = buffer_alloc(100); - double_vector_type * vector = double_vector_alloc( 0,0 ); - int driver_nr; - - - for (driver_nr = 0; driver_nr < num_drivers; driver_nr++) { - char * mount_file = util_alloc_sprintf( "%s/%s/mod_%d/%s.mnt" , enspath , case_path , driver_nr , file); - fs_list[driver_nr] = block_fs_mount( mount_file , 32 , 0 , 1 , 1 , true , false ); - free( mount_file ); - } - - { - const ecl_smspec_type * smspec = ecl_sum_get_smspec( refcase ); - int num_params = ecl_smspec_get_params_size( smspec ); - msg_type * msg; - { - char * prefix = util_alloc_sprintf("Upgrading %s/mod_nnn/%s: " , case_path , file ); - msg = msg_alloc( prefix , false ); - free( prefix ); - } - msg_show( msg ); - - for (int i=0; i < num_params; i++) { - const smspec_node_type * smspec_node = ecl_smspec_iget_node( smspec , i ); - const char * gen_key = smspec_node_get_gen_key1( smspec_node ); - { - char * progress = util_alloc_sprintf("%4.1f %s" , i * 100.0 / num_params , "%"); - msg_update( msg , progress ); - free( progress ); - } - if (gen_key != NULL) { - for (int iens = 0; iens < ens_size; iens++) { - block_fs_type * fs = fs_list[ iens % num_drivers ]; - double_vector_reset( vector ); - for (int tstep = 0; tstep <= length; tstep++) { - char * node_key = util_alloc_sprintf("%s.%d.%d" , gen_key , tstep , iens ); - - if (block_fs_has_file( fs , node_key )) { - block_fs_fread_realloc_buffer( fs , node_key , buffer ); - buffer_fskip( buffer , 12 ); - double_vector_iset( vector , tstep , buffer_fread_double( buffer )); - block_fs_unlink_file( fs , node_key ); - } - free( node_key ); - } - - if (double_vector_size( vector ) > 0) { - char * vector_key = util_alloc_sprintf("%s.%d" , gen_key , iens ); - buffer_rewind( buffer ); - buffer_fwrite_time_t( buffer , time(NULL)); - buffer_fwrite_int( buffer , SUMMARY ); - double_vector_buffer_fwrite( vector , buffer ); - - block_fs_fwrite_buffer( fs , vector_key , buffer ); - free( vector_key ); - } - } - } - } - msg_free( msg , false); - } - - double_vector_free( vector ); - buffer_free( buffer ); - for (driver_nr = 0; driver_nr < num_drivers; driver_nr++) { - block_fs_close( fs_list[driver_nr] , true ); - } - free( fs_list ); -} - - -void update_index( int ens_size, int length, const char * ens_path , const char * case_path ) { - char * index_path = util_alloc_sprintf("%s/%s/Index" , ens_path , case_path ); - char * old_path = util_alloc_sprintf("%s/%s" , ens_path , case_path ); - - util_make_path( index_path ); - util_move_file4( "INDEX.data_0" , NULL , old_path , index_path ); - util_move_file4( "INDEX.mnt" , NULL , old_path , index_path ); - - free( old_path ); - - { - char * mount_file = util_alloc_sprintf("%s/INDEX.mnt" , index_path); - block_fs_type * index = block_fs_mount( mount_file , 32 , 0 , 1 , 1 , true , false ); - buffer_type * buffer = buffer_alloc( 512 ); - for (int iens = 0; iens < ens_size; iens++) - for (int tstep = 0; tstep < length; tstep++) { - char * old_key = util_alloc_sprintf("kw_list_%d.%d" , tstep , iens); - char * new_key = util_alloc_sprintf("kw_list.%d.%d" , tstep , iens); - - if (block_fs_has_file( index , old_key )) { - block_fs_fread_realloc_buffer( index , old_key , buffer ); - block_fs_fwrite_buffer( index , new_key , buffer ); - block_fs_unlink_file( index , old_key ); - } - - free( old_key ); - free( new_key ); - } - - free( mount_file ); - block_fs_close( index , true ); - } -} - - -void create_fstab( const char * ens_path , const char * case_path ) { - int num_drivers = 32; - char * mount_point = util_alloc_sprintf("%s/%s" , ens_path , case_path ); - FILE * stream = fs_driver_open_fstab( mount_point , true ); - fs_driver_init_fstab( stream, BLOCK_FS_DRIVER_ID); - - block_fs_driver_create_fs( stream , mount_point , DRIVER_PARAMETER , num_drivers , "mod_%d" , "PARAMETER"); - block_fs_driver_create_fs( stream , mount_point , DRIVER_STATIC , num_drivers , "mod_%d" , "STATIC"); - block_fs_driver_create_fs( stream , mount_point , DRIVER_DYNAMIC_FORECAST , num_drivers , "mod_%d" , "FORECAST"); - block_fs_driver_create_fs( stream , mount_point , DRIVER_DYNAMIC_ANALYZED , num_drivers , "mod_%d" , "ANALYZED"); - block_fs_driver_create_fs( stream , mount_point , DRIVER_INDEX , 1 , "Index" , "INDEX"); - - fclose( stream ); - free( mount_point ); -} - - - - - -int main (int argc , char ** argv) { - enkf_main_install_SIGNALS(); /* Signals common to both tui and gui. */ - signal(SIGINT , util_abort_signal); /* Control C - tui only. */ - enkf_main_init_debug( NULL ); - if (argc != 2) { - printf("Usage: upgrade_fs104 config_file\n"); - exit(1); - } else { - const char * model_config_file = argv[1]; - char * enspath; - int ens_size; - ecl_sum_type * refcase; - { - config_type * config = create_config(); - if (!config_parse( config , model_config_file , "--" , "INCLUDE" , "DEFINE" , CONFIG_UNRECOGNIZED_IGNORE , true )) { - config_fprintf_erors( config , stderr ); - exit(1); - } - - { - char * path; - util_alloc_file_components(model_config_file , &path , NULL , NULL); - if (path != NULL) { - printf("Changing to directory:%s\n" , path); - chdir(path); - } - util_safe_free( path ); - } - - ens_size = config_get_value_as_int( config , NUM_REALIZATIONS_KEY ); - enspath = util_alloc_string_copy( config_get_value( config , ENSPATH_KEY )); - refcase = ecl_sum_fread_alloc_case( config_get_value( config , REFCASE_KEY ) , ":"); - config_free( config ); - } - - { - stringlist_type * case_list = stringlist_alloc_new(); - int ic; - char * mount_file = check_enspath( enspath , case_list ); - - for (ic = 0; ic < stringlist_get_size( case_list ); ic++) { - const char * case_path = stringlist_iget( case_list , ic); - - upgrade_case( ens_size, refcase , enspath , case_path , "FORECAST"); - upgrade_case( ens_size, refcase , enspath , case_path , "ANALYZED"); - - update_index( ens_size, ecl_sum_get_last_report_step( refcase ), enspath , case_path ); - create_fstab( enspath , case_path ); - } - { - FILE * stream = util_fopen( mount_file , "w"); - util_fwrite_long(FS_MAGIC_ID , stream); - util_fwrite_int( 105 , stream); - fclose( stream ); - } - stringlist_free( case_list ); - free( mount_file ); - - } - free( enspath ); - ecl_sum_free( refcase ); - util_abort_free_version_info(); /* No fucking leaks ... */ - } -} diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/README.new_type.h b/ThirdParty/Ert/libenkf/include/ert/enkf/README.new_type.h deleted file mode 100644 index 9fd3d05df7..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/README.new_type.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'README.new_type.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -/** -The two files README.new_type.c and README.new_type_config.c (along -with the corresponding header files) are meant to serve as a -documentation and reference on how to add new object types to the enkf -system. - - -new_type.h -========== -When implementing a new type, the header file should contain a typedef like this: - - typedef struct new_type_struct new_type; - -This typedef means two things: - - 1. The entity "new_type" is to be interpreted as a "struc - new_type_struct". - - 2. We are informing the compiler that a declaration of the struct - new_type_struct will come at a later stage. However for the rest - of the header file we can refer only to "new_type" - -The advantages of this way to do it is that only the existence of -"struct new_type_struct" is exported, the actual implementation is -hidden for other files; it is a bit like making all the data private -in a C++ class. - - _____________________ E X A M P L E _____________________________ - / - | new.h - | ----- - | typedef struct new_struct new_type; - | - | new_type * new_type_alloc(int , const char *); - | double * new_get_data_ref(const new_type *); - | void new_type_free(new_type *); - | - | - | new.c - | ----- - | #include - | #include - | - | struct new_struct { - | double *data; - | } - | - | new_type * new_type_alloc(int size) { - | new_type * new = util_malloc(sizeof * new_type , __func__); - new->date = util_malloc(size * sizeof new->data); - | return new; - | } - | - | double * new_get_data_ref(const new_type * new) { - | return new->data; - | } - | - | - | void new_type_free(new_type * new) { - | free(new->data); - | free(new); - | } - | - | - | other.c - | ------- - | #include - | - | void some_func() { - | new_type * new = new_type_alloc(100 , "Programmer ..."); - | .... - | .... - | new_type_free(new); - | } - \_________________________________________________________________ - -What happen in this little example is the following things: - - 1. In the header file "new.h" we say that an implementation of a - struct new_type_struct will be forthcoming. This struct can - (without the implementation) be referred to as new_type. - - In the header file we also claim that the three functions: - - i new_type * new_type_alloc(int , const chat*); - ii double * new_get_data_ref(const new_type *); - iii void new_type_free(new_type *); - - will be coming. - - 2. In the source file new.c we have the implementation of the struct - new_struct, along with the three functions listed above. - - 3. In the third file, other.c which includes "new.h", we can refer to - the type new_type, and the three functions listed in the - header. However we can *NOT* get to the fields in the struct of - type new_type_struct, i.e. code like: - - .... - new->data[17] = 178.9; - .... - - in "other.c" will *NOT* compile. It will fail with the message - "dereferencing pointer to imcomplete type." - -*/ diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/README.new_type_config.h b/ThirdParty/Ert/libenkf/include/ert/enkf/README.new_type_config.h deleted file mode 100644 index 91963a1c4d..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/README.new_type_config.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'README.new_type_config.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -/** -The two files README.new_type.c and README.new_type_config.c (along -with the corresponding header files) are meant to serve as a -documentation and reference on how to add new object types to the enkf -system. - - -new_type_config.h -========== -*/ diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/active_config.h b/ThirdParty/Ert/libenkf/include/ert/enkf/active_config.h deleted file mode 100644 index da374cffed..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/active_config.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'active_config.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ACTIVE_CONFIG_H -#define ERT_ACTIVE_CONFIG_H - - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/active_list.h b/ThirdParty/Ert/libenkf/include/ert/enkf/active_list.h deleted file mode 100644 index 5f03fcfbcb..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/active_list.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'active_list.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ACTIVE_LIST_H -#define ERT_ACTIVE_LIST_H - -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include - - -typedef struct active_list_struct active_list_type; - - active_list_type * active_list_alloc( ); - void active_list_add_index(active_list_type * , int); - void active_list_free( active_list_type *); - const int * active_list_get_active(const active_list_type * ); - int active_list_get_active_size(const active_list_type * , int total_size ); - void active_list_set_all_active(active_list_type * ); - void active_list_set_data_size(active_list_type * , int ); - void active_list_free( active_list_type * ); - active_mode_type active_list_get_mode(const active_list_type * ); - void active_list_free__( void * arg ); - active_list_type * active_list_alloc_copy( const active_list_type * src); - void active_list_fprintf( const active_list_type * active_list , const char * dataset_key , const char * key , FILE * stream ); - void active_list_summary_fprintf( const active_list_type * active_list , const char * dataset_key , const char * key , FILE * stream); - bool active_list_iget( const active_list_type * active_list , int index ); - bool active_list_equal( const active_list_type * active_list1 , const active_list_type * active_list2); - void active_list_copy( active_list_type * target , const active_list_type * src); - -UTIL_IS_INSTANCE_HEADER( active_list ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/active_node.h b/ThirdParty/Ert/libenkf/include/ert/enkf/active_node.h deleted file mode 100644 index c8fcc09e7d..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/active_node.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'active_node.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ACTIVE_NODE_H -#define ERT_ACTIVE_NODE_H - - -typedef struct active_var_struct active_var_type; -typedef struct active_obs_struct active_obs_type; - - -typedef void (active_config_destructor_ftype) (void *); /* A destructor for the (node-spesific) object holding inactive/active information. */ - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/analysis_config.h b/ThirdParty/Ert/libenkf/include/ert/enkf/analysis_config.h deleted file mode 100644 index 8c849c1cc3..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/analysis_config.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'analysis_config.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#ifndef ERT_ANALYSIS_CONFIG_H -#define ERT_ANALYSIS_CONFIG_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include -#include - -#include -#include - -#include - -#include -#include - - - - -typedef struct analysis_config_struct analysis_config_type; - -analysis_iter_config_type * analysis_config_get_iter_config( const analysis_config_type * config ); -analysis_module_type * analysis_config_get_module( analysis_config_type * config , const char * module_name ); -bool analysis_config_has_module( analysis_config_type * config , const char * module_name ); -void analysis_config_load_internal_module( analysis_config_type * config , const char * symbol_table ); -void analysis_config_load_internal_modules( analysis_config_type * analysis ); -void analysis_config_reload_module( analysis_config_type * config , const char * module_name); -bool analysis_config_get_module_option( const analysis_config_type * config , long flag); -bool analysis_config_load_external_module( analysis_config_type * config , const char * lib_name, const char * user_name); -void analysis_config_load_all_external_modules_from_config ( analysis_config_type * analysis_config, const config_content_type * config); - -stringlist_type * analysis_config_alloc_module_names( analysis_config_type * config ); -const char * analysis_config_get_log_path( const analysis_config_type * config ); -void analysis_config_init( analysis_config_type * analysis , const config_content_type * config); -analysis_config_type * analysis_config_alloc( rng_type * rng ); -void analysis_config_free( analysis_config_type * ); -bool analysis_config_get_merge_observations(const analysis_config_type * ); -double analysis_config_get_alpha(const analysis_config_type * config); -double analysis_config_get_truncation(const analysis_config_type * config); -bool analysis_config_Xbased(const analysis_config_type * config); -bool analysis_config_get_rerun(const analysis_config_type * config); -bool analysis_config_get_random_rotation(const analysis_config_type * config); -int analysis_config_get_rerun_start(const analysis_config_type * config); -bool analysis_config_get_do_local_cross_validation(const analysis_config_type * config); -bool analysis_config_get_force_subspace_dimension(const analysis_config_type * config); -bool analysis_config_get_do_kernel_regression(const analysis_config_type * config); -int analysis_config_get_kernel_function(const analysis_config_type * config); -int analysis_config_get_kernel_param(const analysis_config_type * config); -int analysis_config_get_nfolds_CV(const analysis_config_type * config); -int analysis_config_get_subspace_dimension(const analysis_config_type * config); -bool analysis_config_get_bootstrap(const analysis_config_type * config); -bool analysis_config_get_penalised_press(const analysis_config_type * config); -bool analysis_config_get_do_scaling(const analysis_config_type * config); -void analysis_config_set_rerun(analysis_config_type * config , bool rerun); -void analysis_config_set_rerun_start( analysis_config_type * config , int rerun_start ); -void analysis_config_set_truncation( analysis_config_type * config , double truncation); -void analysis_config_set_alpha( analysis_config_type * config , double alpha); -void analysis_config_set_merge_observations( analysis_config_type * config , bool merge_observations); -void analysis_config_set_nfolds_CV( analysis_config_type * config , int folds); -void analysis_config_set_subspace_dimension( analysis_config_type * config , int dimension); -void analysis_config_set_do_bootstrap( analysis_config_type * config , bool do_bootstrap); -void analysis_config_set_penalised_press( analysis_config_type * config , bool do_pen_press); -void analysis_config_set_log_path(analysis_config_type * config , const char * log_path ); -void analysis_config_set_std_cutoff( analysis_config_type * config , double std_cutoff ); -double analysis_config_get_std_cutoff( const analysis_config_type * config ); -void analysis_config_add_config_items( config_parser_type * config ); -void analysis_config_fprintf_config( analysis_config_type * config , FILE * stream); - -bool analysis_config_select_module( analysis_config_type * config , const char * module_name ); -analysis_module_type * analysis_config_get_active_module( analysis_config_type * config ); -void analysis_config_set_single_node_update(analysis_config_type * config , bool single_node_update); -bool analysis_config_get_single_node_update(const analysis_config_type * config); - -void analysis_config_set_store_PC( analysis_config_type * config , bool store_PC); -bool analysis_config_get_store_PC( const analysis_config_type * config ); -void analysis_config_set_PC_filename( analysis_config_type * config , const char * filename ); -const char * analysis_config_get_PC_filename( const analysis_config_type * config ); -void analysis_config_set_PC_path( analysis_config_type * config , const char * path ); -const char * analysis_config_get_PC_path( const analysis_config_type * config ); -bool analysis_config_have_enough_realisations( const analysis_config_type* config, int realisations, int ensemble_size); -void analysis_config_set_stop_long_running( analysis_config_type * config, bool stop_long_running ); -bool analysis_config_get_stop_long_running( const analysis_config_type * config); -void analysis_config_set_max_runtime( analysis_config_type * config, int max_runtime ); -int analysis_config_get_max_runtime( const analysis_config_type * config ); -const char * analysis_config_get_active_module_name( const analysis_config_type * config ); -bool analysis_config_get_std_scale_correlated_obs( const analysis_config_type * config); -void analysis_config_set_std_scale_correlated_obs( analysis_config_type * config, bool std_scale_correlated_obs); - -double analysis_config_get_global_std_scaling(const analysis_config_type * config); -void analysis_config_set_global_std_scaling(analysis_config_type * config, double global_std_scaling); - - UTIL_IS_INSTANCE_HEADER( analysis_config ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/analysis_iter_config.h b/ThirdParty/Ert/libenkf/include/ert/enkf/analysis_iter_config.h deleted file mode 100644 index e0a2e007b8..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/analysis_iter_config.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'analysis_iter_config.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ANALYSIS_ITER_CONFIG_H -#define ERT_ANALYSIS_ITER_CONFIG_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -typedef struct analysis_iter_config_struct analysis_iter_config_type; - - void analysis_iter_config_set_num_iterations( analysis_iter_config_type * config , int num_iterations); - int analysis_iter_config_get_num_iterations( const analysis_iter_config_type * config ); - void analysis_iter_config_set_num_retries_per_iteration( analysis_iter_config_type * config , int num_retries); - int analysis_iter_config_get_num_retries_per_iteration( const analysis_iter_config_type * config ); - void analysis_iter_config_set_case_fmt( analysis_iter_config_type * config, const char * case_fmt); - char * analysis_iter_config_get_case_fmt( analysis_iter_config_type * config); - analysis_iter_config_type * analysis_iter_config_alloc(); - void analysis_iter_config_free( analysis_iter_config_type * config ); - const char * analysis_iter_config_iget_case( analysis_iter_config_type * config , int iter); - void analysis_iter_config_add_config_items( config_parser_type * config ); - void analysis_iter_config_init(analysis_iter_config_type * iter_config , const config_content_type * config); - bool analysis_iter_config_case_fmt_set( const analysis_iter_config_type * config ); - bool analysis_iter_config_num_iterations_set( const analysis_iter_config_type * config ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/block_fs_driver.h b/ThirdParty/Ert/libenkf/include/ert/enkf/block_fs_driver.h deleted file mode 100644 index da9bc072e9..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/block_fs_driver.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'block_fs_driver.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_BLOCK_FS_DRIVER_H -#define ERT_BLOCK_FS_DRIVER_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include - - typedef struct block_fs_driver_struct block_fs_driver_type; - - - void block_fs_driver_fwrite_mount_info(FILE * stream , fs_driver_enum driver_type , int num_block_fs_drivers); - block_fs_driver_type * block_fs_driver_fread_alloc(const char * root_path , FILE * stream); - bool block_fs_sscanf_key(const char * key , char ** config_key , int * __report_step , int * __iens); - void * block_fs_driver_open(FILE * fstab_stream , const char * mount_point , fs_driver_enum driver_type , bool read_only); - void block_fs_driver_create_fs( FILE * stream , - const char * mount_point , - fs_driver_enum driver_type , - int num_fs , - const char * ens_path_fmt, - const char * filename ); - void block_fs_driver_fskip(FILE * fstab_stream); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/block_obs.h b/ThirdParty/Ert/libenkf/include/ert/enkf/block_obs.h deleted file mode 100644 index 47c8dbfb13..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/block_obs.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'block_obs.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_BLOCK_OBS_H -#define ERT_BLOCK_OBS_H -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include - -#include -#include - -#include -#include -#include -#include -#include - - - -typedef struct block_obs_struct block_obs_type; - - typedef enum { - SOURCE_FIELD = 10, - SOURCE_SUMMARY = 12 - } block_obs_source_type; - - - block_obs_type * block_obs_alloc_complete(const char * obs_label, - block_obs_source_type source_type , - const stringlist_type * summary_keys , - const void * data_config , - const ecl_grid_type * grid , - int size, - const int * i, - const int * j, - const int * k, - const double * obs_value, - const double * obs_std); - - block_obs_type * block_obs_alloc(const char * obs_key, - const void * data_config , - const ecl_grid_type * grid); - - -void block_obs_free( - block_obs_type * block_obs); - - -block_obs_type * block_obs_alloc_from_BLOCK_OBSERVATION(const conf_instance_type * conf_instance, const history_type * history); - -double block_obs_iget_depth( const block_obs_type * block_obs , int index); -int block_obs_iget_i(const block_obs_type * , int index); -int block_obs_iget_j(const block_obs_type * , int index); -int block_obs_iget_k(const block_obs_type * , int index); -int block_obs_get_size(const block_obs_type * ); -void block_obs_iget(const block_obs_type * block_obs, int , double * , double * ); -double block_obs_iget_value(const block_obs_type * block_obs, int index ); -double block_obs_iget_std(const block_obs_type * block_obs, int index ); -void block_obs_iget_ijk(const block_obs_type * block_obs , int block_nr , int * i , int * j , int * k); -double block_obs_iget_data( const block_obs_type * block_obs, const void * state , int iobs , node_id_type node_id ); -double block_obs_iget_std_scaling(const block_obs_type * block_obs, int index ); -void block_obs_update_std_scale(block_obs_type * block_obs, double scale_factor, const active_list_type * active_list); -void block_obs_append_field_obs( block_obs_type * block_obs , int i , int j , int k , double value , double std); -void block_obs_append_summary_obs( block_obs_type * block_obs , int i , int j , int k , const char * sum_key , double value , double std); - -VOID_FREE_HEADER(block_obs); -VOID_GET_OBS_HEADER(block_obs); -UTIL_IS_INSTANCE_HEADER(block_obs); -VOID_MEASURE_HEADER(block_obs); -VOID_USER_GET_OBS_HEADER(block_obs); -VOID_CHI2_HEADER(block_obs); -VOID_UPDATE_STD_SCALE_HEADER(block_obs); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/cases_config.h b/ThirdParty/Ert/libenkf/include/ert/enkf/cases_config.h deleted file mode 100644 index 78915cc31d..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/cases_config.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'cases_config.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_CASES_CONFIG_H -#define ERT_CASES_CONFIG_H - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef struct cases_config_struct cases_config_type; - - bool cases_config_set_int( cases_config_type * config , const char * var_name, int num_iterations); - int cases_config_get_iteration_number( const cases_config_type * config ); - void cases_config_fwrite( cases_config_type * config , const char * filename ); - void cases_config_fread( cases_config_type * config , const char * filename); - cases_config_type * cases_config_alloc(); - void cases_config_free( cases_config_type * config ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/config_keys.h b/ThirdParty/Ert/libenkf/include/ert/enkf/config_keys.h deleted file mode 100644 index dc8c835089..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/config_keys.h +++ /dev/null @@ -1,166 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'config_keys.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. - */ - - -#ifndef ERT_CONFIG_KEYS_H -#define ERT_CONFIG_KEYS_H -#ifdef __cplusplus -extern "C" { -#endif - -/* These keys are used as options in KEY:VALUE statements */ -#define BASE_SURFACE_KEY "BASE_SURFACE" -#define DEFINE_KEY "DEFINE" -#define DYNAMIC_KEY "DYNAMIC" -#define ECL_FILE_KEY "ECL_FILE" -#define FORWARD_INIT_KEY "FORWARD_INIT" -#define GENERAL_KEY "GENERAL" -#define INCLUDE_KEY "INCLUDE" -#define INIT_FILES_KEY "INIT_FILES" -#define INIT_TRANSFORM_KEY "INIT_TRANSFORM" -#define INPUT_FORMAT_KEY "INPUT_FORMAT" -#define INPUT_TRANSFORM_KEY "INPUT_TRANSFORM" -#define KEY_KEY "KEY" -#define MAX_KEY "MAX" -#define MIN_KEY "MIN" -#define MIN_STD_KEY "MIN_STD" -#define OUTPUT_FILE_KEY "OUTPUT_FILE" -#define OUTPUT_FORMAT_KEY "OUTPUT_FORMAT" -#define OUTPUT_TRANSFORM_KEY "OUTPUT_TRANSFORM" -#define PARAMETER_KEY "PARAMETER" -#define REPORT_STEPS_KEY "REPORT_STEPS" -#define RESULT_FILE_KEY "RESULT_FILE" -#define TEMPLATE_KEY "TEMPLATE" - - -#define ADD_FIXED_LENGTH_SCHEDULE_KW_KEY "ADD_FIXED_LENGTH_SCHEDULE_KW" -#define ANALYSIS_COPY_KEY "ANALYSIS_COPY" -#define ANALYSIS_LOAD_KEY "ANALYSIS_LOAD" -#define ANALYSIS_SET_VAR_KEY "ANALYSIS_SET_VAR" -#define ANALYSIS_SELECT_KEY "ANALYSIS_SELECT" -#define CASE_TABLE_KEY "CASE_TABLE" -#define CONTAINER_KEY "CONTAINER" -#define CUSTOM_KW_KEY "CUSTOM_KW" -#define DATA_FILE_KEY "DATA_FILE" -#define DATA_KW_KEY "DATA_KW" -#define DBASE_TYPE_KEY "DBASE_TYPE" -#define DELETE_RUNPATH_KEY "DELETE_RUNPATH" -#define ECLBASE_KEY "ECLBASE" -#define END_DATE_KEY "END_DATE" -#define ENKF_BOOTSTRAP_KEY "ENKF_BOOTSTRAP" -#define ENKF_PEN_PRESS_KEY "ENKF_PEN_PRESS" -#define ENKF_ALPHA_KEY "ENKF_ALPHA" -#define ENKF_CROSS_VALIDATION_KEY "ENKF_CROSS_VALIDATION" -#define ENKF_CV_FOLDS_KEY "ENKF_CV_FOLDS" -#define ENKF_SCALING_KEY "ENKF_SCALING" -#define ENKF_KERNEL_REG_KEY "ENKF_KERNEL_REGRESSION" -#define ENKF_KERNEL_FUNC_KEY "ENKF_KERNEL_FUNCTION" -#define ENKF_KERNEL_PARAM_KEY "ENKF_KERNEL_PARAM" -#define ENKF_LOCAL_CV_KEY "ENKF_LOCAL_CV" -#define ENKF_MERGE_OBSERVATIONS_KEY "ENKF_MERGE_OBSERVATIONS" -#define ENKF_MODE_KEY "ENKF_MODE" -#define ENKF_RERUN_KEY "ENKF_RERUN" -#define ENKF_TRUNCATION_KEY "ENKF_TRUNCATION" -#define ENSPATH_KEY "ENSPATH" -#define ITER_CASE_KEY "ITER_CASE" -#define ITER_COUNT_KEY "ITER_COUNT" -#define ITER_RETRY_COUNT_KEY "ITER_RETRY_COUNT" -#define FIELD_KEY "FIELD" -#define FORWARD_MODEL_KEY "FORWARD_MODEL" -#define GEN_DATA_KEY "GEN_DATA" -#define GEN_KW_KEY "GEN_KW" -#define GEN_KW_TAG_FORMAT_KEY "GEN_KW_TAG_FORMAT" -#define GEN_KW_EXPORT_FILE_KEY "GEN_KW_EXPORT_FILE" -#define GEN_PARAM_KEY "GEN_PARAM" -#define GRID_KEY "GRID" -#define HISTORY_SOURCE_KEY "HISTORY_SOURCE" -#define HOSY_TYPE_KEY "HOST_TYPE" -#define IGNORE_SCHEDULE_KEY "IGNORE_SCHEDULE" -#define INIT_SECTION_KEY "INIT_SECTION" -#define INSTALL_JOB_KEY "INSTALL_JOB" -#define INSTALL_JOB_DIRECTORY_KEY "INSTALL_JOB_DIRECTORY" -#define JOB_SCRIPT_KEY "JOB_SCRIPT" -#define JOBNAME_KEY "JOBNAME" -#define LICENSE_PATH_KEY "LICENSE_PATH" -#define LOAD_SEED_KEY "LOAD_SEED" -#define LOCAL_CONFIG_KEY "LOCAL_CONFIG" -#define LOG_FILE_KEY "LOG_FILE" -#define LOG_LEVEL_KEY "LOG_LEVEL" -#define LSF_QUEUE_KEY "LSF_QUEUE" -#define LSF_RESOURCES_KEY "LSF_RESOURCES" -#define LSF_SERVER_KEY "LSF_SERVER" -#define TORQUE_QUEUE_KEY "TORQUE_QUEUE" -#define MAX_RESAMPLE_KEY "MAX_RESAMPLE" -#define MAX_RUNNING_LOCAL_KEY "MAX_RUNNING_LOCAL" -#define MAX_RUNNING_LSF_KEY "MAX_RUNNING_LSF" -#define MAX_RUNNING_RSH_KEY "MAX_RUNNING_RSH" -#define MAX_SUBMIT_KEY "MAX_SUBMIT" -#define NUM_REALIZATIONS_KEY "NUM_REALIZATIONS" -#define MIN_REALIZATIONS_KEY "MIN_REALIZATIONS" -#define OBS_CONFIG_KEY "OBS_CONFIG" -#define PLOT_PATH_KEY "PLOT_PATH" -#define PRE_CLEAR_RUNPATH_KEY "PRE_CLEAR_RUNPATH" -#define QUEUE_SYSTEM_KEY "QUEUE_SYSTEM" -#define QUEUE_OPTION_KEY "QUEUE_OPTION" -#define QC_PATH_KEY "QC_PATH" -#define QC_WORKFLOW_KEY "QC_WORKFLOW" -#define HOOK_WORKFLOW_KEY "HOOK_WORKFLOW" -#define REFCASE_KEY "REFCASE" -#define REFCASE_LIST_KEY "REFCASE_LIST" -#define RERUN_START_KEY "RERUN_START" -#define RSH_COMMAND_KEY "RSH_COMMAND" -#define RSH_HOST_KEY "RSH_HOST" -#define RUNPATH_FILE_KEY "RUNPATH_FILE" -#define RUNPATH_KEY "RUNPATH" -#define ITER_RUNPATH_KEY "ITER_RUNPATH" -#define RERUN_PATH_KEY "RERUN_PATH" -#define RUN_TEMPLATE_KEY "RUN_TEMPLATE" -#define RFT_CONFIG_KEY "RFT_CONFIG" -#define RFTPATH_KEY "RFTPATH" -#define SCHEDULE_FILE_KEY "SCHEDULE_FILE" -#define SCHEDULE_PREDICTION_FILE_KEY "SCHEDULE_PREDICTION_FILE" -#define SETENV_KEY "SETENV" -#define STATIC_KW_KEY "ADD_STATIC_KW" -#define STD_CUTOFF_KEY "STD_CUTOFF" -#define SUMMARY_KEY "SUMMARY" -#define SURFACE_KEY "SURFACE" -#define UPDATE_LOG_PATH_KEY "UPDATE_LOG_PATH" -#define UPDATE_PATH_KEY "UPDATE_PATH" -#define SINGLE_NODE_UPDATE_KEY "SINGLE_NODE_UPDATE" -#define STORE_SEED_KEY "STORE_SEED" -#define UMASK_KEY "UMASK" -#define WORKFLOW_JOB_DIRECTORY_KEY "WORKFLOW_JOB_DIRECTORY" -#define LOAD_WORKFLOW_KEY "LOAD_WORKFLOW" -#define LOAD_WORKFLOW_JOB_KEY "LOAD_WORKFLOW_JOB" -#define STOP_LONG_RUNNING_KEY "STOP_LONG_RUNNING" -#define MAX_RUNTIME_KEY "MAX_RUNTIME" -#define TIME_MAP_KEY "TIME_MAP" -#define EXT_JOB_SEARCH_PATH_KEY "EXT_JOB_SEARCH_PATH" -#define STD_SCALE_CORRELATED_OBS_KEY "STD_SCALE_CORRELATED_OBS" -#define PLOT_SETTING_KEY "PLOT_SETTINGS" -#define UPDATE_SETTING_KEY "UPDATE_SETTINGS" - -#define CONFIG_BOOL_STRING( var ) (var) ? "TRUE" : "FALSE" - - - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/config_parser.h b/ThirdParty/Ert/libenkf/include/ert/enkf/config_parser.h deleted file mode 100644 index 4df730dcf4..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/config_parser.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'config_parser.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_CONFIG_PARSER_H -#define ERT_CONFIG_PARSER_H - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/container.h b/ThirdParty/Ert/libenkf/include/ert/enkf/container.h deleted file mode 100644 index 215c6f0969..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/container.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'container.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_CONTAINER_H -#define ERT_CONTAINER_H - -#ifdef __cplusplus -extern "C" { -#endif -#include - - - typedef struct container_struct container_type; - - void container_add_node(container_type * container , void * child_node ); - const void * container_iget_node(const container_type * container , int index); - int container_get_size( const container_type * container ); - void container_assert_size( const container_type * container ); - - VOID_ALLOC_HEADER(container); - VOID_FREE_HEADER(container); - UTIL_IS_INSTANCE_HEADER(container); - UTIL_SAFE_CAST_HEADER_CONST(container); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/container_config.h b/ThirdParty/Ert/libenkf/include/ert/enkf/container_config.h deleted file mode 100644 index ed0399345c..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/container_config.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'container_config.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_CONTAINER_CONFIG_H -#define ERT_CONTAINER_CONFIG_H - - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - - typedef struct container_config_struct container_config_type; - - - container_config_type * container_config_alloc( const char * key ); - void container_config_free( container_config_type * container ); - void container_config_add_node( container_config_type * container, const enkf_config_node_type * config_node); - const char * container_config_iget_key( const container_config_type * container_config , int index); - const void * container_config_iget_node(const container_config_type * container_config , int index); - int container_config_get_size( const container_config_type * container_config ); - - UTIL_IS_INSTANCE_HEADER(container_config); - UTIL_SAFE_CAST_HEADER_CONST(container_config); - GET_DATA_SIZE_HEADER(container); - VOID_GET_DATA_SIZE_HEADER(container); - VOID_CONFIG_FREE_HEADER(container); - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/custom_kw.h b/ThirdParty/Ert/libenkf/include/ert/enkf/custom_kw.h deleted file mode 100644 index f8282cd830..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/custom_kw.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef ERT_CUSTOM_KW_H -#define ERT_CUSTOM_KW_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - - typedef struct custom_kw_struct custom_kw_type; - - custom_kw_type * custom_kw_alloc(const custom_kw_config_type * config); - void custom_kw_free(custom_kw_type * custom_kw); - custom_kw_config_type * custom_kw_get_config(const custom_kw_type * custom_kw); - const stringlist_type * custom_kw_get_data(const custom_kw_type * custom_kw); - bool custom_kw_key_is_null(const custom_kw_type * custom_kw, char * key); - double custom_kw_iget_as_double(const custom_kw_type * custom_kw, int index); - const char * custom_kw_iget_as_string(const custom_kw_type * custom_kw, int index); - void custom_kw_set_string(custom_kw_type * custom_kw, const char * key, const char * value); - void custom_kw_set_double(custom_kw_type * custom_kw, const char * key, double value); - - bool custom_kw_fload(custom_kw_type * custom_kw, const char * filename); - bool custom_kw_forward_load(custom_kw_type * custom_kw, const char * ecl_file, const forward_load_context_type * load_context); - - bool custom_kw_write_to_buffer(const custom_kw_type * custom_kw, buffer_type * buffer, int report_step); - void custom_kw_read_from_buffer(const custom_kw_type * custom_kw, buffer_type * buffer, enkf_fs_type * fs, int report_step); - void custom_kw_ecl_write(const custom_kw_type * custom_kw, const char * run_path, const char * base_file, void * filestream); - void custom_kw_serialize(const custom_kw_type * custom_kw, node_id_type node_id, const active_list_type * active_list, matrix_type * A, int row_offset, int column); - void custom_kw_deserialize(custom_kw_type * custom_kw, node_id_type node_id, const active_list_type * active_list, const matrix_type * A, int row_offset , int column); - - - UTIL_SAFE_CAST_HEADER(custom_kw); - UTIL_SAFE_CAST_HEADER_CONST(custom_kw); - VOID_USER_GET_HEADER(custom_kw); - VOID_ALLOC_HEADER(custom_kw); - VOID_FREE_HEADER(custom_kw); - VOID_FORWARD_LOAD_HEADER(custom_kw) - VOID_FLOAD_HEADER(custom_kw) - VOID_ECL_WRITE_HEADER(custom_kw); - VOID_READ_FROM_BUFFER_HEADER(custom_kw); - VOID_WRITE_TO_BUFFER_HEADER(custom_kw); - VOID_SERIALIZE_HEADER(custom_kw) - VOID_DESERIALIZE_HEADER(custom_kw) -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/custom_kw_config.h b/ThirdParty/Ert/libenkf/include/ert/enkf/custom_kw_config.h deleted file mode 100644 index e532807d1f..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/custom_kw_config.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef ERT_CUSTOM_KW_CONFIG_H -#define ERT_CUSTOM_KW_CONFIG_H -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include -#include -#include -#include - -#include -#include -#include - - typedef struct custom_kw_config_struct custom_kw_config_type; - - custom_kw_config_type * custom_kw_config_alloc_empty(const char * key, const char * result_file, const char * output_file); - custom_kw_config_type * custom_kw_config_alloc_with_definition(const char * key, const hash_type * definition); - void custom_kw_config_free(custom_kw_config_type * config); - const char * custom_kw_config_get_name(const custom_kw_config_type * config); - char * custom_kw_config_get_result_file(const custom_kw_config_type * config); - char * custom_kw_config_get_output_file(const custom_kw_config_type * config); - bool custom_kw_config_parse_result_file(custom_kw_config_type * config, const char * result_file, stringlist_type * result); - void custom_kw_config_serialize(const custom_kw_config_type * config, stringlist_type * config_set); - void custom_kw_config_deserialize(custom_kw_config_type * config, stringlist_type * config_set); - bool custom_kw_config_has_key(const custom_kw_config_type * config, const char * key); - bool custom_kw_config_key_is_double(const custom_kw_config_type * config, const char * key); - int custom_kw_config_index_of_key(const custom_kw_config_type * config, const char * key); - int custom_kw_config_size(const custom_kw_config_type * config); - stringlist_type * custom_kw_config_get_keys(const custom_kw_config_type * config); - - - UTIL_IS_INSTANCE_HEADER(custom_kw_config); - UTIL_SAFE_CAST_HEADER(custom_kw_config); - UTIL_SAFE_CAST_HEADER_CONST(custom_kw_config); - VOID_FREE_HEADER(custom_kw_config) - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/custom_kw_config_set.h b/ThirdParty/Ert/libenkf/include/ert/enkf/custom_kw_config_set.h deleted file mode 100644 index b99ca9c9b8..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/custom_kw_config_set.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef ERT_CUSTOM_KW_CONFIG_SET_H -#define ERT_CUSTOM_KW_CONFIG_SET_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include - - typedef struct custom_kw_config_set_struct custom_kw_config_set_type; - - custom_kw_config_set_type * custom_kw_config_set_alloc(); - custom_kw_config_set_type * custom_kw_config_set_alloc_from_file(const char * filename); - void custom_kw_config_set_free(custom_kw_config_set_type * set); - void custom_kw_config_set_add_config(custom_kw_config_set_type * set, const custom_kw_config_type * config); - void custom_kw_config_set_update_config(custom_kw_config_set_type * set, custom_kw_config_type * config); - void custom_kw_config_set_reset(custom_kw_config_set_type * set); - stringlist_type * custom_kw_config_set_get_keys_alloc(custom_kw_config_set_type * set); - void custom_kw_config_set_fwrite(custom_kw_config_set_type * set, const char * filename); - bool custom_kw_config_set_fread(custom_kw_config_set_type * set, const char * filename); - - UTIL_IS_INSTANCE_HEADER(custom_kw_config_set); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/data_ranking.h b/ThirdParty/Ert/libenkf/include/ert/enkf/data_ranking.h deleted file mode 100644 index a85e90fea7..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/data_ranking.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'data_ranking.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_DATA_RANKING_H -#define ERT_DATA_RANKING_H - -#ifdef __cplusplus -extern "C" { -#endif -#include -#include - -#include -#include - -#include - - typedef struct data_ranking_struct data_ranking_type; - - UTIL_IS_INSTANCE_HEADER( data_ranking ); - UTIL_SAFE_CAST_HEADER(data_ranking); - - const perm_vector_type * data_ranking_get_permutation( const data_ranking_type * data_ranking ); - data_ranking_type * data_ranking_alloc( bool sort_increasing , int ens_size , const char * user_key , const char * key_index , enkf_fs_type * fs , const enkf_config_node_type * config_node , int step ); - void data_ranking_free__( void * arg ); - void data_ranking_display( const data_ranking_type * data_ranking , FILE * stream); - -#ifdef __cplusplus -} -#endif -#endif - - - - - diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/ecl_config.h b/ThirdParty/Ert/libenkf/include/ert/enkf/ecl_config.h deleted file mode 100644 index a8270d2c47..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/ecl_config.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'ecl_config.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ECL_CONFIG_H -#define ERT_ECL_CONFIG_H -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include -#include - -#include -#include - -#include -#include -#include - -#include - -#include - - - typedef struct ecl_config_struct ecl_config_type; - - const char * ecl_config_get_data_file(const ecl_config_type * ); - void ecl_config_set_data_file( ecl_config_type * ecl_config , const char * data_file); - ui_return_type * ecl_config_validate_data_file(const ecl_config_type * ecl_config, const char * data_file); - - void ecl_config_set_schedule_file(ecl_config_type * ecl_config, const char * schedule_file, const char * schedule_target_file); - ui_return_type * ecl_config_validate_schedule_file(const ecl_config_type * ecl_config , const char * schedule_file); - const char * ecl_config_get_schedule_file( const ecl_config_type * ecl_config ); - const char * ecl_config_get_schedule_target(const ecl_config_type * ); - bool ecl_config_has_schedule( const ecl_config_type * ecl_config ); - - void ecl_config_set_eclbase( ecl_config_type * ecl_config , const char * eclbase_fmt ); - ui_return_type * ecl_config_validate_eclbase( const ecl_config_type * ecl_config , const char * eclbase_fmt ); - const path_fmt_type * ecl_config_get_eclbase_fmt(const ecl_config_type * ); - - void ecl_config_set_init_section( ecl_config_type * ecl_config , const char * input_init_section ); - ui_return_type * ecl_config_validate_init_section( const ecl_config_type * ecl_config , const char * input_init_section ); - const char * ecl_config_get_init_section(const ecl_config_type * ecl_config); - const char * ecl_config_get_equil_init_file(const ecl_config_type * ); - bool ecl_config_has_init_section( const ecl_config_type * ecl_config ); - - - void ecl_config_set_grid( ecl_config_type * ecl_config , const char * grid_file ); - const char * ecl_config_get_gridfile( const ecl_config_type * ecl_config ); - ecl_grid_type * ecl_config_get_grid(const ecl_config_type * ); - ui_return_type * ecl_config_validate_grid( const ecl_config_type * ecl_config , const char * grid_file ); - - bool ecl_config_load_refcase( ecl_config_type * ecl_config , const char * refcase); - ui_return_type * ecl_config_validate_refcase( const ecl_config_type * ecl_config , const char * refcase ); - const ecl_sum_type * ecl_config_get_refcase(const ecl_config_type * ecl_config); - bool ecl_config_has_refcase( const ecl_config_type * ecl_config ); - ecl_refcase_list_type * ecl_config_get_refcase_list( const ecl_config_type * ecl_config ); - - /*****************************************************************/ - - void ecl_config_static_kw_init( ecl_config_type * ecl_config , const config_content_type * config ); - bool ecl_config_active( const ecl_config_type * config ); - time_t ecl_config_get_end_date( const ecl_config_type * ecl_config ); - time_t ecl_config_get_start_date( const ecl_config_type * ecl_config ); - - const char * ecl_config_get_schedule_prediction_file( const ecl_config_type * ecl_config ); - void ecl_config_set_schedule_prediction_file( ecl_config_type * ecl_config , const char * schedule_prediction_file ); - sched_file_type * ecl_config_get_sched_file(const ecl_config_type * ); - - - int ecl_config_get_num_cpu( const ecl_config_type * ecl_config ); - void ecl_config_init( ecl_config_type * ecl_config , const config_content_type * config); - void ecl_config_free( ecl_config_type *); - bool ecl_config_include_static_kw(const ecl_config_type * , const char * ); - void ecl_config_add_static_kw(ecl_config_type *, const char *); - ecl_io_config_type * ecl_config_get_io_config(const ecl_config_type * ); - - bool ecl_config_get_formatted(const ecl_config_type * ); - bool ecl_config_get_unified_restart(const ecl_config_type * ); - bool ecl_config_get_unified_summary(const ecl_config_type * ); - int ecl_config_get_num_restart_files(const ecl_config_type * ); - int ecl_config_get_last_history_restart( const ecl_config_type * ); - bool ecl_config_can_restart( const ecl_config_type * ecl_config ); - void ecl_config_assert_restart( const ecl_config_type * ecl_config ); - const char * ecl_config_get_eclbase( const ecl_config_type * ecl_config ); - const char * ecl_config_get_refcase_name( const ecl_config_type * ecl_config); - void ecl_config_clear_static_kw( ecl_config_type * ecl_config ); - stringlist_type * ecl_config_get_static_kw_list( const ecl_config_type * ecl_config ); - void ecl_config_fprintf_config( const ecl_config_type * ecl_config , FILE * stream ); - ecl_config_type * ecl_config_alloc( ); - void ecl_config_add_config_items( config_parser_type * config ); - const char * ecl_config_get_depth_unit( const ecl_config_type * ecl_config ); - const char * ecl_config_get_pressure_unit( const ecl_config_type * ecl_config ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/ecl_refcase_list.h b/ThirdParty/Ert/libenkf/include/ert/enkf/ecl_refcase_list.h deleted file mode 100644 index 22627d7b31..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/ecl_refcase_list.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'ecl_refcase_list.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#ifndef ERT_ECL_REFCASE_LIST_H -#define ERT_ECL_REFCASE_LIST_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - - - typedef struct ecl_refcase_list_struct ecl_refcase_list_type; - - ecl_refcase_list_type * ecl_refcase_list_alloc( ); - void ecl_refcase_list_free( ecl_refcase_list_type * refcase_list ); - - bool ecl_refcase_list_has_default( ecl_refcase_list_type * refcase_list ); - const ecl_sum_type * ecl_refcase_list_get_default( ecl_refcase_list_type * refcase_list ); - bool ecl_refcase_list_set_default( ecl_refcase_list_type * refcase_list , const char * default_case); - int ecl_refcase_list_get_size(ecl_refcase_list_type * refcase_list ); - int ecl_refcase_list_add_matching( ecl_refcase_list_type * refcase_list , const char * glob_string); - int ecl_refcase_list_add_case( ecl_refcase_list_type * refcase_list , const char * case_name); - const char * ecl_refcase_list_iget_pathcase( ecl_refcase_list_type * refcase_list , int index); - const ecl_sum_type * ecl_refcase_list_iget_case( ecl_refcase_list_type * refcase_list , int index); - const ecl_sum_type * ecl_refcase_list_get_case( ecl_refcase_list_type * refcase_list , const char * case_name); - bool ecl_refcase_list_has_case( ecl_refcase_list_type * refcase_list , const char * case_name); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf.h deleted file mode 100644 index 280430db55..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#define SPLASH_LENGTH 8 -const char *splash_text[SPLASH_LENGTH] = { -" 8888888888 888 d8P 8888888888", -" 888 888 d8P 888 ", -" 888 888 d8P 888 ", -" 8888888 88888b. 888d88K 8888888 ", -" 888 888 '88b 8888888b 888 ", -" 888 888 888 888 Y88b 888 ", -" 888 888 888 888 Y88b 888 ", -" 8888888888 888 888 888 Y88b 888 "}; - diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_analysis.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_analysis.h deleted file mode 100644 index 294f441fee..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_analysis.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_analysis.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#ifndef ERT_ENKF_ANALYSIS_H -#define ERT_ENKF_ANALYSIS_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include -#include - -#include - - - -void enkf_analysis_fprintf_obs_summary(const obs_data_type * obs_data , - const meas_data_type * meas_data , - const int_vector_type * step_list , - const char * ministep_name , - FILE * stream ); - -void enkf_analysis_deactivate_outliers(obs_data_type * obs_data , - meas_data_type * meas_data , - double std_cutoff , - double alpha, - bool verbose); - -void enkf_analysis_deactivate_std_zero(obs_data_type * obs_data , - meas_data_type * meas_data, - bool verbose); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_config_node.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_config_node.h deleted file mode 100644 index bc4f84a117..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_config_node.h +++ /dev/null @@ -1,234 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_config_node.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_CONFIG_NODE_H -#define ERT_ENKF_CONFIG_NODE_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include - -#include - -#include -#include -#include -#include -#include - - typedef void (config_free_ftype) (void *); - typedef int (get_data_size_ftype) (const void *); - typedef void (config_fprintf_ftype) (const void * , enkf_var_type , FILE * ); - - typedef struct enkf_config_node_struct enkf_config_node_type; - typedef struct enkf_node_struct enkf_node_type; - - - bool enkf_config_node_has_vector( const enkf_config_node_type * node , enkf_fs_type * fs , int iens); - bool enkf_config_node_has_node( const enkf_config_node_type * node , enkf_fs_type * fs , node_id_type node_id); - bool enkf_config_node_vector_storage( const enkf_config_node_type * config_node); - - enkf_config_node_type * enkf_config_node_new_GEN_PARAM( const char * key , bool forward_init); - enkf_config_node_type * enkf_config_node_new_GEN_DATA( const char * key , bool forward_init); - enkf_config_node_type * enkf_config_node_new_custom_kw(const char * key, const char * result_file, const char * output_file); - enkf_config_node_type * enkf_config_node_new_defined_custom_kw(const char * key, const hash_type * definition); - - void enkf_config_node_update_min_std( enkf_config_node_type * config_node , const char * min_std_file ); - - enkf_config_node_type * enkf_config_node_alloc_GEN_PARAM( const char * node_key , - bool forward_init , - gen_data_file_format_type input_format , - gen_data_file_format_type output_format , - const char * init_file_fmt , - const char * ert_outfile_fmt); - - - enkf_config_node_type * enkf_config_node_alloc_GEN_DATA_state( const char * key, - bool forward_init , - gen_data_file_format_type input_format, - gen_data_file_format_type output_format, - const char * init_file_fmt , - const char * template_ecl_file , - const char * template_data_key , - const char * enkf_outfile_fmt , - const char * enkf_infile_fmt , - const char * min_std_file); - - - - enkf_config_node_type * enkf_config_node_alloc_GEN_DATA_result( const char * key , - gen_data_file_format_type input_format, - const char * enkf_infile_fmt ); - - - - - void enkf_config_node_update_GEN_PARAM( enkf_config_node_type * config_node, - gen_data_file_format_type input_format, - gen_data_file_format_type output_format, - const char * init_file_fmt , - const char * template_ecl_file , - const char * template_data_key , - const char * enkf_outfile_fmt , - const char * min_std_file); - - - void enkf_config_node_update_GEN_DATA_result( enkf_config_node_type * config_node, - gen_data_file_format_type input_format, - const char * enkf_infile_fmt ); - - - void enkf_config_node_update_GEN_DATA_state( enkf_config_node_type * config_node, - gen_data_file_format_type input_format, - gen_data_file_format_type output_format, - const char * init_file_fmt , - const char * template_ecl_file , - const char * template_data_key , - const char * enkf_outfile_fmt , - const char * enkf_infile_fmt , - const char * min_std_file); - - - enkf_config_node_type * enkf_config_node_new_surface( const char * key , bool forward_init); - - - void enkf_config_node_update_surface( enkf_config_node_type * config_node , - const char * base_surface , - const char * init_file_fmt , - const char * output_file , - const char * min_std_file ); - - - void enkf_config_node_update_gen_kw( enkf_config_node_type * config_node , - const char * enkf_outfile_fmt , /* The include file created by ERT for the forward model. */ - const char * template_file , - const char * parameter_file , - const char * min_std_file , - const char * init_file_fmt ); - - void enkf_config_node_update_custom_kw(enkf_config_node_type * config_node, const char * result_file, const char * output_file); - - - enkf_config_node_type * enkf_config_node_alloc(enkf_var_type , - ert_impl_type , - bool , - const char * , - const char * , - const char * , - const char * , - void * ); - - - enkf_config_node_type * enkf_config_node_alloc_summary( const char * key , load_fail_type load_fail); - - - void enkf_config_node_update_state_field( enkf_config_node_type * config_node , int truncation , double value_min , double value_max ); - - - void enkf_config_node_update_parameter_field( enkf_config_node_type * config_node , - const char * enkf_outfile_fmt , - const char * init_file_fmt , - const char * min_std_file , - int truncation , double value_min , double value_max , - const char * init_transform , - const char * output_transform ); - - - void enkf_config_node_update_general_field( enkf_config_node_type * config_node , - const char * enkf_outfile_fmt , - const char * enkf_infile_fmt , - const char * init_file_fmt , - const char * min_std_file , - int truncation , - double value_min , - double value_max , - const char * init_transform , - const char * input_transform , - const char * output_transform ); - - - -/*****************************************************************/ - - enkf_config_node_type * enkf_config_node_new_gen_kw( const char * key , const char * tag_fmt , bool forward_init); - enkf_config_node_type * enkf_config_node_alloc_field( const char * key , ecl_grid_type * ecl_grid, field_trans_table_type * trans_table, bool forward_init); - bool enkf_config_node_is_valid( const enkf_config_node_type * config_node ); - int enkf_config_node_get_data_size( const enkf_config_node_type * node , int report_step); - char * enkf_config_node_alloc_infile(const enkf_config_node_type * , int ); - char * enkf_config_node_alloc_outfile(const enkf_config_node_type * , int ); - int enkf_config_node_get_num_obs( const enkf_config_node_type * config_node ); - int enkf_config_node_load_obs( const enkf_config_node_type * config_node , enkf_obs_type * enkf_obs ,const char * key_index , int obs_count , time_t * sim_time , double * y , double * std); - const stringlist_type * enkf_config_node_get_obs_keys(const enkf_config_node_type *); - void enkf_config_node_add_obs_key(enkf_config_node_type * , const char * ); - void enkf_config_node_clear_obs_keys(enkf_config_node_type * config_node); - void enkf_config_node_free(enkf_config_node_type * ); - bool enkf_config_node_include_type(const enkf_config_node_type * , int ); - int enkf_config_node_get_serial_size(enkf_config_node_type *, int *); - bool enkf_config_node_include_type(const enkf_config_node_type * , int); - ert_impl_type enkf_config_node_get_impl_type(const enkf_config_node_type *); - enkf_var_type enkf_config_node_get_var_type(const enkf_config_node_type *); - void * enkf_config_node_get_ref(const enkf_config_node_type * ); - const char * enkf_config_node_get_key(const enkf_config_node_type * ); - const char * enkf_config_node_get_FIELD_fill_file(enkf_config_node_type * config_node, const path_fmt_type * runpath_fmt); - void enkf_config_node_init_internalization(enkf_config_node_type * ); - void enkf_config_node_set_min_std( enkf_config_node_type * config_node , enkf_node_type * min_std ); - const char * enkf_config_node_get_min_std_file( const enkf_config_node_type * config_node ); - const char * enkf_config_node_get_enkf_outfile( const enkf_config_node_type * conifg_node ); - const char * enkf_config_node_get_enkf_infile( const enkf_config_node_type * config_node ); - const char * enkf_config_node_get_init_file_fmt( const enkf_config_node_type * config_node ); - char * enkf_config_node_alloc_initfile( const enkf_config_node_type * node , const char * path , int iens); - - void enkf_config_node_set_internalize(enkf_config_node_type * node, int report_step); - bool enkf_config_node_internalize(const enkf_config_node_type * node, int report_step); - - void enkf_config_node_fprintf_config( const enkf_config_node_type * config_node , FILE * stream ); - enkf_config_node_type * enkf_config_node_container_iget( const enkf_config_node_type * node , int index); - int enkf_config_node_container_size( const enkf_config_node_type * node ); - - enkf_config_node_type * enkf_config_node_new_container( const char * key ); - void enkf_config_node_update_container( enkf_config_node_type * config_node , const enkf_config_node_type * child_node); - const char * enkf_config_node_iget_container_key( const enkf_config_node_type * config_node , int index); - /* - The enkf_node_free() function declaration is in the enkf_config_node.h header, - because the enkf_config_node needs to know how to free the min_std node. - */ - void enkf_node_free(enkf_node_type *enkf_node); - const enkf_node_type * enkf_config_node_get_min_std( const enkf_config_node_type * config_node ); - - bool enkf_config_node_use_forward_init(const enkf_config_node_type * config_node); - void enkf_config_node_set_forward_init(enkf_config_node_type * config_node, bool forward_init); - - /*****************************************************************/ - - void enkf_config_node_add_GEN_DATA_config_schema( config_parser_type * config ); - void enkf_config_node_add_CUSTOM_KW_config_schema( config_parser_type * config ); - void enkf_config_node_add_GEN_PARAM_config_schema( config_parser_type * config ); - enkf_config_node_type * enkf_config_node_alloc_GEN_PARAM_from_config( const config_content_node_type * config_node ); - enkf_config_node_type * enkf_config_node_alloc_GEN_DATA_from_config( const config_content_node_type * node ); - -UTIL_IS_INSTANCE_HEADER( enkf_config_node ); -UTIL_SAFE_CAST_HEADER(enkf_config_node); -VOID_FREE_HEADER(enkf_config_node); -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_config_private.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_config_private.h deleted file mode 100644 index 511a05ed50..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_config_private.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_config_private.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -struct enkf_config_struct { - int ens_size; - hash_type *config_hash; - hash_type *obs_hash; - bool endian_swap; - path_fmt_type *run_path; - int Nwells; - char **well_list; -}; diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_defaults.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_defaults.h deleted file mode 100644 index 6dbac98d54..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_defaults.h +++ /dev/null @@ -1,296 +0,0 @@ -/** - This file contains verious default values which are compiled into - the enkf executable. Everytime you add something here you should - ask yourself: - - * Can we determine this automagically. - * Should the user be required to enter this information. - -*/ - -#ifndef ERT_ENKF_DEFAULT -#define ERT_ENKF_DEFAULT -#include - -#define DEFAULT_RUNPATH_KEY "DEFAULT_RUNPATH" -#define RERUN_RUNPATH_KEY "DEFAULT_RERUN_PATH" - - -/** - The format string used when creating "search-strings" which should - be replaced in the gen_kw template files - MUST contain one %s - placeholder which will be replaced with the parameter name. -*/ -#define DEFAULT_GEN_KW_TAG_FORMAT "<%s>" - - -/** - Default file name for export file for GEN_KW parameters -*/ -#define DEFAULT_GEN_KW_EXPORT_FILE "parameters.txt" - - -/** - The format string used when creating search strings from user input - with the 'DATA_KW' keyword. The format string must contain one '%s' - placeholder which will be replaced with the user supplied key; can - be just '%s' which means no ERT induced transformations. - - Example: - ------- - DATA_KW KEY1 VALUE1 - - DATA_KW_FORMAT = [<%s>] - - In this case all occurences of '[]' will be replaced with - 'VALUE1'. The DATA_KW_TAG_FORMAT used on user supplied tag keys can - in principle be different from the internal format, but this can of - course be confusing. The internal format is hard linked to job - description files, and can not easily be changed. -*/ - -//#define DEFAULT_DATA_KW_TAG_FORMAT "<%s>" - - -/** - This is the format used for tagging the internal variables like - IENS, and ECLBASE. These values are written into the various job - description files, care should therefor be taken before changing - the value of this variable. It is not user modifiable, and can only - be changed by recompiling. - -*/ -#define INTERNAL_DATA_KW_TAG_FORMAT "<%s>" - - - - -#define DEFAULT_DBASE_TYPE "BLOCK_FS" - -/** - The default number of block_fs instances allocated. -*/ -#define ENKF_DEFAULT_NUM_BLOCK_FS_DRIVERS 32 - - -/* Eclipse IO related stuff */ -#define DEFAULT_FORMATTED false -#define DEFAULT_UNIFIED false - - - -/* - Where the history is coming from - default value for config item: - HISTORY_SOURCE Observe that the function: - model_config_set_history_source() does currently not handle a - default value different from SCHEDULE. -*/ -#define DEFAULT_HISTORY_SOURCE REFCASE_HISTORY - - -#define DEFAULT_MAX_SUBMIT 2 /* The number of times to resubmit - default value for config item: MAX_SUBMIT */ -#define DEFAULT_MAX_INTERNAL_SUBMIT 1 /** Attached to keyword : MAX_RETRY */ - - -#define DEFAULT_LOG_LEVEL 1 -#define DEFAULT_LOG_FILE "log" - - - -/* - Defaults for the EnKF analysis. The analysis_config object is - instantiated with these values. -*/ -#define DEFAULT_ENKF_MODE ENKF_STANDARD -#define DEFAULT_NCOMP 1 -#define DEFAULT_ENKF_TRUNCATION 0.99 -#define DEFAULT_ENKF_ALPHA 3.0 -#define DEFAULT_ENKF_STD_CUTOFF 1e-6 -#define DEFAULT_MERGE_OBSERVATIONS false -#define DEFAULT_RERUN false -#define DEFAULT_RERUN_START 0 -#define DEFAULT_UPDATE_LOG_PATH "update_log" -#define DEFAULT_CV_NFOLDS 10 -#define DEFAULT_ENKF_SCALING true -#define DEFAULT_ENKF_KERNEL_REG false -#define DEFAULT_ENKF_KERNEL_FUNC 1 /*Default is the Gaussian */ -#define DEFAULT_ENKF_KERNEL_PARAM 1 /*Scale by the maximum value in the distance matrix */ -#define DEFAULT_ENKF_CV false -#define DEFAULT_ENKF_BOOTSTRAP false -#define DEFAULT_ENKF_PEN_PRESS false -#define DEFAULT_ENKF_FORCE_NCOMP false -#define DEFAULT_UPDATE_RESULTS false -#define DEFAULT_SINGLE_NODE_UPDATE false -#define DEFAULT_ANALYSIS_MODULE "STD_ENKF" -#define DEFAULT_ANALYSIS_NUM_ITERATIONS 4 -#define DEFAULT_ANALYSIS_ITER_CASE "ITERATED_ENSEMBLE_SMOOTHER%d" -#define DEFAULT_ANALYSIS_ITER_RUNPATH "Simulations/Real%d" -#define DEFAULT_ANALYSIS_MIN_REALISATIONS 0 // 0: No lower limit -#define DEFAULT_ANALYSIS_STOP_LONG_RUNNING false -#define DEFAULT_MAX_RUNTIME 0 -#define DEFAULT_ITER_RETRY_COUNT 4 - - -/* Default directories. */ -#define DEFAULT_QC_PATH "QC" -#define DEFAULT_REPORT_PATH "reports" -#define DEFAULT_RUNPATH "simulations/realization%d" -#define DEFAULT_ENSPATH "storage" -#define DEFAULT_RFTPATH "rft" -#define DEFAULT_PLOT_REFCASE true -#define DEFAULT_REPORT_LARGE false -#define DEFAULT_REPORT_TIMEOUT 120 - -#define DEFAULT_PRE_CLEAR_RUNPATH false - -#define DEFAULT_PLOT_WIDTH 1024 -#define DEFAULT_PLOT_HEIGHT 768 -#define DEFAULT_PLOT_ERRORBAR_MAX 25 -#define DEFAULT_PLOT_ERRORBAR false -#define DEFAULT_IMAGE_TYPE "png" -#define DEFAULT_PLOT_DRIVER "PLPLOT" -#define DEFAULT_IMAGE_VIEWER "/usr/bin/display" -#define DEFAULT_PLOT_LOGY false - -#define DEFAULT_STORE_PC true -#define DEFAULT_PC_FILENAME "PC_%04d-%04d-%s" -#define DEFAULT_PC_PATH "PC" - -#define SUMMARY_KEY_JOIN_STRING ":" -#define USER_KEY_JOIN_STRING ":" - -#define DEFAULT_WORKFLOW_VERBOSE false - -/* - Some #define symbols used when saving configuration files. -*/ -#define CONFIG_OPTION_FORMAT " %s:%s" -#define CONFIG_FLOAT_OPTION_FORMAT " %s:%g" -#define CONFIG_KEY_FORMAT "%-24s" -#define CONFIG_VALUE_FORMAT " %-32s" -#define CONFIG_FLOAT_FORMAT " %32.4f" /* One size - fits all :-) */ -#define CONFIG_INT_FORMAT " %32d" /* One size - fits all :-) */ -#define CONFIG_SHORT_VALUE_FORMAT " %-12s" -#define CONFIG_ENDVALUE_FORMAT " %-32s\n" -#define CONFIG_COMMENT_FORMAT "-- %s\n" -#define CONFIG_COMMENTLINE_FORMAT "----------------------------------------------------------------------\n" - - - -/* The magic string used to signal that *ALL* static keywords should be included. */ -#define DEFAULT_ALL_STATIC_KW "ERT_ALL" -#define NUM_STATIC_KW 56 - -/* - The whole thing is defined as one literal - just because I don't - understand C-linkage. -*/ -#define DEFAULT_STATIC_KW (const char *[NUM_STATIC_KW]) { \ - "ACAQ", \ - "ACAQNUM", \ - "DOUBHEAD", \ - "ENDSOL", \ - "HIDDEN", \ - "IAAQ", \ - "ICAQ", \ - "ICAQNUM", \ - "ICON", \ - "IGRP", \ - "ILBR", \ - "ILBS", \ - "INTEHEAD", \ - "ISEG", \ - "ISTHG", \ - "ISTHW", \ - "IWEL", \ - "LOGIHEAD", \ - "PRESSURE", \ - "RS", \ - "RSEG", \ - "RV", \ - "SAAQ", \ - "SCAQ", \ - "SCAQNUM", \ - "SCON", \ - "SGAS", \ - "SGRP", \ - "STARTSOL", \ - "SWAT", \ - "SWEL", \ - "XAAQ", \ - "XCON", \ - "XGRP", \ - "XWEL", \ - "ZGRP", \ - "ZWEL", \ - "ENDLGR", \ - "LGR", \ - "LGRHEADD", \ - "LGRHEADI", \ - "LGRHEADQ", \ - "LGRNAMES", \ - "EOWC" , \ - "IOWC" , \ - "OWC" , \ - "ZNODE" , \ - "INODE" , \ - "RNODE" , \ - "LGWEL" , \ - "IBRAN" , \ - "INOBR" , \ - "RBRAN" , \ - "PRESROCC", \ - "REGDIMS" , \ - "THRESHPR"} - - - -/* - The string added at the beginning and end of string which should be - replaced with the template parser. -*/ - -#define DEFAULT_START_TAG "<" -#define DEFAULT_END_TAG ">" - -#define DEFAULT_MANUAL_URL "http://ert.nr.no/ert/index.php/User_Manual" -#define DEFAULT_BROWSER "firefox" - -/*****************************************************************/ - -#define DEFAULT_VAR_DIR "/tmp/ert/var/run/ert" - -/*****************************************************************/ -/* file system spesific defaults. */ - -/** - Name of the default case. -*/ - -#define CASE_LOG "case-log" -#define CURRENT_CASE "current" -#define DEFAULT_CASE "default" -#define CURRENT_CASE_FILE "current_case" - -#define DEFAULT_PLAIN_NODE_PARAMETER_PATH "tstep/%04d/mem%03d/Parameter" -#define DEFAULT_PLAIN_NODE_STATIC_PATH "tstep/%04d/mem%03d/Static" -#define DEFAULT_PLAIN_NODE_DYNAMIC_FORECAST_PATH "tstep/%04d/mem%03d/Forecast" -#define DEFAULT_PLAIN_NODE_DYNAMIC_ANALYZED_PATH "tstep/%04d/mem%03d/Analyzed" -#define DEFAULT_PLAIN_NODE_INDEX_PATH "tstep/%04d/mem%03d/Index" - -#define DEFAULT_PLAIN_VECTOR_PARAMETER_PATH "vectors/mem%03d/Parameter" -#define DEFAULT_PLAIN_VECTOR_STATIC_PATH "vectors/mem%03d/Static" -#define DEFAULT_PLAIN_VECTOR_DYNAMIC_FORECAST_PATH "vectors/mem%03d/Forecast" -#define DEFAULT_PLAIN_VECTOR_DYNAMIC_ANALYZED_PATH "vectors/mem%03d/Analyzed" -#define DEFAULT_PLAIN_VECTOR_INDEX_PATH "vectors/mem%03d/Index" - - -#define DEFAULT_CASE_PATH "%s/files" // mountpoint -#define DEFAULT_CASE_MEMBER_PATH "%s/mem%03d/files" // mountpoint/member -#define DEFAULT_CASE_TSTEP_PATH "%s/%04d/files" // mountpoint/tstep -#define DEFAULT_CASE_TSTEP_MEMBER_PATH "%s/%04d/mem%03d/files" // mountpoint/tstep/member -// mountpoint = ENSPATH/case - - - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_fs.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_fs.h deleted file mode 100644 index 1dbe607810..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_fs.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_fs.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_FS_H -#define ERT_ENKF_FS_H -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - const char * enkf_fs_get_mount_point( const enkf_fs_type * fs ); - const char * enkf_fs_get_root_path( const enkf_fs_type * fs ); - const char * enkf_fs_get_case_name( const enkf_fs_type * fs ); - bool enkf_fs_is_read_only(const enkf_fs_type * fs); - void enkf_fs_fsync( enkf_fs_type * fs ); - void enkf_fs_add_index_node(enkf_fs_type * , int , int , const char * , enkf_var_type, ert_impl_type); - - enkf_fs_type * enkf_fs_get_ref( enkf_fs_type * fs ); - int enkf_fs_decref( enkf_fs_type * fs ); - int enkf_fs_incref( enkf_fs_type * fs ); - int enkf_fs_get_refcount( const enkf_fs_type * fs ); - enkf_fs_type * enkf_fs_mount( const char * path ); - bool enkf_fs_update_disk_version(const char * mount_point , int src_version , int target_version); - int enkf_fs_disk_version(const char * mount_point ); - int enkf_fs_get_version104( const char * path ); - void enkf_fs_fwrite_node(enkf_fs_type * enkf_fs , buffer_type * buffer , const char * node_key, enkf_var_type var_type, - int report_step , int iens); - - void enkf_fs_fwrite_vector(enkf_fs_type * enkf_fs , - buffer_type * buffer , - const char * node_key, - enkf_var_type var_type, - int iens); - - bool enkf_fs_exists( const char * mount_point ); - - void enkf_fs_fread_node(enkf_fs_type * enkf_fs , buffer_type * buffer , - const char * node_key , enkf_var_type var_type , - int report_step , int iens); - - void enkf_fs_fread_vector(enkf_fs_type * enkf_fs , buffer_type * buffer , - const char * node_key , - enkf_var_type var_type , - int iens); - - - bool enkf_fs_has_vector(enkf_fs_type * enkf_fs , const char * node_key , enkf_var_type var_type , int iens); - bool enkf_fs_has_node(enkf_fs_type * enkf_fs , const char * node_key , enkf_var_type var_type , int report_step , int iens); - - void enkf_fs_debug_fprintf( const enkf_fs_type * fs); - - enkf_fs_type * enkf_fs_create_fs( const char * mount_point , fs_driver_impl driver_id , void * arg, bool mount); - - char * enkf_fs_alloc_case_filename( const enkf_fs_type * fs , const char * input_name); - char * enkf_fs_alloc_case_member_filename( const enkf_fs_type * fs , int iens , const char * input_name); - char * enkf_fs_alloc_case_tstep_filename( const enkf_fs_type * fs , int tstep , const char * input_name); - char * enkf_fs_alloc_case_tstep_member_filename( const enkf_fs_type * fs , int tstep , int iens , const char * input_name); - - FILE * enkf_fs_open_case_tstep_member_file( const enkf_fs_type * fs , const char * input_name , int tstep , int iens , const char * mode); - FILE * enkf_fs_open_case_file( const enkf_fs_type * fs , const char * input_name , const char * mode); - FILE * enkf_fs_open_case_tstep_file( const enkf_fs_type * fs , const char * input_name , int tstep , const char * mode); - FILE * enkf_fs_open_case_member_file( const enkf_fs_type * fs , const char * input_name , int iens , const char * mode); - - FILE * enkf_fs_open_excase_tstep_member_file( const enkf_fs_type * fs , const char * input_name , int tstep , int iens); - FILE * enkf_fs_open_excase_file( const enkf_fs_type * fs , const char * input_name); - FILE * enkf_fs_open_excase_tstep_file( const enkf_fs_type * fs , const char * input_name , int tstep ); - FILE * enkf_fs_open_excase_member_file( const enkf_fs_type * fs , const char * input_name , int iens ); - - time_map_type * enkf_fs_alloc_readonly_time_map( const char * mount_point ); - state_map_type * enkf_fs_alloc_readonly_state_map( const char * mount_point ); - summary_key_set_type * enkf_fs_alloc_readonly_summary_key_set( const char * mount_point ); - state_map_type * enkf_fs_get_state_map( const enkf_fs_type * fs ); - time_map_type * enkf_fs_get_time_map( const enkf_fs_type * fs ); - cases_config_type * enkf_fs_get_cases_config( const enkf_fs_type * fs); - misfit_ensemble_type * enkf_fs_get_misfit_ensemble( const enkf_fs_type * fs ); - summary_key_set_type * enkf_fs_get_summary_key_set( const enkf_fs_type * fs ); - custom_kw_config_set_type * enkf_fs_get_custom_kw_config_set( const enkf_fs_type * fs ); - - void enkf_fs_increase_write_count(enkf_fs_type * fs); - void enkf_fs_decrease_write_count(enkf_fs_type * fs); - int enkf_fs_get_write_count(const enkf_fs_type * fs); - - - UTIL_SAFE_CAST_HEADER( enkf_fs ); - UTIL_IS_INSTANCE_HEADER( enkf_fs ); - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_fs_type.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_fs_type.h deleted file mode 100644 index 1192ad60ea..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_fs_type.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_fs_type.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_FS_TYPES_H -#define ERT_ENKF_FS_TYPES_H -typedef struct enkf_fs_struct enkf_fs_type; -#endif - diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_macros.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_macros.h deleted file mode 100644 index 8a7103279a..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_macros.h +++ /dev/null @@ -1,355 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_macros.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_MACROS_H -#define ERT_ENKF_MACROS_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - - - - - -/*****************************************************************/ - -#define VOID_CONFIG_FREE(prefix) void prefix ## _config_free__(void *void_arg) { prefix ## _config_free((prefix ## _config_type *) void_arg); } -#define VOID_CONFIG_FREE_HEADER(prefix) void prefix ## _config_free__(void *); - -/*****************************************************************/ - -#define GET_DATA_SIZE(prefix) int prefix ## _config_get_data_size (const prefix ## _config_type *arg) { return arg->data_size; } -#define GET_DATA_SIZE_HEADER(prefix) int prefix ## _config_get_data_size (const prefix ## _config_type *arg); - -#define VOID_GET_DATA_SIZE(prefix) int prefix ## _config_get_data_size__ (const void * arg) {\ - const prefix ## _config_type * config = prefix ## _config_safe_cast_const( arg ); \ - return prefix ## _config_get_data_size( config ); \ -} -#define VOID_GET_DATA_SIZE_HEADER(prefix) int prefix ## _config_get_data_size__ (const void * arg); - -/*****************************************************************/ - - - -#define VOID_ALLOC(prefix) \ -void * prefix ## _alloc__(const void *void_config) { \ - const prefix ## _config_type * config = prefix ## _config_safe_cast_const( void_config ); \ - return prefix ## _alloc(config); \ -} - -#define VOID_ALLOC_HEADER(prefix) void * prefix ## _alloc__(const void *); - -/*****************************************************************/ - -#define VOID_HAS_DATA(prefix) \ - bool prefix ##_has_data__(const void * void_arg , int report_step) { \ - const prefix ## _type * arg = prefix ## _safe_cast_const( void_arg ); \ - return prefix ## _has_data(arg , report_step); \ -} - -#define VOID_HAS_DATA_HEADER(prefix) bool prefix ##_has_data__(const void * , int); - -/*****************************************************************/ -#define VOID_WRITE_TO_BUFFER(prefix) \ - bool prefix ## _write_to_buffer__(const void * void_arg , buffer_type * buffer , int report_step) { \ - const prefix ## _type * arg = prefix ## _safe_cast_const( void_arg ); \ - return prefix ## _write_to_buffer(arg , buffer , report_step); \ -} - - -#define VOID_READ_FROM_BUFFER(prefix) \ - void prefix ## _read_from_buffer__(void * void_arg , buffer_type * buffer , enkf_fs_type * fs, int report_step) { \ - prefix ## _type * arg = prefix ## _safe_cast( void_arg ); \ - prefix ## _read_from_buffer(arg , buffer , fs, report_step); \ -} - -#define VOID_WRITE_TO_BUFFER_HEADER(prefix) bool prefix ## _write_to_buffer__(const void * , buffer_type * , int); -#define VOID_READ_FROM_BUFFER_HEADER(prefix) void prefix ## _read_from_buffer__(void * , buffer_type * , enkf_fs_type * , int); - -#define VOID_FLOAD(prefix) \ -bool prefix ## _fload__(void * void_arg , const char * filename) { \ - prefix ## _type * arg = prefix ## _safe_cast( void_arg ); \ - return prefix ## _fload(arg , filename); \ -} -#define VOID_FLOAD_HEADER(prefix) bool prefix ## _fload__(void * , const char * ); - - -/*****************************************************************/ - -#define VOID_ECL_WRITE(prefix) \ -void prefix ## _ecl_write__(const void * void_arg , const char * path , const char * file , void * filestream) { \ - const prefix ## _type * arg = prefix ## _safe_cast_const( void_arg ); \ - prefix ## _ecl_write(arg , path , file , filestream); \ -} - -#define VOID_ECL_WRITE_HEADER(prefix) void prefix ## _ecl_write__(const void * , const char * , const char * , void *); - -/*****************************************************************/ - -#define VOID_FORWARD_LOAD(prefix) \ -bool prefix ## _forward_load__(void * void_arg , const char * ecl_file , const forward_load_context_type * load_context) { \ - prefix ## _type * arg = prefix ## _safe_cast( void_arg ); \ - return prefix ## _forward_load(arg , ecl_file , load_context); \ -} - -#define VOID_FORWARD_LOAD_HEADER(prefix) bool prefix ## _forward_load__(void * , const char * , const forward_load_context_type * load_context); - - /*****************************************************************/ - -#define VOID_FORWARD_LOAD_VECTOR(prefix) \ - bool prefix ## _forward_load_vector__(void * void_arg , const char * ecl_file , const forward_load_context_type * load_context, const int_vector_type * time_index) { \ - prefix ## _type * arg = prefix ## _safe_cast( void_arg ); \ - return prefix ## _forward_load_vector(arg , ecl_file ,load_context , time_index); \ -} - -#define VOID_FORWARD_LOAD_VECTOR_HEADER(prefix) bool prefix ## _forward_load_vector__(void * , const char * , const forward_load_context_type * load_context, const int_vector_type * time_index); - - -/*****************************************************************/ - -#define VOID_FREE(prefix) \ -void prefix ## _free__(void * void_arg) { \ - prefix ## _type * arg = prefix ## _safe_cast( void_arg ); \ - prefix ## _free( arg ); \ -} - -#define VOID_FREE_HEADER(prefix) void prefix ## _free__(void * ); - - -/*****************************************************************/ - -#define VOID_USER_GET(prefix) \ -bool prefix ## _user_get__(void * void_arg , const char * key , int report_step , double * value) { \ - prefix ## _type * arg = prefix ## _safe_cast( void_arg ); \ - return prefix ## _user_get(arg , key , report_step, value); \ -} - -#define VOID_USER_GET_HEADER(prefix) bool prefix ## _user_get__(void * , const char * , int, double *); - - -/*****************************************************************/ - -#define VOID_USER_GET_VECTOR(prefix) \ -void prefix ## _user_get_vector__(void * void_arg , const char * key , double_vector_type * value) { \ - prefix ## _type * arg = prefix ## _safe_cast( void_arg ); \ - prefix ## _user_get_vector(arg , key , value); \ -} - -#define VOID_USER_GET_VECTOR_HEADER(prefix) void prefix ## _user_get_vector__(void * , const char * , double_vector_type *); - -/*****************************************************************/ - -#define VOID_USER_GET_OBS(prefix) \ -void prefix ## _user_get__(void * void_arg , const char * key , double * value, double * std, bool * valid) { \ - prefix ## _user_get((prefix ## _type *) void_arg , key , value , std , valid); \ -} - -#define VOID_USER_GET_OBS_HEADER(prefix) void prefix ## _user_get__(void * , const char * , double * , double * , bool *); - - -/*****************************************************************/ - -#define VOID_FREE_DATA(prefix) \ -void prefix ## _free_data__(void * void_arg) { \ - prefix ## _type * arg = prefix ## _safe_cast( void_arg ); \ - prefix ## _free_data( arg ); \ -} - -#define VOID_FREE_DATA_HEADER(prefix) void prefix ## _free_data__(void * ); - -/*****************************************************************/ - -#define VOID_COPY(prefix) \ -void prefix ## _copy__(const void * void_src, void * void_target) { \ - const prefix ## _type * src = prefix ## _safe_cast_const( void_src ); \ - prefix ## _type * target = prefix ## _safe_cast( void_target ); \ - prefix ## _copy( src , target ); \ -} -#define VOID_COPY_HEADER(prefix) void prefix ## _copy__(const void * , void * ); - -/*****************************************************************/ - - -#define CONFIG_GET_ECL_KW_NAME(prefix) const char * prefix ## _config_get_ecl_kw_name(const prefix ## _config_type * config) { return config->ecl_kw_name; } -#define CONFIG_GET_ECL_KW_NAME_HEADER(prefix) const char * prefix ## _config_get_ecl_kw_name(const prefix ## _config_type * ) - - -/*****************************************************************/ - -#define VOID_SERIALIZE(prefix) \ - void prefix ## _serialize__(const void *void_arg, node_id_type node_id , const active_list_type * active_list , matrix_type * A , int row_offset , int column) { \ - const prefix ## _type *arg = prefix ## _safe_cast_const( void_arg ); \ - prefix ## _serialize (arg , node_id , active_list , A , row_offset , column); \ -} -#define VOID_SERIALIZE_HEADER(prefix) void prefix ## _serialize__(const void * , node_id_type , const active_list_type * , matrix_type * , int , int); - - -#define VOID_DESERIALIZE(prefix) \ - void prefix ## _deserialize__(void *void_arg, node_id_type node_id , const active_list_type * active_list , const matrix_type * A , int row_offset , int column) { \ - prefix ## _type *arg = prefix ## _safe_cast( void_arg ); \ - prefix ## _deserialize (arg , node_id , active_list , A , row_offset , column); \ -} -#define VOID_DESERIALIZE_HEADER(prefix) void prefix ## _deserialize__(void * , node_id_type , const active_list_type * , const matrix_type * , int , int); - - - - -/*****************************************************************/ - -#define VOID_INITIALIZE(prefix) \ - bool prefix ## _initialize__(void *void_arg, int iens , const char * init_file, rng_type * rng) { \ - prefix ## _type *arg = prefix ## _safe_cast(void_arg); \ - return prefix ## _initialize (arg , iens , init_file , rng); \ -} -#define VOID_INITIALIZE_HEADER(prefix) bool prefix ## _initialize__(void *, int , const char * , rng_type * ); - -/*****************************************************************/ - -#define VOID_SET_INFLATION(prefix) \ -void prefix ## _set_inflation__( void * void_inflation , const void * void_std , const void * void_min_std) { \ - prefix ## _set_inflation( prefix ## _safe_cast( void_inflation ) , prefix ## _safe_cast_const( void_std ) , prefix ## _safe_cast_const( void_min_std )); \ -} -#define VOID_SET_INFLATION_HEADER(prefix) void prefix ## _set_inflation__( void * void_inflation , const void * void_std , const void * void_min_std ); - - -/*****************************************************************/ - -#define VOID_GET_OBS(prefix) \ -void prefix ## _get_observations__(const void * void_arg , obs_data_type * obs_data, enkf_fs_type * fs, int report_step , const active_list_type * __active_list) { \ - prefix ## _get_observations((prefix ## _type *) void_arg , obs_data , fs, report_step , __active_list); \ -} - -#define VOID_GET_OBS_HEADER(prefix) void prefix ## _get_observations__(const void * , obs_data_type * , enkf_fs_type *, int , const active_list_type * ) - -/*****************************************************************/ - -#define VOID_MEASURE(obs_prefix, state_prefix) \ -void obs_prefix ## _measure__(const void * void_obs , const void * void_state , node_id_type node_id , meas_data_type * meas_data , const active_list_type * __active_list) { \ - const obs_prefix ## _type * obs = obs_prefix ## _safe_cast_const( void_obs ); \ - const state_prefix ## _type * state = state_prefix ## _safe_cast_const( void_state ); \ - obs_prefix ## _measure(obs , state , node_id , meas_data , __active_list); \ -} - -#define VOID_MEASURE_UNSAFE(obs_prefix, state_prefix) \ -void obs_prefix ## _measure__(const void * void_obs , const void * state , node_id_type node_id , meas_data_type * meas_data , const active_list_type * __active_list) { \ - const obs_prefix ## _type * obs = obs_prefix ## _safe_cast_const( void_obs ); \ - obs_prefix ## _measure(obs , state , node_id , meas_data , __active_list); \ -} - - -#define VOID_MEASURE_HEADER(obs_prefix) void obs_prefix ## _measure__(const void * , const void * , node_id_type , meas_data_type * , const active_list_type *) - -/*****************************************************************/ - -#define VOID_UPDATE_STD_SCALE(prefix)\ -void prefix ## _update_std_scale__( void * void_obs , double std_multiplier , const active_list_type * active_list) { \ - prefix ## _type * obs = prefix ## _safe_cast( void_obs ); \ - prefix ## _update_std_scale( obs , std_multiplier , active_list ); \ -} - -#define VOID_UPDATE_STD_SCALE_HEADER(prefix) void prefix ## _update_std_scale__(void * void_obs , double std_multiplier , const active_list_type * active_list); - -/*****************************************************************/ - -#define VOID_CHI2(obs_prefix, state_prefix) \ - double obs_prefix ## _chi2__(const void * void_obs , const void * void_state, node_id_type node_id) { \ - const obs_prefix ## _type * obs = obs_prefix ## _safe_cast_const( void_obs ); \ - return obs_prefix ## _chi2(obs , void_state , node_id); \ -} - -#define VOID_CHI2_HEADER(obs_prefix) double obs_prefix ## _chi2__(const void * , const void *, node_id_type); - - -/*****************************************************************/ - -#define VOID_TRUNCATE(prefix) void prefix ## _truncate__(void * void_arg) { prefix ## _truncate( (prefix ## _type *) void_arg); } -#define VOID_TRUNCATE_HEADER(prefix) void prefix ## _truncate__(void * ) - -/*****************************************************************/ -#define VOID_SCALE(prefix) void prefix ## _scale__(void * void_arg , double scale_factor) { prefix ## _scale( prefix ## _safe_cast( void_arg ) , scale_factor ); } -#define VOID_SCALE_HEADER(prefix) void prefix ## _scale__(void * , double ); - -/*****************************************************************/ - -#define VOID_CLEAR(prefix) void prefix ## _clear__(void * void_arg) { prefix ## _clear( prefix ## _safe_cast( void_arg )); } -#define VOID_CLEAR_HEADER(prefix) void prefix ## _clear__(void * ) - -/*****************************************************************/ - - -#define VOID_ISQRT(prefix) void prefix ## _isqrt__(void * void_arg) { prefix ## _isqrt( prefix ## _safe_cast( void_arg )); } -#define VOID_ISQRT_HEADER(prefix) void prefix ## _isqrt__(void * ) - -/*****************************************************************/ - -#define VOID_IADD(prefix) void prefix ## _iadd__( void * void_arg , const void * void_delta ) { \ - prefix ## _iadd( prefix ## _safe_cast( void_arg ) , prefix ## _safe_cast_const( void_delta ) ); \ -} - -#define VOID_IADD_HEADER(prefix) void prefix ## _iadd__( void * void_arg , const void * void_delta ); - -/*****************************************************************/ - -#define VOID_IMUL(prefix) void prefix ## _imul__( void * void_arg , const void * void_delta ) { \ - prefix ## _imul( prefix ## _safe_cast( void_arg ) , prefix ## _safe_cast_const( void_delta ) ); \ -} - -#define VOID_IMUL_HEADER(prefix) void prefix ## _imul__( void * void_arg , const void * void_delta ); - -/*****************************************************************/ - -#define VOID_IADDSQR(prefix) void prefix ## _iaddsqr__( void * void_arg , const void * void_delta ) { \ - prefix ## _iaddsqr( prefix ## _safe_cast( void_arg ) , prefix ## _safe_cast_const( void_delta ) ); \ -} - -#define VOID_IADDSQR_HEADER(prefix) void prefix ## _iaddsqr__( void * void_arg , const void * void_delta ); - -/*****************************************************************/ - -#define CONFIG_GET_ENSFILE(prefix) const char * prefix ## _config_get_ensfile_ref(const prefix ## _config_type * config) { return config->ensfile; } -#define CONFIG_GET_ECLFILE(prefix) const char * prefix ## _config_get_eclfile_ref(const prefix ## _config_type * config) { return config->eclfile; } -#define CONFIG_GET_ENSFILE_HEADER(prefix) const char * prefix ## _config_get_ensfile_ref(const prefix ## _config_type * ) -#define CONFIG_GET_ECLFILE_HEADER(prefix) const char * prefix ## _config_get_eclfile_ref(const prefix ## _config_type * ) - -/*****************************************************************/ - -#define VOID_IGET(prefix) double prefix ## _iget__(const void * void_arg, int index) { return prefix ## _iget((const prefix ## _type *) void_arg , index); } -#define VOID_IGET_HEADER(prefix) double prefix ## _iget__(const void * , int ) - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_main.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_main.h deleted file mode 100644 index df01172709..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_main.h +++ /dev/null @@ -1,327 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_main.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_MAIN_H -#define ERT_ENKF_MAIN_H -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - /*****************************************************************/ - - typedef struct enkf_main_struct enkf_main_type; - ui_return_type * enkf_main_set_eclbase( enkf_main_type * enkf_main , const char * eclbase_fmt); - ui_return_type * enkf_main_set_data_file( enkf_main_type * enkf_main , const char * data_file ); - void enkf_main_set_user_config_file( enkf_main_type * enkf_main , const char * user_config_file ); - const char * enkf_main_get_user_config_file( const enkf_main_type * enkf_main ); - void enkf_main_set_rft_config_file( enkf_main_type * enkf_main , const char * rft_config_file ); - const char * enkf_main_get_rft_config_file( const enkf_main_type * enkf_main ); - bool enkf_main_get_pre_clear_runpath( const enkf_main_type * enkf_main ); - void enkf_main_set_pre_clear_runpath( enkf_main_type * enkf_main , bool pre_clear_runpath); - bool enkf_main_set_refcase( enkf_main_type * enkf_main , const char * refcase_path); - ui_return_type * enkf_main_validata_refcase( const enkf_main_type * enkf_main , const char * refcase_path); - - ert_templates_type * enkf_main_get_templates( enkf_main_type * enkf_main ); - void enkf_main_set_log_file( enkf_main_type * enkf_main , const char * log_file ); - const char * enkf_main_get_log_file( const enkf_main_type * enkf_main ); - void enkf_main_set_log_level( enkf_main_type * enkf_main , int log_level ); - int enkf_main_get_log_level( const enkf_main_type * enkf_main ); - - member_config_type * enkf_main_iget_member_config(const enkf_main_type * enkf_main , int iens); - void enkf_main_del_unused_static(enkf_main_type * , int ); - const char * enkf_main_get_data_file(const enkf_main_type * ); - const char ** enkf_main_get_well_list_ref(const enkf_main_type * , int *); - - - bool enkf_main_get_endian_swap(const enkf_main_type * ); - bool enkf_main_get_fmt_file(const enkf_main_type * ); - bool enkf_main_has_key(const enkf_main_type * , const char *); - void enkf_main_add_gen_kw(enkf_main_type * , const char * ); - void enkf_main_add_type(enkf_main_type * , const char * , enkf_var_type , ert_impl_type , const char * , const void *); - void enkf_main_add_type0(enkf_main_type * , const char * , int , enkf_var_type , ert_impl_type ); - void enkf_main_add_well(enkf_main_type * , const char * , int , const char ** ); - void enkf_main_analysis(enkf_main_type * ); - void enkf_main_free(enkf_main_type * ); - void enkf_main_exit(enkf_main_type * enkf_main); - void enkf_main_init_eclipse(enkf_main_type * , int , int ); - void enkf_main_init_run( enkf_main_type * enkf_main, const ert_run_context_type * run_context , init_mode_type init_mode); - void enkf_main_load_ecl_init_mt(enkf_main_type * enkf_main , int ); - void enkf_main_load_ecl_complete_mt(enkf_main_type *); - void enkf_main_iload_ecl_mt(enkf_main_type *enkf_main , int ); - - bool enkf_main_UPDATE(enkf_main_type * enkf_main , const int_vector_type * step_list, enkf_fs_type * source_fs, enkf_fs_type * target_fs , int target_step , run_mode_type run_mode); - bool enkf_main_smoother_update(enkf_main_type * enkf_main , enkf_fs_type * source_fs, enkf_fs_type * target_fs); - void enkf_main_create_run_path(enkf_main_type * enkf_main , const bool_vector_type * iactive , int iter); - int enkf_main_run_simple_step( enkf_main_type* enkf_main, bool_vector_type* iactive, init_mode_type init_mode, int iter ); - - void enkf_main_run_tui_exp(enkf_main_type * enkf_main , - bool_vector_type * iactive); - - - void enkf_main_run_smoother(enkf_main_type * enkf_main , enkf_fs_type * source_fs, const char * target_fs_name , bool_vector_type * iactive , int iter , bool rerun); - void enkf_main_run_iterated_ES(enkf_main_type * enkf_main, int num_iterations); - void enkf_main_set_data_kw(enkf_main_type * , const char * , const char *); - void enkf_main_set_state_run_path(const enkf_main_type * , int ); - void enkf_main_set_state_eclbase(const enkf_main_type * , int ); - void enkf_main_interactive_set_runpath__(void * ); - enkf_main_type * enkf_main_bootstrap(const char * model_config, bool strict, bool verbose); - void enkf_main_create_new_config( const char * config_file , const char * storage_path , const char * dbase_type , int num_realizations); - - enkf_node_type ** enkf_main_get_node_ensemble(const enkf_main_type * enkf_main , enkf_fs_type * src_fs , const char * key , int report_step); - void enkf_main_node_mean( const enkf_node_type ** ensemble , int ens_size , enkf_node_type * mean ); - void enkf_main_node_std( const enkf_node_type ** ensemble , int ens_size , const enkf_node_type * mean , enkf_node_type * std); - - ert_impl_type enkf_main_impl_type(const enkf_main_type *, const char * ); - enkf_state_type * enkf_main_iget_state(const enkf_main_type * , int ); - enkf_state_type ** enkf_main_get_ensemble( enkf_main_type * enkf_main); - const enkf_state_type ** enkf_main_get_ensemble_const( const enkf_main_type * enkf_main); - - const enkf_config_node_type * enkf_main_get_config_node(const enkf_main_type * , const char *); - const sched_file_type * enkf_main_get_sched_file(const enkf_main_type *); - ranking_table_type * enkf_main_get_ranking_table( const enkf_main_type * enkf_main ); - ecl_config_type * enkf_main_get_ecl_config(const enkf_main_type * enkf_main); - ensemble_config_type * enkf_main_get_ensemble_config(const enkf_main_type * enkf_main); - int enkf_main_get_ensemble_size( const enkf_main_type * enkf_main ); - int enkf_main_get_history_length( const enkf_main_type * ); - bool enkf_main_has_prediction( const enkf_main_type * ); - //const enkf_sched_type * enkf_main_get_enkf_sched(const enkf_main_type *); - model_config_type * enkf_main_get_model_config( const enkf_main_type * ); - local_config_type * enkf_main_get_local_config( const enkf_main_type * enkf_main ); - config_settings_type * enkf_main_get_plot_config( const enkf_main_type * enkf_main ); - void enkf_main_load_obs( enkf_main_type * enkf_main , const char * obs_config_file , bool clear_existing); - enkf_obs_type * enkf_main_get_obs(const enkf_main_type * ); - bool enkf_main_have_obs( const enkf_main_type * enkf_main ); - analysis_config_type * enkf_main_get_analysis_config(const enkf_main_type * ); - - void * enkf_main_get_enkf_config_node_type(const ensemble_config_type *, const char *); - void enkf_main_set_field_config_iactive(const ensemble_config_type *, int); - const char * enkf_main_get_image_viewer(const enkf_main_type * ); - const char * enkf_main_get_plot_driver(const enkf_main_type * enkf_main ); - const char * enkf_main_get_image_type(const enkf_main_type * enkf_main); - - - - - void enkf_main_list_users( set_type * users , const char * executable ); - const ext_joblist_type * enkf_main_get_installed_jobs( const enkf_main_type * enkf_main ); - - subst_list_type * enkf_main_get_data_kw( const enkf_main_type * enkf_main ); - void enkf_main_clear_data_kw( enkf_main_type * enkf_main ); - site_config_type * enkf_main_get_site_config( const enkf_main_type * enkf_main ); - void enkf_main_resize_ensemble( enkf_main_type * enkf_main , int new_ens_size ); - void enkf_main_get_observations( const enkf_main_type * enkf_main, const char * user_key , int obs_count , time_t * obs_time , double * y , double * std); - int enkf_main_get_observation_count( const enkf_main_type * enkf_main, const char * user_key ); - - keep_runpath_type enkf_main_iget_keep_runpath( const enkf_main_type * enkf_main , int iens ); - void enkf_main_iset_keep_runpath( enkf_main_type * enkf_main , int iens , keep_runpath_type keep_runpath); - - /*****************************************************************/ - void enkf_main_install_SIGNALS(void); - const char * enkf_main_get_SVN_VERSION( void ); - const char * enkf_main_get_COMPILE_TIME( void ); - void enkf_main_del_node(enkf_main_type * enkf_main , const char * key); - void enkf_main_add_node(enkf_main_type * enkf_main, enkf_config_node_type * enkf_config_node); - void enkf_main_update_node( enkf_main_type * enkf_main , const char * key ); - int_vector_type * enkf_main_update_alloc_step_list( const enkf_main_type * enkf_main , int load_start , int step2 , int stride); - - hook_manager_type * enkf_main_get_hook_manager( const enkf_main_type * enkf_main ); - - void enkf_main_get_PC( const matrix_type * S, - const matrix_type * dObs, - double truncation , - int ncomp , - matrix_type * PC , - matrix_type * PC_obs, - double_vector_type * singular_values); - - - void enkf_main_fprintf_PC(const char * filename , - matrix_type * PC , - matrix_type * PC_obs); - - - void enkf_main_set_verbose( enkf_main_type * enkf_main , bool verbose); - bool enkf_main_get_verbose( const enkf_main_type * enkf_main ); - - ert_workflow_list_type * enkf_main_get_workflow_list( enkf_main_type * enkf_main ); - void enkf_main_run_workflows( enkf_main_type * enkf_main , const stringlist_type * workflows); - bool enkf_main_run_workflow( enkf_main_type * enkf_main , const char * workflow); - - enkf_main_type * enkf_main_alloc_empty( ); - - rng_config_type * enkf_main_get_rng_config( const enkf_main_type * enkf_main ); - void enkf_main_rng_init( enkf_main_type * enkf_main); - - bool enkf_main_export_field(const enkf_main_type * enkf_main, - const char * kw, - const char * path, - bool_vector_type * iactive, - field_file_format_type file_type, - int report_step); - - bool enkf_main_export_field_with_fs(const enkf_main_type * enkf_main, - const char * kw, - const char * path, - bool_vector_type * iactive, - field_file_format_type file_type, - int report_step, - enkf_fs_type * fs); - - - int enkf_main_load_from_forward_model_with_fs(enkf_main_type * enkf_main, int iter , bool_vector_type * iactive, stringlist_type ** realizations_msg_list, enkf_fs_type * fs); - int enkf_main_load_from_forward_model(enkf_main_type * enkf_main, int iter , bool_vector_type * iactive, stringlist_type ** realizations_msg_list); - int enkf_main_load_from_forward_model_from_gui(enkf_main_type * enkf_main, int iter , bool_vector_type * iactive, enkf_fs_type * fs); - - void enkf_main_rank_on_observations(enkf_main_type * enkf_main, - const char * ranking_key, - const stringlist_type * obs_ranking_keys, - const int_vector_type * steps); - - - - void enkf_main_rank_on_data(enkf_main_type * enkf_main, - const char * ranking_key, - const char * data_key, - bool sort_increasing, - int step); - - - void enkf_main_export_ranking(enkf_main_type * enkf_main, const char * ranking_key, const char * ranking_file); - - - - - - - - /********* File System / Case Management ********** - Implementation: enkf_main_manage_fs.c */ - - - bool enkf_main_case_is_current(const enkf_main_type * enkf_main , const char * case_path); - char * enkf_main_read_alloc_current_case_name(const enkf_main_type * enkf_main); - stringlist_type * enkf_main_alloc_caselist( const enkf_main_type * enkf_main ); - void enkf_main_set_case_table( enkf_main_type * enkf_main , const char * case_table_file ); - - void enkf_main_initialize_from_scratch(enkf_main_type * enkf_main , - enkf_fs_type * init_fs, - const stringlist_type * param_list , - const bool_vector_type * iens_mask , - init_mode_type init_mode); - - void enkf_main_init_current_case_from_existing(enkf_main_type * enkf_main, - enkf_fs_type * source_case_fs, - int source_report_step); - - void enkf_main_init_current_case_from_existing_custom(enkf_main_type * enkf_main, - enkf_fs_type * source_case_fs, - int source_report_step, - stringlist_type * node_list, - bool_vector_type * iactive); - - - void enkf_main_init_case_from_existing(const enkf_main_type * enkf_main, - enkf_fs_type * source_case_fs, - int source_report_step, - enkf_fs_type * target_case); - - void enkf_main_init_case_from_existing_custom(const enkf_main_type * enkf_main, - enkf_fs_type * source_case_fs, - int source_report_step, - enkf_fs_type * target_case, - stringlist_type * node_list, - bool_vector_type * iactive); - - bool enkf_main_case_is_initialized( const enkf_main_type * enkf_main , - const char * case_name , - bool_vector_type * __mask); - - bool enkf_main_is_initialized( const enkf_main_type * enkf_main ,bool_vector_type * __mask); - - char * enkf_main_alloc_mount_point( const enkf_main_type * enkf_main , const char * case_path); - enkf_fs_type * enkf_main_get_fs(const enkf_main_type * ); - enkf_fs_type * enkf_main_tui_get_fs(const enkf_main_type * ); - enkf_fs_type * enkf_main_job_get_fs(const enkf_main_type * ); - enkf_fs_type * enkf_main_get_fs_ref(const enkf_main_type * enkf_main); - const char * enkf_main_get_current_fs( const enkf_main_type * enkf_main ); - enkf_fs_type * enkf_main_mount_alt_fs(const enkf_main_type * enkf_main , const char * case_path , bool create); - void enkf_main_set_fs( enkf_main_type * enkf_main , enkf_fs_type * fs , const char * case_path ); - void enkf_main_user_select_fs(enkf_main_type * enkf_main , const char * case_path ); - void enkf_main_select_fs( enkf_main_type * enkf_main , const char * case_path ); - bool enkf_main_fs_exists(const enkf_main_type * enkf_main, const char * input_case); - const char * enkf_main_get_mount_root( const enkf_main_type * enkf_main); - - - state_map_type * enkf_main_alloc_readonly_state_map( const enkf_main_type * enkf_main , const char * case_path); - time_map_type * enkf_main_alloc_readonly_time_map( const enkf_main_type * enkf_main , const char * case_path ); - - runpath_list_type * enkf_main_get_runpath_list( const enkf_main_type * enkf_main ); - ert_run_context_type * enkf_main_alloc_ert_run_context_ENSEMBLE_EXPERIMENT(const enkf_main_type * enkf_main , enkf_fs_type * fs , bool_vector_type * iactive , int iter); - ert_init_context_type * enkf_main_alloc_ert_init_context(const enkf_main_type * enkf_main , enkf_fs_type * fs, const bool_vector_type * iactive , init_mode_type init_mode , int iter); - - -UTIL_SAFE_CAST_HEADER(enkf_main); -UTIL_IS_INSTANCE_HEADER(enkf_main); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_main_jobs.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_main_jobs.h deleted file mode 100644 index b57353ca4e..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_main_jobs.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_main_jobs.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ENKF_MAIN_JOBS_H -#define ENKF_MAIN_JOBS_H - -#ifdef __cplusplus -extern "C" { -#endif - - -void * enkf_main_select_case_JOB( void * self , const stringlist_type * args); -void * enkf_main_create_case_JOB( void * self , const stringlist_type * args); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_main_update.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_main_update.h deleted file mode 100644 index e7e3e9d919..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_main_update.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_main_update.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_MAIN_UPDATE -#define ERT_ENKF_MAIN_UPDATE - -#include - -void enkf_main_update(enkf_main_type * enkf_main , int step1 , int step2); - - - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_node.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_node.h deleted file mode 100644 index e1d52b207b..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_node.h +++ /dev/null @@ -1,199 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_node.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_NODE_H -#define ERT_ENKF_NODE_H -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -/**********************************/ - - - typedef void (serialize_ftype) (const void * , node_id_type , const active_list_type * , matrix_type * , int , int); - typedef void (deserialize_ftype) ( void * , node_id_type , const active_list_type * , const matrix_type * , int , int); - - - - - typedef void (ecl_write_ftype) (const void * , /* Node object */ - const char * , /* Directory to write to. */ - const char * , /* Filename - can be NULL. */ - void * ); /* fortio or FILE inistance for writing elements in restart files. */ - - typedef bool (fload_ftype) ( void * , const char *); - typedef void (read_from_buffer_ftype) ( void * , buffer_type * , enkf_fs_type * , int); - typedef bool (write_to_buffer_ftype) (const void * , buffer_type * , int); - typedef bool (has_data_ftype) (const void * , int); - - - typedef void (set_inflation_ftype) (void * , - const void * , /* Node object with the ensemble standard deviation. */ - const void * ); /* Node object with the minimum standard deviation - supplied by the user. */ - - - typedef void (user_get_vector_ftype) (void * , const char * , double_vector_type *); - typedef bool (user_get_ftype) (void * , const char * , int , double *); - typedef void * (alloc_ftype) (const void *); - typedef bool (initialize_ftype) ( void * , int , const char * , rng_type * ); - typedef bool (forward_load_ftype) (void * , const char * , const forward_load_context_type *); - typedef bool (forward_load_vector_ftype) (void * , const char * , const forward_load_context_type *, const int_vector_type *); - typedef void (realloc_data_ftype) (void * ); - typedef void (free_data_ftype) (void * ); - typedef void (node_free_ftype) ( void *); - typedef void (clear_ftype) ( void *); - typedef void (node_copy_ftype) (const void * , void *); - typedef void (isqrt_ftype) ( void *); - typedef void (scale_ftype) ( void * , double); - typedef void (iadd_ftype) ( void * , const void *); - typedef void (imul_ftype) ( void * , const void *); - typedef void (iaddsqr_ftype) ( void * , const void *); - typedef void (ensemble_mulX_vector_ftype) ( void * , int , const void ** , const double *); - - - typedef enum {alloc_func = 0, - ecl_write_func = 1, - forward_load_func = 2, - fread_func = 3, - fwrite_func = 4, - copy_func = 5, - initialize_func = 6, - free_func = 7, - free_data_func = 8, - clear_serial_state_func = 9, - serialize = 10, - deserialize = 11} node_function_type; - - - typedef void (enkf_node_ftype1) (enkf_node_type *); - typedef void (enkf_node_ftype_NEW) (enkf_node_type * , arg_pack_type * ); - - - bool enkf_node_user_get_vector( enkf_node_type * enkf_node , enkf_fs_type * fs , const char * key , int iens , double_vector_type * values); - bool enkf_node_user_get_no_id(enkf_node_type * enkf_node , enkf_fs_type * fs , const char * key , int report_step, int iens, double * value); - bool enkf_node_user_get(enkf_node_type * , enkf_fs_type * , const char * , node_id_type , double * ); - enkf_node_type * enkf_node_deep_alloc(const enkf_config_node_type * config); - enkf_node_type * enkf_node_alloc(const enkf_config_node_type *); - enkf_node_type * enkf_node_copyc(const enkf_node_type * ); - /* - The enkf_node_free() function declaration is in the enkf_config_node.h header, - because the enkf_config_node needs to know how to free the min_std node. - - void enkf_node_free(enkf_node_type *enkf_node); - */ - - bool enkf_node_forward_init(enkf_node_type * enkf_node , const char * run_path , int iens); - bool enkf_node_has_data( enkf_node_type * enkf_node , enkf_fs_type * fs , node_id_type node_id); - //void enkf_node_free_data(enkf_node_type * ); - void enkf_node_free__(void *); - void enkf_initialize(enkf_node_type * , int); - bool enkf_node_include_type(const enkf_node_type * , int ); - void * enkf_node_value_ptr(const enkf_node_type * ); - ert_impl_type enkf_node_get_impl_type(const enkf_node_type * ); - enkf_var_type enkf_node_get_var_type(const enkf_node_type * ); - bool enkf_node_use_forward_init( const enkf_node_type * enkf_node ); - void enkf_node_clear_serial_state(enkf_node_type * ); - void enkf_node_serialize(enkf_node_type * enkf_node , enkf_fs_type * fs , node_id_type node_id , const active_list_type * active_list , matrix_type * A , int row_offset , int column); - void enkf_node_deserialize(enkf_node_type *enkf_node , enkf_fs_type * fs , node_id_type node_id , const active_list_type * active_list , const matrix_type * A , int row_offset , int column); - - bool enkf_node_forward_load_vector(enkf_node_type *enkf_node , const forward_load_context_type * load_context , const int_vector_type * time_index); - bool enkf_node_forward_load (enkf_node_type *, const forward_load_context_type * load_context); - void enkf_node_ecl_write (const enkf_node_type *, const char * , void * , int); - bool enkf_node_initialize(enkf_node_type *enkf_node , int , rng_type * ); - void enkf_node_printf(const enkf_node_type *); - bool enkf_node_fwrite (enkf_node_type * , FILE * stream, bool , int , int); - void enkf_node_clear (enkf_node_type *); - void enkf_node_fread (enkf_node_type * , FILE * stream , int , int); - - void enkf_node_copy_ensemble(const enkf_config_node_type * config_node , - enkf_fs_type * src_case, - enkf_fs_type * target_case , - int report_step_from, /* src state */ - int report_step_to , /* target state */ - int ens_size, - const perm_vector_type * permutations); - - void enkf_node_copy(const enkf_config_node_type * config_node , - enkf_fs_type * src_case , - enkf_fs_type * target_case , - node_id_type src_id , - node_id_type target_id ); - enkf_node_type ** enkf_node_load_alloc_ensemble( const enkf_config_node_type * config_node , enkf_fs_type * fs , - int report_step , int iens1 , int iens2 ); - enkf_node_type * enkf_node_load_alloc( const enkf_config_node_type * config_node , enkf_fs_type * fs , node_id_type node_id); - bool enkf_node_fload( enkf_node_type * enkf_node , const char * filename ); - void enkf_node_load(enkf_node_type * enkf_node , enkf_fs_type * fs , node_id_type node_id ); - void enkf_node_load_vector( enkf_node_type * enkf_node , enkf_fs_type * fs , int iens); - bool enkf_node_store(enkf_node_type * enkf_node , enkf_fs_type * fs , bool force_vectors , node_id_type node_id); - bool enkf_node_store_vector(enkf_node_type *enkf_node , enkf_fs_type * fs , int iens ); - bool enkf_node_try_load(enkf_node_type *enkf_node , enkf_fs_type * fs , node_id_type node_id); - bool enkf_node_try_load_vector(enkf_node_type *enkf_node , enkf_fs_type * fs , int iens ); - bool enkf_node_exists( enkf_node_type *enkf_node , enkf_fs_type * fs , int report_step , int iens); - bool enkf_node_vector_storage( const enkf_node_type * node ); - enkf_node_type * enkf_node_alloc_shared_container(const enkf_config_node_type * config, hash_type * node_hash); - enkf_node_type * enkf_node_alloc_private_container(const enkf_config_node_type * config); -/*****************************************************************/ -/* Function callbacks */ -ecl_write_ftype * enkf_node_get_func_pointer( const enkf_node_type * node ); - - - -void enkf_node_set_inflation( enkf_node_type * inflation , const enkf_node_type * std , const enkf_node_type * min_std); -void enkf_node_sqrt(enkf_node_type *enkf_node); -void enkf_node_scale(enkf_node_type * , double ); -void enkf_node_iadd(enkf_node_type * , const enkf_node_type * ); -void enkf_node_iaddsqr(enkf_node_type * , const enkf_node_type * ); -void enkf_node_imul(enkf_node_type * , const enkf_node_type * ); -const enkf_config_node_type * enkf_node_get_config(const enkf_node_type * ); -const char * enkf_config_node_get_infile(const enkf_config_node_type * ); -const char * enkf_node_get_key(const enkf_node_type * ); -const char * enkf_node_get_swapfile(const enkf_node_type *); -bool enkf_node_has_func(const enkf_node_type * , node_function_type ); -bool enkf_node_internalize(const enkf_node_type * , int ); - -void enkf_node_upgrade_file_103( const char * path , const char * file , ert_impl_type impl_type , int perc_complete , msg_type * msg); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_obs.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_obs.h deleted file mode 100644 index fd23a65269..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_obs.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_obs.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_OBS_H -#define ERT_ENKF_OBS_H -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include -#include -#include -#include - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - - bool enkf_obs_have_obs( const enkf_obs_type * enkf_obs ); - enkf_obs_type * enkf_obs_alloc( const history_type * history , - time_map_type * external_time_map , - const ecl_grid_type * grid , - const ecl_sum_type * refcase, - ensemble_config_type * ensemble_config ); - - void enkf_obs_free( enkf_obs_type * enkf_obs); - - obs_vector_type * enkf_obs_iget_vector(const enkf_obs_type * obs, int index); - obs_vector_type * enkf_obs_get_vector(const enkf_obs_type * , const char * ); - void enkf_obs_add_obs_vector(enkf_obs_type * enkf_obs, - const obs_vector_type * vector); - - bool enkf_obs_load(enkf_obs_type * enkf_obs, - const char * config_file, - double std_cutoff); - void enkf_obs_clear( enkf_obs_type * enkf_obs ); - - void enkf_obs_get_obs_and_measure_node( const enkf_obs_type * enkf_obs, - enkf_fs_type * fs, - const local_obsdata_node_type * obs_node , - const int_vector_type * ens_active_list , - meas_data_type * meas_data, - obs_data_type * obs_data); - - - void enkf_obs_get_obs_and_measure_data(const enkf_obs_type * enkf_obs, - enkf_fs_type * fs, - const local_obsdata_type * local_obsdata , - const int_vector_type * ens_active_list , - meas_data_type * meas_data, - obs_data_type * obs_data); - - - stringlist_type * enkf_obs_alloc_typed_keylist( enkf_obs_type * enkf_obs , obs_impl_type ); - hash_type * enkf_obs_alloc_data_map(enkf_obs_type * enkf_obs); - - const obs_vector_type * enkf_obs_user_get_vector(const enkf_obs_type * obs , const char * full_key, char ** index_key ); - bool enkf_obs_has_key(const enkf_obs_type * , const char * ); - int enkf_obs_get_size( const enkf_obs_type * obs ); - - hash_iter_type * enkf_obs_alloc_iter( const enkf_obs_type * enkf_obs ); - - stringlist_type * enkf_obs_alloc_keylist(enkf_obs_type * enkf_obs ); - stringlist_type * enkf_obs_alloc_matching_keylist(const enkf_obs_type * enkf_obs , const char * input_string); - time_t enkf_obs_iget_obs_time(const enkf_obs_type * enkf_obs , int report_step); - void enkf_obs_scale_std(enkf_obs_type * enkf_obs, double scale_factor); - void enkf_obs_local_scale_std( const enkf_obs_type * enkf_obs , const local_obsdata_type * local_obsdata, double scale_factor); - void enkf_obs_add_local_nodes_with_data(const enkf_obs_type * enkf_obs , local_obsdata_type * local_obs , enkf_fs_type *fs , const bool_vector_type * ens_mask); - double enkf_obs_scale_correlated_std(const enkf_obs_type * enkf_obs , enkf_fs_type * fs , const int_vector_type * ens_active_list , const local_obsdata_type * local_obsdata); - local_obsdata_type * enkf_obs_alloc_all_active_local_obs( const enkf_obs_type * enkf_obs , const char * key); - - UTIL_IS_INSTANCE_HEADER( enkf_obs ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_plot_data.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_plot_data.h deleted file mode 100644 index d1e619a1b9..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_plot_data.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'enkf_plot_data.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#ifndef ERT_ENKF_PLOT_DATA_H -#define ERT_ENKF_PLOT_DATA_H - -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include -#include - -#include -#include -#include -#include - - typedef struct enkf_plot_data_struct enkf_plot_data_type; - - enkf_plot_data_type * enkf_plot_data_alloc( const enkf_config_node_type * config_node ); - void enkf_plot_data_free( enkf_plot_data_type * plot_data ); - void enkf_plot_data_load( enkf_plot_data_type * plot_data , - enkf_fs_type * fs , - const char * user_key , - const bool_vector_type * input_mask); - int enkf_plot_data_get_size( const enkf_plot_data_type * plot_data ); - enkf_plot_tvector_type * enkf_plot_data_iget( const enkf_plot_data_type * plot_data , int index); - - UTIL_IS_INSTANCE_HEADER( enkf_plot_data ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_plot_gen_kw.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_plot_gen_kw.h deleted file mode 100644 index 6819d0464e..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_plot_gen_kw.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_plot_gen_kw.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#ifndef ERT_ENKF_PLOT_GEN_KW_H -#define ERT_ENKF_PLOT_GEN_KW_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -#include -#include - - typedef struct enkf_plot_gen_kw_struct enkf_plot_gen_kw_type; - - enkf_plot_gen_kw_type * enkf_plot_gen_kw_alloc( const enkf_config_node_type * enkf_config_node); - void enkf_plot_gen_kw_free( enkf_plot_gen_kw_type * gen_kw ); - int enkf_plot_gen_kw_get_size( const enkf_plot_gen_kw_type * gen_kw ); - enkf_plot_gen_kw_vector_type * enkf_plot_gen_kw_iget( const enkf_plot_gen_kw_type * vector , int index); - void enkf_plot_gen_kw_load( enkf_plot_gen_kw_type * gen_kw , - enkf_fs_type * fs , - bool transform_data , - int report_step , - const bool_vector_type * input_mask); - - const char * enkf_plot_gen_kw_iget_key( const enkf_plot_gen_kw_type * plot_gen_kw, int index); - int enkf_plot_gen_kw_get_keyword_count( const enkf_plot_gen_kw_type * gen_kw ); - bool enkf_plot_gen_kw_should_use_log_scale(const enkf_plot_gen_kw_type * gen_kw , int index); - - UTIL_IS_INSTANCE_HEADER( enkf_plot_gen_kw ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_plot_gen_kw_vector.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_plot_gen_kw_vector.h deleted file mode 100644 index 8e659306e0..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_plot_gen_kw_vector.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_plot_gen_kw.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#ifndef ERT_ENKF_PLOT_GEN_KW_VECTOR_H -#define ERT_ENKF_PLOT_GEN_KW_VECTOR_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include - - typedef struct enkf_plot_gen_kw_vector_struct enkf_plot_gen_kw_vector_type; - - enkf_plot_gen_kw_vector_type * enkf_plot_gen_kw_vector_alloc( const enkf_config_node_type * config_node , int iens ); - void enkf_plot_gen_kw_vector_free( enkf_plot_gen_kw_vector_type * vector ); - int enkf_plot_gen_kw_vector_get_size( const enkf_plot_gen_kw_vector_type * vector ); - void enkf_plot_gen_kw_vector_reset( enkf_plot_gen_kw_vector_type * vector ); - void enkf_plot_gen_kw_vector_load( enkf_plot_gen_kw_vector_type * vector , enkf_fs_type * fs , bool transform_data , int report_step ); - void * enkf_plot_gen_kw_vector_load__( void * arg ); - double enkf_plot_gen_kw_vector_iget( const enkf_plot_gen_kw_vector_type * vector , int index); - - UTIL_IS_INSTANCE_HEADER( enkf_plot_gen_kw_vector ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_plot_gendata.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_plot_gendata.h deleted file mode 100644 index d2a4ecd16a..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_plot_gendata.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_plot_gendata.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_PLOT_GENDATA_H -#define ERT_ENKF_PLOT_GENDATA_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include -#include -#include -#include - - - -typedef struct enkf_plot_gendata_struct enkf_plot_gendata_type; - -enkf_plot_gendata_type * enkf_plot_gendata_alloc( const enkf_config_node_type * enkf_config_node); -enkf_plot_gendata_type * enkf_plot_gendata_alloc_from_obs_vector( const obs_vector_type * obs_vector ); -void enkf_plot_gendata_free( enkf_plot_gendata_type * data ); -int enkf_plot_gendata_get_size( const enkf_plot_gendata_type * data ); -enkf_plot_genvector_type * enkf_plot_gendata_iget( const enkf_plot_gendata_type * plot_data , int index); -void enkf_plot_gendata_load( enkf_plot_gendata_type * plot_data , - enkf_fs_type * fs , - int report_step , - const bool_vector_type * input_mask); - -double_vector_type * enkf_plot_gendata_get_min_values(enkf_plot_gendata_type * plot_data); -double_vector_type * enkf_plot_gendata_get_max_values(enkf_plot_gendata_type * plot_data); - - -UTIL_IS_INSTANCE_HEADER( enkf_plot_gendata ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_plot_genvector.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_plot_genvector.h deleted file mode 100644 index 0cf27d665c..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_plot_genvector.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_plot_genvector.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_PLOT_GENVECTOR_H -#define ERT_ENKF_PLOT_GENVECTOR_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include - -typedef struct enkf_plot_genvector_struct enkf_plot_genvector_type; - -enkf_plot_genvector_type * enkf_plot_genvector_alloc( const enkf_config_node_type * enkf_config_node , int iens); -void enkf_plot_genvector_free( enkf_plot_genvector_type * vector ); -int enkf_plot_genvector_get_size( const enkf_plot_genvector_type * vector ); -void enkf_plot_genvector_reset( enkf_plot_genvector_type * vector ); - void * enkf_plot_genvector_load__( void * arg ); -double enkf_plot_genvector_iget( const enkf_plot_genvector_type * vector , int index); - -UTIL_IS_INSTANCE_HEADER( enkf_plot_genvector ); - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_plot_tvector.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_plot_tvector.h deleted file mode 100644 index c23f1ddf7a..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_plot_tvector.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'enkf_plot_tvector.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#ifndef ERT_ENKF_PLOT_TVECTOR_H -#define ERT_ENKF_PLOT_TVECTOR_H - -#ifdef __cplusplus -extern "C" { -#endif -#include -#include - -#include - -#include -#include -#include - - typedef struct enkf_plot_tvector_struct enkf_plot_tvector_type; - - UTIL_SAFE_CAST_HEADER( enkf_plot_tvector ); - UTIL_IS_INSTANCE_HEADER( enkf_plot_tvector ); - - - - void enkf_plot_tvector_reset( enkf_plot_tvector_type * plot_tvector ); - enkf_plot_tvector_type * enkf_plot_tvector_alloc( const enkf_config_node_type * config_node , int iens); - void enkf_plot_tvector_load( enkf_plot_tvector_type * plot_tvector , enkf_fs_type * fs , const char * user_key ); - void * enkf_plot_tvector_load__( void * arg ); - void enkf_plot_tvector_free( enkf_plot_tvector_type * plot_tvector ); - void enkf_plot_tvector_iset( enkf_plot_tvector_type * plot_tvector , int index , time_t time , double value); - - int enkf_plot_tvector_size( const enkf_plot_tvector_type * plot_tvector ); - double enkf_plot_tvector_iget_value( const enkf_plot_tvector_type * plot_tvector , int index); - time_t enkf_plot_tvector_iget_time( const enkf_plot_tvector_type * plot_tvector , int index); - bool enkf_plot_tvector_iget_active( const enkf_plot_tvector_type * plot_tvector , int index); - bool enkf_plot_tvector_all_active( const enkf_plot_tvector_type * plot_tvector ); - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_serialize.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_serialize.h deleted file mode 100644 index 5db999ac9a..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_serialize.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_serialize.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_SERIALIZE_H -#define ERT_ENKF_SERIALIZE_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include - -#include - -#include - - - - -void enkf_matrix_serialize(const void * __node_data , - int node_size , - ecl_type_enum node_type , - const active_list_type * __active_list , - matrix_type * A, - int row_offset, - int column); - - -void enkf_matrix_deserialize(void * __node_data , - int node_size , - ecl_type_enum node_type , - const active_list_type * __active_list , - const matrix_type * A, - int row_offset, - int column); - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_state.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_state.h deleted file mode 100644 index 2f67e700ba..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_state.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_state.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_STATE_H -#define ERT_ENKF_STATE_H -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include -#include -#include -#include -#include - - -#include - -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -typedef struct enkf_state_struct enkf_state_type; - - bool enkf_state_get_pre_clear_runpath( const enkf_state_type * enkf_state ); - void enkf_state_set_pre_clear_runpath( enkf_state_type * enkf_state , bool pre_clear_runpath ); - - keep_runpath_type enkf_state_get_keep_runpath( const enkf_state_type * enkf_state ); - void enkf_state_set_keep_runpath( enkf_state_type * enkf_state , keep_runpath_type keep_runpath); - keep_runpath_type member_config_get_keep_runpath(const member_config_type * member_config); - //void * enkf_state_complete_forward_model__(void * arg ); - void * enkf_state_load_from_forward_model_mt( void * arg ); - void enkf_state_initialize(enkf_state_type * enkf_state , enkf_fs_type * fs, const stringlist_type * param_list , init_mode_type init_mode); - void enkf_state_fread(enkf_state_type * , enkf_fs_type * fs , int , int ); - void enkf_state_swapout_node(const enkf_state_type * , const char *); - void enkf_state_swapin_node(const enkf_state_type * , const char *); - void enkf_state_iset_eclpath(enkf_state_type * , int , const char *); - enkf_node_type * enkf_state_get_node(const enkf_state_type * , const char * ); - bool enkf_state_has_node(const enkf_state_type * enkf_state , const char * node_key); - void enkf_state_del_node(enkf_state_type * , const char * ); - void enkf_state_load_ecl_summary(enkf_state_type * , bool , int ); - void * enkf_state_run_eclipse__(void * ); - void * enkf_state_start_forward_model__(void * ); - - int enkf_state_load_from_forward_model(enkf_state_type * enkf_state , - run_arg_type * run_arg , - stringlist_type * msg_list); - - int enkf_state_forward_init(enkf_state_type * enkf_state , - run_arg_type * run_arg); - - void enkf_state_init_eclipse(enkf_state_type *enkf_state, const run_arg_type * run_arg ); - - enkf_state_type * enkf_state_alloc(int , - rng_type * main_rng , - const char * casename , - bool pre_clear_runpath, - keep_runpath_type , - model_config_type * , - ensemble_config_type * , - const site_config_type * , - const ecl_config_type * , - ert_templates_type * templates, - subst_list_type * parent_subst); - void enkf_state_update_node( enkf_state_type * enkf_state , const char * node_key ); - void enkf_state_update_jobname( enkf_state_type * enkf_state ); - void enkf_state_update_eclbase( enkf_state_type * enkf_state ); - void enkf_state_add_node(enkf_state_type * , const char * , const enkf_config_node_type * ); - enkf_node_type * enkf_state_get_or_create_node(enkf_state_type * enkf_state, const enkf_config_node_type * config_node); - void enkf_state_load_ecl_restart(enkf_state_type * , bool , int ); - void enkf_state_sample(enkf_state_type * , int); - void enkf_state_fwrite(const enkf_state_type * , enkf_fs_type * fs , int , int ); - void enkf_state_ens_read( enkf_state_type * , const char * , int); - void enkf_state_ecl_write(enkf_state_type *, const run_arg_type * run_arg , enkf_fs_type * fs); - void enkf_state_free(enkf_state_type * ); - void enkf_state_apply(enkf_state_type * , enkf_node_ftype1 * , int ); - void enkf_state_serialize(enkf_state_type * , size_t); - void enkf_state_set_iens(enkf_state_type * , int ); - int enkf_state_get_iens(const enkf_state_type * ); - member_config_type *enkf_state_get_member_config(const enkf_state_type * enkf_state); - const char * enkf_state_get_run_path(const enkf_state_type * ); - const char * enkf_state_get_eclbase( const enkf_state_type * enkf_state ); - void enkf_state_printf_subst_list(enkf_state_type * enkf_state , int step1 , int step2); - - rng_type * enkf_state_get_rng( const enkf_state_type * enkf_state ); - unsigned int enkf_state_get_random( enkf_state_type * enkf_state ); - run_status_type enkf_state_get_simple_run_status(const enkf_state_type * state); - void enkf_state_add_subst_kw(enkf_state_type * enkf_state , const char * kw , const char * value , const char * doc_string); - subst_list_type * enkf_state_get_subst_kw( enkf_state_type * enkf_state ); - const ensemble_config_type * enkf_state_get_ensemble_config( const enkf_state_type * enkf_state ); - -/******************************************************************/ -/* Forward model callbacks: */ - -bool enkf_state_complete_forward_modelOK__(void * arg ); -bool enkf_state_complete_forward_modelRETRY__(void * arg ); -bool enkf_state_complete_forward_modelEXIT__(void * arg ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_types.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_types.h deleted file mode 100644 index fdef2ec2a2..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_types.h +++ /dev/null @@ -1,253 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_types.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_TYPES_H -#define ERT_ENKF_TYPES_H -#ifdef __cplusplus -extern "C" { -#endif - - - - - -/* - This enum signals the three different states a "cell" in - observation/data node can be in: - - ACTIVE: The cell is active and should be used/updated in EnKF - analysis. - - LOCAL_INACTIVE: The cell is not included in the current local - analysis ministep - - DEACTIVATED: The cell has been deactivated by the functionality - deactivating outliers. - -*/ - -typedef enum { ACTIVE = 1, - LOCAL_INACTIVE = 2, /* Not active in current local update scheme. */ - DEACTIVATED = 3, /* Deactivaed due to to small overlap, or... */ - MISSING = 4} active_type; /* Set as missing by the forward model. */ - - - -/* - The enkf_var_type enum defines logical groups of variables. All - variables in the same group, i.e. 'parameter' are typically treated - in the same manner. So the reason for creating this type is to be - able to say for instance: "Load all dynamic_state variables". - - Observe that these are used as bitmask's, i.e. the numerical values - must be a power of 2 series. -*/ - -typedef enum {INVALID_VAR = 0 , /* */ - PARAMETER = 1 , /* A parameter which is updated with enkf: PORO , MULTFLT , ..*/ - DYNAMIC_STATE = 2 , /* Dynamic data which are needed for a restart - i.e. pressure and saturations. */ - DYNAMIC_RESULT = 4 , /* Dynamic results which are NOT needed for a restart - i.e. well rates. */ - INDEX_STATE = 16 } /* Index data - enum value is used for storage classification */ -enkf_var_type; - - - -typedef enum { DEFAULT_KEEP = 0, /* Remove for enkf assimilation - keep for ensemble experiments. */ - EXPLICIT_DELETE = 1, /* Remove unconditionally */ - EXPLICIT_KEEP = 2} /* keep unconditionally */ -keep_runpath_type; - - - - - -/* - ert_impl_type are the actual node implementation types. Observe - that one ert_impl_type can be used in several ways as - enkf_var_type. For instance the pressure is implemented with a - field, and behaves as a dynamic_state variable, on the other hand - the permeability is also implemented as a field, but this is a - parameter. - - These correspond to implementation types. The numbers are on disk, - and should **NOT BE UPDATED**. The ERT_MIN_TYPE and MAX_TYPE - identifiers are needed for the block_fs_driver. -*/ - - - -typedef enum {INVALID = 0 , - IMPL_TYPE_OFFSET = 100 , - FIELD = 104 , /* WELL has been removed */ - GEN_KW = 107 , /* RELPERM has been removed & HAVANA_FAULT */ - CUSTOM_KW = 108 , - SUMMARY = 110 , /* TPGZONE has been removed */ - GEN_DATA = 113 , /* PILOT_POINT has been removed */ - SURFACE = 114 , - CONTAINER = 115 } ert_impl_type; - - - -/* - Should update the functions enkf_types_get_impl_name() and - enkf_types_get_impl_type__() when this enum is updated. - In addition to enkf_config_add_type(). -*/ - - - - - -typedef enum { REPORT_STEP_INCOMPATIBLE = 1, - LOAD_FAILURE = 2} enkf_fw_load_result_enum; - - - - - - - /** - These are 2^n bitmasks. - */ - -typedef enum { TRUNCATE_NONE = 0, - TRUNCATE_MIN = 1, - TRUNCATE_MAX = 2 } truncation_type; - - - - -/** - This enum is used to differentiate between different types of - run. The point is that depending on this mode we can be more or - less restrictive on the amount of input we require from the user. - - In mode enkf_assimlation ( which is the default ), we require quite - a lot of info, whereas in the case screening_experiment we require - less. - - screening_experiment: - - SIZE - - RUNPATH - - ECLBASE - - SCHEDULE_FILE - - DATA_FILE - - FORWARD_MODEL. - - ensemble_experiment: - - ENSPATH - - INIT_FILE (or estimation of EQUIL) - - enkf_assmilation: - - RESULT_PATH - -*/ - -typedef enum { //ENKF_ASSIMILATION = 1, - ENSEMBLE_EXPERIMENT = 2, - SMOOTHER_UPDATE = 4 , - INIT_ONLY = 8 } run_mode_type; - - -#define ENKF_RUN_ENUM_DEFS {.value = 1 , .name = "ENKF_ASSIMILATION"}, \ - {.value = 2 , .name = "ENSEMBLE_EXPERIMENT"} - -#define ENKF_RUN_ENUM_SIZE 2 - - - -/** - This enum enumerates the different types of inflation which should - be used. Observe that the actual variable used is not en enum - instance, but rather an ordinary integer which is in general a sum - of of the values listed in this enum. -*/ - - - typedef enum { NO_INFLATION = 0, - SCALAR_INFLATION = 1, - LOCAL_INFLATION = 2} inflation_mode_type; - - - - typedef enum { JOB_NOT_STARTED = 0, - JOB_SUBMITTED = 1, // This implies that it has been submitted to the internal queue system; we don't know if it is actually running or not. - JOB_RUN_FAILURE = 2, - JOB_LOAD_FAILURE = 3, - JOB_RUN_OK = 4 } run_status_type; - - -/*****************************************************************/ - -/** - This enum is used when we are setting up the dependencies between - observations and variables. The modes all_active and inactive are - sufficient information, for the values partly active we need - additional information. - - The same type is used both for variables (PRESSURE/PORO/MULTZ/...) - and for observations. -*/ - -typedef enum { - ALL_ACTIVE = 1, /* The variable/observation is fully active, i.e. all cells/all faults/all .. */ - INACTIVE = 2, /* Fully inactive */ - PARTLY_ACTIVE = 3 /* Partly active - must supply additonal type spesific information on what is active.*/ -} active_mode_type; - - - typedef struct { - int report_step; - int iens; - } node_id_type; - - - -/*****************************************************************/ -/* Possible transitions: */ - typedef enum { - STATE_UNDEFINED = 1, - STATE_INITIALIZED = 2, - STATE_HAS_DATA = 4, - STATE_LOAD_FAILURE = 8, - STATE_PARENT_FAILURE = 16 - } realisation_state_enum; - - - typedef enum { - INIT_NONE = 0, - INIT_CONDITIONAL = 1, - INIT_FORCE = 2 - } init_mode_type; - - - -typedef struct enkf_obs_struct enkf_obs_type; - - - - -const char * enkf_types_get_var_name(enkf_var_type var_type); -ert_impl_type enkf_types_get_impl_type(const char * ); -const char * enkf_types_get_impl_name(ert_impl_type ); -ert_impl_type enkf_types_check_impl_type(const char * ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_util.h b/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_util.h deleted file mode 100644 index 32130b5436..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/enkf_util.h +++ /dev/null @@ -1,349 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_util.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENKF_UTIL_H -#define ERT_ENKF_UTIL_H -#ifdef __cplusplus -extern "C" { -#endif -#include -#include -#include - -#include -#include - -#include - -#include - -/*****************************************************************/ - -/** - These math functions assume that the underlying data implementation - is double or float - will NOT work for fields. -*/ - - - -#define SQR_FUNC(prefix) \ -void prefix ## _isqr(void * void_arg) { \ -prefix ## _type *arg = (prefix ## _type *) void_arg;\ -const int data_size = prefix ## _config_get_data_size(arg->config); \ -int i; \ -for (i=0; i < data_size; i++) \ - arg->data[i] = arg->data[i]*arg->data[i]; \ -} -#define SQR_FUNC_VOID_HEADER(prefix) void prefix ## _isqr(void * ) -#define SQR_FUNC_HEADER(prefix) void prefix ## _isqr(prefix ## _type *) -#define SQR_FUNC_SCALAR(prefix) void prefix ## _isqr(void * void_arg) { scalar_isqr(((prefix ## _type *) void_arg)->scalar); } - - -/*****************************************************************/ - -#define SQRT_FUNC(prefix) \ -void prefix ## _isqrt(void * void_arg) { \ -prefix ## _type *arg = (prefix ## _type *) void_arg;\ -const int data_size = prefix ## _config_get_data_size(arg->config); \ -int i; \ -for (i=0; i < data_size; i++) \ - arg->data[i] = sqrt(arg->data[i]); \ -} -#define SQRT_FUNC_VOID_HEADER(prefix) void prefix ## _isqrt(void * ) -#define SQRT_FUNC_HEADER(prefix) void prefix ## _isqrt(prefix ## _type* ) -#define SQRT_FUNC_SCALAR(prefix) void prefix ## _isqrt(void * void_arg) { scalar_isqrt(((prefix ## _type *) void_arg)->scalar); } - - -/*****************************************************************/ - -#define SCALE_FUNC(prefix) \ -void prefix ## _iscale(void *void_arg , double scale_factor) { \ -prefix ## _type *arg = (prefix ## _type *) void_arg; \ -const int data_size = prefix ## _config_get_data_size(arg->config); \ -int i; \ -for (i=0; i < data_size; i++) \ - arg->data[i] *= scale_factor; \ -} -#define SCALE_FUNC_SCALAR(prefix) void prefix ## _iscale(void * void_arg, double scale_factor) { scalar_iscale(((prefix ## _type *) void_arg)->scalar , scale_factor); } -#define SCALE_FUNC_VOID_HEADER(prefix) void prefix ## _iscale(void * , double) -#define SCALE_FUNC_HEADER(prefix) void prefix ## _iscale(prefix ## _type * , double) - -/*****************************************************************/ - -#define RESET_FUNC(prefix) \ -void prefix ## _ireset(void *void_arg) { \ -prefix ## _type *arg = (prefix ## _type *) void_arg; \ -const int data_size = prefix ## _config_get_data_size(arg->config); \ -int i; \ -for (i=0; i < data_size; i++) \ - arg->data[i] = 0; \ -} -#define RESET_FUNC_SCALAR(prefix) void prefix ## _ireset(void * void_arg) { scalar_ireset(((prefix ## _type *) void_arg)->scalar); } -#define RESET_FUNC_VOID_HEADER(prefix) void prefix ## _ireset(void *) -#define RESET_FUNC_HEADER(prefix) void prefix ## _ireset(prefix ## _type *) - -/*****************************************************************/ - -#define ADD_FUNC(prefix) \ -void prefix ## _iadd(void *void_arg , const void *void_delta) { \ - prefix ## _type *arg = (prefix ## _type *) void_arg; \ -const prefix ## _type *delta = (const prefix ## _type *) void_delta; \ -const prefix ## _config_type *config = arg->config; \ -const int data_size = prefix ## _config_get_data_size(arg->config); \ -int i; \ -if (config != delta->config) { \ - fprintf(stderr,"%s:two object have different config objects - aborting \n",__func__);\ - abort(); \ -} \ -for (i=0; i < data_size; i++) \ - arg->data[i] += delta->data[i]; \ -} - -#define ADD_FUNC_SCALAR(prefix) void prefix ## _iadd(void *void_arg, const void * void_factor) { scalar_iadd( ((prefix ## _type *) void_arg)->scalar , (( const prefix ## _type *) void_factor)->scalar); } -#define ADD_FUNC_VOID_HEADER(prefix) void prefix ## _iadd(void * , const void *) -#define ADD_FUNC_HEADER(prefix) void prefix ## _iadd(prefix ## _type * , const prefix ## _type *) -/*****************************************************************/ - -#define MUL_ADD_FUNC(prefix) \ -void prefix ## _imul_add(void *void_arg , double scale_factor , const void *void_delta) { \ - prefix ## _type *arg = (prefix ## _type *) void_arg; \ -const prefix ## _type *delta = (const prefix ## _type *) void_delta; \ -const prefix ## _config_type *config = arg->config; \ -const int data_size = prefix ## _config_get_data_size(arg->config); \ -int i; \ -if (config != delta->config) { \ - fprintf(stderr,"%s:two object have different config objects - aborting \n",__func__);\ - abort(); \ -} \ -for (i=0; i < data_size; i++) \ - arg->data[i] += scale_factor * delta->data[i]; \ -} - -#define MUL_ADD_FUNC_SCALAR(prefix) void prefix ## _imul_add(void *void_arg, double scale_factor , const void * void_factor) { scalar_imul_add( ((prefix ## _type *) void_arg)->scalar , scale_factor , (( const prefix ## _type *) void_factor)->scalar); } -#define MUL_ADD_FUNC_VOID_HEADER(prefix) void prefix ## _imul_add(void * , double , const void *) -#define MUL_ADD_FUNC_HEADER(prefix) void prefix ## _imul_add(prefix ## _type* , double , const prefix ## _type *) - -/*****************************************************************/ - -#define SUB_FUNC(prefix) \ -void prefix ## _isub(void *void_arg , const void *void_diff) { \ - prefix ## _type *arg = (prefix ## _type *) void_arg; \ -const prefix ## _type *diff = (const prefix ## _type *) void_diff; \ -const prefix ## _config_type *config = arg->config; \ -const int data_size = prefix ## _config_get_data_size(arg->config); \ -int i; \ -if (config != diff->config) { \ - fprintf(stderr,"%s:two object have different config objects - aborting \n",__func__);\ - abort(); \ -} \ -for (i=0; i < data_size; i++) \ - arg->data[i] -= diff->data[i]; \ -} - -#define SUB_FUNC_SCALAR(prefix) void prefix ## _isub(void *void_arg, const void * void_factor) { scalar_isub( ((prefix ## _type *) void_arg)->scalar , (( const prefix ## _type *) void_factor)->scalar); } -#define SUB_FUNC_VOID_HEADER(prefix) void prefix ## _isub(void * , const void *) -#define SUB_FUNC_HEADER(prefix) void prefix ## _isub(prefix ## _type * , const prefix ## _type*) -/*****************************************************************/ - -#define MUL_FUNC(prefix) \ -void prefix ## _imul(void *void_arg , const void *void_factor) { \ - prefix ## _type *arg = (prefix ## _type *) void_arg; \ -const prefix ## _type *factor = (const prefix ## _type *) void_factor; \ -const prefix ## _config_type *config = arg->config; \ -const int data_size = prefix ## _config_get_data_size(arg->config); \ -int i; \ -if (config != factor->config) { \ - fprintf(stderr,"%s:two object have different config objects - aborting \n",__func__);\ - abort(); \ -} \ -for (i=0; i < data_size; i++) \ - arg->data[i] *= factor->data[i]; \ -} -#define MUL_FUNC_SCALAR(prefix) void prefix ## _imul(void *void_arg, const void * void_factor) { scalar_imul( ((prefix ## _type *) void_arg)->scalar , (( const prefix ## _type *) void_factor)->scalar); } -#define MUL_FUNC_VOID_HEADER(prefix) void prefix ## _imul(void * , const void *) -#define MUL_FUNC_HEADER(prefix) void prefix ## _imul(prefix ## _type * , const prefix ## _type*) - -/*****************************************************************/ - -#define ADDSQR_FUNC(prefix) \ -void prefix ## _iaddsqr(void *void_arg , const void *void_delta) { \ - prefix ## _type *arg = (prefix ## _type *) void_arg; \ -const prefix ## _type *delta = (const prefix ## _type *) void_delta; \ -const prefix ## _config_type *config = arg->config; \ -const int data_size = prefix ## _config_get_data_size(arg->config); \ -int i; \ -if (config != delta->config) { \ - fprintf(stderr,"%s:two object have different config objects - aborting \n",__func__);\ - abort(); \ -} \ -for (i=0; i < data_size; i++) \ - arg->data[i] += delta->data[i] * delta->data[i]; \ -} -#define ADDSQR_FUNC_SCALAR(prefix) void prefix ## _iaddsqr(void *void_arg, const void * void_factor) { scalar_iaddsqr( ((prefix ## _type *) void_arg)->scalar , (( const prefix ## _type *) void_factor)->scalar); } -#define ADDSQR_FUNC_VOID_HEADER(prefix) void prefix ## _iaddsqr(void * , const void *) -#define ADDSQR_FUNC_HEADER(prefix) void prefix ## _iaddsqr(prefix ## _type * , const prefix ## _type *) - - - -#define MATH_OPS(prefix) \ -SQR_FUNC (prefix) \ -SQRT_FUNC (prefix) \ -SCALE_FUNC (prefix) \ -ADD_FUNC (prefix) \ -ADDSQR_FUNC (prefix) \ -SUB_FUNC (prefix) \ -MUL_FUNC (prefix) \ -MUL_ADD_FUNC(prefix) - -#define MATH_OPS_SCALAR(prefix) \ -SQR_FUNC_SCALAR (prefix) \ -SQRT_FUNC_SCALAR (prefix) \ -SCALE_FUNC_SCALAR (prefix) \ -ADD_FUNC_SCALAR (prefix) \ -ADDSQR_FUNC_SCALAR (prefix) \ -SUB_FUNC_SCALAR (prefix) \ -MUL_FUNC_SCALAR (prefix) \ -MUL_ADD_FUNC_SCALAR(prefix) - - - -#define MATH_OPS_VOID_HEADER(prefix) \ -SQR_FUNC_VOID_HEADER (prefix); \ -SQRT_FUNC_VOID_HEADER (prefix); \ -SCALE_FUNC_VOID_HEADER (prefix); \ -ADD_FUNC_VOID_HEADER (prefix); \ -ADDSQR_FUNC_VOID_HEADER (prefix); \ -SUB_FUNC_VOID_HEADER (prefix); \ -MUL_FUNC_VOID_HEADER (prefix); \ -MUL_ADD_FUNC_VOID_HEADER(prefix) - -#define MATH_OPS_HEADER(prefix) \ -SQR_FUNC_HEADER (prefix); \ -SQRT_FUNC_HEADER (prefix); \ -SCALE_FUNC_HEADER (prefix); \ -ADD_FUNC_HEADER (prefix); \ -ADDSQR_FUNC_HEADER (prefix); \ -SUB_FUNC_HEADER (prefix); \ -MUL_FUNC_HEADER (prefix); \ -MUL_ADD_FUNC_HEADER(prefix) - -/*****************************************************************/ - -#define ENSEMBLE_MULX_VECTOR(prefix) \ -void prefix ## _ensemble_mulX_vector(prefix ## _type *new , int ens_size , const prefix ## _type ** prefix ## _ensemble , const double *X_vector) { \ - int iens; \ - prefix ## _clear(new); \ - for (iens=0; iens < ens_size; iens++) \ - prefix ## _imul_add(new , X_vector[iens] , prefix ## _ensemble[iens]);\ -} -#define ENSEMBLE_MULX_VECTOR_HEADER(prefix) void prefix ## _ensemble_mulX_vector(prefix ## _type *, int , const prefix ## _type ** , const double *); - - -#define ENSEMBLE_MULX_VECTOR_VOID(prefix) \ -void prefix ## _ensemble_mulX_vector__(void *new , int ens_size , const void ** prefix ## _ensemble , const double *X_vector) { \ - prefix ## _ensemble_mulX_vector((prefix ## _type *) new , ens_size , (const prefix ## _type **) prefix ## _ensemble , X_vector); \ -} - -#define ENSEMBLE_MULX_VECTOR_VOID_HEADER(prefix) void prefix ## _ensemble_mulX_vector__(void * , int , const void ** , const double *); - -/*****************************************************************/ - -#define ALLOC_STATS_SCALAR(prefix) \ -void prefix ## _alloc_stats(const prefix ## _type ** ensemble , int ens_size , prefix ## _type ** _mean , prefix ## _type ** _std) { \ - int iens; \ - prefix ## _type * mean = prefix ## _copyc(ensemble[0]); \ - prefix ## _type * std = prefix ## _copyc(ensemble[0]); \ - prefix ## _clear(mean); \ - prefix ## _clear(std); \ - for (iens = 0; iens < ens_size; iens++) { \ - prefix ## _output_transform(ensemble[iens]); \ - prefix ## _iadd(mean , ensemble[iens]); \ - prefix ## _iaddsqr(std , ensemble[iens]); \ - } \ - prefix ## _iscale(mean , 1.0 / ens_size); \ - prefix ## _iscale(std , 1.0 / ens_size); \ - { \ - prefix ## _type * tmp = prefix ## _copyc(mean); \ - prefix ## _isqr(tmp); \ - prefix ## _imul_add(std , -1.0 , tmp); \ - prefix ## _free(tmp); \ - } \ - prefix ## _isqrt(std); \ - *_mean = mean; \ - *_std = std; \ -} - - - - -#define ALLOC_STATS(prefix) \ -void prefix ## _alloc_stats(const prefix ## _type ** ensemble , int ens_size , prefix ## _type ** _mean , prefix ## _type ** _std) { \ - int iens; \ - prefix ## _type * mean = prefix ## _copyc(ensemble[0]); \ - prefix ## _type * std = prefix ## _copyc(ensemble[0]); \ - prefix ## _clear(mean); \ - prefix ## _clear(std); \ - for (iens = 0; iens < ens_size; iens++) { \ - prefix ## _iadd(mean , ensemble[iens]); \ - prefix ## _iaddsqr(std , ensemble[iens]); \ - } \ - prefix ## _iscale(mean , 1.0 / ens_size); \ - prefix ## _iscale(std , 1.0 / ens_size); \ - { \ - prefix ## _type * tmp = prefix ## _copyc(mean); \ - prefix ## _isqr(tmp); \ - prefix ## _imul_add(std , -1.0 , tmp); \ - prefix ## _free(tmp); \ - } \ - prefix ## _isqrt(std); \ - if (_mean != NULL) *_mean = mean; \ - if (_std != NULL) *_std = std; \ -} - - - -#define ALLOC_STATS_HEADER(prefix) void prefix ## _alloc_stats(const prefix ## _type ** , int , prefix ## _type ** , prefix ## _type ** ); -/*****************************************************************/ - - - -void enkf_util_truncate(void * , int , ecl_type_enum , void * , void *); -void enkf_util_rand_stdnormal_vector(int , double *, rng_type * rng); -double enkf_util_rand_normal(double , double , rng_type * rng); -void enkf_util_fwrite_target_type(FILE * , ert_impl_type); -void enkf_util_assert_buffer_type(buffer_type * buffer, ert_impl_type target_type); -void enkf_util_randperm( int * , int, rng_type * rng); - - //char * enkf_util_scanf_alloc_filename(const char * , int ); -void enkf_util_fprintf_data(const int * , const double ** , const char * , const char ** , int , int , const bool * , bool , FILE * stream); - -char * enkf_util_alloc_tagged_string(const char * ); -char * enkf_util_alloc_detagged_string( const char * tagged_string); -int enkf_util_compare_keys( const char * key1 , const char * key2 ); -int enkf_util_compare_keys__( const void * __key1 , const void * __key2 ); - -///* These #defines are used in the enkf_util_scanf_alloc_filename function. */ -//#define EXISTING_FILE 1 -//#define NEW_FILE 2 -//#define AUTO_MKDIR 4 - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/ensemble_config.h b/ThirdParty/Ert/libenkf/include/ert/enkf/ensemble_config.h deleted file mode 100644 index 332f0cac21..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/ensemble_config.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'ensemble_config.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_ENSEMBLE_CONFIG_H -#define ERT_ENSEMBLE_CONFIG_H -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include -#include - -#include -#include - -#include -#include - -#include -#include -#include -#include -#include - - - -typedef struct ensemble_config_struct ensemble_config_type; - - void ensemble_config_set_refcase( ensemble_config_type * ensemble_config , const ecl_sum_type * refcase); - void ensemble_config_set_gen_kw_format( ensemble_config_type * ensemble_config , const char * gen_kw_format_string); - const char * ensemble_config_get_gen_kw_format( const ensemble_config_type * ensemble_config ); - enkf_config_node_type * ensemble_config_add_container( ensemble_config_type * ensemble_config , const char * key); - enkf_config_node_type * ensemble_config_add_surface( ensemble_config_type * ensemble_config , const char * key , bool forward_init); - - void ensemble_config_add_node( ensemble_config_type * ensemble_config , enkf_config_node_type * node); - enkf_config_node_type * ensemble_config_add_gen_data( ensemble_config_type * config , const char * key , bool dynamic , bool forward_init); - enkf_config_node_type * ensemble_config_add_summary(ensemble_config_type * ensemble_config , const char * key, load_fail_type load_fail); - enkf_config_node_type * ensemble_config_add_summary_observation(ensemble_config_type * ensemble_config , const char * key, load_fail_type load_fail); - enkf_config_node_type * ensemble_config_add_gen_kw( ensemble_config_type * config , const char * key , bool forward_init); - enkf_config_node_type * ensemble_config_add_custom_kw(ensemble_config_type * config, const char * key, const char * result_file, const char * output_file); - enkf_config_node_type * ensemble_config_add_defined_custom_kw(ensemble_config_type * config, const char * key, const hash_type * definition); - void ensemble_config_update_custom_kw_config(ensemble_config_type * config, custom_kw_config_set_type * config_set); - enkf_config_node_type * ensemble_config_add_field( ensemble_config_type * config , const char * key , ecl_grid_type * ecl_grid , bool forward_init); - int ensemble_config_get_observations( const ensemble_config_type * config , enkf_obs_type * enkf_obs , const char * user_key , int obs_count , - time_t * obs_time , double * y , double * std); - void ensemble_config_clear_obs_keys(ensemble_config_type * ensemble_config); - void ensemble_config_add_obs_key(ensemble_config_type * , const char * , const char * ); - const enkf_config_node_type * ensemble_config_user_get_node(const ensemble_config_type * , const char * , char **); - ert_impl_type ensemble_config_impl_type(const ensemble_config_type *, const char * ); - enkf_var_type ensemble_config_var_type(const ensemble_config_type *, const char * ); - void ensemble_config_init(ensemble_config_type * ensemble_config , const config_content_type * config , ecl_grid_type * grid , const ecl_sum_type * refcase); - void ensemble_config_free(ensemble_config_type * ); - bool ensemble_config_has_key(const ensemble_config_type * , const char * ); - bool ensemble_config_has_impl_type(const ensemble_config_type * config, const ert_impl_type impl_type); - bool ensemble_config_have_forward_init( const ensemble_config_type * ensemble_config ); - - void ensemble_config_del_node(ensemble_config_type * , const char * ); - void ensemble_config_add_config_items(config_parser_type * ); - - void ensemble_config_init_GEN_PARAM( ensemble_config_type * ensemble_config , const config_content_type * config ); - - enkf_config_node_type * ensemble_config_get_node(const ensemble_config_type * , const char * ); - enkf_config_node_type * ensemble_config_get_or_create_summary_node(ensemble_config_type * ensemble_config, const char * key); - stringlist_type * ensemble_config_alloc_keylist(const ensemble_config_type *); - stringlist_type * ensemble_config_alloc_keylist_from_var_type(const ensemble_config_type * , int var_mask); - stringlist_type * ensemble_config_alloc_keylist_from_impl_type(const ensemble_config_type *, ert_impl_type); - bool ensemble_config_iget_keep_runpath(const ensemble_config_type * , int ); - ensemble_config_type * ensemble_config_alloc( ); - void ensemble_config_fprintf_config( ensemble_config_type * ensemble_config , FILE * stream ); - const summary_key_matcher_type * ensemble_config_get_summary_key_matcher(const ensemble_config_type * ensemble_config); - int ensemble_config_get_size(const ensemble_config_type * ensemble_config ); - - - UTIL_IS_INSTANCE_HEADER( ensemble_config ); - UTIL_SAFE_CAST_HEADER( ensemble_config ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/ert_init_context.h b/ThirdParty/Ert/libenkf/include/ert/enkf/ert_init_context.h deleted file mode 100644 index 3160782d91..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/ert_init_context.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - Copyright (C) 2016 Statoil ASA, Norway. - - The file 'ert_init_context.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_INIT_CONTEXT_H -#define ERT_INIT_CONTEXT_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include - -#include -#include -#include - -typedef struct ert_init_context_struct ert_init_context_type; - - stringlist_type * ert_init_context_alloc_runpath_list(const bool_vector_type * iactive , path_fmt_type * runpath_fmt , subst_list_type * subst_list , int iter); - char * ert_init_context_alloc_runpath( int iens , path_fmt_type * runpath_fmt , subst_list_type * subst_list , int iter); - - ert_init_context_type * ert_init_context_alloc(enkf_fs_type * init_fs , const bool_vector_type * iactive , - path_fmt_type * runpath_fmt , - subst_list_type * subst_list , - init_mode_type init_mode , - int iter); - - void ert_init_context_free( ert_init_context_type * ); - int ert_init_context_get_size( const ert_init_context_type * context ); - init_mode_type ert_init_context_get_init_mode( const ert_init_context_type * context ); - bool_vector_type * ert_init_context_get_iactive( const ert_init_context_type * context ); - int ert_init_context_get_iter( const ert_init_context_type * context ); - run_arg_type * ert_init_context_iget_arg( const ert_init_context_type * context , int index); - run_arg_type * ert_init_context_iens_get_arg( const ert_init_context_type * context , int iens); - - - UTIL_IS_INSTANCE_HEADER( ert_init_context ); - - -#ifdef __cplusplus -} -#endif -#endif - - diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/ert_log.h b/ThirdParty/Ert/libenkf/include/ert/enkf/ert_log.h deleted file mode 100644 index f6819fd1bf..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/ert_log.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'ert_log.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERTLOG_H -#define ERTLOG_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include - -void ert_log_init_log(int log_level,const char * log_file_name, bool verbose); -void ert_log_add_fmt_message(int message_level , FILE * dup_stream , const char * fmt , ...); -void ert_log_add_message(int message_level , FILE * dup_stream , char* message, bool free_message); -void ert_log_add_message_py(int message_level, char* message); -void ert_log_close(); -bool ert_log_is_open(); -int ert_log_get_log_level(); -const char * ert_log_get_filename(); -log_type * ert_log_get_logh(); -void ert_log_open_empty(); - -#ifdef __cplusplus -} -#endif -#endif // ERTLOG_H diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/ert_run_context.h b/ThirdParty/Ert/libenkf/include/ert/enkf/ert_run_context.h deleted file mode 100644 index 7442c378db..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/ert_run_context.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'ert_run_context.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_RUN_CONTEXT_H -#define ERT_RUN_CONTEXT_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include - -#include -#include -#include - -typedef struct ert_run_context_struct ert_run_context_type; - - stringlist_type * ert_run_context_alloc_runpath_list(const bool_vector_type * iactive , path_fmt_type * runpath_fmt , subst_list_type * subst_list , int iter); - char * ert_run_context_alloc_runpath( int iens , path_fmt_type * runpath_fmt , subst_list_type * subst_list , int iter); - ert_run_context_type * ert_run_context_alloc_ENSEMBLE_EXPERIMENT(enkf_fs_type * fs , - bool_vector_type * iactive , - path_fmt_type * runpath_fmt , - subst_list_type * subst_list , - int iter); - - - ert_run_context_type * ert_run_context_alloc_SMOOTHER_RUN(enkf_fs_type * simulate_fs , enkf_fs_type * target_update_fs , - bool_vector_type * iactive , - path_fmt_type * runpath_fmt , - subst_list_type * subst_list , - int iter); - void ert_run_context_set_init_fs(ert_run_context_type * context, enkf_fs_type * init_fs); - void ert_run_context_set_result_fs(ert_run_context_type * context, enkf_fs_type * result_fs); - void ert_run_context_set_update_target_fs(ert_run_context_type * context, enkf_fs_type * update_target_fs); - - void ert_run_context_free( ert_run_context_type * ); - int ert_run_context_get_size( const ert_run_context_type * context ); - run_mode_type ert_run_context_get_mode( const ert_run_context_type * context ); - bool_vector_type * ert_run_context_get_iactive( const ert_run_context_type * context ); - int ert_run_context_get_iter( const ert_run_context_type * context ); - int ert_run_context_get_step1( const ert_run_context_type * context ); - int ert_run_context_get_step2( const ert_run_context_type * context ); - int ert_run_context_get_load_start( const ert_run_context_type * context ); - run_arg_type * ert_run_context_iget_arg( const ert_run_context_type * context , int index); - run_arg_type * ert_run_context_iens_get_arg( const ert_run_context_type * context , int iens); - void ert_run_context_deactivate_realization( ert_run_context_type * context , int iens); - - enkf_fs_type * ert_run_context_get_init_fs(const ert_run_context_type * run_context); - enkf_fs_type * ert_run_context_get_result_fs(const ert_run_context_type * run_context); - enkf_fs_type * ert_run_context_get_update_target_fs(const ert_run_context_type * run_context); - - UTIL_IS_INSTANCE_HEADER( ert_run_context ); - - -#ifdef __cplusplus -} -#endif -#endif - - diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/ert_template.h b/ThirdParty/Ert/libenkf/include/ert/enkf/ert_template.h deleted file mode 100644 index 3b2d4aeb91..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/ert_template.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'ert_template.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_TEMPLATE_H -#define ERT_TEMPLATE_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include -#include - -typedef struct ert_template_struct ert_template_type; -typedef struct ert_templates_struct ert_templates_type; - - -stringlist_type * ert_templates_alloc_list( ert_templates_type * ert_templates); -ert_template_type * ert_template_alloc( const char * template_file , const char * target_file, subst_list_type * parent_subst) ; -void ert_template_free( ert_template_type * ert_tamplete ); -void ert_template_instantiate( ert_template_type * ert_template , const char * path , const subst_list_type * arg_list ); -void ert_template_add_arg( ert_template_type * ert_template , const char * key , const char * value ); -void ert_template_free__(void * arg); - -void ert_templates_clear( ert_templates_type * ert_templates ); -ert_template_type * ert_templates_get_template( ert_templates_type * ert_templates , const char * key); - -ert_templates_type * ert_templates_alloc(subst_list_type * parent_subst); -void ert_templates_free( ert_templates_type * ert_templates ); -ert_template_type * ert_templates_add_template( ert_templates_type * ert_templates , const char * key , const char * template_file , const char * target_file , const char * arg_string); -void ert_templates_instansiate( ert_templates_type * ert_templates , const char * path , const subst_list_type * arg_list); -void ert_templates_del_template( ert_templates_type * ert_templates , const char * key); - -const char * ert_template_get_template_file( const ert_template_type * ert_template); -const char * ert_template_get_target_file( const ert_template_type * ert_template); -const char * ert_template_get_args_as_string( const ert_template_type * ert_template ); -void ert_templates_fprintf_config( const ert_templates_type * ert_templates , FILE * stream ); -void ert_templates_init( ert_templates_type * templates , const config_content_type * config ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/ert_test_context.h b/ThirdParty/Ert/libenkf/include/ert/enkf/ert_test_context.h deleted file mode 100644 index 4dfacef55d..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/ert_test_context.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'ert_test_context.h' is part of ERT - Ensemble based - Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_TEST_CONTEXT_H -#define ERT_TEST_CONTEXT_H - -#include - -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct ert_test_context_struct ert_test_context_type; - -void ert_test_context_set_store( ert_test_context_type * test_context , bool store); -ert_test_context_type * ert_test_context_alloc( const char * test_name , const char * model_config); -ert_test_context_type * ert_test_context_alloc_python( const char * test_name , const char * model_config); -void ert_test_context_free( ert_test_context_type * test_context ); -enkf_main_type * ert_test_context_get_main( ert_test_context_type * test_context ); -bool ert_test_context_install_workflow_job( ert_test_context_type * test_context , const char * job_name , const char * job_file); -bool ert_test_context_run_worklow_job( ert_test_context_type * test_context , const char * job_name, const stringlist_type * args); -void ert_test_context_fwrite_workflow_job( FILE * stream , const char * job_name , const stringlist_type * args); -bool ert_test_context_install_workflow( ert_test_context_type * test_context , const char * workflow_name , const char * workflow_file); -bool ert_test_context_run_worklow( ert_test_context_type * test_context , const char * workflow_name); -const char * ert_test_context_get_cwd( const ert_test_context_type * test_context ); - -UTIL_IS_INSTANCE_HEADER( ert_test_context ); - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/ert_workflow_list.h b/ThirdParty/Ert/libenkf/include/ert/enkf/ert_workflow_list.h deleted file mode 100644 index cc861a1b3f..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/ert_workflow_list.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'ert_workflow_list.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_WORKFLOW_LIST_H -#define ERT_WORKFLOW_LIST_H - - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include -#include -#include - -#include -#include - - - typedef struct ert_workflow_list_struct ert_workflow_list_type; - - workflow_type * ert_workflow_list_get_workflow(ert_workflow_list_type * workflow_list , const char * workflow_name ); - workflow_type * ert_workflow_list_add_workflow( ert_workflow_list_type * workflow_list , const char * workflow_file , const char * workflow_name); - void ert_workflow_list_free( ert_workflow_list_type * workflow_list ); - ert_workflow_list_type * ert_workflow_list_alloc( const subst_list_type * subst_list ); - void ert_workflow_list_add_jobs_in_directory( ert_workflow_list_type * workflow_list , const char * path ); - void ert_workflow_list_add_job( ert_workflow_list_type * workflow_list , const char * job_name , const char * config_file ); - bool ert_workflow_list_has_job( const ert_workflow_list_type * workflow_list , const char * job_name); - const workflow_job_type * ert_workflow_list_get_job( const ert_workflow_list_type * workflow_list , const char * job_name); - stringlist_type * ert_workflow_list_get_job_names(const ert_workflow_list_type * workflow_list); - void ert_workflow_list_add_alias( ert_workflow_list_type * workflow_list , const char * real_name , const char * alias); - void ert_workflow_list_add_config_items( config_parser_type * config ); - void ert_workflow_list_init( ert_workflow_list_type * workflow_list , config_content_type * config ); - bool ert_workflow_list_run_workflow(ert_workflow_list_type * workflow_list, const char * workflow_name , void * self); - bool ert_workflow_list_run_workflow__(ert_workflow_list_type * workflow_list, workflow_type * workflow, bool verbose , void * self); - bool ert_workflow_list_has_workflow(ert_workflow_list_type * workflow_list , const char * workflow_name ); - stringlist_type * ert_workflow_list_alloc_namelist( ert_workflow_list_type * workflow_list ); - const config_error_type * ert_workflow_list_get_last_error( const ert_workflow_list_type * workflow_list); - void ert_workflow_list_set_verbose( ert_workflow_list_type * workflow_list , bool verbose); - bool ert_workflow_list_run_workflow_blocking(ert_workflow_list_type * workflow_list , const char * workflow_name , void * self); - const subst_list_type * ert_workflow_list_get_context(const ert_workflow_list_type * workflow_list); - int ert_workflow_list_get_size( const ert_workflow_list_type * workflow_list); - - - UTIL_IS_INSTANCE_HEADER( ert_workflow_list ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/field.h b/ThirdParty/Ert/libenkf/include/ert/enkf/field.h deleted file mode 100644 index c2d1c3c8bc..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/field.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'field.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_FIELD_H -#define ERT_FIELD_H -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include -#include - -#include -#include -#include -#include -#include - -/* Typedef field_type moved to field_config.h */ - - void field_scale(field_type * field, double scale_factor); - int field_get_global_index(const field_type * , int , int , int ); - void field_ijk_set(field_type * , int , int , int , const void * ); - void field_indexed_set(field_type * field, ecl_type_enum , int , const int * , const void * ); - void field_indexed_add(field_type * field, ecl_type_enum , int , const int * , const void * ); - double field_iget_double(const field_type * , int ); - double field_ijk_get_double(const field_type * field, int , int , int ); - float field_iget_float(const field_type * , int ); - float field_ijk_get_float(const field_type * field, int , int , int ); - void field_ijk_get(const field_type * , int , int , int , void *); - bool field_ijk_valid(const field_type * , int , int , int ); - void field_ijk_get_if_valid(const field_type * , int , int , int , void * , bool *); - void field_ecl_write1D_fortio(const field_type * , fortio_type *); - void field_ecl_write3D_fortio(const field_type * , fortio_type *, const char *); - void field_ROFF_export(const field_type * , const char * , const char *); - void field_copy_ecl_kw_data(field_type * , const ecl_kw_type * ); - field_type * field_alloc_shared(const field_config_type * , void * , int ); - void field_free(field_type *); - void field_get_dims(const field_type *, int *, int *, int *); - bool field_fload_keep_inactive(field_type * field , const char * filename); - bool field_fload_auto(field_type * , const char * , bool); - bool field_fload_rms(field_type * field , const char * filename, bool keep_inactive); - void field_export3D(const field_type * , void *, bool, ecl_type_enum , void *, const char *); - void field_export(const field_type * , const char * , fortio_type * , field_file_format_type , bool, const char *); - field_type * field_copyc(const field_type *); - bool field_cmp(const field_type * , const field_type * ); - - double * field_indexed_get_alloc(const field_type *, int, const int *); - void field_inplace_output_transform(field_type * field); - - void field_iscale(field_type * , double ); - void field_isqrt(field_type *); - void field_isqr(field_type *); - void field_iaddsqr(field_type * , const field_type *); - void field_iadd(field_type * , const field_type *); - void field_imul_add(field_type * , double , const field_type *); - ecl_kw_type * field_alloc_ecl_kw_wrapper(const field_type * ); - void field_update_sum(field_type * sum , field_type * field , double lower_limit , double upper_limit); - void field_upgrade_103(const char * filename); - - UTIL_IS_INSTANCE_HEADER(field); - UTIL_SAFE_CAST_HEADER_CONST(field); - VOID_ALLOC_HEADER(field); - VOID_FREE_HEADER(field); - VOID_COPY_HEADER (field); - VOID_INITIALIZE_HEADER(field); - VOID_ECL_WRITE_HEADER (field); - VOID_FORWARD_LOAD_HEADER(field); - VOID_USER_GET_HEADER(field); - VOID_READ_FROM_BUFFER_HEADER(field); - VOID_WRITE_TO_BUFFER_HEADER(field); - VOID_SERIALIZE_HEADER(field); - VOID_DESERIALIZE_HEADER(field); - VOID_CLEAR_HEADER(field); - VOID_SET_INFLATION_HEADER(field); - VOID_IMUL_HEADER(field); - VOID_IADD_HEADER(field); - VOID_IADDSQR_HEADER(field); - VOID_SCALE_HEADER(field); - VOID_ISQRT_HEADER(field); - VOID_FLOAD_HEADER(field); - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/field_common.h b/ThirdParty/Ert/libenkf/include/ert/enkf/field_common.h deleted file mode 100644 index 5cac48ff7d..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/field_common.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'field_common.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_FIELD_COMMON_H -#define ERT_FIELD_COMMON_H - -/* - Contains some headers which both field.c and field_config.c need - - split like this to avoid circular dependencies. -*/ - - - -typedef struct field_config_struct field_config_type; -typedef struct field_struct field_type; - -field_type * field_alloc(const field_config_type * ); -bool field_fload(field_type * , const char * ); - - - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/field_config.h b/ThirdParty/Ert/libenkf/include/ert/enkf/field_config.h deleted file mode 100644 index f5bcd5b578..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/field_config.h +++ /dev/null @@ -1,203 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'field_config.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_FIELD_CONFIG_H -#define ERT_FIELD_CONFIG_H -#ifdef __cplusplus -extern "C" { -#endif -#include -#include - -#include -#include -#include - -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - - -/** - This is purely a convenience structure used during initialization, - to denote which arguments are required and, which should be - defualted. - -*/ - -typedef enum { - ECLIPSE_RESTART = 1, - ECLIPSE_PARAMETER = 2, - GENERAL = 3, - UNKNOWN_FIELD_TYPE= 4 -} field_type_enum; - - -/** - The field_file_format_type denotes different ways to store a - field. Unfortunately the different elements in the enum definition - have somewhat different properties: - - - 1. ecl_kw_file is for input - either pack or unpacked. - - 2. ecl_kw_file_active_cells / ecl_kw_file_all_cells are for output. - - 3. Except for ecl_restart_file all formats are for A FILE (with a - filename), more or less assuming that this field is the only - content in the file, whereas ecl_restart_file is for a restart - block, and not a file. - - This has some slightly unlogical consequences: - - 1. The enum has 'file_format' in the name, but ecl_restart_file - is not a file. - - 2. The functions which guess/determine a file type can not return - all possible values of the enum. - - 3. Treatment is not symmetric for input/output. - -*/ - - - - -typedef enum { UNDEFINED_FORMAT = 0, - RMS_ROFF_FILE = 1, - ECL_KW_FILE = 2, /* ecl_kw format either packed (i.e. active cells) *or* all cells - used when reading from file. */ - ECL_KW_FILE_ACTIVE_CELLS = 3, /* ecl_kw format, only active cells - used writing to file. */ - ECL_KW_FILE_ALL_CELLS = 4, /* ecl_kw_format, all cells - used when writing to file. */ - ECL_GRDECL_FILE = 5, - ECL_FILE = 6, /* Assumes packed on export. */ - FILE_FORMAT_NULL = 7} field_file_format_type; /* Used when the guess functions are given NULL to check -should never be read. */ - - -/* active_cells currently not really implemented */ - - - - - -void field_config_update_state_field( field_config_type * config, int truncation, double min_value , double max_value); - - -void field_config_update_parameter_field( field_config_type * config , int truncation, double min_value , double max_value, - field_file_format_type export_format , - const char * init_transform , const char * output_transform ); - - -void field_config_update_general_field( field_config_type * config , int truncation, double min_value , double max_value, - field_file_format_type export_format , /* This can be guessed with the field_config_default_export_format( ecl_file ) function. */ - const char * init_transform , - const char * input_transform , - const char * output_transform ); - - -field_config_type * field_config_alloc_empty( const char * ecl_kw_name , ecl_grid_type * ecl_grid , field_trans_table_type * trans_table, bool global_size ); - - -void field_config_get_ijk( const field_config_type * config , int active_index , int *i , int * j , int * k); -field_type * field_config_get_min_std( const field_config_type * field_config ); -const char * field_config_default_extension(field_file_format_type , bool ); -bool field_config_write_compressed(const field_config_type * ); -field_file_format_type field_config_guess_file_type(const char * ); -field_file_format_type field_config_manual_file_type(const char * , bool); -ecl_type_enum field_config_get_ecl_type(const field_config_type * ); -rms_type_enum field_config_get_rms_type(const field_config_type * ); -void field_config_get_dims(const field_config_type * , int * , int * , int *); -int field_config_get_nx(const field_config_type * config ); -int field_config_get_ny(const field_config_type * config ); -int field_config_get_nz(const field_config_type * config ); -void field_config_free(field_config_type *); -int field_config_get_volume(const field_config_type * ); -int field_config_get_data_size_from_grid(const field_config_type * config); -void field_config_set_ecl_kw_name(field_config_type * , const char * ); -void field_config_set_ecl_type(field_config_type * , ecl_type_enum ); -void field_config_set_eclfile(field_config_type * , const char * ); -const bool * field_config_get_iactive(const field_config_type * ); -int field_config_get_byte_size(const field_config_type * ); -int field_config_get_sizeof_ctype(const field_config_type * ); -int field_config_active_index(const field_config_type * , int , int , int ); -int field_config_global_index(const field_config_type * , int , int , int ); -void field_config_get_ijk(const field_config_type * , int , int * , int * , int *); -bool field_config_ijk_valid(const field_config_type * , int , int , int ); -bool field_config_ijk_active(const field_config_type * config , int i , int j , int k); -bool field_config_active_cell(const field_config_type * , int , int , int); -char * field_config_alloc_init_file(const field_config_type * , int ); -field_file_format_type field_config_get_export_format(const field_config_type * ); -field_file_format_type field_config_get_import_format(const field_config_type * ); -void field_config_set_all_active(field_config_type * ); -void field_config_set_key(field_config_type * , const char *); -void field_config_enkf_OFF(field_config_type * ); -bool field_config_enkf_mode(const field_config_type * config); -void field_config_scanf_ijk(const field_config_type * , bool , const char * , int , int * , int * , int * , int *); -const char * field_config_get_key(const field_config_type * ); -bool field_config_keep_inactive_cells(const field_config_type *); -field_func_type * field_config_get_init_transform(const field_config_type * ); -field_func_type * field_config_get_output_transform(const field_config_type * ); -field_func_type * field_config_get_input_transform(const field_config_type * ); - //void field_config_set_output_transform(field_config_type * config , field_func_type * ); -bool field_config_is_valid( const field_config_type * field_config ); -void field_config_assert_binary( const field_config_type * , const field_config_type * , const char * ); -void field_config_assert_unary( const field_config_type * , const char * ); -void field_config_activate(field_config_type * , active_mode_type , void * ); - -const char * field_config_get_init_transform_name( const field_config_type * field_config ); -const char * field_config_get_input_transform_name( const field_config_type * field_config ); -const char * field_config_get_output_transform_name( const field_config_type * field_config ); - -void field_config_set_truncation(field_config_type * , int , double , double ); -int field_config_get_truncation_mode(const field_config_type * config ); -double field_config_get_truncation_min( const field_config_type * config ); -double field_config_get_truncation_max( const field_config_type * config ); -ecl_grid_type * field_config_get_grid(const field_config_type * ); -const char * field_config_get_grid_name( const field_config_type * ); - - int field_config_parse_user_key(const field_config_type * config, const char * index_key , int *i , int *j , int *k); - bool field_config_parse_user_key__( const char * index_key , int *i , int *j , int *k); - -field_file_format_type field_config_default_export_format(const char * filename); -const char * field_config_get_input_transform_name( const field_config_type * field_config ) ; -const char * field_config_get_output_transform_name( const field_config_type * field_config ) ; -const char * field_config_get_init_transform_name( const field_config_type * field_config ) ; - -void field_config_fprintf_config( const field_config_type * config , enkf_var_type var_type , const char * outfile , const char * infile , - const char * min_std_file , FILE * stream); - - - -/*Generated headers */ - UTIL_IS_INSTANCE_HEADER(field_config); -UTIL_SAFE_CAST_HEADER(field_config); -UTIL_SAFE_CAST_HEADER_CONST(field_config); -CONFIG_GET_ECL_KW_NAME_HEADER(field); -VOID_FREE_HEADER(field_config); -VOID_GET_DATA_SIZE_HEADER(field); -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/field_trans.h b/ThirdParty/Ert/libenkf/include/ert/enkf/field_trans.h deleted file mode 100644 index c235edc1ae..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/field_trans.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'field_trans.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_FIELD_TRANS_H -#define ERT_FIELD_TRANS_H -#ifdef __cplusplus -extern "C" { -#endif -#include -#include - - -typedef float (field_func_type) ( float ); -typedef struct field_trans_table_struct field_trans_table_type; - - -void field_trans_table_fprintf(const field_trans_table_type * , FILE * ); -void field_trans_table_free(field_trans_table_type * ); -void field_trans_table_add(field_trans_table_type * , const char * , const char * , field_func_type * ); -field_trans_table_type * field_trans_table_alloc(); -bool field_trans_table_has_key(field_trans_table_type * , const char * ); -field_func_type * field_trans_table_lookup(field_trans_table_type * , const char * ); - - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/forward_load_context.h b/ThirdParty/Ert/libenkf/include/ert/enkf/forward_load_context.h deleted file mode 100644 index 991c06917f..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/forward_load_context.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright (C) 2016 Statoil ASA, Norway. - - The file 'forward_load_context.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_FORWARD_LOAD_CONTEXT_H -#define ERT_FORWARD_LOAD_CONTEXT_H - -#ifdef __cplusplus -extern "C" { -#endif -#include -#include - -#include -#include - -#include -#include -#include - - typedef struct forward_load_context_struct forward_load_context_type; - - bool forward_load_context_accept_messages( const forward_load_context_type * load_context ); - void forward_load_context_add_message( forward_load_context_type * load_context , const char * message ); - void forward_load_context_update_result( forward_load_context_type * load_context , int flags); - int forward_load_context_get_result( const forward_load_context_type * load_context ); - forward_load_context_type * forward_load_context_alloc( const run_arg_type * run_arg , bool load_summary , const ecl_config_type * ecl_config , const char * eclbase, stringlist_type * messages); - void forward_load_context_free( forward_load_context_type * load_context ); - const ecl_sum_type * forward_load_context_get_ecl_sum( const forward_load_context_type * load_context); - const ecl_file_type * forward_load_context_get_restart_file( const forward_load_context_type * load_context); - int forward_load_context_get_report_step( const forward_load_context_type * load_context); - int forward_load_context_get_iens( const forward_load_context_type * load_context); - const run_arg_type * forward_load_context_get_run_arg( const forward_load_context_type * load_context ); - const char * forward_load_context_get_run_path( const forward_load_context_type * load_context ); - int forward_load_context_get_load_step(const forward_load_context_type * load_context); - enkf_fs_type * forward_load_context_get_result_fs( const forward_load_context_type * load_context ); - bool forward_load_context_load_restart_file( forward_load_context_type * load_context , int report_step ); - void forward_load_context_select_step( forward_load_context_type * load_context , int report_step); - - UTIL_IS_INSTANCE_HEADER( forward_load_context ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/fs_driver.h b/ThirdParty/Ert/libenkf/include/ert/enkf/fs_driver.h deleted file mode 100644 index 28f1bfc359..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/fs_driver.h +++ /dev/null @@ -1,241 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'fs_driver.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_FS_DRIVER_H -#define ERT_FS_DRIVER_H -#ifdef __cplusplus -extern "C" { -#endif -#include -#include - -#include -#include - -#define FS_MAGIC_ID 123998L -#define FSTAB_FILE "ert_fstab" -#define CURRENT_FS_VERSION 107 -#define MIN_SUPPORTED_FS_VERSION 105 - -/** - Version history: - - 0 : - - - File system version | First svn version | Last svn version - -------------------------------------------------------------------------- - 100 | | 1799 - 101 | 1810 | 1886 - 102 | 1887/1902 | 1996 - 103 | 1997 | - | 2047: sqlite added | 2125 - 104 | 2127 | - | 2140: block_fs_index added - | 2190: started to distribute ert binary internally - 105 | 3918 | - 106 | Git ~ Desember 2015 - 107 | Git ~ September 2017 - ------------------------------------------------------------------------- - - - Version: 100 - ------------ - First version with subdirectories for different cases. - - - - Version: 101 - ------------ - Have changed the format for storing static keywords. Instead of a - directory with numbered files in them, the keywords get an integer - appended: - - INTEHEAD/0 ==> INTEHEAD_0 - - The actual changing of keyword is done in the function - __realloc_static_kw() in enkf_state.c. - - - - Version: 102 - ------------ - Have removed the type spesific plain drivers, now it is only - plain_driver and plain_driver index. The special functionality for - parameters/static/dynamic is now implemented at the enkf_fs level. - The upgrade from 101 only involves the mount info and the - implementation, the actual stored files are not touched by this - upgrade. - - - - Version: 103 - ------------ - Have changed the reading/writing to go through the buffer - type. This should simplify introducing other drivers than the - simple plain file based driver. - - The upgrade to version is 103 is quite extensive - all node types - have specific _103_ functions. The xxx_fread() and xxx_fwrite() - functions were removed in svn:2046. - - A very experimental version of the sqlite driver was added in - svn:2047. When (if ??) this stabilizes it should probably lead to - an upgrade to version 104. - - At the very last checkin of this version the fs prototypes also - changed to use (const enkf_config_node_type *) instances instead of - (const char * ) for the main key. - - - - Version: 104 - ------------ - In this version the treatment of read_xx and write_xx drivers has - changed. There are no longer separate read_xx and write_xx drivers, - instead the drivers have internal state which differentiates - between read and write. - - The block_fs driver is added - and reasonably stabilized in this - version. - - - Observe that all the upgrade functions were removed at svn:3305. - - - Version 104B - ------------ - Vector storage; each case is a seperate enkf_fs instance. Current - is stored with a symlink. Read about 104 -> 104B fuckup in the - function upgrade104B() in fs_driver.c - - - Version: 105 - ------------ - Using time_map to store time information; common to all members in - ensemble. - - - Version: 106 - ------------ - - Dropped drivers for storing STATIC eclipse keywords. The upgrade - from version 105 to 106 happens silently; the only thing happening - is that the information about the static driver is ignored when - reading the mount map. An older version of ert - with - CURRENT_VERSION == 105 can also read a VERSION == 106 filesystem - with a minor backport and some default heuristics. - - - Version: 107 - ------------ - - Using UTC instead of localtime throughout the code. This implies - that the timemaps written to disk with old versions have time_t - values corresponding to localtime, whereas everything now is - expected to be in utc. - - If we detect a filesystem with version below 107 we stop the - program. If a refcase is supplied the user is given a suggested - commandline to perform an inplace upgrade. -*/ - - - - - typedef struct fs_driver_struct fs_driver_type; - - typedef void (save_kwlist_ftype) (void * , int , int , buffer_type * buffer); /* Functions used to load/store restart_kw_list instances. */ - typedef void (load_kwlist_ftype) (void * , int , int , buffer_type * buffer); - - typedef void (load_node_ftype) (void * driver, const char * , int , int , buffer_type * ); - typedef void (save_node_ftype) (void * driver, const char * , int , int , buffer_type * ); - typedef void (unlink_node_ftype) (void * driver, const char * , int , int ); - typedef bool (has_node_ftype) (void * driver, const char * , int , int ); - - typedef void (load_vector_ftype) (void * driver, const char * , int , buffer_type * ); - typedef void (save_vector_ftype) (void * driver, const char * , int , buffer_type * ); - typedef void (unlink_vector_ftype) (void * driver, const char * , int ); - typedef bool (has_vector_ftype) (void * driver, const char * , int ); - - typedef void (fsync_driver_ftype) (void * driver); - typedef void (free_driver_ftype) (void * driver); - - -/** - The fs_driver_type contains a number of function pointers - and a type_id used for run-time cast checking. - - The fs_driver_type is never actually used, but the point is that - all drivers must implement the fs driver "interface". In practice - this is done by including the macro FS_DRIVER_FIELDS *at the start* - of the definition of another driver, i.e. the simplest actually - working driver, the plain_driver is implemented like this: - - struct plain_driver_struct { - FS_DRIVER_FIELDS - int plain_driver_id; - path_fmt_type * path; - } - - -*/ - - - -#define FS_DRIVER_FIELDS \ -load_node_ftype * load_node; \ -save_node_ftype * save_node; \ -has_node_ftype * has_node; \ -unlink_node_ftype * unlink_node; \ -load_vector_ftype * load_vector; \ -save_vector_ftype * save_vector; \ -has_vector_ftype * has_vector; \ -unlink_vector_ftype * unlink_vector; \ -free_driver_ftype * free_driver; \ -fsync_driver_ftype * fsync_driver; \ -int type_id - - - - -struct fs_driver_struct { - FS_DRIVER_FIELDS; -}; - - - - /*****************************************************************/ - - void fs_driver_init(fs_driver_type * ); - void fs_driver_assert_cast(const fs_driver_type * ); - fs_driver_type * fs_driver_safe_cast(void * ); - - void fs_driver_init_fstab( FILE * stream, fs_driver_impl driver_id ); - char * fs_driver_alloc_fstab_file( const char * path ); - FILE * fs_driver_open_fstab( const char * path , bool create); - fs_driver_impl fs_driver_fread_type( FILE * stream ); - void fs_driver_assert_magic( FILE * stream ); - void fs_driver_assert_version( FILE * stream , const char * mount_point); - int fs_driver_fread_version( FILE * stream ); - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/fs_types.h b/ThirdParty/Ert/libenkf/include/ert/enkf/fs_types.h deleted file mode 100644 index 7f34d0519f..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/fs_types.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'fs_types.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_FS_TYPES_H -#define ERT_FS_TYPES_H - - - -/* - The various driver implementations - this goes on disk all over the - place, and the numbers should be considered SET IN STONE. When a new - driver is added the switch statement in the enkf_fs_mount() function - must be updated. -*/ - -// Version from ~ svn:3720 -//typedef enum { -// INVALID_DRIVER_ID = 0, -// PLAIN_DRIVER_INDEX_ID = 1001, -// PLAIN_DRIVER_STATIC_ID = 1002, /* Depreceated */ -// PLAIN_DRIVER_DYNAMIC_ID = 1003, /* Depreceated */ -// PLAIN_DRIVER_PARAMETER_ID = 1004, /* Depreceated */ -// PLAIN_DRIVER_ID = 1005, -// BLOCK_FS_DRIVER_ID = 3001, -// BLOCK_FS_DRIVER_INDEX_ID = 3002 } fs_driver_impl; - - -typedef enum { - INVALID_DRIVER_ID = 0, - PLAIN_DRIVER_ID = 1005, - BLOCK_FS_DRIVER_ID = 3001} fs_driver_impl; - - - - - - -/* - The categories of drivers. To reduce the risk of programming - error (or at least to detect it ...), there should be no overlap - between these ID's and the ID's of the actual implementations - above. The same comment about permanent storage applies to these - numbers as well. -*/ - -typedef enum { - DRIVER_PARAMETER = 1, - DRIVER_STATIC = 2, // Driver static is no longer in use since December 2015 - but it must be retained here for old mount files on disk. - DRIVER_INDEX = 4, // DRIVER_DYNAMIC = 3; removed at svn ~ 3720. - DRIVER_DYNAMIC_FORECAST = 5, - DRIVER_DYNAMIC_ANALYZED = 6 // Driver DYNAMIC_ANALYZED is no longer in use since April 2016 - but it must be retained here for old mount files on disk. -} fs_driver_enum; - - - - - -fs_driver_impl fs_types_lookup_string_name(const char * driver_name); -const char * fs_types_get_driver_name(fs_driver_enum driver_type); -bool fs_types_valid( fs_driver_enum driver_type); - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/gen_common.h b/ThirdParty/Ert/libenkf/include/ert/enkf/gen_common.h deleted file mode 100644 index 906310391c..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/gen_common.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'gen_common.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_GEN_COMMON_H -#define ERT_GEN_COMMON_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include - -void * gen_common_fscanf_alloc(const char * , ecl_type_enum , int * ); -void * gen_common_fread_alloc(const char * , ecl_type_enum , int * ); -void * gen_common_fload_alloc(const char * , gen_data_file_format_type , ecl_type_enum , ecl_type_enum * , int * ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/gen_data.h b/ThirdParty/Ert/libenkf/include/ert/enkf/gen_data.h deleted file mode 100644 index 587f916230..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/gen_data.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'gen_data.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_GEN_DATA_H -#define ERT_GEN_DATA_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -void gen_data_assert_size( gen_data_type * gen_data , int size , int report_step); -bool gen_data_forward_load(gen_data_type * gen_data , const char * ecl_file , const forward_load_context_type * load_context); -void gen_data_free(gen_data_type * ); -double gen_data_iget_double(const gen_data_type * , int ); - void gen_data_iset_double(gen_data_type * , int , double); -gen_data_config_type * gen_data_get_config(const gen_data_type * ); -const bool_vector_type * gen_data_get_forward_mask( const gen_data_type * gen_data ); -int gen_data_get_size(const gen_data_type * ); -double gen_data_iget_double(const gen_data_type * , int ); -void gen_data_export(const gen_data_type * gen_data , const char * full_path , gen_data_file_format_type export_type , fortio_type * fortio); -void gen_data_export_data(const gen_data_type * gen_data , double_vector_type * export_data); -gen_data_file_format_type gen_data_guess_export_type( const gen_data_type * gen_data ); -const char * gen_data_get_key( const gen_data_type * gen_data); -void gen_data_upgrade_103(const char * filename); -int gen_data_get_size( const gen_data_type * gen_data ); -void gen_data_copy_to_double_vector(const gen_data_type * gen_data , double_vector_type * vector); -bool gen_data_fload_with_report_step( gen_data_type * gen_data , const char * filename , const forward_load_context_type * load_context); - -UTIL_SAFE_CAST_HEADER(gen_data); -UTIL_SAFE_CAST_HEADER_CONST(gen_data); -VOID_USER_GET_HEADER(gen_data); -VOID_ALLOC_HEADER(gen_data); -VOID_FREE_HEADER(gen_data); -VOID_COPY_HEADER (gen_data); -VOID_ECL_WRITE_HEADER(gen_data); -VOID_FORWARD_LOAD_HEADER(gen_data); -VOID_INITIALIZE_HEADER(gen_data); -VOID_READ_FROM_BUFFER_HEADER(gen_data); -VOID_WRITE_TO_BUFFER_HEADER(gen_data); -VOID_SERIALIZE_HEADER(gen_data) -VOID_DESERIALIZE_HEADER(gen_data) -VOID_SET_INFLATION_HEADER(gen_data); -VOID_CLEAR_HEADER(gen_data); -VOID_IMUL_HEADER(gen_data); -VOID_IADD_HEADER(gen_data); -VOID_IADDSQR_HEADER(gen_data); -VOID_SCALE_HEADER(gen_data); -VOID_ISQRT_HEADER(gen_data); -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/gen_data_common.h b/ThirdParty/Ert/libenkf/include/ert/enkf/gen_data_common.h deleted file mode 100644 index 4668c25bde..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/gen_data_common.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'gen_data_common.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_GEN_DATA_COMMON_H -#define ERT_GEN_DATA_COMMON_H - -/* - Contains some headers which both gen_data.c and gen_data_config.c need - - split like this to avoid circular dependencies. -*/ - - -typedef struct gen_data_config_struct gen_data_config_type; -typedef struct gen_data_struct gen_data_type; - -gen_data_type * gen_data_alloc(const gen_data_config_type * ); -bool gen_data_fload(gen_data_type * , const char * ); - - - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/gen_data_config.h b/ThirdParty/Ert/libenkf/include/ert/enkf/gen_data_config.h deleted file mode 100644 index 2ef3e1e955..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/gen_data_config.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'gen_data_config.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_GEN_DATA_CONFIG_H -#define ERT_GEN_DATA_CONFIG_H -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - -typedef enum { GEN_DATA_UNDEFINED = 0, - ASCII = 1, /* The file is ASCII file with a vector of numbers formatted with "%g". */ - ASCII_TEMPLATE = 2, /* The data is inserted into a user defined template file. */ - BINARY_DOUBLE = 3, /* The data is in a binary file with doubles. */ - BINARY_FLOAT = 4} /* The data is in a binary file with floats. */ - gen_data_file_format_type; - - bool gen_data_config_is_dynamic( const gen_data_config_type * config ); - void gen_data_config_load_active( gen_data_config_type * config , enkf_fs_type * fs, int report_step , bool force_load); - bool gen_data_config_valid_result_format(const char * result_file_fmt); - bool gen_data_config_set_template( gen_data_config_type * config , const char * template_ecl_file , const char * template_data_key ); - - bool gen_data_config_has_active_mask( const gen_data_config_type * config , enkf_fs_type * fs , int report_step); - - /* - Observe that the format ASCII_template can *NOT* be used for - loading files. - */ - gen_data_config_type * gen_data_config_alloc_GEN_PARAM( const char * key , gen_data_file_format_type output_format , gen_data_file_format_type input_format); - gen_data_config_type * gen_data_config_alloc_GEN_DATA_result( const char * key , gen_data_file_format_type input_format); - gen_data_config_type * gen_data_config_alloc_GEN_DATA_state( const char * key , gen_data_file_format_type output_format , gen_data_file_format_type input_format); - void gen_data_config_set_ens_size( gen_data_config_type * config , int ens_size ); - gen_data_file_format_type gen_data_config_get_input_format ( const gen_data_config_type * ); - gen_data_file_format_type gen_data_config_get_output_format ( const gen_data_config_type * ); - ecl_type_enum gen_data_config_get_internal_type(const gen_data_config_type * ); - gen_data_config_type * gen_data_config_alloc_with_options(const char * key , bool , const stringlist_type *); - void gen_data_config_free(gen_data_config_type * ); - int gen_data_config_get_initial_size( const gen_data_config_type * config ); - void gen_data_config_assert_size(gen_data_config_type * , int , int); - const bool_vector_type * gen_data_config_get_active_mask( const gen_data_config_type * config ); - void gen_data_config_update_active(gen_data_config_type * config , const forward_load_context_type * load_context , const bool_vector_type * data_mask); - const bool * gen_data_config_get_iactive(const gen_data_config_type * ); - void gen_data_config_ecl_write(const gen_data_config_type * , const char * , char * ); - void gen_data_config_get_template_data( const gen_data_config_type * , char ** , int * , int * , int *); - gen_data_config_type * gen_data_config_fscanf_alloc(const char * ); - const char * gen_data_config_get_key( const gen_data_config_type * config); - int gen_data_config_get_byte_size( const gen_data_config_type * config , int report_step); - int gen_data_config_get_data_size( const gen_data_config_type * config , int report_step); - gen_data_file_format_type gen_data_config_check_format( const void * format_string ); - - void gen_data_config_set_active_report_steps_from_string( gen_data_config_type *config , const char * range_string); - const int_vector_type * gen_data_config_get_active_report_steps( const gen_data_config_type *config); - int gen_data_config_iget_report_step( const gen_data_config_type *config , int index); - void gen_data_config_add_report_step( gen_data_config_type * config , int report_step); - bool gen_data_config_has_report_step( const gen_data_config_type * config , int report_step); - int gen_data_config_num_report_step( const gen_data_config_type * config ); - const char * gen_data_config_get_template_file( const gen_data_config_type * config ); - const char * gen_data_config_get_template_key( const gen_data_config_type * config ); - void gen_data_config_fprintf_config( const gen_data_config_type * config , enkf_var_type var_type , const char * outfile , const char * infile , - const char * min_std_file , FILE * stream); - - UTIL_IS_INSTANCE_HEADER(gen_data_config); - UTIL_SAFE_CAST_HEADER(gen_data_config); - UTIL_SAFE_CAST_HEADER_CONST(gen_data_config); - VOID_FREE_HEADER(gen_data_config) - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/gen_kw.h b/ThirdParty/Ert/libenkf/include/ert/enkf/gen_kw.h deleted file mode 100644 index 92911a7a6a..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/gen_kw.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'gen_kw.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_GEN_KW_H -#define ERT_GEN_KW_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include -#include -#include -#include -#include - - - -void gen_kw_output_transform(gen_kw_type * ); -void gen_kw_get_output_data(const gen_kw_type * , double * ); -const double * gen_kw_get_output_ref(const gen_kw_type * ); -const double * gen_kw_get_data_ref(const gen_kw_type * ); - //void gen_kw_get_data(const gen_kw_type * , double * ); - -void gen_kw_free(gen_kw_type *); -int gen_kw_data_size( gen_kw_type * ); -double gen_kw_data_iget( gen_kw_type * , int , bool ); -void gen_kw_data_iset( gen_kw_type * , int , double ); -void gen_kw_data_set_vector( gen_kw_type * gen_kw, const double_vector_type * values ); -double gen_kw_data_get( gen_kw_type * , const char * , bool ); -void gen_kw_data_set( gen_kw_type *, const char *, double ); -bool gen_kw_data_has_key( gen_kw_type *, const char *); -void gen_kw_ens_write(const gen_kw_type * , const char *); -void gen_kw_ens_read(gen_kw_type * , const char *); -void gen_kw_truncate(gen_kw_type * ); -gen_kw_type * gen_kw_alloc_mean(int , const gen_kw_type **); -const char * gen_kw_get_name(const gen_kw_type * , int ); -void gen_kw_filter_file(const gen_kw_type * , const char * ); -void gen_kw_export(const gen_kw_type * , int * , char ***, double **); -void gen_kw_upgrade_103( const char * filename ); -char * gen_kw_alloc_user_key(const gen_kw_config_type * , const char * , int ); -void gen_kw_set_subst_parent(gen_kw_type * gen_kw , const subst_list_type * parent_subst); -void gen_kw_ecl_write_template(const gen_kw_type * gen_kw , const char * file_name); - - -UTIL_SAFE_CAST_HEADER(gen_kw); -UTIL_SAFE_CAST_HEADER_CONST(gen_kw); -ALLOC_STATS_HEADER(gen_kw) -VOID_ECL_WRITE_HEADER (gen_kw) -VOID_COPY_HEADER (gen_kw); -VOID_INITIALIZE_HEADER(gen_kw); -VOID_FREE_HEADER (gen_kw); - //MATH_OPS_VOID_HEADER(gen_kw); -VOID_ALLOC_HEADER(gen_kw); -VOID_ECL_WRITE_HEADER(gen_kw); -VOID_USER_GET_HEADER(gen_kw); -VOID_WRITE_TO_BUFFER_HEADER(gen_kw); -VOID_READ_FROM_BUFFER_HEADER(gen_kw); -VOID_FLOAD_HEADER(gen_kw); -VOID_CLEAR_HEADER(gen_kw); -VOID_SERIALIZE_HEADER(gen_kw) -VOID_DESERIALIZE_HEADER(gen_kw) -VOID_IADD_HEADER(gen_kw); -VOID_IMUL_HEADER(gen_kw); -VOID_SCALE_HEADER(gen_kw); -VOID_IADDSQR_HEADER(gen_kw); -VOID_ISQRT_HEADER(gen_kw); -VOID_SET_INFLATION_HEADER(gen_kw); -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/gen_kw_common.h b/ThirdParty/Ert/libenkf/include/ert/enkf/gen_kw_common.h deleted file mode 100644 index f9a7db39f4..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/gen_kw_common.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'gen_kw_common.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_GEN_KW_COMMON_H -#define ERT_GEN_KW_COMMON_H - -/* - Contains some headers which both gen_kw.c and gen_kw_config.c need - - split like this to avoid circular dependencies. -*/ - - -typedef struct gen_kw_config_struct gen_kw_config_type; -typedef struct gen_kw_struct gen_kw_type; - -gen_kw_type * gen_kw_alloc(const gen_kw_config_type * ); -bool gen_kw_fload(gen_kw_type * , const char *); - - - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/gen_kw_config.h b/ThirdParty/Ert/libenkf/include/ert/enkf/gen_kw_config.h deleted file mode 100644 index d8a55f73b5..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/gen_kw_config.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'gen_kw_config.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_GEN_KW_CONFIG_H -#define ERT_GEN_KW_CONFIG_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include -#include - -#include -#include -#include - - -bool gen_kw_config_is_valid( const gen_kw_config_type * config ); -void gen_kw_config_fprintf_config( const gen_kw_config_type * config , const char * outfile , const char * min_std_file , FILE * stream ); -void gen_kw_config_set_parameter_file( gen_kw_config_type * config , const char * parameter_file ); -const char * gen_kw_config_get_parameter_file( const gen_kw_config_type * config ); -char * gen_kw_config_alloc_initfile( const gen_kw_config_type * gen_kw_config , int iens ); -void gen_kw_config_set_init_file_fmt( gen_kw_config_type * config , const char * init_file_fmt ); -const char * gen_kw_config_get_key(const gen_kw_config_type * config ); -const char * gen_kw_config_get_template_file(const gen_kw_config_type * ); -void gen_kw_config_free(gen_kw_config_type *); -double gen_kw_config_transform(const gen_kw_config_type * , int index, double x); -bool gen_kw_config_should_use_log_scale(const gen_kw_config_type * config, int index); -int gen_kw_config_get_data_size(const gen_kw_config_type * ); -const char * gen_kw_config_iget_name(const gen_kw_config_type * , int ); -const char * gen_kw_config_get_tagged_name(const gen_kw_config_type * , int ); -stringlist_type * gen_kw_config_alloc_name_list( const gen_kw_config_type * config); -int gen_kw_config_get_index(const gen_kw_config_type * , const char * ); -char * gen_kw_config_alloc_user_key(const gen_kw_config_type * config , int kw_nr); -const char * gen_kw_config_get_init_file_fmt( const gen_kw_config_type * config ); -void gen_kw_config_set_template_file( gen_kw_config_type * config , const char * template_file ); -gen_kw_config_type * gen_kw_config_alloc_empty( const char * key , const char * tag_fmt ); -void gen_kw_config_update( gen_kw_config_type * config , const char * template_file , const char * parameter_file); -void gen_kw_config_update_tag_format(gen_kw_config_type * config , const char * tag_format); - -UTIL_SAFE_CAST_HEADER_CONST( gen_kw_config ); -UTIL_SAFE_CAST_HEADER(gen_kw_config); -VOID_FREE_HEADER(gen_kw_config); -VOID_GET_DATA_SIZE_HEADER(gen_kw); -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/gen_obs.h b/ThirdParty/Ert/libenkf/include/ert/enkf/gen_obs.h deleted file mode 100644 index 497bcf9efa..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/gen_obs.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'gen_obs.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_GEN_OBS_H -#define ERT_GEN_OBS_H - -#include -#include -#include -#include -#include - -typedef struct gen_obs_struct gen_obs_type; - -gen_obs_type * gen_obs_alloc(gen_data_config_type * config , const char * obs_key , const char * , double , double , const char * , const char * , const char * ); -gen_obs_type * gen_obs_alloc__(gen_data_config_type * data_config , const char * obs_key); // for python bindings -void gen_obs_user_get_with_data_index(const gen_obs_type * gen_obs , const char * index_key , double * value , double * std , bool * valid); - -void gen_obs_update_std_scale(gen_obs_type * gen_obs, double std_multiplier , const active_list_type * active_list); -int gen_obs_get_size(const gen_obs_type * gen_obs); -double gen_obs_iget_std(const gen_obs_type * gen_obs, int index); -double gen_obs_iget_value(const gen_obs_type * gen_obs, int index); -double gen_obs_iget_std_scaling(const gen_obs_type * gen_obs, int index); -int gen_obs_get_obs_index(const gen_obs_type * gen_obs, int index); -void gen_obs_load_observation(gen_obs_type * gen_obs, const char * obs_file); -void gen_obs_set_scalar( gen_obs_type * gen_obs , double scalar_value , double scalar_std); -void gen_obs_attach_data_index( gen_obs_type * gen_obs , const int_vector_type * data_index ); -void gen_obs_load_data_index( gen_obs_type * obs , const char * data_index_file); -void gen_obs_parse_data_index( gen_obs_type * obs , const char * data_index_string); -void gen_obs_free(gen_obs_type * gen_obs); - - - -VOID_CHI2_HEADER(gen_obs); -UTIL_IS_INSTANCE_HEADER(gen_obs); -VOID_FREE_HEADER(gen_obs); -VOID_GET_OBS_HEADER(gen_obs); -VOID_MEASURE_HEADER(gen_obs); -VOID_USER_GET_OBS_HEADER(gen_obs); -VOID_UPDATE_STD_SCALE_HEADER(gen_obs); - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/hook_manager.h b/ThirdParty/Ert/libenkf/include/ert/enkf/hook_manager.h deleted file mode 100644 index 81e910f11a..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/hook_manager.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'hook_manager.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#ifndef ERT_HOOK_MANAGER_H -#define ERT_HOOK_MANAGER_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include -#include -#include - - typedef struct hook_manager_struct hook_manager_type; - - hook_manager_type * hook_manager_alloc(ert_workflow_list_type * workflow_list); - void hook_manager_free(); - - void hook_manager_init( hook_manager_type * hook_manager , const config_content_type * config); - void hook_manager_add_config_items( config_parser_type * config ); - - runpath_list_type * hook_manager_get_runpath_list( hook_manager_type * hook_manager ); - void hook_manager_export_runpath_list( const hook_manager_type * hook_manager ); - void hook_manager_set_runpath_list_file( hook_manager_type * hook_manager , const char * path, const char * filename); - const char * hook_manager_get_runpath_list_file(const hook_manager_type * hook_manager); - void hook_manager_run_workflows( const hook_manager_type * hook_manager , hook_run_mode_enum run_mode , void * self); - - const hook_workflow_type * hook_manager_iget_hook_workflow(const hook_manager_type * hook_manager, int index); - int hook_manager_get_size(const hook_manager_type * hook_manager); - - /*****************************************************************/ - /* Deprecated stuff */ - /*****************************************************************/ - bool hook_manager_run_post_hook_workflow( const hook_manager_type * hook_manager , void * self); - - void hook_manager_set_path( hook_manager_type * hook_manager , const char * path); - bool hook_manager_has_post_hook_workflow( const hook_manager_type * hook_manager ); - const hook_workflow_type * hook_manager_get_post_hook_workflow( const hook_manager_type * hook_manager ); - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/hook_workflow.h b/ThirdParty/Ert/libenkf/include/ert/enkf/hook_workflow.h deleted file mode 100644 index f8dbb48850..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/hook_workflow.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright (C) 2015 Statoil ASA, Norway. - - The file 'hook_workflow.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#ifndef ERT_HOOK_WORKFLOW_H -#define ERT_HOOK_WORKFLOW_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include - -#include - - - typedef enum {PRE_SIMULATION = 0, - POST_SIMULATION = 1, - PRE_UPDATE = 2, - POST_UPDATE = 3} hook_run_mode_enum; - - typedef struct hook_workflow_struct hook_workflow_type; - - - hook_workflow_type * hook_workflow_alloc( workflow_type * workflow , hook_run_mode_enum run_mode); - void hook_workflow_free(hook_workflow_type * hook_workflow); - void hook_workflow_free__( void * arg ); - - - workflow_type * hook_workflow_get_workflow( const hook_workflow_type * hook_workflow ); - bool hook_workflow_run_workflow(const hook_workflow_type * hook_workflow, ert_workflow_list_type * workflow_list, void * self); - hook_run_mode_enum hook_workflow_get_run_mode( const hook_workflow_type * hook_workflow ); - - hook_run_mode_enum hook_workflow_run_mode_from_name( const char * run_mode ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/local_config.h b/ThirdParty/Ert/libenkf/include/ert/enkf/local_config.h deleted file mode 100644 index 25f73c9e56..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/local_config.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'local_config.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_LOCAL_CONFIG_H -#define ERT_LOCAL_CONFIG_H - -#include - -#include - -#include - -#include -#include -#include -#include - - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct local_config_struct local_config_type; - -local_config_type * local_config_alloc( ); -void local_config_clear( local_config_type * local_config ); -void local_config_free( local_config_type * local_config ); -local_ministep_type * local_config_alloc_ministep( local_config_type * local_config , const char * key, analysis_module_type* analysis_module ); -local_ministep_type * local_config_alloc_ministep_copy( local_config_type * local_config , const char * src_key , const char * new_key); -void local_config_set_default_updatestep( local_config_type * local_config , local_updatestep_type * update_step ); -local_updatestep_type * local_config_get_updatestep( const local_config_type * local_config ); -local_ministep_type * local_config_get_ministep( const local_config_type * local_config , const char * key); -void local_config_set_updatestep(local_config_type * local_config, int step1 , int step2 , const char * key); -void local_config_summary_fprintf( const local_config_type * local_config , const char * config_file); -local_obsdata_type * local_config_alloc_obsdata( local_config_type * local_config , const char * obsdata_name ); -bool local_config_has_obsdata( const local_config_type * local_config , const char * obsdata_name); -local_dataset_type * local_config_alloc_dataset( local_config_type * local_config , const char * key ); -bool local_config_has_dataset( const local_config_type * local_config , const char * key); -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/local_context.h b/ThirdParty/Ert/libenkf/include/ert/enkf/local_context.h deleted file mode 100644 index 7bc72b3a30..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/local_context.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'local_context.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#ifndef ERT_LOCAL_CONTEXT_H -#define ERT_LOCAL_CONTEXT_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include -#include -#include - -#include -#include -#include - -#define GLOBAL_GRID "GLOBAL_GRID" - - typedef struct local_context_struct local_context_type; - - - local_context_type * local_context_alloc( const ecl_grid_type * ecl_grid ); - void local_context_free( local_context_type * context ); - - ecl_region_type * local_context_get_ecl_region( local_context_type * context , const char * region_name); - void local_context_create_ecl_region( local_context_type * context , const char * grid_name , const char * region_name , bool preselect ); - - void local_context_load_file( local_context_type * context , const char * filename , const char * file_key ); - ecl_file_type * local_context_get_file( local_context_type * context , const char * file_key ); - - void local_context_add_polygon( local_context_type * context , const char * polygon_name); - geo_polygon_type * local_context_get_polygon( local_context_type * context , const char * polygon_name ); - void local_context_load_polygon( local_context_type * context , const char * polygon_name , const char * polygon_file); - - void local_context_load_surface( local_context_type * context , const char * surface_name , const char * surface_file); - geo_surface_type * local_context_get_surface( local_context_type * context , const char * surface_name ); - - void local_context_create_surface_region( local_context_type * context , const char * surface_name , const char * region_name , bool preselect ); - geo_region_type * local_context_get_surface_region( local_context_type * context , const char * region_name); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/local_dataset.h b/ThirdParty/Ert/libenkf/include/ert/enkf/local_dataset.h deleted file mode 100644 index c7dd92fc6a..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/local_dataset.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'local_dataset.h' is part of ERT - Ensemble based - Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_LOCAL_DATASET_H -#define ERT_LOCAL_DATASET_H - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct local_dataset_struct local_dataset_type; - -local_dataset_type * local_dataset_alloc_copy( local_dataset_type * src_dataset , const char * copy_name ); -local_dataset_type * local_dataset_alloc( const char * name ); -void local_dataset_free( local_dataset_type * dataset ); -void local_dataset_free__( void * arg ); -void local_dataset_add_node(local_dataset_type * dataset, const char *node_key); -void local_dataset_del_node( local_dataset_type * dataset , const char * node_key); -void local_dataset_clear( local_dataset_type * dataset); -const char * local_dataset_get_name( const local_dataset_type * dataset); -void local_dataset_fprintf( const local_dataset_type * dataset , FILE * stream); -void local_dataset_summary_fprintf( const local_dataset_type * dataset , FILE * stream); -active_list_type * local_dataset_get_node_active_list(const local_dataset_type * dataset , const char * node_key ); -stringlist_type * local_dataset_alloc_keys( const local_dataset_type * dataset ); -int local_dataset_get_size( const local_dataset_type * dataset ); -void local_dataset_del_node( local_dataset_type * dataset , const char * node_key); -void local_dataset_clear( local_dataset_type * dataset); -bool local_dataset_has_key(const local_dataset_type * dataset, const char * key); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/local_ministep.h b/ThirdParty/Ert/libenkf/include/ert/enkf/local_ministep.h deleted file mode 100644 index cedad78346..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/local_ministep.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'local_ministep.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_LOCAL_MINISTEP_H -#define ERT_LOCAL_MINISTEP_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include - -#include -#include -#include -#include - -typedef struct local_ministep_struct local_ministep_type; - -local_ministep_type * local_ministep_alloc(const char * name, analysis_module_type* analysis_module); -void local_ministep_free(local_ministep_type * ministep); -void local_ministep_free__(void * arg); -void local_ministep_add_obs(local_ministep_type * ministep, const char * obs_key); -active_list_type * local_ministep_get_node_active_list(const local_ministep_type * ministep , const char * node_key ); -hash_iter_type * local_ministep_alloc_dataset_iter( const local_ministep_type * ministep ); -stringlist_type * local_ministep_alloc_data_keys( const local_ministep_type * ministep ); -bool local_ministep_has_data_key(const local_ministep_type * ministep , const char * key); -local_ministep_type * local_ministep_alloc_copy( const local_ministep_type * src , const char * name); -void local_ministep_del_obs( local_ministep_type * ministep , const char * obs_key); -void local_ministep_del_node( local_ministep_type * ministep , const char * node_key); -const char * local_ministep_get_name( const local_ministep_type * ministep ); -void local_ministep_clear_nodes( local_ministep_type * ministep); -void local_ministep_clear_observations( local_ministep_type * ministep); -void local_ministep_fprintf( const local_ministep_type * ministep , FILE * stream ); -void local_ministep_summary_fprintf( const local_ministep_type * ministep , FILE * stream); -void local_ministep_add_dataset( local_ministep_type * ministep , const local_dataset_type * dataset); -void local_ministep_add_obsdata( local_ministep_type * ministep , local_obsdata_type * obsdata); -void local_ministep_add_obsdata_node( local_ministep_type * ministep , local_obsdata_node_type * obsdatanode); -local_obsdata_type * local_ministep_get_obsdata(const local_ministep_type * ministep); -local_dataset_type * local_ministep_get_dataset( const local_ministep_type * ministep, const char * dataset_name); -bool local_ministep_has_dataset( const local_ministep_type * ministep, const char * dataset_name); -int local_ministep_get_num_dataset( const local_ministep_type * ministep ); -bool local_ministep_has_analysis_module( const local_ministep_type * ministep ); -analysis_module_type* local_ministep_get_analysis_module( const local_ministep_type * ministep ); - -UTIL_SAFE_CAST_HEADER(local_ministep); -UTIL_IS_INSTANCE_HEADER(local_ministep); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/local_obsdata.h b/ThirdParty/Ert/libenkf/include/ert/enkf/local_obsdata.h deleted file mode 100644 index 9517d513f0..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/local_obsdata.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'local_obsdata.h' - - ERT 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. - - ERT 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 - for more details. -*/ -#ifndef ERT_LOCAL_OBSDATA_H -#define ERT_LOCAL_OBSDATA_H - -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include - -#include - -typedef struct local_obsdata_struct local_obsdata_type; - - void local_obsdata_free__( void * arg); - bool local_obsdata_has_node( const local_obsdata_type * data , const char * key); - local_obsdata_type * local_obsdata_alloc_copy( const local_obsdata_type * src, const char * target_key); - local_obsdata_type * local_obsdata_alloc( const char * name ); - void local_obsdata_free( local_obsdata_type * data ); - int local_obsdata_get_size( const local_obsdata_type * data ); - bool local_obsdata_add_node( local_obsdata_type * data , local_obsdata_node_type * node ); - local_obsdata_node_type * local_obsdata_iget( const local_obsdata_type * data , int index); - local_obsdata_type * local_obsdata_alloc_wrapper( local_obsdata_node_type * node ); - const char * local_obsdata_get_name( const local_obsdata_type * data); - local_obsdata_node_type * local_obsdata_get( const local_obsdata_type * data , const char * key); - void local_obsdata_clear( local_obsdata_type * data ); - void local_obsdata_del_node( local_obsdata_type * data , const char * key); - void local_obsdata_reset_tstep_list( local_obsdata_type * data , const int_vector_type * step_list); - active_list_type * local_obsdata_get_node_active_list(const local_obsdata_type * obsdata , const char * obs_key ); - void local_obsdata_fprintf( const local_obsdata_type * obsdata , FILE * stream ); - void local_obsdata_summary_fprintf( const local_obsdata_type * obsdata , FILE * stream); - -UTIL_IS_INSTANCE_HEADER( local_obsdata ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/local_obsdata_node.h b/ThirdParty/Ert/libenkf/include/ert/enkf/local_obsdata_node.h deleted file mode 100644 index ab1bd33c19..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/local_obsdata_node.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'local_obsdata_node.h' - - ERT 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. - - ERT 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 - for more details. -*/ -#ifndef ERT_LOCAL_OBSDATA_NODE_H -#define ERT_LOCAL_OBSDATA_NODE_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include - - - typedef struct local_obsdata_node_struct local_obsdata_node_type; - - local_obsdata_node_type * local_obsdata_node_alloc( const char * obs_key , bool all_timestep_active ); - local_obsdata_node_type * local_obsdata_node_alloc_copy( const local_obsdata_node_type * src); - const char * local_obsdata_node_get_key( const local_obsdata_node_type * node ); - void local_obsdata_node_free( local_obsdata_node_type * node ); - void local_obsdata_node_free__( void * arg ); - active_list_type * local_obsdata_node_get_active_list( const local_obsdata_node_type * node ); - void local_obsdata_node_copy_active_list( local_obsdata_node_type * node , const active_list_type * active_list); - void local_obsdata_node_add_tstep( local_obsdata_node_type * node, int tstep); - void local_obsdata_node_add_range( local_obsdata_node_type * node, int step1, int step2); - - bool local_obsdata_node_tstep_active( const local_obsdata_node_type * node , int tstep ); - bool local_obsdata_node_all_timestep_active( const local_obsdata_node_type * node); - bool local_obsdata_node_has_tstep( const local_obsdata_node_type * node , int tstep); - void local_obsdata_node_reset_tstep_list( local_obsdata_node_type * node , const int_vector_type * step_list); - void local_obsdata_node_set_all_timestep_active( local_obsdata_node_type * node, bool flag); - - UTIL_IS_INSTANCE_HEADER( local_obsdata_node ); - UTIL_SAFE_CAST_HEADER( local_obsdata_node ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/local_updatestep.h b/ThirdParty/Ert/libenkf/include/ert/enkf/local_updatestep.h deleted file mode 100644 index a56de59c75..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/local_updatestep.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'local_updatestep.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_LOCAL_UPDATESTEP_H -#define ERT_LOCAL_UPDATESTEP_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -typedef struct local_updatestep_struct local_updatestep_type; - -local_updatestep_type * local_updatestep_alloc( const char * name ); -void local_updatestep_free__(void * arg); -void local_updatestep_add_ministep( local_updatestep_type * updatestep , local_ministep_type * ministep); -local_ministep_type * local_updatestep_iget_ministep( const local_updatestep_type * updatestep , int index); -local_obsdata_type * local_updatestep_iget_obsdata( const local_updatestep_type * updatestep , int index); -int local_updatestep_get_num_ministep( const local_updatestep_type * updatestep ); -local_updatestep_type * local_updatestep_alloc_copy( const local_updatestep_type * src , const char * name ); -void local_updatestep_fprintf( const local_updatestep_type * updatestep , FILE * stream); -const char * local_updatestep_get_name( const local_updatestep_type * updatestep ); -bool local_updatestep_has_data_key( const local_updatestep_type * update_step , const char * key); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/meas_data.h b/ThirdParty/Ert/libenkf/include/ert/enkf/meas_data.h deleted file mode 100644 index 9a7e12b234..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/meas_data.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'meas_data.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_MEAS_DATA_H -#define ERT_MEAS_DATA_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include -#include -#include -#include - -typedef struct meas_data_struct meas_data_type; -typedef struct meas_block_struct meas_block_type; - -UTIL_IS_INSTANCE_HEADER( meas_data ); -UTIL_SAFE_CAST_HEADER( meas_block ); - -bool meas_block_iens_active( const meas_block_type * meas_block , int iens); -void meas_block_iset( meas_block_type * meas_block , int iens , int iobs , double value); -double meas_block_iget( const meas_block_type * meas_block , int iens , int iobs); -double meas_block_iget_ens_mean( meas_block_type * meas_block , int iobs ); -double meas_block_iget_ens_std( meas_block_type * meas_block , int iobs); -void meas_block_deactivate( meas_block_type * meas_block , int iobs ); -bool meas_block_iget_active( const meas_block_type * meas_block , int iobs); -void meas_data_fprintf( const meas_data_type * matrix , FILE * stream); - -void meas_data_reset(meas_data_type * ); - meas_data_type * meas_data_alloc( const bool_vector_type * ens_mask); -void meas_data_free(meas_data_type * ); -void meas_data_add(meas_data_type * , int , double ); -matrix_type * meas_data_allocS(const meas_data_type * matrix); -int meas_data_get_active_obs_size( const meas_data_type * matrix ); -void meas_data_deactivate(meas_data_type * meas_data, int index); -int meas_data_get_active_ens_size( const meas_data_type * meas_data ); -int meas_data_get_nrobs( const meas_data_type * meas_data ); -meas_block_type * meas_data_add_block( meas_data_type * matrix , const char * obs_key , int report_step , int obs_size); -int meas_data_get_num_blocks( const meas_data_type * meas_block ); -meas_block_type * meas_data_iget_block( const meas_data_type * matrix , int block_mnr); -const meas_block_type * meas_data_iget_block_const( const meas_data_type * matrix , int block_nr ); -int meas_block_get_total_obs_size( const meas_block_type * meas_block ); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/member_config.h b/ThirdParty/Ert/libenkf/include/ert/enkf/member_config.h deleted file mode 100644 index 64386e99d2..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/member_config.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'member_config.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_MEMBER_CONFIG_H -#define ERT_MEMBER_CONFIG_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include - -#include - -#include -#include -#include -#include - - - -typedef struct member_config_struct member_config_type; - - const char * member_config_get_jobname( const member_config_type * member_config ); - void member_config_set_keep_runpath(member_config_type * member_config , keep_runpath_type keep_runpath); - keep_runpath_type member_config_get_keep_runpath(const member_config_type * member_config); - int member_config_get_iens( const member_config_type * member_config ); - const char * member_config_update_jobname(member_config_type * member_config , const char * jobname_fmt , const subst_list_type * subst_list); - const char * member_config_update_eclbase(member_config_type * member_config , const ecl_config_type * ecl_config , const subst_list_type * subst_list); - void member_config_free(member_config_type * member_config) ; - const char * member_config_get_eclbase( const member_config_type * member_config ); - const char * member_config_get_casename( const member_config_type * member_config ); - - bool member_config_pre_clear_runpath(const member_config_type * member_config); - void member_config_set_pre_clear_runpath(member_config_type * member_config , bool pre_clear_runpath); - - - member_config_type * member_config_alloc(int iens , - const char * casename , - bool pre_clear_runpath , - keep_runpath_type keep_runpath , - const ecl_config_type * ecl_config , - const ensemble_config_type * ensemble_config); - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/misfit_ensemble.h b/ThirdParty/Ert/libenkf/include/ert/enkf/misfit_ensemble.h deleted file mode 100644 index e6ed2ebcd0..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/misfit_ensemble.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'misfit_table.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_MISFIT_ENSEMBLE_H -#define ERT_MISFIT_ENSEMBLE_H - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include - -#define MISFIT_DEFAULT_RANKING_KEY "DEFAULT" -#include - - - - void misfit_ensemble_fread( misfit_ensemble_type * misfit_ensemble , FILE * stream ); - void misfit_ensemble_clear( misfit_ensemble_type * table); - misfit_ensemble_type * misfit_ensemble_alloc( ); - void misfit_ensemble_free( misfit_ensemble_type * table ); - void misfit_ensemble_fwrite( const misfit_ensemble_type * misfit_ensemble , FILE * stream); - bool misfit_ensemble_initialized( const misfit_ensemble_type * misfit_ensemble ); - - void misfit_ensemble_initialize( misfit_ensemble_type * misfit_ensemble , - const ensemble_config_type * ensemble_config , - const enkf_obs_type * enkf_obs , - enkf_fs_type * fs , - int ens_size , - int history_length, - bool force_init); - - void misfit_ensemble_set_ens_size( misfit_ensemble_type * misfit_ensemble , int ens_size); - int misfit_ensemble_get_ens_size( const misfit_ensemble_type * misfit_ensemble ); - - misfit_member_type * misfit_ensemble_iget_member( const misfit_ensemble_type * table , int iens); - - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/misfit_ensemble_typedef.h b/ThirdParty/Ert/libenkf/include/ert/enkf/misfit_ensemble_typedef.h deleted file mode 100644 index 2c5adff7bf..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/misfit_ensemble_typedef.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef ERT_MISFIT_ENSEMBLE_TYPEDEF_H -#define ERT_MISFIT_ENSEMBLE_TYPEDEF_H - -typedef struct misfit_ensemble_struct misfit_ensemble_type; - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/misfit_member.h b/ThirdParty/Ert/libenkf/include/ert/enkf/misfit_member.h deleted file mode 100644 index 72d11ec372..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/misfit_member.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'misfit_member.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_MISFIT_MEMBER_H -#define ERT_MISFIT_MEMBER_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include - - typedef struct misfit_member_struct misfit_member_type; - misfit_ts_type * misfit_member_get_ts( const misfit_member_type * member , const char * obs_key ); - bool misfit_member_has_ts( const misfit_member_type * member , const char * obs_key ); - misfit_member_type * misfit_member_fread_alloc( FILE * stream ); - void misfit_member_fwrite( const misfit_member_type * node , FILE * stream ); - void misfit_member_update( misfit_member_type * node , const char * obs_key , int history_length , int iens , const double ** work_chi2); - void misfit_member_free__( void * node ); - misfit_member_type * misfit_member_alloc(int iens); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/misfit_ranking.h b/ThirdParty/Ert/libenkf/include/ert/enkf/misfit_ranking.h deleted file mode 100644 index 447ddfed3e..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/misfit_ranking.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'misfit_ranking.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_MISFIT_RANKING_H -#define ERT_MISFIT_RANKING_H - -#include -#include -#include - -#include -#include -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - typedef struct misfit_ranking_struct misfit_ranking_type; - - UTIL_IS_INSTANCE_HEADER( misfit_ranking ); - UTIL_SAFE_CAST_HEADER( misfit_ranking ); - - void misfit_ranking_fprintf( const misfit_ranking_type * misfit_ranking , const char * filename); - void misfit_ranking_display( const misfit_ranking_type * misfit_ranking , FILE * stream); - misfit_ranking_type * misfit_ranking_alloc(const misfit_ensemble_type * ensemble , const stringlist_type * sort_keys , const int_vector_type * steps, const char * ranking_key); - void misfit_ranking_free( misfit_ranking_type * misfit_ranking ); - void misfit_ranking_free__( void * arg ); - const perm_vector_type * misfit_ranking_get_permutation( const misfit_ranking_type * misfit_ranking ); - void misfit_ranking_iset_invalid( misfit_ranking_type * misfit_ranking , int iens ); - void misfit_ranking_iset( misfit_ranking_type * misfit_ranking , int iens , hash_type * obs_hash , double total_misfit); - void misfit_ranking_init_sort( misfit_ranking_type * misfit_ranking ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/misfit_ts.h b/ThirdParty/Ert/libenkf/include/ert/enkf/misfit_ts.h deleted file mode 100644 index ad3994045a..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/misfit_ts.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'misfit_ts.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#ifndef ERT_MISFIT_TS_H -#define ERT_MISFIT_TS_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - - typedef struct misfit_ts_struct misfit_ts_type; - - - void misfit_ts_fwrite( const misfit_ts_type * misfit_ts , FILE * stream ); - double misfit_ts_eval( const misfit_ts_type * ts , const int_vector_type * steps ); - misfit_ts_type * misfit_ts_alloc(int history_length); - misfit_ts_type * misfit_ts_fread_alloc( FILE * stream ); - void misfit_ts_free__( void * vector ); - void misfit_ts_iset( misfit_ts_type * vector , int time_index , double value ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/model_config.h b/ThirdParty/Ert/libenkf/include/ert/enkf/model_config.h deleted file mode 100644 index 6f07abb516..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/model_config.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'model_config.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_MODEL_CONFIG_H -#define ERT_MODEL_CONFIG_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include -#include - -#include -#include - -#include -#include - -#include -#include - -#include - -#include -#include -#include - - typedef struct model_config_struct model_config_type; - - const char * model_config_get_jobname_fmt( const model_config_type * model_config ); - void model_config_set_jobname_fmt( model_config_type * model_config , const char * jobname_fmt); - const char * model_config_get_case_table_file( const model_config_type * model_config ); - void model_config_set_case_table( model_config_type * model_config , int ens_size , const char * case_table_file ); - void model_config_set_enspath( model_config_type * model_config , const char * enspath); - void model_config_set_rftpath( model_config_type * model_config , const char * rftpath); - void model_config_set_dbase_type( model_config_type * model_config , const char * dbase_type_string); - void * model_config_get_dbase_args( const model_config_type * model_config ); - const char * model_config_get_enspath( const model_config_type * model_config); - const char * model_config_get_rftpath( const model_config_type * model_config); - fs_driver_impl model_config_get_dbase_type(const model_config_type * model_config ); - const ecl_sum_type * model_config_get_refcase( const model_config_type * model_config ); - void model_config_init_internalization( model_config_type * ); - void model_config_set_internalize_state( model_config_type * , int ); - void model_config_set_load_state( model_config_type * , int ); - int model_config_get_history_length(const model_config_type * ); - bool model_config_has_prediction(const model_config_type * ); - bool model_config_has_history(const model_config_type * config); - int model_config_get_last_history_restart(const model_config_type * ); - time_map_type * model_config_get_external_time_map( const model_config_type * config); - void model_config_init(model_config_type * model_config , const config_content_type * , int ens_size , const ext_joblist_type * , int , const sched_file_type * , const ecl_sum_type * refcase); - void model_config_free(model_config_type *); - bool model_config_runpath_requires_iter( const model_config_type * model_config ); - path_fmt_type * model_config_get_runpath_fmt(const model_config_type * ); - history_type * model_config_get_history(const model_config_type * ); - forward_model_type * model_config_get_forward_model( const model_config_type * ); - bool model_config_internalize_state( const model_config_type *, int ); - bool model_config_load_state( const model_config_type *, int ); - const char * model_config_iget_casename( const model_config_type * model_config , int index); - //void model_config_set_max_resample( model_config_type * model_config , int max_resample ); - //int model_config_get_max_resample(const model_config_type * model_config ); - void model_config_set_max_internal_submit(model_config_type * config, int max_resample); - int model_config_get_max_internal_submit( const model_config_type * config ); - bool model_config_select_runpath( model_config_type * model_config , const char * path_key); - void model_config_add_runpath( model_config_type * model_config , const char * path_key , const char * fmt ); - const char * model_config_get_runpath_as_char( const model_config_type * model_config ); - history_source_type model_config_get_history_source( const model_config_type * model_config ); - void model_config_set_refcase( model_config_type * model_config , const ecl_sum_type * refcase ); - void model_config_fprintf_config( const model_config_type * model_config , int ens_size ,FILE * stream ); - model_config_type * model_config_alloc(); - bool model_config_select_history( model_config_type * model_config , history_source_type source_type, const sched_file_type * schede_file , const ecl_sum_type * refcase); - void model_config_set_runpath(model_config_type * model_config , const char * fmt); - void model_config_set_gen_kw_export_file( model_config_type * model_config, const char * file_name); - const char * model_config_get_gen_kw_export_file( const model_config_type * model_config); - - UTIL_IS_INSTANCE_HEADER( model_config); - -#ifdef __cplusplus -} -#endif -#endif - - diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/obs_data.h b/ThirdParty/Ert/libenkf/include/ert/enkf/obs_data.h deleted file mode 100644 index 7d250fc2ef..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/obs_data.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'obs_data.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_OBS_DATA_H -#define ERT_OBS_DATA_H -#ifdef __cplusplus -extern "C" { -#endif -#include -#include - -#include -#include -#include - -#include -#include - -typedef struct obs_data_struct obs_data_type; -typedef struct obs_block_struct obs_block_type; - -active_type obs_block_iget_active_mode( const obs_block_type * obs_block , int iobs); -const char * obs_data_iget_keyword( const obs_data_type * obs_data , int index ); -double obs_data_iget_value( const obs_data_type * obs_data , int index ); -double obs_data_iget_std( const obs_data_type * obs_data , int index ); -active_type obs_data_iget_active_mode( const obs_data_type * obs_data , int index ); -void obs_block_deactivate( obs_block_type * obs_block , int iobs , bool verbose , const char * msg); -int obs_block_get_size( const obs_block_type * obs_block ); -void obs_block_iset( obs_block_type * obs_block , int iobs , double value , double std); -void obs_block_iset_missing( obs_block_type * obs_block , int iobs ); - -double obs_block_iget_std( const obs_block_type * obs_block , int iobs); -double obs_block_iget_value( const obs_block_type * obs_block , int iobs); -bool obs_block_iget_active( const obs_block_type * obs_block , int iobs); - - -obs_block_type * obs_data_iget_block( obs_data_type * obs_data , int index ); -const obs_block_type * obs_data_iget_block_const( const obs_data_type * obs_data , int block_nr); -obs_block_type * obs_data_get_block( obs_data_type * obs_data , const char * obs_key ); -obs_block_type * obs_data_add_block( obs_data_type * obs_data , const char * obs_key , int obs_size , matrix_type * error_covar , bool error_covar_owner); - -obs_data_type * obs_data_alloc(double global_std_scaling); -void obs_data_free(obs_data_type *); -void obs_data_reset(obs_data_type * obs_data); -matrix_type * obs_data_allocD(const obs_data_type * obs_data , const matrix_type * E , const matrix_type * S); -matrix_type * obs_data_allocR(const obs_data_type * obs_data ); -matrix_type * obs_data_allocdObs(const obs_data_type * obs_data ); -//matrix_type * obs_data_alloc_innov(const obs_data_type * obs_data , const meas_data_type * meas_data , int active_size); -matrix_type * obs_data_allocE(const obs_data_type * obs_data , rng_type * rng , int active_ens_size); -matrix_type * obs_data_allocE_non_centred(const obs_data_type * obs_data , rng_type * rng , int ens_size); - void obs_data_scale(const obs_data_type * obs_data , matrix_type *S , matrix_type *E , matrix_type *D , matrix_type *R , matrix_type * O); -void obs_data_scale_kernel(const obs_data_type * obs_data , matrix_type *S , matrix_type *E , matrix_type *D , double *dObs); -void obs_data_fprintf(const obs_data_type * , FILE *); -void obs_data_iget_value_std(const obs_data_type * obs_data , int index , double * value , double * std); -int obs_data_get_active_size(const obs_data_type * obs_data ); -int obs_data_get_total_size( const obs_data_type * obs_data ); -int obs_data_get_num_blocks( const obs_data_type * obs_data ); -const char * obs_block_get_key( const obs_block_type * obs_block) ; -double obs_data_iget_value( const obs_data_type * obs_data , int total_index ); -double obs_data_iget_std( const obs_data_type * obs_data , int total_index ); - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/obs_vector.h b/ThirdParty/Ert/libenkf/include/ert/enkf/obs_vector.h deleted file mode 100644 index 2c1224a3aa..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/obs_vector.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'obs_vector.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_OBS_VECTOR_H -#define ERT_OBS_VECTOR_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include -#include - -#include - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - - typedef void (obs_free_ftype) (void *); - typedef void (obs_get_ftype) (const void * , obs_data_type * , enkf_fs_type *, int , const active_list_type * ); - typedef void (obs_meas_ftype) (const void * , const void *, node_id_type , meas_data_type * , const active_list_type * ); - typedef void (obs_user_get_ftype) (void * , const char * , double * , double * , bool *); - typedef void (obs_update_std_scale_ftype) (void * , double , const active_list_type * ); - typedef double (obs_chi2_ftype) (const void * , const void *, node_id_type ); - - typedef enum { GEN_OBS = 1, - SUMMARY_OBS = 2, - BLOCK_OBS = 3} obs_impl_type; - - typedef struct obs_vector_struct obs_vector_type; - - - void obs_vector_clear_nodes( obs_vector_type * obs_vector ); - void obs_vector_del_node(obs_vector_type * obs_vector , int index); - void obs_vector_free(obs_vector_type * ); - int obs_vector_get_num_active(const obs_vector_type * ); - bool obs_vector_iget_active(const obs_vector_type * , int ); - void obs_vector_iget_observations(const obs_vector_type * , int , obs_data_type * , const active_list_type * active_list, enkf_fs_type * fs); - bool obs_vector_has_data( const obs_vector_type * obs_vector , const bool_vector_type * active_mask , enkf_fs_type * fs); - void obs_vector_measure(const obs_vector_type * , enkf_fs_type * fs, int report_step , const int_vector_type * ens_active_list , meas_data_type * , const active_list_type * active_list); - const char * obs_vector_get_state_kw(const obs_vector_type * ); - const char * obs_vector_get_key(const obs_vector_type * ); - obs_impl_type obs_vector_get_impl_type(const obs_vector_type * ); - int obs_vector_get_active_report_step(const obs_vector_type * ); - const int_vector_type * obs_vector_get_step_list(const obs_vector_type * vector); - void obs_vector_user_get(const obs_vector_type * obs_vector , const char * index_key , int report_step , double * value , double * std , bool * valid); - int obs_vector_get_next_active_step(const obs_vector_type * , int ); - void * obs_vector_iget_node(const obs_vector_type * , int ); - obs_vector_type * obs_vector_alloc_from_GENERAL_OBSERVATION(const conf_instance_type * , time_map_type * obs_time , const ensemble_config_type * ); - void obs_vector_load_from_SUMMARY_OBSERVATION(obs_vector_type * obs_vector , const conf_instance_type * , time_map_type * obs_time , ensemble_config_type * ); - bool obs_vector_load_from_HISTORY_OBSERVATION(obs_vector_type * obs_vector , const conf_instance_type * , time_map_type * obs_time , const history_type * , ensemble_config_type * , double std_cutoff ); - obs_vector_type * obs_vector_alloc_from_BLOCK_OBSERVATION(const conf_instance_type * , const ecl_grid_type * grid , time_map_type * obs_time , const ecl_sum_type * refcase , ensemble_config_type * ); - void obs_vector_set_config_node(obs_vector_type * , const enkf_config_node_type * ); - obs_vector_type * obs_vector_alloc(obs_impl_type obs_type , const char * obs_key , enkf_config_node_type * config_node, int num_reports); - void obs_vector_scale_std(obs_vector_type * obs_vector, const local_obsdata_node_type * local_node , double std_multiplier); - void obs_vector_install_node(obs_vector_type * obs_vector , int obs_index , void * node ); - - double obs_vector_chi2(const obs_vector_type * , enkf_fs_type * , node_id_type node_id); - - void obs_vector_ensemble_chi2(const obs_vector_type * obs_vector , - enkf_fs_type * fs, - bool_vector_type * valid , - int step1 , int step2 , - int iens1 , int iens2 , - double ** chi2); - - double obs_vector_total_chi2(const obs_vector_type * , enkf_fs_type * , int ); - void obs_vector_ensemble_total_chi2(const obs_vector_type * , enkf_fs_type * , int , double * ); - enkf_config_node_type * obs_vector_get_config_node(const obs_vector_type * ); - const char * obs_vector_get_obs_key( const obs_vector_type * obs_vector); - local_obsdata_node_type * obs_vector_alloc_local_node(const obs_vector_type * obs_vector); - - - - UTIL_IS_INSTANCE_HEADER(obs_vector); - UTIL_SAFE_CAST_HEADER(obs_vector); - VOID_FREE_HEADER(obs_vector); - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/pca_plot_data.h b/ThirdParty/Ert/libenkf/include/ert/enkf/pca_plot_data.h deleted file mode 100644 index d758e78473..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/pca_plot_data.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'pca_plot_data.h' - - ERT 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. - - ERT 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 - for more details. -*/ -#ifndef ERT_PCA_PLOT_DATA_H -#define ERT_PCA_PLOT_DATA_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -#include - - typedef struct pca_plot_data_struct pca_plot_data_type; - - pca_plot_data_type * pca_plot_data_alloc( const char * name , const matrix_type * PC, const matrix_type * PC_obs, const double_vector_type * singular_values); - const double_vector_type * pca_plot_data_get_singular_values( const pca_plot_data_type * plot_data ); - void pca_plot_data_free( pca_plot_data_type * plot_data ); - const pca_plot_vector_type * pca_plot_data_iget_vector( const pca_plot_data_type * plot_data , int ivec); - int pca_plot_data_get_size( const pca_plot_data_type * plot_data ); - const char * pca_plot_data_get_name( const pca_plot_data_type * plot_data ); - int pca_plot_data_get_ens_size( const pca_plot_data_type * plot_data ); - void pca_plot_data_free__( void * arg ); - - UTIL_IS_INSTANCE_HEADER( pca_plot_data ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/pca_plot_vector.h b/ThirdParty/Ert/libenkf/include/ert/enkf/pca_plot_vector.h deleted file mode 100644 index 21ff2b4e65..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/pca_plot_vector.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'pca_plot_vector.h' - - ERT 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. - - ERT 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 - for more details. -*/ -#ifndef ERT_PCA_PLOT_VECTOR_H -#define ERT_PCA_PLOT_VECTOR_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - - typedef struct pca_plot_vector_struct pca_plot_vector_type; - - pca_plot_vector_type * pca_plot_vector_alloc( int component , const matrix_type * PC, const matrix_type * PC_obs, const double_vector_type * singular_values); - - void pca_plot_vector_free( pca_plot_vector_type * plot_vector ); - bool pca_plot_assert_input( const matrix_type * PC, const matrix_type * PC_obs , const double_vector_type * singular_values); - void pca_plot_vector_free__( void * arg ); - double pca_plot_vector_get_obs_value( const pca_plot_vector_type * vector ); - double pca_plot_vector_get_singular_value( const pca_plot_vector_type * vector ); - double pca_plot_vector_iget_sim_value( const pca_plot_vector_type * vector , int sim_index); - int pca_plot_vector_get_size( const pca_plot_vector_type * vector ); - - UTIL_IS_INSTANCE_HEADER( pca_plot_vector ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/plain_driver.h b/ThirdParty/Ert/libenkf/include/ert/enkf/plain_driver.h deleted file mode 100644 index b66774e9e9..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/plain_driver.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'plain_driver.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_PLAIN_DRIVER_H -#define ERT_PLAIN_DRIVER_H - -#include -#include - -#include - -typedef struct plain_driver_struct plain_driver_type; - -void plain_driver_create_fs( FILE * stream , fs_driver_enum driver_type , const char * node_fmt , const char * vector_fmt); -void * plain_driver_open(FILE * fstab_stream , const char * path); -void plain_driver_fskip(FILE * fstab_stream ); - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/plain_driver_obs.h b/ThirdParty/Ert/libenkf/include/ert/enkf/plain_driver_obs.h deleted file mode 100644 index cc7987bd15..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/plain_driver_obs.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'plain_driver_obs.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_PLAIN_DRIVER_OBS_H -#define ERT_PLAIN_DRIVER_OBS_H -#ifdef __cplusplus -extern "C" { -#endif -#include - -typedef struct plain_driver_obs_struct plain_driver_obs_type; - -plain_driver_obs_type * plain_driver_obs_fread_alloc(const char * , FILE * ); - void * plain_driver_obs_alloc(const char * , const char *); -void plain_driver_obs_README(const char * ); -void plain_driver_obs_fwrite_mount_info(FILE * stream , const char * ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/plot_settings.h b/ThirdParty/Ert/libenkf/include/ert/enkf/plot_settings.h deleted file mode 100644 index eb8f762ae3..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/plot_settings.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'plot_settings.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_PLOT_SETTINGS_H -#define ERT_PLOT_SETTINGS_H - -#include -#include - -void plot_settings_init(config_settings_type * setting); -void plot_settings_add_config_items( config_parser_type * config ); - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/ranking_common.h b/ThirdParty/Ert/libenkf/include/ert/enkf/ranking_common.h deleted file mode 100644 index d9e423dccb..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/ranking_common.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'ranking_common.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_RANKING_COMMON_H -#define ERT_RANKING_COMMON_H -#include - -#define INVALID_RANKING_VALUE INFINITY - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/ranking_table.h b/ThirdParty/Ert/libenkf/include/ert/enkf/ranking_table.h deleted file mode 100644 index 5b2753fd7d..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/ranking_table.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'ranking_table.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#ifndef ERT_RANKING_TABLE_H -#define ERT_RANKING_TABLE_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include - -#include - - typedef struct ranking_table_struct ranking_table_type; - - void ranking_table_set_ens_size( ranking_table_type * table, int ens_size); - ranking_table_type * ranking_table_alloc( ) ; - void ranking_table_free( ranking_table_type * table ); - - void ranking_table_add_data_ranking( ranking_table_type * ranking_table , - bool sort_increasing , - const char * ranking_key , - const char * user_key , - const char * key_index , - enkf_fs_type * fs , - const enkf_config_node_type * config_node , - int step); - - bool ranking_table_has_ranking( const ranking_table_type * ranking_table , const char * ranking_key ); - bool ranking_table_display_ranking( const ranking_table_type * ranking_table , const char * ranking_key ); - bool ranking_table_fwrite_ranking( const ranking_table_type * ranking_table , const char * ranking_key, const char * filename ); - - void ranking_table_add_misfit_ranking( ranking_table_type * ranking_table , - const misfit_ensemble_type * misfit_ensemble , - const stringlist_type * obs_keys , - const int_vector_type * steps, - const char * ranking_key); - - - int ranking_table_get_size( const ranking_table_type * ranking_table ); - const perm_vector_type * ranking_table_get_permutation( const ranking_table_type * ranking_table , const char * ranking_key); - -#ifdef __cplusplus -} -#endif - - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/rng_config.h b/ThirdParty/Ert/libenkf/include/ert/enkf/rng_config.h deleted file mode 100644 index 695be37e12..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/rng_config.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rng_config.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_RNG_CONFIG_H -#define ERT_RNG_CONFIG_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include -#include - -typedef struct rng_config_struct rng_config_type; - - void rng_config_fprintf_config( rng_config_type * rng_config , FILE * stream ); - void rng_config_init( rng_config_type * rng_config , config_content_type * config ); - void rng_config_set_type( rng_config_type * rng_config , rng_alg_type type); - rng_alg_type rng_config_get_type(const rng_config_type * rng_config ); - const char * rng_config_get_seed_load_file( const rng_config_type * rng_config ); - void rng_config_set_seed_load_file( rng_config_type * rng_config , const char * seed_load_file); - const char * rng_config_get_seed_store_file( const rng_config_type * rng_config ); - void rng_config_set_seed_store_file( rng_config_type * rng_config , const char * seed_store_file); - rng_config_type * rng_config_alloc( ); - void rng_config_free( rng_config_type * rng); - void rng_config_add_config_items( config_parser_type * config ); - rng_type * rng_config_alloc_init_rng( const rng_config_type * rng_config); - void rng_config_init_rng(const rng_config_type * rng_config, rng_type * rng ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/run_arg.h b/ThirdParty/Ert/libenkf/include/ert/enkf/run_arg.h deleted file mode 100644 index 246e14062b..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/run_arg.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'run_arg.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_RUN_ARG_H -#define ERT_RUN_ARG_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -#include -#include -#include - - - -UTIL_SAFE_CAST_HEADER( run_arg ); -UTIL_IS_INSTANCE_HEADER( run_arg ); - - - run_arg_type * run_arg_alloc_ENSEMBLE_EXPERIMENT(enkf_fs_type * fs , int iens , int iter , const char * runpath); - run_arg_type * run_arg_alloc_INIT_ONLY(enkf_fs_type * init_fs , int iens , int iter , const char * runpath); - run_arg_type * run_arg_alloc_SMOOTHER_RUN(enkf_fs_type * simulate_fs , enkf_fs_type * update_target_fs , int iens , int iter , const char * runpath); - - int run_arg_get_step1( const run_arg_type * run_arg ); - int run_arg_get_step2( const run_arg_type * run_arg ); - run_mode_type run_arg_get_run_mode( const run_arg_type * run_arg ); - int run_arg_get_load_start( const run_arg_type * run_arg ); - int run_arg_get_iens( const run_arg_type * run_arg ); - int run_arg_get_iter( const run_arg_type * run_arg ); - void run_arg_increase_submit_count( run_arg_type * run_arg ); - void run_arg_set_queue_index( run_arg_type * run_arg , int queue_index); - - void run_arg_free(run_arg_type * run_arg); - void run_arg_free__(void * arg); - const char * run_arg_get_runpath( const run_arg_type * run_arg); - void run_arg_complete_run(run_arg_type * run_arg); - run_status_type run_arg_get_run_status( const run_arg_type * run_arg ); - - int run_arg_get_queue_index( const run_arg_type * run_arg ); - bool run_arg_is_submitted( const run_arg_type * run_arg ); - - bool run_arg_can_retry( const run_arg_type * run_arg ); - - run_status_type run_arg_get_run_status( const run_arg_type * run_arg); - void run_arg_set_run_status( run_arg_type * run_arg , run_status_type run_status); - - enkf_fs_type * run_arg_get_init_fs(const run_arg_type * run_arg); - enkf_fs_type * run_arg_get_update_target_fs(const run_arg_type * run_arg); - enkf_fs_type * run_arg_get_result_fs(const run_arg_type * run_arg); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/run_arg_type.h b/ThirdParty/Ert/libenkf/include/ert/enkf/run_arg_type.h deleted file mode 100644 index 18bdd51f67..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/run_arg_type.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (C) 2016 Statoil ASA, Norway. - - The file 'run_arg_type.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_RUN_ARG_TYPE_H -#define ERT_RUN_ARG_TYPE_H - -typedef struct run_arg_struct run_arg_type; - -#endif - diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/runpath_list.h b/ThirdParty/Ert/libenkf/include/ert/enkf/runpath_list.h deleted file mode 100644 index bf053e37d2..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/runpath_list.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - The file 'runpath_list.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_RUNPATH_LIST_H -#define ERT_RUNPATH_LIST_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define RUNPATH_LIST_DEFAULT_LINE_FMT "%03d %s %s %03d\n" - - - typedef struct runpath_list_struct runpath_list_type; - - void runpath_list_free( runpath_list_type * list ); - runpath_list_type * runpath_list_alloc(const char * export_file ); - int runpath_list_size( const runpath_list_type * list ); - void runpath_list_add( runpath_list_type * list , int iens , int iter, const char * runpath , const char * basename); - void runpath_list_clear( runpath_list_type * list ); - int runpath_list_iget_iens( runpath_list_type * list , int index); - int runpath_list_iget_iter( runpath_list_type * list , int index); - char * runpath_list_iget_runpath( runpath_list_type * list , int index); - char * runpath_list_iget_basename( runpath_list_type * list , int index); - void runpath_list_set_line_fmt( runpath_list_type * list , const char * line_fmt ); - const char * runpath_list_get_line_fmt( const runpath_list_type * list ); - void runpath_list_fprintf( runpath_list_type * list); - const char * runpath_list_get_export_file( const runpath_list_type * list ); - void runpath_list_set_export_file( runpath_list_type * list , const char * export_file ); - - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/scalar_config.h b/ThirdParty/Ert/libenkf/include/ert/enkf/scalar_config.h deleted file mode 100644 index 08f94d08b0..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/scalar_config.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'scalar_config.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SCALAR_CONFIG_H -#define ERT_SCALAR_CONFIG_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include - -typedef struct scalar_config_struct scalar_config_type; - - - -scalar_config_type * scalar_config_alloc_empty(int); -void scalar_config_free(scalar_config_type *); -const char * scalar_config_get_ensfile_ref(const scalar_config_type * ); -const char * scalar_config_get_eclfile_ref(const scalar_config_type * ); -void scalar_config_transform(const scalar_config_type * , const double * , double *); -double scalar_config_transform_item(const scalar_config_type *, double, int); -void scalar_config_fscanf_line(scalar_config_type * , int , FILE * ); -int scalar_config_get_active_size(const scalar_config_type *); - -SAFE_CAST_HEADER(scalar_config) -GET_DATA_SIZE_HEADER(scalar); -VOID_FREE_HEADER(scalar_config); -GET_ACTIVE_LIST_HEADER(scalar); -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/site_config.h b/ThirdParty/Ert/libenkf/include/ert/enkf/site_config.h deleted file mode 100644 index 1e3c893d56..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/site_config.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'site_config.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SITE_CONFIG_H -#define ERT_SITE_CONFIG_H -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include - -#include -#include - -#include -#include -#include - - -typedef struct site_config_struct site_config_type; - - const char * site_config_get_location(); - - bool site_config_has_job_script( const site_config_type * site_config ); - const char * site_config_get_manual_url( const site_config_type * site_config ); - void site_config_set_manual_url( site_config_type * site_config , const char * manual_url ); - const char * site_config_get_default_browser( const site_config_type * site_config ); - void site_config_set_default_browser( site_config_type * site_config , const char * default_browser ); - - const char * site_config_get_license_root_path( const site_config_type * site_config ); - void site_config_set_license_root_path( site_config_type * site_config , const char * license_root_path); - void site_config_init_user_mode( site_config_type * site_config ); - - void site_config_set_num_cpu( site_config_type * site_config , int num_cpu ); - void site_config_update_lsf_request(site_config_type * , const forward_model_type *); - bool site_config_init(site_config_type * site_config , const config_content_type * config); - void site_config_free(site_config_type *); - ext_joblist_type * site_config_get_installed_jobs( const site_config_type * ); - job_queue_type * site_config_get_job_queue( const site_config_type * ); - void site_config_set_ens_size( site_config_type * site_config , int ens_size ); - - void site_config_set_max_running_lsf( site_config_type * site_config , int max_running_lsf); - int site_config_get_max_running_lsf( const site_config_type * site_config ); - void site_config_set_max_running_rsh( site_config_type * site_config , int max_running_rsh); - int site_config_get_max_running_rsh( const site_config_type * site_config); - void site_config_set_max_running_local( site_config_type * site_config , int max_running_local); - int site_config_get_max_running_local( const site_config_type * site_config ); - void site_config_setenv( site_config_type * site_config , const char * variable, const char * value); - hash_type * site_config_get_env_hash( const site_config_type * site_config ); - void site_config_clear_env( site_config_type * site_config ); - void site_config_clear_pathvar( site_config_type * site_config ); - stringlist_type * site_config_get_path_variables( const site_config_type * site_config ); - stringlist_type * site_config_get_path_values( const site_config_type * site_config ); - - void site_config_clear_rsh_host_list( site_config_type * site_config ); - hash_type * site_config_get_rsh_host_list( const site_config_type * site_config ); - void site_config_add_rsh_host( site_config_type * site_config , const char * rsh_host , int max_running); - - void site_config_set_lsf_queue( site_config_type * site_config , const char * lsf_queue); - const char * site_config_get_lsf_queue( const site_config_type * site_config ); - void site_config_set_lsf_request( site_config_type * site_config , const char * lsf_request); - const char * site_config_get_lsf_request( const site_config_type * site_config ); - - const char * site_config_get_job_queue_name( const site_config_type * site_config ); - void site_config_set_job_queue( site_config_type * site_config , const char * queue_name ); - - void site_config_set_rsh_command( site_config_type * site_config , const char * rsh_command); - const char * site_config_get_rsh_command( const site_config_type * site_config ); - void site_config_set_ext_job_search_path(site_config_type * site_config, bool search_path); - - - bool site_config_set_job_script( site_config_type * site_config , const char * job_script ); - const char * site_config_get_job_script( const site_config_type * site_config ); - - void site_config_set_max_submit( site_config_type * site_config , int max_submit ); - int site_config_get_max_submit(const site_config_type * site_config ); - - bool site_config_queue_is_running( const site_config_type * site_config ); - int site_config_install_job(site_config_type * site_config , const char * job_name , const char * install_file); - bool site_config_del_job( site_config_type * site_config , const char * job_name ); - - void site_config_set_umask( site_config_type * site_config , mode_t umask); - mode_t site_config_get_umask( const site_config_type * site_config ); - - site_config_type * site_config_alloc_empty(); - void site_config_add_config_items( config_parser_type * config , bool site_mode); -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/state_map.h b/ThirdParty/Ert/libenkf/include/ert/enkf/state_map.h deleted file mode 100644 index 49a7a378a4..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/state_map.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - The file 'state_map.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_STATE_MAP_H -#define ERT_STATE_MAP_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include - - typedef struct state_map_struct state_map_type; - - - state_map_type * state_map_alloc( ); - state_map_type * state_map_fread_alloc( const char * filename ); - state_map_type * state_map_fread_alloc_readonly( const char * filename ); - state_map_type * state_map_alloc_copy( state_map_type * map ); - bool state_map_is_readonly(const state_map_type * state_map); - void state_map_free( state_map_type * map ); - int state_map_get_size( state_map_type * map); - realisation_state_enum state_map_iget( state_map_type * map , int index); - void state_map_update_undefined( state_map_type * map , int index , realisation_state_enum new_state); - void state_map_update_matching( state_map_type * map , int index , int state_mask , realisation_state_enum new_state); - void state_map_iset( state_map_type * map ,int index , realisation_state_enum state); - bool state_map_equal( state_map_type * map1 , state_map_type * map2); - void state_map_fwrite( state_map_type * map , const char * filename); - bool state_map_fread( state_map_type * map , const char * filename); - void state_map_select_matching( state_map_type * map , bool_vector_type * select_target , int select_mask); - void state_map_deselect_matching( state_map_type * map , bool_vector_type * select_target , int select_mask); - void state_map_set_from_inverted_mask(state_map_type * map, const bool_vector_type *mask , realisation_state_enum state); - void state_map_set_from_mask(state_map_type * map, const bool_vector_type *mask , realisation_state_enum state); - int state_map_count_matching( state_map_type * state_map , int mask); - bool state_map_legal_transition( realisation_state_enum state1 , realisation_state_enum state2); - - UTIL_IS_INSTANCE_HEADER( state_map ); - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/summary.h b/ThirdParty/Ert/libenkf/include/ert/enkf/summary.h deleted file mode 100644 index fd250f0e12..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/summary.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'summary.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SUMMARY_H -#define ERT_SUMMARY_H -#include - -#include -#include - -#include -#include -#include - - - - - - -double summary_get(const summary_type * summary, int report_step ); -bool summary_active_value( double value ); -int summary_length(const summary_type * summary); - -VOID_HAS_DATA_HEADER(summary); -UTIL_SAFE_CAST_HEADER(summary); -UTIL_SAFE_CAST_HEADER_CONST(summary); -VOID_ALLOC_HEADER(summary); -VOID_FREE_HEADER(summary); -VOID_COPY_HEADER(summary); -VOID_FORWARD_LOAD_HEADER(summary); -VOID_FORWARD_LOAD_VECTOR_HEADER(summary); -VOID_USER_GET_HEADER(summary); -VOID_USER_GET_VECTOR_HEADER(summary); -VOID_WRITE_TO_BUFFER_HEADER(summary); -VOID_READ_FROM_BUFFER_HEADER(summary); -VOID_SERIALIZE_HEADER(summary) -VOID_DESERIALIZE_HEADER(summary) -VOID_SET_INFLATION_HEADER(summary); -VOID_CLEAR_HEADER(summary); - -VOID_IADD_HEADER(summary); -VOID_SCALE_HEADER(summary); -VOID_IMUL_HEADER(summary); -VOID_IADDSQR_HEADER(summary); -VOID_ISQRT_HEADER(summary); -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/summary_config.h b/ThirdParty/Ert/libenkf/include/ert/enkf/summary_config.h deleted file mode 100644 index b3aabd035c..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/summary_config.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'summary_config.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SUMMARY_CONFIG_H -#define ERT_SUMMARY_CONFIG_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include - -#include -#include - -#include - -/* - How should the run system handle a load problem of a summary - variable. Observe that the numerical enum values are actually used - - they should be listed with the most strict mode having the - numerically largest value. -*/ - - -typedef enum { LOAD_FAIL_SILENT = 0, // We just try to load - and if it is not there we do not care at all. - LOAD_FAIL_WARN = 2, // If the key can not be found we will print a warning on stdout - but the run will still be flagged as successfull. - LOAD_FAIL_EXIT = 4 } // The data is deemed important - and we let the run fail if this data can not be found. - load_fail_type; - - - - typedef struct summary_config_struct summary_config_type; - typedef struct summary_struct summary_type; - - void summary_config_update_load_fail_mode( summary_config_type * config , load_fail_type load_fail); - void summary_config_set_load_fail_mode( summary_config_type * config , load_fail_type load_fail); - load_fail_type summary_config_get_load_fail_mode( const summary_config_type * config); - void summary_config_update_required( summary_config_type * config , bool required ); - ecl_smspec_var_type summary_config_get_var_type(summary_config_type * , const ecl_sum_type * ecl_sum); - const char * summary_config_get_var(const summary_config_type * ); - void summary_config_set_obs_config_file(summary_config_type * , const char * ); - const char * summary_config_get_config_txt_file_ref(const summary_config_type * ); - summary_config_type * summary_config_alloc(const char * , load_fail_type load_fail); - void summary_config_free(summary_config_type * ); - int summary_config_get_active_mask(const summary_config_type *); - int summary_config_get_var_index(const summary_config_type * , const char * ); - const char ** summary_config_get_var_list_ref(const summary_config_type *); - void summary_config_add_var(summary_config_type * , const char * ); - bool summary_config_has_var(const summary_config_type * , const char * ); - void summary_config_summarize(const summary_config_type * ); - void summary_config_add_obs_key(summary_config_type * , const char * ); - int summary_config_get_byte_size(const summary_config_type * ); - - UTIL_IS_INSTANCE_HEADER(summary_config); - UTIL_SAFE_CAST_HEADER(summary_config); - UTIL_SAFE_CAST_HEADER_CONST(summary_config); - GET_DATA_SIZE_HEADER(summary); - VOID_GET_DATA_SIZE_HEADER(summary); - VOID_CONFIG_FREE_HEADER(summary); - - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/summary_key_matcher.h b/ThirdParty/Ert/libenkf/include/ert/enkf/summary_key_matcher.h deleted file mode 100644 index c82d14f3e4..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/summary_key_matcher.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef ERT_SUMMARY_KEY_MATCHER_H -#define ERT_SUMMARY_KEY_MATCHER_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include - - typedef struct summary_key_matcher_struct summary_key_matcher_type; - - summary_key_matcher_type * summary_key_matcher_alloc(); - void summary_key_matcher_free(summary_key_matcher_type * matcher); - int summary_key_matcher_get_size(const summary_key_matcher_type * matcher); - void summary_key_matcher_add_summary_key(summary_key_matcher_type * matcher, const char * summary_key); - bool summary_key_matcher_match_summary_key(const summary_key_matcher_type * matcher, const char * summary_key); - bool summary_key_matcher_summary_key_is_required(const summary_key_matcher_type * matcher, const char * summary_key); - stringlist_type * summary_key_matcher_get_keys(const summary_key_matcher_type * matcher); - - UTIL_IS_INSTANCE_HEADER( summary_key_matcher ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/summary_key_set.h b/ThirdParty/Ert/libenkf/include/ert/enkf/summary_key_set.h deleted file mode 100644 index 7b167cda8c..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/summary_key_set.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef ERT_SUMMARY_KEY_SET_H -#define ERT_SUMMARY_KEY_SET_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include - - typedef struct summary_key_set_struct summary_key_set_type; - - summary_key_set_type * summary_key_set_alloc(); - summary_key_set_type * summary_key_set_alloc_from_file(const char * filename, bool read_only); - void summary_key_set_free(summary_key_set_type * set); - int summary_key_set_get_size(summary_key_set_type * set); - bool summary_key_set_add_summary_key(summary_key_set_type * set, const char * summary_key); - bool summary_key_set_has_summary_key(summary_key_set_type * set, const char * summary_key); - stringlist_type * summary_key_set_alloc_keys(summary_key_set_type * set); - bool summary_key_set_is_read_only(const summary_key_set_type * set); - - void summary_key_set_fwrite(summary_key_set_type * set, const char * filename); - bool summary_key_set_fread(summary_key_set_type * set, const char * filename); - - - - UTIL_IS_INSTANCE_HEADER( summary_key_set ); - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/summary_obs.h b/ThirdParty/Ert/libenkf/include/ert/enkf/summary_obs.h deleted file mode 100644 index 3d36b1bfce..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/summary_obs.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'summary_obs.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SUMMARY_OBS_H -#define ERT_SUMMARY_OBS_H - -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include - -#include - -#include -#include -#include -#include -#include -#include - - -#define AUTO_CORRF_EXP "EXP" -#define AUTO_CORRF_GAUSS "GAUSS" - - -typedef struct summary_obs_struct summary_obs_type; - -typedef double (auto_corrf_ftype) ( double , double ); - - -void summary_obs_free( - summary_obs_type * summary_obs); - -summary_obs_type * summary_obs_alloc( - const char * summary_key, - const char * obs_key , - double value , - double std, - const char * auto_corrf_name , - double auto_corrf_param); - - - double summary_obs_get_value( const summary_obs_type * summary_obs ); - double summary_obs_get_std( const summary_obs_type * summary_obs ); - double summary_obs_get_std_scaling( const summary_obs_type * summary_obs ); - -auto_corrf_ftype * summary_obs_get_auto_corrf( const summary_obs_type * summary_obs ); -double summary_obs_get_auto_corrf_param( const summary_obs_type * summary_obs ); - -bool summary_obs_default_used( - const summary_obs_type * summary_obs, - int restart_nr); - -const char * summary_obs_get_summary_key( - const summary_obs_type * summary_obs); - -summary_obs_type * summary_obs_alloc_from_HISTORY_OBSERVATION( - const conf_instance_type * conf_instance, - const history_type * history); - -summary_obs_type * summary_obs_alloc_from_SUMMARY_OBSERVATION( - const conf_instance_type * conf_instance, - const history_type * history); - -void summary_obs_set(summary_obs_type * , double , double ); - -void summary_obs_update_std_scale(summary_obs_type * summary_obs, double std_multiplier , const active_list_type * active_list); - -VOID_FREE_HEADER(summary_obs); -VOID_GET_OBS_HEADER(summary_obs); -VOID_MEASURE_HEADER(summary_obs); -UTIL_IS_INSTANCE_HEADER(summary_obs); -VOID_USER_GET_OBS_HEADER(summary_obs); -VOID_CHI2_HEADER(summary_obs); -VOID_UPDATE_STD_SCALE_HEADER(summary_obs); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/surface.h b/ThirdParty/Ert/libenkf/include/ert/enkf/surface.h deleted file mode 100644 index 62be08f030..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/surface.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'surface.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SURFACE_H -#define ERT_SURFACE_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - - typedef struct surface_struct surface_type; - - UTIL_SAFE_CAST_HEADER(surface); - UTIL_SAFE_CAST_HEADER_CONST(surface); - VOID_ALLOC_HEADER(surface); - VOID_FREE_HEADER(surface); - VOID_ECL_WRITE_HEADER(surface); - VOID_COPY_HEADER(surface); - VOID_USER_GET_HEADER(surface); - VOID_WRITE_TO_BUFFER_HEADER(surface); - VOID_READ_FROM_BUFFER_HEADER(surface); - VOID_SERIALIZE_HEADER(surface); - VOID_DESERIALIZE_HEADER(surface); - VOID_SET_INFLATION_HEADER(surface); - VOID_CLEAR_HEADER(surface); - VOID_IADD_HEADER(surface); - VOID_SCALE_HEADER(surface); - VOID_IMUL_HEADER(surface); - VOID_IADDSQR_HEADER(surface); - VOID_ISQRT_HEADER(surface); - VOID_INITIALIZE_HEADER(surface); - VOID_FLOAD_HEADER(surface); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/surface_config.h b/ThirdParty/Ert/libenkf/include/ert/enkf/surface_config.h deleted file mode 100644 index 73fb0e88b6..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/surface_config.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'surface_config.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SURFACE_CONFIG_H -#define ERT_SURFACE_CONFIG_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include - - typedef struct surface_config_struct surface_config_type; - - void surface_config_ecl_write( const surface_config_type * config , const char * filename , const double * zcoord); - const geo_surface_type * surface_config_get_base_surface( const surface_config_type * config ); - void surface_config_free( surface_config_type * config ); - int surface_config_get_data_size(const surface_config_type * config ); - surface_config_type * surface_config_alloc_empty( ); - void surface_config_set_base_surface( surface_config_type * config , const char * base_surface ); - - UTIL_SAFE_CAST_HEADER(surface_config); - UTIL_SAFE_CAST_HEADER_CONST(surface_config); - GET_DATA_SIZE_HEADER(surface); - VOID_GET_DATA_SIZE_HEADER(surface); - VOID_CONFIG_FREE_HEADER(surface); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/time_map.h b/ThirdParty/Ert/libenkf/include/ert/enkf/time_map.h deleted file mode 100644 index 239482484b..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/time_map.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - The file 'time_map.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#ifndef ERT_TIME_MAP_H -#define ERT_TIME_MAP_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include -#include - -#include - -typedef struct time_map_struct time_map_type; - - UTIL_SAFE_CAST_HEADER( time_map ); - UTIL_IS_INSTANCE_HEADER( time_map ); - - bool time_map_try_summary_update( time_map_type * map , const ecl_sum_type * ecl_sum); - bool time_map_try_update( time_map_type * map , int step , time_t time); - bool time_map_attach_refcase( time_map_type * time_map , const ecl_sum_type * refcase); - bool time_map_has_refcase( const time_map_type * time_map ); - bool time_map_is_strict( const time_map_type * time_map ); - void time_map_set_strict( time_map_type * time_map , bool strict); - void time_map_clear( time_map_type * map ); - bool time_map_equal( const time_map_type * map1 , const time_map_type * map2); - time_map_type * time_map_alloc( ); - void time_map_free( time_map_type * map ); - bool time_map_update( time_map_type * map , int step , time_t time); - bool time_map_summary_update( time_map_type * map , const ecl_sum_type * ecl_sum); - time_t time_map_iget( time_map_type * map , int step ); - void time_map_fwrite( time_map_type * map , const char * filename); - void time_map_fread( time_map_type * map , const char * filename); - bool time_map_fscanf(time_map_type * map , const char * filename); - double time_map_iget_sim_days( time_map_type * map , int step ); - int time_map_get_last_step( time_map_type * map); - int time_map_get_size( time_map_type * map); - time_t time_map_get_start_time( time_map_type * map); - time_t time_map_get_end_time( time_map_type * map); - double time_map_get_end_days( time_map_type * map); - bool time_map_is_readonly( const time_map_type * tm); - time_map_type * time_map_fread_alloc_readonly( const char * filename); - int_vector_type * time_map_alloc_index_map( time_map_type * map , const ecl_sum_type * ecl_sum ); - int time_map_lookup_time( time_map_type * map , time_t time); - int time_map_lookup_days( time_map_type * map , double sim_days); - int time_map_lookup_time_with_tolerance( time_map_type * map , time_t time , int seconds_before_tolerance, int seconds_after_tolerance); - void time_map_summary_upgrade107( time_map_type * map , const ecl_sum_type * ecl_sum); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/include/ert/enkf/trans_func.h b/ThirdParty/Ert/libenkf/include/ert/enkf/trans_func.h deleted file mode 100644 index 1d0b9e7507..0000000000 --- a/ThirdParty/Ert/libenkf/include/ert/enkf/trans_func.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'trans_func.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_TRANS_FUNC_H -#define ERT_TRANS_FUNC_H -#ifdef __cplusplus -extern "C" { -#endif -#include -#include - -#include - -#include - - -typedef struct trans_func_struct trans_func_type; -typedef double (transform_ftype) (double , const arg_pack_type *); -typedef bool (validate_ftype) (const trans_func_type * ); - -trans_func_type * trans_func_fscanf_alloc( FILE * stream, const char * filename ); -double trans_func_eval( const trans_func_type * trans_func , double x); - -void trans_func_free( trans_func_type * trans_func ); -void trans_func_iset_double_param(trans_func_type * trans_func , int param_index , double value ); -bool trans_func_set_double_param( trans_func_type * trans_func , const char * param_name , double value ); -void trans_func_iset_int_param(trans_func_type * trans_func , int param_index , int value ); -bool trans_func_set_int_param( trans_func_type * trans_func , const char * param_name , int value ); -bool trans_func_use_log_scale(const trans_func_type * trans_func ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libenkf/src/CMakeLists.txt b/ThirdParty/Ert/libenkf/src/CMakeLists.txt deleted file mode 100644 index bf950ea8a4..0000000000 --- a/ThirdParty/Ert/libenkf/src/CMakeLists.txt +++ /dev/null @@ -1,239 +0,0 @@ -set( source_files - time_map.c - rng_config.c - trans_func.c - enkf_types.c - enkf_obs.c - obs_data.c - block_obs.c - enkf_config_node.c - field_config.c - field.c - enkf_state.c - enkf_util.c - enkf_node.c - gen_kw_config.c - gen_kw.c - enkf_fs.c - fs_driver.c - meas_data.c - summary_obs.c - summary.c - summary_config.c - gen_data_config.c - gen_data.c - gen_common.c - gen_obs.c - enkf_serialize.c - ecl_config.c - enkf_defaults.c - ensemble_config.c - model_config.c - site_config.c - active_list.c - obs_vector.c - field_trans.c - plain_driver.c - local_ministep.c - local_updatestep.c - container_config.c - container.c - local_context.c - local_config.c - analysis_config.c - misfit_ensemble.c - misfit_member.c - misfit_ts.c - data_ranking.c - misfit_ranking.c - ranking_table.c - fs_types.c - block_fs_driver.c - plot_settings.c - ert_template.c - member_config.c - enkf_analysis.c - enkf_main.c - local_dataset.c - surface.c - surface_config.c - enkf_plot_data.c - enkf_plot_tvector.c - enkf_plot_gendata.c - enkf_plot_genvector.c - enkf_plot_gen_kw.c - enkf_plot_gen_kw_vector.c - hook_manager.c - hook_workflow.c - runpath_list.c - ert_workflow_list.c - analysis_iter_config.c - enkf_main_jobs.c - ecl_refcase_list.c - local_obsdata_node.c - local_obsdata.c - pca_plot_data.c - pca_plot_vector.c - state_map.c - cases_config.c - state_map.c - summary_key_set.c - summary_key_matcher.c - ert_test_context.c - ert_log.c - run_arg.c - ert_run_context.c - ert_init_context.c - custom_kw.c - custom_kw_config.c - custom_kw_config_set.c - forward_load_context.c -) - -set( header_files - time_map.h - rng_config.h - enkf_analysis.h - enkf_fs_type.h - trans_func.h - enkf_obs.h - obs_data.h - enkf_config_node.h - block_obs.h - field_config.h - field.h - enkf_macros.h - enkf_state.h - enkf_util.h - enkf_main.h - enkf_main_jobs.h - enkf_node.h - enkf_fs.h - gen_kw_config.h - gen_kw.h - enkf_types.h - fs_driver.h - meas_data.h - summary_obs.h - summary_config.h - summary_config.h - gen_data_config.h - gen_data.h - gen_common.h - gen_obs.h - fs_types.h - enkf_serialize.h - plain_driver.h - ecl_config.h - ensemble_config.h - model_config.h - site_config.h - active_list.h - obs_vector.h - field_trans.h - plain_driver.h - local_ministep.h - container.h - local_updatestep.h - local_config.h - analysis_config.h - misfit_ensemble.h - misfit_ensemble_typedef.h - misfit_ts.h - misfit_member.h - data_ranking.h - ranking_table.h - ranking_common.h - misfit_ranking.h - block_fs_driver.h - field_common.h - gen_kw_common.h - gen_data_common.h - plot_settings.h - ert_template.h - member_config.h - enkf_defaults.h - container_config.h - local_dataset.h - surface.h - surface_config.h - local_context.h - enkf_plot_data.h - enkf_plot_tvector.h - enkf_plot_gendata.h - enkf_plot_genvector.h - enkf_plot_gen_kw.h - enkf_plot_gen_kw_vector.h - hook_manager.h - runpath_list.h - ert_workflow_list.h - analysis_iter_config.h - ecl_refcase_list.h - local_obsdata_node.h - local_obsdata.h - pca_plot_data.h - pca_plot_vector.h - state_map.h - summary_key_set.h - summary_key_matcher.h - cases_config.h - state_map.h - ert_test_context.h - ert_log.h - run_arg.h - run_arg_type.h - ert_run_context.h - ert_init_context.h - custom_kw.h - custom_kw_config.h - custom_kw_config_set.h - forward_load_context.h -) - - -add_library( enkf ${LIBRARY_TYPE} ${source_files} ) -set_target_properties( enkf PROPERTIES VERSION ${ERT_VERSION_MAJOR}.${ERT_VERSION_MINOR} SOVERSION ${ERT_VERSION_MAJOR} ) - -set( STATOIL_SITE_CONFIG /project/res/etc/ERT/site-config) -if (STATOIL_TESTDATA_ROOT) - set( SITE_CONFIG_FILE ${STATOIL_SITE_CONFIG} CACHE FILEPATH "Path to global ERT Configuration file") -else() - if (EXISTS ${STATOIL_SITE_CONFIG}) - set( SITE_CONFIG_FILE ${STATOIL_SITE_CONFIG}) - else() - set( SITE_CONFIG_FILE "${PROJECT_SOURCE_DIR}/share/site-config") - endif() -endif() - -set_source_files_properties( site_config.c PROPERTIES COMPILE_DEFINITIONS "SITE_CONFIG_FILE=\"${SITE_CONFIG_FILE}\"") - -target_link_libraries( enkf ecl sched analysis rms config job_queue ) - -if (USE_RUNPATH) - add_runpath( enkf ) -endif() - -if(ERT_MAC) - add_custom_target(ert_share_symlinking ALL - COMMENT "Symlinking to the development share directory." - COMMAND ln -sfh ${PROJECT_SOURCE_DIR}/share ${PROJECT_BINARY_DIR}/share - ) - -else() - add_custom_target(ert_share_symlinking ALL - COMMENT "Symlinking to the development share directory." - COMMAND ln -sf -t ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/share - ) -endif() - -#----------------------------------------------------------------- -if (INSTALL_ERT) - install(TARGETS enkf DESTINATION ${CMAKE_INSTALL_LIBDIR}) - foreach(header ${header_files}) - install(FILES ../include/ert/enkf/${header} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/enkf) - endforeach() -endif() - -#----------------------------------------------------------------- - - diff --git a/ThirdParty/Ert/libenkf/src/README.new_config_draft b/ThirdParty/Ert/libenkf/src/README.new_config_draft deleted file mode 100644 index 0576ff4591..0000000000 --- a/ThirdParty/Ert/libenkf/src/README.new_config_draft +++ /dev/null @@ -1,251 +0,0 @@ --- QUEUE_SYSTEM prevails, but becomes a class. --- --- This is a singleton class. I.e., it can only have --- one instance. --- --- Example: -QUEUE_SYSTEM xHydro_LSF -{ - TYPE = LSF; - MAX_JOBS = 10; -}; - - - - --- SUBSTITUTION takes over for DATA_KW. --- Adding support for arbitrary files --- and keys. Adding support for sourced --- file. --- --- Example A: -SUBSTITUTION my_own_hack -{ - FILENAME = "my_magic_file.txt"; - KEY = ""; - VALUE = "SVADAFRANZ_"; -}; - --- Example B: -SUBSTITUTION your_hack -{ - FILENAME = ; - KEY = "__SVADAFRANZ__"; - VALUE = ; -}; - --- Example C: -SUBSTITUTION our_hack -{ - FILENAME = "our_file.txt"; - KEY = "__INSERT_HERE__"; - SOURCE_FILE = "the_data.txt"; - -}; - - - --- JOB takes over for INSTALL_JOB. --- --- Example: -JOB STEINFYSIKK -{ - PLATFORM_EXE i386 - { - EXE = "/bin/old/bein.exe"; - }; - - - PLATFORM_EXE x86_64 - { - EXE = "/bin/x86_64/bein.exe"; - }; - - - PLATFORM_EXE ia64 - { - EXE = "/bin/ia64/bein.exe"; - - -- Special arguments and env for this platform. - ARGUMENTS = "-finn -olje -some funky special stuff"; - SETENV F_UMFTENDIAN { VALUE = "special"; }; - }; - - - ARGUMENTS = "-finn -olje"; - - STDIN = ""; - STDOUT = "steinfysikk.stdout"; - - LSF_RESOURCES = "det skal gÃ¥ snabbt!"; - -}; - - - --- SIMULATION_WORKFLOW takes over for FORWARD_MODEL --- --- "Simulation workflow" might be more instructive? --- Not 100% sure though... --- --- Example: -SIMULATION_WORKFLOW = "RELPERM ECLIPSE100 STEINFYSIKK"; - - - --- SIMULATION_SCHEDULE takes over for ENKF_SCHED_FILE. --- --- This is a singleton class. I.e., it can only have --- one instance. --- --- Example: -SIMULATION_SCHEDULE my_schedule -{ - SEGMENT A - { - START = 0; - END = 10; - STRIDE = 5; - UPDATE = ENKF; - SIMULATION_WORKFLOW = "ECLIPSE100 ROCKPHYSICS SEISMIC"; - }; - - - SEGMENT B - { - START = 10; - END = 100; - - -- Use smoother for this interval - UPDATE = ENKS; - }; - - - SEGMENT C - { - START = 100; - END = 200; - UPDATE = NO; - }; - -}; - - - - --- PARAMETER_COLLECTION takes over for GEN_KW. --- --- Example: -PARAMETER_COLLECTION my_big_collection -{ - -- All the parameters in the collection - -- subsitutes into the TEMPLATE_FILE. - TEMPLATE_FILE = "templates/my_template.txt"; - - - -- File produced in the simulation folder. - TARGET_FILE = "my_output.txt"; - - - SCALAR foo - { - -- The key in my_template to subsitute. - -- This shold probably default to - -- __INSTANCE_NAME__ or . - TEMPLATE_KEY = ""; - - - -- Prior distribution can not be used - -- with MAX, MIN, TRANSFER_FUNCTION - -- and PRIOR_SAMPLES. - PRIOR_DISTRIBUTION = "LOGUNIF 0 1"; - }; - - - -- This parameter behaves like the old GEN_KW, - -- but reads input from a user provided file - -- and subsitutes a key different from name. - SCALAR bar - { - TEMPLATE_KEY = "__MAGIC__"; - - -- The file user_provided_realizations.txt shall - -- contain ascii doubles, one per line. - PRIOR_SAMPLES = "user_provided_realizations.txt"; - TRANSFER_FUNCTION = LOG10; - MAX = 100; - MIN = 1; - }; - - -- User provided covariance matrix. - -- - -- Note that we cannot use this if not all - -- parameters are sampled internally! - -- COVARIANCE_MATRIX = "my_covmat.txt"; -}; - - --- PARAMETER takes over for GEN_PARAM and --- FIELD * PARAMETER. --- --- Example A, subsituting FIELD * PARAMETER. -PARAMETER poro -{ - -- Need to have either: - -- 1. ECL_OUTPUT and KEYWORD (for FIELD * PARAMETER) - -- or - -- 2. TEMPLATE_FILE and KEY (for GEN_PARAM). - ECL_OUTPUT = GRDECL; - KEYWORD = "PORO"; - TARGET_FILE = "PORO.GRDECL"; - PRIOR_SAMPLES = "poro-%d.grdecl"; -}; --- Example B, subsituting FIELD * PARAMETER -PARAMETER permx -{ - ECL_OUTPUT = "ECLBIN"; - KEYWORD = "PERMX"; - TARGET_FILE = "PERMX.BIN"; - PRIOR_SAMPLES = "permx-%d.roff"; -}; --- Example C, subsituting GEN_PARAM. -PARAMETER surf -{ - TEMPLATE_FILE = "my_surf_template.txt"; - KEY = "__REPLACE_THIS__"; - TARGET_FILE = "surface.roff"; - PRIOR_SAMPLES = "surf-%d.txt"; -}; - - --- STATE takes over for FIELD * DYNAMIC --- and SUMMARY. --- --- Example A, replacing FIELD * DYNAMIC. -STATE pres -{ - ECL_SOURCE = RESTART; - KEYWORD = PRESSURE; - MIN = 100; - -- Specify UPDATE_SPACE instead of - -- input and output transform. - UPDATE_SPACE = LOG10; -}; --- Example B, replacing SUMMARY. -STATE region_pressure; -{ - ECL_SOURCE = SUMMARY; - KEYWORD = RPR:10; - -- Need to think about how this affects observations.. - UPDATE_SPACE = LOG10; -}; - - - -SUMMARY_OBSERVATION foobar -{ - KEY = WOPR:P1; - RESTARTS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; - VALUES = [0, 0, 0, 1, 1, 1, 1, 1, 1, 1]; - ERRORS = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; -} diff --git a/ThirdParty/Ert/libenkf/src/README.new_type.c b/ThirdParty/Ert/libenkf/src/README.new_type.c deleted file mode 100644 index d7547500c1..0000000000 --- a/ThirdParty/Ert/libenkf/src/README.new_type.c +++ /dev/null @@ -1,343 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'README.new_type.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -/** -The two files README.new_type.c and README.new_type_config.c (along -with the corresponding header files) are meant to serve as a -documentation and reference on how to add new object types to the enkf -system. - -The enkf object system is based on the enkf_node_type as a sort of -abstract class, this object has a void pointer which will point to the -actual data instance (i.e. for instance an instance of the type -"new_type" implemented here), along with several function pointers to -manipulate the data object. - - _______________________________________ _______________________________ - | enkf_node_type instance | | | - | ------------------------------------- | | Actual data , e.g. a field or | - | * void * data |-------------->| a multiplier. | - | * Function pointers to manipulate | |_______________________________| - | data | - | * Something more - not relevant here | - |_______________________________________| - - -The enkf_node object can contain pointers to all types of objects. - - - - - - - -new_type.c (should read README.new_type.h first). -========== -For all the enkf objects we have split the member spesific data, and -the configuration information in two different files (objects): - - ______________ - | | - _________________| Config |_______________ - | | information | | - | /|______________|\ | - | / | \ | - | / | \ | - | / | | | - | | | | | - _|__ __|_ _|__ _|__ _|__ - | | | | | | | | | | - | 01 | | 02 | | 03 | | 04 | | 05 | - |____| |____| |____| |____| |____| - - -The figure shows an ensemble of 5 members (of some type); they all -have a pointer to a common configuration object. The thought behind -this is that all members should share configuration information, -i.e. for instance all the members in a permeability field should have -the same active/inactive cells, all the relperm instances should use -the same relperm model e.t.c. This file is about implementing the data -members, i.e. the small boxes. The implementation of the config -object, is discussed in README.new_type_config.c. - - -1. alloc_ftype: new_type * new_type_alloc(const new_type_config *); - -------------------------------------------- - - This function takes a pointer to a config object of the right type - (i.e. new_type_config_type in this case), reads the required - configuration information from this object, and returns a new new_type - instance. - - -2. ecl_write_ftype: void new_type_ecl_write(const new_type * , const char *); - -------------------------------------------------------------------------- - This function takes a const pointer to a new_type instance, along - with a filename. The function should write eclipse data to the - filename specified in the second argument. - - - -3. fread_ftype: void new_type_fread(new_type * , FILE * ); - ------------------------------------------------ - This function should take a pointer to a new_type object, and a - stream opened for reading as input, and then read in data for the - object from disk. - - -4. fwrite_ftype: void new_type_fwrite(new_type * , FILE * ); - ------------------------------------------------ - This function should take a pointer to a new_type object, and a - stream opened for writing as input, and then write the data from - the object to disk. The two functions instances fread_ftype - and - fwrite_ftype must of course match, but apart from that they are - quite free. - - -5. copyc_ftype: new_type * new_type_copyc(const new_type *); - --------------------------------------------------------------- - This function takes a const pointer to a new_type instance. A new - new_type copy instance with identical data is created. The two - instance share config object. - - -6. initialize_ftype: void new_type_initialize(new_type * , int); - ------------------------------------------------------------ - This function takes a pointer to a new_type instance, and a an - ensemble number as input; it should then initialize the data of - the new_type object - this can either be done by sampling a random - number according to some distribution, by reading in input from an - external program or by calling an external program (i.e. RMS). - - -7. serialize_ftype: int (const new_type * , int , size_t , double * , size_t , size_t , bool *); - -------------------------------------------------------------------------------------------- - This one is a bit tricky ... The enkf_state object, holding among - others things instances of new_type * can be illustrated as this: - - - -------------- - | enkf_state | - ============== ---------------- - | PRESSURE |-------->| Pressure data| - |------------| ---------------- - | New_type |---| - -------------- | ----------------- - | multz | |-------->| new_type data | - -------------- ----------------- - | - | -------------- - |------>| multz data | - -------------- - - The key point of this figure is that the various data we want to - update with enkf are at random locations in memory. To be able to - do the - A' = AX - - matrix multiplication we must assemble this data in a long - vector. That is what is meant by serializing. The serialize - routine is so complicated for (at least) two reasons: - - o We can allocate a certain amount of memory, and then the - serialize routines should continue until the available memory - is exhausted, update and the resume. - - o For efficiency reasons a "funny" stride should be used. - - - -8. deserialize_ftype: int new_type_deserialize(new_type * , int , size_t , const double * , size_t , size_t); - --------------------------------------------------------------------------------------------------------- - This is "just" the opposite of serialize, take data back after the - update (matrix multiplication). - - -9. free_ftype: void new_type_free(new_type *); - ------------------------------------------- - This function should free all the memory used by the new_type - instance. Observe that the config pointer should be left alone, - that will be collected elsewhere. - -10. free_data_ftype: void new_type_free_data(new_type *); - ----------------------------------------------------- - This function should free the data of the new_type instance, but - retain the new_type holding structure. This function is called - after an instance has swapped to disk. - -11. realloc_data_ftype: void (new_type *); - -------------------------------------------------------------- - This function is the "opposite" of function number 10, i.e. it - is to reallocate memory to hold the actual data. - - -12. ensemble_fprintf_results_ftype * fprintf_results - -------------------------------------------------------------- - This function is used to print the reuslts in a formatted nice way. Only - applicable for variables with small amounts of data, like gen_kw. - -13. ecl_load_ftype: void (new_type * , const char * run_path , const char * eclbase, const ecl_sum_type , int report_step) - ----------------------------------------------------------------- - This function is used to load ECLIPSE results from a complete - forward simulation. Observe that the restart data are not loaded - through this interface, and that the summary datka get an - ecl_sum_type * instance for convenience. If you want to add a new - which should be loaded from a eclipse directory, you must manage - with the run_path ankd ecl_base input. - - -Now - since the enkf_node objects can point to arbitrary types of -object the data pointer is a void pointer, and the function pointer -expect (void *) as input, instead of pointers to e.g. new_type -instances. To cast from the typed functions listed above, to functions -accepting (void *) there are several utility functions, i.e. the macro -VOID_ECL_WRITE() will create a void * version of the XXX_ecl_write() -function: - -The macro call: VOID_ECL_WRITE(new_type) will generate the following code: - - void new_type_ecl_write__(void *__new_type) { - new_type_ecl_write( (new_type *) __new_type); - } - -And the macro VOID_ECL_WRITE_HEADER(new_type) will generate the -corresponding header. These (void) functions are the ones used when -initializing the function pointers in the enkf_node object. For -instance for registering the new_type object in the enkf_node -implementation (function: enkf_node_alloc_empty) - -.... -.... -case(NEW_TYPE): - node->alloc = new_type_alloc__; - node->fwrite_f = new_type_fwrite__; - ... - -*/ - - - -/* -OK - here comes the implementation: -*/ - -/* - These are standard header files needed by almost any C-program: -*/ -#include -#include -#include -#include - -/* - Lots of small utility functions for: memory handling, string - handling and file handling. Implemented in the libutil library. -*/ -#include - - -/* - Lots of (ugly) C-macros to generate anonymous versions of the various - functions listed above. -*/ -#include - - -/* - This file contains several enum typedefs, the most important one in - this context is the ert_impl_type; the NEW_TYPE should be added to - this (at the end). -*/ -#include - - -/* - The header file for the actual new_type object. -*/ -#include - - - -/* - These two #define statements, along with the macros found in - enkf_debug.h allow for some simple run_time checks of the various - casts. Observe that the header file enkf_debug.h is included from - the current directory; it is *not* installed in an include/ - directory. -*/ -#define TARGET_TYPE NEW_TYPE /* The variable type in this file - according to the ert_impl_type classification */ -#define DEBUG /* We want debugging */ -#include "enkf_debug.h" - - - -/* - Here comes the new_type_struct defintion: -*/ - -struct new_type_struct { - DEBUG_DECLARE - const new_type_config_type *config; - - 1: scalar_type *scalar; - 2: double *data; -}; - -/* - Observe the following properties of the struct: - - 1. The statement DEBUG_DECLARE inserts a variable __impl_type as the - first element of the struct (if debugging is enabled) with - #define DBEUG. This should be the first element in the struct. - - 2. The struct contains a pointer to a new_type_config_type object; - this pointer is const, as the new_type instances are not allowed - to write the configuration information (it is shared among many - instances), only read it. - - 3. The actual data is stored in either a scalar instance, or just as - double * data. (1: and 2: is *NOT* some new funny C-syntax). - - The scalar_type object is described further down. If use of - scalar_type is not appropriate, you must store the data in some - other way. There are no formal rules to this, but if you stick to - the suggested "double *data;" convention suggested above, you - will get several macros for algebraic manipulation (adding, - scaling, squaring +++) of new_type instances for free. - - Hence - it is *strongly* recommended to use either: - - scalar_type * scalar; - - or - - double * data; - - to hold the actual data. -*/ - - -/* -scalar_type -=========== -This type is implemented in scalar.c / scalar_config.c. -*/ - - - - diff --git a/ThirdParty/Ert/libenkf/src/README.obs b/ThirdParty/Ert/libenkf/src/README.obs deleted file mode 100644 index 96e7c8443b..0000000000 --- a/ThirdParty/Ert/libenkf/src/README.obs +++ /dev/null @@ -1,52 +0,0 @@ -/** - -Observations/measurements are handled by three different (toplevel) -objects: - - -obs_node_type -------------- -This object contians qualitative information about the observations, -i.e. when they are active, what is the error of the observations, what -type they are, and how to measure them. The obs_node_type object -contains the two function pointers: - - get_obs : void (const void* , int , * obs_data_type) - measure : void (const void * , const voide * , meas_vector_type) - -The first of these, get_obs, is used to load/get the actual -observation, that can typically be to get an historical rate from the -history; the data is pushed onto an instance of obs_data_type. measure -on the other is used to extract information from the ensemble state, -i.e. measure for instance a simulated rate or a pressure, and push the -data onto a meas_vector_type instance. - -Several obs_node instances are collected in the enkf_obs type, which -is mostly a hash table of obs_node instances. - -The obs_node_type lives through the whole simulation, this in contrast -to the two other data types involved in the process. - - -obs_data_type -------------- -This data type is used to store all the observation AT ONE -TIMESTEP. New observations are just added with a obs_data_add(), and -the structure grows as necessary. Before the next timestep, the -obs_data_type instance is reset. - - -meas_vector_type / meas_matrix_type ------------------------------------ -This data type is used in the same way as the obs_data_type, for -measurements. When an eclipse integration is complete the -obs_node->measure function is called, and the measurements are pushed -onto the meas_vector. (The whole ensemble corresponds to meas_matrix_type). - - -Analysis --------- -Observe that the analysis step ONLY involves a meas_matrix_type -instance and an obs_data instance. - ------------------------------------------------------------------ diff --git a/ThirdParty/Ert/libenkf/src/README.paths b/ThirdParty/Ert/libenkf/src/README.paths deleted file mode 100644 index 8048a837b0..0000000000 --- a/ThirdParty/Ert/libenkf/src/README.paths +++ /dev/null @@ -1,25 +0,0 @@ -The enkf program uses an object call path_fmt_type to store/configure -various paths and filenames (The path_fmt_type is implemented in the -libutil library). For instance the main configuration file must -contain a line like this: - - RUNPATH /tmp/Eclipse/tmpdir_%04d - -This is actually a format string, so when we want to get/make a -directory for an eclipse simulation, the %04d is replaced with the -actual ensemble member. Usage example: - -/* This is common to all members in the ensemble */ -path_fmt_type * run_path_fmt = path_fmt_alloc_directory_fmt("/tmp/Eclipse/tmpdir_%04d" , true); -... -... -/* For a spesific member: */ -{ - char * run_path = path_fmt_alloc_path(run_path_fmt , iens); - -} - - - - - diff --git a/ThirdParty/Ert/libenkf/src/active_list.c b/ThirdParty/Ert/libenkf/src/active_list.c deleted file mode 100644 index 582032c535..0000000000 --- a/ThirdParty/Ert/libenkf/src/active_list.c +++ /dev/null @@ -1,224 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'active_list.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -#include -#include - -#include -#include -#include - - -/** - This file implements a small structure used to denote which - elements of a node/observation which is active. At the lowest level - the active elements in a node is just a list of integers. This - list of integers, with som extra twists is what is implemented - here. - - All the xxx_config objects have a pointer to an active_list - instance. This pointer is passed to the enkf_serialize / - enkf_deserialize routines. - - Observe that for the (very important!!) special case that all - elements are active the (int *) pointer should not be accessed, and - the code here is free to return NULL. - - -Example -------- - -Consider a situation where faults number 0,4 and 5 should be active in -a fault object. Then the code will be like: - - - .... - active_list_add_index(multflt_config->active_list , 0); - active_list_add_index(multflt_config->active_list , 4); - active_list_add_index(multflt_config->active_list , 5); - .... - - When this fault object is serialized/deserialized only the elements - 0,4,5 are updated. -*/ - - -#define ACTIVE_LIST_TYPE_ID 66109 - -struct active_list_struct { - UTIL_TYPE_ID_DECLARATION; - active_mode_type mode; /* ALL_ACTIVE | INACTIVE | PARTLY_ACTIVE */ - int_vector_type *index_list; /* A list of active indices - if data_size == active_size this can be NULL. */ -}; - -/*****************************************************************/ - - -static UTIL_SAFE_CAST_FUNCTION(active_list , ACTIVE_LIST_TYPE_ID) -UTIL_IS_INSTANCE_FUNCTION( active_list , ACTIVE_LIST_TYPE_ID) - - - - -/** - The newly created active_list default to setting all indices actiove. -*/ -active_list_type * active_list_alloc( ) { - active_list_type * active_list = util_malloc(sizeof * active_list); - UTIL_TYPE_ID_INIT( active_list , ACTIVE_LIST_TYPE_ID ); - active_list->index_list = int_vector_alloc(0 , -1); - active_list->mode = ALL_ACTIVE; - return active_list; -} - - -active_list_type * active_list_alloc_copy( const active_list_type * src) { - active_list_type * new = active_list_alloc( ); - new->mode = src->mode; - int_vector_free( new->index_list ) ; - new->index_list = int_vector_alloc_copy( src->index_list ); - return new; -} - - -void active_list_copy( active_list_type * target , const active_list_type * src) { - target->mode = src->mode; - int_vector_memcpy( target->index_list , src->index_list); -} - - -void active_list_free( active_list_type * active_list ) { - int_vector_free(active_list->index_list); - free(active_list); -} - - - -void active_list_free__( void * arg ) { - active_list_type * active_list = active_list_safe_cast ( arg ); - active_list_free(active_list); -} - - - -/** - Appends a new index to the current list of active indices, and - setting the mode to PARTLY_ACTIVE. -*/ -void active_list_add_index(active_list_type * active_list, int new_index) { - if (int_vector_contains(active_list->index_list , new_index )) - return; - active_list->mode = PARTLY_ACTIVE; - int_vector_append( active_list->index_list , new_index ); -} - - - - - - - - -/** - When mode == PARTLY_ACTIVE the active_list instance knows the size - of the active set; if the mode is INACTIVE 0 will be returned and - if the mode is ALL_ACTIVE the input parameter @total_size will be - passed back to calling scope. -*/ - - -int active_list_get_active_size(const active_list_type * active_list, int total_size) { - int active_size; - switch( active_list->mode ) { - case PARTLY_ACTIVE: - active_size = int_vector_size( active_list->index_list ); - break; - case INACTIVE: - active_size = 0; - break; - case ALL_ACTIVE: - active_size = total_size; - break; - default: - util_abort("%s: internal fuckup \n",__func__); - active_size = -1; - } - return active_size; -} - - -active_mode_type active_list_get_mode(const active_list_type * active_list) { - return active_list->mode; -} - - - -/** - This will return a (const int *) pointer to the active indices. IFF - (mode == INACTIVE || mode == ALL_ACTIVE) it will instead just - return NULL. In that case it is the responsability of the calling - scope to not dereference the NULL pointer. -*/ - -const int * active_list_get_active(const active_list_type * active_list) { - if (active_list->mode == PARTLY_ACTIVE) - return int_vector_get_const_ptr( active_list->index_list ); - else - return NULL; -} - - -bool active_list_iget( const active_list_type * active_list , int index ) { - if (active_list->mode == ALL_ACTIVE) - return true; - else if (active_list->mode == INACTIVE) - return false; - else - return int_vector_iget( active_list->index_list , index ); -} - -void active_list_summary_fprintf( const active_list_type * active_list , const char *dataset_key, const char *key , FILE * stream) { - int number_of_active = int_vector_size( active_list->index_list ); - if (active_list->mode == ALL_ACTIVE){ - fprintf(stream , "NUMBER OF ACTIVE:%d,STATUS:%s,", number_of_active, "ALL_ACTIVE"); - } - else if (active_list->mode == PARTLY_ACTIVE){ - fprintf(stream , "NUMBER OF ACTIVE:%d,STATUS:%s,", number_of_active, "PARTLY_ACTIVE"); - } - else - fprintf(stream , "NUMBER OF ACTIVE:%d,STATUS:%s,", number_of_active, "INACTIVE"); -} - - - -bool active_list_equal( const active_list_type * active_list1 , const active_list_type * active_list2) { - if (active_list1 == active_list2) - return true; - else { - if (active_list1->mode != active_list2->mode) - return false; - else { - if (active_list1->mode == PARTLY_ACTIVE) - return int_vector_equal( active_list1->index_list , active_list2->index_list); - else - return true; - } - } -} diff --git a/ThirdParty/Ert/libenkf/src/active_node.c b/ThirdParty/Ert/libenkf/src/active_node.c deleted file mode 100644 index b1434610db..0000000000 --- a/ThirdParty/Ert/libenkf/src/active_node.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'active_node.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include -#include - -/** - This file implements the two most basic objects used in the mapping - of active/inactive observations and variables. One of these nodes - contains the information necessary to activate/deactivate one - variable/observation. -*/ - - -/** - This struct implements the holding information for the - activation/deactivation of one variable. -*/ - -struct active_var_struct { - const enkf_config_node_type * config_node; /* The enkf_config_node instance this is all about - pointer to *shared* resource. */ - active_mode_type active_mode; - void * active_config; /* An object (type depending on datatype of config_node) used to hold info abourt partly active variable. - Owned by this object. If active_mode == all_active or active_mode == inactive, this can be NULL. */ - active_config_destructor_ftype * free_active_config; /* Destructor for the active_config object, can be NULL if that object is NULL. */ -}; - - - -/** - Similar to active_var_struct, but for observations. -*/ -struct active_obs_struct { - const obs_vector_type * obs_vector; /* The obs_node instance this is all about - pointer to *shared* resource. */ - active_mode_type active_mode; - void * active_config; /* An object (type depending on datatype of obs_node) used to hold info abourt partly active variable. - Owned by this object. If active_mode == all_active or active_mode == inactive, this can be NULL. */ - active_config_destructor_ftype * free_active_config; /* Destructor for the active_config object, can be NULL if that object is NULL. */ -}; - - - - diff --git a/ThirdParty/Ert/libenkf/src/analysis_config.c b/ThirdParty/Ert/libenkf/src/analysis_config.c deleted file mode 100644 index 9e18efd529..0000000000 --- a/ThirdParty/Ert/libenkf/src/analysis_config.c +++ /dev/null @@ -1,714 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'analysis_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - - -#define UPDATE_OVERLAP_KEY "OVERLAP_LIMIT" -#define UPDATE_STD_CUTOFF_KEY "STD_CUTOFF" - - -#define ANALYSIS_CONFIG_TYPE_ID 64431306 - -struct analysis_config_struct { - UTIL_TYPE_ID_DECLARATION; - hash_type * analysis_modules; - analysis_module_type * analysis_module; - char * log_path; /* Points to directory with update logs. */ - bool merge_observations; /* When observing from time1 to time2 - should ALL observations in between be used? */ - bool rerun; /* Should we rerun the simulator when the parameters have been updated? */ - int rerun_start; /* When rerunning - from where should we start? */ - config_settings_type * update_settings; - - char * PC_filename; - char * PC_path; - bool store_PC; - bool single_node_update; /* When creating the default ALL_ACTIVE local configuration. */ - rng_type * rng; - analysis_iter_config_type * iter_config; - int min_realisations; - bool stop_long_running; - bool std_scale_correlated_obs; - int max_runtime; - double global_std_scaling; -}; - - - - -UTIL_IS_INSTANCE_FUNCTION( analysis_config , ANALYSIS_CONFIG_TYPE_ID ) - -/*****************************************************************/ -/* - -Interacting with modules ------------------------- - -The modules which are included in the build must be installed/loaded with a -hard-coded call to analysis_config_load_internal_module(). External modules -are loaded with the config statement: - - ANALYSIS_LOAD ModuleName libfile - -Where 'ModuleName is the name you want to use to refer to the module, and -libfile is the name of the library file which implements the analysis -module[1]. - -It is possible to create a copy of an analysis module under a different -name, this can be convenient when trying out the same algorithm with -different parameter settings. I.e. based on the built in module STD_ENKF we -can create two copies with high and low truncation respectively: - - ANALYSIS_COPY STD_ENKF ENKF_HIGH_TRUNCATION - ANALYSIS_COPY STD_ENKF ENKF_LOW_TRUNCATION - -The copy operation does not differentiate between external and internal -modules. When a module has been loaded you can set internal parameters for -the module with the config command: - - ANALYSIS_SET_VAR ModuleName VariableName Value - -The module will be called with a function for setting variables which gets -the VariableName and value parameters as input; if the module recognizes -VariableName and Value is of the right type the module should set the -internal variable accordingly. If the module does not recognize the -variable name a warning will be printed on stderr, but no further action. - -The actual analysis module to use is selected with the statement: - -ANALYSIS_SELECT ModuleName - -[1] The libfile argument should include the '.so' extension, and can - optionally contain a path component. The libfile will be passed directly to - the dlopen() library call, this implies that normal runtime linking - conventions apply - i.e. you have three options: - - 1. The library name is given with a full path. - 2. The library is in a standard location for shared libraries. - 3. The library is in one of the directories mentioned in the - LD_LIBRARY_PATH environment variable. - -*/ - - -/*****************************************************************/ - -bool analysis_config_have_enough_realisations( const analysis_config_type * config , int realisations, int ensemble_size) { - if (config->min_realisations > 0) { - /* A value > 0 has been set in the config; compare with this value. */ - return realisations >= config->min_realisations; - } - else { - return realisations >= ensemble_size; - } -} - -void analysis_config_set_stop_long_running( analysis_config_type * config, bool stop_long_running ) { - config->stop_long_running = stop_long_running; -} - -bool analysis_config_get_stop_long_running( const analysis_config_type * config) { - return config->stop_long_running; -} - -bool analysis_config_get_std_scale_correlated_obs( const analysis_config_type * config) { - return config->std_scale_correlated_obs; -} - -void analysis_config_set_std_scale_correlated_obs( analysis_config_type * config, bool std_scale_correlated_obs) { - config->std_scale_correlated_obs = std_scale_correlated_obs; -} - -double analysis_config_get_global_std_scaling(const analysis_config_type * config) { - return config->global_std_scaling; -} - -void analysis_config_set_global_std_scaling(analysis_config_type * config, double global_std_scaling) { - config->global_std_scaling = global_std_scaling; -} - -int analysis_config_get_max_runtime( const analysis_config_type * config ) { - return config->max_runtime; -} - -void analysis_config_set_max_runtime( analysis_config_type * config, int max_runtime ) { - config->max_runtime = max_runtime; -} - -static void analysis_config_set_min_realisations( analysis_config_type * config , int min_realisations) { - config->min_realisations = min_realisations; -} - - -stringlist_type * analysis_config_alloc_module_names( analysis_config_type * config ) { - return hash_alloc_stringlist( config->analysis_modules ); -} - -void analysis_config_set_store_PC( analysis_config_type * config , bool store_PC) { - config->store_PC = store_PC; -} - -bool analysis_config_get_store_PC( const analysis_config_type * config ) { - return config->store_PC; -} - -void analysis_config_set_PC_filename( analysis_config_type * config , const char * filename ) { - config->PC_filename = util_realloc_string_copy( config->PC_filename , filename ); -} - -const char * analysis_config_get_PC_filename( const analysis_config_type * config ) { - return config->PC_filename; -} - - -void analysis_config_set_PC_path( analysis_config_type * config , const char * path ) { - config->PC_path = util_realloc_string_copy( config->PC_path , path ); -} - -const char * analysis_config_get_PC_path( const analysis_config_type * config ) { - return config->PC_path; -} - - -void analysis_config_set_alpha( analysis_config_type * config , double alpha) { - config_settings_set_double_value(config->update_settings, UPDATE_OVERLAP_KEY, alpha ); -} - - -double analysis_config_get_alpha(const analysis_config_type * config) { - return config_settings_get_double_value(config->update_settings, UPDATE_OVERLAP_KEY); -} - -void analysis_config_set_std_cutoff( analysis_config_type * config , double std_cutoff ) { - config_settings_set_double_value(config->update_settings, UPDATE_STD_CUTOFF_KEY, std_cutoff ); -} - -double analysis_config_get_std_cutoff(const analysis_config_type * config) { - return config_settings_get_double_value(config->update_settings, UPDATE_STD_CUTOFF_KEY); -} - - -void analysis_config_set_log_path(analysis_config_type * config , const char * log_path ) { - config->log_path = util_realloc_string_copy(config->log_path , log_path); -} - - -/** - Will in addition create the path. -*/ -const char * analysis_config_get_log_path( const analysis_config_type * config ) { - util_make_path( config->log_path ); - return config->log_path; -} - - - -void analysis_config_set_rerun_start( analysis_config_type * config , int rerun_start ) { - config->rerun_start = rerun_start; -} - -void analysis_config_set_rerun(analysis_config_type * config , bool rerun) { - config->rerun = rerun; -} - -bool analysis_config_get_rerun(const analysis_config_type * config) { - return config->rerun; -} - -void analysis_config_set_single_node_update(analysis_config_type * config , bool single_node_update) { - config->single_node_update = single_node_update; -} - -bool analysis_config_get_single_node_update(const analysis_config_type * config) { - return config->single_node_update; -} - - -int analysis_config_get_rerun_start(const analysis_config_type * config) { - return config->rerun_start; -} - - -void analysis_config_set_merge_observations( analysis_config_type * config , bool merge_observations) { - config->merge_observations = merge_observations; -} - - - -/*****************************************************************/ - -void analysis_config_load_internal_module( analysis_config_type * config , - const char * symbol_table ) { - analysis_module_type * module = analysis_module_alloc_internal( config->rng , symbol_table ); - if (module != NULL) - hash_insert_hash_owned_ref( config->analysis_modules , analysis_module_get_name( module ) , module , analysis_module_free__ ); - else - fprintf(stderr,"** Warning: failed to load module %s from %s.\n", analysis_module_get_name( module ) , symbol_table); -} - - -void analysis_config_load_all_external_modules_from_config ( analysis_config_type * analysis, const config_content_type * config) { - - if (config_content_has_item( config, ANALYSIS_LOAD_KEY)) { - const config_content_item_type * load_item = config_content_get_item( config , ANALYSIS_LOAD_KEY ); - for (int i=0; i < config_content_item_get_size( load_item ); i++) { - const config_content_node_type * load_node = config_content_item_iget_node( load_item , i ); - const char * user_name = config_content_node_iget( load_node , 0 ); - const char * lib_name = config_content_node_iget( load_node , 1 ); - - analysis_config_load_external_module( analysis , lib_name , user_name); - } - } -} - - -bool analysis_config_load_external_module( analysis_config_type * config , - const char * lib_name, - const char * user_name) { - analysis_module_type * module = analysis_module_alloc_external( config->rng , lib_name ); - if (module != NULL) { - if (user_name) - analysis_module_set_name(module, user_name); - hash_insert_hash_owned_ref( config->analysis_modules , analysis_module_get_name( module ) , module , analysis_module_free__ ); - return true; - } else { - fprintf(stderr,"** Warning: failed to load module from %s.\n",lib_name); - return false; - } -} - - -void analysis_config_add_module_copy( analysis_config_type * config , - const char * src_name , - const char * target_name) { - const analysis_module_type * src_module = analysis_config_get_module( config , src_name ); - analysis_module_type * target_module; - - if (analysis_module_internal( src_module )) { - const char * symbol_table = analysis_module_get_table_name( src_module ); - target_module = analysis_module_alloc_internal( config->rng , symbol_table ); - } else { - const char * lib_name = analysis_module_get_lib_name( src_module ); - target_module = analysis_module_alloc_external( config->rng , lib_name ); - } - - hash_insert_hash_owned_ref( config->analysis_modules , target_name , target_module , analysis_module_free__ ); - analysis_module_set_name( target_module , target_name ); -} - - - -/* - If module_name == NULL we will reload the current module. Unloading - modules is based on the dlclose() system call; internally the - dlopen() / dlclose() systems implements a reference counting to the - shared objects, i.e. if you have several modules defined in the same - shared library the dlclose() call will not unload the module - completely, and a subsequent dlopen() call will be satisfied by the - stale shared objects still mapped. Practically this means that: - - * Internal modules (all in libanalysis.so) can not be reloaded. - - * Modules which have been involved in copy operations, either as - source or target can not be reloaded. -*/ - -void analysis_config_reload_module( analysis_config_type * config , const char * module_name) { - analysis_module_type * module; - if (module_name != NULL) - module = analysis_config_get_module( config , module_name ); - else - module = config->analysis_module; - - if (!analysis_module_internal( module )) { - char * user_name = util_alloc_string_copy(analysis_module_get_name( module )); - char * lib_name = util_alloc_string_copy(analysis_module_get_lib_name( module )); - - bool is_current = false; - if (module == config->analysis_module) { - config->analysis_module = NULL; - is_current = true; - } - - hash_del( config->analysis_modules , user_name ); - analysis_config_load_external_module( config , user_name , lib_name ); - if (is_current) - analysis_config_select_module( config , user_name ); - - free( lib_name ); - free( user_name ); - } else - fprintf(stderr,"** Warning: Internal modules can not be reloaded.\n"); -} - - -analysis_module_type * analysis_config_get_module( analysis_config_type * config , const char * module_name ) { - return hash_get( config->analysis_modules , module_name ); -} - -bool analysis_config_has_module(analysis_config_type * config , const char * module_name) { - return hash_has_key( config->analysis_modules , module_name ); -} - -bool analysis_config_get_module_option( const analysis_config_type * config , long flag) { - if (config->analysis_module) - return analysis_module_check_option(config->analysis_module , flag); - else - return false; -} - - -bool analysis_config_select_module( analysis_config_type * config , const char * module_name ) { - if (analysis_config_has_module( config , module_name )) { - analysis_module_type * module = analysis_config_get_module( config , module_name ); - - if (analysis_module_check_option( module , ANALYSIS_ITERABLE)) { - if (analysis_config_get_single_node_update( config )) { - fprintf(stderr," ** Warning: the module:%s requires the setting \"SINGLE_NODE_UPDATE FALSE\" in the config file.\n" , module_name); - fprintf(stderr," ** the module has NOT been selected. \n"); - return false; - } - } - - config->analysis_module = module; - return true; - } else { - if (config->analysis_module == NULL) - util_abort("%s: sorry module:%s does not exist - and no module currently selected\n",__func__ , module_name); - else - fprintf(stderr , "** Warning: analysis module:%s does not exist - current selection unchanged:%s\n", - module_name , - analysis_module_get_name( config->analysis_module )); - return false; - } -} - - -analysis_module_type * analysis_config_get_active_module( analysis_config_type * config ) { - return config->analysis_module; -} - - -const char * analysis_config_get_active_module_name( const analysis_config_type * config ) { - if (config->analysis_module) - return analysis_module_get_name( config->analysis_module ); - else - return NULL; -} - - - -/*****************************************************************/ - - -void analysis_config_load_internal_modules( analysis_config_type * config ) { - analysis_config_load_internal_module( config , "STD_ENKF"); - analysis_config_load_internal_module( config , "NULL_ENKF"); - analysis_config_load_internal_module( config , "SQRT_ENKF"); - analysis_config_load_internal_module( config , "CV_ENKF"); - analysis_config_load_internal_module( config , "BOOTSTRAP_ENKF"); - analysis_config_load_internal_module( config , "FWD_STEP_ENKF"); - analysis_config_select_module( config , DEFAULT_ANALYSIS_MODULE); -} - -/** - The analysis_config object is instantiated with the default values - for enkf_defaults.h -*/ - -void analysis_config_init( analysis_config_type * analysis , const config_content_type * config ) { - config_settings_apply(analysis->update_settings , config); - - if (config_content_has_item( config , UPDATE_LOG_PATH_KEY )) - analysis_config_set_log_path( analysis , config_content_get_value( config , UPDATE_LOG_PATH_KEY )); - - if (config_content_has_item( config , STD_CUTOFF_KEY )) - analysis_config_set_std_cutoff( analysis , config_content_get_value_as_double( config , STD_CUTOFF_KEY )); - - if (config_content_has_item( config , ENKF_ALPHA_KEY )) - analysis_config_set_alpha( analysis , config_content_get_value_as_double( config , ENKF_ALPHA_KEY )); - - if (config_content_has_item( config , ENKF_MERGE_OBSERVATIONS_KEY )) - analysis_config_set_merge_observations( analysis , config_content_get_value_as_bool( config , ENKF_MERGE_OBSERVATIONS_KEY )); - - if (config_content_has_item( config , ENKF_RERUN_KEY )) - analysis_config_set_rerun( analysis , config_content_get_value_as_bool( config , ENKF_RERUN_KEY )); - - if (config_content_has_item( config , SINGLE_NODE_UPDATE_KEY )) - analysis_config_set_single_node_update( analysis , config_content_get_value_as_bool( config , SINGLE_NODE_UPDATE_KEY )); - - if (config_content_has_item( config , STD_SCALE_CORRELATED_OBS_KEY )) - analysis_config_set_std_scale_correlated_obs( analysis , config_content_get_value_as_bool( config , STD_SCALE_CORRELATED_OBS_KEY )); - - if (config_content_has_item( config , RERUN_START_KEY )) - analysis_config_set_rerun_start( analysis , config_content_get_value_as_int( config , RERUN_START_KEY )); - - if (config_content_has_item( config , MIN_REALIZATIONS_KEY )) { - - config_content_node_type * config_content = config_content_get_value_node(config , MIN_REALIZATIONS_KEY); - char * min_realizations_string = config_content_node_alloc_joined_string(config_content, " "); - - int num_realizations = config_content_get_value_as_int(config, NUM_REALIZATIONS_KEY); - int min_realizations = DEFAULT_ANALYSIS_MIN_REALISATIONS; - double percent = 0.0; - if (util_sscanf_percent(min_realizations_string, &percent)) { - - min_realizations = num_realizations * percent/100; - } else { - bool min_realizations_int_exists = util_sscanf_int(min_realizations_string, &min_realizations); - if (!min_realizations_int_exists) - fprintf(stderr, "Method %s: failed to read integer value for MIN_REALIZATIONS_KEY\n", __func__); - } - - if (min_realizations > num_realizations) - min_realizations = num_realizations; - - analysis_config_set_min_realisations(analysis, min_realizations); - free(min_realizations_string); - } - - if (config_content_has_item( config , STOP_LONG_RUNNING_KEY )) - analysis_config_set_stop_long_running( analysis , config_content_get_value_as_bool( config , STOP_LONG_RUNNING_KEY )); - - if (config_content_has_item( config, MAX_RUNTIME_KEY)) { - analysis_config_set_max_runtime( analysis, config_content_get_value_as_int( config, MAX_RUNTIME_KEY )); - } - - - /* Loading external modules */ - analysis_config_load_all_external_modules_from_config(analysis, config); - - - /* Reload/copy modules. */ - { - if (config_content_has_item( config , ANALYSIS_COPY_KEY )) { - const config_content_item_type * copy_item = config_content_get_item( config , ANALYSIS_COPY_KEY ); - for (int i=0; i < config_content_item_get_size( copy_item ); i++) { - const config_content_node_type * copy_node = config_content_item_iget_node( copy_item , i ); - const char * src_name = config_content_node_iget( copy_node , 0 ); - const char * target_name = config_content_node_iget( copy_node , 1 ); - - analysis_config_add_module_copy( analysis , src_name , target_name); - } - } - } - - - /* Setting variables for analysis modules */ - { - if (config_content_has_item( config , ANALYSIS_SET_VAR_KEY )) { - const config_content_item_type * assign_item = config_content_get_item( config , ANALYSIS_SET_VAR_KEY ); - for (int i=0; i < config_content_item_get_size( assign_item ); i++) { - const config_content_node_type * assign_node = config_content_item_iget_node( assign_item , i ); - - const char * module_name = config_content_node_iget( assign_node , 0 ); - const char * var_name = config_content_node_iget( assign_node , 1 ); - analysis_module_type * module = analysis_config_get_module( analysis , module_name ); - { - char * value = NULL; - - for (int j=2; j < config_content_node_get_size( assign_node ); j++) { - const char * config_value = config_content_node_iget( assign_node , j ); - if (value == NULL) - value = util_alloc_string_copy( config_value ); - else { - value = util_strcat_realloc( value , " " ); - value = util_strcat_realloc( value , config_value ); - } - } - - analysis_module_set_var( module , var_name , value ); - free( value ); - } - } - } - } - - if (config_content_has_item( config, ANALYSIS_SELECT_KEY )) - analysis_config_select_module( analysis , config_content_get_value( config , ANALYSIS_SELECT_KEY )); - - analysis_iter_config_init( analysis->iter_config , config ); -} - - - -bool analysis_config_get_merge_observations(const analysis_config_type * config) { - return config->merge_observations; -} - - -analysis_iter_config_type * analysis_config_get_iter_config( const analysis_config_type * config ) { - return config->iter_config; -} - - -void analysis_config_free(analysis_config_type * config) { - analysis_iter_config_free( config->iter_config ); - hash_free( config->analysis_modules ); - config_settings_free( config->update_settings ); - free( config->log_path ); - free( config->PC_filename ); - free( config->PC_path ); - free( config ); -} - - - -analysis_config_type * analysis_config_alloc( rng_type * rng ) { - analysis_config_type * config = util_malloc( sizeof * config ); - UTIL_TYPE_ID_INIT( config , ANALYSIS_CONFIG_TYPE_ID ); - - config->log_path = NULL; - config->PC_filename = NULL; - config->PC_path = NULL; - config->update_settings = config_settings_alloc( UPDATE_SETTING_KEY ); - config_settings_add_double_setting(config->update_settings, UPDATE_OVERLAP_KEY , DEFAULT_ENKF_ALPHA); - config_settings_add_double_setting(config->update_settings, UPDATE_STD_CUTOFF_KEY, DEFAULT_ENKF_STD_CUTOFF ); - - analysis_config_set_merge_observations( config , DEFAULT_MERGE_OBSERVATIONS ); - analysis_config_set_rerun( config , DEFAULT_RERUN ); - analysis_config_set_rerun_start( config , DEFAULT_RERUN_START ); - analysis_config_set_single_node_update( config , DEFAULT_SINGLE_NODE_UPDATE ); - analysis_config_set_log_path( config , DEFAULT_UPDATE_LOG_PATH); - - analysis_config_set_store_PC( config , DEFAULT_STORE_PC ); - analysis_config_set_PC_filename( config , DEFAULT_PC_FILENAME ); - analysis_config_set_PC_path( config , DEFAULT_PC_PATH ); - analysis_config_set_min_realisations( config , DEFAULT_ANALYSIS_MIN_REALISATIONS ); - analysis_config_set_stop_long_running( config , DEFAULT_ANALYSIS_STOP_LONG_RUNNING ); - analysis_config_set_max_runtime( config , DEFAULT_MAX_RUNTIME ); - - config->analysis_module = NULL; - config->analysis_modules = hash_alloc(); - config->rng = rng; - config->iter_config = analysis_iter_config_alloc(); - config->std_scale_correlated_obs = false; - config->global_std_scaling = 1.0; - return config; -} - - - -/*****************************************************************/ -/* - Keywords for the analysis - all optional. The analysis_config object - is instantiated with defaults from enkf_defaults.h -*/ - -void analysis_config_add_config_items( config_parser_type * config ) { - config_schema_item_type * item; - - config_add_key_value( config , ENKF_ALPHA_KEY , false , CONFIG_FLOAT); - config_add_key_value( config , STD_CUTOFF_KEY , false , CONFIG_FLOAT); - config_settings_init_parser__( UPDATE_SETTING_KEY , config , false ); - - config_add_key_value( config , ENKF_MERGE_OBSERVATIONS_KEY , false , CONFIG_BOOL); - config_add_key_value( config , SINGLE_NODE_UPDATE_KEY , false , CONFIG_BOOL); - config_add_key_value( config , ENKF_CROSS_VALIDATION_KEY , false , CONFIG_BOOL); - config_add_key_value( config , ENKF_LOCAL_CV_KEY , false , CONFIG_BOOL); - config_add_key_value( config , ENKF_PEN_PRESS_KEY , false , CONFIG_BOOL); - config_add_key_value( config , ENKF_SCALING_KEY , false , CONFIG_BOOL); - config_add_key_value( config , ENKF_KERNEL_REG_KEY , false , CONFIG_BOOL); - config_add_key_value( config , ENKF_KERNEL_FUNC_KEY , false , CONFIG_INT); - config_add_key_value( config , ENKF_KERNEL_PARAM_KEY , false , CONFIG_INT); - config_add_key_value( config , ENKF_CV_FOLDS_KEY , false , CONFIG_INT); - config_add_key_value( config , ENKF_RERUN_KEY , false , CONFIG_BOOL); - config_add_key_value( config , RERUN_START_KEY , false , CONFIG_INT); - config_add_key_value( config , UPDATE_LOG_PATH_KEY , false , CONFIG_STRING); - config_add_key_value( config , MIN_REALIZATIONS_KEY , false , CONFIG_STRING ); - config_add_key_value( config , MAX_RUNTIME_KEY , false , CONFIG_INT ); - config_add_key_value( config , STD_SCALE_CORRELATED_OBS_KEY, false , CONFIG_BOOL ); - - item = config_add_key_value( config , STOP_LONG_RUNNING_KEY, false, CONFIG_BOOL ); - stringlist_type * child_list = stringlist_alloc_new(); - stringlist_append_ref(child_list, MIN_REALIZATIONS_KEY); - config_schema_item_set_required_children_on_value(item , "TRUE" , child_list); - stringlist_free(child_list); - - config_add_key_value( config , ANALYSIS_SELECT_KEY , false , CONFIG_STRING); - - item = config_add_schema_item( config , ANALYSIS_LOAD_KEY , false ); - config_schema_item_set_argc_minmax( item , 2 , 2); - - item = config_add_schema_item( config , ANALYSIS_COPY_KEY , false ); - config_schema_item_set_argc_minmax( item , 2 , 2); - - - item = config_add_schema_item( config , ANALYSIS_SET_VAR_KEY , false ); - config_schema_item_set_argc_minmax( item , 3 , CONFIG_DEFAULT_ARG_MAX); - analysis_iter_config_add_config_items( config ); -} - - - -void analysis_config_fprintf_config( analysis_config_type * config , FILE * stream) { - fprintf( stream , CONFIG_COMMENTLINE_FORMAT ); - fprintf( stream , CONFIG_COMMENT_FORMAT , "Here comes configuration information related to the EnKF analysis."); - - - if (config->merge_observations != DEFAULT_MERGE_OBSERVATIONS) { - fprintf( stream , CONFIG_KEY_FORMAT , ENKF_MERGE_OBSERVATIONS_KEY); - fprintf( stream , CONFIG_ENDVALUE_FORMAT , CONFIG_BOOL_STRING( config->merge_observations )); - } - - if (config->single_node_update != DEFAULT_SINGLE_NODE_UPDATE) { - fprintf( stream , CONFIG_KEY_FORMAT , SINGLE_NODE_UPDATE_KEY); - fprintf( stream , CONFIG_ENDVALUE_FORMAT , CONFIG_BOOL_STRING( config->single_node_update )); - } - - if (config->rerun) { - fprintf( stream , CONFIG_KEY_FORMAT , ENKF_RERUN_KEY); - fprintf( stream , CONFIG_ENDVALUE_FORMAT , CONFIG_BOOL_STRING( config->rerun )); - } - - if (config->rerun_start != DEFAULT_RERUN_START) { - fprintf( stream , CONFIG_KEY_FORMAT , RERUN_START_KEY); - fprintf( stream , CONFIG_INT_FORMAT , config->rerun_start ); - fprintf( stream , "\n"); - } - - if (config->log_path != NULL) { - fprintf( stream , CONFIG_KEY_FORMAT , UPDATE_LOG_PATH_KEY); - fprintf( stream , CONFIG_ENDVALUE_FORMAT , config->log_path ); - } - - fprintf(stream , "\n\n"); -} - - - diff --git a/ThirdParty/Ert/libenkf/src/analysis_iter_config.c b/ThirdParty/Ert/libenkf/src/analysis_iter_config.c deleted file mode 100644 index b269ca447d..0000000000 --- a/ThirdParty/Ert/libenkf/src/analysis_iter_config.c +++ /dev/null @@ -1,131 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'analysis_iter_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include -#include - -#include -#include - -#include - -#include -#include -#include - - -struct analysis_iter_config_struct { - char * case_fmt; - stringlist_type * storage; - int num_iterations; - int num_iter_tries; - bool case_set; - bool num_iterations_set; -}; - - -void analysis_iter_config_set_num_iterations( analysis_iter_config_type * config , int num_iterations) { - config->num_iterations = num_iterations; - config->num_iterations_set = true; -} - -int analysis_iter_config_get_num_iterations( const analysis_iter_config_type * config ) { - return config->num_iterations; -} - -bool analysis_iter_config_num_iterations_set( const analysis_iter_config_type * config ) { - return config->num_iterations_set; -} - - -void analysis_iter_config_set_num_retries_per_iteration( analysis_iter_config_type * config , int num_iter_tries) { - config->num_iter_tries = num_iter_tries; -} - -int analysis_iter_config_get_num_retries_per_iteration( const analysis_iter_config_type * config ) { - return config->num_iter_tries; -} - - -void analysis_iter_config_set_case_fmt( analysis_iter_config_type * config , const char * case_fmt) { - config->case_fmt = util_realloc_string_copy( config->case_fmt , case_fmt ); - config->case_set = true; -} - - -bool analysis_iter_config_case_fmt_set( const analysis_iter_config_type * config ) { - return config->case_set; -} - - -char * analysis_iter_config_get_case_fmt( analysis_iter_config_type * config) { - return config->case_fmt; -} - - -analysis_iter_config_type * analysis_iter_config_alloc() { - analysis_iter_config_type * config = util_malloc( sizeof * config ); - config->case_fmt = NULL; - analysis_iter_config_set_case_fmt( config, DEFAULT_ANALYSIS_ITER_CASE); - config->storage = stringlist_alloc_new(); - analysis_iter_config_set_num_iterations( config , DEFAULT_ANALYSIS_NUM_ITERATIONS ); - analysis_iter_config_set_num_retries_per_iteration(config, DEFAULT_ITER_RETRY_COUNT); - - config->num_iterations_set = false; - config->case_set = false; - return config; -} - -void analysis_iter_config_free( analysis_iter_config_type * config ) { - util_safe_free( config->case_fmt ); - stringlist_free( config->storage ); - util_safe_free( config ); -} - - -const char * analysis_iter_config_iget_case( analysis_iter_config_type * config , int iter) { - if (config->case_fmt != NULL) { - char * fs_case = util_alloc_sprintf( config->case_fmt , iter ); - stringlist_append_owned_ref( config->storage , fs_case); - return fs_case; - } else - return NULL; -} - - -void analysis_iter_config_add_config_items( config_parser_type * config ) { - config_add_key_value( config , ITER_CASE_KEY , false , CONFIG_STRING); - config_add_key_value( config , ITER_COUNT_KEY , false , CONFIG_INT); - config_add_key_value( config , ITER_RETRY_COUNT_KEY , false , CONFIG_INT); -} - - -void analysis_iter_config_init(analysis_iter_config_type * iter_config , const config_content_type * config) { - if (config_content_has_item( config , ITER_CASE_KEY )) - analysis_iter_config_set_case_fmt( iter_config , config_content_get_value( config , ITER_CASE_KEY )); - - if (config_content_has_item( config , ITER_COUNT_KEY )) - analysis_iter_config_set_num_iterations( iter_config , config_content_get_value_as_int( config , ITER_COUNT_KEY )); - - if (config_content_has_item( config , ITER_RETRY_COUNT_KEY )) - analysis_iter_config_set_num_retries_per_iteration( iter_config , config_content_get_value_as_int( config , ITER_RETRY_COUNT_KEY )); -} - - diff --git a/ThirdParty/Ert/libenkf/src/block_fs_driver.c b/ThirdParty/Ert/libenkf/src/block_fs_driver.c deleted file mode 100644 index f22eb6e5ab..0000000000 --- a/ThirdParty/Ert/libenkf/src/block_fs_driver.c +++ /dev/null @@ -1,511 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'block_fs_driver.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - - -typedef struct bfs_struct bfs_type; -typedef struct bfs_config_struct bfs_config_type; - -struct bfs_config_struct { - int fsync_interval; - double fragmentation_limit; - bool read_only; - bool preload; - int block_size; - int max_cache_size; - bool bfs_lock; -}; - - -#define BFS_TYPE_ID 5510643 - -struct bfs_struct { - UTIL_TYPE_ID_DECLARATION; - /*-----------------------------------------------------------------*/ - /* New variables */ - block_fs_type * block_fs; - char * mountfile; // The full path to the file mounted by the block_fs layer - including extension. - - const bfs_config_type * config; -}; - - - -struct block_fs_driver_struct { - FS_DRIVER_FIELDS; - int __id; - int num_fs; - bfs_config_type * config; - - // New variables - bfs_type ** fs_list; -}; - -/*****************************************************************/ - -bfs_config_type * bfs_config_alloc( fs_driver_enum driver_type , bool read_only, bool bfs_lock) { - const int PARAMETER_blocksize = 64; - const int DYNAMIC_blocksize = 64; - const int DEFAULT_blocksize = 64; - - const bool PARAMETER_preload = false; - const bool DYNAMIC_preload = true; - const bool DEFAULT_preload = false; - - const int max_cache_size = 512; - const int fsync_interval = 10; /* An fsync() call is issued for every 10'th write. */ - const double fragmentation_limit = 1.0; /* 1.0 => NO defrag is run. */ - - { - bfs_config_type * config = util_malloc( sizeof * config ); - config->max_cache_size = max_cache_size; - config->fsync_interval = fsync_interval; - config->fragmentation_limit = fragmentation_limit; - config->read_only = read_only; - config->bfs_lock = bfs_lock; - - switch (driver_type) { - case( DRIVER_PARAMETER ): - config->block_size = PARAMETER_blocksize; - config->preload = PARAMETER_preload; - break; - case(DRIVER_DYNAMIC_FORECAST): - config->block_size = DYNAMIC_blocksize; - config->preload = DYNAMIC_preload; - break; - default: - config->block_size = DEFAULT_blocksize; - config->preload = DEFAULT_preload; - } - return config; - } -} - -void bfs_config_free( bfs_config_type * config ) { - free( config ); -} - -/*****************************************************************/ - -static UTIL_SAFE_CAST_FUNCTION(bfs , BFS_TYPE_ID); - -static void bfs_close( bfs_type * bfs ) { - if (bfs->block_fs != NULL) - block_fs_close( bfs->block_fs , false); - free( bfs->mountfile ); - free( bfs ); -} - - -static void * bfs_close__( void * arg ) { - bfs_type * bfs = ( bfs_type * ) arg; - bfs_close( bfs ); - - return NULL; -} - -static bfs_type * bfs_alloc( const bfs_config_type * config ) { - bfs_type * fs = util_malloc( sizeof * fs ); - UTIL_TYPE_ID_INIT( fs , BFS_TYPE_ID ); - fs->config = config; - - // New init - fs->mountfile = NULL; - - return fs; -} - - -static bfs_type * bfs_alloc_new( const bfs_config_type * config , char * mountfile) { - bfs_type * bfs = bfs_alloc( config ); - - bfs->mountfile = mountfile; // Warning pattern break: This is allocated in external scope; and the bfs takes ownership. - return bfs; -} - - -static void bfs_mount( bfs_type * bfs) { - const bfs_config_type * config = bfs->config; - bfs->block_fs = block_fs_mount( bfs->mountfile , - config->block_size , - config->max_cache_size , - config->fragmentation_limit , - config->fsync_interval , - config->preload , - config->read_only, - config->bfs_lock); -} - - -static void * bfs_mount__( void * arg ) { - bfs_type * bfs = bfs_safe_cast( arg ); - bfs_mount( bfs ); - //printf("."); - //fflush( stdout ); - return NULL; -} - - - - -static void bfs_fsync( bfs_type * bfs ) { - block_fs_fsync( bfs->block_fs ); -} - - - -/*****************************************************************/ - - -static void block_fs_driver_assert_cast(block_fs_driver_type * block_fs_driver) { - if (block_fs_driver->__id != BLOCK_FS_DRIVER_ID) - util_abort("%s: internal error - cast failed - aborting \n",__func__); -} - - -static block_fs_driver_type * block_fs_driver_safe_cast( void * __driver) { - block_fs_driver_type * driver = (block_fs_driver_type *) __driver; - block_fs_driver_assert_cast(driver); - return driver; -} - -static char * block_fs_driver_alloc_node_key( const block_fs_driver_type * driver , const char * node_key , int report_step , int iens) { - char * key = util_alloc_sprintf("%s.%d.%d" , node_key , report_step , iens); - return key; -} - - -static char * block_fs_driver_alloc_vector_key( const block_fs_driver_type * driver , const char * node_key , int iens) { - char * key = util_alloc_sprintf("%s.%d" , node_key , iens); - return key; -} - -/** - This function will take an input string, and try to to parse it as - string.int.int, where string is the normal enkf key, and the two - integers are report_step and ensemble number respectively. The - storage for the enkf_key is allocated here in this function, and - must be freed by the calling scope. - - If the parsing fails the function will return false, and *config_key - will be set to NULL; in this case the report_step and iens poinyers - will not be touched. -*/ - -bool block_fs_sscanf_key(const char * key , char ** config_key , int * __report_step , int * __iens) { - char ** tmp; - int num_items; - - *config_key = NULL; - util_split_string(key , "." , &num_items , &tmp); /* The key can contain additional '.' - can not use sscanf(). */ - if (num_items >= 3) { - int report_step , iens; - if (util_sscanf_int(tmp[num_items - 2] , &report_step) && util_sscanf_int(tmp[num_items - 1] , &iens)) { - /* OK - all is hunkadory */ - *__report_step = report_step; - *__iens = iens; - *config_key = util_alloc_joined_string((const char **) tmp , num_items - 2 , "."); /* This must bee freed by the calling scope */ - util_free_stringlist( tmp , num_items ); - return true; - } else - /* Failed to parse the two last items as integers. */ - return false; - } else - /* Did not have at least three items. */ - return false; -} - - - - -static bfs_type * block_fs_driver_get_fs( block_fs_driver_type * driver , int iens ) { - int phase = (iens % driver->num_fs); - - return driver->fs_list[phase]; -} - - - -static void block_fs_driver_load_node(void * _driver , const char * node_key , int report_step , int iens , buffer_type * buffer) { - block_fs_driver_type * driver = block_fs_driver_safe_cast( _driver ); - { - char * key = block_fs_driver_alloc_node_key( driver , node_key , report_step , iens ); - bfs_type * bfs = block_fs_driver_get_fs( driver , iens ); - - block_fs_fread_realloc_buffer( bfs->block_fs , key , buffer); - - free( key ); - } -} - - -static void block_fs_driver_load_vector(void * _driver , const char * node_key , int iens , buffer_type * buffer) { - block_fs_driver_type * driver = block_fs_driver_safe_cast( _driver ); - { - char * key = block_fs_driver_alloc_vector_key( driver , node_key , iens ); - bfs_type * bfs = block_fs_driver_get_fs( driver , iens ); - - block_fs_fread_realloc_buffer( bfs->block_fs , key , buffer); - free( key ); - } -} - -/*****************************************************************/ - -static void block_fs_driver_save_node(void * _driver , const char * node_key , int report_step , int iens , buffer_type * buffer) { - block_fs_driver_type * driver = (block_fs_driver_type *) _driver; - block_fs_driver_assert_cast(driver); - { - char * key = block_fs_driver_alloc_node_key( driver , node_key , report_step , iens ); - bfs_type * bfs = block_fs_driver_get_fs( driver , iens ); - block_fs_fwrite_buffer( bfs->block_fs , key , buffer); - free( key ); - } -} - - -static void block_fs_driver_save_vector(void * _driver , const char * node_key , int iens , buffer_type * buffer) { - block_fs_driver_type * driver = (block_fs_driver_type *) _driver; - block_fs_driver_assert_cast(driver); - { - char * key = block_fs_driver_alloc_vector_key( driver , node_key , iens ); - bfs_type * bfs = block_fs_driver_get_fs( driver , iens ); - block_fs_fwrite_buffer( bfs->block_fs , key , buffer); - free( key ); - } -} - -/*****************************************************************/ - -void block_fs_driver_unlink_node(void * _driver , const char * node_key , int report_step , int iens ) { - block_fs_driver_type * driver = (block_fs_driver_type *) _driver; - block_fs_driver_assert_cast(driver); - { - char * key = block_fs_driver_alloc_node_key( driver , node_key , report_step , iens ); - bfs_type * bfs = block_fs_driver_get_fs( driver , iens ); - block_fs_unlink_file( bfs->block_fs , key ); - free( key ); - } -} - -void block_fs_driver_unlink_vector(void * _driver , const char * node_key , int iens ) { - block_fs_driver_type * driver = (block_fs_driver_type *) _driver; - block_fs_driver_assert_cast(driver); - { - char * key = block_fs_driver_alloc_vector_key( driver , node_key , iens ); - bfs_type * bfs = block_fs_driver_get_fs( driver , iens ); - block_fs_unlink_file( bfs->block_fs , key ); - free( key ); - } -} - - -/*****************************************************************/ - -bool block_fs_driver_has_node(void * _driver , const char * node_key , int report_step , int iens ) { - block_fs_driver_type * driver = (block_fs_driver_type *) _driver; - block_fs_driver_assert_cast(driver); - { - char * key = block_fs_driver_alloc_node_key( driver , node_key , report_step , iens ); - bfs_type * bfs = block_fs_driver_get_fs( driver , iens ); - bool has_node = block_fs_has_file( bfs->block_fs , key ); - free( key ); - return has_node; - } -} - - -bool block_fs_driver_has_vector(void * _driver , const char * node_key , int iens ) { - block_fs_driver_type * driver = (block_fs_driver_type *) _driver; - block_fs_driver_assert_cast(driver); - { - char * key = block_fs_driver_alloc_vector_key( driver , node_key , iens ); - bfs_type * bfs = block_fs_driver_get_fs( driver , iens ); - bool has_node = block_fs_has_file( bfs->block_fs , key ); - free( key ); - return has_node; - } -} - -/*****************************************************************/ - - - - - - - - - -void block_fs_driver_free(void *_driver) { - block_fs_driver_type * driver = block_fs_driver_safe_cast( _driver ); - { - int driver_nr; - thread_pool_type * tp = thread_pool_alloc( 4 , true); - for (driver_nr = 0; driver_nr < driver->num_fs; driver_nr++) - thread_pool_add_job( tp , bfs_close__ , driver->fs_list[driver_nr] ); - - thread_pool_join( tp ); - thread_pool_free( tp ); - } - bfs_config_free( driver->config ); - free( driver->fs_list ); - free(driver); -} - - - -static void block_fs_driver_fsync( void * _driver ) { - block_fs_driver_type * driver = (block_fs_driver_type *) _driver; - block_fs_driver_assert_cast(driver); - - { - int driver_nr; - block_fs_driver_type * driver = block_fs_driver_safe_cast(_driver); - for (driver_nr = 0; driver_nr < driver->num_fs; driver_nr++) - bfs_fsync( driver->fs_list[driver_nr] ); - } -} - - -static block_fs_driver_type * block_fs_driver_alloc(int num_fs) { - block_fs_driver_type * driver = util_malloc(sizeof * driver ); - { - fs_driver_type * fs_driver = (fs_driver_type *) driver; - fs_driver_init(fs_driver); - } - driver->load_node = block_fs_driver_load_node; - driver->save_node = block_fs_driver_save_node; - driver->unlink_node = block_fs_driver_unlink_node; - driver->has_node = block_fs_driver_has_node; - - driver->load_vector = block_fs_driver_load_vector; - driver->save_vector = block_fs_driver_save_vector; - driver->unlink_vector = block_fs_driver_unlink_vector; - driver->has_vector = block_fs_driver_has_vector; - - driver->free_driver = block_fs_driver_free; - driver->fsync_driver = block_fs_driver_fsync; - driver->__id = BLOCK_FS_DRIVER_ID; - driver->num_fs = num_fs; - - driver->fs_list = util_calloc( driver->num_fs , sizeof * driver->fs_list ); - return driver; -} - - - - -static void * block_fs_driver_alloc_new( fs_driver_enum driver_type , bool read_only , int num_fs , const char * mountfile_fmt, bool block_level_lock ) { - block_fs_driver_type * driver = block_fs_driver_alloc( num_fs); - driver->config = bfs_config_alloc( driver_type , read_only, block_level_lock ); - { - for (int ifs = 0; ifs < driver->num_fs; ifs++) - driver->fs_list[ifs] = bfs_alloc_new( driver->config , util_alloc_sprintf( mountfile_fmt , ifs) ); - } - return driver; -} - - -static void block_fs_driver_mount( block_fs_driver_type * driver ) { - thread_pool_type * tp = thread_pool_alloc( 4 , true ); - - for (int ifs = 0; ifs < driver->num_fs; ifs++) - thread_pool_add_job( tp , bfs_mount__ , driver->fs_list[ ifs ]); - - thread_pool_join( tp ); - thread_pool_free( tp ); -} - - - - - -/*****************************************************************/ - -void block_fs_driver_create_fs( FILE * stream , - const char * mount_point , - fs_driver_enum driver_type , - int num_fs , - const char * ens_path_fmt, - const char * filename ) { - - util_fwrite_int(driver_type , stream ); - util_fwrite_int(num_fs , stream ); - { - char * mountfile_fmt = util_alloc_sprintf("%s%c%s.mnt" , ens_path_fmt , UTIL_PATH_SEP_CHAR , filename ); - util_fwrite_string( mountfile_fmt , stream ); - free( mountfile_fmt ); - } - - for (int ifs = 0; ifs < num_fs; ifs++) { - char * path_fmt = util_alloc_sprintf("%s%c%s" , mount_point , UTIL_PATH_SEP_CHAR , ens_path_fmt); - char * ens_path = util_alloc_sprintf(path_fmt , ifs); - - util_make_path( ens_path ); - - free( path_fmt ); - free( ens_path ); - } - -} - - -/* - @path should contain both elements called root_path and case_path in - the block_fs_driver_create() function. -*/ - -void * block_fs_driver_open(FILE * fstab_stream , const char * mount_point , fs_driver_enum driver_type , bool read_only) { - int num_fs = util_fread_int( fstab_stream ); - char * tmp_fmt = util_fread_alloc_string( fstab_stream ); - char * mountfile_fmt = util_alloc_sprintf("%s%c%s" , mount_point , UTIL_PATH_SEP_CHAR , tmp_fmt ); - const bool block_level_lock = false; - - block_fs_driver_type * driver = block_fs_driver_alloc_new( driver_type , read_only , num_fs , mountfile_fmt, block_level_lock ); - - block_fs_driver_mount( driver ); - - free( tmp_fmt ); - free( mountfile_fmt ); - return driver; -} - - -void block_fs_driver_fskip(FILE * fstab_stream) { - util_fskip_int( fstab_stream ); - { - char * tmp_fmt = util_fread_alloc_string( fstab_stream ); - free( tmp_fmt ); - } -} diff --git a/ThirdParty/Ert/libenkf/src/block_obs.c b/ThirdParty/Ert/libenkf/src/block_obs.c deleted file mode 100644 index 61a6c4adea..0000000000 --- a/ThirdParty/Ert/libenkf/src/block_obs.c +++ /dev/null @@ -1,466 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'block_obs.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -/** - See the overview documentation of the observation system in enkf_obs.c -*/ -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define BLOCK_OBS_TYPE_ID 661098 -#define POINT_OBS_TYPE_ID 778196 - - -typedef struct { - UTIL_TYPE_ID_DECLARATION; - block_obs_source_type source_type; - int i; - int j; - int k; - int active_index; - double value; - double std; - double std_scaling; - char * sum_key; -} point_obs_type; - -static UTIL_SAFE_CAST_FUNCTION(point_obs , POINT_OBS_TYPE_ID); - - -struct block_obs_struct { - UTIL_TYPE_ID_DECLARATION; - char * obs_key; /** A user provided label for the observation. */ - vector_type * point_list; - const ecl_grid_type * grid; - const void * data_config; - block_obs_source_type source_type; -}; - - -static UTIL_SAFE_CAST_FUNCTION_CONST(block_obs , BLOCK_OBS_TYPE_ID); -static UTIL_SAFE_CAST_FUNCTION(block_obs , BLOCK_OBS_TYPE_ID); -UTIL_IS_INSTANCE_FUNCTION(block_obs , BLOCK_OBS_TYPE_ID); - - -/*****************************************************************/ - - - - - -static point_obs_type * point_obs_alloc( block_obs_source_type source_type , int i , int j , int k , int active_index , const char * sum_key , double value , double std) { - point_obs_type * point_obs = util_malloc( sizeof * point_obs ); - UTIL_TYPE_ID_INIT( point_obs , POINT_OBS_TYPE_ID ); - - point_obs->source_type = source_type; - point_obs->i = i; - point_obs->j = j; - point_obs->k = k; - point_obs->active_index = active_index; - point_obs->value = value; - point_obs->std = std; - point_obs->sum_key = util_alloc_string_copy( sum_key ); - point_obs->std_scaling = 1.0; - - return point_obs; -} - - - - - - -static void point_obs_free( point_obs_type * point_obs ) { - util_safe_free( point_obs->sum_key ); - free( point_obs ); -} - -static void point_obs_free__( void * arg ) { - point_obs_type * point_obs = point_obs_safe_cast( arg ); - point_obs_free( point_obs ); -} - - - -static double point_obs_iget_data( const point_obs_type * point_obs , const void * state , int iobs , node_id_type node_id) { - if (point_obs->source_type == SOURCE_FIELD) { - const field_type * field = field_safe_cast_const( state ); - return field_iget_double(field , point_obs->active_index); - } else if (point_obs->source_type == SOURCE_SUMMARY) { - const container_type * container = container_safe_cast_const( state ); - const summary_type * summary = summary_safe_cast_const( container_iget_node( container , iobs )); - return summary_get( summary , node_id.report_step ); - } else { - util_abort("%s: unknown source type: %d \n",__func__, point_obs->source_type ); - return -1; - } -} - - -/*****************************************************************/ - - -static const point_obs_type * block_obs_iget_point_const( const block_obs_type * block_obs , int index) { - return vector_iget_const( block_obs->point_list , index ); -} - - -static point_obs_type * block_obs_iget_point( const block_obs_type * block_obs , int index) { - return vector_iget( block_obs->point_list , index ); -} - - -static void block_obs_validate_ijk( const ecl_grid_type * grid , int size, const int * i , const int * j , const int * k) { - int l; - for (l = 0; l < size; l++) { - if (ecl_grid_ijk_valid(grid , i[l] , j[l] , k[l])) { - int active_index = ecl_grid_get_active_index3( grid , i[l] , j[l] , k[l]); - if (active_index < 0) - util_abort("%s: sorry: cell:(%d,%d,%d) is not active - can not observe it. \n",__func__ , i[l]+1 , j[l]+1 , k[l]+1); - - } else - util_abort("%s: sorry: cell (%d,%d,%d) is outside valid range: \n",__func__ , i[l]+1 , j[l]+1 , k[l]+1); - } -} - - -static void block_obs_append_point( block_obs_type * block_obs , point_obs_type * point) { - if (point->source_type == block_obs->source_type) - vector_append_owned_ref(block_obs->point_list , point , point_obs_free__); - else - util_abort("%s: fatal internal error - mixing points with different source type in one block_obs instance.\n",__func__); -} - - -void block_obs_append_field_obs( block_obs_type * block_obs , int i , int j , int k , double value , double std) { - int active_index = ecl_grid_get_active_index3( block_obs->grid , i , j , k ); - point_obs_type * point_obs = point_obs_alloc( SOURCE_FIELD , i , j , k , active_index , NULL , value , std); - block_obs_append_point( block_obs , point_obs ); -} - - -void block_obs_append_summary_obs( block_obs_type * block_obs , int i , int j , int k , const char * sum_key , double value , double std) { - int active_index = ecl_grid_get_active_index3( block_obs->grid , i , j , k ); - point_obs_type * point_obs = point_obs_alloc( SOURCE_SUMMARY , i , j , k , active_index , sum_key , value , std); - block_obs_append_point( block_obs , point_obs ); -} - - -block_obs_type * block_obs_alloc(const char * obs_key, - const void * data_config , - const ecl_grid_type * grid) { - - if (!(field_config_is_instance( data_config ) || container_config_is_instance( data_config ))) - return NULL; - - { - block_obs_type * block_obs = util_malloc(sizeof * block_obs); - UTIL_TYPE_ID_INIT( block_obs , BLOCK_OBS_TYPE_ID ); - - block_obs->obs_key = util_alloc_string_copy(obs_key); - block_obs->data_config = data_config; - block_obs->point_list = vector_alloc_new(); - block_obs->grid = grid; - - if (field_config_is_instance( data_config )) - block_obs->source_type = SOURCE_FIELD; - else - block_obs->source_type = SOURCE_SUMMARY; - - return block_obs; - } -} - - - -/** - The input vectors i,j,k should contain offset zero values. -*/ -block_obs_type * block_obs_alloc_complete(const char * obs_key, - block_obs_source_type source_type , - const stringlist_type * summary_keys , - const void * data_config , - const ecl_grid_type * grid , - int size, - const int * i, - const int * j, - const int * k, - const double * obs_value, - const double * obs_std) -{ - block_obs_validate_ijk( grid , size , i,j,k); - { - block_obs_type * block_obs = block_obs_alloc( obs_key , data_config , grid ); - if (block_obs) { - for (int l=0; l < size; l++) { - - if (source_type == SOURCE_SUMMARY) { - const char * sum_key = stringlist_iget( summary_keys , l ); - block_obs_append_summary_obs( block_obs , i[l] , j[l] , k[l] , sum_key , obs_value[l] , obs_std[l]); - } else - block_obs_append_field_obs( block_obs , i[l] , j[l] , k[l] , obs_value[l] , obs_std[l]); - - } - return block_obs; - } else { - util_abort("%s: internal error - block_obs_alloc() returned NULL \n",__func__); - return NULL; - } - } -} - - - -void block_obs_free( block_obs_type * block_obs) { - vector_free( block_obs->point_list ); - free(block_obs->obs_key); - free(block_obs); -} - - - - - - - -void block_obs_get_observations(const block_obs_type * block_obs, obs_data_type * obs_data, enkf_fs_type * fs, int report_step , const active_list_type * __active_list) { - int i; - int obs_size = block_obs_get_size( block_obs ); - int active_size = active_list_get_active_size( __active_list , obs_size); - active_mode_type active_mode = active_list_get_mode( __active_list ); - obs_block_type * obs_block = obs_data_add_block( obs_data , block_obs->obs_key , obs_size , NULL , false ); - - if (active_mode == ALL_ACTIVE) { - for (i=0; i < obs_size; i++) { - const point_obs_type * point_obs = block_obs_iget_point_const( block_obs , i ); - obs_block_iset(obs_block , i , point_obs->value , point_obs->std * point_obs->std_scaling ); - } - } else if (active_mode == PARTLY_ACTIVE) { - const int * active_list = active_list_get_active( __active_list ); - for (i =0 ; i < active_size; i++) { - int iobs = active_list[i]; - const point_obs_type * point_obs = block_obs_iget_point_const( block_obs , i ); - obs_block_iset(obs_block , iobs , point_obs->value , point_obs->std * point_obs->std_scaling ); - } - } -} - - -static void block_obs_assert_data( const block_obs_type * block_obs , const void * state ) { - if (block_obs->source_type == SOURCE_FIELD) { - if (!field_is_instance( state )) - util_abort("%s: state data is not of type FIELD - aborting \n",__func__); - } else if (block_obs->source_type == SOURCE_SUMMARY) { - if (!container_is_instance( state )) - util_abort("%s: state data is not of type CONTAINER - aborting \n",__func__); - } -} - - -double block_obs_iget_data( const block_obs_type * block_obs, const void * state , int iobs , node_id_type node_id ) { - const point_obs_type * point_obs = block_obs_iget_point_const( block_obs , iobs ); - return point_obs_iget_data( point_obs , state , iobs , node_id); -} - - - -void block_obs_measure(const block_obs_type * block_obs, const void * state , node_id_type node_id , meas_data_type * meas_data , const active_list_type * __active_list) { - block_obs_assert_data( block_obs , state ); - { - int obs_size = block_obs_get_size( block_obs ); - int active_size = active_list_get_active_size( __active_list , obs_size ); - meas_block_type * meas_block = meas_data_add_block( meas_data , block_obs->obs_key , node_id.report_step , obs_size ); - int iobs; - - active_mode_type active_mode = active_list_get_mode( __active_list ); - if (active_mode == ALL_ACTIVE) { - for (iobs=0; iobs < obs_size; iobs++) { - double value = block_obs_iget_data( block_obs , state , iobs , node_id ); - meas_block_iset( meas_block , node_id.iens , iobs , value ); - } - } else if (active_mode == PARTLY_ACTIVE) { - const int * active_list = active_list_get_active( __active_list ); - for (int i =0 ; i < active_size; i++) { - iobs = active_list[i]; - { - double value = block_obs_iget_data( block_obs , state , iobs , node_id); - meas_block_iset( meas_block , node_id.iens , i , value ); - } - } - } - } -} - - - -double block_obs_chi2(const block_obs_type * block_obs, const void * state, node_id_type node_id) { - double sum_chi2 = 0; - int obs_size = block_obs_get_size( block_obs ); - block_obs_assert_data(block_obs, state); - - for (int i=0; i < obs_size; i++) { - const point_obs_type * point_obs = block_obs_iget_point_const( block_obs , i ); - double sim_value = point_obs_iget_data( point_obs , state , i, node_id ); - double x = (sim_value - point_obs->value) / point_obs->std; - sum_chi2 += x*x; - } - return sum_chi2; -} - - - - -/** - The index is into the the number of active cells which are observed by this observation. -*/ -void block_obs_iget(const block_obs_type * block_obs, int index , double *value , double * std) { - const point_obs_type * point_obs = block_obs_iget_point_const( block_obs , index ); - *value = point_obs->value; - *std = point_obs->std; -} - -double block_obs_iget_value(const block_obs_type * block_obs, int index ){ - const point_obs_type * point_obs = block_obs_iget_point_const( block_obs , index ); - return point_obs->value; -} - -double block_obs_iget_std(const block_obs_type * block_obs, int index ){ - const point_obs_type * point_obs = block_obs_iget_point_const( block_obs , index ); - return point_obs->std; -} - -double block_obs_iget_std_scaling(const block_obs_type * block_obs, int index ){ - const point_obs_type * point_obs = block_obs_iget_point_const( block_obs , index ); - return point_obs->std_scaling; -} - - -void block_obs_user_get(const block_obs_type * block_obs , const char * index_key , double *value , double * std, bool * valid) { - int i,j,k; - - *valid = false; - if (field_config_parse_user_key__( index_key , &i , &j , &k)) { - int obs_size = block_obs_get_size( block_obs ); - int active_index = ecl_grid_get_active_index3(block_obs->grid , i,j,k); - int l = 0; - /* iterating through all the cells the observation is observing. */ - - while (!(*valid) && l < obs_size) { - const point_obs_type * point_obs = block_obs_iget_point_const( block_obs , l); - if (point_obs->active_index == active_index) { - *value = point_obs->value; - *std = point_obs->std; - *valid = true; - } - l++; - } - } -} - - - - -int block_obs_iget_i(const block_obs_type * block_obs, int index) { - const point_obs_type * point_obs = block_obs_iget_point_const( block_obs , index); - return point_obs->i; -} - -int block_obs_iget_j(const block_obs_type * block_obs, int index) { - const point_obs_type * point_obs = block_obs_iget_point_const( block_obs , index); - return point_obs->j; -} - -int block_obs_iget_k(const block_obs_type * block_obs, int index) { - const point_obs_type * point_obs = block_obs_iget_point_const( block_obs , index); - return point_obs->k; -} - -double block_obs_iget_depth( const block_obs_type * block_obs , int index) { - const point_obs_type * point_obs = block_obs_iget_point_const( block_obs , index); - return ecl_grid_get_cdepth3( block_obs->grid , point_obs->i , point_obs->j ,point_obs->k); -} - -/* - Returns by reference i,j,k for observation point nr block_nr. -*/ - -void block_obs_iget_ijk(const block_obs_type * block_obs , int block_nr , int * i , int * j , int * k) { - const point_obs_type * point_obs = block_obs_iget_point_const( block_obs , block_nr ); - *i = point_obs->i; - *j = point_obs->j; - *k = point_obs->k; -} - - -int block_obs_get_size(const block_obs_type * block_obs) { - return vector_get_size( block_obs->point_list ); -} - -void block_obs_update_std_scale(block_obs_type * block_obs, double scale_factor, const active_list_type * active_list) { - int obs_size = block_obs_get_size( block_obs ); - if (active_list_get_mode( active_list ) == ALL_ACTIVE) { - for (int i = 0; i < obs_size; i++) { - point_obs_type * point_observation = block_obs_iget_point( block_obs , i ); - point_observation->std_scaling = scale_factor; - } - } else { - const int * active_index = active_list_get_active( active_list ); - int size = active_list_get_active_size( active_list , obs_size ); - for (int i=0; i < size; i++) { - int obs_index = active_index[i]; - point_obs_type * point_observation = block_obs_iget_point( block_obs , obs_index ); - point_observation->std_scaling = scale_factor; - } - } -} - - - - - - -/*****************************************************************/ - -VOID_FREE(block_obs) -VOID_GET_OBS(block_obs) -VOID_MEASURE_UNSAFE(block_obs , data) // The cast of data field is not checked - that is done in block_obs_measure(). -VOID_USER_GET_OBS(block_obs) -VOID_CHI2(block_obs , field) -VOID_UPDATE_STD_SCALE(block_obs) diff --git a/ThirdParty/Ert/libenkf/src/cases_config.c b/ThirdParty/Ert/libenkf/src/cases_config.c deleted file mode 100644 index 7a3c594d37..0000000000 --- a/ThirdParty/Ert/libenkf/src/cases_config.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'cases_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include -#include - -#include -#include - -#include - -#include -#include -#include - - -struct cases_config_struct { - int iteration_number; -}; - - -cases_config_type * cases_config_alloc( ) { - cases_config_type * config = util_malloc( sizeof * config ); - config->iteration_number = 0; - return config; -} - - -static void cases_config_set_iteration_number( cases_config_type * config , int num_iterations) { - config->iteration_number = num_iterations; -} - -int cases_config_get_iteration_number( const cases_config_type * config ) { - return config->iteration_number; -} - -bool cases_config_set_int( cases_config_type * cases_config , const char * var_name , int value) { - bool name_recognized = true; - if (strcmp( var_name , "iteration_number") == 0) - cases_config_set_iteration_number(cases_config, value); - else - name_recognized = false; - - return name_recognized; -} - - - -void cases_config_fwrite( cases_config_type * config , const char * filename ) { - FILE * stream = util_mkdir_fopen(filename , "w"); - int iteration_no = cases_config_get_iteration_number(config); - util_fwrite_int( iteration_no , stream ); - fclose( stream ); -} - -void cases_config_fread( cases_config_type * config , const char * filename) { - if (util_file_exists( filename )) { - FILE * stream = util_fopen( filename , "r"); - int iteration_number = util_fread_int( stream ); - cases_config_set_iteration_number(config,iteration_number); - fclose( stream ); - } -} - - -void cases_config_free( cases_config_type * config ) { - free( config ); -} - diff --git a/ThirdParty/Ert/libenkf/src/container.c b/ThirdParty/Ert/libenkf/src/container.c deleted file mode 100644 index 671a061f4e..0000000000 --- a/ThirdParty/Ert/libenkf/src/container.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'container.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include -#include -#include - -struct container_struct { - int __type_id; - const container_config_type * config; - vector_type * nodes; -}; - - - -container_type * container_alloc( const container_config_type * config ) { - container_type * container = util_malloc( sizeof * container ); - UTIL_TYPE_ID_INIT( container , CONTAINER ); - container->config = config; - container->nodes = vector_alloc_new(); - return container; -} - - -void container_free( container_type * container ) { - vector_free( container->nodes ); - free( container ); -} - -void container_add_node(container_type * container , void * child_node ) { - vector_append_ref( container->nodes , child_node ); -} - -const void * container_iget_node(const container_type * container , int index) { - return vector_iget_const( container->nodes , index ); -} - -int container_get_size( const container_type * container ) { - return vector_get_size( container->nodes ); -} - -void container_assert_size( const container_type * container ) { - if (vector_get_size( container->nodes ) != container_config_get_size( container->config )) - util_abort("%s: container size mismatch. Current:%d Config:%d \n",__func__ , container_get_size( container ) , container_config_get_size( container->config )); -} - - -/******************************************************************/ -/* Anonumously generated functions used by the enkf_node object */ -/******************************************************************/ - -UTIL_IS_INSTANCE_FUNCTION(container , CONTAINER) -UTIL_SAFE_CAST_FUNCTION(container , CONTAINER) -UTIL_SAFE_CAST_FUNCTION_CONST(container , CONTAINER) -VOID_ALLOC(container) -VOID_FREE(container) - - - - - - - diff --git a/ThirdParty/Ert/libenkf/src/container_config.c b/ThirdParty/Ert/libenkf/src/container_config.c deleted file mode 100644 index 50d37243c9..0000000000 --- a/ThirdParty/Ert/libenkf/src/container_config.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'container_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -#include -#include - -#include -#include - -#define CONTAINER_CONFIG_TYPE_ID 51330852 - -struct container_config_struct { - UTIL_TYPE_ID_DECLARATION; - vector_type * nodes; -}; - -UTIL_IS_INSTANCE_FUNCTION(container_config , CONTAINER_CONFIG_TYPE_ID); - -container_config_type * container_config_alloc( const char * key ) { - container_config_type * container = util_malloc( sizeof * container ); - UTIL_TYPE_ID_INIT( container , CONTAINER_CONFIG_TYPE_ID ); - container->nodes = vector_alloc_new(); - return container; -} - - - -void container_config_free( container_config_type * container_config ) { - vector_free( container_config->nodes ); - free( container_config ); -} - - -void container_config_add_node( container_config_type * container_config , const enkf_config_node_type * config_node) { - vector_append_ref( container_config->nodes , config_node ); -} - -const void * container_config_iget_node(const container_config_type * container_config , int index) { - return vector_iget_const( container_config->nodes , index ); -} - -int container_config_get_size( const container_config_type * container_config ) { - return vector_get_size( container_config->nodes ); -} - - -int container_config_get_data_size( const container_config_type * container_config ) { - util_exit("%s: not implemented \n",__func__); - return 0; -} - - -/*****************************************************************/ - -UTIL_SAFE_CAST_FUNCTION(container_config , CONTAINER_CONFIG_TYPE_ID) -UTIL_SAFE_CAST_FUNCTION_CONST(container_config , CONTAINER_CONFIG_TYPE_ID) -VOID_GET_DATA_SIZE(container) -VOID_CONFIG_FREE(container) - diff --git a/ThirdParty/Ert/libenkf/src/custom_kw.c b/ThirdParty/Ert/libenkf/src/custom_kw.c deleted file mode 100644 index ab44db926c..0000000000 --- a/ThirdParty/Ert/libenkf/src/custom_kw.c +++ /dev/null @@ -1,149 +0,0 @@ -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - - -struct custom_kw_struct { - int __type_id; - custom_kw_config_type * config; - /* Thin config object - mainly contains filename for remote load */ - stringlist_type * data; /* Actual storage - will be casted to double or float on use. */ -}; - - -custom_kw_type * custom_kw_alloc(const custom_kw_config_type * config) { - custom_kw_type * custom_kw = util_malloc(sizeof * custom_kw); - custom_kw->config = (custom_kw_config_type *) config; - custom_kw->data = stringlist_alloc_new(); - - stringlist_type * keys = custom_kw_config_get_keys(custom_kw->config); - for(int index = 0; index < stringlist_get_size(keys); index++) { - const char * key = stringlist_iget(keys, index); - if(custom_kw_config_key_is_double(custom_kw->config, key)) { - custom_kw_set_double(custom_kw, key, 0.0); - } else { - custom_kw_set_string(custom_kw, key, ""); - } - } - - custom_kw->__type_id = CUSTOM_KW; - return custom_kw; -} - -void custom_kw_free(custom_kw_type * custom_kw) { - stringlist_free(custom_kw->data); - free(custom_kw); -} - -const stringlist_type * custom_kw_get_data(const custom_kw_type * custom_kw) { - return custom_kw->data; -} - -bool custom_kw_key_is_null(const custom_kw_type * custom_kw, char * key) { - int index = custom_kw_config_index_of_key(custom_kw->config, key); - return stringlist_iget(custom_kw->data, index) == NULL; -} - - -void custom_kw_set_double(custom_kw_type * custom_kw, const char * key, double value) { - char value_as_string[128]; - sprintf(value_as_string, "%26.100f", value); - custom_kw_set_string(custom_kw, key, value_as_string); -} - - -void custom_kw_set_string(custom_kw_type * custom_kw, const char * key, const char * value) { - int index = custom_kw_config_index_of_key(custom_kw->config, key); - stringlist_iset_copy(custom_kw->data, index, value); -} - - -double custom_kw_iget_as_double(const custom_kw_type * custom_kw, int index) { - double value; - - util_sscanf_double(stringlist_iget(custom_kw->data, index), & value); - return value; -} - -const char * custom_kw_iget_as_string(const custom_kw_type * custom_kw, int index) { - return stringlist_iget(custom_kw->data, index); -} - -custom_kw_config_type * custom_kw_get_config(const custom_kw_type * custom_kw) { - return custom_kw->config; -} - -bool custom_kw_fload(custom_kw_type * custom_kw, const char * filename) { - return custom_kw_config_parse_result_file(custom_kw->config, filename, custom_kw->data); -} - -bool custom_kw_forward_load(custom_kw_type * custom_kw, const char * ecl_file, const forward_load_context_type * load_context) { - return custom_kw_fload(custom_kw, ecl_file); -} - -bool custom_kw_write_to_buffer(const custom_kw_type * custom_kw, buffer_type * buffer, int report_step) { - stringlist_buffer_fwrite(custom_kw->data, buffer); - return true; -} - -void custom_kw_read_from_buffer(const custom_kw_type * custom_kw, buffer_type * buffer, enkf_fs_type * fs, int report_step) { - stringlist_buffer_fread(custom_kw->data, buffer); -} - -void custom_kw_ecl_write(const custom_kw_type * custom_kw, const char * run_path, const char * base_file, void * filestream) { - //printf("CustomKW ecl_write\n"); -} - -void custom_kw_serialize(const custom_kw_type * custom_kw, node_id_type node_id, const active_list_type * active_list, matrix_type * A, int row_offset, int column) { - printf("CustomKW serialize\n"); -} - -void custom_kw_deserialize(custom_kw_type * custom_kw, node_id_type node_id, const active_list_type * active_list, const matrix_type * A, int row_offset, int column) { - printf("CustomKW deserialize\n"); -} - -/******************************************************************/ -/* Anonumously generated functions used by the enkf_node object */ -/******************************************************************/ -UTIL_SAFE_CAST_FUNCTION_CONST(custom_kw, CUSTOM_KW) - -UTIL_SAFE_CAST_FUNCTION(custom_kw, CUSTOM_KW) - -VOID_ALLOC(custom_kw) - -VOID_FREE(custom_kw) - -VOID_FORWARD_LOAD(custom_kw) - -VOID_FLOAD(custom_kw) - -VOID_ECL_WRITE(custom_kw) - -VOID_READ_FROM_BUFFER(custom_kw); - -VOID_WRITE_TO_BUFFER(custom_kw); - -VOID_SERIALIZE(custom_kw) - -VOID_DESERIALIZE(custom_kw) diff --git a/ThirdParty/Ert/libenkf/src/custom_kw_config.c b/ThirdParty/Ert/libenkf/src/custom_kw_config.c deleted file mode 100644 index d606bf4233..0000000000 --- a/ThirdParty/Ert/libenkf/src/custom_kw_config.c +++ /dev/null @@ -1,304 +0,0 @@ -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include - - -#define CUSTOM_KW_CONFIG_ID 90051933 - -struct custom_kw_config_struct { - UTIL_TYPE_ID_DECLARATION; - char * name; - char * result_file; - char * output_file; - - hash_type * custom_keys; - hash_type * custom_key_types; /* True if float */ - bool undefined; - char * key_definition_file; - - pthread_rwlock_t rw_lock; -}; - - -custom_kw_config_type * custom_kw_config_alloc_empty(const char * key, const char * result_file, const char * output_file) { - custom_kw_config_type * custom_kw_config = util_malloc(sizeof * custom_kw_config); - UTIL_TYPE_ID_INIT(custom_kw_config, CUSTOM_KW_CONFIG_ID); - - custom_kw_config->name = NULL; - custom_kw_config->result_file = util_alloc_string_copy(result_file); - custom_kw_config->output_file = util_alloc_string_copy(output_file); - custom_kw_config->name = util_alloc_string_copy(key); - custom_kw_config->undefined = true; - custom_kw_config->key_definition_file = NULL; - - custom_kw_config->custom_keys = hash_alloc(); - custom_kw_config->custom_key_types = hash_alloc(); //types: 0 if string, 1 if double - pthread_rwlock_init(& custom_kw_config->rw_lock, NULL); - - return custom_kw_config; -} - - -custom_kw_config_type * custom_kw_config_alloc_with_definition(const char * key, const hash_type * definition) { - custom_kw_config_type * custom_kw_config = custom_kw_config_alloc_empty(key, NULL, NULL); - - stringlist_type * keys = hash_alloc_stringlist((hash_type *) definition); - - for(int index = 0; index < stringlist_get_size(keys); index++) { - const char * definition_key = stringlist_iget_copy(keys, index); - int type_value = hash_get_int(definition, definition_key); - - if(type_value < 0 || type_value > 1) { - fprintf(stderr ,"[%s] Warning: Value type not 0 or 1 for key: '%s', defaulting to string!\n", __func__, key); - type_value = 0; - } - hash_insert_int(custom_kw_config->custom_keys, definition_key, index); - hash_insert_int(custom_kw_config->custom_key_types, definition_key, type_value); - } - - custom_kw_config->undefined = false; - custom_kw_config->key_definition_file = util_alloc_string_copy("custom definition"); - - stringlist_free(keys); - - return custom_kw_config; -} - - -void custom_kw_config_free(custom_kw_config_type * config) { - util_safe_free(config->name); - util_safe_free(config->result_file); - util_safe_free(config->output_file); - util_safe_free(config->key_definition_file); - - hash_free(config->custom_keys); - hash_free(config->custom_key_types); - - pthread_rwlock_destroy(& config->rw_lock); - - free(config); -} - -static void custom_kw_config_reset__(custom_kw_config_type * config) { - config->undefined = true; - hash_clear(config->custom_keys); - hash_clear(config->custom_key_types); - util_safe_free(config->key_definition_file); - config->key_definition_file = NULL; -} - -void custom_kw_config_serialize(const custom_kw_config_type * config, stringlist_type * config_set) { - pthread_rwlock_t * rw_lock = (pthread_rwlock_t *)& config->rw_lock; - pthread_rwlock_rdlock(rw_lock); - { - stringlist_clear(config_set); - - stringlist_type * configured_keys = custom_kw_config_get_keys(config); - - for (int i = 0; i < stringlist_get_size(configured_keys); i++) { - const char * key = stringlist_iget(configured_keys, i); - bool double_type = custom_kw_config_key_is_double(config, key); - int index = custom_kw_config_index_of_key(config, key); - char buffer[256]; - - sprintf(buffer, "%s %d %d", key, index, double_type); - stringlist_append_copy(config_set, buffer); - } - - stringlist_free(configured_keys); - - } - pthread_rwlock_unlock(rw_lock); -} - -void custom_kw_config_deserialize(custom_kw_config_type * config, stringlist_type * config_set) { - pthread_rwlock_wrlock(& config->rw_lock); - { - custom_kw_config_reset__(config); - - for (int i = 0; i < stringlist_get_size(config_set); i++) { - const char * items = stringlist_iget(config_set, i); - - char key[128]; - int index; - int is_double; - - int count = sscanf(items, "%s %d %d", key, &index, &is_double); - - if (count == 3) { - hash_insert_int(config->custom_keys, key, index); - hash_insert_int(config->custom_key_types, key, is_double); - } else - util_abort("%s: internal error - deserialize failed\n",__func__); - } - config->undefined = false; - config->key_definition_file = util_alloc_string_copy("from storage"); //Todo: Handle this differently? - } - pthread_rwlock_unlock(& config->rw_lock); -} - -int custom_kw_config_size(const custom_kw_config_type * config) { - return hash_get_size(config->custom_keys); -} - -const char * custom_kw_config_get_name(const custom_kw_config_type * config) { - return config->name; -} - -char * custom_kw_config_get_result_file(const custom_kw_config_type * config) { - return config->result_file; -} - -char * custom_kw_config_get_output_file(const custom_kw_config_type * config) { - return config->output_file; -} - -bool custom_kw_config_has_key(const custom_kw_config_type * config, const char * key) { - return hash_has_key(config->custom_keys, key); -} - -bool custom_kw_config_key_is_double(const custom_kw_config_type * config, const char * key) { - return hash_get_int(config->custom_key_types, key) == 1; -} - -int custom_kw_config_index_of_key(const custom_kw_config_type * config, const char * key) { - return hash_get_int(config->custom_keys, key); -} - -stringlist_type * custom_kw_config_get_keys(const custom_kw_config_type * config) { - return hash_alloc_stringlist(config->custom_keys); -} - -static bool custom_kw_config_setup__(custom_kw_config_type * config, const char * result_file) { - FILE * stream = util_fopen__(result_file, "r"); - if (stream != NULL) { - bool read_ok = true; - config->key_definition_file = util_alloc_string_copy(result_file); - - int counter = 0; - char key[128]; - char value[128]; - int read_count; - while ((read_count = fscanf(stream, "%s %s", key, value)) != EOF) { - if (read_count == 1) { - fprintf(stderr ,"[%s] Warning: Key: '%s:%s' is missing value in file: '%s'\n", __func__, config->name, key, result_file); - read_ok = false; - break; - } - - if (custom_kw_config_has_key(config, key)) { - fprintf(stderr ,"[%s] Warning: Key: '%s:%s' already defined!\n", __func__, config->name, key); - } else { - hash_insert_int(config->custom_keys, key, counter++); - hash_insert_int(config->custom_key_types, key, util_sscanf_double(value, NULL)); - } - } - - fclose(stream); - return read_ok; - } - return false; -} - -static bool custom_kw_config_read_data__(const custom_kw_config_type * config, const char * result_file, stringlist_type * result) { - FILE * stream = util_fopen__(result_file, "r"); - if (stream != NULL) { - bool read_ok = true; - - stringlist_clear(result); - stringlist_iset_ref(result, hash_get_size(config->custom_keys) - 1, NULL); - hash_type * read_keys = hash_alloc(); - - char key[128]; - char value[128]; - int read_count; - while ((read_count = fscanf(stream, "%s %s", key, value)) != EOF) { - if (read_count == 1) { - fprintf(stderr ,"[%s] Warning: Key: '%s:%s' missing value in file: %s!\n", __func__, config->name, key, result_file); - read_ok = false; - break; - } - - if (custom_kw_config_has_key(config, key)) { - if (hash_has_key(read_keys, key)) { - fprintf(stderr ,"[%s] Warning: Key: '%s:%s' has appeared multiple times. Only the last occurrence will be used!\n", __func__, config->name, key); - } - - hash_insert_int(read_keys, key, 1); - int index = custom_kw_config_index_of_key(config, key); - stringlist_iset_copy(result, index, value); - - } else { - fprintf(stderr ,"[%s] Warning: Key: '%s:%s' not in the available set. Ignored!\n", __func__, config->name, key); - } - } - - fclose(stream); - - if (read_ok) { - read_ok = hash_key_list_compare(read_keys, config->custom_keys); - } - - return read_ok; - } - return false; -} - -bool custom_kw_config_parse_result_file(custom_kw_config_type * config, const char * result_file, stringlist_type * result) { - bool read_ok = true; - - // if config->result_file is NULL then the CustomKWConfig was made dynamically - // for storing data manually and not as part of a forward model output. - if(config->result_file != NULL) { - pthread_rwlock_wrlock(&config->rw_lock); - if (config->undefined) { - read_ok = custom_kw_config_setup__(config, result_file); - if (read_ok) { - config->undefined = false; - } - } - pthread_rwlock_unlock(&config->rw_lock); - - if (read_ok) { - read_ok = custom_kw_config_read_data__(config, result_file, result); - } - } - - return read_ok; -} - - - -/*****************************************************************/ - -UTIL_IS_INSTANCE_FUNCTION(custom_kw_config, CUSTOM_KW_CONFIG_ID) - -UTIL_SAFE_CAST_FUNCTION(custom_kw_config, CUSTOM_KW_CONFIG_ID) - -UTIL_SAFE_CAST_FUNCTION_CONST(custom_kw_config, CUSTOM_KW_CONFIG_ID) - - - -/*****************************************************************/ - -VOID_FREE(custom_kw_config) diff --git a/ThirdParty/Ert/libenkf/src/custom_kw_config_set.c b/ThirdParty/Ert/libenkf/src/custom_kw_config_set.c deleted file mode 100644 index 681ebe379c..0000000000 --- a/ThirdParty/Ert/libenkf/src/custom_kw_config_set.c +++ /dev/null @@ -1,143 +0,0 @@ -#define _GNU_SOURCE /* Must define this to get access to pthread_rwlock_t */ - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - - -#define CUSTOM_KW_CONFIG_SET_TYPE_ID 701622133 - -struct custom_kw_config_set_struct { - UTIL_TYPE_ID_DECLARATION; - hash_type * config_set; - pthread_rwlock_t rw_lock; -}; - - -UTIL_IS_INSTANCE_FUNCTION(custom_kw_config_set, CUSTOM_KW_CONFIG_SET_TYPE_ID) - - -custom_kw_config_set_type * custom_kw_config_set_alloc() { - custom_kw_config_set_type * set = util_malloc(sizeof * set); - UTIL_TYPE_ID_INIT(set, CUSTOM_KW_CONFIG_SET_TYPE_ID); - set->config_set = hash_alloc(); - pthread_rwlock_init(& set->rw_lock, NULL); - return set; -} - -custom_kw_config_set_type * custom_kw_config_set_alloc_from_file(const char * filename) { - custom_kw_config_set_type * set = custom_kw_config_set_alloc(); - custom_kw_config_set_fread(set, filename); - return set; -} - -void custom_kw_config_set_free(custom_kw_config_set_type * set) { - hash_free(set->config_set); - free(set); -} - -void custom_kw_config_set_add_config(custom_kw_config_set_type * set, const custom_kw_config_type * config) { - pthread_rwlock_wrlock(& set->rw_lock); - { - const char * name = custom_kw_config_get_name(config); - - if (!hash_has_key(set->config_set, name)) { - stringlist_type * stringlist = stringlist_alloc_new(); - hash_insert_hash_owned_ref(set->config_set, name, stringlist, stringlist_free__); - } - - stringlist_type * formatted_keys = (stringlist_type *) hash_get(set->config_set, name); - custom_kw_config_serialize(config, formatted_keys); - - } - pthread_rwlock_unlock(& set->rw_lock); -} - -void custom_kw_config_set_update_config(custom_kw_config_set_type * set, custom_kw_config_type * config) { - pthread_rwlock_rdlock(& set->rw_lock); - { - const char * name = custom_kw_config_get_name(config); - - if(!hash_has_key(set->config_set, name)) { - printf("[%s] Warning: The key:'%s' is not part of this set. Ignored!\n", __func__, name); - } else { - stringlist_type * formatted_keys = (stringlist_type *) hash_get(set->config_set, name); - custom_kw_config_deserialize(config, formatted_keys); - } - } - pthread_rwlock_unlock(& set->rw_lock); -} - - -void custom_kw_config_set_reset(custom_kw_config_set_type * set) { - pthread_rwlock_wrlock(& set->rw_lock); - { - hash_clear(set->config_set); - } - pthread_rwlock_unlock(& set->rw_lock); -} - -stringlist_type * custom_kw_config_set_get_keys_alloc(custom_kw_config_set_type * set) { - return hash_alloc_stringlist(set->config_set); -} - -void custom_kw_config_set_fwrite(custom_kw_config_set_type * set, const char * filename) { - pthread_rwlock_rdlock(& set->rw_lock); - { - FILE * stream = util_mkdir_fopen(filename, "w"); - if (stream) { - stringlist_type * keys = hash_alloc_stringlist(set->config_set); - stringlist_fwrite(keys, stream); - - for (int i = 0; i < stringlist_get_size(keys); i++) { - const char * key = stringlist_iget(keys, i); - stringlist_type * formatted_keys = (stringlist_type *) hash_get(set->config_set, key); - stringlist_fwrite(formatted_keys, stream); - } - - stringlist_free(keys); - fclose(stream); - } else { - util_abort("%s: failed to open: %s for writing \n", __func__, filename); - } - } - pthread_rwlock_unlock(& set->rw_lock); -} - - -bool custom_kw_config_set_fread(custom_kw_config_set_type * set, const char * filename) { - bool file_exists = false; - - pthread_rwlock_wrlock(& set->rw_lock); - { - hash_clear(set->config_set); - - if (util_file_exists(filename)) { - FILE * stream = util_fopen(filename, "r"); - if (stream) { - stringlist_type * key_set = stringlist_fread_alloc(stream); - - for (int i = 0; i < stringlist_get_size(key_set); i++) { - const char * key = stringlist_iget(key_set, i); - stringlist_type * config_keys = stringlist_fread_alloc(stream); - hash_insert_hash_owned_ref(set->config_set, key, config_keys, stringlist_free__); - } - stringlist_free(key_set); - fclose(stream); - } else { - util_abort("%s: failed to open: %s for reading \n", __func__, filename); - } - file_exists = true; - } - } - pthread_rwlock_unlock(& set->rw_lock); - return file_exists; -} diff --git a/ThirdParty/Ert/libenkf/src/data_ranking.c b/ThirdParty/Ert/libenkf/src/data_ranking.c deleted file mode 100644 index 366c230c80..0000000000 --- a/ThirdParty/Ert/libenkf/src/data_ranking.c +++ /dev/null @@ -1,151 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'data_ranking.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - - -#define DATA_RANKING_TYPE_ID 71420672 - -struct data_ranking_struct { - UTIL_TYPE_ID_DECLARATION; - int ens_size; - double_vector_type * data_ensemble; - perm_vector_type * sort_permutation; - bool_vector_type * valid; - char * user_key; - bool sort_increasing; -}; - - -UTIL_SAFE_CAST_FUNCTION( data_ranking , DATA_RANKING_TYPE_ID ) -UTIL_IS_INSTANCE_FUNCTION( data_ranking , DATA_RANKING_TYPE_ID ); - - -void data_ranking_free( data_ranking_type * ranking ) { - double_vector_free( ranking->data_ensemble ); - bool_vector_free( ranking->valid ); - - if (ranking->sort_permutation) - perm_vector_free( ranking->sort_permutation ); - - util_safe_free( ranking->user_key ); - free( ranking ); -} - - - - - -static void data_ranking_init(data_ranking_type * ranking , - enkf_fs_type * fs , - const enkf_config_node_type * config_node, - const char * key_index , - int step) { - - enkf_node_type * enkf_node = enkf_node_alloc( config_node ); - int iens; - for (iens = 0; iens < ranking->ens_size; iens++) { - - double value; - node_id_type node_id = {.report_step = step , - .iens = iens }; - - if (enkf_node_user_get( enkf_node , fs , key_index , node_id , &value)) { - double_vector_iset( ranking->data_ensemble , iens , value ); - bool_vector_iset( ranking->valid , iens , true ); - } - } - - if (ranking->sort_increasing) - ranking->sort_permutation = double_vector_alloc_sort_perm( ranking->data_ensemble ); - else - ranking->sort_permutation = double_vector_alloc_rsort_perm( ranking->data_ensemble ); - - enkf_node_free( enkf_node ); -} - - - -data_ranking_type * data_ranking_alloc( bool sort_increasing , int ens_size , const char * user_key , const char * key_index , enkf_fs_type * fs , const enkf_config_node_type * config_node , int step) { - data_ranking_type * ranking = util_malloc( sizeof * ranking ); - UTIL_TYPE_ID_INIT( ranking , DATA_RANKING_TYPE_ID ); - ranking->ens_size = ens_size; - ranking->sort_increasing = sort_increasing; - - if (ranking->sort_increasing) - ranking->data_ensemble = double_vector_alloc( ens_size , INFINITY); // To ensure it comes last when sorting - else - ranking->data_ensemble = double_vector_alloc( ens_size , -INFINITY); // To ensure it comes last when sorting - - ranking->valid = bool_vector_alloc( ens_size , false ); - ranking->sort_permutation = NULL; - ranking->user_key = util_alloc_string_copy( user_key ); - - data_ranking_init( ranking , fs , config_node , key_index , step ); - return ranking; -} - - - -void data_ranking_free__( void * arg) { - data_ranking_type * ranking = data_ranking_safe_cast( arg ); - data_ranking_free( ranking ); -} - - -const perm_vector_type * data_ranking_get_permutation( const data_ranking_type * data_ranking ) { - return data_ranking->sort_permutation; -} - - -void data_ranking_display( const data_ranking_type * data_ranking , FILE * stream) { - const int ens_size = data_ranking->ens_size; - const perm_vector_type * permutations = data_ranking->sort_permutation; - - { - int i; - fprintf(stream,"\n\n"); - fprintf(stream," # Realization %12s\n" , data_ranking->user_key); - fprintf(stream,"----------------------------------\n"); - for (i = 0; i < ens_size; i++) { - int iens = perm_vector_iget( permutations , i ); - if (bool_vector_iget( data_ranking->valid , iens)) - fprintf(stream,"%3d %3d %14.3f\n",i,iens,double_vector_iget(data_ranking->data_ensemble , iens)); - - } - fprintf(stream,"----------------------------------\n"); - } -} diff --git a/ThirdParty/Ert/libenkf/src/dependencies b/ThirdParty/Ert/libenkf/src/dependencies deleted file mode 100644 index cb79581d6c..0000000000 --- a/ThirdParty/Ert/libenkf/src/dependencies +++ /dev/null @@ -1,71 +0,0 @@ -enkf_tui_fs.o : enkf_tui_fs.c enkf_tui_fs.h enkf_tui_util.o enkf_tui_init.o enkf_main.o enkf_types.o enkf_fs.o -summary_obs.o : summary_obs.c summary_obs.h obs_data.o meas_matrix.o summary.o active_list.o -enkf_fs.o : enkf_fs.c enkf_fs.h enkf_defaults.o enkf_node.o basic_driver.o fs_types.o ecl_static_kw.o plain_driver_index.o plain_driver.o sqlite3_driver.o block_fs_driver.o block_fs_driver_index.o -local_updatestep.o : local_updatestep.c local_updatestep.h local_ministep.o enkf_macros.h -enkf_config_node.o : enkf_config_node.c enkf_config_node.h enkf_types.o enkf_macros.h field_config.o gen_data_config.o gen_kw_config.o summary_config.o -enkf_tui_util.o : enkf_tui_util.c enkf_tui_util.h enkf_node.o field.o field_config.o enkf_state.o ensemble_config.o enkf_types.o -enkf_defaults.o : enkf_defaults.c enkf_defaults.h -gen_data.o : gen_data.c gen_data.h enkf_serialize.o enkf_types.o enkf_macros.h enkf_util.o gen_data_config.o gen_data_common.h gen_common.o -block_fs_driver_index.o : block_fs_driver_index.c block_fs_driver_index.h fs_types.o basic_driver.o -field_obs.o : field_obs.c field_obs.h enkf_util.o field_config.o obs_data.o meas_vector.o field_config.o field.o active_list.o -enkf_tui_init.o : enkf_tui_init.c enkf_tui_init.h enkf_main.o enkf_sched.o enkf_types.o enkf_tui_util.o enkf_state.o enkf_node.o enkf_fs.o ensemble_config.o -block_fs_driver.o : block_fs_driver.c block_fs_driver.h fs_types.o basic_driver.o enkf_types.o -enkf_tui_ranking.o : enkf_tui_ranking.c enkf_tui_ranking.h enkf_main.o enkf_obs.o enkf_tui_util.o -enkf_main.o : enkf_main.c enkf_main.h enkf_config_node.o enkf_types.o obs_data.o meas_matrix.o enkf_state.o enkf_obs.o enkf_fs.o enkf_serialize.o enkf_sched.o ecl_config.o ensemble_config.o model_config.o site_config.o active_config.o enkf_analysis.o local_ministep.o local_updatestep.o local_config.o misfit_table.o plot_config.o ert_template.o enkf_defaults.o -plain_driver_common.o : plain_driver_common.c plain_driver_common.h enkf_types.o enkf_node.o -gen_data_active.o : gen_data_active.c gen_data_active.h enkf_macros.h -active_node.o : active_node.c active_node.h enkf_types.o enkf_config_node.o ensemble_config.o obs_vector.o -enkf_sched.o : enkf_sched.c enkf_sched.h enkf_types.o enkf_defaults.o -summary.o : summary.c summary.h enkf_macros.h enkf_util.o summary_config.o enkf_types.o enkf_util.o enkf_serialize.o -enkf_types.o : enkf_types.c enkf_types.h -plain_driver.o : plain_driver.c plain_driver.h fs_types.o basic_driver.o plain_driver_index.o plain_driver_common.o enkf_node.o -model_config.o : model_config.c model_config.h enkf_sched.o enkf_types.o plain_driver.o fs_types.o enkf_defaults.o -fs_types.o : fs_types.c fs_types.h -site_config.o : site_config.c site_config.h -ert_template.o : ert_template.c ert_template.h -misfit_table.o : misfit_table.c misfit_table.h enkf_obs.o enkf_fs.o -field_active.o : field_active.c field_active.h enkf_macros.h active_list.o -enkf_obs.o : enkf_obs.c enkf_obs.h summary_obs.o field_obs.o enkf_fs.o obs_vector.o enkf_state.o local_ministep.o local_config.o -enkf_state.o : enkf_state.c enkf_state.h enkf_node.o enkf_types.o ecl_static_kw.o field.o field_config.o gen_kw.o summary.o enkf_fs.o basic_driver.o ensemble_config.o model_config.o site_config.o ecl_config.o ert_template.o -active_config.o : active_config.c active_config.h enkf_types.o ensemble_config.o enkf_obs.o active_node.o -ensemble_config.o : ensemble_config.c ensemble_config.h enkf_config_node.o enkf_types.o field_config.o gen_data_config.o meas_matrix.o enkf_types.o enkf_fs.o gen_kw_config.o summary.o summary_config.o gen_data.o pilot_point_config.o gen_data_config.o gen_data_config.o field_trans.o -field_trans.o : field_trans.c field_trans.h -sqlite3_driver.o : sqlite3_driver.c sqlite3_driver.h sqlite3.o basic_driver.o fs_types.o enkf_config_node.o -field_config.o : field_config.c field_config.h enkf_types.o enkf_macros.h field_active.o active_list.o field_trans.o field_common.h -obs_vector.o : obs_vector.c obs_vector.h enkf_fs.o summary_obs.o field_obs.o gen_obs.o ensemble_config.o active_list.o -enkf_tui_export.o : enkf_tui_export.c enkf_tui_export.h enkf_main.o field.o field_config.o enkf_state.o enkf_fs.o enkf_tui_util.o field_config.o gen_data.o -enkf_tui_table.o : enkf_tui_table.c enkf_tui_table.h enkf_main.o enkf_tui_plot.o enkf_tui_fs.o enkf_obs.o field_obs.o field_config.o obs_vector.o enkf_tui_util.o ensemble_config.o gen_kw_config.o -enkf_tui_main.o : enkf_tui_main.c enkf_tui_main.h enkf_tui_run.o enkf_tui_export.o enkf_tui_plot.o enkf_tui_table.o enkf_tui_fs.o enkf_tui_ranking.o enkf_tui_misc.o enkf_main.o enkf_sched.o -enkf_util.o : enkf_util.c enkf_util.h enkf_defaults.o -main.o : main.c enkf_fs.o enkf_main.o enkf_types.o enkf_sched.o enkf_tui_main.o ERT.h -scalar.o : scalar.c scalar.h enkf_types.o scalar_config.o enkf_util.o enkf_serialize.o -pilot_point_config.o : pilot_point_config.c pilot_point_config.h enkf_types.o enkf_macros.h scalar_config.o -enkf_tui_plot.o : enkf_tui_plot.c enkf_tui_plot.h enkf_main.o enkf_tui_fs.o enkf_obs.o field_obs.o gen_obs.o field_config.o obs_vector.o enkf_tui_util.o ensemble_config.o enkf_state.o gen_kw_config.o enkf_defaults.o plot_config.o -summary_config.o : summary_config.c summary_config.h enkf_types.o enkf_util.o enkf_macros.h active_list.o -meas_matrix.o : meas_matrix.c meas_matrix.h meas_vector.o -gen_data_config.o : gen_data_config.c gen_data_config.h enkf_macros.h enkf_types.o gen_data_common.h gen_data_active.o active_list.o -active_list.o : active_list.c active_list.h enkf_macros.h -gen_kw.o : gen_kw.c gen_kw.h enkf_types.o enkf_util.o scalar.o enkf_macros.h gen_kw_common.h gen_kw_config.o -gen_obs.o : gen_obs.c gen_obs.h enkf_util.o enkf_types.o enkf_macros.h meas_vector.o obs_data.o gen_data.o gen_common.o gen_obs_active.o active_list.o -meas_vector.o : meas_vector.c meas_vector.h enkf_util.o -scalar_config.o : scalar_config.c scalar_config.h enkf_util.o enkf_macros.h trans_func.o active_list.o -enkf_tui_run.o : enkf_tui_run.c enkf_tui_run.h enkf_main.o enkf_fs.o enkf_sched.o ensemble_config.o enkf_analysis.o enkf_tui_util.o enkf_tui_fs.o -enkf_serialize.o : enkf_serialize.c enkf_serialize.h enkf_types.o active_list.o -sqlite3.o : sqlite3.c sqlite3.h -gen_obs_active.o : gen_obs_active.c gen_obs_active.h enkf_macros.h -basic_driver.o : basic_driver.c basic_driver.h fs_types.o -enkf_node.o : enkf_node.c enkf_node.h enkf_config_node.o field.o summary.o ecl_static_kw.o gen_kw.o gen_data.o enkf_serialize.o -ecl_config.o : ecl_config.c ecl_config.h enkf_util.o enkf_defaults.o -trans_func.o : trans_func.c trans_func.h -gen_common.o : gen_common.c gen_common.h gen_data_config.o -local_config.o : local_config.c local_config.h local_ministep.o local_updatestep.o -obs_data.o : obs_data.c obs_data.h enkf_util.o meas_matrix.o -plain_driver_index.o : plain_driver_index.c plain_driver_index.h fs_types.o plain_driver_common.o basic_driver.o -field.o : field.c field.h field_config.o enkf_serialize.o -plot_config.o : plot_config.c plot_config.h enkf_defaults.o -ecl_static_kw.o : ecl_static_kw.c ecl_static_kw.h enkf_util.o enkf_macros.h -local_ministep.o : local_ministep.c local_ministep.h active_list.o enkf_macros.h -enkf_tui_misc.o : enkf_tui_misc.c enkf_tui_misc.h enkf_types.o enkf_main.o enkf_state.o -enkf_analysis.o : enkf_analysis.c enkf_analysis.h meas_matrix.o obs_data.o analysis_config.o enkf_util.o -gen_kw_config.o : gen_kw_config.c gen_kw_config.h enkf_util.o enkf_macros.h trans_func.o scalar_config.o enkf_defaults.o gen_kw_common.h -analysis_config.o : analysis_config.c analysis_config.h enkf_types.o enkf_defaults.o diff --git a/ThirdParty/Ert/libenkf/src/ecl_config.c b/ThirdParty/Ert/libenkf/src/ecl_config.c deleted file mode 100644 index c4bc48e3b9..0000000000 --- a/ThirdParty/Ert/libenkf/src/ecl_config.c +++ /dev/null @@ -1,1012 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'ecl_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. - */ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/** - This file implements a struct which holds configuration information - needed to run ECLIPSE. - - Pointers to the fields in this structure are passed on to e.g. the - enkf_state->shared_info object, but this struct is the *OWNER* of - this information, and hence responsible for booting and deleting - these objects. - - Observe that the distinction of what goes in model_config, and what - goes in ecl_config is not entirely clear. - */ - -struct ecl_config_struct -{ - ecl_io_config_type * io_config; /* This struct contains information of whether the eclipse files should be formatted|unified|endian_fliped */ - path_fmt_type * eclbase; /* A path_fmt instance with one %d specifer which will be used for eclbase - members will allocate private eclbase; i.e. updates will not be reflected. */ - sched_file_type * sched_file; /* Will only contain the history - if predictions are active the member_config objects will have a private sched_file instance. */ - hash_type * fixed_length_kw; /* Set of user-added SCHEDULE keywords with fixed length. */ - bool include_all_static_kw; /* If true all static keywords are stored.*/ - set_type * static_kw_set; /* Minimum set of static keywords which must be included to make valid restart files. */ - stringlist_type * user_static_kw; - char * data_file; /* Eclipse data file. */ - time_t start_date; /* The start date of the ECLIPSE simulation - parsed from the data_file. */ - time_t end_date; /* An optional date value which can be used to check if the ECLIPSE simulation has been 'long enough'. */ - ecl_refcase_list_type * refcase_list; - ecl_grid_type * grid; /* The grid which is active for this model. */ - char * schedule_prediction_file; /* Name of schedule prediction file - observe that this is internally handled as a gen_kw node. */ - char * schedule_target_file; /* File name to write schedule info to */ - char * input_init_section; /* File name for ECLIPSE (EQUIL) initialisation - can be NULL if the user has not supplied INIT_SECTION. */ - char * init_section; /* Equal to the full path of input_init_section IFF input_init_section points to an existing file - otherwise equal to input_init_section. */ - int last_history_restart; - bool can_restart; /* Have we found the tag in the data file? */ - int num_cpu; /* We should parse the ECLIPSE data file and determine how many cpus this eclipse file needs. */ - ert_ecl_unit_enum unit_system; /* Either metric, field or lab */ -}; - -/*****************************************************************/ - -/** - With this function we try to determine whether ECLIPSE is active - for this case, i.e. if ECLIPSE is part of the forward model. This - should ideally be inferred from the FORWARD model, but what we do - here is just to check if the core field ->eclbase and ->data_file - have been set. If they are both equal to NULL we assume that - ECLIPSE is not active and return false, otherwise we return true. - */ - -bool ecl_config_active(const ecl_config_type * config) -{ - if ((config->eclbase == NULL )&& (config->data_file == NULL)) - return false; - else - return true; -} - - /** - Could look up the sched_file instance directly - because the - ecl_config will never be the owner of a file with predictions. - */ - -int ecl_config_get_last_history_restart(const ecl_config_type * ecl_config) -{ - return ecl_config->last_history_restart; -} - -bool ecl_config_can_restart(const ecl_config_type * ecl_config) -{ - return ecl_config->can_restart; -} - -void ecl_config_assert_restart(const ecl_config_type * ecl_config) -{ - if (!ecl_config_can_restart(ecl_config)) - { - fprintf(stderr, "** Warning - tried to restart case which is not properly set up for restart.\n"); - fprintf(stderr, "** Need in datafile and INIT_SECTION keyword in config file.\n"); - util_exit("%s: exiting \n", __func__); - } -} - -ui_return_type * ecl_config_validate_data_file(const ecl_config_type * ecl_config, const char * data_file) { - if (util_file_exists(data_file)) - return ui_return_alloc(UI_RETURN_OK); - else { - ui_return_type * ui_return = ui_return_alloc(UI_RETURN_FAIL); - char * error_msg = util_alloc_sprintf("File not found:%s" , data_file); - ui_return_add_error(ui_return , error_msg); - free( error_msg ); - return ui_return; - } -} - - -void ecl_config_set_data_file(ecl_config_type * ecl_config, const char * data_file) { - ecl_config->data_file = util_realloc_string_copy(ecl_config->data_file, data_file); - { - FILE * stream = util_fopen(ecl_config->data_file, "r"); - basic_parser_type * parser = basic_parser_alloc(NULL, NULL, NULL, NULL, "--", "\n"); - char * init_tag = enkf_util_alloc_tagged_string("INIT"); - - ecl_config->can_restart = basic_parser_fseek_string(parser, stream, init_tag, false, true); - - free(init_tag); - basic_parser_free(parser); - fclose(stream); - } - ecl_config->start_date = ecl_util_get_start_date(ecl_config->data_file); - ecl_config->num_cpu = ecl_util_get_num_cpu(ecl_config->data_file); - ecl_config->unit_system = ecl_util_get_unit_set(ecl_config->data_file); -} - - -const char * ecl_config_get_data_file(const ecl_config_type * ecl_config) -{ - return ecl_config->data_file; -} - -time_t ecl_config_get_start_date(const ecl_config_type * ecl_config) -{ - return ecl_config->start_date; -} - -time_t ecl_config_get_end_date(const ecl_config_type * ecl_config) -{ - return ecl_config->end_date; -} - -static void ecl_config_set_end_date(ecl_config_type * ecl_config, time_t end_date) -{ - ecl_config->end_date = end_date; -} - -int ecl_config_get_num_cpu(const ecl_config_type * ecl_config) -{ - return ecl_config->num_cpu; -} - -const char * ecl_config_get_schedule_prediction_file(const ecl_config_type * ecl_config) -{ - return ecl_config->schedule_prediction_file; -} - -/** - Observe: The real schedule prediction functionality is implemented - as a special GEN_KW node in ensemble_config. - */ - -void ecl_config_set_schedule_prediction_file(ecl_config_type * ecl_config, const char * schedule_prediction_file) -{ - ecl_config->schedule_prediction_file = util_realloc_string_copy(ecl_config->schedule_prediction_file, schedule_prediction_file); -} - -const char * ecl_config_get_schedule_file(const ecl_config_type * ecl_config) -{ - if (ecl_config->sched_file != NULL ) - return sched_file_iget_filename(ecl_config->sched_file, 0); - else - return NULL ; -} - -bool ecl_config_has_schedule(const ecl_config_type * ecl_config) -{ - if (ecl_config->sched_file == NULL ) - return false; - else - return true; -} - -bool ecl_config_has_init_section(const ecl_config_type * ecl_config) -{ - if (ecl_config->init_section == NULL ) - return false; - else - return true; -} - - - -ui_return_type * ecl_config_validate_schedule_file(const ecl_config_type * ecl_config , const char * schedule_file) { - if ((ecl_config->start_date != -1) && (util_file_exists(schedule_file))) - return ui_return_alloc(UI_RETURN_OK); - else { - ui_return_type * ui_return = ui_return_alloc(UI_RETURN_FAIL); - - if (ecl_config->start_date == -1) - ui_return_add_error(ui_return, "You must set the ECLIPSE datafile before you can set the SCHEDULE file."); - - if (!util_file_exists(schedule_file)) { - char * error_msg = util_alloc_sprintf("SCHEDULE file:%s not found" , schedule_file); - ui_return_add_error(ui_return , error_msg); - free(error_msg); - } - - return ui_return; - } -} - - -/** - Observe: This function makes a hard assumption that the - ecl_config->start_date has already been set. (And should not be - changed either ...) -*/ - -void ecl_config_set_schedule_file(ecl_config_type * ecl_config, const char * schedule_file, const char * schedule_target_file) -{ - if (schedule_target_file) - ecl_config->schedule_target_file = util_alloc_string_copy(schedule_target_file); - else { - char * base; /* The schedule target file will be without any path component */ - char * ext; - util_alloc_file_components(schedule_file, NULL, &base, &ext); - ecl_config->schedule_target_file = util_alloc_filename(NULL, base, ext); - free(ext); - free(base); - } - - ecl_config->sched_file = sched_file_alloc(ecl_config->start_date); - sched_file_parse(ecl_config->sched_file, schedule_file); - ecl_config->last_history_restart = sched_file_get_num_restart_files(ecl_config->sched_file) - 1; /* We keep track of this - so we can stop assimilation at the end of history */ - - { - hash_iter_type * iter = hash_iter_alloc(ecl_config->fixed_length_kw); - while (!hash_iter_is_complete(iter)) { - const char * key = hash_iter_get_next_key(iter); - int length = hash_get_int(ecl_config->fixed_length_kw, key); - - sched_file_add_fixed_length_kw(ecl_config->sched_file, key, length); - } - hash_iter_free(iter); - } -} - - - -void ecl_config_add_fixed_length_schedule_kw(ecl_config_type * ecl_config, const char * kw, int length) -{ - hash_insert_int(ecl_config->fixed_length_kw, kw, length); - if (ecl_config->sched_file != NULL ) - sched_file_add_fixed_length_kw(ecl_config->sched_file, kw, length); - -} - - -ui_return_type * ecl_config_validate_eclbase(const ecl_config_type * ecl_config, const char * eclbase_fmt) { - if (ecl_util_valid_basename_fmt(eclbase_fmt)) - return ui_return_alloc(UI_RETURN_OK); - else { - ui_return_type * ui_return = ui_return_alloc(UI_RETURN_FAIL); - { - char * error_msg = util_alloc_sprintf("The format string: %s was invalid as ECLBASE format", eclbase_fmt); - ui_return_add_error(ui_return, error_msg); - free(error_msg); - } - ui_return_add_help(ui_return , "The eclbase format must have all characters in the same case,"); - ui_return_add_help(ui_return , "in addition it can contain a %d specifier which will be"); - ui_return_add_help(ui_return , "with the realization number."); - - return ui_return; - } -} - -/** - The value of eclbase is in addition internalized in each enkf_state - object, i.e. the _set routine must be called from enkf_main, and - call enkf_state_update_eclbase() afterwards. - */ - -void ecl_config_set_eclbase(ecl_config_type * ecl_config, const char * eclbase_fmt) -{ - if (ecl_config->eclbase != NULL ) - path_fmt_free(ecl_config->eclbase); - ecl_config->eclbase = path_fmt_alloc_path_fmt(eclbase_fmt); -} - - -/** - Observe that this function returns a (char *) - corresponding to - the argument used when calling the ecl_config_set_eclbase() - function, and not a path_fmt instance. - */ - -const char * ecl_config_get_eclbase(const ecl_config_type * ecl_config) -{ - return path_fmt_get_fmt(ecl_config->eclbase); -} - -/** - Can be called with @refcase == NULL - which amounts to clearing the - current refcase. -*/ -bool ecl_config_load_refcase(ecl_config_type * ecl_config, const char * refcase) -{ - return ecl_refcase_list_set_default(ecl_config->refcase_list, refcase); -} - - -ui_return_type * ecl_config_validate_refcase( const ecl_config_type * ecl_config , const char * refcase) { - if (ecl_sum_case_exists( refcase )) - return ui_return_alloc( UI_RETURN_OK ); - else { - ui_return_type * ui_return = ui_return_alloc( UI_RETURN_FAIL ); - char * error_msg = util_alloc_sprintf( "Could not load summary case from:%s \n",refcase); - ui_return_add_error( ui_return , error_msg ); - free( error_msg ); - return ui_return; - } -} - - -/** - Will return NULL if no refcase is set. - */ -const char * ecl_config_get_refcase_name(const ecl_config_type * ecl_config) -{ - const ecl_sum_type * refcase = ecl_refcase_list_get_default(ecl_config->refcase_list); - if (refcase == NULL ) - return NULL ; - else - return ecl_sum_get_case(refcase); - -} - -/** - This function will clear the list of static keywords supplied by - the user. The default built in keywords are not touched. - */ - -void ecl_config_clear_static_kw(ecl_config_type * ecl_config) -{ - ecl_config->include_all_static_kw = false; - stringlist_clear(ecl_config->user_static_kw); -} - -/** - Returns a stringlist of the user-defined static keywords. - */ -stringlist_type * ecl_config_get_static_kw_list(const ecl_config_type * ecl_config) -{ - return ecl_config->user_static_kw; -} - - /* The semantic regarding INIT_SECTION is as follows: - - 1. If the INIT_SECTION points to an existing file - the - ecl_config->input_init_section is set to the absolute path of - this file. - - 2. If the INIT_SECTION points to a not existing file: - - a. We assert that INIT_SECTION points to a pure filename, - i.e. /some/path/which/does/not/exist is NOT accepted. In - the case the input argument contain a path a error message - will be printed on stderr and the ->init_section will not - be set. - b. The ecl_config->input_init_section is set to point to this - file. - c. WE TRUST THE USER TO SUPPLY CONTENT (THROUGH SOME FUNKY - FORWARD MODEL) IN THE RUNPATH. This can unfortunately not - be checked/verified before the ECLIPSE simulation fails. - - - The INIT_SECTION keyword and in the datafile (checked with - ecl_config->can_restart) interplay as follows: - - - CASE | INIT_SECTION | | OK ? - --------------------------------------------- - 0 | Present | Present | Yes - 1 | Not Present | Present | No - 2 | Present | Not present| No - 3 | Not Present | Not present| Yes - --------------------------------------------- - - - Case 0: This is the most flexible case, which can do arbitrary - restart. - - Case 1: In this case the datafile will contain a tag, we - we do not have the info to replace that tag with for - initialisation, and ECLIPSE will fail. Strictly speaking this - case can actually restart, but that is not enough - we let - this case fail hard. - - Case 2: We have some INIT_SECTION infor, but no tag in he - datafile to update. If the datafile has embedded - initialisation info this case will work for init; but it is - logically flawed, and not accepted. Currently only a warning. - - Case 3: This case has just the right amount of information for - initialisation, but it is 'consistently unable' to restart. - -*/ - -ui_return_type * ecl_config_validate_init_section(const ecl_config_type * ecl_config, const char * input_init_section) { - if (ecl_config->can_restart) - return ui_return_alloc( UI_RETURN_OK ); - else { - ui_return_type * ui_return = ui_return_alloc(UI_RETURN_FAIL); - ui_return_add_error( ui_return , "The tag was not found in datafile - can not set INIT_SECTION keyword\n"); - return ui_return; - } -} - - -void ecl_config_set_init_section(ecl_config_type * ecl_config, const char * input_init_section) { - if (ecl_config->can_restart) { - /* The tag is set. */ - ecl_config->input_init_section = util_realloc_string_copy(ecl_config->input_init_section, input_init_section); /* input_init_section = path/to/init_section */ - if (util_file_exists(ecl_config->input_init_section)) - { /* init_section = $CWD/path/to/init_section */ - util_safe_free(ecl_config->init_section); - ecl_config->init_section = util_alloc_realpath(input_init_section); - } - else - { - char * path; - - util_alloc_file_components(ecl_config->input_init_section, &path, NULL, NULL ); - if (path != NULL ) - fprintf(stderr, - "** Warning: %s: When INIT_SECTION:%s points to a non-existing file - you can not have any path components.\n", - __func__, input_init_section); - else - ecl_config->init_section = util_alloc_string_copy(input_init_section); - - util_safe_free(path); - } - } - else - /* - The tag is not set - we can not utilize the - input_init_section info, and we just ignore it. - */ - fprintf(stderr, - "** Warning: tag was not found in datafile - can not utilize INIT_SECTION keyword - ignored.\n"); -} - - -/** - This just returns the string which has been set with the - ecl_config_set_init_section() function, whereas the - ecl_config_get_equil_init_file() function will return the absolute - path to the init_section (if it exists). - */ - -const char * ecl_config_get_init_section(const ecl_config_type * ecl_config) -{ - return ecl_config->input_init_section; -} - -const char * ecl_config_get_equil_init_file(const ecl_config_type * ecl_config) -{ - return ecl_config->init_section; -} - - -static void ecl_config_init_static_kw(ecl_config_type * ecl_config) -{ - int i; - for (i = 0; i < NUM_STATIC_KW; i++) - set_add_key(ecl_config->static_kw_set, DEFAULT_STATIC_KW - [i]); -} - -ecl_config_type * ecl_config_alloc() -{ - ecl_config_type * ecl_config = util_malloc(sizeof *ecl_config); - - ecl_config->io_config = ecl_io_config_alloc(DEFAULT_FORMATTED, DEFAULT_UNIFIED, DEFAULT_UNIFIED); - ecl_config->fixed_length_kw = hash_alloc(); - ecl_config->eclbase = NULL; - ecl_config->include_all_static_kw = false; - ecl_config->static_kw_set = set_alloc_empty(); - ecl_config->user_static_kw = stringlist_alloc_new(); - ecl_config->num_cpu = 1; /* This must get a valid default in case no ECLIPSE datafile is provided. */ - ecl_config->unit_system = ECL_METRIC_UNITS; - ecl_config->data_file = NULL; - ecl_config->input_init_section = NULL; - ecl_config->init_section = NULL; - ecl_config->grid = NULL; - ecl_config->can_restart = false; - ecl_config->start_date = -1; - ecl_config->end_date = -1; - ecl_config->sched_file = NULL; - ecl_config->schedule_prediction_file = NULL; - ecl_config->schedule_target_file = NULL; - ecl_config->refcase_list = ecl_refcase_list_alloc(); - - ecl_config_init_static_kw(ecl_config); - - return ecl_config; -} - -void ecl_config_init(ecl_config_type * ecl_config, const config_content_type * config) -{ - if (config_content_has_item(config, ECLBASE_KEY)) { - ui_return_type * ui_return = ecl_config_validate_eclbase(ecl_config, config_content_iget(config, ECLBASE_KEY, 0, 0)); - if (ui_return_get_status(ui_return) == UI_RETURN_OK) - ecl_config_set_eclbase(ecl_config, config_content_iget(config, ECLBASE_KEY, 0, 0)); - else - util_abort("%s: failed to set eclbase format. Error:%s\n", __func__ , ui_return_get_last_error(ui_return)); - ui_return_free(ui_return); - } - - if (config_content_has_item(config, DATA_FILE_KEY)) - { - ui_return_type * ui_return = ecl_config_validate_data_file(ecl_config, config_content_iget(config, DATA_FILE_KEY, 0, 0)); - if (ui_return_get_status( ui_return ) == UI_RETURN_OK) - ecl_config_set_data_file( ecl_config, config_content_iget(config, DATA_FILE_KEY, 0, 0) ); - else - util_abort("%s: problem setting ECLIPSE data file\n",__func__ , ui_return_get_last_error(ui_return)); - - ui_return_free(ui_return); - } - - if (config_content_has_item(config, SCHEDULE_FILE_KEY)) { - const char * schedule_target_file = config_content_safe_iget(config, SCHEDULE_FILE_KEY, 0, 1); - if (schedule_target_file) { - ui_return_type * ui_return_sched_target_file = ecl_config_validate_schedule_file(ecl_config, schedule_target_file); - if (!ui_return_get_status(ui_return_sched_target_file) == UI_RETURN_OK) { - util_abort("%s: failed to set target schedule file. Error:%s\n",__func__ , ui_return_get_last_error(ui_return_sched_target_file)); - } - ui_return_free(ui_return_sched_target_file); - } - - ui_return_type * ui_return = ecl_config_validate_schedule_file(ecl_config, config_content_iget(config, SCHEDULE_FILE_KEY, 0, 0)); - if (ui_return_get_status(ui_return) == UI_RETURN_OK) - ecl_config_set_schedule_file(ecl_config, config_content_iget(config, SCHEDULE_FILE_KEY, 0, 0), schedule_target_file); - else - util_abort("%s: failed to set schedule file. Error:%s\n",__func__ , ui_return_get_last_error(ui_return)); - - ui_return_free(ui_return); - } - - if (config_content_has_item(config, GRID_KEY)) { - const char * grid_file = config_content_iget(config, GRID_KEY, 0, 0); - ui_return_type * ui_return = ecl_config_validate_grid( ecl_config , grid_file); - if (ui_return_get_status(ui_return) == UI_RETURN_OK) - ecl_config_set_grid(ecl_config, grid_file ); - else - util_abort("%s: failed to set grid file:%s Error:%s \n",__func__ , grid_file , ui_return_get_last_error(ui_return)); - - ui_return_free( ui_return ); - } - - - if (config_content_has_item(config, ADD_FIXED_LENGTH_SCHEDULE_KW_KEY)) - { - int iocc; - for (iocc = 0; iocc < config_content_get_occurences(config, ADD_FIXED_LENGTH_SCHEDULE_KW_KEY); iocc++) - ecl_config_add_fixed_length_schedule_kw(ecl_config, - config_content_iget(config, ADD_FIXED_LENGTH_SCHEDULE_KW_KEY, iocc, 0), - config_content_iget_as_int(config, ADD_FIXED_LENGTH_SCHEDULE_KW_KEY, iocc, 1)); - } - - if (config_content_has_item(config, REFCASE_KEY)) - { - const char * refcase_path = config_content_get_value_as_path(config, REFCASE_KEY); - if (!ecl_config_load_refcase(ecl_config, refcase_path)) - fprintf(stderr, "** Warning: loading refcase:%s failed \n", refcase_path); - } - - if (config_content_has_item(config, REFCASE_LIST_KEY)) - { - config_content_item_type * item = config_content_get_item(config, REFCASE_LIST_KEY); - int i; - for (i = 0; i < config_content_item_get_size(item); i++) - { - config_content_node_type * node = config_content_item_iget_node(item, i); - int j; - for (j = 0; j < config_content_node_get_size(node); j++) - { - const char * case_glob = config_content_node_iget_as_path(node, j); - ecl_refcase_list_add_matching(ecl_config->refcase_list, case_glob); - } - } - } - - if (config_content_has_item(config, INIT_SECTION_KEY)) - ecl_config_set_init_section(ecl_config, config_content_get_value(config, INIT_SECTION_KEY)); - else if (ecl_config->can_restart) - /** - This is a hard error - the datafile contains , however - the config file does NOT contain INIT_SECTION, i.e. we have - no information to fill in for the section. This case - will not be able to initialize an ECLIPSE model, and that is - broken behaviour. - */ - util_exit("Sorry: when the datafile contains the config file MUST have the INIT_SECTION keyword. \n"); - - /* - The user has not supplied a INIT_SECTION keyword whatsoever, - this essentially means that we can not restart - because: - - 1. The EQUIL section must be inlined in the DATAFILE without any - special markup. - - 2. ECLIPSE will fail hard if the datafile contains both an EQUIL - section and a restart statement, and when we have not marked - the EQUIL section specially with the INIT_SECTION keyword it - is impossible for ERT to dynamically change between a - datafile with initialisation and a datafile for restart. - - IFF the user has no intentitions of any form of restart, this is - perfectly legitemate. - */ - if (config_content_has_item(config, END_DATE_KEY)) - { - const char * date_string = config_content_get_value(config, END_DATE_KEY); - time_t end_date; - if (util_sscanf_date_utc(date_string, &end_date)) - ecl_config_set_end_date(ecl_config, end_date); - else - fprintf(stderr, "** WARNING **: Failed to parse %s as a date - should be in format dd/mm/yyyy \n", date_string); - } -} - -void ecl_config_free(ecl_config_type * ecl_config) -{ - ecl_io_config_free(ecl_config->io_config); - if (ecl_config->eclbase != NULL ) - path_fmt_free(ecl_config->eclbase); - - set_free(ecl_config->static_kw_set); - stringlist_free(ecl_config->user_static_kw); - util_safe_free(ecl_config->data_file); - if (ecl_config->sched_file != NULL ) - sched_file_free(ecl_config->sched_file); - - util_safe_free(ecl_config->schedule_target_file); - hash_free(ecl_config->fixed_length_kw); - - util_safe_free(ecl_config->input_init_section); - util_safe_free(ecl_config->init_section); - util_safe_free(ecl_config->schedule_prediction_file); - - if (ecl_config->grid != NULL ) - ecl_grid_free(ecl_config->grid); - - ecl_refcase_list_free(ecl_config->refcase_list); - - free(ecl_config); -} - -/** - This function adds a keyword to the list of restart keywords wich - are included. Observe that ecl_util_escape_kw() is called prior to - adding it. - - The kw __ALL__ is magic; and will result in a request to store all - static kewyords. This wastes disk-space, but might be beneficial - when debugging. - */ - -void ecl_config_add_static_kw(ecl_config_type * ecl_config, const char * _kw) -{ - if (strcmp(_kw, DEFAULT_ALL_STATIC_KW) == 0) - ecl_config->include_all_static_kw = true; - else - { - char * kw = util_alloc_string_copy(_kw); - ecl_util_escape_kw(kw); - if (!stringlist_contains(ecl_config->user_static_kw, kw)) - stringlist_append_owned_ref(ecl_config->user_static_kw, kw); - } -} - -/** - This function checks whether the static kw should be - included. Observe that it is __assumed__ that ecl_util_escape_kw() - has already been called on the kw. - */ - -bool ecl_config_include_static_kw(const ecl_config_type * ecl_config, const char * kw) -{ - if (ecl_config->include_all_static_kw) - return true; - else - { - if (set_has_key(ecl_config->static_kw_set, kw)) - return true; - else - return stringlist_contains(ecl_config->user_static_kw, kw); - } -} - -ecl_grid_type * ecl_config_get_grid(const ecl_config_type * ecl_config) -{ - return ecl_config->grid; -} - -const char * ecl_config_get_gridfile(const ecl_config_type * ecl_config) -{ - if (ecl_config->grid == NULL ) - return NULL ; - else - return ecl_grid_get_name(ecl_config->grid); -} - -/** - The ecl_config object isolated supports run-time changing of the - grid, however this does not (in general) apply to the system as a - whole. Other objects which internalize pointers (i.e. field_config - objects) to an ecl_grid_type instance will be left with dangling - pointers; and things will probably die an ugly death. So - changing - grid runtime should be done with extreme care. -*/ - -void ecl_config_set_grid(ecl_config_type * ecl_config, const char * grid_file) -{ - if (ecl_config->grid != NULL ) - ecl_grid_free(ecl_config->grid); - ecl_config->grid = ecl_grid_alloc(grid_file); -} - -ui_return_type * ecl_config_validate_grid( const ecl_config_type * ecl_config , const char * grid_file ) { - ui_return_type * ui_return; - if (util_file_exists( grid_file )) { - ecl_file_enum file_type = ecl_util_get_file_type( grid_file , NULL , NULL ); - if ((file_type == ECL_EGRID_FILE) || (file_type == ECL_GRID_FILE)) - ui_return = ui_return_alloc( UI_RETURN_OK ); - else { - ui_return = ui_return_alloc( UI_RETURN_FAIL ); - ui_return_add_error( ui_return , "Input argument is not a GRID/EGRID file"); - } - } else { - ui_return = ui_return_alloc( UI_RETURN_FAIL ); - ui_return_add_error( ui_return , "Input argument does not exist."); - } - return ui_return; -} - - - -ecl_refcase_list_type * ecl_config_get_refcase_list(const ecl_config_type * ecl_config) -{ - return ecl_config->refcase_list; -} - -const ecl_sum_type * ecl_config_get_refcase(const ecl_config_type * ecl_config) -{ - return ecl_refcase_list_get_default(ecl_config->refcase_list); -} - -bool ecl_config_has_refcase(const ecl_config_type * ecl_config) -{ - const ecl_sum_type * refcase = ecl_config_get_refcase(ecl_config); - if (refcase) - return true; - else - return false; -} - -ecl_io_config_type * ecl_config_get_io_config(const ecl_config_type * ecl_config) -{ - return ecl_config->io_config; -} - -const path_fmt_type * ecl_config_get_eclbase_fmt(const ecl_config_type * ecl_config) -{ - return ecl_config->eclbase; -} - -sched_file_type * ecl_config_get_sched_file(const ecl_config_type * ecl_config) -{ - return ecl_config->sched_file; -} - - -const char * ecl_config_get_schedule_target(const ecl_config_type * ecl_config) -{ - return ecl_config->schedule_target_file; -} - -int ecl_config_get_num_restart_files(const ecl_config_type * ecl_config) -{ - return sched_file_get_num_restart_files(ecl_config->sched_file); -} - -bool ecl_config_get_formatted(const ecl_config_type * ecl_config) -{ - return ecl_io_config_get_formatted(ecl_config->io_config); -} -bool ecl_config_get_unified_restart(const ecl_config_type * ecl_config) -{ - return ecl_io_config_get_unified_restart(ecl_config->io_config); -} -bool ecl_config_get_unified_summary(const ecl_config_type * ecl_config) -{ - return ecl_io_config_get_unified_summary(ecl_config->io_config); -} - -void ecl_config_static_kw_init(ecl_config_type * ecl_config, const config_content_type * config) -{ - if (config_content_has_item( config , STATIC_KW_KEY)) { - const config_content_item_type * content_item = config_content_get_item(config, STATIC_KW_KEY); - int j; - for (j = 0; j < config_content_item_get_size(content_item); j++) { - const config_content_node_type * content_node = config_content_item_iget_node(content_item, j); - int k; - for (k = 0; k < config_content_node_get_size(content_node); k++) - ecl_config_add_static_kw(ecl_config, config_content_node_iget(content_node, k)); - } - } -} - -void ecl_config_add_config_items(config_parser_type * config) -{ - config_schema_item_type * item; - - item = config_add_schema_item(config, SCHEDULE_FILE_KEY, false); - config_schema_item_set_argc_minmax(item, 1, 2); - config_schema_item_iset_type(item, 0, CONFIG_EXISTING_PATH); - /* - Observe that SCHEDULE_PREDICTION_FILE - which is implemented as a - GEN_KW is added in ensemble_config.c - */ - - item = config_add_schema_item(config, IGNORE_SCHEDULE_KEY, false); - config_schema_item_set_argc_minmax(item, 1, 1); - config_schema_item_iset_type(item, 0, CONFIG_BOOL); - - item = config_add_schema_item(config, ECLBASE_KEY, false); - config_schema_item_set_argc_minmax(item, 1, 1); - - item = config_add_schema_item(config, DATA_FILE_KEY, false); - config_schema_item_set_argc_minmax(item, 1, 1); - config_schema_item_iset_type(item, 0, CONFIG_EXISTING_PATH); - - item = config_add_schema_item(config, STATIC_KW_KEY, false); - config_schema_item_set_argc_minmax(item, 1, CONFIG_DEFAULT_ARG_MAX); - - item = config_add_schema_item(config, ADD_FIXED_LENGTH_SCHEDULE_KW_KEY, false); - config_schema_item_set_argc_minmax(item, 2, 2); - config_schema_item_iset_type(item, 1, CONFIG_INT); - - item = config_add_schema_item(config, REFCASE_KEY, false); - config_schema_item_set_argc_minmax(item, 1, 1); - config_schema_item_iset_type(item, 0, CONFIG_PATH); - - item = config_add_schema_item(config, REFCASE_LIST_KEY, false); - config_schema_item_set_default_type(item, CONFIG_PATH); - - item = config_add_schema_item(config, GRID_KEY, false); - config_schema_item_set_argc_minmax(item, 1, 1); - config_schema_item_iset_type(item, 0, CONFIG_EXISTING_PATH); - - item = config_add_schema_item(config, INIT_SECTION_KEY, false); - config_schema_item_set_argc_minmax(item, 1, 1); - config_schema_item_iset_type(item, 0, CONFIG_PATH); - config_add_alias(config, INIT_SECTION_KEY, "EQUIL_INIT_FILE"); - - item = config_add_schema_item(config, END_DATE_KEY, false); - config_schema_item_set_argc_minmax(item, 1, 1); -} - -void ecl_config_fprintf_config(const ecl_config_type * ecl_config, FILE * stream) -{ - fprintf(stream, CONFIG_COMMENTLINE_FORMAT); - fprintf(stream, CONFIG_COMMENT_FORMAT, "Here comes configuration information related to the ECLIPSE model."); - - fprintf(stream, CONFIG_KEY_FORMAT, DATA_FILE_KEY); - fprintf(stream, CONFIG_ENDVALUE_FORMAT, ecl_config->data_file); - - fprintf(stream, CONFIG_KEY_FORMAT, SCHEDULE_FILE_KEY); - fprintf(stream, CONFIG_ENDVALUE_FORMAT, sched_file_iget_filename(ecl_config->sched_file, 0)); - - fprintf(stream, CONFIG_KEY_FORMAT, ECLBASE_KEY); - fprintf(stream, CONFIG_ENDVALUE_FORMAT, path_fmt_get_fmt(ecl_config->eclbase)); - - if (ecl_config->include_all_static_kw) - { - fprintf(stream, CONFIG_KEY_FORMAT, STATIC_KW_KEY); - fprintf(stream, CONFIG_ENDVALUE_FORMAT, DEFAULT_ALL_STATIC_KW); - } - { - int size = stringlist_get_size(ecl_config->user_static_kw); - if (size > 0) - { - int i; - fprintf(stream, CONFIG_KEY_FORMAT, STATIC_KW_KEY); - for (i = 0; i < size; i++) - if (i < (size - 1)) - fprintf(stream, CONFIG_VALUE_FORMAT, stringlist_iget(ecl_config->user_static_kw, i)); - else - fprintf(stream, CONFIG_ENDVALUE_FORMAT, stringlist_iget(ecl_config->user_static_kw, i)); - } - } - - /* - if (ecl_config->refcase != NULL) { - fprintf( stream , CONFIG_KEY_FORMAT , REFCASE_KEY ); - fprintf( stream , CONFIG_ENDVALUE_FORMAT , ecl_config_get_refcase_name( ecl_config )); - } - */ - - if (ecl_config->grid != NULL ) - { - fprintf(stream, CONFIG_KEY_FORMAT, GRID_KEY); - fprintf(stream, CONFIG_ENDVALUE_FORMAT, ecl_config_get_gridfile(ecl_config)); - } - - if (ecl_config->schedule_prediction_file != NULL ) - { - fprintf(stream, CONFIG_KEY_FORMAT, SCHEDULE_PREDICTION_FILE_KEY); - fprintf(stream, CONFIG_ENDVALUE_FORMAT, ecl_config_get_schedule_prediction_file(ecl_config)); - } - - if (ecl_config->init_section != NULL ) - { - fprintf(stream, CONFIG_KEY_FORMAT, INIT_SECTION_KEY); - fprintf(stream, CONFIG_ENDVALUE_FORMAT, ecl_config_get_init_section(ecl_config)); - } - - { - hash_iter_type * iter = hash_iter_alloc(ecl_config->fixed_length_kw); - while (!hash_iter_is_complete(iter)) - { - const char * kw = hash_iter_get_next_key(iter); - int length = hash_get_int(ecl_config->fixed_length_kw, kw); - - fprintf(stream, CONFIG_KEY_FORMAT, ADD_FIXED_LENGTH_SCHEDULE_KW_KEY); - fprintf(stream, CONFIG_VALUE_FORMAT, kw); - fprintf(stream, CONFIG_INT_FORMAT, length); - fprintf(stream, "\n"); - - } - hash_iter_free(iter); - } - - fprintf(stream, "\n\n"); -} - -/* Units as specified in the ECLIPSE technical manual */ -const char * ecl_config_get_depth_unit(const ecl_config_type * ecl_config) -{ - switch(ecl_config->unit_system) { - case ECL_METRIC_UNITS: - return "M"; - case ECL_FIELD_UNITS: - return "FT"; - case ECL_LAB_UNITS: - return "CM"; - default: - util_abort("%s: unit system enum value:%d not recognized \n",__func__ , ecl_config->unit_system); - return NULL; - } -} - - -const char * ecl_config_get_pressure_unit(const ecl_config_type * ecl_config) -{ - switch(ecl_config->unit_system) { - case ECL_METRIC_UNITS: - return "BARSA"; - case ECL_FIELD_UNITS: - return "PSIA"; - case ECL_LAB_UNITS: - return "ATMA"; - default: - util_abort("%s: unit system enum value:%d not recognized \n",__func__ , ecl_config->unit_system); - return NULL; - } -} diff --git a/ThirdParty/Ert/libenkf/src/ecl_refcase_list.c b/ThirdParty/Ert/libenkf/src/ecl_refcase_list.c deleted file mode 100644 index 9e2e599729..0000000000 --- a/ThirdParty/Ert/libenkf/src/ecl_refcase_list.c +++ /dev/null @@ -1,397 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'ecl_refcase_list.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include -#include -#include - -#include - -#include - - -/* - This file implements a quite simple collection of ecl_sum instances, - with the following twists: - - o The default case is special in several ways: - - - It is added with the ecl_refcase_list_set_default() function. - - - The default case is always the first case, i.e. iget(0) will - return the default case. - - - When setting the default we verify that it can be loaded, and - the thing fails if not. That is in contrast to the other cases - where the actual summary loading is lazy and on demand. - - o The collection has an internal dictionary which ensures that the - same case is not added twice. - - o When calling iget( ) the default case will come as index 0, and - the remaining cases will come in util_strcmp_int() ordering. - - o Observe that the functions in this module return NULL quite - liberally: - - - If you have added a case which does not exist you will get - NULL when you (at a later stage) try to access the ecl_sum - instance. - - - If you ask for the default case before one has been set you - will get NULL. - */ - - -#define SUM_PAIR_TYPE_ID 665109971 - -typedef struct sum_pair_struct { - UTIL_TYPE_ID_DECLARATION; - char * case_name; // This should be (path)/basename - no extension - ecl_sum_type * ecl_sum; -} sum_pair_type; - - - -struct ecl_refcase_list_struct { - sum_pair_type * default_case; - hash_type * case_dict; - vector_type * case_list; /* This is created, and sorted, on demand when we do indexed lookup of cases. */ - bool sorted; -}; - -/*****************************************************************/ - - - -static sum_pair_type * sum_pair_alloc( const char * case_name , bool strict_load) { - ecl_sum_type * ecl_sum = NULL; - char * path = NULL; - char * basename = NULL; - - util_alloc_file_components( case_name , &path , &basename , NULL); - if (basename != NULL) { - char * use_case = util_alloc_filename( path , basename , NULL); - if (strict_load) - ecl_sum = ecl_sum_fread_alloc_case( use_case , ":"); - - util_safe_free( path ); - free( basename ); - if (strict_load && (ecl_sum == NULL)) { - free( use_case ); - return NULL; - } - - - { - sum_pair_type * pair = util_malloc( sizeof * pair ); - UTIL_TYPE_ID_INIT( pair , SUM_PAIR_TYPE_ID ); - pair->case_name = use_case; - pair->ecl_sum = ecl_sum; - return pair; - } - } else { - util_safe_free( path ); - util_safe_free( basename ); - return NULL; - } -} - - -static UTIL_SAFE_CAST_FUNCTION( sum_pair , SUM_PAIR_TYPE_ID ); -static UTIL_SAFE_CAST_FUNCTION_CONST( sum_pair , SUM_PAIR_TYPE_ID ); - -const ecl_sum_type * sum_pair_get_ecl_sum( sum_pair_type * sum_pair ) { - if (sum_pair->ecl_sum == NULL) - sum_pair->ecl_sum = ecl_sum_fread_alloc_case( sum_pair->case_name , ":"); - return sum_pair->ecl_sum; -} - - -static void sum_pair_free( sum_pair_type * sum_pair ) { - free( sum_pair->case_name ); - if (sum_pair->ecl_sum != NULL) - ecl_sum_free( sum_pair->ecl_sum ); - free( sum_pair ); -} - - -static void sum_pair_free__( void * arg ) { - sum_pair_type * pair = sum_pair_safe_cast( arg ); - sum_pair_free( pair ); -} - - - - -static int sum_pair_cmp( const void * arg1 , const void * arg2) { - const sum_pair_type * pair1 = sum_pair_safe_cast_const( arg1 ); - const sum_pair_type * pair2 = sum_pair_safe_cast_const( arg2 ); - - return util_strcmp_int( pair1->case_name , pair2->case_name ); -} - -/*****************************************************************/ - - -ecl_refcase_list_type * ecl_refcase_list_alloc( ) { - ecl_refcase_list_type * refcase_list = util_malloc( sizeof * refcase_list ); - refcase_list->default_case = NULL; - refcase_list->case_list = vector_alloc_new(); - refcase_list->case_dict = hash_alloc(); - refcase_list->sorted = false; - return refcase_list; -} - - - -void ecl_refcase_list_free( ecl_refcase_list_type * refcase_list ) { - vector_free( refcase_list->case_list ); - hash_free( refcase_list->case_dict ); - free( refcase_list ); -} - - - -const ecl_sum_type * ecl_refcase_list_get_default( ecl_refcase_list_type * refcase_list ) { - const ecl_sum_type * return_value = NULL; - if (refcase_list->default_case) - return_value = sum_pair_get_ecl_sum( refcase_list->default_case ); - - return return_value; -} - - -bool ecl_refcase_list_has_default( ecl_refcase_list_type * refcase_list ) { - if (refcase_list->default_case) - return true; - else - return false; -} - - -static void ecl_refcase_list_del_default( ecl_refcase_list_type * refcase_list ) { - sum_pair_type * default_pair = refcase_list->default_case; - if (default_pair) { - hash_del( refcase_list->case_dict , default_pair->case_name ); - refcase_list->default_case = NULL; - } -} - - -/* - If a valid refcase has been set already, and this fails, nothing happens. -*/ - -bool ecl_refcase_list_set_default( ecl_refcase_list_type * refcase_list , const char * default_case) { - - if (default_case) { - sum_pair_type * default_pair = sum_pair_alloc( default_case , true ); - if (default_pair) { - ecl_refcase_list_del_default( refcase_list ); - refcase_list->default_case = default_pair; - - hash_insert_hash_owned_ref( refcase_list->case_dict , default_pair->case_name , default_pair , sum_pair_free__); - refcase_list->sorted = false; - return true; - } else - return false; - } else { - ecl_refcase_list_del_default( refcase_list ); - return true; - } -} - - - - -/** - Will sort the list and remove all elements which can not be loaded. -*/ - -static void ecl_refcase_list_assert_clean( ecl_refcase_list_type * refcase_list ) { - if (!refcase_list->sorted) { - vector_free( refcase_list->case_list ); - refcase_list->case_list = vector_alloc_new(); - - { - stringlist_type * tmp_list = hash_alloc_stringlist( refcase_list->case_dict ); - sum_pair_type * default_case = refcase_list->default_case; - int i; - - for (i =0; i < stringlist_get_size( tmp_list ); i++) { - const char * casename = stringlist_iget( tmp_list , i ); - bool normal_case = true; - - if (default_case && util_string_equal( casename , default_case->case_name)) - normal_case = false; - - if (normal_case) { - sum_pair_type * pair = hash_get( refcase_list->case_dict , casename); - const ecl_sum_type * ecl_sum = sum_pair_get_ecl_sum( pair ); - - if (ecl_sum) - vector_append_ref( refcase_list->case_list , pair); - else - hash_del( refcase_list->case_dict , casename ); - - } - } - stringlist_free( tmp_list ); - } - - vector_sort( refcase_list->case_list , sum_pair_cmp ); - refcase_list->sorted = true; - } -} - - -static sum_pair_type * ecl_refcase_list_get_pair( ecl_refcase_list_type * refcase_list , const char * case_name) { - ecl_refcase_list_assert_clean( refcase_list ); - { - if (hash_has_key( refcase_list->case_dict , case_name)) - return hash_get( refcase_list->case_dict , case_name ); - else - return NULL; - } -} - - -static sum_pair_type * ecl_refcase_list_iget_pair( ecl_refcase_list_type * refcase_list , int index) { - ecl_refcase_list_assert_clean( refcase_list ); - { - int index_offset = refcase_list->default_case ? 1 : 0; - index -= index_offset; - - if (index < 0) - return refcase_list->default_case; - else - return vector_safe_iget( refcase_list->case_list , index); - } -} - - -int ecl_refcase_list_get_size(ecl_refcase_list_type * refcase_list ) { - ecl_refcase_list_assert_clean( refcase_list ); - { - int size = hash_get_size( refcase_list->case_dict ); - return size; - } -} - - - -const ecl_sum_type * ecl_refcase_list_iget_case( ecl_refcase_list_type * refcase_list , int index) { - sum_pair_type * pair = ecl_refcase_list_iget_pair( refcase_list , index ); - if (pair) - return sum_pair_get_ecl_sum( pair ); - else - return NULL; -} - - -const ecl_sum_type * ecl_refcase_list_get_case( ecl_refcase_list_type * refcase_list , const char * case_name) { - sum_pair_type * pair = ecl_refcase_list_get_pair( refcase_list , case_name ); - if (pair) - return sum_pair_get_ecl_sum( pair ); - else - return NULL; -} - - -bool ecl_refcase_list_has_case( ecl_refcase_list_type * refcase_list , const char * case_name) { - const sum_pair_type * pair = ecl_refcase_list_get_pair( refcase_list , case_name ); - if (pair) - return true; - else - return false; -} - - - -const char * ecl_refcase_list_iget_pathcase( ecl_refcase_list_type * refcase_list , int index) { - const ecl_sum_type * ecl_sum = ecl_refcase_list_iget_case( refcase_list , index ); - if (ecl_sum) - return ecl_sum_get_case( ecl_sum ); - else - return NULL; -} - - - -int ecl_refcase_list_add_case( ecl_refcase_list_type * refcase_list , const char * case_name) { - sum_pair_type * pair = sum_pair_alloc( case_name , false ); - if (pair) { - if (hash_has_key( refcase_list->case_dict , pair->case_name)) { - sum_pair_free( pair ); - return 0; - } else { - hash_insert_hash_owned_ref( refcase_list->case_dict , pair->case_name , pair , sum_pair_free__); - refcase_list->sorted = false; - return 1; - } - } else - return 0; -} - -/* - The glob_string pattern must (for all practical purposes) end in an - explicit extension: - - - If it ends without an extension there will be zero mathces. It - - it ends with a '*' there will be a hell-of-a-lot of duplicate - matches. - - If the input glob string does not have an explicit extension we add - .*SMSPEC for the matching purpose. -*/ - - -int ecl_refcase_list_add_matching( ecl_refcase_list_type * refcase_list , const char * __glob_string) { - int count = 0; - char * glob_string; - - { - char * glob_ext; - util_alloc_file_components( __glob_string , NULL , NULL , &glob_ext); - if (glob_ext == NULL) - glob_string = util_alloc_filename(NULL , __glob_string , "*SMSPEC"); - else { - glob_string = util_alloc_string_copy( __glob_string ); - free( glob_ext ); - } - } - - { - stringlist_type * case_list = stringlist_alloc_new(); - int i; - stringlist_select_matching( case_list , glob_string ); - for (i=0; i < stringlist_get_size( case_list ); i++) { - count += ecl_refcase_list_add_case( refcase_list , stringlist_iget( case_list , i ) ); - } - stringlist_free( case_list ); - } - - free( glob_string ); - return count; -} - diff --git a/ThirdParty/Ert/libenkf/src/enkf_analysis.c b/ThirdParty/Ert/libenkf/src/enkf_analysis.c deleted file mode 100644 index 44a10d143f..0000000000 --- a/ThirdParty/Ert/libenkf/src/enkf_analysis.c +++ /dev/null @@ -1,190 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_analysis.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include - - - - - - -/*****************************************************************/ - -void enkf_analysis_fprintf_obs_summary(const obs_data_type * obs_data , const meas_data_type * meas_data , const int_vector_type * step_list , const char * ministep_name , FILE * stream ) { - const char * float_fmt = "%15.3f"; - fprintf(stream , "===============================================================================================================================\n"); - fprintf(stream , "Report step...: %04d",int_vector_iget( step_list , 0)); - if (int_vector_size( step_list ) == 1) - fprintf(stream , "\n"); - else - fprintf(stream , " - %04d \n",int_vector_get_last( step_list )); - - - fprintf(stream , "Ministep......: %s \n",ministep_name); - fprintf(stream , "-------------------------------------------------------------------------------------------------------------------------------\n"); - { - char * obs_fmt = util_alloc_sprintf(" %%-3d : %%-32s %s +/- %s" , float_fmt , float_fmt); - char * sim_fmt = util_alloc_sprintf(" %s +/- %s \n" , float_fmt , float_fmt); - - fprintf(stream , " Observed history | Simulated data \n"); - fprintf(stream , "-------------------------------------------------------------------------------------------------------------------------------\n"); - - { - int block_nr; - int obs_count = 1; /* Only for printing */ - for (block_nr =0; block_nr < obs_data_get_num_blocks( obs_data ); block_nr++) { - const obs_block_type * obs_block = obs_data_iget_block_const( obs_data , block_nr); - meas_block_type * meas_block = meas_data_iget_block( meas_data , block_nr ); - const char * obs_key = obs_block_get_key( obs_block ); - - for (int iobs = 0; iobs < obs_block_get_size( obs_block ); iobs++) { - active_type active_mode = obs_block_iget_active_mode( obs_block , iobs ); - if ((active_mode == MISSING) || (active_mode == LOCAL_INACTIVE)) - continue; - else { - const char * print_key; - if (iobs == 0) - print_key = obs_key; - else - print_key = " ..."; - - fprintf(stream , obs_fmt , obs_count , print_key , obs_block_iget_value( obs_block , iobs ) , obs_block_iget_std( obs_block , iobs )); - - if (active_mode == ACTIVE) - fprintf(stream , " Active |"); - else if (active_mode == DEACTIVATED) - fprintf(stream , " Inactive |"); - else if (active_mode == LOCAL_INACTIVE) - fprintf(stream , " |"); - else if (active_mode == MISSING) - fprintf(stream , " |"); - else - util_abort("%s: enum_value:%d not handled - internal error\n" , __func__ , active_mode); - - if (active_mode == MISSING) - fprintf(stream , " Missing\n"); - else if (active_mode == LOCAL_INACTIVE) - fprintf(stream , " Deactivated - local updates\n"); - else - fprintf(stream , sim_fmt, meas_block_iget_ens_mean( meas_block , iobs ) , meas_block_iget_ens_std( meas_block , iobs )); - - obs_count++; - } - } - } - } - - free( obs_fmt ); - free( sim_fmt ); - } - fprintf(stream , "===============================================================================================================================\n"); - fprintf(stream , "\n\n\n"); -} - - - - -void enkf_analysis_deactivate_outliers(obs_data_type * obs_data , meas_data_type * meas_data , double std_cutoff , double alpha, bool verbose) { - for (int block_nr =0; block_nr < obs_data_get_num_blocks( obs_data ); block_nr++) { - obs_block_type * obs_block = obs_data_iget_block( obs_data , block_nr); - meas_block_type * meas_block = meas_data_iget_block( meas_data , block_nr ); - - { - int iobs; - for (iobs =0; iobs < meas_block_get_total_obs_size( meas_block ); iobs++) { - if (meas_block_iget_active( meas_block , iobs )) { - double ens_std = meas_block_iget_ens_std( meas_block , iobs ); - if (ens_std <= std_cutoff) { - /* - De activated because the ensemble has to small - variation for this particular measurement. - */ - obs_block_deactivate( obs_block , iobs , verbose , "No ensemble variation"); - meas_block_deactivate( meas_block , iobs ); - } else { - double ens_mean = meas_block_iget_ens_mean( meas_block , iobs ); - double obs_std = obs_block_iget_std( obs_block , iobs ); - double obs_value = obs_block_iget_value( obs_block , iobs ); - double innov = obs_value - ens_mean; - - /* - Deactivated because the distance between the observed data - and the ensemble prediction is to large. Keeping these - outliers will lead to numerical problems. - */ - - if (fabs( innov ) > alpha * (ens_std + obs_std)) { - obs_block_deactivate(obs_block , iobs , verbose , "No overlap"); - meas_block_deactivate(meas_block , iobs); - } - } - } - } - } - } -} - -void enkf_analysis_deactivate_std_zero(obs_data_type * obs_data , meas_data_type * meas_data , bool verbose) { - - for (int block_nr =0; block_nr < obs_data_get_num_blocks( obs_data ); block_nr++) { - obs_block_type * obs_block = obs_data_iget_block( obs_data , block_nr); - meas_block_type * meas_block = meas_data_iget_block( meas_data , block_nr ); - - { - int iobs; - for (iobs =0; iobs < meas_block_get_total_obs_size( meas_block ); iobs++) { - if (meas_block_iget_active( meas_block , iobs )) { - double ens_std = meas_block_iget_ens_std( meas_block , iobs ); - if (ens_std <= 0.0) { - /* - De activated because the ensemble has to small - variation for this particular measurement. - */ - obs_block_deactivate( obs_block , iobs , verbose , "No ensemble variation"); - meas_block_deactivate( meas_block , iobs ); - } - } - } - } - } -} - - - - - - - - - diff --git a/ThirdParty/Ert/libenkf/src/enkf_config_node.c b/ThirdParty/Ert/libenkf/src/enkf_config_node.c deleted file mode 100644 index 7fc3e245ad..0000000000 --- a/ThirdParty/Ert/libenkf/src/enkf_config_node.c +++ /dev/null @@ -1,1072 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_config_node.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define ENKF_CONFIG_NODE_TYPE_ID 776104 - -struct enkf_config_node_struct { - UTIL_TYPE_ID_DECLARATION; - ert_impl_type impl_type; - enkf_var_type var_type; - bool vector_storage; - bool forward_init; /* Should the (parameter) node be initialized by loading results from the Forward model? */ - - bool_vector_type * internalize; /* Should this node be internalized - observe that question of what to internalize is MOSTLY handled at a higher level - without consulting this variable. Can be NULL. */ - stringlist_type * obs_keys; /* Keys of observations which observe this node. */ - char * key; - char * init_file_abs_path; - path_fmt_type * init_file_fmt; /* Format used to create files for initialization. */ - path_fmt_type * enkf_infile_fmt; /* Format used to load in file from forward model - one %d (if present) is replaced with report_step. */ - path_fmt_type * enkf_outfile_fmt; /* Name of file which is written by EnKF, and read by the forward model. */ - void * data; /* This points to the config object of the actual implementation. */ - enkf_node_type * min_std; - char * min_std_file; - - vector_type * container_nodes; - /*****************************************************************/ - /* Function pointers to methods working on the underlying config object. */ - get_data_size_ftype * get_data_size; /* Function pointer to ask the underlying config object of the size - i.e. number of elements. */ - config_free_ftype * freef; -}; - - -UTIL_IS_INSTANCE_FUNCTION( enkf_config_node , ENKF_CONFIG_NODE_TYPE_ID ) - - -static bool enkf_config_node_has_container(const enkf_config_node_type * node , enkf_fs_type * fs , node_id_type node_id) { - bool has_container = true; - for (int inode=0; inode < vector_get_size( node->container_nodes ); inode++) { - enkf_config_node_type * child_node = vector_iget( node->container_nodes , inode ); - bool has_child; - if (child_node->vector_storage) - has_child = enkf_config_node_has_vector( child_node , fs , node_id.iens ); - else - has_child = enkf_config_node_has_node( child_node , fs , node_id ); - - if (!has_child) { - has_container = false; - break; - } - } - return has_container; -} - - - -bool enkf_config_node_has_node( const enkf_config_node_type * node , enkf_fs_type * fs , node_id_type node_id) { - if (node->impl_type == CONTAINER) - return enkf_config_node_has_container( node , fs , node_id ); - else - return enkf_fs_has_node( fs , node->key , node->var_type , node_id.report_step , node_id.iens ); -} - - -bool enkf_config_node_has_vector( const enkf_config_node_type * node , enkf_fs_type * fs , int iens) { - bool has_vector = enkf_fs_has_vector( fs , node->key , node->var_type , iens ); - return has_vector; -} - - - -static enkf_config_node_type * enkf_config_node_alloc__(enkf_var_type var_type, ert_impl_type impl_type, const char * key, bool forward_init) { - enkf_config_node_type * node = util_malloc( sizeof *node ); - UTIL_TYPE_ID_INIT( node , ENKF_CONFIG_NODE_TYPE_ID ); - node->forward_init = forward_init; - node->var_type = var_type; - node->impl_type = impl_type; - node->key = util_alloc_string_copy( key ); - node->container_nodes = vector_alloc_new(); - node->vector_storage = false; - - node->init_file_abs_path = NULL, - node->init_file_fmt = NULL; - node->enkf_infile_fmt = NULL; - node->enkf_outfile_fmt = NULL; - node->internalize = NULL; - node->data = NULL; - node->obs_keys = stringlist_alloc_new(); - node->min_std = NULL; - node->min_std_file = NULL; - - node->get_data_size = NULL; - node->freef = NULL; - - switch(impl_type) { - case(FIELD): - node->freef = field_config_free__; - node->get_data_size = field_config_get_data_size__; - break; - case(GEN_KW): - node->freef = gen_kw_config_free__; - node->get_data_size = gen_kw_config_get_data_size__; - break; - case(CUSTOM_KW): - node->freef = custom_kw_config_free__; - node->get_data_size = NULL; - break; - case(SUMMARY): - node->vector_storage = true; - node->freef = summary_config_free__; - node->get_data_size = summary_config_get_data_size__; - break; - case(GEN_DATA): - node->freef = gen_data_config_free__; - node->get_data_size = NULL; - break; - case(SURFACE): - node->freef = surface_config_free__; - node->get_data_size = surface_config_get_data_size__; - break; - case(CONTAINER): - node->freef = container_config_free__; - node->get_data_size = container_config_get_data_size__; - break; - default: - util_abort("%s : invalid implementation type: %d - aborting \n",__func__ , impl_type); - } - return node; -} - - -bool enkf_config_node_vector_storage( const enkf_config_node_type * config_node) { - return config_node->vector_storage; -} - -/** - Requires that enkf_outfile_fmt (i.e. the name of the file produced - by ERT) is set to a non NULL value; in addition to the type - specific validation in gen_kw_config_is_valid(). -*/ - -static bool enkf_config_node_is_valid_GEN_KW( const enkf_config_node_type * config_node ) { - bool valid = gen_kw_config_is_valid( config_node->data ); - valid = (valid && (config_node->enkf_outfile_fmt != NULL)); - - return valid; -} - - -static bool enkf_config_node_is_valid_FIELD( const enkf_config_node_type * config_node ) { - bool valid = false; - if ( config_node->var_type != INVALID_VAR ) - valid = field_config_is_valid( config_node->data ); - - - return valid; -} - - -static bool enkf_config_node_is_valid_GEN_DATA( const enkf_config_node_type * config_node ) { - bool valid = gen_kw_config_is_valid( config_node->data ); - valid = (valid && (config_node->enkf_outfile_fmt != NULL)); - - return valid; -} - - - - - -bool enkf_config_node_is_valid( const enkf_config_node_type * config_node ) { - bool valid = false; - - switch(config_node->impl_type) { - case(FIELD): - valid = enkf_config_node_is_valid_FIELD( config_node ); - break; - case(SUMMARY): - valid = true; - break; - case(GEN_KW): - valid = enkf_config_node_is_valid_GEN_KW( config_node ); - break; - case(GEN_DATA): - valid = enkf_config_node_is_valid_GEN_DATA( config_node ); - break; - default: - util_abort("%s: - what the fuXX - internal bug. \n",__func__); - } - - return valid; -} - -void enkf_config_node_update_min_std( enkf_config_node_type * config_node , const char * min_std_file ) { - if (!util_string_equal( config_node->min_std_file , min_std_file )) { - /* The current min_std_file and the new input are different, and - the min_std node must be cleared. */ - if (config_node->min_std != NULL) { - enkf_node_free( config_node->min_std ); - config_node->min_std = NULL; - free( config_node->min_std_file ); - } - } - config_node->min_std_file = util_realloc_string_copy( config_node->min_std_file , min_std_file ); - if (config_node->min_std_file != NULL) { - config_node->min_std = enkf_node_alloc( config_node ); - enkf_node_fload( config_node->min_std , min_std_file ); - } -} - - -static void enkf_config_node_update( enkf_config_node_type * config_node , - const char * initfile_fmt , - const char * enkf_outfile_fmt , - const char * enkf_infile_fmt , - const char * min_std_file ) { - - config_node->init_file_fmt = path_fmt_realloc_path_fmt( config_node->init_file_fmt , initfile_fmt ); - config_node->enkf_infile_fmt = path_fmt_realloc_path_fmt( config_node->enkf_infile_fmt , enkf_infile_fmt ); - config_node->enkf_outfile_fmt = path_fmt_realloc_path_fmt( config_node->enkf_outfile_fmt , enkf_outfile_fmt ); - enkf_config_node_update_min_std( config_node , min_std_file ); -} - - - - -enkf_config_node_type * enkf_config_node_alloc(enkf_var_type var_type, - ert_impl_type impl_type, - bool forward_init , - const char * key , - const char * init_file_fmt , - const char * enkf_outfile_fmt , - const char * enkf_infile_fmt , - void * data) { - - enkf_config_node_type * node = enkf_config_node_alloc__( var_type , impl_type , key , forward_init); - enkf_config_node_update( node , init_file_fmt, enkf_outfile_fmt , enkf_infile_fmt , NULL ); - node->data = data; - return node; -} - - - - - -void enkf_config_node_update_gen_kw( enkf_config_node_type * config_node , - const char * enkf_outfile_fmt , /* The include file created by ERT for the forward model. */ - const char * template_file , - const char * parameter_file , - const char * min_std_file , - const char * init_file_fmt ) { - - /* 1: Update the low level gen_kw_config stuff. */ - gen_kw_config_update( config_node->data , template_file , parameter_file ); - - /* 2: Update the stuff which is owned by the upper-level enkf_config_node instance. */ - enkf_config_node_update( config_node , init_file_fmt , enkf_outfile_fmt , NULL , min_std_file); -} - - -void enkf_config_node_update_custom_kw(enkf_config_node_type * config_node, const char * result_file, const char * output_file) { - enkf_config_node_update(config_node, NULL, output_file, result_file, NULL); -} - -/** - This will create a new gen_kw_config instance which is NOT yet - valid. -*/ -enkf_config_node_type * enkf_config_node_new_gen_kw( const char * key , const char * tag_fmt , bool forward_init) { - enkf_config_node_type * config_node = enkf_config_node_alloc__( PARAMETER , GEN_KW , key , forward_init); - config_node->data = gen_kw_config_alloc_empty( key , tag_fmt ); - return config_node; -} - -enkf_config_node_type * enkf_config_node_new_custom_kw(const char * key, const char * result_file, const char * output_file) { - enkf_config_node_type * config_node = enkf_config_node_alloc__(DYNAMIC_RESULT, CUSTOM_KW, key, false); - config_node->data = custom_kw_config_alloc_empty(key, result_file, output_file); - return config_node; -} - -enkf_config_node_type * enkf_config_node_new_defined_custom_kw(const char * key, const hash_type * definition) { - enkf_config_node_type * config_node = enkf_config_node_alloc__(DYNAMIC_RESULT, CUSTOM_KW, key, false); - config_node->data = custom_kw_config_alloc_with_definition(key, definition); - return config_node; -} - -enkf_config_node_type * enkf_config_node_new_surface( const char * key , bool forward_init) { - enkf_config_node_type * config_node = enkf_config_node_alloc__( PARAMETER , SURFACE , key , forward_init); - config_node->data = surface_config_alloc_empty( ); - return config_node; -} - - -void enkf_config_node_update_surface( enkf_config_node_type * config_node , const char * base_surface, const char * init_file_fmt , const char * output_file , const char * min_std_file ) { - - /* 1: Update the data owned by the surface node. */ - surface_config_set_base_surface( config_node->data , base_surface ); - - /* 2: Update the stuff which is owned by the upper-level enkf_config_node instance. */ - enkf_config_node_update( config_node , init_file_fmt , output_file , NULL , min_std_file); -} - - -/*****************************************************************/ - -enkf_config_node_type * enkf_config_node_alloc_summary( const char * key , load_fail_type load_fail) { - enkf_config_node_type * config_node = enkf_config_node_alloc__( DYNAMIC_RESULT , SUMMARY , key , false); - config_node->data = summary_config_alloc( key , load_fail ); - return config_node; -} - - - - -enkf_config_node_type * enkf_config_node_alloc_GEN_PARAM( const char * node_key , - bool forward_init , - gen_data_file_format_type input_format , - gen_data_file_format_type output_format , - const char * init_file_fmt , - const char * ert_outfile_fmt) { - - - enkf_config_node_type * config_node = enkf_config_node_alloc__( PARAMETER , GEN_DATA , node_key , forward_init ); - config_node->data = gen_data_config_alloc_GEN_PARAM( node_key , output_format , input_format); - - enkf_config_node_update( config_node , /* Generic update - needs the format settings from the special.*/ - init_file_fmt , - ert_outfile_fmt , - NULL , - NULL ); - - return config_node; -} - - - - -enkf_config_node_type * enkf_config_node_alloc_GEN_DATA_result( const char * key , - gen_data_file_format_type input_format, - const char * enkf_infile_fmt ) { - - enkf_config_node_type * config_node = enkf_config_node_alloc__( DYNAMIC_RESULT , GEN_DATA , key , false); - config_node->data = gen_data_config_alloc_GEN_DATA_result( key , input_format ); - - enkf_config_node_update( config_node , /* Generic update - needs the format settings from the special.*/ - NULL , - NULL , - enkf_infile_fmt , - NULL ); - - return config_node; -} - - -enkf_config_node_type * enkf_config_node_alloc_GEN_DATA_state( const char * key, - bool forward_init , - gen_data_file_format_type input_format, - gen_data_file_format_type output_format, - const char * init_file_fmt , - const char * template_ecl_file , - const char * template_data_key , - const char * enkf_outfile_fmt , - const char * enkf_infile_fmt , - const char * min_std_file) { - - if (gen_data_config_valid_result_format( enkf_infile_fmt )) { - enkf_config_node_type * config_node = enkf_config_node_alloc__( DYNAMIC_STATE , GEN_DATA , key , forward_init); - config_node->data = gen_data_config_alloc_GEN_DATA_state( key , output_format , input_format ); - - enkf_config_node_update(config_node , /* Generic update - needs the format settings from the special.*/ - init_file_fmt , - enkf_outfile_fmt , - enkf_infile_fmt, - min_std_file); - - return config_node; - } else { - fprintf(stderr, "** ERROR: The RESULT_FILE setting for %s is invalid - must have an embedded %%d - and be a relative path.\n" , key ); - return NULL; - } -} - - - -/*****************************************************************/ - -enkf_config_node_type * enkf_config_node_new_container( const char * key ) { - enkf_config_node_type * config_node = enkf_config_node_alloc__( INVALID , CONTAINER , key , false); - config_node->data = container_config_alloc( key ); - return config_node; -} - -void enkf_config_node_update_container( enkf_config_node_type * config_node , const enkf_config_node_type * child_node) { - vector_append_ref( config_node->container_nodes , child_node ); - container_config_add_node( config_node->data , child_node ); -} - -const char * enkf_config_node_iget_container_key( const enkf_config_node_type * config_node , int index) { - const enkf_config_node_type * child_node = vector_iget_const( config_node->container_nodes , index ); - return child_node->key; -} - - -/*****************************************************************/ - -/** - This will create a new gen_kw_config instance which is NOT yet - valid. Mainly support code for the GUI. -*/ -enkf_config_node_type * enkf_config_node_alloc_field( const char * key , ecl_grid_type * ecl_grid, field_trans_table_type * trans_table, bool forward_init) { - enkf_config_node_type * config_node = enkf_config_node_alloc__( INVALID , FIELD , key , forward_init); - config_node->data = field_config_alloc_empty( key , ecl_grid , trans_table, false ); - return config_node; -} - - - -/** - This is for dynamic ECLIPSE fields like PRESSURE and SWAT; they - only have truncation as possible parameters. -*/ -void enkf_config_node_update_state_field( enkf_config_node_type * config_node , int truncation , double value_min , double value_max ) { - config_node->var_type = DYNAMIC_STATE; - field_config_update_state_field( config_node->data , truncation , value_min , value_max ); - enkf_config_node_update( config_node , NULL , NULL , NULL , NULL ); -} - - - -void enkf_config_node_update_parameter_field( enkf_config_node_type * config_node , - const char * enkf_outfile_fmt , - const char * init_file_fmt , - const char * min_std_file , - int truncation , double value_min , double value_max , - const char * init_transform , - const char * output_transform ) { - - field_file_format_type export_format = field_config_default_export_format( enkf_outfile_fmt ); /* Purely based on extension, recognizes ROFF and GRDECL, the rest will be ecl_kw format. */ - field_config_update_parameter_field( config_node->data , truncation , value_min , value_max , - export_format , - init_transform , - output_transform ); - config_node->var_type = PARAMETER; - enkf_config_node_update( config_node , init_file_fmt , enkf_outfile_fmt , NULL , min_std_file); -} - - - - - -/*****************************************************************/ - - -void enkf_config_node_update_general_field( enkf_config_node_type * config_node , - const char * enkf_outfile_fmt , - const char * enkf_infile_fmt , - const char * init_file_fmt , - const char * min_std_file , - int truncation , - double value_min , - double value_max , - const char * init_transform , - const char * input_transform , - const char * output_transform ) { - - - field_file_format_type export_format = field_config_default_export_format( enkf_outfile_fmt ); /* Purely based on extension, recognizes ROFF and GRDECL, the rest will be ecl_kw format. */ - { - enkf_var_type var_type; - if (enkf_infile_fmt == NULL) - var_type = PARAMETER; - else { - if (enkf_outfile_fmt == NULL) - var_type = DYNAMIC_RESULT; /* Probably not very realistic */ - else - var_type = DYNAMIC_STATE; - } - config_node->var_type = var_type; - } - field_config_update_general_field( config_node->data , - truncation , value_min , value_max , - export_format , - init_transform , - input_transform , - output_transform ); - - enkf_config_node_update( config_node , init_file_fmt , enkf_outfile_fmt , enkf_infile_fmt, min_std_file); -} - - - - - - -/*****************************************************************/ - - -enkf_config_node_type * enkf_config_node_container_iget( const enkf_config_node_type * node , int index) { - return vector_iget( node->container_nodes , index ); -} - -int enkf_config_node_container_size( const enkf_config_node_type * node ) { - return vector_get_size( node->container_nodes ); -} - - -/*****************************************************************/ - -/** - Invokes the get_data_size() function of the underlying node object. -*/ - -int enkf_config_node_get_data_size( const enkf_config_node_type * node , int report_step) { - if (node->impl_type == GEN_DATA) - return gen_data_config_get_data_size( node->data , report_step); - else - return node->get_data_size( node->data ); -} - -void enkf_config_node_free(enkf_config_node_type * node) { - /* Freeing the underlying node object. */ - if (node->freef != NULL) node->freef(node->data); - free(node->key); - stringlist_free(node->obs_keys); - - free(node->init_file_abs_path); - - if (node->enkf_infile_fmt != NULL) - path_fmt_free( node->enkf_infile_fmt ); - - if (node->enkf_outfile_fmt != NULL) - path_fmt_free( node->enkf_outfile_fmt ); - - if (node->init_file_fmt != NULL) - path_fmt_free( node->init_file_fmt ); - - if (node->internalize != NULL) - bool_vector_free( node->internalize ); - - if (node->min_std != NULL) - enkf_node_free( node->min_std ); - - vector_free( node->container_nodes ); - free(node); -} - - - -const enkf_node_type * enkf_config_node_get_min_std( const enkf_config_node_type * config_node ) { - return config_node->min_std; -} - -const char * enkf_config_node_get_min_std_file( const enkf_config_node_type * config_node ) { - return config_node->min_std_file; -} - - -const char * enkf_config_node_get_enkf_outfile( const enkf_config_node_type * config_node ) { - return path_fmt_get_fmt( config_node->enkf_outfile_fmt ); -} - -const char * enkf_config_node_get_enkf_infile( const enkf_config_node_type * config_node ) { - return path_fmt_get_fmt( config_node->enkf_infile_fmt ); -} - - -const char * enkf_config_node_get_FIELD_fill_file(enkf_config_node_type * config_node, const path_fmt_type * runpath_fmt) { - if (config_node->init_file_abs_path) - return config_node->init_file_abs_path; - - char * runpath = NULL; - bool forward_init = enkf_config_node_use_forward_init(config_node); - - if (forward_init && runpath_fmt) { - runpath = path_fmt_alloc_path(runpath_fmt , false , 0, 0); /* Replace first %d with iens, if a second %d replace with iter */ - config_node->init_file_abs_path = enkf_config_node_alloc_initfile(config_node, runpath, 0); - } else - config_node->init_file_abs_path = enkf_config_node_alloc_initfile(config_node, NULL, 0); - - if (config_node->init_file_abs_path) { - config_node->init_file_abs_path = util_alloc_abs_path(config_node->init_file_abs_path); - if (!util_file_exists(config_node->init_file_abs_path)) { - free(config_node->init_file_abs_path); - config_node->init_file_abs_path = NULL; - } - } - - free(runpath); - - return config_node->init_file_abs_path; -} - - - -const char * enkf_config_node_get_init_file_fmt( const enkf_config_node_type * config_node) -{ - return path_fmt_get_fmt( config_node->init_file_fmt ); -} - -void enkf_config_node_set_min_std( enkf_config_node_type * config_node , enkf_node_type * min_std ) { - if (config_node->min_std != NULL) - enkf_node_free( config_node->min_std ); - - config_node->min_std = min_std; -} - - -void enkf_config_node_set_internalize(enkf_config_node_type * node, int report_step) { - ert_impl_type impl_type = enkf_config_node_get_impl_type( node ); - if (impl_type == CONTAINER) { - int inode; - int container_size = enkf_config_node_container_size( node ); - for (inode = 0; inode < container_size; inode++) { - enkf_config_node_type * child_node = enkf_config_node_container_iget( node , inode ); - enkf_config_node_set_internalize( child_node , report_step ); - } - } else { - if (node->internalize == NULL) - node->internalize = bool_vector_alloc( 0 , false ); - bool_vector_iset( node->internalize , report_step , true); - } -} - - -void enkf_config_node_init_internalization(enkf_config_node_type * node) { - if (node->internalize != NULL) - bool_vector_reset( node->internalize ); -} - - -/* Query function: */ -bool enkf_config_node_internalize(const enkf_config_node_type * node, int report_step) { - if (node->internalize == NULL) - return false; - else - return bool_vector_safe_iget( node->internalize , report_step); /* Will return default value if report_step is beyond size. */ -} - - - -/** - This is the filename used when loading from a completed forward - model. -*/ - -char * enkf_config_node_alloc_infile(const enkf_config_node_type * node , int report_step) { - if (node->enkf_infile_fmt != NULL) - return path_fmt_alloc_path(node->enkf_infile_fmt , false , report_step); - else - return NULL; -} - - -char * enkf_config_node_alloc_outfile(const enkf_config_node_type * node , int report_step) { - if (node->enkf_outfile_fmt != NULL) - return path_fmt_alloc_path(node->enkf_outfile_fmt , false , report_step); - else - return NULL; -} - -/* - The path argument is used when the function is during forward_model - based initialisation. -*/ - -char * enkf_config_node_alloc_initfile( const enkf_config_node_type * node , const char * path , int iens) { - if (node->init_file_fmt == NULL) - return NULL; - else { - char * file = path_fmt_alloc_file( node->init_file_fmt , false , iens ); - if (util_is_abs_path( file )) - return file; - else { - char * full_path = util_alloc_filename( path , file , NULL ); - free( file ); - return full_path; - } - } -} - - - - -void * enkf_config_node_get_ref(const enkf_config_node_type * node) { - return node->data; -} - - - -bool enkf_config_node_include_type(const enkf_config_node_type * config_node , int mask) { - - enkf_var_type var_type = config_node->var_type; - if (var_type & mask) - return true; - else - return false; - -} - - -bool enkf_config_node_use_forward_init(const enkf_config_node_type * config_node) { - return config_node->forward_init; -} - - -ert_impl_type enkf_config_node_get_impl_type(const enkf_config_node_type *config_node) { - return config_node->impl_type; -} - - -enkf_var_type enkf_config_node_get_var_type(const enkf_config_node_type *config_node) { - return config_node->var_type; -} - - -const char * enkf_config_node_get_key(const enkf_config_node_type * config_node) { return config_node->key; } - - -const stringlist_type * enkf_config_node_get_obs_keys(const enkf_config_node_type *config_node) { - return config_node->obs_keys; -} - - -int enkf_config_node_get_num_obs( const enkf_config_node_type * config_node ) { - return stringlist_get_size( config_node->obs_keys ); -} - - -/** - This checks the index_key - and sums up over all the time points of the observation. -*/ - -int enkf_config_node_load_obs( const enkf_config_node_type * config_node , enkf_obs_type * enkf_obs ,const char * key_index , int obs_count , time_t * _sim_time , double * _y , double * _std) { - ert_impl_type impl_type = enkf_config_node_get_impl_type(config_node); - int num_obs = 0; - int iobs; - - for (iobs = 0; iobs < stringlist_get_size( config_node->obs_keys ); iobs++) { - obs_vector_type * obs_vector = enkf_obs_get_vector( enkf_obs , stringlist_iget( config_node->obs_keys , iobs)); - - int report_step = -1; - while (true) { - report_step = obs_vector_get_next_active_step( obs_vector , report_step); - if (report_step == -1) break; - { - bool valid; - double value , std1; - - /** - The user index used when calling the user_get function on the - gen_obs data type is different depending on whether is called with a - data context user_key (as here) or with a observation context - user_key (as when plotting an observation plot). See more - documentation of the function gen_obs_user_get_data_index(). - */ - - if (impl_type == GEN_DATA) - gen_obs_user_get_with_data_index( obs_vector_iget_node( obs_vector , report_step ) , key_index , &value , &std1 , &valid); - else - obs_vector_user_get( obs_vector , key_index , report_step , &value , &std1 , &valid); - - if (valid) { - if (obs_count > 0) { - _sim_time[num_obs] = enkf_obs_iget_obs_time( enkf_obs , report_step ); - _y[num_obs] = value; - _std[num_obs] = std1; - } - num_obs++; - } - } - } - } - - /* Sorting the observations in time order. */ - if (obs_count > 0) { - double_vector_type * y = double_vector_alloc_shared_wrapper( 0 , 0 , _y , obs_count ); - double_vector_type * std = double_vector_alloc_shared_wrapper( 0 , 0 , _std , obs_count ); - time_t_vector_type * sim_time = time_t_vector_alloc_shared_wrapper( 0 , 0 , _sim_time , obs_count ); - perm_vector_type * sort_perm = time_t_vector_alloc_sort_perm( sim_time ); - - time_t_vector_permute( sim_time , sort_perm ); - double_vector_permute( y , sort_perm ); - double_vector_permute( std , sort_perm ); - - free( sort_perm ); - double_vector_free( y ); - double_vector_free( std ); - time_t_vector_free( sim_time ); - } - return num_obs; -} - - - -void enkf_config_node_add_obs_key(enkf_config_node_type * config_node , const char * obs_key) { - if (!stringlist_contains(config_node->obs_keys , obs_key)) - stringlist_append_copy(config_node->obs_keys , obs_key); -} - - -void enkf_config_node_clear_obs_keys(enkf_config_node_type * config_node) { - stringlist_clear( config_node->obs_keys ); -} - -/*****************************************************************/ - - - -void enkf_config_node_fprintf_config( const enkf_config_node_type * config_node , FILE * stream ) { - switch( config_node->impl_type) { - case(GEN_KW): - fprintf( stream , CONFIG_KEY_FORMAT , GEN_KW_KEY ); - fprintf( stream , CONFIG_VALUE_FORMAT , config_node->key ); - gen_kw_config_fprintf_config( config_node->data , path_fmt_get_fmt( config_node->enkf_outfile_fmt ) , config_node->min_std_file , stream ); - break; - case(FIELD): - fprintf( stream , CONFIG_KEY_FORMAT , FIELD_KEY ); - fprintf( stream , CONFIG_VALUE_FORMAT , config_node->key ); - field_config_fprintf_config( config_node->data , - config_node->var_type , - path_fmt_get_fmt( config_node->enkf_outfile_fmt ) , - path_fmt_get_fmt( config_node->enkf_infile_fmt ) , - config_node->min_std_file , - stream ); - break; - case(GEN_DATA): - - if (config_node->var_type == PARAMETER) - fprintf( stream , CONFIG_KEY_FORMAT , GEN_PARAM_KEY ); - else - fprintf( stream , CONFIG_KEY_FORMAT , GEN_DATA_KEY ); - - gen_data_config_fprintf_config( config_node->data , - config_node->var_type , - path_fmt_get_fmt( config_node->enkf_outfile_fmt ) , - path_fmt_get_fmt( config_node->enkf_infile_fmt ) , - config_node->min_std_file , - stream ); - break; - default: - util_abort("%s: internal error - function can not store configuration for: %s variables. \n",__func__ , enkf_types_get_impl_name( config_node->impl_type) ); - } - fprintf( stream , "\n"); -} -/*****************************************************************/ - -void enkf_config_node_add_GEN_PARAM_config_schema( config_parser_type * config ) { - config_schema_item_type * item; - item = config_add_schema_item(config , GEN_PARAM_KEY , false ); - config_schema_item_set_argc_minmax(item , 2 , CONFIG_DEFAULT_ARG_MAX); -} - - -void enkf_config_node_add_GEN_DATA_config_schema( config_parser_type * config ) { - config_schema_item_type * item; - item = config_add_schema_item(config , GEN_DATA_KEY , false ); - config_schema_item_set_argc_minmax(item , 1 , CONFIG_DEFAULT_ARG_MAX); -} - -void enkf_config_node_add_CUSTOM_KW_config_schema(config_parser_type * config){ - config_schema_item_type * item = config_add_schema_item(config, CUSTOM_KW_KEY, false); - config_schema_item_set_argc_minmax(item, 2, 3); - config_schema_item_iset_type(item, 0, CONFIG_STRING); - config_schema_item_iset_type(item, 1, CONFIG_PATH); - config_schema_item_iset_type(item, 2, CONFIG_PATH); -} - -enkf_config_node_type * enkf_config_node_alloc_GEN_DATA_from_config( const config_content_node_type * node ) { - enkf_config_node_type * config_node = NULL; - const char * node_key = config_content_node_iget( node , 0 ); - { - hash_type * options = hash_alloc(); - - config_content_node_init_opt_hash( node , options , 1 ); - { - gen_data_file_format_type input_format = gen_data_config_check_format( hash_safe_get( options , INPUT_FORMAT_KEY)); - gen_data_file_format_type output_format = gen_data_config_check_format( hash_safe_get( options , OUTPUT_FORMAT_KEY)); - const char * init_file_fmt = hash_safe_get( options , INIT_FILES_KEY); - const char * ecl_file = hash_safe_get( options , ECL_FILE_KEY); - const char * template = hash_safe_get( options , TEMPLATE_KEY); - const char * data_key = hash_safe_get( options , KEY_KEY); - const char * result_file = hash_safe_get( options , RESULT_FILE_KEY); - const char * min_std_file = hash_safe_get( options , MIN_STD_KEY); - const char * forward_string = hash_safe_get( options , FORWARD_INIT_KEY ); - const char * report_steps_string = hash_safe_get( options , REPORT_STEPS_KEY ); - int_vector_type * report_steps = int_vector_alloc(0,0); - bool forward_init = false; - bool valid_input = true; - - if (input_format == GEN_DATA_UNDEFINED) - valid_input = false; - - if (!gen_data_config_valid_result_format( result_file )) { - fprintf(stderr, "** ERROR: The RESULT_FILE:%s setting for %s is invalid - must have an embedded %%d - and be a relative path.\n" , result_file , node_key ); - valid_input = false; - } - - if (report_steps_string) { - if (!string_util_update_active_list( report_steps_string , report_steps )) { - valid_input = false; - fprintf(stderr,"** ERROR: The REPORT_STEPS:%s attribute was not valid.\n",report_steps_string); - } - } else { - fprintf(stderr,"** ERROR: As of July 2014 the GEN_DATA keywords must have a REPORT_STEPS:xxxx \n"); - fprintf(stderr," attribute to indicate which report step(s) you want to load data \n"); - fprintf(stderr," from. By requiring the user to enter this information in advance\n"); - fprintf(stderr," it is easier for ERT for to check that the results are valid, and\n"); - fprintf(stderr," handle errors with the GEN_DATA results gracefully.\n"); - fprintf(stderr," \n"); - fprintf(stderr," You can list several report steps separated with ',' and ranges with '-' \n"); - fprintf(stderr," but observe that spaces is NOT ALLOWED. \n"); - fprintf(stderr," \n"); - fprintf(stderr," - load from report step 100: REPORT_STEPS:100 \n"); - fprintf(stderr," - load from report steps 10, 20 and 30-40 REPORT_STEPS:10,20,30-40 \n"); - fprintf(stderr," \n"); - fprintf(stderr," The GEN_DATA keyword: %s will be ignored\n",node_key); - valid_input = false; - } - - if (valid_input) { - - if (forward_string) { - if (!util_sscanf_bool( forward_string , &forward_init)) - fprintf(stderr,"** Warning: parsing %s as bool failed - using FALSE \n",forward_string); - } - - if ((init_file_fmt == NULL) && - (ecl_file == NULL) && - (result_file != NULL)) - config_node = enkf_config_node_alloc_GEN_DATA_result( node_key , input_format , result_file); - else if ((init_file_fmt != NULL) && - (ecl_file != NULL) && - (result_file != NULL)) - config_node = enkf_config_node_alloc_GEN_DATA_state( node_key , - forward_init , - input_format , - output_format , - init_file_fmt , - template , - data_key , - ecl_file , - result_file , - min_std_file); - - { - gen_data_config_type * gen_data_config = enkf_config_node_get_ref( config_node ); - - if (template) - gen_data_config_set_template( gen_data_config , template , data_key); - - for (int i=0; i < int_vector_size( report_steps ); i++) { - int report_step = int_vector_iget( report_steps , i ); - gen_data_config_add_report_step( gen_data_config , report_step); - enkf_config_node_set_internalize( config_node , report_step ); - } - } - } - - int_vector_free( report_steps ); - } - hash_free( options ); - } - - return config_node; -} - - -enkf_config_node_type * enkf_config_node_alloc_GEN_PARAM_from_config( const config_content_node_type * node ) { - enkf_config_node_type * config_node = NULL; - const char * node_key = config_content_node_iget( node , 0 ); - const char * ecl_file = config_content_node_iget( node , 1 ); - { - hash_type * options = hash_alloc(); - - config_content_node_init_opt_hash( node , options , 2 ); - { - gen_data_file_format_type input_format = gen_data_config_check_format( hash_safe_get( options , INPUT_FORMAT_KEY)); - gen_data_file_format_type output_format = gen_data_config_check_format( hash_safe_get( options , OUTPUT_FORMAT_KEY)); - const char * init_file_fmt = hash_safe_get( options , INIT_FILES_KEY); - const char * template = hash_safe_get( options , TEMPLATE_KEY); - const char * data_key = hash_safe_get( options , KEY_KEY); - const char * min_std_file = hash_safe_get( options , MIN_STD_KEY); - const char * forward_string = hash_safe_get( options , FORWARD_INIT_KEY ); - bool forward_init = false; - bool valid_input = true; - - - if (input_format == GEN_DATA_UNDEFINED) - valid_input = false; - - if (input_format == ASCII_TEMPLATE) - valid_input = false; - - if (output_format == GEN_DATA_UNDEFINED) - valid_input = false; - - if (init_file_fmt == NULL) - valid_input = false; - - if (valid_input) { - - if (forward_string) { - if (!util_sscanf_bool( forward_string , &forward_init)) - fprintf(stderr,"** Warning: parsing %s as bool failed - using FALSE \n",forward_string); - } - - config_node = enkf_config_node_alloc_GEN_PARAM( node_key , forward_init , input_format , output_format , init_file_fmt , ecl_file); - - if (template) { - bool template_set_ok = gen_data_config_set_template( enkf_config_node_get_ref( config_node ) , template , data_key); - if (!template_set_ok) - fprintf(stderr,"** Warning: the template settings were not applied correctly - ignored\n"); - } - - if (min_std_file) - enkf_config_node_update_min_std( config_node , min_std_file ); - - } - } - hash_free( options ); - } - return config_node; -} - - -/*****************************************************************/ -UTIL_SAFE_CAST_FUNCTION( enkf_config_node , ENKF_CONFIG_NODE_TYPE_ID) -VOID_FREE(enkf_config_node) diff --git a/ThirdParty/Ert/libenkf/src/enkf_defaults.c b/ThirdParty/Ert/libenkf/src/enkf_defaults.c deleted file mode 100644 index f8647b2ac3..0000000000 --- a/ThirdParty/Ert/libenkf/src/enkf_defaults.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_defaults.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -/** - Currently no code here - but the way DEFAULT_STATIC_KW is implemented - is dang ugly. Should be compiled. -*/ diff --git a/ThirdParty/Ert/libenkf/src/enkf_fs.c b/ThirdParty/Ert/libenkf/src/enkf_fs.c deleted file mode 100644 index 6074363d42..0000000000 --- a/ThirdParty/Ert/libenkf/src/enkf_fs.c +++ /dev/null @@ -1,1058 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_fs.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/** - - About storage in the EnKF system - ================================ - - The system for storage in the EnKF system is quite complicated, maybe too - complicated. The reason the system is so complex is (at least) twofold: - - 1. It is a goal that it should be relatively easy to write new - systems (i.e. drivers) for storage. The current suite of - drivers (plain_driver_xx) are based on normal (compressed) - fread() and fwrite() system calls. But with the current - implementation one could write e.g. a MySQL based driver for - storage without touching(??) the rest of the EnKF code. - - 2. The parameters / static restart data / dynamic restart data - have very different storage characteristics. By splitting the - storage up in different drivers we can write drivers which are - specialized for the different types of data. - - - The interface - ------------- - - The unit of storage in the enkf_fs system is one enkf_node instance. The - interface between the storage system and the rest of the EnKF system is - through the enkf_fs functions: - - enkf_fs_fread_node() - enkf_fs_has_node() - enkf_fs_fwrite_node() - enkf_fs_unlink_node() - not implemented yet. - - - So all these functions (partly except enkf_fs_has_node()) work on a enkf_node - instance, and in addition they take the following input: - - - iens : ensemble member number - - report_step : the report_step number we are interested in - - state : whether we are considering an analyzed node or a forecast. - - In addition to the functions enkf_fs_fread_node() and enkf_fs_fwrite_node() there - are higher level functions enkf_fs_fread_alloc_ensemble() to load an ensemble of - nodes and enkf_fs_fread_alloc_ts() to load a time series of nodes. The driver can - implement these functions (to get a performance gain when loading many nodes). It - is not necceasry to implement these functions, the enkf_fs layer has simple - functions doing repeated calls to the enkf_fs_fread_node() function. - - - The drivers - ----------- - - The enkf_fs layer does not self implement the functions to read and write - nodes. Instead what happens is: - - 1. We determine the type of the node (static/dynamic/parameter), and select - the appropriate driver. - - 2. The appropriate driver is called to implement e.g. the fread_node - functions. - - The different types of data have different characteristcs, which the driver is - implemented to support. The characteristics the drivers support are the - following: - - - dynamic driver - -------------- - This is the simplest driver, all data is stored both in a forecast version and - an analyzed version. - - - parameter driver - ---------------- - This driver utilizes that parameters do not change during the forward model, - i.e. (analyzed , t) = (forecast , t - 1). So, only one version of the data is - actually stored; if you ask for the forecast you just get the data from the - previous report_step. - To support spin-ups and such the driver will actually go backwards in - report_time all the way until a node is found on disk. - - - static driver - ------------- - Like the parameter driver this also only stores one version od the data, - however in addition it has to query the node for a ID to support multiply - occuring keywords in ECLIPSE restart files. - - Currently only the plain_driver_xxx family has been implemented. Observe that - there is no dependencies between the drivers, it is perfectly possible to - implement a new driver for storage of static datat only. (There is probably a - large amount of static data which is common both between members and for - several consecutive report steps; utilizing that one could write a static - driver which was admittedly slower, but leaner on the storage.) - - The drivers are allocated prior to allocating the enkf_fs instance, and - pointers are passed in when allocating the enkf_fs instance. - - - Mounting the filesystem - ----------------------- - - Mounting the filesystem - cool ehh?? Anyway, the important point is - that the moment ensemble information has hit the filesystem later - versions of the enkf program must support exactly that lay-out, - those drivers+++. To ensure this I see two possibilities: - - 1. We can freeze the filesystem drivers, and the layout on disk - indefinetly. - - 2. We can store the information needed to bootstrap the drivers, - according to the current layout on disk, in the - filesystem. I.e. something like a '/etc/fstab' file. - - We have chosen the second alternative. Currently this implemented as - follows: - - 1. In main() we query for the file {root-path}/enkf_mount_info. If - that file does not exists it is created by calls to the - selected drivers xxxx_fwrite_mount_info() functions. - - 2. enkf_fs_mount() is called with the enkf_mount_info as input. - - The enkf_mount_info file (BINARY) consists of four records (one for - each driver, including the index). The format of each record is: - - DRIVER_CATEGORY DRIVER_ID INFO - int int void * - - The driver category should be one of the four integer values in - fs_driver_type (fs_types.h) and DRIVER_ID is one the integer - values in fs_driver_impl. The last void * data is whatever - (serialized) info the driver needs to bootstrap. This info is - written by the drivers xxxx_fwrite_mount_info() function, and it is - used when the driver is allocated with xxxx_fread_alloc(). - - The different drivers can be in arbitrary order in the - enkf_mount_info file, but when four records are read it checks that - all drivers have been initialized, and aborts if that is not the - case. - - If the enkf_mount_info file is deleted you (might) be fucked. It - is currently 'protected' with chomd a-w - but that is of course not - foolprof. -*/ - - - - -/** - Observe the following convention: the initial ensemble at report - step 0 is supposed to be analyzed. If we ask for the forecast at - report_step 0, we should get the analyzed value. -*/ - - -#define ENKF_FS_TYPE_ID 1089763 -#define ENKF_MOUNT_MAP "enkf_mount_info" -#define SUMMARY_KEY_SET_FILE "summary-key-set" -#define TIME_MAP_FILE "time-map" -#define STATE_MAP_FILE "state-map" -#define MISFIT_ENSEMBLE_FILE "misfit-ensemble" -#define CASE_CONFIG_FILE "case_config" -#define CUSTOM_KW_CONFIG_SET_FILE "custom_kw_config_set" - -struct enkf_fs_struct { - UTIL_TYPE_ID_DECLARATION; - char * case_name; - char * root_path; - char * mount_point; // mount_point = root_path / case_name; the mount_point is the fundamental INPUT. - - char * lock_file; - int lock_fd; - - fs_driver_type * dynamic_forecast; - fs_driver_type * parameter; - fs_driver_type * index ; - - bool read_only; /* Whether this filesystem has been mounted read-only. */ - time_map_type * time_map; - cases_config_type * cases_config; - state_map_type * state_map; - summary_key_set_type * summary_key_set; - misfit_ensemble_type * misfit_ensemble; - custom_kw_config_set_type * custom_kw_config_set; - /* - The variables below here are for storing arbitrary files within - the enkf_fs storage directory, but not as serialized enkf_nodes. - */ - path_fmt_type * case_fmt; - path_fmt_type * case_member_fmt; - path_fmt_type * case_tstep_fmt; - path_fmt_type * case_tstep_member_fmt; - - int refcount; - int writecount; -}; - - -/*****************************************************************/ - - -UTIL_SAFE_CAST_FUNCTION( enkf_fs , ENKF_FS_TYPE_ID) -UTIL_IS_INSTANCE_FUNCTION( enkf_fs , ENKF_FS_TYPE_ID) - -static void enkf_fs_umount( enkf_fs_type * fs ); - -int enkf_fs_incref( enkf_fs_type * fs ) { - fs->refcount++; - return fs->refcount; -} - - -int enkf_fs_decref( enkf_fs_type * fs ) { - int refcount; - fs->refcount--; - refcount = fs->refcount; - - if (fs->refcount < 0) - util_abort("%s: internal fuckup. The filesystem refcount:%d is < 0 \n",__func__ , fs->refcount); - - if (refcount == 0) - enkf_fs_umount( fs ); - - return refcount; -} - - -int enkf_fs_get_refcount( const enkf_fs_type * fs ) { - return fs->refcount; -} - - -enkf_fs_type * enkf_fs_get_ref( enkf_fs_type * fs ) { - enkf_fs_incref( fs ); - return fs; -} - - -static enkf_fs_type * enkf_fs_alloc_empty( const char * mount_point ) { - enkf_fs_type * fs = util_malloc(sizeof * fs ); - UTIL_TYPE_ID_INIT( fs , ENKF_FS_TYPE_ID ); - fs->time_map = time_map_alloc( ); - fs->cases_config = cases_config_alloc(); - fs->state_map = state_map_alloc(); - fs->summary_key_set = summary_key_set_alloc(); - fs->custom_kw_config_set = custom_kw_config_set_alloc(); - fs->misfit_ensemble = misfit_ensemble_alloc(); - fs->index = NULL; - fs->parameter = NULL; - fs->dynamic_forecast = NULL; - fs->read_only = true; - fs->mount_point = util_alloc_string_copy( mount_point ); - fs->refcount = 0; - fs->writecount = 0; - fs->lock_fd = 0; - - if (mount_point == NULL) - util_abort("%s: fatal internal error: mount_point == NULL \n",__func__); - { - char ** path_tmp; - int path_len; - - util_path_split( fs->mount_point , &path_len , &path_tmp); - fs->case_name = util_alloc_string_copy( path_tmp[path_len - 1]); - fs->root_path = util_alloc_joined_string( (const char **) path_tmp , path_len , UTIL_PATH_SEP_STRING); - fs->lock_file = util_alloc_filename( fs->mount_point , fs->case_name , "lock"); - - if (util_try_lockf( fs->lock_file , S_IWUSR + S_IWGRP , &fs->lock_fd)) { - fs->read_only = false; - } else { - fprintf(stderr," Another program has already opened filesystem read-write - this instance will be UNSYNCRONIZED read-only. Cross your fingers ....\n"); - fs->read_only = true; - } - - util_free_stringlist( path_tmp , path_len ); - } - return fs; -} - - - - -static int enkf_fs_fread_fs_version__(FILE * stream) { - int version; - long fs_tag = util_fread_long( stream ); - if (fs_tag == FS_MAGIC_ID) - version = util_fread_int(stream); - else - version = 0; - return version; -} - - -/** - -1 : No mount map found. - 0 : Old mount map without version info. - x : Actual version info. -*/ - -static int enkf_fs_get_fs_version__(const char * config_file) { - int version = -1; - if (util_file_exists(config_file)) { - FILE * stream = util_fopen(config_file , "r"); - version = enkf_fs_fread_fs_version__(stream); - fclose(stream); - } - return version; -} - -/** - Function written to look for old (version <= 104) mount info maps. -*/ - -int enkf_fs_get_version104( const char * path ) { - char * config_file = util_alloc_filename( path , ENKF_MOUNT_MAP, NULL); - int version = enkf_fs_get_fs_version__( config_file ); - free( config_file ); - return version; -} - - - - - - - -/*****************************************************************/ - - -static void enkf_fs_init_path_fmt( enkf_fs_type * fs) { - /* - Installing the path_fmt instances for the storage of arbitrary files. - */ - fs->case_fmt = path_fmt_alloc_directory_fmt( DEFAULT_CASE_PATH ); - fs->case_member_fmt = path_fmt_alloc_directory_fmt( DEFAULT_CASE_MEMBER_PATH ); - fs->case_tstep_fmt = path_fmt_alloc_directory_fmt( DEFAULT_CASE_TSTEP_PATH ); - fs->case_tstep_member_fmt = path_fmt_alloc_directory_fmt( DEFAULT_CASE_TSTEP_MEMBER_PATH ); - -} - - -static void enkf_fs_create_plain_fs( FILE * stream , void * arg) { - - plain_driver_create_fs( stream , DRIVER_PARAMETER , DEFAULT_PLAIN_NODE_PARAMETER_PATH , DEFAULT_PLAIN_VECTOR_PARAMETER_PATH); - plain_driver_create_fs( stream , DRIVER_DYNAMIC_FORECAST , DEFAULT_PLAIN_NODE_DYNAMIC_FORECAST_PATH , DEFAULT_PLAIN_VECTOR_DYNAMIC_FORECAST_PATH); - plain_driver_create_fs( stream , DRIVER_INDEX , DEFAULT_PLAIN_NODE_INDEX_PATH , DEFAULT_PLAIN_VECTOR_INDEX_PATH ); - -} - - - -static void enkf_fs_create_block_fs( FILE * stream , int num_drivers , const char * mount_point , void * arg) { - - block_fs_driver_create_fs( stream , mount_point , DRIVER_PARAMETER , num_drivers , "Ensemble/mod_%d" , "PARAMETER"); - block_fs_driver_create_fs( stream , mount_point , DRIVER_DYNAMIC_FORECAST , num_drivers , "Ensemble/mod_%d" , "FORECAST"); - block_fs_driver_create_fs( stream , mount_point , DRIVER_INDEX , 1 , "Index" , "INDEX"); - -} - - -static void enkf_fs_assign_driver( enkf_fs_type * fs , fs_driver_type * driver , fs_driver_enum driver_type ) { - switch(driver_type) { - case(DRIVER_PARAMETER): - fs->parameter = driver; - break; - case(DRIVER_DYNAMIC_FORECAST): - fs->dynamic_forecast = driver; - break; - case(DRIVER_INDEX): - fs->index = driver; - break; - case(DRIVER_STATIC): - util_abort("%s: internal error - should not assign a STATIC driver \n",__func__); - break; - case(DRIVER_DYNAMIC_ANALYZED): - util_abort("%s: internal error - should not assign a DYNAMIC_ANALYZED driver \n",__func__); - break; - } -} - - -static enkf_fs_type * enkf_fs_mount_block_fs( FILE * fstab_stream , const char * mount_point ) { - enkf_fs_type * fs = enkf_fs_alloc_empty( mount_point ); - - { - while (true) { - fs_driver_enum driver_type; - if (fread( &driver_type , sizeof driver_type , 1 , fstab_stream) == 1) { - if (fs_types_valid( driver_type )) { - fs_driver_type * driver = block_fs_driver_open( fstab_stream , mount_point , driver_type , fs->read_only); - enkf_fs_assign_driver( fs , driver , driver_type ); - } else - block_fs_driver_fskip( fstab_stream ); - } else - break; - } - } - - return fs; -} - - - - -static enkf_fs_type * enkf_fs_mount_plain( FILE * fstab_stream , const char * mount_point ) { - enkf_fs_type * fs = enkf_fs_alloc_empty( mount_point ); - { - while (true) { - fs_driver_enum driver_type; - if (fread( &driver_type , sizeof driver_type , 1 , fstab_stream) == 1) { - if (fs_types_valid( driver_type )) { - fs_driver_type * driver = plain_driver_open( fstab_stream , mount_point ); - enkf_fs_assign_driver( fs , driver , driver_type ); - } else - plain_driver_fskip( fstab_stream ); - - } else - break; - } - } - return fs; -} - - - -enkf_fs_type * enkf_fs_create_fs( const char * mount_point, fs_driver_impl driver_id , void * arg , bool mount) { - const int num_drivers = 32; - FILE * stream = fs_driver_open_fstab( mount_point , true ); - if (stream != NULL) { - fs_driver_init_fstab( stream, driver_id); - { - switch( driver_id ) { - case( BLOCK_FS_DRIVER_ID ): - enkf_fs_create_block_fs( stream , num_drivers , mount_point , arg ); - break; - case( PLAIN_DRIVER_ID ): - enkf_fs_create_plain_fs( stream , arg ); - break; - default: - util_abort("%s: Invalid driver_id value:%d \n",__func__ , driver_id ); - } - } - fclose( stream ); - } - - if (mount) - return enkf_fs_mount( mount_point ); - else - return NULL; -} - - -static void enkf_fs_fsync_time_map( enkf_fs_type * fs ) { - char * filename = enkf_fs_alloc_case_filename( fs , TIME_MAP_FILE ); - time_map_fwrite( fs->time_map , filename ); - free( filename ); -} - - -static void enkf_fs_fread_time_map( enkf_fs_type * fs ) { - char * filename = enkf_fs_alloc_case_filename( fs , TIME_MAP_FILE ); - time_map_fread( fs->time_map , filename ); - free( filename ); -} - - -static void enkf_fs_fsync_cases_config( enkf_fs_type * fs ) { - char * filename = enkf_fs_alloc_case_filename( fs , CASE_CONFIG_FILE ); - cases_config_fwrite( fs->cases_config , filename ); - free( filename ); -} - -static void enkf_fs_fsync_state_map( enkf_fs_type * fs ) { - char * filename = enkf_fs_alloc_case_filename( fs , STATE_MAP_FILE ); - state_map_fwrite( fs->state_map , filename ); - free( filename ); -} - -static void enkf_fs_fsync_summary_key_set( enkf_fs_type * fs ) { - char * filename = enkf_fs_alloc_case_filename( fs , SUMMARY_KEY_SET_FILE ); - summary_key_set_fwrite( fs->summary_key_set , filename ); - free( filename ); -} - -static void enkf_fs_fsync_custom_kw_config_set( enkf_fs_type * fs ) { - char * filename = enkf_fs_alloc_case_filename(fs, CUSTOM_KW_CONFIG_SET_FILE); - custom_kw_config_set_fwrite(fs->custom_kw_config_set, filename ); - free( filename ); -} - -static void enkf_fs_fread_cases_config( enkf_fs_type * fs ) { - char * filename = enkf_fs_alloc_case_filename( fs , CASE_CONFIG_FILE ); - cases_config_fread( fs->cases_config , filename ); - free( filename ); -} - - -static void enkf_fs_fread_state_map( enkf_fs_type * fs ) { - char * filename = enkf_fs_alloc_case_filename( fs , STATE_MAP_FILE ); - state_map_fread( fs->state_map , filename ); - free( filename ); -} - -static void enkf_fs_fread_summary_key_set( enkf_fs_type * fs ) { - char * filename = enkf_fs_alloc_case_filename( fs , SUMMARY_KEY_SET_FILE ); - summary_key_set_fread( fs->summary_key_set , filename ); - free( filename ); -} - -static void enkf_fs_fread_custom_kw_config_set(enkf_fs_type * fs) { - char * filename = enkf_fs_alloc_case_filename(fs, CUSTOM_KW_CONFIG_SET_FILE); - custom_kw_config_set_fread(fs->custom_kw_config_set, filename); - free( filename ); -} - -state_map_type * enkf_fs_alloc_readonly_state_map( const char * mount_point ) { - path_fmt_type * path_fmt = path_fmt_alloc_directory_fmt( DEFAULT_CASE_PATH ); - char * filename = path_fmt_alloc_file( path_fmt , false , mount_point , STATE_MAP_FILE); - - state_map_type * state_map = state_map_fread_alloc_readonly( filename ); - - path_fmt_free( path_fmt ); - free( filename ); - return state_map; -} - -summary_key_set_type * enkf_fs_alloc_readonly_summary_key_set( const char * mount_point ) { - path_fmt_type * path_fmt = path_fmt_alloc_directory_fmt( DEFAULT_CASE_PATH ); - char * filename = path_fmt_alloc_file( path_fmt , false , mount_point , SUMMARY_KEY_SET_FILE); - - summary_key_set_type * summary_key_set = summary_key_set_alloc_from_file( filename, true ); - - path_fmt_free( path_fmt ); - free( filename ); - return summary_key_set; -} - -time_map_type * enkf_fs_alloc_readonly_time_map( const char * mount_point ) { - path_fmt_type * path_fmt = path_fmt_alloc_directory_fmt( DEFAULT_CASE_PATH ); - char * filename = path_fmt_alloc_file( path_fmt , false , mount_point , TIME_MAP_FILE); - - time_map_type * time_map = time_map_fread_alloc_readonly( filename ); - - path_fmt_free( path_fmt ); - free( filename ); - return time_map; -} - - - -static void enkf_fs_fread_misfit( enkf_fs_type * fs ) { - FILE * stream = enkf_fs_open_excase_file( fs , MISFIT_ENSEMBLE_FILE ); - if (stream != NULL) { - misfit_ensemble_fread( fs->misfit_ensemble , stream ); - fclose( stream ); - } -} - - -static void enkf_fs_fwrite_misfit( enkf_fs_type * fs ) { - if (misfit_ensemble_initialized( fs->misfit_ensemble )) { - FILE * stream = enkf_fs_open_case_file( fs , MISFIT_ENSEMBLE_FILE , "w"); - misfit_ensemble_fwrite( fs->misfit_ensemble , stream ); - fclose( stream ); - } -} - - - -int enkf_fs_disk_version(const char * mount_point ) { - int disk_version = -1; - FILE * stream = fs_driver_open_fstab( mount_point , false ); - if (stream) { - disk_version = fs_driver_fread_version( stream ); - fclose( stream ); - } - return disk_version; -} - - -bool enkf_fs_update_disk_version(const char * mount_point , int src_version , int target_version) { - if (enkf_fs_disk_version( mount_point ) == src_version) { - char * fstab_file = fs_driver_alloc_fstab_file( mount_point ); - FILE * stream = util_fopen( fstab_file , "r+"); - - fseek( stream , 0L, SEEK_SET ); - fs_driver_assert_magic( stream ); - util_fwrite_int( target_version , stream ); - - fclose( stream ); - free( fstab_file ); - - return true; - } else - return false; -} - - -enkf_fs_type * enkf_fs_mount( const char * mount_point ) { - FILE * stream = fs_driver_open_fstab( mount_point , false ); - - if (stream != NULL) { - enkf_fs_type * fs = NULL; - fs_driver_assert_magic( stream ); - fs_driver_assert_version( stream , mount_point ); - { - fs_driver_impl driver_id = util_fread_int( stream ); - - switch( driver_id ) { - case( BLOCK_FS_DRIVER_ID ): - fs = enkf_fs_mount_block_fs( stream , mount_point); - break; - case( PLAIN_DRIVER_ID ): - fs = enkf_fs_mount_plain( stream , mount_point ); - break; - default: - util_abort("%s: unrecognized driver_id:%d \n",__func__ , driver_id ); - } - } - fclose( stream ); - enkf_fs_init_path_fmt( fs ); - enkf_fs_fread_time_map( fs ); - enkf_fs_fread_cases_config( fs ); - enkf_fs_fread_state_map( fs ); - enkf_fs_fread_summary_key_set( fs ); - enkf_fs_fread_custom_kw_config_set( fs ); - enkf_fs_fread_misfit( fs ); - - enkf_fs_get_ref( fs ); - return fs; - } - return NULL; -} - - -bool enkf_fs_exists( const char * mount_point ) { - bool exists = false; - - FILE * stream = fs_driver_open_fstab( mount_point , false ); - if (stream != NULL) { - exists = true; - fclose( stream ); - } - - return exists; -} - - - - -/*****************************************************************/ - - - -static void enkf_fs_free_driver(fs_driver_type * driver) { - driver->free_driver(driver); -} - - -static void enkf_fs_umount( enkf_fs_type * fs ) { - if (!fs->read_only) { - enkf_fs_fsync( fs ); - enkf_fs_fwrite_misfit( fs ); - } - - { - int refcount = fs->refcount; - if (refcount == 0) { - enkf_fs_free_driver( fs->dynamic_forecast ); - enkf_fs_free_driver( fs->parameter ); - enkf_fs_free_driver( fs->index ); - - if (fs->lock_fd > 0) { - close( fs->lock_fd ); // Closing the lock_file file descriptor - and releasing the lock. - util_unlink_existing( fs->lock_file ); - } - - util_safe_free( fs->case_name ); - util_safe_free( fs->root_path ); - util_safe_free(fs->lock_file); - util_safe_free( fs->mount_point ); - path_fmt_free( fs->case_fmt ); - path_fmt_free( fs->case_member_fmt ); - path_fmt_free( fs->case_tstep_fmt ); - path_fmt_free( fs->case_tstep_member_fmt ); - - custom_kw_config_set_free( fs->custom_kw_config_set ); - state_map_free( fs->state_map ); - summary_key_set_free(fs->summary_key_set); - time_map_free( fs->time_map ); - cases_config_free( fs->cases_config ); - misfit_ensemble_free( fs->misfit_ensemble ); - free( fs ); - } else - util_abort("%s: internal fuckup - tried to umount a filesystem with refcount:%d\n",__func__ , refcount); - } -} - - - - - -static void * enkf_fs_select_driver(enkf_fs_type * fs , enkf_var_type var_type, const char * key) { - void * driver = NULL; - switch (var_type) { - case(PARAMETER): - driver = fs->parameter; - break; - case(DYNAMIC_RESULT): - driver = fs->dynamic_forecast; - break; - case(DYNAMIC_STATE): - driver = fs->dynamic_forecast; - break; - default: - util_abort("%s: fatal internal error - could not determine enkf_fs driver for object:%s[integer type:%d] - aborting.\n",__func__, key , var_type); - } - return driver; -} - - - -/*****************************************************************/ -/* Exported functions for enkf_node instances . */ - - -static void enkf_fs_fsync_driver( fs_driver_type * driver ) { - if (driver->fsync_driver != NULL) - driver->fsync_driver( driver ); -} - - - -void enkf_fs_fsync( enkf_fs_type * fs ) { - enkf_fs_fsync_driver( fs->parameter ); - enkf_fs_fsync_driver( fs->dynamic_forecast ); - enkf_fs_fsync_driver( fs->index ); - - enkf_fs_fsync_time_map( fs ); - enkf_fs_fsync_cases_config( fs) ; - enkf_fs_fsync_state_map( fs ); - enkf_fs_fsync_summary_key_set( fs ); - enkf_fs_fsync_custom_kw_config_set(fs); -} - - - - -void enkf_fs_fread_node(enkf_fs_type * enkf_fs , buffer_type * buffer , - const char * node_key , - enkf_var_type var_type , - int report_step, - int iens) { - - fs_driver_type * driver = enkf_fs_select_driver(enkf_fs , var_type , node_key ); - if (var_type == PARAMETER) - /* Parameters are *ONLY* stored at report_step == 0 */ - report_step = 0; - - buffer_rewind( buffer ); - driver->load_node(driver , node_key , report_step , iens , buffer); -} - - -void enkf_fs_fread_vector(enkf_fs_type * enkf_fs , buffer_type * buffer , - const char * node_key , - enkf_var_type var_type , - int iens) { - - fs_driver_type * driver = enkf_fs_select_driver(enkf_fs , var_type , node_key ); - - buffer_rewind( buffer ); - driver->load_vector(driver , node_key , iens , buffer); -} - - - -bool enkf_fs_has_node(enkf_fs_type * enkf_fs , const char * node_key , enkf_var_type var_type , int report_step , int iens) { - fs_driver_type * driver = fs_driver_safe_cast(enkf_fs_select_driver(enkf_fs , var_type , node_key)); - return driver->has_node(driver , node_key , report_step , iens ); -} - - -bool enkf_fs_has_vector(enkf_fs_type * enkf_fs , const char * node_key , enkf_var_type var_type , int iens ) { - fs_driver_type * driver = fs_driver_safe_cast(enkf_fs_select_driver(enkf_fs , var_type , node_key)); - return driver->has_vector(driver , node_key , iens ); -} - -void enkf_fs_fwrite_node(enkf_fs_type * enkf_fs , buffer_type * buffer , const char * node_key, enkf_var_type var_type, - int report_step , int iens ) { - if (enkf_fs->read_only) - util_abort("%s: attempt to write to read_only filesystem mounted at:%s - aborting. \n",__func__ , enkf_fs->mount_point); - - - if ((var_type == PARAMETER) && (report_step > 0)) - util_abort("%s: Parameters can only be saved for report_step = 0 %s:%d\n", __func__ , node_key , report_step); - { - void * _driver = enkf_fs_select_driver(enkf_fs , var_type , node_key); - { - fs_driver_type * driver = fs_driver_safe_cast(_driver); - driver->save_node(driver , node_key , report_step , iens , buffer); - } - } -} - - -void enkf_fs_fwrite_vector(enkf_fs_type * enkf_fs , buffer_type * buffer , const char * node_key, enkf_var_type var_type, - int iens ) { - if (enkf_fs->read_only) - util_abort("%s: attempt to write to read_only filesystem mounted at:%s - aborting. \n",__func__ , enkf_fs->mount_point); - { - void * _driver = enkf_fs_select_driver(enkf_fs , var_type , node_key); - { - fs_driver_type * driver = fs_driver_safe_cast(_driver); - driver->save_vector(driver , node_key , iens , buffer); - } - } -} - - - - -/*****************************************************************/ - - - - - -/*****************************************************************/ - -const char * enkf_fs_get_mount_point( const enkf_fs_type * fs ) { - return fs->mount_point; -} - -const char * enkf_fs_get_root_path( const enkf_fs_type * fs ) { - return fs->root_path; -} - -const char * enkf_fs_get_case_name( const enkf_fs_type * fs ) { - return fs->case_name; -} - - -bool enkf_fs_is_read_only(const enkf_fs_type * fs) { - return fs->read_only; -} - -void enkf_fs_set_writable(enkf_fs_type * fs, bool writable) { - fs->read_only = !writable; -} - -void enkf_fs_debug_fprintf( const enkf_fs_type * fs) { - printf("-----------------------------------------------------------------\n"); - printf("fs...................: %p \n",fs ); - printf("Mount point..........: %s \n",fs->mount_point ); - printf("Dynamic forecast.....: %p \n",fs->dynamic_forecast ); - printf("Parameter............: %p \n",fs->parameter ); - printf("Index................: %p \n",fs->index ); - printf("-----------------------------------------------------------------\n"); -} - - - - -/*****************************************************************/ -/* write_dir / read_dir confusion. */ - -char * enkf_fs_alloc_case_filename( const enkf_fs_type * fs , const char * input_name) { - char * filename = path_fmt_alloc_file( fs->case_fmt , false , fs->mount_point , input_name); - return filename; -} - - -char * enkf_fs_alloc_case_member_filename( const enkf_fs_type * fs , int iens , const char * input_name) { - char * filename = path_fmt_alloc_file( fs->case_member_fmt , false , fs->mount_point , iens , input_name); - return filename; -} - - -char * enkf_fs_alloc_case_tstep_filename( const enkf_fs_type * fs , int tstep , const char * input_name) { - char * filename = path_fmt_alloc_file( fs->case_tstep_fmt , false , fs->mount_point , tstep , input_name); - return filename; -} - -char * enkf_fs_alloc_case_tstep_member_filename( const enkf_fs_type * fs , int tstep , int iens , const char * input_name) { - char * filename = path_fmt_alloc_file( fs->case_tstep_member_fmt , false , fs->mount_point , tstep , iens , input_name); - return filename; -} - - - -FILE * enkf_fs_open_case_file( const enkf_fs_type * fs , const char * input_name , const char * mode) { - char * filename = enkf_fs_alloc_case_filename( fs , input_name ); - FILE * stream = util_mkdir_fopen( filename , mode ); - free( filename ); - return stream; -} - - -FILE * enkf_fs_open_case_member_file( const enkf_fs_type * fs , const char * input_name , int iens , const char * mode) { - char * filename = enkf_fs_alloc_case_member_filename( fs , iens , input_name ); - FILE * stream = util_mkdir_fopen( filename , mode ); - free( filename ); - return stream; -} - - -FILE * enkf_fs_open_case_tstep_file( const enkf_fs_type * fs , const char * input_name , int tstep , const char * mode) { - char * filename = enkf_fs_alloc_case_tstep_filename( fs , tstep , input_name ); - FILE * stream = util_mkdir_fopen( filename , mode ); - free( filename ); - return stream; -} - - -FILE * enkf_fs_open_case_tstep_member_file( const enkf_fs_type * fs , const char * input_name , int tstep , int iens , const char * mode) { - char * filename = enkf_fs_alloc_case_tstep_member_filename( fs , tstep , iens , input_name ); - FILE * stream = util_mkdir_fopen( filename , mode ); - free( filename ); - return stream; -} - -/*****************************************************************/ -/* - The open_exXXX functions will return NULL if the file does not - already exist. These functions can only be used to open with 'r' - mode. -*/ - - - -static FILE * enkf_fs_open_exfile( const char * filename ) { - if (util_file_exists(filename)) - return util_fopen( filename , "r"); - else - return NULL; -} - -FILE * enkf_fs_open_excase_file( const enkf_fs_type * fs , const char * input_name ) { - char * filename = enkf_fs_alloc_case_filename( fs , input_name ); - FILE * stream = enkf_fs_open_exfile( filename ); - free( filename ); - return stream; -} - - -FILE * enkf_fs_open_excase_member_file( const enkf_fs_type * fs , const char * input_name , int iens ) { - char * filename = enkf_fs_alloc_case_member_filename( fs , iens , input_name ); - FILE * stream = enkf_fs_open_exfile( filename ); - free( filename ); - return stream; -} - - -FILE * enkf_fs_open_excase_tstep_file( const enkf_fs_type * fs , const char * input_name , int tstep ) { - char * filename = enkf_fs_alloc_case_tstep_filename( fs , tstep , input_name ); - FILE * stream = enkf_fs_open_exfile( filename ); - free( filename ); - return stream; -} - - -FILE * enkf_fs_open_excase_tstep_member_file( const enkf_fs_type * fs , const char * input_name , int tstep , int iens ) { - char * filename = enkf_fs_alloc_case_tstep_member_filename( fs , tstep , iens , input_name ); - FILE * stream = enkf_fs_open_exfile( filename ); - free( filename ); - return stream; -} - -/*****************************************************************/ - -time_map_type * enkf_fs_get_time_map( const enkf_fs_type * fs ) { - return fs->time_map; -} - -cases_config_type * enkf_fs_get_cases_config( const enkf_fs_type * fs) { - return fs->cases_config; -} - -state_map_type * enkf_fs_get_state_map( const enkf_fs_type * fs ) { - return fs->state_map; -} - -summary_key_set_type * enkf_fs_get_summary_key_set( const enkf_fs_type * fs ) { - return fs->summary_key_set; -} - -custom_kw_config_set_type * enkf_fs_get_custom_kw_config_set(const enkf_fs_type * fs) { - return fs->custom_kw_config_set; -} - -misfit_ensemble_type * enkf_fs_get_misfit_ensemble( const enkf_fs_type * fs ) { - return fs->misfit_ensemble; -} - -void enkf_fs_increase_write_count(enkf_fs_type * fs) { - fs->writecount = fs->writecount + 1; -} - -void enkf_fs_decrease_write_count(enkf_fs_type * fs) { - fs->writecount = fs->writecount - 1; -} - -int enkf_fs_get_write_count(const enkf_fs_type * fs) { - return fs->writecount; -} - diff --git a/ThirdParty/Ert/libenkf/src/enkf_main.c b/ThirdParty/Ert/libenkf/src/enkf_main.c deleted file mode 100644 index ca8ea54ee1..0000000000 --- a/ThirdParty/Ert/libenkf/src/enkf_main.c +++ /dev/null @@ -1,3304 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - The file 'enkf_main.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define HAVE_THREAD_POOL 1 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/**/ - -/** - This object should contain **everything** needed to run a enkf - simulation. A way to wrap up all available information/state and - pass it around. An attempt has been made to collect various pieces - of related information together in a couple of objects - (model_config, ecl_config, site_config and ensemble_config). When - it comes to these holding objects the following should be observed: - - 1. It not always obvious where a piece of information should be - stored, i.e. the grid is a property of the model, however it is - an eclipse grid, and hence also belongs to eclipse - configuration?? [In this case ecl_config wins out.] - - 2. The information stored in these objects is typically passed on - to the enkf_state object, where it is used. - - 3. At enkf_state level it is not really consequent - in some cases - the enkf_state object takes a scalar copy (i.e. keep_runpath), - and in other cases only a pointer down to the underlying - enkf_main object is taken. In the former case it is no way to - change global behaviour by modifying the enkf_main objects. - - In the enkf_state object the fields of the member_config, - ecl_config, site_config and ensemble_config objects are mixed - and matched into other small holding objects defined in - enkf_state.c. - -*/ - -#define ENKF_MAIN_ID 8301 - -struct enkf_main_struct { - UTIL_TYPE_ID_DECLARATION; - enkf_fs_type * dbase; /* The internalized information. */ - - ensemble_config_type * ensemble_config; /* The config objects for the various enkf nodes.*/ - hook_manager_type * hook_manager; - model_config_type * model_config; - ecl_config_type * ecl_config; - site_config_type * site_config; - analysis_config_type * analysis_config; - local_config_type * local_config; /* Holding all the information about local analysis. */ - ert_templates_type * templates; /* Run time templates */ - config_settings_type * plot_config; /* Information about plotting. */ - rng_config_type * rng_config; - rng_type * rng; - ert_workflow_list_type * workflow_list; - ranking_table_type * ranking_table; - - /*---------------------------*/ /* Variables related to substitution. */ - subst_func_pool_type * subst_func_pool; - subst_list_type * subst_list; /* A parent subst_list instance - common to all ensemble members. */ - /*-------------------------*/ - - int_vector_type * keep_runpath; /* HACK: This is only used in the initialization period - afterwards the data is held by the enkf_state object. */ - bool pre_clear_runpath; /* HACK: This is only used in the initialization period - afterwards the data is held by the enkf_state object. */ - - char * site_config_file; - char * user_config_file; - char * rft_config_file; /* File giving the configuration to the RFTwells*/ - enkf_obs_type * obs; - enkf_state_type ** ensemble; /* The ensemble ... */ - int ens_size; /* The size of the ensemble */ - bool verbose; -}; - - - - -/*****************************************************************/ - -void enkf_main_init_internalization( enkf_main_type * , run_mode_type ); -void enkf_main_update_local_updates( enkf_main_type * enkf_main); -static void enkf_main_close_fs( enkf_main_type * enkf_main ); -static void enkf_main_init_fs( enkf_main_type * enkf_main ); -static void enkf_main_user_select_initial_fs(enkf_main_type * enkf_main ); - -/*****************************************************************/ - -UTIL_SAFE_CAST_FUNCTION(enkf_main , ENKF_MAIN_ID) -UTIL_IS_INSTANCE_FUNCTION(enkf_main , ENKF_MAIN_ID) - -analysis_config_type * enkf_main_get_analysis_config(const enkf_main_type * enkf_main) { - return enkf_main->analysis_config; -} - -bool enkf_main_get_pre_clear_runpath( const enkf_main_type * enkf_main ) { - return enkf_state_get_pre_clear_runpath( enkf_main->ensemble[0] ); -} - -void enkf_main_set_pre_clear_runpath( enkf_main_type * enkf_main , bool pre_clear_runpath) { - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - int iens; - for (iens = 0; iens < ens_size; iens++) - enkf_state_set_pre_clear_runpath( enkf_main->ensemble[iens] , pre_clear_runpath ); -} - - -bool enkf_main_set_refcase( enkf_main_type * enkf_main , const char * refcase_path) { - bool set_refcase = ecl_config_load_refcase( enkf_main->ecl_config , refcase_path ); - - model_config_set_refcase( enkf_main->model_config , ecl_config_get_refcase( enkf_main->ecl_config )); - ensemble_config_set_refcase( enkf_main->ensemble_config , ecl_config_get_refcase( enkf_main->ecl_config )); - - return set_refcase; -} - - -ui_return_type * enkf_main_validata_refcase( const enkf_main_type * enkf_main , const char * refcase_path) { - return ecl_config_validate_refcase( enkf_main->ecl_config , refcase_path ); -} - - -ui_return_type * enkf_main_set_eclbase( enkf_main_type * enkf_main , const char * eclbase_fmt) { - ui_return_type * ui_return = ecl_config_validate_eclbase( enkf_main->ecl_config , eclbase_fmt); - if (ui_return_get_status(ui_return) == UI_RETURN_OK) { - ecl_config_set_eclbase( enkf_main->ecl_config , eclbase_fmt ); - for (int iens = 0; iens < enkf_main->ens_size; iens++) - enkf_state_update_eclbase(enkf_main->ensemble[iens]); - } - return ui_return; -} - -void enkf_main_init_jobname( enkf_main_type * enkf_main) { - for (int iens = 0; iens < enkf_main->ens_size; iens++) - enkf_state_update_jobname( enkf_main->ensemble[iens] ); -} - - -void enkf_main_set_jobname( enkf_main_type * enkf_main , const char * jobname_fmt) { - model_config_set_jobname_fmt( enkf_main->model_config , jobname_fmt ); - enkf_main_init_jobname( enkf_main ); -} - -void enkf_main_set_user_config_file( enkf_main_type * enkf_main , const char * user_config_file ) { - enkf_main->user_config_file = util_realloc_string_copy( enkf_main->user_config_file , user_config_file ); -} - -void enkf_main_set_rft_config_file( enkf_main_type * enkf_main , const char * rft_config_file ) { - enkf_main->rft_config_file = util_realloc_string_copy( enkf_main->rft_config_file , rft_config_file ); -} - -void enkf_main_set_site_config_file( enkf_main_type * enkf_main , const char * site_config_file ) { - enkf_main->site_config_file = util_realloc_string_copy( enkf_main->site_config_file , site_config_file ); -} - -const char * enkf_main_get_user_config_file( const enkf_main_type * enkf_main ) { - return enkf_main->user_config_file; -} - -const char * enkf_main_get_site_config_file( const enkf_main_type * enkf_main ) { - return enkf_main->site_config_file; -} - -const char * enkf_main_get_rft_config_file( const enkf_main_type * enkf_main ) { - return enkf_main->rft_config_file; -} - -ensemble_config_type * enkf_main_get_ensemble_config(const enkf_main_type * enkf_main) { - return enkf_main->ensemble_config; -} - -site_config_type * enkf_main_get_site_config( const enkf_main_type * enkf_main ) { - return enkf_main->site_config; -} - - -subst_list_type * enkf_main_get_data_kw( const enkf_main_type * enkf_main ) { - return enkf_main->subst_list; -} - - -local_config_type * enkf_main_get_local_config( const enkf_main_type * enkf_main ) { - return enkf_main->local_config; -} - -model_config_type * enkf_main_get_model_config( const enkf_main_type * enkf_main ) { - return enkf_main->model_config; -} - -config_settings_type * enkf_main_get_plot_config( const enkf_main_type * enkf_main ) { - return enkf_main->plot_config; -} - -ranking_table_type * enkf_main_get_ranking_table( const enkf_main_type * enkf_main ) { - return enkf_main->ranking_table; -} - -ecl_config_type *enkf_main_get_ecl_config(const enkf_main_type * enkf_main) { - return enkf_main->ecl_config; -} - -int enkf_main_get_history_length( const enkf_main_type * enkf_main) { - return model_config_get_last_history_restart( enkf_main->model_config); -} - -bool enkf_main_has_prediction( const enkf_main_type * enkf_main ) { - return model_config_has_prediction( enkf_main->model_config ); -} - - - -enkf_obs_type * enkf_main_get_obs(const enkf_main_type * enkf_main) { - return enkf_main->obs; -} - - -bool enkf_main_have_obs( const enkf_main_type * enkf_main ) { - return enkf_obs_have_obs( enkf_main->obs ); -} - - - -hook_manager_type * enkf_main_get_hook_manager( const enkf_main_type * enkf_main ) { - return enkf_main->hook_manager; -} - - - -void enkf_main_alloc_obs( enkf_main_type * enkf_main ) { - enkf_main->obs = enkf_obs_alloc( model_config_get_history(enkf_main->model_config), - model_config_get_external_time_map(enkf_main->model_config), - ecl_config_get_grid( enkf_main->ecl_config ), - ecl_config_get_refcase( enkf_main->ecl_config ) , - enkf_main->ensemble_config ); -} - -void enkf_main_load_obs( enkf_main_type * enkf_main , const char * obs_config_file , bool clear_existing) { - if (clear_existing) - enkf_obs_clear( enkf_main->obs ); - - if (enkf_obs_load(enkf_main->obs , - obs_config_file , - analysis_config_get_std_cutoff(enkf_main->analysis_config))) { - enkf_main_update_local_updates( enkf_main ); - } else - fprintf(stderr,"** Warning: failed to load observation data from: %s \n",obs_config_file); -} - - -/** - This function should be called when a new data_file has been set. -*/ - -static void enkf_main_update_num_cpu( enkf_main_type * enkf_main ) { - /** - This is how the number of CPU's are passed on to the forward models: - */ - { - char * num_cpu_key = enkf_util_alloc_tagged_string( "NUM_CPU" ); - char * num_cpu_string = util_alloc_sprintf( "%d" , ecl_config_get_num_cpu( enkf_main->ecl_config )); - - subst_list_append_owned_ref( enkf_main->subst_list , num_cpu_key , num_cpu_string , NULL ); - free( num_cpu_key ); - } -} - - -ui_return_type * enkf_main_set_data_file( enkf_main_type * enkf_main , const char * data_file ) { - ui_return_type * ui_return = ecl_config_validate_data_file( enkf_main->ecl_config , data_file ); - if (ui_return_get_status(ui_return) == UI_RETURN_OK) { - ecl_config_set_data_file( enkf_main->ecl_config , data_file ); - enkf_main_update_num_cpu( enkf_main ); - } - return ui_return; -} - - - -static void enkf_main_free_ensemble( enkf_main_type * enkf_main ) { - if (enkf_main->ensemble != NULL) { - const int ens_size = enkf_main->ens_size; - int i; - for (i=0; i < ens_size; i++) - enkf_state_free( enkf_main->ensemble[i] ); - free(enkf_main->ensemble); - enkf_main->ensemble = NULL; - } -} - - -void enkf_main_free(enkf_main_type * enkf_main){ - if (enkf_main->rng != NULL) - rng_free( enkf_main->rng ); - rng_config_free( enkf_main->rng_config ); - - if (enkf_main->obs) - enkf_obs_free(enkf_main->obs); - - ranking_table_free( enkf_main->ranking_table ); - enkf_main_free_ensemble( enkf_main ); - enkf_main_close_fs( enkf_main ); - ert_log_close(); - - analysis_config_free(enkf_main->analysis_config); - ecl_config_free(enkf_main->ecl_config); - model_config_free( enkf_main->model_config); - - - hook_manager_free( enkf_main->hook_manager ); - site_config_free( enkf_main->site_config); - ensemble_config_free( enkf_main->ensemble_config ); - - local_config_free( enkf_main->local_config ); - - ert_workflow_list_free( enkf_main->workflow_list ); - - - int_vector_free( enkf_main->keep_runpath ); - config_settings_free( enkf_main->plot_config ); - ert_templates_free( enkf_main->templates ); - - subst_func_pool_free( enkf_main->subst_func_pool ); - subst_list_free( enkf_main->subst_list ); - util_safe_free( enkf_main->user_config_file ); - util_safe_free( enkf_main->site_config_file ); - util_safe_free( enkf_main->rft_config_file ); - free(enkf_main); -} - - - -void enkf_main_exit(enkf_main_type * enkf_main) { - enkf_main_free( enkf_main ); - exit(0); -} - - -/*****************************************************************/ - - - -/** - This function returns a (enkf_node_type ** ) pointer, which points - to all the instances with the same keyword, i.e. - - enkf_main_get_node_ensemble(enkf_main , "PRESSURE"); - - Will return an ensemble of pressure nodes. Observe that apart from - the list of pointers, *now new storage* is allocated, all the - pointers point in to the underlying enkf_node instances under the - enkf_main / enkf_state objects. Consequently there is no designated - free() function to match this, just free() the result. - - Example: - - enkf_node_type ** pressure_nodes = enkf_main_get_node_ensemble(enkf_main , "PRESSURE"); - - Do something with the pressure nodes ... - - free(pressure_nodes); - -*/ - -enkf_node_type ** enkf_main_get_node_ensemble(const enkf_main_type * enkf_main , enkf_fs_type * src_fs, const char * key , int report_step) { - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - enkf_node_type ** node_ensemble = util_calloc(ens_size , sizeof * node_ensemble ); - node_id_type node_id = {.report_step = report_step , - .iens = -1 }; - int iens; - - - for (iens = 0; iens < ens_size; iens++) { - node_ensemble[iens] = enkf_state_get_node(enkf_main->ensemble[iens] , key); - node_id.iens = iens; - enkf_node_load( node_ensemble[iens] , src_fs , node_id); - } - return node_ensemble; -} - -/*****************************************************************/ - - - - -enkf_state_type * enkf_main_iget_state(const enkf_main_type * enkf_main , int iens) { - return enkf_main->ensemble[iens]; -} - - -member_config_type * enkf_main_iget_member_config(const enkf_main_type * enkf_main , int iens) { - return enkf_state_get_member_config( enkf_main->ensemble[iens] ); -} - - - -void enkf_main_node_mean( const enkf_node_type ** ensemble , int ens_size , enkf_node_type * mean ) { - int iens; - enkf_node_clear( mean ); - for (iens = 0; iens < ens_size; iens++) - enkf_node_iadd( mean , ensemble[iens] ); - - enkf_node_scale( mean , 1.0 / ens_size ); -} - - -/** - This function calculates the node standard deviation from the - ensemble. The mean can be NULL, in which case it is assumed that - the mean has already been shifted away from the ensemble. -*/ - - -void enkf_main_node_std( const enkf_node_type ** ensemble , int ens_size , const enkf_node_type * mean , enkf_node_type * std) { - int iens; - enkf_node_clear( std ); - for (iens = 0; iens < ens_size; iens++) - enkf_node_iaddsqr( std , ensemble[iens] ); - enkf_node_scale(std , 1.0 / ens_size ); - - if (mean != NULL) { - enkf_node_scale( std , -1 ); - enkf_node_iaddsqr( std , mean ); - enkf_node_scale( std , -1 ); - } - - enkf_node_sqrt( std ); -} - - -void enkf_main_inflate_node(enkf_main_type * enkf_main , enkf_fs_type * src_fs , enkf_fs_type * target_fs , int report_step , const char * key , const enkf_node_type * min_std) { - int ens_size = enkf_main_get_ensemble_size(enkf_main); - enkf_node_type ** ensemble = enkf_main_get_node_ensemble( enkf_main , src_fs , key , report_step ); // Was ANALYZED - enkf_node_type * mean = enkf_node_copyc( ensemble[0] ); - enkf_node_type * std = enkf_node_copyc( ensemble[0] ); - int iens; - - /* Shifting away the mean */ - enkf_main_node_mean( (const enkf_node_type **) ensemble , ens_size , mean ); - enkf_node_scale( mean , -1 ); - for (iens = 0; iens < ens_size; iens++) - enkf_node_iadd( ensemble[iens] , mean ); - enkf_node_scale( mean , -1 ); - - /*****************************************************************/ - /* - Now we have the ensemble represented as a mean and an ensemble of - deviations from the mean. This is the form suitable for actually - doing the inflation. - */ - { - enkf_node_type * inflation = enkf_node_copyc( ensemble[0] ); - enkf_node_set_inflation( inflation , std , min_std ); - - for (iens = 0; iens < ens_size; iens++) - enkf_node_imul( ensemble[iens] , inflation ); - - enkf_node_free( inflation ); - } - - /* Add the mean back in - and store the updated node to disk.*/ - for (iens = 0; iens < ens_size; iens++) { - node_id_type node_id = {.report_step = report_step , .iens = iens }; - enkf_node_iadd( ensemble[iens] , mean ); - enkf_node_store( ensemble[iens] , target_fs , true , node_id); - } - - enkf_node_free( mean ); - enkf_node_free( std ); - free( ensemble ); -} - - - -/** - Denne burde istedet loope gjennom noklene fra use_count - direkte. -*/ - -void enkf_main_inflate(enkf_main_type * enkf_main , enkf_fs_type * src_fs , enkf_fs_type * target_fs , int report_step , hash_type * use_count) { - stringlist_type * keys = ensemble_config_alloc_keylist_from_var_type( enkf_main->ensemble_config , PARAMETER + DYNAMIC_STATE); - - for (int ikey = 0; ikey < stringlist_get_size( keys ); ikey++) { - const char * key = stringlist_iget( keys , ikey ); - if (hash_get_counter(use_count , key) > 0) { - const enkf_config_node_type * config_node = ensemble_config_get_node( enkf_main->ensemble_config , key ); - const enkf_node_type * min_std = enkf_config_node_get_min_std( config_node ); - - if (min_std != NULL) - enkf_main_inflate_node(enkf_main , src_fs , target_fs , report_step , key , min_std ); - - } - } - stringlist_free( keys ); -} - - - - -static int __get_active_size(const ensemble_config_type * ensemble_config , enkf_fs_type * fs , const char * key, int report_step , const active_list_type * active_list) { - const enkf_config_node_type * config_node = ensemble_config_get_node( ensemble_config , key ); - /** - This is very awkward; the problem is that for the GEN_DATA - type the config object does not really own the size. Instead - the size is pushed (on load time) from gen_data instances to - the gen_data_config instance. Therefor we have to assert - that at least one gen_data instance has been loaded (and - consequently updated the gen_data_config instance) before we - query for the size. - */ - { - if (enkf_config_node_get_impl_type( config_node ) == GEN_DATA) { - enkf_node_type * node = enkf_node_alloc( config_node ); - node_id_type node_id = {.report_step = report_step , - .iens = 0 }; - - enkf_node_load( node , fs , node_id ); - enkf_node_free( node ); - } - } - - { - active_mode_type active_mode = active_list_get_mode( active_list ); - int active_size; - if (active_mode == INACTIVE) - active_size = 0; - else if (active_mode == ALL_ACTIVE) - active_size = enkf_config_node_get_data_size( config_node , report_step ); - else if (active_mode == PARTLY_ACTIVE) - active_size = active_list_get_active_size( active_list , -1 ); - else { - util_abort("%s: internal error .. \n",__func__); - active_size = -1; /* Compiler shut up */ - } - return active_size; - } -} - - -/*****************************************************************/ -/** - Helper struct used to pass information to the multithreaded - serialize / deserialize functions. -*/ - -typedef struct { - enkf_fs_type * src_fs; - enkf_fs_type * target_fs; - enkf_state_type ** ensemble; - int iens1; /* Inclusive lower limit. */ - int iens2; /* NOT inclusive upper limit. */ - const char * key; - int report_step; - int target_step; - run_mode_type run_mode; - int row_offset; - const active_list_type * active_list; - matrix_type * A; - const int_vector_type * iens_active_index; -} serialize_info_type; - - -static void serialize_node( enkf_fs_type * fs , - enkf_state_type ** ensemble , - const char * key , - int iens , - int report_step , - int row_offset , - int column, - const active_list_type * active_list, - matrix_type * A) { - - enkf_node_type * node = enkf_state_get_node( ensemble[iens] , key); - node_id_type node_id = {.report_step = report_step, .iens = iens }; - enkf_node_serialize( node , fs , node_id , active_list , A , row_offset , column); -} - - -static void * serialize_nodes_mt( void * arg ) { - serialize_info_type * info = (serialize_info_type *) arg; - int iens; - for (iens = info->iens1; iens < info->iens2; iens++) { - int column = int_vector_iget( info->iens_active_index , iens); - if (column >= 0) - serialize_node( info->src_fs , - info->ensemble , - info->key , - iens , - info->report_step , - info->row_offset , - column, - info->active_list , - info->A ); - } - return NULL; -} - - -static void enkf_main_serialize_node( const char * node_key , - const active_list_type * active_list , - int row_offset , - thread_pool_type * work_pool , - serialize_info_type * serialize_info) { - - /* Multithreaded serializing*/ - const int num_cpu_threads = thread_pool_get_max_running( work_pool ); - int icpu; - - thread_pool_restart( work_pool ); - for (icpu = 0; icpu < num_cpu_threads; icpu++) { - serialize_info[icpu].key = node_key; - serialize_info[icpu].active_list = active_list; - serialize_info[icpu].row_offset = row_offset; - - thread_pool_add_job( work_pool , serialize_nodes_mt , &serialize_info[icpu]); - } - thread_pool_join( work_pool ); -} - - - -/** - The return value is the number of rows in the serialized - A matrix. -*/ - -static int enkf_main_serialize_dataset( const ensemble_config_type * ens_config , - const local_dataset_type * dataset , - int report_step, - hash_type * use_count , - int * active_size , - int * row_offset, - thread_pool_type * work_pool, - serialize_info_type * serialize_info) { - - matrix_type * A = serialize_info->A; - stringlist_type * update_keys = local_dataset_alloc_keys( dataset ); - const int num_kw = stringlist_get_size( update_keys ); - int ens_size = matrix_get_columns( A ); - int current_row = 0; - - for (int ikw=0; ikw < num_kw; ikw++) { - const char * key = stringlist_iget(update_keys , ikw); - enkf_config_node_type * config_node = ensemble_config_get_node( ens_config , key ); - if ((serialize_info[0].run_mode == SMOOTHER_UPDATE) && (enkf_config_node_get_var_type( config_node ) != PARAMETER)) { - /* We have tried to serialize a dynamic node when we are - smoother update mode; that does not make sense and we just - continue. */ - active_size[ikw] = 0; - continue; - } else { - const active_list_type * active_list = local_dataset_get_node_active_list( dataset , key ); - enkf_fs_type * src_fs = serialize_info->src_fs; - active_size[ikw] = __get_active_size( ens_config , src_fs , key , report_step , active_list ); - row_offset[ikw] = current_row; - - { - int matrix_rows = matrix_get_rows( A ); - if ((active_size[ikw] + current_row) > matrix_rows) - matrix_resize( A , matrix_rows + 2 * active_size[ikw] , ens_size , true ); - } - - if (active_size[ikw] > 0) { - enkf_main_serialize_node( key , active_list , row_offset[ikw] , work_pool , serialize_info ); - current_row += active_size[ikw]; - } - } - } - matrix_shrink_header( A , current_row , ens_size ); - stringlist_free( update_keys ); - return matrix_get_rows( A ); -} - -static void deserialize_node( enkf_fs_type * fs, - enkf_state_type ** ensemble , - const char * key , - int iens, - int target_step , - int row_offset , - int column, - const active_list_type * active_list, - matrix_type * A) { - - enkf_node_type * node = enkf_state_get_node( ensemble[iens] , key); - node_id_type node_id = { .report_step = target_step , .iens = iens }; - enkf_node_deserialize(node , fs , node_id , active_list , A , row_offset , column); - state_map_update_undefined(enkf_fs_get_state_map(fs) , iens , STATE_INITIALIZED); -} - - - -static void * deserialize_nodes_mt( void * arg ) { - serialize_info_type * info = (serialize_info_type *) arg; - int iens; - for (iens = info->iens1; iens < info->iens2; iens++) { - int column = int_vector_iget( info->iens_active_index , iens ); - if (column >= 0) - deserialize_node( info->target_fs , info->ensemble , info->key , iens , info->target_step , info->row_offset , column, info->active_list , info->A ); - } - return NULL; -} - - -static void enkf_main_deserialize_dataset( ensemble_config_type * ensemble_config , - const local_dataset_type * dataset , - const int * active_size , - const int * row_offset , - serialize_info_type * serialize_info , - thread_pool_type * work_pool ) { - - int num_cpu_threads = thread_pool_get_max_running( work_pool ); - stringlist_type * update_keys = local_dataset_alloc_keys( dataset ); - for (int i = 0; i < stringlist_get_size( update_keys ); i++) { - const char * key = stringlist_iget(update_keys , i); - enkf_config_node_type * config_node = ensemble_config_get_node( ensemble_config , key ); - if ((serialize_info[0].run_mode == SMOOTHER_UPDATE) && (enkf_config_node_get_var_type( config_node ) != PARAMETER)) - /* - We have tried to serialize a dynamic node when we are in - smoother update mode; that does not make sense and we just - continue. - */ - continue; - else { - if (active_size[i] > 0) { - const active_list_type * active_list = local_dataset_get_node_active_list( dataset , key ); - - { - /* Multithreaded */ - int icpu; - thread_pool_restart( work_pool ); - for (icpu = 0; icpu < num_cpu_threads; icpu++) { - serialize_info[icpu].key = key; - serialize_info[icpu].active_list = active_list; - serialize_info[icpu].row_offset = row_offset[i]; - - thread_pool_add_job( work_pool , deserialize_nodes_mt , &serialize_info[icpu]); - } - thread_pool_join( work_pool ); - } - } - } - } - stringlist_free( update_keys ); -} - - -static void serialize_info_free( serialize_info_type * serialize_info ) { - free( serialize_info ); -} - -static serialize_info_type * serialize_info_alloc( enkf_fs_type * src_fs, - enkf_fs_type * target_fs , - const int_vector_type * iens_active_index , - int target_step , - enkf_state_type ** ensemble , - run_mode_type run_mode , - int report_step , - matrix_type * A , - int num_cpu_threads ) { - - serialize_info_type * serialize_info = util_calloc( num_cpu_threads , sizeof * serialize_info ); - int ens_size = int_vector_size(iens_active_index); - int icpu; - int iens_offset = 0; - for (icpu = 0; icpu < num_cpu_threads; icpu++) { - serialize_info[icpu].iens_active_index = iens_active_index; - serialize_info[icpu].run_mode = run_mode; - serialize_info[icpu].src_fs = src_fs; - serialize_info[icpu].target_fs = target_fs; - serialize_info[icpu].target_step = target_step; - serialize_info[icpu].ensemble = ensemble; - serialize_info[icpu].report_step = report_step; - serialize_info[icpu].A = A; - serialize_info[icpu].iens1 = iens_offset; - serialize_info[icpu].iens2 = iens_offset + (ens_size - iens_offset) / (num_cpu_threads - icpu); - iens_offset = serialize_info[icpu].iens2; - } - serialize_info[num_cpu_threads - 1].iens2 = ens_size; - return serialize_info; -} - -static module_info_type * enkf_main_module_info_alloc( const local_ministep_type* ministep, - const obs_data_type * obs_data, - const local_dataset_type * dataset , - const local_obsdata_type * local_obsdata , - int * active_size , - int * row_offset) -{ - // Create and initialize the module_info instance. - module_info_type * module_info = module_info_alloc(local_ministep_get_name(ministep)); - - { /* Init data blocks in module_info */ - stringlist_type * update_keys = local_dataset_alloc_keys( dataset ); - const int num_kw = stringlist_get_size( update_keys ); - module_data_block_vector_type * module_data_block_vector = module_info_get_data_block_vector(module_info); - - for (int ikw=0; ikw < num_kw; ikw++) { - const char * key = stringlist_iget(update_keys , ikw); - const active_list_type * active_list = local_dataset_get_node_active_list( dataset , key ); - const module_data_block_type * data_block = module_data_block_alloc( key, active_list_get_active(active_list), row_offset[ikw], active_size[ikw] ); - module_data_block_vector_add_data_block(module_data_block_vector, data_block); - } - stringlist_free( update_keys ); - } - - - { /* Init obs blocks in module_info */ - module_obs_block_vector_type * module_obs_block_vector = module_info_get_obs_block_vector ( module_info ); - int current_row = 0; - for (int block_nr = 0; block_nr < local_obsdata_get_size( local_obsdata ); block_nr++) { - const obs_block_type * obs_block = obs_data_iget_block_const( obs_data , block_nr); - int total_size = obs_block_get_size(obs_block); - local_obsdata_node_type * node = local_obsdata_iget ( local_obsdata, block_nr ); - const char * key = local_obsdata_node_get_key ( node ); - const active_list_type * active_list = local_obsdata_node_get_active_list( node ); - int n_active = active_list_get_active_size(active_list, total_size); - module_obs_block_type * module_obs_block = module_obs_block_alloc(key, active_list_get_active(active_list), current_row, n_active); - module_obs_block_vector_add_obs_block ( module_obs_block_vector, module_obs_block ); - current_row += n_active; - } - } - - return module_info; -} - -static void enkf_main_module_info_free( module_info_type * module_info ) { - free( module_info ); -} - -void enkf_main_fprintf_PC(const char * filename , - matrix_type * PC , - matrix_type * PC_obs) { - - FILE * stream = util_mkdir_fopen(filename , "w"); - const int num_PC = matrix_get_rows( PC ); - const int ens_size = matrix_get_columns( PC ); - int ipc,iens; - - for (ipc = 0; ipc < num_PC; ipc++) - fprintf(stream , "%10.6f " , matrix_iget( PC_obs , ipc , 0)); - fprintf(stream , "\n"); - - for (iens = 0; iens < ens_size; iens++) { - for (ipc = 0; ipc < num_PC; ipc++) - fprintf(stream ,"%10.6f " , matrix_iget( PC , ipc, iens )); - fprintf(stream , "\n"); - } - fclose( stream ); -} - - -void enkf_main_get_PC( const matrix_type * S, - const matrix_type * dObs, - double truncation , - int ncomp , - matrix_type * PC , - matrix_type * PC_obs , - double_vector_type * singular_values) { - - enkf_linalg_get_PC( S , dObs , truncation , ncomp , PC , PC_obs , singular_values); -} - - - - - - - -static void assert_matrix_size(const matrix_type * m , const char * name , int rows , int columns) { - if (m) { - if (!matrix_check_dims(m , rows , columns)) - util_abort("%s: matrix mismatch %s:[%d,%d] - expected:[%d, %d]", __func__ , name , matrix_get_rows(m) , matrix_get_columns(m) , rows , columns); - } else - util_abort("%s: matrix:%s is NULL \n",__func__ , name); -} - -static void assert_size_equal(int ens_size , const bool_vector_type * ens_mask) { - if (bool_vector_size( ens_mask ) != ens_size) - util_abort("%s: fundamental inconsistency detected. Total ens_size:%d mask_size:%d \n",__func__ , ens_size , bool_vector_size( ens_mask )); -} - - -static void enkf_main_analysis_update( enkf_main_type * enkf_main , - enkf_fs_type * target_fs , - const bool_vector_type * ens_mask , - int target_step , - hash_type * use_count, - run_mode_type run_mode , - int step1 , - int step2 , - const local_ministep_type * ministep , - const meas_data_type * forecast , - obs_data_type * obs_data) { - - const int cpu_threads = 4; - const int matrix_start_size = 250000; - thread_pool_type * tp = thread_pool_alloc( cpu_threads , false ); - int active_ens_size = meas_data_get_active_ens_size( forecast ); - int active_size = obs_data_get_active_size( obs_data ); - matrix_type * X = matrix_alloc( active_ens_size , active_ens_size ); - matrix_type * S = meas_data_allocS( forecast ); - matrix_type * R = obs_data_allocR( obs_data ); - matrix_type * dObs = obs_data_allocdObs( obs_data ); - matrix_type * A = matrix_alloc( matrix_start_size , active_ens_size ); - matrix_type * E = NULL; - matrix_type * D = NULL; - matrix_type * localA = NULL; - int_vector_type * iens_active_index = bool_vector_alloc_active_index_list(ens_mask , -1); - - analysis_module_type * module = analysis_config_get_active_module( enkf_main->analysis_config ); - if ( local_ministep_has_analysis_module (ministep)) - module = local_ministep_get_analysis_module (ministep); - - assert_matrix_size(X , "X" , active_ens_size , active_ens_size); - assert_matrix_size(S , "S" , active_size , active_ens_size); - assert_matrix_size(R , "R" , active_size , active_size); - assert_size_equal( enkf_main_get_ensemble_size( enkf_main ) , ens_mask ); - - if (analysis_module_check_option( module , ANALYSIS_NEED_ED)) { - E = obs_data_allocE( obs_data , enkf_main->rng , active_ens_size ); - D = obs_data_allocD( obs_data , E , S ); - - assert_matrix_size( E , "E" , active_size , active_ens_size); - assert_matrix_size( D , "D" , active_size , active_ens_size); - } - - if (analysis_module_check_option( module , ANALYSIS_SCALE_DATA)) - obs_data_scale( obs_data , S , E , D , R , dObs ); - - if (analysis_module_check_option( module , ANALYSIS_USE_A) || analysis_module_check_option(module , ANALYSIS_UPDATE_A)) - localA = A; - - /*****************************************************************/ - - analysis_module_init_update( module , ens_mask , S , R , dObs , E , D ); - { - hash_iter_type * dataset_iter = local_ministep_alloc_dataset_iter( ministep ); - serialize_info_type * serialize_info = serialize_info_alloc( target_fs, //src_fs - we have already copied the parameters from the src_fs to the target_fs - target_fs , - iens_active_index, - target_step , - enkf_main_get_ensemble( enkf_main ) , - run_mode , - step2 , - A , - cpu_threads); - - - // Store PC: - if (analysis_config_get_store_PC( enkf_main->analysis_config )) { - double truncation = -1; - int ncomp = active_ens_size - 1; - matrix_type * PC = matrix_alloc(1,1); - matrix_type * PC_obs = matrix_alloc(1,1); - double_vector_type * singular_values = double_vector_alloc(0,0); - local_obsdata_type * obsdata = local_ministep_get_obsdata( ministep ); - const char * obsdata_name = local_obsdata_get_name( obsdata ); - - enkf_main_get_PC( S , dObs , truncation , ncomp , PC , PC_obs , singular_values); - { - char * filename = util_alloc_sprintf(analysis_config_get_PC_filename( enkf_main->analysis_config ) , step1 , step2 , obsdata_name); - char * full_path = util_alloc_filename( analysis_config_get_PC_path( enkf_main->analysis_config) , filename , NULL ); - - enkf_main_fprintf_PC( full_path , PC , PC_obs); - - free( full_path ); - free( filename ); - } - matrix_free( PC ); - matrix_free( PC_obs ); - double_vector_free( singular_values ); - } - - if (localA == NULL) - analysis_module_initX( module , X , NULL , S , R , dObs , E , D ); - - - while (!hash_iter_is_complete( dataset_iter )) { - const char * dataset_name = hash_iter_get_next_key( dataset_iter ); - const local_dataset_type * dataset = local_ministep_get_dataset( ministep , dataset_name ); - if (local_dataset_get_size( dataset )) { - int * active_size = util_calloc( local_dataset_get_size( dataset ) , sizeof * active_size ); - int * row_offset = util_calloc( local_dataset_get_size( dataset ) , sizeof * row_offset ); - local_obsdata_type * local_obsdata = local_ministep_get_obsdata( ministep ); - - enkf_main_serialize_dataset( enkf_main->ensemble_config , dataset , step2 , use_count , active_size , row_offset , tp , serialize_info); - module_info_type * module_info = enkf_main_module_info_alloc(ministep, obs_data, dataset, local_obsdata, active_size , row_offset); - - if (analysis_module_check_option( module , ANALYSIS_UPDATE_A)){ - if (analysis_module_check_option( module , ANALYSIS_ITERABLE)){ - analysis_module_updateA( module , localA , S , R , dObs , E , D , module_info ); - } - else - analysis_module_updateA( module , localA , S , R , dObs , E , D , module_info ); - } - else { - if (analysis_module_check_option( module , ANALYSIS_USE_A)){ - analysis_module_initX( module , X , localA , S , R , dObs , E , D ); - } - - matrix_inplace_matmul_mt2( A , X , tp ); - } - - // The deserialize also calls enkf_node_store() functions. - enkf_main_deserialize_dataset( enkf_main_get_ensemble_config( enkf_main ) , dataset , active_size , row_offset , serialize_info , tp); - - free( active_size ); - free( row_offset ); - enkf_main_module_info_free( module_info ); - } - } - hash_iter_free( dataset_iter ); - serialize_info_free( serialize_info ); - } - analysis_module_complete_update( module ); - - - /*****************************************************************/ - - int_vector_free(iens_active_index); - matrix_safe_free( E ); - matrix_safe_free( D ); - matrix_free( S ); - matrix_free( R ); - matrix_free( dObs ); - matrix_free( X ); - matrix_free( A ); -} - - - -// Opens and returns a log file. A subroutine of enkf_main_UPDATE. -static FILE * enkf_main_log_step_list(enkf_main_type * enkf_main, const int_vector_type * step_list) { - const char * log_path = analysis_config_get_log_path(enkf_main->analysis_config); - char * log_file; - if (int_vector_size(step_list) == 1) - log_file = util_alloc_sprintf("%s%c%04d", log_path, UTIL_PATH_SEP_CHAR, int_vector_iget(step_list, 0)); - else - log_file = util_alloc_sprintf("%s%c%04d-%04d", log_path, UTIL_PATH_SEP_CHAR, int_vector_iget(step_list, 0), - int_vector_get_last(step_list)); - FILE * log_stream = util_fopen(log_file, "w"); - - free(log_file); - return log_stream; -} - - -/** - * This is THE ENKF update function. It should only be called from enkf_main_UPDATE. - */ -static void enkf_main_update__(enkf_main_type * enkf_main, const int_vector_type * step_list, enkf_fs_type * source_fs, - enkf_fs_type * target_fs, int target_step, run_mode_type run_mode, - const analysis_config_type * analysis_config, const local_updatestep_type * updatestep, - const int total_ens_size) -{ - /* - Observations and measurements are collected in these temporary - structures. obs_data is a precursor for the 'd' vector, and - meas_data is a precursor for the 'S' matrix'. - - The reason for going via these temporary structures is to support - deactivating observations which should not be used in the update - process. - */ - bool_vector_type * ens_mask = bool_vector_alloc(total_ens_size, false); - state_map_type * source_state_map = enkf_fs_get_state_map( source_fs ); - - state_map_select_matching(source_state_map, ens_mask, STATE_HAS_DATA); - { - FILE * log_stream = enkf_main_log_step_list(enkf_main, step_list); - double global_std_scaling = analysis_config_get_global_std_scaling(analysis_config); - meas_data_type * meas_data = meas_data_alloc(ens_mask); - obs_data_type * obs_data = obs_data_alloc(global_std_scaling); - int_vector_type * ens_active_list = bool_vector_alloc_active_list(ens_mask); - - /* - Copy all the parameter nodes from source case to target case; - nodes which are updated will be fetched from the new target - case, and nodes which are not updated will be manually copied - over there. - */ - if (target_fs != source_fs) { - stringlist_type * param_keys = ensemble_config_alloc_keylist_from_var_type(enkf_main->ensemble_config, PARAMETER); - for (int i = 0; i < stringlist_get_size(param_keys); i++) { - const char * key = stringlist_iget(param_keys, i); - enkf_config_node_type * config_node = ensemble_config_get_node(enkf_main->ensemble_config, key); - enkf_node_type * data_node = enkf_node_alloc(config_node); - for (int j = 0; j < int_vector_size(ens_active_list); j++) { - node_id_type node_id = { .iens = int_vector_iget(ens_active_list, j), .report_step = 0 }; - enkf_node_load(data_node, source_fs, node_id); - enkf_node_store(data_node, target_fs, false, node_id); - } - enkf_node_free(data_node); - } - stringlist_free(param_keys); - } - - { - hash_type * use_count = hash_alloc(); - int current_step = int_vector_get_last(step_list); - - - /* Looping over local analysis ministep */ - for (int ministep_nr = 0; ministep_nr < local_updatestep_get_num_ministep(updatestep); ministep_nr++) { - local_ministep_type * ministep = local_updatestep_iget_ministep(updatestep, ministep_nr); - local_obsdata_type * obsdata = local_ministep_get_obsdata(ministep); - - obs_data_reset(obs_data); - meas_data_reset(meas_data); - - /* - Temporarily we will just force the timestep from the input - argument onto the obsdata instance; in the future the - obsdata should hold it's own here. - */ - local_obsdata_reset_tstep_list(obsdata, step_list); - - if (analysis_config_get_std_scale_correlated_obs(enkf_main->analysis_config)) { - double scale_factor = enkf_obs_scale_correlated_std(enkf_main->obs, source_fs, - ens_active_list, obsdata); - ert_log_add_fmt_message(1, NULL, - "Scaling standard deviation in obdsata set:%s with %g", - local_obsdata_get_name(obsdata), scale_factor); - } - enkf_obs_get_obs_and_measure_data(enkf_main->obs, source_fs, obsdata, - ens_active_list, meas_data, obs_data); - - double alpha = analysis_config_get_alpha(enkf_main->analysis_config); - double std_cutoff = analysis_config_get_std_cutoff(enkf_main->analysis_config); - enkf_analysis_deactivate_outliers(obs_data, meas_data, - std_cutoff, alpha, enkf_main->verbose); - - if (enkf_main->verbose) - enkf_analysis_fprintf_obs_summary(obs_data, meas_data, step_list, local_ministep_get_name(ministep), stdout); - enkf_analysis_fprintf_obs_summary(obs_data, meas_data, step_list, local_ministep_get_name(ministep), log_stream); - - if ((obs_data_get_active_size(obs_data) > 0) && (meas_data_get_active_obs_size(meas_data) > 0)) - enkf_main_analysis_update(enkf_main, - target_fs, - ens_mask, - target_step, - use_count, - run_mode, - int_vector_get_first(step_list), - current_step, - ministep, - meas_data, - obs_data); - else if (target_fs != source_fs) - ert_log_add_fmt_message(1, stderr, "No active observations/parameters for MINISTEP: %s.", - local_ministep_get_name(ministep)); - } - - enkf_main_inflate(enkf_main, source_fs, target_fs, current_step, use_count); - hash_free(use_count); - } - - - { - state_map_type * target_state_map = enkf_fs_get_state_map(target_fs); - - if (target_state_map != source_state_map) { - state_map_set_from_inverted_mask(target_state_map, ens_mask, STATE_PARENT_FAILURE); - state_map_set_from_mask(target_state_map, ens_mask, STATE_INITIALIZED); - enkf_fs_fsync(target_fs); - } - } - - int_vector_free(ens_active_list); - obs_data_free(obs_data); - meas_data_free(meas_data); - fclose(log_stream); - } - bool_vector_free( ens_mask); -} - - -/** - * This is T H E EnKF update routine. - */ -bool enkf_main_UPDATE(enkf_main_type * enkf_main , const int_vector_type * step_list, enkf_fs_type * source_fs , enkf_fs_type * target_fs , int target_step , run_mode_type run_mode) { - /* - If merge_observations is true all observations in the time - interval [step1+1,step2] will be used, otherwise only the last - observation at step2 will be used. - */ - - state_map_type * source_state_map = enkf_fs_get_state_map( source_fs ); - const analysis_config_type * analysis_config = enkf_main_get_analysis_config( enkf_main ); - const int active_ens_size = state_map_count_matching( source_state_map , STATE_HAS_DATA ); - const int total_ens_size = enkf_main_get_ensemble_size(enkf_main); - - // exit if not enough realisations - if (!analysis_config_have_enough_realisations(analysis_config , active_ens_size, total_ens_size)) { - fprintf(stderr,"** ERROR ** There are %d active realisations left, which is less than the minimum specified - stopping assimilation.\n" , - active_ens_size ); - return false; - } - - local_config_type * local_config = enkf_main->local_config; - const local_updatestep_type * updatestep = local_config_get_updatestep( local_config ); - - // exit if multi step update - if ((local_updatestep_get_num_ministep( updatestep ) > 1) && - (analysis_config_get_module_option( analysis_config , ANALYSIS_ITERABLE))) { - util_exit("** ERROR: Can not combine iterable modules with multi step updates - sorry\n"); - } - - enkf_main_update__(enkf_main, - step_list, - source_fs, - target_fs, - target_step, - run_mode, - analysis_config, - updatestep, - total_ens_size); - - return true; -} - - - - - - -static bool enkf_main_smoother_update__(enkf_main_type * enkf_main , const int_vector_type * step_list , enkf_fs_type * source_fs, enkf_fs_type * target_fs) { - return enkf_main_UPDATE( enkf_main , step_list , source_fs , target_fs , 0 , SMOOTHER_UPDATE ); -} - - -bool enkf_main_smoother_update(enkf_main_type * enkf_main , enkf_fs_type * source_fs, enkf_fs_type * target_fs) { - int stride = 1; - int step2; - time_map_type * time_map = enkf_fs_get_time_map( source_fs ); - int_vector_type * step_list; - bool update_done; - - step2 = time_map_get_last_step( time_map ); - if (step2 < 0) - step2 = model_config_get_last_history_restart( enkf_main->model_config ); - - step_list = enkf_main_update_alloc_step_list( enkf_main , 0 , step2 , stride); - update_done = enkf_main_smoother_update__( enkf_main , step_list , source_fs, target_fs ); - int_vector_free( step_list ); - - return update_done; -} - - -static void enkf_main_monitor_job_queue ( const enkf_main_type * enkf_main) { - analysis_config_type * analysis_config = enkf_main_get_analysis_config( enkf_main ); - if (analysis_config_get_stop_long_running(analysis_config)) { - job_queue_type * job_queue = site_config_get_job_queue(enkf_main->site_config); - - bool cont = true; - while (cont) { - //Check if minimum number of realizations have run, and if so, kill the rest after a certain time - if (analysis_config_have_enough_realisations(analysis_config, job_queue_get_num_complete(job_queue), enkf_main_get_ensemble_size(enkf_main))) { - job_queue_set_auto_job_stop_time(job_queue); - cont = false; - } - - //Check if all possible successes satisfies the minimum number of realizations threshold. If not so, it is time to give up - int possible_successes = job_queue_get_num_running(job_queue) + - job_queue_get_num_waiting(job_queue) + - job_queue_get_num_pending(job_queue) + - job_queue_get_num_complete(job_queue); - - - if (analysis_config_have_enough_realisations(analysis_config, possible_successes, enkf_main_get_ensemble_size(enkf_main))) { - cont = false; - } - - if (cont) { - util_usleep(10000); - } - } - } -} - - - -void enkf_main_isubmit_job( enkf_main_type * enkf_main , run_arg_type * run_arg ) { - const ecl_config_type * ecl_config = enkf_main_get_ecl_config( enkf_main ); - enkf_state_type * enkf_state = enkf_main->ensemble[ run_arg_get_iens(run_arg) ]; - const member_config_type * member_config = enkf_state_get_member_config( enkf_state ); - const site_config_type * site_config = enkf_main_get_site_config( enkf_main ); - const char * job_script = site_config_get_job_script( site_config ); - job_queue_type * job_queue = site_config_get_job_queue( site_config ); - const char * run_path = run_arg_get_runpath( run_arg ); - - // The job_queue_node will take ownership of this arg_pack; and destroy it when - // the job_queue_node is discarded. - arg_pack_type * callback_arg = arg_pack_alloc(); - - /* - Prepare the job and submit it to the queue - */ - arg_pack_append_ptr( callback_arg , enkf_state ); - arg_pack_append_ptr( callback_arg , run_arg ); - - { - int queue_index = job_queue_add_job( job_queue , - job_script , - enkf_state_complete_forward_modelOK__ , - enkf_state_complete_forward_modelRETRY__ , - enkf_state_complete_forward_modelEXIT__, - callback_arg , - ecl_config_get_num_cpu( ecl_config ), - run_path , - member_config_get_jobname( member_config ) , - 1, - (const char *[1]) { run_path } ); - - run_arg_set_queue_index( run_arg , queue_index ); - run_arg_increase_submit_count( run_arg ); - } - -} - -void * enkf_main_icreate_run_path( enkf_main_type * enkf_main, run_arg_type * run_arg){ - enkf_state_type * enkf_state = enkf_main->ensemble[ run_arg_get_iens(run_arg) ]; - { - runpath_list_type * runpath_list = hook_manager_get_runpath_list( enkf_main->hook_manager ); - runpath_list_add( runpath_list , - run_arg_get_iens( run_arg ), - run_arg_get_iter( run_arg ), - run_arg_get_runpath( run_arg ), - enkf_state_get_eclbase( enkf_state )); - } - enkf_state_init_eclipse( enkf_state , run_arg ); - return NULL; -} - - -static void * enkf_main_create_run_path__( enkf_main_type * enkf_main, - const ert_init_context_type * init_context) { - - const bool_vector_type * iactive = ert_init_context_get_iactive(init_context); - const int active_ens_size = util_int_min( bool_vector_size( iactive ) , enkf_main_get_ensemble_size( enkf_main )); - int iens; - for (iens = 0; iens < active_ens_size; iens++) { - if (bool_vector_iget(iactive , iens)) { - run_arg_type * run_arg = ert_init_context_iens_get_arg( init_context , iens); - enkf_main_icreate_run_path(enkf_main, run_arg); - } - } - return NULL; -} - -void enkf_main_create_run_path(enkf_main_type * enkf_main , const bool_vector_type * iactive , int iter) { - init_mode_type init_mode = INIT_CONDITIONAL; - - enkf_main_init_internalization(enkf_main , init_mode); - { - stringlist_type * param_list = ensemble_config_alloc_keylist_from_var_type( enkf_main->ensemble_config , PARAMETER ); - enkf_main_initialize_from_scratch(enkf_main , - enkf_main_get_fs( enkf_main ), - param_list , - iactive, - init_mode); - stringlist_free( param_list ); - } - - - { - ert_init_context_type * init_context = enkf_main_alloc_ert_init_context( enkf_main , - enkf_main_get_fs( enkf_main ), - iactive , - init_mode , - iter ); - enkf_main_create_run_path__( enkf_main , init_context ); - ert_init_context_free( init_context ); - } - - - /* - The runpath_list is written to disk here, when all the simulation - folders have been created and filled with content. The - runpath_list instance is owned and managed by the hook manager; - could say that the responsability for writing that data should be - with the hook_manager? - */ - - { - runpath_list_type * runpath_list = hook_manager_get_runpath_list(enkf_main->hook_manager ); - runpath_list_fprintf( runpath_list ); - } -} - - - -void * enkf_main_isubmit_job__( void * arg ) { - arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); - enkf_main_type * enkf_main = enkf_main_safe_cast( arg_pack_iget_ptr( arg_pack , 0 )); - run_arg_type * run_arg = run_arg_safe_cast( arg_pack_iget_ptr( arg_pack , 1)); - - enkf_main_isubmit_job( enkf_main , run_arg ); - return NULL; -} - - - - - -static void enkf_main_submit_jobs__( enkf_main_type * enkf_main , - const ert_run_context_type * run_context , - thread_pool_type * submit_threads, - arg_pack_type ** arg_pack_list) { - { - int iens; - const bool_vector_type * iactive = ert_run_context_get_iactive( run_context ); - const int active_ens_size = util_int_min( bool_vector_size( iactive ) , enkf_main_get_ensemble_size( enkf_main )); - - for (iens = 0; iens < active_ens_size; iens++) { - if (bool_vector_iget(iactive , iens)) { - run_arg_type * run_arg = ert_run_context_iens_get_arg( run_context , iens); - arg_pack_type * arg_pack = arg_pack_list[iens]; - - arg_pack_append_ptr( arg_pack , enkf_main ); - arg_pack_append_ptr( arg_pack , run_arg); - - run_arg_set_run_status( run_arg, JOB_SUBMITTED ); - thread_pool_add_job(submit_threads , enkf_main_isubmit_job__ , arg_pack); - } - } - } -} - - -void enkf_main_submit_jobs( enkf_main_type * enkf_main , - const ert_run_context_type * run_context) { - - int ens_size = enkf_main_get_ensemble_size( enkf_main ); - arg_pack_type ** arg_pack_list = util_malloc( ens_size * sizeof * arg_pack_list ); - thread_pool_type * submit_threads = thread_pool_alloc( 4 , true ); - runpath_list_type * runpath_list = hook_manager_get_runpath_list( enkf_main->hook_manager ); - int iens; - for (iens = 0; iens < ens_size; iens++) - arg_pack_list[iens] = arg_pack_alloc( ); - - runpath_list_clear( runpath_list ); - enkf_main_submit_jobs__(enkf_main , run_context , submit_threads , arg_pack_list); - - /* - After this join all directories/files for the simulations - have been set up correctly, and all the jobs have been added - to the job_queue manager. - */ - - thread_pool_join(submit_threads); - thread_pool_free(submit_threads); - - for (iens = 0; iens < ens_size; iens++) - arg_pack_free( arg_pack_list[iens] ); - free( arg_pack_list ); -} - - - -/** - The function will return number of non-failing jobs. -*/ - - -static int enkf_main_run_step(enkf_main_type * enkf_main , - ert_run_context_type * run_context) { - - if (ert_run_context_get_step1(run_context)) - ecl_config_assert_restart( enkf_main_get_ecl_config( enkf_main ) ); - - { - int job_size , iens; - bool verbose_queue = enkf_main->verbose; - const int active_ens_size = util_int_min( bool_vector_size( ert_run_context_get_iactive( run_context )) , enkf_main_get_ensemble_size( enkf_main )); - - state_map_deselect_matching( enkf_fs_get_state_map( ert_run_context_get_init_fs( run_context )) , - ert_run_context_get_iactive( run_context ), STATE_LOAD_FAILURE | STATE_PARENT_FAILURE); - - ert_log_add_fmt_message( 1 , NULL , "===================================================================", false); - - job_size = bool_vector_count_equal( ert_run_context_get_iactive(run_context) , true ); - { - job_queue_type * job_queue = site_config_get_job_queue(enkf_main->site_config); - job_queue_manager_type * queue_manager = job_queue_manager_alloc( job_queue ); - bool restart_queue = true; - - /* Start the queue */ - if (site_config_has_job_script( enkf_main->site_config )) - job_queue_manager_start_queue( queue_manager , job_size , verbose_queue , restart_queue); - else - util_exit("No job script specified, can not start any jobs. Use the key JOB_SCRIPT in the config file\n"); - - - enkf_main_submit_jobs( enkf_main , run_context ); - - - job_queue_submit_complete( job_queue ); - ert_log_add_message( 1 , NULL , "All jobs submitted to internal queue - waiting for completion" , false); - - int max_runtime = analysis_config_get_max_runtime(enkf_main_get_analysis_config( enkf_main )); - job_queue_set_max_job_duration(job_queue, max_runtime); - enkf_main_monitor_job_queue( enkf_main ); - - job_queue_manager_wait( queue_manager ); - job_queue_manager_free( queue_manager ); - } - - - /* This should be carefully checked for the situation where only a - subset (with offset > 0) of realisations are simulated. */ - - int totalOK = 0; - int totalFailed = 0; - for (iens = 0; iens < active_ens_size; iens++) { - if (bool_vector_iget(ert_run_context_get_iactive(run_context) , iens)) { - run_arg_type * run_arg = ert_run_context_iens_get_arg( run_context , iens ); - run_status_type run_status = run_arg_get_run_status( run_arg ); - - if ((run_status == JOB_LOAD_FAILURE) || (run_status == JOB_RUN_FAILURE)) { - ert_run_context_deactivate_realization(run_context, iens); - totalFailed++; - } - else { - totalOK++; - } - } - } - - enkf_fs_fsync( ert_run_context_get_result_fs( run_context ) ); - if (totalFailed == 0) - ert_log_add_fmt_message( 1 , NULL , "All jobs complete and data loaded."); - - - return totalOK; - } -} - -/** - The special value stride == 0 means to just include step2. -*/ -int_vector_type * enkf_main_update_alloc_step_list( const enkf_main_type * enkf_main , int load_start , int step2 , int stride) { - int_vector_type * step_list = int_vector_alloc( 0 , 0 ); - - if (step2 < load_start) - util_abort("%s: fatal internal error: Tried to make step list %d ... %d \n",__func__ , load_start , step2); - - if (stride == 0) - int_vector_append( step_list , step2 ); - else { - int step = util_int_max( 1 , load_start ); - while (true) { - int_vector_append( step_list , step ); - - if (step == step2) - break; - else { - step += stride; - if (step >= step2) { - int_vector_append( step_list , step2 ); - break; - } - } - - } - } - return step_list; -} - - - - -void * enkf_main_get_enkf_config_node_type(const ensemble_config_type * ensemble_config, const char * key){ - enkf_config_node_type * config_node_type = ensemble_config_get_node(ensemble_config, key); - return enkf_config_node_get_ref(config_node_type); -} - - -/** - This function will initialize the necessary enkf_main structures - before a run. Currently this means: - - 1. Set the enkf_sched instance - either by loading from file or - by using the default. - - 2. Set up the configuration of what should be internalized. - -*/ - - -void enkf_main_init_run( enkf_main_type * enkf_main, const ert_run_context_type * run_context, init_mode_type init_mode) { - enkf_main_init_internalization(enkf_main , ert_run_context_get_mode( run_context )); - { - stringlist_type * param_list = ensemble_config_alloc_keylist_from_var_type( enkf_main->ensemble_config , PARAMETER ); - enkf_main_initialize_from_scratch(enkf_main , - ert_run_context_get_init_fs( run_context ), - param_list , - ert_run_context_get_iactive( run_context ), - init_mode); - stringlist_free( param_list ); - } -} - - - - -void enkf_main_run_tui_exp(enkf_main_type * enkf_main , - bool_vector_type * iactive) { - - int active_before = bool_vector_count_equal(iactive, true); - hook_manager_type * hook_manager = enkf_main_get_hook_manager(enkf_main); - ert_run_context_type * run_context; - init_mode_type init_mode = INIT_CONDITIONAL; - int iter = 0; - - run_context = enkf_main_alloc_ert_run_context_ENSEMBLE_EXPERIMENT(enkf_main , - enkf_main_get_fs( enkf_main ) , - iactive , - iter ); - enkf_main_init_run( enkf_main , run_context , init_mode); - enkf_main_create_run_path( enkf_main , iactive , iter ); - hook_manager_run_workflows(hook_manager, PRE_SIMULATION, enkf_main); - enkf_main_run_step(enkf_main , run_context); - - int active_after = bool_vector_count_equal(iactive, true); - if (active_after == active_before) - hook_manager_run_workflows(hook_manager, POST_SIMULATION, enkf_main); - - ert_run_context_free( run_context ); -} - - - - -int enkf_main_run_simple_step(enkf_main_type * enkf_main , bool_vector_type * iactive , init_mode_type init_mode, int iter) { - ert_run_context_type * run_context = enkf_main_alloc_ert_run_context_ENSEMBLE_EXPERIMENT( enkf_main , - enkf_main_get_fs( enkf_main ) , - iactive , - iter ); - enkf_main_init_run( enkf_main , run_context , init_mode); - int successful_realizations = enkf_main_run_step( enkf_main , run_context ); - ert_run_context_free( run_context ); - - return successful_realizations; -} - - - -void enkf_main_run_smoother(enkf_main_type * enkf_main , enkf_fs_type * source_fs, const char * target_fs_name , bool_vector_type * iactive , int iter , bool rerun) { - analysis_config_type * analysis_config = enkf_main_get_analysis_config( enkf_main ); - if (!analysis_config_get_module_option( analysis_config , ANALYSIS_ITERABLE)) { - if (enkf_main_run_simple_step( enkf_main , iactive , INIT_CONDITIONAL, iter)) { - hook_manager_type * hook_manager = enkf_main_get_hook_manager(enkf_main); - hook_manager_run_workflows(hook_manager, POST_SIMULATION, enkf_main); - } - - { - enkf_fs_type * target_fs = enkf_main_mount_alt_fs( enkf_main , target_fs_name , true ); - bool update_done = enkf_main_smoother_update( enkf_main , source_fs , target_fs ); - - if (rerun) { - if (update_done) { - enkf_main_set_fs( enkf_main , target_fs , target_fs_name); - if (enkf_main_run_simple_step(enkf_main , iactive , INIT_NONE, iter + 1)) { - hook_manager_type * hook_manager = enkf_main_get_hook_manager(enkf_main); - hook_manager_run_workflows(hook_manager, POST_SIMULATION, enkf_main); - } - } else - fprintf(stderr,"** Warning: the analysis update failed - no rerun started.\n"); - } - enkf_fs_decref( target_fs ); - - } - } else - fprintf(stderr,"** ERROR: The normal smoother should not be combined with an iterable analysis module\n"); -} - - -static bool enkf_main_run_simulation_and_postworkflow(enkf_main_type * enkf_main, ert_run_context_type * run_context) { - bool ret = true; - analysis_config_type * analysis_config = enkf_main_get_analysis_config(enkf_main); - - int active_after_step = enkf_main_run_step(enkf_main , run_context); - if (analysis_config_have_enough_realisations(analysis_config, active_after_step, enkf_main_get_ensemble_size(enkf_main))) { - hook_manager_type * hook_manager = enkf_main_get_hook_manager(enkf_main); - hook_manager_run_workflows(hook_manager, POST_SIMULATION, enkf_main); - } else { - fprintf(stderr,"Simulation in iteration %d failed, stopping Iterated Ensemble Smoother\n", ert_run_context_get_iter( run_context )); - ret = false; - } - - return ret; -} - - -static bool enkf_main_run_analysis(enkf_main_type * enkf_main, enkf_fs_type * source_fs ,const char * target_fs_name, int iteration_number) { - bool updateOK = false; - analysis_config_type * analysis_config = enkf_main_get_analysis_config(enkf_main); - analysis_module_type * analysis_module = analysis_config_get_active_module(analysis_config); - int pre_iteration_number = analysis_module_get_int(analysis_module, "ITER"); - - if (target_fs_name == NULL){ - fprintf(stderr,"Sorry: the updated ensemble will overwrite the current case in the iterated ensemble smoother."); - printf("Running analysis on case %s, target case is %s\n", enkf_main_get_current_fs(enkf_main), enkf_main_get_current_fs(enkf_main)); - updateOK = enkf_main_smoother_update(enkf_main, source_fs, enkf_main_get_fs(enkf_main)); - } else { - enkf_fs_type * target_fs = enkf_main_mount_alt_fs(enkf_main , target_fs_name , true ); - updateOK = enkf_main_smoother_update(enkf_main, source_fs , target_fs); - enkf_fs_decref( target_fs ); - } - - int post_iteration_number = analysis_module_get_int(analysis_module, "ITER"); - - if (post_iteration_number <= pre_iteration_number) - updateOK = false; - - if (updateOK) { - enkf_fs_type * target_fs = enkf_main_mount_alt_fs(enkf_main , target_fs_name , true ); - cases_config_set_int(enkf_fs_get_cases_config(target_fs), "iteration_number", iteration_number+1); - enkf_fs_decref( target_fs ); - } - - return updateOK; -} - - -void enkf_main_run_iterated_ES(enkf_main_type * enkf_main, int num_iterations_to_run) { - const analysis_config_type * analysis_config = enkf_main_get_analysis_config(enkf_main); - - if (analysis_config_get_module_option( analysis_config , ANALYSIS_ITERABLE)) { - const int ens_size = enkf_main_get_ensemble_size(enkf_main); - bool_vector_type * iactive = bool_vector_alloc(ens_size , true); - enkf_fs_type * current_case = enkf_main_get_fs( enkf_main ); - analysis_iter_config_type * iter_config = analysis_config_get_iter_config(analysis_config); - int current_iteration = 0; - const char * initial_case_name = analysis_iter_config_iget_case( iter_config , current_iteration ); - - if (!util_string_equal( initial_case_name , enkf_fs_get_case_name( current_case ))) { - enkf_fs_type * initial_case = enkf_main_mount_alt_fs( enkf_main , initial_case_name , true); - enkf_main_init_case_from_existing(enkf_main, current_case, 0, initial_case); // ANALYZED argument removed. - enkf_main_set_fs( enkf_main , initial_case , NULL ); - enkf_fs_decref( initial_case ); - } - - { //Iteration 0 - ert_run_context_type * run_context = NULL; - enkf_main_init_run(enkf_main , run_context , INIT_CONDITIONAL ); - enkf_main_run_simulation_and_postworkflow(enkf_main, run_context); - ert_run_context_free( run_context ); - } - - { // Iteration 1 - num_iterations [iteration 1, num iterations] - int num_retries_per_iteration = analysis_iter_config_get_num_retries_per_iteration(iter_config); - int num_tries = 0; - enkf_fs_type * source_fs = enkf_main_get_fs( enkf_main ); - current_iteration = 1; - - while ((current_iteration <= num_iterations_to_run) && (num_tries < num_retries_per_iteration)) { - ert_run_context_type * run_context = NULL; - - const char * target_fs_name = analysis_iter_config_iget_case( iter_config , current_iteration ); - - if (enkf_main_run_analysis(enkf_main, source_fs, target_fs_name, current_iteration)) { - enkf_main_select_fs(enkf_main, target_fs_name); - if (!enkf_main_run_simulation_and_postworkflow(enkf_main, run_context )) - break; - num_tries = 0; - ++current_iteration; - } else { - fprintf(stderr, "\nAnalysis failed, rerunning simulation on changed initial parameters\n"); - enkf_fs_type * target_fs = enkf_main_mount_alt_fs( enkf_main , target_fs_name , false ); - enkf_main_init_current_case_from_existing(enkf_main, target_fs, 0); // ANALYZED argument removed - enkf_fs_decref(target_fs); - ++num_tries; - - if (!enkf_main_run_simulation_and_postworkflow(enkf_main, run_context )) - //if (!enkf_main_run_simulation_and_postworkflow(enkf_main, current_iteration-1, iactive)) - break; - } - - ert_run_context_free( run_context ); - } - } - - bool_vector_free(iactive); - } else - fprintf(stderr,"** ERROR: The current analysis module:%s can not be used for iterations \n", analysis_config_get_active_module_name( analysis_config )); -} - - -ert_run_context_type * enkf_main_alloc_ert_run_context_ENSEMBLE_EXPERIMENT(const enkf_main_type * enkf_main , enkf_fs_type * fs , bool_vector_type * iactive , int iter) { - return ert_run_context_alloc_ENSEMBLE_EXPERIMENT( fs , iactive , model_config_get_runpath_fmt( enkf_main->model_config ) , enkf_main->subst_list , iter ); -} - -ert_init_context_type * enkf_main_alloc_ert_init_context(const enkf_main_type * enkf_main , enkf_fs_type * fs, const bool_vector_type * iactive , init_mode_type init_mode , int iter) { - return ert_init_context_alloc( fs, iactive , model_config_get_runpath_fmt( enkf_main->model_config ) , enkf_main->subst_list , init_mode , iter ); -} - - - - -/** - This function creates a local_config file corresponding to the - default 'ALL_ACTIVE' configuration. We eat our own dogshit around - here... -*/ - -void enkf_main_create_all_active_config( const enkf_main_type * enkf_main) { - - - bool single_node_update = analysis_config_get_single_node_update( enkf_main->analysis_config ); - local_config_type * local_config = enkf_main->local_config; - local_config_clear( local_config ); - { - local_updatestep_type * default_step = local_config_get_updatestep(local_config); - local_ministep_type * ministep = local_config_alloc_ministep( local_config , "ALL_ACTIVE", NULL); - local_obsdata_type * obsdata = local_config_alloc_obsdata(local_config, "ALL_OBS"); - local_dataset_type * all_active_dataset = local_config_alloc_dataset(local_config, "ALL_DATA"); - - local_updatestep_add_ministep( default_step , ministep ); - - /* Adding all observation keys */ - { - hash_iter_type * obs_iter = enkf_obs_alloc_iter( enkf_main->obs ); - while ( !hash_iter_is_complete(obs_iter) ) { - const char * obs_key = hash_iter_get_next_key( obs_iter ); - local_obsdata_node_type * obsdata_node = local_obsdata_node_alloc( obs_key , true ); - local_obsdata_add_node(obsdata, obsdata_node ); - } - local_ministep_add_obsdata(ministep, obsdata); - hash_iter_free( obs_iter ); - } - - /* Adding all node which can be updated. */ - { - stringlist_type * keylist = ensemble_config_alloc_keylist_from_var_type( enkf_main->ensemble_config , PARAMETER); - int i; - for (i = 0; i < stringlist_get_size( keylist ); i++) { - const char * key = stringlist_iget( keylist , i); - bool add_node = true; - - /* - Make sure the funny GEN_KW instance masquerading as - SCHEDULE_PREDICTION_FILE is not added to the soup. - */ - if (util_string_equal(key , "PRED")) - add_node = false; - - - if (add_node) { - if (single_node_update) { - local_dataset_type * this_dataset = local_config_alloc_dataset(local_config, key); - local_dataset_add_node(this_dataset, key); - local_ministep_add_dataset(ministep, this_dataset); - } - local_dataset_add_node(all_active_dataset, key); - } - } - stringlist_free( keylist); - } - if (!single_node_update) - local_ministep_add_dataset(ministep, all_active_dataset); - - } -} - - -static void enkf_main_user_config_deprecate( config_parser_type * config ) -{ - config_parser_deprecate( config , "MAX_RUNNING_LSF" , "MAX_RUNNING_LSF is deprecated. Use the general QUEUE_OPTION LSF MAX_RUNNING instead."); - config_parser_deprecate( config , "MAX_RUNNING_LOCAL" , "MAX_RUNNING_LOCAL is deprecated. Use the general QUEUE_OPTION LOCAL MAX_RUNNING instead."); - config_parser_deprecate( config , "MAX_RUNNING_RSH" , "MAX_RUNNING_RSH is deprecated. Use the general QUEUE_OPTION RSH MAX_RUNNING instead."); -} - - -static void enkf_main_init_user_config( const enkf_main_type * enkf_main , config_parser_type * config ) { - config_schema_item_type * item; - - /*****************************************************************/ - /* config_add_schema_item(): */ - /* */ - /* 1. boolean - required? */ - /*****************************************************************/ - - ert_workflow_list_add_config_items( config ); - plot_settings_add_config_items( config ); - analysis_config_add_config_items( config ); - ensemble_config_add_config_items( config ); - ecl_config_add_config_items( config ); - rng_config_add_config_items( config ); - - /*****************************************************************/ - /* Required keywords from the ordinary model_config file */ - - item = config_add_schema_item(config , CASE_TABLE_KEY , false ); - config_schema_item_set_argc_minmax(item , 1 , 1); - config_schema_item_iset_type( item , 0 , CONFIG_EXISTING_PATH ); - - config_add_key_value( config , LOG_LEVEL_KEY , false , CONFIG_INT); - config_add_key_value( config , LOG_FILE_KEY , false , CONFIG_STRING); - - config_add_key_value(config , MAX_RESAMPLE_KEY , false , CONFIG_INT); - - - item = config_add_schema_item(config , NUM_REALIZATIONS_KEY , true ); - config_schema_item_set_argc_minmax(item , 1 , 1); - config_schema_item_iset_type( item , 0 , CONFIG_INT ); - config_add_alias(config , NUM_REALIZATIONS_KEY , "SIZE"); - config_add_alias(config , NUM_REALIZATIONS_KEY , "NUM_REALISATIONS"); - config_install_message(config , "SIZE" , "** Warning: \'SIZE\' is depreceated - use \'NUM_REALIZATIONS\' instead."); - - - /*****************************************************************/ - /* Optional keywords from the model config file */ - - item = config_add_schema_item( config , RUN_TEMPLATE_KEY , false ); - config_schema_item_set_argc_minmax(item , 2 , CONFIG_DEFAULT_ARG_MAX ); - config_schema_item_iset_type( item , 0 , CONFIG_EXISTING_PATH ); - - config_add_key_value(config , RUNPATH_KEY , false , CONFIG_STRING); - - item = config_add_schema_item(config , ENSPATH_KEY , false ); - config_schema_item_set_argc_minmax(item , 1 , 1 ); - - item = config_add_schema_item( config , JOBNAME_KEY , false ); - config_schema_item_set_argc_minmax(item , 1 , 1 ); - - item = config_add_schema_item(config , DBASE_TYPE_KEY , false ); - config_schema_item_set_argc_minmax(item , 1, 1 ); - config_schema_item_set_common_selection_set(item , 2 , (const char *[2]) {"PLAIN" , "BLOCK_FS"}); - - item = config_add_schema_item(config , FORWARD_MODEL_KEY , false ); - config_schema_item_set_argc_minmax(item , 1 , CONFIG_DEFAULT_ARG_MAX); - - item = config_add_schema_item(config , DATA_KW_KEY , false ); - config_schema_item_set_argc_minmax(item , 2 , 2); - - config_add_key_value(config , PRE_CLEAR_RUNPATH_KEY , false , CONFIG_BOOL); - - item = config_add_schema_item(config , DELETE_RUNPATH_KEY , false ); - config_schema_item_set_argc_minmax(item , 1 , CONFIG_DEFAULT_ARG_MAX); - - item = config_add_schema_item(config , OBS_CONFIG_KEY , false ); - config_schema_item_set_argc_minmax(item , 1 , 1 ); - config_schema_item_iset_type( item , 0 , CONFIG_EXISTING_PATH ); - - config_add_key_value(config , TIME_MAP_KEY , false , CONFIG_EXISTING_PATH); - - item = config_add_schema_item(config , RFT_CONFIG_KEY , false ); - config_schema_item_set_argc_minmax(item , 1 , 1 ); - config_schema_item_iset_type( item , 0 , CONFIG_EXISTING_PATH ); - - item = config_add_schema_item(config , RFTPATH_KEY , false ); - config_schema_item_set_argc_minmax(item , 1 , 1 ); - - item = config_add_schema_item(config, GEN_KW_EXPORT_FILE_KEY, false ); - config_schema_item_set_argc_minmax(item , 1 , 1 ); - - item = config_add_schema_item(config , LOCAL_CONFIG_KEY , false ); - config_schema_item_set_argc_minmax(item , 1 , 1 ); - config_schema_item_iset_type( item , 0 , CONFIG_EXISTING_PATH ); - - { - stringlist_type * refcase_dep = stringlist_alloc_argv_ref( (const char *[1]) { REFCASE_KEY } , 1); - - item = config_add_schema_item(config , HISTORY_SOURCE_KEY , false ); - config_schema_item_set_argc_minmax(item , 1 , 1); - config_schema_item_set_common_selection_set(item , 3 , (const char *[3]) {"SCHEDULE" , "REFCASE_SIMULATED" , "REFCASE_HISTORY"}); - config_schema_item_set_required_children_on_value(item , "REFCASE_SIMULATED" , refcase_dep); - config_schema_item_set_required_children_on_value(item , "REFCASE_HISTORY" , refcase_dep); - - stringlist_free(refcase_dep); - } - - hook_manager_add_config_items( config ); -} - - -keep_runpath_type enkf_main_iget_keep_runpath( const enkf_main_type * enkf_main , int iens ) { - return enkf_state_get_keep_runpath( enkf_main->ensemble[iens] ); -} - -void enkf_main_iset_keep_runpath( enkf_main_type * enkf_main , int iens , keep_runpath_type keep_runpath) { - enkf_state_set_keep_runpath( enkf_main->ensemble[iens] , keep_runpath); -} - -void enkf_main_set_verbose( enkf_main_type * enkf_main , bool verbose) { - enkf_main->verbose = verbose; -} - - -bool enkf_main_get_verbose( const enkf_main_type * enkf_main ) { - return enkf_main->verbose; -} - -/** - Observe that this function parses and TEMPORARILY stores the keep_runpath - information ion the enkf_main object. This is subsequently passed on the - enkf_state members, and the functions enkf_main_iget_keep_runpath() and - enkf_main_iset_keep_runpath() act on the enkf_state objects, and not on the - internal keep_runpath field of the enkf_main object (what a fxxxing mess). -*/ - - -void enkf_main_parse_keep_runpath(enkf_main_type * enkf_main , const char * delete_runpath_string , int ens_size ) { - - int i; - for (i = 0; i < ens_size; i++) - int_vector_iset( enkf_main->keep_runpath , i , DEFAULT_KEEP); - - { - int_vector_type * active_list = string_util_alloc_active_list(delete_runpath_string); - - for (i = 0; i < int_vector_size( active_list ); i++) - int_vector_iset( enkf_main->keep_runpath , int_vector_iget( active_list , i ) , EXPLICIT_DELETE); - - int_vector_free( active_list ); - } -} - - - -/** - There is NO tagging anymore - if the user wants tags - the user - supplies the key __WITH__ tags. -*/ -void enkf_main_add_data_kw(enkf_main_type * enkf_main , const char * key , const char * value) { - subst_list_append_copy( enkf_main->subst_list , key , value , "Supplied by the user in the configuration file."); -} - - -void enkf_main_data_kw_fprintf_config( const enkf_main_type * enkf_main , FILE * stream ) { - for (int i = 0; i < subst_list_get_size( enkf_main->subst_list ); i++) { - fprintf(stream , CONFIG_KEY_FORMAT , DATA_KW_KEY ); - fprintf(stream , CONFIG_VALUE_FORMAT , subst_list_iget_key( enkf_main->subst_list , i )); - fprintf(stream , CONFIG_ENDVALUE_FORMAT , subst_list_iget_value( enkf_main->subst_list , i )); - } -} - - -void enkf_main_clear_data_kw( enkf_main_type * enkf_main ) { - subst_list_clear( enkf_main->subst_list ); -} - -static void enkf_main_add_subst_kw( enkf_main_type * enkf_main , const char * key , const char * value, const char * help_text , bool insert_copy) { - char * tagged_key = util_alloc_sprintf( INTERNAL_DATA_KW_TAG_FORMAT , key ); - - if (insert_copy) - subst_list_append_owned_ref( enkf_main->subst_list , tagged_key , util_alloc_string_copy( value ), help_text); - else - subst_list_append_ref( enkf_main->subst_list , tagged_key , value , help_text); - - free(tagged_key); -} - - -static void enkf_main_init_hook_manager( enkf_main_type * enkf_main , config_content_type * config ) { - hook_manager_init( enkf_main->hook_manager , config ); -} - -static void enkf_main_init_subst_list( enkf_main_type * enkf_main ) { - /* Here we add the functions which should be available for string substitution operations. */ - subst_func_pool_add_func( enkf_main->subst_func_pool , "EXP" , "exp" , subst_func_exp , false , 1 , 1 , NULL); - subst_func_pool_add_func( enkf_main->subst_func_pool , "LOG" , "log" , subst_func_log , false , 1 , 1 , NULL); - subst_func_pool_add_func( enkf_main->subst_func_pool , "POW10" , "Calculates 10^x" , subst_func_pow10 , false , 1 , 1 , NULL); - subst_func_pool_add_func( enkf_main->subst_func_pool , "ADD" , "Adds arguments" , subst_func_add , true , 1 , 0 , NULL); - subst_func_pool_add_func( enkf_main->subst_func_pool , "MUL" , "Multiplies arguments" , subst_func_mul , true , 1 , 0 , NULL); - subst_func_pool_add_func( enkf_main->subst_func_pool , "RANDINT" , "Returns a random integer - 32 bit" , subst_func_randint , false , 0 , 0 , enkf_main->rng); - subst_func_pool_add_func( enkf_main->subst_func_pool , "RANDFLOAT" , "Returns a random float 0-1." , subst_func_randfloat , false , 0 , 0 , enkf_main->rng); - - /** - Allocating the parent subst_list instance. This will (should ...) - be the top level subst instance for all substitions in the ert - program. - - All the functions available or only installed in this - subst_list. - - The key->value replacements installed in this instance are - key,value pairs which are: - - o Common to all ensemble members. - - o Constant in time. - */ - - - /* Installing the functions. */ - subst_list_insert_func( enkf_main->subst_list , "EXP" , "__EXP__"); - subst_list_insert_func( enkf_main->subst_list , "LOG" , "__LOG__"); - subst_list_insert_func( enkf_main->subst_list , "POW10" , "__POW10__"); - subst_list_insert_func( enkf_main->subst_list , "ADD" , "__ADD__"); - subst_list_insert_func( enkf_main->subst_list , "MUL" , "__MUL__"); - subst_list_insert_func( enkf_main->subst_list , "RANDINT" , "__RANDINT__"); - subst_list_insert_func( enkf_main->subst_list , "RANDFLOAT" , "__RANDFLOAT__"); -} - - - -enkf_main_type * enkf_main_alloc_empty( ) { - enkf_main_type * enkf_main = util_malloc(sizeof * enkf_main); - UTIL_TYPE_ID_INIT(enkf_main , ENKF_MAIN_ID); - ert_log_open_empty(); - enkf_main->ensemble = NULL; - enkf_main->user_config_file = NULL; - enkf_main->site_config_file = NULL; - enkf_main->rft_config_file = NULL; - enkf_main->local_config = NULL; - enkf_main->rng = NULL; - enkf_main->ens_size = 0; - enkf_main->keep_runpath = int_vector_alloc( 0 , DEFAULT_KEEP ); - enkf_main->rng_config = rng_config_alloc( ); - enkf_main->site_config = site_config_alloc_empty(); - enkf_main->ensemble_config = ensemble_config_alloc(); - enkf_main->ecl_config = ecl_config_alloc(); - enkf_main->ranking_table = ranking_table_alloc( 0 ); - enkf_main->obs = NULL; - enkf_main->model_config = model_config_alloc( ); - enkf_main->local_config = local_config_alloc( ); - - enkf_main->plot_config = config_settings_alloc( PLOT_SETTING_KEY ); - plot_settings_init( enkf_main->plot_config ); - - enkf_main_rng_init( enkf_main ); - enkf_main->subst_func_pool = subst_func_pool_alloc( ); - enkf_main->subst_list = subst_list_alloc( enkf_main->subst_func_pool ); - enkf_main->templates = ert_templates_alloc( enkf_main->subst_list ); - enkf_main->workflow_list = ert_workflow_list_alloc( enkf_main->subst_list ); - enkf_main->hook_manager = hook_manager_alloc( enkf_main->workflow_list ); - enkf_main->analysis_config = analysis_config_alloc( enkf_main->rng ); - - enkf_main_init_subst_list( enkf_main ); - enkf_main_set_verbose( enkf_main , true ); - enkf_main_init_fs( enkf_main ); - return enkf_main; -} - - - - - -static void enkf_main_install_data_kw( enkf_main_type * enkf_main , hash_type * config_data_kw) { - /* - Installing the DATA_KW keywords supplied by the user - these are - at the very top level, so they can reuse everything defined later. - */ - if (config_data_kw) { - hash_iter_type * iter = hash_iter_alloc(config_data_kw); - const char * key = hash_iter_get_next_key(iter); - while (key != NULL) { - enkf_main_add_data_kw( enkf_main , key , hash_get( config_data_kw , key )); - key = hash_iter_get_next_key(iter); - } - hash_iter_free(iter); - } -} - - - -static void enkf_main_install_common_data_kw( enkf_main_type * enkf_main ) { - /* - Installing the based (key,value) pairs which are common to all - ensemble members, and independent of time. - */ - char * cwd = util_alloc_cwd(); - char * date_string = util_alloc_date_stamp_utc(); - const char * num_cpu_string = "1"; - - enkf_main_add_subst_kw( enkf_main , "CWD" , cwd , "The current working directory we are running from - the location of the config file." , true); - enkf_main_add_subst_kw( enkf_main , "CONFIG_PATH" , cwd , "The current working directory we are running from - the location of the config file." , true); - enkf_main_add_subst_kw( enkf_main , "DATE" , date_string , "The current date." , true); - enkf_main_add_subst_kw( enkf_main , "NUM_CPU" , num_cpu_string , "The number of CPU used for one forward model." , true ); - enkf_main_add_subst_kw( enkf_main , "RUNPATH_FILE" , hook_manager_get_runpath_list_file( enkf_main->hook_manager ) , "The name of a file with a list of run directories." , true); - - free( cwd ); - free( date_string ); -} - - - -runpath_list_type * enkf_main_get_runpath_list( const enkf_main_type * enkf_main ) { - return hook_manager_get_runpath_list( enkf_main->hook_manager ); -} - - -/** - This function will resize the enkf_main->ensemble vector, - allocating or freeing enkf_state instances as needed. -*/ - - -void enkf_main_resize_ensemble( enkf_main_type * enkf_main , int new_ens_size ) { - int iens; - - /* No change */ - if (new_ens_size == enkf_main->ens_size) - return ; - - ranking_table_set_ens_size( enkf_main->ranking_table , new_ens_size ); - /* Tell the site_config object (i.e. the queue drivers) about the new ensemble size: */ - site_config_set_ens_size( enkf_main->site_config , new_ens_size ); - - - /* The ensemble is shrinking. */ - if (new_ens_size < enkf_main->ens_size) { - /*1: Free all ensemble members which go out of scope. */ - for (iens = new_ens_size; iens < enkf_main->ens_size; iens++) - enkf_state_free( enkf_main->ensemble[iens] ); - - /*2: Shrink the ensemble pointer. */ - enkf_main->ensemble = util_realloc(enkf_main->ensemble , new_ens_size * sizeof * enkf_main->ensemble ); - enkf_main->ens_size = new_ens_size; - return; - } - - - /* The ensemble is expanding */ - if (new_ens_size > enkf_main->ens_size) { - /*1: Grow the ensemble pointer. */ - enkf_main->ensemble = util_realloc(enkf_main->ensemble , new_ens_size * sizeof * enkf_main->ensemble ); - - /*2: Allocate the new ensemble members. */ - for (iens = enkf_main->ens_size; iens < new_ens_size; iens++) - - /* Observe that due to the initialization of the rng - this function is currently NOT thread safe. */ - enkf_main->ensemble[iens] = enkf_state_alloc(iens, - enkf_main->rng , - model_config_iget_casename( enkf_main->model_config , iens ) , - enkf_main->pre_clear_runpath , - int_vector_safe_iget( enkf_main->keep_runpath , iens) , - enkf_main->model_config , - enkf_main->ensemble_config , - enkf_main->site_config , - enkf_main->ecl_config , - enkf_main->templates , - enkf_main->subst_list); - enkf_main->ens_size = new_ens_size; - return; - } - - util_abort("%s: something is seriously broken - should NOT be here .. \n",__func__); -} - - -void enkf_main_add_node(enkf_main_type * enkf_main, enkf_config_node_type * enkf_config_node) { - for (int iens = 0; iens < enkf_main_get_ensemble_size(enkf_main); iens++) { - - enkf_state_add_node(enkf_main->ensemble[iens], enkf_config_node_get_key(enkf_config_node), enkf_config_node); - } -} - - - -void enkf_main_update_node( enkf_main_type * enkf_main , const char * key ) { - int iens; - for (iens = 0; iens < enkf_main->ens_size; iens++) - enkf_state_update_node( enkf_main->ensemble[iens] , key ); -} - - - - - - - - - - - - - - -/******************************************************************/ - -/** - SCHEDULE_PREDICTION_FILE. - - The SCHEDULE_PREDICTION_FILE is implemented as a GEN_KW instance, - with some twists. Observe the following: - - 1. The SCHEDULE_PREDICTION_FILE is added to the ensemble_config - as a GEN_KW node with key 'PRED'. - - 2. The target file is set equal to the initial prediction file - (i.e. the template in this case), NOT including any path - components. - -*/ - - -void enkf_main_set_schedule_prediction_file__( enkf_main_type * enkf_main , const char * template_file , const char * parameters , const char * min_std , const char * init_file_fmt) { - const char * key = "PRED"; - /* - First remove/delete existing PRED node if it is already installed. - */ - if (ensemble_config_has_key( enkf_main->ensemble_config , key)) - enkf_main_del_node( enkf_main , key ); - - if (template_file != NULL) { - char * target_file; - bool forward_init = false; - enkf_config_node_type * config_node = ensemble_config_add_gen_kw( enkf_main->ensemble_config , key , forward_init); - { - char * base; - char * ext; - util_alloc_file_components( template_file , NULL , &base , &ext); - target_file = util_alloc_filename(NULL , base , ext ); - util_safe_free( base ); - util_safe_free( ext ); - } - enkf_config_node_update_gen_kw( config_node , target_file , template_file , parameters , min_std , init_file_fmt ); - free( target_file ); - ecl_config_set_schedule_prediction_file( enkf_main->ecl_config , template_file ); - } -} - - -void enkf_main_set_schedule_prediction_file( enkf_main_type * enkf_main , const char * schedule_prediction_file) { - enkf_main_set_schedule_prediction_file__(enkf_main , schedule_prediction_file , NULL , NULL , NULL ); -} - - -const char * enkf_main_get_schedule_prediction_file( const enkf_main_type * enkf_main ) { - return ecl_config_get_schedule_prediction_file( enkf_main->ecl_config ); -} - - - -/*****************************************************************/ - -static void enkf_main_init_data_kw( enkf_main_type * enkf_main , config_content_type * config ) { - { - const subst_list_type * define_list = config_content_get_define_list( config ); - for (int i=0; i < subst_list_get_size( define_list ); i++) { - const char * key = subst_list_iget_key( define_list , i ); - const char * value = subst_list_iget_value( define_list , i ); - enkf_main_add_data_kw( enkf_main , key , value ); - } - } - - if (config_content_has_item( config , DATA_KW_KEY)) { - config_content_item_type * data_item = config_content_get_item( config , DATA_KW_KEY ); - hash_type * data_kw = config_content_item_alloc_hash(data_item , true); - enkf_main_install_data_kw( enkf_main , data_kw ); - hash_free( data_kw ); - } - - enkf_main_install_common_data_kw( enkf_main ); -} - - - - - -/*****************************************************************/ - - -rng_config_type * enkf_main_get_rng_config( const enkf_main_type * enkf_main ) { - return enkf_main->rng_config; -} - - -void enkf_main_rng_init( enkf_main_type * enkf_main) { - if (enkf_main->rng != NULL) - rng_config_init_rng(enkf_main->rng_config, enkf_main->rng); - else - enkf_main->rng = rng_config_alloc_init_rng( enkf_main->rng_config ); -} - - -void enkf_main_update_local_updates( enkf_main_type * enkf_main) { - const enkf_obs_type * enkf_obs = enkf_main_get_obs( enkf_main ); - if (enkf_obs_have_obs( enkf_obs )) { - /* First create the default ALL_ACTIVE configuration. */ - enkf_main_create_all_active_config( enkf_main ); - } -} - -static char * __enkf_main_alloc_user_config_file(const enkf_main_type * enkf_main, bool base_only) { - char * base_name; - char * extension; - util_alloc_file_components(enkf_main_get_user_config_file(enkf_main), NULL, &base_name, &extension); - - char * config_file; - if (base_only) { - config_file = util_alloc_filename(NULL, base_name, NULL);; - } else { - config_file = util_alloc_filename(NULL, base_name, extension); - } - - free(base_name); - free(extension); - return config_file; -} - -static hash_type *__enkf_main_alloc_predefined_kw_map(const enkf_main_type *enkf_main) { - char * config_file_base = __enkf_main_alloc_user_config_file(enkf_main, true); - char * config_file = __enkf_main_alloc_user_config_file(enkf_main, false); - hash_type * pre_defined_kw_map = hash_alloc(); - - hash_insert_string(pre_defined_kw_map, "", config_file); - hash_insert_string(pre_defined_kw_map, "", config_file_base); - - free( config_file ) ; - free( config_file_base ); - return pre_defined_kw_map; -} - - -/** - Observe that the site-config initializations starts with chdir() to - the location of the site_config_file; this ensures that the - site_config can contain relative paths to job description files and - scripts. -*/ - - -static void enkf_main_bootstrap_site(enkf_main_type * enkf_main , const char * site_config_file) { - if (site_config_file != NULL) { - if (!util_file_exists(site_config_file)) util_exit("%s: can not locate site configuration file:%s \n",__func__ , site_config_file); - config_parser_type * config = config_alloc(); - site_config_add_config_items( config , true ); - { - config_content_type * content = config_parse(config , site_config_file , "--" , INCLUDE_KEY , DEFINE_KEY , NULL, CONFIG_UNRECOGNIZED_WARN , false); - if (config_content_is_valid( content )) { - site_config_init( enkf_main->site_config , content ); - analysis_config_load_all_external_modules_from_config(enkf_main->analysis_config, content); - ert_workflow_list_init( enkf_main->workflow_list , content ); - } else { - config_error_type * errors = config_content_get_errors( content ); - fprintf(stderr , "** ERROR: Parsing site configuration file:%s failed \n\n" , site_config_file); - config_error_fprintf( errors , true , stderr ); - exit(1); - } - config_content_free( content ); - } - config_free( config ); - } -} - - -/** - This function boots everything needed for running a EnKF - application. Very briefly it can be summarized as follows: - - 1. A large config object is initalized with all the possible - keywords we are looking for. - - 2. All the config files are parsed in one go. - - 3. The various objects are build up by reading from the config - object. - - 4. The resulting enkf_main object contains *EVERYTHING* - (whoaha...) - - - Observe that the function will start with chdir() to the directory - containing the configuration file, so that all subsequent file - references are relative to the location of the configuration - file. This also applies if the command_line argument given is a - symlink. - - - If the parameter @strict is set to false a configuration with some - missing parameters will validate; this is to support bootstrapping - from a minimal configuration created by the GUI. The parameters - which become optional in a non-strict mode are: - - FORWARD_MODEL - DATA_FILE - SCHEDULE_FILE - ECLBASE - -*/ - - -/** - It is possible to pass NULL as the model_config argument, in that - case only the site config file will be parsed. The purpose of this - is mainly to be able to test that the site config file is valid. -*/ - - -enkf_main_type * enkf_main_bootstrap(const char * _model_config, bool strict , bool verbose) { - const char * site_config = site_config_get_location(); - char * model_config = NULL; - enkf_main_type * enkf_main; /* The enkf_main object is allocated when the config parsing is completed. */ - - if (_model_config) { - { - char * path; - char * base; - char * ext; - if (util_is_link( _model_config )) { /* The command line argument given is a symlink - we start by changing to */ - /* the real location of the configuration file. */ - char * realpath = util_alloc_link_target( _model_config ); - util_alloc_file_components(realpath , &path , &base , &ext); - free( realpath ); - } else - util_alloc_file_components(_model_config , &path , &base , &ext); - - if (path != NULL) { - if (util_chdir(path) != 0) - util_abort("%s: failed to change directory to: %s : %s \n",__func__ , path , strerror(errno)); - - if (verbose) - printf("Changing to directory ...................: %s \n",path); - - if (ext != NULL) - model_config = util_alloc_filename( NULL , base , ext ); - else - model_config = util_alloc_string_copy( base ); - } else - model_config = util_alloc_string_copy(_model_config); - - util_safe_free( path ); - util_safe_free( base ); - util_safe_free( ext ); - } - - if (!util_file_exists(model_config)) - util_exit("%s: can not locate user configuration file:%s \n",__func__ , model_config); - } - - - { - config_parser_type * config; - config_content_type * content; - enkf_main = enkf_main_alloc_empty( ); - enkf_main_set_verbose( enkf_main , verbose ); - enkf_main_bootstrap_site( enkf_main , site_config); - - if (model_config) { - enkf_main_set_site_config_file( enkf_main , site_config ); - enkf_main_set_user_config_file( enkf_main , model_config ); - - config = config_alloc(); - enkf_main_init_user_config( enkf_main , config ); - site_config_add_config_items( config , false ); - site_config_init_user_mode( enkf_main->site_config ); - enkf_main_user_config_deprecate( config ); - - { - hash_type *pre_defined_kw_map = __enkf_main_alloc_predefined_kw_map(enkf_main); - content = config_parse(config , model_config , "--" , INCLUDE_KEY , DEFINE_KEY , pre_defined_kw_map, CONFIG_UNRECOGNIZED_WARN , true); - hash_free(pre_defined_kw_map); - } - - { - const stringlist_type * warnings = config_content_get_warnings( content ); - if (stringlist_get_size( warnings ) > 0) { - fprintf(stderr," ** There were warnings when parsing the configuration file: %s" , model_config ); - for (int i=0; i < stringlist_get_size( warnings ); i++) - fprintf(stderr, " %02d : %s \n",i , stringlist_iget( warnings , i )); - } - } - - if (!config_content_is_valid( content )) { - config_error_type * errors = config_content_get_errors( content ); - config_error_fprintf( errors , true , stderr ); - exit(1); - } - - site_config_init( enkf_main->site_config , content ); /* <---- model_config : second pass. */ - - /*****************************************************************/ - /* - OK - now we have parsed everything - and we are ready to start - populating the enkf_main object. - */ - - - - - { - char * log_file; - int log_level = DEFAULT_LOG_LEVEL; - if(config_content_has_item( content , LOG_LEVEL_KEY)) - log_level = config_content_get_value_as_int(content , LOG_LEVEL_KEY); - - if (config_content_has_item( content , LOG_FILE_KEY)) - log_file = util_alloc_string_copy( config_content_get_value(content , LOG_FILE_KEY)); - else - log_file = util_alloc_filename( NULL , enkf_main->user_config_file , "log"); - - ert_log_init_log(log_level, log_file , enkf_main->verbose); - - free( log_file ); - } - - /* - Initializing the various 'large' sub config objects. - */ - rng_config_init( enkf_main->rng_config , content ); - enkf_main_rng_init( enkf_main ); /* Must be called before the ensmeble is created. */ - - enkf_main_init_subst_list( enkf_main ); - ert_workflow_list_init( enkf_main->workflow_list , content ); - - analysis_config_load_internal_modules( enkf_main->analysis_config ); - analysis_config_init( enkf_main->analysis_config , content ); - ecl_config_init( enkf_main->ecl_config , content ); - config_settings_apply( enkf_main->plot_config , content ); - - ensemble_config_init( enkf_main->ensemble_config , content , - ecl_config_get_grid( enkf_main->ecl_config ) , - ecl_config_get_refcase( enkf_main->ecl_config) ); - - model_config_init( enkf_main->model_config , - content , - enkf_main_get_ensemble_size( enkf_main ), - site_config_get_installed_jobs(enkf_main->site_config) , - ecl_config_get_last_history_restart( enkf_main->ecl_config ), - ecl_config_get_sched_file(enkf_main->ecl_config) , - ecl_config_get_refcase( enkf_main->ecl_config )); - - enkf_main_init_hook_manager( enkf_main , content ); - enkf_main_init_data_kw( enkf_main , content ); - enkf_main_update_num_cpu( enkf_main ); - { - if (config_content_has_item( content , SCHEDULE_PREDICTION_FILE_KEY )) { - const config_content_item_type * pred_item = config_content_get_item( content , SCHEDULE_PREDICTION_FILE_KEY ); - config_content_node_type * pred_node = config_content_item_get_last_node( pred_item ); - const char * template_file = config_content_node_iget_as_path( pred_node , 0 ); - { - hash_type * opt_hash = hash_alloc(); - config_content_node_init_opt_hash( pred_node , opt_hash , 1 ); - - const char * parameters = hash_safe_get( opt_hash , "PARAMETERS" ); - const char * min_std = hash_safe_get( opt_hash , "MIN_STD" ); - const char * init_files = hash_safe_get( opt_hash , "INIT_FILES" ); - - enkf_main_set_schedule_prediction_file__( enkf_main , template_file , parameters , min_std , init_files ); - hash_free( opt_hash ); - } - } - } - - - /*****************************************************************/ - /** - By default the simulation directories are left intact when - the simulations re complete, but using the keyword - DELETE_RUNPATH you can request (some of) the directories to - be wiped after the simulations are complete. - */ - { - { - char * delete_runpath_string = NULL; - int ens_size = config_content_get_value_as_int(content , NUM_REALIZATIONS_KEY); - - if (config_content_has_item(content , DELETE_RUNPATH_KEY)) - delete_runpath_string = config_content_alloc_joined_string(content , DELETE_RUNPATH_KEY , ""); - - enkf_main_parse_keep_runpath( enkf_main , delete_runpath_string , ens_size ); - - util_safe_free( delete_runpath_string ); - } - - /* This is really in the wrong place ... */ - { - enkf_main->pre_clear_runpath = DEFAULT_PRE_CLEAR_RUNPATH; - if (config_content_has_item(content , PRE_CLEAR_RUNPATH_KEY)) - enkf_main->pre_clear_runpath = config_content_get_value_as_bool( content , PRE_CLEAR_RUNPATH_KEY); - } - - ecl_config_static_kw_init( enkf_main->ecl_config , content ); - - /* Installing templates */ - ert_templates_init( enkf_main->templates , content ); - - { - const char * rft_config_file = NULL; - if (config_content_has_item(content , RFT_CONFIG_KEY)) - rft_config_file = config_content_iget(content , RFT_CONFIG_KEY , 0,0); - - enkf_main_set_rft_config_file( enkf_main , rft_config_file ); - } - - - /*****************************************************************/ - enkf_main_user_select_initial_fs( enkf_main ); - - /* Adding ensemble members */ - enkf_main_resize_ensemble( enkf_main, config_content_iget_as_int(content, NUM_REALIZATIONS_KEY , 0 , 0) ); - - /*****************************************************************/ - - /* Loading observations */ - enkf_main_alloc_obs(enkf_main); - if (config_content_has_item(content , OBS_CONFIG_KEY)) { - const char * obs_config_file = config_content_iget(content , OBS_CONFIG_KEY , 0,0); - enkf_main_load_obs( enkf_main , obs_config_file , true ); - } - - } - config_content_free( content ); - config_free(config); - } - enkf_main_init_jobname( enkf_main ); - free( model_config ); - } - return enkf_main; -} - - - - -/** - This function creates a minimal configuration file, with a few - parameters (a bit arbitrary) parameters read from (typically) a GUI - configuration dialog. - - The set of parameters written by this function is _NOT_ a minimum - set to generate a valid configuration. -*/ - -void enkf_main_create_new_config( const char * config_file , const char * storage_path , const char * dbase_type , int num_realizations) { - - FILE * stream = util_mkdir_fopen( config_file , "w" ); - - fprintf(stream , CONFIG_KEY_FORMAT , ENSPATH_KEY); - fprintf(stream , CONFIG_ENDVALUE_FORMAT , storage_path ); - - fprintf(stream , CONFIG_KEY_FORMAT , DBASE_TYPE_KEY); - fprintf(stream , CONFIG_ENDVALUE_FORMAT , dbase_type); - - fprintf(stream , CONFIG_KEY_FORMAT , NUM_REALIZATIONS_KEY); - fprintf(stream , CONFIG_INT_FORMAT , num_realizations); - fprintf(stream , "\n"); - - fclose( stream ); - - printf("Have created configuration file: %s \n",config_file ); -} - - - - - - - - -/** - First deleting all the nodes - then the configuration. -*/ - -void enkf_main_del_node(enkf_main_type * enkf_main , const char * key) { - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - int iens; - for (iens = 0; iens < ens_size; iens++) - enkf_state_del_node(enkf_main->ensemble[iens] , key); - ensemble_config_del_node(enkf_main->ensemble_config , key); -} - - - -int enkf_main_get_ensemble_size( const enkf_main_type * enkf_main ) { - return enkf_main->ens_size; -} - - -enkf_state_type ** enkf_main_get_ensemble( enkf_main_type * enkf_main) { - return enkf_main->ensemble; -} - - -const enkf_state_type ** enkf_main_get_ensemble_const( const enkf_main_type * enkf_main) { - return (const enkf_state_type **) enkf_main->ensemble; -} - - - -/** - In this function we initialize the variables which control - which nodes are internalized (i.e. loaded from the forward - simulation and stored in the enkf_fs 'database'). The system is - based on two-levels: - - * Should we store the state? This is goverened by the variable - model_config->internalize_state. If this is true we will - internalize all nodes which have enkf_var_type = {dynamic_state , - static_state}. In the same way the variable - model_config->internalize_results governs whether the dynamic - results (i.e. summary variables in ECLIPSE speak) should be - internalized. - - * In addition we have fine-grained control in the enkf_config_node - objects where we can explicitly say that, altough we do not want - to internalize the full state, we want to internalize e.g. the - pressure field. - - * All decisions on internalization are based on a per report step - basis. - - The user-space API for manipulating this is (extremely) - limited. What is implemented here is the following: - - 1. We internalize the initial dynamic state. - - 2. For all the end-points in the current enkf_sched instance we - internalize the state. - - 3. store_results is set to true for all report steps irrespective - of run_mode. - - 4. We iterate over all the observations, and ensure that the - observed nodes (i.e. the pressure for an RFT) are internalized - (irrespective of whether they are of type dynamic_state or - dynamic_result). - - Observe that this cascade can result in some nodes, i.e. a rate we - are observing, to be marked for internalization several times - - that is no problem. - - ----- - - For performance reason model_config contains the bool vector - __load_eclipse_restart; if it is true the ECLIPSE restart state is - loaded from disk, otherwise no loading is performed. This implies - that if we do not want to internalize the full state but for - instance the pressure (i.e. for an RFT) we must set the - __load_state variable for the actual report step to true. For this - reason calls enkf_config_node_internalize() must be accompanied by - calls to model_config_set_load_state|results() - this is ensured - when using this function to manipulate the configuration of - internalization. - -*/ - - -void enkf_main_init_internalization( enkf_main_type * enkf_main , run_mode_type run_mode ) { - /* Clearing old internalize flags. */ - model_config_init_internalization( enkf_main->model_config ); - - /* Internalizing the initial state. */ - model_config_set_internalize_state( enkf_main->model_config , 0); - - - /* Make sure we internalize at all observation times.*/ - { - hash_type * map = enkf_obs_alloc_data_map(enkf_main->obs); - hash_iter_type * iter = hash_iter_alloc(map); - const char * obs_key = hash_iter_get_next_key(iter); - - while (obs_key != NULL) { - obs_vector_type * obs_vector = enkf_obs_get_vector( enkf_main->obs , obs_key ); - enkf_config_node_type * data_node = obs_vector_get_config_node( obs_vector ); - int active_step = -1; - do { - active_step = obs_vector_get_next_active_step( obs_vector , active_step ); - if (active_step >= 0) { - enkf_config_node_set_internalize( data_node , active_step ); - { - enkf_var_type var_type = enkf_config_node_get_var_type( data_node ); - if (var_type == DYNAMIC_STATE) - model_config_set_load_state( enkf_main->model_config , active_step); - } - } - } while (active_step >= 0); - obs_key = hash_iter_get_next_key(iter); - } - hash_iter_free(iter); - hash_free(map); - } -} - - - - -/*****************************************************************/ - - - - - - -const ext_joblist_type * enkf_main_get_installed_jobs( const enkf_main_type * enkf_main ) { - return site_config_get_installed_jobs( enkf_main->site_config ); -} - - - -/*****************************************************************/ - -void enkf_main_get_observations( const enkf_main_type * enkf_main, const char * user_key , int obs_count , time_t * obs_time , double * y , double * std) { - ensemble_config_get_observations( enkf_main->ensemble_config , enkf_main->obs , user_key , obs_count , obs_time , y , std); -} - - -int enkf_main_get_observation_count( const enkf_main_type * enkf_main, const char * user_key ) { - return ensemble_config_get_observations( enkf_main->ensemble_config , enkf_main->obs , user_key , 0 , NULL , NULL , NULL); -} - - - -void enkf_main_log_fprintf_config( const enkf_main_type * enkf_main , FILE * stream ) { - fprintf( stream , CONFIG_COMMENTLINE_FORMAT ); - fprintf( stream , CONFIG_COMMENT_FORMAT , "Here comes configuration information about the ERT logging."); - fprintf( stream , CONFIG_KEY_FORMAT , LOG_FILE_KEY ); - fprintf( stream , CONFIG_ENDVALUE_FORMAT , ert_log_get_filename()); - - if (ert_log_get_log_level() != DEFAULT_LOG_LEVEL) { - fprintf(stream , CONFIG_KEY_FORMAT , LOG_LEVEL_KEY ); - fprintf(stream , CONFIG_INT_FORMAT , ert_log_get_log_level()); - fprintf(stream , "\n"); - } - - fprintf(stream , "\n"); - fprintf(stream , "\n"); -} - - -void enkf_main_install_SIGNALS(void) { - util_install_signals(); -} - - - - -ert_templates_type * enkf_main_get_templates( enkf_main_type * enkf_main ) { - return enkf_main->templates; -} - - - -/*****************************************************************/ - - -void enkf_main_fprintf_runpath_config( const enkf_main_type * enkf_main , FILE * stream ) { - fprintf(stream , CONFIG_KEY_FORMAT , PRE_CLEAR_RUNPATH_KEY ); - fprintf(stream , CONFIG_ENDVALUE_FORMAT , CONFIG_BOOL_STRING( enkf_state_get_pre_clear_runpath( enkf_main->ensemble[0] ))); - - { - bool del_comma = false; - - - for (int iens = 0; iens < enkf_main->ens_size; iens++) { - keep_runpath_type keep_runpath = enkf_main_iget_keep_runpath( enkf_main , iens ); - if (keep_runpath == EXPLICIT_DELETE) { - if (!del_comma) { - fprintf(stream , CONFIG_KEY_FORMAT , DELETE_RUNPATH_KEY ); - fprintf(stream , CONFIG_INT_FORMAT , iens); - del_comma = true; - } else { - fprintf(stream , ","); - fprintf(stream , CONFIG_INT_FORMAT , iens); - } - } - } - fprintf(stream , "\n"); - } -} - - - -/*****************************************************************/ - -ert_workflow_list_type * enkf_main_get_workflow_list( enkf_main_type * enkf_main ) { - return enkf_main->workflow_list; -} - -bool enkf_main_run_workflow( enkf_main_type * enkf_main , const char * workflow ) { - ert_workflow_list_type * workflow_list = enkf_main_get_workflow_list( enkf_main ); - if (ert_workflow_list_has_workflow( workflow_list , workflow)){ - return ert_workflow_list_run_workflow_blocking( workflow_list , workflow , enkf_main); - } - else{ - return false; - } -} - - -void enkf_main_run_workflows( enkf_main_type * enkf_main , const stringlist_type * workflows) { - int iw; - for (iw = 0; iw < stringlist_get_size( workflows ); iw++) - enkf_main_run_workflow( enkf_main , stringlist_iget( workflows , iw )); -} - - -int enkf_main_load_from_forward_model_from_gui(enkf_main_type * enkf_main, int iter , bool_vector_type * iactive, enkf_fs_type * fs){ - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - stringlist_type ** realizations_msg_list = util_calloc( ens_size , sizeof * realizations_msg_list ); - for (int iens = 0; iens < ens_size; ++iens) - realizations_msg_list[iens] = stringlist_alloc_new(); - - int loaded = enkf_main_load_from_forward_model_with_fs(enkf_main, iter , iactive, realizations_msg_list, fs); - - for (int iens = 0; iens < ens_size; ++iens) - stringlist_free( realizations_msg_list[iens] ); - - free(realizations_msg_list); - return loaded; -} - -int enkf_main_load_from_forward_model(enkf_main_type * enkf_main, int iter , bool_vector_type * iactive, stringlist_type ** realizations_msg_list){ - enkf_fs_type * fs = enkf_main_get_fs( enkf_main ); - return enkf_main_load_from_forward_model_with_fs(enkf_main, iter, iactive, realizations_msg_list, fs); -} - - -int enkf_main_load_from_forward_model_with_fs(enkf_main_type * enkf_main, int iter , bool_vector_type * iactive, stringlist_type ** realizations_msg_list, enkf_fs_type * fs) { - printf("Loading from forward model\n"); - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - int result[ens_size]; - model_config_type * model_config = enkf_main->model_config; - - ert_run_context_type * run_context = ert_run_context_alloc_ENSEMBLE_EXPERIMENT( fs , iactive , model_config_get_runpath_fmt( model_config ) , enkf_main->subst_list , iter ); - arg_pack_type ** arg_list = util_calloc( ens_size , sizeof * arg_list ); - thread_pool_type * tp = thread_pool_alloc( 4 , true ); /* num_cpu - HARD coded. */ - - int iens = 0; - for (; iens < ens_size; ++iens) { - printf("\tloading %d (realization %d/%d) ", iens, (1+iens), ens_size); - result[iens] = 0; - arg_pack_type * arg_pack = arg_pack_alloc(); - arg_list[iens] = arg_pack; - - if (bool_vector_iget(iactive, iens)) { - printf("... "); - enkf_state_type * enkf_state = enkf_main_iget_state( enkf_main , iens ); - arg_pack_append_ptr( arg_pack , enkf_state); /* 0: enkf_state*/ - arg_pack_append_ptr( arg_pack , ert_run_context_iens_get_arg( run_context , iens )); /* 1: run_arg */ - arg_pack_append_ptr(arg_pack, realizations_msg_list[iens]); /* 2: List of interactive mode messages. */ - arg_pack_append_bool( arg_pack, true ); /* 3: Manual load */ - arg_pack_append_ptr(arg_pack, &result[iens]); /* 4: Result */ - thread_pool_add_job( tp , enkf_state_load_from_forward_model_mt , arg_pack); - } - printf("done\n"); - } - - thread_pool_join( tp ); - thread_pool_free( tp ); - printf("\n"); - - int loaded = 0; - for (iens = 0; iens < ens_size; ++iens) { - if (bool_vector_iget(iactive, iens)) { - if (result[iens] & LOAD_FAILURE) - fprintf(stderr, "** Warning: Function %s: Realization %d load failure\n", __func__, iens); - else if (result[iens] & REPORT_STEP_INCOMPATIBLE) - fprintf(stderr, "** Warning: Function %s: Realization %d report step incompatible\n", __func__, iens); - else - loaded++; - } - arg_pack_free(arg_list[iens]); - } - free( arg_list ); - ert_run_context_free( run_context ); - return loaded; -} - - -bool enkf_main_export_field(const enkf_main_type * enkf_main, - const char * kw, - const char * path, - bool_vector_type * iactive, - field_file_format_type file_type, - int report_step) -{ - enkf_fs_type * fs = enkf_main_get_fs(enkf_main); - bool result = enkf_main_export_field_with_fs(enkf_main, kw, path, iactive, file_type, report_step, fs); - return result; -} - - - - -bool enkf_main_export_field_with_fs(const enkf_main_type * enkf_main, - const char * kw, - const char * path, - bool_vector_type * iactive, - field_file_format_type file_type, - int report_step, - enkf_fs_type * fs) { - - bool ret = false; - if (util_int_format_count(path) < 1) { - printf("EXPORT FIELD: There must be a %%d in the file name\n"); - return ret; - } - - const ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main); - enkf_config_node_type * config_node = NULL; - bool node_found = false; - - if (ensemble_config_has_key(ensemble_config, kw)) { - config_node = ensemble_config_get_node(ensemble_config, kw); - if (config_node && enkf_config_node_get_impl_type(config_node) == FIELD) { - node_found = true; - } else - printf("Did not find a FIELD %s node\n", kw); - } else - printf("Ensemble config does not have key %s\n", kw); - - if (node_found) { - enkf_node_type * node = NULL; - model_config_type * mc = enkf_main_get_model_config(enkf_main); - path_fmt_type * runpath_fmt = model_config_get_runpath_fmt(mc); - const char * init_file = enkf_config_node_get_FIELD_fill_file(config_node, runpath_fmt); - if (init_file) - printf("init_file found: \"%s\", exporting initial value for inactive cells\n", init_file); - else - printf("no init_file found, exporting 0 or fill value for inactive cells\n"); - - int iens; - for (iens = 0; iens < bool_vector_size(iactive); ++iens) { - if (bool_vector_iget(iactive, iens)) { - node_id_type node_id = {.report_step = report_step , .iens = iens }; - node = enkf_state_get_node(enkf_main->ensemble[iens] , kw); - if (node) { - if (enkf_node_try_load(node , fs , node_id)) { - path_fmt_type * export_path = path_fmt_alloc_path_fmt( path ); - char * filename = path_fmt_alloc_path( export_path , false , iens); - path_fmt_free(export_path); - - { - char * path; - util_alloc_file_components(filename , &path , NULL , NULL); - if (path != NULL) { - util_make_path( path ); - free( path ); - } - } - - { - const field_type * field = enkf_node_value_ptr(node); - const bool output_transform = true; - field_export(field , filename , NULL , file_type , output_transform, init_file); - ret = true; - } - free(filename); - } else - printf("%s : enkf_node_try_load returned returned false \n", __func__); - } else - printf("%s : enkf_state_get_node returned NULL for parameters %d, %s \n", __func__, iens, kw); - } - } - } - - - if (ret) - printf("Successful export of FIELD %s\n", kw); - else - printf("Errors during export of FIELD %s\n", kw); - - return ret; -} - - -void enkf_main_rank_on_observations(enkf_main_type * enkf_main, - const char * ranking_key, - const stringlist_type * obs_ranking_keys, - const int_vector_type * steps) { - - enkf_fs_type * fs = enkf_main_get_fs(enkf_main); - const enkf_obs_type * enkf_obs = enkf_main_get_obs( enkf_main ); - const ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main); - const int history_length = enkf_main_get_history_length( enkf_main ); - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - - misfit_ensemble_type * misfit_ensemble = enkf_fs_get_misfit_ensemble( fs ); - misfit_ensemble_initialize( misfit_ensemble , ensemble_config , enkf_obs , fs , ens_size , history_length, false); - - ranking_table_type * ranking_table = enkf_main_get_ranking_table( enkf_main ); - - ranking_table_add_misfit_ranking( ranking_table , misfit_ensemble , obs_ranking_keys , steps , ranking_key ); - ranking_table_display_ranking( ranking_table , ranking_key); -} - - - -void enkf_main_rank_on_data(enkf_main_type * enkf_main, - const char * ranking_key, - const char * data_key, - bool sort_increasing, - int step) { - - ranking_table_type * ranking_table = enkf_main_get_ranking_table( enkf_main ); - ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config( enkf_main ); - enkf_fs_type * fs = enkf_main_get_fs(enkf_main); - char * key_index; - - const enkf_config_node_type * config_node = ensemble_config_user_get_node( ensemble_config , data_key , &key_index); - if (config_node) { - ranking_table_add_data_ranking( ranking_table , sort_increasing , ranking_key , data_key , key_index , fs , config_node, step ); - ranking_table_display_ranking( ranking_table , ranking_key ); - } else { - fprintf(stderr,"** No data found for key %s\n", data_key); - } -} - - -void enkf_main_export_ranking(enkf_main_type * enkf_main, const char * ranking_key, const char * ranking_file) { - ranking_table_type * ranking_table = enkf_main_get_ranking_table( enkf_main ); - ranking_table_fwrite_ranking(ranking_table, ranking_key, ranking_file); -} - - -#include "enkf_main_manage_fs.c" diff --git a/ThirdParty/Ert/libenkf/src/enkf_main_jobs.c b/ThirdParty/Ert/libenkf/src/enkf_main_jobs.c deleted file mode 100644 index 6718e2be54..0000000000 --- a/ThirdParty/Ert/libenkf/src/enkf_main_jobs.c +++ /dev/null @@ -1,552 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'enkf_main_jobs.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -#include -#include -#include - -#include -#include -#include -#include - - - -static bool_vector_type * alloc_iactive_vector_from_range(const stringlist_type * range, int startindex, int endindex, int ens_size) { - bool_vector_type * iactive; - int range_list_size = stringlist_get_size(range); - if ((range_list_size > startindex) && (range_list_size >= endindex)) { - char * arg_string = stringlist_alloc_joined_substring( range, startindex, endindex, ""); - iactive = bool_vector_alloc(ens_size, false); - string_util_update_active_mask( arg_string, iactive ); - free ( arg_string ); - } else { - iactive = bool_vector_alloc(ens_size, true); - } - return iactive; -} - -void enkf_main_jobs_sleep(){ - while(true){ - printf("Hi from internal \n"); - sleep(1); - } -} - -void * enkf_main_exit_JOB(void * self , const stringlist_type * args ) { - enkf_main_type * enkf_main = enkf_main_safe_cast( self ); - enkf_main_exit( enkf_main ); - return NULL; -} - - -/** - This job is purely added to make sure we have a job in the - internal-gui/config subdirectory. As soon as there is a real job - there; this can be removed. -*/ - -void * enkf_main_dummy_JOB(void * self , const stringlist_type * args ) { - return NULL; -} - - - - - -void * enkf_main_ensemble_run_JOB( void * self , const stringlist_type * args ) { - enkf_main_type * enkf_main = enkf_main_safe_cast( self ); - int ens_size = enkf_main_get_ensemble_size( enkf_main ); - bool_vector_type * iactive = alloc_iactive_vector_from_range(args, 0, stringlist_get_size(args), ens_size); - - bool_vector_iset( iactive , ens_size - 1 , true ); - enkf_main_run_tui_exp( enkf_main , iactive); - bool_vector_free(iactive); - return NULL; -} - - -static void * enkf_main_smoother_JOB__( void * self , int iter , const stringlist_type * args ) { - enkf_main_type * enkf_main = enkf_main_safe_cast( self ); - int ens_size = enkf_main_get_ensemble_size( enkf_main ); - bool_vector_type * iactive = bool_vector_alloc( ens_size , true ); - bool valid = true; - const char * target_case = stringlist_iget( args , 0 ); - enkf_fs_type * source_fs = enkf_main_job_get_fs( enkf_main ); - //Argument 2: Rerun. Default false. - bool rerun = (stringlist_get_size(args) >= 2) ? stringlist_iget_as_bool(args, 1, &valid) : false; - - if (!valid) { - fprintf(stderr, "** Warning: Function %s : Second argument must be a bool value. Exiting job\n", __func__); - return NULL; - } - enkf_main_run_smoother( enkf_main , source_fs , target_case , iactive , iter , rerun); - bool_vector_free( iactive ); - return NULL; -} - - -void * enkf_main_smoother_JOB( void * self , const stringlist_type * args ) { - return enkf_main_smoother_JOB__( self, 0 , args ); -} - - -void * enkf_main_smoother_with_iter_JOB( void * self , const stringlist_type * args ) { - int iter; - stringlist_type * sub_args = stringlist_alloc_shallow_copy_with_limits( args , 1 , stringlist_get_size( args ) - 1); - util_sscanf_int( stringlist_iget(args , 0 ) , &iter ); - - enkf_main_smoother_JOB__( self , iter , sub_args ); - - stringlist_free( sub_args ); - return NULL; -} - - - -void * enkf_main_iterated_smoother_JOB( void * self , const stringlist_type * args ) { - enkf_main_type * enkf_main = enkf_main_safe_cast( self ); - const analysis_config_type * analysis_config = enkf_main_get_analysis_config(enkf_main); - analysis_iter_config_type * iter_config = analysis_config_get_iter_config(analysis_config); - int num_iter = analysis_iter_config_get_num_iterations(iter_config); - - enkf_main_run_iterated_ES( enkf_main , num_iter); - return NULL; -} - - -void * enkf_main_select_module_JOB( void * self , const stringlist_type * args ) { - enkf_main_type * enkf_main = enkf_main_safe_cast( self ); - analysis_config_type * analysis_config = enkf_main_get_analysis_config( enkf_main ); - - analysis_config_select_module( analysis_config , stringlist_iget( args , 0 )); - - return NULL; -} - - -void * enkf_main_scale_obs_std_JOB(void * self, const stringlist_type * args ) { - enkf_main_type * enkf_main = enkf_main_safe_cast( self ); - - double scale_factor; - if (util_sscanf_double(stringlist_iget(args, 0), &scale_factor)) { - analysis_config_type * analysis_config = enkf_main_get_analysis_config( enkf_main ); - analysis_config_set_global_std_scaling( analysis_config , scale_factor ); - } - return NULL; -} - -/*****************************************************************/ - -/* - Will create the new case if it does not exist. -*/ -void * enkf_main_select_case_JOB( void * self , const stringlist_type * args) { - enkf_main_type * enkf_main = enkf_main_safe_cast( self ); - const char * new_case = stringlist_iget( args , 0 ); - enkf_main_select_fs( enkf_main , new_case ); - return NULL; -} - - -void * enkf_main_create_case_JOB( void * self , const stringlist_type * args) { - enkf_main_type * enkf_main = enkf_main_safe_cast( self ); - const char * new_case = stringlist_iget( args , 0 ); - enkf_fs_type * fs = enkf_main_mount_alt_fs( enkf_main , new_case , true ); - enkf_fs_decref( fs ); - return NULL; -} - - - -void * enkf_main_init_case_from_existing_JOB( void * self , const stringlist_type * args) { - enkf_main_type * enkf_main = enkf_main_safe_cast( self ); - - const char * source_case = stringlist_iget( args , 0 ); - enkf_fs_type * source_fs = enkf_main_mount_alt_fs( enkf_main , source_case , true ); - { - enkf_fs_type * target_fs; - - if (stringlist_get_size(args) > 1) { - const char * current_case = enkf_main_get_current_fs(enkf_main); - const char * target_case = stringlist_iget( args , 1 ); - if (0 != strcmp(current_case, target_case)) { - target_fs = enkf_main_mount_alt_fs( enkf_main , target_case , true ); - } else - target_fs = enkf_fs_get_ref( enkf_main_job_get_fs(enkf_main) ); // Using get_ref so that we can unconditionally call decref() further down. - } else - target_fs = enkf_fs_get_ref( enkf_main_job_get_fs(enkf_main) ); // Using get_ref so that we can unconditionally call decref() further down. - - enkf_main_init_case_from_existing(enkf_main, source_fs, 0, target_fs); // Removed ANALYZED argument - enkf_fs_decref(target_fs); - } - enkf_fs_decref(source_fs); - - return NULL; -} - - -/*****************************************************************/ - -static void * enkf_main_load_results_JOB__( enkf_main_type * enkf_main , int iter , const stringlist_type * args) { - bool_vector_type * iactive = alloc_iactive_vector_from_range(args, 0, stringlist_get_size(args), enkf_main_get_ensemble_size(enkf_main)); - int ens_size = enkf_main_get_ensemble_size(enkf_main); - stringlist_type ** realizations_msg_list = util_calloc(ens_size, sizeof * realizations_msg_list); - for (int iens = 0; iens < ens_size; ++iens) - realizations_msg_list[iens] = stringlist_alloc_new(); - - enkf_main_load_from_forward_model(enkf_main, iter , iactive, realizations_msg_list); - - for (int iens = 0; iens < ens_size; ++iens) { - stringlist_type * msg = realizations_msg_list[iens]; - if (stringlist_get_size(msg)) { - int msg_count = 0; - for (; msg_count < stringlist_get_size(msg); ++msg_count) - fprintf(stderr, "** Warning: Function %s : Load of realization number %d returned the following warning: %s\n", __func__, iens, stringlist_iget(msg, msg_count)); - } - stringlist_free(msg); - } - - free(realizations_msg_list); - bool_vector_free(iactive); - return NULL; -} - - -void * enkf_main_load_results_JOB( void * self , const stringlist_type * args) { - enkf_main_type * enkf_main = enkf_main_safe_cast( self ); - int iter = 0; - { - const model_config_type * model_config = enkf_main_get_model_config( enkf_main ); - if (model_config_runpath_requires_iter( model_config )) - fprintf(stderr,"**Warning: the runpath format:%s requires an iteration number - using default:0. Use the job: LOAD_RESULT_ITER instead.\n" , model_config_get_runpath_as_char( model_config )); - } - return enkf_main_load_results_JOB__(enkf_main , iter , args ); -} - - -void * enkf_main_load_results_iter_JOB( void * self , const stringlist_type * args) { - enkf_main_type * enkf_main = enkf_main_safe_cast( self ); - stringlist_type * iens_args = stringlist_alloc_shallow_copy_with_limits( args , 1 , stringlist_get_size( args ) - 1); - int iter; - - util_sscanf_int( stringlist_iget( args , 0 ) , &iter); - enkf_main_load_results_JOB__(enkf_main , iter , iens_args ); - stringlist_free( iens_args ); - - return NULL; -} - - -/*****************************************************************/ - -static void enkf_main_jobs_export_field(const enkf_main_type * enkf_main, const stringlist_type * args, field_file_format_type file_type) { - const char * field = stringlist_iget(args, 0); - const char * file_name = stringlist_iget(args, 1); - int report_step = 0; - util_sscanf_int(stringlist_iget(args,2), &report_step); - - bool_vector_type * iactive = alloc_iactive_vector_from_range(args, 4, stringlist_get_size(args), enkf_main_get_ensemble_size(enkf_main)); - enkf_main_export_field(enkf_main,field, file_name, iactive, file_type, report_step ) ; - bool_vector_free(iactive); -} - - - -void * enkf_main_export_field_JOB(void * self, const stringlist_type * args) { - const char * file_name = stringlist_iget(args, 1); - field_file_format_type file_type = field_config_default_export_format(file_name); - - if ((RMS_ROFF_FILE == file_type) || (ECL_GRDECL_FILE == file_type)) { - enkf_main_type * enkf_main = enkf_main_safe_cast( self ); - enkf_main_jobs_export_field(enkf_main, args, file_type); - } else - printf("EXPORT_FIELD filename argument: File extension must be either .roff or .grdecl\n"); - - return NULL; -} - -void * enkf_main_export_field_to_RMS_JOB(void * self, const stringlist_type * args) { - enkf_main_type * enkf_main = enkf_main_safe_cast( self ); - enkf_main_jobs_export_field(enkf_main, args, RMS_ROFF_FILE); - return NULL; -} - -void * enkf_main_export_field_to_ECL_JOB(void * self, const stringlist_type * args) { - enkf_main_type * enkf_main = enkf_main_safe_cast( self ); - enkf_main_jobs_export_field(enkf_main, args, ECL_GRDECL_FILE); - return NULL; -} - - -/*****************************************************************/ - -void * enkf_main_rank_on_observations_JOB(void * self, const stringlist_type * args) { - enkf_main_type * enkf_main = enkf_main_safe_cast( self ); - const char * ranking_name = stringlist_iget(args, 0); - - bool step_arguments = false; - bool obs_arguments = false; - int delimiter = 0; - { - delimiter = stringlist_find_first(args, "|"); - if (delimiter > -1) { - step_arguments = (delimiter > 1) ? true : false; - obs_arguments = (stringlist_get_size(args) > delimiter + 1) ? true : false; - } else if (stringlist_get_size(args) > 1) { - step_arguments = true; - delimiter = stringlist_get_size(args); - } - } - - int_vector_type * steps_vector = NULL; - { - char * report_steps = NULL; - - if (step_arguments) - report_steps = stringlist_alloc_joined_substring(args, 1, delimiter, ","); - else - report_steps = util_alloc_sprintf("0-%d", enkf_main_get_history_length(enkf_main)); - - steps_vector = string_util_alloc_value_list(report_steps); - - free(report_steps); - } - - - stringlist_type * obs_ranking_keys = NULL; - { - char * obs_key_char = NULL; - if (obs_arguments) - obs_key_char = stringlist_alloc_joined_substring( args , delimiter+1 , stringlist_get_size(args) , " "); - - enkf_obs_type * enkf_obs = enkf_main_get_obs(enkf_main); - obs_ranking_keys = enkf_obs_alloc_matching_keylist( enkf_obs , obs_key_char ); - - if ((obs_arguments) && (stringlist_get_size(obs_ranking_keys) == 0)) { - fprintf(stderr,"The input string : \"%s\" did not resolve to any valid observation keys. Job not started\n", obs_key_char); - return NULL; - } - - if (obs_arguments) - free(obs_key_char); - } - - - enkf_main_rank_on_observations(enkf_main, ranking_name, obs_ranking_keys, steps_vector); - - stringlist_free(obs_ranking_keys); - int_vector_free(steps_vector); - return NULL; -} - - -void * enkf_main_rank_on_data_JOB(void * self, const stringlist_type * args) { - enkf_main_type * enkf_main = enkf_main_safe_cast( self ); - const char * ranking_name = stringlist_iget(args, 0); - const char * data_key = stringlist_iget(args, 1); - bool valid = true; - bool sort_increasing = stringlist_iget_as_bool(args, 2, &valid); - - if (!valid) { - fprintf(stderr,"** Third argument \"sort increasing\" not recognized as bool value, job not started\n"); - return NULL; - } - - int report_step = (stringlist_get_size(args) > 3) ? stringlist_iget_as_int(args, 3, &valid) : enkf_main_get_history_length(enkf_main) ; - if (!valid) { - fprintf(stderr,"** Fourth argument \"step\" not recognized as integer value, job not started\n"); - return NULL; - } - - if (report_step < 0) { - fprintf(stderr,"** Negative report step, job not started\n"); - return NULL; - } - - enkf_main_rank_on_data(enkf_main, ranking_name, data_key, sort_increasing, report_step); - return NULL; -} - - -void * enkf_main_export_ranking_JOB(void * self, const stringlist_type * args) { - enkf_main_type * enkf_main = enkf_main_safe_cast( self ); - const char * ranking_name = stringlist_iget(args, 0); - const char * ranking_file = stringlist_iget(args, 1); - - enkf_main_export_ranking(enkf_main, ranking_name, ranking_file); - return NULL; -} - -void * enkf_main_init_misfit_table_JOB(void * self, const stringlist_type * args) { - enkf_main_type * enkf_main = enkf_main_safe_cast( self ); - int history_length = enkf_main_get_history_length(enkf_main); - enkf_obs_type * enkf_obs = enkf_main_get_obs(enkf_main); - int ens_size = enkf_main_get_ensemble_size(enkf_main); - enkf_fs_type * fs = enkf_main_job_get_fs(enkf_main); - bool force_update = true; - const ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main); - - - misfit_ensemble_type * misfit_ensemble = enkf_fs_get_misfit_ensemble( fs ); - misfit_ensemble_initialize( misfit_ensemble , ensemble_config , enkf_obs , fs , ens_size , history_length, force_update); - - return NULL; -} - - - - -static void enkf_main_export_runpath_file(enkf_main_type * enkf_main, - const int_vector_type * realizations, - const int_vector_type * iterations) { - - ecl_config_type * ecl_config = enkf_main_get_ecl_config(enkf_main); - const model_config_type * model_config = enkf_main_get_model_config(enkf_main); - const char * basename_fmt = ecl_config_get_eclbase(ecl_config); - const char * runpath_fmt = model_config_get_runpath_as_char(model_config); - const hook_manager_type * hook_manager = enkf_main_get_hook_manager( enkf_main ); - - runpath_list_type * runpath_list = runpath_list_alloc( hook_manager_get_runpath_list_file( hook_manager )); - - for (int iter = 0; iter < int_vector_size(iterations); ++iter) { - for (int iens = 0; iens < int_vector_size(realizations); ++iens) { - int iter_value = int_vector_iget(iterations, iter); - int iens_value = int_vector_iget(realizations, iens); - char * basename; - char * runpath; - - if (basename_fmt) - basename = util_alloc_sprintf(basename_fmt, iens_value); - else - basename = util_alloc_sprintf("--%d", iens_value); - - if (model_config_runpath_requires_iter(model_config)) - runpath = util_alloc_sprintf(runpath_fmt, iens_value, iter_value); - else - runpath = util_alloc_sprintf(runpath_fmt, iens_value); - - runpath_list_add(runpath_list, iens_value, iter_value, runpath, basename); - - free(basename); - free(runpath); - } - } - runpath_list_fprintf(runpath_list); - runpath_list_free(runpath_list); -} - - - - -void * enkf_main_export_runpath_file_JOB(void * self, const stringlist_type * args) { - enkf_main_type * enkf_main = enkf_main_safe_cast( self ); - int ensemble_size = enkf_main_get_ensemble_size(enkf_main); - analysis_config_type * analysis_config = enkf_main_get_analysis_config(enkf_main); - analysis_iter_config_type * iter_config = analysis_config_get_iter_config(analysis_config); - int num_iterations = analysis_iter_config_get_num_iterations(iter_config); - const model_config_type * model_config = enkf_main_get_model_config(enkf_main); - int_vector_type * realizations = int_vector_alloc(1, 0); - int_vector_init_range(realizations, 0, ensemble_size, 1); - int_vector_type * iterations = int_vector_alloc(1, 0); - - - if (stringlist_get_size(args) > 0) { - int offset = 0; - while (true) { - if (offset == stringlist_get_size( args )) - break; - if (0 == strcmp("|" , stringlist_iget( args, offset ))) - break; - ++offset; - } - - if (0 != strcmp("*", stringlist_iget(args,0))) { - char * range_str = stringlist_alloc_joined_substring( args, 0, offset, ""); - string_util_init_value_list(range_str, realizations); - free(range_str); - } - - if ((offset < stringlist_get_size(args)) && model_config_runpath_requires_iter(model_config)) { - if (0 == strcmp("*", stringlist_iget(args, (offset+1)))) - int_vector_init_range(iterations, 0, num_iterations, 1); - else { - char * range_str = stringlist_alloc_joined_substring( args, offset+1, stringlist_get_size(args), ""); - string_util_init_value_list(range_str, iterations); - free(range_str); - } - } - } - - enkf_main_export_runpath_file(enkf_main, realizations, iterations); - - int_vector_free(realizations); - int_vector_free(iterations); - - return NULL; -} - - - -void * enkf_main_std_scale_correlated_obs_JOB(void * self, const stringlist_type * args) { - - if (stringlist_get_size(args) > 0) { - enkf_main_type * enkf_main = enkf_main_safe_cast( self ); - int ensemble_size = enkf_main_get_ensemble_size(enkf_main); - enkf_fs_type * fs = enkf_main_job_get_fs( enkf_main ); - enkf_obs_type * obs = enkf_main_get_obs( enkf_main ); - int_vector_type * realizations = int_vector_alloc(1, 0); - local_obsdata_type * obsdata = local_obsdata_alloc( "OBS-JOB" ); - - int_vector_init_range(realizations, 0, ensemble_size, 1); - - for (int iarg = 0; iarg < stringlist_get_size(args); iarg++) { - const char * arg_key = stringlist_iget( args , iarg ); - stringlist_type * key_list = enkf_obs_alloc_matching_keylist(obs, arg_key); - for (int iobs=0; iobs < stringlist_get_size( key_list ); iobs++) { - const char * obs_key = stringlist_iget( key_list , iobs); - const obs_vector_type * obs_vector = enkf_obs_get_vector(obs, obs_key); - local_obsdata_add_node( obsdata , obs_vector_alloc_local_node(obs_vector) ); - } - stringlist_free( key_list ); - } - - if (local_obsdata_get_size(obsdata) > 0) - enkf_obs_scale_correlated_std(obs, fs, realizations, obsdata ); - - local_obsdata_free( obsdata ); - } - - return NULL; -} - - -void * enkf_main_analysis_update_JOB( void * self , const stringlist_type * args) { - enkf_main_type * enkf_main = enkf_main_safe_cast( self ); - enkf_fs_type * source_fs = enkf_main_mount_alt_fs( enkf_main , stringlist_iget(args , 0 ) , false); - enkf_fs_type * target_fs = enkf_main_mount_alt_fs( enkf_main , stringlist_iget(args , 1 ) , true); - - enkf_main_smoother_update( enkf_main , source_fs , target_fs); - - enkf_fs_decref( source_fs ); - enkf_fs_decref( target_fs ); - return NULL; -} - diff --git a/ThirdParty/Ert/libenkf/src/enkf_main_manage_fs.c b/ThirdParty/Ert/libenkf/src/enkf_main_manage_fs.c deleted file mode 100644 index e5961ac895..0000000000 --- a/ThirdParty/Ert/libenkf/src/enkf_main_manage_fs.c +++ /dev/null @@ -1,683 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_main_manage_fs.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - - -/* - This small function is here only to make sure that the main - enkf_main.c file does not contain any explicit mention of the - dbase member. -*/ - -static void enkf_main_init_fs( enkf_main_type * enkf_main ) { - enkf_main->dbase = NULL; -} - - - -bool enkf_main_case_is_current(const enkf_main_type * enkf_main , const char * case_path) { - char * mount_point = enkf_main_alloc_mount_point( enkf_main , case_path ); - const char * current_mount_point = NULL; - bool is_current; - - if (enkf_main->dbase != NULL) - current_mount_point = enkf_fs_get_mount_point( enkf_main->dbase ); - - is_current = util_string_equal( mount_point , current_mount_point ); - free( mount_point ); - return is_current; -} - -static bool enkf_main_current_case_file_exists( const enkf_main_type * enkf_main) { - const char * ens_path = model_config_get_enspath( enkf_main->model_config); - char * current_case_file = util_alloc_filename(ens_path, CURRENT_CASE_FILE, NULL); - bool exists = util_file_exists(current_case_file); - free(current_case_file); - return exists; -} - -char* enkf_main_read_alloc_current_case_name(const enkf_main_type * enkf_main) { - char * current_case = NULL; - const char * ens_path = model_config_get_enspath( enkf_main->model_config); - char * current_case_file = util_alloc_filename(ens_path, CURRENT_CASE_FILE, NULL); - if (enkf_main_current_case_file_exists(enkf_main)) { - FILE * stream = util_fopen( current_case_file , "r"); - current_case = util_fscanf_alloc_token(stream); - util_fclose(stream); - } else { - util_abort("%s: File: storage/current_case not found, aborting! \n",__func__); - } - free(current_case_file); - return current_case; -} - - - - - -stringlist_type * enkf_main_alloc_caselist( const enkf_main_type * enkf_main ) { - stringlist_type * case_list = stringlist_alloc_new( ); - { - const char * ens_path = model_config_get_enspath( enkf_main->model_config ); - DIR * ens_dir = opendir( ens_path ); - if (ens_dir != NULL) { - int ens_fd = dirfd( ens_dir ); - if (ens_fd != -1) { - struct dirent * dp; - do { - dp = readdir( ens_dir ); - if (dp != NULL) { - if (!(util_string_equal( dp->d_name , ".") || util_string_equal(dp->d_name , ".."))) { - if (!util_string_equal( dp->d_name , CURRENT_CASE_FILE)) { - char * full_path = util_alloc_filename( ens_path , dp->d_name , NULL); - if (util_is_directory( full_path )) - stringlist_append_copy( case_list , dp->d_name ); - free( full_path); - } - } - } - } while (dp != NULL); - } - } - closedir( ens_dir ); - } - return case_list; -} - - -void enkf_main_set_case_table( enkf_main_type * enkf_main , const char * case_table_file ) { - model_config_set_case_table( enkf_main->model_config , enkf_main->ens_size , case_table_file ); -} - - - -static void * enkf_main_initialize_from_scratch_mt(void * void_arg) { - arg_pack_type * arg_pack = arg_pack_safe_cast( void_arg ); - enkf_main_type * enkf_main = arg_pack_iget_ptr( arg_pack , 0); - enkf_fs_type * init_fs = arg_pack_iget_ptr( arg_pack , 1); - const stringlist_type * param_list = arg_pack_iget_const_ptr( arg_pack , 2 ); - int iens = arg_pack_iget_int( arg_pack , 3 ); - init_mode_type init_mode = arg_pack_iget_int( arg_pack , 4 ); - enkf_state_type * state = enkf_main_iget_state( enkf_main , iens); - enkf_state_initialize( state , init_fs , param_list , init_mode); - return NULL; -} - -void enkf_main_initialize_from_scratch(enkf_main_type * enkf_main , enkf_fs_type * init_fs , const stringlist_type * param_list ,const bool_vector_type * iens_mask , init_mode_type init_mode) { - int num_cpu = 4; - int ens_size = enkf_main_get_ensemble_size( enkf_main ); - thread_pool_type * tp = thread_pool_alloc( num_cpu , true ); - arg_pack_type ** arg_list = util_calloc( ens_size , sizeof * arg_list ); - int i; - int iens; - - for (iens = 0; iens < ens_size; iens++) { - arg_list[iens] = arg_pack_alloc(); - if (bool_vector_safe_iget(iens_mask , iens)) { - arg_pack_append_ptr( arg_list[iens] , enkf_main ); - arg_pack_append_ptr( arg_list[iens] , init_fs ); - arg_pack_append_const_ptr( arg_list[iens] , param_list ); - arg_pack_append_int( arg_list[iens] , iens ); - arg_pack_append_int( arg_list[iens] , init_mode ); - - thread_pool_add_job( tp , enkf_main_initialize_from_scratch_mt , arg_list[iens]); - } - } - thread_pool_join( tp ); - for (i = 0; i < ens_size; i++){ - arg_pack_free( arg_list[i] ); - } - free( arg_list ); - thread_pool_free( tp ); -} - - - - -static void enkf_main_copy_ensemble( const enkf_main_type * enkf_main, - enkf_fs_type * source_case_fs, - int source_report_step, - enkf_fs_type * target_case_fs, - int target_report_step, - const bool_vector_type * iens_mask, - const char * ranking_key , /* It is OK to supply NULL - but if != NULL it must exist */ - const stringlist_type * node_list) { - - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - state_map_type * target_state_map = enkf_fs_get_state_map(target_case_fs); - - { - int * ranking_permutation; - int inode , src_iens; - - if (ranking_key != NULL) { - ranking_table_type * ranking_table = enkf_main_get_ranking_table( enkf_main ); - ranking_permutation = (int *) ranking_table_get_permutation( ranking_table , ranking_key ); - } else { - ranking_permutation = util_calloc( ens_size , sizeof * ranking_permutation ); - for (src_iens = 0; src_iens < ens_size; src_iens++) - ranking_permutation[src_iens] = src_iens; - } - - for (inode =0; inode < stringlist_get_size( node_list ); inode++) { - enkf_config_node_type * config_node = ensemble_config_get_node( enkf_main_get_ensemble_config(enkf_main) , stringlist_iget( node_list , inode )); - for (src_iens = 0; src_iens < enkf_main_get_ensemble_size( enkf_main ); src_iens++) { - if (bool_vector_safe_iget(iens_mask , src_iens)) { - int target_iens = ranking_permutation[src_iens]; - node_id_type src_id = {.report_step = source_report_step , .iens = src_iens }; - node_id_type target_id = {.report_step = target_report_step , .iens = target_iens }; - - /* The copy is careful ... */ - if (enkf_config_node_has_node( config_node , source_case_fs , src_id)) - enkf_node_copy( config_node , - source_case_fs , target_case_fs , - src_id , target_id ); - - if (0 == target_report_step) - state_map_iset(target_state_map, target_iens, STATE_INITIALIZED); - } - } - } - - if (ranking_permutation == NULL) - free( ranking_permutation ); - } -} - - - -void enkf_main_init_current_case_from_existing(enkf_main_type * enkf_main, - enkf_fs_type * source_case_fs, - int source_report_step) { - - enkf_fs_type * current_fs = enkf_main_get_fs(enkf_main); - - enkf_main_init_case_from_existing(enkf_main, - source_case_fs, - source_report_step, - current_fs); - -} - - -void enkf_main_init_current_case_from_existing_custom(enkf_main_type * enkf_main, - enkf_fs_type * source_case_fs, - int source_report_step, - stringlist_type * node_list, - bool_vector_type * iactive) { - - enkf_fs_type * current_fs = enkf_main_get_fs(enkf_main); - - enkf_main_init_case_from_existing_custom(enkf_main, - source_case_fs, - source_report_step, - current_fs, - node_list, - iactive); - -} - - -void enkf_main_init_case_from_existing(const enkf_main_type * enkf_main, - enkf_fs_type * source_case_fs, - int source_report_step, - enkf_fs_type * target_case_fs ) { - - stringlist_type * param_list = ensemble_config_alloc_keylist_from_var_type( enkf_main_get_ensemble_config(enkf_main) , PARAMETER ); /* Select only paramters - will fail for GEN_DATA of type DYNAMIC_STATE. */ - int target_report_step = 0; - bool_vector_type * iactive = bool_vector_alloc( 0 , true ); - - enkf_main_copy_ensemble(enkf_main, - source_case_fs, - source_report_step, - target_case_fs, - target_report_step, - iactive, - NULL, - param_list); - - - enkf_fs_fsync(target_case_fs); - - bool_vector_free(iactive); - stringlist_free(param_list); -} - - -void enkf_main_init_case_from_existing_custom(const enkf_main_type * enkf_main, - enkf_fs_type * source_case_fs, - int source_report_step, - enkf_fs_type * target_case_fs, - stringlist_type * node_list, - bool_vector_type * iactive) { - - int target_report_step = 0; - - enkf_main_copy_ensemble(enkf_main, - source_case_fs, - source_report_step, - target_case_fs, - target_report_step, - iactive, - NULL, - node_list); - - enkf_fs_fsync(target_case_fs); -} - - - - -/** - This function will go through the filesystem and check that we have - initial data for all parameters and all realizations. If the second - argument mask is different from NULL, the function will only - consider the realizations for which mask is true (if mask == NULL - all realizations will be checked). -*/ - -static bool enkf_main_case_is_initialized__( const enkf_main_type * enkf_main , enkf_fs_type * fs , bool_vector_type * __mask) { - stringlist_type * parameter_keys = ensemble_config_alloc_keylist_from_var_type( enkf_main->ensemble_config , PARAMETER ); - bool_vector_type * mask; - bool initialized = true; - int ikey = 0; - if (__mask != NULL) - mask = __mask; - else - mask = bool_vector_alloc(0 , true ); - - while ((ikey < stringlist_get_size( parameter_keys )) && (initialized)) { - const enkf_config_node_type * config_node = ensemble_config_get_node( enkf_main->ensemble_config , stringlist_iget( parameter_keys , ikey) ); - int iens = 0; - do { - if (bool_vector_safe_iget( mask , iens)) { - node_id_type node_id = {.report_step = 0 , .iens = iens }; - initialized = enkf_config_node_has_node( config_node , fs , node_id); - } - iens++; - } while ((iens < enkf_main->ens_size) && (initialized)); - ikey++; - } - - stringlist_free( parameter_keys ); - if (__mask == NULL) - bool_vector_free( mask ); - return initialized; -} - - - -bool enkf_main_case_is_initialized( const enkf_main_type * enkf_main , const char * case_name , bool_vector_type * __mask) { - enkf_fs_type * fs = enkf_main_mount_alt_fs(enkf_main , case_name , false ); - if (fs) { - bool initialized = enkf_main_case_is_initialized__(enkf_main , fs , __mask); - enkf_fs_decref( fs ); - return initialized; - } else - return false; -} - - - -bool enkf_main_is_initialized( const enkf_main_type * enkf_main , bool_vector_type * __mask) { - return enkf_main_case_is_initialized__(enkf_main , enkf_main->dbase , __mask); -} - - -static void update_case_log(enkf_main_type * enkf_main , const char * case_path) { - /* : Update a small text file with the name of the host currently - running ert, the pid number of the process, the active case - and when it started. - - If the previous shutdown was unclean the file will be around, - and we will need the info from the previous invocation which - is in the file. For that reason we open with mode 'a' instead - of 'w'. - */ - - const char * ens_path = model_config_get_enspath( enkf_main->model_config); - - { - int buffer_size = 256; - char * current_host = util_alloc_filename( ens_path , CASE_LOG , NULL ); - FILE * stream = util_fopen( current_host , "a"); - - fprintf(stream , "CASE:%-16s " , case_path ); - fprintf(stream , "PID:%-8d " , getpid()); - { - char hostname[buffer_size]; - gethostname( hostname , buffer_size ); - fprintf(stream , "HOST:%-16s " , hostname ); - } - - - { - int year,month,day,hour,minute,second; - time_t now = time( NULL ); - - util_set_datetime_values_utc( now , &second , &minute , &hour , &day , &month , &year ); - - fprintf(stream , "TIME:%02d/%02d/%4d-%02d.%02d.%02d\n" , day , month , year , hour , minute , second); - } - fclose( stream ); - free( current_host ); - } -} - - - -static void enkf_main_write_current_case_file( const enkf_main_type * enkf_main, const char * case_path) { - const char * ens_path = model_config_get_enspath( enkf_main->model_config); - const char * base = CURRENT_CASE_FILE; - char * current_case_file = util_alloc_filename(ens_path , base, NULL); - FILE * stream = util_fopen( current_case_file , "w"); - fprintf(stream, "%s", case_path); - util_fclose(stream); - free(current_case_file); -} - - -static void enkf_main_gen_data_special( enkf_main_type * enkf_main , enkf_fs_type * fs ) { - stringlist_type * gen_data_keys = ensemble_config_alloc_keylist_from_impl_type( enkf_main->ensemble_config , GEN_DATA); - for (int i=0; i < stringlist_get_size( gen_data_keys ); i++) { - enkf_config_node_type * config_node = ensemble_config_get_node( enkf_main->ensemble_config , stringlist_iget( gen_data_keys , i)); - gen_data_config_type * gen_data_config = enkf_config_node_get_ref( config_node ); - - if (gen_data_config_is_dynamic( gen_data_config )) - gen_data_config_set_ens_size( gen_data_config , enkf_main->ens_size ); - - } - stringlist_free( gen_data_keys ); -} - - -static void enkf_main_update_current_case( enkf_main_type * enkf_main , const char * case_path /* Can be NULL */) { - if (!case_path) - case_path = enkf_fs_get_case_name( enkf_main_get_fs(enkf_main) ); - - enkf_main_write_current_case_file(enkf_main, case_path); - update_case_log(enkf_main , case_path); - - enkf_main_gen_data_special( enkf_main , enkf_main_get_fs( enkf_main )); - enkf_main_add_subst_kw( enkf_main , "ERT-CASE" , enkf_main_get_current_fs( enkf_main ) , "Current case" , true ); - enkf_main_add_subst_kw( enkf_main , "ERTCASE" , enkf_main_get_current_fs( enkf_main ) , "Current case" , true ); -} - - - -static void enkf_main_create_fs( const enkf_main_type * enkf_main , const char * case_path ) { - char * new_mount_point = enkf_main_alloc_mount_point( enkf_main , case_path ); - - enkf_fs_create_fs( new_mount_point, - model_config_get_dbase_type( enkf_main->model_config ) , - model_config_get_dbase_args( enkf_main->model_config ) , - false ); - - free( new_mount_point ); -} - - -const char * enkf_main_get_mount_root( const enkf_main_type * enkf_main) { - return model_config_get_enspath( enkf_main->model_config); -} - - - -char * enkf_main_alloc_mount_point( const enkf_main_type * enkf_main , const char * case_path) { - char * mount_point; - if (util_is_abs_path( case_path )) - mount_point = util_alloc_string_copy( case_path ); - else - mount_point = util_alloc_filename( model_config_get_enspath( enkf_main->model_config) , case_path , NULL); - return mount_point; -} - -/* - Return a weak reference - i.e. the refcount is not increased. -*/ -enkf_fs_type * enkf_main_get_fs(const enkf_main_type * enkf_main) { - return enkf_main->dbase; -} - -enkf_fs_type * enkf_main_tui_get_fs(const enkf_main_type * enkf_main) { - return enkf_main->dbase; -} - -enkf_fs_type * enkf_main_job_get_fs(const enkf_main_type * enkf_main) { - return enkf_main->dbase; -} - - -enkf_fs_type * enkf_main_get_fs_ref(const enkf_main_type * enkf_main) { - return enkf_fs_get_ref( enkf_main->dbase ); -} - - -const char * enkf_main_get_current_fs( const enkf_main_type * enkf_main ) { - return enkf_fs_get_case_name( enkf_main->dbase ); -} - - - -/* - This function will return a valid enkf_fs instance; either just a - pointer to the current enkf_main->dbase, or alternatively it will - create a brand new fs instance. Because we do not really know whether - a new instance has been created or not resource handling becomes - slightly non trivial: - - - 1. When calling scope is finished with the enkf_fs instance it - must call enkf_fs_decref(); the enkf_fs_decref() function will - close the filesystem and free all resources when the reference - count has reached zero. -*/ - - -enkf_fs_type * enkf_main_mount_alt_fs(const enkf_main_type * enkf_main , const char * case_path , bool create) { - if (enkf_main_case_is_current( enkf_main , case_path )) { - // Fast path - we just return a reference to the currently selected case; - // with increased refcount. - enkf_fs_incref( enkf_main->dbase ); - return enkf_main->dbase; - } else { - // We have asked for an alterantive fs - must mount and possibly create that first. - enkf_fs_type * new_fs = NULL; - if (case_path != NULL) { - char * new_mount_point = enkf_main_alloc_mount_point( enkf_main , case_path ); - - if (!enkf_fs_exists( new_mount_point )) { - if (create) - enkf_main_create_fs( enkf_main , case_path ); - } - - new_fs = enkf_fs_mount( new_mount_point ); - if (new_fs) { - const model_config_type * model_config = enkf_main_get_model_config( enkf_main ); - const ecl_sum_type * refcase = model_config_get_refcase( model_config ); - - if (refcase) { - time_map_type * time_map = enkf_fs_get_time_map( new_fs ); - if (time_map_attach_refcase( time_map , refcase)) - time_map_set_strict( time_map , false ); - else - ert_log_add_fmt_message(1 , stderr , "Warning mismatch between refcase:%s and existing case:%s" , ecl_sum_get_case( refcase ) , new_mount_point); - } - } - - free( new_mount_point ); - } - return new_fs; - } -} - - -static void enkf_main_update_summary_config_from_fs__(enkf_main_type * enkf_main, enkf_fs_type * fs) { - ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main); - summary_key_set_type * summary_key_set = enkf_fs_get_summary_key_set(fs); - stringlist_type * keys = summary_key_set_alloc_keys(summary_key_set); - - for(int i = 0; i < stringlist_get_size(keys); i++) { - const char * key = stringlist_iget(keys, i); - ensemble_config_add_summary(ensemble_config, key, LOAD_FAIL_SILENT); - } - stringlist_free( keys ); -} - - -static void enkf_main_update_custom_kw_config_from_fs__(enkf_main_type * enkf_main, enkf_fs_type * fs) { - ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main); - custom_kw_config_set_type * custom_kw_config_set = enkf_fs_get_custom_kw_config_set(fs); - - ensemble_config_update_custom_kw_config(ensemble_config, custom_kw_config_set); -} - - -/** - The enkf_fs instances employ a simple reference counting - scheme. The main point with this system is to avoid opening the - full timesystem more than necessary (this is quite compute - intensive). This is essentially achieved by: - - 1. Create new fs instances by using the function - enkf_main_mount_alt_fs() - depending on the input arguments - this will either create a new enkf_fs instance or it will - just return a pointer to currently open fs instance; with an - increased refcount. - - 2. When you are finished with working with filesystem pointer - call enkf_fs_unmount() - this will reduce the refcount with - one, and eventually discard the complete datastructure when - the refcount has reached zero. - - 3. By using the function enkf_main_get_fs() / - enkf_fs_get_weakref() you get a pointer to the current fs - instance WITHOUT INCREASING THE REFCOUNT. This means that - scope calling one of these functions does not get any - ownership to the enkf_fs instance. - - The enkf_main instance will take ownership of the enkf_fs instance; - this implies that the calling scope must have proper ownership of - the fs instance which is passed in. The return value from - enkf_main_get_fs() can NOT be used as input to this function; this - is not checked for in any way - but the crash will be horrible if - this is not adhered to. -*/ - -void enkf_main_set_fs( enkf_main_type * enkf_main , enkf_fs_type * fs , const char * case_path /* Can be NULL */) { - if (enkf_main->dbase != fs) { - enkf_fs_incref( fs ); - - if (enkf_main->dbase) - enkf_fs_decref(enkf_main->dbase); - - enkf_main->dbase = fs; - enkf_main_update_current_case(enkf_main, case_path); - - enkf_main_update_summary_config_from_fs__(enkf_main, fs); - enkf_main_update_custom_kw_config_from_fs__(enkf_main, fs); - } -} - - - -void enkf_main_select_fs( enkf_main_type * enkf_main , const char * case_path ) { - if (enkf_main_case_is_current( enkf_main , case_path )) - return; /* We have tried to select the currently selected case - just return. */ - else { - enkf_fs_type * new_fs = enkf_main_mount_alt_fs( enkf_main , case_path , true ); - if (enkf_main->dbase == new_fs) - util_abort("%s : return reference to current FS in situation where that should not happen.\n",__func__); - - if (new_fs != NULL) - enkf_main_set_fs( enkf_main , new_fs , case_path); - else { - const char * ens_path = model_config_get_enspath( enkf_main->model_config ); - util_exit("%s: select filesystem %s:%s failed \n",__func__ , ens_path , case_path ); - } - enkf_fs_decref( new_fs ); - } -} - - -static void enkf_main_user_select_initial_fs(enkf_main_type * enkf_main) { - const char * ens_path = model_config_get_enspath( enkf_main->model_config); - int root_version = enkf_fs_get_version104( ens_path ); - if (root_version == -1 || root_version == 105) { - char * current_mount_point = util_alloc_filename( ens_path , CURRENT_CASE , NULL); - - if (enkf_main_current_case_file_exists(enkf_main)) { - char * current_case = enkf_main_read_alloc_current_case_name(enkf_main); - enkf_main_select_fs(enkf_main, current_case); - free (current_case); - } else if (enkf_fs_exists( current_mount_point ) && util_is_link( current_mount_point )) { - /*If the current_case file does not exists, but the 'current' symlink does we use readlink to - get hold of the actual target before calling the enkf_main_select_fs() function. We then - write the current_case file and delete the symlink.*/ - char * target_case = util_alloc_atlink_target( ens_path , CURRENT_CASE ); - enkf_main_select_fs( enkf_main , target_case ); - unlink(current_mount_point); - enkf_main_write_current_case_file(enkf_main, target_case); - free( target_case ); - } else - enkf_main_select_fs( enkf_main , DEFAULT_CASE ); // Selecting (a new) default case - - free( current_mount_point ); - } else { - fprintf(stderr,"Sorry: the filesystem located in %s must be upgraded before the current ERT version can read it.\n" , ens_path); - exit(1); - } -} - - -bool enkf_main_fs_exists(const enkf_main_type * enkf_main, const char * input_case){ - bool exists = false; - char * new_mount_point = enkf_main_alloc_mount_point( enkf_main , input_case); - if(enkf_fs_exists( new_mount_point )) - exists = true; - - free( new_mount_point ); - return exists; -} - - - -state_map_type * enkf_main_alloc_readonly_state_map( const enkf_main_type * enkf_main , const char * case_path) { - char * mount_point = enkf_main_alloc_mount_point( enkf_main , case_path ); - state_map_type * state_map = enkf_fs_alloc_readonly_state_map( mount_point ); - free( mount_point ); - return state_map; -} - - - -time_map_type * enkf_main_alloc_readonly_time_map( const enkf_main_type * enkf_main , const char * case_path ) { - char * mount_point = enkf_main_alloc_mount_point( enkf_main , case_path ); - time_map_type * time_map = enkf_fs_alloc_readonly_time_map( mount_point ); - free( mount_point ); - return time_map; -} - - -void enkf_main_close_fs( enkf_main_type * enkf_main ) { - if (enkf_main->dbase != NULL) - enkf_fs_decref( enkf_main->dbase ); -} - diff --git a/ThirdParty/Ert/libenkf/src/enkf_main_update.c b/ThirdParty/Ert/libenkf/src/enkf_main_update.c deleted file mode 100644 index bff4eb8ee8..0000000000 --- a/ThirdParty/Ert/libenkf/src/enkf_main_update.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_main_update.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include - -/** - This file implements functions related to updating the state. The - really low level functions related to the analysis is implemented - in enkf_analysis.h. - - This file only implements code for updating, and not any data - structures. -*/ - -#include "enkf_main_struct.h" - - diff --git a/ThirdParty/Ert/libenkf/src/enkf_node.c b/ThirdParty/Ert/libenkf/src/enkf_node.c deleted file mode 100644 index 38f185ef89..0000000000 --- a/ThirdParty/Ert/libenkf/src/enkf_node.c +++ /dev/null @@ -1,1077 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_node.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/** - A small illustration (says more than thousand words ...) of how the - enkf_node, enkf_config_node, field[1] and field_config[1] objects - are linked. - - - ================ - | | o----------- - | ================ | ===================== - | | | o-------- | | - | | ================ |-------------> | | - | | | | | | enkf_config_node | - | | | | | | | - ===| | enkf_node | o------ | | - o | | | | | - | ===| | ===================== - | o | | o - | | ================ | - | | o | - | \ | | - | \ | | - | | | | - | | | | - | | | | - | | | | - \|/ | | | - ======|======|== \|/ - | \|/ | | o----------- - | ==========|===== | ===================== - | | \|/ | o-------- | | - | | ================ |-------------> | | - | | | | | | field_config | - | | | | | | | - ===| | field | o------ | | - | | | | | - === | | ===================== - | | - ================ - - - To summarize in words: - - * The enkf_node object is an abstract object, which again contains - a spesific enkf_object, like e.g. the field objects shown - here. In general we have an ensemble of enkf_node objects. - - * The enkf_node objects contain a pointer to a enkf_config_node - object. - - * The enkf_config_node object contains a pointer to the spesific - config object, i.e. field_config in this case. - - * All the field objects contain a pointer to a field_config object. - - - [1]: field is just an example, and could be replaced with any of - the enkf object types. -*/ - -/*-----------------------------------------------------------------*/ - -/** - A note on memory - ================ - - The enkf_nodes can consume large amounts of memory, and for large - models/ensembles we have a situation where not all the - members/fields can be in memory simultanouesly - such low-memory - situations are not really supported at the moment, but we have - implemented some support for such problems: - - o All enkf objects should have a xxx_realloc_data() function. This - function should be implemented in such a way that it is always - safe to call, i.e. if the object already has allocated data the - function should just return. - - o All enkf objects should implement a xxx_free_data() - function. This function free the data of the object, and set the - data pointer to NULL. - - - The following 'rules' apply to the memory treatment: - ---------------------------------------------------- - - o Functions writing to memory can always be called, and it is their - responsibility to allocate memory before actually writing on it. The - writer functions are: - - enkf_node_initialize() - enkf_node_fread() - enkf_node_forward_load() - - These functions should all start with a call to - enkf_node_ensure_memory(). The (re)allocation of data is done at - the enkf_node level, and **NOT** in the low level object - (altough that is where it is eventually done of course). - - o When it comes to functions reading memory it is a bit more - tricky. It could be that if the functions are called without - memory, that just means that the object is not active or - something (and the function should just return). On the other - hand trying to read a NULL pointer does indicate that program - logic is not fully up to it? And should therefor maybe be - punished? - - o The only memory operation which is exported to 'user-space' - (i.e. the enkf_state object) is enkf_node_free_data(). - -*/ - - -/** - Keeeping track of node state. - ============================= - - To keep track of the state of the node's data (actually the data of - the contained enkf_object, i.e. a field) we have three higly - internal variables __state, __modified , __iens, and - __report_step. These three variables are used/updated in the - following manner: - - - - 1. The nodes are created with (modified, report_step, state, iens) == - (true , -1 , undefined , -1). - - 2. After initialization we set: report_step -> 0 , state -> - analyzed, modified -> true, iens -> -1 - - 3. After load (both from ensemble and ECLIPSE). We set modified -> - false, and report_step, state and iens according to the load - arguments. - - 4. After deserialize (i.e. update) we set modified -> true. - - 5. After write (to ensemble) we set in the same way as after load. - - 6. After free_data we invalidate according to the newly allocated - status. - - 7. In the ens_load routine we check if modified == false and the - report_step and state arguments agree with the current - values. IN THAT CASE WE JUST RETURN WITHOUT ACTUALLY HITTING - THE FILESYSTEM. This performance gain is the main point of the - whole excercise. -*/ - - - -#define ENKF_NODE_TYPE_ID 71043086 - -struct enkf_node_struct { - UTIL_TYPE_ID_DECLARATION; - alloc_ftype * alloc; - ecl_write_ftype * ecl_write; - forward_load_ftype * forward_load; - forward_load_vector_ftype * forward_load_vector; - free_data_ftype * free_data; - user_get_ftype * user_get; - user_get_vector_ftype * user_get_vector; - set_inflation_ftype * set_inflation; - fload_ftype * fload; - has_data_ftype * has_data; - - serialize_ftype * serialize; - deserialize_ftype * deserialize; - read_from_buffer_ftype * read_from_buffer; - write_to_buffer_ftype * write_to_buffer; - initialize_ftype * initialize; - node_free_ftype * freef; - clear_ftype * clear; - node_copy_ftype * copy; - scale_ftype * scale; - iadd_ftype * iadd; - imul_ftype * imul; - isqrt_ftype * isqrt; - iaddsqr_ftype * iaddsqr; - - /******************************************************************/ - bool vector_storage; - char *node_key; /* The (hash)key this node is identified with. */ - void *data; /* A pointer to the underlying enkf_object, i.e. gen_kw_type instance, or a field_type instance or ... */ - const enkf_config_node_type *config; /* A pointer to a enkf_config_node instance (which again cointans a pointer to the config object of data). */ - /*****************************************************************/ - - vector_type *container_nodes; -}; - - -const enkf_config_node_type * enkf_node_get_config(const enkf_node_type * node) { - return node->config; -} - - -bool enkf_node_vector_storage( const enkf_node_type * node ) { - return node->vector_storage; -} - -static UTIL_IS_INSTANCE_FUNCTION( enkf_node , ENKF_NODE_TYPE_ID ) - - -/*****************************************************************/ - -/* - All the function pointers REALLY should be in the config object ... -*/ - - -#define FUNC_ASSERT(func) if (func == NULL) util_abort("%s: function handler: %s not registered for node:%s - aborting\n",__func__ , #func , enkf_node->node_key); - - - - -void enkf_node_alloc_domain_object(enkf_node_type * node) { - if (node->data != NULL) - node->freef( node->data ); - node->data = node->alloc(enkf_config_node_get_ref(node->config)); -} - - - - -enkf_node_type * enkf_node_copyc(const enkf_node_type * enkf_node) { - FUNC_ASSERT(enkf_node->copy); - { - const enkf_node_type * src = enkf_node; - enkf_node_type * target; - target = enkf_node_alloc(src->config); - src->copy( src->data , target->data ); /* Calling the low level copy function */ - return target; - } -} - - - -bool enkf_node_include_type(const enkf_node_type * enkf_node, int mask) { - return enkf_config_node_include_type(enkf_node->config , mask); -} - - -ert_impl_type enkf_node_get_impl_type(const enkf_node_type * enkf_node) { - return enkf_config_node_get_impl_type(enkf_node->config); -} - - -enkf_var_type enkf_node_get_var_type(const enkf_node_type * enkf_node) { - return enkf_config_node_get_var_type(enkf_node->config); -} - -bool enkf_node_use_forward_init( const enkf_node_type * enkf_node ) { - return enkf_config_node_use_forward_init( enkf_node->config ); -} - - - -void * enkf_node_value_ptr(const enkf_node_type * enkf_node) { - return enkf_node->data; -} - - - -/** - This function calls the node spesific ecl_write function. IF the - ecl_file of the (node == NULL) *ONLY* the path is sent to the node - spesific file. -*/ - -void enkf_node_ecl_write(const enkf_node_type *enkf_node , const char *path , void * filestream , int report_step) { - if (enkf_node->ecl_write != NULL) { - char * node_eclfile = enkf_config_node_alloc_outfile(enkf_node->config , report_step); /* Will return NULL if the node does not have any outfile format. */ - /* - If the node does not have a outfile (i.e. ecl_file), the - ecl_write function will be called with file argument NULL. It - is then the responsability of the low-level implementation to - do "the right thing". - */ - enkf_node->ecl_write(enkf_node->data , path , node_eclfile , filestream); - util_safe_free( node_eclfile ); - } -} - - - -/** - This function takes a string - key - as input an calls a node - specific function to look up one scalar based on that key. The key - is always a string, but the the type of content will vary for the - different objects. For a field, the key will be a string of "i,j,k" - for a cell. - - If the user has asked for something which does not exist the - function SHOULD NOT FAIL; it should return false and set the *value - to 0. -*/ - - -bool enkf_node_user_get(enkf_node_type * enkf_node , enkf_fs_type * fs , const char * key , node_id_type node_id , double * value) { - return enkf_node_user_get_no_id( enkf_node , fs , key , node_id.report_step , node_id.iens , value ); -} - -bool enkf_node_user_get_no_id(enkf_node_type * enkf_node , enkf_fs_type * fs , const char * key , int report_step, int iens, double * value) { - node_id_type node_id = {.report_step = report_step , .iens = iens}; - bool loadOK; - FUNC_ASSERT( enkf_node->user_get ); - { - loadOK = enkf_node_try_load( enkf_node , fs , node_id); - - if (loadOK) - return enkf_node->user_get(enkf_node->data , key , report_step, value); - else { - *value = 0; - return false; - } - } -} - -bool enkf_node_user_get_vector( enkf_node_type * enkf_node , enkf_fs_type * fs , const char * key , int iens , double_vector_type * values) { - if (enkf_node->vector_storage) { - if (enkf_node_try_load_vector( enkf_node , fs , iens )) { - enkf_node->user_get_vector( enkf_node->data , key , values); - return true; - } else - return false; - } else { - util_abort("%s: internal error - function should only be called by nodes with vector storage.\n",__func__); - return false; - } -} - - - -bool enkf_node_fload( enkf_node_type * enkf_node , const char * filename ) { - FUNC_ASSERT( enkf_node->fload ); - return enkf_node->fload( enkf_node->data , filename ); -} - - - -/** - This function loads (internalizes) ECLIPSE results, the ecl_file - instance with restart data, and the ecl_sum instance with summary - data must already be loaded by the calling function. - - IFF the enkf_node has registered a filename to load from, that is - passed to the specific load function, otherwise the run_path is sent - to the load function. - - If the node does not have a forward_load function, the function just - returns. -*/ - - -bool enkf_node_forward_load(enkf_node_type *enkf_node , const forward_load_context_type * load_context) { - bool loadOK; - FUNC_ASSERT(enkf_node->forward_load); - { - if (enkf_node_get_impl_type(enkf_node) == SUMMARY) - /* Fast path for loading summary data. */ - loadOK = enkf_node->forward_load(enkf_node->data , NULL , load_context); - else { - char * input_file = enkf_config_node_alloc_infile(enkf_node->config , forward_load_context_get_load_step( load_context )); - - if (input_file != NULL) { - char * file = util_alloc_filename( forward_load_context_get_run_path( load_context ) , input_file , NULL); - loadOK = enkf_node->forward_load(enkf_node->data , file , load_context); - free(file); - } else - loadOK = enkf_node->forward_load(enkf_node->data , NULL , load_context); - - util_safe_free( input_file ); - } - } - return loadOK; -} - - -bool enkf_node_forward_init(enkf_node_type * enkf_node , const char * run_path , int iens) { - char * init_file = enkf_config_node_alloc_initfile( enkf_node->config , run_path , iens ); - bool init = enkf_node->initialize(enkf_node->data , iens , init_file, NULL); - util_safe_free( init_file ); - return init; -} - - - -bool enkf_node_forward_load_vector(enkf_node_type *enkf_node , const forward_load_context_type * load_context , const int_vector_type * time_index) { - bool loadOK; - FUNC_ASSERT(enkf_node->forward_load_vector); - loadOK = enkf_node->forward_load_vector(enkf_node->data , NULL , load_context , time_index); - - return loadOK; -} - - - - - - -/** - This function compares the internal __report_step with the input - report_step, and return true if they are equal. It is used in the - calling scope to discard static nodes which are no longer in use. -*/ - - - -static bool enkf_node_store_buffer( enkf_node_type * enkf_node , enkf_fs_type * fs , int report_step , int iens) { - FUNC_ASSERT(enkf_node->write_to_buffer); - { - bool data_written; - buffer_type * buffer = buffer_alloc( 100 ); - const enkf_config_node_type * config_node = enkf_node_get_config( enkf_node ); - buffer_fwrite_time_t( buffer , time(NULL)); - data_written = enkf_node->write_to_buffer(enkf_node->data , buffer , report_step ); - if (data_written) { - const char * node_key = enkf_config_node_get_key( config_node ); - enkf_var_type var_type = enkf_config_node_get_var_type( config_node ); - - if (enkf_node->vector_storage) - enkf_fs_fwrite_vector( fs , buffer , node_key , var_type , iens ); - else - enkf_fs_fwrite_node( fs , buffer , node_key , var_type , report_step , iens ); - - } - buffer_free( buffer ); - return data_written; - } -} - -bool enkf_node_store_vector(enkf_node_type *enkf_node , enkf_fs_type * fs , int iens ) { - return enkf_node_store_buffer( enkf_node , fs , -1 , iens ); -} - - - -bool enkf_node_store(enkf_node_type * enkf_node , enkf_fs_type * fs , bool force_vectors , node_id_type node_id) { - if (enkf_node->vector_storage) { - if (force_vectors) - return enkf_node_store_vector( enkf_node , fs , node_id.iens ); - else - return false; - } else { - if (node_id.report_step == 0) { - ert_impl_type impl_type = enkf_node_get_impl_type(enkf_node); - if (impl_type == SUMMARY) - return false; /* For report step == 0 the summary data is just garbage. */ - } - - return enkf_node_store_buffer( enkf_node , fs , node_id.report_step , node_id.iens ); - } -} - - - -/** - This function will load a node from the filesystem if it is - available; if not it will just return false. - - The state argument can be 'both' - in which case it will first try - the analyzed, and then subsequently the forecast before giving up - and returning false. If the function returns true with state == - 'both' it is no way to determine which version was actually loaded. -*/ - -bool enkf_node_try_load(enkf_node_type *enkf_node , enkf_fs_type * fs , node_id_type node_id) { - if (enkf_node_has_data( enkf_node , fs , node_id)) { - enkf_node_load( enkf_node , fs , node_id); - return true; - } else - return false; -} - - -static void enkf_node_buffer_load( enkf_node_type * enkf_node , enkf_fs_type * fs , int report_step , int iens) { - FUNC_ASSERT(enkf_node->read_from_buffer); - { - buffer_type * buffer = buffer_alloc( 100 ); - const enkf_config_node_type * config_node = enkf_node_get_config( enkf_node ); - const char * node_key = enkf_config_node_get_key( config_node ); - enkf_var_type var_type = enkf_config_node_get_var_type( config_node ); - - if (enkf_node->vector_storage) - enkf_fs_fread_vector( fs , buffer , node_key , var_type , iens ); - else - enkf_fs_fread_node( fs , buffer , node_key , var_type , report_step , iens ); - - buffer_fskip_time_t( buffer ); - enkf_node->read_from_buffer(enkf_node->data , buffer , fs , report_step ); - buffer_free( buffer ); - } -} - - - - -void enkf_node_load_vector( enkf_node_type * enkf_node , enkf_fs_type * fs , int iens ) { - enkf_node_buffer_load( enkf_node , fs , -1 , iens ); -} - - - -static void enkf_node_load_container( enkf_node_type * enkf_node , enkf_fs_type * fs , node_id_type node_id ) { - for (int inode=0; inode < vector_get_size( enkf_node->container_nodes ); inode++) { - enkf_node_type * child_node = vector_iget( enkf_node->container_nodes , inode ); - enkf_node_load( child_node , fs , node_id ); - } -} - - -void enkf_node_load(enkf_node_type * enkf_node , enkf_fs_type * fs , node_id_type node_id) { - if (enkf_node_get_impl_type(enkf_node) == CONTAINER) - enkf_node_load_container( enkf_node , fs , node_id ); - else { - if (enkf_node->vector_storage) - enkf_node_load_vector( enkf_node , fs , node_id.iens ); - else - /* Normal load path */ - enkf_node_buffer_load( enkf_node , fs , node_id.report_step, node_id.iens ); - } -} - - -bool enkf_node_try_load_vector(enkf_node_type *enkf_node , enkf_fs_type * fs , int iens ) { - if (enkf_config_node_has_vector( enkf_node->config , fs , iens)) { - enkf_node_load_vector( enkf_node , fs , iens ); - return true; - } else - return false; -} - - - - - -/* - In the case of nodes with vector storage this function - will load the entire vector. -*/ - -enkf_node_type * enkf_node_load_alloc( const enkf_config_node_type * config_node , enkf_fs_type * fs , node_id_type node_id) { - if (enkf_config_node_vector_storage( config_node )) { - if (enkf_config_node_has_vector( config_node , fs , node_id.iens)) { - enkf_node_type * node = enkf_node_alloc( config_node ); - enkf_node_load( node , fs , node_id ); - return node; - } else { - util_abort("%s: could not load vector:%s from iens:%d\n",__func__ , enkf_config_node_get_key( config_node ), - node_id.iens ); - return NULL; - } - } else { - if (enkf_config_node_has_node( config_node , fs , node_id)) { - enkf_node_type * node = enkf_node_alloc( config_node ); - enkf_node_load( node , fs , node_id ); - return node; - } else { - util_abort("%s: Could not load node: key:%s iens:%d report:%d \n", - __func__ , - enkf_config_node_get_key( config_node ) , - node_id.iens , node_id.report_step ); - return NULL; - } - } -} - - - -void enkf_node_copy(const enkf_config_node_type * config_node , - enkf_fs_type * src_case, - enkf_fs_type * target_case, - node_id_type src_id , - node_id_type target_id) { - - enkf_node_type * enkf_node = enkf_node_load_alloc(config_node, src_case , src_id); - - - /* Hack to ensure that size is set for the gen_data instances. - This sneeks low level stuff into a high level scope. BAD. */ - { - ert_impl_type impl_type = enkf_node_get_impl_type( enkf_node ); - if (impl_type == GEN_DATA) { - /* Read the size at report_step_from */ - gen_data_type * gen_data = enkf_node_value_ptr( enkf_node ); - int size = gen_data_get_size( gen_data ); - - /* Enforce the size at report_step_to */ - gen_data_assert_size( gen_data , size , target_id.report_step); - } - } - - enkf_node_store(enkf_node, target_case , true , target_id ); - enkf_node_free(enkf_node); -} - -bool enkf_node_has_data( enkf_node_type * enkf_node , enkf_fs_type * fs , node_id_type node_id) { - if (enkf_node->vector_storage) { - FUNC_ASSERT(enkf_node->has_data); - { - int report_step = node_id.report_step; - int iens = node_id.iens; - - // Try to load the vector. - if (enkf_config_node_has_vector( enkf_node->config , fs , iens )) { - enkf_node_load_vector( enkf_node , fs , iens); - - // The vector is loaded. Check if we have the report_step/state asked for: - return enkf_node->has_data( enkf_node->data , report_step ); - } else - return false; - } - } else - return enkf_config_node_has_node( enkf_node->config , fs , node_id ); -} - - -/** - Copy an ensemble of nodes. Note that the limits are inclusive. -*/ - -void enkf_node_copy_ensemble(const enkf_config_node_type * config_node , - enkf_fs_type * src_case , - enkf_fs_type * target_case , - int report_step_from, /* src state */ - int report_step_to , /* target state */ - int ens_size, - const perm_vector_type * permutations) { - - node_id_type src_id = {.report_step = report_step_from , .iens = 0 }; - node_id_type target_id = {.report_step = report_step_to , .iens = 0 }; - - for(int iens_from = 0; iens_from < ens_size; iens_from++) { - int iens_to; - if (permutations == NULL) - iens_to = iens_from; - else - iens_to = perm_vector_iget(permutations, iens_from); - - src_id.iens = iens_from; - target_id.iens = iens_to; - - enkf_node_copy(config_node , src_case , target_case , src_id , target_id ); - } -} - - - -enkf_node_type ** enkf_node_load_alloc_ensemble( const enkf_config_node_type * config_node , enkf_fs_type * fs , - int report_step , int iens1 , int iens2) { - enkf_node_type ** ensemble = util_calloc( (iens2 - iens1) , sizeof * ensemble ); - for (int iens = iens1; iens < iens2; iens++) { - node_id_type node_id = {.report_step = report_step , .iens = iens }; - ensemble[iens - iens1] = NULL; - ensemble[iens - iens1] = enkf_node_load_alloc(config_node , fs , node_id); - } - - return ensemble; -} - - - - -void enkf_node_serialize(enkf_node_type *enkf_node , enkf_fs_type * fs, node_id_type node_id , - const active_list_type * active_list , matrix_type * A , int row_offset , int column) { - - FUNC_ASSERT(enkf_node->serialize); - enkf_node_load( enkf_node , fs , node_id); - enkf_node->serialize(enkf_node->data , node_id , active_list , A , row_offset , column); - -} - - - -void enkf_node_deserialize(enkf_node_type *enkf_node , enkf_fs_type * fs , node_id_type node_id, - const active_list_type * active_list , const matrix_type * A , int row_offset , int column) { - - FUNC_ASSERT(enkf_node->deserialize); - enkf_node->deserialize(enkf_node->data , node_id , active_list , A , row_offset , column); - enkf_node_store( enkf_node , fs , true , node_id ); -} - - - -void enkf_node_set_inflation( enkf_node_type * inflation , const enkf_node_type * std , const enkf_node_type * min_std) { - { - enkf_node_type * enkf_node = inflation; - FUNC_ASSERT(enkf_node->set_inflation); - } - inflation->set_inflation( inflation->data , std->data , min_std->data ); -} - - -void enkf_node_sqrt(enkf_node_type *enkf_node) { - FUNC_ASSERT(enkf_node->isqrt); - enkf_node->isqrt(enkf_node->data); -} - - -void enkf_node_scale(enkf_node_type *enkf_node , double scale_factor) { - FUNC_ASSERT(enkf_node->scale); - enkf_node->scale(enkf_node->data , scale_factor); -} - - -void enkf_node_iadd(enkf_node_type *enkf_node , const enkf_node_type * delta_node) { - FUNC_ASSERT(enkf_node->iadd); - enkf_node->iadd(enkf_node->data , delta_node->data); -} - - -void enkf_node_iaddsqr(enkf_node_type *enkf_node , const enkf_node_type * delta_node) { - FUNC_ASSERT(enkf_node->iaddsqr); - enkf_node->iaddsqr(enkf_node->data , delta_node->data); -} - - -void enkf_node_imul(enkf_node_type *enkf_node , const enkf_node_type * delta_node) { - FUNC_ASSERT(enkf_node->imul); - enkf_node->imul(enkf_node->data , delta_node->data); -} - - - -/** - The return value is whether any initialization has actually taken - place. If the function returns false it is for instance not - necessary to internalize anything. -*/ - -bool enkf_node_initialize(enkf_node_type *enkf_node, int iens , rng_type * rng) { - if (enkf_node_use_forward_init( enkf_node )) - return false; // This node will be initialized by loading results from the forward model. - else { - if (enkf_node->initialize != NULL) { - char * init_file = enkf_config_node_alloc_initfile( enkf_node->config , NULL , iens ); - bool init = enkf_node->initialize(enkf_node->data , iens , init_file, rng); - util_safe_free( init_file ); - return init; - } else - return false; /* No init performed */ - } -} - - - - -void enkf_node_clear(enkf_node_type *enkf_node) { - FUNC_ASSERT(enkf_node->clear); - enkf_node->clear(enkf_node->data); -} - - -void enkf_node_free(enkf_node_type *enkf_node) { - if (enkf_node->freef != NULL) - enkf_node->freef(enkf_node->data); - free(enkf_node->node_key); - vector_free(enkf_node->container_nodes); - free(enkf_node); -} - - -void enkf_node_free__(void *void_node) { - enkf_node_free((enkf_node_type *) void_node); -} - -const char * enkf_node_get_key(const enkf_node_type * enkf_node) { - return enkf_node->node_key; -} - - -#undef FUNC_ASSERT - - - -/*****************************************************************/ - - - -/* Manual inheritance - .... */ -static enkf_node_type * enkf_node_alloc_empty(const enkf_config_node_type *config ) { - const char *node_key = enkf_config_node_get_key(config); - ert_impl_type impl_type = enkf_config_node_get_impl_type(config); - enkf_node_type * node = util_malloc(sizeof * node ); - node->vector_storage = enkf_config_node_vector_storage( config ); - node->config = config; - node->node_key = util_alloc_string_copy(node_key); - node->data = NULL; - node->container_nodes = vector_alloc_new( ); - - /* - Start by initializing all function pointers to NULL. - */ - node->alloc = NULL; - node->ecl_write = NULL; - node->forward_load = NULL; - node->forward_load_vector = NULL; - node->copy = NULL; - node->initialize = NULL; - node->freef = NULL; - node->free_data = NULL; - node->user_get = NULL; - node->user_get_vector = NULL; - node->fload = NULL; - node->read_from_buffer = NULL; - node->write_to_buffer = NULL; - node->serialize = NULL; - node->deserialize = NULL; - node->clear = NULL; - node->set_inflation = NULL; - node->has_data = NULL; - - /* Math operations: */ - node->iadd = NULL; - node->scale = NULL; - node->isqrt = NULL; - node->iaddsqr = NULL; - node->imul = NULL; - - switch (impl_type) { - case(CONTAINER): - node->alloc = container_alloc__; - node->freef = container_free__; - break; - case(GEN_KW): - node->alloc = gen_kw_alloc__; - node->ecl_write = gen_kw_ecl_write__; - node->copy = gen_kw_copy__; - node->initialize = gen_kw_initialize__; - node->freef = gen_kw_free__; - node->user_get = gen_kw_user_get__; - node->write_to_buffer = gen_kw_write_to_buffer__; - node->read_from_buffer = gen_kw_read_from_buffer__; - node->serialize = gen_kw_serialize__; - node->deserialize = gen_kw_deserialize__; - node->clear = gen_kw_clear__; - node->iadd = gen_kw_iadd__; - node->scale = gen_kw_scale__; - node->iaddsqr = gen_kw_iaddsqr__; - node->imul = gen_kw_imul__; - node->isqrt = gen_kw_isqrt__; - node->set_inflation = gen_kw_set_inflation__; - node->fload = gen_kw_fload__; - break; - case(CUSTOM_KW): - node->alloc = custom_kw_alloc__; - node->freef = custom_kw_free__; - node->forward_load = custom_kw_forward_load__; - node->fload = custom_kw_fload__; - node->ecl_write = custom_kw_ecl_write__; - node->write_to_buffer = custom_kw_write_to_buffer__; - node->read_from_buffer = custom_kw_read_from_buffer__; - node->serialize = custom_kw_serialize__; - node->deserialize = custom_kw_deserialize__; - break; - case(SUMMARY): - node->forward_load = summary_forward_load__; - node->forward_load_vector = summary_forward_load_vector__; - node->alloc = summary_alloc__; - node->copy = summary_copy__; - node->freef = summary_free__; - node->user_get = summary_user_get__; - node->user_get_vector = summary_user_get_vector__; - node->read_from_buffer = summary_read_from_buffer__; - node->write_to_buffer = summary_write_to_buffer__; - node->serialize = summary_serialize__; - node->deserialize = summary_deserialize__; - node->clear = summary_clear__; - node->has_data = summary_has_data__; - /* - node->iadd = summary_iadd__; - node->scale = summary_scale__; - node->iaddsqr = summary_iaddsqr__; - node->imul = summary_imul__; - node->isqrt = summary_isqrt__; - */ - break; - case(SURFACE): - node->initialize = surface_initialize__; - node->ecl_write = surface_ecl_write__; - node->alloc = surface_alloc__; - node->copy = surface_copy__; - node->freef = surface_free__; - node->user_get = surface_user_get__; - node->read_from_buffer = surface_read_from_buffer__; - node->write_to_buffer = surface_write_to_buffer__; - node->serialize = surface_serialize__; - node->deserialize = surface_deserialize__; - node->clear = surface_clear__; - node->iadd = surface_iadd__; - node->scale = surface_scale__; - node->iaddsqr = surface_iaddsqr__; - node->imul = surface_imul__; - node->isqrt = surface_isqrt__; - node->fload = surface_fload__; - break; - case(FIELD): - node->alloc = field_alloc__; - node->ecl_write = field_ecl_write__; - node->forward_load = field_forward_load__; - node->copy = field_copy__; - node->initialize = field_initialize__; - node->freef = field_free__; - node->user_get = field_user_get__; - node->read_from_buffer = field_read_from_buffer__; - node->write_to_buffer = field_write_to_buffer__; - node->serialize = field_serialize__; - node->deserialize = field_deserialize__; - - node->clear = field_clear__; - node->set_inflation = field_set_inflation__; - node->iadd = field_iadd__; - node->scale = field_scale__; - node->iaddsqr = field_iaddsqr__; - node->imul = field_imul__; - node->isqrt = field_isqrt__; - node->fload = field_fload__; - break; - case(GEN_DATA): - node->alloc = gen_data_alloc__; - node->initialize = gen_data_initialize__; - node->copy = gen_data_copy__; - node->freef = gen_data_free__; - node->ecl_write = gen_data_ecl_write__; - node->forward_load = gen_data_forward_load__; - node->user_get = gen_data_user_get__; - node->read_from_buffer = gen_data_read_from_buffer__; - node->write_to_buffer = gen_data_write_to_buffer__; - node->serialize = gen_data_serialize__; - node->deserialize = gen_data_deserialize__; - node->set_inflation = gen_data_set_inflation__; - - node->clear = gen_data_clear__; - node->iadd = gen_data_iadd__; - node->scale = gen_data_scale__; - node->iaddsqr = gen_data_iaddsqr__; - node->imul = gen_data_imul__; - node->isqrt = gen_data_isqrt__; - //node->fload = gen_data_fload__; - break; - default: - util_abort("%s: implementation type: %d unknown - all hell is loose - aborting \n",__func__ , impl_type); - } - return node; -} - - - -#define CASE_SET(type , func) case(type): has_func = (func != NULL); break; -bool enkf_node_has_func(const enkf_node_type * node , node_function_type function_type) { - bool has_func = false; - switch (function_type) { - CASE_SET(alloc_func , node->alloc); - CASE_SET(ecl_write_func , node->ecl_write); - CASE_SET(forward_load_func , node->forward_load); - CASE_SET(copy_func , node->copy); - CASE_SET(initialize_func , node->initialize); - CASE_SET(free_func , node->freef); - default: - fprintf(stderr,"%s: node_function_identifier: %d not recognized - aborting \n",__func__ , function_type); - } - return has_func; -} -#undef CASE_SET - - - - -enkf_node_type * enkf_node_alloc(const enkf_config_node_type * config) { - enkf_node_type * node = enkf_node_alloc_empty(config); - UTIL_TYPE_ID_INIT( node , ENKF_NODE_TYPE_ID ); - enkf_node_alloc_domain_object(node); - return node; -} - - - - - -static void enkf_node_container_add_node( enkf_node_type * node , const enkf_node_type * child_node , bool shared) { - if (shared) - vector_append_ref( node->container_nodes , child_node ); - else - vector_append_owned_ref( node->container_nodes , child_node, enkf_node_free__ ); -} - -static enkf_node_type * enkf_node_alloc_container(const enkf_config_node_type * config, hash_type * node_hash , bool shared) { - enkf_node_type * container_node = enkf_node_alloc( config ); - { - for (int i=0; i < enkf_config_node_container_size( config ); i++) { - const enkf_config_node_type * child_config = enkf_config_node_container_iget( config , i ); - enkf_node_type * child_node; - - if (shared) - child_node = hash_get( node_hash , enkf_config_node_get_key( child_config )); - else - child_node = enkf_node_alloc( child_config ); - - enkf_node_container_add_node( container_node , child_node , shared); - container_add_node( enkf_node_value_ptr( container_node ) , enkf_node_value_ptr( child_node )); - } - } - return container_node; -} - -enkf_node_type * enkf_node_alloc_shared_container(const enkf_config_node_type * config, hash_type * node_hash) { - return enkf_node_alloc_container( config , node_hash , true ); -} - - -enkf_node_type * enkf_node_alloc_private_container(const enkf_config_node_type * config) { - return enkf_node_alloc_container( config , NULL , false ); -} - -enkf_node_type * enkf_node_deep_alloc(const enkf_config_node_type * config) { - if (enkf_config_node_get_impl_type( config ) == CONTAINER) { - enkf_node_type * container = enkf_node_alloc_container( config , NULL , false ); - container_assert_size( enkf_node_value_ptr( container )); - return container; - } else - return enkf_node_alloc( config ); -} - - - -bool enkf_node_internalize(const enkf_node_type * node, int report_step) { - return enkf_config_node_internalize( node->config , report_step ); -} - - -/*****************************************************************/ - - -ecl_write_ftype * enkf_node_get_func_pointer( const enkf_node_type * node ) { - return node->ecl_write; -} diff --git a/ThirdParty/Ert/libenkf/src/enkf_obs.c b/ThirdParty/Ert/libenkf/src/enkf_obs.c deleted file mode 100644 index 43fa6e60ad..0000000000 --- a/ThirdParty/Ert/libenkf/src/enkf_obs.c +++ /dev/null @@ -1,1270 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_obs.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - -The observation system ----------------------- - -The observation system in the EnKF code is a three layer system. At -the the top is the enkf_obs_type. The enkf_main object contains one -enkf_obs instance which has internalized ALL the observation data. In -enkf_obs the the data is internalized in a hash table, where the keys -in the table are the keys used the observation file. - -The next level is the obs_vector type which is a vector of length -num_report_steps. Each element in this vector can either point a -spesific observation instance (which actually contains the data), or -be NULL, if the observation is not active at this report step. In -addition the obs_vector contains function pointers to manipulate the -observation data at the lowest level. - -At the lowest level we have specific observation instances, -field_obs, summary_obs and gen_obs. These instances contain the actual -data. - -To summarize we can say: - - 1. enkf_obs has ALL the observation data. - - 2. obs_vector has the full time series for one observation key, - i.e. all the watercuts in well P2. - - 3. field_obs/gen_obs/summary_obs instances contain the actual - observed data for one (logical) observation and one report step. - - -In the following example we have two observations - - WWCT:OP1 The water cut in well OP1. This is an observation which is - active for many report steps, at the lowest level it is - implemented as summary_obs. - - RFT_P2 This is an RFT test for one well. Only active at one report - step, implemented at the lowest level as a field_obs instance. - - - In the example below there are in total five report steps, hence all - the obs_vector instances have five 'slots'. If there is no active - observation for a particular report step, the corresponding pointer - in the obs_vector instance is NULL. - - - - _____________________ _____________________ - / enkf_obs \ - | | - | | - | obs_hash: {"WWCT:OP1" , "RFT_P2"} | - | | | | - | | | | - \________________|___________|________________________/ - | | - | | - | | - | \--------------------------------------------------------------\ - | | - | | - \|/ | - |--- obs_vector: WWCT:OP1 -----------------------------------------------------| | - | Function pointers: -------- -------- -------- -------- -------- | | - | Pointing to the | | | | | | | | | | | | - | underlying | NULL | | X | | X | | NULL | | X | | | - | implementation in the | | | | | | | | | | | | | | | - | summary_obs object. -------- ---|---- ---|---- -------- ---|---- | | - |---------------------------------------|---------|-------------------|--------| | - | | | | - \|/ | | | - |-- summary_obs -| | \|/ | - | Value: 0.56.. | | |-- summary_obs -| | - | std : 0.15.. | | | Value: 0.70.. | | - |----------------| | | std : 0.25.. | | - | |----------------| | - \|/ | - |-- summary_obs -| | - | Value: 0.62.. | | - | std : 0.12.. | | - |----------------| | - | - | - | - The observation WWCT:OP1 is an observation of summary type, and the | - obs_vector contains pointers to summary_obs instances; along with | - function pointers to manipulate the summary_obs instances. The | - observation is not active for report steps 0 and 3, so for these | - report steps the obse vector has a NULL pointer. | - | - | - | - | - | - | - |--- obs_vector: RFT_P2 -------------------------------------------------------| | - | Function pointers: -------- -------- -------- -------- -------- | | - | Pointing to the | | | | | | | | | | |<---------------/ - | underlying | NULL | | NULL | | NULL | | X | | NULL | | - | implementation in the | | | | | | | | | | | | - | field_obs object. -------- -------- -------- ---|---- -------- | - |-----------------------------------------------------------|------------------| - | - | - \|/ - |-- field_obs -----------------------------------| - | i = 25 , j = 16, k = 10, value = 278, std = 10 | - | i = 25 , j = 16, k = 11, value = 279, std = 10 | - | i = 25 , j = 16, k = 12, value = 279, std = 10 | - | i = 25 , j = 17, k = 12, value = 281, std = 10 | - | i = 25 , j = 18, k = 12, value = 282, std = 10 | - |------------------------------------------------| - - - The observation RFT_P2 is an RFT observation which is only active at - one report step, i.e. 4/5 pointers in the obs_vector are just NULL - pointers. The actual observation(s) are stored in a field_obs - instance. - - */ - - -/** -TODO - - This static function header shall be removed when the - configuration is unified.... -*/ -static conf_class_type * enkf_obs_get_obs_conf_class(); - - - -////////////////////////////////////////////////////////////////////////////////////// - - -#define ENKF_OBS_TYPE_ID 637297 -struct enkf_obs_struct { - UTIL_TYPE_ID_DECLARATION; - /** A hash of obs_vector_types indexed by user provided keys. */ - vector_type * obs_vector; - hash_type * obs_hash; - time_map_type * obs_time; /* For fast lookup of report_step -> obs_time */ - - bool valid; - /* Several shared resources - can generally be NULL*/ - const history_type * history; /* A shared (not owned by enkf_obs) reference to the history object - used when - adding HISTORY observations. */ - const ecl_sum_type * refcase; - const ecl_grid_type * grid; - time_map_type * external_time_map; - ensemble_config_type * ensemble_config; -}; - - - - -////////////////////////////////////////////////////////////////////////////////////// - - -static void enkf_obs_iset_obs_time(enkf_obs_type * enkf_obs , int report_step, time_t obs_time) { - time_map_update( enkf_obs->obs_time , report_step , obs_time); -} - - -static int enkf_obs_get_last_restart( const enkf_obs_type * enkf_obs ) { - return time_map_get_size( enkf_obs->obs_time ) - 1; -} - -UTIL_IS_INSTANCE_FUNCTION( enkf_obs , ENKF_OBS_TYPE_ID ) - -enkf_obs_type * enkf_obs_alloc( const history_type * history , - time_map_type * external_time_map , - const ecl_grid_type * grid , - const ecl_sum_type * refcase, - ensemble_config_type * ensemble_config ) -{ - enkf_obs_type * enkf_obs = util_malloc(sizeof * enkf_obs); - UTIL_TYPE_ID_INIT( enkf_obs , ENKF_OBS_TYPE_ID ); - enkf_obs->obs_hash = hash_alloc(); - enkf_obs->obs_vector = vector_alloc_new(); - enkf_obs->obs_time = time_map_alloc(); - - enkf_obs->history = history; - enkf_obs->refcase = refcase; - enkf_obs->grid = grid; - enkf_obs->ensemble_config = ensemble_config; - enkf_obs->external_time_map = external_time_map; - enkf_obs->valid = false; - - /* Initialize obs time: */ - { - if (enkf_obs->history) { - int last_report = history_get_last_restart( enkf_obs->history ); - int step; - for (step =0; step <= last_report; step++) { - time_t obs_time = history_get_time_t_from_restart_nr( enkf_obs->history , step ); - enkf_obs_iset_obs_time( enkf_obs , step , obs_time ); - } - enkf_obs->valid = true; - } else { - if (enkf_obs->external_time_map) { - int last_report = time_map_get_size( enkf_obs->external_time_map ) - 1; - int step; - for (step =0; step <= last_report; step++) { - time_t obs_time = time_map_iget( enkf_obs->external_time_map , step ); - enkf_obs_iset_obs_time( enkf_obs , step , obs_time ); - } - enkf_obs->valid = true; - } - } - } - - return enkf_obs; -} - - - -bool enkf_obs_have_obs( const enkf_obs_type * enkf_obs ) { - if (vector_get_size( enkf_obs->obs_vector ) > 0) - return true; - else - return false; -} - - -void enkf_obs_free(enkf_obs_type * enkf_obs) { - hash_free(enkf_obs->obs_hash); - vector_free( enkf_obs->obs_vector ); - time_map_free( enkf_obs->obs_time ); - free(enkf_obs); -} - - - - -time_t enkf_obs_iget_obs_time(const enkf_obs_type * enkf_obs , int report_step) { - return time_map_iget( enkf_obs->obs_time , report_step ); -} - - - - - -/** - Observe that the obs_vector can be NULL - in which it is of course not added. -*/ -void enkf_obs_add_obs_vector(enkf_obs_type * enkf_obs, - const obs_vector_type * vector) -{ - - if (vector != NULL) { - const char * obs_key = obs_vector_get_key( vector ); - if (hash_has_key(enkf_obs->obs_hash , obs_key)) - util_abort("%s: Observation with key:%s already added.\n",__func__ , obs_key); - - hash_insert_ref(enkf_obs->obs_hash , obs_key , vector ); - vector_append_owned_ref( enkf_obs->obs_vector , vector , obs_vector_free__); - } -} - - -bool enkf_obs_has_key(const enkf_obs_type * obs , const char * key) { - return hash_has_key(obs->obs_hash , key); -} - -obs_vector_type * enkf_obs_get_vector(const enkf_obs_type * obs, const char * key) { - return hash_get(obs->obs_hash , key); -} - -obs_vector_type * enkf_obs_iget_vector(const enkf_obs_type * obs, int index) { - return vector_iget( obs->obs_vector , index ); -} - -int enkf_obs_get_size( const enkf_obs_type * obs ) { - return vector_get_size( obs->obs_vector ); -} - - -static matrix_type * estimate_covar_alloc_matrix(const enkf_obs_type * enkf_obs, - obs_vector_type * obs_vector, - double_vector_type * obs_std, - int step, int size) { - matrix_type * error_covar = NULL; - auto_corrf_ftype * auto_corrf; - double auto_corrf_param; - { - const summary_obs_type * summary_obs = obs_vector_iget_node( obs_vector , step ); - auto_corrf = summary_obs_get_auto_corrf( summary_obs ); - auto_corrf_param = summary_obs_get_auto_corrf_param( summary_obs ); - } - - if (size <= 1 || auto_corrf == NULL) - return NULL; - - int i,j; - error_covar = matrix_alloc( size, size ); - for (i = 0; i < size; i++) { - for (j=0; j <= i; j++) { - double covar = sqrt( double_vector_iget( obs_std , i ) * double_vector_iget( obs_std , j )); - double delta_t = enkf_obs_iget_obs_time( enkf_obs , i ) - enkf_obs_iget_obs_time( enkf_obs , j ); - double corr = auto_corrf(delta_t / (24.00 * 3600) , auto_corrf_param ); - - matrix_iset(error_covar , i , j , covar * corr ); - if (i != j) - matrix_iset(error_covar , j , i , covar * corr ); - } - } - return error_covar; -} - - -static void enkf_obs_get_obs_and_measure_summary(const enkf_obs_type * enkf_obs, - obs_vector_type * obs_vector , - enkf_fs_type * fs, - const local_obsdata_node_type * obs_node , - const int_vector_type * ens_active_list , - meas_data_type * meas_data, - obs_data_type * obs_data, - double_vector_type * obs_value , - double_vector_type * obs_std) { - - const active_list_type * active_list = local_obsdata_node_get_active_list( obs_node ); - - matrix_type * error_covar = NULL; - int active_count = 0; - int last_step = -1; - int step = -1; - - /*1: Determine which report_steps have active observations; and collect the observed values. */ - double_vector_reset( obs_std ); - double_vector_reset( obs_value ); - - while (true) { - step = obs_vector_get_next_active_step( obs_vector , step ); - if (step < 0) - break; - - if (local_obsdata_node_tstep_active(obs_node, step) - && obs_vector_iget_active( obs_vector , step ) - && active_list_iget( active_list , 0 /* Index into the scalar summary observation */)) { - const summary_obs_type * summary_obs = obs_vector_iget_node( obs_vector , step ); - double_vector_iset( obs_std , active_count , summary_obs_get_std( summary_obs ) * summary_obs_get_std_scaling( summary_obs )); - double_vector_iset( obs_value , active_count , summary_obs_get_value( summary_obs )); - last_step = step; - active_count++; - } - } - - if (active_count <= 0) - return; - - /* - 2: Estimate a covariance matrix. - Will be owned by the obs_block instance. - */ - error_covar = estimate_covar_alloc_matrix(enkf_obs, obs_vector, obs_std, - last_step, active_count); - - /* - 3: Fill up the obs_block and meas_block structures with this - time-aggregated summary observation. Passing in the error_covar - matrix (which can be NULL) to the obs_block instance. - */ - - { - obs_block_type * obs_block = obs_data_add_block( obs_data , obs_vector_get_obs_key( obs_vector ) , active_count , error_covar , true); - meas_block_type * meas_block = meas_data_add_block( meas_data, obs_vector_get_obs_key( obs_vector ) , last_step , active_count ); - - enkf_node_type * work_node = enkf_node_alloc( obs_vector_get_config_node( obs_vector )); - - for (int i=0; i < active_count; i++) - obs_block_iset( obs_block , i , double_vector_iget( obs_value , i) , double_vector_iget( obs_std , i )); - - int active_size = int_vector_size( ens_active_list ); - active_count = 0; - step = -1; - while (true) { - step = obs_vector_get_next_active_step( obs_vector , step ); - if (step < 0) - break; - - if (local_obsdata_node_tstep_active(obs_node, step) - && obs_vector_iget_active( obs_vector , step ) - && active_list_iget( active_list , 0 /* Index into the scalar summary observation */)) { - for (int iens_index = 0; iens_index < active_size; iens_index++) { - const int iens = int_vector_iget( ens_active_list , iens_index ); - node_id_type node_id = {.report_step = step, - .iens = iens}; - enkf_node_load( work_node , fs , node_id ); - - int smlength = summary_length( enkf_node_value_ptr( work_node ) ); - if (step >= smlength) { - // if obs vector and sim vector have different length - // deactivate and continue to next - char * msg = util_alloc_sprintf("length of observation vector and simulated differ: %d vs. %d ", step, smlength); - meas_block_deactivate(meas_block , active_count); - obs_block_deactivate(obs_block , active_count, true, msg); - free( msg ); - break; - } else { - meas_block_iset(meas_block , iens , active_count , - summary_get( enkf_node_value_ptr( work_node ), - node_id.report_step )); - } - } - active_count++; - } - } - enkf_node_free( work_node ); - } -} - - -void enkf_obs_get_obs_and_measure_node( const enkf_obs_type * enkf_obs, - enkf_fs_type * fs, - const local_obsdata_node_type * obs_node , - const int_vector_type * ens_active_list , - meas_data_type * meas_data, - obs_data_type * obs_data) { - - const char * obs_key = local_obsdata_node_get_key( obs_node ); - obs_vector_type * obs_vector = hash_get( enkf_obs->obs_hash , obs_key ); - obs_impl_type obs_type = obs_vector_get_impl_type( obs_vector ); - - if (obs_type == SUMMARY_OBS) { - // this if also used to test: (end_step >= start_step+2) - double_vector_type * work_value = double_vector_alloc( 0 , -1 ); - double_vector_type * work_std = double_vector_alloc( 0 , -1 ); - - enkf_obs_get_obs_and_measure_summary( enkf_obs , - obs_vector , - fs , - obs_node , - ens_active_list , - meas_data , - obs_data , - work_value, - work_std); - - double_vector_free( work_std ); - double_vector_free( work_value ); - return; - } - - - // obs_type is GEN_OBS or BLOCK_OBS - int report_step = -1; - while (true) { - report_step = obs_vector_get_next_active_step( obs_vector , report_step ); - if (report_step < 0) - return; - - if (local_obsdata_node_tstep_active(obs_node, report_step) - && (obs_vector_iget_active(obs_vector , report_step))) { - /* The observation is active for this report step. */ - const active_list_type * active_list = local_obsdata_node_get_active_list( obs_node ); - /* Collect the observed data in the obs_data instance. */ - obs_vector_iget_observations(obs_vector , report_step , obs_data , active_list, fs); - obs_vector_measure(obs_vector , fs , report_step , ens_active_list , meas_data , active_list); - } - } -} - - -/* - This will append observations and simulated responses from - report_step to obs_data and meas_data. - Call obs_data_reset and meas_data_reset on obs_data and meas_data - if you want to use fresh instances. -*/ - -void enkf_obs_get_obs_and_measure_data(const enkf_obs_type * enkf_obs, - enkf_fs_type * fs, - const local_obsdata_type * local_obsdata , - const int_vector_type * ens_active_list , - meas_data_type * meas_data, - obs_data_type * obs_data) { - - - int iobs; - for (iobs = 0; iobs < local_obsdata_get_size( local_obsdata ); iobs++) { - const local_obsdata_node_type * obs_node = local_obsdata_iget( local_obsdata , iobs ); - enkf_obs_get_obs_and_measure_node( enkf_obs , - fs , - obs_node , - ens_active_list , - meas_data , - obs_data); - } -} - - - - -void enkf_obs_clear( enkf_obs_type * enkf_obs ) { - hash_clear( enkf_obs->obs_hash ); - vector_clear( enkf_obs->obs_vector ); - ensemble_config_clear_obs_keys(enkf_obs->ensemble_config); -} - - - - - -/* - Adding inverse observation keys to the enkf_nodes; can be called - several times. -*/ - - -static void enkf_obs_update_keys( enkf_obs_type * enkf_obs ) { - /* First clear all existing observation keys. */ - ensemble_config_clear_obs_keys( enkf_obs->ensemble_config ); - - /* Add new observation keys. */ - { - hash_type * map = enkf_obs_alloc_data_map(enkf_obs); - hash_iter_type * iter = hash_iter_alloc(map); - const char * obs_key = hash_iter_get_next_key(iter); - while (obs_key != NULL) { - const char * state_kw = hash_get(map , obs_key); - ensemble_config_add_obs_key(enkf_obs->ensemble_config , state_kw , obs_key); - obs_key = hash_iter_get_next_key(iter); - } - hash_iter_free(iter); - hash_free(map); - } -} - - - -/** - This function will load an observation configuration from the - observation file @config_file. - - If called several times during one invocation the function will - start by clearing the current content. -*/ - - - -bool enkf_obs_load(enkf_obs_type * enkf_obs , - const char * config_file, - double std_cutoff) { - - if (enkf_obs->valid) { - int last_report = enkf_obs_get_last_restart( enkf_obs ); - conf_class_type * enkf_conf_class = enkf_obs_get_obs_conf_class(); - conf_instance_type * enkf_conf = conf_instance_alloc_from_file(enkf_conf_class, "enkf_conf", config_file); - - if(conf_instance_validate(enkf_conf) == false) - util_abort("Can not proceed with this configuration.\n"); - - /** Handle HISTORY_OBSERVATION instances. */ - { - stringlist_type * hist_obs_keys = conf_instance_alloc_list_of_sub_instances_of_class_by_name(enkf_conf, "HISTORY_OBSERVATION"); - int num_hist_obs = stringlist_get_size(hist_obs_keys); - - for (int hist_obs_nr = 0; hist_obs_nr < num_hist_obs; hist_obs_nr++) { - const char * obs_key = stringlist_iget(hist_obs_keys, hist_obs_nr); - if (enkf_obs->history) { - const conf_instance_type * hist_obs_conf = conf_instance_get_sub_instance_ref(enkf_conf, obs_key); - obs_vector_type * obs_vector; - enkf_config_node_type * config_node; - config_node = ensemble_config_add_summary_observation( enkf_obs->ensemble_config , obs_key , LOAD_FAIL_WARN ); - if (config_node != NULL) { - obs_vector = obs_vector_alloc( SUMMARY_OBS , obs_key , ensemble_config_get_node( enkf_obs->ensemble_config , obs_key ), last_report); - if (obs_vector != NULL) { - if (obs_vector_load_from_HISTORY_OBSERVATION(obs_vector , - hist_obs_conf , - enkf_obs->obs_time , - enkf_obs->history , - enkf_obs->ensemble_config, - std_cutoff )) { - enkf_obs_add_obs_vector(enkf_obs, obs_vector); - } else { - fprintf(stderr,"** Could not load historical data for observation:%s - ignored\n",obs_key); - obs_vector_free( obs_vector ); - } - } - } else - fprintf(stderr,"** Warning: summary:%s does not exist - observation:%s not added. \n", obs_key , obs_key); - } else - fprintf(stderr,"** Warning: no history object registered - observation:%s is ignored\n",obs_key); - } - - stringlist_free(hist_obs_keys); - } - - - - /** Handle SUMMARY_OBSERVATION instances. */ - { - stringlist_type * sum_obs_keys = conf_instance_alloc_list_of_sub_instances_of_class_by_name(enkf_conf, "SUMMARY_OBSERVATION"); - int num_sum_obs = stringlist_get_size(sum_obs_keys); - - - for(int sum_obs_nr = 0; sum_obs_nr < num_sum_obs; sum_obs_nr++) { - const char * obs_key = stringlist_iget(sum_obs_keys, sum_obs_nr); - const conf_instance_type * sum_obs_conf = conf_instance_get_sub_instance_ref(enkf_conf, obs_key); - const char * sum_key = conf_instance_get_item_value_ref( sum_obs_conf , "KEY" ); - obs_vector_type * obs_vector; - enkf_config_node_type * config_node; - - config_node = ensemble_config_add_summary_observation( enkf_obs->ensemble_config , sum_key , LOAD_FAIL_WARN ); - if (config_node != NULL) { - obs_vector = obs_vector_alloc( SUMMARY_OBS , obs_key , ensemble_config_get_node( enkf_obs->ensemble_config , sum_key ), last_report); - if (obs_vector != NULL) { - obs_vector_load_from_SUMMARY_OBSERVATION(obs_vector , sum_obs_conf , enkf_obs->obs_time , enkf_obs->ensemble_config); - enkf_obs_add_obs_vector(enkf_obs, obs_vector); - } - } else - fprintf(stderr,"** Warning: summary key:%s does not exist - observation key:%s not added.\n", sum_key , obs_key); - } - stringlist_free(sum_obs_keys); - } - - - /** Handle BLOCK_OBSERVATION instances. */ - { - stringlist_type * block_obs_keys = conf_instance_alloc_list_of_sub_instances_of_class_by_name(enkf_conf, "BLOCK_OBSERVATION"); - int num_block_obs = stringlist_get_size(block_obs_keys); - - for(int block_obs_nr = 0; block_obs_nr < num_block_obs; block_obs_nr++) - { - const char * obs_key = stringlist_iget(block_obs_keys, block_obs_nr); - const conf_instance_type * block_obs_conf = conf_instance_get_sub_instance_ref(enkf_conf, obs_key); - obs_vector_type * obs_vector = obs_vector_alloc_from_BLOCK_OBSERVATION(block_obs_conf , enkf_obs->grid , enkf_obs->obs_time , enkf_obs->refcase , enkf_obs->ensemble_config); - if (obs_vector != NULL) - enkf_obs_add_obs_vector(enkf_obs, obs_vector); - } - stringlist_free(block_obs_keys); - } - - - /** Handle GENERAL_OBSERVATION instances. */ - { - stringlist_type * block_obs_keys = conf_instance_alloc_list_of_sub_instances_of_class_by_name(enkf_conf, "GENERAL_OBSERVATION"); - int num_block_obs = stringlist_get_size(block_obs_keys); - - for(int block_obs_nr = 0; block_obs_nr < num_block_obs; block_obs_nr++) - { - const char * obs_key = stringlist_iget(block_obs_keys, block_obs_nr); - const conf_instance_type * gen_obs_conf = conf_instance_get_sub_instance_ref(enkf_conf, obs_key); - - obs_vector_type * obs_vector = obs_vector_alloc_from_GENERAL_OBSERVATION(gen_obs_conf , enkf_obs->obs_time , enkf_obs->ensemble_config); - if (obs_vector != NULL) - enkf_obs_add_obs_vector(enkf_obs, obs_vector); - } - stringlist_free(block_obs_keys); - } - - - conf_instance_free(enkf_conf ); - conf_class_free( enkf_conf_class); - - enkf_obs_update_keys( enkf_obs ); - return true; - } else - return false; -} - - - - - - - static conf_class_type * enkf_obs_get_obs_conf_class( void ) { - const char * enkf_conf_help = "An instance of the class ENKF_CONFIG shall contain neccessary infomation to run the enkf."; - conf_class_type * enkf_conf_class = conf_class_alloc_empty("ENKF_CONFIG", true , false , enkf_conf_help); - conf_class_set_help(enkf_conf_class, enkf_conf_help); - - - - /** Create and insert HISTORY_OBSERVATION class. */ - { - const char * help_class_history_observation = "The class HISTORY_OBSERVATION is used to condition on a time series from the production history. The name of the an instance is used to define the item to condition on, and should be in summary.x syntax. E.g., creating a HISTORY_OBSERVATION instance with name GOPR:P4 conditions on GOPR for group P4."; - - conf_class_type * history_observation_class = conf_class_alloc_empty("HISTORY_OBSERVATION", false , false, help_class_history_observation); - - conf_item_spec_type * item_spec_error_mode = conf_item_spec_alloc("ERROR_MODE", true, DT_STR , "The string ERROR_MODE gives the error mode for the observation."); - conf_item_spec_type * item_spec_auto_corrf_param = conf_item_spec_alloc("AUTO_CORRF_PARAM", false, DT_FLOAT , "A parameter passed to the auto correlation function."); - const char * help_item_spec_auto_corrf = "The name of the auto correlation function used for smoother updates."; - conf_item_spec_type * item_spec_auto_corrf = conf_item_spec_alloc("AUTO_CORRF", false , DT_STR , help_item_spec_auto_corrf); - conf_item_spec_add_restriction( item_spec_auto_corrf , AUTO_CORRF_EXP); - conf_item_spec_add_restriction( item_spec_auto_corrf , AUTO_CORRF_GAUSS); - - - conf_item_spec_add_restriction(item_spec_error_mode, "REL"); - conf_item_spec_add_restriction(item_spec_error_mode, "ABS"); - conf_item_spec_add_restriction(item_spec_error_mode, "RELMIN"); - conf_item_spec_set_default_value(item_spec_error_mode, "RELMIN"); - - conf_item_spec_type * item_spec_error = conf_item_spec_alloc("ERROR", true, DT_POSFLOAT , "The positive floating number ERROR gives the standard deviation (ABS) or the relative uncertainty (REL/RELMIN) of the observations."); - conf_item_spec_set_default_value(item_spec_error, "0.10"); - - conf_item_spec_type * item_spec_error_min = conf_item_spec_alloc("ERROR_MIN", true, DT_POSFLOAT , "The positive floating point number ERROR_MIN gives the minimum value for the standard deviation of the observation when RELMIN is used."); - conf_item_spec_set_default_value(item_spec_error_min, "0.10"); - - conf_class_insert_owned_item_spec(history_observation_class, item_spec_error_mode); - conf_class_insert_owned_item_spec(history_observation_class, item_spec_error); - conf_class_insert_owned_item_spec(history_observation_class, item_spec_error_min); - conf_class_insert_owned_item_spec(history_observation_class, item_spec_auto_corrf); - conf_class_insert_owned_item_spec(history_observation_class, item_spec_auto_corrf_param); - - /** Sub class segment. */ - { - const char * help_class_segment = "The class SEGMENT is used to fine tune the error model."; - conf_class_type * segment_class = conf_class_alloc_empty("SEGMENT", false , false, help_class_segment); - - conf_item_spec_type * item_spec_start_segment = conf_item_spec_alloc("START", true, DT_INT, "The first restart in the segment."); - conf_item_spec_type * item_spec_stop_segment = conf_item_spec_alloc("STOP", true, DT_INT, "The last restart in the segment."); - - conf_item_spec_type * item_spec_error_mode_segment = conf_item_spec_alloc("ERROR_MODE", true, DT_STR , "The string ERROR_MODE gives the error mode for the observation."); - conf_item_spec_add_restriction(item_spec_error_mode_segment, "REL"); - conf_item_spec_add_restriction(item_spec_error_mode_segment, "ABS"); - conf_item_spec_add_restriction(item_spec_error_mode_segment, "RELMIN"); - conf_item_spec_set_default_value(item_spec_error_mode_segment, "RELMIN"); - - conf_item_spec_type * item_spec_error_segment = conf_item_spec_alloc("ERROR", true, DT_POSFLOAT , "The positive floating number ERROR gives the standard deviation (ABS) or the relative uncertainty (REL/RELMIN) of the observations."); - conf_item_spec_set_default_value(item_spec_error_segment, "0.10"); - - conf_item_spec_type * item_spec_error_min_segment = conf_item_spec_alloc("ERROR_MIN", true, DT_POSFLOAT , "The positive floating point number ERROR_MIN gives the minimum value for the standard deviation of the observation when RELMIN is used."); - conf_item_spec_set_default_value(item_spec_error_min_segment, "0.10"); - - - conf_class_insert_owned_item_spec(segment_class, item_spec_start_segment); - conf_class_insert_owned_item_spec(segment_class, item_spec_stop_segment); - conf_class_insert_owned_item_spec(segment_class, item_spec_error_mode_segment); - conf_class_insert_owned_item_spec(segment_class, item_spec_error_segment); - conf_class_insert_owned_item_spec(segment_class, item_spec_error_min_segment); - - conf_class_insert_owned_sub_class(history_observation_class, segment_class); - } - - conf_class_insert_owned_sub_class(enkf_conf_class, history_observation_class); - } - - - - /** Create and insert SUMMARY_OBSERVATION class. */ - { - const char * help_class_summary_observation = "The class SUMMARY_OBSERVATION can be used to condition on any observation whos simulated value is written to the summary file."; - conf_class_type * summary_observation_class = conf_class_alloc_empty("SUMMARY_OBSERVATION", false , false, help_class_summary_observation); - - const char * help_item_spec_value = "The floating point number VALUE gives the observed value."; - conf_item_spec_type * item_spec_value = conf_item_spec_alloc("VALUE", true, DT_FLOAT , help_item_spec_value); - - const char * help_item_spec_error = "The positive floating point number ERROR is the standard deviation of the observed value."; - conf_item_spec_type * item_spec_error = conf_item_spec_alloc("ERROR", true, DT_POSFLOAT ,help_item_spec_error ); - - const char * help_item_spec_date = "The DATE item gives the observation time as the date date it occured. Format is dd/mm/yyyy."; - conf_item_spec_type * item_spec_date = conf_item_spec_alloc("DATE", false, DT_DATE , help_item_spec_date); - - const char * help_item_spec_days = "The DAYS item gives the observation time as days after simulation start."; - conf_item_spec_type * item_spec_days = conf_item_spec_alloc("DAYS", false, DT_POSFLOAT , help_item_spec_days); - - const char * help_item_spec_hours = "The HOURS item gives the observation time as hours after simulation start."; - conf_item_spec_type * item_spec_hours = conf_item_spec_alloc("HOURS", false, DT_POSFLOAT , help_item_spec_hours); - - const char * help_item_spec_restart = "The RESTART item gives the observation time as the ECLIPSE restart nr."; - conf_item_spec_type * item_spec_restart = conf_item_spec_alloc("RESTART", false, DT_POSINT , help_item_spec_restart); - - const char * help_item_spec_sumkey = "The string SUMMARY_KEY is used to look up the simulated value in the summary file. It has the same format as the summary.x program, e.g. WOPR:P4"; - conf_item_spec_type * item_spec_sumkey = conf_item_spec_alloc("KEY", true, DT_STR , help_item_spec_sumkey); - - conf_item_spec_type * item_spec_error_min = conf_item_spec_alloc("ERROR_MIN", true, DT_POSFLOAT , - "The positive floating point number ERROR_MIN gives the minimum value for the standard deviation of the observation when RELMIN is used."); - conf_item_spec_type * item_spec_error_mode = conf_item_spec_alloc("ERROR_MODE", true, DT_STR , "The string ERROR_MODE gives the error mode for the observation."); - - conf_item_spec_add_restriction(item_spec_error_mode, "REL"); - conf_item_spec_add_restriction(item_spec_error_mode, "ABS"); - conf_item_spec_add_restriction(item_spec_error_mode, "RELMIN"); - conf_item_spec_set_default_value(item_spec_error_mode, "ABS"); - conf_item_spec_set_default_value(item_spec_error_min, "0.10"); - - conf_class_insert_owned_item_spec(summary_observation_class, item_spec_value); - conf_class_insert_owned_item_spec(summary_observation_class, item_spec_error); - conf_class_insert_owned_item_spec(summary_observation_class, item_spec_date); - conf_class_insert_owned_item_spec(summary_observation_class, item_spec_days); - conf_class_insert_owned_item_spec(summary_observation_class, item_spec_hours); - conf_class_insert_owned_item_spec(summary_observation_class, item_spec_restart); - conf_class_insert_owned_item_spec(summary_observation_class, item_spec_sumkey); - conf_class_insert_owned_item_spec(summary_observation_class, item_spec_error_mode); - conf_class_insert_owned_item_spec(summary_observation_class, item_spec_error_min); - - /** Create a mutex on DATE, DAYS and RESTART. */ - conf_item_mutex_type * time_mutex = conf_class_new_item_mutex(summary_observation_class , true , false); - - conf_item_mutex_add_item_spec(time_mutex , item_spec_date); - conf_item_mutex_add_item_spec(time_mutex , item_spec_days); - conf_item_mutex_add_item_spec(time_mutex , item_spec_hours); - conf_item_mutex_add_item_spec(time_mutex , item_spec_restart); - conf_item_mutex_add_item_spec(time_mutex , item_spec_days ); - - conf_class_insert_owned_sub_class(enkf_conf_class, summary_observation_class); - } - - - - /** Create and insert BLOCK_OBSERVATION class. */ - { - const char * help_class_block_observation = "The class BLOCK_OBSERVATION can be used to condition on an observation whos simulated values are block/cell values of a field, e.g. RFT tests."; - conf_class_type * block_observation_class = conf_class_alloc_empty("BLOCK_OBSERVATION", false , false, help_class_block_observation); - - const char * help_item_spec_field = "The item FIELD gives the observed field. E.g., ECLIPSE fields such as PRESSURE, SGAS or any user defined fields such as PORO or PERMX."; - conf_item_spec_type * item_spec_field = conf_item_spec_alloc("FIELD", true , DT_STR , help_item_spec_field); - - const char * help_item_spec_date = "The DATE item gives the observation time as the date date it occured. Format is dd/mm/yyyy."; - conf_item_spec_type * item_spec_date = conf_item_spec_alloc("DATE", false, DT_DATE , help_item_spec_date); - - const char * help_item_spec_days = "The DAYS item gives the observation time as days after simulation start."; - conf_item_spec_type * item_spec_days = conf_item_spec_alloc("DAYS", false, DT_POSFLOAT , help_item_spec_days); - - const char * help_item_spec_hours = "The HOURS item gives the observation time as hours after simulation start."; - conf_item_spec_type * item_spec_hours = conf_item_spec_alloc("HOURS", false, DT_POSFLOAT , help_item_spec_hours); - - const char * help_item_spec_restart = "The RESTART item gives the observation time as the ECLIPSE restart nr."; - conf_item_spec_type * item_spec_restart = conf_item_spec_alloc("RESTART", false, DT_POSINT , help_item_spec_restart); - - conf_item_spec_type * item_spec_source = conf_item_spec_alloc("SOURCE", false, DT_STR , "The simulated data can be taken from the field or summary keys."); - - - conf_item_spec_add_restriction(item_spec_source, "FIELD"); - conf_item_spec_add_restriction(item_spec_source, "SUMMARY"); - conf_item_spec_set_default_value(item_spec_source, "FIELD"); - - conf_class_insert_owned_item_spec(block_observation_class, item_spec_source); - conf_class_insert_owned_item_spec(block_observation_class, item_spec_field); - conf_class_insert_owned_item_spec(block_observation_class, item_spec_date); - conf_class_insert_owned_item_spec(block_observation_class, item_spec_days); - conf_class_insert_owned_item_spec(block_observation_class, item_spec_restart); - conf_class_insert_owned_item_spec(block_observation_class, item_spec_hours); - /** Create a mutex on DATE, DAYS and RESTART. */ - { - conf_item_mutex_type * time_mutex = conf_class_new_item_mutex(block_observation_class , true , false); - conf_item_mutex_add_item_spec(time_mutex, item_spec_date); - conf_item_mutex_add_item_spec(time_mutex, item_spec_days); - conf_item_mutex_add_item_spec(time_mutex, item_spec_restart); - conf_item_mutex_add_item_spec(time_mutex, item_spec_hours); - } - - /** Create and insert the sub class OBS. */ - { - const char * help_class_obs = "The class OBS is used to specify a single observed point."; - conf_class_type * obs_class = conf_class_alloc_empty("OBS", true , false, help_class_obs); - - const char * help_item_i = "The item I gives the I index of the block observation."; - conf_item_spec_type * item_spec_i = conf_item_spec_alloc("I", true, DT_POSINT , help_item_i); - - const char * help_item_j = "The item J gives the J index of the block observation."; - conf_item_spec_type * item_spec_j = conf_item_spec_alloc("J", true, DT_POSINT, help_item_j); - - const char * help_item_k = "The item K gives the K index of the block observation."; - conf_item_spec_type * item_spec_k = conf_item_spec_alloc("K", true, DT_POSINT, help_item_k); - - const char * help_item_spec_value = "The floating point number VALUE gives the observed value."; - conf_item_spec_type * item_spec_value = conf_item_spec_alloc("VALUE", true, DT_FLOAT , help_item_spec_value); - - const char * help_item_spec_error = "The positive floating point number ERROR is the standard deviation of the observed value."; - conf_item_spec_type * item_spec_error = conf_item_spec_alloc("ERROR", true, DT_POSFLOAT , help_item_spec_error); - - conf_item_spec_type * item_spec_error_mode = conf_item_spec_alloc("ERROR_MODE", true, DT_STR , "The string ERROR_MODE gives the error mode for the observation."); - - conf_item_spec_type * item_spec_error_min = conf_item_spec_alloc("ERROR_MIN", true, DT_POSFLOAT , - "The positive floating point number ERROR_MIN gives the minimum value for the standard deviation of the observation when RELMIN is used."); - - conf_item_spec_add_restriction(item_spec_error_mode, "REL"); - conf_item_spec_add_restriction(item_spec_error_mode, "ABS"); - conf_item_spec_add_restriction(item_spec_error_mode, "RELMIN"); - conf_item_spec_set_default_value(item_spec_error_mode, "ABS"); - conf_item_spec_set_default_value(item_spec_error_min, "0.10" ); - - conf_class_insert_owned_item_spec(obs_class, item_spec_i); - conf_class_insert_owned_item_spec(obs_class, item_spec_j); - conf_class_insert_owned_item_spec(obs_class, item_spec_k); - conf_class_insert_owned_item_spec(obs_class, item_spec_value); - conf_class_insert_owned_item_spec(obs_class, item_spec_error); - conf_class_insert_owned_item_spec(obs_class, item_spec_error_mode); - conf_class_insert_owned_item_spec(obs_class, item_spec_error_min); - - conf_class_insert_owned_sub_class(block_observation_class, obs_class); - } - - conf_class_insert_owned_sub_class(enkf_conf_class, block_observation_class); - } - - /** Create and insert class for general observations. */ - { - const char * help_item_spec_restart = "The RESTART item gives the observation time as the ECLIPSE restart nr."; - const char * help_item_spec_field = "The item DATA gives the observed GEN_DATA instance."; - const char * help_item_spec_date = "The DATE item gives the observation time as the date date it occured. Format is dd/mm/yyyy."; - const char * help_item_spec_days = "The DAYS item gives the observation time as days after simulation start."; - const char * help_item_spec_hours = "The HOURS item gives the observation time as hours after simulation start."; - - conf_class_type * gen_obs_class = conf_class_alloc_empty("GENERAL_OBSERVATION" , false , false, "The class general_observation is used for general observations"); - - conf_item_spec_type * item_spec_field = conf_item_spec_alloc("DATA", true, DT_STR , help_item_spec_field); - conf_item_spec_type * item_spec_date = conf_item_spec_alloc("DATE", false, DT_DATE , help_item_spec_date); - conf_item_spec_type * item_spec_days = conf_item_spec_alloc("DAYS", false, DT_POSFLOAT , help_item_spec_days); - conf_item_spec_type * item_spec_hours = conf_item_spec_alloc("HOURS", false, DT_POSFLOAT , help_item_spec_hours); - conf_item_spec_type * item_spec_restart = conf_item_spec_alloc("RESTART", false, DT_POSINT , help_item_spec_restart); - conf_item_spec_type * item_spec_error_covar = conf_item_spec_alloc("ERROR_COVAR", false, DT_FILE , "Name of file containing error-covariance as formatted matrix - no header"); - - conf_class_insert_owned_item_spec(gen_obs_class, item_spec_error_covar); - conf_class_insert_owned_item_spec(gen_obs_class, item_spec_field); - conf_class_insert_owned_item_spec(gen_obs_class, item_spec_date); - conf_class_insert_owned_item_spec(gen_obs_class, item_spec_days); - conf_class_insert_owned_item_spec(gen_obs_class, item_spec_hours); - conf_class_insert_owned_item_spec(gen_obs_class, item_spec_restart); - /** Create a mutex on DATE, DAYS and RESTART. */ - { - conf_item_mutex_type * time_mutex = conf_class_new_item_mutex(gen_obs_class , true , false); - - conf_item_mutex_add_item_spec(time_mutex, item_spec_date); - conf_item_mutex_add_item_spec(time_mutex, item_spec_days); - conf_item_mutex_add_item_spec(time_mutex, item_spec_hours); - conf_item_mutex_add_item_spec(time_mutex, item_spec_restart); - } - - { - conf_item_spec_type * item_spec_obs_file = conf_item_spec_alloc("OBS_FILE" , false , DT_FILE , "The name of an (ascii) file with observation values."); - conf_item_spec_type * item_spec_value = conf_item_spec_alloc("VALUE" , false , DT_FLOAT , "One scalar observation value."); - conf_item_spec_type * item_spec_error = conf_item_spec_alloc("ERROR" , false , DT_FLOAT , "One scalar observation error."); - conf_item_mutex_type * value_mutex = conf_class_new_item_mutex( gen_obs_class , true , false); - conf_item_mutex_type * value_error_mutex = conf_class_new_item_mutex( gen_obs_class , false , true); - - conf_class_insert_owned_item_spec(gen_obs_class , item_spec_obs_file); - conf_class_insert_owned_item_spec(gen_obs_class , item_spec_value); - conf_class_insert_owned_item_spec(gen_obs_class , item_spec_error); - - - /* If the observation is in terms of VALUE - we must also have ERROR. - The conf system does not (currently ??) enforce this dependency. */ - - conf_item_mutex_add_item_spec( value_mutex , item_spec_value); - conf_item_mutex_add_item_spec( value_mutex , item_spec_obs_file); - - conf_item_mutex_add_item_spec( value_error_mutex , item_spec_value); - conf_item_mutex_add_item_spec( value_error_mutex , item_spec_error); - } - - - /* - The default is that all the elements in DATA are observed, but - we can restrict ourselves to a list of indices, with either the - INDEX_LIST or INDEX_FILE keywords. - */ - { - conf_item_spec_type * item_spec_index_list = conf_item_spec_alloc("INDEX_LIST" , false , DT_STR , "A list of indicies - possibly with ranges which should be observed in the target field."); - conf_item_spec_type * item_spec_index_file = conf_item_spec_alloc("INDEX_FILE" , false , DT_FILE , "An ASCII file containing a list of indices which should be observed in the target field."); - conf_item_mutex_type * index_mutex = conf_class_new_item_mutex( gen_obs_class , false , false); - - conf_class_insert_owned_item_spec(gen_obs_class, item_spec_index_list); - conf_class_insert_owned_item_spec(gen_obs_class, item_spec_index_file); - conf_item_mutex_add_item_spec(index_mutex , item_spec_index_list); - conf_item_mutex_add_item_spec(index_mutex , item_spec_index_file); - } - - conf_class_insert_owned_sub_class(enkf_conf_class, gen_obs_class); - } - - - return enkf_conf_class; -} - - - -/** - Allocates a stringlist of obs target keys which correspond to - summary observations, these are then added to the state vector in - enkf_main. -*/ -stringlist_type * enkf_obs_alloc_typed_keylist(enkf_obs_type * enkf_obs , obs_impl_type obs_type) { - stringlist_type * vars = stringlist_alloc_new(); - hash_iter_type * iter = hash_iter_alloc(enkf_obs->obs_hash); - const char * key = hash_iter_get_next_key(iter); - while ( key != NULL) { - obs_vector_type * obs_vector = hash_get( enkf_obs->obs_hash , key); - if (obs_vector_get_impl_type(obs_vector) == obs_type) - stringlist_append_copy(vars , key); - key = hash_iter_get_next_key(iter); - } - hash_iter_free(iter); - return vars; -} - - -obs_impl_type enkf_obs_get_type(const enkf_obs_type * enkf_obs , const char * key) { - obs_vector_type * obs_vector = hash_get( enkf_obs->obs_hash , key); - return obs_vector_get_impl_type(obs_vector); -} - -/** - */ - -stringlist_type * enkf_obs_alloc_matching_keylist(const enkf_obs_type * enkf_obs, - const char * input_string) { - - stringlist_type * obs_keys = hash_alloc_stringlist( enkf_obs->obs_hash ); - - if (!input_string) - return obs_keys; - - stringlist_type * matching_keys = stringlist_alloc_new(); - char ** input_keys; - int num_keys; - int obs_keys_count = stringlist_get_size( obs_keys ); - - util_split_string( input_string , " " , &num_keys , &input_keys); - for (int i = 0; i < num_keys; i++) { - const char * input_key = input_keys[i]; - for (int j = 0; j < obs_keys_count; j++) { - const char * obs_key = stringlist_iget( obs_keys , j); - - if (util_string_match( obs_key , input_key) - && !stringlist_contains( matching_keys , obs_key )) - stringlist_append_copy( matching_keys , obs_key); - } - } - util_free_stringlist( input_keys , num_keys ); - stringlist_free( obs_keys ); - return matching_keys; -} - - -stringlist_type * enkf_obs_alloc_keylist(enkf_obs_type * enkf_obs ) { - stringlist_type * vars = stringlist_alloc_new(); - hash_iter_type * iter = hash_iter_alloc(enkf_obs->obs_hash); - const char * key = hash_iter_get_next_key(iter); - while ( key != NULL) { - stringlist_append_copy(vars , key); - key = hash_iter_get_next_key(iter); - } - hash_iter_free(iter); - return vars; -} - -/** - This function allocates a hash table which looks like this: - - {"OBS_KEY1": "STATE_KEY1", "OBS_KEY2": "STATE_KEY2", "OBS_KEY3": "STATE_KEY3", ....} - - where "OBS_KEY" represents the keys in the enkf_obs hash, and the - value they are pointing at are the enkf_state keywords they are - measuring. For instance if we have an observation with key "RFT_1A" - the entry in the table will be: ... "RFT_1A": "PRESSURE", .. - since an RFT observation observes the pressure. - - Let us consider the watercut in a well. Then the state_kw will - typically be WWCT:P1 for a well named 'P1'. Let us assume that this - well is observed both as a normal HISTORY observation from - SCHEDULE, and from two separator tests, called S1 and S2. Then the - hash table will look like this: - - "WWCT:P1": "WWCT:P1", - "S1" : "WWCT:P1", - "S2" : "WWCT:P1" - - - I.e. there are three different observations keys, all observing the - same state_kw. -*/ - - - -hash_type * enkf_obs_alloc_data_map(enkf_obs_type * enkf_obs) -{ - hash_type * map = hash_alloc(); - hash_iter_type * iter = hash_iter_alloc(enkf_obs->obs_hash); - const char * key = hash_iter_get_next_key(iter); - while ( key != NULL) { - obs_vector_type * obs_vector = hash_get( enkf_obs->obs_hash , key); - hash_insert_ref( map , key , obs_vector_get_state_kw(obs_vector)); - key = hash_iter_get_next_key(iter); - } - hash_iter_free( iter ); - return map; -} - - -hash_iter_type * enkf_obs_alloc_iter( const enkf_obs_type * enkf_obs ) { - return hash_iter_alloc(enkf_obs->obs_hash); -} - - - - - -/** - This function takes a string like this: "PRESSURE:1,4,7" - it - splits the string on ":" and tries to lookup a config object with - that key. For the general string A:B:C:D it will try consecutively - the keys: A, A:B, A:B:C, A:B:C:D. If a config object is found it is - returned, otherwise NULL is returned. - - The last argument is the pointer to a string which will be updated - with the node-spesific part of the full key. So for instance with - the example "PRESSURE:1,4,7", the index_key will contain - "1,4,7". If the full full_key is used to find an object index_key - will be NULL, that also applies if no object is found. -*/ - - - -const obs_vector_type * enkf_obs_user_get_vector(const enkf_obs_type * obs , const char * full_key, char ** index_key ) { - const obs_vector_type * vector = NULL; - char ** key_list; - int keys; - int key_length = 1; - int offset; - - *index_key = NULL; - util_split_string(full_key , ":" , &keys , &key_list); - while (vector == NULL && key_length <= keys) { - char * current_key = util_alloc_joined_string( (const char **) key_list , key_length , ":"); - if (enkf_obs_has_key(obs , current_key)) - vector = enkf_obs_get_vector(obs , current_key); - else - key_length++; - offset = strlen( current_key ); - free( current_key ); - } - if (vector != NULL) { - if (offset < strlen( full_key )) - *index_key = util_alloc_string_copy(&full_key[offset+1]); - } - - util_free_stringlist(key_list , keys); - return vector; -} - -/*****************************************************************/ - - -void enkf_obs_scale_std(enkf_obs_type * enkf_obs, double scale_factor) { - local_obsdata_type * local_obs = enkf_obs_alloc_all_active_local_obs( enkf_obs , "ALL-OBS"); - enkf_obs_local_scale_std( enkf_obs , local_obs , scale_factor ); - local_obsdata_free( local_obs ); -} - - -void enkf_obs_local_scale_std( const enkf_obs_type * enkf_obs , const local_obsdata_type * local_obsdata, double scale_factor) { - int num_nodes = local_obsdata_get_size( local_obsdata ); - int node_nr; - for (node_nr = 0; node_nr < num_nodes; node_nr++) { - const local_obsdata_node_type * node = local_obsdata_iget( local_obsdata , node_nr ); - obs_vector_type * obs_vector = enkf_obs_get_vector( enkf_obs , local_obsdata_node_get_key( node )); - obs_vector_scale_std( obs_vector , node , scale_factor ); - } -} - - -double enkf_obs_scale_correlated_std(const enkf_obs_type * enkf_obs, - enkf_fs_type * fs, - const int_vector_type * ens_active_list, - const local_obsdata_type * local_obsdata) { - bool_vector_type * ens_mask = int_vector_alloc_mask( ens_active_list ); - meas_data_type * meas_data = meas_data_alloc( ens_mask ); - obs_data_type * obs_data = obs_data_alloc( 1.0 ); - double scale_factor = 1.0; - - enkf_obs_get_obs_and_measure_data( enkf_obs , fs , local_obsdata , ens_active_list, - meas_data , obs_data ); - { - matrix_type * S = meas_data_allocS( meas_data ); - if (S) { - double truncation = 0.95; - int num_PC; - - obs_data_scale( obs_data , S , NULL , NULL , NULL , NULL ); - num_PC = enkf_linalg_num_PC( S , truncation ); - scale_factor = sqrt( obs_data_get_active_size( obs_data ) / num_PC ); - - matrix_free( S ); - enkf_obs_local_scale_std( enkf_obs , local_obsdata , scale_factor ); - } - } - meas_data_free( meas_data ); - obs_data_free( obs_data ); - bool_vector_free( ens_mask ); - return scale_factor; -} - - - -void enkf_obs_add_local_nodes_with_data(const enkf_obs_type * enkf_obs , local_obsdata_type * local_obs , enkf_fs_type *fs , const bool_vector_type * ens_mask) { - hash_iter_type * iter = hash_iter_alloc(enkf_obs->obs_hash); - while ( !hash_iter_is_complete( iter ) ) { - const char * key = hash_iter_get_next_key(iter); - obs_vector_type * obs_vector = hash_get( enkf_obs->obs_hash , key); - - if (obs_vector_has_data( obs_vector , ens_mask , fs )) { - local_obsdata_node_type * node = obs_vector_alloc_local_node( obs_vector ); - local_obsdata_add_node( local_obs , node ); - } - - } - hash_iter_free(iter); -} - - - -local_obsdata_type * enkf_obs_alloc_all_active_local_obs( const enkf_obs_type * enkf_obs , const char * key) { - local_obsdata_type * local_obs = local_obsdata_alloc( key ); - { - hash_iter_type * iter = hash_iter_alloc(enkf_obs->obs_hash); - while ( !hash_iter_is_complete( iter ) ) { - const char * key = hash_iter_get_next_key(iter); - obs_vector_type * obs_vector = hash_get( enkf_obs->obs_hash , key); - local_obsdata_node_type * node = obs_vector_alloc_local_node( obs_vector ); - local_obsdata_add_node( local_obs , node ); - } - hash_iter_free(iter); - } - return local_obs; -} diff --git a/ThirdParty/Ert/libenkf/src/enkf_plot_data.c b/ThirdParty/Ert/libenkf/src/enkf_plot_data.c deleted file mode 100644 index 45432ce28e..0000000000 --- a/ThirdParty/Ert/libenkf/src/enkf_plot_data.c +++ /dev/null @@ -1,151 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'enkf_plot_data.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - - -#define ENKF_PLOT_DATA_TYPE_ID 3331063 - -struct enkf_plot_data_struct { - UTIL_TYPE_ID_DECLARATION; - const enkf_config_node_type * config_node; - int size; - enkf_plot_tvector_type ** ensemble; - arg_pack_type ** work_arg; -}; - - - -static void enkf_plot_data_resize( enkf_plot_data_type * plot_data , int new_size ) { - if (new_size != plot_data->size) { - int iens; - - if (new_size < plot_data->size) { - for (iens = new_size; iens < plot_data->size; iens++) { - enkf_plot_tvector_free( plot_data->ensemble[iens] ); - arg_pack_free( plot_data->work_arg[iens] ); - } - } - - plot_data->ensemble = util_realloc( plot_data->ensemble , new_size * sizeof * plot_data->ensemble); - plot_data->work_arg = util_realloc( plot_data->work_arg , new_size * sizeof * plot_data->work_arg); - - if (new_size > plot_data->size) { - for (iens = plot_data->size; iens < new_size; iens++) { - plot_data->ensemble[iens] = enkf_plot_tvector_alloc( plot_data->config_node , iens); - plot_data->work_arg[iens] = arg_pack_alloc(); - } - } - plot_data->size = new_size; - } -} - - -static void enkf_plot_data_reset( enkf_plot_data_type * plot_data ) { - int iens; - for (iens = 0; iens < plot_data->size; iens++) { - enkf_plot_tvector_reset( plot_data->ensemble[iens] ); - arg_pack_clear( plot_data->work_arg[iens] ); - } -} - - -void enkf_plot_data_free( enkf_plot_data_type * plot_data ) { - int iens; - for (iens = 0; iens < plot_data->size; iens++) { - enkf_plot_tvector_free( plot_data->ensemble[iens] ); - arg_pack_free( plot_data->work_arg[iens]); - } - free( plot_data->work_arg ); - free( plot_data->ensemble ); - free( plot_data ); -} - -UTIL_IS_INSTANCE_FUNCTION( enkf_plot_data , ENKF_PLOT_DATA_TYPE_ID ) - - -enkf_plot_data_type * enkf_plot_data_alloc( const enkf_config_node_type * config_node ) { - enkf_plot_data_type * plot_data = util_malloc( sizeof * plot_data); - UTIL_TYPE_ID_INIT( plot_data , ENKF_PLOT_DATA_TYPE_ID ); - plot_data->config_node = config_node; - plot_data->size = 0; - plot_data->ensemble = NULL; - plot_data->work_arg = NULL; - return plot_data; -} - -enkf_plot_tvector_type * enkf_plot_data_iget( const enkf_plot_data_type * plot_data , int index) { - return plot_data->ensemble[index]; -} - - -int enkf_plot_data_get_size( const enkf_plot_data_type * plot_data ) { - return plot_data->size; -} - - - - -void enkf_plot_data_load( enkf_plot_data_type * plot_data , - enkf_fs_type * fs , - const char * index_key , - const bool_vector_type * input_mask) { - state_map_type * state_map = enkf_fs_get_state_map( fs ); - int ens_size = state_map_get_size( state_map ); - bool_vector_type * mask; - - if (input_mask) - mask = bool_vector_alloc_copy( input_mask ); - else - mask = bool_vector_alloc( ens_size , false ); - state_map_select_matching( state_map , mask , STATE_HAS_DATA ); - - enkf_plot_data_resize( plot_data , ens_size ); - enkf_plot_data_reset( plot_data ); - { - const int num_cpu = 4; - thread_pool_type * tp = thread_pool_alloc( num_cpu , true ); - for (int iens = 0; iens < ens_size ; iens++) { - if (bool_vector_iget( mask , iens)) { - enkf_plot_tvector_type * vector = enkf_plot_data_iget( plot_data , iens ); - arg_pack_type * work_arg = plot_data->work_arg[iens]; - - arg_pack_append_ptr( work_arg , vector ); - arg_pack_append_ptr( work_arg , fs ); - arg_pack_append_const_ptr( work_arg , index_key ); - - thread_pool_add_job( tp , enkf_plot_tvector_load__ , work_arg ); - } - } - thread_pool_join( tp ); - thread_pool_free( tp ); - } - bool_vector_free( mask ); -} - - diff --git a/ThirdParty/Ert/libenkf/src/enkf_plot_gen_kw.c b/ThirdParty/Ert/libenkf/src/enkf_plot_gen_kw.c deleted file mode 100644 index db066c9f75..0000000000 --- a/ThirdParty/Ert/libenkf/src/enkf_plot_gen_kw.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_plot_gen_kw.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - - -#define ENKF_PLOT_GEN_KW_TYPE_ID 88362063 - -struct enkf_plot_gen_kw_struct { - UTIL_TYPE_ID_DECLARATION; - const enkf_config_node_type * config_node; - int size; /* Number of ensembles. */ - enkf_plot_gen_kw_vector_type ** ensemble; /* One vector for each ensemble. */ -}; - - -UTIL_IS_INSTANCE_FUNCTION( enkf_plot_gen_kw , ENKF_PLOT_GEN_KW_TYPE_ID ) - - -enkf_plot_gen_kw_type * enkf_plot_gen_kw_alloc( const enkf_config_node_type * config_node ) { - if (enkf_config_node_get_impl_type( config_node ) == GEN_KW) { - enkf_plot_gen_kw_type * plot_gen_kw = util_malloc( sizeof * plot_gen_kw ); - UTIL_TYPE_ID_INIT( plot_gen_kw , ENKF_PLOT_GEN_KW_TYPE_ID ); - plot_gen_kw->config_node = config_node; - plot_gen_kw->size = 0; - plot_gen_kw->ensemble = NULL; - return plot_gen_kw; - } - else { - return NULL; - } -} - - -void enkf_plot_gen_kw_free( enkf_plot_gen_kw_type * plot_gen_kw ) { - int iens; - for (iens = 0 ; iens < plot_gen_kw->size ; ++iens) { - enkf_plot_gen_kw_vector_free( plot_gen_kw->ensemble[iens] ); - } - free( plot_gen_kw ); -} - - -int enkf_plot_gen_kw_get_size( const enkf_plot_gen_kw_type * plot_gen_kw ) { - return plot_gen_kw->size; -} - -enkf_plot_gen_kw_vector_type * enkf_plot_gen_kw_iget( const enkf_plot_gen_kw_type * plot_gen_kw , int iens) { - if ((iens < 0) || (iens >= plot_gen_kw->size)) - util_abort("%s: index:%d invalid. Valid interval: [0,%d>.\n",__func__ , iens , plot_gen_kw->size); - - return plot_gen_kw->ensemble[iens]; -} - - -static void enkf_plot_gen_kw_resize( enkf_plot_gen_kw_type * plot_gen_kw , int new_size ) { - if (new_size != plot_gen_kw->size) { - int iens; - - if (new_size < plot_gen_kw->size) { - for (iens = new_size; iens < plot_gen_kw->size; iens++) { - enkf_plot_gen_kw_vector_free( plot_gen_kw->ensemble[iens] ); - } - } - - plot_gen_kw->ensemble = util_realloc( plot_gen_kw->ensemble , new_size * sizeof * plot_gen_kw->ensemble); - - if (new_size > plot_gen_kw->size) { - for (iens = plot_gen_kw->size; iens < new_size; iens++) { - plot_gen_kw->ensemble[iens] = enkf_plot_gen_kw_vector_alloc( plot_gen_kw->config_node , iens ); - } - } - plot_gen_kw->size = new_size; - } -} - - - -void enkf_plot_gen_kw_load( enkf_plot_gen_kw_type * plot_gen_kw, - enkf_fs_type * fs, - bool transform_data , - int report_step, - const bool_vector_type * input_mask ) { - - state_map_type * state_map = enkf_fs_get_state_map( fs ); - int ens_size = state_map_get_size( state_map ); - bool_vector_type * mask; - - if (input_mask) - mask = bool_vector_alloc_copy( input_mask ); - else - mask = bool_vector_alloc( ens_size , true ); - - enkf_plot_gen_kw_resize( plot_gen_kw , ens_size ); - { - int iens; - for (iens = 0; iens < ens_size; ++iens) { - if (bool_vector_iget( mask , iens)) { - enkf_plot_gen_kw_vector_type * vector = enkf_plot_gen_kw_iget( plot_gen_kw , iens ); - enkf_plot_gen_kw_vector_load( vector , fs , transform_data , report_step ); - } - } - } -} - - - -const char * enkf_plot_gen_kw_iget_key( const enkf_plot_gen_kw_type * plot_gen_kw, int index) { - const gen_kw_config_type * gen_kw_config = enkf_config_node_get_ref( plot_gen_kw->config_node ); - return gen_kw_config_iget_name( gen_kw_config , index ); -} - -int enkf_plot_gen_kw_get_keyword_count( const enkf_plot_gen_kw_type * gen_kw ){ - const gen_kw_config_type * gen_kw_config = enkf_config_node_get_ref( gen_kw->config_node ); - return gen_kw_config_get_data_size(gen_kw_config); -} - -bool enkf_plot_gen_kw_should_use_log_scale(const enkf_plot_gen_kw_type * gen_kw , int index) { - const gen_kw_config_type * gen_kw_config = enkf_config_node_get_ref( gen_kw->config_node ); - return gen_kw_config_should_use_log_scale(gen_kw_config, index); -} diff --git a/ThirdParty/Ert/libenkf/src/enkf_plot_gen_kw_vector.c b/ThirdParty/Ert/libenkf/src/enkf_plot_gen_kw_vector.c deleted file mode 100644 index 59a1090659..0000000000 --- a/ThirdParty/Ert/libenkf/src/enkf_plot_gen_kw_vector.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_plot_gen_kw_vector.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - - -#define ENKF_PLOT_GEN_KW_VECTOR_TYPE_ID 88362064 - -struct enkf_plot_gen_kw_vector_struct { - UTIL_TYPE_ID_DECLARATION; - int iens; - double_vector_type * data; - const enkf_config_node_type * config_node; -}; - - -UTIL_IS_INSTANCE_FUNCTION( enkf_plot_gen_kw_vector , ENKF_PLOT_GEN_KW_VECTOR_TYPE_ID ) - - -enkf_plot_gen_kw_vector_type * enkf_plot_gen_kw_vector_alloc( const enkf_config_node_type * config_node , int iens ) { - enkf_plot_gen_kw_vector_type * vector = util_malloc( sizeof * vector ); - UTIL_TYPE_ID_INIT( vector , ENKF_PLOT_GEN_KW_VECTOR_TYPE_ID ); - vector->config_node = config_node; - vector->data = double_vector_alloc(0,0); - vector->iens = iens; - return vector; -} - - -void enkf_plot_gen_kw_vector_free( enkf_plot_gen_kw_vector_type * vector ) { - double_vector_free( vector->data ); - free( vector ); -} - - -int enkf_plot_gen_kw_vector_get_size( const enkf_plot_gen_kw_vector_type * vector ) { - return double_vector_size( vector->data ); -} - -double enkf_plot_gen_kw_vector_iget( const enkf_plot_gen_kw_vector_type * vector , int index ) { - return double_vector_iget( vector->data , index ); -} - - -void enkf_plot_gen_kw_vector_reset( enkf_plot_gen_kw_vector_type * vector ) { - double_vector_reset( vector->data ); -} - - -void enkf_plot_gen_kw_vector_load( enkf_plot_gen_kw_vector_type * vector , enkf_fs_type * fs , bool transform_data , int report_step ) { - enkf_plot_gen_kw_vector_reset( vector ); - { - node_id_type node_id = { .report_step = report_step , - .iens = vector->iens }; - - enkf_node_type * data_node = enkf_node_alloc( vector->config_node ); - - if (enkf_node_try_load( data_node , fs , node_id )) { - gen_kw_type * gen_kw = enkf_node_value_ptr( data_node ); - int n_kw = gen_kw_data_size( gen_kw ); - int i_kw; - - for (i_kw = 0 ; i_kw < n_kw ; ++i_kw) { - double_vector_append(vector->data , gen_kw_data_iget( gen_kw , i_kw , transform_data ) ); - } - } - - enkf_node_free( data_node ); - } -} diff --git a/ThirdParty/Ert/libenkf/src/enkf_plot_gendata.c b/ThirdParty/Ert/libenkf/src/enkf_plot_gendata.c deleted file mode 100644 index d0fddf5207..0000000000 --- a/ThirdParty/Ert/libenkf/src/enkf_plot_gendata.c +++ /dev/null @@ -1,203 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_plot_gendata.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include -#include -#include - - -#include -#include -#include -#include - -#include -#include -#include -#include - - -#define ENKF_PLOT_GENDATA_TYPE_ID 377626666 - -struct enkf_plot_gendata_struct { - UTIL_TYPE_ID_DECLARATION; - int size; - const enkf_config_node_type * enkf_config_node; - enkf_plot_genvector_type ** ensemble; - arg_pack_type ** work_arg; - double_vector_type * max_values; - double_vector_type * min_values; -}; - -UTIL_IS_INSTANCE_FUNCTION( enkf_plot_gendata , ENKF_PLOT_GENDATA_TYPE_ID ) - -enkf_plot_gendata_type * enkf_plot_gendata_alloc( const enkf_config_node_type * enkf_config_node ) { - if (enkf_config_node_get_impl_type(enkf_config_node) == GEN_DATA ){ - enkf_plot_gendata_type * data = util_malloc(sizeof * data); - UTIL_TYPE_ID_INIT (data , ENKF_PLOT_GENDATA_TYPE_ID); - data->size = 0; - data->enkf_config_node = enkf_config_node; - data->work_arg = NULL; - data->ensemble = NULL; - - data->max_values = NULL; - data->min_values = NULL; - return data; - } else { - return NULL; - } - -} - - -enkf_plot_gendata_type * enkf_plot_gendata_alloc_from_obs_vector( const obs_vector_type * obs_vector ){ - return enkf_plot_gendata_alloc(obs_vector_get_config_node(obs_vector)); -} - -void enkf_plot_gendata_free( enkf_plot_gendata_type * data ){ - for (int iens = 0; iens < data->size; iens++) { - arg_pack_free( data->work_arg[iens] ); - enkf_plot_genvector_free( data->ensemble[iens] ); - } - - free( data->work_arg ); - free( data->ensemble ); - free( data ); - -} - -int enkf_plot_gendata_get_size( const enkf_plot_gendata_type * data ){ - return data->size; -} - -enkf_plot_genvector_type * enkf_plot_gendata_iget( const enkf_plot_gendata_type * plot_data , int index){ - if(index >=0 && index < plot_data->size){ - return plot_data->ensemble[index]; - } else { - return NULL; - } -} - -static void enkf_plot_gendata_resize( enkf_plot_gendata_type * plot_gendata , int new_size ){ - if (new_size != plot_gendata->size) { - int iens; - - if (new_size < plot_gendata->size) { - for (iens = new_size; iens < plot_gendata->size; iens++) { - enkf_plot_genvector_free( plot_gendata->ensemble[iens] ); - arg_pack_free( plot_gendata->work_arg[iens] ); - } - } - - plot_gendata->ensemble = util_realloc( plot_gendata->ensemble , new_size * sizeof * plot_gendata->ensemble); - plot_gendata->work_arg = util_realloc( plot_gendata->work_arg , new_size * sizeof * plot_gendata->work_arg); - - if (new_size > plot_gendata->size) { - for (iens = plot_gendata->size; iens < new_size; iens++) { - plot_gendata->ensemble[iens] = enkf_plot_genvector_alloc( plot_gendata->enkf_config_node , iens ); - plot_gendata->work_arg[iens] = arg_pack_alloc(); - } - } - plot_gendata->size = new_size; - } -} - -static void enkf_plot_gendata_reset( enkf_plot_gendata_type * plot_gendata , int report_step){ - int iens; - for (iens = 0; iens < plot_gendata->size; iens++){ - arg_pack_clear( plot_gendata->work_arg[iens] ); - } -} - - - -void enkf_plot_gendata_load( enkf_plot_gendata_type * plot_data , - enkf_fs_type * fs , - int report_step , - const bool_vector_type * input_mask){ - - state_map_type * state_map = enkf_fs_get_state_map( fs ); - int ens_size = state_map_get_size( state_map ); - bool_vector_type * mask; - - if (input_mask) - mask = bool_vector_alloc_copy( input_mask ); - else - mask = bool_vector_alloc( ens_size , false ); - - state_map_select_matching( state_map , mask , STATE_HAS_DATA ); - - enkf_plot_gendata_resize( plot_data , ens_size ); - enkf_plot_gendata_reset( plot_data , report_step ); - - { - const int num_cpu = 4; - thread_pool_type * tp = thread_pool_alloc( num_cpu , true ); - for (int iens = 0; iens < ens_size ; iens++) { - if (bool_vector_iget( mask , iens)) { - enkf_plot_genvector_type * vector = enkf_plot_gendata_iget( plot_data , iens ); - arg_pack_type * work_arg = plot_data->work_arg[iens]; - - arg_pack_append_ptr( work_arg , vector ); - arg_pack_append_ptr( work_arg , fs ); - arg_pack_append_int( work_arg , report_step); - - thread_pool_add_job( tp , enkf_plot_genvector_load__ , work_arg ); - } - } - thread_pool_join( tp ); - thread_pool_free( tp ); - } - - bool_vector_free( mask ); - -} - -void enkf_plot_gendata_find_min_max_values__(enkf_plot_gendata_type * plot_data){ - for (int iens = 0; iens < plot_data->size; iens++){ - enkf_plot_genvector_type * vector = enkf_plot_gendata_iget(plot_data, iens); - int size = enkf_plot_genvector_get_size(vector); - if(iens == 0) { - plot_data->min_values = double_vector_alloc(size, DBL_MAX); - plot_data->max_values = double_vector_alloc(size, -DBL_MAX); - } - for(int index = 0; index < size; index++){ - double value = enkf_plot_genvector_iget(vector, index); - double_vector_iset(plot_data->min_values, index, util_double_min(double_vector_iget(plot_data->min_values, index), value)); - double_vector_iset(plot_data->max_values, index, util_double_max(double_vector_iget(plot_data->max_values, index), value)); - } - } -} - -double_vector_type * enkf_plot_gendata_get_min_values(enkf_plot_gendata_type * plot_data) { - if(plot_data->min_values == NULL) { - enkf_plot_gendata_find_min_max_values__(plot_data); - } - return plot_data->min_values; -} - - - -double_vector_type * enkf_plot_gendata_get_max_values(enkf_plot_gendata_type * plot_data) { - if(plot_data->max_values == NULL) { - enkf_plot_gendata_find_min_max_values__(plot_data); - } - return plot_data->max_values; -} diff --git a/ThirdParty/Ert/libenkf/src/enkf_plot_genvector.c b/ThirdParty/Ert/libenkf/src/enkf_plot_genvector.c deleted file mode 100644 index 346d7b49b3..0000000000 --- a/ThirdParty/Ert/libenkf/src/enkf_plot_genvector.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_plot_genvector.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include - - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#define ENKF_PLOT_GENVECTOR_TYPE_ID 66862669 - -struct enkf_plot_genvector_struct { - UTIL_TYPE_ID_DECLARATION; - int iens; - double_vector_type * data; - const enkf_config_node_type * config_node; -}; - -UTIL_IS_INSTANCE_FUNCTION( enkf_plot_genvector , ENKF_PLOT_GENVECTOR_TYPE_ID ) - -enkf_plot_genvector_type * enkf_plot_genvector_alloc( const enkf_config_node_type * config_node , int iens){ - enkf_plot_genvector_type * vector = util_malloc( sizeof * vector ); - UTIL_TYPE_ID_INIT( vector , ENKF_PLOT_GENVECTOR_TYPE_ID ); - vector->config_node = config_node; - vector->data = double_vector_alloc(0,0); - vector->iens = iens; - return vector; - -} - -void enkf_plot_genvector_free( enkf_plot_genvector_type * vector ){ - double_vector_free(vector->data); - free(vector); -} - -int enkf_plot_genvector_get_size( const enkf_plot_genvector_type * vector ){ - return double_vector_size( vector->data ); -} - - -double enkf_plot_genvector_iget( const enkf_plot_genvector_type * vector , int index){ - return double_vector_iget( vector->data , index ); -} - - -void enkf_plot_genvector_load( enkf_plot_genvector_type * vector , enkf_fs_type * fs , int report_step ) { - enkf_node_type * work_node = enkf_node_alloc( vector->config_node ); - - node_id_type node_id = { .report_step = report_step , - .iens = vector->iens }; - - if (enkf_node_try_load( work_node , fs , node_id )) { - gen_data_type * node = enkf_node_value_ptr( work_node ); - gen_data_copy_to_double_vector( node , vector->data ); - - } - enkf_node_free( work_node ); -} - - -void * enkf_plot_genvector_load__( void * arg ){ - arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); - enkf_plot_genvector_type * vector = arg_pack_iget_ptr( arg_pack , 0); - enkf_fs_type * fs = arg_pack_iget_ptr( arg_pack , 1 ); - int report_step = arg_pack_iget_int( arg_pack , 2 ); - - enkf_plot_genvector_load( vector , fs , report_step ); - return NULL; - -} diff --git a/ThirdParty/Ert/libenkf/src/enkf_plot_tvector.c b/ThirdParty/Ert/libenkf/src/enkf_plot_tvector.c deleted file mode 100644 index 009f28c710..0000000000 --- a/ThirdParty/Ert/libenkf/src/enkf_plot_tvector.c +++ /dev/null @@ -1,181 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'enkf_plot_tvector.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include -#include - -#define ENKF_PLOT_TVECTOR_ID 6111861 - -struct enkf_plot_tvector_struct { - UTIL_TYPE_ID_DECLARATION; - double_vector_type * data; - double_vector_type * work; - time_t_vector_type * time; - bool_vector_type * mask; - const enkf_config_node_type * config_node; - int iens; - bool summary_mode; -}; - - - -UTIL_SAFE_CAST_FUNCTION( enkf_plot_tvector , ENKF_PLOT_TVECTOR_ID ) -UTIL_IS_INSTANCE_FUNCTION( enkf_plot_tvector , ENKF_PLOT_TVECTOR_ID ) - - - -void enkf_plot_tvector_reset( enkf_plot_tvector_type * plot_tvector ) { - double_vector_reset( plot_tvector->data ); - time_t_vector_reset( plot_tvector->time ); - bool_vector_reset( plot_tvector->mask ); -} - - -enkf_plot_tvector_type * enkf_plot_tvector_alloc( const enkf_config_node_type * config_node , int iens) { - enkf_plot_tvector_type * plot_tvector = util_malloc( sizeof * plot_tvector); - UTIL_TYPE_ID_INIT( plot_tvector , ENKF_PLOT_TVECTOR_ID ); - - plot_tvector->data = double_vector_alloc( 0 , 0 ); - plot_tvector->time = time_t_vector_alloc(-1 , 0); - plot_tvector->mask = bool_vector_alloc( false , 0 ); - plot_tvector->work = double_vector_alloc(0,0); - plot_tvector->iens = iens; - - plot_tvector->config_node = config_node; - if (enkf_config_node_get_impl_type( config_node ) == SUMMARY) - plot_tvector->summary_mode = true; - else - plot_tvector->summary_mode = false; - - return plot_tvector; -} - - -void enkf_plot_tvector_free( enkf_plot_tvector_type * plot_tvector ) { - double_vector_free( plot_tvector->data ); - double_vector_free( plot_tvector->work ); - time_t_vector_free( plot_tvector->time ); - bool_vector_free( plot_tvector->mask ); -} - - -bool enkf_plot_tvector_all_active( const enkf_plot_tvector_type * plot_tvector ) { - bool all_active = true; - for (int i=0; i < bool_vector_size( plot_tvector->mask ); i++) - all_active = all_active && bool_vector_iget(plot_tvector->mask , i ); - - return all_active; -} - - -int enkf_plot_tvector_size( const enkf_plot_tvector_type * plot_tvector ) { - return bool_vector_size( plot_tvector->mask ); -} - - -void enkf_plot_tvector_iset( enkf_plot_tvector_type * plot_tvector , int index , time_t time , double value) { - time_t_vector_iset( plot_tvector->time , index , time ); - bool active_value = true; - - /* This is to handle holes in the summary vector storage. */ - if (plot_tvector->summary_mode && !summary_active_value( value )) - active_value = false; - - if (active_value) { - double_vector_iset( plot_tvector->data , index , value ); - bool_vector_iset( plot_tvector->mask , index , true ); - } else - bool_vector_iset( plot_tvector->mask , index , false ); - -} - - - -double enkf_plot_tvector_iget_value( const enkf_plot_tvector_type * plot_tvector , int index) { - return double_vector_iget( plot_tvector->data , index); -} - -time_t enkf_plot_tvector_iget_time( const enkf_plot_tvector_type * plot_tvector , int index) { - return time_t_vector_iget( plot_tvector->time , index); -} - -bool enkf_plot_tvector_iget_active( const enkf_plot_tvector_type * plot_tvector , int index) { - return bool_vector_iget( plot_tvector->mask , index ); -} - - - - - - -void enkf_plot_tvector_load( enkf_plot_tvector_type * plot_tvector , - enkf_fs_type * fs , - const char * index_key) { - - time_map_type * time_map = enkf_fs_get_time_map( fs ); - int step1 = 0; - int step2 = time_map_get_last_step( time_map ); - enkf_node_type * work_node = enkf_node_alloc( plot_tvector->config_node ); - - if (enkf_node_vector_storage( work_node )) { - bool has_data = enkf_node_user_get_vector(work_node , fs , index_key , plot_tvector->iens , plot_tvector->work); - - if(has_data) { - for (int step = 0; step < double_vector_size( plot_tvector->work ); step++) - enkf_plot_tvector_iset( plot_tvector , - step , - time_map_iget( time_map , step ) , - double_vector_iget( plot_tvector->work , step )); - } - } else { - int step; - node_id_type node_id = {.iens = plot_tvector->iens, - .report_step = 0 }; - - for (step = step1 ; step <= step2; step++) { - double value; - node_id.report_step = step; - - if (enkf_node_user_get(work_node , fs , index_key , node_id , &value)) { - enkf_plot_tvector_iset( plot_tvector , - step , - time_map_iget( time_map , step ) , - value ); - } - } - } - enkf_node_free( work_node ); -} - - -void * enkf_plot_tvector_load__( void * arg ) { - arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); - enkf_plot_tvector_type * tvector = arg_pack_iget_ptr( arg_pack , 0 ); - enkf_fs_type * fs = arg_pack_iget_ptr( arg_pack , 1 ); - const char * index_key = arg_pack_iget_ptr( arg_pack , 2 ); - - enkf_plot_tvector_load( tvector , fs , index_key ); - return NULL; -} - diff --git a/ThirdParty/Ert/libenkf/src/enkf_serialize.c b/ThirdParty/Ert/libenkf/src/enkf_serialize.c deleted file mode 100644 index 3532e8e03a..0000000000 --- a/ThirdParty/Ert/libenkf/src/enkf_serialize.c +++ /dev/null @@ -1,276 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_serialize.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include - -#include -#include -#include - -/** This is heavy shit ... */ - - -/** - This file handles serialization and deserialization of the - enkf_nodes. This is at the very core of the EnKF update - algorithm. The final update step is written: - - A' = XA - - i.e. it is linear algeabra, and we need(?) to write the various - objects in the form of an ensemble matrix, this is the process we - call serialization. Then the linear algebra update is performed, - and afterwards we must read the data back from the ensemble matrix - to the enkf_node object, this is deserialization. - - - - - =============== =============== - | PORO-1 | | PORO-2 | - |-------------- Member 2 |-------------- - | | ======== | | - | P0 ... P10 | Member 1 | | P0 ... P10 | - =============== ======== | =============== - /|\ | ----- /|\ - | | | | - | \|/ \|/ | - | | - | [ P0 P0 ] | - | [ P1 P1 ] | - ------------------>[ P2 P2 ]<------------------- - [ P3 P3 ] - [ P4 P4 ] - [ ··········] ============== - [ R1 R1 ] | RELPERM-2 | - ============== ------>[ R2 R2 ]<----------->|------------| - | RELPERM-1 | | [ R3 R3 ] | | - |------------|<---- [ ··········] | R0 ... R5 | - | | [ F2 F2 ] ============== - | R0 ... R5 | ---->[ F3 F3 ] - ============== | [ F4 F4 ]<----- - | [ F6 F6 ] | - | | - | | ============== - | | | FAULT-1 | - | ----------->|------------| - ============== | | | - | FAULT-1 | | | F0 ... F6 | - |------------|<------ ============== - | | - | F0 ... F6 | - ============== - - - -This figure shows the following: - - 1. Three different nodes called PORO, RELPERM and FAULT - respectively. The PORO node consists of eleven elements (P0 - ... P10), whereas the RELPERM and FAULT nodes contain six and - seven elements. - - 2. The ensemble consists of two members (i.e. there is PORO-1 and - PORO-2.). - - 3. The members have been serialized into a a large vector where - everything comes ordered. Observe that *NOT* all elements from the - members have been inserted into the large vector, i.e. for the - PORO fields we only have elements P0 .. P4; this is because (for - some reason) not all elements were active. - - -Each of the enkf_node functions have their own xxx_serialize and -xxx_deserialize functions, however these functions SHOULD call the -enkf_serialize() and enkf_deserialize() functions in this -file. (Rolling your own serialize / deserialize functions at the -lowest level is a SERIOUS CRIME.) - -The illustration above shows three different enkf_node objects which -have been COMPLETELY serialized. One of the reasons the code is so -complex is that it is supposed to handle situations where the serial -vector is to small to hold everything, and repeated calls to serialize -& deserialize must be performed to complete the thing. - - -About stride -============ -In the enkf update the ensemble matrix A is just that - a matrix, -however in this elegant high-level language it is of course -implemented as one long linear vector. The matrix is implemented such -that the 'member-direction' is fastest running index. Consider the -following ensemble matrix, consisting of five ensemble members: - - - - - - Member 5 - Member 2 --· | - | | - | | -Member 1 ----· | | - | | | - \|/ \|/ \|/ - [ P0 P0 P0 P0 P0 ] - [ P1 P1 P1 P1 P1 ] - [ P2 P2 P2 P2 P2 ] - [ P3 P3 P3 P3 P3 ] - [ R0 R0 R0 R0 R0 ] - A = [ R1 R1 R1 R1 R1 ] - [ R2 R2 R2 R2 R2 ] - [ F0 F0 F0 F0 F0 ] - [ F1 F1 F1 F1 F1 ] - [ F2 F2 F2 F2 F2 ] - [ F3 F3 F3 F3 F3 ] - - -The in memory the matrix will look like this: - - - Member 2 - | - ______________|______________ - / | \ - | | | - ______________|______________|______________|______________ - / | | | \ - | | | | | - | | | | | - \|/ \|/ \|/ \|/ \|/ ........... - A =[ P0 P0 P0 P0 P0 P1 P1 P1 P1 P1 P2 P2 P2 P2 P2 P3 P3 P3 P3 P3 R0 R0 R0 R0 R0 R1 R1 R1 R1 R1 R2 R2 R2 R2 R2 F0 F0 F0 F0 F0 F1 F1 F1 F1 F1 F2 F2 F2 F2 F2 F3 F3 F3 F3 F3 ...] - /|\ X1 /|\ X2 /|\ /|\ /|\ ........ - | | | | | - | | | | | - \______________|______________|______________|______________/ - | | | - | | | - \______________|______________/ - | - | - Member 1 - -The stride in the serial_vector_type object is the number of elements -between consecutive elements in the same member, i.e. it is five in -the vector above. (Starting at e.g. P0 for member three (marked with -X1 in the figure), P1 for the same member is five elements down in the -vector (marked with X2 above)). Now - that was clear ehhh? - -*****************************************************************/ - - - -/* - It will be very costly to make it thread-safe if we manipulate the - shape of the A matrix from here. -*/ - - -void enkf_matrix_serialize(const void * __node_data , - int node_size , - ecl_type_enum node_type , - const active_list_type * __active_list , - matrix_type * A , - int row_offset, - int column) { - - int active_size; - const int * active_list = active_list_get_active( __active_list ); - active_size = active_list_get_active_size( __active_list , node_size); - - if (node_type == ECL_DOUBLE_TYPE) { - const double * node_data = (const double *) __node_data; - if (active_size == node_size) /** All elements active */ - matrix_set_many_on_column( A , row_offset , node_size , node_data , column); - else { - int row_index; - int node_index; - for (row_index = 0; row_index < active_size; row_index++) { - node_index = active_list[ row_index ]; - matrix_iset( A , row_index + row_offset , column , node_data[node_index] ); - } - } - } else if (node_type == ECL_FLOAT_TYPE) { - const float * node_data = (const float *) __node_data; - int row_index; - if (active_size == node_size) {/** All elements active */ - for (row_index = 0; row_index < node_size; row_index++) - matrix_iset( A , row_index + row_offset , column , node_data[ row_index ]); /* Must have float -> double conversion; can not use memcpy() based approach */ - } else { - int row_index; - int node_index; - for (row_index = 0; row_index < active_size; row_index++) { - node_index = active_list[ row_index ]; - matrix_iset( A , row_index + row_offset , column , node_data[node_index] ); - } - } - } else - util_abort("%s: internal error: trying to serialize unserializable type:%s \n",__func__ , ecl_util_get_type_name( node_type )); -} - - -void enkf_matrix_deserialize(void * __node_data , - int node_size , - ecl_type_enum node_type , - const active_list_type * __active_list , - const matrix_type * A, - int row_offset, - int column) { - - int active_size; - const int * active_list = active_list_get_active( __active_list ); - active_size = active_list_get_active_size( __active_list , node_size ); - - if (node_type == ECL_DOUBLE_TYPE) { - double * node_data = (double *) __node_data; - - if (active_size == node_size) { /** All elements active */ - int row_index; - for (row_index = 0; row_index < active_size; row_index++) - node_data[row_index] = matrix_iget( A , row_index + row_offset , column); - } else { - int row_index; - int node_index; - for (row_index = 0; row_index < active_size; row_index++) { - node_index = active_list[ row_index ]; - node_data[node_index] = matrix_iget( A , row_index + row_offset , column); - } - } - - } else if (node_type == ECL_FLOAT_TYPE) { - float * node_data = (float *) __node_data; - - if (active_size == node_size) { /** All elements active */ - int row_index; - for (row_index = 0; row_index < active_size; row_index++) - node_data[row_index] = matrix_iget( A , row_index + row_offset , column); - } else { - int row_index; - int node_index; - for (row_index = 0; row_index < active_size; row_index++) { - node_index = active_list[ row_index ]; - node_data[node_index] = matrix_iget( A , row_index + row_offset , column); - } - } - } else - util_abort("%s: internal error: trying to serialize unserializable type:%s \n",__func__ , ecl_util_get_type_name( node_type )); -} - diff --git a/ThirdParty/Ert/libenkf/src/enkf_state.c b/ThirdParty/Ert/libenkf/src/enkf_state.c deleted file mode 100644 index f2a1afd0a3..0000000000 --- a/ThirdParty/Ert/libenkf/src/enkf_state.c +++ /dev/null @@ -1,1654 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_state.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define ENKF_STATE_TYPE_ID 78132 - - - - - -/** - This struct contains various objects which the enkf_state needs - during operation, which the enkf_state_object *DOES NOT* own. The - struct only contains pointers to objects owned by (typically) the - enkf_main object. - - If the enkf_state object writes to any of the objects in this - struct that can be considered a serious *BUG*. - - The elements in this struct should not change during the - application lifetime? -*/ - -typedef struct shared_info_struct { - model_config_type * model_config; /* .... */ - ext_joblist_type * joblist; /* The list of external jobs which are installed - and *how* they should be run (with Python code) */ - job_queue_type * job_queue; /* The queue handling external jobs. (i.e. LSF / TORQUE / rsh / local / ... )*/ - const site_config_type * site_config; - ert_templates_type * templates; - const ecl_config_type * ecl_config; -} shared_info_type; - - - - - - -/*****************************************************************/ - -struct enkf_state_struct { - UTIL_TYPE_ID_DECLARATION; - hash_type * node_hash; - subst_list_type * subst_list; /* This a list of key - value pairs which are used in a search-replace - operation on the ECLIPSE data file. Will at least contain the key INIT" - - which will describe initialization of ECLIPSE (EQUIL or RESTART).*/ - ensemble_config_type * ensemble_config; /* The config nodes for the enkf_node objects contained in node_hash. */ - - shared_info_type * shared_info; /* Pointers to shared objects which is needed by the enkf_state object (read only). */ - member_config_type * my_config; /* Private config information for this member; not updated during a simulation. */ - rng_type * rng; -}; - -/*****************************************************************/ - - -static UTIL_SAFE_CAST_FUNCTION( enkf_state , ENKF_STATE_TYPE_ID ) - - -static shared_info_type * shared_info_alloc(const site_config_type * site_config , model_config_type * model_config, const ecl_config_type * ecl_config , ert_templates_type * templates) { - shared_info_type * shared_info = util_malloc(sizeof * shared_info ); - - shared_info->joblist = site_config_get_installed_jobs( site_config ); - shared_info->job_queue = site_config_get_job_queue( site_config ); - shared_info->site_config = site_config; - shared_info->model_config = model_config; - shared_info->templates = templates; - shared_info->ecl_config = ecl_config; - return shared_info; -} - - -static void shared_info_free(shared_info_type * shared_info) { - /** - Adding something here is a BUG - this object does - not own anything. - */ - free( shared_info ); -} - - - - - -/*****************************************************************/ -/** Helper classes complete - starting on the enkf_state proper object. */ -/*****************************************************************/ - -void enkf_state_initialize(enkf_state_type * enkf_state , enkf_fs_type * fs , const stringlist_type * param_list, init_mode_type init_mode) { - if (init_mode != INIT_NONE) { - int iens = enkf_state_get_iens( enkf_state ); - state_map_type * state_map = enkf_fs_get_state_map( fs ); - realisation_state_enum current_state = state_map_iget(state_map, iens); - if ((current_state == STATE_PARENT_FAILURE) && (init_mode != INIT_FORCE)) - return; - else { - for (int ip = 0; ip < stringlist_get_size(param_list); ip++) { - enkf_node_type * param_node = enkf_state_get_node(enkf_state, stringlist_iget(param_list, ip)); - node_id_type node_id = { .report_step = 0, .iens = iens }; - bool has_data = enkf_node_has_data(param_node, fs, node_id); - - if ((init_mode == INIT_FORCE) || (has_data == false) || (current_state == STATE_LOAD_FAILURE)) { - if (enkf_node_initialize(param_node, iens, enkf_state->rng)) - enkf_node_store(param_node, fs, true, node_id); - } - } - state_map_update_matching(state_map , iens , STATE_UNDEFINED | STATE_LOAD_FAILURE , STATE_INITIALIZED); - enkf_fs_fsync(fs); - } - } -} - - - - - - - -/* - void enkf_state_set_iens(enkf_state_type * enkf_state , int iens) { - enkf_state->my_iens = iens; - } -*/ - -int enkf_state_get_iens(const enkf_state_type * enkf_state) { - return member_config_get_iens( enkf_state->my_config ); -} - -member_config_type * enkf_state_get_member_config(const enkf_state_type * enkf_state) { - return enkf_state->my_config; -} - - - -subst_list_type * enkf_state_get_subst_list( enkf_state_type * enkf_state ) { - return enkf_state->subst_list; -} - -void enkf_state_add_subst_kw(enkf_state_type * enkf_state , const char * kw , const char * value , const char * doc_string) { - char * tagged_key = util_alloc_sprintf( INTERNAL_DATA_KW_TAG_FORMAT , kw ); - subst_list_append_owned_ref(enkf_state->subst_list , tagged_key , util_alloc_string_copy(value) , doc_string); - free(tagged_key); -} - - - - - -/** - This function must be called each time the eclbase_fmt has been - updated. -*/ - -void enkf_state_update_eclbase( enkf_state_type * enkf_state ) { - const char * eclbase = member_config_update_eclbase( enkf_state->my_config , enkf_state->shared_info->ecl_config , enkf_state->subst_list); - const char * casename = member_config_get_casename( enkf_state->my_config ); /* Mostly NULL */ - { - enkf_state_add_subst_kw(enkf_state , "ECL_BASE" , eclbase , NULL); - enkf_state_add_subst_kw(enkf_state , "ECLBASE" , eclbase , NULL); - - if (casename == NULL) - enkf_state_add_subst_kw( enkf_state , "CASE" , eclbase , NULL); /* No CASE_TABLE loaded - using the eclbase as default. */ - else - enkf_state_add_subst_kw( enkf_state , "CASE" , casename , NULL); - } -} - - -void enkf_state_update_jobname( enkf_state_type * enkf_state ) { - member_config_update_jobname( enkf_state->my_config , - model_config_get_jobname_fmt( enkf_state->shared_info->model_config ) , - enkf_state->subst_list); -} - - -/** - Sets all the static subst keywords which will not change during the simulation. -*/ -static void enkf_state_set_static_subst_kw(enkf_state_type * enkf_state) { - - { - int iens = member_config_get_iens( enkf_state->my_config ); - char * iens_s = util_alloc_sprintf("%d" , iens); - char * iens4_s = util_alloc_sprintf("%04d" , iens); - char * iensp1_s = util_alloc_sprintf("%d" , iens + 1); - - enkf_state_add_subst_kw(enkf_state , "IENS" , iens_s , NULL); - enkf_state_add_subst_kw(enkf_state , "IENSP1" , iensp1_s , NULL); - enkf_state_add_subst_kw(enkf_state , "IENS4" , iens4_s , NULL); - - free(iensp1_s); - free(iens_s); - free(iens4_s); - } - enkf_state_update_eclbase( enkf_state ); -} - - -static void enkf_state_add_nodes( enkf_state_type * enkf_state, const ensemble_config_type * ensemble_config) { - stringlist_type * container_keys = stringlist_alloc_new(); - stringlist_type * keylist = ensemble_config_alloc_keylist(ensemble_config); - int keys = stringlist_get_size(keylist); - - // 1: Add all regular nodes - for (int ik = 0; ik < keys; ik++) { - const char * key = stringlist_iget(keylist, ik); - const enkf_config_node_type * config_node = ensemble_config_get_node(ensemble_config , key); - if (enkf_config_node_get_impl_type( config_node ) == CONTAINER) { - stringlist_append_ref( container_keys , key ); - } else - enkf_state_add_node(enkf_state , key , config_node); - } - - // 2: Add container nodes - must ensure that all other nodes have - // been added already (this implies that containers of containers - // will be victim of hash retrieval order problems .... - - for (int ik = 0; ik < stringlist_get_size( container_keys ); ik++) { - const char * key = stringlist_iget(container_keys, ik); - const enkf_config_node_type * config_node = ensemble_config_get_node(ensemble_config , key); - enkf_state_add_node( enkf_state , key , config_node ); - } - - stringlist_free(keylist); - stringlist_free( container_keys ); -} - - -/** - This variable is on a per-instance basis, but that is not really - supported. The exported functionality applies to all realizations. -*/ - -bool enkf_state_get_pre_clear_runpath( const enkf_state_type * enkf_state ) { - return member_config_pre_clear_runpath( enkf_state->my_config ); -} - - -void enkf_state_set_pre_clear_runpath( enkf_state_type * enkf_state , bool pre_clear_runpath ) { - member_config_set_pre_clear_runpath( enkf_state->my_config , pre_clear_runpath ); -} - - - -enkf_state_type * enkf_state_alloc(int iens, - rng_type * main_rng , - const char * casename , - bool pre_clear_runpath , - keep_runpath_type keep_runpath , - model_config_type * model_config, - ensemble_config_type * ensemble_config, - const site_config_type * site_config, - const ecl_config_type * ecl_config, - - ert_templates_type * templates, - subst_list_type * subst_parent) { - - enkf_state_type * enkf_state = util_malloc(sizeof *enkf_state ); - UTIL_TYPE_ID_INIT( enkf_state , ENKF_STATE_TYPE_ID ); - - enkf_state->ensemble_config = ensemble_config; - enkf_state->shared_info = shared_info_alloc(site_config , model_config , ecl_config , templates); - - enkf_state->node_hash = hash_alloc(); - enkf_state->subst_list = subst_list_alloc( subst_parent ); - enkf_state->rng = rng_alloc( rng_get_type( main_rng ) , INIT_DEFAULT ); - rng_rng_init( enkf_state->rng , main_rng ); /* <- Not thread safe */ - /* - The user MUST specify an INIT_FILE, and for the first timestep the - tag in the data file will be replaced by an - - INCLDUE - EQUIL_INIT_FILE - - statement. When considering the possibility of estimating EQUIL this - require a real understanding of the treatment of paths: - - * If not estimating the EQUIL contacts, all members should use the - same init_file. To ensure this the user must specify the ABSOLUTE - PATH to a file containing initialization information. - - * If the user is estimating initial contacts, the INIT_FILE must - point to the ecl_file of the EQUIL keyword, this must be a pure - filename without any path component (as it will be generated by - the EnKF program, and placed in the run_path directory). We could - let the EnKF program use the ecl_file of the EQUIL keyword if it - is present. - - The key is actually initialized in the - enkf_state_set_dynamic_subst_kw() function. - */ - - /** - Adding all the subst_kw keywords here, with description. Listing - all of them here in one go guarantees that we have control over - the ordering (which is interesting because the substititions are - done in a cascade like fashion). The user defined keywords are - added first, so that these can refer to the built in keywords. - */ - - enkf_state_add_subst_kw(enkf_state , "RUNPATH" , "---" , "The absolute path of the current forward model instance. "); - enkf_state_add_subst_kw(enkf_state , "IENS" , "---" , "The realisation number for this realization."); - enkf_state_add_subst_kw(enkf_state , "IENS4" , "---" , "The realization number for this realization - formated with %04d."); - enkf_state_add_subst_kw(enkf_state , "ECLBASE" , "---" , "The ECLIPSE basename for this realization."); - enkf_state_add_subst_kw(enkf_state , "ECL_BASE" , "---" , "Depreceated - use ECLBASE instead."); - enkf_state_add_subst_kw(enkf_state , "SMSPEC" , "---" , "The ECLIPSE SMSPEC file for this realization."); - enkf_state_add_subst_kw(enkf_state , "TSTEP1" , "---" , "The initial report step for this simulation."); - enkf_state_add_subst_kw(enkf_state , "TSTEP2" , "---" , "The final report step for this simulation."); - enkf_state_add_subst_kw(enkf_state , "TSTEP1_04" , "---" , "The initial report step for this simulation - formated with %04d."); - enkf_state_add_subst_kw(enkf_state , "TSTEP2_04" , "---" , "The final report step for this simulation - formated withh %04d."); - enkf_state_add_subst_kw(enkf_state , "RESTART_FILE1" , "---" , "The ECLIPSE restart file this simulation starts with."); - enkf_state_add_subst_kw(enkf_state , "RESTART_FILE2" , "---" , "The ECLIPSE restart file this simulation should end with."); - enkf_state_add_subst_kw(enkf_state , "RANDINT" , "---" , "Random integer value (depreceated: use __RANDINT__() instead)."); - enkf_state_add_subst_kw(enkf_state , "RANDFLOAT" , "---" , "Random float value (depreceated: use __RANDFLOAT__() instead)."); - enkf_state_add_subst_kw(enkf_state , "INIT" , "---" , "The code which will be inserted at the tag"); - if (casename != NULL) - enkf_state_add_subst_kw(enkf_state , "CASE" , casename , "The casename for this realization - as loaded from the CASE_TABLE file."); - else - enkf_state_add_subst_kw(enkf_state , "CASE" , "---" , "The casename for this realization - similar to ECLBASE."); - - enkf_state->my_config = member_config_alloc( iens , casename , pre_clear_runpath , keep_runpath , ecl_config , ensemble_config); - enkf_state_set_static_subst_kw( enkf_state ); - enkf_state_add_nodes( enkf_state , ensemble_config ); - - return enkf_state; -} - - - - -bool enkf_state_has_node(const enkf_state_type * enkf_state , const char * node_key) { - bool has_node = hash_has_key(enkf_state->node_hash , node_key); - return has_node; -} - - - -/** - The enkf_state inserts a reference to the node object. The - enkf_state object takes ownership of the node object, i.e. it will - free it when the game is over. - - Observe that if the node already exists the existing node will be - removed (freed and so on ... ) from the enkf_state object before - adding the new; this was previously considered a run-time error. -*/ - - -void enkf_state_add_node(enkf_state_type * enkf_state , const char * node_key , const enkf_config_node_type * config) { - if (enkf_state_has_node(enkf_state , node_key)) - enkf_state_del_node( enkf_state , node_key ); /* Deleting the old instance (if we had one). */ - { - enkf_node_type *enkf_node; - if (enkf_config_node_get_impl_type( config ) == CONTAINER) - enkf_node = enkf_node_alloc_shared_container( config , enkf_state->node_hash ); - else - enkf_node = enkf_node_alloc( config ); - - hash_insert_hash_owned_ref(enkf_state->node_hash , node_key , enkf_node, enkf_node_free__); - - /* Setting the global subst list so that the GEN_KW templates can contain e.g. and . */ - if (enkf_node_get_impl_type( enkf_node ) == GEN_KW) - gen_kw_set_subst_parent( enkf_node_value_ptr( enkf_node ) , enkf_state->subst_list ); - } -} - - -enkf_node_type * enkf_state_get_or_create_node(enkf_state_type * enkf_state, const enkf_config_node_type * config_node) { - const char * key = enkf_config_node_get_key(config_node); - if(!enkf_state_has_node(enkf_state, key)) { - enkf_state_add_node(enkf_state, key, config_node); - } - return enkf_state_get_node(enkf_state, key); -} - - - -void enkf_state_update_node( enkf_state_type * enkf_state , const char * node_key ) { - const enkf_config_node_type * config_node = ensemble_config_get_node( enkf_state->ensemble_config , node_key ); - if (!enkf_state_has_node( enkf_state , node_key)) - enkf_state_add_node( enkf_state , node_key , config_node ); /* Add a new node */ - else { - bool modified = true; /* ehhhh? */ - - if (modified) - enkf_state_add_node( enkf_state , node_key , config_node ); - } -} - - -const char * enkf_state_get_eclbase( const enkf_state_type * enkf_state ) { - return member_config_get_eclbase( enkf_state->my_config ); -} - - - - -static void enkf_state_log_GEN_DATA_load( const enkf_node_type * enkf_node , int report_step , forward_load_context_type * load_context) { - if (forward_load_context_accept_messages(load_context)) { - char * load_file = enkf_config_node_alloc_infile(enkf_node_get_config( enkf_node ) , report_step); - int data_size = gen_data_get_size( enkf_node_value_ptr( enkf_node )); - char * msg = util_alloc_sprintf("Loaded GEN_DATA:%s instance for step:%d from file:%s size:%d" , - enkf_node_get_key( enkf_node ) , - report_step , - load_file , - data_size); - - forward_load_context_add_message(load_context, msg); - - free( msg ); - free( load_file ); - } -} - - -static void enkf_state_log_custom_kw_load(const enkf_node_type * enkf_node, int report_step, forward_load_context_type * load_context) { - if (forward_load_context_accept_messages(load_context)) { - char * load_file = enkf_config_node_alloc_infile(enkf_node_get_config(enkf_node), report_step); - char * msg = util_alloc_sprintf("Loaded CUSTOM_KW: %s instance for step: %d from file: %s", - enkf_node_get_key(enkf_node), - report_step, - load_file); - - forward_load_context_add_message(load_context, msg); - - free(msg); - free(load_file); - } -} - -static bool enkf_state_report_step_compatible(const enkf_state_type * enkf_state, const ecl_sum_type * ecl_sum_simulated) { - bool ret = true; - - const model_config_type * model_config = enkf_state->shared_info->model_config; - const ecl_sum_type * ecl_sum_reference = model_config_get_refcase(model_config); - - if (ecl_sum_reference) //Can be NULL - ret = ecl_sum_report_step_compatible(ecl_sum_reference, ecl_sum_simulated); - - return ret; -} - - -static int_vector_type * __enkf_state_get_time_index(enkf_fs_type * result_fs, const ecl_sum_type * summary) { - time_map_type * time_map = enkf_fs_get_time_map( result_fs ); - time_map_summary_update( time_map , summary ); - return time_map_alloc_index_map( time_map , summary ); -} - - -/* - * Check if there are summary keys in the ensemble config that is not found in Eclipse. If this is the case, AND we - * have observations for this key, we have a problem. Otherwise, just print a message to the log. - */ -static void enkf_state_check_for_missing_eclipse_summary_data(const summary_key_matcher_type * matcher, const ecl_smspec_type * smspec, - const enkf_state_type * enkf_state, forward_load_context_type * load_context, const int iens ) { - - stringlist_type * keys = summary_key_matcher_get_keys(matcher); - - for (int i = 0; i < stringlist_get_size(keys); i++) { - - const char *key = stringlist_iget(keys, i); - - if (ecl_smspec_has_general_var(smspec, key) || !summary_key_matcher_summary_key_is_required(matcher, key)) - continue; - - if (!ensemble_config_has_key(enkf_state->ensemble_config, key)) - continue; - - const enkf_config_node_type *config_node = ensemble_config_get_node(enkf_state->ensemble_config, key); - if (enkf_config_node_get_num_obs(config_node) == 0) { - ert_log_add_fmt_message(3, NULL, "[%03d:----] Unable to find Eclipse data for summary key: %s, but have no observations either, so will continue.", - iens, key); - } else { - ert_log_add_fmt_message(1, NULL, "[%03d:----] Unable to find Eclipse data for summary key: %s, but have observation for this, job will fail.", - iens, key); - forward_load_context_update_result(load_context, LOAD_FAILURE); - if (forward_load_context_accept_messages(load_context)) { - char *msg = util_alloc_sprintf("Failed to load vector: %s", key); - forward_load_context_add_message(load_context, msg); - free(msg); - } - } - } - - stringlist_free(keys); -} - -static bool enkf_state_internalize_dynamic_eclipse_results(enkf_state_type * enkf_state , - forward_load_context_type * load_context , - const model_config_type * model_config) { - - bool load_summary = ensemble_config_has_impl_type(enkf_state->ensemble_config, SUMMARY); - const run_arg_type * run_arg = forward_load_context_get_run_arg( load_context ); - const summary_key_matcher_type * matcher = ensemble_config_get_summary_key_matcher(enkf_state->ensemble_config); - int matcher_size = summary_key_matcher_get_size(matcher); - - if (load_summary || matcher_size > 0) { - int load_start = run_arg_get_load_start( run_arg ); - - if (load_start == 0) { /* Do not attempt to load the "S0000" summary results. */ - load_start++; - } - - { - /* Looking for summary files on disk, and loading them. */ - const ecl_sum_type * summary = forward_load_context_get_ecl_sum( load_context ); - enkf_fs_type * result_fs = run_arg_get_result_fs( run_arg ); - /** OK - now we have actually loaded the ecl_sum instance, or ecl_sum == NULL. */ - if (summary) { - int_vector_type * time_index = __enkf_state_get_time_index(result_fs, summary); - - /* - Now there are two related / conflicting(?) systems for - checking summary time consistency, both internally in the - time_map and also through the - enkf_state_report_step_compatible() function. - */ - - /*Check the loaded summary against the reference ecl_sum_type */ - if (!enkf_state_report_step_compatible(enkf_state, summary)) - forward_load_context_update_result(load_context, REPORT_STEP_INCOMPATIBLE); - - - /* The actual loading internalizing - from ecl_sum -> enkf_node. */ - const int iens = member_config_get_iens( enkf_state->my_config ); - const int step2 = ecl_sum_get_last_report_step( summary ); /* Step2 is just taken from the number of steps found in the summary file. */ - - int_vector_iset_block( time_index , 0 , load_start , -1 ); - int_vector_resize( time_index , step2 + 1); - - const ecl_smspec_type * smspec = ecl_sum_get_smspec(summary); - - for(int i = 0; i < ecl_smspec_num_nodes(smspec); i++) { - const smspec_node_type * smspec_node = ecl_smspec_iget_node(smspec, i); - const char * key = smspec_node_get_gen_key1(smspec_node); - - if(summary_key_matcher_match_summary_key(matcher, key)) { - summary_key_set_type * key_set = enkf_fs_get_summary_key_set(result_fs); - summary_key_set_add_summary_key(key_set, key); - - enkf_config_node_type * config_node = ensemble_config_get_or_create_summary_node(enkf_state->ensemble_config, key); - enkf_node_type * node = enkf_state_get_or_create_node(enkf_state, config_node); - - enkf_node_try_load_vector( node , result_fs , iens ); // Ensure that what is currently on file is loaded before we update. - - enkf_node_forward_load_vector( node , load_context , time_index); - enkf_node_store_vector( node , result_fs , iens ); - } - } - - int_vector_free( time_index ); - - /* - Check if some of the specified keys are missing from the Eclipse data, and if there are observations for them. That is a problem. - */ - enkf_state_check_for_missing_eclipse_summary_data(matcher, smspec, enkf_state, load_context, iens); - - return true; - } else { - fprintf(stderr , "** Warning: could not load ECLIPSE summary data from %s - this will probably fail later ...\n" , run_arg_get_runpath( run_arg )); - return false; - } - } - } else { - return true; - } -} - - - - - - -static void enkf_state_internalize_custom_kw(enkf_state_type * enkf_state, - forward_load_context_type * load_context , - const model_config_type * model_config) { - - member_config_type * my_config = enkf_state->my_config; - const int iens = member_config_get_iens( my_config ); - stringlist_type * custom_kw_keys = ensemble_config_alloc_keylist_from_impl_type(enkf_state->ensemble_config, CUSTOM_KW); - const run_arg_type * run_arg = forward_load_context_get_run_arg( load_context ); - enkf_fs_type * result_fs = run_arg_get_result_fs(run_arg); - const int report_step = 0; - - custom_kw_config_set_type * config_set = enkf_fs_get_custom_kw_config_set(result_fs); - custom_kw_config_set_reset(config_set); - - for (int ikey=0; ikey < stringlist_get_size(custom_kw_keys); ikey++) { - const char* custom_kw_key = stringlist_iget(custom_kw_keys, ikey); - enkf_node_type * node = enkf_state_get_node(enkf_state, custom_kw_key); - - if (enkf_node_vector_storage(node)) { - util_abort("%s: Vector storage not correctly implemented for CUSTOM_KW\n", __func__); - } else { - if (enkf_node_internalize(node, report_step)) { - if (enkf_node_has_func(node, forward_load_func)) { - if (enkf_node_forward_load(node, load_context)) { - node_id_type node_id = {.report_step = report_step, .iens = iens }; - - enkf_node_store(node, result_fs, false, node_id); - - const enkf_config_node_type * config_node = enkf_node_get_config(node); - const custom_kw_config_type * custom_kw_config = (custom_kw_config_type*) enkf_config_node_get_ref(config_node); - custom_kw_config_set_add_config(config_set, custom_kw_config); - enkf_state_log_custom_kw_load(node, report_step, load_context); - } else { - forward_load_context_update_result(load_context, LOAD_FAILURE); - ert_log_add_fmt_message(1, stderr, "[%03d:%04d] Failed load data for CUSTOM_KW node: %s.", iens , report_step, enkf_node_get_key(node)); - - if (forward_load_context_accept_messages(load_context)) { - char * msg = util_alloc_sprintf("Failed to load: %s at step: %d", enkf_node_get_key(node), report_step); - forward_load_context_add_message(load_context , msg); - free( msg ); - } - } - } - } - } - } - - stringlist_free(custom_kw_keys); -} - - - -static void enkf_state_internalize_GEN_DATA(enkf_state_type * enkf_state , - forward_load_context_type * load_context , - const model_config_type * model_config , - int last_report) { - { - member_config_type * my_config = enkf_state->my_config; - const int iens = member_config_get_iens( my_config ); - stringlist_type * keylist_GEN_DATA = ensemble_config_alloc_keylist_from_impl_type(enkf_state->ensemble_config , GEN_DATA ); - const run_arg_type * run_arg = forward_load_context_get_run_arg( load_context ); - enkf_fs_type * result_fs = run_arg_get_result_fs( run_arg ); - - for (int ikey=0; ikey < stringlist_get_size( keylist_GEN_DATA ); ikey++) { - enkf_node_type * node = enkf_state_get_node( enkf_state , stringlist_iget( keylist_GEN_DATA , ikey)); - - for (int report_step = run_arg_get_load_start( run_arg ); report_step <= last_report; report_step++) { - if (enkf_node_internalize(node , report_step)) { - - if (enkf_node_has_func(node , forward_load_func)) { - forward_load_context_select_step(load_context, report_step); - if (enkf_node_forward_load(node , load_context )) { - node_id_type node_id = {.report_step = report_step , - .iens = iens }; - - enkf_node_store( node , result_fs, false , node_id ); - enkf_state_log_GEN_DATA_load( node , report_step , load_context); - } else { - forward_load_context_update_result(load_context, LOAD_FAILURE); - ert_log_add_fmt_message(1 , stderr , "[%03d:%04d] Failed load data for GEN_DATA node:%s.",iens , report_step , enkf_node_get_key( node )); - - if (forward_load_context_accept_messages(load_context)) { - char * msg = util_alloc_sprintf("Failed to load: %s at step:%d" , enkf_node_get_key( node ) , report_step); - forward_load_context_add_message(load_context, msg); - free( msg ); - } - } - } - } - } - } - stringlist_free( keylist_GEN_DATA ); - } -} - - -/** - This function loads the STATE from a forward simulation. In ECLIPSE - speak that means to load the solution vectors (PRESSURE/SWAT/..) - and the necessary static keywords. - - When the state has been loaded it goes straight to disk. -*/ - -static void enkf_state_internalize_eclipse_state(enkf_state_type * enkf_state , - forward_load_context_type * load_context, - const model_config_type * model_config , - int report_step , - bool store_vectors) { - - shared_info_type * shared_info = enkf_state->shared_info; - const ecl_config_type * ecl_config = shared_info->ecl_config; - const run_arg_type * run_arg = forward_load_context_get_run_arg( load_context ); - enkf_fs_type * result_fs = run_arg_get_result_fs( run_arg ); - if (ecl_config_active( ecl_config ) && model_config_internalize_state( model_config , report_step )) { - member_config_type * my_config = enkf_state->my_config; - const int iens = member_config_get_iens( my_config ); - const bool internalize_state = model_config_internalize_state( model_config , report_step ); - - forward_load_context_load_restart_file( load_context , report_step); - - /******************************************************************/ - /** - Starting on the enkf_node_forward_load() function calls. This - is where the actual loading is done. Observe that this loading - might involve other load functions than the ones used for - loading PRESSURE++ from ECLIPSE restart files (e.g. for - loading seismic results..) - */ - - { - hash_iter_type * iter = hash_iter_alloc(enkf_state->node_hash); - while ( !hash_iter_is_complete(iter) ) { - enkf_node_type * enkf_node = hash_iter_get_next_value(iter); - if (enkf_node_get_var_type(enkf_node) == DYNAMIC_STATE && - enkf_node_get_impl_type(enkf_node) == FIELD) { - - bool internalize_kw = internalize_state; - if (!internalize_kw) - internalize_kw = enkf_node_internalize(enkf_node , report_step); - - if (internalize_kw) { - if (enkf_node_has_func(enkf_node , forward_load_func)) { - if (enkf_node_forward_load(enkf_node , load_context)) { - node_id_type node_id = {.report_step = report_step , - .iens = iens }; - - enkf_node_store( enkf_node , result_fs, store_vectors , node_id ); - } else { - forward_load_context_update_result(load_context, LOAD_FAILURE); - ert_log_add_fmt_message( 1 , NULL , "[%03d:%04d] Failed load data for FIELD node:%s.",iens , report_step , enkf_node_get_key( enkf_node )); - - if (forward_load_context_accept_messages(load_context)) { - char * msg = util_alloc_sprintf("Failed to load: %s at step:%d" , enkf_node_get_key( enkf_node ) , report_step); - forward_load_context_add_message(load_context, msg); - free( msg ); - } - } - } - } - } - } - hash_iter_free(iter); - } - } -} - - - -static forward_load_context_type * enkf_state_alloc_load_context( const enkf_state_type * state , run_arg_type * run_arg, stringlist_type * messages) { - bool load_summary = ensemble_config_has_impl_type(state->ensemble_config, SUMMARY); - if (!load_summary) { - const summary_key_matcher_type * matcher = ensemble_config_get_summary_key_matcher(state->ensemble_config); - load_summary = (summary_key_matcher_get_size(matcher) > 0); - } - - { - forward_load_context_type * load_context; - const ecl_config_type * ecl_config = state->shared_info->ecl_config; - const char * eclbase = enkf_state_get_eclbase( state ); - - load_context = forward_load_context_alloc( run_arg, - load_summary, - ecl_config , - eclbase, - messages ); - return load_context; - } -} - - -/** - This function loads the results from a forward simulations from report_step1 - to report_step2. The details of what to load are in model_config and the - spesific nodes for special cases. - - Will mainly be called at the end of the forward model, but can also - be called manually from external scope. -*/ - - -static int enkf_state_internalize_results(enkf_state_type * enkf_state , run_arg_type * run_arg , stringlist_type * msg_list) { - model_config_type * model_config = enkf_state->shared_info->model_config; - forward_load_context_type * load_context = enkf_state_alloc_load_context( enkf_state , run_arg , msg_list); - int report_step; - - /* - The timing information - i.e. mainly what is the last report step - in these results are inferred from the loading of summary results, - hence we must load the summary results first. - */ - - enkf_state_internalize_dynamic_eclipse_results(enkf_state , - load_context , - model_config); - { - enkf_fs_type * result_fs = run_arg_get_result_fs( run_arg ); - int last_report = time_map_get_last_step( enkf_fs_get_time_map( result_fs )); - if (last_report < 0) - last_report = model_config_get_last_history_restart( enkf_state->shared_info->model_config); - - /* Ensure that the last step is internalized? */ - model_config_set_internalize_state( model_config , last_report); - - for (report_step = run_arg_get_load_start( run_arg ); report_step <= last_report; report_step++) { - bool store_vectors = (report_step == last_report) ? true : false; - if (model_config_load_state( model_config , report_step)) - enkf_state_internalize_eclipse_state(enkf_state , - load_context , - model_config , - report_step , - store_vectors); - } - - enkf_state_internalize_GEN_DATA(enkf_state , load_context , model_config , last_report); - enkf_state_internalize_custom_kw(enkf_state, load_context , model_config); - } - - - int result = forward_load_context_get_result(load_context); - forward_load_context_free( load_context ); - return result; -} - - -int enkf_state_forward_init(enkf_state_type * enkf_state , - run_arg_type * run_arg) { - - int result = 0; - if (run_arg_get_step1(run_arg) == 0) { - int iens = enkf_state_get_iens( enkf_state ); - hash_iter_type * iter = hash_iter_alloc( enkf_state->node_hash ); - while ( !hash_iter_is_complete(iter) ) { - enkf_node_type * node = hash_iter_get_next_value(iter); - if (enkf_node_use_forward_init(node)) { - enkf_fs_type * result_fs = run_arg_get_result_fs( run_arg ); - node_id_type node_id = {.report_step = 0 , - .iens = iens }; - - - /* - Will not reinitialize; i.e. it is essential that the - forward model uses the state given from the stored - instance, and not from the current run of e.g. RMS. - */ - - if (!enkf_node_has_data( node , result_fs , node_id)) { - if (enkf_node_forward_init(node , run_arg_get_runpath( run_arg ) , iens )) - enkf_node_store( node , result_fs , false , node_id ); - else { - char * init_file = enkf_config_node_alloc_initfile( enkf_node_get_config( node ) , run_arg_get_runpath(run_arg) , iens ); - - if (init_file && !util_file_exists( init_file )) - fprintf(stderr,"File not found: %s - failed to initialize node: %s\n", init_file , enkf_node_get_key( node )); - else - fprintf(stderr,"Failed to initialize node: %s\n", enkf_node_get_key( node )); - - util_safe_free( init_file ); - result |= LOAD_FAILURE; - } - } - - } - } - hash_iter_free( iter ); - } - return result; -} - - - -int enkf_state_load_from_forward_model(enkf_state_type * enkf_state , - run_arg_type * run_arg , - stringlist_type * msg_list) { - - int result = 0; - - if (ensemble_config_have_forward_init( enkf_state->ensemble_config )) - result |= enkf_state_forward_init( enkf_state , run_arg ); - - result |= enkf_state_internalize_results( enkf_state , run_arg , msg_list ); - { - state_map_type * state_map = enkf_fs_get_state_map( run_arg_get_result_fs( run_arg ) ); - int iens = member_config_get_iens( enkf_state->my_config ); - if (result & LOAD_FAILURE) - state_map_iset( state_map , iens , STATE_LOAD_FAILURE); - else - state_map_iset( state_map , iens , STATE_HAS_DATA); - } - - return result; -} - - -/** - Observe that this does not return the loadOK flag; it will load as - good as it can all the data it should, and be done with it. -*/ - -void * enkf_state_load_from_forward_model_mt( void * arg ) { - arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); - enkf_state_type * enkf_state = enkf_state_safe_cast(arg_pack_iget_ptr( arg_pack , 0 )); - run_arg_type * run_arg = arg_pack_iget_ptr( arg_pack , 1 ); - stringlist_type * msg_list = arg_pack_iget_ptr( arg_pack , 2 ); - bool manual_load = arg_pack_iget_bool( arg_pack , 3 ); - int * result = arg_pack_iget_ptr( arg_pack , 4 ); - int iens = run_arg_get_iens( run_arg ); - - if (manual_load) - state_map_update_undefined(enkf_fs_get_state_map( run_arg_get_result_fs(run_arg) ) , iens , STATE_INITIALIZED); - - *result = enkf_state_load_from_forward_model( enkf_state , run_arg , msg_list ); - if (*result & REPORT_STEP_INCOMPATIBLE) { - // If refcase has been used for observations: crash and burn. - fprintf(stderr,"** Warning the timesteps in refcase and current simulation are not in accordance - something wrong with schedule file?\n"); - *result -= REPORT_STEP_INCOMPATIBLE; - } - - if (manual_load) { - printf("."); - fflush(stdout); - } - return NULL; -} - - - - - - - -/** - This function writes out all the files needed by an ECLIPSE simulation, this - includes the restart file, and the various INCLUDE files corresponding to - parameteres estimated by EnKF. - - The writing of restart file is delegated to enkf_state_write_restart_file(). -*/ - -void enkf_state_ecl_write(enkf_state_type * enkf_state, const run_arg_type * run_arg , enkf_fs_type * fs) { - { - /** - This iteration manipulates the hash (thorugh the enkf_state_del_node() call) - - ----------------------------------------------------------------------------------------- - T H I S W I L L D E A D L O C K I F T H E H A S H _ I T E R A P I I S U S E D. - ----------------------------------------------------------------------------------------- - */ - - const shared_info_type * shared_info = enkf_state->shared_info; - const model_config_type * model_config = shared_info->model_config; - int iens = enkf_state_get_iens( enkf_state ); - const char * base_name = model_config_get_gen_kw_export_file(model_config); - char * export_file_name = util_alloc_filename( run_arg_get_runpath( run_arg ) , base_name , NULL); - FILE * export_file = util_mkdir_fopen(export_file_name, "w"); - - - const int num_keys = hash_get_size(enkf_state->node_hash); - char ** key_list = hash_alloc_keylist(enkf_state->node_hash); - int ikey; - - for (ikey = 0; ikey < num_keys; ikey++) { - if (true) { - enkf_node_type * enkf_node = hash_get(enkf_state->node_hash , key_list[ikey]); - bool forward_init = enkf_node_use_forward_init( enkf_node ); - - if ((run_arg_get_step1(run_arg) == 0) && (forward_init)) { - node_id_type node_id = {.report_step = 0, - .iens = iens }; - - if (enkf_node_has_data( enkf_node , fs , node_id)) - enkf_node_ecl_write(enkf_node , run_arg_get_runpath( run_arg ) , export_file , run_arg_get_step1(run_arg)); - } else - enkf_node_ecl_write(enkf_node , run_arg_get_runpath( run_arg ) , export_file , run_arg_get_step1(run_arg)); - } - } - util_free_stringlist(key_list , num_keys); - - fclose(export_file); - free(export_file_name); - } -} - - -/** - This function takes a report_step and a analyzed|forecast state as - input; the enkf_state instance is set accordingly and written to - disk. -*/ - - -void enkf_state_fwrite(const enkf_state_type * enkf_state , enkf_fs_type * fs , int mask , int report_step ) { - const member_config_type * my_config = enkf_state->my_config; - const int num_keys = hash_get_size(enkf_state->node_hash); - char ** key_list = hash_alloc_keylist(enkf_state->node_hash); - int ikey; - - for (ikey = 0; ikey < num_keys; ikey++) { - enkf_node_type * enkf_node = hash_get(enkf_state->node_hash , key_list[ikey]); - if (enkf_node_include_type(enkf_node , mask)) { - node_id_type node_id = {.report_step = report_step , .iens = member_config_get_iens( my_config ) }; - enkf_node_store( enkf_node, fs , true , node_id ); - } - } - util_free_stringlist(key_list , num_keys); -} - - -void enkf_state_fread(enkf_state_type * enkf_state , enkf_fs_type * fs , int mask , int report_step ) { - const member_config_type * my_config = enkf_state->my_config; - const int num_keys = hash_get_size(enkf_state->node_hash); - char ** key_list = hash_alloc_keylist(enkf_state->node_hash); - int ikey; - - for (ikey = 0; ikey < num_keys; ikey++) { - enkf_node_type * enkf_node = hash_get(enkf_state->node_hash , key_list[ikey]); - if (enkf_node_include_type(enkf_node , mask)) { - node_id_type node_id = {.report_step = report_step , - .iens = member_config_get_iens( my_config )}; - bool forward_init = enkf_node_use_forward_init( enkf_node ); - if (forward_init) - enkf_node_try_load(enkf_node , fs , node_id ); - else - enkf_node_load(enkf_node , fs , node_id); - } - } - util_free_stringlist(key_list , num_keys); -} - - -/** - This function will load all the nodes listed in the current - restart_kw_list; in addition to all other variable of type - DYNAMIC_STATE. Observe that for DYNAMIC state nodes it will try - firt analyzed state and then forecast state. -*/ - - -static void enkf_state_fread_state_nodes(enkf_state_type * enkf_state , enkf_fs_type * fs , int report_step ) { - const member_config_type * my_config = enkf_state->my_config; - const int iens = member_config_get_iens( my_config ); - - /* - First pass - load all the STATIC nodes. It is essential to use - the restart_kw_list when loading static nodes, otherwise static - nodes which were only present at e.g. step == 0 will create - problems: (They are in the enkf_state hash table because they - were seen at step == 0, but have not been seen subesquently and - the loading fails.) - */ - - /* Second pass - DYNAMIC state nodes. */ - { - const int num_keys = hash_get_size(enkf_state->node_hash); - char ** key_list = hash_alloc_keylist(enkf_state->node_hash); - int ikey; - - for (ikey = 0; ikey < num_keys; ikey++) { - enkf_node_type * enkf_node = hash_get(enkf_state->node_hash , key_list[ikey]); - enkf_var_type var_type = enkf_node_get_var_type( enkf_node ); - node_id_type node_id = {.report_step = report_step , - .iens = iens }; - - if (var_type == DYNAMIC_STATE) { - /* - Here the enkf_node_try_load() function is used NOT because we accept - that the node is not present, but because the try_fread() - function accepts the BOTH state type. - */ - if (!enkf_node_try_load(enkf_node , fs , node_id)) - util_abort("%s: failed to load node:%s report_step:%d iens:%d \n",__func__ , key_list[ikey] , report_step , iens ); - } - } - util_free_stringlist(key_list , num_keys); - } -} - - - -/** - This is a special function which is only used to load the initial - state of dynamic_state nodes. It checks if the enkf_config_node has - set a valid value for input_file, in that case that means we should - also have an internalized representation of it, otherwise it will - just return (i.e. for PRESSURE / SWAT). -*/ - -static void enkf_state_fread_initial_state(enkf_state_type * enkf_state , enkf_fs_type * fs) { - const member_config_type * my_config = enkf_state->my_config; - const int num_keys = hash_get_size(enkf_state->node_hash); - char ** key_list = hash_alloc_keylist(enkf_state->node_hash); - int ikey; - - for (ikey = 0; ikey < num_keys; ikey++) { - enkf_node_type * enkf_node = hash_get(enkf_state->node_hash , key_list[ikey]); - if (enkf_node_get_var_type(enkf_node) == DYNAMIC_STATE) { - const enkf_config_node_type * config_node = enkf_node_get_config( enkf_node ); - - /* Just checked for != NULL */ - char * load_file = enkf_config_node_alloc_infile( config_node , 0); - if (load_file != NULL) { - node_id_type node_id = {.report_step = 0 , - .iens = member_config_get_iens( my_config ) }; - enkf_node_load(enkf_node , fs , node_id); - } - - util_safe_free( load_file ); - } - } - util_free_stringlist(key_list , num_keys); -} - - -void enkf_state_free_nodes(enkf_state_type * enkf_state, int mask) { - const int num_keys = hash_get_size(enkf_state->node_hash); - char ** key_list = hash_alloc_keylist(enkf_state->node_hash); - int ikey; - - for (ikey = 0; ikey < num_keys; ikey++) { - enkf_node_type * enkf_node = hash_get(enkf_state->node_hash , key_list[ikey]); - if (enkf_node_include_type(enkf_node , mask)) - enkf_state_del_node(enkf_state , enkf_node_get_key(enkf_node)); - } - util_free_stringlist(key_list , num_keys); -} - - - - - - -void enkf_state_free(enkf_state_type *enkf_state) { - rng_free( enkf_state->rng ); - hash_free(enkf_state->node_hash); - subst_list_free(enkf_state->subst_list); - member_config_free(enkf_state->my_config); - shared_info_free(enkf_state->shared_info); - free(enkf_state); -} - - - -enkf_node_type * enkf_state_get_node(const enkf_state_type * enkf_state , const char * node_key) { - if (hash_has_key(enkf_state->node_hash , node_key)) { - enkf_node_type * enkf_node = hash_get(enkf_state->node_hash , node_key); - return enkf_node; - } else { - util_abort("%s: node:[%s] not found in state object - aborting.\n",__func__ , node_key); - return NULL; /* Compiler shut up */ - } -} - - - -void enkf_state_del_node(enkf_state_type * enkf_state , const char * node_key) { - if (hash_has_key(enkf_state->node_hash , node_key)) - hash_del(enkf_state->node_hash , node_key); - else - fprintf(stderr,"%s: tried to remove node:%s which is not in state - internal error?? \n",__func__ , node_key); -} - - -/** - This function will set all the subst_kw key=value pairs which - change with report step. -*/ - -static void enkf_state_set_dynamic_subst_kw__(enkf_state_type * enkf_state , const char * run_path , int step1 , int step2) { - const ecl_config_type * ecl_config = enkf_state->shared_info->ecl_config; - const bool fmt_file = ecl_config_get_formatted( ecl_config ); - - - if (run_path != NULL) { - /** Make absolutely sure the path available as is absolute. */ - char * abs_runpath = util_alloc_realpath( run_path ); - enkf_state_add_subst_kw(enkf_state , "RUNPATH" , abs_runpath , NULL); - free( abs_runpath ); - } - - - /* Time step */ - { - char * step1_s = util_alloc_sprintf("%d" , step1); - char * step2_s = util_alloc_sprintf("%d" , step2); - char * step1_s04 = util_alloc_sprintf("%04d" , step1); - char * step2_s04 = util_alloc_sprintf("%04d" , step2); - - enkf_state_add_subst_kw(enkf_state , "TSTEP1" , step1_s , NULL); - enkf_state_add_subst_kw(enkf_state , "TSTEP2" , step2_s , NULL); - enkf_state_add_subst_kw(enkf_state , "TSTEP1_04" , step1_s04 , NULL); - enkf_state_add_subst_kw(enkf_state , "TSTEP2_04" , step2_s04 , NULL); - - free(step1_s); - free(step2_s); - free(step1_s04); - free(step2_s04); - } - - - /* Restart file names and RESTART keyword in datafile. */ - { - const char * eclbase = member_config_get_eclbase( enkf_state->my_config ); - if (eclbase != NULL) { - { - char * restart_file1 = ecl_util_alloc_filename(NULL , eclbase , ECL_RESTART_FILE , fmt_file , step1); - char * restart_file2 = ecl_util_alloc_filename(NULL , eclbase , ECL_RESTART_FILE , fmt_file , step2); - - enkf_state_add_subst_kw(enkf_state , "RESTART_FILE1" , restart_file1 , NULL); - enkf_state_add_subst_kw(enkf_state , "RESTART_FILE2" , restart_file2 , NULL); - - free(restart_file1); - free(restart_file2); - } - - if (step1 > 0) { - char * data_initialize = util_alloc_sprintf("RESTART\n \'%s\' %d /\n" , eclbase , step1); - enkf_state_add_subst_kw(enkf_state , "INIT" , data_initialize , NULL); - free(data_initialize); - } - } - } - - /** - The magic string: - */ - if (step1 == 0) { - const char * init_file = ecl_config_get_equil_init_file(ecl_config); - if (init_file != NULL) { - char * tmp_include = util_alloc_sprintf("INCLUDE\n \'%s\' /\n",init_file); - enkf_state_add_subst_kw(enkf_state , "INIT" , tmp_include , NULL); - free(tmp_include); - } /* - if init_file == NULL that means the user has not supplied the INIT_SECTION keyword, - and the EQUIL (or whatever) info to initialize the model is inlined in the datafile. - */ - } - - - { - /** - Adding keys for and - these are only - added for backwards compatibility, should be replaced with - prober function callbacks. - */ - char * randint_value = util_alloc_sprintf( "%u" , rng_forward( enkf_state->rng )); - char * randfloat_value = util_alloc_sprintf( "%12.10f" , rng_get_double( enkf_state->rng )); - - enkf_state_add_subst_kw( enkf_state , "RANDINT" , randint_value , NULL); - enkf_state_add_subst_kw( enkf_state , "RANDFLOAT" , randfloat_value , NULL); - - free( randint_value ); - free( randfloat_value ); - } -} - -static void enkf_state_set_dynamic_subst_kw(enkf_state_type * enkf_state , const run_arg_type * run_arg ) { - enkf_state_set_dynamic_subst_kw__( enkf_state , run_arg_get_runpath( run_arg ) , run_arg_get_step1( run_arg ) , run_arg_get_step2( run_arg )); -} - - - -void enkf_state_printf_subst_list(enkf_state_type * enkf_state , int step1 , int step2) { - int ikw; - const char * fmt_string = "%-16s %-40s :: %s\n"; - printf("\n\n"); - printf(fmt_string , "Key" , "Current value" , "Description"); - printf("------------------------------------------------------------------------------------------------------------------------\n"); - if (step1 >= 0) - enkf_state_set_dynamic_subst_kw__(enkf_state , NULL , step1 , step2 ); - - for (ikw = 0; ikw < subst_list_get_size( enkf_state->subst_list ); ikw++) { - const char * key = subst_list_iget_key( enkf_state->subst_list , ikw); - const char * value = subst_list_iget_value( enkf_state->subst_list , ikw); - const char * desc = subst_list_iget_doc_string( enkf_state->subst_list , ikw ); - - if (value != NULL) - printf(fmt_string , key , value , desc); - else - printf(fmt_string , key , "[Not set]" , desc); - } - printf("------------------------------------------------------------------------------------------------------------------------\n"); - -} - - - - -/** - init_step : The parameters are loaded from this EnKF/report step. - report_step1 : The simulation should start from this report step; - dynamic data are loaded from this step. - report_step2 : The simulation should stop at this report step. (unless run_mode == ENSEMBLE_PREDICTION - where it just runs til end.) - - For a normal EnKF run we well have init_step == report_step1, but - in the case where we want rerun from the beginning with updated - parameters, they will be different. If init_step != report_step1, - it is required that report_step1 == 0; otherwise the dynamic data - will become completely inconsistent. We just don't allow that! -*/ - - -void enkf_state_init_eclipse(enkf_state_type *enkf_state, const run_arg_type * run_arg ) { - const member_config_type * my_config = enkf_state->my_config; - const ecl_config_type * ecl_config = enkf_state->shared_info->ecl_config; - { - if (member_config_pre_clear_runpath( my_config )) - util_clear_directory( run_arg_get_runpath( run_arg ) , true , false ); - - util_make_path(run_arg_get_runpath( run_arg )); - { - if (ecl_config_get_schedule_target( ecl_config ) != NULL) { - - char * schedule_file_target = util_alloc_filename(run_arg_get_runpath( run_arg ) , ecl_config_get_schedule_target( ecl_config ) , NULL); - char * schedule_file_target_path = util_split_alloc_dirname(schedule_file_target); - util_make_path(schedule_file_target_path); - free(schedule_file_target_path); - - sched_file_fprintf( ecl_config_get_sched_file( ecl_config ) , schedule_file_target); - - free(schedule_file_target); - } - } - - - /** - For reruns of various kinds the parameters and the state are - generally loaded from different timesteps: - */ - { - enkf_fs_type * init_fs = run_arg_get_init_fs( run_arg ); - /* Loading parameter information: loaded from timestep: run_arg->init_step_parameters. */ - enkf_state_fread(enkf_state , init_fs , PARAMETER , 0); - - - /* Loading state information: loaded from timestep: run_arg->step1 */ - if (run_arg_get_step1(run_arg) == 0) - enkf_state_fread_initial_state(enkf_state , init_fs); - else - enkf_state_fread_state_nodes( enkf_state , init_fs , run_arg_get_step1(run_arg)); - - enkf_state_set_dynamic_subst_kw( enkf_state , run_arg ); - ert_templates_instansiate( enkf_state->shared_info->templates , run_arg_get_runpath( run_arg ) , enkf_state->subst_list ); - enkf_state_ecl_write( enkf_state , run_arg , init_fs); - - if (member_config_get_eclbase( my_config ) != NULL) { - - /* Writing the ECLIPSE data file. */ - if (ecl_config_get_data_file( ecl_config ) != NULL) { - char * data_file = ecl_util_alloc_filename(run_arg_get_runpath( run_arg ) , member_config_get_eclbase( my_config ) , ECL_DATA_FILE , true , -1); - subst_list_filter_file(enkf_state->subst_list , ecl_config_get_data_file(ecl_config) , data_file); - free( data_file ); - } - } - } - member_config_get_jobname( my_config ); - mode_t umask = site_config_get_umask(enkf_state->shared_info->site_config); - - - /* This is where the job script is created */ - forward_model_python_fprintf( model_config_get_forward_model( enkf_state->shared_info->model_config ) , - run_arg_get_runpath( run_arg ) , - enkf_state->subst_list, - umask); - } -} - - - - - - - -bool enkf_state_complete_forward_modelOK__(void * arg ); -bool enkf_state_complete_forward_modelEXIT__(void * arg ); -bool enkf_state_complete_forward_modelRETRY__(void * arg ); - - -/** - This function is called when: - - 1. The external queue system has said that everything is OK; BUT - the ert layer failed to load all the data. - - 2. The external queue system has seen the job fail. - - The parameter and state variables will be resampled before - retrying. And all random elements in templates+++ will be - resampled. -*/ - - - -static void enkf_state_internal_retry(enkf_state_type * enkf_state , run_arg_type * run_arg , bool load_failure) { - const member_config_type * my_config = enkf_state->my_config; - const shared_info_type * shared_info = enkf_state->shared_info; - const int iens = member_config_get_iens( my_config ); - - if (load_failure) - ert_log_add_fmt_message( 1 , NULL , "[%03d:%04d - %04d] Failed to load all data.",iens , run_arg_get_step1(run_arg) , run_arg_get_step2(run_arg)); - else - ert_log_add_fmt_message( 1 , NULL , "[%03d:%04d - %04d] Forward model failed.",iens, run_arg_get_step1(run_arg) , run_arg_get_step2(run_arg)); - - if (run_arg_can_retry( run_arg ) ) { - ert_log_add_fmt_message( 1 , NULL , "[%03d] Resampling and resubmitting realization." ,iens); - { - /* Reinitialization of the nodes */ - stringlist_type * init_keys = ensemble_config_alloc_keylist_from_var_type( enkf_state->ensemble_config , DYNAMIC_STATE + PARAMETER ); - for (int ikey=0; ikey < stringlist_get_size( init_keys ); ikey++) { - enkf_node_type * node = enkf_state_get_node( enkf_state , stringlist_iget( init_keys , ikey) ); - enkf_node_initialize( node , iens , enkf_state->rng ); - } - stringlist_free( init_keys ); - } - - enkf_state_init_eclipse( enkf_state , run_arg ); /* Possibly clear the directory and do a FULL rewrite of ALL the necessary files. */ - job_queue_iset_external_restart( shared_info->job_queue , run_arg_get_queue_index(run_arg) ); /* Here we inform the queue system that it should pick up this job and try again. */ - run_arg_increase_submit_count( run_arg ); - } -} - - - - - - - - - - - -static void enkf_state_clear_runpath( const enkf_state_type * enkf_state , run_arg_type * run_arg) { - const member_config_type * my_config = enkf_state->my_config; - keep_runpath_type keep_runpath = member_config_get_keep_runpath( my_config ); - - bool unlink_runpath; - if (keep_runpath == DEFAULT_KEEP) - unlink_runpath = false; /* For experiments the default is to keep the directories around. */ - else { - /* We have explcitly set a value for the keep_runpath variable - with either KEEP_RUNAPTH or DELETE_RUNPATH. */ - if (keep_runpath == EXPLICIT_KEEP) - unlink_runpath = false; - else if (keep_runpath == EXPLICIT_DELETE) - unlink_runpath = true; - else { - util_abort("%s: internal error \n",__func__); - unlink_runpath = false; /* Compiler .. */ - } - } - - if (unlink_runpath) - util_clear_directory(run_arg_get_runpath( run_arg ) , true , true); -} - - -/** - Observe that if run_arg == false, this routine will return with - job_completeOK == true, that might be a bit misleading. - - Observe that if an internal retry is performed, this function will - be called several times - MUST BE REENTRANT. -*/ - -static bool enkf_state_complete_forward_modelOK(enkf_state_type * enkf_state , run_arg_type * run_arg) { - const member_config_type * my_config = enkf_state->my_config; - const int iens = member_config_get_iens( my_config ); - int result; - - - /** - The queue system has reported that the run is OK, i.e. it has - completed and produced the targetfile it should. We then check - in this scope whether the results can be loaded back; if that - is OK the final status is updated, otherwise: restart. - */ - ert_log_add_fmt_message( 2 , NULL , "[%03d:%04d-%04d] Forward model complete - starting to load results." , iens , run_arg_get_step1(run_arg), run_arg_get_step2(run_arg)); - result = enkf_state_load_from_forward_model(enkf_state , run_arg , NULL); - - if (result & REPORT_STEP_INCOMPATIBLE) { - // If refcase has been used for observations: crash and burn. - fprintf(stderr,"** Warning the timesteps in refcase and current simulation are not in accordance - something wrong with schedule file?\n"); - result -= REPORT_STEP_INCOMPATIBLE; - } - - - if (result == 0) { - /* - The loading succeded - so this is a howling success! We set - the main status to JOB_QUEUE_ALL_OK and inform the queue layer - about the success. In addition we set the simple status - (should be avoided) to JOB_RUN_OK. - */ - run_arg_set_run_status( run_arg , JOB_RUN_OK); - ert_log_add_fmt_message( 2 , NULL , "[%03d:%04d-%04d] Results loaded successfully." , iens , run_arg_get_step1(run_arg), run_arg_get_step2(run_arg)); - - enkf_state_clear_runpath( enkf_state , run_arg ); - run_arg_complete_run(run_arg); /* free() on runpath */ - } - - return (result == 0) ? true : false; -} - - -bool enkf_state_complete_forward_modelOK__(void * arg ) { - arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); - enkf_state_type * enkf_state = enkf_state_safe_cast( arg_pack_iget_ptr( arg_pack , 0 )); - run_arg_type * run_arg = run_arg_safe_cast( arg_pack_iget_ptr( arg_pack , 1 )); - - return enkf_state_complete_forward_modelOK( enkf_state , run_arg); -} - - - -static bool enkf_state_complete_forward_model_EXIT_handler__(enkf_state_type * enkf_state , run_arg_type * run_arg , bool is_retry) { - const member_config_type * my_config = enkf_state->my_config; - const int iens = member_config_get_iens( my_config ); - /* - The external queue system has said that the job failed - we - might give it another try from this scope, possibly involving a - resampling. - */ - - if (is_retry) { - if (run_arg_can_retry(run_arg)) { - enkf_state_internal_retry(enkf_state, run_arg , false); - return true; - } else { - return false; - } - } else { - ert_log_add_fmt_message( 1, NULL, "[%03d:%04d-%04d] FAILED COMPLETELY.", iens, run_arg_get_step1(run_arg), run_arg_get_step2(run_arg)); - - if (run_arg_get_run_status(run_arg) != JOB_LOAD_FAILURE) - run_arg_set_run_status( run_arg , JOB_RUN_FAILURE); - - state_map_type * state_map = enkf_fs_get_state_map(run_arg_get_result_fs( run_arg )); - int iens = member_config_get_iens(enkf_state->my_config); - state_map_iset(state_map, iens, STATE_LOAD_FAILURE); - return false; - } -} - -static bool enkf_state_complete_forward_model_EXIT_handler(void * arg, bool allow_retry ) { - arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); - - enkf_state_type * enkf_state = enkf_state_safe_cast( arg_pack_iget_ptr( arg_pack , 0 ) ); - run_arg_type * run_arg = run_arg_safe_cast( arg_pack_iget_ptr( arg_pack , 1 ) ); - - return enkf_state_complete_forward_model_EXIT_handler__( enkf_state , run_arg , allow_retry ); -} - - -bool enkf_state_complete_forward_modelEXIT__(void * arg ) { - return enkf_state_complete_forward_model_EXIT_handler(arg, false ); -} - -bool enkf_state_complete_forward_modelRETRY__(void * arg ) { - return enkf_state_complete_forward_model_EXIT_handler(arg, true ); -} - - - -/*****************************************************************/ - - -rng_type * enkf_state_get_rng( const enkf_state_type * enkf_state ) { - return enkf_state->rng; -} - -unsigned int enkf_state_get_random( enkf_state_type * enkf_state ) { - return rng_forward( enkf_state->rng ); -} - - - -void enkf_state_set_keep_runpath( enkf_state_type * enkf_state , keep_runpath_type keep_runpath) { - member_config_set_keep_runpath( enkf_state->my_config , keep_runpath); -} - - -keep_runpath_type enkf_state_get_keep_runpath( const enkf_state_type * enkf_state ) { - return member_config_get_keep_runpath( enkf_state->my_config ); -} - - -const ensemble_config_type * enkf_state_get_ensemble_config( const enkf_state_type * enkf_state ) { - return enkf_state->ensemble_config; -} diff --git a/ThirdParty/Ert/libenkf/src/enkf_types.c b/ThirdParty/Ert/libenkf/src/enkf_types.c deleted file mode 100644 index d010cbfc96..0000000000 --- a/ThirdParty/Ert/libenkf/src/enkf_types.c +++ /dev/null @@ -1,144 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_types.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include - -#include - - -/*****************************************************************/ - - -const char * enkf_types_get_var_name(enkf_var_type var_type) { - switch(var_type) { - case(INVALID): - return "INVALID"; - break; - case PARAMETER: - return "PARAMETER"; - break; - case DYNAMIC_STATE: - return "DYNAMIC_STATE"; - break; - case DYNAMIC_RESULT: - return "DYNAMIC_RESULT"; - break; - default: - util_abort("%s: internal error - unrecognized var type: %d - aborting \n",__func__ , var_type); - return NULL; - } -} - - - -const char * enkf_types_get_impl_name(ert_impl_type impl_type) { - switch(impl_type) { - case(INVALID): - return "INVALID"; - break; - case FIELD: - return "FIELD"; - break; - case GEN_KW: - return "GEN_KW"; - break; - case SUMMARY: - return "SUMMARY"; - break; - case GEN_DATA: - return "GEN_DATA"; - break; - default: - util_abort("%s: internal error - unrecognized implementation type: %d - aborting \n",__func__ , impl_type); - return NULL; - } -} - - - -#define if_strcmp(s) if (strcmp(impl_type_string , #s) == 0) impl_type = s -static ert_impl_type enkf_types_get_impl_type__(const char * impl_type_string) { - ert_impl_type impl_type; - if_strcmp(SUMMARY); - else if_strcmp(FIELD); - else if_strcmp(GEN_KW); - else if_strcmp(GEN_DATA); - else impl_type = INVALID; - return impl_type; -} -#undef if_strcmp - - -ert_impl_type enkf_types_get_impl_type(const char * __impl_type_string) { - char * impl_type_string = util_alloc_string_copy(__impl_type_string); - util_strupr(impl_type_string); - ert_impl_type impl_type = enkf_types_get_impl_type__(impl_type_string); - if (impl_type == INVALID) - util_abort("%s: enkf_type: %s not recognized - aborting \n",__func__ , __impl_type_string); - - free(impl_type_string); - return impl_type; -} - - -/* - This will return INVALIID if given an invalid - input string - not fail. -*/ - -ert_impl_type enkf_types_check_impl_type(const char * impl_type_string) { - return enkf_types_get_impl_type__(impl_type_string); -} - - -/*****************************************************************/ -/* - These two functions update the truncation variable to ensure that - it applies truncate_min and truncate_max respectively. The somewhat - involved implementation is to ensure that the functions can be - called many times. -*/ - - -void enkf_types_set_truncate_min(truncation_type * __trunc) { - truncation_type trunc = *__trunc; - - if (!(trunc & TRUNCATE_MIN)) - trunc += TRUNCATE_MIN; - - *__trunc = trunc; -} - - -void enkf_types_set_truncate_max(truncation_type * __trunc) { - truncation_type trunc = *__trunc; - - if (!(trunc & TRUNCATE_MAX)) - trunc += TRUNCATE_MAX; - - *__trunc = trunc; -} - - - - - diff --git a/ThirdParty/Ert/libenkf/src/enkf_util.c b/ThirdParty/Ert/libenkf/src/enkf_util.c deleted file mode 100644 index bcd43dd87d..0000000000 --- a/ThirdParty/Ert/libenkf/src/enkf_util.c +++ /dev/null @@ -1,369 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'enkf_util.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include -#include - - - - -double enkf_util_rand_normal(double mean , double std , rng_type * rng) { - const double pi = 3.141592653589; - double R1 = rng_get_double( rng ); - double R2 = rng_get_double( rng ); - - return mean + std * sqrt(-2.0 * log(R1)) * cos(2.0 * pi * R2); -} - -void enkf_util_rand_stdnormal_vector(int size , double *R, rng_type * rng) { - int i; - for (i = 0; i < size; i++) - R[i] = enkf_util_rand_normal(0.0 , 1.0 , rng); -} - -/** - Vector containing a random permutation of the integers 1,...,size -*/ - -void enkf_util_randperm( int * P , int size , rng_type * rng) { - int k, tmp; - - for (k = 0; k < size; k++) - P[k] = k; - - while (size > 1) { - k = rng_get_int( rng , size ); - size--; - tmp = P[size]; - P[size] = P[k]; - P[k] = tmp; - } -} - - - -/*****************************************************************/ - -#define TRUNCATE(type , void_data , size , min_ptr , max_ptr) \ -{ \ - type * data = (type *) void_data; \ - type min_value = *((type *) min_ptr); \ - type max_value = *((type *) max_ptr); \ - int i; \ - for (i=0; i < size; i++) { \ - if (data[i] < min_value) \ - data[i] = min_value; \ - else if (data[i] > max_value) \ - data[i] = max_value; \ - } \ -} - -void enkf_util_truncate(void * void_data , int size , ecl_type_enum ecl_type , void * min_ptr , void *max_ptr) { - if (ecl_type == ECL_DOUBLE_TYPE) - TRUNCATE(double , void_data , size , min_ptr , max_ptr) - else if (ecl_type == ECL_FLOAT_TYPE) - TRUNCATE(float , void_data , size , min_ptr , max_ptr) - else if (ecl_type == ECL_INT_TYPE) - TRUNCATE(int , void_data , size , min_ptr , max_ptr) - else - util_abort("%s: unrecognized type - aborting \n",__func__); -} -#undef TRUNCATE - - - - -void enkf_util_assert_buffer_type(buffer_type * buffer, ert_impl_type target_type) { - ert_impl_type file_type; - file_type = buffer_fread_int(buffer); - if (file_type != target_type) - util_abort("%s: wrong target type in file (expected:%d got:%d) - aborting \n",__func__ , target_type , file_type); - -} - - -void enkf_util_fread_assert_target_type_from_buffer(char ** ptr , ert_impl_type target_type) { - ert_impl_type file_type; - util_fread_from_buffer( &file_type , sizeof file_type , 1 , ptr); - if (file_type != target_type) - util_abort("%s: wrong target type in file (expected:%d got:%d) - aborting \n",__func__ , target_type , file_type); -} - - -void enkf_util_fwrite_target_type(FILE * stream , ert_impl_type target_type) { - util_fwrite_int(target_type , stream); -} - - -/* -size_t util_copy_strided_vector(const void * _src, size_t src_size , int src_stride , void * _target , int target_stride , size_t target_size , int type_size , bool * complete) { - const char * src = (const char *) _src; - char * target = (char *) _target; - - size_t src_index; - size_t target_index = 0; - - for (src_index = 0; src_index < src_size; src_index++) { - size_t src_adress = src_index * type_size * src_stride; - size_t target_adress = target_index * type_size * target_stride; - memcpy(&target[target_adress] , &src[src_adress] , type_size); - target_index++; - if (target_index == target_size) { - if (src_index < (src_size - 1)) *complete = false; - break; - } - } - return target_index; -} - -*/ - - - -/** - Prompts the user for a filename, and reads the filename from - stdin. - - If the parameter 'auto_mkdir' is true, the path part of the - filename is created automagically. If 'must_exist' is true, the - function will loop until the user gives an existing filename. - - The filename given by the user is returned - it is the - responibility of the calling scope to free this memory. - - The options parameter is an integer, which is a sum of the - following alternatives: - - EXISTING_FILE = 1 - NEW_FILE = 2 - AUTO_MKDIR = 4 -*/ - -//char * enkf_util_scanf_alloc_filename(const char * prompt , int options) { -// if ((options & EXISTING_FILE) && (options & NEW_FILE)) -// util_abort("%s: internal error - asking for both new and existing file - impossible \n", __func__); -// { -// bool OK = true; -// char * _path; -// char file[1024]; -// do { -// printf("%s",prompt); -// scanf("%s" , file); -// util_alloc_file_components(file , &_path , NULL , NULL); -// if (_path != NULL) { -// if (!util_is_directory(_path)) -// if (options & AUTO_MKDIR) -// util_make_path(_path); -// free(_path); -// } -// -// if ((options & EXISTING_FILE) && (!util_file_exists(file))) -// OK = false; -// else if ((options & NEW_FILE) && (util_file_exists(file))) -// OK = false; -// -// } while (!OK); -// return util_alloc_string_copy(file); -// } -//} - - - -/** - This function prints the entries in data to a file. - - data is assumed to be num_colums pointers to double vectors of length num_rows. - Note that this is not the conventional C style naming. - - If summarize is true, the mean and standard deviation of each column will be printed. -*/ -#define PRINT_LINE(n,c,stream) { int _i; for (_i = 0; _i < (n); _i++) fputc(c , stream); fprintf(stream,"\n"); } -void enkf_util_fprintf_data(const int * index_column , const double ** data, const char * index_name , const char ** column_names, int num_rows, int num_columns, const bool * active , - bool summarize, FILE * stream) { - const int float_width = 9; - const int float_precision = 4; - - int * width = util_calloc((num_columns + 1) , sizeof * width ); - int total_width; - - double * mean = util_calloc(num_columns , sizeof * mean ); - double * stddev = util_calloc(num_columns , sizeof * stddev); - - /* Check the column_names. */ - for(int column_nr = 0; column_nr < num_columns; column_nr++) - { - if (column_names[column_nr] == NULL) - util_abort("%s: Trying to dereference NULL pointer.\n", __func__); - } - - /* Calculate the width of each column and the total width. */ - width[0] = strlen(index_name) + 1; - total_width = width[0]; - for (int column_nr = 0; column_nr < num_columns; column_nr++) { - if (active[column_nr]) { - if(column_names[column_nr] != NULL) - width[column_nr + 1] = util_int_max(strlen(column_names[column_nr]), 2 * float_width + 5) + 1; /* Must accomodate A +/- B */ - width[column_nr + 1] += ( 1 - (width[column_nr + 1] & 1)); /* Ensure odd length */ - total_width += width[column_nr + 1] + 1; - } - } - - /* Calculate the mean and std dev of each column. */ - for(int column_nr = 0; column_nr < num_columns; column_nr++) { - if (active[column_nr]) { - mean [column_nr] = util_double_vector_mean( num_rows, data[column_nr]); - stddev[column_nr] = util_double_vector_stddev(num_rows, data[column_nr]); - } - } - - { - util_fprintf_string(index_name , width[0] - 1 , true , stream); fprintf(stream , "|"); - for (int column_nr = 0; column_nr < num_columns; column_nr++) { - if (active[column_nr]) { - util_fprintf_string(column_names[column_nr] , width[column_nr + 1] , center_pad , stream); - fprintf(stream , "|"); - } - } - fprintf(stream , "\n"); - PRINT_LINE(total_width , '=' , stream); - - - if(summarize) - { - util_fprintf_string("Mean" , width[0] - 1 , true , stream); - fprintf(stream , "|"); - { - for (int column_nr = 0; column_nr < num_columns; column_nr++) { - if (active[column_nr]) { - int w = (width[column_nr + 1] - 5) / 2; - util_fprintf_double(mean[column_nr] , w , float_precision , 'g' , stream); - fprintf(stream , " +/- "); - util_fprintf_double(stddev[column_nr] , w , float_precision , 'g' , stream); - fprintf(stream , "|"); - } - } - fprintf(stream , "\n"); - } - PRINT_LINE(total_width , '-' , stream); - } - - - for (int row_nr = 0; row_nr < num_rows; row_nr++) { - util_fprintf_int(index_column[row_nr], width[0] - 1 , stream); /* This +1 is not general */ - fprintf(stream , "|"); - - for (int column_nr = 0; column_nr < num_columns; column_nr++) { - if (active[column_nr]) { - util_fprintf_double(data[column_nr][row_nr] , width[column_nr + 1] , float_precision , 'g' , stream); - fprintf(stream , "|"); - } - } - fprintf(stream , "\n"); - } - PRINT_LINE(total_width , '=' , stream); - } - - free(stddev); - free(mean); - free(width); -} -#undef PRINT_LINE - - -char * enkf_util_alloc_tagged_string(const char * s) { - return util_alloc_sprintf("%s%s%s" , DEFAULT_START_TAG , s , DEFAULT_END_TAG); -} - -char * enkf_util_alloc_detagged_string( const char * tagged_string) { - const char * s = &tagged_string[ strlen( DEFAULT_START_TAG ) ]; - return util_alloc_substring_copy( s , 0 , strlen( s ) - strlen( DEFAULT_END_TAG )); -} - - - - -/** - This function will compare two (key) strings. The function is - intended to be used when sorting observation keys in summary tables - of misfit. First the string is split on ':' - then the subsequent - sorting is as follows: - - 1. The number of items is compared, with fewer items coming first. - - 2. A normal string compare is performed on the second item. - - 3. A normal string compare on the first item. - - 4. A normal string compare of the input key. - - The main point of this whole complexity is what is the items 2 & 3; - this will guarantee that the different summary keys related to the - same well, i.e. WWCT:OP1, WGOR:OP_1 and WBHP:OP_1 will come - together. - -*/ - - -int enkf_util_compare_keys( const char * key1 , const char * key2 ) { - int cmp; - { - stringlist_type * items1 = stringlist_alloc_from_split( key1 , SUMMARY_KEY_JOIN_STRING ); - stringlist_type * items2 = stringlist_alloc_from_split( key2 , SUMMARY_KEY_JOIN_STRING ); - - /* 1: Compare number of items. */ - cmp = stringlist_get_size( items1 ) - stringlist_get_size( items2 ); - if (cmp == 0) { - /* 2: String compare on second item */ - if (stringlist_get_size( items1 ) >= 2) - cmp = strcmp( stringlist_iget( items1 , 1) , stringlist_iget( items2 , 1)); - } - - /* 3: String compare on first item */ - if (cmp == 0) - cmp = strcmp( stringlist_iget( items1 , 0) , stringlist_iget( items2 , 0)); - - /* String compare of the whole god damn thing. */ - if (cmp == 0) - cmp = strcmp( key1 , key2 ); - - stringlist_free( items2 ); - stringlist_free( items1 ); - } - return cmp; -} - - -int enkf_util_compare_keys__( const void * __key1 , const void * __key2 ) { - const char * key1 = (const char *) __key1; - const char * key2 = (const char *) __key2; - - return enkf_util_compare_keys( key1 , key2 ); -} - - diff --git a/ThirdParty/Ert/libenkf/src/ensemble_config.c b/ThirdParty/Ert/libenkf/src/ensemble_config.c deleted file mode 100644 index 974c0cfd4a..0000000000 --- a/ThirdParty/Ert/libenkf/src/ensemble_config.c +++ /dev/null @@ -1,1002 +0,0 @@ -/* - copyright (c) 2011 statoil asa, norway. - - the file 'ensemble_config.c' is part of ert - ensemble based reservoir tool. - - ert 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. - - ert 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include /* must have rw locking on the config_nodes ... */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#define ENSEMBLE_CONFIG_TYPE_ID 8825306 - -struct ensemble_config_struct { - UTIL_TYPE_ID_DECLARATION; - pthread_mutex_t mutex; - char * gen_kw_format_string; /* format string used when creating gen_kw search/replace strings. */ - hash_type * config_nodes; /* a hash of enkf_config_node instances - which again conatin pointers to e.g. field_config objects. */ - field_trans_table_type * field_trans_table; /* a table of the transformations which are available to apply on fields. */ - const ecl_sum_type * refcase; /* a ecl_sum reference instance - can be null (not owned by the ensemble - config). is only used to check that summary keys are valid when adding. */ - bool have_forward_init; - summary_key_matcher_type * summary_key_matcher; -}; - - -UTIL_IS_INSTANCE_FUNCTION( ensemble_config , ENSEMBLE_CONFIG_TYPE_ID ) -UTIL_SAFE_CAST_FUNCTION( ensemble_config , ENSEMBLE_CONFIG_TYPE_ID ) - - -/** - setting the format string used to 'mangle' the string in the gen_kw - template files. consider the following example: - - parameter file - -------------- - multpv logunif 0.0001 0.10 - - - template file - ------------- - box - 1 10 1 10 1 5 / - - multpv 500*__multpv__ - - here the parameter file defines a parameter named 'multpv', and the - template file uses the marker string '__multpv__' which should be - replaced with a numerical value. for the current example the - gen_kw_format_string should have the value '__%s__'. - - there are no rules for the format string, but it _must_ contain a - '%s' placeholder which will be replaced with the parameter name - (this is not checked for). the function call creating a search - string from a parameter name is: - - tagged_string = util_alloc_sprintf( gen_kw_format_string , parameter_name ); - -*/ - -void ensemble_config_set_gen_kw_format( ensemble_config_type * ensemble_config , const char * gen_kw_format_string) { - if (!util_string_equal( gen_kw_format_string , ensemble_config->gen_kw_format_string)) { - stringlist_type * gen_kw_keys = ensemble_config_alloc_keylist_from_impl_type( ensemble_config , GEN_KW ); - int i; - ensemble_config->gen_kw_format_string = util_realloc_string_copy( ensemble_config->gen_kw_format_string , gen_kw_format_string ); - for (i=0; i < stringlist_get_size( gen_kw_keys ); i++) { - enkf_config_node_type * config_node = ensemble_config_get_node( ensemble_config , stringlist_iget( gen_kw_keys , i )); - gen_kw_config_update_tag_format( enkf_config_node_get_ref( config_node ) , gen_kw_format_string ); - } - stringlist_free( gen_kw_keys ); - } -} - - -const char * ensemble_config_get_gen_kw_format( const ensemble_config_type * ensemble_config ) { - return ensemble_config->gen_kw_format_string; -} - - -void ensemble_config_set_refcase( ensemble_config_type * ensemble_config , const ecl_sum_type * refcase) { - ensemble_config->refcase = refcase; -} - - - - -ensemble_config_type * ensemble_config_alloc( ) { - ensemble_config_type * ensemble_config = util_malloc(sizeof * ensemble_config ); - - UTIL_TYPE_ID_INIT( ensemble_config , ENSEMBLE_CONFIG_TYPE_ID ); - ensemble_config->config_nodes = hash_alloc(); - ensemble_config->field_trans_table = field_trans_table_alloc(); - ensemble_config->refcase = NULL; - ensemble_config->gen_kw_format_string = util_alloc_string_copy( DEFAULT_GEN_KW_TAG_FORMAT ); - ensemble_config->have_forward_init = false; - ensemble_config->summary_key_matcher = summary_key_matcher_alloc(); - pthread_mutex_init( &ensemble_config->mutex , NULL); - - return ensemble_config; -} - - - -void ensemble_config_free(ensemble_config_type * ensemble_config) { - hash_free( ensemble_config->config_nodes ); - field_trans_table_free( ensemble_config->field_trans_table ); - summary_key_matcher_free(ensemble_config->summary_key_matcher); - free( ensemble_config->gen_kw_format_string ); - free( ensemble_config ); -} - - - - - - - -ert_impl_type ensemble_config_impl_type(const ensemble_config_type *ensemble_config, const char * ecl_kw_name) { - ert_impl_type impl_type = INVALID; - - if (hash_has_key(ensemble_config->config_nodes , ecl_kw_name)) { - enkf_config_node_type * node = hash_get(ensemble_config->config_nodes , ecl_kw_name); - impl_type = enkf_config_node_get_impl_type(node); - } else - util_abort("%s: internal error: asked for implementation type of unknown node:%s \n",__func__ , ecl_kw_name); - - return impl_type; -} - - -enkf_var_type ensemble_config_var_type(const ensemble_config_type *ensemble_config, const char * ecl_kw_name) { - enkf_var_type var_type = INVALID_VAR; - - if (hash_has_key(ensemble_config->config_nodes , ecl_kw_name)) { - enkf_config_node_type * node = hash_get(ensemble_config->config_nodes , ecl_kw_name); - var_type = enkf_config_node_get_var_type(node); - } else - util_abort("%s: internal error: asked for implementation type of unknown node:%s \n",__func__ , ecl_kw_name); - - return var_type; -} - - - -bool ensemble_config_has_key(const ensemble_config_type * ensemble_config , const char * key) { - return hash_has_key( ensemble_config->config_nodes , key); -} - - - -enkf_config_node_type * ensemble_config_get_node(const ensemble_config_type * ensemble_config, const char * key) { - if (hash_has_key(ensemble_config->config_nodes , key)) { - enkf_config_node_type * node = hash_get(ensemble_config->config_nodes , key); - return node; - } else { - util_abort("%s: ens node:\"%s\" does not exist \n",__func__ , key); - return NULL; /* compiler shut up */ - } -} - -enkf_config_node_type * ensemble_config_get_or_create_summary_node(ensemble_config_type * ensemble_config, const char * key) { - if (!hash_has_key(ensemble_config->config_nodes , key)) { - ensemble_config_add_summary(ensemble_config, key, LOAD_FAIL_SILENT); - } - - return ensemble_config_get_node(ensemble_config, key); -} - -/** - this will remove the config node indexed by key, it will use the - function hash_safe_del(), which is thread_safe, and will not fail - if the node has already been removed from the hash. - - however - it is extremely important to ensure that all storage - nodes (which point to the config nodes) have been deleted before - calling this function. that is only assured by using - enkf_main_del_node(). -*/ - - -void ensemble_config_del_node(ensemble_config_type * ensemble_config, const char * key) { - hash_safe_del(ensemble_config->config_nodes , key); -} - - -bool ensemble_config_have_forward_init( const ensemble_config_type * ensemble_config ) { - return ensemble_config->have_forward_init; -} - -void ensemble_config_add_node( ensemble_config_type * ensemble_config , enkf_config_node_type * node) { - if (node) { - const char * key = enkf_config_node_get_key( node ); - if (ensemble_config_has_key(ensemble_config , key)) - util_abort("%s: a configuration object:%s has already been added - aborting \n",__func__ , key); - - hash_insert_hash_owned_ref(ensemble_config->config_nodes , key , node , enkf_config_node_free__); - ensemble_config->have_forward_init |= enkf_config_node_use_forward_init( node ); - } else - util_abort("%s: internal error - tried to add NULL node to ensemble configuration \n",__func__); -} - - - - - -void ensemble_config_add_obs_key(ensemble_config_type * ensemble_config , const char * key, const char * obs_key) { - enkf_config_node_type * config_node = hash_get(ensemble_config->config_nodes , key); - enkf_config_node_add_obs_key(config_node , obs_key); -} - - -void ensemble_config_clear_obs_keys(ensemble_config_type * ensemble_config) { - hash_iter_type * iter = hash_iter_alloc( ensemble_config->config_nodes ); - while (!hash_iter_is_complete( iter )) { - enkf_config_node_type * config_node = hash_iter_get_next_value( iter ); - enkf_config_node_clear_obs_keys( config_node ); - } - hash_iter_free( iter ); -} - - - - - - -void ensemble_config_add_config_items(config_parser_type * config) { - config_schema_item_type * item; - - /** - the two fault types are just added to the config object only to - be able to print suitable messages before exiting. - */ - - item = config_add_schema_item(config , "HAVANA_FAULT" , false ); - config_schema_item_set_argc_minmax(item , 2 , 2); - - item = config_add_schema_item(config , "MULTFLT" , false ); - config_schema_item_set_argc_minmax(item , 3 , 3 ); - config_schema_item_iset_type( item , 2 , CONFIG_EXISTING_PATH ); - - - /*****************************************************************/ - - - item = config_add_schema_item(config , GEN_KW_KEY , false ); - config_schema_item_set_argc_minmax(item , 4 , 6); - config_schema_item_iset_type( item , 1 , CONFIG_EXISTING_PATH ); - config_schema_item_iset_type( item , 3 , CONFIG_EXISTING_PATH ); - - - - item = config_add_key_value( config , GEN_KW_TAG_FORMAT_KEY , false , CONFIG_STRING); - item = config_add_schema_item(config , SCHEDULE_PREDICTION_FILE_KEY , false ); - /* scedhule_prediction_file filename */ - config_schema_item_set_argc_minmax(item , 1 , 3 ); - config_schema_item_iset_type( item , 0 , CONFIG_EXISTING_PATH ); - - - - enkf_config_node_add_GEN_PARAM_config_schema( config ); - enkf_config_node_add_GEN_DATA_config_schema( config ); - enkf_config_node_add_CUSTOM_KW_config_schema( config ); - - item = config_add_schema_item(config , SUMMARY_KEY , false ); /* can have several summary keys on each line. */ - config_schema_item_set_argc_minmax(item , 1 , CONFIG_DEFAULT_ARG_MAX); - - item = config_add_schema_item(config , CONTAINER_KEY , false ); /* can have several summary keys on each line. */ - config_schema_item_set_argc_minmax(item , 2 , CONFIG_DEFAULT_ARG_MAX); - - item = config_add_schema_item( config , SURFACE_KEY , false ); - config_schema_item_set_argc_minmax(item , 4 , 5 ); - - /* - the way config info is entered for fields is unfortunate because - it is difficult/impossible to let the config system handle run - time validation of the input. - */ - - item = config_add_schema_item(config , FIELD_KEY , false ); - config_schema_item_set_argc_minmax(item , 2 , CONFIG_DEFAULT_ARG_MAX); - config_schema_item_add_required_children(item , GRID_KEY); /* if you are using a field - you must have a grid. */ -} - - - -/* - The var type parameter is determined by inspecting the - combination of input parameters. It is possible to specify an - invalid input combination; that should be identified with a call - to gen_data_config_is_valid() in the calling scope. - - - PARAMETER: init_file_fmt != NULL - enkf_outfile_fmt != NULL - enkf_infile_fmt == NULL - - DYNAMIC_STATE: init_file_fmt != NULL - enkf_outfile_fmt != NULL - enkf_infile_fmt != NULL - - DYNAMIC_RESULT: init_file_fmt == NULL - enkf_outfile_fmt == NULL - enkf_infile_fmt != NULL - -*/ - -void ensemble_config_init_GEN_DATA( ensemble_config_type * ensemble_config , const config_content_type * config) { - if (config_content_has_item(config , GEN_DATA_KEY)) { - const config_content_item_type * item = config_content_get_item( config , GEN_DATA_KEY ); - int i; - for (i=0; i < config_content_item_get_size(item); i++) { - const config_content_node_type * node = config_content_item_iget_node( item , i ); - enkf_config_node_type * config_node = enkf_config_node_alloc_GEN_DATA_from_config( node ); - if (config_node) - ensemble_config_add_node( ensemble_config , config_node ); - - } - } -} - - -void ensemble_config_init_GEN_PARAM( ensemble_config_type * ensemble_config , const config_content_type * config) { - /* gen_param - should be unified with the gen_data*/ - if (config_content_has_item(config , GEN_PARAM_KEY)) { - const config_content_item_type * item = config_content_get_item( config , GEN_PARAM_KEY ); - for (int i=0; i < config_content_item_get_size(item); i++) { - const config_content_node_type * node = config_content_item_iget_node( item , i ); - enkf_config_node_type * config_node = enkf_config_node_alloc_GEN_PARAM_from_config( node ); - if (config_node) - ensemble_config_add_node( ensemble_config , config_node ); - - } - } -} - - -void ensemble_config_init_GEN_KW( ensemble_config_type * ensemble_config , const config_content_type * config ) { - if (config_content_has_item(config , GEN_KW_KEY)) { - const config_content_item_type * gen_kw_item = config_content_get_item( config , GEN_KW_KEY ); - int i; - for (i=0; i < config_content_item_get_size( gen_kw_item ); i++) { - config_content_node_type * node = config_content_item_iget_node( gen_kw_item , i ); - - const char * key = config_content_node_iget( node , 0 ); - const char * template_file = config_content_node_iget_as_path( node , 1 ); - const char * enkf_outfile = config_content_node_iget( node , 2 ); - const char * parameter_file = config_content_node_iget_as_path( node , 3 ); - hash_type * opt_hash = hash_alloc(); - - config_content_node_init_opt_hash( node , opt_hash , 4 ); - { - const char * forward_string = hash_safe_get( opt_hash , FORWARD_INIT_KEY ); - enkf_config_node_type * config_node; - bool forward_init = false; - - if (forward_string) { - if (!util_sscanf_bool( forward_string , &forward_init)) - fprintf(stderr,"** Warning: parsing %s as bool failed - using FALSE \n",forward_string); - } - - config_node = ensemble_config_add_gen_kw( ensemble_config , key , forward_init); - enkf_config_node_update_gen_kw( config_node , - enkf_outfile , - template_file , - parameter_file , - hash_safe_get( opt_hash , MIN_STD_KEY ) , - hash_safe_get( opt_hash , INIT_FILES_KEY)); - } - hash_free( opt_hash ); - } - } -} - -void ensemble_config_init_CUSTOM_KW(ensemble_config_type * ensemble_config, const config_content_type * config) { - if (config_content_has_item(config, CUSTOM_KW_KEY)) { - const config_content_item_type * custom_kw_item = config_content_get_item(config, CUSTOM_KW_KEY); - - for (int i = 0; i < config_content_item_get_size(custom_kw_item); i++) { - config_content_node_type * node = config_content_item_iget_node(custom_kw_item, i); - - const char * key = config_content_node_iget(node, 0); - const char * result_file = config_content_node_iget_as_path(node, 1); - const char * output_file = NULL; - - if(config_content_node_get_size(node) > 2) { - output_file = config_content_node_iget_as_path(node, 2); - } - - enkf_config_node_type * config_node = ensemble_config_add_custom_kw(ensemble_config, key, result_file, output_file); - enkf_config_node_update_custom_kw(config_node, result_file, output_file); - enkf_config_node_set_internalize(config_node, 0); - } - } -} - -void ensemble_config_init_SURFACE( ensemble_config_type * ensemble_config , const config_content_type * config ) { - if (config_content_has_item(config , SURFACE_KEY)) { - const config_content_item_type * item = config_content_get_item( config , SURFACE_KEY ); - int i; - for (i=0; i < config_content_item_get_size( item ); i++) { - const config_content_node_type * node = config_content_item_iget_node( item , i ); - const char * key = config_content_node_iget( node , 0 ); - { - hash_type * options = hash_alloc(); /* INIT_FILE: OUTPUT_FILE: BASE_SURFACE: */ - - config_content_node_init_opt_hash( node , options , 1 ); - { - const char * init_file_fmt = hash_safe_get( options , INIT_FILES_KEY ); - const char * output_file = hash_safe_get( options , OUTPUT_FILE_KEY); - const char * base_surface = hash_safe_get( options , BASE_SURFACE_KEY); - const char * min_std_file = hash_safe_get( options , MIN_STD_KEY); - const char * forward_string = hash_safe_get( options , FORWARD_INIT_KEY ); - bool forward_init = false; - - if (forward_string) { - if (!util_sscanf_bool( forward_string , &forward_init)) - fprintf(stderr,"** Warning: parsing %s as bool failed - using FALSE \n",forward_string); - } - - if ((init_file_fmt == NULL) || (output_file == NULL) || (base_surface == NULL)) { - fprintf(stderr,"** error: when entering a surface you must provide arguments:\n"); - fprintf(stderr,"** %s:/path/to/input/files%%d \n",INIT_FILES_KEY); - fprintf(stderr,"** %s:name_of_output_file\n", OUTPUT_FILE_KEY); - fprintf(stderr,"** %s:base_surface_file\n",BASE_SURFACE_KEY); - exit(1); - } - - { - enkf_config_node_type * config_node = ensemble_config_add_surface( ensemble_config , key , forward_init); - enkf_config_node_update_surface( config_node , base_surface , init_file_fmt , output_file , min_std_file ); - } - } - hash_free( options ); - } - } - } -} - - -void ensemble_config_init_SUMMARY( ensemble_config_type * ensemble_config , const config_content_type * config , const ecl_sum_type * refcase) { - if (config_content_has_item(config , SUMMARY_KEY)) { - const config_content_item_type * item = config_content_get_item( config , SUMMARY_KEY ); - int i; - for (i=0; i < config_content_item_get_size( item ); i++) { - const config_content_node_type * node = config_content_item_iget_node( item , i ); - int j; - for (j= 0; j < config_content_node_get_size( node ); j++) { - const char * key = config_content_node_iget( node , j ); - summary_key_matcher_add_summary_key(ensemble_config->summary_key_matcher, key); - - if (util_string_has_wildcard( key )) { - //todo: DEPRECATED. In the Future the matcher should take care of this. - if (ensemble_config->refcase != NULL) { - int k; - stringlist_type * keys = stringlist_alloc_new ( ); - - ecl_sum_select_matching_general_var_list( ensemble_config->refcase , key , keys ); /* expanding the wildcard notation with help of the refcase. */ - for (k=0; k < stringlist_get_size( keys ); k++) - ensemble_config_add_summary(ensemble_config , stringlist_iget(keys , k) , LOAD_FAIL_SILENT ); - - stringlist_free( keys ); - } - } else - ensemble_config_add_summary(ensemble_config , key , LOAD_FAIL_SILENT); - } - } - } -} - - -void ensemble_config_init_FIELD( ensemble_config_type * ensemble_config , const config_content_type * config , ecl_grid_type * grid) { - if (config_content_has_item(config , FIELD_KEY)) { - const config_content_item_type * item = config_content_get_item( config , FIELD_KEY ); - int i; - for (i=0; i < config_content_item_get_size( item ); i++) { - const config_content_node_type * node = config_content_item_iget_node( item , i ); - const char * key = config_content_node_iget( node , 0 ); - const char * var_type_string = config_content_node_iget( node , 1 ); - enkf_config_node_type * config_node; - - { - hash_type * options = hash_alloc(); - - int truncation = TRUNCATE_NONE; - double value_min = -1; - double value_max = -1; - - config_content_node_init_opt_hash( node , options , 2 ); - if (hash_has_key( options , MIN_KEY)) { - truncation |= TRUNCATE_MIN; - value_min = atof(hash_get( options , MIN_KEY)); - } - - if (hash_has_key( options , MAX_KEY)) { - truncation |= TRUNCATE_MAX; - value_max = atof(hash_get( options , MAX_KEY)); - } - - - if (strcmp(var_type_string , DYNAMIC_KEY) == 0) { - config_node = ensemble_config_add_field( ensemble_config , key , grid , false); - enkf_config_node_update_state_field( config_node , truncation , value_min , value_max ); - } else if (strcmp(var_type_string , PARAMETER_KEY) == 0) { - const char * ecl_file = config_content_node_iget( node , 2 ); - const char * init_file_fmt = hash_safe_get( options , INIT_FILES_KEY ); - const char * init_transform = hash_safe_get( options , INIT_TRANSFORM_KEY ); - const char * output_transform = hash_safe_get( options , OUTPUT_TRANSFORM_KEY ); - const char * min_std_file = hash_safe_get( options , MIN_STD_KEY ); - const char * forward_string = hash_safe_get( options , FORWARD_INIT_KEY ); - bool forward_init = false; - - if (forward_string) { - if (!util_sscanf_bool( forward_string , &forward_init)) - fprintf(stderr,"** Warning: parsing %s as bool failed - using FALSE \n",forward_string); - } - config_node = ensemble_config_add_field( ensemble_config , key , grid , forward_init); - enkf_config_node_update_parameter_field( config_node, - ecl_file , - init_file_fmt , - min_std_file , - truncation , - value_min , - value_max , - init_transform , - output_transform ); - } else if (strcmp(var_type_string , GENERAL_KEY) == 0) { - /* General - not really interesting .. */ - const char * ecl_file = config_content_node_iget( node , 2 ); - const char * enkf_infile = config_content_node_iget( node , 3 ); - const char * init_file_fmt = hash_safe_get( options , INIT_FILES_KEY ); - const char * init_transform = hash_safe_get( options , INIT_TRANSFORM_KEY ); - const char * output_transform = hash_safe_get( options , OUTPUT_TRANSFORM_KEY ); - const char * input_transform = hash_safe_get( options , INPUT_TRANSFORM_KEY ); - const char * min_std_file = hash_safe_get( options , MIN_STD_KEY ); - const char * forward_string = hash_safe_get( options , FORWARD_INIT_KEY ); - bool forward_init = false; - - if (forward_string) { - if (!util_sscanf_bool( forward_string , &forward_init)) - fprintf(stderr,"** Warning: parsing %s as bool failed - using FALSE \n",forward_string); - } - - config_node = ensemble_config_add_field( ensemble_config , key , grid , forward_init); - enkf_config_node_update_general_field( config_node, - ecl_file , - enkf_infile , - init_file_fmt , - min_std_file , - truncation , value_min , value_max , - init_transform , - input_transform , - output_transform); - - - } else - util_abort("%s: field type: %s is not recognized\n",__func__ , var_type_string); - - hash_free( options ); - } - } - } -} - - - -/** - observe that if the user has not given a refcase with the refcase - key the refcase pointer will be NULL. in that case it will be - impossible to use wildcards when expanding summary variables. -*/ - -void ensemble_config_init(ensemble_config_type * ensemble_config , const config_content_type * config , ecl_grid_type * grid, const ecl_sum_type * refcase) { - int i; - ensemble_config_set_refcase( ensemble_config , refcase ); - - if (config_content_has_item( config , GEN_KW_TAG_FORMAT_KEY)) { - ensemble_config_set_gen_kw_format( ensemble_config , config_content_iget( config , GEN_KW_TAG_FORMAT_KEY , 0 , 0 )); - } - - ensemble_config_init_GEN_PARAM( ensemble_config , config ); - ensemble_config_init_GEN_DATA( ensemble_config , config ); - ensemble_config_init_CUSTOM_KW(ensemble_config, config); - ensemble_config_init_GEN_KW(ensemble_config , config ); - ensemble_config_init_SURFACE( ensemble_config , config ); - - ensemble_config_init_SUMMARY( ensemble_config , config , refcase ); - - ensemble_config_init_FIELD( ensemble_config , config , grid ); - - - /* Containers - this must come last, to ensure that the other nodes have been added. */ - { - for (i=0; i < config_content_get_occurences(config , CONTAINER_KEY ); i++) { - const stringlist_type * container_kw_list = config_content_iget_stringlist_ref(config , CONTAINER_KEY , i); - const char * container_key = stringlist_iget( container_kw_list , 0 ); - enkf_config_node_type * container_node = ensemble_config_add_container( ensemble_config , container_key ); - - for (int j= 1; j < stringlist_get_size( container_kw_list ); j++) { - const char * child_key = stringlist_iget( container_kw_list , j); - enkf_config_node_update_container( container_node , ensemble_config_get_node( ensemble_config , child_key )); - } - } - } - - /*****************************************************************/ -} - -/** - this function takes a string like this: "pressure:1,4,7" - it - splits the string on ":" and tries to lookup a config object with - that key. for the general string a:b:c:d it will try consecutively - the keys: a, a:b, a:b:c, a:b:c:d. if a config object is found it is - returned, otherwise NULL is returned. - - the last argument is the pointer to a string which will be updated - with the node-spesific part of the full key. so for instance with - the example "pressure:1,4,7", the index_key will contain - "1,4,7". if the full full_key is used to find an object index_key - will be NULL, that also applies if no object is found. -*/ - - -const enkf_config_node_type * ensemble_config_user_get_node(const ensemble_config_type * config , const char * full_key, char ** index_key ) { - const enkf_config_node_type * node = NULL; - char ** key_list; - int keys; - int key_length = 1; - int offset; - - *index_key = NULL; - util_split_string(full_key , USER_KEY_JOIN_STRING , &keys , &key_list); - while (node == NULL && key_length <= keys) { - char * current_key = util_alloc_joined_string( (const char **) key_list , key_length , USER_KEY_JOIN_STRING ); - if (ensemble_config_has_key(config , current_key)) - node = ensemble_config_get_node(config , current_key); - else - key_length++; - offset = strlen( current_key ); - free( current_key ); - } - if (node != NULL) { - if (offset < strlen( full_key )) - *index_key = util_alloc_string_copy(&full_key[offset+1]); - } - - util_free_stringlist(key_list , keys); - return node; -} - - - -stringlist_type * ensemble_config_alloc_keylist(const ensemble_config_type * config) { - return hash_alloc_stringlist( config->config_nodes ); -} - - -/** - observe that var_type here is an integer - naturally written as a - sum of enkf_var_type values: - - ensemble_config_alloc_keylist_from_var_type( config , parameter + dynamic_state); - -*/ - -stringlist_type * ensemble_config_alloc_keylist_from_var_type(const ensemble_config_type * config , int var_mask) { - stringlist_type * key_list = stringlist_alloc_new(); - hash_iter_type * iter = hash_iter_alloc(config->config_nodes); - - while (!hash_iter_is_complete( iter )) { - const char * key = hash_iter_get_next_key(iter); - enkf_var_type var_type = enkf_config_node_get_var_type( hash_get(config->config_nodes , key)); - - if (var_type & var_mask) - stringlist_append_copy( key_list , key ); - } - hash_iter_free(iter); - - return key_list; -} - - - -stringlist_type * ensemble_config_alloc_keylist_from_impl_type(const ensemble_config_type * config , ert_impl_type impl_type) { - stringlist_type * key_list = stringlist_alloc_new(); - hash_iter_type * iter = hash_iter_alloc(config->config_nodes); - while (!hash_iter_is_complete( iter )) { - const char * key = hash_iter_get_next_key(iter); - if (enkf_config_node_get_impl_type( hash_get(config->config_nodes , key)) == impl_type) - stringlist_append_copy( key_list , key ); - - } - hash_iter_free(iter); - return key_list; -} - - -bool ensemble_config_has_impl_type(const ensemble_config_type * config, const ert_impl_type impl_type) { - bool ret = false; - hash_iter_type * iter = hash_iter_alloc(config->config_nodes); - while (!hash_iter_is_complete( iter )) { - const char * key = hash_iter_get_next_key(iter); - if (enkf_config_node_get_impl_type( hash_get(config->config_nodes , key)) == impl_type) { - ret = true; - break; - } - } - hash_iter_free(iter); - return ret; -} - - - - - -/** - this function will look up the user_key in the ensemble_config. if - the corresponding config_node can not be found 0 will be returned, - otherwise enkf_config_node functions will be invoked. -*/ - - -int ensemble_config_get_observations( const ensemble_config_type * config , enkf_obs_type * enkf_obs , const char * user_key , int obs_count , time_t * obs_time , double * y , double * std) { - int num_obs = 0; - char * index_key; - const enkf_config_node_type * config_node = ensemble_config_user_get_node( config , user_key , &index_key); - if (config_node != NULL) { - num_obs = enkf_config_node_load_obs( config_node , enkf_obs , index_key , obs_count , obs_time , y , std); - util_safe_free( index_key ); - } - return num_obs; -} - - -/*****************************************************************/ - - -/* - the ensemble_config_add_xxx() functions below will create a new xxx - instance and add it to the ensemble_config; the return value from - the functions is the newly created config_node instances. - - the newly created enkf_config_node instances are __not__ fully - initialized, and a subsequent call to enkf_config_node_update_xxx() - is essential for proper operation. -*/ - -enkf_config_node_type * ensemble_config_add_field( ensemble_config_type * config , const char * key , ecl_grid_type * ecl_grid , bool forward_init) { - enkf_config_node_type * config_node = enkf_config_node_alloc_field( key , ecl_grid , config->field_trans_table , forward_init); - ensemble_config_add_node( config , config_node ); - return config_node; -} - - -enkf_config_node_type * ensemble_config_add_gen_kw( ensemble_config_type * config , const char * key , bool forward_init) { - enkf_config_node_type * config_node = enkf_config_node_new_gen_kw( key , config->gen_kw_format_string , forward_init); - ensemble_config_add_node( config , config_node ); - return config_node; -} - -enkf_config_node_type * ensemble_config_add_custom_kw(ensemble_config_type * config, const char * key, const char * result_file, const char * output_file) { - enkf_config_node_type * config_node = enkf_config_node_new_custom_kw(key, result_file, output_file); - ensemble_config_add_node(config, config_node); - return config_node; -} - -enkf_config_node_type * ensemble_config_add_defined_custom_kw(ensemble_config_type * config, const char * key, const hash_type * definition) { - enkf_config_node_type * config_node = enkf_config_node_new_defined_custom_kw(key, definition); - ensemble_config_add_node(config, config_node); - return config_node; -} - - - -void ensemble_config_update_custom_kw_config(ensemble_config_type * config, custom_kw_config_set_type * config_set) { - stringlist_type * keys = custom_kw_config_set_get_keys_alloc(config_set); - - for(int i = 0; i < stringlist_get_size(keys); i++) { - const char * key = stringlist_iget(keys, i); - if(!ensemble_config_has_key(config, key)) { - ensemble_config_add_custom_kw(config, key, NULL, NULL); - printf("[%s] CustomKW key: '%s' not in ensemble! Adding from storage.\n", __func__, key); - } - - enkf_config_node_type * config_node = ensemble_config_get_node(config, key); - custom_kw_config_type * custom_kw_config = (custom_kw_config_type*) enkf_config_node_get_ref(config_node); - - custom_kw_config_set_update_config(config_set, custom_kw_config); - } - - stringlist_free(keys); -} - - -/** - this function ensures that object contains a node with 'key' and - type == summary. - - if the @refcase pointer is different from NULL the key will be - validated. keys which do not exist in the refcase will be ignored, - a warning will be printed on stderr and the function will return - NULL. -*/ - -enkf_config_node_type * ensemble_config_add_summary(ensemble_config_type * ensemble_config , const char * key , load_fail_type load_fail) { - enkf_config_node_type * config_node = NULL; - - if (hash_has_key(ensemble_config->config_nodes, key)) { - config_node = hash_get(ensemble_config->config_nodes, key); - if (enkf_config_node_get_impl_type( config_node ) != SUMMARY) { - util_abort("%s: ensemble key:%s already exists - but it is not of summary type\n",__func__ , key); - } - - summary_config_type * summary_config = enkf_config_node_get_ref( config_node ); - summary_config_update_load_fail_mode( summary_config , load_fail ); - - } else { - config_node = enkf_config_node_alloc_summary( key , load_fail); - ensemble_config_add_node(ensemble_config , config_node ); - } - - return config_node; -} - -enkf_config_node_type * ensemble_config_add_summary_observation(ensemble_config_type * ensemble_config , const char * key , load_fail_type load_fail) { - enkf_config_node_type * config_node = ensemble_config_add_summary(ensemble_config, key, load_fail); - - summary_key_matcher_add_summary_key(ensemble_config->summary_key_matcher, key); - - return config_node; -} - - -enkf_config_node_type * ensemble_config_add_surface( ensemble_config_type * ensemble_config , const char * key , bool forward_init) { - enkf_config_node_type * config_node = enkf_config_node_new_surface( key , forward_init ); - ensemble_config_add_node( ensemble_config , config_node ); - return config_node; -} - - -/* - If key == NULL the function will create a random key. -*/ -enkf_config_node_type * ensemble_config_add_container( ensemble_config_type * ensemble_config , const char * key) { - char * local_key = (char *) key; - bool random_key = false; - if (key == NULL) { - local_key = util_calloc( 11 , sizeof * local_key ); - sprintf(local_key , "%ld" , random() % 10000000 ); - random_key = true; - } - - { - enkf_config_node_type * config_node = enkf_config_node_new_container( local_key ); - ensemble_config_add_node( ensemble_config , config_node ); - if (random_key) - free( local_key ); - return config_node; - } -} - - -const summary_key_matcher_type * ensemble_config_get_summary_key_matcher(const ensemble_config_type * ensemble_config) { - return ensemble_config->summary_key_matcher; -} - -/*****************************************************************/ - -void ensemble_config_fprintf_config( ensemble_config_type * ensemble_config , FILE * stream ) { - fprintf( stream , CONFIG_COMMENTLINE_FORMAT ); - fprintf( stream , CONFIG_COMMENT_FORMAT , "Here comes configuration information about the uncertain parameters and response variables in use."); - - fprintf( stream , CONFIG_KEY_FORMAT , GEN_KW_TAG_FORMAT_KEY ); - fprintf( stream , CONFIG_ENDVALUE_FORMAT , ensemble_config->gen_kw_format_string); - - - /* Writing GEN_KW nodes. */ - { - stringlist_type * gen_kw_keys = ensemble_config_alloc_keylist_from_impl_type( ensemble_config , GEN_KW ); - stringlist_sort( gen_kw_keys , NULL ); - for (int i=0; i < stringlist_get_size( gen_kw_keys ); i++) { - const enkf_config_node_type * config_node = ensemble_config_get_node( ensemble_config , stringlist_iget( gen_kw_keys , i)); - enkf_config_node_fprintf_config( config_node , stream ); - } - if (stringlist_get_size( gen_kw_keys ) > 0) - fprintf(stream , "\n"); - stringlist_free( gen_kw_keys ); - } - - - /* Writing FIELD nodes. */ - { - stringlist_type * field_keys = ensemble_config_alloc_keylist_from_impl_type( ensemble_config , FIELD ); - stringlist_sort( field_keys , NULL ); - for (int i=0; i < stringlist_get_size( field_keys ); i++) { - const enkf_config_node_type * config_node = ensemble_config_get_node( ensemble_config , stringlist_iget( field_keys , i)); - enkf_config_node_fprintf_config( config_node , stream ); - } - if (stringlist_get_size( field_keys ) > 0) - fprintf(stream , "\n"); - stringlist_free( field_keys ); - } - - - /* Writing SUMMARY nodes. */ - { - stringlist_type * summary_keys = ensemble_config_alloc_keylist_from_impl_type( ensemble_config , SUMMARY ); - stringlist_sort( summary_keys , NULL ); - for (int i=0; i < stringlist_get_size( summary_keys ); i++) { - if (i == 0) - fprintf(stream , CONFIG_KEY_FORMAT , SUMMARY_KEY); - else if ((i % 8) == 0) { - fprintf(stream , "\n"); - fprintf(stream , CONFIG_KEY_FORMAT , SUMMARY_KEY); - } - fprintf(stream , CONFIG_SHORT_VALUE_FORMAT , stringlist_iget( summary_keys , i )); - } - fprintf(stream , "\n"); - stringlist_free( summary_keys ); - } - fprintf(stream , "\n"); - - - /* Writing GEN_DATA nodes. */ - { - stringlist_type * gen_data_keys = ensemble_config_alloc_keylist_from_impl_type( ensemble_config , GEN_DATA ); - stringlist_sort( gen_data_keys , NULL ); - for (int i=0; i < stringlist_get_size( gen_data_keys ); i++) { - const enkf_config_node_type * config_node = ensemble_config_get_node( ensemble_config , stringlist_iget( gen_data_keys , i)); - enkf_config_node_fprintf_config( config_node , stream ); - } - stringlist_free( gen_data_keys ); - } - fprintf(stream , "\n\n"); -} - - - -int ensemble_config_get_size(const ensemble_config_type * ensemble_config ) { - return hash_get_size( ensemble_config->config_nodes ); -} diff --git a/ThirdParty/Ert/libenkf/src/ert_init_context.c b/ThirdParty/Ert/libenkf/src/ert_init_context.c deleted file mode 100644 index 472f6508fb..0000000000 --- a/ThirdParty/Ert/libenkf/src/ert_init_context.c +++ /dev/null @@ -1,154 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'ert_init_context.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - -#define ERT_INIT_CONTEXT_TYPE_ID 555341328 - - -struct ert_init_context_struct { - UTIL_TYPE_ID_DECLARATION; - vector_type * run_args; - bool_vector_type * iactive; // This can be updated .... - init_mode_type init_mode; - int iter; - int_vector_type * iens_map; - -}; - - - - -char * ert_init_context_alloc_runpath( int iens , path_fmt_type * runpath_fmt , subst_list_type * subst_list , int iter) { - char * runpath; - { - char * first_pass = path_fmt_alloc_path(runpath_fmt , false , iens, iter); /* 1: Replace first %d with iens, if a second %d replace with iter */ - - if (subst_list) - runpath = subst_list_alloc_filtered_string( subst_list , first_pass ); /* 2: Filter out various magic strings like and . */ - else - runpath = util_alloc_string_copy( first_pass ); - - free( first_pass ); - } - return runpath; -} - - -stringlist_type * ert_init_context_alloc_runpath_list(const bool_vector_type * iactive , path_fmt_type * runpath_fmt , subst_list_type * subst_list , int iter) { - stringlist_type * runpath_list = stringlist_alloc_new(); - for (int iens = 0; iens < bool_vector_size( iactive ); iens++) { - - if (bool_vector_iget( iactive , iens )) - stringlist_append_owned_ref( runpath_list , ert_init_context_alloc_runpath(iens , runpath_fmt , subst_list , iter)); - else - stringlist_append_ref( runpath_list , NULL ); - - } - return runpath_list; -} - - -static ert_init_context_type * ert_init_context_alloc1(const bool_vector_type * iactive , init_mode_type init_mode, int iter) { - ert_init_context_type * context = util_malloc( sizeof * context ); - UTIL_TYPE_ID_INIT( context , ERT_INIT_CONTEXT_TYPE_ID ); - - context->iactive = bool_vector_alloc_copy( iactive ); - context->iens_map = bool_vector_alloc_active_index_list( iactive , -1 ); - context->run_args = vector_alloc_new(); - context->init_mode = init_mode; - context->iter = iter; - - return context; -} - -ert_init_context_type * ert_init_context_alloc(enkf_fs_type * init_fs , const bool_vector_type * iactive , - path_fmt_type * runpath_fmt , - subst_list_type * subst_list , - init_mode_type init_mode , - int iter) { - - ert_init_context_type * context = ert_init_context_alloc1( iactive , init_mode , iter ); - { - stringlist_type * runpath_list = ert_init_context_alloc_runpath_list( iactive , runpath_fmt , subst_list , iter ); - for (int iens = 0; iens < bool_vector_size( iactive ); iens++) { - if (bool_vector_iget( iactive , iens )) { - run_arg_type * arg = run_arg_alloc_INIT_ONLY( init_fs , iens , iter , stringlist_iget( runpath_list , iens)); - vector_append_owned_ref( context->run_args , arg , run_arg_free__); - } - } - stringlist_free( runpath_list ); - } - return context; -} - - - - -UTIL_IS_INSTANCE_FUNCTION( ert_init_context , ERT_INIT_CONTEXT_TYPE_ID ); - - - -void ert_init_context_free( ert_init_context_type * context ) { - - vector_free( context->run_args ); - bool_vector_free( context->iactive ); - int_vector_free( context->iens_map ); - free( context ); -} - - -int ert_init_context_get_size( const ert_init_context_type * context ) { - return vector_get_size( context->run_args ); -} - - - -init_mode_type ert_init_context_get_init_mode( const ert_init_context_type * context ) { - return context->init_mode; -} - - -bool_vector_type * ert_init_context_get_iactive( const ert_init_context_type * context ) { - return context->iactive; -} - - -run_arg_type * ert_init_context_iget_arg( const ert_init_context_type * context , int index) { - return vector_iget( context->run_args , index ); -} - - -run_arg_type * ert_init_context_iens_get_arg( const ert_init_context_type * context , int iens) { - int index = int_vector_iget( context->iens_map , iens ); - if (index >= 0) - return vector_iget( context->run_args , index ); - else - return NULL; -} diff --git a/ThirdParty/Ert/libenkf/src/ert_log.c b/ThirdParty/Ert/libenkf/src/ert_log.c deleted file mode 100644 index 629415f538..0000000000 --- a/ThirdParty/Ert/libenkf/src/ert_log.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'ert_log.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -#include - -#include -#include - - -static log_type * logh = NULL; /* Handle to an open log file. */ - -/** - * The logging uses log_level to determine if an incoming message is to be included in the log. - * A high log_level setting will include more messages. - */ -void ert_log_init_log( int log_level , const char * log_file_name, bool verbose){ - logh = log_open( NULL , DEFAULT_LOG_LEVEL ); - - log_set_level(logh, log_level); - if (log_file_name) - log_reopen( logh , log_file_name); - - if (verbose) - printf("Activity will be logged to ..............: %s \n",log_get_filename( logh )); - log_add_message(logh , 1 , NULL , "ert configuration loaded" , false); -} - -void ert_log_add_message_py(int message_level, char* message){ - ert_log_add_message(message_level, NULL, message, false); -} - -/** - * Adding a message with a given message_level. A low message_level means "more important", as only messages with - * message_level below the configured log_level will be included. - */ -void ert_log_add_message(int message_level , FILE * dup_stream , char* message, bool free_message) { - if(logh==NULL) - ert_log_init_log(1,NULL,true); - log_add_message(logh, message_level, dup_stream, message, free_message); -} - -/** - * Adding a message with a given message_level. A low message_level means "more important", as only messages with - * message_level below the configured log_level will be included. - */ -void ert_log_add_fmt_message(int message_level , FILE * dup_stream , const char * fmt , ...) { - if (log_include_message(logh,message_level)) { - char * message; - va_list ap; - va_start(ap , fmt); - message = util_alloc_sprintf_va( fmt , ap ); - log_add_message( logh , message_level , dup_stream , message , true); - va_end(ap); - } -} - -void ert_log_close(){ - if (log_is_open( logh )) - log_add_message( logh , false , NULL , "Exiting ert application normally - all is fine(?)" , false); - log_close( logh ); - logh = NULL; -} - -bool ert_log_is_open(){ - if(logh==NULL) - return false; - return log_is_open(logh); -} - -void ert_log_set_log_level(int log_level){ - if(logh==NULL) - ert_log_init_log(1,NULL,true); - log_set_level(logh, log_level); -} - -int ert_log_get_log_level(){ - if(logh==NULL) - ert_log_init_log(1,NULL,true); - return log_get_level(logh); -} - -const char * ert_log_get_filename() { - if(logh==NULL) - ert_log_init_log(1,NULL,true); - return log_get_filename(logh); -} - -log_type * ert_log_get_logh() { - if(logh==NULL) - ert_log_init_log(1,NULL,true); - return logh; -} - -void ert_log_open_empty(){ - logh = log_open(NULL, DEFAULT_LOG_LEVEL); -} diff --git a/ThirdParty/Ert/libenkf/src/ert_run_context.c b/ThirdParty/Ert/libenkf/src/ert_run_context.c deleted file mode 100644 index 655de27048..0000000000 --- a/ThirdParty/Ert/libenkf/src/ert_run_context.c +++ /dev/null @@ -1,278 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'ert_run_context.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - -#define ERT_RUN_CONTEXT_TYPE_ID 55534132 - - -struct ert_run_context_struct { - UTIL_TYPE_ID_DECLARATION; - vector_type * run_args; - - // Observe that the iactive mask is a shared reference which has - // lifetime longer than the ert_run_context instance. When - // simulations have failed elements in the iactive vector can be set - // to false during runtime. - bool_vector_type * iactive; - run_mode_type run_mode; - int iter; - int step1; - int step2; - int load_start; - int_vector_type * iens_map; - - enkf_fs_type * init_fs; - enkf_fs_type * result_fs; - enkf_fs_type * update_target_fs; -}; - - - - -char * ert_run_context_alloc_runpath( int iens , path_fmt_type * runpath_fmt , subst_list_type * subst_list , int iter) { - char * runpath; - { - char * first_pass = path_fmt_alloc_path(runpath_fmt , false , iens, iter); /* 1: Replace first %d with iens, if a second %d replace with iter */ - - if (subst_list) - runpath = subst_list_alloc_filtered_string( subst_list , first_pass ); /* 2: Filter out various magic strings like and . */ - else - runpath = util_alloc_string_copy( first_pass ); - - free( first_pass ); - } - return runpath; -} - - -stringlist_type * ert_run_context_alloc_runpath_list(const bool_vector_type * iactive , path_fmt_type * runpath_fmt , subst_list_type * subst_list , int iter) { - stringlist_type * runpath_list = stringlist_alloc_new(); - for (int iens = 0; iens < bool_vector_size( iactive ); iens++) { - - if (bool_vector_iget( iactive , iens )) - stringlist_append_owned_ref( runpath_list , ert_run_context_alloc_runpath(iens , runpath_fmt , subst_list , iter)); - else - stringlist_append_ref( runpath_list , NULL ); - - } - return runpath_list; -} - - -static ert_run_context_type * ert_run_context_alloc(bool_vector_type * iactive , run_mode_type run_mode , enkf_fs_type * init_fs , enkf_fs_type * result_fs , enkf_fs_type * update_target_fs , int iter) { - ert_run_context_type * context = util_malloc( sizeof * context ); - UTIL_TYPE_ID_INIT( context , ERT_RUN_CONTEXT_TYPE_ID ); - - context->iactive = iactive; - context->iens_map = bool_vector_alloc_active_index_list( iactive , -1 ); - context->run_args = vector_alloc_new(); - context->run_mode = run_mode; - context->iter = iter; - ert_run_context_set_init_fs(context, init_fs); - ert_run_context_set_result_fs(context, result_fs); - ert_run_context_set_update_target_fs(context, update_target_fs); - - context->step1 = 0; - context->step2 = 0; - return context; -} - - -ert_run_context_type * ert_run_context_alloc_ENSEMBLE_EXPERIMENT(enkf_fs_type * fs , bool_vector_type * iactive , - path_fmt_type * runpath_fmt , - subst_list_type * subst_list , - int iter) { - - ert_run_context_type * context = ert_run_context_alloc( iactive , ENSEMBLE_EXPERIMENT , fs , fs , NULL , iter); - { - stringlist_type * runpath_list = ert_run_context_alloc_runpath_list( iactive , runpath_fmt , subst_list , iter ); - for (int iens = 0; iens < bool_vector_size( iactive ); iens++) { - if (bool_vector_iget( iactive , iens )) { - run_arg_type * arg = run_arg_alloc_ENSEMBLE_EXPERIMENT( fs , iens , iter , stringlist_iget( runpath_list , iens)); - vector_append_owned_ref( context->run_args , arg , run_arg_free__); - } - } - stringlist_free( runpath_list ); - } - return context; -} - - - -ert_run_context_type * ert_run_context_alloc_SMOOTHER_RUN(enkf_fs_type * simulate_fs , enkf_fs_type * target_update_fs , - bool_vector_type * iactive , - path_fmt_type * runpath_fmt , - subst_list_type * subst_list , - int iter) { - - ert_run_context_type * context = ert_run_context_alloc( iactive , SMOOTHER_UPDATE , simulate_fs , simulate_fs , target_update_fs , iter); - { - stringlist_type * runpath_list = ert_run_context_alloc_runpath_list( iactive , runpath_fmt , subst_list , iter ); - for (int iens = 0; iens < bool_vector_size( iactive ); iens++) { - if (bool_vector_iget( iactive , iens )) { - run_arg_type * arg = run_arg_alloc_SMOOTHER_RUN( simulate_fs , target_update_fs , iens , iter , stringlist_iget( runpath_list , iens)); - vector_append_owned_ref( context->run_args , arg , run_arg_free__); - } - } - stringlist_free( runpath_list ); - } - return context; -} - - - - -UTIL_IS_INSTANCE_FUNCTION( ert_run_context , ERT_RUN_CONTEXT_TYPE_ID ); - - - -void ert_run_context_free( ert_run_context_type * context ) { - if (context->result_fs) { - enkf_fs_decrease_write_count(context->result_fs); - } - - if (context->update_target_fs) { - enkf_fs_decrease_write_count(context->update_target_fs); - } - - vector_free( context->run_args ); - int_vector_free( context->iens_map ); - free( context ); -} - - -int ert_run_context_get_size( const ert_run_context_type * context ) { - return vector_get_size( context->run_args ); -} - - - -run_mode_type ert_run_context_get_mode( const ert_run_context_type * context ) { - return context->run_mode; -} - - - - - -int ert_run_context_get_iter( const ert_run_context_type * context ) { - return context->iter; -} - -int ert_run_context_get_step1( const ert_run_context_type * context ) { - return context->step1; -} - - -int ert_run_context_get_load_start( const ert_run_context_type * context ) { - if (context->step1 == 0) - return 1; - else - return context->step1; -} - - -int ert_run_context_get_step2( const ert_run_context_type * context ) { - return context->step2; -} - - -bool_vector_type * ert_run_context_get_iactive( const ert_run_context_type * context ) { - return context->iactive; -} - - -run_arg_type * ert_run_context_iget_arg( const ert_run_context_type * context , int index) { - return vector_iget( context->run_args , index ); -} - - -run_arg_type * ert_run_context_iens_get_arg( const ert_run_context_type * context , int iens) { - int index = int_vector_iget( context->iens_map , iens ); - if (index >= 0) - return vector_iget( context->run_args , index ); - else - return NULL; -} - -enkf_fs_type * ert_run_context_get_init_fs(const ert_run_context_type * run_context) { - if (run_context->init_fs) - return run_context->init_fs; - else { - util_abort("%s: internal error - tried to access run_context->init_fs when init_fs == NULL\n",__func__); - return NULL; - } -} - - -enkf_fs_type * ert_run_context_get_result_fs(const ert_run_context_type * run_context) { - if (run_context->result_fs) - return run_context->result_fs; - else { - util_abort("%s: internal error - tried to access run_context->result_fs when result_fs == NULL\n",__func__); - return NULL; - } -} - - -enkf_fs_type * ert_run_context_get_update_target_fs(const ert_run_context_type * run_context) { - if (run_context->update_target_fs) - return run_context->update_target_fs; - else { - util_abort("%s: internal error - tried to access run_context->update_target_fs when update_target_fs == NULL\n",__func__); - return NULL; - } -} - -void ert_run_context_set_init_fs(ert_run_context_type * context, enkf_fs_type * init_fs) { - context->init_fs = (init_fs) ? init_fs : NULL; -} - -void ert_run_context_set_result_fs(ert_run_context_type * context, enkf_fs_type * result_fs) { - if (result_fs) { - context->result_fs = result_fs; - enkf_fs_increase_write_count(result_fs); - } else - context->result_fs = NULL; -} - -void ert_run_context_set_update_target_fs(ert_run_context_type * context, enkf_fs_type * update_target_fs) { - if (update_target_fs) { - context->update_target_fs = update_target_fs; - enkf_fs_increase_write_count(update_target_fs); - } else - context->update_target_fs = NULL; -} - - - -void ert_run_context_deactivate_realization( ert_run_context_type * context , int iens) { - bool_vector_iset( context->iactive , iens , false ); -} diff --git a/ThirdParty/Ert/libenkf/src/ert_template.c b/ThirdParty/Ert/libenkf/src/ert_template.c deleted file mode 100644 index 408ebe6820..0000000000 --- a/ThirdParty/Ert/libenkf/src/ert_template.c +++ /dev/null @@ -1,258 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'ert_template.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - - -#define ERT_TEMPLATE_TYPE_ID 7731963 -#define ERT_TEMPLATES_TYPE_ID 6677330 - -/* Singular - one template. */ -struct ert_template_struct { - UTIL_TYPE_ID_DECLARATION; - template_type * template; - char * target_file; -}; - - - -/* Plural - many templates. */ -struct ert_templates_struct { - UTIL_TYPE_ID_DECLARATION; - subst_list_type * parent_subst; - hash_type * templates; -}; - - - -void ert_template_set_target_file( ert_template_type * ert_template , const char * target_file ) { - ert_template->target_file = util_realloc_string_copy( ert_template->target_file , target_file ); -} - - -void ert_template_set_template_file( ert_template_type * ert_template , const char * template_file ) { - template_set_template_file( ert_template->template , template_file ); -} - - -const char * ert_template_get_template_file( const ert_template_type * ert_template) { - return template_get_template_file( ert_template->template ); -} - -const char * ert_template_get_target_file( const ert_template_type * ert_template) { - return ert_template->target_file; -} - -const char * ert_template_get_args_as_string( const ert_template_type * ert_template ) { - return template_get_args_as_string( ert_template->template ); -} - - - -ert_template_type * ert_template_alloc( const char * template_file , const char * target_file , subst_list_type * parent_subst) { - ert_template_type * template = util_malloc( sizeof * template); - UTIL_TYPE_ID_INIT(template , ERT_TEMPLATE_TYPE_ID); - template->template = template_alloc( template_file , false , parent_subst); /* The templates are instantiated with internalize_template == false; - this means that substitutions are performed on the filename of the - template itself .*/ - - template->target_file = NULL; - ert_template_set_target_file( template , target_file ); - return template; -} - - -void ert_template_free( ert_template_type * template ) { - util_safe_free( template->target_file ); - template_free( template->template ); - free( template ); -} - - -void ert_template_instantiate( ert_template_type * template , const char * path , const subst_list_type * arg_list) { - char * target_file = util_alloc_filename( path , template->target_file , NULL ); - template_instantiate( template->template , target_file , arg_list , true ); - free( target_file ); -} - - -void ert_template_add_arg( ert_template_type * template , const char * key , const char * value ) { - template_add_arg( template->template , key , value ); -} - -void ert_template_set_args_from_string( ert_template_type * template, const char * arg_string ) { - template_clear_args( template->template ); - template_add_args_from_string( template->template , arg_string ); -} - - -UTIL_SAFE_CAST_FUNCTION( ert_template , ERT_TEMPLATE_TYPE_ID ) - -void ert_template_free__(void * arg) { - ert_template_free( ert_template_safe_cast( arg )); -} - - -static void ert_template_fprintf_config( const ert_template_type * template , FILE * stream ) { - fprintf(stream , CONFIG_KEY_FORMAT , RUN_TEMPLATE_KEY ); - fprintf(stream , CONFIG_VALUE_FORMAT , ert_template_get_template_file( template )); - fprintf(stream , CONFIG_VALUE_FORMAT , template->target_file ); - { - const char * arg_string = ert_template_get_args_as_string( template ); - if (arg_string != NULL) - fprintf(stream , CONFIG_ENDVALUE_FORMAT , arg_string ); - else - fprintf(stream , "\n"); - } -} - - -/*****************************************************************/ - - -ert_templates_type * ert_templates_alloc( subst_list_type * parent_subst ) { - ert_templates_type * templates = util_malloc( sizeof * templates ); - UTIL_TYPE_ID_INIT( templates , ERT_TEMPLATES_TYPE_ID ); - templates->templates = hash_alloc(); - templates->parent_subst = parent_subst; - return templates; -} - - -void ert_templates_free( ert_templates_type * ert_templates ) { - hash_free( ert_templates->templates ); - free( ert_templates ); -} - - -void ert_templates_del_template( ert_templates_type * ert_templates , const char * key) { - hash_del( ert_templates->templates , key ); -} - - -ert_template_type * ert_templates_add_template( ert_templates_type * ert_templates , const char * key , const char * template_file , const char * target_file, const char * arg_string) { - ert_template_type * template = ert_template_alloc( template_file , target_file , ert_templates->parent_subst); - ert_template_set_args_from_string( template , arg_string ); /* Arg_string can be NULL */ - - /** - If key == NULL the function will generate a key after the following algorithm: - - 1. It tries with the basename of the template file. - 2. It tries with the basename of the template file, and a counter. - */ - - if (key == NULL) { - char * new_key = NULL; - char * base_name; - int counter = 1; - util_alloc_file_components( template_file , NULL , &base_name , NULL); - do { - if (counter == 1) - new_key = util_realloc_string_copy( new_key , base_name ); - else - new_key = util_realloc_sprintf( new_key , "%s.%d" , base_name , counter ); - counter++; - } while (hash_has_key( ert_templates->templates , new_key)); - hash_insert_hash_owned_ref( ert_templates->templates , new_key , template , ert_template_free__); - free( new_key ); - free( base_name ); - } else - hash_insert_hash_owned_ref( ert_templates->templates , key , template , ert_template_free__); - - return template; -} - - -void ert_templates_instansiate( ert_templates_type * ert_templates , const char * path , const subst_list_type * arg_list) { - hash_iter_type * iter = hash_iter_alloc( ert_templates->templates ); - while (!hash_iter_is_complete( iter )) { - ert_template_type * ert_template = hash_iter_get_next_value( iter ); - ert_template_instantiate( ert_template , path , arg_list); - } - hash_iter_free( iter ); -} - - - -void ert_templates_clear( ert_templates_type * ert_templates ) { - hash_clear( ert_templates->templates ); -} - -ert_template_type * ert_templates_get_template( ert_templates_type * ert_templates , const char * key) { - return hash_get( ert_templates->templates , key ); -} - -stringlist_type * ert_templates_alloc_list( ert_templates_type * ert_templates) { - return hash_alloc_stringlist( ert_templates->templates ); -} - - -void ert_templates_init( ert_templates_type * templates , const config_content_type * config ) { - if (config_content_has_item( config , RUN_TEMPLATE_KEY)) { - const config_content_item_type * template_item = config_content_get_item( config , RUN_TEMPLATE_KEY ); - for (int i=0; i < config_content_item_get_size( template_item ); i++) { - config_content_node_type * template_node = config_content_item_iget_node( template_item , i ); - const char * template_file = config_content_node_iget_as_path(template_node , 0 ); - const char * target_file = config_content_node_iget( template_node , 1 ); - - ert_template_type * template = ert_templates_add_template( templates , NULL , template_file , target_file , NULL); - - for (int iarg = 2; iarg < config_content_node_get_size( template_node ); iarg++) { - char * key , *value; - const char * key_value = config_content_node_iget( template_node , iarg ); - util_binary_split_string( key_value , "=:" , true , &key , &value); - - if (value != NULL) - ert_template_add_arg( template ,key , value ); - else - fprintf(stderr,"** Warning - failed to parse argument:%s as key:value - ignored \n",config_content_iget( config , "RUN_TEMPLATE" , i , iarg )); - - free( key ); - util_safe_free( value ); - } - } - } -} - - -void ert_templates_fprintf_config( const ert_templates_type * ert_templates , FILE * stream ) { - if (hash_get_size( ert_templates->templates ) > 0 ) { - fprintf( stream , CONFIG_COMMENTLINE_FORMAT ); - fprintf( stream , CONFIG_COMMENT_FORMAT , "Here comes configuration information about RUN-TIME templates instantiated by ERT."); - - { - hash_iter_type * iter = hash_iter_alloc( ert_templates->templates ); - while( !hash_iter_is_complete( iter )) { - const char * key = hash_iter_get_next_key( iter ); - const ert_template_type * template = hash_get( ert_templates->templates , key ); - ert_template_fprintf_config( template , stream ); - } - hash_iter_free( iter ); - } - fprintf( stream , "\n\n" ); - } -} diff --git a/ThirdParty/Ert/libenkf/src/ert_test_context.c b/ThirdParty/Ert/libenkf/src/ert_test_context.c deleted file mode 100644 index faeac2f0b3..0000000000 --- a/ThirdParty/Ert/libenkf/src/ert_test_context.c +++ /dev/null @@ -1,183 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'ert_test_context.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - - -#define ERT_TEST_CONTEXT_TYPE_ID 99671055 -struct ert_test_context_struct { - UTIL_TYPE_ID_DECLARATION; - enkf_main_type * enkf_main; - test_work_area_type * work_area; - rng_type * rng; -}; - - -UTIL_IS_INSTANCE_FUNCTION( ert_test_context , ERT_TEST_CONTEXT_TYPE_ID ) - - -static ert_test_context_type * ert_test_context_alloc__( const char * test_name , const char * model_config , bool python_mode) { - ert_test_context_type * test_context = util_malloc( sizeof * test_context ); - UTIL_TYPE_ID_INIT( test_context , ERT_TEST_CONTEXT_TYPE_ID ); - - /* - This environment variable is set to ensure that test context will - parse the correct files when loading site config. - */ - if (python_mode) - setenv("ERT_UI_MODE" , "gui" , 1); - else - setenv("ERT_UI_MODE" , "tui" , 1); - - - if (util_file_exists(model_config)) { - test_context->work_area = test_work_area_alloc(test_name); - test_work_area_set_store( test_context->work_area , false ); - test_work_area_copy_parent_content(test_context->work_area , model_config ); - { - char * config_file = util_split_alloc_filename( model_config ); - test_context->enkf_main = enkf_main_bootstrap(config_file , true , false ); - free( config_file ); - } - test_context->rng = rng_alloc( MZRAN , INIT_DEV_URANDOM ); - } else { - test_context->enkf_main = NULL; - test_context->work_area = NULL; - test_context->rng = NULL; - } - return test_context; -} - -ert_test_context_type * ert_test_context_alloc( const char * test_name , const char * model_config) { - return ert_test_context_alloc__( test_name , model_config , false ); -} - - -ert_test_context_type * ert_test_context_alloc_python( const char * test_name , const char * model_config) { - return ert_test_context_alloc__( test_name , model_config , true ); -} - - - -enkf_main_type * ert_test_context_get_main( ert_test_context_type * test_context ) { - return test_context->enkf_main; -} - - -const char * ert_test_context_get_cwd( const ert_test_context_type * test_context ) { - return test_work_area_get_cwd( test_context->work_area ); -} - - - -void ert_test_context_free( ert_test_context_type * test_context ) { - - if (test_context->enkf_main) - enkf_main_free( test_context->enkf_main ); - - if (test_context->work_area) - test_work_area_free( test_context->work_area ); - - if (test_context->rng) - rng_free( test_context->rng ); - - free( test_context ); -} - - -bool ert_test_context_install_workflow_job( ert_test_context_type * test_context , const char * job_name , const char * job_file) { - if (util_file_exists( job_file )) { - enkf_main_type * enkf_main = ert_test_context_get_main( test_context ); - ert_workflow_list_type * workflow_list = enkf_main_get_workflow_list( enkf_main ); - ert_workflow_list_add_job( workflow_list , job_name , job_file ); - return ert_workflow_list_has_job( workflow_list , job_name ); - } else - return false; -} - - -bool ert_test_context_install_workflow( ert_test_context_type * test_context , const char * workflow_name , const char * workflow_file) { - if (util_file_exists( workflow_file )) { - enkf_main_type * enkf_main = ert_test_context_get_main( test_context ); - ert_workflow_list_type * workflow_list = enkf_main_get_workflow_list( enkf_main ); - ert_workflow_list_add_workflow( workflow_list , workflow_file , workflow_name ); - return ert_workflow_list_has_workflow( workflow_list , workflow_name); - } else - return false; -} - - -void ert_test_context_fwrite_workflow_job( FILE * stream , const char * job_name , const stringlist_type * args) { - fprintf(stream , "%s " , job_name); - stringlist_fprintf(args , " ", stream); - fprintf(stream , "\n"); -} - - -bool ert_test_context_run_worklow( ert_test_context_type * test_context , const char * workflow_name) { - enkf_main_type * enkf_main = ert_test_context_get_main( test_context ); - ert_workflow_list_type * workflow_list = enkf_main_get_workflow_list( enkf_main ); - - if (ert_workflow_list_has_workflow( workflow_list , workflow_name )){ - bool result = ert_workflow_list_run_workflow_blocking( workflow_list , workflow_name , enkf_main ); - return result; - } - else{ - return false; - } -} - - - -bool ert_test_context_run_worklow_job( ert_test_context_type * test_context , const char * job_name, const stringlist_type * args) { - enkf_main_type * enkf_main = ert_test_context_get_main( test_context ); - ert_workflow_list_type * workflow_list = enkf_main_get_workflow_list( enkf_main ); - - if (ert_workflow_list_has_job( workflow_list , job_name )) { - bool status; - { - char * workflow = util_alloc_sprintf("WORKFLOW-%06d" , rng_get_int( test_context->rng , 1000000)); - { - FILE * stream = util_fopen( workflow , "w"); - ert_test_context_fwrite_workflow_job( stream , job_name , args ); - fclose(stream); - } - ert_test_context_install_workflow( test_context , workflow , workflow); - status = ert_test_context_run_worklow( test_context , workflow ); - free(workflow); - } - return status; - } else - return false; -} - - -void ert_test_context_set_store( ert_test_context_type * test_context , bool store) { - test_work_area_set_store( test_context->work_area , store ); -} diff --git a/ThirdParty/Ert/libenkf/src/ert_users.c b/ThirdParty/Ert/libenkf/src/ert_users.c deleted file mode 100644 index 5458fcbddf..0000000000 --- a/ThirdParty/Ert/libenkf/src/ert_users.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'ert_users.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - - -int main (int argc , char ** argv) { - char hostname[256]; - const char * executable = argv[1]; - - gethostname( hostname , 255 ); - printf("%s : " , hostname); - { - set_type * user_set = set_alloc_empty(); - enkf_main_list_users( user_set , executable ); - - if (set_get_size( user_set ) > 0) - set_fprintf(user_set , " " , stdout ); - else - printf("No users."); - - printf("\n"); - - set_free( user_set ); - } -} - - - - diff --git a/ThirdParty/Ert/libenkf/src/ert_workflow_list.c b/ThirdParty/Ert/libenkf/src/ert_workflow_list.c deleted file mode 100644 index ca78f76bc0..0000000000 --- a/ThirdParty/Ert/libenkf/src/ert_workflow_list.c +++ /dev/null @@ -1,365 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'ert_workflow_list.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include - - -#define ERT_WORKFLOW_LIST_TYPE_ID 8856275 - -struct ert_workflow_list_struct { - UTIL_TYPE_ID_DECLARATION; - stringlist_type * path_list; - hash_type * workflows; - hash_type * alias_map; - workflow_joblist_type * joblist; - const subst_list_type * context; - const config_error_type * last_error; - bool verbose; -}; - - - -ert_workflow_list_type * ert_workflow_list_alloc(const subst_list_type * context) { - ert_workflow_list_type * workflow_list = util_malloc( sizeof * workflow_list ); - UTIL_TYPE_ID_INIT( workflow_list , ERT_WORKFLOW_LIST_TYPE_ID ); - workflow_list->path_list = stringlist_alloc_new(); - workflow_list->workflows = hash_alloc(); - workflow_list->alias_map = hash_alloc(); - workflow_list->joblist = workflow_joblist_alloc(); - workflow_list->context = context; - workflow_list->last_error = NULL; - ert_workflow_list_set_verbose( workflow_list , DEFAULT_WORKFLOW_VERBOSE ); - return workflow_list; -} - - - -UTIL_IS_INSTANCE_FUNCTION( ert_workflow_list , ERT_WORKFLOW_LIST_TYPE_ID ) - -void ert_workflow_list_set_verbose( ert_workflow_list_type * workflow_list , bool verbose) { - workflow_list->verbose = verbose; -} - - -const subst_list_type * ert_workflow_list_get_context(const ert_workflow_list_type * workflow_list) { - return workflow_list->context; -} - -void ert_workflow_list_free( ert_workflow_list_type * workflow_list ) { - hash_free( workflow_list->workflows ); - hash_free( workflow_list->alias_map ); - stringlist_free( workflow_list->path_list ); - workflow_joblist_free( workflow_list->joblist ); - free( workflow_list ); -} - - - -workflow_type * ert_workflow_list_add_workflow( ert_workflow_list_type * workflow_list , const char * workflow_file , const char * workflow_name) { - if (util_file_exists( workflow_file )) { - workflow_type * workflow = workflow_alloc( workflow_file , workflow_list->joblist ); - char * name; - - if (workflow_name == NULL) - util_alloc_file_components( workflow_file , NULL , &name , NULL ); - else - name = (char *) workflow_name; - - - hash_insert_hash_owned_ref( workflow_list->workflows , name , workflow , workflow_free__); - if (hash_has_key( workflow_list->alias_map , name)) - hash_del( workflow_list->alias_map , name); - - if (workflow_name == NULL) - free( name ); - - return workflow; - } else - return NULL; -} - - - -void ert_workflow_list_add_alias( ert_workflow_list_type * workflow_list , const char * real_name , const char * alias) { - if (!util_string_equal( real_name , alias)) - hash_insert_ref( workflow_list->alias_map , alias , real_name ); -} - - -void ert_workflow_list_add_job( ert_workflow_list_type * workflow_list , const char * job_name , const char * config_file ) { - char * name = (char *) job_name; - - if (job_name == NULL) - util_alloc_file_components( config_file , NULL , &name , NULL ); - - if (!workflow_joblist_add_job_from_file( workflow_list->joblist , name , config_file )) - fprintf(stderr,"** Warning: failed to add workflow job:%s from:%s \n",name , config_file ); - - if (job_name == NULL) - free(name); -} - - -bool ert_workflow_list_has_job( const ert_workflow_list_type * workflow_list , const char * job_name) { - return workflow_joblist_has_job( workflow_list->joblist , job_name ); -} - - -const workflow_job_type * ert_workflow_list_get_job( const ert_workflow_list_type * workflow_list , const char * job_name) { - return workflow_joblist_get_job(workflow_list->joblist, job_name); -} - -/** - This function will create the most specific matching filename - corresponding to the @root_name input. I.e. it will look for - filename in this order: - - ROOT@X.Y.Z, ROOT@X.Y, ROOT@X, ROOT - - And return the first name corresponding to an existing file. If no - file can be found the function will return NULL. -*/ - -static char * ert_workflow_list_alloc_version_name( const char * path , const char * root_name ) { - char * full_path = util_alloc_sprintf( "%s%s%s@%d.%d.%s" , path , UTIL_PATH_SEP_STRING , root_name , - version_get_major_ert_version(), - version_get_minor_ert_version(), - version_get_micro_ert_version()); - if (util_is_file( full_path )) - return full_path; - else - free( full_path ); - - /*****************************************************************/ - - full_path = util_alloc_sprintf( "%s%s%s@%d.%d" , path , UTIL_PATH_SEP_STRING , root_name , - version_get_major_ert_version(), - version_get_minor_ert_version()); - - if (util_is_file( full_path )) - return full_path; - else - free( full_path ); - - /*****************************************************************/ - - full_path = util_alloc_sprintf( "%s%s%s@%d" , path , UTIL_PATH_SEP_STRING , root_name , - version_get_major_ert_version()); - - if (util_is_file( full_path )) - return full_path; - else - free( full_path ); - - - /*****************************************************************/ - - full_path = util_alloc_sprintf( "%s%s%s" , path , UTIL_PATH_SEP_STRING , root_name); - - if (util_is_file( full_path )) - return full_path; - else - free( full_path ); - - return NULL; -} - - - -void ert_workflow_list_add_jobs_in_directory( ert_workflow_list_type * workflow_list , const char * path ) { - DIR * dirH = opendir( path ); - set_type * names = set_alloc( 0 , NULL ); - if (dirH) { - while (true) { - struct dirent * entry = readdir( dirH ); - if (entry != NULL) { - if ((strcmp(entry->d_name , ".") != 0) && (strcmp(entry->d_name , "..") != 0)) { - char * root_name, * version; - util_binary_split_string( entry->d_name , "@" , false , &root_name , &version); - if (!set_has_key( names , root_name)) { - char * full_path = ert_workflow_list_alloc_version_name( path , root_name ); - - if (full_path) { - set_add_key( names , root_name ); - if (ert_log_is_open()) - ert_log_add_message( 1 , NULL , util_alloc_sprintf("Adding workflow job:%s " , full_path ), true); - - ert_workflow_list_add_job( workflow_list , root_name , full_path ); - } - - free( full_path ); - } - free( root_name ); - free( version ); - } - } else - break; - } - closedir( dirH ); - } else - fprintf(stderr, "** Warning: failed to open workflow/jobs directory: %s\n", path); - - set_free( names ); -} - - -stringlist_type * ert_workflow_list_get_job_names(const ert_workflow_list_type * workflow_list) { - return workflow_joblist_get_job_names(workflow_list->joblist); -} - - -void ert_workflow_list_init( ert_workflow_list_type * workflow_list , config_content_type * config ) { - /* Adding jobs */ - { - if (config_content_has_item( config , WORKFLOW_JOB_DIRECTORY_KEY)) { - const config_content_item_type * jobpath_item = config_content_get_item( config , WORKFLOW_JOB_DIRECTORY_KEY); - for (int i=0; i < config_content_item_get_size( jobpath_item ); i++) { - config_content_node_type * path_node = config_content_item_iget_node( jobpath_item , i ); - - for (int j=0; j < config_content_node_get_size( path_node ); j++) - ert_workflow_list_add_jobs_in_directory( workflow_list , config_content_node_iget_as_abspath( path_node , j ) ); - } - } - } - - { - if (config_content_has_item( config , LOAD_WORKFLOW_JOB_KEY)) { - const config_content_item_type * job_item = config_content_get_item( config , LOAD_WORKFLOW_JOB_KEY); - for (int i=0; i < config_content_item_get_size( job_item ); i++) { - config_content_node_type * job_node = config_content_item_iget_node( job_item , i ); - const char * config_file = config_content_node_iget_as_path( job_node , 0 ); - const char * job_name = config_content_node_safe_iget( job_node , 1 ); - ert_workflow_list_add_job( workflow_list , job_name , config_file); - } - } - } - - - /* Adding workflows */ - { - if (config_content_has_item( config , LOAD_WORKFLOW_KEY)) { - const config_content_item_type * workflow_item = config_content_get_item( config , LOAD_WORKFLOW_KEY); - for (int i=0; i < config_content_item_get_size( workflow_item ); i++) { - config_content_node_type * workflow_node = config_content_item_iget_node( workflow_item , i ); - const char * workflow_file = config_content_node_iget_as_path( workflow_node , 0 ); - const char * workflow_name = config_content_node_safe_iget( workflow_node , 1 ); - - ert_workflow_list_add_workflow( workflow_list , workflow_file , workflow_name ); - } - } - } -} - - -void ert_workflow_list_add_config_items( config_parser_type * config ) { - config_schema_item_type * item = config_add_schema_item( config , WORKFLOW_JOB_DIRECTORY_KEY , false ); - config_schema_item_set_argc_minmax(item , 1 , 1 ); - config_schema_item_iset_type( item , 0 , CONFIG_PATH ); - - item = config_add_schema_item( config , LOAD_WORKFLOW_KEY , false ); - config_schema_item_set_argc_minmax(item , 1 , 2 ); - config_schema_item_iset_type( item , 0 , CONFIG_EXISTING_PATH ); - - item = config_add_schema_item( config , LOAD_WORKFLOW_JOB_KEY , false ); - config_schema_item_set_argc_minmax(item , 1 , 2 ); - config_schema_item_iset_type( item , 0 , CONFIG_EXISTING_PATH ); -} - - - -workflow_type * ert_workflow_list_get_workflow(ert_workflow_list_type * workflow_list , const char * workflow_name ) { - const char * lookup_name = workflow_name; - - if (hash_has_key( workflow_list->alias_map , workflow_name)) - lookup_name = hash_get( workflow_list->alias_map , workflow_name ); - - return hash_get( workflow_list->workflows , lookup_name ); -} - -bool ert_workflow_list_has_workflow(ert_workflow_list_type * workflow_list , const char * workflow_name ) { - return - hash_has_key( workflow_list->workflows , workflow_name ) || - hash_has_key( workflow_list->alias_map , workflow_name); -} - - -bool ert_workflow_list_run_workflow__(ert_workflow_list_type * workflow_list, workflow_type * workflow, bool verbose , void * self) { - bool runOK = workflow_run( workflow, self , verbose , workflow_list->context); - if (runOK) - workflow_list->last_error = NULL; - else - workflow_list->last_error = workflow_get_last_error( workflow ); - - return runOK; -} - - -bool ert_workflow_list_run_workflow_blocking(ert_workflow_list_type * workflow_list , const char * workflow_name , void * self) { - workflow_type * workflow = ert_workflow_list_get_workflow( workflow_list , workflow_name ); - bool result = ert_workflow_list_run_workflow__( workflow_list, workflow , workflow_list->verbose , self); - return result; -} - - -bool ert_workflow_list_run_workflow(ert_workflow_list_type * workflow_list, const char * workflow_name , void * self) { - workflow_type * workflow = ert_workflow_list_get_workflow( workflow_list , workflow_name ); - return ert_workflow_list_run_workflow__( workflow_list, workflow , workflow_list->verbose , self); -} - - -/*****************************************************************/ - -stringlist_type * ert_workflow_list_alloc_namelist( ert_workflow_list_type * workflow_list ) { - return hash_alloc_stringlist( workflow_list->workflows ); -} - - -const config_error_type * ert_workflow_list_get_last_error( const ert_workflow_list_type * workflow_list) { - return workflow_list->last_error; -} - - -int ert_workflow_list_get_size( const ert_workflow_list_type * workflow_list) { - return hash_get_size( workflow_list->workflows ) + hash_get_size( workflow_list->alias_map); -} diff --git a/ThirdParty/Ert/libenkf/src/field.c b/ThirdParty/Ert/libenkf/src/field.c deleted file mode 100644 index 5fa6eccdb9..0000000000 --- a/ThirdParty/Ert/libenkf/src/field.c +++ /dev/null @@ -1,1564 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'field.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - - -GET_DATA_SIZE_HEADER(field); - - -/*****************************************************************/ - -/** - The field data type contains for "something" which is distributed - over the full grid, i.e. permeability or pressure. All configuration - information is stored in the config object, which is of type - field_config_type. Observe the following: - - * The field **only** contains the active cells - the config object - has a reference to actnum information. - - * The data is stored in a char pointer; the real underlying data can - be (at least) of the types int, float and double. -*/ - -struct field_struct { - int __type_id; - const field_config_type * config; /* The field config object - containing information of active cells++ */ - bool private_config; - char *data; /* The actual storage for the field - suitabley casted to int/float/double on use*/ - - bool shared_data; /* If the data is shared - i.e. managed (xalloc & free) from another scope. */ - int shared_byte_size; /* The size of the shared buffer (if it is shared). */ - char *export_data; /* IFF an output transform should be applied this pointer will hold the transformed data. */ - char *__data; /* IFF an output transform, this pointer will hold the original data during the transform and export. */ -}; - - - -#define EXPORT_MACRO \ -{ \ - int nx,ny,nz; \ - field_config_get_dims(field->config , &nx , &ny , &nz); \ - int i,j,k; \ - for (k=0; k < nz; k++) { \ - for (j=0; j < ny; j++) { \ - for (i=0; i < nx; i++) { \ - bool active_cell = field_config_active_cell(config, i, j, k); \ - bool use_initial_value = false; \ - \ - if (init_file && !active_cell) \ - use_initial_value = true; \ - \ - int source_index = 0; \ - if (use_initial_value) \ - source_index = field_config_global_index(config , i , j , k); \ - else \ - source_index = field_config_active_index(config, i, j, k); \ - \ - int target_index; \ - if (rms_index_order) \ - target_index = rms_util_global_index_from_eclipse_ijk(nx,ny,nz,i,j,k); \ - else \ - target_index = i + j * nx + k* nx*ny; \ - \ - if (use_initial_value) \ - target_data[target_index] = initial_src_data[source_index]; \ - else if (active_cell) \ - target_data[target_index] = src_data[source_index]; \ - else \ - memcpy(&target_data[target_index] , fill_value , sizeof_ctype_target); \ - } \ - } \ - } \ -} \ - - -void field_export3D(const field_type * field , - void *_target_data , - bool rms_index_order , - ecl_type_enum target_type , - void *fill_value, - const char * init_file) { - - const field_config_type * config = field->config; - ecl_type_enum ecl_type = field_config_get_ecl_type( config ); - int sizeof_ctype_target = ecl_util_get_sizeof_ctype(target_type); - - field_type * initial_field = NULL; - field_config_type * initial_field_config = NULL; - if (init_file) { - ecl_grid_type * grid = field_config_get_grid(config); - bool global_size = true; - initial_field_config = field_config_alloc_empty(field_config_get_key(config), grid, NULL, global_size); - initial_field = field_alloc(initial_field_config); - - field_fload_keep_inactive(initial_field, init_file); - } - - switch(ecl_type) { - case(ECL_DOUBLE_TYPE): - { - const double * src_data = (const double *) field->data; - const double * initial_src_data = initial_field ? (const double *) initial_field->data : NULL; - - if (target_type == ECL_FLOAT_TYPE) { - float *target_data = (float *) _target_data; - EXPORT_MACRO; - } else if (target_type == ECL_DOUBLE_TYPE) { - double *target_data = (double *) _target_data; - EXPORT_MACRO; - } else { - fprintf(stderr,"%s: double field can only export to double/float\n",__func__); - abort(); - } - } - break; - case(ECL_FLOAT_TYPE): - { - const float * src_data = (const float *) field->data; - const float * initial_src_data = initial_field ? (const float *) initial_field->data : NULL; - if (target_type == ECL_FLOAT_TYPE) { - float *target_data = (float *) _target_data; - EXPORT_MACRO; - } else if (target_type == ECL_DOUBLE_TYPE) { - double *target_data = (double *) _target_data; - EXPORT_MACRO; - } else { - fprintf(stderr,"%s: float field can only export to double/float\n",__func__); - abort(); - } - } - break; - case(ECL_INT_TYPE): - { - const int * src_data = (const int *) field->data; - const int * initial_src_data = initial_field ? (const int *) initial_field->data : NULL; - if (target_type == ECL_FLOAT_TYPE) { - float *target_data = (float *) _target_data; - EXPORT_MACRO; - } else if (target_type == ECL_DOUBLE_TYPE) { - double *target_data = (double *) _target_data; - EXPORT_MACRO; - } else if (target_type == ECL_INT_TYPE) { - int *target_data = (int *) _target_data; - EXPORT_MACRO; - } else { - fprintf(stderr,"%s: int field can only export to int/double/float\n",__func__); - abort(); - } - } - break; - default: - fprintf(stderr,"%s: Sorry field has unexportable type ... \n",__func__); - break; - } - - if (initial_field) { - field_config_free(initial_field_config); - field_free(initial_field); - } -} -#undef EXPORT_MACRO - - -/*****************************************************************/ -#define IMPORT_MACRO \ -{ \ - int i,j,k; \ - int nx,ny,nz; \ - field_config_get_dims(field->config , &nx , &ny , &nz); \ - for (k=0; k < nz; k++) { \ - for (j=0; j < ny; j++) { \ - for (i=0; i < nx; i++) { \ - int target_index = keep_inactive_cells ? field_config_global_index(config, i, j, k) : field_config_active_index(config, i, j, k); \ - \ - if (target_index >= 0) { \ - int source_index; \ - if (rms_index_order) \ - source_index = rms_util_global_index_from_eclipse_ijk(nx,ny,nz,i,j,k); \ - else \ - source_index = i + j * nx + k* nx*ny; \ - \ - target_data[target_index] = src_data[source_index] ; \ - } \ - } \ - } \ - } \ -} \ - - - -/** - The main function of the field_import3D and field_export3D - functions are to skip the inactive cells (field_import3D) and - distribute inactive cells (field_export3D). - When the flag keep_inactive_cells is set for field_import3D, - the values for the inactive cells are kept. The field argument - must have been allocated with flag global_size = true for this - to work. - When field_export3D is called with argument INIT_FILE, the - exported values for inactive cells are read from the INIT_FILE. - - In addition we can reorganize input/output according to the - RMS Roff index convention, and also perform float <-> double - conversions. - - Observe that these functions only import/export onto memory - buffers, the actual reading and writing of files is done in other - functions (calling these). -*/ - -static void field_import3D(field_type * field , - const void *_src_data , - bool rms_index_order , - bool keep_inactive_cells, - ecl_type_enum src_type) { - const field_config_type * config = field->config; - ecl_type_enum ecl_type = field_config_get_ecl_type(config); - - switch(ecl_type) { - case(ECL_DOUBLE_TYPE): - { - double * target_data = (double *) field->data; - if (src_type == ECL_FLOAT_TYPE) { - float *src_data = (float *) _src_data; - IMPORT_MACRO; - } else if (src_type == ECL_DOUBLE_TYPE) { - double *src_data = (double *) _src_data; - IMPORT_MACRO; - } else if (src_type == ECL_INT_TYPE) { - int *src_data = (int *) _src_data; - IMPORT_MACRO; - } else { - fprintf(stderr,"%s: double field can only import from int/double/float\n",__func__); - abort(); - } - } - break; - case(ECL_FLOAT_TYPE): - { - float * target_data = (float *) field->data; - if (src_type == ECL_FLOAT_TYPE) { - float *src_data = (float *) _src_data; - IMPORT_MACRO; - } else if (src_type == ECL_DOUBLE_TYPE) { - double *src_data = (double *) _src_data; - IMPORT_MACRO; - } else if (src_type == ECL_INT_TYPE) { - int *src_data = (int *) _src_data; - IMPORT_MACRO; - } else { - fprintf(stderr,"%s: double field can only import from int/double/float\n",__func__); - abort(); - } - } - break; - case(ECL_INT_TYPE): - { - int * target_data = (int *) field->data; - if (src_type == ECL_INT_TYPE) { - int *src_data = (int *) _src_data; - IMPORT_MACRO; - } else { - fprintf(stderr,"%s: int field can only import from int\n",__func__); - abort(); - } - } - break; - default: - fprintf(stderr,"%s: Sorry field has unimportable type ... \n",__func__); - break; - } -} -#undef IMPORT_MACRO - - -/*****************************************************************/ - -#define CLEAR_MACRO(d,s) { int k; for (k=0; k < (s); k++) (d)[k] = 0; } -void field_clear(field_type * field) { - const ecl_type_enum ecl_type = field_config_get_ecl_type(field->config); - const int data_size = field_config_get_data_size(field->config ); - - switch (ecl_type) { - case(ECL_DOUBLE_TYPE): - { - double * data = (double *) field->data; - CLEAR_MACRO(data , data_size); - break; - } - case(ECL_FLOAT_TYPE): - { - float * data = (float *) field->data; - CLEAR_MACRO(data , data_size); - break; - } - case(ECL_INT_TYPE): - { - int * data = (int *) field->data; - CLEAR_MACRO(data , data_size); - break; - } - default: - util_abort("%s: not implemeneted for data_type: %d \n",__func__ , ecl_type); - } -} -#undef CLEAR_MACRO - - - - -static field_type * __field_alloc(const field_config_type * field_config , void * shared_data , int shared_byte_size) { - field_type * field = util_malloc(sizeof *field); - field->config = field_config; - field->private_config = false; - if (shared_data == NULL) { - field->shared_data = false; - field->data = util_calloc(field_config_get_byte_size(field->config) , sizeof * field->data ); - } else { - field->data = shared_data; - field->shared_data = true; - field->shared_byte_size = shared_byte_size; - if (shared_byte_size < field_config_get_byte_size(field->config)) - util_abort("%s: the shared buffer is to small to hold the input field - aborting \n",__func__); - - } - field->export_data = NULL; /* This NULL is checked for in the revert_output_transform() */ - field->__type_id = FIELD; - return field; -} - - - -field_type * field_alloc(const field_config_type * field_config) { - return __field_alloc(field_config , NULL , 0); -} - - -field_type * field_alloc_shared(const field_config_type * field_config, void * shared_data , int shared_byte_size) { - return __field_alloc(field_config , shared_data , shared_byte_size); -} - - - -void field_copy(const field_type *src , field_type * target ) { - if (src->config == target->config) - memcpy(target->data , src->data , field_config_get_byte_size(src->config)); - else - util_abort("%s: instances do not share config \n",__func__); -} - - - -void field_read_from_buffer(field_type * field , buffer_type * buffer, enkf_fs_type * fs, int report_step) { - int byte_size = field_config_get_byte_size( field->config ); - enkf_util_assert_buffer_type(buffer , FIELD); - buffer_fread_compressed(buffer , buffer_get_remaining_size( buffer ) , field->data , byte_size); -} - - - -static void * __field_alloc_3D_data(const field_type * field , - int data_size , - bool rms_index_order , - ecl_type_enum ecl_type , - ecl_type_enum target_type, - const char * init_file) { - void * data = util_calloc(data_size , ecl_util_get_sizeof_ctype(target_type) ); - if (ecl_type == ECL_DOUBLE_TYPE) { - double fill; - if (rms_index_order) - fill = RMS_INACTIVE_DOUBLE; - else - fill = 0; - field_export3D(field , data , rms_index_order , target_type , &fill, init_file); - } else if (ecl_type == ECL_FLOAT_TYPE) { - float fill; - if (rms_index_order) - fill = RMS_INACTIVE_FLOAT; - else - fill = 0; - field_export3D(field , data , rms_index_order , target_type , &fill, init_file); - } else if (ecl_type == ECL_INT_TYPE) { - int fill; - if (rms_index_order) - fill = RMS_INACTIVE_INT; - else - fill = 0; - field_export3D(field , data , rms_index_order , target_type , &fill, init_file); - } else - util_abort("%s: trying to export type != int/float/double - aborting \n",__func__); - return data; -} - - -/** - A general comment about writing fields to disk: - - The writing of fields to disk can be done in **MANY** different ways: - - o The native function field_fwrite() will save the field in the - format most suitable for use with enkf. This function will only - save the active cells, and compress the field if the variable - write_compressed is true. Most of the configuration information - is with the field_config object, and not saved with the field. - - o Export as ECLIPSE input. This again has three subdivisions: - - * The function field_ecl_grdecl_export() will write the field to - disk in a format suitable for ECLIPSE INCLUDE statements. This - means that both active and inactive cells are written, with a - zero fill for the inactive. If the argument init_file is set, - the value for the inactive cells are read from this file. - - * The functions field_xxxx_fortio() writes the field in the - ECLIPSE restart format. The function field_ecl_write3D_fortio() - writes all the cells - with zero filling for inactive - cells. This is suitable for IMPORT of e.g. PORO. - - The function field_ecl_write1D_fortio() will write only the - active cells in an ECLIPSE restart file. This is suitable for - e.g. the pressure. - - Observe that the function field_ecl_write() should get config - information and automatically select the right way to export to - eclipse format. - - o Export in RMS ROFF format. -*/ - - - -/** - This function exports *one* field instance to the rms_file - instance. It is the responsibility of the field_ROFF_export() - function to initialize and close down the rms_file instance. -*/ - -static void field_ROFF_export__(const field_type * field , rms_file_type * rms_file, const char * init_file) { - const int data_size = field_config_get_volume(field->config); - const ecl_type_enum target_type = field_config_get_ecl_type(field->config); /* Could/should in principle be input */ - const ecl_type_enum ecl_type = field_config_get_ecl_type(field->config); - - void *data = __field_alloc_3D_data(field , data_size , true , ecl_type , target_type, init_file); - rms_tagkey_type * data_key = rms_tagkey_alloc_complete("data" , data_size , rms_util_convert_ecl_type(target_type) , data , true); - rms_tag_fwrite_parameter(field_config_get_ecl_kw_name(field->config) , data_key , rms_file_get_FILE(rms_file)); - rms_tagkey_free(data_key); - free(data); -} - - -static rms_file_type * field_init_ROFF_export(const field_type * field, const char * filename) { - rms_file_type * rms_file = rms_file_alloc(filename , false); - rms_file_fopen_w(rms_file); - rms_file_init_fwrite(rms_file , "parameter"); /* Version / byteswap ++ */ - { - int nx,ny,nz; - field_config_get_dims(field->config , &nx , &ny , &nz); - rms_tag_fwrite_dimensions(nx , ny , nz , rms_file_get_FILE(rms_file)); /* Dimension header */ - } - return rms_file; -} - - -static void field_complete_ROFF_export(const field_type * field , rms_file_type * rms_file) { - rms_file_complete_fwrite(rms_file); - rms_file_fclose(rms_file); - rms_file_free(rms_file); -} - - - - -/** - This function exports the data of a field as a parameter to an RMS - roff file. The export process is divided in three parts: - - 1. The rms_file is opened, and initialized with some basic data - for dimensions++ - 2. The field is written to file. - 3. The file is completed / closed. - - The reason for doing it like this is that it should be easy to - export several fields (of the same dimension+++) with repeated - calls to 2 (i.e. field_ROFF_export__()) - that is currently not - implemented. -*/ - -void field_ROFF_export(const field_type * field , const char * export_filename, const char * init_file) { - rms_file_type * rms_file = field_init_ROFF_export(field , export_filename); - field_ROFF_export__(field , rms_file, init_file); /* Should now be possible to several calls to field_ROFF_export__() */ - field_complete_ROFF_export(field , rms_file); -} - - - -bool field_write_to_buffer(const field_type * field , buffer_type * buffer , int report_step) { - int byte_size = field_config_get_byte_size( field->config ); - buffer_fwrite_int( buffer , FIELD ); - buffer_fwrite_compressed( buffer , field->data , byte_size ); - return true; -} - - - -void field_ecl_write1D_fortio(const field_type * field , fortio_type * fortio) { - const int data_size = field_config_get_data_size(field->config ); - const ecl_type_enum ecl_type = field_config_get_ecl_type(field->config); - - ecl_kw_fwrite_param_fortio(fortio , field_config_get_ecl_kw_name(field->config), ecl_type , data_size , field->data); -} - - -void field_ecl_write3D_fortio(const field_type * field , fortio_type * fortio, const char * init_file ) { - const int data_size = field_config_get_volume(field->config); - const ecl_type_enum target_type = field_config_get_ecl_type(field->config); /* Could/should in principle be input */ - const ecl_type_enum ecl_type = field_config_get_ecl_type(field->config); - void *data = __field_alloc_3D_data(field , data_size , false ,ecl_type , target_type, init_file); - - ecl_kw_fwrite_param_fortio(fortio , field_config_get_ecl_kw_name(field->config), ecl_type , data_size , data); - free(data); -} - - -static ecl_kw_type * field_alloc_ecl_kw_wrapper__(const field_type * field, void * data) { - const int data_size = field_config_get_volume(field->config); - const ecl_type_enum target_type = field_config_get_ecl_type(field->config); /* Could/should in principle be input */ - - ecl_kw_type * ecl_kw = ecl_kw_alloc_new_shared(field_config_get_ecl_kw_name(field->config) , data_size , target_type , data); - - return ecl_kw; -} - - -void field_ecl_grdecl_export(const field_type * field , FILE * stream, const char * init_file) { - const int data_size = field_config_get_volume(field->config); - const ecl_type_enum target_type = field_config_get_ecl_type(field->config); /* Could/should in principle be input */ - const ecl_type_enum ecl_type = field_config_get_ecl_type(field->config); - void *data = __field_alloc_3D_data(field , data_size , false , ecl_type , target_type, init_file ); - ecl_kw_type * ecl_kw = field_alloc_ecl_kw_wrapper__(field , data); - ecl_kw_fprintf_grdecl(ecl_kw , stream); - ecl_kw_free(ecl_kw); - free(data); -} - - -/** - This allocates a ecl_kw instance representing the field. The - size/header/type are copied from the field. whereas the data is - *SHARED* with the field->data. - - The ecl_kw instance knows that the data is only shared, and it is - safe to call ecl_kw_free() on it. -*/ - -ecl_kw_type * field_alloc_ecl_kw_wrapper(const field_type * field) { - ecl_kw_type * ecl_kw = field_alloc_ecl_kw_wrapper__(field , field->data); - return ecl_kw; -} - - -static void field_apply(field_type * field , field_func_type * func) { - field_config_assert_unary(field->config , __func__); - { - const int data_size = field_config_get_data_size( field->config ); - const ecl_type_enum ecl_type = field_config_get_ecl_type(field->config); - - if (ecl_type == ECL_FLOAT_TYPE) { - float * data = (float *) field->data; - for (int i=0; i < data_size; i++) - data[i] = func(data[i]); - } else if (ecl_type == ECL_DOUBLE_TYPE) { - double * data = (double *) field->data; - for (int i=0; i < data_size; i++) - data[i] = func(data[i]); - } - } -} - - -static bool field_check_finite( const field_type * field) { - const int data_size = field_config_get_data_size( field->config ); - const ecl_type_enum ecl_type = field_config_get_ecl_type(field->config); - bool ok = true; - - if (ecl_type == ECL_FLOAT_TYPE) { - float * data = (float *) field->data; - for (int i=0; i < data_size; i++) - if (!isfinite( data[i] )) - ok = false; - } else if (ecl_type == ECL_DOUBLE_TYPE) { - double * data = (double *) field->data; - for (int i=0; i < data_size; i++) - if (!isfinite( data[i] )) - ok = false; - } - return ok; -} - - - -void field_inplace_output_transform(field_type * field ) { - field_func_type * output_transform = field_config_get_output_transform(field->config); - if (output_transform != NULL) - field_apply(field , output_transform); -} - - - -#define TRUNCATE_MACRO(s , d , t , min , max) \ -for (int i=0; i < s; i++) { \ - if ( t & TRUNCATE_MIN ) \ - if (d[i] < min) \ - d[i] = min; \ - if ( t & TRUNCATE_MAX ) \ - if (d[i] > max) \ - d[i] = max; \ -} - - -static void field_apply_truncation(field_type * field) { - truncation_type truncation = field_config_get_truncation_mode( field->config ); - if (truncation != TRUNCATE_NONE) { - double min_value = field_config_get_truncation_min( field->config ); - double max_value = field_config_get_truncation_max( field->config ); - - const int data_size = field_config_get_data_size(field->config ); - const ecl_type_enum ecl_type = field_config_get_ecl_type(field->config); - if (ecl_type == ECL_FLOAT_TYPE) { - float * data = (float *) field->data; - TRUNCATE_MACRO(data_size , data , truncation , min_value , max_value); - } else if (ecl_type == ECL_DOUBLE_TYPE) { - double * data = (double *) field->data; - TRUNCATE_MACRO(data_size , data , truncation , min_value , max_value); - } else - util_abort("%s: Field type not supported for truncation \n",__func__); - } -} - - -/** - Does both the explicit output transform *AND* the truncation. -*/ - -static void field_output_transform(field_type * field) { - field_func_type * output_transform = field_config_get_output_transform(field->config); - truncation_type truncation = field_config_get_truncation_mode( field->config ); - if ((output_transform != NULL) || (truncation != TRUNCATE_NONE)) { - field->export_data = util_alloc_copy(field->data , field_config_get_byte_size(field->config) ); - field->__data = field->data; /* Storing a pointer to the original data. */ - field->data = field->export_data; - - if (output_transform != NULL) - field_inplace_output_transform(field); - - field_apply_truncation(field); - } -} - - -static void field_revert_output_transform(field_type * field) { - if (field->export_data != NULL) { - free(field->export_data); - field->export_data = NULL; - field->data = field->__data; /* Recover the original pointer. */ - } -} - - -/** - This is the generic "export field to eclipse" function. It will - check up the config object to determine how to export the field, - and then call the appropriate function. The alternatives are: - - * Restart format - only active cells (field_ecl_write1D_fortio). - * Restart format - all cells (field_ecl_write3D_fortio). - * GRDECL format (field_ecl_grdecl_export) - - Observe that the output transform is hooked in here, that means - that if you call e.g. the ROFF export function directly, the output - transform will *NOT* be applied. -*/ - -void field_export(const field_type * __field, - const char * file , - fortio_type * restart_fortio , - field_file_format_type file_type, - bool output_transform, - const char * init_file) { - field_type * field = (field_type *) __field; /* Net effect is no change ... but */ - - if (output_transform) field_output_transform(field); - { - - /* Writes the field to in ecl_kw format to a new file. */ - if ((file_type == ECL_KW_FILE_ALL_CELLS) || (file_type == ECL_KW_FILE_ACTIVE_CELLS)) { - fortio_type * fortio; - bool fmt_file = false; /* For formats which support both formatted and unformatted output this is hardwired to unformatted. */ - - fortio = fortio_open_writer(file , fmt_file , ECL_ENDIAN_FLIP); - - if (file_type == ECL_KW_FILE_ALL_CELLS) - field_ecl_write3D_fortio(field , fortio, init_file); - else - field_ecl_write1D_fortio(field , fortio); - - fortio_fclose(fortio); - } else if (file_type == ECL_GRDECL_FILE) { - /* Writes the field to a new grdecl file. */ - FILE * stream = util_mkdir_fopen(file , "w"); - field_ecl_grdecl_export(field , stream, init_file); - fclose(stream); - } else if (file_type == RMS_ROFF_FILE) - /* Roff export */ - field_ROFF_export(field , file, init_file); - else if (file_type == ECL_FILE) - /* This entry point is used by the ecl_write() function to write to an ALREADY OPENED eclipse restart file. */ - field_ecl_write1D_fortio( field , restart_fortio); - else - util_abort("%s: internal error file_type = %d - aborting \n",__func__ , file_type); - } - if (output_transform) field_revert_output_transform(field); -} - - -/** - Observe that the output transform is hooked in here, that means - that if you call e.g. the ROFF export function directly, the output - transform will *NOT* be applied. - - Observe that the output transform is done one a copy of the data - - not in place. When the export is complete the field->data will be - unchanged. -*/ - -void field_ecl_write(const field_type * field , const char * run_path , const char * file , void * filestream) { - field_file_format_type export_format = field_config_get_export_format(field->config); - - if (export_format == ECL_FILE) { - fortio_type * restart_fortio = fortio_safe_cast(filestream); - field_export(field , NULL , restart_fortio , export_format , true, NULL); - } - else { - char * full_path = util_alloc_filename( run_path , file , NULL); - if (util_is_link(full_path)) { - util_unlink_existing(full_path); - } - field_export(field , full_path , NULL , export_format , true, NULL); - free( full_path ); - } -} - - - -bool field_initialize(field_type *field , int iens , const char * init_file , rng_type * rng) { - bool ret = false; - if (init_file) { - if (field_fload(field , init_file )) { - field_func_type * init_transform = field_config_get_init_transform(field->config); - /* - Doing the input transform - observe that this is done inplace on - the data, not as the output transform which is done on a copy of - prior to export. - */ - if (init_transform) { - field_apply(field , init_transform); - if (!field_check_finite( field )) - util_exit("Sorry: after applying the init transform field:%s contains nan/inf or similar malformed values.\n" , field_config_get_key( field->config )); - } - ret = true; - } - } - - return ret; -} - - -void field_free(field_type *field) { - if (!field->shared_data) { - free(field->data); - field->data = NULL; - } - free(field); -} - - - -void field_serialize(const field_type * field , node_id_type node_id , const active_list_type * active_list , matrix_type * A , int row_offset , int column) { - const field_config_type *config = field->config; - const int data_size = field_config_get_data_size(config ); - ecl_type_enum ecl_type = field_config_get_ecl_type(config); - - enkf_matrix_serialize( field->data , data_size , ecl_type , active_list , A , row_offset , column); -} - - -void field_deserialize(field_type * field , node_id_type node_id , const active_list_type * active_list , const matrix_type * A , int row_offset , int column) { - const field_config_type *config = field->config; - const int data_size = field_config_get_data_size(config ); - ecl_type_enum ecl_type = field_config_get_ecl_type(config); - - enkf_matrix_deserialize( field->data , data_size , ecl_type , active_list , A , row_offset , column); -} - -static int __get_index(const field_type * field, int i, int j, int k) { - return field_config_keep_inactive_cells(field->config) ? field_config_global_index(field->config , i , j , k) : field_config_active_index(field->config , i , j , k); -} - - -void field_ijk_get(const field_type * field , int i , int j , int k , void * value) { - int index = __get_index(field, i, j, k); - int sizeof_ctype = field_config_get_sizeof_ctype(field->config); - memcpy(value , &field->data[index * sizeof_ctype] , sizeof_ctype); -} - - - -double field_ijk_get_double(const field_type * field, int i , int j , int k) { - int index = __get_index(field, i, j, k); - return field_iget_double( field , index ); -} - - -float field_ijk_get_float(const field_type * field, int i , int j , int k) { - int index = __get_index(field, i, j, k); - return field_iget_float( field , index ); -} - - -/** - Takes an active or global index as input, and returns a double. -*/ -double field_iget_double(const field_type * field , int index) { - ecl_type_enum ecl_type = field_config_get_ecl_type(field->config); - int sizeof_ctype = field_config_get_sizeof_ctype(field->config); - char buffer[8]; /* Enough to hold one double */ - memcpy(buffer , &field->data[index * sizeof_ctype] , sizeof_ctype); - if ( ecl_type == ECL_DOUBLE_TYPE ) - return *((double *) buffer); - else if (ecl_type == ECL_FLOAT_TYPE) { - double double_value; - float float_value; - - float_value = *((float *) buffer); - double_value = float_value; - - return double_value; - } else { - util_abort("%s: failed - wrong internal type \n",__func__); - return -1; - } -} - - -/** - Takes an active or global index as input, and returns a double. -*/ -float field_iget_float(const field_type * field , int index) { - ecl_type_enum ecl_type = field_config_get_ecl_type(field->config); - int sizeof_ctype = field_config_get_sizeof_ctype(field->config); - char buffer[8]; /* Enough to hold one double */ - memcpy(buffer , &field->data[index * sizeof_ctype] , sizeof_ctype); - if ( ecl_type == ECL_FLOAT_TYPE ) - return *((float *) buffer); - else if (ecl_type == ECL_DOUBLE_TYPE) { - double double_value; - float float_value; - - double_value = *((double *) buffer); - float_value = double_value; - - return float_value; - } else { - util_abort("%s: failed - wrong internal type \n",__func__); - return -1; - } -} - - - - -double field_iget(const field_type * field, int index) { - return field_iget_double(field , index); -} - - - -void field_ijk_set(field_type * field , int i , int j , int k , const void * value) { - int index = __get_index(field, i, j, k); - int sizeof_ctype = field_config_get_sizeof_ctype(field->config); - memcpy(&field->data[index * sizeof_ctype] , value , sizeof_ctype); -} - - -#define INDEXED_UPDATE_MACRO(t,s,n,index,add) \ -{ \ - int i; \ - if (add) \ - for (i=0; i < (n); i++) \ - (t)[index[i]] += (s)[i]; \ - else \ - for (i=0; i < (n); i++) \ - (t)[index[i]] = (s)[i]; \ -} - - - -static void field_indexed_update(field_type * field, ecl_type_enum src_type , int len , const int * index_list , const void * value , bool add) { - ecl_type_enum target_type = field_config_get_ecl_type(field->config); - - switch (target_type) { - case(ECL_FLOAT_TYPE): - { - float * field_data = (float *) field->data; - if (src_type == ECL_DOUBLE_TYPE) { - double * src_data = (double *) value; - INDEXED_UPDATE_MACRO(field_data , src_data , len , index_list , add); - } else if (src_type == ECL_FLOAT_TYPE) { - float * src_data = (float *) value; - INDEXED_UPDATE_MACRO(field_data , src_data , len , index_list , add); - } else - util_abort("%s both existing field - and indexed values must be float / double - aborting\n",__func__); - } - break; - case(ECL_DOUBLE_TYPE): - { - double * field_data = (double *) field->data; - if (src_type == ECL_DOUBLE_TYPE) { - double * src_data = (double *) value; - INDEXED_UPDATE_MACRO(field_data , src_data , len , index_list , add); - } else if (src_type == ECL_FLOAT_TYPE) { - float * src_data = (float *) value; - INDEXED_UPDATE_MACRO(field_data , src_data , len , index_list , add); - } else - util_abort("%s both existing field - and indexed values must be float / double - aborting\n",__func__); - } - break; - default: - util_abort("%s existing field must be of type float/double - aborting \n",__func__); - } -} - - -void field_indexed_set(field_type * field, ecl_type_enum src_type , int len , const int * index_list , const void * value) { - field_indexed_update(field , src_type , len , index_list , value , false); -} - - -void field_indexed_add(field_type * field, ecl_type_enum src_type , int len , const int * index_list , const void * value) { - field_indexed_update(field , src_type , len , index_list , value , true); -} - - - -double * field_indexed_get_alloc(const field_type * field, int len, const int * index_list) -{ - double * export_data = util_calloc(len , sizeof * export_data); - ecl_type_enum src_type = field_config_get_ecl_type(field->config); - - if(src_type == ECL_DOUBLE_TYPE) { - /* double -> double */ - double * field_data = (double *) field->data; - for (int i=0; i double */ - float * field_data = (float *) field->data; - for (int i=0; i=0) - return true; - else - return false; -} - - -void field_ijk_get_if_valid(const field_type * field , int i , int j , int k , void * value , bool * valid) { - int index = __get_index(field, i, j, k); - if (index >=0) { - *valid = true; - field_ijk_get(field , i , j , k , value); - } else - *valid = false; -} - - -int field_get_active_index(const field_type * field , int i , int j , int k) { - return field_config_active_index(field->config , i , j , k); -} - -int field_get_global_index(const field_type * field , int i , int j , int k) { - return field_config_global_index(field->config , i , j , k); -} - - - -/** - Copying data from a (PACKED) ecl_kw instance down to a fields data. -*/ - -void field_copy_ecl_kw_data(field_type * field , const ecl_kw_type * ecl_kw) { - const field_config_type * config = field->config; - const int data_size = field_config_get_data_size(config ); - ecl_type_enum field_type = field_config_get_ecl_type(field->config); - ecl_type_enum kw_type = ecl_kw_get_type(ecl_kw); - - if (data_size != ecl_kw_get_size(ecl_kw)) { - fprintf(stderr,"\n"); - fprintf(stderr," ** Fatal error - the number of active cells has changed \n"); - fprintf(stderr," ** Grid:%s has %d active cells. \n",field_config_get_grid_name( config ) , data_size); - fprintf(stderr," ** %s loaded from file has %d active cells.\n",field_config_get_key(config), ecl_kw_get_size(ecl_kw)); - fprintf(stderr," ** MINPV / MINPVV problem?? \n"); - util_abort("%s: Aborting \n",__func__ ); - } - - ecl_util_memcpy_typed_data(field->data , ecl_kw_get_void_ptr(ecl_kw) , field_type , kw_type , ecl_kw_get_size(ecl_kw)); -} - - - -/*****************************************************************/ - -bool field_fload_rms(field_type * field , const char * filename, bool keep_inactive) { - { - FILE * stream = util_fopen__( filename , "r"); - if (!stream) - return false; - - fclose( stream ); - } - - { - const char * key = field_config_get_ecl_kw_name(field->config); - ecl_type_enum ecl_type; - rms_file_type * rms_file = rms_file_alloc(filename , false); - rms_tagkey_type * data_tag; - if (field_config_enkf_mode(field->config)) - data_tag = rms_file_fread_alloc_data_tagkey(rms_file , "parameter" , "name" , key); - else { - /** - Setting the key - purely to support converting between - different types of files, without knowing the key. A usable - feature - but not really well defined. - */ - - rms_tag_type * rms_tag = rms_file_fread_alloc_tag(rms_file , "parameter" , NULL , NULL); - const char * parameter_name = rms_tag_get_namekey_name(rms_tag); - field_config_set_key( (field_config_type *) field->config , parameter_name ); - data_tag = rms_tagkey_copyc( rms_tag_get_key(rms_tag , "data") ); - rms_tag_free(rms_tag); - } - - ecl_type = rms_tagkey_get_ecl_type(data_tag); - if (rms_tagkey_get_size(data_tag) != field_config_get_volume(field->config)) - util_abort("%s: trying to import rms_data_tag from:%s with wrong size - aborting \n",__func__ , filename); - - field_import3D(field , rms_tagkey_get_data_ref(data_tag) , true , keep_inactive, ecl_type); - rms_tagkey_free(data_tag); - rms_file_free(rms_file); - } - return true; -} - - - -static bool field_fload_ecl_kw(field_type * field , const char * filename, bool keep_inactive) { - const char * key = field_config_get_ecl_kw_name(field->config); - ecl_kw_type * ecl_kw = NULL; - - { - bool fmt_file; - - if (ecl_util_fmt_file( filename , &fmt_file)) { - fortio_type * fortio = fortio_open_reader(filename , fmt_file , ECL_ENDIAN_FLIP); - if (fortio) { - ecl_kw_fseek_kw(key , true , true , fortio); - ecl_kw = ecl_kw_fread_alloc( fortio ); - fortio_fclose(fortio); - - if (field_config_get_volume(field->config) == ecl_kw_get_size(ecl_kw)) - field_import3D(field , ecl_kw_get_void_ptr(ecl_kw) , false , keep_inactive, ecl_kw_get_type(ecl_kw)); - else - /* Keyword is already packed - e.g. from a restart file. Size is - verified in the _copy function.*/ - field_copy_ecl_kw_data(field , ecl_kw); - - ecl_kw_free(ecl_kw); - return true; - } - } else - util_abort("%s: could not determine formatted/unformatted status of file:%s \n",filename); - } - return false; -} - - - -/* No type translation possible */ -static bool field_fload_ecl_grdecl(field_type * field , const char * filename, bool keep_inactive ) { - const char * key = field_config_get_ecl_kw_name(field->config); - int size = field_config_get_volume(field->config); - ecl_type_enum ecl_type = field_config_get_ecl_type(field->config); - ecl_kw_type * ecl_kw = NULL; - { - FILE * stream = util_fopen__(filename , "r"); - if (stream) { - if (ecl_kw_grdecl_fseek_kw(key , false , stream)) - ecl_kw = ecl_kw_fscanf_alloc_grdecl_data(stream , size , ecl_type); - else - util_exit("%s: Can not locate %s keyword in %s \n",__func__ , key , filename); - fclose(stream); - - field_import3D(field , ecl_kw_get_void_ptr(ecl_kw) , false , keep_inactive, ecl_kw_get_type(ecl_kw)); - ecl_kw_free(ecl_kw); - return true; - } - } - return false; -} - - - - -bool field_fload_typed(field_type * field , const char * filename , field_file_format_type file_type, bool keep_inactive) { - bool loadOK = false; - switch (file_type) { - case(RMS_ROFF_FILE): - loadOK = field_fload_rms(field , filename, keep_inactive ); - break; - case(ECL_KW_FILE): - loadOK = field_fload_ecl_kw(field , filename, keep_inactive ); - break; - case(ECL_GRDECL_FILE): - loadOK = field_fload_ecl_grdecl(field , filename, keep_inactive); - break; - default: - util_abort("%s: file_type:%d not recognized - aborting \n",__func__ , file_type); - } - return loadOK; -} - - -static bool field_fload_custom__(field_type * field , const char * filename , bool keep_inactive) { - if (util_file_readable( filename )) { - field_file_format_type file_type = field_config_guess_file_type( filename ); - if (file_type == UNDEFINED_FORMAT) - file_type = field_config_manual_file_type(filename , true); - - return field_fload_typed(field , filename , file_type, keep_inactive); - } else - return false; -} - - -bool field_fload(field_type * field , const char * filename) { - bool keep_inactive = false; - return field_fload_custom__(field, filename, keep_inactive); -} - - -bool field_fload_keep_inactive(field_type * field , const char * filename) { - bool keep_inactive = true; - return field_fload_custom__(field , filename , keep_inactive); -} - - -bool field_fload_auto(field_type * field , const char * filename, bool keep_inactive ) { - field_file_format_type file_type = field_config_guess_file_type(filename); - return field_fload_typed(field , filename , file_type, keep_inactive); -} - - - -/** - This function compares two fields, and return true if they are - equal. Observe that the config comparison is done with plain - pointer comparison, i.e. the actual content of the config objects - is not compared. If the two fields point to different config - objects, the comparision will fail immediately - without checking the - content of the fields. -*/ - -bool field_cmp(const field_type * f1 , const field_type * f2) { - if (f1->config != f2->config) { - fprintf(stderr,"The two fields have different config objects - and the comparison fails trivially.\n"); - return false; - } else { - const int byte_size = field_config_get_byte_size(f1->config); - if (memcmp( f1->data , f2->data , byte_size) != 0) - return false; - else - return true; - } -} - - -/*****************************************************************/ - - - - -/** - This function loads a field from a complete forward run. The - original implementation is to load e.g. pressure and saturations - from a block of restart data. Current implementation can only - handle that, but in principle other possibilities should be - possible. - - Observe that forward_load loads from a (already loaded) restart_block, - and not from a file. -*/ - - -static bool field_forward_load(field_type * field , - const char * ecl_file_name , - const forward_load_context_type * load_context) { - bool keep_inactive = false; - bool loadOK = true; - field_file_format_type import_format = field_config_get_import_format(field->config); - - if (import_format == ECL_FILE) { - const ecl_file_type * restart_file = forward_load_context_get_restart_file( load_context ); - if (restart_file != NULL) { - ecl_kw_type * field_kw = ecl_file_iget_named_kw(restart_file , field_config_get_ecl_kw_name(field->config) , 0); - field_copy_ecl_kw_data(field , field_kw); - } else - loadOK = false; - //util_abort("%s: fatal error when loading: %s - no restart information has been loaded \n",__func__ , field_config_get_key( field->config )); - } else - /* Loading from unique file - currently this only applies to the modelerror implementation. */ - field_fload_typed(field , ecl_file_name , import_format, keep_inactive); - - - if (loadOK) { - field_func_type * input_transform = field_config_get_input_transform(field->config); - /* The input transform is done in-place. */ - if (input_transform != NULL) - field_apply(field , input_transform); - - } - return loadOK; -} - - - -void field_get_dims(const field_type * field, int *nx, int *ny , int *nz) { - field_config_get_dims(field->config , nx , ny ,nz); -} - - - - - - - - -void field_iadd(field_type * field1, const field_type * field2) { - field_config_assert_binary(field1->config , field2->config , __func__); - { - const int data_size = field_config_get_data_size( field1->config ); - const ecl_type_enum ecl_type = field_config_get_ecl_type( field1->config ); - int i; - - if (ecl_type == ECL_FLOAT_TYPE) { - float * data1 = (float *) field1->data; - const float * data2 = (const float *) field2->data; - for (i = 0; i < data_size; i++) - data1[i] += data2[i]; - } else if (ecl_type == ECL_DOUBLE_TYPE) { - double * data1 = (double *) field1->data; - const double * data2 = (const double *) field2->data; - for (i = 0; i < data_size; i++) - data1[i] += data2[i]; - } - } -} - - -void field_imul(field_type * field1, const field_type * field2) { - field_config_assert_binary(field1->config , field2->config , __func__); - { - const int data_size = field_config_get_data_size(field1->config ); - const ecl_type_enum ecl_type = field_config_get_ecl_type(field1->config); - int i; - - if (ecl_type == ECL_FLOAT_TYPE) { - float * data1 = (float *) field1->data; - const float * data2 = (const float *) field2->data; - for (i = 0; i < data_size; i++) - data1[i] *= data2[i]; - } else if (ecl_type == ECL_DOUBLE_TYPE) { - double * data1 = (double *) field1->data; - const double * data2 = (const double *) field2->data; - for (i = 0; i < data_size; i++) - data1[i] *= data2[i]; - } - } -} - - -void field_iaddsqr(field_type * field1, const field_type * field2) { - field_config_assert_binary(field1->config , field2->config , __func__); - { - const int data_size = field_config_get_data_size(field1->config ); - const ecl_type_enum ecl_type = field_config_get_ecl_type(field1->config); - int i; - - if (ecl_type == ECL_FLOAT_TYPE) { - float * data1 = (float *) field1->data; - const float * data2 = (const float *) field2->data; - for (i = 0; i < data_size; i++) - data1[i] += data2[i] * data2[i]; - } else if (ecl_type == ECL_DOUBLE_TYPE) { - double * data1 = (double *) field1->data; - const double * data2 = (const double *) field2->data; - for (i = 0; i < data_size; i++) - data1[i] += data2[i] * data2[i]; - } - } -} - - -void field_scale(field_type * field, double scale_factor) { - field_config_assert_unary(field->config, __func__); - { - const int data_size = field_config_get_data_size(field->config ); - const ecl_type_enum ecl_type = field_config_get_ecl_type(field->config); - int i; - - if (ecl_type == ECL_FLOAT_TYPE) { - float * data = (float *) field->data; - for (i = 0; i < data_size; i++) - data[i] *= scale_factor; - } else if (ecl_type == ECL_DOUBLE_TYPE) { - double * data = (double *) field->data; - for (i = 0; i < data_size; i++) - data[i] *= scale_factor; - } - } -} - - -static inline float __sqr(float x) { return x*x; } - -void field_isqr(field_type * field) { - field_apply(field , __sqr); -} - - -void field_isqrt(field_type * field) { - field_apply(field , sqrtf); -} - -void field_imul_add(field_type * field1 , double factor , const field_type * field2) { - field_config_assert_binary(field1->config , field2->config , __func__); - { - const int data_size = field_config_get_data_size(field1->config ); - const ecl_type_enum ecl_type = field_config_get_ecl_type(field1->config); - int i; - - if (ecl_type == ECL_FLOAT_TYPE) { - float * data1 = (float *) field1->data; - const float * data2 = (const float *) field2->data; - for (i = 0; i < data_size; i++) - data1[i] += factor * data2[i]; - } else if (ecl_type == ECL_DOUBLE_TYPE) { - double * data1 = (double *) field1->data; - const double * data2 = (const double *) field2->data; - for (i = 0; i < data_size; i++) - data1[i] += factor * data2[i]; - } - } -} - - -void field_update_sum(field_type * sum , field_type * field , double lower_limit , double upper_limit) { - field_output_transform( field ); - { - const int data_size = field_config_get_data_size(field->config ); - const ecl_type_enum ecl_type = field_config_get_ecl_type(field->config); - int i; - - if (ecl_type == ECL_FLOAT_TYPE) { - float * data = (float *) field->data; - float * sum_data = (float *) sum->data; - for (i = 0; i < data_size; i++) { - if (data[i] >= lower_limit) - if (data[i] < upper_limit) - sum_data[i] += 1; - } - } else if (ecl_type == ECL_DOUBLE_TYPE) { - double * data = (double *) field->data; - double * sum_data = (double *) sum->data; - for (i = 0; i < data_size; i++) { - if (data[i] >= lower_limit) - if (data[i] < upper_limit) - sum_data[i] += 1; - } - } - } - field_revert_output_transform( field ); -} - - - -/** - Here, index_key is i a tree digit string with the i, j and k indicies of - the requested block separated by comma. E.g., 1,1,1. - - The string is supposed to contain indices in the range [1...nx] , - [1..ny] , [1...nz], they are immediately converted to C-based zero - offset indices. -*/ -bool field_user_get(const field_type * field, const char * index_key, int report_step , double * value) -{ - const bool internal_value = false; - bool valid; - int i,j,k; - int parse_user_key = field_config_parse_user_key(field->config , index_key , &i, &j , &k); - - - if (parse_user_key == 0) { - int active_index = field_config_active_index(field->config , i,j,k); - *value = field_iget_double(field, active_index); - valid = true; - } else { - if (parse_user_key == 1) - fprintf(stderr,"Failed to parse \"%s\" as three integers \n",index_key); - else if (parse_user_key == 2) - fprintf(stderr," ijk: %d , %d, %d is invalid \n",i+1 , j + 1 , k + 1); - else if (parse_user_key == 3) - fprintf(stderr," ijk: %d , %d, %d is an inactive cell. \n",i+1 , j + 1 , k + 1); - else - util_abort("%s: internal error -invalid value:%d \n",__func__ , parse_user_key); - *value = 0.0; - valid = false; - } - - if (!internal_value && valid) { - field_func_type * output_transform = field_config_get_output_transform(field->config); - if (output_transform != NULL) - *value = output_transform( *value ); - /* Truncation - ignored for now */ - } - return valid; -} - - - -#define INFLATE(inf,std,min) \ -{ \ - for (int i=0; i < data_size; i++) { \ - if (std_data[i] > 0) \ - inflation_data[i] = util_float_max( 1.0 , min_std_data[i] / std_data[i]); \ - else \ - inflation_data[i] = 1.0; \ - } \ -} - - -void field_set_inflation(field_type * inflation , const field_type * std , const field_type * min_std) { - const field_config_type * config = inflation->config; - ecl_type_enum ecl_type = field_config_get_ecl_type( config ); - const int data_size = field_config_get_data_size( config ); - - if (ecl_type == ECL_FLOAT_TYPE) { - float * inflation_data = (float *) inflation->data; - const float * std_data = (const float *) std->data; - const float * min_std_data = (const float *) min_std->data; - - INFLATE(inflation_data , std_data , min_std_data ); - - } else if (ecl_type == ECL_DOUBLE_TYPE) { - double * inflation_data = (double *) inflation->data; - const double * std_data = (const double *) std->data; - const double * min_std_data = (const double *) min_std->data; - - INFLATE(inflation_data , std_data , min_std_data ); - } -} -#undef INFLATE - - - -/******************************************************************/ -/* Anonumously generated functions used by the enkf_node object */ -/******************************************************************/ - -/* - These two functions assume float/double storage; will not work with - field which is internally based on char *. - - MATH_OPS(field) -*/ -UTIL_SAFE_CAST_FUNCTION(field , FIELD) -UTIL_SAFE_CAST_FUNCTION_CONST(field , FIELD) -UTIL_IS_INSTANCE_FUNCTION(field , FIELD) -VOID_ALLOC(field) -VOID_FREE(field) -VOID_ECL_WRITE (field) -VOID_FORWARD_LOAD(field) -VOID_COPY (field) -VOID_INITIALIZE(field); -VOID_USER_GET(field) -VOID_READ_FROM_BUFFER(field) -VOID_WRITE_TO_BUFFER(field) -VOID_CLEAR(field) -VOID_SERIALIZE(field) -VOID_DESERIALIZE(field) -VOID_SET_INFLATION(field) -VOID_IADD(field) -VOID_SCALE(field) -VOID_IADDSQR(field) -VOID_IMUL(field) -VOID_ISQRT(field) -VOID_FLOAD(field) diff --git a/ThirdParty/Ert/libenkf/src/field_config.c b/ThirdParty/Ert/libenkf/src/field_config.c deleted file mode 100644 index 6f14da7dc5..0000000000 --- a/ThirdParty/Ert/libenkf/src/field_config.c +++ /dev/null @@ -1,1048 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'field_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -/** - About transformations and truncations - ------------------------------------- - - The values of the fields data can be automagically manipulated through two methods: - - * You can specify a min and a max value which will serve as truncation. - - * You can specify transformation functions which are applied to the field as follows: - - init_transform: This function is applied to the field when the - field is loaded the first time, i.e. initialized. It is *NOT* - applied under subsequent loads of dynamic fields during the - execution. - - output_transform: This function is applied to the field before it - is exported to eclipse. - - input_transform: This function is applied each time a field is - loaded in from the forward model; i.e. this transformation - applies to dynamic fields. - - - - _______________________________ ___ - / \ /|\ - | Forward model (i.e. ECLIPSE) | | - | generates dynamic fields like | | - | PRESSURE and SATURATIONS | | - \_______________________________/ | This code is run - | | every time a field - | | is loaded FROM the - \|/ | forward model into - | | EnKF. - ________|_________ | - / \ | - | Input transform | | - \__________________/ | - | | - | | - \|/ | - | | - ________________|__________________ _\|/_ -_______________ ___________ / \ - \ / \ | The internal representation | - Geo Modelling | | init- | | of the field. This (should) | - creates a |==>===============>==| transform |===>===| be a normally distributed | - realization | | | | variable suitable for updates | -_______________/ \___________/ | with EnKF. | - \___________________________________/ ___ -|<---- This path is ONLY executed during INIT ------->| | /|\ - Observe that there is no truncation \|/ | - on load. _________|__________ | - / \ | This code is run - | Output transform | | every time a field - \____________________/ | is exported from - | | enkf to the forward - \|/ | model - i.e. ECLIPSE. - _________|__________ | - / \ | - | Truncate min/max | | - \____________________/ | - | | - \|/ | - _________|__________ | - / \ | - | FORWARD MODEL | | - \____________________/ _\|/_ - - - - - - -*/ - -/*Observe the following convention: - - global_index: [0 , nx*ny*nz) - active_index: [0 , nactive) -*/ - -#define FIELD_CONFIG_ID 78269 - -struct field_config_struct { - UTIL_TYPE_ID_DECLARATION; - - char * ecl_kw_name; /* Name/key ... */ - int data_size , nx,ny,nz; /* The number of elements in the three directions. */ - bool keep_inactive_cells; /* Whether the data contains only active cells or active and inactive cells */ - ecl_grid_type * grid; /* A shared reference to the grid this field is defined on. */ - bool private_grid; - - int truncation; /* How the field should be trunacted before exporting for simulation, and for the inital import. OR'd combination of truncation_type from enkf_types.h*/ - double min_value; /* The min value used in truncation. */ - double max_value; /* The maximum value used in truncation. */ - - field_file_format_type export_format; - field_file_format_type import_format; - int sizeof_ctype; - ecl_type_enum internal_ecl_type; - ecl_type_enum export_ecl_type; - bool __enkf_mode; /* See doc of functions field_config_set_key() / field_config_enkf_OFF() */ - bool write_compressed; - - field_type_enum type; - field_type * min_std; - /*****************************************************************/ - field_trans_table_type * trans_table; /* Internalize a (pointer to) a table of the available transformation functions. */ - field_func_type * output_transform; /* Function to apply to the data before they are exported - NULL: no transform. */ - field_func_type * init_transform; /* Function to apply on the data when they are loaded the first time - i.e. initialized. NULL : no transform*/ - field_func_type * input_transform; /* Function to apply on the data when they are loaded from the forward model - i.e. for dynamic data. */ - - char * output_transform_name; - char * init_transform_name; - char * input_transform_name; -}; - - -UTIL_IS_INSTANCE_FUNCTION(field_config , FIELD_CONFIG_ID) - -/*****************************************************************/ - - -void field_config_set_ecl_kw_name(field_config_type * config , const char * ecl_kw_name) { - config->ecl_kw_name = util_realloc_string_copy(config->ecl_kw_name , ecl_kw_name); -} - - - -void field_config_set_ecl_type(field_config_type * config , ecl_type_enum ecl_type) { - config->internal_ecl_type = ecl_type; - config->sizeof_ctype = ecl_util_get_sizeof_ctype(ecl_type); -} - - - -static const char * field_config_file_type_string(field_file_format_type file_type) { - switch (file_type) { - case(RMS_ROFF_FILE): - return "Binary ROFF file from RMS"; - break; - case(ECL_KW_FILE): - return "ECLIPSE file in restart format"; - break; - case(ECL_KW_FILE_ALL_CELLS): - return "ECLIPSE file in restart format (all cells)"; - break; - case(ECL_KW_FILE_ACTIVE_CELLS): - return "ECLIPSE file in restart format (active cells)"; - break; - case(ECL_GRDECL_FILE): - return "ECLIPSE file in grdecl format"; - break; - default: - fprintf(stderr,"%s: invalid file type \n",__func__); - abort(); - } -} - - - -/** - This function takes a field_file_format_type variable, and returns - a string containing a default extension for files of this type. For - ecl_kw_file it will return NULL, i.e. no default extension. - - rms_roff_file => ROFF - ecl_grdecl_file => GRDECL - ecl_kw_file_xxx => NULL - - It will return UPPERCASE or lowercase depending on the value of the - second argument. -*/ - - -const char * field_config_default_extension(field_file_format_type file_type, bool upper_case) { - if (file_type == RMS_ROFF_FILE) { - if (upper_case) - return "ROFF"; - else - return "roff"; - } else if (file_type == ECL_GRDECL_FILE) { - if (upper_case) - return "GRDECL"; - else - return "grdecl"; - } else - return NULL; -} - - - - -static bool field_config_valid_file_type(field_file_format_type file_type, bool import) { - if (import) { - if (file_type == RMS_ROFF_FILE || file_type == ECL_KW_FILE || file_type == ECL_GRDECL_FILE) - return true; - else - return false; - } else { - if (file_type == RMS_ROFF_FILE || file_type == ECL_KW_FILE_ACTIVE_CELLS || file_type == ECL_KW_FILE_ALL_CELLS || file_type == ECL_GRDECL_FILE) - return true; - else - return false; - } -} - - -field_file_format_type field_config_default_export_format(const char * filename) { - field_file_format_type export_format = FILE_FORMAT_NULL; - if (filename != NULL) { - export_format = ECL_KW_FILE_ALL_CELLS; /* Suitable for PERMX/PORO/... ; when this export format is - used IMPORT must be used in the datafile instead of - INCLUDE. This gives faster ECLIPSE startup time, but is - (unfortunately) quite unstandard. */ - - char * extension; - util_alloc_file_components(filename , NULL,NULL,&extension); - if (extension != NULL) { - util_strupr(extension); - if (strcmp(extension , "GRDECL") == 0) - export_format = ECL_GRDECL_FILE; - else if (strcmp(extension , "ROFF") == 0) - export_format = RMS_ROFF_FILE; - - free(extension); - } - - } - return export_format; -} - - - - - - -/** - This function prompts the user for a file type. - - If the parameter 'import' is true we provide the alternative - ecl_kw_file (in that case the program itself will determine - whether) the file contains all cells (i.e. PERMX) or only active - cells (i.e. pressure). - - If the parameter 'import' is false the user must specify whether we - are considering all cells, or only active cells. -*/ - -field_file_format_type field_config_manual_file_type(const char * prompt , bool import) { - int int_file_type; - printf("\n%s\n",prompt); - printf("----------------------------------------------------------------\n"); - printf(" %3d: %s.\n" , RMS_ROFF_FILE , field_config_file_type_string(RMS_ROFF_FILE)); - if (import) - printf(" %3d: %s.\n" , ECL_KW_FILE , field_config_file_type_string(ECL_KW_FILE)); - else { - printf(" %3d: %s.\n" , ECL_KW_FILE_ACTIVE_CELLS , field_config_file_type_string(ECL_KW_FILE_ACTIVE_CELLS)); - printf(" %3d: %s.\n" , ECL_KW_FILE_ALL_CELLS , field_config_file_type_string(ECL_KW_FILE_ALL_CELLS)); - } - printf(" %3d: %s.\n" , ECL_GRDECL_FILE , field_config_file_type_string(ECL_GRDECL_FILE)); - printf("----------------------------------------------------------------\n"); - do { - int_file_type = util_scanf_int("" , 2); - if (!field_config_valid_file_type(int_file_type, import)) - int_file_type = UNDEFINED_FORMAT; - } while(int_file_type == UNDEFINED_FORMAT); - return int_file_type; -} - - - - -/** -This function takes in a filename and tries to guess the type of the -file. It can determine the following three types of files: - - ecl_kw_file: This is a file containg ecl_kw instances in the form found - in eclipse restart files. - - rms_roff_file: An rms roff file - obviously. - - ecl_grdecl_file: This is a file containing a parameter of the form - found in eclipse grid declaration files, i.e. formatted, one - keyword and all elements (active and not). - - The latter test is the weakest. Observe that the function will - happily return unkown_file if none of these types are recognized, - i.e. it is *essential* to check the return value. - -*/ -field_file_format_type field_config_guess_file_type(const char * filename ) { - bool fmt_file = util_fmt_bit8(filename ); - FILE * stream = util_fopen(filename , "r"); - fortio_type * fortio = fortio_alloc_FILE_wrapper(NULL , ECL_ENDIAN_FLIP , fmt_file , false , stream); - field_file_format_type file_type; - - if (ecl_kw_is_kw_file(fortio)) - file_type = ECL_KW_FILE; - else if (rms_file_is_roff(stream)) - file_type = RMS_ROFF_FILE; - else if (ecl_kw_grdecl_fseek_next_kw(stream)) /* This is the weakest test - and should be last in a cascading if / else hierarchy. */ - file_type = ECL_GRDECL_FILE; - else - file_type = UNDEFINED_FORMAT; /* MUST Check on this return value */ - - fortio_free_FILE_wrapper( fortio ); - fclose(stream); - return file_type; -} - - - -field_type * field_config_get_min_std( const field_config_type * field_config ) { - return field_config->min_std; -} - - -field_file_format_type field_config_get_export_format(const field_config_type * field_config) { - return field_config->export_format; -} - -field_file_format_type field_config_get_import_format(const field_config_type * field_config) { - return field_config->import_format; -} - -/** - Will return the name of the init_transform function, or NULL if no - init_transform function has been registered. -*/ - - -const char * field_config_get_init_transform_name( const field_config_type * field_config ) { - return field_config->init_transform_name; -} - -const char * field_config_get_input_transform_name( const field_config_type * field_config ) { - return field_config->input_transform_name; -} - -const char * field_config_get_output_transform_name( const field_config_type * field_config ) { - return field_config->output_transform_name; -} - - -/** - IFF the @private_grid parameter is true, the field_config instance - will take ownership of grid, i.e. freeing it in - field_config_free(). - - The field_config object exports a field_config_set_grid() function, - but that is actually quite misleading. If this function is called - during a run there are many other dependencies which must also be - updated, which are not handled. -*/ - - -void field_config_set_grid(field_config_type * config, ecl_grid_type * grid , bool private_grid) { - if ((config->private_grid) && (config->grid != NULL)) - ecl_grid_free( config->grid ); - - config->grid = grid; - config->private_grid = private_grid; - - ecl_grid_get_dims(grid , &config->nx , &config->ny , &config->nz , NULL); - config->data_size = field_config_get_data_size_from_grid(config); -} - - - - -const char * field_config_get_grid_name( const field_config_type * config) { - return ecl_grid_get_name( config->grid ); -} - - - -/* - The return value from this function is hardly usable. -*/ -field_config_type * field_config_alloc_empty( const char * ecl_kw_name , ecl_grid_type * ecl_grid , field_trans_table_type * trans_table, bool keep_inactive_cells ) { - - field_config_type * config = util_malloc(sizeof *config); - UTIL_TYPE_ID_INIT( config , FIELD_CONFIG_ID); - - config->keep_inactive_cells = keep_inactive_cells; - config->ecl_kw_name = util_alloc_string_copy( ecl_kw_name ); - config->private_grid = false; - config->__enkf_mode = true; - config->grid = NULL; - config->write_compressed = true; - config->type = UNKNOWN_FIELD_TYPE; - - config->output_transform = NULL; - config->input_transform = NULL; - config->init_transform = NULL; - config->output_transform_name = NULL; - config->input_transform_name = NULL; - config->init_transform_name = NULL; - - config->truncation = TRUNCATE_NONE; - config->min_std = NULL; - config->trans_table = trans_table; - - field_config_set_grid(config , ecl_grid , false); /* The grid is (currently) set on allocation and can NOT be updated afterwards. */ - field_config_set_ecl_type( config , ECL_FLOAT_TYPE ); /* This is the internal type - currently not exported any API to change it. */ - return config; -} - - - - -static void field_config_set_init_transform( field_config_type * config , const char * __init_transform_name ) { - const char * init_transform_name = NULL; - if (field_trans_table_has_key( config->trans_table , __init_transform_name)) - init_transform_name = __init_transform_name; - else if (__init_transform_name != NULL) { - fprintf(stderr , "Sorry: the field transformation function:%s is not recognized \n\n",__init_transform_name); - field_trans_table_fprintf(config->trans_table , stderr); - util_exit("Exiting ... \n"); - } - - config->init_transform_name = util_realloc_string_copy( config->init_transform_name , init_transform_name ); - if (init_transform_name != NULL) - config->init_transform = field_trans_table_lookup( config->trans_table , init_transform_name); - else - config->init_transform = NULL; -} - - -static void field_config_set_output_transform( field_config_type * config , const char * __output_transform_name ) { - const char * output_transform_name = NULL; - if (field_trans_table_has_key( config->trans_table , __output_transform_name)) - output_transform_name = __output_transform_name; - else if (__output_transform_name) { - fprintf(stderr , "Sorry: the field transformation function:%s is not recognized \n\n",__output_transform_name); - field_trans_table_fprintf(config->trans_table , stderr); - util_exit("Exiting ... \n"); - } - - config->output_transform_name = util_realloc_string_copy( config->output_transform_name , output_transform_name ); - if (output_transform_name != NULL) - config->output_transform = field_trans_table_lookup( config->trans_table , output_transform_name); - else - config->output_transform = NULL; -} - - -static void field_config_set_input_transform( field_config_type * config , const char * __input_transform_name ) { - const char * input_transform_name = NULL; - if (field_trans_table_has_key( config->trans_table , __input_transform_name)) - input_transform_name = __input_transform_name; - else if (__input_transform_name != NULL) { - fprintf(stderr , "Sorry: the field transformation function:%s is not recognized \n\n",__input_transform_name); - field_trans_table_fprintf(config->trans_table , stderr); - util_exit("Exiting ... \n"); - } - - - config->input_transform_name = util_realloc_string_copy( config->input_transform_name , input_transform_name ); - if (input_transform_name != NULL) - config->input_transform = field_trans_table_lookup( config->trans_table , input_transform_name); - else - config->input_transform = NULL; -} - - - -void field_config_update_state_field( field_config_type * config, int truncation, double min_value , double max_value) { - field_config_set_truncation( config ,truncation , min_value , max_value ); - config->type = ECLIPSE_RESTART; - - /* Setting all the defaults for state_fields, i.e. PRESSURE / SGAS / SWAT ... */ - config->import_format = ECL_FILE; - config->export_format = ECL_FILE; - - field_config_set_output_transform( config , NULL ); - field_config_set_input_transform( config , NULL ); - field_config_set_init_transform( config , NULL ); -} - - - - -void field_config_update_parameter_field( field_config_type * config , int truncation, double min_value , double max_value, - field_file_format_type export_format , /* This can be guessed with the field_config_default_export_format( ecl_file ) function. */ - const char * init_transform , const char * output_transform ) { - field_config_set_truncation( config , truncation , min_value , max_value ); - config->type = ECLIPSE_PARAMETER; - - config->export_format = export_format; - config->import_format = UNDEFINED_FORMAT; /* Guess from filename when loading. */ - - config->input_transform = NULL; - - field_config_set_input_transform( config , NULL ); - field_config_set_init_transform( config , init_transform ); - field_config_set_output_transform( config , output_transform ); -} - - -void field_config_update_general_field( field_config_type * config , int truncation, double min_value , double max_value, - field_file_format_type export_format , /* This can be guessed with the field_config_default_export_format( ecl_file ) function. */ - const char * init_transform , - const char * input_transform , - const char * output_transform ) { - field_config_set_truncation( config , truncation , min_value , max_value ); - config->type = GENERAL; - - config->export_format = export_format; - config->import_format = UNDEFINED_FORMAT; /* Guess from filename when loading. */ - - field_config_set_input_transform( config , input_transform ); - field_config_set_init_transform( config , init_transform ); - field_config_set_output_transform( config , output_transform ); -} - - -/** - Requirements: - - ECLIPSE_PARAMETER: export_format != UNDEFINED_FORMAT - - ECLIPSE_RESTART : Validation can be finalized at the enkf_config_node level. - - GENERAL : export_format != UNDEFINED_FORMAT -*/ - -bool field_config_is_valid( const field_config_type * field_config ) { - bool valid = true; - - switch( field_config->type ) { - case ECLIPSE_PARAMETER: - if (field_config->export_format == UNDEFINED_FORMAT) - valid = false; - break; - case ECLIPSE_RESTART: - break; - case GENERAL: - if (field_config->export_format == UNDEFINED_FORMAT) - valid = false; - break; - default: - util_abort("%s: internal fuckup \n",__func__); - } - return valid; - -} - - -field_type_enum field_config_get_type( const field_config_type * config) { - return config->type; -} - - -/* - Observe that the indices are zero-based, in contrast to those used - by eclipse which are based on one. - - This function will return an index in the interval: [0...nactive), - and -1 if i,j,k correspond to an inactive cell. -*/ - - -inline int field_config_active_index(const field_config_type * config , int i , int j , int k) { - return ecl_grid_get_active_index3( config->grid , i,j,k); -} - -inline int field_config_global_index(const field_config_type * config, int i, int j, int k) { - return ecl_grid_get_global_index3( config->grid , i,j,k); -} - - -/** - This function checks that i,j,k are in the intervals [0..nx), - [0..ny) and [0..nz). It does *NOT* check if the corresponding - index is active. -*/ - -bool field_config_ijk_valid(const field_config_type * config , int i , int j , int k) { - return ecl_grid_ijk_valid(config->grid , i,j,k); -} - - -/** - This function checks that i,j,k are in the intervals [0..nx), - [0..ny) and [0..nz) AND that the corresponding cell is active. If - the function returns false it is impossible to differentiate - between (i,j,k) values which are out of bounds and an inactive - cell. -*/ - -bool field_config_ijk_active(const field_config_type * config , int i , int j , int k) { - if (ecl_grid_ijk_valid(config->grid , i,j,k)) { - int active_index = ecl_grid_get_active_index3( config->grid , i , j , k); - - if (active_index >= 0) - return true; - else - return false; - } else - return false; -} - - - - -void field_config_get_ijk( const field_config_type * config , int active_index , int *i , int * j , int * k) { - ecl_grid_get_ijk1A( config->grid , active_index , i,j,k); -} - - -bool field_config_write_compressed(const field_config_type * config) { return config->write_compressed; } - - - -void field_config_set_truncation(field_config_type * config , int truncation, double min_value, double max_value) { - config->truncation = truncation; - config->min_value = min_value; - config->max_value = max_value; -} - - - - -int field_config_get_truncation_mode(const field_config_type * config ) { - return config->truncation; -} - -double field_config_get_truncation_min( const field_config_type * config ) { - return config->min_value; -} - -double field_config_get_truncation_max( const field_config_type * config ) { - return config->max_value; -} - - - -void field_config_free(field_config_type * config) { - util_safe_free(config->ecl_kw_name); - util_safe_free(config->input_transform_name); - util_safe_free(config->output_transform_name); - util_safe_free(config->init_transform_name); - if ((config->private_grid) && (config->grid != NULL)) ecl_grid_free( config->grid ); - free(config); -} - - - -int field_config_get_volume(const field_config_type * config) { - return config->nx * config->ny * config->nz; -} - - - -rms_type_enum field_config_get_rms_type(const field_config_type * config) { - return rms_util_convert_ecl_type(config->internal_ecl_type); -} - - - -ecl_type_enum field_config_get_ecl_type(const field_config_type * config) { - return config->internal_ecl_type; -} - - - -int field_config_get_data_size_from_grid(const field_config_type * config) { - return config->keep_inactive_cells ? ecl_grid_get_global_size(config->grid) : ecl_grid_get_active_size(config->grid); -} - -int field_config_get_byte_size(const field_config_type * config) { - int num_cells = field_config_get_data_size_from_grid(config); - return num_cells * config->sizeof_ctype; -} - - -int field_config_get_sizeof_ctype(const field_config_type * config) { return config->sizeof_ctype; } - - - -/** - Returns true / false whether a cell is active. -*/ -bool field_config_active_cell(const field_config_type * config , int i , int j , int k) { - int active_index = field_config_active_index(config , i,j,k); - if (active_index >= 0) - return true; - else - return false; -} - - - - void field_config_get_dims(const field_config_type * config , int *nx , int *ny , int *nz) { - *nx = config->nx; - *ny = config->ny; - *nz = config->nz; -} - - -int field_config_get_nx(const field_config_type * config ) { - return config->nx; -} - -int field_config_get_ny(const field_config_type * config ) { - return config->ny; -} - -int field_config_get_nz(const field_config_type * config ) { - return config->nz; -} - - - - - -/** - This function reads a string with i,j,k from the user. All - characters in the constant sep_set are allowed to separate the - integers. The function will loop until: - - * Three integers have been succesfully parsed. - * All numbers are in the (1-nx,1-ny,1-nz) intervals. - * IFF active_only - only active cells wll be allowed. - - i,j,k and global_index are returned by reference. All pointers can - be NULL, if you are not interested. An invald global_index is - returned as -1 (if active_only == false). - - Observe that the user is expected to enter numbers in the interval - [1..nx],[1..ny],[1..nz], but internaly they are immediately - converted to zero offset. -*/ - - -void field_config_scanf_ijk(const field_config_type * config , bool active_only , const char * _prompt , int prompt_len , int *_i , int *_j , int *_k , int * _global_index) { - const char * sep_set = " ,.:"; - char * prompt = util_alloc_sprintf("%s (%d,%d,%d)" , _prompt , config->nx , config->ny , config->nz); - bool OK; - int i,j,k,global_index; - global_index = -1; /* Keep the compiler happy. */ - - do { - char *input; - const char *current_ptr; - util_printf_prompt(prompt , prompt_len , '=' , "=> "); - input = util_alloc_stdin_line(); - - - i = -1; - j = -1; - k = -1; - - OK = true; - current_ptr = input; - current_ptr = util_parse_int(current_ptr , &i , &OK); - current_ptr = util_skip_sep(current_ptr , sep_set , &OK); - current_ptr = util_parse_int(current_ptr , &j , &OK); - current_ptr = util_skip_sep(current_ptr , sep_set , &OK); - current_ptr = util_parse_int(current_ptr , &k , &OK); - if (OK) - if (current_ptr[0] != '\0') OK = false; /* There was something more at the end */ - - /* Now we have three valid integers. */ - - if (OK) { - if (i <= 0 || i > config->nx) OK = false; - if (j <= 0 || j > config->ny) OK = false; - if (k <= 0 || k > config->nz) OK = false; - i--; j--; k--; - } - /* Now we have three integers in the right interval. */ - - - if (OK) { - global_index = field_config_active_index(config , i,j,k); - if (active_only) { - if (global_index < 0) { - OK = false; - printf("Sorry the point: (%d,%d,%d) corresponds to an inactive cell\n" , i + 1 , j+ 1 , k + 1); - } - } - } - free(input); - } while (!OK); - - if (_i != NULL) *_i = i; - if (_j != NULL) *_j = j; - if (_k != NULL) *_k = k; - if (_global_index != NULL) *_global_index = global_index; - - free(prompt); -} - - - - -/** - The field_config and field objects are mainly written for use in - the enkf application. In that setting a field instance is *NOT* - allowed to write on it's field_config object. - - However, when used in a stand-alone application, i.e. in the - field_convert program, it is desirable for the field object to be - allowed to write to / update the field_config object. In an attempt - to make this reasonably safe you must first call - field_config_enkf_OFF() to signal that you know what you are doing. - - After you have called field_config_enkf_OFF() you can subsequently - call field_config_set_key() to change the key of the field_config - object. This will typically be interesting when an unknown file is - loaded. - - Currently only the roff loader supports set operations on the - key. Also it is essential to observe that this will break **HARD** - is the file contains several parameters - so maybe this whole thing - is stupid? -*/ - - -void field_config_set_key(field_config_type * config , const char *key) { - if (config->__enkf_mode) - util_abort("%s: internal error - must call field_config_enkf_OFF() prior to calling: %s()\n",__func__ , __func__); - /* - Should be locked to protect against concurrent access. - */ - config->ecl_kw_name = util_realloc_string_copy(config->ecl_kw_name , key); -} - -const char * field_config_get_key(const field_config_type * field_config) { - return field_config->ecl_kw_name; -} - -bool field_config_keep_inactive_cells(const field_config_type * config) { - return config->keep_inactive_cells; -} - -void field_config_enkf_OFF(field_config_type * config) { - if (config->__enkf_mode) - fprintf(stderr , "** Warning: turning off EnKF mode for field:%s - you better know what you are doing! **\n",config->ecl_kw_name); - config->__enkf_mode = false; -} - - -bool field_config_enkf_mode(const field_config_type * config) { return config->__enkf_mode; } - - -field_func_type * field_config_get_output_transform(const field_config_type * config) { - return config->output_transform; -} - -field_func_type * field_config_get_input_transform(const field_config_type * config) { - return config->input_transform; -} - -field_func_type * field_config_get_init_transform(const field_config_type * config) { - return config->init_transform; -} - - -/* - This function asserts that a unary function can be applied - to the field - i.e. that the underlying data_type is ecl_float or ecl_double. -*/ -void field_config_assert_unary( const field_config_type * field_config , const char * caller) { - const ecl_type_enum ecl_type = field_config_get_ecl_type(field_config); - if (ecl_type == ECL_FLOAT_TYPE || ecl_type == ECL_DOUBLE_TYPE) - return; - else - util_abort("%s: error in:%s unary functions can only be applied on fields of type ecl_float / ecl_double \n",__func__ , caller); -} - - -/* - Asserts that two fields can be combined in a binary operation. -*/ -void field_config_assert_binary( const field_config_type * config1 , const field_config_type * config2 , const char * caller) { - field_config_assert_unary(config1 , caller); - const ecl_type_enum ecl_type1 = config1->internal_ecl_type; - const ecl_type_enum ecl_type2 = config2->internal_ecl_type; - const int size1 = config1->data_size; - const int size2 = config2->data_size; - - if ((ecl_type1 == ecl_type2) && (size1 == size2)) - return; - else - util_abort("%s: fields not equal enough - failure in:%s \n",__func__ , caller); -} - - - - - - -/** - Parses a string of the type "1,5,6", and returns the indices i,j,k - by reference. The return value of the function as a whole is - whether the string constitutes a valid cell: - - 0: All is OK. - 1: The string could not pe parsed to three valid integers. - 2: ijk are not in the grid. - 3: ijk correspond to an inactive cell. - - In cases 2 & 3 the i,j,k are valid (in the string-parsing sense). - The input string is assumed to have offset one, and the return - values (by reference) are offset zero. -*/ - - -bool field_config_parse_user_key__( const char * index_key , int *i , int *j , int *k) { - int length; - { - int_vector_type * indices = string_util_alloc_value_list( index_key ); - length = int_vector_size( indices ); - - if (length == 3) { - *i = int_vector_iget( indices , 0) - 1; - *j = int_vector_iget( indices , 1) - 1; - *k = int_vector_iget( indices , 2) - 1; - } - - int_vector_free( indices ); - } - if (length == 3) - return true; - else - return false; -} - - - -int field_config_parse_user_key(const field_config_type * config, const char * index_key , int *i , int *j , int *k) { - int return_value = 0; - - if (field_config_parse_user_key__( index_key , i , j , k)) { - if(field_config_ijk_valid(config, *i, *j, *k)) { - int active_index = field_config_active_index(config , *i,*j,*k); - if (active_index < 0) - return_value = 3; /* ijk corresponds to an inactive cell. */ - } else - return_value = 2; /* ijk is outside the grid. */ - } else - return_value = 1; /* Could not be parsed to three integers. */ - - return return_value; -} - - - -ecl_grid_type * field_config_get_grid(const field_config_type * config) { return config->grid; } - - -void field_config_fprintf_config( const field_config_type * config , - enkf_var_type var_type , - const char * outfile , - const char * infile , - const char * min_std_file , - FILE * stream) { - - if (var_type == PARAMETER) { - fprintf( stream , CONFIG_VALUE_FORMAT , PARAMETER_KEY ); - fprintf( stream , CONFIG_VALUE_FORMAT , outfile ); - } else { - if (true) - /* This is an ECLIPSE dynamic field. */ - fprintf( stream , CONFIG_VALUE_FORMAT , DYNAMIC_KEY ); - else { - /* Dynamic fields which are not ECLIPSE solution fields - not really very well supported. */ - fprintf( stream , CONFIG_VALUE_FORMAT , GENERAL_KEY ); - fprintf( stream , CONFIG_VALUE_FORMAT , outfile ); - fprintf( stream , CONFIG_VALUE_FORMAT , infile ); - } - } - - if (config->init_transform != NULL) - fprintf( stream , CONFIG_OPTION_FORMAT , INIT_TRANSFORM_KEY , config->init_transform_name ); - - if (config->output_transform != NULL) - fprintf( stream , CONFIG_OPTION_FORMAT , OUTPUT_TRANSFORM_KEY , config->output_transform_name ); - - if (config->input_transform != NULL) - fprintf( stream , CONFIG_OPTION_FORMAT , INPUT_TRANSFORM_KEY , config->input_transform_name ); - - if (min_std_file != NULL) - fprintf( stream , CONFIG_OPTION_FORMAT , MIN_STD_KEY , min_std_file ); - - if (config->truncation & TRUNCATE_MIN) - fprintf( stream , CONFIG_FLOAT_OPTION_FORMAT , MIN_KEY , config->min_value ); - - if (config->truncation & TRUNCATE_MAX) - fprintf( stream , CONFIG_FLOAT_OPTION_FORMAT , MAX_KEY , config->max_value ); -} - - -/*****************************************************************/ -UTIL_SAFE_CAST_FUNCTION(field_config , FIELD_CONFIG_ID) -UTIL_SAFE_CAST_FUNCTION_CONST(field_config , FIELD_CONFIG_ID) -CONFIG_GET_ECL_KW_NAME(field); -GET_DATA_SIZE(field) -VOID_GET_DATA_SIZE(field) -VOID_FREE(field_config) - - diff --git a/ThirdParty/Ert/libenkf/src/field_convert.c b/ThirdParty/Ert/libenkf/src/field_convert.c deleted file mode 100644 index 6530ea9008..0000000000 --- a/ThirdParty/Ert/libenkf/src/field_convert.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'field_convert.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - - -void usage(const char * cmd) { - printf("%s: GRID_FILE OUTPATH field1 field2 field3 ....\n",cmd); - exit(1); -} - - -int main(int argc , char ** argv) { - if (argc < 4) usage(argv[0]); - { - const char * grid_file = argv[1]; - const char * out_path = argv[2]; - const char ** file_list = (const char **) &argv[3]; - int num_files = argc - 3; - int ifile; - field_file_format_type file_type; - - ecl_grid_type * ecl_grid = ecl_grid_alloc(grid_file , true); - field_config_type *field_config = field_config_alloc_dynamic("XX" , NULL , NULL , ecl_grid); - field_type * field = field_alloc(field_config); - field_config_enkf_OFF(field_config); - - util_make_path(out_path); - file_type = field_config_manual_file_type("Export files to type: " , false); - printf("num_files:%d \n",num_files); - for (ifile = 0; ifile < num_files; ifile++) { - char * base_name; - char * target_file; - util_alloc_file_components(file_list[ifile] , NULL , &base_name , NULL); - target_file = util_alloc_filename(out_path , base_name , field_config_default_extension(file_type , true)); - field_fload(field , file_list[ifile] , true); - printf("Converting: %s -> %s \n",file_list[ifile] , target_file); - field_export(field , target_file , file_type); - free(target_file); - free(base_name); - } - - - field_free(field); - field_config_free(field_config); - ecl_grid_free(ecl_grid); - } - - -} diff --git a/ThirdParty/Ert/libenkf/src/field_test.c b/ThirdParty/Ert/libenkf/src/field_test.c deleted file mode 100644 index 93fca096c8..0000000000 --- a/ThirdParty/Ert/libenkf/src/field_test.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'field_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - - - -int main (int argc , char **argv) { - const char * config_file = "../../librms/src/Testing/PERMX_%d"; - const char *EGRID_file = "../../librms/src/Testing/GRANE.EGRID"; - int nx , ny , nz , active_size; - - field_config_type * field_config; - field_type * field1 , *field2; - - ecl_grid_type * ecl_grid = ecl_grid_alloc(EGRID_file , true); - ecl_grid_get_dims(ecl_grid , &nx , &ny , &nz , &active_size); - - - field_config = field_config_alloc_parameter("PERMX" , nx , ny , nz , active_size , ecl_grid_get_index_map_ref(ecl_grid) , 0 , load_unique , 1 , (const char **) &config_file); - field1 = field_alloc(field_config); - field2 = field_alloc(field_config); - - field_fload(field1 , "../../librms/src/Testing/PERMX_1" , true); - field_ROFF_export(field1 , "Testing/PERMX_1"); - - field_fload(field2 , "Testing/PERMX_1" , true); - field_ROFF_export(field2 , "Testing/PERMX_2"); - - if (field_cmp(field1 , field2)) - printf("EQUAL\n"); - else - printf("DIFFERENT\n"); - - - field_config_free(field_config); - ecl_grid_free(ecl_grid); -} diff --git a/ThirdParty/Ert/libenkf/src/field_trans.c b/ThirdParty/Ert/libenkf/src/field_trans.c deleted file mode 100644 index 0ce78f84ec..0000000000 --- a/ThirdParty/Ert/libenkf/src/field_trans.c +++ /dev/null @@ -1,289 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'field_trans.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -/* - This file implements a number of functions used for init and output - transformations of fields. The prototype for these functions is very - simple: "one float in - one float out". - - It is mainly implemented in this file, so that it will be easy to - adde new transformation functions without diving into the the full - field / field_config complexity. - - Documentation on how to add a new transformation function is at the - bottom of the file. -*/ -#include -#include -#include - -#include -#include - -#include -/*****************************************************************/ - -struct field_trans_table_struct { - bool case_sensitive; - hash_type * function_table; -}; - - - -typedef struct { - char * key; - char * description; - field_func_type * func; -} field_func_node_type; - -/*****************************************************************/ - -static field_func_node_type * field_func_node_alloc(const char * key , const char * description , field_func_type * func) { - field_func_node_type * node = util_malloc( sizeof * node ); - - node->key = util_alloc_string_copy( key ); - node->description = util_alloc_string_copy( description ); - node->func = func; - - return node; -} - - -static void field_func_node_free(field_func_node_type * node) { - free(node->key); - util_safe_free( node->description ); - free(node); -} - - -static void field_func_node_free__(void * node) { - field_func_node_free( (field_func_node_type *) node); -} - - -static void field_func_node_fprintf(const field_func_node_type * node , FILE * stream) { - if (node->description != NULL) - fprintf(stream , "%16s: %s \n",node->key , node->description); - else - fprintf(stream , "%16s: No description \n",node->key ); -} - - - - - - -/*****************************************************************/ - -void field_trans_table_add(field_trans_table_type * table , const char * _key , const char * description , field_func_type * func) { - char * key; - - if (table->case_sensitive) - key = util_alloc_string_copy( _key ); - else - key = util_alloc_strupr_copy( _key ); - - { - field_func_node_type * node = field_func_node_alloc( key , description , func ); - hash_insert_hash_owned_ref(table->function_table , key , node , field_func_node_free__); - } - free(key); -} - - -void field_trans_table_fprintf(const field_trans_table_type * table , FILE * stream) { - hash_iter_type * iter = hash_iter_alloc(table->function_table); - const char * key = hash_iter_get_next_key(iter); - fprintf(stream,"==========================================================================================\n"); - fprintf(stream,"Available transformations: \n"); - while (key != NULL) { - field_func_node_type * func_node = hash_get(table->function_table , key); - field_func_node_fprintf(func_node , stream); - key = hash_iter_get_next_key(iter); - } - fprintf(stream,"==========================================================================================\n"); - hash_iter_free(iter); -} - - - -/* - This function takes a key input, and returns a pointer to the - corresponding function. The function will fail if the key is not - recognized. -*/ - - -field_func_type * field_trans_table_lookup(field_trans_table_type * table , const char * _key) { - field_func_type * func; - char * key; - - if (table->case_sensitive) - key = util_alloc_string_copy(_key); - else - key = util_alloc_strupr_copy(_key); - - if (hash_has_key(table->function_table , key)) { - field_func_node_type * func_node = hash_get(table->function_table , key); - func = func_node->func; - } else { - fprintf(stderr , "Sorry: the field transformation function:%s is not recognized \n\n",key); - field_trans_table_fprintf(table , stderr); - util_exit("Exiting ... \n"); - func = NULL; /* Compiler shut up. */ - } - free( key ); - return func; -} - - -/** - Will return false if _key == NULL -*/ -bool field_trans_table_has_key(field_trans_table_type * table , const char * _key) { - bool has_key = false; - - if (_key != NULL) { - char * key; - if (table->case_sensitive) - key = util_alloc_string_copy(_key); - else - key = util_alloc_strupr_copy(_key); - - has_key = hash_has_key( table->function_table , key); - free(key); - } - - return has_key; -} - - -void field_trans_table_free(field_trans_table_type * table ) { - hash_free( table->function_table ); - free( table ); -} - - - - -/*****************************************************************/ -/*****************************************************************/ -/* Here comes the actual functions. To add a new function: */ -/* */ -/* 1. Write the function - as a float in - float out. */ -/* 2. Register the function in field_trans_table_alloc(). */ -/* */ -/*****************************************************************/ - -/*****************************************************************/ -/* Rubakumar specials: start */ -#define PERMX_MEAN 100 -#define PERMX_STD 1 - -#define PERMZ_MEAN 100 -#define PERMZ_STD 1 - -#define PORO_MEAN 100 -#define PORO_STD 1 - - -static float normalize(float x , float mean , float std) { - return (x - mean) / std; -} - -static float denormalize(float x , float mean , float std) { - return (x * std) + mean; -} - -static float normalize_permx(float x) { - return normalize(x , PERMX_MEAN , PERMX_STD); -} - -static float denormalize_permx(float x) { - return denormalize(x , PERMX_MEAN , PERMX_STD); -} - -static float normalize_permz(float x) { - return normalize(x , PERMZ_MEAN , PERMZ_STD); -} - -static float denormalize_permz(float x) { - return denormalize(x , PERMZ_MEAN , PERMZ_STD); -} - -static float normalize_poro(float x) { - return normalize(x , PORO_MEAN , PORO_STD); -} - -static float denormalize_poro(float x) { - return denormalize(x , PORO_MEAN , PORO_STD); -} - -/* Rubakumar specials: end */ -/*****************************************************************/ - - -static float field_trans_pow10(float x) { - return powf(10.0 , x); -} - - -static float trunc_pow10f(float x) { - return util_float_max(powf(10.0 , x) , 0.001); -} - -#define LN_SHIFT 0.0000001 -static float field_trans_ln0( float x ) { - return logf( x + LN_SHIFT ); -} - -static float field_trans_exp0( float x ) { - return expf( x ) - LN_SHIFT; -} -#undef LN_SHIFT - - - -field_trans_table_type * field_trans_table_alloc() { - field_trans_table_type * table = util_malloc( sizeof * table); - table->function_table = hash_alloc(); - field_trans_table_add( table , "POW10" , "This function will raise x to the power of 10: y = 10^x." , field_trans_pow10); - field_trans_table_add( table , "TRUNC_POW10" , "This function will raise x to the power of 10 - and truncate lower values at 0.001." , trunc_pow10f); - field_trans_table_add( table , "LOG" , "This function will take the NATURAL logarithm of x: y = ln(x)" , logf); - field_trans_table_add( table , "LN" , "This function will take the NATURAL logarithm of x: y = ln(x)" , logf); - field_trans_table_add( table , "LOG10" , "This function will take the log10 logarithm of x: y = log10(x)" , log10f); - field_trans_table_add( table , "EXP" , "This function will calculate y = exp(x) " , expf); - field_trans_table_add( table , "LN0" , "This function will calculate y = ln(x + 0.000001)" , field_trans_ln0); - field_trans_table_add( table , "EXP0" , "This function will calculate y = exp(x) - 0.000001" , field_trans_exp0); - - //----------------------------------------------------------------- - // Rubakumar specials: - field_trans_table_add( table , "NORMALIZE_PERMX" , "..." , normalize_permx); - field_trans_table_add( table , "DENORMALIZE_PERMX" , "..." , denormalize_permx); - - field_trans_table_add( table , "NORMALIZE_PERMZ" , "..." , normalize_permz); - field_trans_table_add( table , "DENORMALIZE_PERMZ" , "..." , denormalize_permz); - - field_trans_table_add( table , "NORMALIZE_PORO" , "..." , normalize_poro); - field_trans_table_add( table , "DENORMALIZE_PORO" , "..." , denormalize_poro); - //----------------------------------------------------------------- - - table->case_sensitive = false; - return table; -} - diff --git a/ThirdParty/Ert/libenkf/src/forward_load_context.c b/ThirdParty/Ert/libenkf/src/forward_load_context.c deleted file mode 100644 index 7ccf65892a..0000000000 --- a/ThirdParty/Ert/libenkf/src/forward_load_context.c +++ /dev/null @@ -1,269 +0,0 @@ -/* - Copyright (C) 2016 Statoil ASA, Norway. - - The file 'forward_load_context.c.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include -#include -#include - - -#define FORWARD_LOAD_CONTEXT_TYPE_ID 644239127 - -struct forward_load_context_struct { - UTIL_TYPE_ID_DECLARATION; - // Everyuthing can be NULL here ... - when created from gen_data. - - ecl_sum_type * ecl_sum; - ecl_file_type * restart_file; - const run_arg_type * run_arg; - char * eclbase; - const ecl_config_type * ecl_config; // Can be NULL - - int step1; - int step2; - stringlist_type * messages; // This is managed by external scope - can be NULL - - - /* The variables below are updated during the load process. */ - int load_step; - int load_result; -}; - -UTIL_IS_INSTANCE_FUNCTION( forward_load_context , FORWARD_LOAD_CONTEXT_TYPE_ID) - - - -static void forward_load_context_load_ecl_sum(forward_load_context_type * load_context) { - ecl_sum_type * summary = NULL; - - if (ecl_config_active( load_context->ecl_config )) { - const run_arg_type * run_arg = forward_load_context_get_run_arg(load_context); - const char * run_path = run_arg_get_runpath( run_arg ); - const char * eclbase = load_context->eclbase; - - const bool fmt_file = ecl_config_get_formatted(load_context->ecl_config); - char * header_file = ecl_util_alloc_exfilename(run_path , eclbase , ECL_SUMMARY_HEADER_FILE , fmt_file , -1); - char * unified_file = ecl_util_alloc_exfilename(run_path , eclbase , ECL_UNIFIED_SUMMARY_FILE , fmt_file , -1); - stringlist_type * data_files = stringlist_alloc_new(); - - /* Should we load from a unified summary file, or from several non-unified files? */ - if (unified_file != NULL) - /* Use unified file: */ - stringlist_append_ref( data_files , unified_file); - else { - /* Use several non unified files. */ - /* Bypassing the query to model_config_load_results() */ - int report_step = run_arg_get_load_start( run_arg ); - if (report_step == 0) - report_step++; // Ignore looking for the .S0000 summary file (it does not exist). - while (true) { - char * summary_file = ecl_util_alloc_exfilename(run_arg_get_runpath( run_arg ) , eclbase , ECL_SUMMARY_FILE , fmt_file , report_step); - - if (summary_file != NULL) - stringlist_append_owned_ref( data_files , summary_file); - else - /* - We stop the loading at first 'hole' in the series of summary files; - the internalize layer must report failure if we are missing data. - */ - break; - - report_step++; - } - } - - if ((header_file != NULL) && (stringlist_get_size(data_files) > 0)) { - summary = ecl_sum_fread_alloc(header_file , data_files , SUMMARY_KEY_JOIN_STRING ); - { - time_t end_time = ecl_config_get_end_date( load_context->ecl_config ); - if (end_time > 0) { - if (ecl_sum_get_end_time( summary ) < end_time) { - /* The summary vector was shorter than expected; we interpret this as - a simulation failure and discard the current summary instance. */ - - if (forward_load_context_accept_messages(load_context)) { - int end_day,end_month,end_year; - int sum_day,sum_month,sum_year; - - util_set_date_values_utc( end_time , &end_day , &end_month , &end_year ); - util_set_date_values_utc( ecl_sum_get_end_time( summary ) , &sum_day , &sum_month , &sum_year ); - { - char * msg = util_alloc_sprintf("Summary ended at %02d/%02d/%4d - expected at least END_DATE: %02d/%02d/%4d" , - sum_day , sum_month , sum_year , - end_day , end_month , end_year ); - forward_load_context_add_message( load_context , msg ); - free( msg ); - } - } - - } - ecl_sum_free( summary ); - summary = NULL; - } - } - } - stringlist_free( data_files ); - util_safe_free( header_file ); - util_safe_free( unified_file ); - } - - if (summary) - load_context->ecl_sum = summary; - else - forward_load_context_update_result(load_context, LOAD_FAILURE); -} - - - - -forward_load_context_type * forward_load_context_alloc( const run_arg_type * run_arg , bool load_summary , const ecl_config_type * ecl_config , const char * eclbase , stringlist_type * messages) { - forward_load_context_type * load_context = util_malloc( sizeof * load_context ); - UTIL_TYPE_ID_INIT( load_context , FORWARD_LOAD_CONTEXT_TYPE_ID ); - - load_context->ecl_sum = NULL; - load_context->restart_file = NULL; - load_context->run_arg = run_arg; - load_context->load_step = -1; // Invalid - must call forward_load_context_select_step() - load_context->load_result = 0; - load_context->messages = messages; - load_context->ecl_config = ecl_config; - load_context->eclbase = util_alloc_string_copy( eclbase ); - - if (load_summary) - forward_load_context_load_ecl_sum(load_context); - - return load_context; -} - - - -bool forward_load_context_accept_messages( const forward_load_context_type * load_context ) { - if (load_context->messages) - return true; - else - return false; -} - - -/* - The messages can be NULL; in which case the message is completely ignored. -*/ - -void forward_load_context_add_message( forward_load_context_type * load_context , const char * message ) { - if (load_context->messages) - stringlist_append_copy( load_context->messages , message ); -} - - -int forward_load_context_get_result( const forward_load_context_type * load_context ) { - return load_context->load_result; -} - -void forward_load_context_update_result( forward_load_context_type * load_context , int flags) { - load_context->load_result |= flags; -} - - -void forward_load_context_free( forward_load_context_type * load_context ) { - if (load_context->restart_file) - ecl_file_close( load_context->restart_file ); - - if (load_context->ecl_sum) - ecl_sum_free( load_context->ecl_sum ); - - util_safe_free( load_context->eclbase ); - free( load_context ); -} - -bool forward_load_context_load_restart_file( forward_load_context_type * load_context, int report_step) { - if (load_context->ecl_config) { - const bool unified = ecl_config_get_unified_restart( load_context->ecl_config ); - if (unified) - util_abort("%s: sorry - unified restart files are not supported \n",__func__); - - forward_load_context_select_step(load_context, report_step); - { - const bool fmt_file = ecl_config_get_formatted( load_context->ecl_config ); - char * filename = ecl_util_alloc_exfilename( run_arg_get_runpath(load_context->run_arg) , - load_context->eclbase, - ECL_RESTART_FILE , - fmt_file , - load_context->load_step ); - - if (load_context->restart_file) - ecl_file_close( load_context->restart_file ); - load_context->restart_file = NULL; - - if (filename) { - load_context->restart_file = ecl_file_open( filename , 0 ); - free(filename); - } - - if (load_context->restart_file) - return true; - else - return false; - } - } else { - util_abort("%s: internal error - tried to load restart with load_context with ecl_config==NULL \n",__func__); - return false; - } -} - - - - -const ecl_sum_type * forward_load_context_get_ecl_sum( const forward_load_context_type * load_context) { - return load_context->ecl_sum; -} - -const ecl_file_type * forward_load_context_get_restart_file( const forward_load_context_type * load_context) { - return load_context->restart_file; -} - -const run_arg_type * forward_load_context_get_run_arg( const forward_load_context_type * load_context ) { - return load_context->run_arg; -} - -const char * forward_load_context_get_run_path( const forward_load_context_type * load_context ) { - return run_arg_get_runpath( load_context->run_arg ); -} - - -enkf_fs_type * forward_load_context_get_result_fs( const forward_load_context_type * load_context ) { - return run_arg_get_result_fs( load_context->run_arg ); -} - - -void forward_load_context_select_step( forward_load_context_type * load_context , int report_step) { - load_context->load_step = report_step; -} - -int forward_load_context_get_load_step(const forward_load_context_type * load_context) { - if (load_context->load_step < 0) - util_abort("%s: this looks like an internal error - missing call to forward_load_context_select_step() \n",__func__); - - return load_context->load_step; -} - - - - diff --git a/ThirdParty/Ert/libenkf/src/fs_driver.c b/ThirdParty/Ert/libenkf/src/fs_driver.c deleted file mode 100644 index ed1c95aefd..0000000000 --- a/ThirdParty/Ert/libenkf/src/fs_driver.c +++ /dev/null @@ -1,162 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'fs_driver.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -#include -#include - -/* - The underlying base types (abstract - with no accompanying - implementation); these two type ID's are not exported outside this - file. They are not stored to disk, and only used in an attempt - yo verify run-time casts. -*/ -#define FS_DRIVER_ID 10 - - -/*****************************************************************/ -/* This fs driver implemenatition is common to both dynamic and - parameter info. */ - -void fs_driver_init(fs_driver_type * driver) { - driver->type_id = FS_DRIVER_ID; - - driver->load_node = NULL; - driver->save_node = NULL; - driver->has_node = NULL; - driver->unlink_node = NULL; - - driver->load_vector = NULL; - driver->save_vector = NULL; - driver->has_vector = NULL; - driver->unlink_vector = NULL; - - driver->free_driver = NULL; - driver->fsync_driver = NULL; -} - -void fs_driver_assert_cast(const fs_driver_type * driver) { - if (driver->type_id != FS_DRIVER_ID) - util_abort("%s: internal error - incorrect cast() - aborting \n" , __func__); -} - - -fs_driver_type * fs_driver_safe_cast(void * __driver) { - fs_driver_type * driver = (fs_driver_type *) __driver; - if (driver->type_id != FS_DRIVER_ID) - util_abort("%s: runtime cast failed. \n",__func__); - return driver; -} - -/*****************************************************************/ - - -void fs_driver_init_fstab( FILE * stream, fs_driver_impl driver_id) { - util_fwrite_long( FS_MAGIC_ID , stream ); - util_fwrite_int ( CURRENT_FS_VERSION , stream ); - util_fwrite_int ( driver_id , stream ); -} - - - -/** - Will open fstab stream and return it. The semantics with respect to - existing/not existnig fstab file depends on the value of the - @create parameter: - - @create = True: If the fstab file exists the function will return - NULL, otherwise it will return a stream opened for writing to the - fstab file. - - @create = False: If the fstab file exists the the function will - return a stream opened for reading of the fstab file, otherwise - it will return NULL. - -*/ - -char * fs_driver_alloc_fstab_file( const char * path ) { - return util_alloc_filename( path , "ert_fstab" , NULL); -} - - -FILE * fs_driver_open_fstab( const char * path , bool create) { - FILE * stream = NULL; - char * fstab_file = fs_driver_alloc_fstab_file( path ); - if (create) - util_make_path( path ); - - if (util_file_exists( fstab_file ) != create) { - if (create) - stream = util_fopen( fstab_file , "w"); - else - stream = util_fopen( fstab_file , "r"); - } - free( fstab_file ); - return stream; -} - - -void fs_driver_assert_magic( FILE * stream ) { - long fs_magic = util_fread_long( stream ); - if (fs_magic != FS_MAGIC_ID) - util_abort("%s: WTF - fstab magic marker incorrect \n",__func__); -} - - - -void fs_driver_assert_version( FILE * stream , const char * mount_point) { - int file_version = util_fread_int( stream ); - - if (file_version < MIN_SUPPORTED_FS_VERSION ) - util_exit("%s: The file system you are trying to access is created with a very old version of ert - sorry.\n",__func__); - - if (file_version > CURRENT_FS_VERSION) - util_exit("%s: The file system you are trying to access has been created with a newer version of ert - sorry.\n",__func__); - - if (file_version < CURRENT_FS_VERSION) { - if ((file_version == 105) && (CURRENT_FS_VERSION == 106)) - fprintf(stderr,"%s: The file system you are accessing has been written with an older version of ert - STATIC information ignored. \n",__func__); - else - util_exit("%s: The file system you are trying to access has been created with an old version of ert - sorry.\n",__func__); - } - - -} - - -fs_driver_impl fs_driver_fread_type( FILE * stream ) { - fs_driver_impl impl = util_fread_int( stream ); - return impl; -} - - -int fs_driver_fread_version( FILE * stream ) { - long fs_magic = util_fread_long( stream ); - if (fs_magic != FS_MAGIC_ID) - return -1; - else { - int file_version = util_fread_int( stream ); - return file_version; - } -} - - -/*****************************************************************/ - - diff --git a/ThirdParty/Ert/libenkf/src/fs_types.c b/ThirdParty/Ert/libenkf/src/fs_types.c deleted file mode 100644 index 454e726bc1..0000000000 --- a/ThirdParty/Ert/libenkf/src/fs_types.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'fs_types.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include - -#include - - - -fs_driver_impl fs_types_lookup_string_name(const char * driver_name) { - if (strcmp(driver_name , "PLAIN") == 0) - return PLAIN_DRIVER_ID; - else if (strcmp(driver_name , "BLOCK_FS") == 0) - return BLOCK_FS_DRIVER_ID; - else { - util_abort("%s: could not determine driver type for input:%s \n",__func__ , driver_name); - return INVALID_DRIVER_ID; - } -} - - - -const char * fs_types_get_driver_name(fs_driver_enum driver_type) { - switch( driver_type ) { - case(DRIVER_PARAMETER): - return "PARAMETER"; - break; - case(DRIVER_DYNAMIC_FORECAST): - return "FORECAST"; - break; - case(DRIVER_INDEX): - return "INDEX"; - break; - default: - util_abort("%s: driver_id:%d not recognized. \n",__func__ , driver_type ); - return NULL; - } -} - - -/* - The driver type DRIVER_STATIC has been removed completely as of - December 2015, but there will still be many mount map files with - this enum value around on disk. This function is a minor convenience - to handle that. - - The driver type DRIVER_DYNAMIC_ANALYZED was removed ~april 2016. -*/ - -bool fs_types_valid( fs_driver_enum driver_type) { - if ((driver_type == DRIVER_STATIC) || (driver_type == DRIVER_DYNAMIC_ANALYZED)) - return false; - else - return true; -} diff --git a/ThirdParty/Ert/libenkf/src/gen_common.c b/ThirdParty/Ert/libenkf/src/gen_common.c deleted file mode 100644 index f7a45852c7..0000000000 --- a/ThirdParty/Ert/libenkf/src/gen_common.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'gen_common.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include - -#include -#include - -#include -#include - -/** - This file implements some (very basic) functionality which is used - by both the gen_data and gen_obs objects. -*/ - - -void * gen_common_fscanf_alloc(const char * file , ecl_type_enum load_type , int * size) { - FILE * stream = util_fopen(file , "r"); - int sizeof_ctype = ecl_util_get_sizeof_ctype(load_type); - int buffer_elements = *size; - int current_size = 0; - int fscanf_return = 1; /* To keep the compiler happy .*/ - void * buffer; - - if (buffer_elements == 0) - buffer_elements = 100; - - buffer = util_calloc( buffer_elements , sizeof_ctype ); - { - do { - if (load_type == ECL_FLOAT_TYPE) { - float * float_buffer = (float *) buffer; - fscanf_return = fscanf(stream , "%g" , &float_buffer[current_size]); - } else if (load_type == ECL_DOUBLE_TYPE) { - double * double_buffer = (double *) buffer; - fscanf_return = fscanf(stream , "%lg" , &double_buffer[current_size]); - } else if (load_type == ECL_INT_TYPE) { - int * int_buffer = (int *) buffer; - fscanf_return = fscanf(stream , "%d" , &int_buffer[current_size]); - } else - util_abort("%s: god dammit - internal error \n",__func__); - - if (fscanf_return == 1) - current_size += 1; - - if (current_size == buffer_elements) { - buffer_elements *= 2; - buffer = util_realloc( buffer , buffer_elements * sizeof_ctype ); - } - } while (fscanf_return == 1); - } - if (fscanf_return != EOF) - util_abort("%s: scanning of %s terminated before EOF was reached -- fix your file.\n" , __func__ , file); - - fclose(stream); - *size = current_size; - return buffer; -} - - - -void * gen_common_fread_alloc(const char * file , ecl_type_enum load_type , int * size) { - const int max_read_size = 100000; - FILE * stream = util_fopen(file , "r"); - int sizeof_ctype = ecl_util_get_sizeof_ctype(load_type); - int read_size = 4096; /* Shot in the wild */ - int current_size = 0; - int buffer_elements; - int fread_return; - char * buffer; - - - buffer_elements = read_size; - buffer = util_calloc( buffer_elements , sizeof_ctype ); - { - do { - fread_return = fread( &buffer[ current_size * sizeof_ctype] , sizeof_ctype , read_size , stream); - current_size += fread_return; - - if (!feof(stream)) { - /* Allocate more elements. */ - if (current_size == buffer_elements) { - read_size *= 2; - read_size = util_int_min(read_size , max_read_size); - buffer_elements += read_size; - buffer = util_realloc( buffer , buffer_elements * sizeof_ctype ); - } else - util_abort("%s: internal error ?? \n",__func__); - } - } while (!feof(stream)); - } - *size = current_size; - return buffer; -} - - -/* - If the load_format is binary_float or binary_double, the ASCII_type - is *NOT* consulted. The load_type is set to float/double depending - on what was actually used when the data was loaded. -*/ - -void * gen_common_fload_alloc(const char * file , gen_data_file_format_type load_format , ecl_type_enum ASCII_type , ecl_type_enum * load_type , int * size) { - void * buffer = NULL; - - if (load_format == ASCII) { - *load_type = ASCII_type; - buffer = gen_common_fscanf_alloc(file , ASCII_type , size); - } else if (load_format == BINARY_FLOAT) { - *load_type = ECL_FLOAT_TYPE; - buffer = gen_common_fread_alloc(file , ECL_FLOAT_TYPE , size); - } else if (load_format == BINARY_DOUBLE) { - *load_type = ECL_DOUBLE_TYPE; - buffer = gen_common_fread_alloc(file , ECL_DOUBLE_TYPE , size); - } else - util_abort("%s: trying to load with unsupported format:%s... \n" , load_format); - - return buffer; -} diff --git a/ThirdParty/Ert/libenkf/src/gen_data.c b/ThirdParty/Ert/libenkf/src/gen_data.c deleted file mode 100644 index 7e57b9aa22..0000000000 --- a/ThirdParty/Ert/libenkf/src/gen_data.c +++ /dev/null @@ -1,745 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'gen_data.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -/** - The file implements a general data type which can be used to update - arbitrary data which the EnKF system has *ABSOLUTELY NO IDEA* of - how is organised; how it should be used in the forward model and so - on. Similarly to the field objects, the gen_data objects can be - treated both as parameters and as dynamic data. - - Whether the forward_load function should be called (i.e. it is dynamic - data) is determined at the enkf_node level, and no busissiness of - the gen_data implementation. -*/ - - - - -struct gen_data_struct { - int __type_id; - gen_data_config_type * config; /* Thin config object - mainly contains filename for remote load */ - char * data; /* Actual storage - will be casted to double or float on use. */ - int current_report_step; /* Need this to look up the correct size in the config object. */ - bool_vector_type * active_mask; /* Mask of active/not active - loaded from a "_active" file created by the forward model. Not used when used as parameter*/ -}; - - - -void gen_data_assert_size( gen_data_type * gen_data , int size , int report_step) { - gen_data_config_assert_size(gen_data->config , size , report_step); - gen_data->current_report_step = report_step; -} - -gen_data_config_type * gen_data_get_config(const gen_data_type * gen_data) { return gen_data->config; } - -int gen_data_get_size( const gen_data_type * gen_data ) { - return gen_data_config_get_data_size( gen_data->config , gen_data->current_report_step ); -} - -/** - It is a bug to call this before some function has set the size. -*/ -void gen_data_realloc_data(gen_data_type * gen_data) { - int byte_size = gen_data_config_get_byte_size(gen_data->config , gen_data->current_report_step ); - gen_data->data = util_realloc(gen_data->data , byte_size ); -} - - - -gen_data_type * gen_data_alloc(const gen_data_config_type * config) { - gen_data_type * gen_data = util_malloc(sizeof * gen_data); - gen_data->config = (gen_data_config_type *) config; - gen_data->data = NULL; - gen_data->__type_id = GEN_DATA; - gen_data->active_mask = bool_vector_alloc( 0 , true ); - gen_data->current_report_step = -1; /* God - if you ever read this .... */ - return gen_data; -} - - -void gen_data_copy(const gen_data_type * src , gen_data_type * target) { - if (src->config == target->config) { - target->current_report_step = src->current_report_step; - - if (src->data != NULL) { - int byte_size = gen_data_config_get_byte_size( src->config , src->current_report_step ); - target->data = util_realloc_copy(target->data , src->data , byte_size ); - } - } else - util_abort("%s: do not share config object \n",__func__); -} - - - -void gen_data_free(gen_data_type * gen_data) { - util_safe_free(gen_data->data); - bool_vector_free( gen_data->active_mask ); - free(gen_data); -} - - - - -/** - Observe that this function writes parameter size to disk, that is - special. The reason is that the config object does not know the - size (on allocation). - - The function currently writes an empty file (with only a report - step and a size == 0) in the case where it does not have data. This - is controlled by the value of the variable write_zero_size; if this - is changed to false some semantics in the load code must be - changed. -*/ - - -bool gen_data_write_to_buffer(const gen_data_type * gen_data , buffer_type * buffer , int report_step) { - const bool write_zero_size = true; /* true:ALWAYS write a file false:only write files with size > 0. */ - { - bool write = write_zero_size; - int size = gen_data_config_get_data_size( gen_data->config , report_step ); - if (size > 0) - write = true; - - if (write) { - int byte_size = gen_data_config_get_byte_size( gen_data->config , report_step ); - buffer_fwrite_int( buffer , GEN_DATA ); - buffer_fwrite_int( buffer , size ); - buffer_fwrite_int( buffer , report_step); /* Why the heck do I need to store this ???? It was a mistake ...*/ - - buffer_fwrite_compressed( buffer , gen_data->data , byte_size); - return true; - } else - return false; /* When false is returned - the (empty) file will be removed */ - } -} - - - -void gen_data_read_from_buffer(gen_data_type * gen_data , buffer_type * buffer , enkf_fs_type * fs, int report_step) { - int size; - enkf_util_assert_buffer_type(buffer , GEN_DATA); - size = buffer_fread_int(buffer); - buffer_fskip_int( buffer ); /* Skipping report_step from the buffer - was a mistake to store it - I think ... */ - { - size_t byte_size = size * ecl_util_get_sizeof_ctype( gen_data_config_get_internal_type ( gen_data->config )); - size_t compressed_size = buffer_get_remaining_size( buffer ); - gen_data->data = util_realloc( gen_data->data , byte_size ); - buffer_fread_compressed( buffer , compressed_size , gen_data->data , byte_size ); - } - gen_data_assert_size( gen_data , size , report_step ); - - if (gen_data_config_is_dynamic(gen_data->config)) { - gen_data_config_load_active( gen_data->config , fs, report_step , false ); - } -} - - - - - - - - -void gen_data_serialize(const gen_data_type * gen_data , node_id_type node_id , const active_list_type * active_list , matrix_type * A , int row_offset , int column) { - const gen_data_config_type *config = gen_data->config; - const int data_size = gen_data_config_get_data_size( gen_data->config , gen_data->current_report_step ); - ecl_type_enum ecl_type = gen_data_config_get_internal_type( config ); - - enkf_matrix_serialize( gen_data->data , data_size , ecl_type , active_list , A , row_offset , column ); -} - - -void gen_data_deserialize(gen_data_type * gen_data , node_id_type node_id , const active_list_type * active_list , const matrix_type * A , int row_offset , int column) { - { - const gen_data_config_type *config = gen_data->config; - const int data_size = gen_data_config_get_data_size( gen_data->config , gen_data->current_report_step ); - ecl_type_enum ecl_type = gen_data_config_get_internal_type(config); - - enkf_matrix_deserialize( gen_data->data , data_size , ecl_type , active_list , A , row_offset , column); - } -} - - - - -/* - This function sets the data field of the gen_data instance after the - data has been loaded from file. -*/ - -static void gen_data_set_data__(gen_data_type * gen_data , int size, const forward_load_context_type * load_context, ecl_type_enum load_type , const void * data) { - gen_data_assert_size(gen_data , size, forward_load_context_get_load_step( load_context )); - if (gen_data_config_is_dynamic( gen_data->config )) - gen_data_config_update_active( gen_data->config , load_context , gen_data->active_mask); - - gen_data_realloc_data(gen_data); - - if (size > 0) { - ecl_type_enum internal_type = gen_data_config_get_internal_type( gen_data->config ); - int byte_size = ecl_util_get_sizeof_ctype( internal_type ) * size ; - - if (load_type == internal_type) - memcpy(gen_data->data , data , byte_size ); - else { - if (load_type == ECL_FLOAT_TYPE) - util_float_to_double((double *) gen_data->data , data , size); - else - util_double_to_float((float *) gen_data->data , data , size); - } - } -} - - - -static bool gen_data_fload_active__(gen_data_type * gen_data, const char * filename, int size) { - /* - Look for file @filename_active - if that file is found it is - interpreted as a an active|inactive mask created by the forward - model. - - The file is assumed to be an ASCII file with integers, 0 - indicates inactive elements and 1 active elements. The file - should of course be as long as @filename. - - If the file is not found the gen_data->active_mask is set to - all-true (i.e. the default true value is invoked). - */ - bool file_exists = false; - if (gen_data_config_is_dynamic( gen_data->config )) { - bool_vector_reset( gen_data->active_mask ); - bool_vector_iset( gen_data->active_mask , size - 1, true ); - { - char * active_file = util_alloc_sprintf("%s_active" , filename ); - if (util_file_exists( active_file )) { - file_exists = true; - FILE * stream = util_fopen( active_file , "r"); - int active_int; - for (int index=0; index < size; index++) { - if (fscanf( stream , "%d" , &active_int) == 1) { - if (active_int == 1) - bool_vector_iset( gen_data->active_mask , index , true); - else if (active_int == 0) - bool_vector_iset( gen_data->active_mask , index , false); - else - util_abort("%s: error when loading active mask from:%s only 0 and 1 allowed \n",__func__ , active_file); - } else - util_abort("%s: error when loading active mask from:%s - file not long enough.\n",__func__ , active_file ); - } - fclose( stream ); - } - free( active_file ); - } - } - return file_exists; -} - - -/** - This functions loads data from file. Observe that there is *NO* - header information in this file - the size is determined by seeing - how much can be successfully loaded. - - The file is loaded with the gen_common_fload_alloc() function, and - can be in formatted ASCII or binary_float / binary_double. - - When the read is complete it is checked/verified with the config - object that this file was as long as the others we have loaded for - other members; it is perfectly OK for the file to not exist. In - which case a size of zero is set, for this report step. - - Return value is whether file was found or was empty - - might have to check this in calling scope. -*/ - -bool gen_data_fload_with_report_step( gen_data_type * gen_data , const char * filename , const forward_load_context_type * load_context) { - bool file_exists = util_file_exists(filename); - void * buffer = NULL; - ecl_type_enum load_type; - - if ( file_exists ) { - ecl_type_enum internal_type = gen_data_config_get_internal_type(gen_data->config); - gen_data_file_format_type input_format = gen_data_config_get_input_format( gen_data->config ); - int size = 0; - buffer = gen_common_fload_alloc( filename , input_format , internal_type , &load_type , &size); - if (size > 0) { - gen_data_fload_active__(gen_data, filename, size); - } else { - bool_vector_reset( gen_data->active_mask ); - } - gen_data_set_data__(gen_data , size , load_context , load_type , buffer ); - util_safe_free(buffer); - } - return file_exists; -} - - - - - -bool gen_data_forward_load(gen_data_type * gen_data , const char * ecl_file , const forward_load_context_type * load_context) { - return gen_data_fload_with_report_step( gen_data , ecl_file , load_context); -} - - - -/** - This function initializes the parameter. This is based on loading a - file. The name of the file is derived from a path_fmt instance - owned by the config object. Observe that there is *NO* header - information in this file. We just read floating point numbers until - we reach EOF. - - When the read is complete it is checked/verified with the config - object that this file was as long as the files we have loaded for - other members. - - If gen_data_config_alloc_initfile() returns NULL that means that - the gen_data instance does not have any init function - that is OK. -*/ - - - -bool gen_data_initialize(gen_data_type * gen_data , int iens , const char * init_file , rng_type * rng) { - bool ret = false; - if (init_file) { - forward_load_context_type * load_context = forward_load_context_alloc( NULL , false , NULL , NULL , NULL ); - - forward_load_context_select_step(load_context, 0); - if (!gen_data_fload_with_report_step(gen_data , init_file , load_context)) - util_abort("%s: could not find file:%s \n",__func__ , init_file); - ret = true; - - forward_load_context_free( load_context ); - } - return ret; -} - - - - -static void gen_data_ecl_write_ASCII(const gen_data_type * gen_data , const char * file , gen_data_file_format_type export_format) { - FILE * stream = util_fopen(file , "w"); - char * template_buffer; - int template_data_offset, template_buffer_size , template_data_skip; - - if (export_format == ASCII_TEMPLATE) { - gen_data_config_get_template_data( gen_data->config , &template_buffer , &template_data_offset , &template_buffer_size , &template_data_skip); - util_fwrite( template_buffer , 1 , template_data_offset , stream , __func__); - } - - { - ecl_type_enum internal_type = gen_data_config_get_internal_type(gen_data->config); - const int size = gen_data_config_get_data_size( gen_data->config , gen_data->current_report_step ); - int i; - if (internal_type == ECL_FLOAT_TYPE) { - float * float_data = (float *) gen_data->data; - for (i=0; i < size; i++) - fprintf(stream , "%g\n",float_data[i]); - } else if (internal_type == ECL_DOUBLE_TYPE) { - double * double_data = (double *) gen_data->data; - for (i=0; i < size; i++) - fprintf(stream , "%lg\n",double_data[i]); - } else - util_abort("%s: internal error - wrong type \n",__func__); - } - - if (export_format == ASCII_TEMPLATE) { - int new_offset = template_data_offset + template_data_skip; - util_fwrite( &template_buffer[new_offset] , 1 , template_buffer_size - new_offset , stream , __func__); - } - fclose(stream); -} - - - -static void gen_data_ecl_write_binary(const gen_data_type * gen_data , const char * file , ecl_type_enum export_type) { - FILE * stream = util_fopen(file , "w"); - int sizeof_ctype = ecl_util_get_sizeof_ctype( export_type ); - util_fwrite( gen_data->data , sizeof_ctype , gen_data_config_get_data_size( gen_data->config , gen_data->current_report_step) , stream , __func__); - fclose(stream); -} - - -gen_data_file_format_type gen_data_guess_export_type( const gen_data_type * gen_data ) { - gen_data_file_format_type export_type = gen_data_config_get_output_format( gen_data->config ); - if (export_type == GEN_DATA_UNDEFINED) - export_type = gen_data_config_get_input_format( gen_data->config ); - - if (export_type == GEN_DATA_UNDEFINED) - util_abort("%s: both input_format and output_format are set to UNDEFINED \n",__func__); - return export_type; -} - - -void gen_data_export(const gen_data_type * gen_data , const char * full_path , gen_data_file_format_type export_type , fortio_type * fortio) { - switch (export_type) { - case(ASCII): - gen_data_ecl_write_ASCII(gen_data , full_path , export_type); - break; - case(ASCII_TEMPLATE): - gen_data_ecl_write_ASCII(gen_data , full_path , export_type); - break; - case(BINARY_DOUBLE): - gen_data_ecl_write_binary(gen_data , full_path , ECL_DOUBLE_TYPE); - break; - case(BINARY_FLOAT): - gen_data_ecl_write_binary(gen_data , full_path , ECL_FLOAT_TYPE); - break; - default: - util_abort("%s: internal error - export type is not set.\n",__func__); - } -} - -/** - It is the enkf_node layer which knows whether the node actually - has any data to export. If it is not supposed to write data to the - forward model, i.e. it is of enkf_type 'dynamic_result' that is - signaled down here with eclfile == NULL. -*/ - - -void gen_data_ecl_write(const gen_data_type * gen_data , const char * run_path , const char * eclfile , void * filestream) { - if (eclfile != NULL) { - char * full_path = util_alloc_filename( run_path , eclfile , NULL); - - gen_data_file_format_type export_type = gen_data_config_get_output_format( gen_data->config ); - gen_data_export( gen_data , full_path , export_type , filestream ); - free( full_path ); - } -} - - -static void gen_data_assert_index(const gen_data_type * gen_data, int index) { - int current_size = gen_data_config_get_data_size( gen_data->config , gen_data->current_report_step ); - if ((index < 0) || (index >= current_size )) - util_abort("%s: index:%d invalid. Valid range: [0,%d) \n",__func__ , index , current_size); -} - - -double gen_data_iget_double(const gen_data_type * gen_data, int index) { - gen_data_assert_index(gen_data , index); - { - ecl_type_enum internal_type = gen_data_config_get_internal_type(gen_data->config); - if (internal_type == ECL_DOUBLE_TYPE) { - double * data = (double *) gen_data->data; - return data[index]; - } else { - float * data = (float *) gen_data->data; - return data[index]; - } - } -} - - - -void gen_data_iset_double(gen_data_type * gen_data, int index, double value) { - gen_data_assert_index(gen_data , index); - { - ecl_type_enum internal_type = gen_data_config_get_internal_type(gen_data->config); - if (internal_type == ECL_DOUBLE_TYPE) { - double * data = (double *) gen_data->data; - data[index] = value; - } else { - float * data = (float *) gen_data->data; - data[index] = value; - } - } -} - - - -void gen_data_export_data(const gen_data_type * gen_data , double_vector_type * export_data) { - ecl_type_enum internal_type = gen_data_config_get_internal_type(gen_data->config); - if (internal_type == ECL_DOUBLE_TYPE) - double_vector_memcpy_from_data( export_data , (const double *) gen_data->data , gen_data_get_size( gen_data )); - else { - double_vector_reset( export_data ); - float * float_data = (float *) gen_data->data; - for (int i = 0; i < gen_data_get_size( gen_data ); i++) - double_vector_iset( export_data , i , float_data[i]); - } -} - - - -/** - The filesystem will (currently) store gen_data instances which do - not hold any data. Therefor it will be quite common to enter this - function with an empty instance, we therefor just set valid => - false, and return silently in that case. -*/ - -bool gen_data_user_get(const gen_data_type * gen_data, const char * index_key, int report_step , double * value) -{ - int index; - *value = 0.0; - - if (index_key != NULL) { - if (util_sscanf_int(index_key , &index)) { - if (index < gen_data_config_get_data_size( gen_data->config , gen_data->current_report_step )) { - *value = gen_data_iget_double( gen_data , index ); - return true; - } - } - } - - return false; -} - - -const char * gen_data_get_key( const gen_data_type * gen_data) { - return gen_data_config_get_key( gen_data->config ); -} - - -void gen_data_clear( gen_data_type * gen_data ) { - const gen_data_config_type * config = gen_data->config; - ecl_type_enum internal_type = gen_data_config_get_internal_type( config ); - const int data_size = gen_data_config_get_data_size( gen_data->config , gen_data->current_report_step ); - - if (internal_type == ECL_FLOAT_TYPE) { - float * data = (float * ) gen_data->data; - for (int i = 0; i < data_size; i++) - data[i] = 0; - } else if (internal_type == ECL_DOUBLE_TYPE) { - double * data = (double * ) gen_data->data; - for (int i = 0; i < data_size; i++) - data[i] = 0; - } -} - - - -void gen_data_isqrt(gen_data_type * gen_data) { - const int data_size = gen_data_config_get_data_size( gen_data->config , gen_data->current_report_step ); - const ecl_type_enum internal_type = gen_data_config_get_internal_type(gen_data->config); - - if (internal_type == ECL_FLOAT_TYPE) { - float * data = (float *) gen_data->data; - for (int i=0; i < data_size; i++) - data[i] = sqrtf( data[i] ); - } else if (internal_type == ECL_DOUBLE_TYPE) { - double * data = (double *) gen_data->data; - for (int i=0; i < data_size; i++) - data[i] = sqrt( data[i] ); - } -} - - - - -void gen_data_iadd(gen_data_type * gen_data1, const gen_data_type * gen_data2) { - //gen_data_config_assert_binary(gen_data1->config , gen_data2->config , __func__); - { - const int data_size = gen_data_config_get_data_size( gen_data1->config , gen_data1->current_report_step ); - const ecl_type_enum internal_type = gen_data_config_get_internal_type(gen_data1->config); - int i; - - if (internal_type == ECL_FLOAT_TYPE) { - float * data1 = (float *) gen_data1->data; - const float * data2 = (const float *) gen_data2->data; - for (i = 0; i < data_size; i++) - data1[i] += data2[i]; - } else if (internal_type == ECL_DOUBLE_TYPE) { - double * data1 = (double *) gen_data1->data; - const double * data2 = (const double *) gen_data2->data; - for (i = 0; i < data_size; i++) { - data1[i] += data2[i]; - } - } - } -} - - -void gen_data_imul(gen_data_type * gen_data1, const gen_data_type * gen_data2) { - //gen_data_config_assert_binary(gen_data1->config , gen_data2->config , __func__); - { - const int data_size = gen_data_config_get_data_size( gen_data1->config , gen_data1->current_report_step ); - const ecl_type_enum internal_type = gen_data_config_get_internal_type(gen_data1->config); - int i; - - if (internal_type == ECL_FLOAT_TYPE) { - float * data1 = (float *) gen_data1->data; - const float * data2 = (const float *) gen_data2->data; - for (i = 0; i < data_size; i++) - data1[i] *= data2[i]; - } else if (internal_type == ECL_DOUBLE_TYPE) { - double * data1 = (double *) gen_data1->data; - const double * data2 = (const double *) gen_data2->data; - for (i = 0; i < data_size; i++) - data1[i] *= data2[i]; - } - } -} - - -void gen_data_iaddsqr(gen_data_type * gen_data1, const gen_data_type * gen_data2) { - //gen_data_config_assert_binary(gen_data1->config , gen_data2->config , __func__); - { - const int data_size = gen_data_config_get_data_size( gen_data1->config , gen_data1->current_report_step ); - const ecl_type_enum internal_type = gen_data_config_get_internal_type(gen_data1->config); - int i; - - if (internal_type == ECL_FLOAT_TYPE) { - float * data1 = (float *) gen_data1->data; - const float * data2 = (const float *) gen_data2->data; - for (i = 0; i < data_size; i++) - data1[i] += data2[i] * data2[i]; - } else if (internal_type == ECL_DOUBLE_TYPE) { - double * data1 = (double *) gen_data1->data; - const double * data2 = (const double *) gen_data2->data; - for (i = 0; i < data_size; i++) - data1[i] += data2[i] * data2[i]; - } - } -} - - -void gen_data_scale(gen_data_type * gen_data, double scale_factor) { - //gen_data_config_assert_unary(gen_data->config, __func__); - { - const int data_size = gen_data_config_get_data_size( gen_data->config , gen_data->current_report_step ); - const ecl_type_enum internal_type = gen_data_config_get_internal_type(gen_data->config); - int i; - - if (internal_type == ECL_FLOAT_TYPE) { - float * data = (float *) gen_data->data; - for (i = 0; i < data_size; i++) - data[i] *= scale_factor; - } else if (internal_type == ECL_DOUBLE_TYPE) { - double * data = (double *) gen_data->data; - for (i = 0; i < data_size; i++) - data[i] *= scale_factor; - } - } -} - - -const bool_vector_type * gen_data_get_forward_mask( const gen_data_type * gen_data ) { - return gen_data_config_get_active_mask( gen_data->config ); -} - -void gen_data_copy_to_double_vector(const gen_data_type * gen_data , double_vector_type * vector){ - const ecl_type_enum internal_type = gen_data_config_get_internal_type(gen_data->config); - int size = gen_data_get_size( gen_data ); - if (internal_type == ECL_FLOAT_TYPE) { - float * data = (float *) gen_data->data; - double_vector_reset(vector); - for (int i = 0; i < size; i++){ - double_vector_append(vector , data[i]); - } - } else if (internal_type == ECL_DOUBLE_TYPE) { - double * data = (double *) gen_data->data; - double_vector_memcpy_from_data( vector , data , size ); - } - - -} - -#define INFLATE(inf,std,min) \ -{ \ - for (int i=0; i < data_size; i++) { \ - if (std_data[i] > 0) \ - inflation_data[i] = util_float_max( 1.0 , min_std_data[i] / std_data[i]); \ - else \ - inflation_data[i] = 1.0; \ - } \ -} - - -/** - If the size changes during the simulation this will go 100% belly - up. -*/ - -void gen_data_set_inflation(gen_data_type * inflation , const gen_data_type * std , const gen_data_type * min_std) { - const gen_data_config_type * config = inflation->config; - ecl_type_enum ecl_type = gen_data_config_get_internal_type( config ); - const int data_size = gen_data_config_get_data_size( std->config , std->current_report_step ); - - if (ecl_type == ECL_FLOAT_TYPE) { - float * inflation_data = (float *) inflation->data; - const float * std_data = (const float *) std->data; - const float * min_std_data = (const float *) min_std->data; - - INFLATE(inflation_data , std_data , min_std_data ); - - } else { - double * inflation_data = (double *) inflation->data; - const double * std_data = (const double *) std->data; - const double * min_std_data = (const double *) min_std->data; - - INFLATE(inflation_data , std_data , min_std_data ); - } -} -#undef INFLATE - - -/******************************************************************/ -/* Anonumously generated functions used by the enkf_node object */ -/******************************************************************/ -UTIL_SAFE_CAST_FUNCTION_CONST(gen_data , GEN_DATA) -UTIL_SAFE_CAST_FUNCTION(gen_data , GEN_DATA) -VOID_USER_GET(gen_data) -VOID_ALLOC(gen_data) -VOID_FREE(gen_data) -VOID_COPY (gen_data) -VOID_INITIALIZE(gen_data) -VOID_ECL_WRITE(gen_data) -VOID_FORWARD_LOAD(gen_data) -VOID_READ_FROM_BUFFER(gen_data); -VOID_WRITE_TO_BUFFER(gen_data); -VOID_SERIALIZE(gen_data) -VOID_DESERIALIZE(gen_data) -VOID_SET_INFLATION(gen_data) -VOID_CLEAR(gen_data) -VOID_SCALE(gen_data) -VOID_IMUL(gen_data) -VOID_IADD(gen_data) -VOID_IADDSQR(gen_data) -VOID_ISQRT(gen_data) diff --git a/ThirdParty/Ert/libenkf/src/gen_data_config.c b/ThirdParty/Ert/libenkf/src/gen_data_config.c deleted file mode 100644 index a37139a78b..0000000000 --- a/ThirdParty/Ert/libenkf/src/gen_data_config.c +++ /dev/null @@ -1,653 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'gen_data_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -/** - About deactivating by the forward model - --------------------------------------- - - For the gen_data instances the forward model has the capability to - deactivate elements in a gen_data vector. This is implemented in - the function gen_data_ecl_load which will look for a file with - extension "_data" and then activate / deactivate elements - accordingly. -*/ - - - - -#define GEN_DATA_CONFIG_ID 90051 -struct gen_data_config_struct { - UTIL_TYPE_ID_DECLARATION; - char * key; /* The key this gen_data instance is known under - needed for debugging. */ - ecl_type_enum internal_type; /* The underlying type (float | double) of the data in the corresponding gen_data instances. */ - char * template_file; - char * template_buffer; /* Buffer containing the content of the template - read and internalized at boot time. */ - char * template_key; - int template_data_offset; /* The offset into the template buffer before the data should come. */ - int template_data_skip; /* The length of data identifier in the template.*/ - int template_buffer_size; /* The total size (bytes) of the template buffer .*/ - gen_data_file_format_type input_format; /* The format used for loading gen_data instances when the forward model has completed *AND* for loading the initial files.*/ - gen_data_file_format_type output_format; /* The format used when gen_data instances are written to disk for the forward model. */ - int_vector_type * data_size_vector; /* Data size, i.e. number of elements , indexed with report_step */ - int_vector_type * active_report_steps; /* The report steps where we expect to load data for this instance. */ - pthread_mutex_t update_lock; - /*****************************************************************/ - /* All the fields below this line are related to the capability of - the forward model to deactivate elements in a gen_data - instance. See documentation above. - */ - bool dynamic; - enkf_fs_type * last_read_fs; /* NBNB This will be NULL in the case of instances which are used as parameters. */ - int ens_size; - bool mask_modified; - bool_vector_type * active_mask; - int active_report_step; -}; - - -/*****************************************************************/ - -UTIL_IS_INSTANCE_FUNCTION(gen_data_config , GEN_DATA_CONFIG_ID) -UTIL_SAFE_CAST_FUNCTION(gen_data_config , GEN_DATA_CONFIG_ID) -UTIL_SAFE_CAST_FUNCTION_CONST(gen_data_config , GEN_DATA_CONFIG_ID) - -gen_data_file_format_type gen_data_config_get_input_format ( const gen_data_config_type * config) { return config->input_format; } -gen_data_file_format_type gen_data_config_get_output_format( const gen_data_config_type * config) { return config->output_format; } - - -ecl_type_enum gen_data_config_get_internal_type(const gen_data_config_type * config) { - return config->internal_type; -} - - -/** - If current_size as queried from config->data_size_vector == -1 - (i.e. not set); we seek through -*/ - -int gen_data_config_get_data_size__( const gen_data_config_type * config , int report_step) { - int current_size = int_vector_safe_iget( config->data_size_vector , report_step ); - return current_size; -} - -int gen_data_config_get_data_size( const gen_data_config_type * config , int report_step) { - int current_size = gen_data_config_get_data_size__(config , report_step); - if (current_size < 0) - util_abort("%s: Size not set for object:%s report_step:%d - internal error: \n",__func__ , config->key , report_step); - return current_size; -} - - - -int gen_data_config_get_initial_size( const gen_data_config_type * config ) { - int initial_size = int_vector_safe_iget( config->data_size_vector , 0); - if (initial_size < 0) - initial_size = 0; - - return initial_size; -} - - - -int gen_data_config_get_byte_size( const gen_data_config_type * config , int report_step) { - int byte_size = gen_data_config_get_data_size( config , report_step ) * ecl_util_get_sizeof_ctype( config->internal_type ); - return byte_size; -} - - - -static void gen_data_config_reset_template( gen_data_config_type * config ) { - util_safe_free( config->template_buffer ); - util_safe_free( config->template_key ); - util_safe_free( config->template_file ); - - config->template_file = NULL; - config->template_buffer = NULL; - config->template_key = NULL; - config->template_data_offset = 0; - config->template_data_skip = 0; - config->template_buffer_size = 0; -} - - - -static gen_data_config_type * gen_data_config_alloc( const char * key , bool dynamic ) { - gen_data_config_type * config = util_malloc(sizeof * config ); - UTIL_TYPE_ID_INIT( config , GEN_DATA_CONFIG_ID); - - config->key = util_alloc_string_copy( key ); - - config->template_file = NULL; - config->template_key = NULL; - config->template_buffer = NULL; - gen_data_config_reset_template( config ); - - config->internal_type = ECL_DOUBLE_TYPE; - config->input_format = GEN_DATA_UNDEFINED; - config->output_format = GEN_DATA_UNDEFINED; - config->data_size_vector = int_vector_alloc( 0 , -1 ); /* The default value: -1 - indicates "NOT SET" */ - config->active_report_steps= int_vector_alloc( 0 , 0 ); - config->active_mask = bool_vector_alloc(0 , true ); /* Elements are explicitly set to FALSE - this MUST default to true. */ - config->active_report_step = -1; - config->ens_size = -1; - config->last_read_fs = NULL; - config->dynamic = dynamic; - pthread_mutex_init( &config->update_lock , NULL ); - - - return config; -} - -gen_data_config_type * gen_data_config_alloc_GEN_PARAM( const char * key , gen_data_file_format_type output_format , gen_data_file_format_type input_format) { - gen_data_config_type * config = gen_data_config_alloc( key , false ); - - if (input_format == ASCII_TEMPLATE) - util_abort("%s: Sorry can not use INPUT_FORMAT:ASCII_TEMPLATE\n",__func__); - - if (output_format == GEN_DATA_UNDEFINED || input_format == GEN_DATA_UNDEFINED) - util_abort("%s: Sorry must specify valid values for both input and output format\n",__func__); - - config->output_format = output_format; - config->input_format = input_format; - return config; -} - - -gen_data_config_type * gen_data_config_alloc_GEN_DATA_result( const char * key , gen_data_file_format_type input_format) { - gen_data_config_type * config = gen_data_config_alloc( key , true ); - - if (input_format == ASCII_TEMPLATE) - util_abort("%s: Sorry can not use INPUT_FORMAT:ASCII_TEMPLATE\n",__func__); - - if (input_format == GEN_DATA_UNDEFINED) - util_abort("%s: Sorry must specify valid values for input format.\n",__func__); - - config->input_format = input_format; - return config; -} - -gen_data_config_type * gen_data_config_alloc_GEN_DATA_state( const char * key , gen_data_file_format_type output_format , gen_data_file_format_type input_format) { - gen_data_config_type * config = gen_data_config_alloc( key , true ); - - if (input_format == ASCII_TEMPLATE) - util_abort("%s: Sorry can not use INPUT_FORMAT:ASCII_TEMPLATE\n",__func__); - - if (output_format == GEN_DATA_UNDEFINED || input_format == GEN_DATA_UNDEFINED) - util_abort("%s: Sorry must specify valid values for both input and output format\n",__func__); - - config->output_format = output_format; - config->input_format = input_format; - return config; -} - - -const bool_vector_type * gen_data_config_get_active_mask( const gen_data_config_type * config ) { - if (config->dynamic) - return config->active_mask; - else - return NULL; /* GEN_PARAM instance will never be deactivated by the forward model. */ -} - - - - - -bool gen_data_config_set_template( gen_data_config_type * config , const char * template_ecl_file , const char * template_data_key ) { - char * template_buffer = NULL; - bool template_valid = true; - int template_buffer_size; - - if (template_ecl_file) { - if (util_file_readable( template_ecl_file )) { - template_buffer = util_fread_alloc_file_content( template_ecl_file , &template_buffer_size); - if (template_data_key) { - if (strstr(template_buffer , template_data_key) == NULL) - template_valid = false; - } - } else - template_valid = false; - } - - if (template_valid) { - - gen_data_config_reset_template(config); - if (template_ecl_file != NULL) { - char *data_ptr; - config->template_buffer = template_buffer; - config->template_buffer_size = template_buffer_size; - if (template_data_key != NULL) { - data_ptr = strstr(config->template_buffer , template_data_key); - if (data_ptr == NULL) - util_abort("%s: template:%s can not be used - could not find data key:%s \n",__func__ , template_ecl_file , template_data_key); - else { - config->template_data_offset = data_ptr - config->template_buffer; - config->template_data_skip = strlen( template_data_key ); - } - } else { /* We are using a template without a template_data_key - the - data is assumed to come at the end of the template. */ - config->template_data_offset = strlen( config->template_buffer ); - config->template_data_skip = 0; - } - - config->template_file = util_realloc_string_copy( config->template_file , template_ecl_file ); - config->template_key = util_realloc_string_copy( config->template_key , template_data_key ); - - if (config->output_format != ASCII_TEMPLATE) - fprintf(stderr,"**WARNING: The template settings will ignored for key:%s - use OUTPUT_FORMAT:ASCII_TEMPLATE to get template behaviour\n", config->key); - } - - } - return template_valid; -} - - -const char * gen_data_config_get_template_file( const gen_data_config_type * config ) { - return config->template_file; -} - -const char * gen_data_config_get_template_key( const gen_data_config_type * config ) { - return config->template_key; -} - - - - - - - - - -/** - This function takes a string representation of one of the - gen_data_file_format_type values, and returns the corresponding - integer value. - - Will return gen_data_undefined if the string is not recognized, - calling scope must check on this return value. -*/ - - -gen_data_file_format_type gen_data_config_check_format( const void * format_string ) { - gen_data_file_format_type type = GEN_DATA_UNDEFINED; - - if (format_string != NULL) { - - if (strcmp(format_string , "ASCII") == 0) - type = ASCII; - else if (strcmp(format_string , "ASCII_TEMPLATE") == 0) - type = ASCII_TEMPLATE; - else if (strcmp(format_string , "BINARY_DOUBLE") == 0) - type = BINARY_DOUBLE; - else if (strcmp(format_string , "BINARY_FLOAT") == 0) - type = BINARY_FLOAT; - - } - - return type; -} - - -/** - The valid options are: - - INPUT_FORMAT:(ASCII|ASCII_TEMPLATE|BINARY_DOUBLE|BINARY_FLOAT) - OUTPUT_FORMAT:(ASCII|ASCII_TEMPLATE|BINARY_DOUBLE|BINARY_FLOAT) - TEMPLATE:/some/template/file - KEY: - ECL_FILE: Forward model> (In the case of gen_param - this is extracted in the calling scope). - RESULT_FILE: - -*/ - - - - -void gen_data_config_free(gen_data_config_type * config) { - int_vector_free( config->data_size_vector ); - int_vector_free( config->active_report_steps ); - - util_safe_free( config->key ); - util_safe_free( config->template_buffer ); - util_safe_free( config->template_file ); - util_safe_free( config->template_key ); - bool_vector_free( config->active_mask ); - - free(config); -} - - - - -/** - This function gets a size (from a gen_data) instance, and verifies - that the size agrees with the currently stored size and - report_step. If the report_step is new we just record the new info, - otherwise it will break hard. -*/ - - -/** - Does not work properly with: - - 1. keep_run_path - the load_file will be left hanging around - and loaded again and again. - 2. Doing forward several steps - how to (time)index the files? - -*/ - - -void gen_data_config_assert_size(gen_data_config_type * config , int data_size, int report_step) { - pthread_mutex_lock( &config->update_lock ); - { - int current_size = int_vector_safe_iget( config->data_size_vector , report_step ); - if (current_size < 0) { - int_vector_iset( config->data_size_vector , report_step , data_size ); - current_size = data_size; - } - - if (current_size != data_size) { - util_abort("%s: Size mismatch when loading:%s from file - got %d elements - expected:%d [report_step:%d] \n", - __func__ , - gen_data_config_get_key( config ), - data_size , - current_size , - report_step); - } - } - pthread_mutex_unlock( &config->update_lock ); -} - -/** - When the forward model is creating results for GEN_DATA instances, - it can optionally signal that not all elements in the gen_data - should be active (i.e. the forward model failed in some way); that - is handled through this function. When all ensemble members have - called this function the mask config->active_mask should be true - ONLY for the elements which are true for all members. - - This MUST be called after gen_data_config_assert_size(). -*/ - -void gen_data_config_update_active(gen_data_config_type * config, const forward_load_context_type * load_context, const bool_vector_type * data_mask) { - pthread_mutex_lock( &config->update_lock ); - { - int report_step = forward_load_context_get_load_step( load_context ); - if ( int_vector_iget( config->data_size_vector , report_step ) > 0) { - if (config->active_report_step != report_step) { - /* This is the first ensemeble member loading for this - particular report_step. */ - bool_vector_reset( config->active_mask ); - bool_vector_iset( config->active_mask , int_vector_iget( config->data_size_vector , report_step ) - 1 , true ); - config->mask_modified = true; - } - - { - int i; - for (i=0; i < bool_vector_size( data_mask ); i++) { - if (!bool_vector_iget( data_mask , i )) { - bool_vector_iset( config->active_mask , i , false ); - config->mask_modified = true; - } - } - } - - if (config->mask_modified) { - /** - The global mask has been modified after the last load; - i.e. we update the on-disk representation. - */ - char * filename = util_alloc_sprintf("%s_active" , config->key ); - FILE * stream = enkf_fs_open_case_tstep_file( forward_load_context_get_result_fs( load_context ) , - filename , - report_step , - "w"); - - bool_vector_fwrite( config->active_mask , stream ); - - fclose( stream ); - free( filename ); - config->mask_modified = false; - } - } - config->active_report_step = report_step; - } - pthread_mutex_unlock( &config->update_lock ); -} - - -bool gen_data_config_has_active_mask( const gen_data_config_type * config , enkf_fs_type * fs , int report_step) { - bool has_mask; - { - char * filename = util_alloc_sprintf("%s_active" , config->key ); - FILE * stream = enkf_fs_open_excase_tstep_file( fs , filename , report_step); - - if (stream == NULL) - has_mask = false; - else { - has_mask = true; - fclose( stream ); - } - - free( filename ); - } - return has_mask; -} - - -/** - This function will load an active map from the enkf_fs filesystem. -*/ -void gen_data_config_load_active( gen_data_config_type * config , enkf_fs_type * fs, int report_step , bool force_load) { - if (!config->dynamic) - return; /* This is used as a GEN_PARAM instance - and the loading of mask is not an option. */ - - { - bool fs_changed = false; - if (fs != config->last_read_fs) { - config->last_read_fs = fs; - fs_changed = true; - } - - pthread_mutex_lock( &config->update_lock ); - { - if ( force_load || (int_vector_iget( config->data_size_vector , report_step ) > 0)) { - if (config->active_report_step != report_step || fs_changed) { - char * filename = util_alloc_sprintf("%s_active" , config->key ); - FILE * stream = enkf_fs_open_excase_tstep_file( fs , filename , report_step); - - if (stream != NULL) { - bool_vector_fread( config->active_mask , stream ); - fclose( stream ); - } else { - int gen_data_size = int_vector_safe_iget( config->data_size_vector, report_step ); - if (gen_data_size < 0) { - fprintf(stderr,"** Fatal internal error in function:%s \n",__func__); - fprintf(stderr,"\n"); - fprintf(stderr," 1: The active mask file:%s was not found \n",filename); - fprintf(stderr," 2: The size of the gen_data vectors has not been set\n"); - fprintf(stderr,"\n"); - fprintf(stderr,"We can not create a suitable active_mask. Code should call gen_data_config_has_active_mask()\n\n"); - - util_abort("%s: fatal internal error - could not create a suitable active_mask \n",__func__); - } else { - fprintf(stdout,"** Info: could not locate active data elements file %s, filling active vector with true all elements active \n",filename); - bool_vector_reset( config->active_mask ); - bool_vector_iset( config->active_mask, gen_data_size - 1, true); - } - } - free( filename ); - } - } - config->active_report_step = report_step; - } - pthread_mutex_unlock( &config->update_lock ); - } -} - -int gen_data_config_num_report_step( const gen_data_config_type * config ) { - return int_vector_size( config->active_report_steps ); -} - -bool gen_data_config_has_report_step( const gen_data_config_type * config , int report_step) { - return int_vector_contains_sorted( config->active_report_steps , report_step ); -} - -void gen_data_config_add_report_step( gen_data_config_type * config , int report_step) { - if (config->dynamic) { - if (!gen_data_config_has_report_step( config , report_step)) { - int_vector_append( config->active_report_steps , report_step ); - int_vector_sort( config->active_report_steps ); - } - } -} - -int gen_data_config_iget_report_step( const gen_data_config_type *config , int index) { - return int_vector_iget( config->active_report_steps , index ); -} - -void gen_data_config_set_active_report_steps_from_string( gen_data_config_type *config , const char * range_string) { - if (config->dynamic) { - int_vector_reset( config->active_report_steps ); - string_util_update_active_list(range_string , config->active_report_steps ); - } -} - - -const int_vector_type * gen_data_config_get_active_report_steps( const gen_data_config_type *config) { - return config->active_report_steps; -} - -void gen_data_config_set_ens_size( gen_data_config_type * config , int ens_size) { - config->ens_size = ens_size; -} - - -bool gen_data_config_is_dynamic( const gen_data_config_type * config ) { - return config->dynamic; -} - -void gen_data_config_get_template_data( const gen_data_config_type * config , - char ** template_buffer , - int * template_data_offset , - int * template_buffer_size , - int * template_data_skip) { - - *template_buffer = config->template_buffer; - *template_data_offset = config->template_data_offset; - *template_buffer_size = config->template_buffer_size; - *template_data_skip = config->template_data_skip; - -} - - -bool gen_data_config_valid_result_format(const char * result_file_fmt) { - if (result_file_fmt) { - if (util_is_abs_path( result_file_fmt )) - return false; - else { - if (util_int_format_count(result_file_fmt) == 1) - return true; - else - return false; - } - } else - return false; -} - - -const char * gen_data_config_get_key( const gen_data_config_type * config) { - return config->key; -} - -static const char * gen_data_config_format_name( gen_data_file_format_type format_type) { - switch (format_type ) { - case GEN_DATA_UNDEFINED: - return "UNDEFINED"; - break; - case ASCII: - return "ASCII"; - break; - case ASCII_TEMPLATE: - return "ASCII_TEMPLATE"; - break; - case BINARY_FLOAT: - return "BINARY_FLOAT"; - break; - case BINARY_DOUBLE: - return "BINARY_DOUBLE"; - break; - default: - util_abort("%s: What the f.. \n",__func__); - return NULL; - } -} - - -void gen_data_config_fprintf_config( const gen_data_config_type * config , enkf_var_type var_type , const char * outfile , const char * infile , - const char * min_std_file , FILE * stream) { - if (var_type == PARAMETER) - fprintf( stream , CONFIG_VALUE_FORMAT , outfile ); - else - fprintf( stream , CONFIG_OPTION_FORMAT , ECL_FILE_KEY , outfile ); - - if (min_std_file != NULL) - fprintf( stream , CONFIG_OPTION_FORMAT , MIN_STD_KEY , min_std_file ); - - if (config->template_file != NULL) - fprintf( stream , CONFIG_OPTION_FORMAT , TEMPLATE_KEY , config->template_file ); - - if (config->template_key != NULL) - fprintf( stream , CONFIG_OPTION_FORMAT , KEY_KEY , config->template_key ); - - if (infile != NULL) - fprintf( stream , CONFIG_OPTION_FORMAT , RESULT_FILE_KEY , infile ); - - if (config->input_format != GEN_DATA_UNDEFINED) - fprintf( stream , CONFIG_OPTION_FORMAT , INPUT_FORMAT_KEY , gen_data_config_format_name( config->input_format )); - - if (config->output_format != GEN_DATA_UNDEFINED) - fprintf( stream , CONFIG_OPTION_FORMAT , OUTPUT_FORMAT_KEY , gen_data_config_format_name( config->output_format )); -} - - - -/*****************************************************************/ - -VOID_FREE(gen_data_config) diff --git a/ThirdParty/Ert/libenkf/src/gen_kw.c b/ThirdParty/Ert/libenkf/src/gen_kw.c deleted file mode 100644 index 2399da9b97..0000000000 --- a/ThirdParty/Ert/libenkf/src/gen_kw.c +++ /dev/null @@ -1,501 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'gen_kw.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -GET_DATA_SIZE_HEADER(gen_kw); - - -struct gen_kw_struct { - int __type_id; - const gen_kw_config_type * config; - double * data; - subst_list_type * subst_list; -}; - -/*****************************************************************/ - - - -void gen_kw_free(gen_kw_type *gen_kw) { - util_safe_free( gen_kw->data ); - subst_list_free( gen_kw->subst_list ); - free(gen_kw); -} - - - - - -gen_kw_type * gen_kw_alloc(const gen_kw_config_type * config) { - gen_kw_type * gen_kw = util_malloc(sizeof *gen_kw ); - gen_kw->__type_id = GEN_KW; - gen_kw->config = config; - gen_kw->subst_list = subst_list_alloc( NULL ); - gen_kw->data = util_calloc( gen_kw_config_get_data_size( config ) , sizeof * gen_kw->data ); - return gen_kw; -} - - -void gen_kw_clear(gen_kw_type * gen_kw) { - int i; - for (i=0; i < gen_kw_config_get_data_size( gen_kw->config ); i++) - gen_kw->data[i] = 0.0; -} - - - -void gen_kw_copy(const gen_kw_type * src , gen_kw_type * target) { - if (src->config == target->config) { - int buffer_size = gen_kw_config_get_data_size( src->config ) * sizeof src->data; - memcpy( target->data , src->data , buffer_size ); - } else - util_abort("%s: two elements do not share config object \n",__func__); -} - - - -int gen_kw_data_size( gen_kw_type * gen_kw ) { - return gen_kw_config_get_data_size( gen_kw->config ); -} - - - -double gen_kw_data_iget( gen_kw_type * gen_kw, int index , bool do_transform ) -{ - double value; - int size = gen_kw_config_get_data_size( gen_kw->config ); - if (( index < 0 ) || ( index >= size )) - util_abort( "%s: index:%d invalid. Valid interval: [0,%d>.\n" , __func__ , index , size ); - - if (do_transform) { - value = gen_kw_config_transform(gen_kw->config, index, gen_kw->data[index]); - } - else { - value = gen_kw->data[index]; - } - - return value; -} - - -void gen_kw_data_set_vector( gen_kw_type * gen_kw, const double_vector_type * values ) { - int size = gen_kw_config_get_data_size( gen_kw->config ); - if (size == double_vector_size( values )) { - for (int index = 0; index < size; index++) - gen_kw->data[index] = double_vector_iget( values , index); - } else - util_abort( "%s: Invalid size for vector:%d gen_Kw:%d \n",__func__ , double_vector_size( values ) , size); -} - - - -void gen_kw_data_iset( gen_kw_type * gen_kw, int index , double value ) -{ - int size = gen_kw_config_get_data_size( gen_kw->config ); - if (( index < 0 ) || ( index >= size )) - util_abort( "%s: index:%d invalid. Valid interval: [0,%d>.\n" , __func__ , index , size ); - - gen_kw->data[index] = value; -} - - -double gen_kw_data_get( gen_kw_type * gen_kw, const char * subkey, bool do_transform ) -{ - int index = gen_kw_config_get_index(gen_kw->config, subkey); - return gen_kw_data_iget(gen_kw, index, do_transform); -} - -void gen_kw_data_set( gen_kw_type * gen_kw, const char * subkey, double value ) -{ - int index = gen_kw_config_get_index(gen_kw->config, subkey); - return gen_kw_data_iset(gen_kw, index, value); -} - - -bool gen_kw_data_has_key( gen_kw_type * gen_kw, const char * subkey ) -{ - int index = gen_kw_config_get_index(gen_kw->config, subkey); - bool has_key = ((0 <= index) && (gen_kw_data_size(gen_kw) > index))? true : false; - return has_key; -} - -bool gen_kw_write_to_buffer(const gen_kw_type *gen_kw , buffer_type * buffer, int report_step) { - const int data_size = gen_kw_config_get_data_size( gen_kw->config ); - buffer_fwrite_int( buffer , GEN_KW ); - buffer_fwrite(buffer , gen_kw->data , sizeof *gen_kw->data , data_size); - return true; -} - - - - -/** - As of 17/03/09 (svn 1811) MULTFLT has been depreceated, and GEN_KW - has been inserted as a 'drop-in-replacement'. This implies that - existing storage labeled with implemantation type 'MULTFLT' should - be silently 'upgraded' to 'GEN_KW'. -*/ - - -#define MULTFLT 102 -void gen_kw_read_from_buffer(gen_kw_type * gen_kw , buffer_type * buffer, enkf_fs_type * fs, int report_step) { - const int data_size = gen_kw_config_get_data_size( gen_kw->config ); - ert_impl_type file_type; - file_type = buffer_fread_int(buffer); - if ((file_type == GEN_KW) || (file_type == MULTFLT)) - buffer_fread(buffer , gen_kw->data , sizeof *gen_kw->data , data_size); -} -#undef MULTFLT - - -void gen_kw_truncate(gen_kw_type * gen_kw) { - return ; -} - - - -bool gen_kw_initialize(gen_kw_type *gen_kw , int iens , const char * init_file , rng_type * rng ) { - if (!init_file && !rng) - util_abort("%s internal error: both init_file and rng are NULL", __func__); - - bool ret = false; - - if (init_file) - ret = gen_kw_fload(gen_kw , init_file ); - else { - const double mean = 0.0; /* Mean and std are hardcoded - the variability should be in the transformation. */ - const double std = 1.0; - const int data_size = gen_kw_config_get_data_size( gen_kw->config ); - int i; - - for (i=0; i < data_size; i++) - gen_kw->data[i] = enkf_util_rand_normal(mean , std , rng); - - ret = true; - } - return ret; -} - - - - - -void gen_kw_serialize(const gen_kw_type *gen_kw , node_id_type node_id , const active_list_type * active_list , matrix_type * A , int row_offset , int column) { - const int data_size = gen_kw_config_get_data_size( gen_kw->config ); - enkf_matrix_serialize( gen_kw->data , data_size , ECL_DOUBLE_TYPE , active_list , A , row_offset , column); -} - - -void gen_kw_deserialize(gen_kw_type *gen_kw , node_id_type node_id , const active_list_type * active_list , const matrix_type * A , int row_offset , int column) { - const int data_size = gen_kw_config_get_data_size( gen_kw->config ); - enkf_matrix_deserialize( gen_kw->data , data_size , ECL_DOUBLE_TYPE , active_list , A , row_offset , column); -} - - - -void gen_kw_filter_file(const gen_kw_type * gen_kw , const char * target_file) { - const char * template_file = gen_kw_config_get_template_file(gen_kw->config); - if (template_file != NULL) { - const int size = gen_kw_config_get_data_size(gen_kw->config ); - int ikw; - - for (ikw = 0; ikw < size; ikw++) { - const char * key = gen_kw_config_get_tagged_name(gen_kw->config , ikw); - subst_list_append_owned_ref(gen_kw->subst_list , key , util_alloc_sprintf("%g" , gen_kw_config_transform( gen_kw->config , ikw , gen_kw->data[ikw] )) , NULL); - } - - /* - If the target_file already exists as a symbolic link the - symbolic link is removed before creating the target file. The is - to ensure against existing symlinks pointing to a common file - outside the realization root. - */ - if (util_is_link( target_file )) - remove( target_file ); - - subst_list_filter_file( gen_kw->subst_list , template_file , target_file); - } else - util_abort("%s: internal error - tried to filter gen_kw instance without template file.\n",__func__); -} - - -void gen_kw_write_export_file(const gen_kw_type * gen_kw, FILE * filestream) { - const int size = gen_kw_config_get_data_size(gen_kw->config ); - int ikw; - - for (ikw = 0; ikw < size; ++ikw) { - const char * key = gen_kw_config_get_key(gen_kw->config); - const char * parameter = gen_kw_config_iget_name(gen_kw->config , ikw); - int width = 60 - (strlen(key) + strlen(parameter) + 1); - double transformed_value = gen_kw_config_transform( gen_kw->config , ikw , gen_kw->data[ikw] ); - { - char * print_string = util_alloc_sprintf("%s:%s %g\n", key, parameter, width, transformed_value); - fprintf(filestream, "%s", print_string); - free( print_string ); - } - - if (gen_kw_config_should_use_log_scale(gen_kw->config, ikw)) { - double log_transformed_value = log10(transformed_value); - char * print_log_string = util_alloc_sprintf("LOG10_%s:%s %g\n", key, parameter, width, log_transformed_value); - fprintf(filestream, "%s", print_log_string); - free( print_log_string ); - } - } -} - -void gen_kw_ecl_write_template(const gen_kw_type * gen_kw , const char * file_name){ - gen_kw_filter_file(gen_kw , file_name); -} - - -void gen_kw_ecl_write(const gen_kw_type * gen_kw , const char * run_path , const char * base_file , void * filestream) { - if (fortio_is_instance(filestream)) { - util_abort("%s: Called with fortio instance, aborting\n", __func__); - } else { - if (filestream) - gen_kw_write_export_file(gen_kw, filestream); - { - char * target_file; - if (run_path) - target_file = util_alloc_filename( run_path , base_file , NULL); - else - target_file = util_alloc_string_copy( base_file ); - - gen_kw_filter_file(gen_kw , target_file); - - free( target_file ); - } - } -} - - - -const char * gen_kw_get_name(const gen_kw_type * gen_kw, int kw_nr) { - return gen_kw_config_iget_name(gen_kw->config , kw_nr); -} - - -/** - This function will load values for gen_kw instance from file. The - file should be formatted as either: - - ------- - Value1 - Value2 - Value3 - .... - ValueN - ------- - - Or - - ------------ - Key3 Value3 - Key5 Value5 - Key1 Value1 - ..... - ------------ - - I.e. you can either just dump in all the numbers in one long - vector, or you can interlace numbers and keys. In the latter case - the ordering is arbitrary. - - Observe the following: - - 1. All values must be specified. - 2. The values are in the N(0,1) domain, i.e. the untransformed variables. - -*/ - -bool gen_kw_fload(gen_kw_type * gen_kw , const char * filename) { - FILE * stream = util_fopen__( filename , "r"); - if (stream) { - const int size = gen_kw_config_get_data_size(gen_kw->config ); - bool readOK = true; - - /* First try reading all the data as one long vector. */ - { - int index = 0; - while ((index < size) && readOK) { - double value; - if (fscanf(stream,"%lg" , &value) == 1) - gen_kw->data[index] = value; - else - readOK = false; - index++; - } - } - - /* - OK - rewind and try again with interlaced key + value - pairs. Observe that we still require that ALL the elements in the - gen_kw instance are set, i.e. it is not allowed to read only some - of the keywords; but the ordering is not relevant. - - The code will be fooled (and give undefined erronous results) if - the same key appears several times. Be polite! - */ - - if (!readOK) { - int counter = 0; - readOK = true; - util_fseek( stream , 0 , SEEK_SET ); - - while ((counter < size) && readOK) { - char key[128]; - double value; - int fscanf_return = fscanf(stream , "%s %lg" , key , &value); - - if (fscanf_return == 2) { - int index = gen_kw_config_get_index(gen_kw->config , key); - if (index >= 0) - gen_kw->data[index] = value; - else - util_abort("%s: key:%s not recognized as part of GEN_KW instance - error when reading file:%s \n",__func__ , key , filename); - counter++; - } else { - util_abort("%s: failed to read (key,value) pair at line:%d in file:%s \n",__func__ , util_get_current_linenr( stream ) , filename); - readOK = false; - } - } - } - - if (!readOK) - util_abort("%s: failed loading from file:%s \n",__func__ , filename); - - fclose(stream); - return true; - } else - return false; -} - - - -/** - Will return 0.0 on invalid input, and set valid -> false. It is the - responsibility of the calling scope to check valid. -*/ -bool gen_kw_user_get(const gen_kw_type * gen_kw, const char * key , int report_step , double * value) { - int index = gen_kw_config_get_index(gen_kw->config , key); - - if (index >= 0) { - *value = gen_kw_config_transform(gen_kw->config , index , gen_kw->data[ index ] ); - return true; - } else { - *value = 0.0; - fprintf(stderr,"** Warning:could not lookup key:%s in gen_kw instance \n",key); - return false; - } -} - - -void gen_kw_set_subst_parent(gen_kw_type * gen_kw , const subst_list_type * subst_parent) { - subst_list_set_parent( gen_kw->subst_list , subst_parent ); -} - - -void gen_kw_set_inflation(gen_kw_type * inflation , const gen_kw_type * std , const gen_kw_type * min_std) { - const int data_size = gen_kw_config_get_data_size(std->config ); - const double * std_data = std->data; - const double * min_std_data = min_std->data; - double * inflation_data = inflation->data; - - { - for (int i=0; i < data_size; i++) { - if (std_data[i] > 0) - inflation_data[i] = util_double_max( 1.0 , min_std_data[i] / std_data[i]); - else - inflation_data[i] = 1; - } - } -} - - -void gen_kw_iadd( gen_kw_type * gen_kw , const gen_kw_type * delta) { - const int data_size = gen_kw_config_get_data_size( gen_kw->config ); - for(int i=0; i < data_size; i++) - gen_kw->data[i] += delta->data[i]; -} - -void gen_kw_iaddsqr( gen_kw_type * gen_kw , const gen_kw_type * delta) { - const int data_size = gen_kw_config_get_data_size( gen_kw->config ); - for(int i=0; i < data_size; i++) - gen_kw->data[i] += (delta->data[i] * delta->data[i]); -} - -void gen_kw_imul( gen_kw_type * gen_kw , const gen_kw_type * delta) { - const int data_size = gen_kw_config_get_data_size( gen_kw->config ); - for(int i=0; i < data_size; i++) - gen_kw->data[i] *= delta->data[i]; -} - -void gen_kw_scale( gen_kw_type * gen_kw , double scale_factor) { - const int data_size = gen_kw_config_get_data_size( gen_kw->config ); - for(int i=0; i < data_size; i++) - gen_kw->data[i] *= scale_factor; -} - -void gen_kw_isqrt( gen_kw_type * gen_kw ) { - const int data_size = gen_kw_config_get_data_size( gen_kw->config ); - for(int i=0; i < data_size; i++) - gen_kw->data[i] = sqrt( gen_kw->data[i] ); -} - - -/******************************************************************/ -/* Anonumously generated functions used by the enkf_node object */ -/******************************************************************/ -UTIL_SAFE_CAST_FUNCTION(gen_kw , GEN_KW); -UTIL_SAFE_CAST_FUNCTION_CONST(gen_kw , GEN_KW); -VOID_ALLOC(gen_kw); -VOID_INITIALIZE(gen_kw); -VOID_COPY(gen_kw) -VOID_FREE(gen_kw) -VOID_ECL_WRITE(gen_kw) -VOID_USER_GET(gen_kw) -VOID_WRITE_TO_BUFFER(gen_kw) -VOID_READ_FROM_BUFFER(gen_kw) -VOID_SERIALIZE(gen_kw) -VOID_DESERIALIZE(gen_kw) -VOID_SET_INFLATION(gen_kw) -VOID_CLEAR(gen_kw) -VOID_IADD(gen_kw) -VOID_SCALE(gen_kw) -VOID_IMUL(gen_kw) -VOID_IADDSQR(gen_kw) -VOID_ISQRT(gen_kw) -VOID_FLOAD(gen_kw) diff --git a/ThirdParty/Ert/libenkf/src/gen_kw_config.c b/ThirdParty/Ert/libenkf/src/gen_kw_config.c deleted file mode 100644 index 65c475d09e..0000000000 --- a/ThirdParty/Ert/libenkf/src/gen_kw_config.c +++ /dev/null @@ -1,327 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'gen_kw_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#define GEN_KW_CONFIG_TYPE_ID 550761 -#define GEN_KW_PARAMETER_TYPE_ID 886201 - - -typedef struct { - UTIL_TYPE_ID_DECLARATION; - char * name; - char * tagged_name; - trans_func_type * trans_func; -} gen_kw_parameter_type; - - - -struct gen_kw_config_struct { - UTIL_TYPE_ID_DECLARATION; - char * key; - vector_type * parameters; /* Vector of gen_kw_parameter_type instances. */ - char * template_file; - char * parameter_file; - const char * tag_fmt; /* Pointer to the tag_format owned by the ensemble config object. */ -}; - - -/*****************************************************************/ - -UTIL_SAFE_CAST_FUNCTION( gen_kw_parameter , GEN_KW_PARAMETER_TYPE_ID ) -UTIL_SAFE_CAST_FUNCTION_CONST( gen_kw_parameter , GEN_KW_PARAMETER_TYPE_ID ) - - -UTIL_SAFE_CAST_FUNCTION( gen_kw_config , GEN_KW_CONFIG_TYPE_ID ) -UTIL_SAFE_CAST_FUNCTION_CONST( gen_kw_config , GEN_KW_CONFIG_TYPE_ID ) - -static void gen_kw_parameter_update_tagged_name( gen_kw_parameter_type * parameter , const char * tag_fmt) { - if (tag_fmt != NULL) - parameter->tagged_name = util_realloc_sprintf( parameter->tagged_name , tag_fmt , parameter->name ); -} - - -static gen_kw_parameter_type * gen_kw_parameter_alloc( const char * parameter_name , const char * tag_fmt ) { - gen_kw_parameter_type * parameter = util_malloc( sizeof * parameter ); - UTIL_TYPE_ID_INIT( parameter , GEN_KW_PARAMETER_TYPE_ID); - parameter->name = util_alloc_string_copy( parameter_name ); - parameter->tagged_name = NULL; - parameter->trans_func = NULL; - gen_kw_parameter_update_tagged_name( parameter , tag_fmt ); - return parameter; -} - - -static void gen_kw_parameter_free( gen_kw_parameter_type * parameter ) { - util_safe_free( parameter->name ); - util_safe_free( parameter->tagged_name ); - if (parameter->trans_func != NULL) - trans_func_free( parameter->trans_func ); - free( parameter ); -} - - -static void gen_kw_parameter_free__( void * __parameter ) { - gen_kw_parameter_type * parameter = gen_kw_parameter_safe_cast( __parameter ); - gen_kw_parameter_free( parameter ); -} - - -static void gen_kw_parameter_set_trans_func( gen_kw_parameter_type * parameter , trans_func_type * trans_func ) { - if (parameter->trans_func != NULL) - trans_func_free( parameter->trans_func ); - parameter->trans_func = trans_func; -} - - - -/*****************************************************************/ - - -const char * gen_kw_config_get_template_file(const gen_kw_config_type * config) { - return config->template_file; -} - - -/* - The input template file must point to an existing file. -*/ -void gen_kw_config_set_template_file( gen_kw_config_type * config , const char * template_file ) { - if (template_file != NULL) { - if (!util_file_exists(template_file)) - util_abort("%s: the template_file:%s does not exist - aborting.\n",__func__ , template_file); - } - - config->template_file = util_realloc_string_copy( config->template_file , template_file ); -} - - - -void gen_kw_config_set_parameter_file( gen_kw_config_type * config , const char * parameter_file ) { - config->parameter_file = util_realloc_string_copy( config->parameter_file , parameter_file ); - vector_clear( config->parameters ); - if (parameter_file != NULL) { - FILE * stream = util_fopen(parameter_file , "r"); - - while (true) { - char parameter_name[256]; - int fscanf_return; - - fscanf_return = fscanf(stream , "%s" , parameter_name); - if (fscanf_return == 1) { - gen_kw_parameter_type * parameter = gen_kw_parameter_alloc( parameter_name , config->tag_fmt); - trans_func_type * trans_func = trans_func_fscanf_alloc( stream, parameter_file ); - gen_kw_parameter_set_trans_func( parameter , trans_func ); - - vector_append_owned_ref( config->parameters , parameter , gen_kw_parameter_free__ ); - } else - break; /* OK - we are ate EOF. */ - } - - fclose( stream ); - } -} - - - - -const char * gen_kw_config_get_parameter_file( const gen_kw_config_type * config ) { - return config->parameter_file; -} - - -/** - Unfortunately the GUI makes it necessary(??) to be able to create - halfways initialized gen_kw_config objects; and we then have to be - able to query the gen_kw_config object if it is valid. Observe that - some of the required config information will be owned by the - enkf_config_node itself, this function should therefor NOT be - called directly, only through the enkf_config_node_is_valid() - function. - - Requirements: - ------------- - * template_file != NULL - * parameter_file != NULL (this means that the special schedule_prediction_file keyword will be invalid). - -*/ - -bool gen_kw_config_is_valid( const gen_kw_config_type * config ) { - if (config->template_file != NULL && config->parameter_file != NULL) - return true; - else - return false; -} - - -/** - A call to gen_kw_config_update_tag_format() must be called - afterwards, otherwise all tagged strings will just be NULL. -*/ -gen_kw_config_type * gen_kw_config_alloc_empty( const char * key , const char * tag_fmt ) { - gen_kw_config_type *gen_kw_config = util_malloc(sizeof *gen_kw_config); - UTIL_TYPE_ID_INIT(gen_kw_config , GEN_KW_CONFIG_TYPE_ID); - - gen_kw_config->key = NULL; - gen_kw_config->template_file = NULL; - gen_kw_config->parameter_file = NULL; - gen_kw_config->parameters = vector_alloc_new(); - gen_kw_config->tag_fmt = tag_fmt; - gen_kw_config->key = util_alloc_string_copy( key ); - - return gen_kw_config; -} - - - -void gen_kw_config_update( gen_kw_config_type * config , const char * template_file , const char * parameter_file ) { - gen_kw_config_set_template_file( config , template_file); - gen_kw_config_set_parameter_file( config , parameter_file ); -} - - - -double gen_kw_config_transform(const gen_kw_config_type * config , int index, double x) { - const gen_kw_parameter_type * parameter = vector_iget_const( config->parameters , index ); - return trans_func_eval( parameter->trans_func , x); -} - -bool gen_kw_config_should_use_log_scale(const gen_kw_config_type * config, int index) { - const gen_kw_parameter_type * parameter = vector_iget_const( config->parameters , index ); - return trans_func_use_log_scale( parameter->trans_func); -} - -void gen_kw_config_free(gen_kw_config_type * gen_kw_config) { - util_safe_free( gen_kw_config->key ); - util_safe_free( gen_kw_config->template_file ); - util_safe_free( gen_kw_config->parameter_file ); - - vector_free( gen_kw_config->parameters ); - free(gen_kw_config); -} - - - -int gen_kw_config_get_data_size(const gen_kw_config_type * gen_kw_config) { - return vector_get_size(gen_kw_config->parameters); -} - - - -const char * gen_kw_config_get_key(const gen_kw_config_type * config ) { - return config->key; -} - - -char * gen_kw_config_alloc_user_key(const gen_kw_config_type * config , int kw_nr) { - char * user_key = util_alloc_sprintf("%s:%s" , config->key ,gen_kw_config_iget_name( config , kw_nr )); - return user_key; -} - - -const char * gen_kw_config_iget_name(const gen_kw_config_type * config, int kw_nr) { - const gen_kw_parameter_type * parameter = vector_iget( config->parameters , kw_nr ); - return parameter->name; -} - - - - -const char * gen_kw_config_get_tagged_name(const gen_kw_config_type * config, int kw_nr) { - const gen_kw_parameter_type * parameter = vector_iget( config->parameters , kw_nr ); - return parameter->tagged_name; -} - - -void gen_kw_config_update_tag_format(gen_kw_config_type * config , const char * tag_format) { - int i; - - config->tag_fmt = tag_format; - for (i=0; i < vector_get_size( config->parameters ); i++) - gen_kw_parameter_update_tagged_name( vector_iget( config->parameters , i ) , config->tag_fmt); -} - - -stringlist_type * gen_kw_config_alloc_name_list( const gen_kw_config_type * config ) { - - stringlist_type * name_list = stringlist_alloc_new(); - int i; - for (i=0; i < vector_get_size( config->parameters ); i++) { - const gen_kw_parameter_type * parameter = vector_iget_const( config->parameters , i ); - stringlist_append_ref( name_list , parameter->name ); /* If the underlying parameter goes out scope - whom bang .. */ - } - - return name_list; -} - - - - - -/** - Will return -1 if the index is invalid. -*/ -int gen_kw_config_get_index(const gen_kw_config_type * config , const char * key) { - const int size = gen_kw_config_get_data_size(config); - bool have_key = false; - int index = 0; - - while (index < size && !have_key) { - const gen_kw_parameter_type * parameter = vector_iget_const( config->parameters , index ); - if (strcmp(parameter->name , key) == 0) - have_key = true; - else - index++; - } - - if (have_key) - return index; - else - return -1; -} - - - -void gen_kw_config_fprintf_config( const gen_kw_config_type * config , const char * outfile , const char * min_std_file , FILE * stream ) { - fprintf(stream , CONFIG_VALUE_FORMAT , config->template_file ); - fprintf(stream , CONFIG_VALUE_FORMAT , outfile ); - fprintf(stream , CONFIG_VALUE_FORMAT , config->parameter_file ); - - if (min_std_file != NULL) - fprintf( stream , CONFIG_OPTION_FORMAT , MIN_STD_KEY , min_std_file); - -} - - -/*****************************************************************/ - -VOID_FREE(gen_kw_config) -VOID_GET_DATA_SIZE(gen_kw) diff --git a/ThirdParty/Ert/libenkf/src/gen_obs.c b/ThirdParty/Ert/libenkf/src/gen_obs.c deleted file mode 100644 index f407713f43..0000000000 --- a/ThirdParty/Ert/libenkf/src/gen_obs.c +++ /dev/null @@ -1,522 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'gen_obs.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -/** - See the overview documentation of the observation system in - enkf_obs.c -*/ -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -/** - This file implemenets a structure for general observations. A - general observation is just a vector of numbers - where EnKF has no - understanding whatsover of the type of these data. The actual data - is supposed to be found in a file. - - Currently it can only observe gen_data instances - but that should - be generalized. -*/ - -/* - The std_scaling field of the xxx_obs structure can be used to scale - the standard deviation used for the observations, either to support - workflows with multiple data assimilation or to reduce the effect of - observation correlations. - - When querying for the observation standard deviation using - gen_obs_iget_std() the user input value of standard deviation will - be returned, whereas when the function gen_obs_measure() is used the - std_scaling will be incorporated in the result. -*/ - -#define GEN_OBS_TYPE_ID 77619 - -struct gen_obs_struct { - UTIL_TYPE_ID_DECLARATION; - int obs_size; /* This is the total size of the observation vector. */ - int * data_index_list; /* The indexes which are observed in the corresponding gen_data instance - of length obs_size. */ - bool observe_all_data; /* Flag which indiactes whether all data in the gen_data instance should be observed - in that case we must do a size comparizon-check at use time. */ - - double * obs_data; /* The observed data. */ - double * obs_std; /* The observed standard deviation. */ - double * std_scaling; /* Scaling factor for the standard deviation */ - - char * obs_key; /* The key this observation is held by - in the enkf_obs structur (only for debug messages). */ - gen_data_file_format_type obs_format; /* The format, i.e. ASCII, binary_double or binary_float, of the observation file. */ - matrix_type * error_covar; - gen_data_config_type * data_config; -}; - -/******************************************************************/ - - -static UTIL_SAFE_CAST_FUNCTION_CONST(gen_obs , GEN_OBS_TYPE_ID) -static UTIL_SAFE_CAST_FUNCTION(gen_obs , GEN_OBS_TYPE_ID) - -void gen_obs_free(gen_obs_type * gen_obs) { - util_safe_free(gen_obs->obs_data); - util_safe_free(gen_obs->obs_std); - util_safe_free(gen_obs->data_index_list); - util_safe_free(gen_obs->obs_key); - util_safe_free(gen_obs->std_scaling); - if (gen_obs->error_covar != NULL) - matrix_free( gen_obs->error_covar ); - - free(gen_obs); -} - - -static double IGET_SCALED_STD(const gen_obs_type * gen_obs, int index) { - return gen_obs->obs_std[index] * gen_obs->std_scaling[index]; -} - - -/** - This function loads the actual observations from disk, and - initializes the obs_data and obs_std pointers with the - observations. It also sets the obs_size field of the gen_obs - instance. - - The file with observations should be a long vector of 2N elements, - where the first N elements are data values, and the last N values - are the corresponding standard deviations. - - The file is loaded with the gen_common_fload_alloc() function, and - can be in formatted ASCII or binary_float / binary_double. Observe - that there is *NO* header information in this file. -*/ - - -static void gen_obs_set_data(gen_obs_type * gen_obs, int buffer_size , const double * buffer) { - gen_obs->obs_size = buffer_size / 2; - gen_obs->obs_data = util_realloc(gen_obs->obs_data , gen_obs->obs_size * sizeof * gen_obs->obs_data ); - gen_obs->obs_std = util_realloc(gen_obs->obs_std , gen_obs->obs_size * sizeof * gen_obs->obs_std ); - gen_obs->std_scaling = util_realloc(gen_obs->std_scaling , gen_obs->obs_size * sizeof * gen_obs->std_scaling ); - gen_obs->data_index_list = util_realloc(gen_obs->data_index_list , gen_obs->obs_size * sizeof * gen_obs->data_index_list ); - { - int iobs; - double * double_buffer = (double * ) buffer; - for (iobs = 0; iobs < gen_obs->obs_size; iobs++) { - gen_obs->obs_data[iobs] = double_buffer[2*iobs]; - gen_obs->obs_std[iobs] = double_buffer[2*iobs + 1]; - gen_obs->std_scaling[iobs] = 1.0; - gen_obs->data_index_list[iobs] = iobs; - - } - } -} - - -void gen_obs_load_observation(gen_obs_type * gen_obs, const char * obs_file) { - ecl_type_enum load_type; - void * buffer; - int buffer_size = 0; - buffer = gen_common_fload_alloc(obs_file , gen_obs->obs_format , ECL_DOUBLE_TYPE , &load_type , &buffer_size); - - /** Ensure that the data is of type double. */ - if (load_type == ECL_FLOAT_TYPE) { - double * double_data = util_calloc(gen_obs->obs_size , sizeof * double_data ); - util_float_to_double(double_data , (const float *) buffer , buffer_size); - free(buffer); - buffer = double_data; - } - - gen_obs_set_data( gen_obs , buffer_size , buffer ); - free(buffer); -} - - - -void gen_obs_set_scalar( gen_obs_type * gen_obs , double scalar_value , double scalar_std) { - double buffer[2] = { scalar_value , scalar_std }; - gen_obs_set_data( gen_obs , 2 , buffer ); -} - -void gen_obs_attach_data_index( gen_obs_type * obs , const int_vector_type * data_index ) { - util_safe_free( obs->data_index_list ); - obs->data_index_list = int_vector_alloc_data_copy( data_index ); - obs->observe_all_data = false; -} - - -void gen_obs_load_data_index( gen_obs_type * obs , const char * data_index_file) { - /* Parsing an a file with integers. */ - util_safe_free( obs->data_index_list ); - obs->data_index_list = gen_common_fscanf_alloc( data_index_file , ECL_INT_TYPE , &obs->obs_size); - obs->observe_all_data = false; -} - - -void gen_obs_parse_data_index( gen_obs_type * obs , const char * data_index_string) { - /* Parsing a string of the type "1,3,5,9-100,200,202,300-1000" */ - int_vector_type * index_list = string_util_alloc_active_list( data_index_string ); - int_vector_shrink( index_list ); - gen_obs_attach_data_index( obs , index_list ); - int_vector_free( index_list ); -} - - - -gen_obs_type * gen_obs_alloc__(gen_data_config_type * data_config , const char * obs_key) { - gen_obs_type * obs = util_malloc(sizeof * obs); - UTIL_TYPE_ID_INIT( obs , GEN_OBS_TYPE_ID ); - obs->obs_data = NULL; - obs->obs_std = NULL; - obs->std_scaling = NULL; - obs->data_index_list = NULL; - obs->obs_format = ASCII; /* Hardcoded for now. */ - obs->obs_key = util_alloc_string_copy( obs_key ); - obs->data_config = data_config; - obs->observe_all_data = true; - obs->error_covar = NULL; - return obs; -} - - -/** - data_index_file is the name of a file with indices which should be - observed, data_inde_string is the same, in the form of a - "1,2,3,4-10, 17,19,22-100" string. Only one of these items can be - != NULL. If both are NULL it is assumed that all the indices of the - gen_data instance should be observed. - - @error_covar_file is the name of file which contains a matrix of - error-covariance. The file data will be read with the function - matrix_fscanf_data(), i.e. it should consist of formatted - numbers. Since the matrix is symmetric it does not matter whether - it is represented in row-major or column-major order; newlines for - pretty reading can be inserted but are not necessary. - - The error_covar_file should contain NO header information. -*/ - - -gen_obs_type * gen_obs_alloc(gen_data_config_type * data_config , const char * obs_key , const char * obs_file , double scalar_value , double scalar_error , const char * data_index_file , const char * data_index_string , const char * error_covar_file) { - gen_obs_type * obs = gen_obs_alloc__( data_config , obs_key ); - if (obs_file) - gen_obs_load_observation(obs , obs_file ); /* The observation data is loaded - and internalized at boot time - even though it might not be needed for a long time. */ - else - gen_obs_set_scalar( obs , scalar_value , scalar_error ); - - - if (data_index_file) - gen_obs_load_data_index( obs , data_index_file ); - else if (data_index_string) - gen_obs_parse_data_index( obs , data_index_string ); - - - if (error_covar_file != NULL) { - FILE * stream = util_fopen( error_covar_file , "r"); - - obs->error_covar = matrix_alloc( obs->obs_size , obs->obs_size ); - matrix_fscanf_data( obs->error_covar , false , stream ); - - fclose( stream ); - } else - obs->error_covar = NULL; - - return obs; -} - - - -static void gen_obs_assert_data_size(const gen_obs_type * gen_obs, const gen_data_type * gen_data) { - if (gen_obs->observe_all_data) { - int data_size = gen_data_get_size( gen_data ); - if (gen_obs->obs_size != data_size) - util_abort("%s: size mismatch: Observation: %s:%d Data: %s:%d \n" , __func__ , gen_obs->obs_key , gen_obs->obs_size , gen_data_get_key( gen_data ) , data_size); - - } - /* - Else the user has explicitly entered indices to observe in the - gen_data instances, and we just have to trust them (however the - gen_data_iget() does a range check. - */ -} - - -double gen_obs_chi2(const gen_obs_type * gen_obs , const gen_data_type * gen_data, node_id_type node_id) { - gen_obs_assert_data_size(gen_obs , gen_data); - { - const bool_vector_type * forward_model_active = gen_data_config_get_active_mask( gen_obs->data_config ); - double sum_chi2 = 0; - for (int iobs = 0; iobs < gen_obs->obs_size; iobs++) { - int data_index = gen_obs->data_index_list[iobs]; - if (forward_model_active && (bool_vector_iget( forward_model_active , data_index ) == false)) - continue; /* Forward model has deactivated this index - just continue. */ - { - double d = gen_data_iget_double( gen_data , data_index); - double x = (d - gen_obs->obs_data[iobs]) / gen_obs->obs_std[iobs]; - sum_chi2 += x*x; - } - } - return sum_chi2; - } -} - - - -void gen_obs_measure(const gen_obs_type * gen_obs , const gen_data_type * gen_data , node_id_type node_id , meas_data_type * meas_data, const active_list_type * __active_list) { - gen_obs_assert_data_size(gen_obs , gen_data); - { - int active_size = active_list_get_active_size( __active_list , gen_obs->obs_size ); - meas_block_type * meas_block = meas_data_add_block( meas_data , gen_obs->obs_key , node_id.report_step , active_size ); - active_mode_type active_mode = active_list_get_mode( __active_list ); - const bool_vector_type * forward_model_active = gen_data_config_get_active_mask( gen_obs->data_config ); - - int iobs; - if (active_mode == ALL_ACTIVE) { - for (iobs = 0; iobs < gen_obs->obs_size; iobs++) { - int data_index = gen_obs->data_index_list[iobs] ; - - if (forward_model_active != NULL) { - if (!bool_vector_iget( forward_model_active , data_index )) - continue; /* Forward model has deactivated this index - just continue. */ - } - - meas_block_iset( meas_block , node_id.iens , iobs , gen_data_iget_double( gen_data , data_index )); - } - } else if ( active_mode == PARTLY_ACTIVE) { - const int * active_list = active_list_get_active( __active_list ); - int index; - - for (index = 0; index < active_size; index++) { - iobs = active_list[ index ]; - int data_index = gen_obs->data_index_list[iobs] ; - if (forward_model_active != NULL) { - if (!bool_vector_iget( forward_model_active , data_index )) - continue; /* Forward model has deactivated this index - just continue. */ - } - meas_block_iset( meas_block , node_id.iens , index , gen_data_iget_double( gen_data , data_index )); - } - } - } -} - - - -void gen_obs_get_observations(gen_obs_type * gen_obs , obs_data_type * obs_data, enkf_fs_type * fs, int report_step , const active_list_type * __active_list) { - const bool_vector_type * forward_model_active = NULL; - if (gen_data_config_has_active_mask( gen_obs->data_config , fs, report_step)) { - gen_data_config_load_active( gen_obs->data_config , fs, report_step , true); - forward_model_active = gen_data_config_get_active_mask( gen_obs->data_config ); - } - - { - active_mode_type active_mode = active_list_get_mode( __active_list ); - int active_size = active_list_get_active_size( __active_list , gen_obs->obs_size ); - obs_block_type * obs_block = obs_data_add_block( obs_data , gen_obs->obs_key , active_size , NULL , false); - - if (active_mode == ALL_ACTIVE) { - for (int iobs = 0; iobs < gen_obs->obs_size; iobs++) - obs_block_iset( obs_block , iobs , gen_obs->obs_data[iobs] , IGET_SCALED_STD( gen_obs , iobs )); - - /* Setting some of the elements as missing, i.e. deactivated by the forward model. */ - if (forward_model_active != NULL) { - for (int iobs = 0; iobs < gen_obs->obs_size; iobs++) { - int data_index = gen_obs->data_index_list[ iobs ]; - if (!bool_vector_iget( forward_model_active , data_index )) - obs_block_iset_missing( obs_block , iobs ); - } - } - } else if (active_mode == PARTLY_ACTIVE) { - const int * active_list = active_list_get_active( __active_list ); - int active_size = active_list_get_active_size( __active_list , gen_obs->obs_size); - /* - There are three different indices active at the same time here: - - active_index : [0 ... active_size> - running over the size of - the current local observation. - - iobs : [0 ... size(obs)> - running over the complete size of - the observation node. - - data_index : The index in the data space corresponding to - the observation index iobs. - - */ - - for (int active_index = 0; active_index < active_size; active_index++) { - int iobs = active_list[active_index]; - obs_block_iset( obs_block , active_index , gen_obs->obs_data[iobs] , IGET_SCALED_STD( gen_obs , iobs )); - { - int data_index = gen_obs->data_index_list[ iobs ]; - if ((forward_model_active != NULL) && (!bool_vector_iget( forward_model_active , data_index ))) - obs_block_iset_missing( obs_block , active_index ); - } - } - } - } -} - - - -/** - In general the gen_obs observation vector can be smaller than the - gen_data field it is observing, i.e. we can have a situation like - this: - - Data Obs - ---- --- - - [ 6.0 ] ----\ - [ 2.0 ] \---> [ 6.3 ] - [ 3.0 ] ---------> [ 2.8 ] - [ 2.0 ] /---> [ 4.3 ] - [ 4.5 ] ----/ - - The situation here is as follows: - - 1. We have a gen data vector with five elements. - - 2. We have an observation vector of three elements, which observes - three of the elements in the gen_data vector, in this particular - case the data_index_list of the observation equals: [0 , 2 , 4]. - - Now when we want to look at the match of observation quality of the - last element in the observation vector it would be natural to use - the user_get key: "obs_key:2" - however this is an observation of - data element number 4, i.e. as seen from data context (when adding - observations to an ensemble plot) the natural indexing would be: - "data_key:4". - - - The function gen_obs_user_get_with_data_index() will do the - translation from data based indexing to observation based indexing, i.e. - - gen_obs_user_get_with_data_index("4") - - will do an inverse lookup of the '4' and further call - - gen_obs_user_get("2") - -*/ - - -void gen_obs_user_get(const gen_obs_type * gen_obs , const char * index_key , double * value , double * std , bool * valid) { - int index; - *valid = false; - - if (util_sscanf_int( index_key , &index)) { - if ((index >= 0) && (index < gen_obs->obs_size)) { - *valid = true; - *value = gen_obs->obs_data[ index ]; - *std = gen_obs->obs_std[ index ]; - } - } -} - - - -void gen_obs_user_get_with_data_index(const gen_obs_type * gen_obs , const char * index_key , double * value , double * std , bool * valid) { - if (gen_obs->observe_all_data) - /* The observation and data vectors are equally long - no reverse lookup necessary. */ - gen_obs_user_get(gen_obs , index_key , value , std , valid); - else { - *valid = false; - int data_index; - if (util_sscanf_int( index_key , &data_index )) { - int obs_index = 0; - do { - if (gen_obs->data_index_list[ obs_index ] == data_index) - /* Found it - will use the 'obs_index' value. */ - break; - - obs_index++; - } while (obs_index < gen_obs->obs_size); - if (obs_index < gen_obs->obs_size) { /* The reverse lookup succeeded. */ - *valid = true; - *value = gen_obs->obs_data[ obs_index ]; - *std = gen_obs->obs_std[ obs_index ]; - } - } - } -} - -void gen_obs_update_std_scale(gen_obs_type * gen_obs, double std_multiplier, const active_list_type * active_list) { - if (active_list_get_mode( active_list ) == ALL_ACTIVE) { - for (int i = 0; i < gen_obs->obs_size; i++) - gen_obs->std_scaling[i] = std_multiplier; - } else { - const int * active_index = active_list_get_active( active_list ); - int size = active_list_get_active_size( active_list , gen_obs->obs_size ); - for (int i=0; i < size; i++) { - int obs_index = active_index[i]; - gen_obs->std_scaling[ obs_index ] = std_multiplier; - } - } -} - - - -int gen_obs_get_size(const gen_obs_type * gen_obs){ - return gen_obs->obs_size; -} - -double gen_obs_iget_std(const gen_obs_type * gen_obs, int index){ - return gen_obs->obs_std[index]; -} - -double gen_obs_iget_std_scaling(const gen_obs_type * gen_obs, int index) { - return gen_obs->std_scaling[index]; -} - - -double gen_obs_iget_value(const gen_obs_type * gen_obs, int index){ - return gen_obs->obs_data[index]; -} - -int gen_obs_get_obs_index(const gen_obs_type * gen_obs, int index){ - if(index < 0 || index >= gen_obs->obs_size){ - util_abort("[Gen_Obs] Index out of bounds %d [0, %d]", index, gen_obs->obs_size - 1); - } - - if (gen_obs->observe_all_data){ - return index; - } else { - return gen_obs->data_index_list[index]; - } -} - - - -/*****************************************************************/ -UTIL_IS_INSTANCE_FUNCTION(gen_obs , GEN_OBS_TYPE_ID) -VOID_FREE(gen_obs) -VOID_GET_OBS(gen_obs) -VOID_MEASURE(gen_obs , gen_data) -VOID_USER_GET_OBS(gen_obs) -VOID_CHI2(gen_obs , gen_data) -VOID_UPDATE_STD_SCALE(gen_obs) diff --git a/ThirdParty/Ert/libenkf/src/gen_test.c b/ThirdParty/Ert/libenkf/src/gen_test.c deleted file mode 100644 index 6418c70160..0000000000 --- a/ThirdParty/Ert/libenkf/src/gen_test.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'gen_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - - - - -int main(int argc , char **argv) { -} diff --git a/ThirdParty/Ert/libenkf/src/hook_manager.c b/ThirdParty/Ert/libenkf/src/hook_manager.c deleted file mode 100644 index f21254cb8e..0000000000 --- a/ThirdParty/Ert/libenkf/src/hook_manager.c +++ /dev/null @@ -1,254 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'hook_manager.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include -#include - -#include - -#include - -#include -#include -#include -#include - -#define HOOK_MANAGER_NAME "HOOK MANAGER" -#define RUNPATH_LIST_FILE ".ert_runpath_list" -#define QC_WORKFLOW_NAME "QC WORKFLOW" -#define RUN_MODE_PRE_SIMULATION_NAME "PRE_SIMULATION" -#define RUN_MODE_POST_SIMULATION_NAME "POST_SIMULATION" -#define RUN_MODE_PRE_UPDATE_NAME "PRE_UPDATE" -#define RUN_MODE_POST_UPDATE_NAME "POST_UPDATE" - -struct hook_manager_struct { - vector_type * hook_workflow_list; /* vector of hook_workflow_type instances */ - runpath_list_type * runpath_list; - ert_workflow_list_type * workflow_list; - hash_type * input_context; - - - /* Deprecated stuff */ - hook_workflow_type * post_hook_workflow; /* This is the good old QC workflow, kept for backward compatibility, obsolete */ -}; - -hook_manager_type * hook_manager_alloc( ert_workflow_list_type * workflow_list ) { - hook_manager_type * hook_manager = util_malloc( sizeof * hook_manager ); - hook_manager->hook_workflow_list = vector_alloc_new(); - - hook_manager->workflow_list = workflow_list; - - hook_manager->runpath_list = runpath_list_alloc( NULL ); - hook_manager_set_runpath_list_file( hook_manager, NULL, RUNPATH_LIST_FILE ); - - hook_manager->input_context = hash_alloc(); - - return hook_manager; -} - - -void hook_manager_free( hook_manager_type * hook_manager ) { - runpath_list_free( hook_manager->runpath_list ); - vector_free( hook_manager->hook_workflow_list ); - hash_free( hook_manager->input_context ); - free( hook_manager ); -} - - - -void hook_manager_add_input_context( hook_manager_type * hook_manager, const char * key , const char * value) { - hash_insert_hash_owned_ref(hook_manager->input_context, key, util_alloc_string_copy(value), free); -} - - - -runpath_list_type * hook_manager_get_runpath_list( hook_manager_type * hook_manager ) { - return hook_manager->runpath_list; -} - - -static void hook_manager_add_workflow( hook_manager_type * hook_manager , const char * workflow_name , hook_run_mode_enum run_mode) { - if (ert_workflow_list_has_workflow( hook_manager->workflow_list , workflow_name) ){ - workflow_type * workflow = ert_workflow_list_get_workflow( hook_manager->workflow_list , workflow_name); - hook_workflow_type * hook = hook_workflow_alloc( workflow , run_mode ); - vector_append_owned_ref(hook_manager->hook_workflow_list, hook , hook_workflow_free__); - } - else { - fprintf(stderr, "** Warning: While hooking workflow: %s not recognized among the list of loaded workflows.", workflow_name); - } -} - - - -void hook_manager_init( hook_manager_type * hook_manager , const config_content_type * config_content) { - - /* Old stuff explicitly prefixed with QC */ - { - if (config_content_has_item( config_content , QC_WORKFLOW_KEY)) { - char * workflow_name; - const char * file_name = config_content_get_value_as_path(config_content , QC_WORKFLOW_KEY); - util_alloc_file_components( file_name , NULL , &workflow_name , NULL ); - workflow_type * workflow = ert_workflow_list_add_workflow( hook_manager->workflow_list , file_name , workflow_name); - if (workflow != NULL) { - hook_workflow_type * hook = hook_workflow_alloc( workflow , POST_SIMULATION ); - vector_append_owned_ref(hook_manager->hook_workflow_list, hook , hook_workflow_free__); - } - } - } - - - - if (config_content_has_item( config_content , HOOK_WORKFLOW_KEY)) { - for (int ihook = 0; ihook < config_content_get_occurences(config_content , HOOK_WORKFLOW_KEY); ihook++) { - const char * workflow_name = config_content_iget( config_content , HOOK_WORKFLOW_KEY, ihook , 0 ); - hook_run_mode_enum run_mode = hook_workflow_run_mode_from_name(config_content_iget(config_content , HOOK_WORKFLOW_KEY , ihook , 1)); - hook_manager_add_workflow( hook_manager , workflow_name , run_mode ); - } - } - - - if (config_content_has_item( config_content , RUNPATH_FILE_KEY)) - hook_manager_set_runpath_list_file( hook_manager, NULL, config_content_get_value( config_content , RUNPATH_FILE_KEY)); -} - - - -void hook_manager_add_config_items( config_parser_type * config ) { - config_schema_item_type * item; - - /* Old stuff - explicitly prefixed with QC. */ - { - item = config_add_schema_item( config , QC_PATH_KEY , false ); - config_schema_item_set_argc_minmax(item , 1 , 1 ); - config_install_message( config , QC_PATH_KEY , "The \'QC_PATH\' keyword is ignored."); - - - item = config_add_schema_item( config , QC_WORKFLOW_KEY , false ); - config_schema_item_set_argc_minmax(item , 1 , 1 ); - config_schema_item_iset_type( item , 0 , CONFIG_EXISTING_PATH ); - - config_install_message( config , QC_WORKFLOW_KEY , "The \'QC_WORKFLOW\' keyword is deprecated - use \'HOOK_WORKFLOW\' instead"); - } - - item = config_add_schema_item( config , HOOK_WORKFLOW_KEY , false ); - config_schema_item_set_argc_minmax(item , 2 , 2 ); - config_schema_item_iset_type( item , 0 , CONFIG_STRING ); - config_schema_item_iset_type( item , 1 , CONFIG_STRING ); - { - char ** argv = util_malloc( 4 * sizeof * argv ); - - argv[0] = RUN_MODE_PRE_SIMULATION_NAME; - argv[1] = RUN_MODE_POST_SIMULATION_NAME; - argv[2] = RUN_MODE_PRE_UPDATE_NAME; - argv[3] = RUN_MODE_POST_UPDATE_NAME; - config_schema_item_set_indexed_selection_set(item, 1, 4, (const char **) argv); - - free( argv ); - } - - item = config_add_schema_item( config , RUNPATH_FILE_KEY , false ); - config_schema_item_set_argc_minmax(item , 1 , 1 ); -} - - -void hook_manager_export_runpath_list( const hook_manager_type * hook_manager ) { - runpath_list_fprintf( hook_manager->runpath_list ); -} - -const char * hook_manager_get_runpath_list_file( const hook_manager_type * hook_manager) { - return runpath_list_get_export_file( hook_manager->runpath_list ); -} - -static void hook_manager_set_runpath_list_file__( hook_manager_type * hook_manager , const char * runpath_list_file) { - runpath_list_set_export_file( hook_manager->runpath_list , runpath_list_file ); -} - -void hook_manager_set_runpath_list_file( hook_manager_type * hook_manager , const char * basepath, const char * filename) { - if (filename && util_is_abs_path( filename )) - hook_manager_set_runpath_list_file__( hook_manager , filename ); - else { - const char * file = RUNPATH_LIST_FILE; - - if (filename != NULL) - file = filename; - - char * file_with_path_prefix = NULL; - if (basepath != NULL) { - file_with_path_prefix = util_alloc_filename(basepath, file, NULL); - } - else - file_with_path_prefix = util_alloc_string_copy(file); - - { - char * absolute_path = util_alloc_abs_path(file_with_path_prefix); - hook_manager_set_runpath_list_file__( hook_manager , absolute_path ); - free( absolute_path ); - } - - free(file_with_path_prefix); - } -} - - -void hook_manager_run_workflows( const hook_manager_type * hook_manager , hook_run_mode_enum run_mode , void * self ) -{ - bool verbose = false; - for (int i=0; i < vector_get_size( hook_manager->hook_workflow_list ); i++) { - hook_workflow_type * hook_workflow = vector_iget( hook_manager->hook_workflow_list , i ); - if (hook_workflow_get_run_mode(hook_workflow) == run_mode) { - workflow_type * workflow = hook_workflow_get_workflow( hook_workflow ); - workflow_run( workflow, self , verbose , ert_workflow_list_get_context( hook_manager->workflow_list )); - /* - The workflow_run function will return a bool to indicate - success/failure, and in the case of error the function - workflow_get_last_error() can be used to get a config_error - object. - */ - } - } -} - -const hook_workflow_type * hook_manager_iget_hook_workflow(const hook_manager_type * hook_manager, int index){ - return vector_iget(hook_manager->hook_workflow_list, index); -} - -int hook_manager_get_size(const hook_manager_type * hook_manager){ - return vector_get_size(hook_manager->hook_workflow_list); -} - - -/*****************************************************************/ -/* Deprecated stuff */ -/*****************************************************************/ - - - -bool hook_manager_run_post_hook_workflow( const hook_manager_type * hook_manager , void * self) { - const char * export_file = runpath_list_get_export_file( hook_manager->runpath_list ); - if (!util_file_exists( export_file )) - fprintf(stderr,"** Warning: the file:%s with a list of runpath directories was not found - workflow will probably fail.\n" , export_file); - - return hook_workflow_run_workflow(hook_manager->post_hook_workflow, hook_manager->workflow_list, self); -} - - - diff --git a/ThirdParty/Ert/libenkf/src/hook_workflow.c b/ThirdParty/Ert/libenkf/src/hook_workflow.c deleted file mode 100644 index 227f038a70..0000000000 --- a/ThirdParty/Ert/libenkf/src/hook_workflow.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - Copyright (C) 2015 Statoil ASA, Norway. - - The file 'hook_workflow.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include -#include - -#include - -#include - -#include -#include - -#define RUN_MODE_PRE_SIMULATION_NAME "PRE_SIMULATION" -#define RUN_MODE_POST_SIMULATION_NAME "POST_SIMULATION" -#define RUN_MODE_PRE_UPDATE_NAME "PRE_UPDATE" -#define RUN_MODE_POST_UPDATE_NAME "POST_UPDATE" - -#define HOOK_WORKFLOW_TYPE_ID 7321780 - -struct hook_workflow_struct { - UTIL_TYPE_ID_DECLARATION; - hook_run_mode_enum run_mode; - workflow_type * workflow; -}; - - -static UTIL_SAFE_CAST_FUNCTION( hook_workflow , HOOK_WORKFLOW_TYPE_ID); - -hook_workflow_type * hook_workflow_alloc( workflow_type * workflow , hook_run_mode_enum run_mode ) { - hook_workflow_type * hook_workflow = util_malloc( sizeof * hook_workflow ); - UTIL_TYPE_ID_INIT( hook_workflow , HOOK_WORKFLOW_TYPE_ID); - hook_workflow->run_mode = run_mode; - hook_workflow->workflow = workflow; - return hook_workflow; -} - -void hook_workflow_free( hook_workflow_type * hook_workflow ) { - free( hook_workflow ); -} - -void hook_workflow_free__( void * arg ) { - hook_workflow_type * hook_workflow = hook_workflow_safe_cast( arg ); - hook_workflow_free( hook_workflow ); -} - - - -workflow_type* hook_workflow_get_workflow( const hook_workflow_type * hook_workflow ) { - return hook_workflow->workflow; -} - - -bool hook_workflow_run_workflow( const hook_workflow_type * hook_workflow, ert_workflow_list_type * workflow_list, void * self) { - bool verbose = false; - if (hook_workflow->workflow != NULL ) { - bool result = ert_workflow_list_run_workflow__( workflow_list, hook_workflow->workflow , verbose , self); - return result; - } - else - return false; -} - - -hook_run_mode_enum hook_workflow_run_mode_from_name( const char * run_mode ) { - hook_run_mode_enum mode; - if (strcmp( run_mode , RUN_MODE_PRE_SIMULATION_NAME) == 0) - mode = PRE_SIMULATION; - else if (strcmp( run_mode , RUN_MODE_POST_SIMULATION_NAME) == 0) - mode = POST_SIMULATION; - else if (strcmp( run_mode , RUN_MODE_PRE_UPDATE_NAME) == 0) - mode = PRE_UPDATE; - else if (strcmp( run_mode , RUN_MODE_POST_UPDATE_NAME) == 0) - mode = POST_UPDATE; - else { - util_abort("%s: unrecognized run mode :%s \n",__func__ , run_mode); - mode = -1; /* Dummy */ - } - return mode; -} - - -hook_run_mode_enum hook_workflow_get_run_mode( const hook_workflow_type * hook_workflow ){ - return hook_workflow->run_mode; -} - diff --git a/ThirdParty/Ert/libenkf/src/local_config.c b/ThirdParty/Ert/libenkf/src/local_config.c deleted file mode 100644 index 256216f5a9..0000000000 --- a/ThirdParty/Ert/libenkf/src/local_config.c +++ /dev/null @@ -1,298 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'local_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include -#include - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/******************************************************************/ - -/* - - +-------------------------- local_updatestep_type ---------------------------------------+ - | | - | | - | +----------------- local_ministep_type --------------------------------------+ | - | | | | - | | / +--- local_dataset_type ---+ | | - | | | | PRESSURE | | | - | | | | SWAT | | | - | | | | SGAS | | | - | | | +--------------------------+ | | - | | +-- local_obsset_type ---+ | | | - | | | WWCT:OP_2 | | +--- local_dataset_type ---+ | | - | | | WGOR:OP_1 | | | MULTFLT1 | | | - | | | RFT:WELL1 | <------| | MULTFLT2 | | | - | | | RFT:WELL3 | | | MULTFLT3 | | | - | | | WWCT:WELLX | | +--------------------------+ | | - | | +------------------------+ | | | - | | | +--- local_dataset_type ---+ | | - | | | | RELPERM1 | | | - | | | | RELPERM2 | | | - | | | | RELPERM3 | | | - | | \ +--------------------------+ | | - | | | | - | +----------------------------------------------------------------------------+ | - | | - | | - | +----------------- local_ministep_type --------------------------------------+ | - | | | | - | | / +--- local_dataset_type ---+ | | - | | +-- local_obsset_type ---+ | | PERMX PORO | | | - | | | 4D Seismic | | | PRESSURE SWAT | | | - | | | Gravimetri | | | SGAS | | | - | | | | <------| +--------------------------+ | | - | | | | | | | - | | | | | +--- local_dataset_type ---+ | | - | | +------------------------+ | | MULTFLT1 | | | - | | | | MULTFLT2 | | | - | | | | MULTFLT3 | | | - | | \ +--------------------------+ | | - | | | | - | +----------------------------------------------------------------------------+ | - | | - +----------------------------------------------------------------------------------------+ - -This figure illustrates the different objects when configuring local -analysis: - -local_updatestep_type: This is is the top level configuration of the - updating at one timestep. In principle you can have different - updatestep configurations at the different timesteps, but it will - typically be identical for all the time steps. Observe that the - update at one time step can typically conist of several enkf - updates, this is handled by using several local_ministep. - -local_ministep_type: The ministep defines a collection of observations - and state/parameter variables which are mutually dependant on - eachother and should be updated together. The local_ministep will - consist of *ONE* local_obsset of observations, and one or more - local_dataset of data which should be updated. - -local_obsset_type: This is a collection of observation data; there is - exactly one local_obsset for each local_ministep. - -local_dataset_type: This is a collection of data/parameters which - should be updated together in the EnKF updating. - - -How the local_dataset_type is configured is quite important for the -core EnKF updating: - - 1. All the members in one local_dataset instance are serialized and - packed in the A-matrix together; i.e. in the example above the - parameters RELPERM1,RELPERM2 and RELPERM3 are updated in one go. - - 2. When using the standard EnKF the X matrix is calculated using - the actual data vectors, and the results will be identical if we - use one large local_dataset instance or several small. However - when using more advanced techniques where the A matrix is used - explicitly when calculating the update this will matter. - - 3. If you have not entered a local configuration explicitly the - default ALL_ACTIVE local configuration will be used. -*/ - - -struct local_config_struct { - local_updatestep_type * default_updatestep; /* A default report step returned if no particular report step has been installed for this time index. */ - hash_type * updatestep_storage; /* These three hash tables are the 'holding area' for the local_updatestep, */ - hash_type * ministep_storage; /* local_ministep instances. */ - hash_type * dataset_storage; - hash_type * obsdata_storage; -}; - - -/** - Instances of local_updatestep and local_ministep are allocated from - the local_config object, and then subsequently manipulated from the calling scope. -*/ - -static local_updatestep_type * local_config_alloc_updatestep( local_config_type * local_config , const char * key ) { - local_updatestep_type * updatestep = local_updatestep_alloc( key ); - hash_insert_hash_owned_ref( local_config->updatestep_storage , key , updatestep , local_updatestep_free__); - return updatestep; -} - - - -void local_config_clear( local_config_type * local_config ) { - local_config->default_updatestep = NULL; - hash_clear( local_config->updatestep_storage ); - hash_clear( local_config->ministep_storage ); - hash_clear( local_config->dataset_storage ); - hash_clear( local_config->obsdata_storage ); - local_config->default_updatestep = local_config_alloc_updatestep(local_config, "DEFAULT"); -} - - - - -local_config_type * local_config_alloc( ) { - local_config_type * local_config = util_malloc( sizeof * local_config ); - - local_config->default_updatestep = NULL; - local_config->updatestep_storage = hash_alloc(); - local_config->ministep_storage = hash_alloc(); - local_config->dataset_storage = hash_alloc(); - local_config->obsdata_storage = hash_alloc(); - - local_config_clear( local_config ); - return local_config; -} - - -void local_config_free(local_config_type * local_config) { - hash_free( local_config->updatestep_storage ); - hash_free( local_config->ministep_storage); - hash_free( local_config->dataset_storage); - hash_free( local_config->obsdata_storage); - free( local_config ); -} - -local_ministep_type * local_config_alloc_ministep( local_config_type * local_config , const char * key, analysis_module_type* analysis_module) { - local_ministep_type * ministep = local_ministep_alloc( key, analysis_module ); - hash_insert_hash_owned_ref( local_config->ministep_storage , key , ministep , local_ministep_free__); - return ministep; -} - -local_obsdata_type * local_config_alloc_obsdata( local_config_type * local_config , const char * obsdata_name ) { - if (local_config_has_obsdata(local_config, obsdata_name)) - util_abort("%s: tried to add existing obsdata node key:%s \n",__func__ , obsdata_name); - - local_obsdata_type * obsdata = local_obsdata_alloc( obsdata_name ); - hash_insert_hash_owned_ref( local_config->obsdata_storage , obsdata_name , obsdata , local_obsdata_free__); - return obsdata; -} - -bool local_config_has_obsdata( const local_config_type * local_config , const char * key) { - return hash_has_key( local_config->obsdata_storage , key ); -} - - -local_dataset_type * local_config_alloc_dataset( local_config_type * local_config , const char * key ) { - if (local_config_has_dataset(local_config, key)) - util_abort("%s: tried to add existing dataset node key:%s \n",__func__ , key); - - local_dataset_type * dataset = local_dataset_alloc( key ); - hash_insert_hash_owned_ref( local_config->dataset_storage , key , dataset , local_dataset_free__); - return dataset; -} - -bool local_config_has_dataset( const local_config_type * local_config , const char * key) { - return hash_has_key( local_config->dataset_storage , key ); -} - - -local_dataset_type * local_config_alloc_dataset_copy( local_config_type * local_config , const char * src_key , const char * target_key) { - local_dataset_type * src_dataset = hash_get( local_config->dataset_storage , src_key ); - local_dataset_type * copy_dataset = local_dataset_alloc_copy( src_dataset , target_key ); - - hash_insert_hash_owned_ref( local_config->dataset_storage , target_key , copy_dataset , local_dataset_free__); - return copy_dataset; -} - - -local_obsdata_type * local_config_alloc_obsdata_copy( local_config_type * local_config , const char * src_key , const char * target_key) { - local_obsdata_type * src_obsdata = hash_get( local_config->obsdata_storage , src_key ); - local_obsdata_type * copy_obsdata = local_obsdata_alloc_copy( src_obsdata , target_key ); - - hash_insert_hash_owned_ref( local_config->obsdata_storage , target_key , copy_obsdata , local_obsdata_free__); - return copy_obsdata; -} - - -local_ministep_type * local_config_get_ministep( const local_config_type * local_config , const char * key) { - local_ministep_type * ministep = hash_get( local_config->ministep_storage , key ); - return ministep; -} - - -local_obsdata_type * local_config_get_obsdata( const local_config_type * local_config , const char * key) { - local_obsdata_type * obsdata = hash_get( local_config->obsdata_storage , key ); - return obsdata; -} - -local_dataset_type * local_config_get_dataset( const local_config_type * local_config , const char * key) { - local_dataset_type * dataset = hash_get( local_config->dataset_storage , key ); - return dataset; -} - -local_ministep_type * local_config_alloc_ministep_copy( local_config_type * local_config , const char * src_key , const char * new_key) { - local_ministep_type * src_step = hash_get( local_config->ministep_storage , src_key ); - local_ministep_type * new_step = local_ministep_alloc_copy( src_step , new_key ); - hash_insert_hash_owned_ref( local_config->ministep_storage , new_key , new_step , local_ministep_free__); - return new_step; -} - - - -local_updatestep_type * local_config_get_updatestep( const local_config_type * local_config) { - local_updatestep_type * updatestep = local_config->default_updatestep; - - if (updatestep == NULL) - util_exit("%s: fatal error. No report step information for step:%d - and no default \n",__func__ , index); - - return updatestep; -} - - -void local_config_summary_fprintf( const local_config_type * local_config , const char * config_file) { - - FILE * stream = util_mkdir_fopen( config_file , "w"); - - const local_updatestep_type * updatestep = local_config_get_updatestep( local_config ); // There is only one update step, the default - { - hash_iter_type * hash_iter = hash_iter_alloc( local_config->ministep_storage ); - - while (!hash_iter_is_complete( hash_iter )) { - const local_ministep_type * ministep = hash_iter_get_next_value( hash_iter ); - - fprintf(stream , "UPDATE_STEP:%s,", local_updatestep_get_name(updatestep)); - - local_ministep_summary_fprintf( ministep , stream); - - } - - hash_iter_free( hash_iter ); - } - - fclose( stream ); -} diff --git a/ThirdParty/Ert/libenkf/src/local_context.c b/ThirdParty/Ert/libenkf/src/local_context.c deleted file mode 100644 index bb2ac13648..0000000000 --- a/ThirdParty/Ert/libenkf/src/local_context.c +++ /dev/null @@ -1,132 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'local_context.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -#include -#include - -#include -#include -#include - -#include - -#include - -struct local_context_struct { - hash_type * ecl_regions; - hash_type * files; - hash_type * polygons; - hash_type * grids; - hash_type * surfaces; - hash_type * surface_regions; -}; - - - -local_context_type * local_context_alloc( const ecl_grid_type * ecl_grid ) { - local_context_type * context = util_malloc( sizeof * context ); - context->surface_regions = hash_alloc(); - context->ecl_regions = hash_alloc(); - context->files = hash_alloc(); - context->polygons = hash_alloc(); - context->grids = hash_alloc(); - context->surfaces = hash_alloc(); - - hash_insert_ref( context->grids , GLOBAL_GRID , ecl_grid ); - return context; -} - - -void local_context_free( local_context_type * context) { - hash_free( context->ecl_regions ); - hash_free( context->files ); - hash_free( context->polygons ); - hash_free( context->grids ); - hash_free( context->surfaces ); - hash_free( context->surface_regions ); -} - - - -ecl_region_type * local_context_get_ecl_region( local_context_type * context , const char * region_name) { - return hash_get( context->ecl_regions , region_name ); -} - -void local_context_create_ecl_region( local_context_type * context , const char * grid_name , const char * region_name , bool preselect ) { - ecl_grid_type * grid = hash_get( context->grids , grid_name); - ecl_region_type * new_region = ecl_region_alloc( grid , preselect ); - hash_insert_hash_owned_ref( context->ecl_regions , region_name , new_region , ecl_region_free__ ); -} - -/*************************/ - -geo_region_type * local_context_get_surface_region( local_context_type * context , const char * region_name) { - return hash_get( context->surface_regions , region_name ); -} - -void local_context_create_surface_region( local_context_type * context , const char * surface_name , const char * region_name , bool preselect ) { - geo_surface_type * base_surface = hash_get( context->surfaces , surface_name ); - geo_region_type * new_region = geo_region_alloc( geo_surface_get_pointset( base_surface ) , preselect ); - hash_insert_hash_owned_ref( context->surface_regions , region_name , new_region , geo_region_free__ ); -} - -/*************************/ - -void local_context_load_file( local_context_type * context , const char * filename , const char * file_key ) { - ecl_file_type * ecl_file = ecl_file_open( filename , 0); - hash_insert_hash_owned_ref( context->files , file_key , ecl_file , ecl_file_free__); -} - - -ecl_file_type * local_context_get_file( local_context_type * context , const char * file_key ) { - return hash_get( context->files , file_key ); -} - -/*************************/ - -static void local_context_add_polygon__( local_context_type * context , const char * polygon_name , geo_polygon_type * polygon) { - hash_insert_hash_owned_ref( context->polygons , polygon_name , polygon , geo_polygon_free__); -} - -void local_context_add_polygon( local_context_type * context , const char * polygon_name ) { - geo_polygon_type * polygon = geo_polygon_alloc( polygon_name ); - local_context_add_polygon__(context , polygon_name , polygon ); -} - -void local_context_load_polygon( local_context_type * context , const char * polygon_name , const char * polygon_file) { - geo_polygon_type * polygon = geo_polygon_fload_alloc_irap( polygon_file ); - hash_insert_hash_owned_ref( context->polygons , polygon_name , polygon , geo_polygon_free__); -} - - -geo_polygon_type * local_context_get_polygon( local_context_type * context , const char * polygon_name ) { - return hash_get( context->polygons , polygon_name ); -} - -/*************************/ - -void local_context_load_surface( local_context_type * context , const char * surface_name , const char * surface_file) { - geo_surface_type * surface = geo_surface_fload_alloc_irap( surface_file , true ); - hash_insert_hash_owned_ref( context->surfaces , surface_name , surface , geo_surface_free__); -} - -geo_surface_type * local_context_get_surface( local_context_type * context , const char * surface_name) { - return hash_get( context->surfaces , surface_name ); -} diff --git a/ThirdParty/Ert/libenkf/src/local_dataset.c b/ThirdParty/Ert/libenkf/src/local_dataset.c deleted file mode 100644 index a6f44bb4a3..0000000000 --- a/ThirdParty/Ert/libenkf/src/local_dataset.c +++ /dev/null @@ -1,137 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'local_dataset.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include - -#include -#include - -#include -#include -#include -#include -#include - - -#define LOCAL_DATASET_TYPE_ID 6615409 - -struct local_dataset_struct { - UTIL_TYPE_ID_DECLARATION; - char * name; - hash_type * nodes; /* A hash table indexed by node keys - each element is an active_list instance. */ -}; - - - -UTIL_SAFE_CAST_FUNCTION(local_dataset , LOCAL_DATASET_TYPE_ID) -UTIL_IS_INSTANCE_FUNCTION(local_dataset , LOCAL_DATASET_TYPE_ID) - - -local_dataset_type * local_dataset_alloc( const char * name ) { - local_dataset_type * dataset = util_malloc( sizeof * dataset); - - UTIL_TYPE_ID_INIT( dataset , LOCAL_DATASET_TYPE_ID ); - dataset->nodes = hash_alloc(); - dataset->name = util_alloc_string_copy( name ); - - return dataset; -} - -local_dataset_type * local_dataset_alloc_copy( local_dataset_type * src_dataset , const char * copy_name ) { - local_dataset_type * copy_dataset = local_dataset_alloc( copy_name ); - hash_iter_type * node_iter = hash_iter_alloc( src_dataset->nodes ); - - while (!hash_iter_is_complete( node_iter )) { - const char * key = hash_iter_get_next_key( node_iter ); - active_list_type * active_list = active_list_alloc_copy( hash_get( src_dataset->nodes , key ) ); - hash_insert_hash_owned_ref( copy_dataset->nodes , key , active_list , active_list_free__); - } - - hash_iter_free( node_iter ); - return copy_dataset; -} - - -void local_dataset_free( local_dataset_type * dataset ) { - util_safe_free(dataset->name); - hash_free( dataset->nodes ); - free( dataset ); -} - -void local_dataset_free__( void * arg ) { - local_dataset_type * local_dataset = local_dataset_safe_cast( arg ); - local_dataset_free( local_dataset ); -} - -const char * local_dataset_get_name( const local_dataset_type * dataset) { - return dataset->name; -} - - - -void local_dataset_add_node(local_dataset_type * dataset, const char *node_key) { - if (hash_has_key( dataset->nodes , node_key )) - util_abort("%s: tried to add existing node key:%s \n",__func__ , node_key); - - hash_insert_hash_owned_ref( dataset->nodes , node_key , active_list_alloc( ALL_ACTIVE ) , active_list_free__); -} - -bool local_dataset_has_key(const local_dataset_type * dataset, const char * key) { - return hash_has_key( dataset->nodes , key ); -} - - -void local_dataset_del_node( local_dataset_type * dataset , const char * node_key) { - hash_del( dataset->nodes , node_key ); -} - - -void local_dataset_clear( local_dataset_type * dataset) { - hash_clear( dataset->nodes ); -} - - -active_list_type * local_dataset_get_node_active_list(const local_dataset_type * dataset , const char * node_key ) { - return hash_get( dataset->nodes , node_key ); /* Fails hard if you do not have the key ... */ -} - -stringlist_type * local_dataset_alloc_keys( const local_dataset_type * dataset ) { - return hash_alloc_stringlist( dataset->nodes ); -} - -void local_dataset_summary_fprintf( const local_dataset_type * dataset , FILE * stream) { -{ - hash_iter_type * data_iter = hash_iter_alloc( dataset->nodes ); - while (!hash_iter_is_complete( data_iter )) { - const char * data_key = hash_iter_get_next_key( data_iter ); - fprintf(stream , "NAME OF DATA:%s,", data_key ); - - active_list_type * active_list = hash_get( dataset->nodes , data_key ); - active_list_summary_fprintf( active_list , local_dataset_get_name(dataset) , data_key , stream); - } - hash_iter_free( data_iter ); - } -} - - -int local_dataset_get_size( const local_dataset_type * dataset ) { - return hash_get_size( dataset->nodes ); -} - diff --git a/ThirdParty/Ert/libenkf/src/local_ministep.c b/ThirdParty/Ert/libenkf/src/local_ministep.c deleted file mode 100644 index 500ee47eaa..0000000000 --- a/ThirdParty/Ert/libenkf/src/local_ministep.c +++ /dev/null @@ -1,274 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'local_ministep.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -/** - This file implements a 'ministep' configuration for active / - inactive observations and parameters for ONE enkf update. Observe - that the updating at one report step can consist of several - socalled ministeps, i.e. first the northern part of the field with - the relevant observations, and then the southern part. - - The implementation, in local_ministep_type, is quite simple, it - only contains the keys for the observations and nodes, with an - accompanying pointer to an active_list instance which denotes the - active indices. Observe that this implementation offers no access - to the internals of the underlying enkf_node / obs_node objects. -*/ - - -#define LOCAL_MINISTEP_TYPE_ID 661066 - - - - -struct local_ministep_struct { - UTIL_TYPE_ID_DECLARATION; - char * name; /* A name used for this ministep - string is also used as key in a hash table holding this instance. */ - hash_type * datasets; /* A hash table of local_dataset_type instances - indexed by the name of the datasets. */ - local_obsdata_type * observations; - analysis_module_type * analysis_module; -}; - - -/** - Observe there is no link between the instances here and the real - observations/nodes (apart from the key in the hash). -*/ - -UTIL_SAFE_CAST_FUNCTION(local_ministep , LOCAL_MINISTEP_TYPE_ID) -UTIL_IS_INSTANCE_FUNCTION(local_ministep , LOCAL_MINISTEP_TYPE_ID) - -local_ministep_type * local_ministep_alloc(const char * name, analysis_module_type* analysis_module) { - local_ministep_type * ministep = util_malloc( sizeof * ministep ); - - ministep->name = util_alloc_string_copy( name ); - - char* obsdata_name = "OBSDATA_"; - char* result = malloc(strlen(obsdata_name)+strlen(name)+1); - strcpy(result, obsdata_name); - strcat(result, name); - ministep->observations = local_obsdata_alloc(result); - - - ministep->datasets = hash_alloc(); - ministep->analysis_module = analysis_module; - UTIL_TYPE_ID_INIT( ministep , LOCAL_MINISTEP_TYPE_ID); - - return ministep; -} - - -local_ministep_type * local_ministep_alloc_copy( const local_ministep_type * src , const char * name) { - //local_ministep_type * new = local_ministep_alloc( name ); - //{ - // hash_iter_type * obs_iter = hash_iter_alloc( src->observations ); - // while (!hash_iter_is_complete( obs_iter )) { - // const char * obs_key = hash_iter_get_next_key( obs_iter ); - // active_list_type * active_list_copy = active_list_alloc_copy( hash_get( src->observations , obs_key) ); - // hash_insert_hash_owned_ref( new->observations , obs_key , active_list_copy , active_list_free__); - // } - //} - // - //{ - // hash_iter_type * nodeset_iter = hash_iter_alloc( src->datasets ); - // while (!hash_iter_is_complete( nodeset_iter )) { - // const char * nodeset_key = hash_iter_get_next_key( nodeset_iter ); - // local_nodeset_type * new_nodeset = local_nodeset_alloc_copy( hash_get( src->datasets , nodeset_key )); - // hash_insert_ref( new->datasets , nodeset_key , new_nodeset ); - // } - //} - // - //return new; - return NULL; -} - - - -void local_ministep_free(local_ministep_type * ministep) { - free(ministep->name); - hash_free( ministep->datasets ); - local_obsdata_free(ministep->observations); - free( ministep ); -} - - -void local_ministep_free__(void * arg) { - local_ministep_type * ministep = local_ministep_safe_cast( arg ); - local_ministep_free( ministep ); -} - - - - - -/** - When adding observations and update nodes here observe the following: - - 1. The thing will fail hard if you try to add a node/obs which is - already in the hash table. - - 2. The newly added elements will be assigned an active_list - instance with mode ALL_ACTIVE. -*/ - - - -void local_ministep_add_dataset( local_ministep_type * ministep , const local_dataset_type * dataset) { - hash_insert_ref( ministep->datasets , local_dataset_get_name( dataset ) , dataset ); -} - -void local_ministep_add_obsdata( local_ministep_type * ministep , local_obsdata_type * obsdata) { - if (ministep->observations == NULL) - ministep->observations = obsdata; - else { // Add nodes from input observations to existing observations - int iobs; - for (iobs = 0; iobs < local_obsdata_get_size( obsdata ); iobs++) { - local_obsdata_node_type * obs_node = local_obsdata_iget( obsdata , iobs ); - local_obsdata_node_type * new_node = local_obsdata_node_alloc_copy(obs_node); - local_ministep_add_obsdata_node(ministep, new_node); - } - } -} - -void local_ministep_add_obsdata_node( local_ministep_type * ministep , local_obsdata_node_type * obsdatanode) { - local_obsdata_type * obsdata = local_ministep_get_obsdata(ministep); - local_obsdata_add_node(obsdata, obsdatanode); -} - -bool local_ministep_has_dataset( const local_ministep_type * ministep, const char * dataset_name) { - return hash_has_key( ministep->datasets, dataset_name ); -} - -int local_ministep_get_num_dataset( const local_ministep_type * ministep ) { - return hash_get_size( ministep->datasets ); -} - -local_dataset_type * local_ministep_get_dataset( const local_ministep_type * ministep, const char * dataset_name) { - return hash_get( ministep->datasets, dataset_name ); -} - -local_obsdata_type * local_ministep_get_obsdata( const local_ministep_type * ministep ) { - return ministep->observations; -} - -const char * local_ministep_get_name( const local_ministep_type * ministep ) { - return ministep->name; -} - -/*****************************************************************/ - -hash_iter_type * local_ministep_alloc_dataset_iter( const local_ministep_type * ministep ) { - return hash_iter_alloc( ministep->datasets ); -} - -/*****************************************************************/ - -/* - The keys referenced in the local_ministep_alloc_data_keys() and - local_ministep_has_data_key() are the underlying *enkf_node* keys - - not the keys used to index the local_datasets managed by this - local_ministep. -*/ - -stringlist_type * local_ministep_alloc_data_keys( const local_ministep_type * ministep ) { - stringlist_type * keys = stringlist_alloc_new(); - { - hash_iter_type * dataset_iter = hash_iter_alloc( ministep->datasets ); - while (!hash_iter_is_complete( dataset_iter )) { - const local_dataset_type * dataset = hash_iter_get_next_value( dataset_iter ); - stringlist_type * node_keys = local_dataset_alloc_keys( dataset ); - for (int i=0; i < stringlist_get_size( node_keys ); i++) { - const char * data_key = stringlist_iget( node_keys , i ); - if (!stringlist_contains(keys , data_key )) - stringlist_append_copy( keys , data_key ); - } - stringlist_free( node_keys ); - } - hash_iter_free( dataset_iter ); - } - return keys; -} - - -bool local_ministep_has_data_key(const local_ministep_type * ministep , const char * key) { - bool has_key = false; - { - hash_iter_type * dataset_iter = hash_iter_alloc( ministep->datasets ); - - while (true) { - const local_dataset_type * dataset = hash_iter_get_next_value( dataset_iter ); - if (dataset) { - if (local_dataset_has_key( dataset , key)) { - has_key = true; - break; - } - } else - break; - } - - hash_iter_free( dataset_iter ); - } - return has_key; -} - -bool local_ministep_has_analysis_module( const local_ministep_type * ministep){ - return ministep->analysis_module != NULL; -} - -analysis_module_type* local_ministep_get_analysis_module( const local_ministep_type * ministep ){ - return ministep->analysis_module; -} - -void local_ministep_summary_fprintf( const local_ministep_type * ministep , FILE * stream) { - - fprintf(stream , "MINISTEP:%s,", ministep->name); - - { - /* Dumping all the DATASET instances. */ - { - hash_iter_type * dataset_iter = hash_iter_alloc( ministep->datasets ); - while (!hash_iter_is_complete( dataset_iter )) { - const local_dataset_type * dataset = hash_iter_get_next_value( dataset_iter ); - local_dataset_summary_fprintf(dataset, stream); - } - hash_iter_free( dataset_iter ); - } - - /* Only one OBSDATA */ - local_obsdata_type * obsdata = local_ministep_get_obsdata(ministep); - local_obsdata_summary_fprintf( obsdata , stream); - fprintf(stream, "\n"); - } -} - - diff --git a/ThirdParty/Ert/libenkf/src/local_obsdata.c b/ThirdParty/Ert/libenkf/src/local_obsdata.c deleted file mode 100644 index 4b20d242f8..0000000000 --- a/ThirdParty/Ert/libenkf/src/local_obsdata.c +++ /dev/null @@ -1,165 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'local_obsdata.c' - - ERT 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. - - ERT 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 - for more details. -*/ -#include - -#include -#include -#include -#include - -#include -#include - - -#define LOCAL_OBSDATA_TYPE_ID 86331309 - -struct local_obsdata_struct { - UTIL_TYPE_ID_DECLARATION; - hash_type * nodes_map; - vector_type * nodes_list; - char * name; -}; - - - -UTIL_IS_INSTANCE_FUNCTION( local_obsdata , LOCAL_OBSDATA_TYPE_ID ) -static UTIL_SAFE_CAST_FUNCTION( local_obsdata , LOCAL_OBSDATA_TYPE_ID ) - -local_obsdata_type * local_obsdata_alloc( const char * name) { - local_obsdata_type * data = util_malloc( sizeof * data ); - UTIL_TYPE_ID_INIT( data , LOCAL_OBSDATA_TYPE_ID ); - data->nodes_list = vector_alloc_new(); - data->nodes_map = hash_alloc(); - data->name = util_alloc_string_copy( name ); - return data; -} - - - -local_obsdata_type * local_obsdata_alloc_wrapper( local_obsdata_node_type * node ) { - local_obsdata_type * data = local_obsdata_alloc( local_obsdata_node_get_key( node )); - local_obsdata_add_node( data , node ); - return data; -} - - -local_obsdata_type * local_obsdata_alloc_copy( const local_obsdata_type * src, const char * target_key) { - local_obsdata_type * target = local_obsdata_alloc( target_key ); - int i; - for (i=0; i < local_obsdata_get_size( src ); i++ ) { - const local_obsdata_node_type * src_node = local_obsdata_iget( src , i ); - local_obsdata_node_type * target_node = local_obsdata_node_alloc_copy( src_node ); - local_obsdata_add_node( target , target_node ); - } - return target; -} - - - -void local_obsdata_free( local_obsdata_type * data ) { - vector_free( data->nodes_list ); - hash_free( data->nodes_map ); - free( data->name ); - free( data ); -} - -void local_obsdata_free__( void * arg) { - local_obsdata_type * data = local_obsdata_safe_cast( arg ); - return local_obsdata_free( data ); -} - - -const char * local_obsdata_get_name( const local_obsdata_type * data) { - return data->name; -} - - -int local_obsdata_get_size( const local_obsdata_type * data ) { - return vector_get_size( data->nodes_list ); -} - -/* - The @data instance will assume ownership of the node; i.e. calling - scope should NOT call local_obsdata_node_free(). -*/ - -bool local_obsdata_add_node( local_obsdata_type * data , local_obsdata_node_type * node ) { - const char * key = local_obsdata_node_get_key( node ); - if (local_obsdata_has_node(data , key)) - return false; - else { - vector_append_owned_ref( data->nodes_list , node , local_obsdata_node_free__ ); - hash_insert_ref( data->nodes_map , key , node ); - return true; - } -} - - void local_obsdata_del_node( local_obsdata_type * data , const char * key) { - local_obsdata_node_type * node = local_obsdata_get( data , key ); - int index = vector_find( data->nodes_list , node ); - - hash_del( data->nodes_map , key ); - vector_idel( data->nodes_list , index ); -} - - - void local_obsdata_clear( local_obsdata_type * data ) { - hash_clear( data->nodes_map ); - vector_clear( data->nodes_list ); - } - - -local_obsdata_node_type * local_obsdata_iget( const local_obsdata_type * data , int index) { - return vector_iget( data->nodes_list , index ); -} - - -local_obsdata_node_type * local_obsdata_get( const local_obsdata_type * data , const char * key) { - return hash_get( data->nodes_map , key ); -} - - -bool local_obsdata_has_node( const local_obsdata_type * data , const char * key) { - return hash_has_key( data->nodes_map , key ); -} - -void local_obsdata_reset_tstep_list( local_obsdata_type * data , const int_vector_type * step_list) { - int i; - for (i=0; i < local_obsdata_get_size( data ); i++ ) { - local_obsdata_node_type * node = local_obsdata_iget( data , i ); - local_obsdata_node_reset_tstep_list(node, step_list); - } -} - -active_list_type * local_obsdata_get_node_active_list(const local_obsdata_type * obsdata , const char * obs_key ) { - local_obsdata_node_type * obsdata_node = local_obsdata_get( obsdata , obs_key ); - active_list_type * active_list = local_obsdata_node_get_active_list( obsdata_node ); - return active_list; -} - -void local_obsdata_summary_fprintf( const local_obsdata_type * obsdata , FILE * stream) { - - fprintf(stream , "LOCAL OBSDATA NAME:%s,LOCAL OBSDATA SIZE:%d,", local_obsdata_get_name(obsdata), local_obsdata_get_size(obsdata) ); - - int i; - for (i = 0; i < local_obsdata_get_size( obsdata ); i++ ) { - local_obsdata_node_type * node = local_obsdata_iget( obsdata , i ); - const char * obs_key = local_obsdata_node_get_key(node); - fprintf(stream , "OBSERVATION:%s,", obs_key ); - } -} diff --git a/ThirdParty/Ert/libenkf/src/local_obsdata_node.c b/ThirdParty/Ert/libenkf/src/local_obsdata_node.c deleted file mode 100644 index ba4e207212..0000000000 --- a/ThirdParty/Ert/libenkf/src/local_obsdata_node.c +++ /dev/null @@ -1,174 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'local_obsdata_node.c' - - ERT 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. - - ERT 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 - for more details. -*/ -#include - -#include -#include -#include - -#include - -#define LOCAL_OBSDATA_NODE_TYPE_ID 84441309 - -struct local_obsdata_node_struct { - UTIL_TYPE_ID_DECLARATION; - char * obs_key; - active_list_type * active_list; - int_vector_type * tstep_list; - bool all_timestep_active; -}; - - - -UTIL_IS_INSTANCE_FUNCTION( local_obsdata_node , LOCAL_OBSDATA_NODE_TYPE_ID ) -UTIL_SAFE_CAST_FUNCTION( local_obsdata_node , LOCAL_OBSDATA_NODE_TYPE_ID ) - -static local_obsdata_node_type * local_obsdata_node_alloc__( const char * obs_key , bool all_timestep_active) { - local_obsdata_node_type * node = util_malloc( sizeof * node ); - UTIL_TYPE_ID_INIT( node , LOCAL_OBSDATA_NODE_TYPE_ID ); - node->obs_key = util_alloc_string_copy( obs_key ); - node->active_list = NULL; - node->tstep_list = NULL; - node->all_timestep_active = all_timestep_active; - return node; -} - - -local_obsdata_node_type * local_obsdata_node_alloc( const char * obs_key , bool all_timestep_active ) { - local_obsdata_node_type * node = local_obsdata_node_alloc__(obs_key , all_timestep_active); - - node->active_list = active_list_alloc( ); - node->tstep_list = int_vector_alloc(0,0); - - return node; -} - - -local_obsdata_node_type * local_obsdata_node_alloc_copy( const local_obsdata_node_type * src) { - local_obsdata_node_type * target = local_obsdata_node_alloc__( src->obs_key , src->all_timestep_active ); - - target->active_list = active_list_alloc_copy( src->active_list ); - target->tstep_list = int_vector_alloc_copy( src->tstep_list ); - - return target; -} - - - -void local_obsdata_node_copy_active_list( local_obsdata_node_type * node , const active_list_type * active_list) { - active_list_copy( node->active_list , active_list ); -} - - -const char * local_obsdata_node_get_key( const local_obsdata_node_type * node ) { - return node->obs_key; -} - - - -void local_obsdata_node_free( local_obsdata_node_type * node ) { - if (node->active_list) - active_list_free( node->active_list ); - - if (node->tstep_list) - int_vector_free( node->tstep_list ); - - free( node->obs_key ); - free( node ); -} - - - -void local_obsdata_node_free__( void * arg ) { - local_obsdata_node_type * node = local_obsdata_node_safe_cast( arg ); - local_obsdata_node_free( node ); -} - - -active_list_type * local_obsdata_node_get_active_list( const local_obsdata_node_type * node ) { - return node->active_list; -} - - -bool local_obsdata_node_tstep_active( const local_obsdata_node_type * node , int tstep ) { - if (node->all_timestep_active) - return true; - else - return local_obsdata_node_has_tstep( node , tstep ); -} - - - -/* - This a temporarary function to support the change local_obsset -> - local_obsdata; should eventually be removed. -*/ - -void local_obsdata_node_reset_tstep_list( local_obsdata_node_type * node , const int_vector_type * step_list) { - int_vector_free(node->tstep_list); - node->tstep_list = int_vector_alloc_copy( step_list ); - node->all_timestep_active = false; -} - - -bool local_obsdata_node_all_timestep_active( const local_obsdata_node_type * node) { - return node->all_timestep_active; -} - -/** - Observe that this function check for explicitly added timestep, - i.e. if the all_timestep_active flag is set to true this will - return false. -*/ - -bool local_obsdata_node_has_tstep( const local_obsdata_node_type * node , int tstep) { - const int_vector_type * tstep_list = node->tstep_list; - if (int_vector_index_sorted( tstep_list , tstep) == -1) - return false; - else - return true; -} - - -void local_obsdata_node_add_tstep( local_obsdata_node_type * node, int tstep) { - if (!local_obsdata_node_has_tstep( node , tstep)) { - - if (int_vector_size( node->tstep_list )) { - int last = int_vector_get_last( node->tstep_list ); - int_vector_append( node->tstep_list , tstep ); - if (tstep < last) - int_vector_sort( node->tstep_list); - } else - int_vector_append( node->tstep_list , tstep ); - - node->all_timestep_active = false; - } -} - - - - -void local_obsdata_node_add_range( local_obsdata_node_type * node, int step1 , int step2) { - int tstep; - for (tstep = step1; tstep <= step2; tstep++) - local_obsdata_node_add_tstep( node , tstep ); -} - -void local_obsdata_node_set_all_timestep_active( local_obsdata_node_type * node, bool flag) { - node->all_timestep_active = flag; -} diff --git a/ThirdParty/Ert/libenkf/src/local_updatestep.c b/ThirdParty/Ert/libenkf/src/local_updatestep.c deleted file mode 100644 index ba0f8eba19..0000000000 --- a/ThirdParty/Ert/libenkf/src/local_updatestep.c +++ /dev/null @@ -1,118 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'local_updatestep.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include -#include -#include - -/** - One enkf update is described/configured by the data structure in - local_ministep.c. This file implements a local report_step, which - is a collection of ministeps - in many cases a local_updatestep will - only consist of one single local_ministep; but in principle it can - contain several. -*/ - -#define LOCAL_UPDATESTEP_TYPE_ID 77159 - -struct local_updatestep_struct { - UTIL_TYPE_ID_DECLARATION; - char * name; - vector_type * ministep; -}; - - - -UTIL_SAFE_CAST_FUNCTION(local_updatestep , LOCAL_UPDATESTEP_TYPE_ID) - - -local_updatestep_type * local_updatestep_alloc( const char * name ) { - local_updatestep_type * updatestep = util_malloc( sizeof * updatestep ); - - UTIL_TYPE_ID_INIT( updatestep , LOCAL_UPDATESTEP_TYPE_ID ); - updatestep->name = util_alloc_string_copy( name ); - updatestep->ministep = vector_alloc_new(); - - return updatestep; -} - - -bool local_updatestep_has_data_key( const local_updatestep_type * update_step , const char * key) { - bool has_key = false; - for (int i = 0; i < vector_get_size( update_step->ministep ); i++) { - const local_ministep_type * ministep = vector_iget_const( update_step->ministep , i ); - if (local_ministep_has_data_key(ministep, key)) - has_key = true; - } - return has_key; -} - -/** - Observe that use_count values are not copied. -*/ -local_updatestep_type * local_updatestep_alloc_copy( const local_updatestep_type * src , const char * name ) { - local_updatestep_type * new = local_updatestep_alloc( name ); - for (int i = 0; i < vector_get_size(src->ministep ); i++) - local_updatestep_add_ministep( new , vector_iget( src->ministep , i) ); - return new; -} - - -void local_updatestep_free( local_updatestep_type * updatestep) { - free( updatestep->name ); - vector_free( updatestep->ministep ); - free( updatestep ); -} - - -void local_updatestep_free__(void * arg) { - local_updatestep_type * updatestep = local_updatestep_safe_cast( arg ); - local_updatestep_free( updatestep ); -} - - -void local_updatestep_add_ministep( local_updatestep_type * updatestep , local_ministep_type * ministep) { - vector_append_ref( updatestep->ministep , ministep ); /* Observe that the vector takes NO ownership */ -} - - - -local_ministep_type * local_updatestep_iget_ministep( const local_updatestep_type * updatestep , int index) { - return vector_iget( updatestep->ministep , index ); -} - - -local_obsdata_type * local_updatestep_iget_obsdata( const local_updatestep_type * updatestep , int index) { - return local_ministep_get_obsdata( vector_iget( updatestep->ministep , index ) ); -} - - -int local_updatestep_get_num_ministep( const local_updatestep_type * updatestep) { - return vector_get_size( updatestep->ministep ); -} - -const char * local_updatestep_get_name( const local_updatestep_type * updatestep ) { - return updatestep->name; -} - - diff --git a/ThirdParty/Ert/libenkf/src/meas_data.c b/ThirdParty/Ert/libenkf/src/meas_data.c deleted file mode 100644 index 7abdf6b182..0000000000 --- a/ThirdParty/Ert/libenkf/src/meas_data.c +++ /dev/null @@ -1,451 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'meas_data.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -/** - See the file README.obs for ducumentation of the varios datatypes - involved with observations/measurement/+++. -*/ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -#define MEAS_BLOCK_TYPE_ID 661936407 -#define MEAS_DATA_TYPE_ID 561000861 - - -struct meas_data_struct { - UTIL_TYPE_ID_DECLARATION; - int active_ens_size; - vector_type * data; - pthread_mutex_t data_mutex; - hash_type * blocks; - bool_vector_type * ens_mask; -}; - - -struct meas_block_struct { - UTIL_TYPE_ID_DECLARATION; - int active_ens_size; - int obs_size; - int ens_stride; - int obs_stride; - int data_size; - char * obs_key; - double * data; - bool * active; - bool stat_calculated; - const bool_vector_type * ens_mask; - int_vector_type * index_map; -}; - - -UTIL_SAFE_CAST_FUNCTION( meas_block , MEAS_BLOCK_TYPE_ID ) - - -/** - Observe that meas_block instance must be allocated with a correct - value for obs_size; it can not grow during use, and it does also - not count the number of elements added. - - Observe that the input argument @obs_size should be the total size - of the observation; if parts of the observation have been excluded - due to local analysis it should still be included in the @obs_size - value. -*/ - -meas_block_type * meas_block_alloc( const char * obs_key , const bool_vector_type * ens_mask , int obs_size) { - meas_block_type * meas_block = util_malloc( sizeof * meas_block ); - UTIL_TYPE_ID_INIT( meas_block , MEAS_BLOCK_TYPE_ID ); - meas_block->active_ens_size = bool_vector_count_equal( ens_mask , true ); - meas_block->ens_mask = ens_mask; - meas_block->obs_size = obs_size; - meas_block->obs_key = util_alloc_string_copy( obs_key ); - meas_block->data = util_calloc( (meas_block->active_ens_size + 2) * obs_size , sizeof * meas_block->data ); - meas_block->active = util_calloc( obs_size , sizeof * meas_block->active ); - meas_block->ens_stride = 1; - meas_block->obs_stride = meas_block->active_ens_size + 2; - meas_block->data_size = (meas_block->active_ens_size + 2) * obs_size; - meas_block->index_map = bool_vector_alloc_active_index_list( meas_block->ens_mask , -1); - { - int i; - for (i=0; i < obs_size; i++) - meas_block->active[i] = false; - } - meas_block->stat_calculated = false; - return meas_block; -} - -static void meas_block_fprintf( const meas_block_type * meas_block , FILE * stream) { - int iens; - int iobs; - for (iobs = 0; iobs < meas_block->obs_size; iobs++) { - for (iens = 0; iens < meas_block->active_ens_size; iens++) { - int index = iens * meas_block->ens_stride + iobs * meas_block->obs_stride; - fprintf(stream , " %10.2f ", meas_block->data[ index ]); - } - fprintf(stream , "\n"); - } -} - - -void meas_block_free( meas_block_type * meas_block ) { - free( meas_block->obs_key ); - free( meas_block->data ); - free( meas_block->active ); - int_vector_free( meas_block->index_map ); - free( meas_block ); -} - - -static void meas_block_free__( void * arg ) { - meas_block_type * meas_block = meas_block_safe_cast( arg ); - meas_block_free( meas_block ); -} - - - -static void meas_block_initS( const meas_block_type * meas_block , matrix_type * S, int * __obs_offset) { - int obs_offset = *__obs_offset; - for (int iobs =0; iobs < meas_block->obs_size; iobs++) { - if (meas_block->active[iobs]) { - for (int iens =0; iens < meas_block->active_ens_size; iens++) { - int obs_index = iens * meas_block->ens_stride + iobs* meas_block->obs_stride; - - matrix_iset( S , obs_offset, iens , meas_block->data[ obs_index ]); - } - obs_offset++; - } - } - *__obs_offset = obs_offset; -} - -bool meas_block_iens_active( const meas_block_type * meas_block , int iens) { - return bool_vector_iget( meas_block->ens_mask , iens); -} - - -/* -static void meas_data_assign_block( meas_block_type * target_block , const meas_block_type * src_block , int target_iens , int src_iens ) { - int iobs; - for (iobs =0; iobs < target_block->obs_size; iobs++) { - int target_index = target_iens * target_block->ens_stride + iobs * target_block->obs_stride; - int src_index = src_iens * src_block->ens_stride + iobs * src_block->obs_stride; - target_block->data[ target_index ] = src_block->data[ src_index ]; - } - target_block->stat_calculated = false; -} -*/ - -static void meas_block_calculate_ens_stats( meas_block_type * meas_block ) { - bool include_inactive = true; - int iobs , iens; - for (iobs =0; iobs < meas_block->obs_size; iobs++) { - if (meas_block->active[iobs] || include_inactive) { - double M1 = 0; - double M2 = 0; - for (iens =0; iens < meas_block->active_ens_size; iens++) { - int index = iens * meas_block->ens_stride + iobs * meas_block->obs_stride; - M1 += meas_block->data[ index ]; - M2 += meas_block->data[ index ] * meas_block->data[ index ]; - } - { - int mean_index = (meas_block->active_ens_size + 0) * meas_block->ens_stride + iobs * meas_block->obs_stride; - int std_index = (meas_block->active_ens_size + 1) * meas_block->ens_stride + iobs * meas_block->obs_stride; - double mean = M1 / meas_block->active_ens_size; - double var = M2 / meas_block->active_ens_size - mean * mean; - meas_block->data[ mean_index ] = mean; - meas_block->data[ std_index ] = sqrt( util_double_max( 0.0 , var)); - } - } - } - meas_block->stat_calculated = true; -} - - -static void meas_block_assert_ens_stat( meas_block_type * meas_block ) { - if (!meas_block->stat_calculated) - meas_block_calculate_ens_stats( meas_block ); -} - - -static void meas_block_assert_iens_active( const meas_block_type * meas_block , int iens) { - if (!bool_vector_iget( meas_block->ens_mask , iens )) - util_abort("%s: fatal error - trying to access inactive ensemble member:%d \n",__func__ , iens); -} - - -void meas_block_iset( meas_block_type * meas_block , int iens , int iobs , double value) { - meas_block_assert_iens_active( meas_block , iens ); - { - int active_iens = int_vector_iget( meas_block->index_map , iens ); - int index = active_iens * meas_block->ens_stride + iobs * meas_block->obs_stride; - meas_block->data[ index ] = value; - if (!meas_block->active[ iobs ]) - meas_block->active[ iobs ] = true; - - meas_block->stat_calculated = false; - } -} - - -double meas_block_iget( const meas_block_type * meas_block , int iens , int iobs) { - meas_block_assert_iens_active( meas_block , iens ); - { - int active_iens = int_vector_iget( meas_block->index_map , iens ); - int index = active_iens * meas_block->ens_stride + iobs * meas_block->obs_stride; - return meas_block->data[ index ]; - } -} - - -static int meas_block_get_active_obs_size( const meas_block_type * meas_block ) { - int obs_size = 0; - int i; - - for (i=0; i < meas_block->obs_size; i++) - if (meas_block->active[i]) - obs_size++; - - return obs_size; -} - - -double meas_block_iget_ens_std( meas_block_type * meas_block , int iobs) { - meas_block_assert_ens_stat( meas_block ); - { - int std_index = (meas_block->active_ens_size + 1) * meas_block->ens_stride + iobs * meas_block->obs_stride; - return meas_block->data[ std_index ]; - } -} - - -double meas_block_iget_ens_mean( meas_block_type * meas_block , int iobs) { - meas_block_assert_ens_stat( meas_block ); - { - int mean_index = meas_block->active_ens_size * meas_block->ens_stride + iobs * meas_block->obs_stride; - return meas_block->data[ mean_index ]; - } -} - - -bool meas_block_iget_active( const meas_block_type * meas_block , int iobs) { - return meas_block->active[ iobs ]; -} - - -void meas_block_deactivate( meas_block_type * meas_block , int iobs ) { - if (meas_block->active[ iobs ]) - meas_block->active[ iobs ] = false; - meas_block->stat_calculated = false; -} - - -int meas_block_get_total_obs_size( const meas_block_type * meas_block ) { - return meas_block->obs_size; -} - - -int meas_block_get_active_ens_size( const meas_block_type * meas_block ) { - return meas_block->active_ens_size; -} - - -int meas_block_get_total_ens_size( const meas_block_type * meas_block ) { - return bool_vector_size( meas_block->ens_mask ); -} - - - - - - -/*****************************************************************/ - -UTIL_IS_INSTANCE_FUNCTION( meas_data , MEAS_DATA_TYPE_ID ) - -meas_data_type * meas_data_alloc( const bool_vector_type * ens_mask ) { - meas_data_type * meas = util_malloc(sizeof * meas ); - UTIL_TYPE_ID_INIT( meas , MEAS_DATA_TYPE_ID ); - - meas->data = vector_alloc_new(); - meas->blocks = hash_alloc(); - meas->ens_mask = bool_vector_alloc_copy( ens_mask ); - meas->active_ens_size = bool_vector_count_equal( ens_mask , true ); - pthread_mutex_init( &meas->data_mutex , NULL ); - - return meas; -} - - - -void meas_data_free(meas_data_type * matrix) { - vector_free( matrix->data ); - hash_free( matrix->blocks ); - bool_vector_free( matrix->ens_mask ); - free( matrix ); -} - - - -void meas_data_reset(meas_data_type * matrix) { - hash_clear( matrix->blocks ); - vector_clear( matrix->data ); /* Will dump and discard all the meas_block instances. */ -} - - -/* - The obs_key is not alone unique over different report steps. -*/ -static char * meas_data_alloc_key( const char * obs_key , int report_step) { - return util_alloc_sprintf( "%s-%d" , obs_key , report_step ); -} - -/** - The code actually adding new blocks to the vector must be run in single-thread mode. -*/ - -meas_block_type * meas_data_add_block( meas_data_type * matrix , const char * obs_key , int report_step , int obs_size) { - char * lookup_key = meas_data_alloc_key( obs_key , report_step ); - pthread_mutex_lock( &matrix->data_mutex ); - { - if (!hash_has_key( matrix->blocks , lookup_key )) { - meas_block_type * new_block = meas_block_alloc(obs_key , matrix->ens_mask , obs_size); - vector_append_owned_ref( matrix->data , new_block , meas_block_free__ ); - hash_insert_ref( matrix->blocks , lookup_key , new_block ); - } - } - pthread_mutex_unlock( &matrix->data_mutex ); - free( lookup_key ); - return vector_get_last( matrix->data ); -} - - -/* - Observe that the key should compare with the keys created by meas_data_alloc_key(). -*/ -bool meas_data_has_block( const meas_data_type * matrix , const char * lookup_key) { - return hash_has_key( matrix->blocks , lookup_key); -} - -meas_block_type * meas_data_get_block( const meas_data_type * matrix , const char * lookup_key) { - return hash_get( matrix->blocks , lookup_key ); -} - - -meas_block_type * meas_data_iget_block( const meas_data_type * matrix , int block_nr) { - return vector_iget( matrix->data , block_nr); -} - - -const meas_block_type * meas_data_iget_block_const( const meas_data_type * matrix , int block_nr) { - return vector_iget_const( matrix->data , block_nr); -} - - -int meas_data_get_active_obs_size( const meas_data_type * matrix ) { - int obs_size = 0; - - for (int block_nr = 0; block_nr < vector_get_size( matrix->data ); block_nr++) { - const meas_block_type * meas_block = vector_iget_const( matrix->data , block_nr); - obs_size += meas_block_get_active_obs_size( meas_block ); - } - - return obs_size; -} - - - -/* - Observe that this can return NULL is there is no data/observations. -*/ - -matrix_type * meas_data_allocS(const meas_data_type * matrix) { - int obs_offset = 0; - matrix_type * S = matrix_alloc( meas_data_get_active_obs_size( matrix ) , matrix->active_ens_size); - if (S) { - for (int block_nr = 0; block_nr < vector_get_size( matrix->data ); block_nr++) { - const meas_block_type * meas_block = vector_iget_const( matrix->data , block_nr); - meas_block_initS( meas_block , S , &obs_offset); - } - - matrix_set_name( S , "S"); - matrix_assert_finite( S ); - } - return S; -} - - - -int meas_data_get_nrobs( const meas_data_type * meas_data ) { - return -1; -} - - -int meas_data_get_active_ens_size( const meas_data_type * meas_data ) { - return meas_data->active_ens_size; -} - - -int meas_data_get_total_ens_size( const meas_data_type * meas_data ) { - return bool_vector_size( meas_data->ens_mask ); -} - - -int meas_data_get_num_blocks( const meas_data_type * meas_data ) { - return vector_get_size( meas_data->data ); -} - - - -/* -void meas_data_assign_vector(meas_data_type * target_matrix, const meas_data_type * src_matrix , int target_index , int src_index) { - if (target_matrix->active_ens_size != src_matrix->active_ens_size) - util_abort("%s: size mismatch \n",__func__); - - for (int block_nr = 0; block_nr < vector_get_size( target_matrix->data ); block_nr++) { - meas_block_type * target_block = meas_data_iget_block( target_matrix , block_nr ); - const meas_block_type * src_block = meas_data_iget_block_const( src_matrix , block_nr ); - - meas_data_assign_block( target_block , src_block , target_index , src_index ); - } -} -*/ - - - -void meas_data_fprintf( const meas_data_type * matrix , FILE * stream ) { - fprintf(stream , "-----------------------------------------------------------------\n"); - for (int block_nr = 0; block_nr < vector_get_size( matrix->data ); block_nr++) { - const meas_block_type * block = meas_data_iget_block_const( matrix , block_nr ); - meas_block_fprintf( block , stream ); - fprintf(stream , "\n"); - } - fprintf(stream , "-----------------------------------------------------------------\n"); -} diff --git a/ThirdParty/Ert/libenkf/src/member_config.c b/ThirdParty/Ert/libenkf/src/member_config.c deleted file mode 100644 index 1fefd908ec..0000000000 --- a/ThirdParty/Ert/libenkf/src/member_config.c +++ /dev/null @@ -1,174 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'member_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include - - -/** - This struct contains information which is private to this - member. It is initialized at object boot time, and (typically) not - changed during the simulation. [In principle it could change during - the simulation, but the current API does not support that.] -*/ - - -struct member_config_struct { - int iens; /* The ensemble member number of this member. */ - char * casename; /* The name of this case - will mostly be NULL. */ - keep_runpath_type keep_runpath; /* Should the run-path directory be left around (for this member)*/ - bool pre_clear_runpath; /* Should the runpath directory be cleared before starting? */ - char * jobname; /* The jobname used for this job when submitting to the queue system. */ - char * eclbase; /* The ECLBASE string used for simulations of this member. */ -}; - - -/*****************************************************************/ -/* - Observe that there is a potential for conflict between the fields - pre_clear_runpath and keep_runpath when running normal EnKF. If both - are set to true the former will win. -*/ - - - -/******************************************************************/ -/** Implementation of the member_config struct. All of this implementation - is private - however some of it is exported through the enkf_state object, - and it should be perfectly safe to export more of it. -*/ - - -const char * member_config_update_jobname(member_config_type * member_config , const char * jobname_fmt , const subst_list_type * subst_list) { - if (jobname_fmt != NULL) { - util_safe_free( member_config->jobname ); - { - char * tmp = util_alloc_sprintf( jobname_fmt , member_config->iens); - member_config->jobname = subst_list_alloc_filtered_string( subst_list , tmp ); - free( tmp ); - } - } - return member_config->jobname; -} - - - -const char * member_config_update_eclbase(member_config_type * member_config , const ecl_config_type * ecl_config , const subst_list_type * subst_list) { - util_safe_free( member_config->eclbase ); - { - const path_fmt_type * eclbase_fmt = ecl_config_get_eclbase_fmt(ecl_config); - if (eclbase_fmt != NULL) { - { - char * tmp = path_fmt_alloc_path(eclbase_fmt , false , member_config->iens); - member_config->eclbase = subst_list_alloc_filtered_string( subst_list , tmp ); - free( tmp ); - } - } - } - - return member_config->eclbase; -} - - -int member_config_get_iens( const member_config_type * member_config ) { - return member_config->iens; -} - - - -void member_config_free(member_config_type * member_config) { - util_safe_free(member_config->eclbase); - util_safe_free(member_config->casename ); - free(member_config); -} - - - -void member_config_set_keep_runpath(member_config_type * member_config , keep_runpath_type keep_runpath) { - member_config->keep_runpath = keep_runpath; -} - - -keep_runpath_type member_config_get_keep_runpath(const member_config_type * member_config) { - return member_config->keep_runpath; -} - -bool member_config_pre_clear_runpath(const member_config_type * member_config) { - return member_config->pre_clear_runpath; -} - - -void member_config_set_pre_clear_runpath(member_config_type * member_config , bool pre_clear_runpath) { - member_config->pre_clear_runpath = pre_clear_runpath; -} - - - - - -const char * member_config_get_eclbase( const member_config_type * member_config ) { - return member_config->eclbase; -} - - -const char * member_config_get_jobname( const member_config_type * member_config ) { - if (member_config->jobname != NULL) - return member_config->jobname; - else { - if (member_config->eclbase != NULL) - return member_config->eclbase; - else { - util_abort("%s: sorry can not submit JOB - must specify name with JOBNAME or ECLBASE config keys\n",__func__); - return NULL; - } - } -} - - -const char * member_config_get_casename( const member_config_type * member_config ) { - return member_config->casename; -} - - -member_config_type * member_config_alloc(int iens , - const char * casename , - bool pre_clear_runpath , - keep_runpath_type keep_runpath , - const ecl_config_type * ecl_config , - const ensemble_config_type * ensemble_config) { - - - member_config_type * member_config = util_malloc( sizeof * member_config ); - member_config->casename = util_alloc_string_copy( casename ); - member_config->iens = iens; /* Can only be changed in the allocater. */ - member_config->eclbase = NULL; - member_config->jobname = NULL; - member_config->pre_clear_runpath = pre_clear_runpath; - member_config_set_keep_runpath(member_config , keep_runpath); - return member_config; -} diff --git a/ThirdParty/Ert/libenkf/src/migrate_bfs.c b/ThirdParty/Ert/libenkf/src/migrate_bfs.c deleted file mode 100644 index 5a01ace37b..0000000000 --- a/ThirdParty/Ert/libenkf/src/migrate_bfs.c +++ /dev/null @@ -1,131 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'migrate_bfs.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include - - - -static void migrate_file( const char * src_case, int num_src_drivers , const char * target_case, int num_target_drivers, const char * file, int block_size , msg_type * msg) { - block_fs_type ** target_fs = util_calloc( num_target_drivers , sizeof * target_fs ); - int itarget; - for (itarget = 0; itarget < num_target_drivers; itarget++) { - char * path = util_alloc_sprintf("%s/mod_%d" , target_case , itarget ); - char * mount_file = util_alloc_sprintf("%s/mod_%d/%s.mnt" , target_case , itarget , file ); - util_make_path( path ); - - target_fs[itarget] = block_fs_mount( mount_file , 16 , 0 , 1.0, 0 , false , false ); - free( mount_file ); - free( path ); - } - - { - int isrc; - buffer_type * buffer = buffer_alloc(1024); - for (isrc = 0; isrc < num_src_drivers; isrc++) { - char * mount_file = util_alloc_sprintf("%s/mod_%d/%s.mnt" , src_case , isrc , file ); - block_fs_type * src_fs = block_fs_mount( mount_file , 16 , 1024 , 1.0 , 0 , true , true ); - vector_type * file_list = block_fs_alloc_filelist( src_fs , NULL , NO_SORT , false ); - int ifile; - msg_update( msg , mount_file ); - for (ifile = 0; ifile < vector_get_size( file_list ); ifile++) { - const file_node_type * node = vector_iget_const( file_list , ifile ); - const char * filename = file_node_get_filename( node ); - int report_step , iens; - char * key; - if (block_fs_sscanf_key( filename , &key , &report_step , &iens )) { - block_fs_fread_realloc_buffer( src_fs , filename , buffer); - block_fs_fwrite_buffer( target_fs[(iens % num_target_drivers)] , filename , buffer ); - free( key ); - } else - util_abort("%s: All hell is loose - failed to parse:%s \n",__func__ , filename); - } - - vector_free( file_list ); - block_fs_close(src_fs , false); - } - buffer_free( buffer ); - } - - - for (itarget = 0; itarget < num_target_drivers; itarget++) - block_fs_close( target_fs[itarget] , false); - free( target_fs ); -} - - -static void copy_index( const char * src_case , const char * target_case) { - char * mount_src = util_alloc_filename(src_case , "INDEX" , "mnt"); - char * mount_target = util_alloc_filename(target_case , "INDEX" , "mnt"); - char * data_src = util_alloc_filename(src_case , "INDEX" , "data_0"); - char * data_target = util_alloc_filename(target_case , "INDEX" , "data_0"); - - util_copy_file( mount_src , mount_target ); - util_copy_file( data_src , data_target ); - - free( mount_src ); - free( mount_target ); - free( data_src ); - free( data_target ); -} - - -static void usage() { - printf("Use:\n"); - printf("bash%% migrate_bfs case\n"); - exit(1); -} - -int main(int argc, char ** argv) { - int num_src_drivers = 10; - int num_target_drivers = 32; - if (argc != 4) - usage(); - - { - char * src_path = argv[1] ; - char * target_path = argv[2] ; - char * dir = argv[3] ; - - util_make_path( target_path ); - if (util_same_file( src_path , target_path)) { - fprintf(stderr,"The two directories:%s and %s point to the same location \n" , src_path , target_path ); - exit(1); - } - - { - char * src_case = util_alloc_sprintf("%s/%s" , src_path , dir ); - char * target_case = util_alloc_sprintf("%s/%s" , target_path , dir ); - - msg_type * msg = msg_alloc("Copying from: " , false); - msg_show( msg ); - migrate_file(src_case , num_src_drivers , target_case , num_target_drivers , "ANALYZED" , 32 , msg); - migrate_file(src_case , num_src_drivers , target_case , num_target_drivers , "FORECAST" , 32 , msg); - migrate_file(src_case , num_src_drivers , target_case , num_target_drivers , "PARAMETER" , 32 , msg); - migrate_file(src_case , num_src_drivers , target_case , num_target_drivers , "STATIC" , 32 , msg); - copy_index( src_case , target_case ); - free( src_case); - free( target_case ); - msg_free( msg , true ); - } - } -} diff --git a/ThirdParty/Ert/libenkf/src/misfit_ensemble.c b/ThirdParty/Ert/libenkf/src/misfit_ensemble.c deleted file mode 100644 index 0ade82b860..0000000000 --- a/ThirdParty/Ert/libenkf/src/misfit_ensemble.c +++ /dev/null @@ -1,249 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'misfit_ensemble.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - - -/** - This file implements a type misfit_ensemble which is used to rank the - different realization according to various criteria. - - The top level datastructure in this file is the misfit_ensemble, and - that is the only exported datatype, but in addition there are the - misfit_member which is the misfit for one ensemble member, and - misfit_ts which is the misfit for one ensemble member / one - observation key. -*/ - - - - - -#define MISFIT_ENSEMBLE_TYPE_ID 441066 - -struct misfit_ensemble_struct { - UTIL_TYPE_ID_DECLARATION; - bool initialized; - int history_length; - vector_type * ensemble; /* Vector of misfit_member_type instances - one for each ensemble member. */ -}; - - -/*****************************************************************/ - -static double ** __2d_malloc(int rows , int columns) { - double ** d = util_calloc( rows , sizeof * d ); - for (int i =0; i < rows; i++) - d[i] = util_calloc( columns , sizeof * d[i]); - return d; -} - -static void __2d_free(double ** d , int rows) { - for (int i =0; i < rows; i++) - free(d[i]); - free(d); -} - - -void misfit_ensemble_initialize( misfit_ensemble_type * misfit_ensemble , - const ensemble_config_type * ensemble_config , - const enkf_obs_type * enkf_obs , - enkf_fs_type * fs , - int ens_size , - int history_length, - bool force_init) { - - if (force_init || !misfit_ensemble->initialized) { - misfit_ensemble_clear( misfit_ensemble ); - - msg_type * msg = msg_alloc("Evaluating misfit for observation: " , false); - double ** chi2_work = __2d_malloc( history_length + 1 , ens_size ); - bool_vector_type * iens_valid = bool_vector_alloc( ens_size , true ); - - hash_iter_type * obs_iter = enkf_obs_alloc_iter( enkf_obs ); - const char * obs_key = hash_iter_get_next_key( obs_iter ); - - misfit_ensemble->history_length = history_length; - misfit_ensemble_set_ens_size( misfit_ensemble , ens_size ); - - msg_show( msg ); - while (obs_key != NULL) { - obs_vector_type * obs_vector = enkf_obs_get_vector( enkf_obs , obs_key ); - msg_update( msg , obs_key ); - - bool_vector_reset( iens_valid ); - bool_vector_iset( iens_valid , ens_size - 1 , true ); - obs_vector_ensemble_chi2( obs_vector , - fs , - iens_valid , - 0 , - misfit_ensemble->history_length, - 0 , - ens_size , - chi2_work); - - /** - Internalizing the results from the chi2_work table into the misfit structure. - */ - for (int iens = 0; iens < ens_size; iens++) { - misfit_member_type * node = misfit_ensemble_iget_member( misfit_ensemble , iens ); - if (bool_vector_iget( iens_valid , iens)) - misfit_member_update( node , obs_key , misfit_ensemble->history_length , iens , (const double **) chi2_work); - } - obs_key = hash_iter_get_next_key( obs_iter ); - } - - bool_vector_free( iens_valid ); - msg_free(msg , true ); - hash_iter_free( obs_iter ); - - __2d_free( chi2_work , misfit_ensemble->history_length + 1); - misfit_ensemble->initialized = true; - } -} - - -void misfit_ensemble_fwrite( const misfit_ensemble_type * misfit_ensemble , FILE * stream ) { - int ens_size = vector_get_size( misfit_ensemble->ensemble); - util_fwrite_int( misfit_ensemble->history_length , stream ); - util_fwrite_int( vector_get_size( misfit_ensemble->ensemble ) , stream); - - /* Writing the nodes - one for each ensemble member */ - { - int iens; - for (iens = 0; iens < ens_size; iens++) - misfit_member_fwrite( vector_iget( misfit_ensemble->ensemble , iens ) , stream ); - } - -} - - - - -/** - Observe that the object is NOT in a valid state when leaving this function, - must finalize in either misfit_ensemble_alloc() or misfit_ensemble_fread_alloc(). -*/ - -static misfit_ensemble_type * misfit_ensemble_alloc_empty() { - misfit_ensemble_type * table = util_malloc( sizeof * table ); - - table->initialized = false; - table->ensemble = vector_alloc_new(); - - return table; -} - - -/** - This funcion is a feeble attempt at allowing the ensemble size to - change runtime. If the new ensemble size is larger than the current - ensemble size ALL the currently internalized misfit information is - dropped on the floor; if the the ensemble is shrinked only the the - last elements of the misfit table are discarded (NOT exactly battle-tested). - -*/ -void misfit_ensemble_set_ens_size( misfit_ensemble_type * misfit_ensemble , int ens_size) { - int iens; - if (ens_size > vector_get_size( misfit_ensemble->ensemble )) { - /* The new ensemble is larger than what we have currently internalized, - we drop everything and add empty misfit_member instances. */ - vector_clear( misfit_ensemble->ensemble ); - for (iens = 0; iens < ens_size; iens++) - vector_append_owned_ref( misfit_ensemble->ensemble , misfit_member_alloc( iens ) , misfit_member_free__); - - } else - /* We shrink the vector by removing the last elements. */ - vector_shrink( misfit_ensemble->ensemble , ens_size); -} - - -void misfit_ensemble_fread( misfit_ensemble_type * misfit_ensemble , FILE * stream ) { - misfit_ensemble_clear( misfit_ensemble ); - { - int ens_size; - - misfit_ensemble->history_length = util_fread_int( stream ); - ens_size = util_fread_int( stream ); - misfit_ensemble_set_ens_size( misfit_ensemble , ens_size ); - { - for (int iens = 0; iens < ens_size; iens++) { - misfit_member_type * node = misfit_member_fread_alloc( stream ); - vector_iset_owned_ref( misfit_ensemble->ensemble , iens , node , misfit_member_free__); - } - } - - } -} - - - -misfit_ensemble_type * misfit_ensemble_alloc( ) { - misfit_ensemble_type * table = misfit_ensemble_alloc_empty( ); - return table; -} - - - -misfit_member_type * misfit_ensemble_iget_member( const misfit_ensemble_type * table , int iens) { - return vector_iget( table->ensemble , iens); -} - - - - -void misfit_ensemble_clear( misfit_ensemble_type * table) { - vector_clear( table->ensemble ); - table->initialized = false; -} - - -void misfit_ensemble_free(misfit_ensemble_type * table ) { - vector_free( table->ensemble ); - free( table ); -} - - -bool misfit_ensemble_initialized( const misfit_ensemble_type * misfit_ensemble ) { - return misfit_ensemble->initialized; -} - - -/*****************************************************************/ - - -int misfit_ensemble_get_ens_size( const misfit_ensemble_type * misfit_ensemble ) { - return vector_get_size( misfit_ensemble->ensemble ); -} diff --git a/ThirdParty/Ert/libenkf/src/misfit_member.c b/ThirdParty/Ert/libenkf/src/misfit_member.c deleted file mode 100644 index 90afdc20c3..0000000000 --- a/ThirdParty/Ert/libenkf/src/misfit_member.c +++ /dev/null @@ -1,122 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'misfit_member.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include -#include - -#include - - -#define MISFIT_MEMBER_TYPE_ID 541066 - -struct misfit_member_struct { - UTIL_TYPE_ID_DECLARATION; - int my_iens; - hash_type *obs; /* hash table of misfit_ts_type instances - indexed by observation keys. The structure - of this hash table is duplicated for each ensemble member.*/ -}; - - - -static UTIL_SAFE_CAST_FUNCTION(misfit_member , MISFIT_MEMBER_TYPE_ID); - - -static void misfit_member_free( misfit_member_type * node ) { - hash_free( node->obs ); - free( node ); -} - - -void misfit_member_free__( void * node ) { - misfit_member_free( misfit_member_safe_cast( node )); -} - - -misfit_member_type * misfit_member_alloc(int iens) { - misfit_member_type * node = util_malloc( sizeof * node ); - UTIL_TYPE_ID_INIT( node , MISFIT_MEMBER_TYPE_ID); - node->my_iens = iens; - node->obs = hash_alloc(); - return node; -} - - -static void misfit_member_install_vector( misfit_member_type * node , const char * key , misfit_ts_type * vector ) { - hash_insert_hash_owned_ref( node->obs, key , vector , misfit_ts_free__ ); -} - - -static misfit_ts_type * misfit_member_safe_get_vector( misfit_member_type * node , const char * obs_key , int history_length) { - if (!hash_has_key( node->obs , obs_key )) - misfit_member_install_vector(node , obs_key , misfit_ts_alloc( history_length ) ); - return hash_get( node->obs , obs_key ); -} - - -misfit_ts_type * misfit_member_get_ts( const misfit_member_type * node , const char * obs_key ) { - return hash_get( node->obs , obs_key ); -} - -bool misfit_member_has_ts( const misfit_member_type * node , const char * obs_key ) { - return hash_has_key( node->obs , obs_key ); -} - - -void misfit_member_update( misfit_member_type * node , const char * obs_key , int history_length , int iens , const double ** work_chi2) { - misfit_ts_type * vector = misfit_member_safe_get_vector( node , obs_key , history_length ); - for (int step = 0; step <= history_length; step++) - misfit_ts_iset( vector , step , work_chi2[step][iens]); -} - - -void misfit_member_fwrite( const misfit_member_type * node , FILE * stream) { - util_fwrite_int( node->my_iens , stream); - util_fwrite_int( hash_get_size( node->obs ) , stream); - { - hash_iter_type * obs_iter = hash_iter_alloc( node->obs ); - while ( !hash_iter_is_complete( obs_iter )) { - const char * key = hash_iter_get_next_key( obs_iter ); - misfit_ts_type * misfit_ts = hash_get( node->obs , key ); - util_fwrite_string( key , stream ); - misfit_ts_fwrite( misfit_ts , stream); - } - hash_iter_free( obs_iter ); - } -} - - -misfit_member_type * misfit_member_fread_alloc( FILE * stream ) { - int my_iens = util_fread_int( stream ); - misfit_member_type * node = misfit_member_alloc( my_iens ); - int hash_size = util_fread_int( stream ); - { - int iobs; - for (iobs = 0; iobs < hash_size; iobs++) { - char * key = util_fread_alloc_string( stream ); - misfit_ts_type * misfit_ts = misfit_ts_fread_alloc( stream ); - misfit_member_install_vector( node , key , misfit_ts ); - free( key ); - } - } - return node; -} - diff --git a/ThirdParty/Ert/libenkf/src/misfit_ranking.c b/ThirdParty/Ert/libenkf/src/misfit_ranking.c deleted file mode 100644 index 1b49ff16a7..0000000000 --- a/ThirdParty/Ert/libenkf/src/misfit_ranking.c +++ /dev/null @@ -1,254 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'misfit_ranking.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -/** - This struct contains the misfits & sort keys for one particular - misfit_ranking. I.e. all the RFT measurements. -*/ - - - -#define MISFIT_RANKING_TYPE_ID 671108 - -struct misfit_ranking_struct { - UTIL_TYPE_ID_DECLARATION; - vector_type * ensemble; /* An ensemble of hash instances. Each hash instance is populated like this: hash_insert_double(hash , "WGOR" , 1.09); */ - double_vector_type * total; /* An enemble of total misfit values (for this misfit_ranking). */ - perm_vector_type * sort_permutation; /* This is how the ens members should be permuted to be sorted under this misfit_ranking. */ - int ens_size; -}; - -UTIL_SAFE_CAST_FUNCTION( misfit_ranking , MISFIT_RANKING_TYPE_ID ) -UTIL_IS_INSTANCE_FUNCTION( misfit_ranking , MISFIT_RANKING_TYPE_ID) - -void misfit_ranking_display( const misfit_ranking_type * misfit_ranking , FILE * stream) { - const int ens_size = double_vector_size( misfit_ranking->total ); - const perm_vector_type * permutations = misfit_ranking->sort_permutation; - hash_type * obs_hash = NULL; - { - // The ensemble vector can contain invalid nodes with NULL. - int index = 0; - while ((obs_hash == NULL) && (index < vector_get_size( misfit_ranking->ensemble))) { - obs_hash = vector_iget( misfit_ranking->ensemble , index ); - index++; - } - if (obs_hash == NULL) { - fprintf(stderr,"Sorry: no valid results loaded for this misfit_ranking - returning\n"); - return; - } - } - - { - int i; - double summed_up = 0.0; - stringlist_type * obs_keys = hash_alloc_stringlist( obs_hash ); - int num_obs = stringlist_get_size( obs_keys ); - int num_obs_total = num_obs * ens_size; // SHould not count failed/missing members ... - - fprintf(stream,"\n\n"); - fprintf(stream," # Realization Normalized misfit Total misfit\n"); - fprintf(stream,"-------------------------------------------------------\n"); - for (i = 0; i < ens_size; i++) { - int iens = perm_vector_iget( permutations, i ); - double total_misfit = double_vector_iget( misfit_ranking->total , iens ); - double normalized_misfit = sqrt(total_misfit / num_obs_total); - summed_up = summed_up+total_misfit; - fprintf(stream,"%3d %3d %10.3f %10.3f \n",i,iens,normalized_misfit,total_misfit); - } - - { - double normalized_summed_up = sqrt(summed_up / (num_obs_total * ens_size)); - fprintf(stream," All %10.3f %10.3f \n",normalized_summed_up,summed_up); - } - fprintf(stream,"-------------------------------------------------------\n"); - } - -} - - - -void misfit_ranking_fprintf( const misfit_ranking_type * misfit_ranking , const char * filename) { - FILE * stream = util_mkdir_fopen( filename , "w"); - const int ens_size = misfit_ranking->ens_size; - const perm_vector_type * permutations = misfit_ranking->sort_permutation; - double summed_up = 0.0; - { - // All this whitespace is finely tuned and highly significant .... - const char * key_fmt = " %18s "; - const char * value_fmt = " %10.3f %8.3f"; - const char * start_fmt = " %2d %3d %7.3f %8.3f"; - - hash_type * obs_hash = vector_iget( misfit_ranking->ensemble , 0); - stringlist_type * obs_keys = hash_alloc_stringlist( obs_hash ); - int num_obs = stringlist_get_size( obs_keys ); - int iobs; - int num_obs_total = num_obs * ens_size; - - stringlist_sort( obs_keys , enkf_util_compare_keys__ ); - fprintf(stream , " Overall "); - for (iobs =0; iobs < num_obs; iobs++) - fprintf(stream , key_fmt , stringlist_iget( obs_keys , iobs )); - - fprintf(stream , "\n"); - fprintf(stream , " # Realization Norm Total"); - for (iobs =0; iobs < num_obs; iobs++) - fprintf(stream , " Norm Total"); - - fprintf(stream , "\n"); - for (int i = 0; i < ens_size; i++) { - int iens = perm_vector_iget( permutations , i ); - hash_type * obs_hash = vector_iget( misfit_ranking->ensemble , iens ); - double total_value = double_vector_iget( misfit_ranking->total , iens ); - double normalized_misfit = sqrt(total_value / num_obs_total); - summed_up = summed_up+total_value; - fprintf(stream , start_fmt , i , iens , normalized_misfit , total_value); - for (iobs =0; iobs < num_obs; iobs++){ - double single_value = hash_get_double( obs_hash , stringlist_iget( obs_keys , iobs )); - double single_value_normalized = sqrt(single_value / (num_obs_total)); - fprintf(stream , value_fmt , single_value_normalized , single_value); - } - fprintf(stream , "\n"); - } - double summed_up_normalized = sqrt(summed_up / (num_obs_total * ens_size)); - fprintf(stream , " All %7.3f %8.3f" , summed_up_normalized , summed_up); - for (iobs = 0; iobs < num_obs; iobs++){ - double single_value_summed_up = 0.0; - for (int i = 0; i < ens_size; i++) { - single_value_summed_up = single_value_summed_up + hash_get_double( obs_hash , stringlist_iget( obs_keys , iobs )); - } - double single_value_summed_up_normalized=sqrt(single_value_summed_up / (num_obs_total * ens_size)); - fprintf(stream , value_fmt , single_value_summed_up_normalized , single_value_summed_up); - } - fprintf(stream , "\n"); - } - fclose( stream ); -} - - -static misfit_ranking_type * misfit_ranking_alloc_empty( int ens_size ) { - misfit_ranking_type * misfit_ranking = util_malloc( sizeof * misfit_ranking ); - UTIL_TYPE_ID_INIT( misfit_ranking , MISFIT_RANKING_TYPE_ID ); - misfit_ranking->sort_permutation = NULL; - misfit_ranking->ensemble = vector_alloc_new(); - misfit_ranking->total = double_vector_alloc( 0 , INVALID_RANKING_VALUE ); - misfit_ranking->ens_size = ens_size; - return misfit_ranking; -} - - -/** - Step and step2 are inclusive. The time direction is flattened. -*/ - -misfit_ranking_type * misfit_ranking_alloc(const misfit_ensemble_type * misfit_ensemble , const stringlist_type * sort_keys , const int_vector_type * steps, const char * ranking_key) { - const int ens_size = misfit_ensemble_get_ens_size( misfit_ensemble ); - int iens; - misfit_ranking_type * ranking = misfit_ranking_alloc_empty(ens_size); - - for (iens = 0; iens < ens_size; iens++) { - const misfit_member_type * misfit_member = misfit_ensemble_iget_member( misfit_ensemble , iens ); /* Lookup in the master ensemble. */ - - { - double iens_valid = true; - double total = 0; - hash_type * obs_hash = hash_alloc(); - for (int ikey = 0; ikey < stringlist_get_size( sort_keys ); ikey++) { - const char * obs_key = stringlist_iget( sort_keys , ikey ); - if (misfit_member_has_ts( misfit_member , obs_key )) { - misfit_ts_type * ts = misfit_member_get_ts( misfit_member , obs_key ); - double value = misfit_ts_eval( ts , steps ); /* Sum up the misfit for this key - and these timesteps. */ - hash_insert_double( obs_hash , obs_key , value); - total += value; - } else - iens_valid = true; - } - if (iens_valid) - misfit_ranking_iset( ranking , iens , obs_hash , total ); - else - misfit_ranking_iset_invalid( ranking , iens ); - } - } - ranking->sort_permutation = double_vector_alloc_sort_perm( ranking->total ); - - return ranking; -} - - - - - -void misfit_ranking_free( misfit_ranking_type * misfit_ranking ) { - vector_free( misfit_ranking->ensemble ); - double_vector_free( misfit_ranking->total ); - - if (misfit_ranking->sort_permutation) - perm_vector_free( misfit_ranking->sort_permutation ); - - free( misfit_ranking ); -} - - - -void misfit_ranking_free__( void * arg ) { - misfit_ranking_type * misfit_ranking = misfit_ranking_safe_cast( arg ); - misfit_ranking_free( misfit_ranking ); -} - - - -void misfit_ranking_iset( misfit_ranking_type * misfit_ranking , int iens , hash_type * obs_hash , double total_misfit) { - if (iens > vector_get_size(misfit_ranking->ensemble)) - vector_grow_NULL( misfit_ranking->ensemble , iens ); - - if (obs_hash != NULL) - vector_iset_owned_ref( misfit_ranking->ensemble , iens , obs_hash , hash_free__ ); - else - vector_iset_ref( misfit_ranking->ensemble , iens , NULL ); - - double_vector_iset( misfit_ranking->total , iens , total_misfit ); -} - - -void misfit_ranking_iset_invalid( misfit_ranking_type * misfit_ranking , int iens ) { - misfit_ranking_iset( misfit_ranking , iens , NULL , INVALID_RANKING_VALUE ); -} - - -const perm_vector_type * misfit_ranking_get_permutation( const misfit_ranking_type * misfit_ranking ) { - return misfit_ranking->sort_permutation; -} diff --git a/ThirdParty/Ert/libenkf/src/misfit_ts.c b/ThirdParty/Ert/libenkf/src/misfit_ts.c deleted file mode 100644 index e0b4655387..0000000000 --- a/ThirdParty/Ert/libenkf/src/misfit_ts.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'misfit_ts.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include -#include -#include - -#include - - -#define MISFIT_TS_TYPE_ID 641066 - -struct misfit_ts_struct { - UTIL_TYPE_ID_DECLARATION; - double_vector_type * data; /* A double vector of length 'history_length' with actual misfit values. */ -}; - -static UTIL_SAFE_CAST_FUNCTION(misfit_ts , MISFIT_TS_TYPE_ID); - -/******************************************************************/ -/* - Implementation of the misfit_ts type. Contains the full - timeseries of misfit for one member/one observation key. -*/ - -misfit_ts_type * misfit_ts_alloc(int history_length) { - misfit_ts_type * misfit_ts = util_malloc( sizeof * misfit_ts ); - UTIL_TYPE_ID_INIT(misfit_ts , MISFIT_TS_TYPE_ID); - - if (history_length > 0) - misfit_ts->data = double_vector_alloc( history_length + 1 , 0 ); - else - misfit_ts->data = NULL; /* Used by the xxx_fread_alloc() function below. */ - - return misfit_ts; -} - - -misfit_ts_type * misfit_ts_fread_alloc( FILE * stream ) { - misfit_ts_type * misfit_ts = misfit_ts_alloc( 0 ); - if (misfit_ts->data == NULL) - misfit_ts->data = double_vector_fread_alloc( stream ); - return misfit_ts; -} - - -void misfit_ts_fwrite( const misfit_ts_type * misfit_ts , FILE * stream ) { - double_vector_fwrite( misfit_ts->data , stream ); -} - - - - -static void misfit_ts_free( misfit_ts_type * misfit_ts) { - double_vector_free( misfit_ts->data ); - free( misfit_ts ); -} - - -void misfit_ts_free__( void * vector ) { - misfit_ts_free( misfit_ts_safe_cast( vector )); -} - - - - -void misfit_ts_iset( misfit_ts_type * vector , int time_index , double value ) { - double_vector_iset( vector->data , time_index , value ); -} - -/** Step2 is inclusive - what a fucking mess. */ -double misfit_ts_eval( const misfit_ts_type * vector , const int_vector_type * steps) { - double misfit_sum = 0; - int step; - - for (int i = 0; i < int_vector_size(steps); ++i) { - step = int_vector_iget(steps, i); - misfit_sum += double_vector_iget(vector->data , step ); - } - - return misfit_sum; -} - diff --git a/ThirdParty/Ert/libenkf/src/model_config.c b/ThirdParty/Ert/libenkf/src/model_config.c deleted file mode 100644 index 9891449ef4..0000000000 --- a/ThirdParty/Ert/libenkf/src/model_config.c +++ /dev/null @@ -1,636 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'model_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -/** - This struct contains configuration which is specific to this - particular model/run. Such of the information is actually accessed - directly through the enkf_state object; but this struct is the - owner of the information, and responsible for allocating/freeing - it. - - Observe that the distinction of what goes in model_config, and what - goes in ecl_config is not entirely clear; ECLIPSE is unfortunately - not (yet ??) exactly 'any' reservoir simulator in this context. - -*/ - - -/* - The runpath format is governed by a hash table where new runpaths - are added with model_config_add_runpath() and then current runpath - is selected with model_config_select_runpath(). However this - implementation is quite different from the way manipulation of the - runpath is exposed to the user: The runpath is controlled through - the RUNPATH config key (key DEFAULT_RUNPATH_KEY in the hash table) - This semantically predefined runpath is the only option visible to the user. - */ - -#define MODEL_CONFIG_TYPE_ID 661053 -struct model_config_struct { - UTIL_TYPE_ID_DECLARATION; - stringlist_type * case_names; /* A list of "iens -> name" mappings - can be NULL. */ - char * case_table_file; - forward_model_type * forward_model; /* The forward_model - as loaded from the config file. Each enkf_state object internalizes its private copy of the forward_model. */ - time_map_type * external_time_map; - history_type * history; /* The history object. */ - path_fmt_type * current_runpath; /* path_fmt instance for runpath - runtime the call gets arguments: (iens, report_step1 , report_step2) - i.e. at least one %d must be present.*/ - char * current_path_key; - hash_type * runpath_map; - char * jobname_fmt; /* Format string with one '%d' for the jobname - can be NULL in which case the eclbase name will be used. */ - char * enspath; - char * rftpath; - fs_driver_impl dbase_type; - bool has_prediction; - int max_internal_submit; /* How many times to retry if the load fails. */ - history_source_type history_source; - const ecl_sum_type * refcase; /* A pointer to the refcase - can be NULL. Observe that this ONLY a pointer - to the ecl_sum instance owned and held by the ecl_config object. */ - char * gen_kw_export_file_name; - - /** The results are always loaded. */ - bool_vector_type * internalize_state; /* Should the (full) state be internalized (at this report_step). */ - bool_vector_type * __load_eclipse_restart; /* Internal variable: is it necessary to load the state? */ -}; - - - -const char * model_config_get_jobname_fmt( const model_config_type * model_config ) { - return model_config->jobname_fmt; -} - -void model_config_set_jobname_fmt( model_config_type * model_config , const char * jobname_fmt) { - model_config->jobname_fmt = util_realloc_string_copy( model_config->jobname_fmt , jobname_fmt ); -} - - -path_fmt_type * model_config_get_runpath_fmt(const model_config_type * model_config) { - return model_config->current_runpath; -} - -const char * model_config_get_runpath_as_char( const model_config_type * model_config ) { - return path_fmt_get_fmt( model_config->current_runpath ); -} - -bool model_config_runpath_requires_iter( const model_config_type * model_config ) { - if (util_int_format_count( model_config_get_runpath_as_char( model_config)) > 1 ) - return true; - else - return false; -} - - -const char * model_config_get_case_table_file( const model_config_type * model_config ) { - return model_config->case_table_file; -} - -void model_config_set_case_table( model_config_type * model_config , int ens_size , const char * case_table_file ) { - if (model_config->case_table_file != NULL) { /* Clear the current selection */ - free( model_config->case_table_file ); - stringlist_free( model_config->case_names ); - - model_config->case_table_file = NULL; - model_config->case_names = NULL; - } - - if (case_table_file != NULL) { - bool atEOF = false; - char casename[128]; - int case_size = 0; - FILE * stream = util_fopen( case_table_file , "r"); - model_config->case_names = stringlist_alloc_new(); - while (!atEOF) { - if (fscanf( stream , "%s" , casename) == 1) { - stringlist_append_copy( model_config->case_names , casename ); - case_size++; - } else - atEOF = true; - } - fclose( stream ); - - if (case_size < ens_size) { - for (int i = case_size; i < ens_size; i++) - stringlist_append_owned_ref( model_config->case_names , util_alloc_sprintf("case_%04d" , i)); - fprintf(stderr, "** Warning: mismatch between NUM_REALIZATIONS:%d and size of CASE_TABLE:%d - using \'case_nnnn\' for the last cases %d.\n", ens_size , case_size , ens_size - case_size); - } else if (case_size > ens_size) - fprintf(stderr, "** Warning: mismatch between NUM_REALIZATIONS:%d and CASE_TABLE:%d - only the %d realizations will be used.\n", ens_size , case_size , ens_size); - - } -} - - -void model_config_add_runpath( model_config_type * model_config , const char * path_key , const char * fmt) { - path_fmt_type * path_fmt = path_fmt_alloc_directory_fmt( fmt ); - hash_insert_hash_owned_ref( model_config->runpath_map , path_key , path_fmt , path_fmt_free__ ); -} - - -/* - If the path_key does not exists it will return false and stay - silent. -*/ - -bool model_config_select_runpath( model_config_type * model_config , const char * path_key) { - if (hash_has_key( model_config->runpath_map , path_key )) { - model_config->current_runpath = hash_get( model_config->runpath_map , path_key ); - model_config->current_path_key = util_realloc_string_copy( model_config->current_path_key , path_key); - return true; - } else { - if (model_config->current_runpath != NULL) // OK - we already have a valid selection - stick to that and return False. - return false; - else { - util_abort("%s: path_key:%s does not exist - and currently no valid runpath selected \n",__func__ , path_key); - return false; - } - } -} - - -void model_config_set_runpath(model_config_type * model_config , const char * fmt) { - if (model_config->current_path_key) { - model_config_add_runpath(model_config , model_config->current_path_key , fmt); - model_config_select_runpath( model_config , model_config->current_path_key ); - } else - util_abort("%s: current path has not been set \n",__func__); -} - - - -void model_config_set_gen_kw_export_file( model_config_type * model_config, const char * file_name) { - model_config->gen_kw_export_file_name = util_realloc_string_copy( model_config->gen_kw_export_file_name , file_name ); -} - -const char * model_config_get_gen_kw_export_file( const model_config_type * model_config) { - return model_config->gen_kw_export_file_name; -} - - - - void model_config_set_enspath( model_config_type * model_config , const char * enspath) { - model_config->enspath = util_realloc_string_copy( model_config->enspath , enspath ); - } - - void model_config_set_rftpath( model_config_type * model_config , const char * rftpath) { - model_config->rftpath = util_realloc_string_copy( model_config->rftpath , rftpath ); - } - - void model_config_set_dbase_type( model_config_type * model_config , const char * dbase_type_string) { - model_config->dbase_type = fs_types_lookup_string_name( dbase_type_string ); - if (model_config->dbase_type == INVALID_DRIVER_ID) - util_abort("%s: did not recognize driver_type:%s \n",__func__ , dbase_type_string); - } - - - const char * model_config_get_enspath( const model_config_type * model_config) { - return model_config->enspath; - } - -const char * model_config_get_rftpath( const model_config_type * model_config) { - return model_config->rftpath; -} - -fs_driver_impl model_config_get_dbase_type(const model_config_type * model_config ) { - return model_config->dbase_type; -} - -const ecl_sum_type * model_config_get_refcase( const model_config_type * model_config ) { - return model_config->refcase; -} - -void * model_config_get_dbase_args( const model_config_type * model_config ) { - return NULL; -} - - -void model_config_set_refcase( model_config_type * model_config , const ecl_sum_type * refcase ) { - model_config->refcase = refcase; -} - - -history_source_type model_config_get_history_source( const model_config_type * model_config ) { - return model_config->history_source; -} - - - -void model_config_select_schedule_history( model_config_type * model_config , const sched_file_type * sched_file) { - if (model_config->history != NULL) - history_free( model_config->history ); - - if (sched_file != NULL) { - model_config->history = history_alloc_from_sched_file( SUMMARY_KEY_JOIN_STRING , sched_file); - model_config->history_source = SCHEDULE; - } else - util_abort("%s: internal error - trying to select HISTORY_SOURCE:SCHEDULE - but no Schedule file has been loaded.\n",__func__); -} - - -void model_config_select_refcase_history( model_config_type * model_config , const ecl_sum_type * refcase , bool use_history) { - if (model_config->history != NULL) - history_free( model_config->history ); - - if (refcase != NULL) { - model_config->history = history_alloc_from_refcase( refcase , use_history ); - model_config->history_source = SCHEDULE; - } else - util_abort("%s: internal error - trying to load history from REFCASE - but no REFCASE has been loaded.\n",__func__); -} - - -int model_config_get_max_internal_submit( const model_config_type * config ) { - return config->max_internal_submit; -} - -void model_config_set_max_internal_submit( model_config_type * model_config , int max_resample ) { - model_config->max_internal_submit = max_resample; -} - - -UTIL_IS_INSTANCE_FUNCTION( model_config , MODEL_CONFIG_TYPE_ID) - -model_config_type * model_config_alloc() { - model_config_type * model_config = util_malloc(sizeof * model_config ); - /** - There are essentially three levels of initialisation: - - 1. Initialize to NULL / invalid. - 2. Initialize with default values. - 3. Initialize with user supplied values. - - */ - UTIL_TYPE_ID_INIT(model_config , MODEL_CONFIG_TYPE_ID); - model_config->case_names = NULL; - model_config->enspath = NULL; - model_config->rftpath = NULL; - model_config->dbase_type = INVALID_DRIVER_ID; - model_config->current_runpath = NULL; - model_config->current_path_key = NULL; - model_config->case_table_file = NULL; - model_config->history = NULL; - model_config->jobname_fmt = NULL; - model_config->forward_model = NULL; - model_config->external_time_map = NULL; - model_config->internalize_state = bool_vector_alloc( 0 , false ); - model_config->__load_eclipse_restart = bool_vector_alloc( 0 , false ); - model_config->history_source = HISTORY_SOURCE_INVALID; - model_config->runpath_map = hash_alloc(); - model_config->gen_kw_export_file_name = NULL; - model_config->refcase = NULL; - - model_config_set_enspath( model_config , DEFAULT_ENSPATH ); - model_config_set_rftpath( model_config , DEFAULT_RFTPATH ); - model_config_set_dbase_type( model_config , DEFAULT_DBASE_TYPE ); - model_config_set_max_internal_submit( model_config , DEFAULT_MAX_INTERNAL_SUBMIT); - model_config_add_runpath( model_config , DEFAULT_RUNPATH_KEY , DEFAULT_RUNPATH); - model_config_select_runpath( model_config , DEFAULT_RUNPATH_KEY ); - model_config_set_gen_kw_export_file(model_config, DEFAULT_GEN_KW_EXPORT_FILE); - - return model_config; -} - - -bool model_config_select_history( model_config_type * model_config , history_source_type source_type, const sched_file_type * sched_file , const ecl_sum_type * refcase) { - bool selectOK = false; - - if (source_type == SCHEDULE && sched_file != NULL) { - model_config_select_schedule_history( model_config , sched_file ); - selectOK = true; - } - - if (((source_type == REFCASE_HISTORY) || (source_type == REFCASE_SIMULATED)) && refcase != NULL) { - if (source_type == REFCASE_HISTORY) - model_config_select_refcase_history( model_config , refcase , true); - else - model_config_select_refcase_history( model_config , refcase , false); - selectOK = true; - } - - return selectOK; -} - - -static bool model_config_select_any_history( model_config_type * model_config , const sched_file_type * sched_file , const ecl_sum_type * refcase) { - bool selectOK = false; - - if (sched_file != NULL) { - model_config_select_schedule_history( model_config , sched_file ); - selectOK = true; - } else if ( refcase != NULL ) { - model_config_select_refcase_history( model_config , refcase , true); - selectOK = true; - } - - return selectOK; -} - - - - -void model_config_init(model_config_type * model_config , - const config_content_type * config , - int ens_size , - const ext_joblist_type * joblist , - int last_history_restart , - const sched_file_type * sched_file , - const ecl_sum_type * refcase) { - - model_config->forward_model = forward_model_alloc( joblist ); - model_config_set_refcase( model_config , refcase ); - - - if (config_content_has_item( config , FORWARD_MODEL_KEY )) { - char * config_string = config_content_alloc_joined_string( config , FORWARD_MODEL_KEY , " "); - forward_model_parse_init( model_config->forward_model , config_string ); - free(config_string); - } - - if (config_content_has_item( config, RUNPATH_KEY)) { - model_config_add_runpath( model_config , DEFAULT_RUNPATH_KEY , config_content_get_value(config , RUNPATH_KEY) ); - model_config_select_runpath( model_config , DEFAULT_RUNPATH_KEY ); - } - - { - history_source_type source_type = DEFAULT_HISTORY_SOURCE; - - if (config_content_has_item( config , HISTORY_SOURCE_KEY)) { - const char * history_source = config_content_iget(config , HISTORY_SOURCE_KEY, 0,0); - source_type = history_get_source_type( history_source ); - } - - if (!model_config_select_history( model_config , source_type , sched_file , refcase )) - if (!model_config_select_history( model_config , DEFAULT_HISTORY_SOURCE , sched_file , refcase )) - if (!model_config_select_any_history( model_config , sched_file , refcase)) - fprintf(stderr,"** Warning:: Do not have enough information to select a history source \n"); - - } - - if (model_config->history != NULL) { - int num_restart = model_config_get_last_history_restart(model_config); - bool_vector_iset( model_config->internalize_state , num_restart - 1 , false ); - bool_vector_iset( model_config->__load_eclipse_restart , num_restart - 1 , false ); - } - - if (config_content_has_item( config , TIME_MAP_KEY)) { - const char * filename = config_content_get_value_as_path( config , TIME_MAP_KEY); - time_map_type * time_map = time_map_alloc(); - if (time_map_fscanf( time_map , filename)) - model_config->external_time_map = time_map; - else { - time_map_free( time_map ); - fprintf(stderr,"** ERROR: Loading external time map from:%s failed \n", filename); - } - } - - - - /* - The full treatment of the SCHEDULE_PREDICTION_FILE keyword is in - the ensemble_config file, because the functionality is implemented - as (quite) plain GEN_KW instance. Here we just check if it is - present or not. - */ - - if (config_content_has_item(config , SCHEDULE_PREDICTION_FILE_KEY)) - model_config->has_prediction = true; - else - model_config->has_prediction = false; - - - if (config_content_has_item(config , CASE_TABLE_KEY)) - model_config_set_case_table( model_config , ens_size , config_content_iget( config , CASE_TABLE_KEY , 0,0)); - - if (config_content_has_item( config , ENSPATH_KEY)) - model_config_set_enspath( model_config , config_content_get_value(config , ENSPATH_KEY)); - - if (config_content_has_item( config , JOBNAME_KEY)) - model_config_set_jobname_fmt( model_config , config_content_get_value(config , JOBNAME_KEY)); - - if (config_content_has_item( config , RFTPATH_KEY)) - model_config_set_rftpath( model_config , config_content_get_value(config , RFTPATH_KEY)); - - if (config_content_has_item( config , DBASE_TYPE_KEY)) - model_config_set_dbase_type( model_config , config_content_get_value(config , DBASE_TYPE_KEY)); - - if (config_content_has_item( config , MAX_RESAMPLE_KEY)) - model_config_set_max_internal_submit( model_config , config_content_get_value_as_int( config , MAX_RESAMPLE_KEY )); - - - { - const char * export_file_name; - if (config_content_has_item( config , GEN_KW_EXPORT_FILE_KEY)) - export_file_name = config_content_get_value(config, GEN_KW_EXPORT_FILE_KEY); - else - export_file_name = DEFAULT_GEN_KW_EXPORT_FILE; - - model_config_set_gen_kw_export_file(model_config, export_file_name); - } -} - - -const char * model_config_iget_casename( const model_config_type * model_config , int index) { - if (model_config->case_names == NULL) - return NULL; - else - return stringlist_iget( model_config->case_names , index ); -} - - - -void model_config_free(model_config_type * model_config) { - free( model_config->enspath ); - free( model_config->rftpath ); - util_safe_free( model_config->jobname_fmt ); - util_safe_free( model_config->case_table_file ); - util_safe_free( model_config->current_path_key); - util_safe_free( model_config->gen_kw_export_file_name); - - if (model_config->history) - history_free(model_config->history); - - if (model_config->forward_model) - forward_model_free(model_config->forward_model); - - if (model_config->external_time_map) - time_map_free( model_config->external_time_map ); - - - bool_vector_free(model_config->internalize_state); - bool_vector_free(model_config->__load_eclipse_restart); - hash_free(model_config->runpath_map); - - if (model_config->case_names) - stringlist_free( model_config->case_names ); - free(model_config); -} - - - -bool model_config_has_history(const model_config_type * config) { - if (config->history != NULL) - return true; - else - return false; -} - - -history_type * model_config_get_history(const model_config_type * config) { - return config->history; -} - -/** - Will be NULL unless the user has explicitly loaded an external time - map with the TIME_MAP config option. -*/ - -time_map_type * model_config_get_external_time_map( const model_config_type * config) { - return config->external_time_map; -} - -int model_config_get_last_history_restart(const model_config_type * config) { - if (config->history) - return history_get_last_restart( config->history ); - else { - if (config->external_time_map) - return time_map_get_last_step( config->external_time_map); - else { - fprintf(stderr,"** Warning: Trying to get the last restart number - no history/time_map object has been registered.\n"); - return 0; - } - } -} - - -bool model_config_has_prediction(const model_config_type * config) { - return config->has_prediction; -} - - -forward_model_type * model_config_get_forward_model( const model_config_type * config) { - return config->forward_model; -} - - -/*****************************************************************/ - -/* Setting everything back to the default value: false. */ -void model_config_init_internalization( model_config_type * config ) { - bool_vector_reset(config->internalize_state); - bool_vector_reset(config->__load_eclipse_restart); -} - - -/** - This function sets the internalize_state flag to true for - report_step. Because of the coupling to the __load_eclipse_restart variable - this function can __ONLY__ be used to set internalize to true. -*/ - -void model_config_set_internalize_state( model_config_type * config , int report_step) { - bool_vector_iset(config->internalize_state , report_step , true); - bool_vector_iset(config->__load_eclipse_restart , report_step , true); -} - - -void model_config_set_load_state( model_config_type * config , int report_step) { - bool_vector_iset(config->__load_eclipse_restart , report_step , true); -} - - - -/* Query functions. */ - -bool model_config_internalize_state( const model_config_type * config , int report_step) { - return bool_vector_iget(config->internalize_state , report_step); -} - -/*****************************************************************/ - -bool model_config_load_state( const model_config_type * config , int report_step) { - return bool_vector_iget(config->__load_eclipse_restart , report_step); -} - - - - - -void model_config_fprintf_config( const model_config_type * model_config , int ens_size , FILE * stream ) { - fprintf( stream , CONFIG_COMMENTLINE_FORMAT ); - fprintf( stream , CONFIG_COMMENT_FORMAT , "Here comes configuration information related to this model."); - - if (model_config->case_table_file != NULL) { - fprintf( stream , CONFIG_KEY_FORMAT , CASE_TABLE_KEY ); - fprintf( stream , CONFIG_ENDVALUE_FORMAT , model_config->case_table_file ); - } - fprintf( stream , CONFIG_KEY_FORMAT , FORWARD_MODEL_KEY); - forward_model_fprintf( model_config->forward_model , stream ); - - fprintf( stream , CONFIG_KEY_FORMAT , RUNPATH_KEY ); - fprintf( stream , CONFIG_ENDVALUE_FORMAT , path_fmt_get_fmt( model_config->current_runpath )); - - fprintf( stream , CONFIG_KEY_FORMAT , ENSPATH_KEY ); - fprintf( stream , CONFIG_ENDVALUE_FORMAT , model_config->enspath ); - - fprintf( stream , CONFIG_KEY_FORMAT , RFTPATH_KEY ); - fprintf( stream , CONFIG_ENDVALUE_FORMAT , model_config->rftpath ); - - fprintf( stream , CONFIG_KEY_FORMAT , MAX_RESAMPLE_KEY ); - { - char max_retry_string[16]; - sprintf( max_retry_string , "%d" ,model_config->max_internal_submit); - fprintf( stream , CONFIG_ENDVALUE_FORMAT , max_retry_string); - } - - fprintf(stream , CONFIG_KEY_FORMAT , HISTORY_SOURCE_KEY); - fprintf(stream , CONFIG_ENDVALUE_FORMAT , history_get_source_string( model_config->history_source )); - - fprintf(stream , CONFIG_KEY_FORMAT , NUM_REALIZATIONS_KEY); - fprintf(stream , CONFIG_INT_FORMAT , ens_size); - fprintf(stream , "\n\n"); - -} diff --git a/ThirdParty/Ert/libenkf/src/obs_data.c b/ThirdParty/Ert/libenkf/src/obs_data.c deleted file mode 100644 index 0e2f0bd758..0000000000 --- a/ThirdParty/Ert/libenkf/src/obs_data.c +++ /dev/null @@ -1,762 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'obs_data.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -/** -See the file README.obs for ducumentation of the varios datatypes -involved with observations/measurement/+++. - - -The file contains two different variables holding the number of -observations, nrobs_total and nrobs_active. The first holds the total -number of observations at this timestep, and the second holds the -number of active measurements at this timestep; the inactive -measurements have been deactivated the obs_data_deactivate_outliers() -function. - -The flow is as follows: - - 1. All the observations have been collected in an obs_data instance, - and all the corresponding measurements of the state have been - collected in a meas_data instance - we are ready for analysis. - - 2. The functions meas_data_alloc_stats() is called to calculate - the ensemble mean and std of all the measurements. - - 3. The function obs_data_deactivate_outliers() is called to compare - the ensemble mean and std with the observations, in the case of - outliers the number obs_active flag of the obs_data instance is - set to false. - - 4. The remaining functions (and matrices) now refer to the number of - active observations, however the "raw" observations found in the - obs_data instance are in a vector with nrobs_total observations; - i.e. we must handle two indices and two total lengths. A bit - messy. - - -Variables of size nrobs_total: ------------------------------- - o obs->value / obs->std / obs->obs_active - o meanS , innov, stdS - - -variables of size nrobs_active: -------------------------------- -Matrices: S, D, E and various internal variables. -*/ - - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -#define OBS_BLOCK_TYPE_ID 995833 - -struct obs_block_struct { - UTIL_TYPE_ID_DECLARATION; - char * obs_key; - int size; - double * value; - double * std; - - active_type * active_mode; - int active_size; - matrix_type * error_covar; - bool error_covar_owner; /* If true the error_covar matrix is free'd when construction of the R matrix is complete. */ - double global_std_scaling; -}; - - - -struct obs_data_struct { - vector_type * data; /* vector with obs_block instances. */ - double global_std_scaling; -}; - - - -static UTIL_SAFE_CAST_FUNCTION(obs_block , OBS_BLOCK_TYPE_ID ) - -obs_block_type * obs_block_alloc( const char * obs_key , int obs_size , matrix_type * error_covar , bool error_covar_owner, double global_std_scaling) { - obs_block_type * obs_block = util_malloc( sizeof * obs_block ); - - UTIL_TYPE_ID_INIT( obs_block , OBS_BLOCK_TYPE_ID ); - obs_block->size = obs_size; - obs_block->obs_key = util_alloc_string_copy( obs_key ); - obs_block->value = util_calloc( obs_size , sizeof * obs_block->value ); - obs_block->std = util_calloc( obs_size , sizeof * obs_block->std ); - obs_block->active_mode = util_calloc( obs_size , sizeof * obs_block->active_mode ); - obs_block->error_covar = error_covar; - obs_block->error_covar_owner = error_covar_owner; - obs_block->global_std_scaling = global_std_scaling; - { - for (int iobs = 0; iobs < obs_size; iobs++) - obs_block->active_mode[iobs] = LOCAL_INACTIVE; - } - obs_block->active_size = 0; - return obs_block; -} - - - -void obs_block_free( obs_block_type * obs_block ) { - free( obs_block->obs_key ); - free( obs_block->value ); - free( obs_block->std ); - free( obs_block->active_mode ); - free( obs_block ); -} - - -static void obs_block_free__( void * arg ) { - obs_block_type * obs_block = obs_block_safe_cast( arg ); - obs_block_free( obs_block ); -} - - -static void obs_block_fprintf( const obs_block_type * obs_block , FILE * stream ) { - for (int iobs=0; iobs < obs_block->size; iobs++) - fprintf(stream , "[ %12.5f +/- %12.5f ] \n" , obs_block->value[iobs] , obs_block->std[iobs]); -} - - -void obs_block_deactivate( obs_block_type * obs_block , int iobs , bool verbose , const char * msg) { - if (obs_block->active_mode[ iobs ] == ACTIVE) { - if (verbose) - printf("Deactivating: %s(%d) : %s \n",obs_block->obs_key , iobs , msg); - obs_block->active_mode[ iobs ] = DEACTIVATED; - obs_block->active_size--; - } -} - - -const char * obs_block_get_key( const obs_block_type * obs_block) { return obs_block->obs_key; } - -void obs_block_iset( obs_block_type * obs_block , int iobs , double value , double std) { - obs_block->value[ iobs ] = value; - obs_block->std[ iobs ] = std; - if (obs_block->active_mode[ iobs ] != ACTIVE) { - obs_block->active_mode[iobs] = ACTIVE; - obs_block->active_size++; - } -} - -void obs_block_iset_missing( obs_block_type * obs_block , int iobs ) { - if (obs_block->active_mode[ iobs ] == ACTIVE) - obs_block->active_size--; - obs_block->active_mode[iobs] = MISSING; -} - - -double obs_block_iget_std( const obs_block_type * obs_block , int iobs) { - return obs_block->std[ iobs ] * obs_block->global_std_scaling; -} - - -double obs_block_iget_value( const obs_block_type * obs_block , int iobs) { - return obs_block->value[ iobs ]; -} - - -active_type obs_block_iget_active_mode( const obs_block_type * obs_block , int iobs) { - return obs_block->active_mode[ iobs ]; -} - - - -int obs_block_get_size( const obs_block_type * obs_block ) { - return obs_block->size; -} - - -int obs_block_get_active_size( const obs_block_type * obs_block ) { - return obs_block->active_size; -} - - - - -/*Function that sets each element of the scaling factor equal to 1 divided by the prior standard deviation (from the - obs_data input file. -*/ -static void obs_block_init_scaling( const obs_block_type * obs_block , double * scale_factor , int * __obs_offset) { - int obs_offset = *__obs_offset; - int iobs; - for (iobs =0; iobs < obs_block->size; iobs++) { - if (obs_block->active_mode[iobs] == ACTIVE) { - scale_factor[ obs_offset ] = 1.0 / obs_block_iget_std(obs_block, iobs); - obs_offset++; - } - } - *__obs_offset = obs_offset; -} - - -/* -static void obs_block_init_innov( const obs_block_type * obs_block , const meas_block_type * meas_block , matrix_type * innov , int * __obs_offset) { - int obs_offset = *__obs_offset; - int iobs; - for (iobs =0; iobs < obs_block->size; iobs++) { - if (obs_block->active_mode[iobs] == ACTIVE) { - matrix_iset( innov , obs_offset , 0 , obs_block->value[ iobs ] - meas_block_iget_ens_mean( meas_block , iobs )); - obs_offset++; - } - } - *__obs_offset = obs_offset; -} -*/ - -static void obs_block_initdObs( const obs_block_type * obs_block , matrix_type * dObs , int * __obs_offset) { - int obs_offset = *__obs_offset; - int iobs; - for (iobs =0; iobs < obs_block->size; iobs++) { - if (obs_block->active_mode[iobs] == ACTIVE) { - matrix_iset( dObs , obs_offset , 0 , obs_block->value[ iobs ]); - matrix_iset( dObs , obs_offset , 1 , obs_block->std[ iobs ]); - obs_offset++; - } - } - *__obs_offset = obs_offset; -} - - - - - - -static void obs_block_initR( const obs_block_type * obs_block , matrix_type * R, int * __obs_offset) { - int obs_offset = *__obs_offset; - if (obs_block->error_covar == NULL) { - int iobs; - int iactive = 0; - for (iobs =0; iobs < obs_block->size; iobs++) { - if (obs_block->active_mode[iobs] == ACTIVE) { - double var = obs_block_iget_std(obs_block, iobs) * obs_block_iget_std(obs_block, iobs); - matrix_iset_safe(R , obs_offset + iactive, obs_offset + iactive, var); - iactive++; - } - } - } else { - int row_active = 0; /* We have a covar matrix */ - for (int row = 0; row < obs_block->size; row++) { - if (obs_block->active_mode[row] == ACTIVE) { - int col_active = 0; - for (int col = 0; col < obs_block->size; col++) { - if (obs_block->active_mode[col] == ACTIVE) { - matrix_iset_safe(R , obs_offset + row_active , obs_offset + col_active , matrix_iget( obs_block->error_covar , row , col )); - col_active++; - } - } - row_active++; - } - } - } - - *__obs_offset = obs_offset + obs_block->active_size; - if ((obs_block->error_covar_owner) && (obs_block->error_covar != NULL)) - matrix_free( obs_block->error_covar ); -} - - - -static void obs_block_initE( const obs_block_type * obs_block , matrix_type * E, const double * pert_var , int * __obs_offset) { - int ens_size = matrix_get_columns( E ); - int obs_offset = *__obs_offset; - int iobs; - for (iobs =0; iobs < obs_block->size; iobs++) { - if (obs_block->active_mode[iobs] == ACTIVE) { - double factor = obs_block_iget_std(obs_block, iobs) * sqrt( ens_size / pert_var[ obs_offset ]); - for (int iens = 0; iens < ens_size; iens++) - matrix_imul(E , obs_offset , iens , factor ); - - obs_offset++; - } - } - - *__obs_offset = obs_offset; -} - - -static void obs_block_initE_non_centred( const obs_block_type * obs_block , matrix_type * E, int * __obs_offset) { - int ens_size = matrix_get_columns( E ); - int obs_offset = *__obs_offset; - int iobs; - for (iobs =0; iobs < obs_block->size; iobs++) { - if (obs_block->active_mode[iobs] == ACTIVE) { - double factor = obs_block_iget_std(obs_block, iobs); - for (int iens = 0; iens < ens_size; iens++) - matrix_imul(E , obs_offset , iens , factor ); - - obs_offset++; - } - } - - *__obs_offset = obs_offset; -} - - - -static void obs_block_initD( const obs_block_type * obs_block , matrix_type * D, int * __obs_offset) { - int ens_size = matrix_get_columns( D ); - int obs_offset = *__obs_offset; - int iobs; - for (iobs =0; iobs < obs_block->size; iobs++) { - if (obs_block->active_mode[iobs] == ACTIVE) { - for (int iens = 0; iens < ens_size; iens++) - matrix_iadd(D , obs_offset , iens , obs_block->value[ iobs ]); - - obs_offset++; - } - } - - *__obs_offset = obs_offset; -} - - -/*****************************************************************/ - - -obs_data_type * obs_data_alloc(double global_std_scaling) { - obs_data_type * obs_data = util_malloc(sizeof * obs_data ); - obs_data->data = vector_alloc_new(); - obs_data->global_std_scaling = global_std_scaling; - obs_data_reset(obs_data); - return obs_data; -} - - - -void obs_data_reset(obs_data_type * obs_data) { - vector_clear( obs_data->data ); -} - - -obs_block_type * obs_data_add_block( obs_data_type * obs_data , const char * obs_key , int obs_size , matrix_type * error_covar, bool error_covar_owner) { - obs_block_type * new_block = obs_block_alloc( obs_key , obs_size , error_covar , error_covar_owner, obs_data->global_std_scaling); - vector_append_owned_ref( obs_data->data , new_block , obs_block_free__ ); - return new_block; -} - - -obs_block_type * obs_data_iget_block( obs_data_type * obs_data , int index ) { - return vector_iget( obs_data->data , index); -} - - -const obs_block_type * obs_data_iget_block_const( const obs_data_type * obs_data , int index ) { - return vector_iget_const( obs_data->data , index ); -} - - -void obs_data_free(obs_data_type * obs_data) { - vector_free( obs_data->data ); - free(obs_data); -} - - - -matrix_type * obs_data_allocE(const obs_data_type * obs_data , rng_type * rng , int active_ens_size ) { - double *pert_mean , *pert_var; - matrix_type * E; - int iens, iobs_active; - int active_obs_size = obs_data_get_active_size( obs_data ); - - E = matrix_alloc( active_obs_size , active_ens_size); - - pert_mean = util_calloc(active_obs_size , sizeof * pert_mean ); - pert_var = util_calloc(active_obs_size , sizeof * pert_var ); - { - double * tmp = util_calloc( active_obs_size * active_ens_size , sizeof * tmp ); - int i,j; - int k = 0; - - enkf_util_rand_stdnormal_vector(active_obs_size * active_ens_size , tmp , rng); - for (j=0; j < active_ens_size; j++) { - for (i=0; i < active_obs_size; i++) { - matrix_iset( E , i , j , tmp[k]); - k++; - } - } - free(tmp); - } - - for (iobs_active = 0; iobs_active < active_obs_size; iobs_active++) { - pert_mean[iobs_active] = 0; - pert_var[iobs_active] = 0; - } - - for (iens = 0; iens < active_ens_size; iens++) - for (iobs_active = 0; iobs_active < active_obs_size; iobs_active++) - pert_mean[iobs_active] += matrix_iget(E , iobs_active , iens); - - - for (iobs_active = 0; iobs_active < active_obs_size; iobs_active++) - pert_mean[iobs_active] /= active_ens_size; - - for (iens = 0; iens < active_ens_size; iens++) { - for (iobs_active = 0; iobs_active < active_obs_size; iobs_active++) { - double tmp; - matrix_iadd(E , iobs_active , iens , -pert_mean[iobs_active]); - tmp = matrix_iget(E , iobs_active , iens); - pert_var[iobs_active] += tmp * tmp; - } - } - - /* - The actual observed data are not accessed before this last block. - */ - { - int obs_offset = 0; - for (int block_nr = 0; block_nr < vector_get_size( obs_data->data ); block_nr++) { - const obs_block_type * obs_block = vector_iget_const( obs_data->data , block_nr); - obs_block_initE( obs_block , E , pert_var , &obs_offset); - } - } - - free(pert_mean); - free(pert_var); - - matrix_set_name( E , "E"); - matrix_assert_finite( E ); - return E; -} - - -/* Function that returns a matrix of independent, normal distributed random vector having mean zero, - and variance (covariance) specified in the input (obs_data) file. NOTICE THE DIFFERENCE WITH allocE, WHERE THE - RETURNED MATRIX IS CENTRED -*/ - - -matrix_type * obs_data_allocE_non_centred(const obs_data_type * obs_data , rng_type * rng , int ens_size) { - matrix_type * E; - int active_size = obs_data_get_active_size( obs_data ); - E = matrix_alloc( active_size , ens_size); - - { - double * tmp = util_calloc( active_size * ens_size , sizeof * tmp ); - int i,j; - int k = 0; - - enkf_util_rand_stdnormal_vector(active_size * ens_size , tmp , rng); - for (j=0; j < ens_size; j++) { - for (i=0; i < active_size; i++) { - matrix_iset( E , i , j , tmp[k]); - k++; - } - } - free(tmp); - } - - - /* - The actual observed data are not accessed before this last block. - */ - { - int obs_offset = 0; - for (int block_nr = 0; block_nr < vector_get_size( obs_data->data ); block_nr++) { - const obs_block_type * obs_block = vector_iget_const( obs_data->data , block_nr); - obs_block_initE_non_centred( obs_block , E , &obs_offset); - } - } - - - matrix_set_name( E , "E"); - matrix_assert_finite( E ); - return E; -} - -matrix_type * obs_data_allocD(const obs_data_type * obs_data , const matrix_type * E , const matrix_type * S) { - matrix_type * D = matrix_alloc_copy( E ); - matrix_inplace_sub( D , S ); - - { - int obs_offset = 0; - for (int block_nr = 0; block_nr < vector_get_size( obs_data->data ); block_nr++) { - const obs_block_type * obs_block = vector_iget_const( obs_data->data , block_nr); - obs_block_initD( obs_block , D , &obs_offset); - } - } - - matrix_set_name( D , "D"); - matrix_assert_finite( D ); - return D; -} - - - - -matrix_type * obs_data_allocR(const obs_data_type * obs_data) { - int active_size = obs_data_get_active_size( obs_data ); - matrix_type * R = matrix_alloc( active_size , active_size ); - { - int obs_offset = 0; - for (int block_nr = 0; block_nr < vector_get_size( obs_data->data ); block_nr++) { - const obs_block_type * obs_block = vector_iget_const( obs_data->data , block_nr); - obs_block_initR( obs_block , R , &obs_offset); - } - } - - matrix_set_name( R , "R"); - matrix_assert_finite( R ); - return R; -} - -/* -matrix_type * obs_data_alloc_innov(const obs_data_type * obs_data , const meas_data_type * meas_data , int active_size) { - matrix_type * innov = matrix_alloc( active_size , 1 ); - { - int obs_offset = 0; - for (int block_nr = 0; block_nr < vector_get_size( obs_data->data ); block_nr++) { - const obs_block_type * obs_block = vector_iget_const( obs_data->data , block_nr ); - const meas_block_type * meas_block = meas_data_iget_block_const( meas_data , block_nr ); - - obs_block_init_innov( obs_block , meas_block , innov , &obs_offset); - } - } - return innov; -} -*/ - -matrix_type * obs_data_allocdObs(const obs_data_type * obs_data ) { - int active_size = obs_data_get_active_size( obs_data ); - matrix_type * dObs = matrix_alloc( active_size , 2 ); - { - int obs_offset = 0; - for (int block_nr = 0; block_nr < vector_get_size( obs_data->data ); block_nr++) { - const obs_block_type * obs_block = vector_iget_const( obs_data->data , block_nr ); - - obs_block_initdObs( obs_block , dObs , &obs_offset); - } - } - return dObs; -} - - -static void obs_data_scale_matrix__(matrix_type * m , const double * scale_factor) { - const int rows = matrix_get_rows( m ); - const int columns = matrix_get_columns( m ); - int i, j; - - for (i = 0; i < columns; i++) - for (j = 0; j < rows; j++) - matrix_imul(m , j,i, scale_factor[j]); - -} - - -static void obs_data_scale_Rmatrix__( matrix_type * R , const double * scale_factor) { - int nrobs_active = matrix_get_rows( R ); - - /* Scale the error covariance matrix*/ - for (int i=0; i < nrobs_active; i++) - for (int j=0; j < nrobs_active; j++) - matrix_imul(R , i , j , scale_factor[i] * scale_factor[j]); -} - - -static double * obs_data_alloc_scale_factor(const obs_data_type * obs_data ) { - int nrobs_active = obs_data_get_active_size( obs_data ); - double * scale_factor = util_calloc(nrobs_active , sizeof * scale_factor ); - int obs_offset = 0; - for (int block_nr = 0; block_nr < vector_get_size( obs_data->data ); block_nr++) { - const obs_block_type * obs_block = vector_iget_const( obs_data->data , block_nr ); - - /* Init. the scaling factor ( 1/std(dObs) ) */ - obs_block_init_scaling( obs_block , scale_factor , &obs_offset); - } - - return scale_factor; -} - - -void obs_data_scale_matrix(const obs_data_type * obs_data , matrix_type * matrix) { - double * scale_factor = obs_data_alloc_scale_factor( obs_data ); - obs_data_scale_matrix__( matrix , scale_factor ); - free( scale_factor ); -} - - -void obs_data_scale_Rmatrix(const obs_data_type * obs_data , matrix_type * R) { - double * scale_factor = obs_data_alloc_scale_factor( obs_data ); - obs_data_scale_Rmatrix__( R , scale_factor ); - free( scale_factor ); -} - - -void obs_data_scale(const obs_data_type * obs_data , matrix_type *S , matrix_type *E , matrix_type *D , matrix_type *R , matrix_type * dObs) { - double * scale_factor = obs_data_alloc_scale_factor( obs_data ); - - /* Scale the forecasted data so that they (in theory) have the same variance - (if the prior distribution for the observation errors is correct) */ - obs_data_scale_matrix__( S , scale_factor ); - - /* Scale the combined data matrix: D = DObs + E - S, where DObs is the iobs_active times ens_size matrix where - each column contains a copy of the observed data - */ - if (D != NULL) - obs_data_scale_matrix__( D , scale_factor ); - - /* Same with E (used for low rank representation of the error covariance matrix*/ - if (E != NULL) - obs_data_scale_matrix__( E , scale_factor ); - - if (dObs != NULL) - obs_data_scale_matrix__( dObs , scale_factor ); - - if (R != NULL) - obs_data_scale_Rmatrix__(R , scale_factor); - - free(scale_factor); -} - - -void obs_data_scale_kernel(const obs_data_type * obs_data , matrix_type *S , matrix_type *E , matrix_type *D , double *dObs) { - const int nrobs_active = matrix_get_rows( S ); - const int ens_size = matrix_get_columns( S ); - double * scale_factor = util_calloc(nrobs_active , sizeof * scale_factor ); - int iens, iobs_active; - - { - int obs_offset = 0; - for (int block_nr = 0; block_nr < vector_get_size( obs_data->data ); block_nr++) { - const obs_block_type * obs_block = vector_iget_const( obs_data->data , block_nr ); - - /* Init. the scaling factor ( 1/std(dObs) ) */ - obs_block_init_scaling( obs_block , scale_factor , &obs_offset); - } - } - - - for (iens = 0; iens < ens_size; iens++) { - for (iobs_active = 0; iobs_active < nrobs_active; iobs_active++) { - - /* Scale the forecasted data so that they (in theory) have the same variance - (if the prior distribution for the observation errors is correct) */ - matrix_imul(S , iobs_active , iens , scale_factor[iobs_active]); - - if (D != NULL) - /* Scale the combined data matrix: D = DObs + E - S, where DObs is the iobs_active times ens_size matrix where - each column contains a copy of the observed data - */ - matrix_imul(D , iobs_active , iens , scale_factor[iobs_active]); - - if (E != NULL) - /* Same with E (used for low rank representation of the error covariance matrix*/ - matrix_imul(E , iobs_active , iens , scale_factor[iobs_active]); - } - } - - /* Scale the vector of observed data*/ - if (dObs != NULL) { - for (iobs_active = 0; iobs_active < nrobs_active; iobs_active++) - dObs[iobs_active] *= scale_factor[iobs_active]; - } - - - free(scale_factor); -} - - - - -int obs_data_get_active_size( const obs_data_type * obs_data ) { - int active_size = 0; - for (int block_nr = 0; block_nr < vector_get_size( obs_data->data ); block_nr++) { - const obs_block_type * obs_block = vector_iget_const( obs_data->data , block_nr ); - active_size += obs_block->active_size; - } - - return active_size; -} - - -int obs_data_get_num_blocks( const obs_data_type * obs_data ) { - return vector_get_size( obs_data->data ); -} - - - -int obs_data_get_total_size( const obs_data_type * obs_data ) { - int total_size = 0; - for (int block_nr = 0; block_nr < vector_get_size( obs_data->data ); block_nr++) { - const obs_block_type * obs_block = vector_iget_const( obs_data->data , block_nr ); - total_size += obs_block->size; - } - return total_size; -} - - -static const obs_block_type * obs_data_lookup_block( const obs_data_type * obs_data, int total_index , int * block_offset) { - if (total_index < obs_data_get_total_size( obs_data )) { - const obs_block_type * obs_block; - int total_offset = 0; - int block_index = 0; - int block_size; - - - while (true) { - obs_block = vector_iget_const( obs_data->data , block_index ); - block_size = obs_block->size; - if ((block_size + total_offset) > total_index) - break; - - total_offset += block_size; - block_index++; - } - *block_offset = total_offset; - return obs_block; - } else { - util_abort("%s: could not lookup obs-block \n",__func__); - return NULL; - } -} - - -double obs_data_iget_value( const obs_data_type * obs_data , int total_index ) { - int total_offset; - const obs_block_type * obs_block = obs_data_lookup_block( obs_data , total_index , &total_offset ); - return obs_block_iget_value( obs_block , total_index - total_offset ); -} - - -double obs_data_iget_std( const obs_data_type * obs_data , int total_index ) { - int total_offset; - const obs_block_type * obs_block = obs_data_lookup_block( obs_data , total_index , &total_offset ); - return obs_block_iget_std( obs_block , total_index - total_offset ); -} - - -void obs_data_fprintf( const obs_data_type * obs_data , FILE * stream) { - fprintf(stream , "\n"); - for (int block_nr = 0; block_nr < vector_get_size( obs_data->data ); block_nr++) { - const obs_block_type * obs_block = vector_iget_const( obs_data->data , block_nr ); - obs_block_fprintf( obs_block , stream ); - } - fprintf(stream , "\n"); -} diff --git a/ThirdParty/Ert/libenkf/src/obs_vector.c b/ThirdParty/Ert/libenkf/src/obs_vector.c deleted file mode 100644 index 6420c6899b..0000000000 --- a/ThirdParty/Ert/libenkf/src/obs_vector.c +++ /dev/null @@ -1,1118 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'obs_vector.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -/** - See the overview documentation of the observation system in enkf_obs.c -*/ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define OBS_VECTOR_TYPE_ID 120086 - -struct obs_vector_struct { - UTIL_TYPE_ID_DECLARATION; - obs_free_ftype *freef; /* Function used to free an observation node. */ - obs_get_ftype *get_obs; /* Function used to build the 'd' vector. */ - obs_meas_ftype *measure; /* Function used to measure on the state, and add to to the S matrix. */ - obs_user_get_ftype *user_get; /* Function to get an observation based on KEY:INDEX input from user.*/ - obs_chi2_ftype *chi2; /* Function to evaluate chi-squared for an observation. */ - obs_update_std_scale_ftype *update_std_scale; /* Function to scale the standard deviation with a given factor */ - - vector_type * nodes; - char * obs_key; /* The key this observation vector has in the enkf_obs layer. */ - enkf_config_node_type * config_node; /* The config_node of the node type we are observing - shared reference */ - obs_impl_type obs_type; - int num_active; /* The total number of timesteps where this observation is active (i.e. nodes[ ] != NULL) */ - int_vector_type * step_list; -}; - - -UTIL_IS_INSTANCE_FUNCTION(obs_vector , OBS_VECTOR_TYPE_ID) -UTIL_SAFE_CAST_FUNCTION(obs_vector , OBS_VECTOR_TYPE_ID) - -/*****************************************************************/ - - -static void obs_vector_prefer_RESTART_warning() { - fprintf(stderr," -------------------------------------------------------------------------------\n"); - fprintf(stderr," Warning: For GEN_OBS observations it is highly recommended to use the RESTART \n"); - fprintf(stderr," keyword to denote the time of the observation. The RESTART value \n"); - fprintf(stderr," should be matched with the report step embedded as part of the \n"); - fprintf(stderr," GEN_DATA result file created by the forward model. \n"); - fprintf(stderr,"\n"); - fprintf(stderr," In the future use OF DATE and DAYS will not be possible for GEN_OBS \n"); - fprintf(stderr," -------------------------------------------------------------------------------\n"); - fprintf(stderr,"\n"); - fprintf(stderr,"\n"); -} - - - -static int __conf_instance_get_restart_nr(const conf_instance_type * conf_instance, const char * obs_key , time_map_type * time_map , bool prefer_restart) { - int obs_restart_nr = -1; /* To shut up compiler warning. */ - - if(conf_instance_has_item(conf_instance, "RESTART")) { - obs_restart_nr = conf_instance_get_item_value_int(conf_instance, "RESTART"); - if (obs_restart_nr > time_map_get_last_step( time_map)) - util_abort("%s: Observation %s occurs at restart %i, but history file has only %i restarts.\n", __func__, obs_key, obs_restart_nr, time_map_get_last_step( time_map )); - } else { - time_t obs_time = time_map_get_start_time( time_map ); - - if(conf_instance_has_item(conf_instance, "DATE")) { - obs_time = conf_instance_get_item_value_time_t(conf_instance, "DATE" ); - if (prefer_restart) - obs_vector_prefer_RESTART_warning(); - } else if (conf_instance_has_item(conf_instance, "DAYS")) { - double days = conf_instance_get_item_value_double(conf_instance, "DAYS"); - util_inplace_forward_days_utc( &obs_time , days ); - if (prefer_restart) - obs_vector_prefer_RESTART_warning(); - } else if (conf_instance_has_item(conf_instance, "HOURS")) { - double hours = conf_instance_get_item_value_double(conf_instance, "HOURS"); - util_inplace_forward_seconds_utc( &obs_time , hours * 3600 ); - if (prefer_restart) - obs_vector_prefer_RESTART_warning(); - } else - util_abort("%s: Internal error. Invalid conf_instance?\n", __func__); - - obs_restart_nr = time_map_lookup_time_with_tolerance( time_map , obs_time , 30 , 30 ); - } - if (obs_restart_nr < 0) - util_abort("%s: Failed to look up restart nr correctly \n",__func__); - - return obs_restart_nr; -} - - - -/*****************************************************************/ - - -static void obs_vector_resize(obs_vector_type * vector , int new_size) { - int current_size = vector_get_size( vector->nodes ); - int i; - - for (i=current_size; i < new_size; i++) - vector_append_ref( vector->nodes , NULL); - -} - - -obs_vector_type * obs_vector_alloc(obs_impl_type obs_type , const char * obs_key , enkf_config_node_type * config_node, int num_reports) { - obs_vector_type * vector = util_malloc(sizeof * vector ); - - UTIL_TYPE_ID_INIT( vector , OBS_VECTOR_TYPE_ID); - vector->freef = NULL; - vector->measure = NULL; - vector->get_obs = NULL; - vector->user_get = NULL; - vector->chi2 = NULL; - vector->update_std_scale = NULL; - vector->step_list = int_vector_alloc(0,0); - - switch (obs_type) { - case(SUMMARY_OBS): - vector->freef = summary_obs_free__; - vector->measure = summary_obs_measure__; - vector->get_obs = summary_obs_get_observations__; - vector->user_get = summary_obs_user_get__; - vector->chi2 = summary_obs_chi2__; - vector->update_std_scale = summary_obs_update_std_scale__; - break; - case(BLOCK_OBS): - vector->freef = block_obs_free__; - vector->measure = block_obs_measure__; - vector->get_obs = block_obs_get_observations__; - vector->user_get = block_obs_user_get__; - vector->chi2 = block_obs_chi2__; - vector->update_std_scale = block_obs_update_std_scale__; - break; - case(GEN_OBS): - vector->freef = gen_obs_free__; - vector->measure = gen_obs_measure__; - vector->get_obs = gen_obs_get_observations__; - vector->user_get = gen_obs_user_get__; - vector->chi2 = gen_obs_chi2__; - vector->update_std_scale = gen_obs_update_std_scale__; - break; - default: - util_abort("%s: internal error - obs_type:%d not recognized \n",__func__ , obs_type); - } - - vector->obs_type = obs_type; - vector->config_node = config_node; - vector->obs_key = util_alloc_string_copy( obs_key ); - vector->num_active = 0; - vector->nodes = vector_alloc_new(); - obs_vector_resize(vector , num_reports + 1); /* +1 here ?? Ohh - these +/- problems. */ - - return vector; -} - -obs_impl_type obs_vector_get_impl_type(const obs_vector_type * obs_vector) { - return obs_vector->obs_type; -} - - -/** - This is the key for the enkf_node which this observation is - 'looking at'. I.e. if this observation is an RFT pressure - measurement, this function will return "PRESSURE". -*/ - -const char * obs_vector_get_state_kw(const obs_vector_type * obs_vector) { - return enkf_config_node_get_key( obs_vector->config_node ); -} - - -const char * obs_vector_get_key(const obs_vector_type * obs_vector) { - return obs_vector->obs_key; -} - - -enkf_config_node_type * obs_vector_get_config_node(const obs_vector_type * obs_vector) { - return obs_vector->config_node; -} - - - -void obs_vector_free(obs_vector_type * obs_vector) { - vector_free( obs_vector->nodes ); - free(obs_vector->obs_key); - int_vector_free(obs_vector->step_list); - free(obs_vector); -} - - -static void obs_vector_assert_node_type( const obs_vector_type * obs_vector , const void * node ) { - bool type_OK; - switch (obs_vector->obs_type) { - case(SUMMARY_OBS): - type_OK = summary_obs_is_instance( node ); - break; - case(BLOCK_OBS): - type_OK = block_obs_is_instance( node ); - break; - case(GEN_OBS): - type_OK = gen_obs_is_instance( node ); - break; - default: - util_abort("%s: Error in type check: \n",__func__); - type_OK = false; - } - if (!type_OK) - util_abort("%s: Type mismatch when trying to add observation node to observation vector \n",__func__); -} - - - - -void obs_vector_del_node(obs_vector_type * obs_vector , int index) { - if (vector_iget_const( obs_vector->nodes , index ) != NULL) { - vector_iset_ref( obs_vector->nodes , index , NULL); /* Clear current content. */ - obs_vector->num_active--; - } -} - -/** - This function will clear (and free) all the summary_obs / gen_obs / - field_obs instances which have been installed in the vector; - however the vector itself is retained with keys, function pointers - and so on. -*/ - -void obs_vector_clear_nodes( obs_vector_type * obs_vector ) { - vector_clear( obs_vector->nodes ); - obs_vector->num_active = 0; -} - - - -void obs_vector_install_node(obs_vector_type * obs_vector , int index , void * node) { - obs_vector_assert_node_type( obs_vector , node ); - { - if (vector_iget_const( obs_vector->nodes , index ) == NULL) { - obs_vector->num_active++; - int_vector_append( obs_vector->step_list , index ); - int_vector_sort( obs_vector->step_list ); - } - - vector_iset_owned_ref( obs_vector->nodes , index , node , obs_vector->freef ); - } -} - -/** - Observe that @summary_key is the key used to look up the - corresponding simulated value in the ensemble, and not the - observation key - the two can be different. -*/ - -static void obs_vector_add_summary_obs( obs_vector_type * obs_vector , int obs_index , const char * summary_key , const char * obs_key , double value , double std , const char * auto_corrf_name , double auto_corrf_param) { - summary_obs_type * summary_obs = summary_obs_alloc( summary_key , obs_key , value , std , auto_corrf_name , auto_corrf_param); - obs_vector_install_node( obs_vector , obs_index , summary_obs ); -} - - -/*****************************************************************/ - -int obs_vector_get_num_active(const obs_vector_type * vector) { - return vector->num_active; -} - - -/** - IFF - only one - report step is active this function will return - that report step. If more than report step is active, the function - is ambiguous, and will fail HARD. Check with get_num_active first! -*/ - -int obs_vector_get_active_report_step(const obs_vector_type * vector) { - if (vector->num_active == 1) { - int active_step = -1; - int i; - for (i=0; i < vector_get_size(vector->nodes); i++) { - void * obs_node = vector_iget( vector->nodes , i); - if (obs_node != NULL) { - if (active_step >= 0) - util_abort("%s: internal error - mismatch in obs_vector->nodes and obs_vector->num_active \n",__func__); - active_step = i; - } - } - if (active_step < 0) - util_abort("%s: internal error - mismatch in obs_vector->nodes and obs_vector->num_active \n",__func__); - - return active_step; - } else { - util_abort("%s: when calling this function the number of active report steps MUST BE 1 - you had: %d \n",__func__ , vector->num_active); - return 0; /* Comiler shut up. */ - } -} - - -const int_vector_type * obs_vector_get_step_list(const obs_vector_type * vector) { - return vector->step_list; -} - - -bool obs_vector_iget_active(const obs_vector_type * vector, int index) { - /* We accept this ... */ - if (index >= vector_get_size( vector->nodes )) - return false; - - { - void * obs_data = vector_iget( vector->nodes , index ); - if (obs_data != NULL) - return true; - else - return false; - } -} - - -/* - Will happily return NULL if index is not active. -*/ -void * obs_vector_iget_node(const obs_vector_type * vector, int index) { - return vector_iget( vector->nodes , index ); -} - - - - -void obs_vector_user_get(const obs_vector_type * obs_vector , const char * index_key , int report_step , double * value , double * std , bool * valid) { - void * obs_node = obs_vector_iget_node( obs_vector , report_step ); - obs_vector->user_get(obs_node , index_key , value , std , valid); -} - -/* - This function returns the next active (i.e. node != NULL) report - step, starting with 'prev_step + 1'. If no more active steps are - found, it will return -1. -*/ - -int obs_vector_get_next_active_step(const obs_vector_type * obs_vector , int prev_step) { - if (prev_step >= (vector_get_size(obs_vector->nodes) - 1)) - return -1; - else { - int size = vector_get_size( obs_vector->nodes ); - int next_step = prev_step + 1; - while (( next_step < size) && (obs_vector_iget_node(obs_vector , next_step) == NULL)) - next_step++; - - if (next_step == size) - return -1; /* No more active steps. */ - else - return next_step; - } -} - - -int obs_vector_get_last_active_step(const obs_vector_type * obs_vector) { - int step = vector_get_size( obs_vector->nodes ) - 1; - while (true) { - const void * obs_node = vector_iget_const( obs_vector->nodes , step ); - if (obs_node) - break; - - step--; - if (step < 0) - break; - } - return step; -} - - - -/*****************************************************************/ -/** - All the obs_vector_load_from_XXXX() functions can safely return - NULL, in which case no observation is added to enkf_obs observation - hash table. -*/ - - -void obs_vector_load_from_SUMMARY_OBSERVATION(obs_vector_type * obs_vector , const conf_instance_type * conf_instance , time_map_type * obs_time , ensemble_config_type * ensemble_config) { - if(!conf_instance_is_of_class(conf_instance, "SUMMARY_OBSERVATION")) - util_abort("%s: internal error. expected \"SUMMARY_OBSERVATION\" instance, got \"%s\".\n", - __func__, conf_instance_get_class_name_ref(conf_instance) ); - - { - double obs_value = conf_instance_get_item_value_double(conf_instance, "VALUE" ); - double obs_error = conf_instance_get_item_value_double(conf_instance, "ERROR" ); - double min_error = conf_instance_get_item_value_double(conf_instance, "ERROR_MIN"); - const char * error_mode = conf_instance_get_item_value_ref( conf_instance, "ERROR_MODE"); - const char * sum_key = conf_instance_get_item_value_ref( conf_instance, "KEY" ); - const char * obs_key = conf_instance_get_name_ref(conf_instance); - int obs_restart_nr = __conf_instance_get_restart_nr(conf_instance , obs_key , obs_time , false); - - if (obs_restart_nr == 0) { - int day,month,year; - time_t start_time = time_map_iget( obs_time , 0 ); - util_set_date_values_utc( start_time , &day , &month , &year); - - fprintf(stderr,"** ERROR: It is unfortunately not possible to use summary observations from the\n"); - fprintf(stderr," start of the simulation. Problem with observation:%s at %02d/%02d/%4d\n",obs_key , day,month,year); - exit(1); - } - { - if (strcmp( error_mode , "REL") == 0) - obs_error *= obs_value; - else if (strcmp( error_mode , "RELMIN") == 0) - obs_error = util_double_max( min_error , obs_error * obs_value ); - - obs_vector_add_summary_obs( obs_vector , obs_restart_nr , sum_key , obs_key , obs_value , obs_error , NULL , 0); - } - } -} - - - - -obs_vector_type * obs_vector_alloc_from_GENERAL_OBSERVATION(const conf_instance_type * conf_instance , time_map_type * obs_time , const ensemble_config_type * ensemble_config) { - if(!conf_instance_is_of_class(conf_instance, "GENERAL_OBSERVATION")) - util_abort("%s: internal error. expected \"GENERAL_OBSERVATION\" instance, got \"%s\".\n", - __func__, conf_instance_get_class_name_ref(conf_instance) ); - const char * obs_key = conf_instance_get_name_ref(conf_instance); - const char * state_kw = conf_instance_get_item_value_ref( conf_instance, "DATA" ); - if (ensemble_config_has_key( ensemble_config , state_kw )) { - const char * obs_key = conf_instance_get_name_ref(conf_instance); - int obs_restart_nr = __conf_instance_get_restart_nr(conf_instance , obs_key , obs_time , true); - const char * index_file = NULL; - const char * index_list = NULL; - const char * obs_file = NULL; - const char * error_covar_file = NULL; - - if (conf_instance_has_item(conf_instance , "INDEX_FILE")) - index_file = conf_instance_get_item_value_ref( conf_instance, "INDEX_FILE" ); - - if (conf_instance_has_item(conf_instance , "INDEX_LIST")) - index_list = conf_instance_get_item_value_ref( conf_instance, "INDEX_LIST" ); - - if (conf_instance_has_item(conf_instance , "OBS_FILE")) - obs_file = conf_instance_get_item_value_ref( conf_instance, "OBS_FILE" ); - - if (conf_instance_has_item(conf_instance , "ERROR_COVAR")) - error_covar_file = conf_instance_get_item_value_ref( conf_instance, "ERROR_COVAR" ); - - { - obs_vector_type * obs_vector = NULL; - const enkf_config_node_type * config_node = ensemble_config_get_node( ensemble_config , state_kw); - - if (enkf_config_node_get_impl_type(config_node) == GEN_DATA) { - double scalar_error = -1; - double scalar_value = -1; - gen_obs_type * gen_obs ; - const gen_data_config_type * config = enkf_config_node_get_ref( config_node ); - - if (gen_data_config_has_report_step( config , obs_restart_nr)) { - obs_vector = obs_vector_alloc( GEN_OBS , obs_key , ensemble_config_get_node(ensemble_config , state_kw ), time_map_get_last_step( obs_time )); - if (conf_instance_has_item(conf_instance , "VALUE")) { - scalar_value = conf_instance_get_item_value_double(conf_instance , "VALUE"); - scalar_error = conf_instance_get_item_value_double(conf_instance , "ERROR"); - } - - /** The config system has ensured that we have either OBS_FILE or (VALUE and ERROR). */ - gen_obs = gen_obs_alloc( enkf_config_node_get_ref( config_node ) , obs_key , obs_file , scalar_value , scalar_error , index_file , index_list , error_covar_file); - obs_vector_install_node( obs_vector , obs_restart_nr , gen_obs ); - } else - fprintf(stderr,"** ERROR: The GEN_DATA node:%s is not configured to load from report step:%d - the observation:%s will be ignored\n", state_kw , obs_restart_nr , obs_key); - } else { - ert_impl_type impl_type = enkf_config_node_get_impl_type(config_node); - fprintf(stderr,"** ERROR: %s: %s has implementation type:\'%s\' - expected:\'%s\' - observation:%s ignored.\n", - __func__ , state_kw , enkf_types_get_impl_name(impl_type) , enkf_types_get_impl_name(GEN_DATA) , obs_key); - } - return obs_vector; - - } - } else { - fprintf(stderr,"** Warning the ensemble key:%s does not exist - observation:%s not added \n", state_kw , obs_key); - return NULL; - } -} - - - -// Should check the refcase for key - if it is != NULL. - -bool obs_vector_load_from_HISTORY_OBSERVATION(obs_vector_type * obs_vector , - const conf_instance_type * conf_instance , - time_map_type * obs_time , - const history_type * history , - ensemble_config_type * ensemble_config, - double std_cutoff ) { - - if(!conf_instance_is_of_class(conf_instance, "HISTORY_OBSERVATION")) - util_abort("%s: internal error. expected \"HISTORY_OBSERVATION\" instance, got \"%s\".\n",__func__, conf_instance_get_class_name_ref(conf_instance) ); - - { - bool initOK = false; - int size , restart_nr; - double_vector_type * value = double_vector_alloc(0,0); - double_vector_type * std = double_vector_alloc(0,0); - bool_vector_type * valid = bool_vector_alloc(0 , false); - - /* The auto_corrf parameters can not be "segmentized" */ - double auto_corrf_param = -1; - const char * auto_corrf_name = NULL; - - - double error = conf_instance_get_item_value_double(conf_instance, "ERROR" ); - double error_min = conf_instance_get_item_value_double(conf_instance, "ERROR_MIN" ); - const char * error_mode = conf_instance_get_item_value_ref( conf_instance, "ERROR_MODE"); - const char * sum_key = conf_instance_get_name_ref( conf_instance ); - - if(conf_instance_has_item(conf_instance, "AUTO_CORRF")) { - auto_corrf_name = conf_instance_get_item_value_ref( conf_instance , "AUTO_CORRF"); - auto_corrf_param = conf_instance_get_item_value_double(conf_instance, "AUTO_CORRF_PARAM"); - if(conf_instance_has_item(conf_instance, "AUTO_CORRF_PARAM")) - auto_corrf_param = conf_instance_get_item_value_double(conf_instance, "AUTO_CORRF_PARAM"); - else - util_abort("%s: When specifying AUTO_CORRF you must also give a vlaue for AUTO_CORRF_PARAM",__func__); - } - - - // Get time series data from history object and allocate - size = time_map_get_last_step( obs_time ); - if (history_init_ts( history , sum_key , value , valid )) { - - // Create the standard deviation vector - if(strcmp(error_mode, "ABS") == 0) { - for( restart_nr = 0; restart_nr < size; restart_nr++) - double_vector_iset( std , restart_nr , error ); - } else if(strcmp(error_mode, "REL") == 0) { - for( restart_nr = 0; restart_nr < size; restart_nr++) - double_vector_iset( std , restart_nr , error * abs( double_vector_iget( value , restart_nr ))); - } else if(strcmp(error_mode, "RELMIN") == 0) { - for(restart_nr = 0; restart_nr < size; restart_nr++) { - double tmp_std = util_double_max( error_min , error * abs( double_vector_iget( value , restart_nr ))); - double_vector_iset( std , restart_nr , tmp_std); - } - } else - util_abort("%s: Internal error. Unknown error mode \"%s\"\n", __func__, error_mode); - - - // Handle SEGMENTs which can be used to customize the observation error. */ - { - stringlist_type * segment_keys = conf_instance_alloc_list_of_sub_instances_of_class_by_name(conf_instance, "SEGMENT"); - stringlist_sort( segment_keys , NULL ); - - int num_segments = stringlist_get_size(segment_keys); - - for(int segment_nr = 0; segment_nr < num_segments; segment_nr++) - { - const char * segment_name = stringlist_iget(segment_keys, segment_nr); - const conf_instance_type * segment_conf = conf_instance_get_sub_instance_ref(conf_instance, segment_name); - - int start = conf_instance_get_item_value_int( segment_conf, "START" ); - int stop = conf_instance_get_item_value_int( segment_conf, "STOP" ); - double error_segment = conf_instance_get_item_value_double(segment_conf, "ERROR" ); - double error_min_segment = conf_instance_get_item_value_double(segment_conf, "ERROR_MIN" ); - const char * error_mode_segment = conf_instance_get_item_value_ref( segment_conf, "ERROR_MODE"); - - if(start < 0) - { - printf("%s: WARNING - Segment out of bounds. Truncating start of segment to 0.\n", __func__); - start = 0; - } - - if(stop >= size) - { - printf("%s: WARNING - Segment out of bounds. Truncating end of segment to %d.\n", __func__, size - 1); - stop = size -1; - } - - if(start > stop) - { - printf("%s: WARNING - Segment start after stop. Truncating end of segment to %d.\n", __func__, start ); - stop = start; - } - - // Create the standard deviation vector - if(strcmp(error_mode_segment, "ABS") == 0) { - for( restart_nr = start; restart_nr <= stop; restart_nr++) - double_vector_iset( std , restart_nr , error_segment) ; - } else if(strcmp(error_mode_segment, "REL") == 0) { - for( restart_nr = start; restart_nr <= stop; restart_nr++) - double_vector_iset( std , restart_nr , error_segment * abs(double_vector_iget( value , restart_nr))); - } else if(strcmp(error_mode_segment, "RELMIN") == 0) { - for(restart_nr = start; restart_nr <= stop ; restart_nr++) { - double tmp_std = util_double_max( error_min_segment , error_segment * abs( double_vector_iget( value , restart_nr ))); - double_vector_iset( std , restart_nr , tmp_std); - } - } else - util_abort("%s: Internal error. Unknown error mode \"%s\"\n", __func__, error_mode); - } - stringlist_free(segment_keys); - } - - - /* - This is where the summary observations are finally added. - */ - for (restart_nr = 0; restart_nr < size; restart_nr++) { - if (bool_vector_safe_iget( valid , restart_nr)) { - if (double_vector_iget( std , restart_nr) > std_cutoff) { - obs_vector_add_summary_obs( obs_vector , restart_nr , sum_key , sum_key , - double_vector_iget( value ,restart_nr) , double_vector_iget( std , restart_nr ) , - auto_corrf_name , auto_corrf_param); - } else - fprintf(stderr,"** Warning: to small observation error in observation %s:%d - ignored. \n", sum_key , restart_nr); - } - } - initOK = true; - } - double_vector_free(std); - double_vector_free(value); - bool_vector_free(valid); - return initOK; - } -} - -void obs_vector_scale_std(obs_vector_type * obs_vector, const local_obsdata_node_type * local_node , double std_multiplier) { - const active_list_type * active_list = local_obsdata_node_get_active_list( local_node ); - int tstep = -1; - - while (true) { - tstep = obs_vector_get_next_active_step( obs_vector , tstep ); - if (tstep < 0) - break; - - if (local_obsdata_node_tstep_active(local_node, tstep)) { - void * observation = obs_vector_iget_node(obs_vector, tstep); - if (observation) - obs_vector->update_std_scale(observation, std_multiplier , active_list); - } - } - -} - - -static const char * __summary_kw( const char * field_name ) { - if (strcmp( field_name , "PRESSURE") == 0) - return "BPR"; - else if (strcmp( field_name , "SWAT") == 0) - return "BSWAT"; - else if (strcmp( field_name , "SGAS") == 0) - return "BSGAS"; - else { - util_abort("%s: sorry - could not \'translate\' field:%s to block summary variable\n",__func__ , field_name); - return NULL; - } -} - - -obs_vector_type * obs_vector_alloc_from_BLOCK_OBSERVATION(const conf_instance_type * conf_instance , - const ecl_grid_type * grid , - time_map_type * obs_time , - const ecl_sum_type * refcase , - ensemble_config_type * ensemble_config) { - - if(!conf_instance_is_of_class(conf_instance, "BLOCK_OBSERVATION")) - util_abort("%s: internal error. expected \"BLOCK_OBSERVATION\" instance, got \"%s\".\n", - __func__, conf_instance_get_class_name_ref(conf_instance) ); - - block_obs_source_type source_type = SOURCE_SUMMARY; - const char * obs_label = conf_instance_get_name_ref(conf_instance); - const char * source_string = conf_instance_get_item_value_ref(conf_instance , "SOURCE"); - const char * field_name = conf_instance_get_item_value_ref(conf_instance , "FIELD"); - const char * sum_kw = NULL; - bool OK = true; - - if (strcmp(source_string , "FIELD") == 0) { - source_type = SOURCE_FIELD; - if (!ensemble_config_has_key( ensemble_config , field_name)) { - OK = false; - fprintf(stderr,"** Warning the ensemble key:%s does not exist - observation:%s not added \n", field_name , obs_label); - } - } else if (strcmp( source_string , "SUMMARY") == 0) { - source_type = SOURCE_SUMMARY; - sum_kw = __summary_kw( field_name ); - } else - util_abort("%s: internal error \n",__func__); - - if (OK) { - obs_vector_type * obs_vector = NULL; - int size = time_map_get_last_step( obs_time ); - int obs_restart_nr ; - - stringlist_type * summary_keys = stringlist_alloc_new(); - stringlist_type * obs_pt_keys = conf_instance_alloc_list_of_sub_instances_of_class_by_name(conf_instance, "OBS"); - int num_obs_pts = stringlist_get_size(obs_pt_keys); - - double * obs_value = util_calloc(num_obs_pts , sizeof * obs_value); - double * obs_std = util_calloc(num_obs_pts , sizeof * obs_std ); - int * obs_i = util_calloc(num_obs_pts , sizeof * obs_i ); - int * obs_j = util_calloc(num_obs_pts , sizeof * obs_j ); - int * obs_k = util_calloc(num_obs_pts , sizeof * obs_k ); - - obs_restart_nr = __conf_instance_get_restart_nr(conf_instance , obs_label , obs_time , false); - - /** Build the observation. */ - for(int obs_pt_nr = 0; obs_pt_nr < num_obs_pts; obs_pt_nr++) { - const char * obs_key = stringlist_iget(obs_pt_keys, obs_pt_nr); - const conf_instance_type * obs_instance = conf_instance_get_sub_instance_ref(conf_instance, obs_key); - const char * error_mode = conf_instance_get_item_value_ref(obs_instance, "ERROR_MODE"); - double error = conf_instance_get_item_value_double(obs_instance, "ERROR"); - double value = conf_instance_get_item_value_double(obs_instance, "VALUE"); - double min_error = conf_instance_get_item_value_double(obs_instance, "ERROR_MIN"); - - if (strcmp( error_mode , "REL") == 0) - error *= value; - else if (strcmp( error_mode , "RELMIN") == 0) - error = util_double_max( error * value , min_error ); - - obs_value[obs_pt_nr] = value; - obs_std [obs_pt_nr] = error; - - /** - The input values i,j,k come from the user, and are offset 1. They - are immediately shifted with -1 to become C-based offset zero. - */ - obs_i[obs_pt_nr] = conf_instance_get_item_value_int( obs_instance, "I") - 1; - obs_j[obs_pt_nr] = conf_instance_get_item_value_int( obs_instance, "J") - 1; - obs_k[obs_pt_nr] = conf_instance_get_item_value_int( obs_instance, "K") - 1; - - if (source_type == SOURCE_SUMMARY) { - char * summary_key = smspec_alloc_block_ijk_key( SUMMARY_KEY_JOIN_STRING , sum_kw , - obs_i[obs_pt_nr] + 1 , - obs_j[obs_pt_nr] + 1 , - obs_k[obs_pt_nr] + 1 ); - - stringlist_append_owned_ref( summary_keys , summary_key ); - } - } - - - if (source_type == SOURCE_FIELD) { - const enkf_config_node_type * config_node = ensemble_config_get_node( ensemble_config , field_name); - const field_config_type * field_config = enkf_config_node_get_ref( config_node ); - block_obs_type * block_obs = block_obs_alloc_complete(obs_label, source_type , NULL , field_config , grid , num_obs_pts, obs_i, obs_j, obs_k, obs_value, obs_std); - - if (block_obs != NULL) { - obs_vector = obs_vector_alloc( BLOCK_OBS , obs_label , ensemble_config_get_node(ensemble_config , field_name), size ); - obs_vector_install_node( obs_vector , obs_restart_nr , block_obs); - } - } else if (source_type == SOURCE_SUMMARY) { - OK = true; - if (refcase != NULL) { - for (int i=0; i < stringlist_get_size( summary_keys ); i++) { - const char * sum_key = stringlist_iget( summary_keys , i ); - if (!ecl_sum_has_key(refcase , sum_key)) { - /* - If the - */ - fprintf(stderr,"** Warning missing summary %s for cell: (%d,%d,%d) in refcase - make sure that \"BPR %d %d %d\" is included in ECLIPSE summary specification \n" , - sum_key , obs_i[i]+1 , obs_j[i]+1 , obs_k[i]+1 , obs_i[i]+1 , obs_j[i]+1 , obs_k[i]+1 ); - //OK = false; - } - } - } - if (OK) { - // We can create the container node and add the summary nodes. - enkf_config_node_type * container_config = ensemble_config_add_container( ensemble_config , NULL ); - - for (int i=0; i < stringlist_get_size( summary_keys ); i++) { - const char * sum_key = stringlist_iget( summary_keys , i ); - enkf_config_node_type * child_node = ensemble_config_add_summary_observation( ensemble_config , sum_key , LOAD_FAIL_WARN ); - enkf_config_node_update_container( container_config , child_node ); - } - - { - block_obs_type * block_obs = block_obs_alloc_complete(obs_label, source_type , summary_keys , enkf_config_node_get_ref(container_config) , - grid , num_obs_pts, obs_i, obs_j, obs_k, obs_value, obs_std); - if (block_obs != NULL) { - obs_vector = obs_vector_alloc( BLOCK_OBS , obs_label , container_config, size ); - obs_vector_install_node( obs_vector , obs_restart_nr , block_obs); - } - } - } - } else - util_abort("%s: invalid source value \n",__func__); - - free(obs_value); - free(obs_std); - free(obs_i); - free(obs_j); - free(obs_k); - stringlist_free(obs_pt_keys); - stringlist_free(summary_keys); - - return obs_vector; - } else { - fprintf(stderr,"** Warning the ensemble key:%s does not exist - observation:%s not added \n", field_name , obs_label); - return NULL; - } -} -/*****************************************************************/ - -void obs_vector_iget_observations(const obs_vector_type * obs_vector, int report_step , obs_data_type * obs_data, const active_list_type * active_list, enkf_fs_type * fs) { - void * obs_node = vector_iget( obs_vector->nodes , report_step ); - if ( obs_node != NULL) - obs_vector->get_obs(obs_node , obs_data , fs, report_step , active_list); -} - - -void obs_vector_measure(const obs_vector_type * obs_vector , - enkf_fs_type * fs , - int report_step , - const int_vector_type * ens_active_list , - meas_data_type * meas_data , - const active_list_type * active_list) { - - void * obs_node = vector_iget( obs_vector->nodes , report_step ); - if ( obs_node != NULL ) { - enkf_node_type * enkf_node = enkf_node_deep_alloc( obs_vector->config_node ); - - node_id_type node_id = { .report_step = report_step , - .iens = 0 }; - - int vec_size = int_vector_size( ens_active_list ); - for (int active_iens_index = 0; active_iens_index < vec_size; active_iens_index++) { - node_id.iens = int_vector_iget( ens_active_list , active_iens_index ); - - enkf_node_load(enkf_node , fs , node_id); - obs_vector->measure(obs_node , enkf_node_value_ptr(enkf_node) , node_id , meas_data , active_list); - } - - enkf_node_free( enkf_node ); - } -} - - -static bool obs_vector_has_data_at_report_step( const obs_vector_type * obs_vector , const bool_vector_type * active_mask , enkf_fs_type * fs, int report_step) { - void * obs_node = vector_iget( obs_vector->nodes , report_step ); - if ( obs_node ) { - node_id_type node_id = {.report_step = report_step }; - for (int iens = 0; iens < bool_vector_size( active_mask ); iens++) { - if (bool_vector_iget( active_mask , iens)) { - node_id.iens = iens; - if (! enkf_config_node_has_node(obs_vector->config_node , fs , node_id )) - return false; - } - } - } - - /* - Will return true unconditionally if we do not have observation data at this report step; - or alternatively if the active_mask is all false. - */ - return true; -} - - -/* - The has_vector_data() function will only check that we have a vector - stored, and not the actual length of the vector. This means we can - be fooled if the stored vector is shorter than what the observation - requires. - - Should ideally check that the vector is long enough, but that - requires changes in the enkf_node api for vector storage. -*/ - -static bool obs_vector_has_vector_data( const obs_vector_type * obs_vector , const bool_vector_type * active_mask , enkf_fs_type * fs) { - int vec_size = bool_vector_size( active_mask ); - - for (int iens = 0; iens < vec_size; iens++) { - const enkf_config_node_type * data_config = obs_vector->config_node; - if (bool_vector_iget( active_mask , iens )) { - if (!enkf_config_node_has_vector(data_config , fs , iens)) { - return false; - } - } - } - - return true; -} - - - -bool obs_vector_has_data( const obs_vector_type * obs_vector , const bool_vector_type * active_mask , enkf_fs_type * fs) { - const enkf_config_node_type * data_config = obs_vector->config_node; - if (enkf_config_node_vector_storage( data_config )) - return obs_vector_has_vector_data( obs_vector , active_mask , fs ); - - int vec_size = vector_get_size( obs_vector->nodes ); - for (int report_step = 0; report_step < vec_size; report_step++) { - if (!obs_vector_has_data_at_report_step( obs_vector , active_mask , fs, report_step)) - return false; - } - return true; -} - - - -/*****************************************************************/ -/** Here comes many different functions for misfit calculations. */ - -/** - This is the lowest level function: - - * It is checked that the obs_vector is active for the actual report - step; if it is not active 0.0 is returned without any further - ado. - - * It is assumed the enkf_node_instance contains valid data for this - report_step. This is not checked in this function, and is the - responsability of the calling scope. - - * The underlying chi2 function will do a type-check of node - and - fail hard if it is not correct. - -*/ - - -static double obs_vector_chi2__(const obs_vector_type * obs_vector , int report_step , const enkf_node_type * node, node_id_type node_id) { - void * obs_node = vector_iget( obs_vector->nodes , report_step ); - - if (obs_node) - return obs_vector->chi2( obs_node , enkf_node_value_ptr( node ), node_id); - else - return 0.0; /* Observation not active for this report step. */ - -} - - - - - -double obs_vector_chi2(const obs_vector_type * obs_vector , enkf_fs_type * fs , node_id_type node_id) { - enkf_node_type * enkf_node = enkf_node_alloc( obs_vector->config_node ); - double chi2 = 0; - - if (enkf_node_try_load( enkf_node , fs , node_id)) - chi2 = obs_vector_chi2__(obs_vector , node_id.report_step , enkf_node , node_id); - - enkf_node_free( enkf_node ); - return chi2; -} - - - - -/** - This function will evaluate the chi2 for the ensemble members - [iens1,iens2) and report steps [step1,step2). - - Observe that the chi2 pointer is assumed to be allocated for the - complete ensemble, altough this function only operates on part of - it. -*/ - - -//This will not work for container observations ..... - -void obs_vector_ensemble_chi2(const obs_vector_type * obs_vector , - enkf_fs_type * fs, - bool_vector_type * valid , - int step1 , - int step2 , - int iens1 , - int iens2 , - double ** chi2) { - - int step; - enkf_node_type * enkf_node = enkf_node_alloc( obs_vector->config_node ); - node_id_type node_id; - for (step = step1; step <= step2; step++) { - int iens; - node_id.report_step = step; - { - void * obs_node = vector_iget( obs_vector->nodes , step); - - if (obs_node == NULL) { - for (iens = iens1; iens < iens2; iens++) - chi2[step][iens] = 0; - } else { - for (iens = iens1; iens < iens2; iens++) { - node_id.iens = iens; - if (enkf_node_try_load( enkf_node , fs , node_id)) - chi2[step][iens] = obs_vector_chi2__(obs_vector , step , enkf_node , node_id); - else { - chi2[step][iens] = 0; - // Missing data - this member will be marked as invalid in the misfit calculations. - bool_vector_iset( valid , iens , false ); - } - } - } - } - } - enkf_node_free( enkf_node ); -} - - - -/** - This function will evaluate the total chi2 for one ensemble member - (i.e. sum over report steps). -*/ - - -double obs_vector_total_chi2(const obs_vector_type * obs_vector , enkf_fs_type * fs , int iens) { - double sum_chi2 = 0; - enkf_node_type * enkf_node = enkf_node_deep_alloc( obs_vector->config_node ); - node_id_type node_id = {.report_step = 0, .iens = iens }; - - int vec_size = vector_get_size( obs_vector->nodes ); - for (int report_step = 0; report_step < vec_size; report_step++) { - if (vector_iget(obs_vector->nodes , report_step) != NULL) { - node_id.report_step = report_step; - - if (enkf_node_try_load( enkf_node , fs , node_id)) - sum_chi2 += obs_vector_chi2__(obs_vector , report_step , enkf_node, node_id); - - } - } - enkf_node_free( enkf_node ); - return sum_chi2; -} - - -/** - This function will sum up all timesteps of the obs_vector, for all ensemble members. -*/ - -void obs_vector_ensemble_total_chi2(const obs_vector_type * obs_vector , enkf_fs_type * fs , int ens_size , double * sum_chi2) { - const bool verbose = true; - msg_type * msg; - int report_step; - int iens; - char * msg_text = NULL; - - for (iens = 0; iens < ens_size; iens++) - sum_chi2[iens] = 0; - - if (verbose) { - msg = msg_alloc("Observation: " , false); - msg_show(msg); - } - - { - node_id_type node_id = {.report_step = 0, .iens = iens }; - enkf_node_type * enkf_node = enkf_node_alloc( obs_vector->config_node ); - int vec_size = vector_get_size( obs_vector->nodes); - for (report_step = 0; report_step < vec_size; report_step++) { - if (verbose) { - msg_text = util_realloc_sprintf( msg_text , "%s[%03d]" , obs_vector->obs_key , report_step); - msg_update(msg , msg_text); - } - if (vector_iget(obs_vector->nodes , report_step) != NULL) { - node_id.report_step = report_step; - for (iens = 0; iens < ens_size; iens++) { - node_id.iens = iens; - - if (enkf_node_try_load( enkf_node , fs , node_id)) - sum_chi2[iens] += obs_vector_chi2__(obs_vector , report_step , enkf_node, node_id); - - } - } - } - enkf_node_free( enkf_node ); - } - - if (verbose) { - msg_free(msg , true); - util_safe_free( msg_text ); - } -} - -const char * obs_vector_get_obs_key( const obs_vector_type * obs_vector) { - return obs_vector->obs_key; -} - - -local_obsdata_node_type * obs_vector_alloc_local_node(const obs_vector_type * obs_vector) { - local_obsdata_node_type * obs_node = local_obsdata_node_alloc( obs_vector->obs_key , false ); - local_obsdata_node_reset_tstep_list(obs_node, obs_vector->step_list ); - return obs_node; -} - - -/*****************************************************************/ - - -VOID_FREE(obs_vector) - diff --git a/ThirdParty/Ert/libenkf/src/pca_plot_data.c b/ThirdParty/Ert/libenkf/src/pca_plot_data.c deleted file mode 100644 index ef9b33df20..0000000000 --- a/ThirdParty/Ert/libenkf/src/pca_plot_data.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - The file 'pca_plot_data.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include - -#include -#include -#include -#include - -#include -#include - -#define PCA_PLOT_DATA_TYPE_ID 61442098 - -struct pca_plot_data_struct { - UTIL_TYPE_ID_DECLARATION; - char * name; - vector_type * pca_vectors; - double_vector_type * singular_values; - int ens_size; -}; - - -UTIL_IS_INSTANCE_FUNCTION( pca_plot_data , PCA_PLOT_DATA_TYPE_ID ) -static UTIL_SAFE_CAST_FUNCTION( pca_plot_data , PCA_PLOT_DATA_TYPE_ID ) - -static void pca_plot_data_add_vectors(pca_plot_data_type * plot_data , const matrix_type * PC , const matrix_type * PC_obs, const double_vector_type * singular_values) { - int component; - for (component = 0; component < matrix_get_rows( PC ); component++) { - pca_plot_vector_type * vector = pca_plot_vector_alloc( component , PC , PC_obs , singular_values); - vector_append_owned_ref( plot_data->pca_vectors , vector , pca_plot_vector_free__); - } -} - - -pca_plot_data_type * pca_plot_data_alloc( const char * name, - const matrix_type * PC , - const matrix_type * PC_obs, - const double_vector_type * singular_values) { - pca_plot_data_type * plot_data = NULL; - - if (pca_plot_assert_input( PC , PC_obs , singular_values)) { - plot_data = util_malloc( sizeof * plot_data ); - UTIL_TYPE_ID_INIT( plot_data , PCA_PLOT_DATA_TYPE_ID ); - plot_data->name = util_alloc_string_copy( name ); - plot_data->pca_vectors = vector_alloc_new(); - plot_data->ens_size = matrix_get_columns( PC ); - plot_data->singular_values = double_vector_alloc_copy( singular_values ); - pca_plot_data_add_vectors( plot_data , PC , PC_obs , singular_values); - } - return plot_data; -} - - - - - -void pca_plot_data_free( pca_plot_data_type * plot_data ) { - vector_free( plot_data->pca_vectors ); - double_vector_free( plot_data->singular_values ); - free( plot_data->name ); - free( plot_data ); -} - -void pca_plot_data_free__( void * arg ) { - pca_plot_data_type * plot_data = pca_plot_data_safe_cast( arg ); - pca_plot_data_free( plot_data ); -} - -int pca_plot_data_get_size( const pca_plot_data_type * plot_data ) { - return vector_get_size( plot_data->pca_vectors ); -} - - -int pca_plot_data_get_ens_size( const pca_plot_data_type * plot_data ) { - return plot_data->ens_size; -} - -const pca_plot_vector_type * pca_plot_data_iget_vector( const pca_plot_data_type * plot_data , int ivec) { - return vector_iget_const( plot_data->pca_vectors , ivec ); -} - - -const char * pca_plot_data_get_name( const pca_plot_data_type * plot_data ) { - return plot_data->name; -} - - -const double_vector_type * pca_plot_data_get_singular_values( const pca_plot_data_type * plot_data ) { - return plot_data->singular_values; -} diff --git a/ThirdParty/Ert/libenkf/src/pca_plot_vector.c b/ThirdParty/Ert/libenkf/src/pca_plot_vector.c deleted file mode 100644 index b6f497d942..0000000000 --- a/ThirdParty/Ert/libenkf/src/pca_plot_vector.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - The file 'pca_plot_vector.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include - -#include -#include -#include - -#include - -#define PCA_PLOT_VECTOR_TYPE_ID 61743098 - -struct pca_plot_vector_struct { - UTIL_TYPE_ID_DECLARATION; - int size; - double singular_value; - double obs_value; - double * sim_data; -}; - - -UTIL_IS_INSTANCE_FUNCTION( pca_plot_vector , PCA_PLOT_VECTOR_TYPE_ID ) -static UTIL_SAFE_CAST_FUNCTION( pca_plot_vector , PCA_PLOT_VECTOR_TYPE_ID ) - -bool pca_plot_assert_input( const matrix_type * PC, const matrix_type * PC_obs, const double_vector_type * singular_values) { - if ((matrix_get_rows(PC) == matrix_get_rows( PC_obs )) && - (matrix_get_columns(PC_obs) == 1) && - (double_vector_size( singular_values ) >= matrix_get_rows(PC))) - return true; - else - return false; -} - -static void pca_plot_vector_init_data( pca_plot_vector_type * plot_vector , int component, const matrix_type * PC , const matrix_type * PC_obs, const double_vector_type * singular_values) { - int iens; - - for (iens = 0; iens < matrix_get_columns( PC ); iens++) - plot_vector->sim_data[iens] = matrix_iget( PC, component , iens ); - - plot_vector->obs_value = matrix_iget( PC_obs , component , 0 ); - plot_vector->singular_value = double_vector_iget( singular_values , component ); -} - -pca_plot_vector_type * pca_plot_vector_alloc( int component , - const matrix_type * PC , - const matrix_type * PC_obs, - const double_vector_type * singular_values) { - pca_plot_vector_type * plot_vector = NULL; - - if (pca_plot_assert_input( PC , PC_obs , singular_values ) && (component < matrix_get_rows( PC ))) { - - plot_vector = util_malloc( sizeof * plot_vector ); - UTIL_TYPE_ID_INIT( plot_vector , PCA_PLOT_VECTOR_TYPE_ID ); - plot_vector->obs_value = matrix_iget( PC_obs , component , 0 ); - plot_vector->size = matrix_get_columns( PC ); - plot_vector->sim_data = util_calloc( plot_vector->size , sizeof * plot_vector->sim_data ); - pca_plot_vector_init_data( plot_vector , component , PC , PC_obs , singular_values); - } - - return plot_vector; -} - - - -void pca_plot_vector_free( pca_plot_vector_type * plot_vector ) { - free( plot_vector->sim_data ); - free( plot_vector ); -} - - -void pca_plot_vector_free__( void * arg ) { - pca_plot_vector_type * vector = pca_plot_vector_safe_cast( arg ); - pca_plot_vector_free( vector ); -} - - -int pca_plot_vector_get_size( const pca_plot_vector_type * vector ) { - return vector->size; -} - -double pca_plot_vector_get_obs_value( const pca_plot_vector_type * vector ) { - return vector->obs_value; -} - -double pca_plot_vector_get_singular_value( const pca_plot_vector_type * vector ) { - return vector->singular_value; -} - - -double pca_plot_vector_iget_sim_value( const pca_plot_vector_type * vector , int sim_index) { - return vector->sim_data[ sim_index ]; -} diff --git a/ThirdParty/Ert/libenkf/src/plain_driver.c b/ThirdParty/Ert/libenkf/src/plain_driver.c deleted file mode 100644 index 56e738617e..0000000000 --- a/ThirdParty/Ert/libenkf/src/plain_driver.c +++ /dev/null @@ -1,273 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'plain_driver.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include - - -/** - The actual path to a stored node can be divided in three parts: - - - /some/path/in/the/filesystem/CurrentDirectory/%03d/mem%03d/Analyzed/%s - |<--------- 1 ------------->|<----- 2 ------>|<-------- 3 ---------->| - - 1: This is root path of the enkf_fs filesystem. This is the path - specified with the ENS_PATH configuration variable in the - enkf_config system. - - 2: The "directory" is a sub indexing under the root path. Typicall - use of this is to differentiate between the enkf assimalition, - various forward runs, smoother solutions and so on. - - 3. The part with the %d variables in is the final storage - hierarchy, where the first the replacement (%d,%d,%s) -> - (report_step , iens, key) is done on run_time. - -*/ - - -struct plain_driver_struct { - FS_DRIVER_FIELDS; - int __id; - path_fmt_type * node_path; - path_fmt_type * vector_path; - /* ---------------------------*/ - char * mount_point; - char * node_fmt; - char * vector_fmt; -}; - - - -static void plain_driver_assert_cast(plain_driver_type * plain_driver) { - if (plain_driver->__id != PLAIN_DRIVER_ID) - util_abort("%s: internal error - cast failed - aborting \n",__func__); -} - - -static plain_driver_type * plain_driver_safe_cast( void * __driver) { - plain_driver_type * driver = (plain_driver_type *) __driver; - plain_driver_assert_cast(driver); - return driver; -} - - -static void plain_driver_load_node(void * _driver , const char * node_key, int report_step , int iens , buffer_type * buffer) { - plain_driver_type * driver = plain_driver_safe_cast( _driver ); - { - char * filename = path_fmt_alloc_file(driver->node_path , false , report_step , iens , node_key); - - buffer_fread_realloc( buffer , filename ); - free(filename); - } -} - - -static void plain_driver_load_vector(void * _driver , const char * node_key, int iens , buffer_type * buffer) { - plain_driver_type * driver = plain_driver_safe_cast( _driver ); - { - char * filename = path_fmt_alloc_file(driver->vector_path , false , iens , node_key); - - buffer_fread_realloc( buffer , filename ); - free(filename); - } -} - - - - -static void plain_driver_save_node(void * _driver , const char * node_key , int report_step , int iens , buffer_type * buffer) { - plain_driver_type * driver = (plain_driver_type *) _driver; - plain_driver_assert_cast(driver); - { - char * filename = path_fmt_alloc_file(driver->node_path , true , report_step , iens , node_key); - buffer_store( buffer , filename ); - free(filename); - } -} - - -static void plain_driver_save_vector(void * _driver , const char * node_key , int iens , buffer_type * buffer) { - plain_driver_type * driver = (plain_driver_type *) _driver; - plain_driver_assert_cast(driver); - { - char * filename = path_fmt_alloc_file(driver->vector_path , true , iens , node_key); - buffer_store( buffer , filename ); - free(filename); - } -} - - - -void plain_driver_unlink_node(void * _driver , const char * node_key , int report_step , int iens ) { - plain_driver_type * driver = (plain_driver_type *) _driver; - plain_driver_assert_cast(driver); - { - char * filename = path_fmt_alloc_file(driver->node_path , true , report_step , iens , node_key ); - util_unlink_existing(filename); - free(filename); - } -} - -void plain_driver_unlink_vector(void * _driver , const char * node_key , int iens ) { - plain_driver_type * driver = (plain_driver_type *) _driver; - plain_driver_assert_cast(driver); - { - char * filename = path_fmt_alloc_file(driver->vector_path , true , iens , node_key ); - util_unlink_existing(filename); - free(filename); - } -} - - -/** - Observe that the semantics is fundamentally different between - plain_driver_paramater_has_node, and plain_driver_load_node: - - * When (trying to) load a node the function will try previous report steps - all the way back to the first report step. - - * The has_node function will _not_ go back to earlier report steps, but - instead return false if the report_step we ask for is not present. -*/ - -bool plain_driver_has_node(void * _driver , const char * node_key , int report_step , int iens ) { - plain_driver_type * driver = (plain_driver_type *) _driver; - plain_driver_assert_cast(driver); - { - bool has_node; - char * filename = path_fmt_alloc_file(driver->node_path , true , report_step , iens , node_key); - if (util_file_exists(filename)) - has_node = true; - else - has_node = false; - free(filename); - return has_node; - } -} - - -bool plain_driver_has_vector(void * _driver , const char * node_key , int iens ) { - plain_driver_type * driver = (plain_driver_type *) _driver; - plain_driver_assert_cast(driver); - { - bool has_node; - char * filename = path_fmt_alloc_file(driver->vector_path , true , iens , node_key); - if (util_file_exists(filename)) - has_node = true; - else - has_node = false; - free(filename); - return has_node; - } -} - - - - -void plain_driver_free(void *_driver) { - plain_driver_type * driver = (plain_driver_type *) _driver; - plain_driver_assert_cast(driver); - - path_fmt_free(driver->node_path); - path_fmt_free(driver->vector_path); - - free( driver->vector_fmt ); - free( driver->node_fmt ); - util_safe_free( driver->mount_point ); - free(driver); -} - - - - -/** - The driver takes a copy of the path object, i.e. it can be deleted - in the calling scope after calling plain_driver_alloc(). - - This is where the various function pointers are initialized. -*/ - -void * plain_driver_alloc(const char * mount_point , const char * node_fmt, const char * vector_fmt) { - plain_driver_type * driver = util_malloc(sizeof * driver ); - { - fs_driver_type * fs_driver = (fs_driver_type *) driver; - fs_driver_init(fs_driver); - } - - driver->load_node = plain_driver_load_node; - driver->save_node = plain_driver_save_node; - driver->unlink_node = plain_driver_unlink_node; - driver->has_node = plain_driver_has_node; - - driver->load_vector = plain_driver_load_vector; - driver->save_vector = plain_driver_save_vector; - driver->unlink_vector = plain_driver_unlink_vector; - driver->has_vector = plain_driver_has_vector; - - driver->fsync_driver = NULL; - driver->free_driver = plain_driver_free; - driver->mount_point = util_alloc_string_copy( mount_point ); - driver->node_fmt = util_alloc_sprintf( "%s%c%s" , mount_point , UTIL_PATH_SEP_CHAR , node_fmt ); - driver->vector_fmt = util_alloc_sprintf( "%s%c%s" , mount_point , UTIL_PATH_SEP_CHAR , vector_fmt ); - - driver->node_path = path_fmt_alloc_directory_fmt( driver->node_fmt ); - driver->vector_path = path_fmt_alloc_directory_fmt( driver->vector_fmt ); - driver->__id = PLAIN_DRIVER_ID; - return driver; -} - - -void plain_driver_create_fs( FILE * stream , fs_driver_enum driver_type , const char * node_fmt , const char * vector_fmt) { - util_fwrite_int(driver_type , stream ); - util_fwrite_string(node_fmt , stream); - util_fwrite_string(vector_fmt , stream); -} - - -/** - The two integers from the mount info have already been read at the enkf_fs level. -*/ -void * plain_driver_open(FILE * fstab_stream , const char * mount_point) { - char * node_fmt = util_fread_alloc_string( fstab_stream ); - char * vector_fmt = util_fread_alloc_string( fstab_stream ); - plain_driver_type * driver = plain_driver_alloc( mount_point , node_fmt , vector_fmt ); - free(node_fmt); - free(vector_fmt); - return driver; -} - - - -void plain_driver_fskip(FILE * fstab_stream ) { - char * node_fmt = util_fread_alloc_string( fstab_stream ); - char * vector_fmt = util_fread_alloc_string( fstab_stream ); - free(node_fmt); - free(vector_fmt); -} diff --git a/ThirdParty/Ert/libenkf/src/plain_driver_obs.c b/ThirdParty/Ert/libenkf/src/plain_driver_obs.c deleted file mode 100644 index e6029d0324..0000000000 --- a/ThirdParty/Ert/libenkf/src/plain_driver_obs.c +++ /dev/null @@ -1,186 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'plain_driver_obs.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include -#include - - - -struct plain_driver_obs_struct { - BASIC_OBS_DRIVER_FIELDS; - int __id; - path_fmt_type * path; /* With one embedded %d format character which is replaced with report_step on runtime. */ -}; - - - - - - - -static plain_driver_obs_type * plain_driver_obs_safe_cast(void * _driver) { - plain_driver_obs_type * driver = (plain_driver_obs_type *) _driver; - - if (driver->__id != PLAIN_DRIVER_OBS_ID) - util_abort("%s: internal error - cast failed - aborting \n",__func__); - - return driver; -} - - - - -static char * plain_driver_obs_alloc_filename(const plain_driver_obs_type * driver , int report_step , const char * key, bool auto_mkdir) { - return path_fmt_alloc_file(driver->path , auto_mkdir , report_step , key); -} - - - -void plain_driver_obs_load_node(void * _driver , int report_step , obs_node_type * node) { - plain_driver_obs_type * driver = plain_driver_obs_safe_cast(_driver); - { - char * filename = plain_driver_obs_alloc_filename(driver , report_step , obs_node_get_key(node) , false); - FILE * stream = util_fopen(filename , "r"); - - obs_node_fread(node , stream , report_step); - - fclose(stream); - free(filename); - } -} - - -void plain_driver_obs_unlink_node(void * _driver , int report_step , obs_node_type * node) { - plain_driver_obs_type * driver = plain_driver_obs_safe_cast(_driver); - { - char * filename = plain_driver_obs_alloc_filename(driver , report_step , obs_node_get_key(node) , false); - util_unlink_existing(filename); - free(filename); - } -} - - -void plain_driver_obs_save_node(void * _driver , int report_step , obs_node_type * node) { - plain_driver_obs_type * driver = plain_driver_obs_safe_cast(_driver); - { - char * filename = plain_driver_obs_alloc_filename(driver , report_step , obs_node_get_key(node) , true); - FILE * stream = util_fopen(filename , "w"); - bool data_written = obs_node_fwrite(node , stream , report_step); - fclose(stream); - if (!data_written) - util_unlink_existing( filename ); /* remove empty files. */ - free(filename); - } -} - - -/** - Return true if we have a on-disk representation of the node. -*/ - -bool plain_driver_obs_has_node(void * _driver , int report_step , const char * key) { - plain_driver_obs_type * driver = plain_driver_obs_safe_cast(_driver); - { - bool has_node; - char * filename = plain_driver_obs_alloc_filename(driver , report_step , key , false); - if (util_file_exists(filename)) - has_node = true; - else - has_node = false; - free(filename); - return has_node; - } -} - - - - -void plain_driver_obs_free(void *_driver) { - plain_driver_obs_type * driver = plain_driver_obs_safe_cast(_driver); - path_fmt_free(driver->path); - free(driver); -} - - - -void plain_driver_obs_README(const char * root_path) { - char * README_file = util_alloc_full_path(root_path , "README.txt"); - util_make_path(root_path); - { - FILE * stream = util_fopen(README_file , "w"); - fprintf(stream,"This is the root directory of the EnKF ensemble filesystem. All files contain one enkf_node \n"); - fprintf(stream,"instance. The files are binary, and compressed with zlib (util_fwrite_compressed).\n"); - fclose(stream); - } - free(README_file); -} - - -/* - The driver takes a copy of the path object, i.e. it can be deleted - in the calling scope after calling plain_driver_obs_alloc(). -*/ -void * plain_driver_obs_alloc(const char * root_path , const char * obs_path ) { - plain_driver_obs_type * driver = util_malloc(sizeof * driver ); - driver->load = plain_driver_obs_load_node; - driver->save = plain_driver_obs_save_node; - driver->has_node = plain_driver_obs_has_node; - driver->free_driver = plain_driver_obs_free; - driver->unlink_node = plain_driver_obs_unlink_node; - { - char *path; - - if (root_path != NULL) - path = util_alloc_full_path(root_path , obs_path); - else - path = util_alloc_string_copy(obs_path); - - driver->path = path_fmt_alloc_directory_fmt( path ); - free(path); - } - driver->__id = PLAIN_DRIVER_OBS_ID; - { - basic_obs_driver_type * basic_driver = (basic_obs_driver_type *) driver; - basic_obs_driver_init(basic_driver); - return basic_driver; - } -} - - -void plain_driver_obs_fwrite_mount_info(FILE * stream , const char * obs_fmt ) { - util_fwrite_int(OBS_DRIVER , stream); - util_fwrite_int(PLAIN_DRIVER_OBS_ID , stream); - util_fwrite_string(obs_fmt , stream); - -} - -/** - The two integers from the mount info have already been read at the enkf_fs level. -*/ -plain_driver_obs_type * plain_driver_obs_fread_alloc(const char * root_path , FILE * stream) { - char * obs_fmt = util_fread_alloc_string( stream ); - plain_driver_obs_type * driver = plain_driver_obs_alloc(root_path , obs_fmt); - free(obs_fmt); - return driver; -} - diff --git a/ThirdParty/Ert/libenkf/src/plot_settings.c b/ThirdParty/Ert/libenkf/src/plot_settings.c deleted file mode 100644 index e23f971b52..0000000000 --- a/ThirdParty/Ert/libenkf/src/plot_settings.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'plot_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -#include - -#include -#include -#include -#include - -#include -#include -#include - -#define TRUE_STRING "True" -#define FALSE_STRING "False" - -#define PATH_KEY "PATH" -#define SHOW_REFCASE_KEY "SHOW_REFCASE" -#define SHOW_HISTORY_KEY "SHOW_HISTORY" - -#define DEFAULT_PLOT_PATH "plots" -#define DEFAULT_SHOW_REFCASE FALSE_STRING -#define DEFAULT_SHOW_HISTORY FALSE_STRING - - -void plot_settings_init(config_settings_type * settings) { - - config_settings_add_setting(settings , PATH_KEY , CONFIG_STRING , DEFAULT_PLOT_PATH ); - config_settings_add_setting(settings , SHOW_REFCASE_KEY , CONFIG_BOOL , DEFAULT_SHOW_REFCASE ); - config_settings_add_setting(settings , SHOW_HISTORY_KEY , CONFIG_BOOL , DEFAULT_SHOW_HISTORY ); - -} - - -void plot_settings_add_config_items( config_parser_type * config ) { - config_settings_init_parser__( PLOT_SETTING_KEY , config , false ); - - config_add_key_value(config , PLOT_PATH_KEY , false , CONFIG_STRING); - { - char * msg = util_alloc_sprintf( "The keyword %s has been deprecated - use %s %s ", PLOT_PATH_KEY , PLOT_SETTING_KEY , PATH_KEY ); - config_parser_deprecate( config , PLOT_PATH_KEY , msg); - free( msg ); - } -} - - diff --git a/ThirdParty/Ert/libenkf/src/ranking_table.c b/ThirdParty/Ert/libenkf/src/ranking_table.c deleted file mode 100644 index f7801c0474..0000000000 --- a/ThirdParty/Ert/libenkf/src/ranking_table.c +++ /dev/null @@ -1,163 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'ranking_table.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - - -#define RANKING_TABLE_TYPE_ID 78420651 - -struct ranking_table_struct { - UTIL_TYPE_ID_DECLARATION; - int ens_size; // Will not really handle ensemble resize events - hash_type * ranking_table; -}; - - - -void ranking_table_free( ranking_table_type * table ) { - hash_free( table->ranking_table ); - free( table ); -} - - - -void ranking_table_set_ens_size( ranking_table_type * table, int ens_size) { - table->ens_size = ens_size; -} - -ranking_table_type * ranking_table_alloc( int ens_size ) { - ranking_table_type * table = util_malloc( sizeof * table ); - table->ranking_table = hash_alloc(); - return table; -} - - -void ranking_table_add_data_ranking( ranking_table_type * ranking_table , bool sort_increasing , const char * ranking_key , const char * user_key , const char * key_index , - enkf_fs_type * fs , const enkf_config_node_type * config_node , int step) { - - data_ranking_type * ranking = data_ranking_alloc( sort_increasing , ranking_table->ens_size , user_key , key_index , fs , config_node , step ); - hash_insert_hash_owned_ref( ranking_table->ranking_table , ranking_key , ranking, data_ranking_free__ ); -} - - - -void ranking_table_add_misfit_ranking( ranking_table_type * ranking_table , const misfit_ensemble_type * misfit_ensemble , const stringlist_type * obs_keys , const int_vector_type * steps , const char * ranking_key) { - misfit_ranking_type * ranking = misfit_ranking_alloc( misfit_ensemble , obs_keys , steps , ranking_key ); - hash_insert_hash_owned_ref( ranking_table->ranking_table , ranking_key , ranking , misfit_ranking_free__ ); -} - - - -bool ranking_table_has_ranking( const ranking_table_type * ranking_table , const char * ranking_key ) { - return hash_has_key( ranking_table->ranking_table , ranking_key ); -} - - -int ranking_table_get_size( const ranking_table_type * ranking_table ) { - return hash_get_size( ranking_table->ranking_table ); -} - - - -bool ranking_table_display_ranking( const ranking_table_type * ranking_table , const char * ranking_key ) { - if (hash_has_key( ranking_table->ranking_table , ranking_key)) { - void * ranking = hash_get( ranking_table->ranking_table , ranking_key ); - - if (data_ranking_is_instance( ranking )) { - data_ranking_type * data_ranking = data_ranking_safe_cast( ranking ); - data_ranking_display( data_ranking , stdout ); - } else if (misfit_ranking_is_instance( ranking )) { - misfit_ranking_type * misfit_ranking = misfit_ranking_safe_cast( ranking ); - misfit_ranking_display( misfit_ranking , stdout ); - } else - util_abort("%s: internal error \n",__func__); - - - return true; - } else - return false; -} - - -bool ranking_table_fwrite_ranking( const ranking_table_type * ranking_table , const char * ranking_key, const char * filename ) { - if (hash_has_key( ranking_table->ranking_table , ranking_key)) { - void * ranking = hash_get( ranking_table->ranking_table , ranking_key ); - - FILE * file = util_mkdir_fopen(filename, "w"); - - if (data_ranking_is_instance( ranking )) { - data_ranking_type * data_ranking = data_ranking_safe_cast( ranking ); - data_ranking_display( data_ranking , file ); - } else if (misfit_ranking_is_instance( ranking )) { - misfit_ranking_type * misfit_ranking = misfit_ranking_safe_cast( ranking ); - misfit_ranking_display( misfit_ranking , file ); - } else - util_abort("%s: internal error \n",__func__); - - util_fclose(file); - - return true; - } else - return false; -} - - - - -const perm_vector_type * ranking_table_get_permutation( const ranking_table_type * ranking_table , const char * ranking_key) { - if (hash_has_key( ranking_table->ranking_table , ranking_key)) { - void * ranking = hash_get( ranking_table->ranking_table , ranking_key ); - - if (data_ranking_is_instance( ranking )) { - data_ranking_type * data_ranking = data_ranking_safe_cast( ranking ); - return data_ranking_get_permutation( data_ranking ); - } else if (misfit_ranking_is_instance( ranking )) { - misfit_ranking_type * misfit_ranking = misfit_ranking_safe_cast( ranking ); - return misfit_ranking_get_permutation( misfit_ranking ); - } else { - util_abort("%s: internal error \n"); - return NULL; - } - - } else - return NULL; -} - - - - diff --git a/ThirdParty/Ert/libenkf/src/readme.overview b/ThirdParty/Ert/libenkf/src/readme.overview deleted file mode 100644 index 5b3c3dff52..0000000000 --- a/ThirdParty/Ert/libenkf/src/readme.overview +++ /dev/null @@ -1,55 +0,0 @@ -The EnKF functionality is organized in xxx libraries with different -functionalities. The different libraries depend on eachother, and the -libraries must be built in correct order. The dependencies is as -follows: - -libhash : -libutil : libhash -libecl : libhash libutil -librms : libecl libutil libhash -libsched : libecl linutil libhash -libenkf : libecl libsched librm linutil libhash - - -libhash: This library implements the classes hash_type, set_type and - list_type. - -libutil: This library is a collection utility routines. Observe that - this library only implements routines, and not statefull - objects. - -libecl: This library implements functions for reading/writing ECLIPSE - restart/summary/init/grid files. - -libsched: This library implements a basic SCHEDULE file parser. - -librms: This library implements (basic) reader and writer for binary - RMS ROFF files. - -libenkf: This library implements various high level objects for EnKF - functionality. - ------------------------------------------------------------------ - -All the makefiles start with the statement: - -include "path_config" - -The file path_config is *not* under version control, this is on -purpose because every user can/should have a private confiiguration of -paths. The file path_config should define make-variables for the -location of all the libraries, this is an example of a valid -path-config file: - - LIBHASH_HOME = /h/a152128/EnKF/EnKF/libhash - LIBUTIL_HOME = /h/a152128/EnKF/EnKF/libutil - LIBSCHED_HOME = /h/a152128/EnKF/EnKF/libsched - LIBRMS_HOME = /h/a152128/EnKF/EnKF/librms - LIBECL_HOME = /h/a152128/EnKF/EnKF/libecl - LIBENKF_HOME = /h/a152128/EnKF/EnKF/libenkf - -In this example all libraries have a common path prefix, that is not -a requirement. - - - diff --git a/ThirdParty/Ert/libenkf/src/rng_config.c b/ThirdParty/Ert/libenkf/src/rng_config.c deleted file mode 100644 index b5a0af25ea..0000000000 --- a/ThirdParty/Ert/libenkf/src/rng_config.c +++ /dev/null @@ -1,160 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rng_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - - -struct rng_config_struct { - rng_alg_type type; - char * seed_load_file; /* NULL: Do not store the seed. */ - char * seed_store_file; /* NULL: Do not load a seed from file. */ -}; - - - -void rng_config_set_type( rng_config_type * rng_config , rng_alg_type type) { - rng_config->type = type; -} - -rng_alg_type rng_config_get_type(const rng_config_type * rng_config ) { - return rng_config->type; -} - -const char * rng_config_get_seed_load_file( const rng_config_type * rng_config ) { - return rng_config->seed_load_file; -} - -void rng_config_set_seed_load_file( rng_config_type * rng_config , const char * seed_load_file) { - rng_config->seed_load_file = util_realloc_string_copy( rng_config->seed_load_file , seed_load_file); -} - -const char * rng_config_get_seed_store_file( const rng_config_type * rng_config ) { - return rng_config->seed_store_file; -} - -void rng_config_set_seed_store_file( rng_config_type * rng_config , const char * seed_store_file) { - rng_config->seed_store_file = util_realloc_string_copy( rng_config->seed_store_file , seed_store_file); -} - - -rng_config_type * rng_config_alloc( ) { - rng_config_type * rng_config = util_malloc( sizeof * rng_config); - - rng_config_set_type( rng_config , MZRAN ); /* Only type ... */ - rng_config->seed_store_file = NULL; - rng_config->seed_load_file = NULL; - - return rng_config; -} - - - -void rng_config_free( rng_config_type * rng) { - util_safe_free( rng->seed_load_file ); - util_safe_free( rng->seed_store_file ); - free( rng ); -} - -rng_type * rng_config_init_rng__(const rng_config_type * rng_config, rng_type * rng) { - const char * seed_load = rng_config_get_seed_load_file( rng_config ); - const char * seed_store = rng_config_get_seed_store_file( rng_config ); - - if (seed_load != NULL) { - if (util_file_exists( seed_load)) - rng_load_state( rng , seed_load ); - else { - /* - In the special case that seed_load == seed_store; we accept a - seed_load argument pointing to a non-existant file. - */ - if (seed_store) { - if (util_string_equal( seed_store , seed_load)) - rng_init( rng , INIT_DEV_URANDOM ); - else - util_abort("%s: tried to load random seed from non-existing file:%s \n",__func__ , seed_load); - } - } - } else - rng_init( rng , INIT_DEV_URANDOM ); - - - if (seed_store != NULL) - rng_save_state( rng , seed_store ); - - return rng; -} - -rng_type * rng_config_alloc_init_rng( const rng_config_type * rng_config ) { - rng_type * rng = rng_alloc(rng_config_get_type(rng_config) , INIT_DEFAULT); - return rng_config_init_rng__(rng_config, rng); -} - - -void rng_config_init_rng( const rng_config_type * rng_config, rng_type * rng ) { - rng_config_init_rng__(rng_config, rng); -} - - - -/*****************************************************************/ - -void rng_config_add_config_items( config_parser_type * config ) { - config_schema_item_type * item; - - item= config_add_schema_item( config , STORE_SEED_KEY , false); - config_schema_item_set_argc_minmax(item , 1 , 1 ); - config_schema_item_iset_type( item , 0 , CONFIG_PATH ); - - item = config_add_schema_item( config , LOAD_SEED_KEY , false ); - config_schema_item_set_argc_minmax(item , 1 , 1 ); - config_schema_item_iset_type( item , 0 , CONFIG_PATH ); -} - - -void rng_config_init( rng_config_type * rng_config , config_content_type * config ) { - if (config_content_has_item( config , STORE_SEED_KEY )) - rng_config_set_seed_store_file( rng_config , config_content_iget(config , STORE_SEED_KEY ,0,0)); - - if (config_content_has_item( config , LOAD_SEED_KEY )) - rng_config_set_seed_load_file( rng_config , config_content_iget(config , LOAD_SEED_KEY ,0,0)); -} - - -void rng_config_fprintf_config( rng_config_type * rng_config , FILE * stream ) { - if (rng_config->seed_load_file != NULL) { - fprintf( stream , CONFIG_KEY_FORMAT , LOAD_SEED_KEY ); - fprintf( stream , CONFIG_ENDVALUE_FORMAT , rng_config->seed_load_file); - } - - if (rng_config->seed_store_file != NULL) { - fprintf( stream , CONFIG_KEY_FORMAT , STORE_SEED_KEY ); - fprintf( stream , CONFIG_ENDVALUE_FORMAT , rng_config->seed_store_file); - } -} diff --git a/ThirdParty/Ert/libenkf/src/run_arg.c b/ThirdParty/Ert/libenkf/src/run_arg.c deleted file mode 100644 index e873aef6af..0000000000 --- a/ThirdParty/Ert/libenkf/src/run_arg.c +++ /dev/null @@ -1,250 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'run_arg.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include -#include - -#include -#include -#include - - -#define RUN_ARG_TYPE_ID 66143287 -#define INVALID_QUEUE_INDEX -99 - - -struct run_arg_struct { - UTIL_TYPE_ID_DECLARATION; - int iens; - int max_internal_submit; /* How many times the enkf_state object should try to resubmit when the queueu has said everything is OK - but the load fails. */ - int num_internal_submit; - int load_start; /* When loading back results - start at this step. */ - int step1; /* The forward model is integrated: step1 -> step2 */ - int step2; - int iter; - char * run_path; /* The currently used runpath - is realloced / freed for every step. */ - run_mode_type run_mode; /* What type of run this is */ - int queue_index; /* The job will in general have a different index in the queue than the iens number. */ - - enkf_fs_type * init_fs; - enkf_fs_type * result_fs; - enkf_fs_type * update_target_fs; - - /******************************************************************/ - /* Return value - set by the called routine!! */ - run_status_type run_status; -}; - - -UTIL_SAFE_CAST_FUNCTION( run_arg , RUN_ARG_TYPE_ID ) -UTIL_IS_INSTANCE_FUNCTION( run_arg , RUN_ARG_TYPE_ID ) - - -static run_arg_type * run_arg_alloc(enkf_fs_type * init_fs , - enkf_fs_type * result_fs , - enkf_fs_type * update_target_fs , - int iens , - run_mode_type run_mode , - int step1 , - int step2 , - int iter , - const char * runpath) { - if ((result_fs != NULL) && (result_fs == update_target_fs)) - util_abort("%s: internal error - can not have result_fs == update_target_fs \n",__func__); - { - run_arg_type * run_arg = util_malloc(sizeof * run_arg ); - UTIL_TYPE_ID_INIT(run_arg , RUN_ARG_TYPE_ID); - - run_arg->init_fs = init_fs; - run_arg->result_fs = result_fs; - run_arg->update_target_fs = update_target_fs; - - run_arg->iens = iens; - run_arg->run_mode = run_mode; - run_arg->step1 = step1; - run_arg->step2 = step2; - run_arg->iter = iter; - run_arg->run_path = util_alloc_abs_path( runpath ); - run_arg->num_internal_submit = 0; - run_arg->queue_index = INVALID_QUEUE_INDEX; - run_arg->run_status = JOB_NOT_STARTED; - - if (step1 == 0) - run_arg->load_start = 1; - else - run_arg->load_start = step1; - - return run_arg; - } -} - - - - - -run_arg_type * run_arg_alloc_ENSEMBLE_EXPERIMENT(enkf_fs_type * fs , int iens , int iter , const char * runpath) { - return run_arg_alloc(fs , fs , NULL , iens , ENSEMBLE_EXPERIMENT , 0 , 0 , iter , runpath); -} - - -run_arg_type * run_arg_alloc_INIT_ONLY(enkf_fs_type * init_fs , int iens , int iter , const char * runpath) { - return run_arg_alloc(init_fs , NULL , NULL , iens , INIT_ONLY , 0 , 0 , iter , runpath); -} - - -run_arg_type * run_arg_alloc_SMOOTHER_RUN(enkf_fs_type * simulate_fs , enkf_fs_type * update_target_fs , int iens , int iter , const char * runpath) { - return run_arg_alloc(simulate_fs , simulate_fs , update_target_fs , iens , ENSEMBLE_EXPERIMENT , 0 , 0 , iter , runpath); -} - - - -void run_arg_free(run_arg_type * run_arg) { - util_safe_free(run_arg->run_path); - free(run_arg); -} - - -void run_arg_free__(void * arg) { - run_arg_type * run_arg = run_arg_safe_cast( arg ); - run_arg_free( run_arg ); -} - - -void run_arg_complete_run(run_arg_type * run_arg) { - if (run_arg->run_status == JOB_RUN_OK) { - util_safe_free(run_arg->run_path); - run_arg->run_path = NULL; - } -} - - - -void run_arg_increase_submit_count( run_arg_type * run_arg ) { - run_arg->num_internal_submit++; -} - - -void run_arg_set_queue_index( run_arg_type * run_arg , int queue_index) { - if (run_arg->queue_index == INVALID_QUEUE_INDEX) - run_arg->queue_index = queue_index; - else - util_abort("%s: attempt to reset run_arg->queue_index. These objects should not be recycled\n",__func__); -} - - - -const char * run_arg_get_runpath( const run_arg_type * run_arg) { - return run_arg->run_path; -} - - - - -int run_arg_get_iter( const run_arg_type * run_arg ) { - return run_arg->iter; -} - - -int run_arg_get_iens( const run_arg_type * run_arg ) { - return run_arg->iens; -} - - -int run_arg_get_load_start( const run_arg_type * run_arg ) { - return run_arg->load_start; -} - - -int run_arg_get_step2( const run_arg_type * run_arg ) { - return run_arg->step2; -} - -bool run_arg_can_retry( const run_arg_type * run_arg ) { - if (run_arg->num_internal_submit < run_arg->max_internal_submit) - return true; - else - return false; -} - - -int run_arg_get_step1( const run_arg_type * run_arg ) { - return run_arg->step1; -} - - -run_mode_type run_arg_get_run_mode( const run_arg_type * run_arg ) { - return run_arg->run_mode; -} - - -int run_arg_get_queue_index( const run_arg_type * run_arg ) { - if (run_arg->queue_index == INVALID_QUEUE_INDEX) - util_abort("%s: sorry internal error - asking for the queue_index in a not-initialized run_arg object.\n" , __func__); - - return run_arg->queue_index; -} - -bool run_arg_is_submitted( const run_arg_type * run_arg ) { - if (run_arg->queue_index == INVALID_QUEUE_INDEX) - return false; - else - return true; -} - - -run_status_type run_arg_get_run_status( const run_arg_type * run_arg) { - return run_arg->run_status; -} - - -void run_arg_set_run_status( run_arg_type * run_arg , run_status_type run_status) { - run_arg->run_status = run_status; -} - - - -enkf_fs_type * run_arg_get_init_fs(const run_arg_type * run_arg) { - if (run_arg->init_fs) - return run_arg->init_fs; - else { - util_abort("%s: internal error - tried to access run_arg->init_fs when init_fs == NULL\n",__func__); - return NULL; - } -} - - -enkf_fs_type * run_arg_get_result_fs(const run_arg_type * run_arg) { - if (run_arg->result_fs) - return run_arg->result_fs; - else { - util_abort("%s: internal error - tried to access run_arg->result_fs when result_fs == NULL\n",__func__); - return NULL; - } -} - - -enkf_fs_type * run_arg_get_update_target_fs(const run_arg_type * run_arg) { - if (run_arg->update_target_fs) - return run_arg->update_target_fs; - else { - util_abort("%s: internal error - tried to access run_arg->update_target_fs when update_target_fs == NULL\n",__func__); - return NULL; - } -} diff --git a/ThirdParty/Ert/libenkf/src/runpath_list.c b/ThirdParty/Ert/libenkf/src/runpath_list.c deleted file mode 100644 index 75e621231d..0000000000 --- a/ThirdParty/Ert/libenkf/src/runpath_list.c +++ /dev/null @@ -1,236 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - The file 'runpath_list.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include -#include -#include - -#include -#include -#include - -#include - -typedef struct runpath_node_struct runpath_node_type; - - -struct runpath_list_struct { - pthread_rwlock_t lock; - vector_type * list; - char * line_fmt; // Format string : Values are in the order: (iens , runpath , basename) - char * export_file; -}; - - -#define RUNPATH_NODE_TYPE_ID 661400541 -struct runpath_node_struct { - UTIL_TYPE_ID_DECLARATION; - int iens; - int iter; - char * runpath; - char * basename; -}; - - -/*****************************************************************/ - - UTIL_SAFE_CAST_FUNCTION( runpath_node , RUNPATH_NODE_TYPE_ID ) - UTIL_SAFE_CAST_FUNCTION_CONST( runpath_node , RUNPATH_NODE_TYPE_ID ) - - static runpath_node_type * runpath_node_alloc( int iens, int iter, const char * runpath , const char * basename) { - runpath_node_type * node = util_malloc( sizeof * node ); - UTIL_TYPE_ID_INIT( node , RUNPATH_NODE_TYPE_ID ); - - node->iens = iens; - node->iter = iter; - node->runpath = util_alloc_string_copy( runpath ); - node->basename = util_alloc_string_copy( basename ); - - return node; - } - - -static void runpath_node_free( runpath_node_type * node ) { - free(node->basename); - free(node->runpath); - free(node); -} - - -static void runpath_node_free__( void * arg ) { - runpath_node_type * node = runpath_node_safe_cast( arg ); - runpath_node_free( node ); -} - - -/* - The comparison is first based on iteration number and then on iens. -*/ - -static int runpath_node_cmp( const void * arg1 , const void * arg2) { - const runpath_node_type * node1 = runpath_node_safe_cast_const( arg1 ); - const runpath_node_type * node2 = runpath_node_safe_cast_const( arg2 ); - { - if (node1->iter > node2->iter) - return 1; - else if (node1->iter < node2->iter) - return -1; - else { - /* Iteration number is the same */ - if (node1->iens > node2->iens) - return 1; - else if (node1->iens < node2->iens) - return -1; - else - return 0; - } - } -} - - -static void runpath_node_fprintf( const runpath_node_type * node , const char * line_fmt , FILE * stream) { - fprintf(stream , line_fmt , node->iens, node->runpath , node->basename, node->iter); -} - - -/*****************************************************************/ - - -runpath_list_type * runpath_list_alloc(const char * export_file) { - runpath_list_type * list = util_malloc( sizeof * list ); - list->list = vector_alloc_new(); - list->line_fmt = NULL; - list->export_file = util_alloc_string_copy( export_file ); - pthread_rwlock_init( &list->lock , NULL ); - return list; -} - - -void runpath_list_free( runpath_list_type * list ) { - vector_free( list->list ); - util_safe_free( list->line_fmt ); - util_safe_free( list->export_file); - free( list ); -} - - -int runpath_list_size( const runpath_list_type * list ) { - return vector_get_size( list->list ); -} - - -void runpath_list_add( runpath_list_type * list , int iens , int iter, const char * runpath , const char * basename) { - runpath_node_type * node = runpath_node_alloc( iens , iter, runpath , basename ); - - pthread_rwlock_wrlock( &list->lock ); - { - vector_append_owned_ref( list->list , node , runpath_node_free__ ); - } - pthread_rwlock_unlock( &list->lock ); -} - - -void runpath_list_clear( runpath_list_type * list ) { - pthread_rwlock_wrlock( &list->lock ); - { - vector_clear( list->list ); - } - pthread_rwlock_unlock( &list->lock ); -} - -/*****************************************************************/ - -void runpath_list_set_line_fmt( runpath_list_type * list , const char * line_fmt ) { - list->line_fmt = util_realloc_string_copy( list->line_fmt , line_fmt ); -} - - -const char * runpath_list_get_line_fmt( const runpath_list_type * list ) { - if (list->line_fmt == NULL) - return RUNPATH_LIST_DEFAULT_LINE_FMT; - else - return list->line_fmt; -} - -/*****************************************************************/ - - -static const runpath_node_type * runpath_list_iget_node__( const runpath_list_type * list , int index) { - return vector_iget_const( list->list , index ); -} - - - -static const runpath_node_type * runpath_list_iget_node( runpath_list_type * list , int index) { - const runpath_node_type * node; - { - pthread_rwlock_rdlock( &list->lock ); - node = runpath_list_iget_node__( list , index ); - pthread_rwlock_unlock( &list->lock ); - } - return node; -} - - -int runpath_list_iget_iens( runpath_list_type * list , int index) { - const runpath_node_type * node = runpath_list_iget_node( list , index ); - return node->iens; -} - -int runpath_list_iget_iter( runpath_list_type * list , int index) { - const runpath_node_type * node = runpath_list_iget_node( list , index ); - return node->iter; -} - - -char * runpath_list_iget_runpath( runpath_list_type * list , int index) { - const runpath_node_type * node = runpath_list_iget_node( list , index ); - return node->runpath; -} - -char * runpath_list_iget_basename( runpath_list_type * list , int index) { - const runpath_node_type * node = runpath_list_iget_node( list , index ); - return node->basename; -} - -void runpath_list_fprintf(runpath_list_type * list ) { - pthread_rwlock_rdlock( &list->lock ); - { - FILE * stream = util_mkdir_fopen( list->export_file , "w"); - const char * line_fmt = runpath_list_get_line_fmt( list ); - int index; - vector_sort( list->list , runpath_node_cmp ); - for (index =0; index < vector_get_size( list->list ); index++) { - const runpath_node_type * node = runpath_list_iget_node__( list , index ); - runpath_node_fprintf( node , line_fmt , stream ); - } - fclose( stream ); - } - pthread_rwlock_unlock( &list->lock ); -} - - -const char * runpath_list_get_export_file( const runpath_list_type * list ) { - return list->export_file; -} - - -void runpath_list_set_export_file( runpath_list_type * list , const char * export_file ) { - list->export_file = util_realloc_string_copy( list->export_file , export_file ); -} diff --git a/ThirdParty/Ert/libenkf/src/scalar_config.c b/ThirdParty/Ert/libenkf/src/scalar_config.c deleted file mode 100644 index 27ff8c09ef..0000000000 --- a/ThirdParty/Ert/libenkf/src/scalar_config.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'scalar_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#define SCALAR_CONFIG_TYPE_ID 877065 - -struct scalar_config_struct { - UTIL_TYPE_ID_DECLARATION; - int data_size; - active_list_type * active_list; - - trans_func_type ** transform; -}; - - - - -scalar_config_type * scalar_config_alloc_empty(int size) { - scalar_config_type *scalar_config = util_malloc(sizeof *scalar_config); - UTIL_TYPE_ID_INIT( scalar_config , SCALAR_CONFIG_TYPE_ID ); - scalar_config->data_size = size; - scalar_config->active_list = active_list_alloc( ); - - scalar_config->transform = util_calloc(scalar_config->data_size , sizeof * scalar_config->transform ); - return scalar_config; -} - - - -void scalar_config_transform(const scalar_config_type * config , const double * input_data , double *output_data) { - int index; - for (index = 0; index < config->data_size; index++) - output_data[index] = trans_func_eval( config->transform[index] , input_data[index] ); -} - - - - - - -void scalar_config_fscanf_line(scalar_config_type * config , int line_nr , FILE * stream) { - config->transform[line_nr] = trans_func_fscanf_alloc( stream ); -} - - - -void scalar_config_free(scalar_config_type * scalar_config) { - int i; - active_list_free(scalar_config->active_list); - for (i=0; i < scalar_config->data_size; i++) - trans_func_free( scalar_config->transform[i] ); - - util_safe_free( scalar_config->transform ); - free(scalar_config); -} - - - -/*****************************************************************/ - -SAFE_CAST(scalar_config , SCALAR_CONFIG_TYPE_ID) -GET_DATA_SIZE(scalar); -GET_ACTIVE_LIST(scalar); -VOID_FREE(scalar_config); diff --git a/ThirdParty/Ert/libenkf/src/site_config.c b/ThirdParty/Ert/libenkf/src/site_config.c deleted file mode 100644 index d520ed6319..0000000000 --- a/ThirdParty/Ert/libenkf/src/site_config.c +++ /dev/null @@ -1,987 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'site_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. - */ - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -/** - This struct contains information which is specific to the site - where this enkf instance is running. Pointers to the fields in this - structure are passed on to e.g. the enkf_state->shared_info object, - but this struct is the *OWNER* of this information, and hence - responsible for booting and deleting these objects. - - The settings held by the site_config object are by default set in - the site-wide configuration file, but they can also be overridden - in the users configuration file. This makes both parsing, - validating and also storing the configuration information a bit - more tricky: - - Parsing: - -------- - When parsing the user configuration file all settings are optional, - that means that the required validation of the config system, can - not be used, instead every get must be preceeded by: - - if (config_content_has_item(config , KEY)) ... - - Furthermore everything is done twice; first with config as a - site-config instance, and later as user-config instance. - - - Saving: - ------- - A setting which originates from the site_config file should not be - stored in the user's config file, but additions/overrides from the - user's config file should of course be saved. This is 'solved' with - many fields having a xxx_site duplicate, where the xxx_site is only - updated during the initial parsing of the site-config file; when - the flag user_mode is set to true the xxx_site fields are not - updated. When saving only fields which are different from their - xxx_site counterpart are stored. - */ - -#define LSF_DRIVER_NAME "LSF" -#define LOCAL_DRIVER_NAME "LOCAL" -#define RSH_DRIVER_NAME "RSH" -#define TORQUE_DRIVER_NAME "TORQUE" - -struct site_config_struct { - ext_joblist_type * joblist; /* The list of external jobs which have been installed. - These jobs will be the parts of the forward model. */ - hash_type * env_variables_user; /* The environment variables set in the user config file. */ - hash_type * env_variables_site; /* The environment variables set in site_config file - not exported. */ - - mode_t umask; - - char * license_root_path; /* The license_root_path value set by the user. */ - char * license_root_path_site; /* The license_root_path value set by the site. */ - char * __license_root_path; /* The license_root_path value actually used - includes a user/pid subdirectory. */ - - hash_type * path_variables_site; /* We store this so we can roll back when all user settings are cleared. */ - stringlist_type * path_variables_user; /* We can update the same path variable several times - i.e. it can not be a hash table. */ - stringlist_type * path_values_user; - - int max_running_lsf_site; - char * lsf_queue_name_site; - char * lsf_request_site; - - int max_running_rsh_site; - char * rsh_command_site; - - int max_running_local_site; - - job_driver_type driver_type; - job_driver_type driver_type_site; - int max_submit; - int max_submit_site; - char * job_script; - char * job_script_site; - - char * manual_url; - char * default_browser; - - queue_driver_type * current_driver; - hash_type * queue_drivers; - - job_queue_type * job_queue; /* The queue instance which will run the external jobs. */ - bool user_mode; - bool search_path; -}; - -void site_config_set_umask(site_config_type * site_config, mode_t new_mask) { - umask(new_mask); - site_config->umask = new_mask; -} - -mode_t site_config_get_umask(const site_config_type * site_config) { - return site_config->umask; -} - -static void site_config_add_queue_driver(site_config_type * site_config, const char * driver_name, queue_driver_type * driver) { - hash_insert_hash_owned_ref(site_config->queue_drivers, driver_name, driver, queue_driver_free__); -} - -bool site_config_has_queue_driver(const site_config_type * site_config, const char * driver_name) { - return hash_has_key(site_config->queue_drivers, driver_name); -} - -queue_driver_type * site_config_get_queue_driver(const site_config_type * site_config, const char * driver_name) { - return hash_get(site_config->queue_drivers, driver_name); -} - -static void site_config_create_queue_drivers(site_config_type * site_config) { - site_config_add_queue_driver(site_config, LSF_DRIVER_NAME, queue_driver_alloc_LSF(NULL, NULL, NULL)); - site_config_add_queue_driver(site_config, TORQUE_DRIVER_NAME, queue_driver_alloc_TORQUE()); - site_config_add_queue_driver(site_config, RSH_DRIVER_NAME, queue_driver_alloc_RSH(NULL, NULL)); - site_config_add_queue_driver(site_config, LOCAL_DRIVER_NAME, queue_driver_alloc_local()); -} - -static void site_config_set_queue_option(site_config_type * site_config, const char * driver_name, const char * option_key, const char * option_value) { - if (site_config_has_queue_driver(site_config, driver_name)) { - queue_driver_type * driver = site_config_get_queue_driver(site_config, driver_name); - if (!queue_driver_set_option(driver, option_key, option_value)) - fprintf(stderr, "** Warning: Option:%s or its value is not recognized by driver:%s- ignored \n", option_key, driver_name); - } else - fprintf(stderr, "** Warning: Driver:%s not recognized - ignored \n", driver_name); -} - -/** - This site_config object is not really ready for prime time. - */ -site_config_type * site_config_alloc_empty() { - site_config_type * site_config = util_malloc(sizeof * site_config); - - site_config->joblist = ext_joblist_alloc(); - site_config->queue_drivers = hash_alloc(); - - site_config->lsf_queue_name_site = NULL; - site_config->lsf_request_site = NULL; - site_config->rsh_command_site = NULL; - site_config->license_root_path = NULL; - site_config->license_root_path_site = NULL; - site_config->__license_root_path = NULL; - site_config->job_script = NULL; - site_config->job_script_site = NULL; - site_config->manual_url = NULL; - site_config->default_browser = NULL; - site_config->user_mode = false; - site_config->driver_type = NULL_DRIVER; - - site_config->job_queue = job_queue_alloc(DEFAULT_MAX_SUBMIT, "OK", "STATUS", "ERROR"); - site_config->env_variables_user = hash_alloc(); - site_config->env_variables_site = hash_alloc(); - - site_config->path_variables_user = stringlist_alloc_new(); - site_config->path_values_user = stringlist_alloc_new(); - site_config->path_variables_site = hash_alloc(); - - /* Some hooops to get the current umask. */ - site_config->umask = umask(0); - site_config_set_umask(site_config, site_config->umask); - site_config_set_manual_url(site_config, DEFAULT_MANUAL_URL); - site_config_set_default_browser(site_config, DEFAULT_BROWSER); - site_config_set_max_submit(site_config, DEFAULT_MAX_SUBMIT); - site_config->search_path = false; - return site_config; -} - -const char * site_config_get_license_root_path(const site_config_type * site_config) { - return site_config->license_root_path; -} - -/** - Observe that this variable can not "really" be set to different - values during a simulation, when creating ext_job instances they - will store a pointer to this variable on creation, if the variable - is later changed they will be left with a dangling copy. That is - not particularly elegant, however it should nonetheless work. - */ - -void site_config_set_license_root_path(site_config_type * site_config, const char * license_root_path) { - util_make_path(license_root_path); - { - char * full_license_root_path = util_alloc_realpath(license_root_path); - { - /** - Appending /user/pid to the license root path. Everything - including the pid is removed when exiting (gracefully ...). - - Dangling license directories after a crash can just be removed. - */ - site_config->license_root_path = util_realloc_string_copy(site_config->license_root_path, full_license_root_path); - site_config->__license_root_path = util_realloc_sprintf(site_config->__license_root_path, "%s%c%s%c%d", full_license_root_path, UTIL_PATH_SEP_CHAR, getenv("USER"), UTIL_PATH_SEP_CHAR, getpid()); - - if (!site_config->user_mode) - site_config->license_root_path_site = util_realloc_string_copy(site_config->license_root_path_site, full_license_root_path); - } - free(full_license_root_path); - } -} - -void site_config_init_user_mode(site_config_type * site_config) { - site_config->user_mode = true; -} - -/** - Will return 0 if the job is added correctly, and a non-zero (not - documented ...) error code if the job is not added. - */ - -int site_config_install_job(site_config_type * site_config, const char * job_name, const char * install_file) { - ext_job_type * new_job = ext_job_fscanf_alloc(job_name, site_config->__license_root_path, site_config->user_mode, install_file, site_config->search_path); - if (new_job != NULL) { - ext_joblist_add_job(site_config->joblist, job_name, new_job); - return 0; - } else - return 1; /* Some undocumented error condition - the job is NOT added. */ -} - -/** - Will NOT remove shared jobs. - */ -bool site_config_del_job(site_config_type * site_config, const char * job_name) { - return ext_joblist_del_job(site_config->joblist, job_name); -} - -static void site_config_add_jobs(site_config_type * site_config, const config_content_type * config) { - if (config_content_has_item(config, INSTALL_JOB_KEY)) { - const config_content_item_type * content_item = config_content_get_item(config, INSTALL_JOB_KEY); - int num_jobs = config_content_item_get_size(content_item); - for (int job_nr = 0; job_nr < num_jobs; job_nr++) { - config_content_node_type * node = config_content_item_iget_node(content_item, job_nr); - const char * job_key = config_content_node_iget(node, 0); - const char * description_file = config_content_node_iget_as_abspath(node, 1); - - site_config_install_job(site_config, job_key, description_file); - } - } - if (config_content_has_item(config, INSTALL_JOB_DIRECTORY_KEY)) { - const config_content_item_type * content_item = config_content_get_item(config, INSTALL_JOB_DIRECTORY_KEY); - int num_dirs = config_content_item_get_size(content_item); - for (int dir_nr = 0; dir_nr < num_dirs; dir_nr++) { - config_content_node_type * node = config_content_item_iget_node(content_item, dir_nr); - const char * directory = config_content_node_iget_as_abspath(node, 0); - - ext_joblist_add_jobs_in_directory(site_config->joblist , directory, site_config->__license_root_path, site_config->user_mode, site_config->search_path ); - } - } - -} - -hash_type * site_config_get_env_hash(const site_config_type * site_config) { - return site_config->env_variables_user; -} - -/** - Will only return the user-set variables. The variables set in the - site config are hidden. - */ - -stringlist_type * site_config_get_path_variables(const site_config_type * site_config) { - return site_config->path_variables_user; -} - -stringlist_type * site_config_get_path_values(const site_config_type * site_config) { - return site_config->path_values_user; -} - -/** - Observe that the value inserted in the internal hash tables is the - interpolated value returned from util_interp_setenv(), where $VAR - expressions have been expanded. - */ - -void site_config_setenv(site_config_type * site_config, const char * variable, const char * __value) { - const char * value = util_interp_setenv(variable, __value); - - if (site_config->user_mode) { - /* In the table meant for user-export we store the literal $var strings. */ - hash_insert_hash_owned_ref(site_config->env_variables_user, variable, util_alloc_string_copy(__value), free); - - if (!hash_has_key(site_config->env_variables_site, variable)) - hash_insert_ref(site_config->env_variables_site, variable, NULL); /* We insert a NULL so we can recover a unsetenv() in _clear_env(). */ - } else - hash_insert_hash_owned_ref(site_config->env_variables_site, variable, util_alloc_string_copy(value), free); -} - -/** - Clears all the environment variables set by the user. This is done - is follows: - - 1. Iterate through the table config->env_variables_user and call - unsetenv() on all of them - - 2. Iterate through the table config->env_variables_site and call - setenv() on all of them. - - This way the environment should be identical to what it is after - the site parsing is completed. - */ - - -void site_config_clear_env(site_config_type * site_config) { - /* 1: Clearing the user_set variables. */ - { - hash_iter_type * hash_iter = hash_iter_alloc(site_config->env_variables_user); - while (!hash_iter_is_complete(hash_iter)) { - const char * var = hash_iter_get_next_key(hash_iter); - util_unsetenv(var); - } - hash_iter_free(hash_iter); - hash_clear(site_config->env_variables_user); - } - - - /* 2: Recovering the site_set variables. */ - { - hash_iter_type * hash_iter = hash_iter_alloc(site_config->env_variables_site); - while (!hash_iter_is_complete(hash_iter)) { - const char * var = hash_iter_get_next_key(hash_iter); - const char * value = hash_get(site_config->env_variables_site, var); - util_interp_setenv(var, value); /* Will call unsetenv if value == NULL */ - } - hash_iter_free(hash_iter); - } -} - -void site_config_clear_pathvar(site_config_type * site_config) { - stringlist_clear(site_config->path_variables_user); - stringlist_clear(site_config->path_values_user); - { - /* Recover the original values. */ - hash_iter_type * hash_iter = hash_iter_alloc(site_config->path_variables_site); - while (!hash_iter_is_complete(hash_iter)) { - const char * var = hash_iter_get_next_key(hash_iter); - const char * site_value = hash_get(site_config->path_variables_site, var); - - if (site_value == NULL) - util_unsetenv(var); - else - util_setenv(var, site_value); - } - } -} - -void site_config_update_pathvar(site_config_type * site_config, const char * pathvar, const char * value) { - if (site_config->user_mode) { - stringlist_append_copy(site_config->path_variables_user, pathvar); - stringlist_append_copy(site_config->path_values_user, value); - - if (!hash_has_key(site_config->path_variables_site, pathvar)) - hash_insert_ref(site_config->path_variables_site, pathvar, NULL); /* This path variable has not been touched in the - site_config. We store a NULL, so can roll back - (i.e. call unsetenv()). */ - } - util_update_path_var(pathvar, value, false); -} - -static void site_config_select_job_driver(site_config_type * site_config, const char * driver_name) { - queue_driver_type * driver = site_config_get_queue_driver(site_config, driver_name); - site_config->current_driver = driver; - job_queue_set_driver(site_config->job_queue, site_config->current_driver); -} - -/** - These functions can be called repeatedly if you should want to - change driver characteristics run-time. - */ -static void site_config_select_LOCAL_job_queue(site_config_type * site_config) { - site_config_select_job_driver(site_config, LOCAL_DRIVER_NAME); -} - -static void site_config_select_RSH_job_queue(site_config_type * site_config) { - site_config_select_job_driver(site_config, RSH_DRIVER_NAME); -} - -static void site_config_select_LSF_job_queue(site_config_type * site_config) { - site_config_select_job_driver(site_config, LSF_DRIVER_NAME); -} - -static void site_config_select_TORQUE_job_queue(site_config_type * site_config) { - site_config_select_job_driver(site_config, TORQUE_DRIVER_NAME); -} - -/*****************************************************************/ - -/*****************************************************************/ -static int site_config_get_queue_max_running_option(queue_driver_type * driver) { - const char * max_running_string = queue_driver_get_option(driver, MAX_RUNNING); - int max_running = 0; - if(!util_sscanf_int(max_running_string, &max_running)) { - fprintf(stderr, "** Warning: String:%s for max_running is not parsable as int, using 0\n", max_running_string); - } - return max_running; -} - - -static void site_config_set_queue_max_running_option(site_config_type * site_config, const char* driver_name, int max_running) { - char* max_running_string = util_alloc_sprintf("%d", max_running); - site_config_set_queue_option(site_config, driver_name, MAX_RUNNING, max_running_string); - free(max_running_string); -} - -void site_config_set_max_running_lsf(site_config_type * site_config, int max_running_lsf) { - site_config_set_queue_max_running_option(site_config, LSF_DRIVER_NAME, max_running_lsf); - if (!site_config->user_mode) - site_config->max_running_lsf_site = max_running_lsf; -} - -int site_config_get_max_running_lsf(const site_config_type * site_config) { - queue_driver_type * lsf_driver = site_config_get_queue_driver(site_config, LSF_DRIVER_NAME); - return site_config_get_queue_max_running_option(lsf_driver); -} - -void site_config_set_max_running_rsh(site_config_type * site_config, int max_running_rsh) { - site_config_set_queue_max_running_option(site_config, RSH_DRIVER_NAME, max_running_rsh); - - if (!site_config->user_mode) - site_config->max_running_rsh_site = max_running_rsh; -} - -int site_config_get_max_running_rsh(const site_config_type * site_config) { - queue_driver_type * rsh_driver = site_config_get_queue_driver(site_config, RSH_DRIVER_NAME); - return site_config_get_queue_max_running_option(rsh_driver); -} - -void site_config_set_max_running_local(site_config_type * site_config, int max_running_local) { - site_config_set_queue_max_running_option(site_config, LOCAL_DRIVER_NAME, max_running_local); - - if (!site_config->user_mode) - site_config->max_running_local_site = max_running_local; -} - -int site_config_get_max_running_local(const site_config_type * site_config) { - queue_driver_type * local_driver = site_config_get_queue_driver(site_config, LOCAL_DRIVER_NAME); - return site_config_get_queue_max_running_option(local_driver); -} - -/*****************************************************************/ - -/*****************************************************************/ - -void site_config_clear_rsh_host_list(site_config_type * site_config) { - queue_driver_type * rsh_driver = site_config_get_queue_driver(site_config, RSH_DRIVER_NAME); - queue_driver_set_option(rsh_driver, RSH_CLEAR_HOSTLIST, NULL); -} - -hash_type * site_config_get_rsh_host_list(const site_config_type * site_config) { - queue_driver_type * rsh_driver = site_config_get_queue_driver(site_config, RSH_DRIVER_NAME); - return (hash_type *) queue_driver_get_option(rsh_driver, RSH_HOSTLIST); -} - -void site_config_add_rsh_host_from_string(site_config_type * site_config, const char * host_string) { - queue_driver_type * rsh_driver = site_config_get_queue_driver(site_config, RSH_DRIVER_NAME); - queue_driver_set_option(rsh_driver, RSH_HOST, host_string); -} - -void site_config_add_rsh_host(site_config_type * site_config, const char * rsh_host, int max_running) { - char * host_max_running = util_alloc_sprintf("%s:%d", rsh_host, max_running); - site_config_add_rsh_host_from_string(site_config, host_max_running); - free(host_max_running); -} - -void site_config_set_rsh_command(site_config_type * site_config, const char * rsh_command) { - queue_driver_type * rsh_driver = site_config_get_queue_driver(site_config, RSH_DRIVER_NAME); - queue_driver_set_option(rsh_driver, RSH_CMD, rsh_command); -} - -const char * site_config_get_rsh_command(const site_config_type * site_config) { - queue_driver_type * rsh_driver = site_config_get_queue_driver(site_config, RSH_DRIVER_NAME); - return queue_driver_get_option(rsh_driver, RSH_CMD); -} - -/*****************************************************************/ - -void site_config_set_lsf_queue(site_config_type * site_config, const char * lsf_queue) { - queue_driver_type * lsf_driver = site_config_get_queue_driver(site_config, LSF_DRIVER_NAME); - if (!site_config->user_mode) - site_config->lsf_queue_name_site = util_realloc_string_copy(site_config->lsf_queue_name_site, lsf_queue); - - queue_driver_set_option(lsf_driver, LSF_QUEUE, lsf_queue); -} - -const char * site_config_get_lsf_queue(const site_config_type * site_config) { - queue_driver_type * lsf_driver = site_config_get_queue_driver(site_config, LSF_DRIVER_NAME); - return queue_driver_get_option(lsf_driver, LSF_QUEUE); -} - -void site_config_set_lsf_server(site_config_type * site_config, const char * lsf_server) { - queue_driver_type * lsf_driver = site_config_get_queue_driver(site_config, LSF_DRIVER_NAME); - queue_driver_set_option(lsf_driver, LSF_SERVER, lsf_server); -} - -void site_config_set_lsf_request(site_config_type * site_config, const char * lsf_request) { - queue_driver_type * lsf_driver = site_config_get_queue_driver(site_config, LSF_DRIVER_NAME); - queue_driver_set_option(lsf_driver, LSF_RESOURCE, lsf_request); - if (!site_config->user_mode) - site_config->lsf_request_site = util_realloc_string_copy(site_config->lsf_request_site, lsf_request); -} - -const char * site_config_get_lsf_request(const site_config_type * site_config) { - queue_driver_type * lsf_driver = site_config_get_queue_driver(site_config, LSF_DRIVER_NAME); - return queue_driver_get_option(lsf_driver, LSF_RESOURCE); -} - -/*****************************************************************/ - - -const char * site_config_get_queue_name(const site_config_type * site_config) { - return queue_driver_get_name(site_config->current_driver); -} - -static void site_config_set_job_queue__(site_config_type * site_config, job_driver_type driver_type) { - site_config->driver_type = driver_type; - if (site_config->job_queue != NULL) { - switch (driver_type) { - case(LSF_DRIVER): - site_config_select_LSF_job_queue(site_config); - break; - case(TORQUE_DRIVER): - site_config_select_TORQUE_job_queue(site_config); - break; - case(RSH_DRIVER): - site_config_select_RSH_job_queue(site_config); - break; - case(LOCAL_DRIVER): - site_config_select_LOCAL_job_queue(site_config); - break; - default: - util_abort("%s: internal error \n", __func__); - } - } - if (!site_config->user_mode) - site_config->driver_type_site = driver_type; -} - -bool site_config_queue_is_running(const site_config_type * site_config) { - return job_queue_is_running(site_config->job_queue); -} - -/** - The job_script might be a relative path, and the cwd changes during - execution, i.e. it is essential to get hold of the full path. -*/ - -bool site_config_set_job_script(site_config_type * site_config, const char * job_script) { - if (util_is_executable(job_script)) { - char * job_script_full_path = util_alloc_realpath(job_script); - { - site_config->job_script = util_realloc_string_copy(site_config->job_script, job_script_full_path); - if (!site_config->user_mode) - site_config->job_script_site = util_realloc_string_copy(site_config->job_script_site, site_config->job_script); - } - free(job_script_full_path); - return true; - } else - return false; -} - - -bool site_config_has_job_script( const site_config_type * site_config ) { - if (site_config->job_script) - return true; - else - return false; -} - - -const char * site_config_get_job_script(const site_config_type * site_config) { - return site_config->job_script; -} - -const char * site_config_get_manual_url(const site_config_type * site_config) { - return site_config->manual_url; -} - -void site_config_set_manual_url(site_config_type * site_config, const char * manual_url) { - site_config->manual_url = util_realloc_string_copy(site_config->manual_url, manual_url); -} - -const char * site_config_get_default_browser(const site_config_type * site_config) { - return site_config->default_browser; -} - -void site_config_set_default_browser(site_config_type * site_config, const char * default_browser) { - site_config->default_browser = util_realloc_string_copy(site_config->default_browser, default_browser); -} - -void site_config_set_max_submit(site_config_type * site_config, int max_submit) { - site_config->max_submit = max_submit; - if (!site_config->user_mode) - site_config->max_submit_site = max_submit; - job_queue_set_max_submit(site_config->job_queue, max_submit); -} - -int site_config_get_max_submit(const site_config_type * site_config) { - return job_queue_get_max_submit(site_config->job_queue); -} - -static void site_config_install_job_queue(site_config_type * site_config) { - /* - All the various driver options are set, unconditionally of which - driver is actually selected in the end. - */ - if (site_config->driver_type != NULL_DRIVER) - site_config_set_job_queue__(site_config, site_config->driver_type); -} - -void site_config_init_env(site_config_type * site_config, const config_content_type * config) { - { - if (config_content_has_item( config , SETENV_KEY)) { - config_content_item_type * setenv_item = config_content_get_item(config, SETENV_KEY); - int i; - for (i = 0; i < config_content_item_get_size(setenv_item); i++) { - const config_content_node_type * setenv_node = config_content_item_iget_node(setenv_item, i); - const char * var = config_content_node_iget(setenv_node, 0); - const char * value = config_content_node_iget(setenv_node, 1); - - site_config_setenv(site_config, var, value); - } - } - } - - { - if (config_content_has_item( config , UPDATE_PATH_KEY)) { - config_content_item_type * path_item = config_content_get_item(config, UPDATE_PATH_KEY); - int i; - for (i = 0; i < config_content_item_get_size(path_item); i++) { - const config_content_node_type * path_node = config_content_item_iget_node(path_item, i); - const char * path = config_content_node_iget(path_node, 0); - const char * value = config_content_node_iget(path_node, 1); - - site_config_update_pathvar(site_config, path, value); - } - } - } -} - -/** - This function will be called twice, first when the config instance - is an internalization of the site-wide configuration file, and - secondly when config is an internalisation of the user's - configuration file. The @user_config parameter will be true in the - latter case. - */ - - -bool site_config_init(site_config_type * site_config, const config_content_type * config) { - site_config_add_jobs(site_config, config); - site_config_init_env(site_config, config); - - /* - When LSF is used several enviroment variables must be set (by the - site wide file) - i.e. the calls to SETENV must come first. - */ - if (!site_config->user_mode) - site_config_create_queue_drivers(site_config); - - /* - Set the umask for all file creation. A value of '0' will ensure - that all files and directories are created with 'equal rights' - for everyone - might be handy if you are helping someone... The - default statoil value is 0022, i.e. write access is removed from - group and others. - - The string is supposed to be in OCTAL representation (without any - prefix characters). - */ - - if (config_content_has_item(config, UMASK_KEY)) { - const char * string_mask = config_content_get_value(config, UMASK_KEY); - mode_t umask_value; - if (util_sscanf_octal_int(string_mask, &umask_value)) - site_config_set_umask(site_config, umask_value); - else - util_abort("%s: failed to parse:\"%s\" as a valid octal literal \n", __func__, string_mask); - } - - if (config_content_has_item(config, MAX_SUBMIT_KEY)) - site_config_set_max_submit(site_config, config_content_get_value_as_int(config, MAX_SUBMIT_KEY)); - - - /* LSF options */ - { - if (config_content_has_item(config, LSF_QUEUE_KEY)) - site_config_set_lsf_queue(site_config, config_content_get_value(config, LSF_QUEUE_KEY)); - - if (config_content_has_item(config, LSF_RESOURCES_KEY)) { - char * lsf_resource_request = config_content_alloc_joined_string(config, LSF_RESOURCES_KEY, " "); - site_config_set_lsf_request(site_config, lsf_resource_request); - free(lsf_resource_request); - } - - if (config_content_has_item(config, MAX_RUNNING_LSF_KEY)) - site_config_set_max_running_lsf(site_config, config_content_get_value_as_int(config, MAX_RUNNING_LSF_KEY)); - - if (config_content_has_item(config, LSF_SERVER_KEY)) - site_config_set_lsf_server(site_config, config_content_get_value(config, LSF_SERVER_KEY)); - } - - - /* RSH options */ - { - if (config_content_has_item(config, RSH_COMMAND_KEY)) - site_config_set_rsh_command(site_config, config_content_get_value(config, RSH_COMMAND_KEY)); - - if (config_content_has_item(config, MAX_RUNNING_RSH_KEY)) - site_config_set_max_running_rsh(site_config, config_content_get_value_as_int(config, MAX_RUNNING_RSH_KEY)); - - /* Parsing the "host1:4" strings. */ - if (config_content_has_item( config , RSH_HOST_KEY)) { - stringlist_type * rsh_host_list = config_content_alloc_complete_stringlist(config, RSH_HOST_KEY); - int i; - for (i = 0; i < stringlist_get_size(rsh_host_list); i++) - site_config_add_rsh_host_from_string(site_config, stringlist_iget(rsh_host_list, i)); - - stringlist_free(rsh_host_list); - } - } - - - if (config_content_has_item(config, QUEUE_SYSTEM_KEY)) { - job_driver_type driver_type; - { - const char * queue_system = config_content_get_value(config, QUEUE_SYSTEM_KEY); - if (strcmp(queue_system, LSF_DRIVER_NAME) == 0) { - driver_type = LSF_DRIVER; - } else if (strcmp(queue_system, RSH_DRIVER_NAME) == 0) - driver_type = RSH_DRIVER; - else if (strcmp(queue_system, LOCAL_DRIVER_NAME) == 0) - driver_type = LOCAL_DRIVER; - else if (strcmp(queue_system, TORQUE_DRIVER_NAME) == 0) - driver_type = TORQUE_DRIVER; - else { - util_abort("%s: queue system :%s not recognized \n", __func__, queue_system); - driver_type = NULL_DRIVER; - } - } - site_config_set_job_queue__(site_config, driver_type); - } - - /* Parsing local options */ - if (config_content_has_item(config, MAX_RUNNING_LOCAL_KEY)) - site_config_set_max_running_local(site_config, config_content_iget_as_int(config, MAX_RUNNING_LOCAL_KEY, 0, 0)); - - if (config_content_has_item(config, JOB_SCRIPT_KEY)) - site_config_set_job_script(site_config, config_content_get_value_as_abspath(config, JOB_SCRIPT_KEY)); - - if (config_content_has_item(config, LICENSE_PATH_KEY)) - site_config_set_license_root_path(site_config, config_content_get_value_as_abspath(config, LICENSE_PATH_KEY)); - - site_config_install_job_queue(site_config); - - if (config_content_has_item(config, EXT_JOB_SEARCH_PATH_KEY)){ - site_config_set_ext_job_search_path(site_config, config_content_get_value_as_bool(config, EXT_JOB_SEARCH_PATH_KEY)); - } - - - /* Setting QUEUE_OPTIONS */ - { - int i; - for (i = 0; i < config_content_get_occurences(config, QUEUE_OPTION_KEY); i++) { - const stringlist_type * tokens = config_content_iget_stringlist_ref(config, QUEUE_OPTION_KEY, i); - const char * driver_name = stringlist_iget(tokens, 0); - const char * option_key = stringlist_iget(tokens, 1); - char * option_value = stringlist_alloc_joined_substring(tokens, 2, stringlist_get_size(tokens), " "); - /* - If it is desirable to keep the exact number of spaces in the - option_value it should be quoted with "" in the configuration - file. - */ - site_config_set_queue_option(site_config, driver_name, option_key, option_value); - free( option_value ); - } - } - return true; -} - -void site_config_set_ext_job_search_path(site_config_type * site_config, bool search_path){ - site_config->search_path = search_path; -} - - -void site_config_free(site_config_type * site_config) { - ext_joblist_free(site_config->joblist); - job_queue_free(site_config->job_queue); - - hash_free(site_config->queue_drivers); - - stringlist_free(site_config->path_variables_user); - stringlist_free(site_config->path_values_user); - hash_free(site_config->path_variables_site); - - hash_free(site_config->env_variables_site); - hash_free(site_config->env_variables_user); - - if (site_config->__license_root_path != NULL) - util_clear_directory(site_config->__license_root_path, true, true); - - util_safe_free(site_config->manual_url); - util_safe_free(site_config->default_browser); - util_safe_free(site_config->license_root_path); - util_safe_free(site_config->license_root_path_site); - util_safe_free(site_config->__license_root_path); - util_safe_free(site_config->job_script); - util_safe_free(site_config->job_script_site); - util_safe_free(site_config->rsh_command_site); - util_safe_free(site_config->lsf_queue_name_site); - util_safe_free(site_config->lsf_request_site); - free(site_config); -} - -ext_joblist_type * site_config_get_installed_jobs(const site_config_type * site_config) { - return site_config->joblist; -} - -job_queue_type * site_config_get_job_queue(const site_config_type * site_config) { - return site_config->job_queue; -} - -void site_config_set_ens_size(site_config_type * site_config, int ens_size) { - //job_queue_set_size( site_config->job_queue , ens_size ); -} - -/*****************************************************************/ - - -void site_config_add_queue_config_items(config_parser_type * config, bool site_mode) { - config_schema_item_type * item = config_add_schema_item(config, QUEUE_SYSTEM_KEY, site_mode); - config_schema_item_set_argc_minmax(item, 1, 1); - - item = config_add_schema_item(config, MAX_SUBMIT_KEY, false); - config_schema_item_set_argc_minmax(item, 1, 1); - config_schema_item_iset_type(item, 0, CONFIG_INT); -} - -void site_config_add_config_items(config_parser_type * config, bool site_mode) { - config_schema_item_type * item; - ert_workflow_list_add_config_items(config); - site_config_add_queue_config_items(config, site_mode); - - - /* - You can set environment variables which will be applied to the - run-time environment. Can unfortunately not use constructions - like PATH=$PATH:/some/new/path, use the UPDATE_PATH function instead. - */ - item = config_add_schema_item(config, SETENV_KEY, false); - config_schema_item_set_argc_minmax(item, 2, 2); - config_schema_item_set_envvar_expansion(item, false); /* Do not expand $VAR expressions (that is done in util_interp_setenv()). */ - - item = config_add_schema_item(config, UMASK_KEY, false); - config_schema_item_set_argc_minmax(item, 1, 1); - - /** - UPDATE_PATH LD_LIBRARY_PATH /path/to/some/funky/lib - - Will prepend "/path/to/some/funky/lib" at the front of LD_LIBRARY_PATH. - */ - item = config_add_schema_item(config, UPDATE_PATH_KEY, false); - config_schema_item_set_argc_minmax(item, 2, 2); - config_schema_item_set_envvar_expansion(item, false); /* Do not expand $VAR expressions (that is done in util_interp_setenv()). */ - - if (!site_mode) { - item = config_add_schema_item(config, LICENSE_PATH_KEY, false); - config_schema_item_set_argc_minmax(item, 1, 1); - config_schema_item_iset_type(item, 0, CONFIG_PATH); - } - - - /*****************************************************************/ - /* Items related to running jobs with lsf/rsh/local ... */ - - /* These must be set IFF QUEUE_SYSTEM == LSF */ - item = config_add_schema_item(config, LSF_QUEUE_KEY, false); - config_schema_item_set_argc_minmax(item, 1, 1); - - item = config_add_schema_item(config, LSF_RESOURCES_KEY, false); - config_schema_item_set_argc_minmax(item, 1, CONFIG_DEFAULT_ARG_MAX); - - item = config_add_schema_item(config, MAX_RUNNING_LSF_KEY, false); - config_schema_item_set_argc_minmax(item, 1, 1); - config_schema_item_iset_type(item, 0, CONFIG_INT); - - item = config_add_schema_item(config, LSF_SERVER_KEY, false); - config_schema_item_set_argc_minmax(item, 1, 1); - - /* These must be set IFF QUEUE_SYSTEM == RSH */ - if (!site_mode) - config_add_schema_item(config, RSH_HOST_KEY, false); /* Only added when user parse. */ - item = config_add_schema_item(config, RSH_COMMAND_KEY, false); - config_schema_item_set_argc_minmax(item, 1, 1); - config_schema_item_iset_type(item, 0, CONFIG_EXECUTABLE); - - item = config_add_schema_item(config, MAX_RUNNING_RSH_KEY, false); - config_schema_item_set_argc_minmax(item, 1, 1); - config_schema_item_iset_type(item, 0, CONFIG_INT); - - /* These must be set IFF QUEUE_SYSTEM == LOCAL */ - item = config_add_schema_item(config, MAX_RUNNING_LOCAL_KEY, false); - config_schema_item_set_argc_minmax(item, 1, 1); - config_schema_item_iset_type(item, 0, CONFIG_INT); - - - /*****************************************************************/ - item = config_add_schema_item(config, QUEUE_OPTION_KEY, false); - config_schema_item_set_argc_minmax(item, 3, CONFIG_DEFAULT_ARG_MAX); - - item = config_add_schema_item(config, JOB_SCRIPT_KEY, false); - config_schema_item_set_argc_minmax(item, 1, 1); - config_schema_item_iset_type(item, 0, CONFIG_EXISTING_PATH); - - item = config_add_schema_item(config, INSTALL_JOB_KEY, false); - config_schema_item_set_argc_minmax(item, 2, 2); - config_schema_item_iset_type(item, 1, CONFIG_EXISTING_PATH); - - item = config_add_schema_item(config, INSTALL_JOB_DIRECTORY_KEY, false); - config_schema_item_set_argc_minmax(item, 1, 1); - config_schema_item_iset_type(item, 0, CONFIG_PATH); - - item = config_add_schema_item( config , ANALYSIS_LOAD_KEY , false ); - config_schema_item_set_argc_minmax( item , 2 , 2); -} - -const char * site_config_get_location() { - const char * site_config = NULL; - - #ifdef SITE_CONFIG_FILE - site_config = SITE_CONFIG_FILE; - #endif - - const char * env_site_config = getenv("ERT_SITE_CONFIG"); - - if(env_site_config != NULL) { - if (util_file_exists(env_site_config)) { - site_config = env_site_config; - } else { - fprintf(stderr, "The environment variable ERT_SITE_CONFIG points to non-existing file: %s - ignored\n", env_site_config); - } - } - - if (site_config == NULL) { - fprintf(stderr, "**WARNING** main enkf_config file is not set. Use environment variable \"ERT_SITE_CONFIG\" - or recompile.\n"); - } - - return site_config; -} diff --git a/ThirdParty/Ert/libenkf/src/state_map.c b/ThirdParty/Ert/libenkf/src/state_map.c deleted file mode 100644 index dbe51e7b85..0000000000 --- a/ThirdParty/Ert/libenkf/src/state_map.c +++ /dev/null @@ -1,285 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - The file 'state_map.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#define _GNU_SOURCE /* Must define this to get access to pthread_rwlock_t */ -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - - -#define STATE_MAP_TYPE_ID 500672132 - -struct state_map_struct { - UTIL_TYPE_ID_DECLARATION; - int_vector_type * state; - pthread_rwlock_t rw_lock; - bool read_only; -}; - - -UTIL_IS_INSTANCE_FUNCTION( state_map , STATE_MAP_TYPE_ID ) - - -state_map_type * state_map_alloc( ) { - state_map_type * map = util_malloc( sizeof * map ); - UTIL_TYPE_ID_INIT( map , STATE_MAP_TYPE_ID ); - map->state = int_vector_alloc( 0 , STATE_UNDEFINED ); - pthread_rwlock_init( &map->rw_lock , NULL); - map->read_only = false; - return map; -} - - -state_map_type * state_map_fread_alloc( const char * filename ) { - state_map_type * map = state_map_alloc(); - if (util_file_exists( filename )) { - FILE * stream = util_fopen( filename , "r"); - int_vector_fread( map->state , stream ); - fclose( stream ); - } - return map; -} - -state_map_type * state_map_fread_alloc_readonly( const char * filename ) { - state_map_type * map = state_map_fread_alloc(filename); - map->read_only = true; - return map; -} - - -state_map_type * state_map_alloc_copy( state_map_type * map ) { - state_map_type * copy = state_map_alloc(); - pthread_rwlock_rdlock( &map->rw_lock ); - { - int_vector_memcpy( copy->state , map->state ); - } - pthread_rwlock_unlock( &map->rw_lock ); - return copy; -} - - -void state_map_free( state_map_type * map ) { - int_vector_free( map->state ); - free( map ); -} - - -int state_map_get_size( state_map_type * map) { - int size; - pthread_rwlock_rdlock( &map->rw_lock ); - { - size = int_vector_size( map->state ); - } - pthread_rwlock_unlock( &map->rw_lock ); - return size; -} - - -bool state_map_equal( state_map_type * map1 , state_map_type * map2) { - bool equal = true; - pthread_rwlock_rdlock( &map1->rw_lock ); - pthread_rwlock_rdlock( &map2->rw_lock ); - { - if (int_vector_size( map1->state) != int_vector_size( map2->state)) - equal = false; - - if (equal) - equal = int_vector_equal( map1->state , map2->state ); - } - pthread_rwlock_unlock( &map1->rw_lock ); - pthread_rwlock_unlock( &map2->rw_lock ); - return equal; -} - - -realisation_state_enum state_map_iget( state_map_type * map , int index) { - realisation_state_enum state; - pthread_rwlock_rdlock( &map->rw_lock ); - { - state = int_vector_safe_iget( map->state , index ); - } - pthread_rwlock_unlock( &map->rw_lock ); - return state; -} - -bool state_map_legal_transition( realisation_state_enum state1 , realisation_state_enum state2) { - int target_mask = 0; - - if (state1 == STATE_UNDEFINED) - target_mask = STATE_INITIALIZED | STATE_PARENT_FAILURE; - else if (state1 == STATE_INITIALIZED) - target_mask = STATE_LOAD_FAILURE | STATE_HAS_DATA | STATE_INITIALIZED | STATE_PARENT_FAILURE; - else if (state1 == STATE_HAS_DATA) - target_mask = STATE_INITIALIZED | STATE_LOAD_FAILURE | STATE_HAS_DATA | STATE_PARENT_FAILURE; - else if (state1 == STATE_LOAD_FAILURE) - target_mask = STATE_HAS_DATA | STATE_INITIALIZED | STATE_LOAD_FAILURE; - else if (state1 == STATE_PARENT_FAILURE) - target_mask = STATE_INITIALIZED | STATE_PARENT_FAILURE; - - if (state2 & target_mask) - return true; - else - return false; -} - -static void state_map_assert_writable( const state_map_type * map) { - if (map->read_only) - util_abort("%s: tried to modify read_only state_map - aborting \n",__func__); -} - -static void state_map_iset__( state_map_type * map , int index , realisation_state_enum new_state) { - realisation_state_enum current_state = int_vector_safe_iget( map->state , index ); - - if (state_map_legal_transition( current_state , new_state )) - int_vector_iset( map->state , index , new_state); - else - util_abort("%s: illegal state transition for realisation:%d %d -> %d \n" , __func__ , index , current_state , new_state ); -} - -void state_map_iset( state_map_type * map ,int index , realisation_state_enum state) { - state_map_assert_writable(map); - pthread_rwlock_wrlock( &map->rw_lock ); - { - state_map_iset__( map , index , state ); - } - pthread_rwlock_unlock( &map->rw_lock ); -} - - -void state_map_update_matching( state_map_type * map , int index , int state_mask , realisation_state_enum new_state) { - realisation_state_enum current_state = state_map_iget( map , index ); - if (current_state & state_mask) - state_map_iset( map , index , new_state ); -} - - -void state_map_update_undefined( state_map_type * map , int index , realisation_state_enum new_state) { - state_map_update_matching( map , index , STATE_UNDEFINED , new_state ); -} - - - - -void state_map_fwrite( state_map_type * map , const char * filename) { - pthread_rwlock_rdlock( &map->rw_lock ); - { - FILE * stream = util_mkdir_fopen( filename , "w"); - if (stream) { - int_vector_fwrite( map->state , stream ); - fclose( stream ); - } else - util_abort("%s: failed to open:%s for writing \n",__func__ , filename ); - } - pthread_rwlock_unlock( &map->rw_lock ); -} - - - -bool state_map_fread( state_map_type * map , const char * filename) { - bool file_exists = false; - pthread_rwlock_wrlock( &map->rw_lock ); - { - if (util_file_exists( filename )) { - FILE * stream = util_fopen( filename , "r"); - if (stream) { - int_vector_fread( map->state , stream ); - fclose( stream ); - } else - util_abort("%s: failed to open:%s for reading \n",__func__ , filename ); - file_exists = true; - } else - int_vector_reset( map->state ); - } - pthread_rwlock_unlock( &map->rw_lock ); - return file_exists; -} - - -static void state_map_select_matching__( state_map_type * map , bool_vector_type * select_target , int select_mask , bool select) { - state_map_assert_writable(map); - pthread_rwlock_rdlock( &map->rw_lock ); - { - { - const int * map_ptr = int_vector_get_ptr( map->state ); - int size = util_int_min(int_vector_size( map->state ), bool_vector_size(select_target)); - for (int i=0; i < size; i++) { - int state_value = map_ptr[i]; - if (state_value & select_mask) - bool_vector_iset( select_target , i , select); - } - } - pthread_rwlock_unlock( &map->rw_lock ); - } -} - - -void state_map_select_matching( state_map_type * map , bool_vector_type * select_target , int select_mask) { - state_map_select_matching__(map , select_target , select_mask , true ); -} - - - - void state_map_deselect_matching( state_map_type * map , bool_vector_type * select_target , int select_mask) { - state_map_select_matching__(map , select_target , select_mask , false ); -} - - -static void state_map_set_from_mask__( state_map_type * map , const bool_vector_type * mask , realisation_state_enum state, bool invert) { - const bool * mask_ptr = bool_vector_get_ptr(mask); - for (int i=0; i < bool_vector_size( mask); i++) { - if (mask_ptr[i] != invert) - state_map_iset(map , i , state); - } -} - -void state_map_set_from_inverted_mask( state_map_type * state_map , const bool_vector_type * mask , realisation_state_enum state) { - state_map_set_from_mask__(state_map , mask , state , true); -} - -void state_map_set_from_mask( state_map_type * state_map , const bool_vector_type * mask , realisation_state_enum state) { - state_map_set_from_mask__(state_map , mask , state , false); -} - -bool state_map_is_readonly(const state_map_type * state_map) { - return state_map->read_only; -} - - -int state_map_count_matching( state_map_type * state_map , int mask) { - int count = 0; - pthread_rwlock_rdlock( &state_map->rw_lock ); - { - const int * map_ptr = int_vector_get_ptr(state_map->state); - for (int i=0; i < int_vector_size( state_map->state ); i++) { - int state_value = map_ptr[i]; - if (state_value & mask) - count++; - } - } - pthread_rwlock_unlock(&state_map->rw_lock); - return count; - } - diff --git a/ThirdParty/Ert/libenkf/src/summary.c b/ThirdParty/Ert/libenkf/src/summary.c deleted file mode 100644 index 3c0cf3b6f5..0000000000 --- a/ThirdParty/Ert/libenkf/src/summary.c +++ /dev/null @@ -1,332 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'summary.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/*****************************************************************/ - -#define SUMMARY_UNDEF -9999 - -struct summary_struct { - int __type_id; /* Only used for run_time checking. */ - summary_config_type * config; /* Can not be NULL - var_type is set on first load. */ - double_vector_type * data_vector; -}; - - -/*****************************************************************/ - - - -static double SUMMARY_GET_VALUE( const summary_type * summary , int report_step) { - return double_vector_iget( summary->data_vector , report_step ); -} - - -static void SUMMARY_SET_VALUE( summary_type * summary , int report_step , double value) { - double_vector_iset( summary->data_vector , report_step , value); -} - -/*****************************************************************/ - - - -void summary_clear(summary_type * summary) { - double_vector_reset( summary->data_vector ); -} - - -summary_type * summary_alloc(const summary_config_type * summary_config) { - summary_type * summary = util_malloc(sizeof *summary ); - summary->__type_id = SUMMARY; - summary->config = (summary_config_type *) summary_config; - summary->data_vector = double_vector_alloc(0 , SUMMARY_UNDEF); - return summary; -} - - - -bool summary_active_value( double value ) { - - if (value == SUMMARY_UNDEF) - return false; - - return true; -} - - -void summary_copy(const summary_type *src , summary_type * target) { - if (src->config == target->config) - double_vector_memcpy( target->data_vector , src->data_vector ); - else - util_abort("%s: do not share config objects \n",__func__); -} - - - - -void summary_read_from_buffer(summary_type * summary , buffer_type * buffer, enkf_fs_type * fs, int report_step) { - enkf_util_assert_buffer_type( buffer , SUMMARY ); - double_vector_buffer_fread( summary->data_vector , buffer ); -} - - -bool summary_write_to_buffer(const summary_type * summary , buffer_type * buffer, int report_step) { - buffer_fwrite_int( buffer , SUMMARY ); - double_vector_buffer_fwrite( summary->data_vector , buffer ); - return true; -} - - -bool summary_has_data( const summary_type * summary , int report_step) { - return (double_vector_size( summary->data_vector ) > report_step) ? true : false; -} - - -void summary_free(summary_type *summary) { - double_vector_free( summary->data_vector ); - free(summary); -} - - - - - - -void summary_serialize(const summary_type * summary , node_id_type node_id , const active_list_type * active_list , matrix_type * A , int row_offset , int column) { - double value = SUMMARY_GET_VALUE( summary , node_id.report_step ); - enkf_matrix_serialize( &value , 1 , ECL_DOUBLE_TYPE , active_list , A , row_offset , column); -} - - -void summary_deserialize(summary_type * summary , node_id_type node_id , const active_list_type * active_list , const matrix_type * A , int row_offset , int column) { - double value; - enkf_matrix_deserialize( &value , 1 , ECL_DOUBLE_TYPE , active_list , A , row_offset , column); - SUMMARY_SET_VALUE( summary , node_id.report_step , value ); -} - -int summary_length(const summary_type * summary) { - return double_vector_size(summary->data_vector); -} - -double summary_get(const summary_type * summary, int report_step) { - return SUMMARY_GET_VALUE( summary , report_step ); -} - - -bool summary_user_get(const summary_type * summary , const char * index_key , int report_step , double * value) { - if (double_vector_size( summary->data_vector ) > report_step) { - *value = double_vector_iget( summary->data_vector , report_step); - return true; - } else { - *value = -1; - return false; - } -} - - - -void summary_user_get_vector(const summary_type * summary , const char * index_key , double_vector_type * value) { - double_vector_memcpy( value , summary->data_vector); -} - - - -/** - There are three typical reasons why the node data can not be loaded: - - 1. The ecl_sum instance is equal to NULL. - 2. The ecl_sum instance does not have the report step we are asking for. - 3. The ecl_sum instance does not have the variable we are asking for. - - In the two first cases the function will return false, ultimately - signaling that the simulation has failed. In the last case we check - the required flag of the variable, and if this is set to false we - return true. This is done because this is a typical situation for - e.g. a well which has not yet opened. -*/ - -bool summary_forward_load(summary_type * summary , const char * ecl_file_name , const forward_load_context_type * load_context) { - bool loadOK = false; - double load_value; - int report_step = forward_load_context_get_load_step( load_context ); - const ecl_sum_type * ecl_sum = forward_load_context_get_ecl_sum( load_context ); - if (ecl_sum != NULL) { - const char * var_key = summary_config_get_var(summary->config); - load_fail_type load_fail_action = summary_config_get_load_fail_mode(summary->config ); - - /* Check if the ecl_sum instance has this report step. */ - if (ecl_sum_has_report_step( ecl_sum , report_step )) { - int last_report_index = ecl_sum_iget_report_end( ecl_sum , report_step ); - - if (ecl_sum_has_general_var(ecl_sum , var_key)) { - load_value = ecl_sum_get_general_var(ecl_sum , last_report_index ,var_key ); - loadOK = true; - } else { - load_value = 0; - /* - The summary object does not have this variable - probably - meaning that it is a well/group which has not yet - opened. When required == false we do not signal load - failure in this situation. - - If the user has misspelled the name, we will go through - the whole simulation without detecting that error. - */ - if (load_fail_action == LOAD_FAIL_EXIT) - loadOK = false; - else { - loadOK = true; - if (load_fail_action == LOAD_FAIL_WARN) - fprintf(stderr,"** WARNING ** Failed summary:%s does not have key:%s \n",ecl_sum_get_case( ecl_sum ) , var_key); - } - } - } else { - load_value = 0; - if (report_step == 0) - loadOK = true; - /* - We do not signal load failure if we do not have the S0000 - summary file - which does not contain any useful information - anyway. - - Hmmm - there is a "if (report_step > 0)" check in the - enkf_state_internalize_x() function as well. - */ - else { - if (load_fail_action == LOAD_FAIL_EXIT) - loadOK = false; - else { - loadOK = true; - if (load_fail_action == LOAD_FAIL_WARN) - fprintf(stderr,"** WARNING ** Failed summary:%s does not have report_step:%d \n",ecl_sum_get_case( ecl_sum ) , report_step); - } - } - } - } - - if (loadOK) - SUMMARY_SET_VALUE( summary , report_step , load_value ); - - return loadOK; -} - - - -bool summary_forward_load_vector(summary_type * summary , - const char * ecl_file_name , - const forward_load_context_type * load_context , - const int_vector_type * time_index) { - bool loadOK = false; - - const ecl_sum_type * ecl_sum = forward_load_context_get_ecl_sum( load_context ); - if (ecl_sum != NULL) { - const char * var_key = summary_config_get_var(summary->config); - load_fail_type load_fail_action = summary_config_get_load_fail_mode(summary->config ); - bool normal_load = false; - - - if (load_fail_action != LOAD_FAIL_EXIT) { - /* - The load will always ~succeed - but if we do not have the data; - we will fill the vector with zeros. - */ - - if (!ecl_sum_has_general_var(ecl_sum , var_key)) { - for (int step = 0; step < int_vector_size( time_index ); step++) { - int summary_step = int_vector_iget( time_index , step ); - if (summary_step >= 0) - double_vector_iset( summary->data_vector , summary_step , 0); - } - loadOK = true; - - if (load_fail_action == LOAD_FAIL_WARN) - fprintf(stderr,"** WARNING ** Failed summary:%s does not have key:%s \n",ecl_sum_get_case( ecl_sum ) , var_key); - } else - normal_load = true; - - } - - - if (normal_load) { - int key_index = ecl_sum_get_general_var_params_index( ecl_sum , var_key ); - - for (int store_index = 0; store_index < int_vector_size( time_index ); store_index++) { - int summary_index = int_vector_iget( time_index , store_index ); - - if (summary_index >= 0) { - if (ecl_sum_has_report_step( ecl_sum , summary_index )) { - int last_ministep_index = ecl_sum_iget_report_end( ecl_sum , summary_index ); - double_vector_iset( summary->data_vector , store_index , ecl_sum_iget(ecl_sum , last_ministep_index , key_index )); - } - } - - } - loadOK = true; - } - } - - return loadOK; -} - - - - - - - - - - -/******************************************************************/ -/* Anonumously generated functions used by the enkf_node object */ -/******************************************************************/ -UTIL_SAFE_CAST_FUNCTION(summary , SUMMARY) -UTIL_SAFE_CAST_FUNCTION_CONST(summary , SUMMARY) -VOID_ALLOC(summary) -VOID_FREE(summary) -VOID_COPY (summary) -VOID_FORWARD_LOAD(summary) -VOID_FORWARD_LOAD_VECTOR(summary) -VOID_USER_GET(summary) -VOID_USER_GET_VECTOR(summary) -VOID_WRITE_TO_BUFFER(summary) -VOID_READ_FROM_BUFFER(summary) -VOID_SERIALIZE(summary) -VOID_DESERIALIZE(summary) -VOID_CLEAR(summary) -VOID_HAS_DATA(summary) diff --git a/ThirdParty/Ert/libenkf/src/summary_config.c b/ThirdParty/Ert/libenkf/src/summary_config.c deleted file mode 100644 index 9ccc39107e..0000000000 --- a/ThirdParty/Ert/libenkf/src/summary_config.c +++ /dev/null @@ -1,135 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'summary_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include - -#include -#include - -#include -#include -#include -#include - - -#define SUMMARY_CONFIG_TYPE_ID 63106 - -struct summary_config_struct { - int __type_id; - load_fail_type load_fail; - ecl_smspec_var_type var_type; /* The type of the variable - according to ecl_summary nomenclature. */ - char * var; /* This is ONE variable of summary.x format - i.e. WOPR:OP_2, RPR:4, ... */ - set_type * obs_set; /* Set of keys (which fit in enkf_obs) which are observations of this node. */ -}; - - -/*****************************************************************/ - -UTIL_IS_INSTANCE_FUNCTION(summary_config , SUMMARY_CONFIG_TYPE_ID) - -const char * summary_config_get_var(const summary_config_type * config) { - return config->var; -} - - -ecl_smspec_var_type summary_config_get_var_type(summary_config_type * config , const ecl_sum_type * ecl_sum) { - return config->var_type; -} - - -load_fail_type summary_config_get_load_fail_mode( const summary_config_type * config) { - return config->load_fail; -} - -/** - Unfortunately it is a bit problematic to set the required flag to - TRUE for well and group variables because they do not exist in the - summary results before the well has actually opened, i.e. for a - partial summary case the results will not be there, and the loader - will incorrectly(?) signal failure. -*/ - -void summary_config_set_load_fail_mode( summary_config_type * config , load_fail_type load_fail) { - if ((config->var_type == ECL_SMSPEC_WELL_VAR) || (config->var_type == ECL_SMSPEC_GROUP_VAR)) - // For well and group variables load_fail will be LOAD_FAIL_SILENT anyway. - config->load_fail = LOAD_FAIL_SILENT; - else - config->load_fail = load_fail; -} - - -/** - This can only be used to increase the load_fail strictness. -*/ - -void summary_config_update_load_fail_mode( summary_config_type * config , load_fail_type load_fail) { - if (load_fail > config->load_fail) - summary_config_set_load_fail_mode( config , load_fail ); -} - - -summary_config_type * summary_config_alloc(const char * var , load_fail_type load_fail) { - summary_config_type * config = util_malloc(sizeof *config ); - config->__type_id = SUMMARY_CONFIG_TYPE_ID; - config->var = util_alloc_string_copy( var ); - config->var_type = ecl_smspec_identify_var_type( var ); - config->obs_set = set_alloc_empty(); - summary_config_set_load_fail_mode( config , load_fail); - return config; -} - - -void summary_config_add_obs_key(summary_config_type * config, const char * obs_key) { - set_add_key(config->obs_set , obs_key); -} - - - -void summary_config_free(summary_config_type * config) { - free(config->var); - set_free(config->obs_set); - free(config); -} - - - -int summary_config_get_byte_size(const summary_config_type * config) { - return sizeof(double); -} - - -int summary_config_get_data_size( const summary_config_type * config) { - return 1; -} - - - - - - -/*****************************************************************/ -UTIL_SAFE_CAST_FUNCTION(summary_config , SUMMARY_CONFIG_TYPE_ID) -UTIL_SAFE_CAST_FUNCTION_CONST(summary_config , SUMMARY_CONFIG_TYPE_ID) -VOID_GET_DATA_SIZE(summary) -VOID_CONFIG_FREE(summary) - diff --git a/ThirdParty/Ert/libenkf/src/summary_key_matcher.c b/ThirdParty/Ert/libenkf/src/summary_key_matcher.c deleted file mode 100644 index 3e7e4dcdbf..0000000000 --- a/ThirdParty/Ert/libenkf/src/summary_key_matcher.c +++ /dev/null @@ -1,77 +0,0 @@ -#include - -#include -#include - -#include -#include -#include -#include - -#include - - - -#define SUMMARY_KEY_MATCHER_TYPE_ID 700672137 - -struct summary_key_matcher_struct { - UTIL_TYPE_ID_DECLARATION; - hash_type * key_set; -}; - - -UTIL_IS_INSTANCE_FUNCTION( summary_key_matcher , SUMMARY_KEY_MATCHER_TYPE_ID ) - - -summary_key_matcher_type * summary_key_matcher_alloc() { - summary_key_matcher_type * matcher = util_malloc(sizeof * matcher); - UTIL_TYPE_ID_INIT( matcher , SUMMARY_KEY_MATCHER_TYPE_ID); - matcher->key_set = hash_alloc(); - return matcher; -} - -void summary_key_matcher_free(summary_key_matcher_type * matcher) { - hash_free(matcher->key_set); - free(matcher); -} - -int summary_key_matcher_get_size(const summary_key_matcher_type * matcher) { - return hash_get_size( matcher->key_set ); -} - -void summary_key_matcher_add_summary_key(summary_key_matcher_type * matcher, const char * summary_key) { - if(!hash_has_key(matcher->key_set, summary_key)) { - hash_insert_int(matcher->key_set, summary_key, !util_string_has_wildcard(summary_key)); - } -} - -bool summary_key_matcher_match_summary_key(const summary_key_matcher_type * matcher, const char * summary_key) { - stringlist_type * keys = hash_alloc_stringlist(matcher->key_set); - bool has_key = false; - - for (int i = 0; i < stringlist_get_size(keys); i++) { - const char * pattern = stringlist_iget(keys, i); - if(util_fnmatch(pattern, summary_key) == 0) { - has_key = true; - break; - } - } - - stringlist_free(keys); - - return has_key; -} - -stringlist_type * summary_key_matcher_get_keys(const summary_key_matcher_type * matcher) { - return hash_alloc_stringlist(matcher->key_set); -} - -bool summary_key_matcher_summary_key_is_required(const summary_key_matcher_type * matcher, const char * summary_key) { - bool is_required = false; - - if(!util_string_has_wildcard(summary_key) && hash_has_key(matcher->key_set, summary_key)) { - is_required = (bool) hash_get_int(matcher->key_set, summary_key); - } - - return is_required; -} \ No newline at end of file diff --git a/ThirdParty/Ert/libenkf/src/summary_key_set.c b/ThirdParty/Ert/libenkf/src/summary_key_set.c deleted file mode 100644 index 97a6d4de93..0000000000 --- a/ThirdParty/Ert/libenkf/src/summary_key_set.c +++ /dev/null @@ -1,170 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - The file 'state_map.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#define _GNU_SOURCE /* Must define this to get access to pthread_rwlock_t */ -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - - -#define SUMMARY_KEY_SET_TYPE_ID 700672133 - -struct summary_key_set_struct { - UTIL_TYPE_ID_DECLARATION; - hash_type * key_set; - pthread_rwlock_t rw_lock; - bool read_only; -}; - - -UTIL_IS_INSTANCE_FUNCTION( summary_key_set , SUMMARY_KEY_SET_TYPE_ID ) - - -summary_key_set_type * summary_key_set_alloc() { - summary_key_set_type * set = util_malloc(sizeof * set); - UTIL_TYPE_ID_INIT( set , SUMMARY_KEY_SET_TYPE_ID); - set->key_set = hash_alloc(); - pthread_rwlock_init( &set->rw_lock , NULL); - set->read_only = false; - return set; -} - -summary_key_set_type * summary_key_set_alloc_from_file(const char * filename, bool read_only) { - summary_key_set_type * set = summary_key_set_alloc(); - summary_key_set_fread(set, filename); - set->read_only = read_only; - return set; -} - -void summary_key_set_free(summary_key_set_type * set) { - hash_free(set->key_set); - free(set); -} - -int summary_key_set_get_size(summary_key_set_type * set) { - int size; - pthread_rwlock_rdlock( &set->rw_lock ); - { - size = hash_get_size( set->key_set ); - } - pthread_rwlock_unlock( &set->rw_lock ); - return size; -} - - -bool summary_key_set_add_summary_key(summary_key_set_type * set, const char * summary_key) { - bool writable_and_non_existent = true; - - pthread_rwlock_wrlock( &set->rw_lock); - { - - if(hash_has_key(set->key_set, summary_key)) { - writable_and_non_existent = false; - } - - if(set->read_only) { - writable_and_non_existent = false; - } - - if(writable_and_non_existent) { - hash_insert_int(set->key_set, summary_key, 1); - } - } - pthread_rwlock_unlock( &set->rw_lock ); - - return writable_and_non_existent; -} - -bool summary_key_set_has_summary_key(summary_key_set_type * set, const char * summary_key) { - bool has_key = false; - - pthread_rwlock_rdlock( &set->rw_lock ); - { - has_key = hash_has_key(set->key_set, summary_key); - } - pthread_rwlock_unlock( &set->rw_lock ); - - return has_key; -} - -stringlist_type * summary_key_set_alloc_keys(summary_key_set_type * set) { - stringlist_type * keys; - - pthread_rwlock_rdlock( &set->rw_lock ); - { - keys = hash_alloc_stringlist(set->key_set); - } - pthread_rwlock_unlock( &set->rw_lock ); - - return keys; -} - - -bool summary_key_set_is_read_only(const summary_key_set_type * set) { - return set->read_only; -} - -void summary_key_set_fwrite(summary_key_set_type * set, const char * filename) { - pthread_rwlock_rdlock( &set->rw_lock ); - { - FILE * stream = util_mkdir_fopen(filename , "w"); - if (stream) { - stringlist_type * keys = hash_alloc_stringlist(set->key_set); - stringlist_fwrite(keys, stream); - stringlist_free(keys); - fclose( stream ); - } else { - util_abort("%s: failed to open: %s for writing \n", __func__, filename); - } - } - pthread_rwlock_unlock( &set->rw_lock ); -} - -bool summary_key_set_fread(summary_key_set_type * set, const char * filename) { - bool file_exists = false; - pthread_rwlock_wrlock( &set->rw_lock ); - { - hash_clear(set->key_set); - - if (util_file_exists(filename)) { - FILE * stream = util_fopen(filename, "r"); - if (stream) { - stringlist_type * key_set = stringlist_fread_alloc(stream); - - for (int i = 0; i < stringlist_get_size(key_set); i++) { - hash_insert_int(set->key_set, stringlist_iget(key_set, i), 1); - } - stringlist_free(key_set); - fclose( stream ); - } else { - util_abort("%s: failed to open: %s for reading \n",__func__ , filename ); - } - file_exists = true; - } - } - pthread_rwlock_unlock( &set->rw_lock ); - return file_exists; -} diff --git a/ThirdParty/Ert/libenkf/src/summary_obs.c b/ThirdParty/Ert/libenkf/src/summary_obs.c deleted file mode 100644 index 933090a57a..0000000000 --- a/ThirdParty/Ert/libenkf/src/summary_obs.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'summary_obs.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -/** - See the overview documentation of the observation system in enkf_obs.c -*/ -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - - -#define SUMMARY_OBS_TYPE_ID 66103 -#define OBS_SIZE 1 - -struct summary_obs_struct { - UTIL_TYPE_ID_DECLARATION; - char * summary_key; /** The observation, in summary.x syntax, e.g. GOPR:FIELD. */ - char * obs_key; - - double value; /** Observation value. */ - double std; /** Standard deviation of observation. */ - double std_scaling; - - auto_corrf_ftype * auto_corrf; - double auto_corrf_param; -}; - - - -static double auto_corrf_exp( double tlag , double param ) { - return exp(-fabs(tlag) / param ); -} - -static double auto_corrf_gauss( double tlag , double param ) { - double x = tlag / param; - return exp(-0.5 * x * x); -} - - - -static auto_corrf_ftype * summary_obs_lookup_auto_corrf( const char * fname ) { - if (fname == NULL) - return NULL; - else { - if (strcmp( fname , AUTO_CORRF_EXP) == 0) - return auto_corrf_exp; - else if (strcmp( fname , AUTO_CORRF_GAUSS) == 0) - return auto_corrf_gauss; - else { - util_abort("%s: correlation function:%s not recognized \n",__func__ , fname); - return NULL; /* Compiler shut up. */ - } - } -} - - - - -/** - This function allocates a summary_obs instance. The summary_key - string should be of the format used by the summary.x program. - E.g., WOPR:P4 would condition on WOPR in well P4. - - Observe that this format is currently *not* checked before the actual - observation time. - - TODO - Should check summary_key on alloc. -*/ -summary_obs_type * summary_obs_alloc(const char * summary_key, - const char * obs_key , - double value , - double std , - const char * auto_corrf_name , - double auto_corrf_param) { - - summary_obs_type * obs = util_malloc(sizeof * obs ); - UTIL_TYPE_ID_INIT( obs , SUMMARY_OBS_TYPE_ID ) - - obs->summary_key = util_alloc_string_copy( summary_key ); - obs->obs_key = util_alloc_string_copy( obs_key ); - obs->value = value; - obs->std = std; - obs->std_scaling = 1.0; - obs->auto_corrf = summary_obs_lookup_auto_corrf( auto_corrf_name ); - obs->auto_corrf_param = auto_corrf_param; - - return obs; -} - - -static UTIL_SAFE_CAST_FUNCTION_CONST(summary_obs , SUMMARY_OBS_TYPE_ID); -static UTIL_SAFE_CAST_FUNCTION(summary_obs , SUMMARY_OBS_TYPE_ID); -UTIL_IS_INSTANCE_FUNCTION(summary_obs , SUMMARY_OBS_TYPE_ID); - - -void summary_obs_free(summary_obs_type * summary_obs) { - free(summary_obs->summary_key); - free(summary_obs->obs_key); - free(summary_obs); -} - - - - - -auto_corrf_ftype * summary_obs_get_auto_corrf( const summary_obs_type * summary_obs ) { - return summary_obs->auto_corrf; -} - -double summary_obs_get_auto_corrf_param( const summary_obs_type * summary_obs ) { - return summary_obs->auto_corrf_param; -} - - - - - -const char * summary_obs_get_summary_key(const summary_obs_type * summary_obs) -{ - return summary_obs->summary_key; -} - - -/** - Hardcodes an assumption that the size of summary data|observations - is always one; i.e. PARTLY_ACTIVE and ALL_ACTIVE are treated in the - same manner. -*/ -void summary_obs_get_observations(const summary_obs_type * summary_obs, - obs_data_type * obs_data, - enkf_fs_type * fs, - int report_step , - const active_list_type * __active_list) { - - int active_size = active_list_get_active_size( __active_list , OBS_SIZE ); - if (active_size == 1) { - obs_block_type * obs_block = obs_data_add_block( obs_data , summary_obs->obs_key , OBS_SIZE , NULL , false); - obs_block_iset( obs_block , 0 , summary_obs->value , summary_obs->std * summary_obs->std_scaling); - } -} - - - -void summary_obs_measure(const summary_obs_type * obs, const summary_type * summary, node_id_type node_id , meas_data_type * meas_data , const active_list_type * __active_list) { - int active_size = active_list_get_active_size( __active_list , OBS_SIZE ); - if (active_size == 1) { - meas_block_type * meas_block = meas_data_add_block( meas_data , obs->obs_key , node_id.report_step , active_size ); - meas_block_iset( meas_block , node_id.iens , 0 , summary_get(summary, node_id.report_step )); - } -} - - - -double summary_obs_chi2(const summary_obs_type * obs, - const summary_type * summary, - node_id_type node_id) { - double x = (summary_get(summary , node_id.report_step) - obs->value) / obs->std; - return x*x; -} - - - -void summary_obs_user_get(const summary_obs_type * summary_obs , const char * index_key , double * value , double * std, bool * valid) { - *valid = true; - *value = summary_obs->value; - *std = summary_obs->std; -} - - - -double summary_obs_get_value( const summary_obs_type * summary_obs ) { - return summary_obs->value; -} - -double summary_obs_get_std( const summary_obs_type * summary_obs ) { - return summary_obs->std; -} - -double summary_obs_get_std_scaling( const summary_obs_type * summary_obs ) { - return summary_obs->std_scaling; -} - - -void summary_obs_update_std_scale(summary_obs_type * summary_obs, double std_multiplier , const active_list_type * active_list) { - if (active_list_get_mode( active_list ) == ALL_ACTIVE) - summary_obs->std_scaling = std_multiplier; - else { - int size = active_list_get_active_size( active_list , OBS_SIZE ); - if (size > 0) - summary_obs->std_scaling = std_multiplier; - } -} - - -/*****************************************************************/ - -VOID_FREE(summary_obs) -VOID_GET_OBS(summary_obs) -VOID_USER_GET_OBS(summary_obs) -VOID_MEASURE(summary_obs , summary) -VOID_CHI2(summary_obs , summary) -VOID_UPDATE_STD_SCALE(summary_obs); diff --git a/ThirdParty/Ert/libenkf/src/surface.c b/ThirdParty/Ert/libenkf/src/surface.c deleted file mode 100644 index 38b225a4e0..0000000000 --- a/ThirdParty/Ert/libenkf/src/surface.c +++ /dev/null @@ -1,230 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'surface.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include - - -/*****************************************************************/ - - -struct surface_struct { - int __type_id; /* Only used for run_time checking. */ - surface_config_type * config; /* Can not be NULL - var_type is set on first load. */ - double * data; /* Size is always one - but what the fuck ... */ -}; - - - - -void surface_clear(surface_type * surface) { - const int data_size = surface_config_get_data_size( surface->config ); - for (int k=0; k < data_size; k++) - surface->data[k] = 0; -} - -bool surface_fload( surface_type * surface , const char * filename ) { - bool ret = false; - if (filename) { - const geo_surface_type * base_surface = surface_config_get_base_surface( surface->config ); - ret = geo_surface_fload_irap_zcoord( base_surface , filename , surface->data ); - } - return ret; -} - - - -bool surface_initialize(surface_type *surface , int iens , const char * filename , rng_type * rng) { - return surface_fload(surface , filename ); -} - - -surface_type * surface_alloc(const surface_config_type * surface_config) { - surface_type * surface = util_malloc(sizeof *surface); - surface->__type_id = SURFACE; - surface->config = (surface_config_type *) surface_config; - { - const int data_size = surface_config_get_data_size( surface_config ); - surface->data = util_calloc( data_size , sizeof * surface->data ); - } - return surface; -} - - - - -void surface_copy(const surface_type *src , surface_type * target) { - if (src->config == target->config) { - const int data_size = surface_config_get_data_size( src->config ); - for (int k=0; k < data_size; k++) - target->data[k] = src->data[k]; - } else - util_abort("%s: do not share config objects \n",__func__); -} - - - - -void surface_read_from_buffer(surface_type * surface , buffer_type * buffer, enkf_fs_type * fs, int report_step) { - int size = surface_config_get_data_size( surface->config ); - enkf_util_assert_buffer_type( buffer , SURFACE ); - buffer_fread( buffer , surface->data , sizeof * surface->data , size); -} - - - - - - -bool surface_write_to_buffer(const surface_type * surface , buffer_type * buffer, int report_step) { - int size = surface_config_get_data_size( surface->config ); - buffer_fwrite_int( buffer , SURFACE ); - buffer_fwrite( buffer , surface->data , sizeof * surface->data , size); - return true; -} - - -void surface_free(surface_type *surface) { - free(surface->data); - free(surface); -} - - - - -void surface_serialize(const surface_type * surface , node_id_type node_id , const active_list_type * active_list , matrix_type * A , int row_offset , int column) { - const surface_config_type *config = surface->config; - const int data_size = surface_config_get_data_size(config ); - - enkf_matrix_serialize( surface->data , data_size , ECL_DOUBLE_TYPE , active_list , A , row_offset , column); -} - - - -void surface_deserialize(surface_type * surface , node_id_type node_id , const active_list_type * active_list , const matrix_type * A , int row_offset , int column) { - const surface_config_type *config = surface->config; - const int data_size = surface_config_get_data_size(config ); - - enkf_matrix_deserialize( surface->data , data_size , ECL_DOUBLE_TYPE , active_list , A , row_offset , column); -} - - -void surface_ecl_write(const surface_type * surface , const char * run_path , const char * base_file , void * filestream) { - char * target_file = util_alloc_filename( run_path , base_file , NULL); - surface_config_ecl_write( surface->config , target_file , surface->data ); - free( target_file ); -} - - -bool surface_user_get(const surface_type * surface , const char * index_key , int report_step , double * value) { - const int data_size = surface_config_get_data_size( surface->config ); - int index; - - *value = 0.0; - - if (util_sscanf_int( index_key , &index)) - if ((index >= 0) && (index < data_size)) { - *value = surface->data[index]; - return true; - } - - // Not valid - return false; -} - - - -void surface_set_inflation(surface_type * inflation , const surface_type * std , const surface_type * min_std) { - int size = 1; - for (int i = 0; i < size; i++) - inflation->data[i] = util_double_max( 1.0 , min_std->data[i] / std->data[i]); -} - - -void surface_iadd( surface_type * surface , const surface_type * delta) { - int size = 1; - for (int i = 0; i < size; i++) - surface->data[i] += delta->data[i]; -} - - -void surface_iaddsqr( surface_type * surface , const surface_type * delta) { - int size = 1; - for (int i = 0; i < size; i++) - surface->data[i] += delta->data[i] * delta->data[i]; -} - - -void surface_imul( surface_type * surface , const surface_type * delta) { - int size = 1; - for (int i = 0; i < size; i++) - surface->data[i] *= delta->data[i]; -} - -void surface_scale( surface_type * surface , double scale_factor) { - int size = 1; - for (int i = 0; i < size; i++) - surface->data[i] *= scale_factor; -} - -void surface_isqrt( surface_type * surface ) { - int size = 1; - for (int i = 0; i < size; i++) - surface->data[i] = sqrt( surface->data[i] ); -} - - - - - -/******************************************************************/ -/* Anonumously generated functions used by the enkf_node object */ -/******************************************************************/ -UTIL_SAFE_CAST_FUNCTION(surface , SURFACE) -UTIL_SAFE_CAST_FUNCTION_CONST(surface , SURFACE) -VOID_ALLOC(surface) -VOID_FREE(surface) -VOID_ECL_WRITE(surface) -VOID_COPY(surface) -VOID_USER_GET(surface) -VOID_WRITE_TO_BUFFER(surface) -VOID_READ_FROM_BUFFER(surface) -VOID_SERIALIZE(surface) -VOID_DESERIALIZE(surface) -VOID_INITIALIZE(surface) -VOID_SET_INFLATION(surface) -VOID_CLEAR(surface) -VOID_IADD(surface) -VOID_SCALE(surface) -VOID_IMUL(surface) -VOID_IADDSQR(surface) -VOID_ISQRT(surface) -VOID_FLOAD(surface) diff --git a/ThirdParty/Ert/libenkf/src/surface_config.c b/ThirdParty/Ert/libenkf/src/surface_config.c deleted file mode 100644 index 0d494f056a..0000000000 --- a/ThirdParty/Ert/libenkf/src/surface_config.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'surface_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include - -#include - -#include -#include -#include - -#define SURFACE_CONFIG_TYPE_ID 853317 - -struct surface_config_struct { - UTIL_TYPE_ID_DECLARATION; - geo_surface_type * base_surface; -}; - - - -surface_config_type * surface_config_alloc_empty( ) { - surface_config_type * config = util_malloc( sizeof * config ); - UTIL_TYPE_ID_INIT( config , SURFACE_CONFIG_TYPE_ID ); - config->base_surface = NULL; - return config; -} - - - -void surface_config_free( surface_config_type * config ) { - if (config->base_surface != NULL) - geo_surface_free( config->base_surface ); - - free( config ); -} - - -void surface_config_set_base_surface( surface_config_type * config , const char * base_surface ) { - if (config->base_surface != NULL) - geo_surface_free( config->base_surface ); - config->base_surface = geo_surface_fload_alloc_irap( base_surface , false ); -} - - -const geo_surface_type * surface_config_get_base_surface( const surface_config_type * config ) { - return config->base_surface; -} - - -int surface_config_get_data_size( const surface_config_type * config ) { - return geo_surface_get_size( config->base_surface ); -} - -void surface_config_ecl_write( const surface_config_type * config , const char * filename , const double * zcoord) { - geo_surface_fprintf_irap_external_zcoord( config->base_surface , filename , zcoord ); -} - - -/*****************************************************************/ -UTIL_SAFE_CAST_FUNCTION(surface_config , SURFACE_CONFIG_TYPE_ID) -UTIL_SAFE_CAST_FUNCTION_CONST(surface_config , SURFACE_CONFIG_TYPE_ID) -VOID_GET_DATA_SIZE(surface) -VOID_CONFIG_FREE(surface) - - diff --git a/ThirdParty/Ert/libenkf/src/test.c b/ThirdParty/Ert/libenkf/src/test.c deleted file mode 100644 index bf1d8fd9c8..0000000000 --- a/ThirdParty/Ert/libenkf/src/test.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - - -int main(void) { -} - - - diff --git a/ThirdParty/Ert/libenkf/src/time_map.c b/ThirdParty/Ert/libenkf/src/time_map.c deleted file mode 100644 index 4c7e37fdaf..0000000000 --- a/ThirdParty/Ert/libenkf/src/time_map.c +++ /dev/null @@ -1,714 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - The file 'time_map.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#define _GNU_SOURCE /* Must define this to get access to pthread_rwlock_t */ -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include - -#define DEFAULT_TIME -1 - -static time_t time_map_iget__( const time_map_type * map , int step ); -static void time_map_update_abort( time_map_type * map , int step , time_t time); -static void time_map_summary_update_abort( time_map_type * map , const ecl_sum_type * ecl_sum); - -#define TIME_MAP_TYPE_ID 7751432 -struct time_map_struct { - UTIL_TYPE_ID_DECLARATION; - time_t_vector_type * map; - pthread_rwlock_t rw_lock; - bool modified; - bool read_only; - bool strict; - const ecl_sum_type * refcase; -}; - - -UTIL_SAFE_CAST_FUNCTION( time_map , TIME_MAP_TYPE_ID ) -UTIL_IS_INSTANCE_FUNCTION( time_map , TIME_MAP_TYPE_ID ) - - -time_map_type * time_map_alloc( ) { - time_map_type * map = util_malloc( sizeof * map ); - UTIL_TYPE_ID_INIT( map , TIME_MAP_TYPE_ID ); - - map->map = time_t_vector_alloc(0 , DEFAULT_TIME ); - map->modified = false; - map->read_only = false; - map->strict = true; - map->refcase = NULL; - pthread_rwlock_init( &map->rw_lock , NULL); - return map; -} - -bool time_map_is_strict( const time_map_type * time_map ){ - return time_map->strict; -} - -/** - The refcase will only be attached if it is consistent with the - current time map; we will accept attaching a refcase which is - shorter than the current case. -*/ -bool time_map_attach_refcase( time_map_type * time_map , const ecl_sum_type * refcase) { - bool attach_ok = true; - pthread_rwlock_rdlock( &time_map->rw_lock ); - - { - int step; - int max_step = util_int_min( time_map_get_size(time_map) , ecl_sum_get_last_report_step( refcase ) + 1); - - for (step = 0; step < max_step; step++) { - time_t current_time = time_map_iget__( time_map , step ); - time_t sim_time = ecl_sum_get_report_time( refcase , step ); - - if (current_time != sim_time) { - attach_ok = false; - break; - } - } - - if (attach_ok) - time_map->refcase = refcase; - } - pthread_rwlock_unlock( &time_map->rw_lock ); - - return attach_ok; -} - -bool time_map_has_refcase( const time_map_type * time_map ) { - if (time_map->refcase) - return true; - else - return false; -} - - -void time_map_set_strict( time_map_type * time_map , bool strict) { - time_map->strict = strict; -} - - -time_map_type * time_map_fread_alloc_readonly( const char * filename) { - time_map_type * tm = time_map_alloc(); - - if (util_file_exists(filename)) - time_map_fread( tm , filename ); - tm->read_only = true; - - return tm; -} - - -bool time_map_fscanf(time_map_type * map , const char * filename) { - bool fscanf_ok = true; - if (util_is_file( filename )) { - time_t_vector_type * time_vector = time_t_vector_alloc(0,0); - - { - FILE * stream = util_fopen(filename , "r"); - time_t last_date = 0; - while (true) { - char date_string[128]; - if (fscanf(stream , "%s" , date_string) == 1) { - time_t date; - if (util_sscanf_date_utc(date_string , &date)) { - if (date > last_date) - time_t_vector_append( time_vector , date ); - else { - fprintf(stderr,"** ERROR: The dates in %s must be in stricly increasing order\n",filename); - fscanf_ok = false; - break; - } - } else { - fprintf(stderr,"** ERROR: The string \'%s\' was not correctly parsed as a date (format: DD/MM/YYYY) ",date_string); - fscanf_ok = false; - break; - } - last_date = date; - } else - break; - } - fclose( stream ); - - if (fscanf_ok) { - int i; - time_map_clear( map ); - for (i=0; i < time_t_vector_size( time_vector ); i++) - time_map_update( map , i , time_t_vector_iget( time_vector , i )); - } - - } - time_t_vector_free( time_vector ); - } else - fscanf_ok = false; - - return fscanf_ok; -} - - -bool time_map_equal( const time_map_type * map1 , const time_map_type * map2) { - return time_t_vector_equal( map1->map , map2->map ); -} - - -void time_map_free( time_map_type * map ) { - time_t_vector_free( map->map ); - free( map ); -} - - -bool time_map_is_readonly( const time_map_type * tm) { - return tm->read_only; -} - - - -/** - Must hold the write lock. When a refcase is supplied we gurantee - that all values written into the map agree with the refcase - values. However the time map is not preinitialized with the refcase - values. -*/ - -static bool time_map_update__( time_map_type * map , int step , time_t update_time) { - bool updateOK = true; - time_t current_time = time_t_vector_safe_iget( map->map , step); - - if (current_time == DEFAULT_TIME) { - if (map->refcase) { - if (step <= ecl_sum_get_last_report_step( map->refcase )) { - time_t ref_time = ecl_sum_get_report_time( map->refcase , step ); - - if (ref_time != update_time) { - updateOK = false; - ert_log_add_message( 1 , NULL , "Tried to load data where report step/data is incompatible with refcase - ignored" , false); - } - } - } - } else if (current_time != update_time) - updateOK = false; - - - if (updateOK) { - map->modified = true; - time_t_vector_iset( map->map , step , update_time ); - } - - return updateOK; -} - - -static bool time_map_summary_update__( time_map_type * map , const ecl_sum_type * ecl_sum) { - bool updateOK = true; - int first_step = ecl_sum_get_first_report_step( ecl_sum ); - int last_step = ecl_sum_get_last_report_step( ecl_sum ); - int step; - - for (step = first_step; step <= last_step; step++) { - if (ecl_sum_has_report_step(ecl_sum , step)) { - time_t sim_time = ecl_sum_get_report_time( ecl_sum , step ); - - updateOK = (updateOK && time_map_update__( map , step , sim_time )); - } - } - - updateOK = (updateOK && time_map_update__(map , 0 , ecl_sum_get_start_time( ecl_sum ))); - return updateOK; -} - - -static time_t time_map_iget__( const time_map_type * map , int step ) { - return time_t_vector_safe_iget( map->map , step ); -} - - -/*****************************************************************/ - -double time_map_iget_sim_days( time_map_type * map , int step ) { - double days; - - pthread_rwlock_rdlock( &map->rw_lock ); - { - time_t start_time = time_map_iget__( map , 0 ); - time_t sim_time = time_map_iget__( map , step ); - - if (sim_time >= start_time) - days = 1.0 * (sim_time - start_time) / (3600 * 24); - else - days = -1; - } - pthread_rwlock_unlock( &map->rw_lock ); - - return days; -} - - -time_t time_map_iget( time_map_type * map , int step ) { - time_t t; - - pthread_rwlock_rdlock( &map->rw_lock ); - t = time_map_iget__( map , step ); - pthread_rwlock_unlock( &map->rw_lock ); - - return t; -} - -static void time_map_assert_writable( const time_map_type * map) { - if (map->read_only) - util_abort("%s: attempt to modify read-only time-map. \n",__func__); -} - - -/** - Observe that the locking is opposite of the function name; i.e. - the time_map_fwrite() function reads the time_map and takes the - read lock, whereas the time_map_fread() function takes the write - lock. -*/ - -void time_map_fwrite( time_map_type * map , const char * filename ) { - pthread_rwlock_rdlock( &map->rw_lock ); - { - if (map->modified) { - FILE * stream = util_mkdir_fopen(filename , "w"); - time_t_vector_fwrite( map->map , stream ); - fclose( stream ); - } - map->modified = false; - } - pthread_rwlock_unlock( &map->rw_lock ); -} - - -void time_map_fread( time_map_type * map , const char * filename) { - time_map_assert_writable( map ); - pthread_rwlock_wrlock( &map->rw_lock ); - { - if (util_file_exists( filename )) { - FILE * stream = util_fopen( filename , "r"); - time_t_vector_type * file_map = time_t_vector_fread_alloc( stream ); - - for (int step=0; step < time_t_vector_size( file_map ); step++) - time_map_update__( map , step , time_t_vector_iget( file_map , step )); - - time_t_vector_free( file_map ); - fclose( stream ); - } - } - pthread_rwlock_unlock( &map->rw_lock ); - time_map_get_last_step( map ); - map->modified = false; -} - - - - - -/* - Observe that the return value from this function is an inclusive - value; i.e. it should be permissible to ask for results at this report - step. -*/ - -int time_map_get_last_step( time_map_type * map) { - int last_step; - - pthread_rwlock_rdlock( &map->rw_lock ); - last_step = time_t_vector_size( map->map ) - 1; - pthread_rwlock_unlock( &map->rw_lock ); - - return last_step; -} - -int time_map_get_size( time_map_type * map) { - return time_map_get_last_step( map ) + 1; -} - -time_t time_map_get_start_time( time_map_type * map) { - return time_map_iget( map , 0 ); -} - - -time_t time_map_get_end_time( time_map_type * map) { - int last_step = time_map_get_last_step( map ); - return time_map_iget( map , last_step ); -} - -double time_map_get_end_days( time_map_type * map) { - int last_step = time_map_get_last_step( map ); - return time_map_iget_sim_days( map , last_step ); -} - -/*****************************************************************/ - - -bool time_map_update( time_map_type * map , int step , time_t time) { - bool updateOK = time_map_try_update( map , step , time ); - if (!updateOK) { - if (map->strict) - time_map_update_abort(map , step , time); - else - ert_log_add_message(1 , NULL , "Report step/true time inconsistency - data will be ignored" , false); - } - return updateOK; -} - - -bool time_map_try_update( time_map_type * map , int step , time_t time) { - bool updateOK; - time_map_assert_writable( map ); - pthread_rwlock_wrlock( &map->rw_lock ); - { - updateOK = time_map_update__( map , step , time ); - } - pthread_rwlock_unlock( &map->rw_lock ); - return updateOK; -} - - - -bool time_map_summary_update( time_map_type * map , const ecl_sum_type * ecl_sum) { - bool updateOK = time_map_try_summary_update( map , ecl_sum ); - - if (!updateOK) { - if (map->strict) - time_map_summary_update_abort( map , ecl_sum ); - else - ert_log_add_message(1 , NULL , "Report step/true time inconsistency - data will be ignored" , false); - } - - return updateOK; -} - - -bool time_map_try_summary_update( time_map_type * map , const ecl_sum_type * ecl_sum) { - bool updateOK; - - time_map_assert_writable( map ); - pthread_rwlock_wrlock( &map->rw_lock ); - { - updateOK = time_map_summary_update__( map , ecl_sum ); - } - pthread_rwlock_unlock( &map->rw_lock ); - - return updateOK; -} - - -int time_map_lookup_time( time_map_type * map , time_t time) { - int index = -1; - pthread_rwlock_rdlock( &map->rw_lock ); - { - int current_index = 0; - while (true) { - if (current_index >= time_t_vector_size( map->map )) - break; - - if (time_map_iget__( map , current_index ) == time) { - index = current_index; - break; - } - - current_index++; - } - } - pthread_rwlock_unlock( &map->rw_lock ); - return index; -} - -static bool time_map_valid_time__(const time_map_type * map , time_t time) { - if (time_t_vector_size( map->map ) > 0) { - if ((time >= time_map_iget__(map , 0)) && - (time <= time_map_iget__(map , time_t_vector_size( map->map ) - 1))) - return true; - else - return false; - } else - return false; -} - - - -int time_map_lookup_time_with_tolerance( time_map_type * map , time_t time , int seconds_before_tolerance, int seconds_after_tolerance) { - int nearest_index = -1; - pthread_rwlock_rdlock( &map->rw_lock ); - { - if (time_map_valid_time__( map , time )) { - time_t nearest_diff = 999999999999; - int current_index = 0; - while (true) { - time_t diff = time - time_map_iget__( map , current_index ); - if (diff == 0) { - nearest_index = current_index; - break; - } - - if (abs(diff) < nearest_diff) { - bool inside_tolerance = true; - if (seconds_after_tolerance >= 0) { - if (diff >= seconds_after_tolerance) - inside_tolerance = false; - } - - if (seconds_before_tolerance >= 0) { - if (diff <= -seconds_before_tolerance) - inside_tolerance = false; - } - - if (inside_tolerance) { - nearest_diff = diff; - nearest_index = current_index; - } - } - - current_index++; - - if (current_index >= time_t_vector_size( map->map )) - break; - } - } - } - pthread_rwlock_unlock( &map->rw_lock ); - return nearest_index; -} - - - -int time_map_lookup_days( time_map_type * map , double sim_days) { - int index = -1; - pthread_rwlock_rdlock( &map->rw_lock ); - { - if (time_t_vector_size( map->map ) > 0) { - time_t time = time_map_iget__(map , 0 ); - util_inplace_forward_days_utc( &time , sim_days ); - index = time_map_lookup_time( map , time ); - } - } - pthread_rwlock_unlock( &map->rw_lock ); - return index; -} - - -void time_map_clear( time_map_type * map ) { - time_map_assert_writable( map ); - pthread_rwlock_wrlock( &map->rw_lock ); - { - time_t_vector_reset( map->map ); - map->modified = true; - } - pthread_rwlock_unlock( &map->rw_lock ); -} - - -/* - This is a function specifically written to upgrade an on-disk - time_map which is using localtime (fs_version <= 106) to a utc based - time_map (fs_version >= 107). -*/ - -void time_map_summary_upgrade107( time_map_type * map , const ecl_sum_type * ecl_sum) { - int first_step = ecl_sum_get_first_report_step( ecl_sum ); - int last_step = ecl_sum_get_last_report_step( ecl_sum ); - - time_t_vector_resize( map->map , last_step + 1); - time_t_vector_iset_block( map->map , 0 , first_step , DEFAULT_TIME); - for (int step=first_step; step <= last_step; step++) { - if (ecl_sum_has_report_step(ecl_sum , step)) { - time_t sim_time = ecl_sum_get_report_time( ecl_sum , step ); - time_t_vector_iset( map->map , step , sim_time); - } - } - map->modified = true; -} - - -/*****************************************************************/ - -static void time_map_update_abort( time_map_type * map , int step , time_t time) { - time_t current_time = time_map_iget__( map , step ); - int current[3]; - int new[3]; - - util_set_date_values_utc( current_time , ¤t[0] , ¤t[1] , ¤t[2]); - util_set_date_values_utc( time , &new[0] , &new[1] , &new[2]); - - util_abort("%s: time mismatch for step:%d New: %02d/%02d/%04d existing: %02d/%02d/%04d \n",__func__ , step , - new[0] , new[1] , new[2] , - current[0] , current[1] , current[2]); -} - - -static void time_map_summary_update_abort( time_map_type * map , const ecl_sum_type * ecl_sum) { - /* - If the normal summary update fails we just play through all - time steps to pinpoint exactly the step where the update fails. - */ - - int first_step = ecl_sum_get_first_report_step( ecl_sum ); - int last_step = ecl_sum_get_last_report_step( ecl_sum ); - int step; - - for (step = first_step; step <= last_step; step++) { - if (ecl_sum_has_report_step(ecl_sum , step)) { - time_t time = ecl_sum_get_report_time( ecl_sum , step ); - - if (map->refcase) { - if (ecl_sum_get_last_report_step( ecl_sum ) >= step) { - time_t ref_time = ecl_sum_get_report_time( map->refcase , step ); - if (ref_time != time) { - int ref[3]; - int new[3]; - - util_set_date_values_utc( time , &new[0] , &new[1] , &new[2]); - util_set_date_values_utc( ref_time , &ref[0] , &ref[1] , &ref[2]); - - fprintf(stderr," Time mismatch for step:%d New: %02d/%02d/%04d refcase: %02d/%02d/%04d \n", step , - new[0] , new[1] , new[2] , - ref[0] , ref[1] , ref[2]); - } - } - } - - { - time_t current_time = time_map_iget__( map , step ); - int current[3]; - int new[3]; - - util_set_date_values_utc( current_time , ¤t[0] , ¤t[1] , ¤t[2]); - util_set_date_values_utc( time , &new[0] , &new[1] , &new[2]); - - fprintf(stderr,"Time mismatch for step:%d New: %02d/%02d/%04d existing: %02d/%02d/%04d \n",step , - new[0] , new[1] , new[2] , - current[0] , current[1] , current[2]); - } - } - } - - util_abort("%s: inconsistency when updating time map \n",__func__); -} - - - -/*****************************************************************/ - - -/* - This function creates an integer index mapping from the time map - into the summary case. In general the time <-> report step mapping - of the summary data should coincide exactly with the one maintained - in the time_map, however we allow extra timesteps in the summary - instance. The extra timesteps will be ignored, holes in the summary - timestep is not allowed - that will lead to a hard crash. - - time map Summary - ------------------------------------------------- - 0: 01/01/2000 <------- 0: 01/01/2000 - - 1: 01/02/2000 <------- 1: 01/02/2000 - - 2: 01/03/2000 <-\ 2: 02/02/2000 (Ignored) - \ - \-- 3: 01/03/2000 - - 3: 01/04/2000 <------- 4: 01/04/2000 - - - index_map = { 0 , 1 , 3 , 4 } - - Observe that the time_map_update_summary() must be called prior to - calling this function, to ensure that the time_map is sufficiently - long. If timesteps are missing from the summary case we crash hard: - - - time map Summary - ------------------------------------------------- - 0: 01/01/2000 <------- 0: 01/01/2000 - - 1: 01/02/2000 <------- 1: 01/02/2000 - - 2: 01/03/2000 ## ERROR -> util_abort() - - 3: 01/04/2000 <------- 2: 01/04/2000 - -*/ - - - -int_vector_type * time_map_alloc_index_map( time_map_type * map , const ecl_sum_type * ecl_sum ) { - int_vector_type * index_map = int_vector_alloc(0 , -1 ); - pthread_rwlock_rdlock( &map->rw_lock ); - { - int time_map_index = 0; - int sum_index = 0; - - while (true) { - time_t map_time = time_map_iget__( map , time_map_index); - if (map_time == DEFAULT_TIME) - break; - - { - time_t sum_time; - - while (true) { - sum_time = ecl_sum_get_report_time( ecl_sum , sum_index ); - - if (sum_time > map_time) { - int day,month,year; - util_set_date_values_utc( map_time , &day , &month , &year); - util_abort("%s: The eclipse summary cases is missing data for date:%02d/%02d/%4d - aborting\n", __func__ , day , month , year); - } else if (sum_time < map_time) { - sum_index++; - if (sum_index > ecl_sum_get_last_report_step( ecl_sum )) - break; - } else - break; - - } - - if (sum_time == map_time) - int_vector_iset( index_map , time_map_index , sum_index); - else { - ert_log_add_message(1 , NULL , "Inconsistency in time_map - data will be ignored" , false); - break; - } - - - time_map_index++; - if (time_map_index == time_map_get_size( map )) - break; - - } - } - } - pthread_rwlock_unlock( &map->rw_lock ); - - return index_map; -} - - - diff --git a/ThirdParty/Ert/libenkf/src/trans_errf.m b/ThirdParty/Ert/libenkf/src/trans_errf.m deleted file mode 100644 index f88965d8ad..0000000000 --- a/ThirdParty/Ert/libenkf/src/trans_errf.m +++ /dev/null @@ -1,3 +0,0 @@ -function y = trans_errf(x , min , max , skewness , width) - -y = min + (max - min) * 0.5*(1 + erf((x + skewness)/(width * sqrt(2.0)))); diff --git a/ThirdParty/Ert/libenkf/src/trans_func.c b/ThirdParty/Ert/libenkf/src/trans_func.c deleted file mode 100644 index bb6dbe499d..0000000000 --- a/ThirdParty/Ert/libenkf/src/trans_func.c +++ /dev/null @@ -1,416 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'trans_func.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - -#include -#include -#include - -#include - - - - - - -struct trans_func_struct { - char * name; /* The name this function is registered as. */ - arg_pack_type * params; /* The parameter values registered for this function. */ - transform_ftype * func; /* A pointer to the actual transformation function. */ - validate_ftype * validate; /* A pointer to a a function which can be used to validate the parameters - can be NULL. */ - stringlist_type * param_names; /* A list of the parameter names. */ - bool use_log; -}; - - - - - - -/** - Width = 1 => uniform - Width > 1 => unimodal peaked - Width < 1 => bimoal peaks - - - Skewness < 0 => shifts towards the left - Skewness = 0 => symmetric - Skewness > 0 => Shifts towards the right - - The width is a relavant scale for the value of skewness. -*/ - -static double trans_errf(double x, const arg_pack_type * arg) { - double min = arg_pack_iget_double(arg , 0); - double max = arg_pack_iget_double(arg , 1); - double skewness = arg_pack_iget_double(arg , 2); - double width = arg_pack_iget_double(arg , 3); - double y; - - y = 0.5*(1 + erf((x + skewness)/(width * sqrt(2.0)))); - return min + y * (max - min); -} - - - - -static double trans_const(double x , const arg_pack_type * arg) { - return arg_pack_iget_double(arg , 0); -} - - -static double trans_raw(double x , const arg_pack_type * arg) { - return x; -} - - - -/* Observe that the argument of the shift should be "+" */ -static double trans_derrf(double x , const arg_pack_type * arg) { - int steps = arg_pack_iget_int(arg , 0); - double min = arg_pack_iget_double(arg , 1); - double max = arg_pack_iget_double(arg , 2); - double skewness = arg_pack_iget_double(arg , 3); - double width = arg_pack_iget_double(arg , 4); - double y; - - y = floor( steps * 0.5*(1 + erf((x + skewness)/(width * sqrt(2.0)))) / (steps - 1) ); - return min + y * (max - min); -} - - - - - -static double trans_unif(double x , const arg_pack_type * arg) { - double y; - double min = arg_pack_iget_double(arg , 0); - double max = arg_pack_iget_double(arg , 1); - y = 0.5*(1 + erf(x/sqrt(2.0))); /* 0 - 1 */ - return y * (max - min) + min; -} - - - -static double trans_dunif(double x , const arg_pack_type * arg) { - double y; - int steps = arg_pack_iget_int(arg , 0); - double min = arg_pack_iget_double(arg , 1); - double max = arg_pack_iget_double(arg , 2); - - y = 0.5*(1 + erf(x/sqrt(2.0))); /* 0 - 1 */ - return (floor( y * steps) / (steps - 1)) * (max - min) + min; -} - - - - -static double trans_normal(double x , const arg_pack_type * arg) { - double mu , std; - mu = arg_pack_iget_double(arg , 0 ); - std = arg_pack_iget_double(arg , 1 ); - return x * std + mu; -} - - -static double trans_truncated_normal(double x , const arg_pack_type * arg) { - double mu , std , min , max; - - mu = arg_pack_iget_double(arg , 0 ); - std = arg_pack_iget_double(arg , 1 ); - min = arg_pack_iget_double(arg , 2 ); - max = arg_pack_iget_double(arg , 3 ); - - { - double y = x * std + mu; - util_clamp_double( &y , min , max ); - return y; - } -} - - - - -static double trans_lognormal(double x, const arg_pack_type * arg) { - double mu, std; - mu = arg_pack_iget_double(arg , 0 ); /* The expectation of log( y ) */ - std = arg_pack_iget_double(arg , 1 ); - return exp(x * std + mu); -} - - - -/** - Used to sample values between min and max - BUT it is the logarithm - of y which is uniformly distributed. Relates to the uniform - distribution in the same manner as the lognormal distribution - relates to the normal distribution. -*/ -static double trans_logunif(double x , const arg_pack_type * arg) { - double log_min = log(arg_pack_iget_double(arg , 0)); - double log_max = log(arg_pack_iget_double(arg , 1)); - double log_y; - { - double tmp = 0.5*(1 + erf(x/sqrt(2.0))); /* 0 - 1 */ - log_y = log_min + tmp * (log_max - log_min); /* Shift according to max / min */ - } - return exp(log_y); -} - - - -/*****************************************************************/ - -static trans_func_type * trans_func_alloc_empty( const char * func_name ) { - trans_func_type * trans_func = util_malloc( sizeof * trans_func ); - - - trans_func->params = arg_pack_alloc(); - trans_func->func = NULL; - trans_func->validate = NULL; - trans_func->name = util_alloc_string_copy( func_name ); - trans_func->param_names = stringlist_alloc_new(); - trans_func->use_log = false; - - return trans_func; -} - - -const char * trans_func_get_name( const trans_func_type * trans_func ) { - return trans_func->name; -} - - -const stringlist_type * trans_func_get_param_names( const trans_func_type * trans_func ) { - return trans_func->param_names; -} - -node_ctype trans_func_iget_param_ctype( const trans_func_type * trans_func , int param_index) { - return arg_pack_iget_ctype( trans_func->params , param_index); -} - - -void trans_func_iset_double_param(trans_func_type * trans_func , int param_index , double value ) { - if (arg_pack_iget_ctype( trans_func->params , param_index) == CTYPE_DOUBLE_VALUE) - arg_pack_iset_double( trans_func->params , param_index , value ); - else - util_abort("%s: type mismatch - the does not expect double as argument:%d \n",__func__ , param_index ); -} - -/** - Return true if the _set operation suceeded (i.e. the name was - recognized), and false otherwise. -*/ -bool trans_func_set_double_param( trans_func_type * trans_func , const char * param_name , double value ) { - int param_index = stringlist_find_first( trans_func->param_names , param_name); - if (param_index >= 0) { - arg_pack_iset_double( trans_func->params , param_index , value ); - return true; - } else - return false; -} - - -void trans_func_iset_int_param(trans_func_type * trans_func , int param_index , int value ) { - if (arg_pack_iget_ctype( trans_func->params , param_index) == CTYPE_INT_VALUE) - arg_pack_iset_int( trans_func->params , param_index , value ); - else - util_abort("%s: type mismatch - the does not expect int as argument:%d \n",__func__ , param_index ); -} - -/** - Return true if the _set operation suceeded (i.e. the name was - recognized), and false otherwise. -*/ -bool trans_func_set_int_param( trans_func_type * trans_func , const char * param_name , int value ) { - int param_index = stringlist_find_first( trans_func->param_names , param_name); - if (param_index >= 0) { - arg_pack_iset_int( trans_func->params , param_index , value ); - return true; - } else - return false; -} - - - -void trans_func_free( trans_func_type * trans_func ) { - stringlist_free( trans_func->param_names ); - arg_pack_free( trans_func->params ); - util_safe_free( trans_func->name ); - free( trans_func ); -} - - - - -/** - It is import to append all the parameters (with arbitrary values), - to ensure that the arg_pack registers the right type. -*/ - - -trans_func_type * trans_func_alloc( const char * func_name ) { - trans_func_type * trans_func = trans_func_alloc_empty( func_name ); - { - if (util_string_equal(func_name , "NORMAL")) { - stringlist_append_ref( trans_func->param_names , "MEAN"); - stringlist_append_ref( trans_func->param_names , "STD" ); - arg_pack_append_double( trans_func->params , 0 ); - arg_pack_append_double( trans_func->params , 0 ); - trans_func->func = trans_normal; - } - - if (util_string_equal( func_name , "LOGNORMAL")) { - stringlist_append_ref( trans_func->param_names , "MEAN"); - stringlist_append_ref( trans_func->param_names , "STD" ); - arg_pack_append_double( trans_func->params , 0 ); - arg_pack_append_double( trans_func->params , 0 ); - trans_func->func = trans_lognormal; - trans_func->use_log = true; - } - - if (util_string_equal( func_name , "TRUNCATED_NORMAL")) { - stringlist_append_ref( trans_func->param_names , "MEAN"); - stringlist_append_ref( trans_func->param_names , "STD" ); - stringlist_append_ref( trans_func->param_names , "MIN"); - stringlist_append_ref( trans_func->param_names , "MAX" ); - - arg_pack_append_double( trans_func->params , 0 ); - arg_pack_append_double( trans_func->params , 0 ); - arg_pack_append_double( trans_func->params , 0 ); - arg_pack_append_double( trans_func->params , 0 ); - trans_func->func = trans_truncated_normal; - } - - - if (util_string_equal( func_name , "UNIFORM")) { - stringlist_append_ref( trans_func->param_names , "MIN"); - stringlist_append_ref( trans_func->param_names , "MAX" ); - arg_pack_append_double( trans_func->params , 0 ); - arg_pack_append_double( trans_func->params , 0 ); - trans_func->func = trans_unif; - } - - - if (util_string_equal( func_name , "DUNIF")) { - stringlist_append_ref( trans_func->param_names , "STEPS"); - stringlist_append_ref( trans_func->param_names , "MIN"); - stringlist_append_ref( trans_func->param_names , "MAX" ); - arg_pack_append_int( trans_func->params , 0 ); - arg_pack_append_double( trans_func->params , 0 ); - arg_pack_append_double( trans_func->params , 0 ); - - trans_func->func = trans_dunif; - } - - - if (util_string_equal( func_name , "ERRF")) { - stringlist_append_ref( trans_func->param_names , "MIN"); - stringlist_append_ref( trans_func->param_names , "MAX" ); - stringlist_append_ref( trans_func->param_names , "SKEWNESS"); - stringlist_append_ref( trans_func->param_names , "WIDTH" ); - arg_pack_append_double( trans_func->params , 0 ); - arg_pack_append_double( trans_func->params , 0 ); - arg_pack_append_double( trans_func->params , 0 ); - arg_pack_append_double( trans_func->params , 0 ); - - trans_func->func = trans_errf; - } - - - if (util_string_equal( func_name , "DERRF")) { - stringlist_append_ref( trans_func->param_names , "STEPS"); - stringlist_append_ref( trans_func->param_names , "MIN"); - stringlist_append_ref( trans_func->param_names , "MAX" ); - stringlist_append_ref( trans_func->param_names , "SKEWNESS"); - stringlist_append_ref( trans_func->param_names , "WIDTH" ); - arg_pack_append_int( trans_func->params , 0 ); - arg_pack_append_double( trans_func->params , 0 ); - arg_pack_append_double( trans_func->params , 0 ); - arg_pack_append_double( trans_func->params , 0 ); - arg_pack_append_double( trans_func->params , 0 ); - - trans_func->func = trans_derrf; - } - - - if (util_string_equal( func_name , "LOGUNIF")) { - stringlist_append_ref( trans_func->param_names , "MIN"); - stringlist_append_ref( trans_func->param_names , "MAX" ); - - arg_pack_append_double( trans_func->params , 0 ); - arg_pack_append_double( trans_func->params , 0 ); - trans_func->func = trans_logunif; - trans_func->use_log = true; - } - - - if (util_string_equal( func_name , "CONST")) { - stringlist_append_ref( trans_func->param_names , "VALUE"); - arg_pack_append_double( trans_func->params , 0 ); - trans_func->func = trans_const; - } - - - if (util_string_equal( func_name , "RAW")) { - trans_func->func = trans_raw; - } - - - if (trans_func->func == NULL) - util_exit("%s: Sorry: function name:%s not recognized \n",__func__ , func_name); - } - return trans_func; -} - - - -double trans_func_eval( const trans_func_type * trans_func , double x) { - double y = trans_func->func( x , trans_func->params ); - return y; -} - -bool trans_func_use_log_scale(const trans_func_type * trans_func) { - return trans_func->use_log; -} - - - -trans_func_type * trans_func_fscanf_alloc( FILE * stream, const char * filename ) { - trans_func_type * trans_func; - char * func_name; - - func_name = util_fscanf_alloc_token(stream); - - - if (func_name == NULL) { - fprintf(stderr,"Problem at file:line: %s:%d \n", filename, util_get_current_linenr( stream )); - util_abort("%s: could not locate name of transformation - aborting \n",__func__); - } - - trans_func = trans_func_alloc( func_name ); - arg_pack_fscanf( trans_func->params , stream, filename ); - - free( func_name ); - return trans_func; -} - diff --git a/ThirdParty/Ert/libenkf/src/trans_test.m b/ThirdParty/Ert/libenkf/src/trans_test.m deleted file mode 100644 index 83ff575003..0000000000 --- a/ThirdParty/Ert/libenkf/src/trans_test.m +++ /dev/null @@ -1,12 +0,0 @@ -%% This is matlab file used to test/vizualize the various -%% distributions in trans_func.c - -N = 100000; -x = random('normal',0 , 1 , N ,1); - - - -y = trans_errf(x , 0.1 , 15 , -3 , 2.0); - -disp(sprintf(' = %g' , mean(y))); -hist(y , sqrt(N)) diff --git a/ThirdParty/Ert/libenkf/tests/CMakeLists.txt b/ThirdParty/Ert/libenkf/tests/CMakeLists.txt deleted file mode 100644 index 4f220dc920..0000000000 --- a/ThirdParty/Ert/libenkf/tests/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -include( tests.cmake ) -if (STATOIL_TESTDATA_ROOT) - include( statoil_tests.cmake ) -endif() diff --git a/ThirdParty/Ert/libenkf/tests/data/config/analysis_load_config b/ThirdParty/Ert/libenkf/tests/data/config/analysis_load_config deleted file mode 100644 index 657ba148c3..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/analysis_load_config +++ /dev/null @@ -1 +0,0 @@ -NUM_REALIZATIONS 3 diff --git a/ThirdParty/Ert/libenkf/tests/data/config/analysis_load_site_config b/ThirdParty/Ert/libenkf/tests/data/config/analysis_load_site_config deleted file mode 100644 index c7be2f143e..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/analysis_load_site_config +++ /dev/null @@ -1,2 +0,0 @@ -ANALYSIS_LOAD RML_ENKF_SITE_CONFIG1 rml_enkf.so -ANALYSIS_LOAD RML_ENKF_SITE_CONFIG2 rml_enkf.so diff --git a/ThirdParty/Ert/libenkf/tests/data/config/ert_report_list b/ThirdParty/Ert/libenkf/tests/data/config/ert_report_list deleted file mode 100644 index 270780b1f1..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/ert_report_list +++ /dev/null @@ -1,3 +0,0 @@ -REPORT_TIMEOUT 167 - -REPORT_LARGE TRUE \ No newline at end of file diff --git a/ThirdParty/Ert/libenkf/tests/data/config/forward/ert/FAULT_TEMPLATE b/ThirdParty/Ert/libenkf/tests/data/config/forward/ert/FAULT_TEMPLATE deleted file mode 100644 index de1f12ca5b..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/forward/ert/FAULT_TEMPLATE +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ThirdParty/Ert/libenkf/tests/data/config/forward/ert/MULTFLT.TXT b/ThirdParty/Ert/libenkf/tests/data/config/forward/ert/MULTFLT.TXT deleted file mode 100644 index c193c48528..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/forward/ert/MULTFLT.TXT +++ /dev/null @@ -1 +0,0 @@ -MULTFLT NORMAL 0 1 diff --git a/ThirdParty/Ert/libenkf/tests/data/config/forward/ert/config_GEN_KW_false b/ThirdParty/Ert/libenkf/tests/data/config/forward/ert/config_GEN_KW_false deleted file mode 100644 index d66f17444a..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/forward/ert/config_GEN_KW_false +++ /dev/null @@ -1,8 +0,0 @@ -JOBNAME Job%d -RUNPATH simulations/run%d -NUM_REALIZATIONS 1 - -ENSPATH Storage -JOB_SCRIPT script.sh - -GEN_KW MULTFLT FAULT_TEMPLATE MULTFLT.INC MULTFLT.TXT INIT_FILES:MULTFLT_INIT diff --git a/ThirdParty/Ert/libenkf/tests/data/config/forward/ert/config_GEN_KW_true b/ThirdParty/Ert/libenkf/tests/data/config/forward/ert/config_GEN_KW_true deleted file mode 100644 index cd6b539bbb..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/forward/ert/config_GEN_KW_true +++ /dev/null @@ -1,10 +0,0 @@ -JOBNAME Job%d -RUNPATH simulations/run%d -NUM_REALIZATIONS 1 - -ENSPATH Storage -JOB_SCRIPT script.sh - -GEN_KW MULTFLT FAULT_TEMPLATE MULTFLT.INC MULTFLT.TXT INIT_FILES:MULTFLT_INIT FORWARD_INIT:TRUE - - diff --git a/ThirdParty/Ert/libenkf/tests/data/config/forward/ert/config_GEN_PARAM_false b/ThirdParty/Ert/libenkf/tests/data/config/forward/ert/config_GEN_PARAM_false deleted file mode 100644 index 4454bbab15..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/forward/ert/config_GEN_PARAM_false +++ /dev/null @@ -1,9 +0,0 @@ -JOBNAME Job%d -RUNPATH simulations/run%d -NUM_REALIZATIONS 1 - -ENSPATH Storage -JOB_SCRIPT script.sh - - -GEN_PARAM PARAM PARAM.INC INIT_FILES:PARAM_INIT INPUT_FORMAT:ASCII OUTPUT_FORMAT:ASCII \ No newline at end of file diff --git a/ThirdParty/Ert/libenkf/tests/data/config/forward/ert/config_GEN_PARAM_true b/ThirdParty/Ert/libenkf/tests/data/config/forward/ert/config_GEN_PARAM_true deleted file mode 100644 index 6ba8d1c4f4..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/forward/ert/config_GEN_PARAM_true +++ /dev/null @@ -1,10 +0,0 @@ -JOBNAME Job%d -RUNPATH simulations/run%d -NUM_REALIZATIONS 1 - -ENSPATH Storage -JOB_SCRIPT script.sh - - -GEN_PARAM PARAM PARAM.INC INIT_FILES:PARAM_INIT INPUT_FORMAT:ASCII OUTPUT_FORMAT:ASCII FORWARD_INIT:TRUE - diff --git a/ThirdParty/Ert/libenkf/tests/data/config/forward/ert/script.sh b/ThirdParty/Ert/libenkf/tests/data/config/forward/ert/script.sh deleted file mode 100644 index 2f92a600cf..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/forward/ert/script.sh +++ /dev/null @@ -1 +0,0 @@ -# Completlely stupid - an executable must be present for the testing. diff --git a/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_logarithmic/FAULT_TEMPLATE b/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_logarithmic/FAULT_TEMPLATE deleted file mode 100644 index de1f12ca5b..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_logarithmic/FAULT_TEMPLATE +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_logarithmic/FAULT_TEMPLATE2 b/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_logarithmic/FAULT_TEMPLATE2 deleted file mode 100644 index bb7d23f1dd..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_logarithmic/FAULT_TEMPLATE2 +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_logarithmic/MULTFLT.TXT b/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_logarithmic/MULTFLT.TXT deleted file mode 100644 index ec7d5e43ed..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_logarithmic/MULTFLT.TXT +++ /dev/null @@ -1 +0,0 @@ -MULTFLT LOGUNIF 0.0001 0.01 diff --git a/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_logarithmic/MULTFLT2.TXT b/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_logarithmic/MULTFLT2.TXT deleted file mode 100644 index d2f6e43865..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_logarithmic/MULTFLT2.TXT +++ /dev/null @@ -1 +0,0 @@ -MULTFLT2 LOGUNIF 0.0000001 0.00001 diff --git a/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_logarithmic/config_GEN_KW_logarithmic b/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_logarithmic/config_GEN_KW_logarithmic deleted file mode 100644 index 8075af97a6..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_logarithmic/config_GEN_KW_logarithmic +++ /dev/null @@ -1,9 +0,0 @@ -JOBNAME Job%d -RUNPATH simulations/run%d -NUM_REALIZATIONS 1 - -ENSPATH Storage -JOB_SCRIPT script.sh - -GEN_KW MULTFLT FAULT_TEMPLATE MULTFLT.INC MULTFLT.TXT -GEN_KW MULTFLT2 FAULT_TEMPLATE2 MULTFLT2.INC MULTFLT2.TXT diff --git a/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_logarithmic/script.sh b/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_logarithmic/script.sh deleted file mode 100644 index 2f92a600cf..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_logarithmic/script.sh +++ /dev/null @@ -1 +0,0 @@ -# Completlely stupid - an executable must be present for the testing. diff --git a/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_plot/Parameters.txt b/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_plot/Parameters.txt deleted file mode 100644 index ba7f5b2386..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_plot/Parameters.txt +++ /dev/null @@ -1,5 +0,0 @@ -PARAM1 CONST 100 -PARAM2 UNIFORM 0 1 -PARAM3 LOGUNIF 0.001 1000 -PARAM4 LOGNORMAL 0.25 100 - diff --git a/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_plot/Template.tmpl b/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_plot/Template.tmpl deleted file mode 100644 index ff8e16240d..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_plot/Template.tmpl +++ /dev/null @@ -1 +0,0 @@ --- Template; not used \ No newline at end of file diff --git a/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_plot/config b/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_plot/config deleted file mode 100644 index f043581fe5..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/gen_kw_plot/config +++ /dev/null @@ -1,2 +0,0 @@ -NUM_REALIZATIONS 25 -GEN_KW GEN_KW Template.tmpl Target.inc Parameters.txt \ No newline at end of file diff --git a/ThirdParty/Ert/libenkf/tests/data/config/rng b/ThirdParty/Ert/libenkf/tests/data/config/rng deleted file mode 100644 index ad8ee50cb1..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/rng +++ /dev/null @@ -1,6 +0,0 @@ -NUM_REALIZATIONS 25 -STORE_SEED seed2 -LOAD_SEED seed2 - --- The settings below here are artifacts which should not be necessary ... -JOB_SCRIPT script.sh diff --git a/ThirdParty/Ert/libenkf/tests/data/config/runpath_list/ARGECHO_JOB b/ThirdParty/Ert/libenkf/tests/data/config/runpath_list/ARGECHO_JOB deleted file mode 100644 index 9cd8129c85..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/runpath_list/ARGECHO_JOB +++ /dev/null @@ -1,2 +0,0 @@ -INTERNAL FALSE -EXECUTABLE arg_echo.sh diff --git a/ThirdParty/Ert/libenkf/tests/data/config/runpath_list/ARGECHO_WF b/ThirdParty/Ert/libenkf/tests/data/config/runpath_list/ARGECHO_WF deleted file mode 100644 index 2eef71ca9b..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/runpath_list/ARGECHO_WF +++ /dev/null @@ -1 +0,0 @@ -ARGECHO_JOB runpath_list.txt \ No newline at end of file diff --git a/ThirdParty/Ert/libenkf/tests/data/config/runpath_list/arg_echo.sh b/ThirdParty/Ert/libenkf/tests/data/config/runpath_list/arg_echo.sh deleted file mode 100644 index e7fffa0c13..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/runpath_list/arg_echo.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -echo $1 > $2 diff --git a/ThirdParty/Ert/libenkf/tests/data/config/runpath_list/config b/ThirdParty/Ert/libenkf/tests/data/config/runpath_list/config deleted file mode 100644 index ded46130bb..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/runpath_list/config +++ /dev/null @@ -1,5 +0,0 @@ -RUNPATH_FILE runpath/runpath-file.txt -NUM_REALIZATIONS 10 - -LOAD_WORKFLOW_JOB ARGECHO_JOB -LOAD_WORKFLOW ARGECHO_WF diff --git a/ThirdParty/Ert/libenkf/tests/data/config/script.sh b/ThirdParty/Ert/libenkf/tests/data/config/script.sh deleted file mode 100644 index de495719f7..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/script.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -#Dummy script \ No newline at end of file diff --git a/ThirdParty/Ert/libenkf/tests/data/config/test_context/FAULT_TEMPLATE b/ThirdParty/Ert/libenkf/tests/data/config/test_context/FAULT_TEMPLATE deleted file mode 100644 index de1f12ca5b..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/test_context/FAULT_TEMPLATE +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ThirdParty/Ert/libenkf/tests/data/config/test_context/MULTFLT.TXT b/ThirdParty/Ert/libenkf/tests/data/config/test_context/MULTFLT.TXT deleted file mode 100644 index c193c48528..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/test_context/MULTFLT.TXT +++ /dev/null @@ -1 +0,0 @@ -MULTFLT NORMAL 0 1 diff --git a/ThirdParty/Ert/libenkf/tests/data/config/test_context/config b/ThirdParty/Ert/libenkf/tests/data/config/test_context/config deleted file mode 100644 index 7e702c6b14..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/test_context/config +++ /dev/null @@ -1,11 +0,0 @@ -JOBNAME Job%d -RUNPATH simulations/run%d -NUM_REALIZATIONS 1 - -ENSPATH Storage -JOB_SCRIPT script.sh - -GEN_KW MULTFLT FAULT_TEMPLATE MULTFLT.INC MULTFLT.TXT INIT_FILES:MULTFLT_INIT FORWARD_INIT:TRUE - - -SUMMARY RPR:8 diff --git a/ThirdParty/Ert/libenkf/tests/data/config/test_context/script.sh b/ThirdParty/Ert/libenkf/tests/data/config/test_context/script.sh deleted file mode 100644 index 2f92a600cf..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/test_context/script.sh +++ /dev/null @@ -1 +0,0 @@ -# Completlely stupid - an executable must be present for the testing. diff --git a/ThirdParty/Ert/libenkf/tests/data/config/test_context/wf_job b/ThirdParty/Ert/libenkf/tests/data/config/test_context/wf_job deleted file mode 100644 index ed3a5838fb..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/test_context/wf_job +++ /dev/null @@ -1,5 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_select_case_JOB -MIN_ARG 1 -MAX_ARG 1 -ARG_TYPE 0 STRING diff --git a/ThirdParty/Ert/libenkf/tests/data/config/test_context/wf_job_fail b/ThirdParty/Ert/libenkf/tests/data/config/test_context/wf_job_fail deleted file mode 100644 index b8d5206384..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/config/test_context/wf_job_fail +++ /dev/null @@ -1,5 +0,0 @@ -INTERNAL True -FUNCTION unknown_function__ -MIN_ARG 1 -MAX_ARG 1 -ARG_TYPE 0 STRING diff --git a/ThirdParty/Ert/libenkf/tests/data/ensemble/GEN_PARAM b/ThirdParty/Ert/libenkf/tests/data/ensemble/GEN_PARAM deleted file mode 100644 index 8f2fdaa749..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/ensemble/GEN_PARAM +++ /dev/null @@ -1 +0,0 @@ -GEN_PARAM GP GP.txt INIT_FILES:GP/GP.txt INPUT_FORMAT:ASCII OUTPUT_FORMAT:ASCII \ No newline at end of file diff --git a/ThirdParty/Ert/libenkf/tests/data/workflow_jobs/CONF1 b/ThirdParty/Ert/libenkf/tests/data/workflow_jobs/CONF1 deleted file mode 100644 index c42a844b29..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/workflow_jobs/CONF1 +++ /dev/null @@ -1,5 +0,0 @@ -INTERNAL True -FUNCTION util_malloc -MIN_ARG 1 -MAX_ARG 1 -ARG_TYPE 0 FLOAT diff --git a/ThirdParty/Ert/libenkf/tests/data/workflow_jobs/CONF2 b/ThirdParty/Ert/libenkf/tests/data/workflow_jobs/CONF2 deleted file mode 100644 index f07a3cc4ab..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/workflow_jobs/CONF2 +++ /dev/null @@ -1,2 +0,0 @@ -This should not be loaded; -instead the CONF2@1 should be loaded in testing. \ No newline at end of file diff --git a/ThirdParty/Ert/libenkf/tests/data/workflow_jobs/CONF2@1 b/ThirdParty/Ert/libenkf/tests/data/workflow_jobs/CONF2@1 deleted file mode 100644 index c42a844b29..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/workflow_jobs/CONF2@1 +++ /dev/null @@ -1,5 +0,0 @@ -INTERNAL True -FUNCTION util_malloc -MIN_ARG 1 -MAX_ARG 1 -ARG_TYPE 0 FLOAT diff --git a/ThirdParty/Ert/libenkf/tests/data/workflow_jobs/CONF3@1.2.3 b/ThirdParty/Ert/libenkf/tests/data/workflow_jobs/CONF3@1.2.3 deleted file mode 100644 index c42a844b29..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/workflow_jobs/CONF3@1.2.3 +++ /dev/null @@ -1,5 +0,0 @@ -INTERNAL True -FUNCTION util_malloc -MIN_ARG 1 -MAX_ARG 1 -ARG_TYPE 0 FLOAT diff --git a/ThirdParty/Ert/libenkf/tests/data/workflow_jobs/CONF4@1.2.0 b/ThirdParty/Ert/libenkf/tests/data/workflow_jobs/CONF4@1.2.0 deleted file mode 100644 index c42a844b29..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/workflow_jobs/CONF4@1.2.0 +++ /dev/null @@ -1,5 +0,0 @@ -INTERNAL True -FUNCTION util_malloc -MIN_ARG 1 -MAX_ARG 1 -ARG_TYPE 0 FLOAT diff --git a/ThirdParty/Ert/libenkf/tests/data/workflow_jobs/CONF5@1.2 b/ThirdParty/Ert/libenkf/tests/data/workflow_jobs/CONF5@1.2 deleted file mode 100644 index c42a844b29..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/workflow_jobs/CONF5@1.2 +++ /dev/null @@ -1,5 +0,0 @@ -INTERNAL True -FUNCTION util_malloc -MIN_ARG 1 -MAX_ARG 1 -ARG_TYPE 0 FLOAT diff --git a/ThirdParty/Ert/libenkf/tests/data/workflow_jobs/CONF5@1.2.0 b/ThirdParty/Ert/libenkf/tests/data/workflow_jobs/CONF5@1.2.0 deleted file mode 100644 index b138beb40a..0000000000 --- a/ThirdParty/Ert/libenkf/tests/data/workflow_jobs/CONF5@1.2.0 +++ /dev/null @@ -1 +0,0 @@ -Wrong .... diff --git a/ThirdParty/Ert/libenkf/tests/enkf_active_list.c b/ThirdParty/Ert/libenkf/tests/enkf_active_list.c deleted file mode 100644 index 9e647d0d85..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_active_list.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_active_list.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include - -#include - - - -int main(int argc , char ** argv) { - active_list_type * active_list1 = active_list_alloc( ); - active_list_type * active_list2 = active_list_alloc( ); - - - test_assert_true( active_list_is_instance( active_list1 )); - - test_assert_true( active_list_equal( active_list1 , active_list2 )); - - active_list_add_index( active_list1 , 11 ); - test_assert_false(active_list_equal( active_list1 , active_list2 )); - - active_list_add_index( active_list1 , 12 ); - test_assert_false(active_list_equal( active_list1 , active_list2 )); - - active_list_add_index( active_list2 , 11 ); - test_assert_false(active_list_equal( active_list1 , active_list2 )); - - active_list_add_index( active_list2 , 12 ); - test_assert_true(active_list_equal( active_list1 , active_list2 )); - - active_list_add_index( active_list2 , 13 ); - test_assert_false(active_list_equal( active_list1 , active_list2 )); - - active_list_add_index( active_list1 , 13 ); - test_assert_true(active_list_equal( active_list1 , active_list2 )); - - active_list_add_index( active_list2 , 27 ); - test_assert_false(active_list_equal( active_list1 , active_list2 )); - active_list_copy( active_list1 , active_list2 ); - test_assert_true(active_list_equal( active_list1 , active_list2 )); - - active_list_free( active_list1 ); - active_list_free( active_list2 ); - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_analysis_config.c b/ThirdParty/Ert/libenkf/tests/enkf_analysis_config.c deleted file mode 100644 index fcf0d40e7a..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_analysis_config.c +++ /dev/null @@ -1,198 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_analysis_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include - - -analysis_config_type * create_analysis_config() { - rng_type * rng = rng_alloc( MZRAN , INIT_DEFAULT ); - analysis_config_type * ac = analysis_config_alloc( rng ); - return ac; -} - - -void test_create() { - analysis_config_type * ac = create_analysis_config( ); - test_assert_true( analysis_config_is_instance( ac ) ); - analysis_config_free( ac ); -} - - -void test_min_realizations(const char * num_realizations_str, const char * min_realizations_str, int min_realizations_expected_needed) { - test_work_area_type * work_area = test_work_area_alloc("test_min_realizations_string"); - - { - FILE * config_file_stream = util_mkdir_fopen("config_file", "w"); - test_assert_not_NULL(config_file_stream); - - fputs(num_realizations_str, config_file_stream); - fputs(min_realizations_str, config_file_stream); - fclose(config_file_stream); - - config_parser_type * c = config_alloc(); - config_schema_item_type * item = config_add_schema_item(c , NUM_REALIZATIONS_KEY , true ); - config_schema_item_set_default_type(item, CONFIG_INT); - config_schema_item_set_argc_minmax( item , 1 , 1); - - item = config_add_schema_item(c , MIN_REALIZATIONS_KEY , false ); - config_schema_item_set_argc_minmax( item , 1 , 2); - { - config_content_type * content = config_parse(c , "config_file" , "--" , NULL , NULL , NULL , false , true ); - test_assert_true(config_content_is_valid(content)); - - analysis_config_type * ac = create_analysis_config( ); - analysis_config_init(ac, content); - - int num_realizations = config_content_get_value_as_int(content, NUM_REALIZATIONS_KEY); - test_assert_false(analysis_config_have_enough_realisations(ac, min_realizations_expected_needed - 1, num_realizations )); - test_assert_true(analysis_config_have_enough_realisations(ac, min_realizations_expected_needed, num_realizations )); - test_assert_true(analysis_config_have_enough_realisations(ac, min_realizations_expected_needed + 1, num_realizations )); - analysis_config_free( ac ); - config_content_free( content ); - config_free( c ); - } - } - - test_work_area_free(work_area); -} - - -void test_have_enough_realisations_defaulted( ) { - analysis_config_type * ac = create_analysis_config( ); - int ensemble_size = 20; - - // min_realizations not set, should then require 20 (ensemble_size) - test_assert_false( analysis_config_have_enough_realisations( ac , 0, ensemble_size )); - test_assert_false( analysis_config_have_enough_realisations( ac , 10, ensemble_size )); - test_assert_true( analysis_config_have_enough_realisations( ac , 20, ensemble_size )); - - analysis_config_free( ac ); -} - - -void test_current_module_options() { - analysis_config_type * ac = create_analysis_config( ); - test_assert_NULL( analysis_config_get_active_module( ac )); - analysis_config_load_internal_module(ac , "STD_ENKF"); - - test_assert_false( analysis_config_get_module_option( ac , ANALYSIS_SCALE_DATA)); - test_assert_true(analysis_config_select_module(ac , "STD_ENKF")); - test_assert_false( analysis_config_select_module(ac , "DOES_NOT_EXIST")); - - test_assert_true( analysis_module_is_instance( analysis_config_get_active_module( ac ))); - test_assert_true( analysis_config_get_module_option( ac , ANALYSIS_SCALE_DATA)); - test_assert_false( analysis_config_get_module_option( ac , ANALYSIS_ITERABLE)); - analysis_config_free( ac ); -} - -void test_stop_long_running( ) { - analysis_config_type * ac = create_analysis_config( ); - test_assert_bool_equal( false , analysis_config_get_stop_long_running( ac ) ); - analysis_config_set_stop_long_running( ac , true ); - test_assert_bool_equal( true , analysis_config_get_stop_long_running( ac ) ); - analysis_config_free( ac ); -} - -void test_min_realizations_percent() { - { - const char * num_realizations_str = "NUM_REALIZATIONS 80\n"; - const char * min_realizations_str = "MIN_REALIZATIONS 10%\n"; - int min_realizations_expected_needed = 8; - test_min_realizations(num_realizations_str, min_realizations_str, min_realizations_expected_needed); - } - { - const char * num_realizations_str = "NUM_REALIZATIONS 8\n"; - const char * min_realizations_str = "MIN_REALIZATIONS 50%\n"; - int min_realizations_expected_needed = 4; - test_min_realizations(num_realizations_str, min_realizations_str, min_realizations_expected_needed ); - } - { - const char * num_realizations_str = "NUM_REALIZATIONS 8\n"; - const char * min_realizations_str = "MIN_REALIZATIONS 100%\n"; - int min_realizations_expected_needed = 8; - test_min_realizations(num_realizations_str, min_realizations_str, min_realizations_expected_needed ); - } - { - const char * num_realizations_str = "NUM_REALIZATIONS 8\n"; - const char * min_realizations_str = "MIN_REALIZATIONS 10%\n"; - int min_realizations_expected_needed = 8; // Expect 8 because 10 % of 8 will be calculated to zero. - test_min_realizations(num_realizations_str, min_realizations_str, min_realizations_expected_needed ); - } -} - -void test_min_realizations_number() { - { - const char * num_realizations_str = "NUM_REALIZATIONS 80\n"; - const char * min_realizations_str = "MIN_REALIZATIONS 0\n"; - int min_realizations_expected_needed = 80; - test_min_realizations(num_realizations_str, min_realizations_str, min_realizations_expected_needed); - } - { - const char * num_realizations_str = "NUM_REALIZATIONS 900\n"; - int min_realizations_expected_needed = 900; // Nothing specified, expect NUM_REALIZATIONS - test_min_realizations(num_realizations_str, "", min_realizations_expected_needed); - } - { - const char * num_realizations_str = "NUM_REALIZATIONS 900\n"; - const char * min_realizations_str = "MIN_REALIZATIONS 10 \n"; - int min_realizations_expected_needed = 10; - test_min_realizations(num_realizations_str, min_realizations_str, min_realizations_expected_needed); - } - { - const char * num_realizations_str = "NUM_REALIZATIONS 80\n"; - const char * min_realizations_str = "MIN_REALIZATIONS 50\n"; - int min_realizations_expected_needed = 50; - test_min_realizations(num_realizations_str, min_realizations_str, min_realizations_expected_needed); - } - { - const char * num_realizations_str = "NUM_REALIZATIONS 80\n"; - const char * min_realizations_str = "MIN_REALIZATIONS 80\n"; - int min_realizations_expected_needed = 80; - test_min_realizations(num_realizations_str, min_realizations_str, min_realizations_expected_needed); - } - { - const char * num_realizations_str = "NUM_REALIZATIONS 80\n"; - const char * min_realizations_str = "MIN_REALIZATIONS 100\n"; - int min_realizations_expected_needed = 80; - test_min_realizations(num_realizations_str, min_realizations_str, min_realizations_expected_needed); - } -} - -int main(int argc , char ** argv) { - test_create(); - test_have_enough_realisations_defaulted(); - test_min_realizations_percent(); - test_min_realizations_number(); - test_current_module_options(); - test_stop_long_running(); - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_analysis_config_analysis_load.c b/ThirdParty/Ert/libenkf/tests/enkf_analysis_config_analysis_load.c deleted file mode 100644 index 361e8fd1b6..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_analysis_config_analysis_load.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_analysis_config_analysis_load.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include -#include -#include - -#include -#include - -#include -#include - -int main(int argc , const char ** argv) { - util_install_signals(); - { - const char * config_file = argv[1]; - - ert_test_context_type * test_context = ert_test_context_alloc("AnalysisLoadFromSiteConfig" , config_file); - enkf_main_type * enkf_main = ert_test_context_get_main(test_context); - - test_assert_true(analysis_config_has_module(enkf_main_get_analysis_config(enkf_main), "RML_ENKF_SITE_CONFIG1")); - analysis_module_type * analysis_module = analysis_config_get_module(enkf_main_get_analysis_config(enkf_main), "RML_ENKF_SITE_CONFIG1"); - test_assert_string_equal(analysis_module_get_name(analysis_module), "RML_ENKF_SITE_CONFIG1"); - - test_assert_true(analysis_config_has_module(enkf_main_get_analysis_config(enkf_main), "RML_ENKF_SITE_CONFIG2")); - analysis_module_type * analysis_module2 = analysis_config_get_module(enkf_main_get_analysis_config(enkf_main), "RML_ENKF_SITE_CONFIG2"); - test_assert_string_equal(analysis_module_get_name(analysis_module2), "RML_ENKF_SITE_CONFIG2"); - - ert_test_context_free(test_context); - } -} - - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_analysis_config_ext_module.c b/ThirdParty/Ert/libenkf/tests/enkf_analysis_config_ext_module.c deleted file mode 100644 index 57b4fd6eb0..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_analysis_config_ext_module.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_analysis_config_ext_module.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include - - -void test_load_external_module( analysis_config_type * ac , const char * user_name , const char * lib_name) { - test_assert_true( analysis_config_load_external_module(ac , lib_name , user_name )); -} - - - -int main(int argc , char ** argv) { - rng_type * rng = rng_alloc(MZRAN , INIT_DEFAULT); - analysis_config_type * analysis_config = analysis_config_alloc(rng); - - for (int i = 1; i < argc; i+= 2) { - const char * user_name = argv[i]; - const char * lib_name = argv[i + 1]; - test_load_external_module( analysis_config , user_name , lib_name ); - } - - analysis_config_free(analysis_config); - rng_free( rng ); - exit(0); -} - - - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_analysis_update_job.c b/ThirdParty/Ert/libenkf/tests/enkf_analysis_update_job.c deleted file mode 100644 index 45e4b74955..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_analysis_update_job.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_analysis_update_job.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - - -void test_update_default(const char * config_file , const char * job_file) { - ert_test_context_type * test_context = ert_test_context_alloc("AnalysisJob0" , config_file); - - stringlist_type * args = stringlist_alloc_new(); - test_assert_true( ert_test_context_install_workflow_job( test_context , "JOB" , job_file )); - test_assert_true( ert_test_context_run_worklow_job( test_context , "JOB" , args) ); - stringlist_free( args ); - - ert_test_context_free( test_context ); -} - - -void test_update_new_case(const char * config_file , const char * job_file) { - ert_test_context_type * test_context = ert_test_context_alloc("AnalysisJob1" , config_file); - - stringlist_type * args = stringlist_alloc_new(); - stringlist_append_copy( args , "NewCase" ); - ert_test_context_install_workflow_job( test_context , "JOB" , job_file ); - test_assert_true( ert_test_context_run_worklow_job( test_context , "JOB" , args) ); - stringlist_free( args ); - - ert_test_context_free( test_context ); -} - - -void test_update_new_case_step(const char * config_file , const char * job_file) { - ert_test_context_type * test_context = ert_test_context_alloc("AnalysisJob2" , config_file); - - stringlist_type * args = stringlist_alloc_new(); - stringlist_append_copy( args , "NewCase" ); - stringlist_append_copy( args , "20" ); - ert_test_context_install_workflow_job( test_context , "JOB" , job_file ); - test_assert_true( ert_test_context_run_worklow_job( test_context , "JOB" , args) ); - stringlist_free( args ); - - ert_test_context_free( test_context ); -} - - -void test_update_new_case_step_selected(const char * config_file , const char * job_file) { - ert_test_context_type * test_context = ert_test_context_alloc("AnalysisJob2" , config_file ); - - stringlist_type * args = stringlist_alloc_new(); - stringlist_append_copy( args , "NewCase" ); - stringlist_append_copy( args , "20" ); - stringlist_append_copy( args , "10" ); - stringlist_append_copy( args , ",20" ); - stringlist_append_copy( args , ",30-50" ); - ert_test_context_install_workflow_job( test_context , "JOB" , job_file ); - test_assert_true( ert_test_context_run_worklow_job( test_context , "JOB" , args) ); - stringlist_free( args ); - - ert_test_context_free( test_context ); -} - - - -int main(int argc , char ** argv) { - const char * config_file = argv[1]; - const char * job_file = argv[2]; - - test_update_default( config_file , job_file); - test_update_new_case( config_file , job_file ); - test_update_new_case_step( config_file , job_file ); - test_update_new_case_step_selected( config_file , job_file ); - - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_block_obs.c b/ThirdParty/Ert/libenkf/tests/enkf_block_obs.c deleted file mode 100644 index 774470a7ff..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_block_obs.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_plot_blockdata.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include - -#include - -#include - -#include -#include -#include - - -void test_create_invalid_data(ecl_grid_type * grid) { - void * data_config = NULL; - test_assert_NULL(block_obs_alloc( "ObsKey" , data_config , grid )); -} - - - -void test_create_from_field(ecl_grid_type * grid) { - field_config_type * field_config = field_config_alloc_empty( "PRESSURE" , grid , NULL, false ); - block_obs_type * block_obs = block_obs_alloc( "ObsKey" , field_config , grid ); - - test_assert_true( block_obs_is_instance( block_obs )); - test_assert_int_equal(0 , block_obs_get_size( block_obs )); - block_obs_append_field_obs( block_obs , 10 , 12 , 8 , 100 , 25); - test_assert_int_equal(1 , block_obs_get_size( block_obs )); - block_obs_append_field_obs( block_obs , 10 , 12 , 9 , 100 , 25); - test_assert_int_equal(2 , block_obs_get_size( block_obs )); - block_obs_free( block_obs ); - field_config_free( field_config ); -} - - -void test_create_from_summary(ecl_grid_type * grid) { - container_config_type * container_config = container_config_alloc( "Container"); - block_obs_type * block_obs = block_obs_alloc( "ObsKey" , container_config , grid ); - - test_assert_true( block_obs_is_instance( block_obs )); - test_assert_int_equal(0 , block_obs_get_size( block_obs )); - - - block_obs_append_summary_obs( block_obs , 10 , 12 , 8 , "BPR:111,13,9" , 100 , 25); - test_assert_int_equal(1 , block_obs_get_size( block_obs )); - block_obs_append_summary_obs( block_obs , 10 , 12 , 9 , "BPR:11,13,10" , 100 , 25); - test_assert_int_equal(2 , block_obs_get_size( block_obs )); - block_obs_free( block_obs ); - - container_config_free( container_config ); -} - - - -int main (int argc , char ** argv) { - ecl_grid_type * grid = ecl_grid_alloc( argv[1] ); - { - test_create_invalid_data( grid ); - test_create_from_field(grid); - test_create_from_summary( grid); - } - ecl_grid_free( grid ); - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_cases_config.c b/ThirdParty/Ert/libenkf/tests/enkf_cases_config.c deleted file mode 100644 index 8063c00f41..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_cases_config.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_cases_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include - -#include - - -void test_create_get_set_and_get() { - cases_config_type * cases_config = cases_config_alloc( ); - test_assert_int_equal( 0, cases_config_get_iteration_number( cases_config ) ); - cases_config_set_int( cases_config , "iteration_number" , 12); - test_assert_int_equal( 12, cases_config_get_iteration_number( cases_config ) ); - cases_config_fwrite( cases_config , "TEST_CASES_CONFIG" ); - cases_config_fread( cases_config , "TEST_CASES_CONFIG" ); - cases_config_free( cases_config ); -} - -int main(int argc , char ** argv) { - test_create_get_set_and_get(); - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_config_node.c b/ThirdParty/Ert/libenkf/tests/enkf_config_node.c deleted file mode 100644 index ecec479dfe..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_config_node.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_config_node.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -#include - -#include -#include - - - - -int main(int argc , char ** argv) { - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_ecl_config.c b/ThirdParty/Ert/libenkf/tests/enkf_ecl_config.c deleted file mode 100644 index 39bdcfc341..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_ecl_config.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_ecl_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include - -#include -#include - -int main(int argc , char ** argv) { - ecl_config_type * ecl_config = ecl_config_alloc(); - - if (argc == 2) { - test_assert_true(ecl_config_load_refcase( ecl_config , argv[1])); - - ecl_refcase_list_type * refcase_list = ecl_config_get_refcase_list( ecl_config ); - test_assert_int_equal( ecl_refcase_list_get_size( refcase_list ) , 1 ); - { - const ecl_sum_type * iget0 = ecl_refcase_list_iget_case( refcase_list , 0 ); - const ecl_sum_type * def = ecl_refcase_list_get_default( refcase_list ); - - test_assert_ptr_equal( iget0 , def ); - test_assert_string_equal( argv[1] , ecl_sum_get_case( def )); - test_assert_string_equal( ecl_refcase_list_iget_pathcase( refcase_list , 0) , ecl_sum_get_case( def )); - - } - } - test_assert_false(ecl_config_load_refcase( ecl_config , "DOES_NOT_EXIST" )); - test_assert_true(ecl_config_load_refcase( ecl_config , NULL )); - - - - ecl_config_free( ecl_config ); - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_ecl_config_config.c b/ThirdParty/Ert/libenkf/tests/enkf_ecl_config_config.c deleted file mode 100644 index f108cb14fc..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_ecl_config_config.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_ecl_config_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include -#include - -int main(int argc , char ** argv) { - util_install_signals(); - { - const char * config_file = argv[1]; - ecl_config_type * ecl_config = ecl_config_alloc(); - ecl_refcase_list_type * refcase_list = ecl_config_get_refcase_list( ecl_config ); - { - config_parser_type * config = config_alloc(); - config_content_type * content; - - ecl_config_add_config_items( config ); - content = config_parse( config , config_file , "--" , NULL , NULL , NULL , CONFIG_UNRECOGNIZED_WARN , true); - - test_assert_true( config_content_is_valid( content )); - ecl_config_init( ecl_config , content ); - - config_content_free( content ); - config_free( config ); - } - - test_assert_true( ecl_config_has_refcase( ecl_config )); - test_assert_int_equal( ecl_refcase_list_get_size( refcase_list) , 17); - - ecl_config_free( ecl_config ); - } - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_enkf_config_node_gen_data.c b/ThirdParty/Ert/libenkf/tests/enkf_enkf_config_node_gen_data.c deleted file mode 100644 index 512762187a..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_enkf_config_node_gen_data.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_enkf_config_node_gen_data.c' is part of ERT - - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include - -#include - - -void test_create() { - enkf_config_node_type * node = enkf_config_node_alloc_GEN_PARAM("key" , false, ASCII , ASCII , "init%d" , "out.txt"); - enkf_config_node_free( node ); -} - - - -int main( int argc , char **argv ) { - test_create(); - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_ensemble.c b/ThirdParty/Ert/libenkf/tests/enkf_ensemble.c deleted file mode 100644 index 9979c1ce04..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_ensemble.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_ensemble.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#include - -#include -#include - - - - - - - -int main(int argc , char ** argv) { - ensemble_config_type * ensemble = ensemble_config_alloc(); - ensemble_config_free( ensemble ); - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_ensemble_GEN_PARAM.c b/ThirdParty/Ert/libenkf/tests/enkf_ensemble_GEN_PARAM.c deleted file mode 100644 index d6d884ab35..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_ensemble_GEN_PARAM.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_ensemble_GEN_PARAM.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include - -#include -#include - - - - - - - -int main(int argc , char ** argv) { - const char * config_file = argv[1]; - config_parser_type * config = config_alloc(); - config_content_type * content; - ensemble_config_type * ensemble = ensemble_config_alloc(); - - enkf_config_node_add_GEN_PARAM_config_schema( config ); - - content = config_parse( config , config_file , "--" , NULL , NULL , NULL , CONFIG_UNRECOGNIZED_WARN , true ); - test_assert_true( config_content_is_valid( content ) ); - - ensemble_config_init_GEN_PARAM( ensemble, content ); - - config_content_free( content ); - config_free( config ); - ensemble_config_free( ensemble ); - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_ensemble_config.c b/ThirdParty/Ert/libenkf/tests/enkf_ensemble_config.c deleted file mode 100644 index c4d3ca0d52..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_ensemble_config.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_gen_data_config_parse.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include -#include -#include -#include - -#include "ert/util/build_config.h" - -#include -#include - -#include - -void add_NULL_node( void * arg) { - ensemble_config_type * ens_config = ensemble_config_safe_cast( arg ); - ensemble_config_add_node( ens_config , NULL ); -} - - - -void test_abort_on_add_NULL() { - ensemble_config_type * ensemble_config = ensemble_config_alloc(); - - test_assert_true( ensemble_config_is_instance( ensemble_config )); - test_assert_util_abort("ensemble_config_add_node" , add_NULL_node , ensemble_config ); - - ensemble_config_free( ensemble_config ); -} - - -int main( int argc , char ** argv) { - test_abort_on_add_NULL(); - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_ert_run_context.c b/ThirdParty/Ert/libenkf/tests/enkf_ert_run_context.c deleted file mode 100644 index 6a8abf09b3..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_ert_run_context.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'ert_run_context.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include - -#include -#include -#include - -#include -#include -#include - -void test_create() { - bool_vector_type * iactive = bool_vector_alloc(10,true); - bool_vector_iset( iactive , 6 , false ); - bool_vector_iset( iactive , 8 , false ); - { - enkf_fs_type * init_fs = NULL; - subst_list_type * subst_list = subst_list_alloc( NULL ); - path_fmt_type * runpath_fmt = path_fmt_alloc_directory_fmt("/tmp/path/%04d"); - ert_init_context_type * context = ert_init_context_alloc( init_fs , iactive , runpath_fmt , subst_list , INIT_CONDITIONAL , 13 ); - - test_assert_true( ert_init_context_is_instance( context )); - test_assert_int_equal( 8 , ert_init_context_get_size( context )); - - { - run_arg_type * run_arg0 = ert_init_context_iget_arg( context , 0 ); - - test_assert_int_equal( 13 , run_arg_get_iter( run_arg0 )); - test_assert_string_equal( "/tmp/path/0000" , run_arg_get_runpath( run_arg0 )); - - test_assert_true( run_arg_is_instance( run_arg0 )); - } - ert_init_context_free( context ); - path_fmt_free( runpath_fmt ); - } - bool_vector_free( iactive ); -} - - -void test_create_ENSEMBLE_EXPERIMENT() { - bool_vector_type * iactive = bool_vector_alloc(10,true); - bool_vector_iset( iactive , 0 , false ); - bool_vector_iset( iactive , 8 , false ); - { - subst_list_type * subst_list = subst_list_alloc( NULL ); - path_fmt_type * runpath_fmt = path_fmt_alloc_directory_fmt("/tmp/path/%04d/%d"); - enkf_fs_type * fs = NULL; - ert_run_context_type * context = ert_run_context_alloc_ENSEMBLE_EXPERIMENT( fs, iactive , runpath_fmt , subst_list , 7 ); - - test_assert_true( ert_run_context_is_instance( context )); - test_assert_int_equal( 8 , ert_run_context_get_size( context )); - - { - run_arg_type * run_arg0 = ert_run_context_iens_get_arg( context , 0 ); - run_arg_type * run_arg2 = ert_run_context_iens_get_arg( context , 2 ); - run_arg_type * run_argi = ert_run_context_iget_arg( context , 1 ); - - test_assert_NULL( run_arg0 ); - test_assert_true( run_arg_is_instance( run_argi )); - test_assert_ptr_equal( run_arg2 , run_argi); - } - - { - run_arg_type * run_arg1 = ert_run_context_iget_arg( context , 1 ); - - test_assert_int_equal( 7 , run_arg_get_iter( run_arg1 )); - test_assert_string_equal( "/tmp/path/0002/7" , run_arg_get_runpath( run_arg1 )); - - test_assert_true( run_arg_is_instance( run_arg1 )); - } - ert_run_context_free( context ); - path_fmt_free( runpath_fmt ); - subst_list_free( subst_list ); - } - bool_vector_free( iactive ); -} - - - - -void test_iactive_update() { - bool_vector_type * iactive = bool_vector_alloc(10,true); - { - subst_list_type * subst_list = subst_list_alloc( NULL ); - path_fmt_type * runpath_fmt = path_fmt_alloc_directory_fmt("/tmp/path/%04d/%d"); - enkf_fs_type * fs = NULL; - ert_run_context_type * context = ert_run_context_alloc_ENSEMBLE_EXPERIMENT( fs, iactive , runpath_fmt , subst_list , 7 ); - - ert_run_context_deactivate_realization( context , 0 ); - ert_run_context_deactivate_realization( context , 5 ); - ert_run_context_deactivate_realization( context , 9 ); - - ert_run_context_free( context ); - path_fmt_free( runpath_fmt ); - subst_list_free( subst_list ); - } - test_assert_int_equal( bool_vector_count_equal( iactive , true ) , 7 ); - test_assert_false( bool_vector_iget( iactive , 0 )); - test_assert_false( bool_vector_iget( iactive , 5 )); - test_assert_false( bool_vector_iget( iactive , 9 )); - bool_vector_free( iactive ); -} - - -int main( int argc , char ** argv) { - test_create(); - test_create_ENSEMBLE_EXPERIMENT(); - test_iactive_update(); - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_ert_test_context.c b/ThirdParty/Ert/libenkf/tests/enkf_ert_test_context.c deleted file mode 100644 index fcf97ab688..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_ert_test_context.c +++ /dev/null @@ -1,153 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_ert_test_context.c' is part of ERT - Ensemble based - Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - - - -#include -#include - - - - -void test_create_invalid(const char * config_file) { - char * cwd0 = util_alloc_cwd(); - ert_test_context_type * test_context = ert_test_context_alloc("CREATE_CONTEXT" , config_file ); - test_assert_true( ert_test_context_is_instance( test_context )); - test_assert_NULL( ert_test_context_get_main( test_context )); - { - char * cwd1 = util_alloc_cwd(); - test_assert_string_equal(cwd1 , cwd0); - free( cwd1 ); - } - free( cwd0 ); - ert_test_context_free( test_context ); -} - - - -void test_create_valid( const char * config_file ) { - char * cwd0 = util_alloc_cwd(); - ert_test_context_type * test_context = ert_test_context_alloc("CREATE_CONTEXT" , config_file ); - test_assert_true( ert_test_context_is_instance( test_context )); - test_assert_true( enkf_main_is_instance( ert_test_context_get_main( test_context ))); - { - char * cwd1 = util_alloc_cwd(); - test_assert_string_not_equal(cwd1 , cwd0); - free( cwd1 ); - } - free( cwd0 ); - ert_test_context_free( test_context ); -} - - - -void test_install_job( const char * config_file, const char * job_file_OK , const char * job_file_ERROR) { - ert_test_context_type * test_context = ert_test_context_alloc("CREATE_CONTEXT_JOB" , config_file ); - - test_assert_false( ert_test_context_install_workflow_job( test_context , "JOB" , "File/does/not/exist")); - test_assert_false( ert_test_context_install_workflow_job( test_context , "ERROR" , job_file_ERROR)); - test_assert_true( ert_test_context_install_workflow_job( test_context , "OK" , job_file_OK)); - - ert_test_context_free( test_context ); -} - - - -void test_run_workflow_job( const char * config_file , const char * job_file ) { - ert_test_context_type * test_context = ert_test_context_alloc("CREATE_CONTEXT_JOB" , config_file ); - stringlist_type * args0 = stringlist_alloc_new( ); - stringlist_type * args1 = stringlist_alloc_new( ); - - stringlist_append_ref( args1 , "NewCase"); - test_assert_false( ert_test_context_run_worklow_job( test_context , "NO-this-does-not-exist" , args1)); - ert_test_context_install_workflow_job( test_context , "JOB" , job_file ); - - test_assert_false( ert_test_context_run_worklow_job( test_context , "JOB" , args0)); - test_assert_true( ert_test_context_run_worklow_job( test_context , "JOB" , args1)); - - stringlist_free( args0 ); - stringlist_free( args1 ); - ert_test_context_free( test_context ); -} - - -void test_install_workflow( const char * config_file , const char * job_file ) { - ert_test_context_type * test_context = ert_test_context_alloc("INSTALL_WORKFLOW" , config_file ); - const char * wf_file = "WFLOW"; - - ert_test_context_install_workflow_job( test_context , "JOB" , job_file ); - { - FILE * stream = util_fopen( wf_file , "w"); - stringlist_type * args = stringlist_alloc_new( ); - stringlist_append_ref( args , "NewCase"); - ert_test_context_fwrite_workflow_job( stream , "JOB" , args); - stringlist_free( args ); - fclose( stream ); - } - test_assert_true( ert_test_context_install_workflow( test_context , "WFLOW" , wf_file )); - ert_test_context_free( test_context ); -} - - -void test_run_workflow(const char * config_file , const char * job_file) { - ert_test_context_type * test_context = ert_test_context_alloc("INSTALL_WORKFLOW" , config_file ); - test_assert_false( ert_test_context_run_worklow( test_context , "No-does.not.exist")); - - ert_test_context_install_workflow_job( test_context , "JOB" , job_file ); - { - FILE * stream1 = util_fopen( "WFLOW1", "w"); - FILE * stream2 = util_fopen( "WFLOW2", "w"); - stringlist_type * args = stringlist_alloc_new( ); - ert_test_context_fwrite_workflow_job( stream1 , "JOB" , args); - stringlist_append_ref( args , "NewCase"); - ert_test_context_fwrite_workflow_job( stream2 , "JOB" , args); - - stringlist_free( args ); - fclose( stream1 ); - fclose( stream2 ); - } - test_assert_true( ert_test_context_install_workflow( test_context , "WFLOW1" , "WFLOW1")); - test_assert_true( ert_test_context_install_workflow( test_context , "WFLOW2" , "WFLOW2")); - - test_assert_true( ert_test_context_run_worklow( test_context , "WFLOW2")); - test_assert_false( ert_test_context_run_worklow( test_context , "WFLOW1")); - - ert_test_context_free( test_context ); -} - - - - - - -int main( int argc , char ** argv) { - char * config_file = argv[1]; - char * wf_job_fileOK = argv[2]; - char * wf_job_fileERROR = argv[3]; - - test_create_invalid( "DoesNotExist" ); - test_create_valid( config_file ); - test_install_job( config_file , wf_job_fileOK, wf_job_fileERROR ); - test_install_workflow( config_file , wf_job_fileOK); - test_run_workflow( config_file , wf_job_fileOK); - test_run_workflow_job( config_file , wf_job_fileOK); -} - - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_ert_workflow_list.c b/ThirdParty/Ert/libenkf/tests/enkf_ert_workflow_list.c deleted file mode 100644 index b6ea0e583d..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_ert_workflow_list.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_ert_workflow_list.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include - -#include - - - -void test_create_workflow_list() { - ert_workflow_list_type * wf_list = ert_workflow_list_alloc( NULL ); - test_assert_true( ert_workflow_list_is_instance( wf_list )); - ert_workflow_list_free( wf_list ); -} - - - -void test_add_alias( const char * job) { - test_work_area_type * work_area = test_work_area_alloc( "workflow_list/alias" ); - ert_workflow_list_type * wf_list = ert_workflow_list_alloc( NULL ); - ert_workflow_list_add_job( wf_list , "JOB" , job ); - - { - FILE * stream = util_fopen("WF1" , "w"); - fprintf(stream , "SCALE_STD 0.25\n"); - fclose(stream); - } - - - { - FILE * stream = util_fopen("WF2" , "w"); - fprintf(stream , "SCALE_STD 0.25\n"); - fclose(stream); - } - - test_assert_true( workflow_is_instance( ert_workflow_list_add_workflow( wf_list , "WF1" , "WF"))); - test_assert_int_equal( 1 , ert_workflow_list_get_size( wf_list )); - test_assert_false( ert_workflow_list_has_workflow( wf_list , "WF1")); - test_assert_true( ert_workflow_list_has_workflow( wf_list , "WF")); - - ert_workflow_list_add_alias( wf_list , "WF" , "alias"); - test_assert_int_equal( 2 , ert_workflow_list_get_size( wf_list )); - test_assert_true( ert_workflow_list_has_workflow( wf_list , "WF")); - test_assert_true( ert_workflow_list_has_workflow( wf_list , "alias")); - test_assert_true( workflow_is_instance( ert_workflow_list_get_workflow( wf_list , "WF"))); - test_assert_true( workflow_is_instance( ert_workflow_list_get_workflow( wf_list , "alias"))); - - test_assert_true( workflow_is_instance( ert_workflow_list_add_workflow( wf_list , "WF2" , "WF"))); - test_assert_int_equal( 2 , ert_workflow_list_get_size( wf_list )); - test_assert_true( ert_workflow_list_has_workflow( wf_list , "WF")); - test_assert_true( ert_workflow_list_has_workflow( wf_list , "alias")); - test_assert_true( workflow_is_instance( ert_workflow_list_get_workflow( wf_list , "WF"))); - test_assert_true( workflow_is_instance( ert_workflow_list_get_workflow( wf_list , "alias"))); - - test_work_area_free( work_area ); -} - - -int main(int argc , char ** argv) { - const char * job = argv[1]; - test_create_workflow_list(); - test_add_alias(job); - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_export_field_test.c b/ThirdParty/Ert/libenkf/tests/enkf_export_field_test.c deleted file mode 100644 index c3fd8a3373..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_export_field_test.c +++ /dev/null @@ -1,135 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_export_field_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - - - -void test_export_field(ert_test_context_type * test_context , const char * job_name , const char * job_file) { - - test_assert_true( ert_test_context_install_workflow_job( test_context , job_name , job_file )); - { - stringlist_type * args = stringlist_alloc_new(); - - stringlist_append_copy(args, "PERMZ"); - stringlist_append_copy(args, "TEST_EXPORT/test_export_field/PermZ%d.grdecl"); - stringlist_append_copy(args, "0"); - stringlist_append_copy(args, "FORECAST"); - stringlist_append_copy(args, "0, 2"); - - test_assert_true( ert_test_context_run_worklow_job( test_context , job_name , args) ); - stringlist_free( args ); - } - test_assert_true( util_file_exists("TEST_EXPORT/test_export_field/PermZ0.grdecl") ); - test_assert_true( util_file_exists("TEST_EXPORT/test_export_field/PermZ2.grdecl") ); -} - - -void job_file_export_field_ecl_grdecl(ert_test_context_type * test_context , const char * job_name , const char * job_file) { - ert_test_context_install_workflow_job( test_context , job_name , job_file ); - { - stringlist_type * args = stringlist_alloc_new(); - - stringlist_append_copy(args, "PERMX"); - stringlist_append_copy(args, "TEST_EXPORT/test_export_field_ecl_grdecl/PermX%d.grdecl"); - stringlist_append_copy(args, "0"); - stringlist_append_copy(args, "ANALYZED"); - test_assert_true( ert_test_context_run_worklow_job( test_context , job_name , args) ); - - stringlist_clear(args); - stringlist_append_copy(args, "PERMZ"); - stringlist_append_copy(args, "TEST_EXPORT/test_export_field_ecl_grdecl/PermZ%d"); - stringlist_append_copy(args, "0"); - stringlist_append_copy(args, "FORECAST"); - stringlist_append_copy(args, "0-1"); - test_assert_true( ert_test_context_run_worklow_job( test_context , job_name , args) ); - - - test_assert_true(util_file_exists("TEST_EXPORT/test_export_field_ecl_grdecl/PermX0.grdecl")); - test_assert_true(util_file_exists("TEST_EXPORT/test_export_field_ecl_grdecl/PermX1.grdecl")); - test_assert_true(util_file_exists("TEST_EXPORT/test_export_field_ecl_grdecl/PermX2.grdecl")); - - test_assert_true(util_file_exists("TEST_EXPORT/test_export_field_ecl_grdecl/PermZ0")); - test_assert_true(util_file_exists("TEST_EXPORT/test_export_field_ecl_grdecl/PermZ1")); - - stringlist_free( args ); - } -} - - -void job_file_export_field_rms_roff(ert_test_context_type * test_context , const char * job_name , const char * job_file) { - test_assert_true( ert_test_context_install_workflow_job( test_context , job_name , job_file ) ); - { - stringlist_type * args = stringlist_alloc_new(); - - stringlist_append_copy(args, "PERMZ"); - stringlist_append_copy(args, "TEST_EXPORT/test_export_field_rms_roff/PermZ%d"); - stringlist_append_copy(args, "0"); - stringlist_append_copy(args, "ANALYZED"); - test_assert_true( ert_test_context_run_worklow_job( test_context , job_name , args) ); - - stringlist_clear(args); - stringlist_append_copy(args, "PERMX"); - stringlist_append_copy(args, "TEST_EXPORT/test_export_field_rms_roff/PermX%d.roff"); - stringlist_append_copy(args, "0"); - stringlist_append_copy(args, "FORECAST"); - test_assert_true( ert_test_context_run_worklow_job( test_context , job_name , args) ); - - test_assert_true(util_file_exists("TEST_EXPORT/test_export_field_rms_roff/PermZ0")); - test_assert_true(util_file_exists("TEST_EXPORT/test_export_field_rms_roff/PermZ1")); - test_assert_true(util_file_exists("TEST_EXPORT/test_export_field_rms_roff/PermZ2")); - - test_assert_true(util_file_exists("TEST_EXPORT/test_export_field_rms_roff/PermX0.roff")); - test_assert_true(util_file_exists("TEST_EXPORT/test_export_field_rms_roff/PermX1.roff")); - test_assert_true(util_file_exists("TEST_EXPORT/test_export_field_rms_roff/PermX2.roff")); - - stringlist_free( args ); - } -} - - - -int main(int argc , const char ** argv) { - enkf_main_install_SIGNALS(); - - const char * config_file = argv[1]; - const char * job_file_export_field = argv[2]; - const char * job_file_export_field_ecl_grdecl = argv[3]; - const char * job_file_export_field_rms_roff = argv[4]; - - ert_test_context_type * test_context = ert_test_context_alloc("ExportFieldsJobs" , config_file); - enkf_main_type * enkf_main = ert_test_context_get_main( test_context ); - - enkf_main_select_fs( enkf_main , "default" ); - { - test_export_field(test_context, "JOB1" , job_file_export_field); - test_export_field(test_context, "JOB2" , job_file_export_field_ecl_grdecl); - test_export_field(test_context, "JOB3" , job_file_export_field_rms_roff); - } - ert_test_context_free( test_context ); - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_export_inactive_cells.c b/ThirdParty/Ert/libenkf/tests/enkf_export_inactive_cells.c deleted file mode 100644 index 934826b289..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_export_inactive_cells.c +++ /dev/null @@ -1,204 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_export_inactive_cells.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include - -#include -#include -#include -#include - - - - -void check_exported_data(const char * exported_file, - const char * init_file, - field_file_format_type file_type, - const field_config_type * field_config, - const field_type * field, - int nx, - int ny, - int nz) { - - FILE * original_stream = NULL; - ecl_kw_type * kw_original = NULL; - FILE * exported_stream = NULL; - ecl_kw_type * kw_exported = NULL; - field_type * exported_field = NULL; - field_config_type * exported_field_config = NULL; - - { - if (init_file) { - original_stream = util_fopen( init_file , "r"); - kw_original = ecl_kw_fscanf_alloc_grdecl_dynamic( original_stream , field_config_get_key(field_config) , ECL_DOUBLE_TYPE ); - } - - if (ECL_GRDECL_FILE == file_type) { - exported_stream = util_fopen( exported_file , "r"); - kw_exported = ecl_kw_fscanf_alloc_grdecl_dynamic( exported_stream , field_config_get_key(field_config) , ECL_DOUBLE_TYPE ); - } else if (RMS_ROFF_FILE == file_type) { - ecl_grid_type * grid = field_config_get_grid(field_config); - exported_field_config = field_config_alloc_empty(field_config_get_key(field_config), grid, NULL, true); - exported_field = field_alloc(exported_field_config); - - bool keep_inactive = true; - field_fload_rms(exported_field, exported_file, keep_inactive); - } - } - - - { - int k, j, i = 0; - - for (k=0; k < nz; k++) { - for (j=0; j < ny; j++) { - for (i=0; i < nx; i++) { - bool active = field_config_active_cell(field_config, i, j, k); - double field_value = active ? field_ijk_get_double(field, i, j, k) : 0.0; - int global_index = field_config_global_index(field_config , i , j , k); - double exported_value = 0.0; - if (ECL_GRDECL_FILE == file_type) - exported_value = ecl_kw_iget_as_double(kw_exported, global_index); - else if (RMS_ROFF_FILE == file_type) { - exported_value = field_ijk_get_double(exported_field, i, j, k); - } - double initial_value = init_file ? ecl_kw_iget_as_double(kw_original, global_index) : 0.0; - - if (active) - test_assert_double_equal(field_value, exported_value); - else if (init_file) - test_assert_double_equal(initial_value, exported_value); - else if (file_type == RMS_ROFF_FILE) - test_assert_double_equal(RMS_INACTIVE_DOUBLE, exported_value); - else - test_assert_double_equal(0.0, exported_value); - } - } - } - } - - - if (init_file) { - util_fclose(original_stream); - ecl_kw_free(kw_original); - } - - if (ECL_GRDECL_FILE == file_type) { - util_fclose(exported_stream); - ecl_kw_free(kw_exported); - } else - field_free(exported_field); -} - - - -void forward_initialize_node(enkf_main_type * enkf_main, const char * init_file, enkf_node_type * field_node) { - { - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - bool_vector_type * iactive = bool_vector_alloc(0, false); - bool_vector_iset( iactive , ens_size - 1 , true ); - - enkf_main_create_run_path(enkf_main , iactive , 0); - bool_vector_free(iactive); - } - - { - int iens = 0; - enkf_state_type * state = enkf_main_iget_state( enkf_main , iens ); - enkf_fs_type * fs = enkf_main_get_fs(enkf_main); - run_arg_type * run_arg = run_arg_alloc_ENSEMBLE_EXPERIMENT( fs , 0 ,0 , "simulations/run0"); - - enkf_state_forward_init( state , run_arg); - } -} - - - -int main(int argc , char ** argv) { - enkf_main_install_SIGNALS(); - - const char * config_file = argv[1]; - const char * init_file = argv[2]; - const char * key = "PORO"; - int iens = 0; - - ert_test_context_type * test_context = ert_test_context_alloc("ExportInactiveCellsTest" , config_file); - enkf_main_type * enkf_main = ert_test_context_get_main(test_context); - enkf_fs_type * fs = enkf_main_get_fs(enkf_main); - const ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config(enkf_main); - enkf_config_node_type * config_node = ensemble_config_get_node(ensemble_config , key); - const field_config_type * field_config = enkf_config_node_get_ref( config_node ); - enkf_state_type * state = enkf_main_iget_state( enkf_main , iens ); - enkf_node_type * field_node = enkf_state_get_node( state , key ); - field_type * field = enkf_node_value_ptr(field_node); - - { - forward_initialize_node(enkf_main, init_file, field_node); - node_id_type node_id = {.report_step = 0 , .iens = iens }; - test_assert_true(enkf_node_try_load(field_node , fs , node_id)); - field_scale(field, 3.0); - } - - int nx,ny,nz; - field_config_get_dims(field_config , &nx , &ny , &nz); - const char * export_file_grdecl = "my_test_dir/exported_field_test_file_grdecl"; - const char * export_file_roff = "my_test_dir/exported_field_test_file_roff"; - field_file_format_type file_type; - model_config_type * mc = enkf_main_get_model_config(enkf_main); - path_fmt_type * runpath_fmt = model_config_get_runpath_fmt(mc); - const char * found_init_file = enkf_config_node_get_FIELD_fill_file(config_node, runpath_fmt); - { - file_type = ECL_GRDECL_FILE; - field_export(field, export_file_grdecl, NULL, file_type, false, found_init_file); - check_exported_data(export_file_grdecl, init_file, file_type, field_config, field, nx, ny, nz); - } - { - file_type = RMS_ROFF_FILE; - field_export(field, export_file_roff, NULL, file_type, false, found_init_file); - check_exported_data(export_file_roff, init_file, file_type, field_config, field, nx, ny, nz); - } - - found_init_file = NULL; - { - file_type = ECL_GRDECL_FILE; - field_export(field, export_file_grdecl, NULL, file_type, false, found_init_file); - check_exported_data(export_file_grdecl, found_init_file, file_type, field_config, field, nx, ny, nz); - } - { - file_type = RMS_ROFF_FILE; - field_export(field, export_file_roff, NULL, file_type, false, found_init_file); - check_exported_data(export_file_roff, found_init_file, file_type, field_config, field, nx, ny, nz); - } - - - - ert_test_context_free(test_context); - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_forward_init_FIELD.c b/ThirdParty/Ert/libenkf/tests/enkf_forward_init_FIELD.c deleted file mode 100644 index b046029ca6..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_forward_init_FIELD.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_forward_init_FIELD.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - - -void create_runpath(enkf_main_type * enkf_main, int iter) { - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - bool_vector_type * iactive = bool_vector_alloc(0,false); - - bool_vector_iset( iactive , ens_size - 1 , true ); - enkf_main_create_run_path(enkf_main , iactive , iter); - bool_vector_free(iactive); -} - - - -int main(int argc , char ** argv) { - enkf_main_install_SIGNALS(); - const char * root_path = argv[1]; - const char * config_file = argv[2]; - const char * init_file = argv[3]; - const char * forward_init_string = argv[4]; - test_work_area_type * work_area = test_work_area_alloc(config_file ); - test_work_area_copy_directory_content( work_area , root_path ); - test_work_area_install_file( work_area , init_file ); - { - bool forward_init; - bool strict = true; - enkf_main_type * enkf_main; - - test_assert_true( util_sscanf_bool( forward_init_string , &forward_init)); - - util_clear_directory( "Storage" , true , true ); - enkf_main = enkf_main_bootstrap( config_file , strict , true ); - { - enkf_state_type * state = enkf_main_iget_state( enkf_main , 0 ); - enkf_node_type * field_node = enkf_state_get_node( state , "PORO" ); - { - const enkf_config_node_type * field_config_node = enkf_node_get_config( field_node ); - char * init_file1 = enkf_config_node_alloc_initfile( field_config_node , NULL , 0); - char * init_file2 = enkf_config_node_alloc_initfile( field_config_node , "/tmp", 0); - - test_assert_bool_equal( enkf_config_node_use_forward_init( field_config_node ) , forward_init ); - test_assert_string_equal( init_file1 , "petro.grdecl"); - test_assert_string_equal( init_file2 , "/tmp/petro.grdecl"); - - free( init_file1 ); - free( init_file2 ); - } - - test_assert_bool_equal( enkf_node_use_forward_init( field_node ) , forward_init ); - if (forward_init) - test_assert_bool_not_equal( enkf_node_initialize( field_node , 0 , enkf_state_get_rng( state )) , forward_init); - // else hard_failure() - } - test_assert_bool_equal( forward_init, ensemble_config_have_forward_init( enkf_main_get_ensemble_config( enkf_main ))); - - if (forward_init) { - enkf_state_type * state = enkf_main_iget_state( enkf_main , 0 ); - enkf_fs_type * fs = enkf_main_get_fs( enkf_main ); - enkf_node_type * field_node = enkf_state_get_node( state , "PORO" ); - run_arg_type * run_arg = run_arg_alloc_ENSEMBLE_EXPERIMENT( fs , 0 ,0 , "simulations/run0"); - node_id_type node_id = {.report_step = 0 , - .iens = 0 }; - - create_runpath( enkf_main, 0 ); - test_assert_true( util_is_directory( "simulations/run0" )); - - { - int result; - stringlist_type * msg_list = stringlist_alloc_new(); - - - test_assert_false( enkf_node_has_data( field_node , fs, node_id )); - - util_unlink_existing( "simulations/run0/petro.grdecl" ); - - test_assert_false(enkf_node_forward_init(field_node, "simulations/run0", 0)); - result = enkf_state_forward_init(state, run_arg); - test_assert_true(LOAD_FAILURE & result); - - result = 0; - { - enkf_fs_type * fs = enkf_main_get_fs(enkf_main); - state_map_type * state_map = enkf_fs_get_state_map(fs); - state_map_iset(state_map, 0, STATE_INITIALIZED); - } - result = enkf_state_load_from_forward_model(state, run_arg , msg_list); - stringlist_free(msg_list); - test_assert_true(LOAD_FAILURE & result); - } - - - util_copy_file( init_file , "simulations/run0/petro.grdecl"); - { - int result; - stringlist_type * msg_list = stringlist_alloc_new(); - - test_assert_true( enkf_node_forward_init( field_node , "simulations/run0" , 0)); - result = enkf_state_forward_init( state , run_arg); - test_assert_int_equal( result, 0 ); - result = enkf_state_load_from_forward_model( state , run_arg , msg_list ); - - stringlist_free( msg_list ); - test_assert_int_equal(result , 0); - - { - double value; - test_assert_true( enkf_node_user_get( field_node , fs , "5,5,5" , node_id , &value)); - test_assert_double_equal( 0.28485405445 , value); - } - } - util_clear_directory( "simulations" , true , true ); - create_runpath( enkf_main, 0 ); - test_assert_true( util_is_directory( "simulations/run0" )); - test_assert_true( util_is_file( "simulations/run0/PORO.grdecl" )); - test_assert_true( enkf_node_fload( field_node , "simulations/run0/PORO.grdecl")); - { - double value; - test_assert_true( enkf_node_user_get( field_node , fs , "4,4,4" , node_id , &value)); - test_assert_double_equal( 0.130251303315 , value); - } - util_clear_directory( "simulations" , true , true ); - run_arg_free( run_arg ); - } - enkf_main_free( enkf_main ); - } -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_forward_init_GEN_KW.c b/ThirdParty/Ert/libenkf/tests/enkf_forward_init_GEN_KW.c deleted file mode 100644 index 5806bfce4b..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_forward_init_GEN_KW.c +++ /dev/null @@ -1,163 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_forward_init_GEN_KW.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - - -void create_runpath(enkf_main_type * enkf_main, int iter ) { - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - bool_vector_type * iactive = bool_vector_alloc(0,false); - - bool_vector_iset( iactive , ens_size - 1 , true ); - enkf_main_create_run_path(enkf_main , iactive , iter); - bool_vector_free(iactive); -} - - -int main(int argc , char ** argv) { - enkf_main_install_SIGNALS(); - const char * root_path = argv[1]; - const char * config_file = argv[2]; - const char * forward_init_string = argv[3]; - test_work_area_type * work_area = test_work_area_alloc(config_file ); - test_work_area_copy_directory_content( work_area , root_path ); - { - bool forward_init; - bool strict = true; - enkf_main_type * enkf_main; - - test_assert_true( util_sscanf_bool( forward_init_string , &forward_init)); - - util_clear_directory( "Storage" , true , true ); - enkf_main = enkf_main_bootstrap( config_file , strict , true ); - { - enkf_state_type * state = enkf_main_iget_state( enkf_main , 0 ); - enkf_node_type * gen_kw_node = enkf_state_get_node( state , "MULTFLT" ); - { - const enkf_config_node_type * gen_kw_config_node = enkf_node_get_config( gen_kw_node ); - char * init_file1 = enkf_config_node_alloc_initfile( gen_kw_config_node , NULL , 0); - char * init_file2 = enkf_config_node_alloc_initfile( gen_kw_config_node , "/tmp", 0); - - test_assert_bool_equal( enkf_config_node_use_forward_init( gen_kw_config_node ) , forward_init ); - test_assert_string_equal( init_file1 , "MULTFLT_INIT"); - test_assert_string_equal( init_file2 , "/tmp/MULTFLT_INIT"); - - free( init_file1 ); - free( init_file2 ); - } - - test_assert_bool_equal( enkf_node_use_forward_init( gen_kw_node ) , forward_init ); - if (forward_init) - test_assert_bool_not_equal( enkf_node_initialize( gen_kw_node , 0 , enkf_state_get_rng( state )) , forward_init); - // else hard_failure() - } - test_assert_bool_equal( forward_init, ensemble_config_have_forward_init( enkf_main_get_ensemble_config( enkf_main ))); - - if (forward_init) { - enkf_state_type * state = enkf_main_iget_state( enkf_main , 0 ); - enkf_fs_type * fs = enkf_main_get_fs( enkf_main ); - run_arg_type * run_arg = run_arg_alloc_ENSEMBLE_EXPERIMENT( fs , 0 , 0 , "simulations/run0"); - enkf_node_type * gen_kw_node = enkf_state_get_node( state , "MULTFLT" ); - node_id_type node_id = {.report_step = 0 , - .iens = 0 }; - - create_runpath( enkf_main, 0 ); - test_assert_true( util_is_directory( "simulations/run0" )); - - { - int error; - stringlist_type * msg_list = stringlist_alloc_new(); - bool_vector_type * iactive = bool_vector_alloc( enkf_main_get_ensemble_size( enkf_main ) , true); - - test_assert_false( enkf_node_has_data( gen_kw_node , fs, node_id )); - util_unlink_existing( "simulations/run0/MULTFLT_INIT" ); - - - test_assert_false( enkf_node_forward_init( gen_kw_node , "simulations/run0" , 0 )); - error = enkf_state_forward_init( state , run_arg ); - test_assert_true(LOAD_FAILURE & error); - - { - enkf_fs_type * fs = enkf_main_get_fs( enkf_main ); - state_map_type * state_map = enkf_fs_get_state_map(fs); - state_map_iset(state_map , 0 , STATE_INITIALIZED); - } - error = enkf_state_load_from_forward_model( state , run_arg , msg_list ); - stringlist_free( msg_list ); - bool_vector_free( iactive ); - test_assert_true(LOAD_FAILURE & error); - } - - - - { - FILE * stream = util_fopen("simulations/run0/MULTFLT_INIT" , "w"); - fprintf(stream , "123456.0\n" ); - fclose( stream ); - } - - { - int error; - stringlist_type * msg_list = stringlist_alloc_new(); - - test_assert_true( enkf_node_forward_init( gen_kw_node , "simulations/run0" , 0 )); - error = enkf_state_forward_init( state , run_arg ); - test_assert_int_equal(0, error); - error = enkf_state_load_from_forward_model( state , run_arg , msg_list ); - - stringlist_free( msg_list ); - test_assert_int_equal(0, error); - - { - double value; - test_assert_true( enkf_node_user_get( gen_kw_node , fs , "MULTFLT" , node_id , &value)); - test_assert_double_equal( 123456.0 , value); - } - } - - test_assert_true( util_is_file ("simulations/run0/parameters.txt")); //Export of gen kw params - - util_clear_directory( "simulations" , true , true ); - create_runpath( enkf_main, 0 ); - test_assert_true( util_is_directory( "simulations/run0" )); - test_assert_true( util_is_file( "simulations/run0/MULTFLT.INC" )); - { - FILE * stream = util_fopen("simulations/run0/MULTFLT.INC" , "r"); - double value; - fscanf(stream , "%lg" , &value); - fclose( stream ); - test_assert_double_equal( 123456.0 , value); - } - util_clear_directory( "simulations" , true , true ); - run_arg_free( run_arg ); - } - enkf_main_free( enkf_main ); - } - test_work_area_free( work_area ); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_forward_init_GEN_PARAM.c b/ThirdParty/Ert/libenkf/tests/enkf_forward_init_GEN_PARAM.c deleted file mode 100644 index f29e0cab78..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_forward_init_GEN_PARAM.c +++ /dev/null @@ -1,154 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_forward_init_GEN_PARAM.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - - -void create_runpath(enkf_main_type * enkf_main, int iter ) { - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - bool_vector_type * iactive = bool_vector_alloc(0,false); - - bool_vector_iset( iactive , ens_size - 1 , true ); - enkf_main_create_run_path(enkf_main , iactive , iter); - bool_vector_free(iactive); -} - - - -int main(int argc , char ** argv) { - enkf_main_install_SIGNALS(); - const char * root_path = argv[1]; - const char * config_file = argv[2]; - const char * forward_init_string = argv[3]; - test_work_area_type * work_area = test_work_area_alloc(config_file ); - test_work_area_copy_directory_content( work_area , root_path ); - { - bool forward_init; - bool strict = true; - enkf_main_type * enkf_main; - - test_assert_true( util_sscanf_bool( forward_init_string , &forward_init)); - - util_clear_directory( "Storage" , true , true ); - enkf_main = enkf_main_bootstrap( config_file , strict , true ); - { - enkf_state_type * state = enkf_main_iget_state( enkf_main , 0 ); - enkf_node_type * gen_param_node = enkf_state_get_node( state , "PARAM" ); - { - const enkf_config_node_type * gen_param_config_node = enkf_node_get_config( gen_param_node ); - char * init_file1 = enkf_config_node_alloc_initfile( gen_param_config_node , NULL , 0); - char * init_file2 = enkf_config_node_alloc_initfile( gen_param_config_node , "/tmp", 0); - - test_assert_bool_equal( enkf_config_node_use_forward_init( gen_param_config_node ) , forward_init ); - test_assert_string_equal( init_file1 , "PARAM_INIT"); - test_assert_string_equal( init_file2 , "/tmp/PARAM_INIT"); - - free( init_file1 ); - free( init_file2 ); - } - - test_assert_bool_equal( enkf_node_use_forward_init( gen_param_node ) , forward_init ); - if (forward_init) - test_assert_bool_not_equal( enkf_node_initialize( gen_param_node , 0 , enkf_state_get_rng( state )) , forward_init); - // else hard_failure() - } - test_assert_bool_equal( forward_init, ensemble_config_have_forward_init( enkf_main_get_ensemble_config( enkf_main ))); - - if (forward_init) { - enkf_state_type * state = enkf_main_iget_state( enkf_main , 0 ); - enkf_fs_type * fs = enkf_main_get_fs( enkf_main ); - run_arg_type * run_arg = run_arg_alloc_ENSEMBLE_EXPERIMENT( fs , 0 , 0 , "simulations/run0"); - enkf_node_type * gen_param_node = enkf_state_get_node( state , "PARAM" ); - node_id_type node_id = {.report_step = 0 , - .iens = 0}; - - create_runpath( enkf_main, 0 ); - test_assert_true( util_is_directory( "simulations/run0" )); - - test_assert_false( enkf_node_has_data( gen_param_node , fs, node_id )); - util_unlink_existing( "simulations/run0/PARAM_INIT" ); - - { - FILE * stream = util_fopen("simulations/run0/PARAM_INIT" , "w"); - fprintf(stream , "0\n1\n2\n3\n" ); - fclose( stream ); - } - - { - int error; - stringlist_type * msg_list = stringlist_alloc_new(); - - test_assert_true( enkf_node_forward_init( gen_param_node , "simulations/run0" , 0 )); - - error = enkf_state_forward_init( state , run_arg ); - test_assert_int_equal(0, error); - { - enkf_fs_type * fs = enkf_main_get_fs( enkf_main ); - state_map_type * state_map = enkf_fs_get_state_map(fs); - state_map_iset(state_map , 0 , STATE_INITIALIZED); - } - error = enkf_state_load_from_forward_model( state , run_arg , msg_list ); - - stringlist_free( msg_list ); - test_assert_int_equal(0, error); - - { - double value; - test_assert_true( enkf_node_user_get( gen_param_node , fs , "0" , node_id , &value)); - test_assert_double_equal( 0 , value); - - test_assert_true( enkf_node_user_get( gen_param_node , fs , "1" , node_id , &value)); - test_assert_double_equal( 1 , value); - - test_assert_true( enkf_node_user_get( gen_param_node , fs , "2" , node_id , &value)); - test_assert_double_equal( 2 , value); - } - } - util_clear_directory( "simulations" , true , true ); - create_runpath( enkf_main, 0 ); - test_assert_true( util_is_directory( "simulations/run0" )); - test_assert_true( util_is_file( "simulations/run0/PARAM.INC" )); - { - FILE * stream = util_fopen("simulations/run0/PARAM.INC" , "r"); - double v0,v1,v2,v3; - fscanf(stream , "%lg %lg %lg %lg" , &v0,&v1,&v2,&v3); - fclose( stream ); - test_assert_double_equal( 0 , v0); - test_assert_double_equal( 1 , v1); - test_assert_double_equal( 2 , v2); - test_assert_double_equal( 3 , v3); - } - util_clear_directory( "simulations" , true , true ); - run_arg_free( run_arg ); - } - enkf_main_free( enkf_main ); - } - test_work_area_free( work_area ); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_forward_init_SURFACE.c b/ThirdParty/Ert/libenkf/tests/enkf_forward_init_SURFACE.c deleted file mode 100644 index 92fe420906..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_forward_init_SURFACE.c +++ /dev/null @@ -1,161 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_forward_init_SURFACE.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -void create_runpath(enkf_main_type * enkf_main, int iter ) { - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - bool_vector_type * iactive = bool_vector_alloc(0,false); - - bool_vector_iset( iactive , ens_size - 1 , true ); - enkf_main_create_run_path(enkf_main , iactive , iter); - bool_vector_free(iactive); -} - - - -int main(int argc , char ** argv) { - enkf_main_install_SIGNALS(); - const char * root_path = argv[1]; - const char * config_file = argv[2]; - const char * init_file = argv[3]; - const char * forward_init_string = argv[4]; - test_work_area_type * work_area = test_work_area_alloc(config_file ); - - test_work_area_copy_directory_content( work_area , root_path ); - test_work_area_install_file( work_area , init_file ); - { - - bool forward_init; - bool strict = true; - enkf_main_type * enkf_main; - - test_assert_true( util_sscanf_bool( forward_init_string , &forward_init)); - - util_clear_directory( "Storage" , true , true ); - enkf_main = enkf_main_bootstrap( config_file , strict , true ); - { - enkf_state_type * state = enkf_main_iget_state( enkf_main , 0 ); - enkf_node_type * surface_node = enkf_state_get_node( state , "SURFACE" ); - { - const enkf_config_node_type * surface_config_node = enkf_node_get_config( surface_node ); - char * init_file1 = enkf_config_node_alloc_initfile( surface_config_node , NULL , 0); - char * init_file2 = enkf_config_node_alloc_initfile( surface_config_node , "/tmp", 0); - - test_assert_bool_equal( enkf_config_node_use_forward_init( surface_config_node ) , forward_init ); - test_assert_string_equal( init_file1 , "Surface.irap"); - test_assert_string_equal( init_file2 , "/tmp/Surface.irap"); - - free( init_file1 ); - free( init_file2 ); - } - - test_assert_bool_equal( enkf_node_use_forward_init( surface_node ) , forward_init ); - if (forward_init) - test_assert_bool_not_equal( enkf_node_initialize( surface_node , 0 , enkf_state_get_rng( state )) , forward_init); - // else hard_failure() - } - test_assert_bool_equal( forward_init, ensemble_config_have_forward_init( enkf_main_get_ensemble_config( enkf_main ))); - - if (forward_init) { - enkf_state_type * state = enkf_main_iget_state( enkf_main , 0 ); - enkf_fs_type * fs = enkf_main_get_fs( enkf_main ); - run_arg_type * run_arg = run_arg_alloc_ENSEMBLE_EXPERIMENT( fs , 0 ,0 , "simulations/run0"); - enkf_node_type * surface_node = enkf_state_get_node( state , "SURFACE" ); - node_id_type node_id = {.report_step = 0 , - .iens = 0 }; - - create_runpath( enkf_main, 0 ); - test_assert_true( util_is_directory( "simulations/run0" )); - - { - int error; - stringlist_type * msg_list = stringlist_alloc_new(); - - - test_assert_false( enkf_node_has_data( surface_node , fs, node_id )); - - util_unlink_existing( "simulations/run0/Surface.irap" ); - - test_assert_false( enkf_node_forward_init( surface_node , "simulations/run0" , 0 )); - error = enkf_state_forward_init( state , run_arg ); - test_assert_true(LOAD_FAILURE & error); - - { - enkf_fs_type * fs = enkf_main_get_fs(enkf_main); - state_map_type * state_map = enkf_fs_get_state_map(fs); - state_map_iset(state_map, 0, STATE_INITIALIZED); - } - error = enkf_state_load_from_forward_model(state, run_arg , msg_list); - stringlist_free( msg_list ); - test_assert_true(LOAD_FAILURE & error); - } - - - util_copy_file( init_file , "simulations/run0/Surface.irap"); - { - int error; - stringlist_type * msg_list = stringlist_alloc_new(); - - - test_assert_true( enkf_node_forward_init( surface_node , "simulations/run0" , 0 )); - error = enkf_state_forward_init( state , run_arg ); - test_assert_int_equal(0, error); - error = enkf_state_load_from_forward_model( state , run_arg , msg_list ); - stringlist_free( msg_list ); - test_assert_int_equal(0, error); - - { - double value; - test_assert_true( enkf_node_user_get( surface_node , fs , "0" , node_id , &value)); - test_assert_double_equal( 2735.7461 , value); - - test_assert_true( enkf_node_user_get( surface_node , fs , "5" , node_id , &value)); - test_assert_double_equal( 2737.0122 , value); - } - } - util_clear_directory( "simulations" , true , true ); - create_runpath( enkf_main, 0 ); - test_assert_true( util_is_directory( "simulations/run0" )); - test_assert_true( util_is_file( "simulations/run0/SURFACE.INC" )); - test_assert_true( enkf_node_fload( surface_node , "simulations/run0/SURFACE.INC")); - { - double value; - test_assert_true( enkf_node_user_get( surface_node , fs , "0" , node_id , &value)); - test_assert_double_equal( 2735.7461 , value); - - test_assert_true( enkf_node_user_get( surface_node , fs , "5" , node_id , &value)); - test_assert_double_equal( 2737.0122 , value); - } - util_clear_directory( "simulations" , true , true ); - } - enkf_main_free( enkf_main ); - } -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_forward_init_transform.c b/ThirdParty/Ert/libenkf/tests/enkf_forward_init_transform.c deleted file mode 100644 index d1cb969763..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_forward_init_transform.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_forward_init_transform.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include - - - - - - -void create_runpath(enkf_main_type * enkf_main, int iter ) { - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - bool_vector_type * iactive = bool_vector_alloc(0,false); - - bool_vector_iset( iactive , ens_size - 1 , true ); - enkf_main_create_run_path(enkf_main , iactive , iter); - bool_vector_free(iactive); -} - - -bool check_original_exported_data_equal(const enkf_node_type * field_node) { - FILE * original_stream = util_fopen( "petro.grdecl" , "r"); - ecl_kw_type * kw_original = ecl_kw_fscanf_alloc_grdecl_dynamic( original_stream , "PORO" , ECL_DOUBLE_TYPE ); - - enkf_node_ecl_write(field_node, "tmp", NULL, 0); - FILE * exported_stream = util_fopen( "tmp/PORO.grdecl" , "r"); - ecl_kw_type * kw_exported = ecl_kw_fscanf_alloc_grdecl_dynamic( exported_stream , "PORO" , ECL_DOUBLE_TYPE ); - - bool ret = ecl_kw_numeric_equal(kw_original, kw_exported, 1e-5 , 1e-5); - - util_fclose(original_stream); - util_fclose(exported_stream); - ecl_kw_free(kw_original); - ecl_kw_free(kw_exported); - - return ret; -} - - -int main(int argc , char ** argv) { - enkf_main_install_SIGNALS(); - const char * root_path = argv[1]; - const char * config_file = argv[2]; - const char * init_file = argv[3]; - const char * forward_init_string = argv[4]; - - test_work_area_type * work_area = test_work_area_alloc(config_file ); - test_work_area_copy_directory_content( work_area , root_path ); - test_work_area_install_file( work_area , init_file ); - test_work_area_set_store(work_area, true); - - bool strict = true; - enkf_main_type * enkf_main = enkf_main_bootstrap( config_file , strict , true ); - enkf_fs_type * init_fs = enkf_main_get_fs(enkf_main); - enkf_state_type * state = enkf_main_iget_state( enkf_main , 0 ); - run_arg_type * run_arg = run_arg_alloc_ENSEMBLE_EXPERIMENT( init_fs , 0 ,0 , "simulations/run0"); - enkf_node_type * field_node = enkf_state_get_node( state , "PORO" ); - - bool forward_init; - test_assert_true( util_sscanf_bool( forward_init_string , &forward_init)); - test_assert_bool_equal( enkf_node_use_forward_init( field_node ) , forward_init ); - test_assert_bool_equal( forward_init, ensemble_config_have_forward_init( enkf_main_get_ensemble_config( enkf_main ))); - - util_clear_directory( "Storage" , true , true ); - - create_runpath( enkf_main, 0 ); - test_assert_true( util_is_directory( "simulations/run0" )); - - if (forward_init) - util_copy_file( init_file , "simulations/run0/petro.grdecl"); - - { - bool_vector_type * iactive = bool_vector_alloc( enkf_main_get_ensemble_size(enkf_main) , true); - int error; - stringlist_type * msg_list = stringlist_alloc_new(); - error = enkf_state_load_from_forward_model( state , run_arg , msg_list ); - stringlist_free( msg_list ); - bool_vector_free( iactive ); - test_assert_int_equal(error, 0); - } - - test_assert_true(check_original_exported_data_equal(field_node)); - - run_arg_free( run_arg ); - enkf_main_free(enkf_main); - test_work_area_free(work_area); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_forward_load_context.c b/ThirdParty/Ert/libenkf/tests/enkf_forward_load_context.c deleted file mode 100644 index 0163e2f330..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_forward_load_context.c +++ /dev/null @@ -1,132 +0,0 @@ -/* - Copyright (C) 2016 Statoil ASA, Norway. - - The file 'forward_load_context.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include - -#include -#include - - -void test_update_result() { - forward_load_context_type * load_context = forward_load_context_alloc( NULL , false , NULL , NULL , NULL); - test_assert_int_equal( forward_load_context_get_result( load_context ) , 0 ); - forward_load_context_update_result( load_context , 1 ); - test_assert_int_equal( forward_load_context_get_result( load_context ) , 1 ); - - forward_load_context_update_result( load_context , 1 ); - test_assert_int_equal( forward_load_context_get_result( load_context ) , 1 ); - - forward_load_context_update_result( load_context , 2 ); - test_assert_int_equal( forward_load_context_get_result( load_context ) , 3 ); - - forward_load_context_update_result( load_context , 5 ); - test_assert_int_equal( forward_load_context_get_result( load_context ) , 7 ); - - forward_load_context_free( load_context ); -} - -void test_create() { - forward_load_context_type * load_context = forward_load_context_alloc( NULL , false , NULL , NULL , NULL); - test_assert_true( forward_load_context_is_instance( load_context )); - forward_load_context_free( load_context ); -} - -void test_load_restart1() { - run_arg_type * run_arg = run_arg_alloc_ENSEMBLE_EXPERIMENT(NULL , 0 , 0 , "run"); - ecl_config_type * ecl_config = ecl_config_alloc( ); - forward_load_context_type * load_context = forward_load_context_alloc( run_arg , false , ecl_config , "BASE" , NULL ); - - test_assert_false( forward_load_context_load_restart_file( load_context , 10 )); - - forward_load_context_free( load_context ); - ecl_config_free( ecl_config ); - run_arg_free( run_arg ); -} - - -void make_restart_mock( const char * path , const char * eclbase , int report_step) { - char * filename = ecl_util_alloc_filename( path , eclbase , ECL_RESTART_FILE , false , report_step ); - ecl_kw_type * kw = ecl_kw_alloc( "KW" , 100 , ECL_FLOAT_TYPE); - fortio_type * f = fortio_open_writer( filename , false , true ); - ecl_kw_fwrite( kw , f ); - fortio_fclose( f ); - ecl_kw_free( kw ); - free( filename ); -} - -void test_load_restart2() { - test_work_area_type * work_area = test_work_area_alloc("forward_load"); - { - run_arg_type * run_arg = run_arg_alloc_ENSEMBLE_EXPERIMENT(NULL , 0 , 0 , "run"); - ecl_config_type * ecl_config = ecl_config_alloc( ); - forward_load_context_type * load_context = forward_load_context_alloc( run_arg , false , ecl_config , "BASE" , NULL ); - util_make_path("run"); - make_restart_mock( "run" , "BASE" , 1 ); - make_restart_mock( "run" , "BASE" , 3 ); - - test_assert_false( forward_load_context_load_restart_file( load_context , 0 )); - test_assert_true( forward_load_context_load_restart_file( load_context , 1 )); - test_assert_false( forward_load_context_load_restart_file( load_context , 2 )); - test_assert_true( forward_load_context_load_restart_file( load_context , 3 )); - - forward_load_context_free( load_context ); - ecl_config_free( ecl_config ); - run_arg_free( run_arg ); - } - test_work_area_free( work_area ); -} - - - -void test_add_message() { - { - forward_load_context_type * load_context = forward_load_context_alloc( NULL , false , NULL , NULL , NULL); - forward_load_context_add_message( load_context , "MESSAGE" ); - test_assert_false( forward_load_context_accept_messages( load_context )); - forward_load_context_free( load_context ); - } - - { - stringlist_type * message_list = stringlist_alloc_new( ); - forward_load_context_type * load_context = forward_load_context_alloc( NULL , false , NULL , NULL , message_list ); - - test_assert_true( forward_load_context_accept_messages( load_context )); - forward_load_context_add_message( load_context , "MESSAGE1" ); - forward_load_context_add_message( load_context , "MESSAGE2" ); - forward_load_context_free( load_context ); - - test_assert_int_equal( 2 , stringlist_get_size( message_list )); - test_assert_string_equal( stringlist_iget( message_list , 0 ) , "MESSAGE1" ); - test_assert_string_equal( stringlist_iget( message_list , 1 ) , "MESSAGE2" ); - stringlist_free( message_list ); - } -} - - - - -int main(int argc , char ** argv) { - util_install_signals(); - test_create(); - test_load_restart1(); - test_load_restart2(); - test_add_message(); - test_update_result(); - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_fs.c b/ThirdParty/Ert/libenkf/tests/enkf_fs.c deleted file mode 100644 index 9447bc8c16..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_fs.c +++ /dev/null @@ -1,158 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_fs.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ert/util/build_config.h" - -#include -#include -#include -#include - - -typedef struct -{ - pthread_mutex_t mutex1; - pthread_mutex_t mutex2; -} shared_data; - -static shared_data* data = NULL; - -void test_mount() { - test_work_area_type * work_area = test_work_area_alloc("enkf_fs/mount"); - - test_assert_false( enkf_fs_exists( "mnt" )); - test_assert_NULL( enkf_fs_create_fs("mnt" , BLOCK_FS_DRIVER_ID , NULL , false)); - test_assert_true( enkf_fs_exists( "mnt" )); - { - enkf_fs_type * fs = enkf_fs_mount( "mnt" ); - test_assert_true( util_file_exists("mnt/mnt.lock")); - test_assert_true( enkf_fs_is_instance( fs )); - enkf_fs_decref( fs ); - test_assert_false( util_file_exists("mnt/mnt.lock")); - } - { - enkf_fs_type * fs = enkf_fs_create_fs( "mnt2" , BLOCK_FS_DRIVER_ID , NULL , true); - test_assert_true( enkf_fs_is_instance( fs )); - enkf_fs_decref( fs ); - } - - - test_work_area_free( work_area ); -} - -void test_refcount() { - test_work_area_type * work_area = test_work_area_alloc("enkf_fs/refcount"); - - enkf_fs_create_fs("mnt" , BLOCK_FS_DRIVER_ID , NULL , false); - { - enkf_fs_type * fs = enkf_fs_mount( "mnt" ); - test_assert_int_equal( 1 , enkf_fs_get_refcount( fs )); - enkf_fs_decref( fs ); - } - test_work_area_free( work_area ); -} - -void createFS() { - - pthread_mutex_lock(&data->mutex1); - pid_t pid = fork(); - - if (pid == 0) { - enkf_fs_type * fs_false = enkf_fs_mount( "mnt" ); - test_assert_false(enkf_fs_is_read_only(fs_false)); - test_assert_true( util_file_exists("mnt/mnt.lock")); - pthread_mutex_unlock(&data->mutex1); - pthread_mutex_lock(&data->mutex2); - enkf_fs_decref( fs_false ); - pthread_mutex_unlock(&data->mutex2); - exit(0); - } -} - -void test_fwrite_readonly( void * arg ) { - enkf_fs_type * fs = enkf_fs_safe_cast( arg ); - /* - The arguments here are completely bogus; the important thing is - that this fwrite call should be intercepted by a util_abort() - call (which is again intercepted by the testing function) before - the argument are actually accessed. - */ - enkf_fs_fwrite_node( fs , NULL , "KEY" , PARAMETER , 100 , 1 ); -} - -void initialise_shared() -{ - // place our shared data in shared memory - int prot = PROT_READ | PROT_WRITE; -#ifdef __linux - int flags = MAP_SHARED | MAP_ANONYMOUS; -#elif __APPLE__ - int flags = MAP_SHARED | MAP_ANON; -#endif - - data = mmap(NULL, sizeof(shared_data), prot, flags, -1, 0); - assert(data); - - // initialise mutex so it works properly in shared memory - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); - pthread_mutex_init(&data->mutex1, &attr); - pthread_mutex_init(&data->mutex2, &attr); -} - -/* - This test needs to fork off a seperate process to test the cross-process file locking. -*/ -void test_read_only2() { - initialise_shared(); - test_work_area_type * work_area = test_work_area_alloc("enkf_fs/read_only2"); - enkf_fs_create_fs("mnt" , BLOCK_FS_DRIVER_ID , NULL , false); - pthread_mutex_lock(&data->mutex2); - createFS(); - pthread_mutex_lock(&data->mutex1); - { - enkf_fs_type * fs_false = enkf_fs_mount( "mnt" ); - test_assert_true(enkf_fs_is_read_only(fs_false)); - test_assert_util_abort( "enkf_fs_fwrite_node" , test_fwrite_readonly , fs_false ); - enkf_fs_decref( fs_false ); - } - pthread_mutex_unlock(&data->mutex2); - pthread_mutex_unlock(&data->mutex1); - pthread_mutex_lock(&data->mutex2); - test_work_area_free( work_area ); - pthread_mutex_unlock(&data->mutex2); - munmap(data, sizeof(data)); -} - -int main(int argc, char ** argv) { - test_mount(); - test_refcount(); - test_read_only2(); - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_gen_data_config.c b/ThirdParty/Ert/libenkf/tests/enkf_gen_data_config.c deleted file mode 100644 index cb6049e650..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_gen_data_config.c +++ /dev/null @@ -1,373 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_gen_data_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include -#include -#include -#include - -#include "ert/util/build_config.h" - -#include -#include -#include -#include -#include -#include -#include -#include - - -void test_report_steps_param() { - - gen_data_config_type * config = gen_data_config_alloc_GEN_PARAM("KEY" , ASCII , ASCII); - test_assert_false( gen_data_config_is_dynamic( config )); - test_assert_int_equal( 0 , gen_data_config_num_report_step( config )); - test_assert_false( gen_data_config_has_report_step( config , 0 )); - - /* Add to parameter should fail. */ - gen_data_config_add_report_step( config , 10 ); - test_assert_int_equal( 0 , gen_data_config_num_report_step( config )); - test_assert_false( gen_data_config_has_report_step( config , 10 )); - - /* Add to parameter should fail. */ - gen_data_config_set_active_report_steps_from_string( config , "0-9,100"); - test_assert_int_equal( 0 , gen_data_config_num_report_step( config )); - test_assert_false( gen_data_config_has_report_step( config , 10 )); - - - gen_data_config_free( config ); -} - - -void test_report_steps_dynamic() { - gen_data_config_type * config = gen_data_config_alloc_GEN_DATA_result("KEY" , ASCII); - test_assert_true( gen_data_config_is_dynamic( config )); - test_assert_int_equal( 0 , gen_data_config_num_report_step( config )); - test_assert_false( gen_data_config_has_report_step( config , 0 )); - - gen_data_config_add_report_step( config , 10 ); - test_assert_int_equal( 1 , gen_data_config_num_report_step( config )); - test_assert_true( gen_data_config_has_report_step( config , 10 )); - test_assert_int_equal( gen_data_config_iget_report_step( config , 0 ) , 10); - - gen_data_config_add_report_step( config , 10 ); - test_assert_int_equal( 1 , gen_data_config_num_report_step( config )); - test_assert_true( gen_data_config_has_report_step( config , 10 )); - - - gen_data_config_add_report_step( config , 5 ); - test_assert_int_equal( 2 , gen_data_config_num_report_step( config )); - test_assert_true( gen_data_config_has_report_step( config , 10 )); - test_assert_int_equal( gen_data_config_iget_report_step( config , 0 ) , 5); - test_assert_int_equal( gen_data_config_iget_report_step( config , 1 ) , 10); - - { - const int_vector_type * active_steps = gen_data_config_get_active_report_steps( config ); - - test_assert_int_equal( int_vector_iget( active_steps , 0 ) , 5); - test_assert_int_equal( int_vector_iget( active_steps , 1 ) , 10); - } - - gen_data_config_set_active_report_steps_from_string( config , "0-3,7-10,100"); // 0,1,2,3,7,8,9,10,100 - test_assert_int_equal( 9 , gen_data_config_num_report_step( config )); - test_assert_int_equal( 0 , gen_data_config_iget_report_step( config , 0 )); - test_assert_int_equal( 3 , gen_data_config_iget_report_step( config , 3)); - test_assert_int_equal( 9 , gen_data_config_iget_report_step( config , 6)); - test_assert_int_equal( 100 , gen_data_config_iget_report_step( config , 8)); - - gen_data_config_free( config ); -} - - -void test_gendata_fload(const char * filename) { - test_work_area_type * work_area = test_work_area_alloc( "test_gendata_fload"); - gen_data_config_type * config = gen_data_config_alloc_GEN_DATA_result("KEY" , ASCII); - gen_data_type * gen_data = gen_data_alloc(config); - - const char * cwd = test_work_area_get_cwd(work_area); - enkf_fs_type * write_fs = enkf_fs_create_fs(cwd, BLOCK_FS_DRIVER_ID, NULL , true); - run_arg_type * run_arg = run_arg_alloc_ENSEMBLE_EXPERIMENT(write_fs , 0,0,"path"); - forward_load_context_type * load_context = forward_load_context_alloc( run_arg , false , NULL , NULL , NULL); - forward_load_context_select_step(load_context , 0 ); - gen_data_fload_with_report_step(gen_data, filename , load_context); - int data_size = gen_data_config_get_data_size(config, 0); - test_assert_true(data_size > 0); - enkf_fs_decref( write_fs ); - - gen_data_free(gen_data); - gen_data_config_free( config ); - test_work_area_free(work_area); - run_arg_free( run_arg ); - forward_load_context_free( load_context ); -} - - -void test_gendata_fload_empty_file(const char * filename) { - test_work_area_type * work_area = test_work_area_alloc( "test_gendata_fload_empty_file" ); - gen_data_config_type * config = gen_data_config_alloc_GEN_DATA_result("KEY" , ASCII); - gen_data_type * gen_data = gen_data_alloc(config); - const char * cwd = test_work_area_get_cwd(work_area); - enkf_fs_type * write_fs = enkf_fs_create_fs(cwd, BLOCK_FS_DRIVER_ID, NULL , true); - run_arg_type * run_arg = run_arg_alloc_ENSEMBLE_EXPERIMENT(write_fs , 0,0,"path"); - forward_load_context_type * load_context = forward_load_context_alloc( run_arg , false , NULL , NULL , NULL); - - forward_load_context_select_step(load_context , 0 ); - gen_data_fload_with_report_step(gen_data, filename, load_context); - int data_size = gen_data_config_get_data_size(config, 0); - test_assert_true(data_size == 0); - enkf_fs_decref( write_fs ); - - gen_data_free(gen_data); - gen_data_config_free( config ); - test_work_area_free(work_area); - run_arg_free( run_arg ); - forward_load_context_free( load_context ); -} - - -void test_result_format() { - test_assert_true( gen_data_config_valid_result_format("path/file%d/extra")); - test_assert_true( gen_data_config_valid_result_format("file%04d")); - test_assert_false( gen_data_config_valid_result_format("/path/file%04d")); - - test_assert_false( gen_data_config_valid_result_format("/path/file%s")); - test_assert_false( gen_data_config_valid_result_format("/path/file")); - test_assert_false( gen_data_config_valid_result_format("/path/file%f")); - - test_assert_false( gen_data_config_valid_result_format(NULL)); -} - - -void alloc_invalid_io_format1( void * arg) { - gen_data_config_type * config = gen_data_config_alloc_GEN_DATA_result("KEY" , ASCII_TEMPLATE ); - gen_data_config_free( config ); -} - - -void alloc_invalid_io_format2( void * arg) { - gen_data_config_type * config = gen_data_config_alloc_GEN_DATA_state("KEY" , GEN_DATA_UNDEFINED , ASCII); - gen_data_config_free( config ); -} - - -void alloc_invalid_io_format3( void *arg) { - gen_data_config_type * config = gen_data_config_alloc_GEN_PARAM("KEY" , ASCII , ASCII_TEMPLATE ); - gen_data_config_free( config ); -} - - - -void test_set_invalid_format() { - test_assert_util_abort( "gen_data_config_alloc_GEN_DATA_result" , alloc_invalid_io_format1 , NULL); - test_assert_util_abort( "gen_data_config_alloc_GEN_DATA_state" , alloc_invalid_io_format2 , NULL); - test_assert_util_abort( "gen_data_config_alloc_GEN_PARAM" , alloc_invalid_io_format3 , NULL); -} - - -void test_format_check() { - test_assert_int_equal( GEN_DATA_UNDEFINED , gen_data_config_check_format( NULL )); - test_assert_int_equal( GEN_DATA_UNDEFINED , gen_data_config_check_format("Error?")); - test_assert_int_equal( ASCII , gen_data_config_check_format("ASCII")); - test_assert_int_equal( ASCII_TEMPLATE , gen_data_config_check_format("ASCII_TEMPLATE")); - test_assert_int_equal( BINARY_DOUBLE , gen_data_config_check_format("BINARY_DOUBLE")); - test_assert_int_equal( BINARY_FLOAT , gen_data_config_check_format("BINARY_FLOAT")); -} - - -void test_set_template_invalid() { - test_work_area_type * work_area = test_work_area_alloc("GEN_DATA_SET_TEMPLATE_INVALID"); - gen_data_config_type * config = gen_data_config_alloc_GEN_PARAM("KEY" , ASCII , ASCII); - - test_assert_false( gen_data_config_set_template( config , "does/not/exist" , NULL ) ); - - { - FILE * stream = util_fopen("template.txt" , "w"); - fprintf(stream , "Header1\n\nHeader2\n"); - fclose( stream ); - - gen_data_config_set_template( config , "template.txt" , ""); - test_assert_string_equal( "template.txt" , gen_data_config_get_template_file( config )); - test_assert_string_equal( "" , gen_data_config_get_template_key( config )); - - - { - char * buffer; - int data_offset , buffer_size , data_skip; - gen_data_config_get_template_data( config , &buffer , &data_offset , &buffer_size , &data_skip); - - test_assert_string_equal( buffer , "Header1\n\nHeader2\n"); - test_assert_int_equal( data_offset , 8 ); - test_assert_int_equal( buffer_size , 22 ); - test_assert_int_equal( data_skip , 5 ); - } - } - - - { - FILE * stream = util_fopen("template2.txt" , "w"); - fprintf(stream , "Template XYZ - lots of shit .... \n"); - fclose( stream ); - - test_assert_false( gen_data_config_set_template( config , "template2.txt" , "")); - - test_assert_string_equal( "template.txt" , gen_data_config_get_template_file( config )); - test_assert_string_equal( "" , gen_data_config_get_template_key( config )); - { - char * buffer; - int data_offset , buffer_size , data_skip; - gen_data_config_get_template_data( config , &buffer , &data_offset , &buffer_size , &data_skip); - - test_assert_string_equal( buffer , "Header1\n\nHeader2\n"); - test_assert_int_equal( data_offset , 8 ); - test_assert_int_equal( buffer_size , 22 ); - test_assert_int_equal( data_skip , 5 ); - } - } - - gen_data_config_free( config ); - test_work_area_free( work_area ); -} - - - -void test_set_template() { - test_work_area_type * work_area = test_work_area_alloc("GEN_DATA_SET_TEMPLATE"); - { - gen_data_config_type * config = gen_data_config_alloc_GEN_PARAM("KEY" , ASCII , ASCII); - - test_assert_true( gen_data_config_set_template( config , NULL , NULL ) ); - test_assert_NULL( gen_data_config_get_template_file( config )); - test_assert_NULL( gen_data_config_get_template_key( config )); - - { - char * buffer; - int data_offset , buffer_size , data_skip; - gen_data_config_get_template_data( config , &buffer , &data_offset , &buffer_size , &data_skip); - - test_assert_NULL( buffer ); - test_assert_int_equal( data_offset , 0 ); - test_assert_int_equal( buffer_size , 0 ); - test_assert_int_equal( data_skip , 0 ); - } - - - { - FILE * stream = util_fopen("template.txt" , "w"); - fprintf(stream , "Header\n"); - fclose( stream ); - - test_assert_true( gen_data_config_set_template( config , "template.txt" , NULL )); - test_assert_string_equal( "template.txt" , gen_data_config_get_template_file( config )); - test_assert_NULL( gen_data_config_get_template_key( config )); - - - { - char * buffer; - int data_offset , buffer_size , data_skip; - gen_data_config_get_template_data( config , &buffer , &data_offset , &buffer_size , &data_skip); - - test_assert_string_equal( buffer , "Header\n"); - test_assert_int_equal( data_offset , 7 ); - test_assert_int_equal( buffer_size , 7 ); - test_assert_int_equal( data_skip , 0 ); - } - } - - { - FILE * stream = util_fopen("template.txt" , "w"); - fprintf(stream , "Header1\n\nHeader2\n"); - fclose( stream ); - - gen_data_config_set_template( config , "template.txt" , ""); - test_assert_string_equal( "template.txt" , gen_data_config_get_template_file( config )); - test_assert_string_equal( "" , gen_data_config_get_template_key( config )); - - - { - char * buffer; - int data_offset , buffer_size , data_skip; - gen_data_config_get_template_data( config , &buffer , &data_offset , &buffer_size , &data_skip); - - test_assert_string_equal( buffer , "Header1\n\nHeader2\n"); - test_assert_int_equal( data_offset , 8 ); - test_assert_int_equal( buffer_size , 22 ); - test_assert_int_equal( data_skip , 5 ); - } - } - - - gen_data_config_set_template( config , NULL , NULL ); - test_assert_NULL( gen_data_config_get_template_file( config )); - test_assert_NULL( gen_data_config_get_template_key( config )); - - { - char * buffer; - int data_offset , buffer_size , data_skip; - gen_data_config_get_template_data( config , &buffer , &data_offset , &buffer_size , &data_skip); - - test_assert_NULL( buffer ); - test_assert_int_equal( data_offset , 0 ); - test_assert_int_equal( buffer_size , 0 ); - test_assert_int_equal( data_skip , 0 ); - } - - - test_assert_true( gen_data_config_set_template( config , NULL , "KEY")); - test_assert_NULL( gen_data_config_get_template_file( config )); - test_assert_NULL( gen_data_config_get_template_key( config )); - - { - char * buffer; - int data_offset , buffer_size , data_skip; - gen_data_config_get_template_data( config , &buffer , &data_offset , &buffer_size , &data_skip); - - test_assert_NULL( buffer ); - test_assert_int_equal( data_offset , 0 ); - test_assert_int_equal( buffer_size , 0 ); - test_assert_int_equal( data_skip , 0 ); - } - - - gen_data_config_free( config ); - } - test_work_area_free( work_area ); -} - - -int main(int argc , char ** argv) { - - const char * gendata_file = argv[1]; - const char * gendata_file_empty = argv[2]; - util_install_signals(); - - test_report_steps_param(); - test_report_steps_dynamic(); - test_result_format(); - test_set_template(); - test_set_template_invalid(); - test_set_invalid_format(); - test_format_check(); - test_gendata_fload(gendata_file); - test_gendata_fload_empty_file(gendata_file_empty); - - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_gen_data_config_parse.c b/ThirdParty/Ert/libenkf/tests/enkf_gen_data_config_parse.c deleted file mode 100644 index 2d9de2ba9e..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_gen_data_config_parse.c +++ /dev/null @@ -1,253 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_gen_data_config_parse.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include -#include -#include - - -enkf_config_node_type * parse_alloc_GEN_PARAM( const char * config_string , bool parse_valid) { - config_parser_type * config = config_alloc(); - enkf_config_node_type * enkf_config_node = NULL; - - enkf_config_node_add_GEN_PARAM_config_schema( config ); - { - FILE * stream = util_fopen("config.txt" , "w"); - fprintf(stream , config_string); - fclose( stream ); - } - - { - config_content_type * content = config_parse( config , "config.txt" , "--" , NULL , NULL , NULL , CONFIG_UNRECOGNIZED_IGNORE , true); - - test_assert_bool_equal( parse_valid , config_content_is_valid( content )); - if (parse_valid) { - const config_content_item_type * config_item = config_content_get_item( content , GEN_PARAM_KEY ); - const config_content_node_type * config_node = config_content_item_iget_node( config_item , 0 ); - - enkf_config_node = enkf_config_node_alloc_GEN_PARAM_from_config( config_node ); - } - config_content_free( content ); - config_free( config ); - } - return enkf_config_node; -} - - - - - -void test_parse_gen_param() { - test_work_area_type * work_area = test_work_area_alloc("GEN_PARAM_parse"); - - // Parse error: missing eclfile - { - enkf_config_node_type * config_node = parse_alloc_GEN_PARAM( "GEN_PARAM KEY\n" , false); - test_assert_NULL( config_node ); - } - - // Missing all required KEY: arguments - { - enkf_config_node_type * config_node = parse_alloc_GEN_PARAM( "GEN_PARAM KEY ECLFILE\n" , true); - test_assert_NULL( config_node ); - } - - - // OUTPUT_FORMAT: Is incorrectly spelled - { - enkf_config_node_type * config_node = parse_alloc_GEN_PARAM( "GEN_PARAM KEY ECLFILE INIT_FILES:XXX INPUT_FORMAT:ASCII OutPutFOrmat:ASCII\n" , true); - test_assert_NULL( config_node ); - } - - - // OUTPUT_FORMAT: ASCII is incorrectly spelled - { - enkf_config_node_type * config_node = parse_alloc_GEN_PARAM( "GEN_PARAM KEY ECLFILE INIT_FILES:XXX INPUT_FORMAT:ASCII OUTPUT_FORMAT:ASCI\n" , true); - test_assert_NULL( config_node ); - } - - // Invalid value for INPUT_FORMAT - { - enkf_config_node_type * config_node = parse_alloc_GEN_PARAM( "GEN_PARAM KEY ECLFILE INIT_FILES:XXX INPUT_FORMAT:ASCII_TEMPLATE OUTPUT_FORMAT:ASCII\n" , true); - test_assert_NULL( config_node ); - } - - - // Correct - { - enkf_config_node_type * config_node = parse_alloc_GEN_PARAM( "GEN_PARAM KEY ECLFILE INPUT_FORMAT:BINARY_DOUBLE OUTPUT_FORMAT:ASCII INIT_FILES:INIT%%d\n" , true); - - test_assert_string_equal( "ECLFILE" , enkf_config_node_get_enkf_outfile( config_node )); - test_assert_NULL( enkf_config_node_get_enkf_infile( config_node )); - test_assert_string_equal( "INIT%d" , enkf_config_node_get_init_file_fmt( config_node )); - test_assert_int_equal( PARAMETER , enkf_config_node_get_var_type( config_node )); - { - gen_data_config_type * gen_data_config = enkf_config_node_get_ref( config_node ); - test_assert_int_equal( BINARY_DOUBLE , gen_data_config_get_input_format( gen_data_config )); - test_assert_int_equal( ASCII , gen_data_config_get_output_format( gen_data_config )); - } - - enkf_config_node_free( config_node ); - } - - test_work_area_free( work_area ); -} - - - -enkf_config_node_type * parse_alloc_GEN_DATA_result( const char * config_string , bool parse_valid) { - config_parser_type * config = config_alloc(); - enkf_config_node_type * enkf_config_node = NULL; - - enkf_config_node_add_GEN_DATA_config_schema( config ); - { - FILE * stream = util_fopen("config.txt" , "w"); - fprintf(stream , config_string); - fclose( stream ); - } - { - config_content_type * content = config_parse( config , "config.txt" , "--" , NULL , NULL , NULL , CONFIG_UNRECOGNIZED_IGNORE , true); - test_assert_bool_equal( parse_valid ,config_content_is_valid( content ) ); - if (parse_valid) { - const config_content_item_type * config_item = config_content_get_item( content , GEN_DATA_KEY ); - const config_content_node_type * config_node = config_content_item_iget_node( config_item , 0 ); - - enkf_config_node = enkf_config_node_alloc_GEN_DATA_from_config( config_node ); - } - - config_content_free( content ); - config_free( config ); - } - return enkf_config_node; -} - - - -void test_parse_gen_data_result() { - test_work_area_type * work_area = test_work_area_alloc("GEN_DATA_RESULT_parse"); - // Parse error: missing KEY - { - enkf_config_node_type * config_node = parse_alloc_GEN_DATA_result( "GEN_DATA\n" , false); - test_assert_NULL( config_node ); - } - - // Validation error: missing INPUT_FORMAT: - { - enkf_config_node_type * config_node = parse_alloc_GEN_DATA_result( "GEN_DATA GEN_DATA_KEY RESULT_FILE:Results%%d REPORT_STEPS:10 \n" , true); - test_assert_NULL( config_node ); - } - - - // Validation error: Invalid INPUT_FORMAT: - { - enkf_config_node_type * config_node = parse_alloc_GEN_DATA_result( "GEN_DATA GEN_DATA_KEY RESULT_FILE:Results%%d INPUT_FORMAT:AsCiiiiii REPORT_STEPS:10 \n" , true); - test_assert_NULL( config_node ); - } - - - // Validation error: missing RESULT_FILE: - { - enkf_config_node_type * config_node = parse_alloc_GEN_DATA_result( "GEN_DATA GEN_DATA_KEY INPUT_FORMAT:ASCII REPORT_STEPS:10 \n" , true); - test_assert_NULL( config_node ); - } - - - // Validation error: Invalid RESULT_FILE: - { - enkf_config_node_type * config_node = parse_alloc_GEN_DATA_result( "GEN_DATA GEN_DATA_KEY RESULT_FILE:Results INPUT_FORMAT:ASCII REPORT_STEPS:10 \n" , true); - test_assert_NULL( config_node ); - } - - // Validation error: Missing REPORT_STEPS: - { - enkf_config_node_type * config_node = parse_alloc_GEN_DATA_result( "GEN_DATA GEN_DATA_KEY RESULT_FILE:Results%%d INPUT_FORMAT:ASCII \n" , true); - test_assert_NULL( config_node ); - } - - // Validation error: Invalid REPORT_STEPS - { - enkf_config_node_type * config_node = parse_alloc_GEN_DATA_result( "GEN_DATA GEN_DATA_KEY RESULT_FILE:Results%%d INPUT_FORMAT:ASCII REPORT_STEPS:XXX\n" , true); - test_assert_NULL( config_node ); - } - - // Valid - { - enkf_config_node_type * config_node = parse_alloc_GEN_DATA_result( "GEN_DATA GEN_DATA_KEY RESULT_FILE:Results%%d INPUT_FORMAT:ASCII REPORT_STEPS:10,20,30\n" , true); - test_assert_true( enkf_config_node_is_instance( config_node )); - - test_assert_string_equal( "Results%d" , enkf_config_node_get_enkf_infile( config_node )); - test_assert_NULL( enkf_config_node_get_init_file_fmt( config_node )); - test_assert_NULL( enkf_config_node_get_enkf_outfile( config_node )); - test_assert_int_equal( DYNAMIC_RESULT , enkf_config_node_get_var_type( config_node )); - { - gen_data_config_type * gen_data_config = enkf_config_node_get_ref( config_node ); - test_assert_int_equal( ASCII , gen_data_config_get_input_format( gen_data_config )); - test_assert_int_equal( GEN_DATA_UNDEFINED , gen_data_config_get_output_format( gen_data_config )); - - test_assert_int_equal( 3 , gen_data_config_num_report_step( gen_data_config )); - test_assert_int_equal( 10 , gen_data_config_iget_report_step( gen_data_config , 0 )); - test_assert_int_equal( 30 , gen_data_config_iget_report_step( gen_data_config , 2 )); - - - test_assert_true( gen_data_config_has_report_step( gen_data_config , 10 )); - test_assert_true( gen_data_config_has_report_step( gen_data_config , 20 )); - test_assert_true( gen_data_config_has_report_step( gen_data_config , 30 )); - - test_assert_false( gen_data_config_has_report_step( gen_data_config , 05 )); - test_assert_false( gen_data_config_has_report_step( gen_data_config , 15 )); - test_assert_false( gen_data_config_has_report_step( gen_data_config , 25 )); - test_assert_false( gen_data_config_has_report_step( gen_data_config , 35 )); - - } - test_assert_true( enkf_config_node_internalize( config_node , 10 )); - test_assert_true( enkf_config_node_internalize( config_node , 20 )); - test_assert_true( enkf_config_node_internalize( config_node , 30 )); - - test_assert_false( enkf_config_node_internalize( config_node , 05 )); - test_assert_false( enkf_config_node_internalize( config_node , 15 )); - test_assert_false( enkf_config_node_internalize( config_node , 25 )); - test_assert_false( enkf_config_node_internalize( config_node , 35 )); - - enkf_config_node_free( config_node ); - } - - test_work_area_free( work_area ); -} - - - - -int main(int argc , char ** argv) { - test_parse_gen_param(); - test_parse_gen_data_result(); - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_gen_obs_load.c b/ThirdParty/Ert/libenkf/tests/enkf_gen_obs_load.c deleted file mode 100644 index 1b84af5f34..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_gen_obs_load.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_gen_obs_load.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - - - -void test_obs_check_report_steps(const char * config_file ) { - ert_test_context_type * test_context = ert_test_context_alloc( "GEN_OBS" , config_file ); - enkf_main_type * enkf_main = ert_test_context_get_main( test_context ); - enkf_obs_type * obs = enkf_main_get_obs( enkf_main ); - - test_assert_true( enkf_obs_has_key( obs , "GEN_OBS10")); - test_assert_true( enkf_obs_has_key( obs , "GEN_OBS20")); - test_assert_false( enkf_obs_has_key( obs , "GEN_OBS30")); - - ert_test_context_free( test_context ); -} - - - - - - -int main(int argc , char ** argv) { - const char * config_file = argv[1]; - - test_obs_check_report_steps( config_file ); - -} - - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_hook_manager_test.c b/ThirdParty/Ert/libenkf/tests/enkf_hook_manager_test.c deleted file mode 100644 index 742d2f86de..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_hook_manager_test.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_ecl_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. - */ -#include -#include -#include -#include - -int main(int argc, char ** argv) { - - ert_workflow_list_type * list = NULL; - hook_manager_type * hook_manager = hook_manager_alloc(list); - - char * expected_path = util_alloc_abs_path(".ert_runpath_list"); - test_assert_string_equal(expected_path, hook_manager_get_runpath_list_file(hook_manager)); - free(expected_path); - - hook_manager_set_runpath_list_file(hook_manager, "Folder", NULL); - expected_path = util_alloc_abs_path("Folder/.ert_runpath_list"); - test_assert_string_equal(expected_path, hook_manager_get_runpath_list_file(hook_manager)); - free(expected_path); - - hook_manager_set_runpath_list_file(hook_manager, "Folder", "thefilename.txt"); - expected_path = util_alloc_abs_path("Folder/thefilename.txt"); - test_assert_string_equal(expected_path, hook_manager_get_runpath_list_file(hook_manager)); - free(expected_path); - - hook_manager_set_runpath_list_file(hook_manager, "/tmp/ouagadogo", "thefilename.txt"); - test_assert_string_equal("/tmp/ouagadogo/thefilename.txt", hook_manager_get_runpath_list_file(hook_manager)); - - hook_manager_free(hook_manager); - - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_iter_config.c b/ThirdParty/Ert/libenkf/tests/enkf_iter_config.c deleted file mode 100644 index 3f297eb8e4..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_iter_config.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_iter_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - -#include -#include -#include - - -#define TMP_PATH "/tmp" -char * create_config_file( const char * enspath_fmt , const char * runpath_fmt , int iter_count) { - char * config_file = util_alloc_tmp_file(TMP_PATH , "iter-config" , false); - FILE * stream = util_fopen( config_file , "w"); - fprintf(stream , "%s %s\n" , ITER_CASE_KEY , enspath_fmt); - fprintf(stream , "%s %d\n" , ITER_COUNT_KEY , iter_count); - fclose( stream ); - return config_file; -} - - - -void test_set() { - analysis_iter_config_type * iter_config = analysis_iter_config_alloc(); - - test_assert_false( analysis_iter_config_case_fmt_set( iter_config )); - analysis_iter_config_set_case_fmt( iter_config , "case%d"); - test_assert_true( analysis_iter_config_case_fmt_set( iter_config )); - - test_assert_false( analysis_iter_config_num_iterations_set( iter_config )); - analysis_iter_config_set_num_iterations( iter_config , 77 ); - test_assert_true( analysis_iter_config_num_iterations_set( iter_config )); - - test_assert_int_equal( analysis_iter_config_get_num_retries_per_iteration(iter_config), 4); - analysis_iter_config_set_num_retries_per_iteration(iter_config , 10 ); - test_assert_int_equal( analysis_iter_config_get_num_retries_per_iteration(iter_config), 10); - - - analysis_iter_config_free( iter_config ); -} - - - - -int main(int argc , char ** argv) { - const char * enspath_fmt = "iter%d"; - const char * runpath_fmt = "run/iter%d/real%d"; - const int iter_count = 10; - char * config_file = create_config_file( enspath_fmt , runpath_fmt , iter_count); - - - config_parser_type * config = config_alloc(); - config_content_type * content; - analysis_iter_config_add_config_items( config ); - - content = config_parse( config , config_file , NULL , NULL , NULL , NULL , CONFIG_UNRECOGNIZED_ERROR , true); - test_assert_true( config_content_is_valid( content) ); - - test_assert_true( config_content_has_item( content , ITER_CASE_KEY )); - test_assert_true( config_content_has_item( content , ITER_COUNT_KEY )); - - { - analysis_iter_config_type * iter_config = analysis_iter_config_alloc(); - char itercase[50]; - sprintf(itercase,DEFAULT_ANALYSIS_ITER_CASE,5); - test_assert_string_equal( analysis_iter_config_iget_case( iter_config , 5) , itercase ); - analysis_iter_config_init( iter_config , content ); - - test_assert_int_equal( analysis_iter_config_get_num_iterations( iter_config ) , iter_count ); - test_assert_string_equal( analysis_iter_config_iget_case( iter_config , 5) , "iter5"); - - analysis_iter_config_free( iter_config ); - } - remove( config_file ); - free( config_file ); - config_content_free( content ); - config_free( config ); - - test_set(); - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_local_obsdata.c b/ThirdParty/Ert/libenkf/tests/enkf_local_obsdata.c deleted file mode 100644 index 594f08ac6e..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_local_obsdata.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_local_obsdata.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include - -#include -#include - - -void test_wrapper() { - local_obsdata_node_type * node = local_obsdata_node_alloc("KEY" , true); - local_obsdata_type * data = local_obsdata_alloc_wrapper( node ); - test_assert_true( local_obsdata_is_instance( data )); - test_assert_int_equal( 1 , local_obsdata_get_size( data )); - test_assert_ptr_equal( node , local_obsdata_iget( data , 0 )); - test_assert_true( local_obsdata_has_node( data , "KEY" )); - test_assert_false( local_obsdata_has_node( data , "KEYX" )); - test_assert_string_equal( local_obsdata_node_get_key( node ) , local_obsdata_get_name( data )); - local_obsdata_free( data ); -} - - -int main(int argc , char ** argv) { - local_obsdata_type * obsdata; - - obsdata = local_obsdata_alloc( "KEY"); - test_assert_true( local_obsdata_is_instance( obsdata )); - test_assert_int_equal( 0 , local_obsdata_get_size( obsdata )); - test_assert_string_equal( "KEY" , local_obsdata_get_name( obsdata )); - - { - local_obsdata_node_type * obsnode = local_obsdata_node_alloc( "KEY" , true); - test_assert_true( local_obsdata_add_node( obsdata , obsnode ) ); - test_assert_false( local_obsdata_add_node( obsdata , obsnode ) ); - test_assert_int_equal( 1 , local_obsdata_get_size( obsdata )); - test_assert_ptr_equal( obsnode , local_obsdata_iget( obsdata , 0)); - } - - local_obsdata_free( obsdata ); - - test_wrapper(); - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_local_obsdata_node.c b/ThirdParty/Ert/libenkf/tests/enkf_local_obsdata_node.c deleted file mode 100644 index a5d1d43622..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_local_obsdata_node.c +++ /dev/null @@ -1,103 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_local_obsdata_node.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include - -#include -#include - - -void test_content( local_obsdata_node_type * node ) { - const active_list_type * active_list = local_obsdata_node_get_active_list( node ); - - test_assert_not_NULL( active_list ); - test_assert_true( active_list_is_instance( active_list )); - - { - active_list_type * new_active_list = active_list_alloc( ); - - active_list_add_index( new_active_list , 1098 ); - - test_assert_false( active_list_equal( new_active_list , local_obsdata_node_get_active_list( node ))); - local_obsdata_node_copy_active_list( node , new_active_list ); - test_assert_true( active_list_equal( new_active_list , local_obsdata_node_get_active_list( node ))); - - } - { - - - local_obsdata_node_add_tstep( node , 20 ); - local_obsdata_node_add_tstep( node , 10 ); - local_obsdata_node_add_tstep( node , 10 ); // Second add - ignored - - test_assert_false( local_obsdata_node_tstep_active(node, 5)); - test_assert_true( local_obsdata_node_tstep_active(node, 10)); - test_assert_true( local_obsdata_node_tstep_active(node, 20)); - test_assert_true( local_obsdata_node_has_tstep( node , 10 )); - test_assert_true( local_obsdata_node_has_tstep( node , 20 )); - test_assert_false( local_obsdata_node_has_tstep( node , 15 )); - - - local_obsdata_node_add_range( node , 5 , 7 ); - test_assert_true( local_obsdata_node_tstep_active(node, 5)); - test_assert_true( local_obsdata_node_tstep_active(node, 7)); - } - -} - -void test_all_active() { - local_obsdata_node_type * node = local_obsdata_node_alloc( "KEY" , true); - - test_assert_true( local_obsdata_node_all_timestep_active( node )); - test_assert_true( local_obsdata_node_tstep_active( node , 0 )); - test_assert_true( local_obsdata_node_tstep_active( node , 10 )); - test_assert_true( local_obsdata_node_tstep_active( node , 20 )); - - local_obsdata_node_free( node ); -} - - - - - - -int main(int argc , char ** argv) { - const char * obs_key = "1234"; - - { - local_obsdata_node_type * node = local_obsdata_node_alloc( obs_key , true); - - test_assert_true( local_obsdata_node_is_instance( node )); - test_assert_string_equal( obs_key , local_obsdata_node_get_key( node )); - test_content( node ); - local_obsdata_node_free( node ); - } - - { - void * node = local_obsdata_node_alloc( obs_key ,true ); - local_obsdata_node_free__( node ); - } - test_all_active(); - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_magic_string_in_workflows.c b/ThirdParty/Ert/libenkf/tests/enkf_magic_string_in_workflows.c deleted file mode 100644 index 88bc0a14fd..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_magic_string_in_workflows.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_magic_string_in_workflows.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include -#include - - -void test_magic_strings( ert_test_context_type * test_context ) { - enkf_main_type * enkf_main = ert_test_context_get_main( test_context ); - test_assert_true( ert_test_context_run_worklow( test_context , "MAGIC_PRINT") ); - test_assert_true( util_file_exists( "magic-list.txt") ); - - { - FILE * stream = util_fopen("magic-list.txt" , "r"); - char string[128]; - - fscanf( stream , "%s" , string); - test_assert_string_equal( string , enkf_fs_get_case_name( enkf_main_get_fs( enkf_main ))); - - fscanf( stream , "%s" , string); - test_assert_string_equal( string , "MagicAllTheWayToWorkFlow"); - - fclose( stream ); - } -} - - -void test_has_job(ert_test_context_type * test_context ) { - enkf_main_type * enkf_main = ert_test_context_get_main( test_context ); - ert_workflow_list_type * workflows = enkf_main_get_workflow_list( enkf_main ); - test_assert_true( ert_workflow_list_has_job( workflows , "MAGIC_PRINT" )); -} - - -int main( int argc , char ** argv) { - const char * model_config = argv[1]; - ert_test_context_type * test_context = ert_test_context_alloc( "MAGIC-STRINGS" , model_config); - enkf_main_type * enkf_main = ert_test_context_get_main( test_context ); - - { - test_has_job( test_context ); - - enkf_main_select_fs(enkf_main , "default"); - test_assert_string_equal( "default" , enkf_fs_get_case_name( enkf_main_get_fs( enkf_main ))); - test_magic_strings( test_context ); - - enkf_main_select_fs(enkf_main , "extraCase"); - test_assert_string_equal( "extraCase" , enkf_fs_get_case_name( enkf_main_get_fs( enkf_main ))); - test_magic_strings( test_context ); - } - ert_test_context_free( test_context ); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_main.c b/ThirdParty/Ert/libenkf/tests/enkf_main.c deleted file mode 100644 index 32db707aad..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_main.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_main.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - - - - -void test_case_initialized() { - test_work_area_type * work_area = test_work_area_alloc("enkf_main_case_initialized" ); - { - enkf_main_type * enkf_main = enkf_main_alloc_empty(); - model_config_type * model_config = enkf_main_get_model_config(enkf_main); - const char * new_case = "fs/case"; - char * mount_point = util_alloc_sprintf("%s/%s" , model_config_get_enspath(model_config) , new_case); - enkf_fs_create_fs(mount_point , BLOCK_FS_DRIVER_ID , NULL , false); - - test_assert_false(enkf_main_case_is_initialized(enkf_main , "does/not/exist" , NULL)); - test_assert_true(enkf_main_case_is_initialized(enkf_main , new_case , NULL)); - - enkf_main_free(enkf_main); - } - test_work_area_free(work_area); -} - - - -void test_create() { - enkf_main_type * enkf_main = enkf_main_alloc_empty(); - test_assert_true( enkf_main_is_instance( enkf_main ) ); - enkf_main_free( enkf_main ); -} - - - -int main(int argc , char ** argv) { - util_install_signals(); - test_create(); - test_case_initialized(); - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_main_fs.c b/ThirdParty/Ert/libenkf/tests/enkf_main_fs.c deleted file mode 100644 index ce01664b83..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_main_fs.c +++ /dev/null @@ -1,124 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_main_fs.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include -#include - -#include -#include -#include -#include -#include - - - - - - - -int main(int argc, char ** argv) { - const char * config_file = argv[1]; - test_work_area_type * work_area = test_work_area_alloc( "enkf_main_fs" ); - char * model_config; - util_alloc_file_components( config_file , NULL , &model_config , NULL); - test_work_area_copy_parent_content( work_area , config_file ); - { - enkf_main_type * enkf_main = enkf_main_bootstrap( model_config , false , false ); - - enkf_main_select_fs( enkf_main , "enkf"); - test_assert_true( enkf_main_case_is_current( enkf_main , "enkf")); - test_assert_false( enkf_main_case_is_current( enkf_main , "default_fs")); - test_assert_false( enkf_main_case_is_current( enkf_main , "does_not_exist")); - - test_assert_int_equal( 1 , enkf_fs_get_refcount( enkf_main_get_fs( enkf_main ))); - { - enkf_fs_type * fs_ref = enkf_main_get_fs_ref( enkf_main ); - test_assert_int_equal( 2 , enkf_fs_get_refcount( enkf_main_get_fs( enkf_main ))); - enkf_fs_decref( fs_ref ); - test_assert_int_equal( 1 , enkf_fs_get_refcount( enkf_main_get_fs( enkf_main ))); - } - - { - state_map_type * map1 = enkf_fs_get_state_map( enkf_main_get_fs( enkf_main )); - state_map_type * map2 = enkf_main_alloc_readonly_state_map(enkf_main , "enkf"); - test_assert_true(state_map_equal( map1 , map2 )); - state_map_free( map2 ); - } - { - enkf_fs_type * fs1 = enkf_main_mount_alt_fs( enkf_main , "default" , false ); - enkf_fs_type * fs2 = enkf_main_mount_alt_fs( enkf_main , "enkf" , false ); - - test_assert_int_equal( 2 , enkf_fs_get_refcount( enkf_main_get_fs( enkf_main ))); - test_assert_int_equal( 2 , enkf_fs_get_refcount( fs2 )); - test_assert_int_equal( 1 , enkf_fs_get_refcount( fs1 )); - - enkf_fs_decref( fs1 ); - enkf_fs_decref( fs2 ); - } - - { - enkf_fs_type * enkf_fs = enkf_main_mount_alt_fs( enkf_main , "enkf" , false ); - - enkf_main_select_fs( enkf_main , "default"); - test_assert_int_equal( 1 , enkf_fs_get_refcount( enkf_main_get_fs( enkf_main ))); - enkf_fs_decref( enkf_fs ); - } - - { - enkf_fs_type * default_fs = enkf_main_mount_alt_fs( enkf_main , "default" , false ); - - test_assert_int_equal( 2 , enkf_fs_get_refcount( enkf_main_get_fs( enkf_main ))); - enkf_main_select_fs( enkf_main , "default"); - test_assert_int_equal( 2 , enkf_fs_get_refcount( enkf_main_get_fs( enkf_main ))); - enkf_fs_decref( default_fs ); - test_assert_int_equal( 1 , enkf_fs_get_refcount( enkf_main_get_fs( enkf_main ))); - } - /*****************************************************************/ - { - enkf_fs_type * fs = enkf_main_mount_alt_fs( enkf_main , "default" , false ); - test_assert_int_equal( 2 , enkf_fs_get_refcount( enkf_main_get_fs( enkf_main ))); - - enkf_main_set_fs( enkf_main , fs , NULL ); - enkf_fs_decref( fs ); - test_assert_int_equal( 1 , enkf_fs_get_refcount( enkf_main_get_fs( enkf_main ))); - } - { - enkf_fs_type * fs = enkf_main_mount_alt_fs( enkf_main , "enkf" , false ); - enkf_fs_type * current = enkf_main_mount_alt_fs( enkf_main , "default" , false ); - - test_assert_int_equal( 2 , enkf_fs_get_refcount( current )); - test_assert_int_equal( 1 , enkf_fs_get_refcount( fs)); - enkf_main_set_fs( enkf_main , fs , NULL); - test_assert_int_equal( 2 , enkf_fs_get_refcount( fs)); - test_assert_int_equal( 1 , enkf_fs_get_refcount( current )); - - enkf_fs_decref( current ); - enkf_fs_decref( fs); - } - - - - - test_assert_int_equal( 1 , enkf_fs_get_refcount( enkf_main_get_fs( enkf_main ))); - enkf_main_free( enkf_main ); - } - test_work_area_free( work_area ); - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_main_fs_current_file_test.c b/ThirdParty/Ert/libenkf/tests/enkf_main_fs_current_file_test.c deleted file mode 100644 index 4f39d32cfe..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_main_fs_current_file_test.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_main_fs_current_file_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include -#include - -#include -#include -#include -#include - -void test_current_file_not_present_symlink_present(const char * model_config) { - test_assert_true(util_file_exists("Storage/enkf")); - util_make_slink("enkf", "Storage/current" ); - enkf_main_type * enkf_main = enkf_main_bootstrap( model_config , false , false ); - test_assert_true( enkf_main_case_is_current( enkf_main , "enkf")); - test_assert_false(util_file_exists("Storage/current")); - test_assert_true(util_file_exists("Storage/current_case")); - char * current_case = enkf_main_read_alloc_current_case_name(enkf_main); - test_assert_string_equal(current_case, "enkf"); - free(current_case); - enkf_main_free(enkf_main); -} - -void test_current_file_present(const char * model_config) { - test_assert_true(util_file_exists("Storage/current_case")); - enkf_main_type * enkf_main = enkf_main_bootstrap( model_config , false , false ); - test_assert_true( enkf_main_case_is_current( enkf_main , "enkf")); - test_assert_false(util_file_exists("Storage/current")); - char * current_case = enkf_main_read_alloc_current_case_name(enkf_main); - test_assert_string_equal(current_case, "enkf"); - free(current_case); - enkf_main_free(enkf_main); -} - - -void test_change_case(const char * model_config) { - enkf_main_type * enkf_main = enkf_main_bootstrap( model_config , false , false ); - enkf_main_select_fs( enkf_main , "default"); - test_assert_true( enkf_main_case_is_current( enkf_main , "default")); - test_assert_false( enkf_main_case_is_current(enkf_main , "enkf")); - { - char * current_case = enkf_main_read_alloc_current_case_name(enkf_main); - test_assert_string_equal(current_case, "default"); - free(current_case); - } - - enkf_main_select_fs( enkf_main , "enkf"); - test_assert_true( enkf_main_case_is_current( enkf_main , "enkf")); - test_assert_false( enkf_main_case_is_current(enkf_main , "default")); - { - char * current_case = enkf_main_read_alloc_current_case_name(enkf_main); - test_assert_string_equal(current_case, "enkf"); - free(current_case); - } - - enkf_fs_type * enkf_fs = enkf_main_mount_alt_fs( enkf_main , "default" , false ); - enkf_main_select_fs( enkf_main , "default"); - test_assert_true( enkf_main_case_is_current( enkf_main , "default")); - enkf_fs_decref( enkf_fs ); - enkf_main_free(enkf_main); -} - -int main(int argc, char ** argv) { - const char * config_file = argv[1]; - test_work_area_type * work_area = test_work_area_alloc( "enkf_main_fs_current_file_test" ); - test_work_area_set_store(work_area, true); - char * model_config; - util_alloc_file_components( config_file , NULL , &model_config , NULL); - test_work_area_copy_parent_content( work_area , config_file ); - - test_current_file_not_present_symlink_present(model_config); - test_current_file_present(model_config); - test_change_case(model_config); - - free(model_config); - test_work_area_free( work_area ); - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_meas_data.c b/ThirdParty/Ert/libenkf/tests/enkf_meas_data.c deleted file mode 100644 index a1b7268996..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_meas_data.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_meas_data.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include "ert/util/build_config.h" - -#include -#include -#include -#include - -#include - - - -void meas_block_iset_abort(void * arg) { - meas_block_type * block = meas_block_safe_cast( arg ); - meas_block_iset( block , 0 , 0 , 100); -} - - -void meas_block_iget_abort(void * arg) { - meas_block_type * block = meas_block_safe_cast( arg ); - meas_block_iget( block , 0 , 0 ); -} - - - -void create_test() { - int_vector_type * ens_active_list = int_vector_alloc(0 , false); - bool_vector_type * ens_mask; - int_vector_append( ens_active_list , 10 ); - int_vector_append( ens_active_list , 20 ); - int_vector_append( ens_active_list , 30 ); - - ens_mask = int_vector_alloc_mask(ens_active_list); - { - meas_data_type * meas_data = meas_data_alloc( ens_mask ); - test_assert_int_equal( 3 , meas_data_get_active_ens_size( meas_data )); - - { - meas_block_type * block = meas_data_add_block(meas_data , "OBS" , 10 , 10); - - meas_block_iset(block , 10 , 0 , 100); - test_assert_double_equal( 100 , meas_block_iget( block , 10 , 0 )); - - test_assert_bool_equal( true , meas_block_iens_active( block , 10 )); - test_assert_bool_equal( false , meas_block_iens_active( block , 11 )); - - test_assert_util_abort( "meas_block_assert_iens_active" , meas_block_iset_abort , block); - test_assert_util_abort( "meas_block_assert_iens_active" , meas_block_iget_abort , block); - } - meas_data_free( meas_data ); - } - - - bool_vector_free( ens_mask ); - int_vector_free( ens_active_list ); -} - - - -int main(int argc , char ** argv) { - create_test(); - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_model_config.c b/ThirdParty/Ert/libenkf/tests/enkf_model_config.c deleted file mode 100644 index 5354e83a6c..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_model_config.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_model_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include - -#include - - -void test_create() { - model_config_type * model_config = model_config_alloc(); - test_assert_true( model_config_is_instance( model_config)); - model_config_free( model_config ); -} - - -void test_runpath() { - model_config_type * model_config = model_config_alloc(); - model_config_add_runpath(model_config , "KEY" , "RunPath%d"); - model_config_add_runpath(model_config , "KEY2" , "2-RunPath%d"); - test_assert_true( model_config_select_runpath(model_config , "KEY")); - test_assert_false( model_config_select_runpath(model_config , "KEYX")); - test_assert_string_equal("RunPath%d" , model_config_get_runpath_as_char(model_config)); - - model_config_set_runpath( model_config , "PATH%d"); - test_assert_string_equal("PATH%d" , model_config_get_runpath_as_char(model_config)); - test_assert_true( model_config_select_runpath(model_config , "KEY2")); - test_assert_string_equal("2-RunPath%d" , model_config_get_runpath_as_char(model_config)); - test_assert_true( model_config_select_runpath(model_config , "KEY")); - test_assert_string_equal("PATH%d" , model_config_get_runpath_as_char(model_config)); - - test_assert_false( model_config_runpath_requires_iter( model_config )); - model_config_set_runpath( model_config , "iens%d/iter%d" ); - test_assert_true( model_config_runpath_requires_iter( model_config )); - - model_config_free( model_config ); -} - - -int main(int argc , char ** argv) { - test_create(); - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_obs_fs.c b/ThirdParty/Ert/libenkf/tests/enkf_obs_fs.c deleted file mode 100644 index a5050d3e08..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_obs_fs.c +++ /dev/null @@ -1,124 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_obs_fs.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include - -#include -#include - -#include -#include -#include -#include -#include - - -void testS( ert_test_context_type * test_context ) { - { - enkf_main_type * enkf_main = ert_test_context_get_main( test_context ); - enkf_obs_type * enkf_obs = enkf_main_get_obs( enkf_main ); - enkf_fs_type * fs = enkf_main_get_fs( enkf_main ); - int_vector_type * active_list = int_vector_alloc(0,0); - obs_data_type * obs_data = obs_data_alloc(1.0); - local_obsdata_type * obs_set = local_obsdata_alloc( "KEY" ); - bool_vector_type * ens_mask; - meas_data_type * meas_data; - - - for (int i= 0; i < enkf_main_get_ensemble_size( enkf_main); i++) - int_vector_append( active_list , i ); - ens_mask = int_vector_alloc_mask( active_list); - - obs_data = obs_data_alloc(1.0); - meas_data = meas_data_alloc( ens_mask ); - - enkf_obs_add_local_nodes_with_data( enkf_obs , obs_set , fs , ens_mask ); - enkf_obs_get_obs_and_measure_data( enkf_obs , fs , obs_set, active_list , meas_data , obs_data); - - { - FILE * stream = util_fopen("analysis/Smatrix" , "r"); - matrix_type * S = meas_data_allocS( meas_data ); - matrix_type * S0 = matrix_fread_alloc( stream ); - - test_assert_true( matrix_equal( S0 , S )); - - matrix_free( S ); - matrix_free( S0 ); - fclose( stream ); - } - int_vector_free( active_list ); - meas_data_free( meas_data ); - obs_data_free( obs_data ); - local_obsdata_free( obs_set ); - bool_vector_free( ens_mask ); - } -} - - - -void test_iget(ert_test_context_type * test_context) { - enkf_main_type * enkf_main = ert_test_context_get_main( test_context ); - enkf_obs_type * enkf_obs = enkf_main_get_obs( enkf_main ); - - test_assert_int_equal( 32 , enkf_obs_get_size( enkf_obs ) ); - for (int iobs = 0; iobs < enkf_obs_get_size( enkf_obs ); iobs++) { - obs_vector_type * vec1 = enkf_obs_iget_vector( enkf_obs , iobs ); - obs_vector_type * vec2 = enkf_obs_get_vector( enkf_obs , obs_vector_get_key( vec1 )); - - test_assert_ptr_equal( vec1 , vec2 ); - } -} - - -void test_container( ert_test_context_type * test_context ) { - enkf_config_node_type * config_node = enkf_config_node_new_container( "CONTAINER" ); - enkf_config_node_type * wwct1_node = enkf_config_node_alloc_summary( "WWCT:OP_1" , LOAD_FAIL_SILENT); - enkf_config_node_type * wwct2_node = enkf_config_node_alloc_summary( "WWCT:OP_2" , LOAD_FAIL_SILENT); - enkf_config_node_type * wwct3_node = enkf_config_node_alloc_summary( "WWCT:OP_3" , LOAD_FAIL_SILENT); - - - enkf_config_node_update_container( config_node , wwct1_node ); - enkf_config_node_update_container( config_node , wwct2_node ); - enkf_config_node_update_container( config_node , wwct3_node ); - { - enkf_node_type * container = enkf_node_deep_alloc( config_node ); - enkf_node_free( container ); - } - - - enkf_config_node_free( wwct3_node ); - enkf_config_node_free( wwct2_node ); - enkf_config_node_free( wwct1_node ); - enkf_config_node_free( config_node ); -} - - -int main(int argc , char ** argv) { - util_install_signals(); - { - const char * config_file = argv[1]; - ert_test_context_type * test_context = ert_test_context_alloc( "ENKF_OBS_FS" , config_file ); - { - testS( test_context ); - test_iget( test_context ); - test_container( test_context ); - } - ert_test_context_free( test_context ); - exit(0); - } -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_obs_tests.c b/ThirdParty/Ert/libenkf/tests/enkf_obs_tests.c deleted file mode 100644 index b317cb42d8..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_obs_tests.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_enkf_obs_tests.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. - */ - -#include - -#include -#include - -#include -#include -#include -#include - - -int main(int argc, char ** argv) { - history_type * history = NULL; - time_map_type * external_time_map = NULL; - ecl_grid_type * grid = NULL; - ensemble_config_type * ensemble_config = NULL; - ecl_sum_type * refcase = NULL; - - enkf_obs_type * enkf_obs = enkf_obs_alloc(history , external_time_map , grid , refcase , ensemble_config); - - obs_vector_type * obs_vector = obs_vector_alloc(SUMMARY_OBS, "WWCT", NULL, 2); - summary_obs_type * summary_obs1 = summary_obs_alloc( "SummaryKey" , "ObservationKey" , 43.2, 2.0 , AUTO_CORRF_EXP, 42); - obs_vector_install_node( obs_vector , 0 , summary_obs1 ); - - summary_obs_type * summary_obs2 = summary_obs_alloc( "SummaryKey2" , "ObservationKey2" , 4.2, 0.1 , AUTO_CORRF_EXP, 42); - obs_vector_install_node( obs_vector , 1 , summary_obs2 ); - - obs_vector_type * obs_vector2 = obs_vector_alloc(SUMMARY_OBS, "WWCT2", NULL, 2); - summary_obs_type * summary_obs3 = summary_obs_alloc( "SummaryKey" , "ObservationKey" , 43.2, 2.0 , AUTO_CORRF_EXP, 42); - obs_vector_install_node( obs_vector2 , 0 , summary_obs3 ); - - summary_obs_type * summary_obs4 = summary_obs_alloc( "SummaryKey2" , "ObservationKey2" , 4.2, 0.1 , AUTO_CORRF_EXP, 42); - obs_vector_install_node( obs_vector2 , 1 , summary_obs4 ); - - enkf_obs_add_obs_vector(enkf_obs, obs_vector); - enkf_obs_add_obs_vector(enkf_obs, obs_vector2); - - enkf_obs_scale_std(enkf_obs, 3.3); - - enkf_obs_free(enkf_obs); - - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_obs_vector.c b/ThirdParty/Ert/libenkf/tests/enkf_obs_vector.c deleted file mode 100644 index c2d2a773d2..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_obs_vector.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - Copyright (C) 2015 Statoil ASA, Norway. - - The file 'enkf_obs_vector.c' is part of ERT - Ensemble based - Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - - - -void test_create(enkf_config_node_type * config_node ) { - obs_vector_type * obs_vector = obs_vector_alloc( SUMMARY_OBS , "OBS" , config_node , 100 ); - test_assert_true( obs_vector_is_instance( obs_vector )); - { - const int_vector_type * step_list = obs_vector_get_step_list( obs_vector ); - - { - summary_obs_type * obs_node = summary_obs_alloc( "FOPT" , "FOPT" , 10 , 1 , NULL , 0); - obs_vector_install_node( obs_vector , 10 , obs_node ); - test_assert_int_equal( 1 , int_vector_size( step_list )); - test_assert_int_equal( 10 , int_vector_iget( step_list , 0)); - } - - { - summary_obs_type * obs_node = summary_obs_alloc( "FOPT" , "FOPT" , 10 , 1 , NULL , 0); - obs_vector_install_node( obs_vector , 10 , obs_node ); - test_assert_int_equal( 1 , int_vector_size( step_list )); - test_assert_int_equal( 10 , int_vector_iget( step_list , 0)); - } - - { - summary_obs_type * obs_node = summary_obs_alloc( "FOPT" , "FOPT" , 10 , 1 , NULL , 0); - obs_vector_install_node( obs_vector , 5 , obs_node ); - test_assert_int_equal( 2 , int_vector_size( step_list )); - test_assert_int_equal( 5 , int_vector_iget( step_list , 0)); - test_assert_int_equal( 10 , int_vector_iget( step_list , 1)); - } - - { - summary_obs_type * obs_node = summary_obs_alloc( "FOPT" , "FOPT" , 10 , 1 , NULL , 0); - obs_vector_install_node( obs_vector , 15 , obs_node ); - test_assert_int_equal( 3 , int_vector_size( step_list )); - test_assert_int_equal( 5 , int_vector_iget( step_list , 0)); - test_assert_int_equal( 10 , int_vector_iget( step_list , 1)); - test_assert_int_equal( 15 , int_vector_iget( step_list , 2)); - } - } - obs_vector_free( obs_vector ); -} - - - -int main(int argc , char ** argv) { - enkf_config_node_type * config_node = enkf_config_node_alloc_summary("FOPR" , LOAD_FAIL_EXIT); - { - test_create( config_node ); - } - enkf_config_node_free( config_node ); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_obs_vector_fs.c b/ThirdParty/Ert/libenkf/tests/enkf_obs_vector_fs.c deleted file mode 100644 index 6a93801605..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_obs_vector_fs.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_obs_vector_fs.c' is part of ERT - Ensemble based - Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - - -void test_valid_obs_vector( enkf_main_type * enkf_main , const char * obs_key) { - enkf_fs_type * fs = enkf_main_get_fs(enkf_main); - enkf_obs_type * enkf_obs = enkf_main_get_obs( enkf_main ); - obs_vector_type * obs_vector = enkf_obs_get_vector( enkf_obs , obs_key ); - bool_vector_type * active_mask = bool_vector_alloc( enkf_main_get_ensemble_size( enkf_main ) , true); - - test_assert_true( obs_vector_has_data( obs_vector , active_mask , fs )); - bool_vector_free( active_mask ); -} - - -/* - This test will modify the enkf_obs container with invalid data; must - be the last test. -*/ - -void test_invalid_obs_vector( enkf_main_type * enkf_main , const char * obs_key) { - enkf_fs_type * fs = enkf_main_get_fs(enkf_main); - enkf_obs_type * enkf_obs = enkf_main_get_obs( enkf_main ); - obs_vector_type * obs_vector = enkf_obs_get_vector( enkf_obs , obs_key ); - bool_vector_type * active_mask = bool_vector_alloc( enkf_main_get_ensemble_size( enkf_main ) , true); - - test_assert_false( obs_vector_has_data( obs_vector , active_mask , fs )); - bool_vector_free( active_mask ); -} - - -void test_container( ert_test_context_type * test_context ) { - enkf_main_type * enkf_main = ert_test_context_get_main( test_context ); - enkf_obs_type * enkf_obs = enkf_main_get_obs( enkf_main ); - obs_vector_type * rft_obs = enkf_obs_get_vector( enkf_obs , "RFT_TEST"); - enkf_fs_type * fs = enkf_main_get_fs( enkf_main ); - bool_vector_type * active_mask = bool_vector_alloc( enkf_main_get_ensemble_size( enkf_main ) , true ); - - test_assert_true( obs_vector_has_data( rft_obs , active_mask , fs )); - bool_vector_free( active_mask ); -} - - - -void test_measure( ert_test_context_type * test_context ) { - enkf_main_type * enkf_main = ert_test_context_get_main( test_context ); - enkf_fs_type * fs = enkf_main_get_fs( enkf_main ); - enkf_obs_type * enkf_obs = enkf_main_get_obs( enkf_main ); - obs_vector_type * rft_obs = enkf_obs_get_vector( enkf_obs , "RFT_TEST"); - int_vector_type * ens_active_list = int_vector_alloc(0,0); - active_list_type * active_list = active_list_alloc( ); - meas_data_type * meas_data_RFT; - - for (int i=0; i < enkf_main_get_ensemble_size( enkf_main ); i++) - int_vector_append( ens_active_list , i ); - - { - bool_vector_type * ens_mask; - ens_mask = int_vector_alloc_mask( ens_active_list ); - meas_data_RFT = meas_data_alloc( ens_mask ); - bool_vector_free( ens_mask ); - } - - obs_vector_measure( rft_obs , fs , 20 , ens_active_list , meas_data_RFT , active_list ); - - int_vector_free( ens_active_list ); - active_list_free( active_list ); - meas_data_free( meas_data_RFT ); -} - - - - -int main(int argc , char ** argv) { - const char * config_file = argv[1]; - ert_test_context_type * context = ert_test_context_alloc( "OBS_VECTOR_FS" , config_file); - enkf_main_type * enkf_main = ert_test_context_get_main( context ); - - { - test_valid_obs_vector( enkf_main , "WWCT:OP_3"); - test_container( context ); - test_measure( context ); - test_invalid_obs_vector( enkf_main , "GOPT:OP"); - } - ert_test_context_free( context ); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_pca_plot.c b/ThirdParty/Ert/libenkf/tests/enkf_pca_plot.c deleted file mode 100644 index 71790def4a..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_pca_plot.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_pca_plot.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include - -#include -#include -#include - -#include -#include - - - -pca_plot_data_type * create_data() { - matrix_type * PC = matrix_alloc( 3 , 10); - matrix_type * PC_obs = matrix_alloc( 3 , 1 ); - double_vector_type * singular_values = double_vector_alloc(3 , 1); - - pca_plot_data_type * data = pca_plot_data_alloc("KEY" , PC , PC_obs , singular_values); - - double_vector_free( singular_values ); - matrix_free( PC ); - matrix_free( PC_obs ); - return data; -} - - - -void test_create_data() { - matrix_type * PC = matrix_alloc( 3 , 10); - matrix_type * PC_obs = matrix_alloc( 3 , 1 ); - double_vector_type * singular_values = double_vector_alloc(3 , 1); - { - pca_plot_data_type * data = pca_plot_data_alloc("KEY" , PC , PC_obs , singular_values); - test_assert_true( pca_plot_data_is_instance( data )); - test_assert_int_equal( 3 , pca_plot_data_get_size( data )); - test_assert_int_equal( 10 , pca_plot_data_get_ens_size( data )); - test_assert_string_equal( "KEY" , pca_plot_data_get_name( data )); - pca_plot_data_free( data ); - } - matrix_resize( PC , 4 , 10 , false); - test_assert_NULL( pca_plot_data_alloc( "KEY" , PC , PC_obs , singular_values)); - - matrix_resize( PC_obs , 3 , 2 , false); - test_assert_NULL( pca_plot_data_alloc( "KEY" , PC , PC_obs , singular_values)); - - double_vector_free( singular_values ); - matrix_free( PC ); - matrix_free( PC_obs ); -} - - - -void test_create_vector() { - matrix_type * PC = matrix_alloc( 3 , 10); - matrix_type * PC_obs = matrix_alloc( 3 , 1 ); - double_vector_type * singular_values = double_vector_alloc(3 , 1); - - { - pca_plot_vector_type * vector = pca_plot_vector_alloc(0 , PC , PC_obs, singular_values); - test_assert_true( pca_plot_vector_is_instance( vector )); - pca_plot_vector_free( vector ); - } - - double_vector_free( singular_values ); - matrix_free( PC ); - matrix_free( PC_obs ); -} - - -void test_get_vector() { - pca_plot_data_type * data = create_data(); - test_assert_true( pca_plot_vector_is_instance( pca_plot_data_iget_vector( data , 0 ))); - pca_plot_data_free( data ); -} - - -void test_content() { - rng_type * rng = rng_alloc(MZRAN , INIT_DEFAULT); - matrix_type * PC = matrix_alloc( 3 , 10); - matrix_type * PC_obs = matrix_alloc( 3 , 1 ); - double_vector_type * singular_values = double_vector_alloc(3 , 1); - matrix_random_init( PC , rng ); - matrix_random_init( PC_obs , rng ); - { - pca_plot_data_type * data = pca_plot_data_alloc("KEY" , PC , PC_obs, singular_values); - for (int i=0; i < matrix_get_rows( PC ); i++) { - const pca_plot_vector_type * vector = pca_plot_data_iget_vector( data , i ); - - test_assert_double_equal( matrix_iget( PC_obs , i , 0) , - pca_plot_vector_get_obs_value( vector ) ); - - test_assert_double_equal( double_vector_iget( singular_values , i), - pca_plot_vector_get_singular_value( vector ) ); - - for (int j=0; j < matrix_get_columns( PC ); j++) - test_assert_double_equal( matrix_iget( PC , i , j ) , pca_plot_vector_iget_sim_value( vector , j )); - - test_assert_int_equal( matrix_get_columns( PC ) , pca_plot_vector_get_size( vector )); - - } - pca_plot_data_free( data ); - } - - double_vector_free( singular_values ); - matrix_free( PC ); - matrix_free( PC_obs ); -} - - -int main(int argc , char ** argv) { - test_create_data(); - test_create_vector(); - test_get_vector(); - test_content(); - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_plot_data.c b/ThirdParty/Ert/libenkf/tests/enkf_plot_data.c deleted file mode 100644 index dc0ecab891..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_plot_data.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_plot_data.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - - - -void test_create() { - enkf_plot_data_type * plot_data = enkf_plot_data_alloc( NULL ); - test_assert_true( enkf_plot_data_is_instance( plot_data )); - test_assert_int_equal( 0 , enkf_plot_data_get_size( plot_data )); - enkf_plot_data_free( plot_data ); -} - - - -int main(int argc , char ** argv) { - test_create(); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_plot_data_fs.c b/ThirdParty/Ert/libenkf/tests/enkf_plot_data_fs.c deleted file mode 100644 index 88ac6b6aa6..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_plot_data_fs.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_plot_data_fs.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#include -#include -#include - -#include -#include - -#include -#include -#include - - - -void test_load_GEN_KW( enkf_main_type * enkf_main , const char * key , const char * index_key) { - ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config( enkf_main ); - const enkf_config_node_type * config_node = ensemble_config_get_node( ensemble_config , key ); - enkf_plot_data_type * plot_data = enkf_plot_data_alloc( config_node ); - - { - enkf_fs_type * enkf_fs = enkf_main_mount_alt_fs( enkf_main , "enkf" , true ); - - enkf_plot_data_load( plot_data , enkf_fs , index_key , NULL ); - test_assert_int_equal( 25 , enkf_plot_data_get_size( plot_data )); - { - enkf_plot_tvector_type * plot_vector = enkf_plot_data_iget( plot_data , 10 ); - test_assert_true( enkf_plot_tvector_is_instance( plot_vector )); - test_assert_int_equal( 63 , enkf_plot_tvector_size( plot_vector )); - - test_assert_true( enkf_plot_tvector_iget_active( plot_vector , 0 )); - test_assert_true( enkf_plot_tvector_iget_active( plot_vector , 10 )); - test_assert_true( enkf_plot_tvector_iget_active( plot_vector , 20 )); - test_assert_true( enkf_plot_tvector_iget_active( plot_vector , 30 )); - - test_assert_false( enkf_plot_tvector_iget_active( plot_vector , 1 )); - test_assert_false( enkf_plot_tvector_iget_active( plot_vector , 11 )); - test_assert_false( enkf_plot_tvector_iget_active( plot_vector , 21 )); - test_assert_false( enkf_plot_tvector_iget_active( plot_vector , 31 )); - } - enkf_fs_decref( enkf_fs ); - } - enkf_plot_data_free( plot_data ); -} - - - -void test_load_summary( enkf_main_type * enkf_main , const char * summary_key) { - ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config( enkf_main ); - const enkf_config_node_type * config_node = ensemble_config_get_node( ensemble_config , summary_key ); - enkf_plot_data_type * plot_data = enkf_plot_data_alloc( config_node ); - - { - enkf_fs_type * enkf_fs = enkf_main_mount_alt_fs( enkf_main , "enkf" , true ); - enkf_plot_data_load( plot_data , enkf_fs , NULL , NULL ); - test_assert_int_equal( 25 , enkf_plot_data_get_size( plot_data )); - { - enkf_plot_tvector_type * plot_vector = enkf_plot_data_iget( plot_data , 10 ); - test_assert_true( enkf_plot_tvector_is_instance( plot_vector )); - test_assert_false( enkf_plot_tvector_iget_active( plot_vector , 0 )); - test_assert_int_equal( 63 , enkf_plot_tvector_size( plot_vector )); - } - enkf_fs_decref( enkf_fs ); - } - - { - enkf_fs_type * enkf_fs = enkf_main_mount_alt_fs( enkf_main , "default" , true ); - enkf_plot_data_load( plot_data , enkf_fs , NULL , NULL ); - test_assert_int_equal( 25 , enkf_plot_data_get_size( plot_data )); - { - enkf_plot_tvector_type * plot_vector = enkf_plot_data_iget( plot_data , 0 ); - test_assert_true( enkf_plot_tvector_is_instance( plot_vector )); - test_assert_false( enkf_plot_tvector_iget_active( plot_vector , 0 )); - test_assert_int_equal( 63 , enkf_plot_tvector_size( plot_vector )); - - plot_vector = enkf_plot_data_iget( plot_data , 1 ); - test_assert_true( enkf_plot_tvector_is_instance( plot_vector )); - test_assert_int_equal( 0 , enkf_plot_tvector_size( plot_vector )); - } - enkf_fs_decref( enkf_fs ); - } - enkf_plot_data_free( plot_data ); -} - - - - - -int main(int argc, char ** argv) { - util_install_signals(); - { - const char * config_file = argv[1]; - test_work_area_type * work_area = test_work_area_alloc( "enkf_main_fs" ); - char * model_config; - util_alloc_file_components( config_file , NULL , &model_config , NULL); - test_work_area_set_store( work_area , true ); - test_work_area_copy_parent_content( work_area , config_file ); - { - enkf_main_type * enkf_main = enkf_main_bootstrap( model_config , false , false ); - - test_load_summary(enkf_main , "WWCT:OP_3"); - test_load_GEN_KW( enkf_main , "MULTFLT" , "F3"); - enkf_main_free( enkf_main ); - } - test_work_area_free( work_area ); - exit(0); - } -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_plot_gen_kw.c b/ThirdParty/Ert/libenkf/tests/enkf_plot_gen_kw.c deleted file mode 100644 index 0471ec8ec2..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_plot_gen_kw.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_plot_gen_kw.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include - -#include - -#include -#include -#include - -void test_create_invalid() { - enkf_config_node_type * config_node = enkf_config_node_alloc_summary( "WWCT" , LOAD_FAIL_SILENT); - enkf_plot_gen_kw_type * gen_kw = enkf_plot_gen_kw_alloc( config_node ); - - test_assert_NULL( gen_kw ); - enkf_config_node_free( config_node ); -} - - -void test_create() { - enkf_config_node_type * config_node = enkf_config_node_new_gen_kw( "GEN_KW" , DEFAULT_GEN_KW_TAG_FORMAT, false); - - { - enkf_plot_gen_kw_type * gen_kw = enkf_plot_gen_kw_alloc( config_node ); - test_assert_true( enkf_plot_gen_kw_is_instance( gen_kw )); - test_assert_int_equal( 0 , enkf_plot_gen_kw_get_size( gen_kw )); - enkf_plot_gen_kw_free( gen_kw ); - } - - enkf_config_node_free( config_node ); -} - - - - -int main( int argc , char ** argv) { - test_create(); - test_create_invalid(); - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_plot_gen_kw_fs.c b/ThirdParty/Ert/libenkf/tests/enkf_plot_gen_kw_fs.c deleted file mode 100644 index 4dba59071d..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_plot_gen_kw_fs.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_plot_gen_kw_fs.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include - -#include - -#include -#include -#include -#include -#include -#include -#include - - -void test_load(const char * config_file) { - ert_test_context_type * test_context = ert_test_context_alloc( "GEN_KW" , config_file ); - enkf_main_type * enkf_main = ert_test_context_get_main( test_context ); - int ens_size = enkf_main_get_ensemble_size( enkf_main ); - stringlist_type * param_list = stringlist_alloc_new(); - enkf_fs_type * init_fs = enkf_fs_create_fs( "fs" , BLOCK_FS_DRIVER_ID , NULL , true ); - bool_vector_type * iens_mask = bool_vector_alloc( ens_size , true ); - - stringlist_append_ref( param_list , "GEN_KW"); - enkf_main_initialize_from_scratch( enkf_main , init_fs , param_list , iens_mask , INIT_FORCE); - { - ensemble_config_type * ensemble_config = enkf_main_get_ensemble_config( enkf_main ); - enkf_config_node_type * config_node = ensemble_config_get_node( ensemble_config , "GEN_KW"); - enkf_plot_gen_kw_type * plot_gen_kw = enkf_plot_gen_kw_alloc( config_node ); - bool_vector_type * input_mask = bool_vector_alloc( ens_size , true ); - gen_kw_config_type * gen_kw_config = enkf_config_node_get_ref( config_node ); - - enkf_plot_gen_kw_load( plot_gen_kw , init_fs , true , 0 , input_mask ); - - test_assert_int_equal( ens_size , enkf_plot_gen_kw_get_size( plot_gen_kw )); - - test_assert_int_equal(4, enkf_plot_gen_kw_get_keyword_count(plot_gen_kw)); - - { - enkf_plot_gen_kw_vector_type * vector = enkf_plot_gen_kw_iget( plot_gen_kw , 0 ); - for (int i=0; i < enkf_plot_gen_kw_vector_get_size( vector ); i++) - test_assert_string_equal( enkf_plot_gen_kw_iget_key( plot_gen_kw , i ) , gen_kw_config_iget_name( gen_kw_config , i)); - } - bool_vector_free( input_mask ); - } - - bool_vector_free( iens_mask ); - stringlist_free( param_list ); - enkf_fs_decref( init_fs ); - ert_test_context_free( test_context ); -} - - - - - -int main( int argc , char ** argv) { - util_install_signals(); - { - const char * config_file = argv[1]; - test_load( config_file ); - exit(0); - } -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_plot_gen_kw_vector.c b/ThirdParty/Ert/libenkf/tests/enkf_plot_gen_kw_vector.c deleted file mode 100644 index d95bbdf539..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_plot_gen_kw_vector.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_plot_gen_kw_vector.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include - -#include - -#include -#include -#include - - -void test_create() { - enkf_config_node_type * config_node = enkf_config_node_new_gen_kw( "GEN_KW" , DEFAULT_GEN_KW_TAG_FORMAT, false); - - enkf_plot_gen_kw_vector_type * vector = enkf_plot_gen_kw_vector_alloc( config_node , 0 ); - test_assert_true( enkf_plot_gen_kw_vector_is_instance( vector )); - test_assert_int_equal( 0 , enkf_plot_gen_kw_vector_get_size( vector )); - - enkf_plot_gen_kw_vector_free( vector ); - enkf_config_node_free( config_node ); -} - - - - -int main( int argc , char ** argv) { - test_create(); - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_plot_gendata.c b/ThirdParty/Ert/libenkf/tests/enkf_plot_gendata.c deleted file mode 100644 index 5185adbbbc..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_plot_gendata.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_plot_gendata.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include - -#include - -#include - -#include -#include -#include - -void test_create_invalid() { - enkf_config_node_type * config_node = enkf_config_node_alloc_summary( "WWCT" , LOAD_FAIL_SILENT); - obs_vector_type * obs_vector = obs_vector_alloc(SUMMARY_OBS , "OBS" , config_node , 100); - enkf_plot_gendata_type * gen_data = enkf_plot_gendata_alloc_from_obs_vector( obs_vector ); - test_assert_NULL( gen_data ); - enkf_config_node_free( config_node ); - obs_vector_free( obs_vector ); -} - - -void test_create() { - enkf_config_node_type * config_node = enkf_config_node_alloc_GEN_DATA_result( "key" , ASCII , "Result:%d"); - enkf_plot_gendata_type * gen_data = enkf_plot_gendata_alloc( config_node ); - test_assert_true( enkf_plot_gendata_is_instance( gen_data )); - test_assert_int_equal( 0 , enkf_plot_gendata_get_size( gen_data )); - enkf_config_node_free( config_node ); - enkf_plot_gendata_free( gen_data); -} - - - - -int main( int argc , char ** argv) { - test_create(); - test_create_invalid(); - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_plot_gendata_fs.c b/ThirdParty/Ert/libenkf/tests/enkf_plot_gendata_fs.c deleted file mode 100644 index 29c2745263..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_plot_gendata_fs.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_plot_gendata_fs.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include - -#include - -#include - -#include -#include -#include -#include - - - - -void test_gendata( enkf_main_type * enkf_main , const char * obs_key , int report_step ) { - enkf_obs_type * enkf_obs = enkf_main_get_obs( enkf_main ); - - obs_vector_type * obs_vector = enkf_obs_get_vector( enkf_obs , obs_key); - - { - enkf_plot_gendata_type * gen_data = enkf_plot_gendata_alloc_from_obs_vector( obs_vector ); - - enkf_fs_type * fs = enkf_main_get_fs( enkf_main ); - gen_obs_type * gen_obs = obs_vector_iget_node( obs_vector , report_step ); - - { - - double value; - double std; - bool valid; - gen_obs_user_get_with_data_index(gen_obs , "0" , &value , &std , &valid ); - test_assert_double_equal( 0.143841 , value ); - test_assert_double_equal( 0.0300 , std ); - test_assert_true( valid ); - - } - - enkf_plot_gendata_load(gen_data, fs, report_step, NULL); - - test_assert_int_equal( enkf_main_get_ensemble_size( enkf_main ) , enkf_plot_gendata_get_size( gen_data )); - - { - enkf_plot_genvector_type * vector = enkf_plot_gendata_iget( gen_data , 24); - test_assert_true( enkf_plot_genvector_is_instance( vector )); - test_assert_double_equal( 0.675537 , enkf_plot_genvector_iget( vector , 0 )); - test_assert_double_equal( 0.682635 , enkf_plot_genvector_iget( vector , 1 )); - test_assert_double_equal( 0.616371 , enkf_plot_genvector_iget( vector , 2 )); - - - } - - { - enkf_plot_genvector_type * vector = enkf_plot_gendata_iget( gen_data , 9 ); - test_assert_true( enkf_plot_genvector_is_instance( vector )); - test_assert_double_equal( -0.515033 , enkf_plot_genvector_iget( vector , 0 )); - test_assert_double_equal( -0.507350 , enkf_plot_genvector_iget( vector , 1 )); - test_assert_double_equal( -0.541030 , enkf_plot_genvector_iget( vector , 2 )); - } - - - enkf_plot_gendata_free( gen_data ); - } - - -} - - - -int main( int argc , char ** argv) { - const char * config_file = argv[1]; - util_install_signals(); - ert_test_context_type * test_context = ert_test_context_alloc("GENDATA" , config_file ); - enkf_main_type * enkf_main = ert_test_context_get_main( test_context ); - - test_gendata( enkf_main , "GEN_TIMESHIFT" , 60); - - ert_test_context_free( test_context ); - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_plot_genvector.c b/ThirdParty/Ert/libenkf/tests/enkf_plot_genvector.c deleted file mode 100644 index b878af563b..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_plot_genvector.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'enkf_plot_genvector.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include - -#include - -#include - -#include -#include -#include -#include - - -void test_create() { - enkf_config_node_type * config_node = enkf_config_node_alloc_GEN_DATA_result( "Key" , ASCII , "Result%d"); - enkf_plot_genvector_type * gen_vector = enkf_plot_genvector_alloc( config_node , 0 ); - test_assert_true( enkf_plot_genvector_is_instance( gen_vector )); - test_assert_int_equal( 0 , enkf_plot_genvector_get_size( gen_vector )); - enkf_config_node_free( config_node ); - enkf_plot_genvector_free(gen_vector); -} - - - - -int main( int argc , char ** argv) { - test_create(); - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_plot_tvector.c b/ThirdParty/Ert/libenkf/tests/enkf_plot_tvector.c deleted file mode 100644 index 0896f5788b..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_plot_tvector.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_plot_tvector.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - - - -void create_test() { - enkf_config_node_type * config_node = enkf_config_node_alloc_summary("KEY" , LOAD_FAIL_SILENT); - enkf_plot_tvector_type * tvector = enkf_plot_tvector_alloc( config_node , 0 ); - test_assert_true( enkf_plot_tvector_is_instance( tvector )); - enkf_plot_tvector_free( tvector ); -} - - - -void test_iset() { - enkf_config_node_type * config_node = enkf_config_node_alloc_summary("KEY" , LOAD_FAIL_SILENT); - enkf_plot_tvector_type * tvector = enkf_plot_tvector_alloc( config_node , 0 ); - enkf_plot_tvector_iset( tvector , 10 , 0 , 100 ); - - test_assert_int_equal( 11 , enkf_plot_tvector_size( tvector )); - test_assert_time_t_equal( 0 , enkf_plot_tvector_iget_time( tvector , 10 )); - test_assert_double_equal( 100 , enkf_plot_tvector_iget_value( tvector , 10 )); - { - for (int i=0; i < (enkf_plot_tvector_size( tvector ) - 1); i++) - test_assert_false( enkf_plot_tvector_iget_active( tvector , i )); - - test_assert_true( enkf_plot_tvector_iget_active( tvector , 10 )); - } - - enkf_plot_tvector_free( tvector ); -} - - -void test_all_active() { - enkf_config_node_type * config_node = enkf_config_node_alloc_summary("KEY" , LOAD_FAIL_SILENT); - enkf_plot_tvector_type * tvector = enkf_plot_tvector_alloc( config_node , 0); - test_assert_true( enkf_plot_tvector_all_active( tvector )); - - enkf_plot_tvector_iset( tvector , 00 , 0 , 100 ); - test_assert_true( enkf_plot_tvector_all_active( tvector )); - - enkf_plot_tvector_iset( tvector , 1 , 0 , 100 ); - test_assert_true( enkf_plot_tvector_all_active( tvector )); - - enkf_plot_tvector_iset( tvector , 10 , 0 , 100 ); - test_assert_false( enkf_plot_tvector_all_active( tvector )); -} - - - -void test_iget() { - enkf_config_node_type * config_node = enkf_config_node_alloc_summary("KEY" , LOAD_FAIL_SILENT); - enkf_plot_tvector_type * tvector = enkf_plot_tvector_alloc( config_node , 0); - enkf_plot_tvector_iset( tvector , 0 , 0 , 0 ); - enkf_plot_tvector_iset( tvector , 1 , 100 , 10 ); - enkf_plot_tvector_iset( tvector , 2 , 200 , 20 ); - enkf_plot_tvector_iset( tvector , 3 , 300 , 30 ); - enkf_plot_tvector_iset( tvector , 4 , 400 , 40 ); - - enkf_plot_tvector_iset( tvector , 6 , 600 , 60 ); - - - test_assert_int_equal( 7 , enkf_plot_tvector_size( tvector )); - for (int i=0; i < 7; i++) { - if (i == 5) - test_assert_false( enkf_plot_tvector_iget_active( tvector , i )); - else { - test_assert_true( enkf_plot_tvector_iget_active( tvector , i )); - test_assert_time_t_equal( i * 100 , enkf_plot_tvector_iget_time( tvector , i )); - test_assert_double_equal( i * 10 , enkf_plot_tvector_iget_value( tvector , i )); - } - } -} - - - -int main(int argc , char ** argv) { - create_test(); - test_iset(); - test_all_active(); - test_iget(); - - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_refcase_list.c b/ThirdParty/Ert/libenkf/tests/enkf_refcase_list.c deleted file mode 100644 index 7abe9aac96..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_refcase_list.c +++ /dev/null @@ -1,128 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_refcase_list.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include - -#include -#include - -#include - - -int main(int argc , char ** argv) { - const char * case1 = argv[1]; - const char * case_glob = argv[2]; - - { - ecl_refcase_list_type * refcase_list = ecl_refcase_list_alloc( ); - - test_assert_false( ecl_refcase_list_has_case( refcase_list , "DoesNotExist" )); - test_assert_NULL( ecl_refcase_list_get_case( refcase_list , "DoesNotExist")); - - test_assert_int_equal( ecl_refcase_list_add_matching( refcase_list , "DoesNotExist") , 0); - ecl_refcase_list_add_case( refcase_list , "DoesNotExist" ); - test_assert_false( ecl_refcase_list_has_case( refcase_list , "DoesNotExist")); - - ecl_refcase_list_add_case( refcase_list , case1 ); - test_assert_true( ecl_refcase_list_has_case( refcase_list , case1)); - - - test_assert_not_NULL( refcase_list ); - test_assert_false( ecl_refcase_list_has_default( refcase_list )); - test_assert_NULL( ecl_refcase_list_get_default( refcase_list )); - - test_assert_false( ecl_refcase_list_set_default( refcase_list , "DoesNotExist")); - test_assert_false( ecl_refcase_list_has_default( refcase_list )); - test_assert_NULL( ecl_refcase_list_get_default( refcase_list )); - test_assert_int_equal( 1 , ecl_refcase_list_get_size( refcase_list )); - - test_assert_true( ecl_refcase_list_set_default( refcase_list , case1)); - test_assert_true( ecl_refcase_list_has_default( refcase_list )); - test_assert_not_NULL( ecl_refcase_list_get_default( refcase_list )); - test_assert_int_equal( 1 , ecl_refcase_list_get_size( refcase_list )); - - test_assert_false( ecl_refcase_list_set_default( refcase_list , "DoesNotExist")); - test_assert_true( ecl_refcase_list_has_default( refcase_list )); - test_assert_not_NULL( ecl_refcase_list_get_default( refcase_list )); - test_assert_int_equal( 1 , ecl_refcase_list_get_size( refcase_list )); - test_assert_NULL( ecl_refcase_list_iget_case( refcase_list , 100)); - - ecl_refcase_list_free( refcase_list ); - } - - { - ecl_refcase_list_type * refcase_list = ecl_refcase_list_alloc( ); - test_assert_int_equal( ecl_refcase_list_add_matching( refcase_list , case_glob ) , 11); - test_assert_int_equal( 11 , ecl_refcase_list_get_size( refcase_list )); - - test_assert_true( ecl_refcase_list_set_default( refcase_list , case1)); - test_assert_true( ecl_refcase_list_has_default( refcase_list )); - test_assert_not_NULL( ecl_refcase_list_get_default( refcase_list )); - test_assert_int_equal( 11 , ecl_refcase_list_get_size( refcase_list )); - - test_assert_int_equal( ecl_refcase_list_add_matching( refcase_list , case_glob ) , 0); - test_assert_int_equal( ecl_refcase_list_add_matching( refcase_list , case_glob ) , 0); - { - const ecl_sum_type * ecl_sum = ecl_refcase_list_iget_case( refcase_list , 0 ); - test_assert_not_NULL( ecl_sum ); - } - test_assert_int_equal( 11 , ecl_refcase_list_get_size( refcase_list )); - - { - stringlist_type * case_list = stringlist_alloc_new( ); - const int N = ecl_refcase_list_get_size( refcase_list ); - int i; - for (i=0; i < N; i++) - stringlist_append_ref( case_list , ecl_refcase_list_iget_pathcase( refcase_list , N - 1 - i )); - - { - bool equal = true; - for (i=0; i < N; i++) - equal = equal && util_string_equal( stringlist_iget( case_list , i ) , ecl_refcase_list_iget_pathcase( refcase_list , i)); - - test_assert_false( equal ); - stringlist_sort( case_list , (string_cmp_ftype *) util_strcmp_int); - - equal = true; - for (i=0; i < N; i++) - equal = equal && util_string_equal( stringlist_iget( case_list , i ) , ecl_refcase_list_iget_pathcase( refcase_list , i)); - test_assert_true( equal ); - } - stringlist_free( case_list ); - } - ecl_refcase_list_add_matching( refcase_list , "DoesNotExist*"); - test_assert_int_equal( 11 , ecl_refcase_list_get_size( refcase_list )); - ecl_refcase_list_free( refcase_list ); - } - - - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_rng.c b/ThirdParty/Ert/libenkf/tests/enkf_rng.c deleted file mode 100644 index 86d430c207..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_rng.c +++ /dev/null @@ -1,130 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_rng.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - - -int main(int argc , char ** argv) { - unsigned int rand1,rand2; - { - test_work_area_type * work_area = test_work_area_alloc("enkf-rng-0"); - { - enkf_main_type * enkf_main = enkf_main_alloc_empty(); - enkf_main_resize_ensemble( enkf_main , 10 ); - { - enkf_state_type * state = enkf_main_iget_state( enkf_main , 9 ); - rand1 = enkf_state_get_random( state ); - } - enkf_main_free( enkf_main ); - } - - { - enkf_main_type * enkf_main = enkf_main_alloc_empty(); - enkf_main_resize_ensemble( enkf_main , 10 ); - { - enkf_state_type * state = enkf_main_iget_state( enkf_main , 9 ); - rand2 = enkf_state_get_random( state ); - } - enkf_main_free( enkf_main ); - } - test_assert_uint_not_equal( rand1 , rand2 ); - test_work_area_free( work_area ); - } - - /*****************************************************************/ - - { - test_work_area_type * work_area = test_work_area_alloc("enkf-rng-1" ); - const char * seed_file = "seed"; - { - enkf_main_type * enkf_main = enkf_main_alloc_empty(); - { - rng_config_type * rng_config = enkf_main_get_rng_config( enkf_main ); - rng_config_set_seed_store_file( rng_config , seed_file ); - } - enkf_main_rng_init( enkf_main ); - - enkf_main_resize_ensemble( enkf_main , 10 ); - { - enkf_state_type * state = enkf_main_iget_state( enkf_main , 9 ); - rand1 = enkf_state_get_random( state ); - } - enkf_main_free( enkf_main ); - } - - { - enkf_main_type * enkf_main = enkf_main_alloc_empty(); - { - rng_config_type * rng_config = enkf_main_get_rng_config( enkf_main ); - rng_config_set_seed_load_file( rng_config , seed_file ); - } - enkf_main_rng_init( enkf_main ); - - enkf_main_resize_ensemble( enkf_main , 10 ); - { - enkf_state_type * state = enkf_main_iget_state( enkf_main , 9 ); - rand2 = enkf_state_get_random( state ); - } - enkf_main_free( enkf_main ); - } - test_assert_uint_equal( rand1 , rand2 ); - test_work_area_free( work_area ); - - } - /*****************************************************************/ - { - const char * config_path = argv[1]; - const char * config_file = argv[2]; - test_work_area_type * work_area = test_work_area_alloc("enkf-rng-2" ); - test_work_area_copy_directory_content( work_area , config_path ); - { - enkf_main_type * enkf_main = enkf_main_bootstrap( config_file , true , true ); - enkf_state_type * state = enkf_main_iget_state( enkf_main , 9 ); - rand1 = enkf_state_get_random( state ); - enkf_main_free( enkf_main ); - } - - { - enkf_main_type * enkf_main = enkf_main_bootstrap( config_file , true , true ); - enkf_state_type * state = enkf_main_iget_state( enkf_main , 9 ); - rand2 = enkf_state_get_random( state ); - enkf_main_free( enkf_main ); - } - test_assert_uint_equal( rand1 , rand2 ); - - { - enkf_main_type * enkf_main = enkf_main_bootstrap( config_file , true , true ); - enkf_state_type * state = enkf_main_iget_state( enkf_main , 9 ); - rand2 = enkf_state_get_random( state ); - enkf_main_free( enkf_main ); - } - test_assert_uint_equal( rand1 , rand2 ); - test_work_area_free( work_area ); - } - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_run_arg.c b/ThirdParty/Ert/libenkf/tests/enkf_run_arg.c deleted file mode 100644 index cd38319e6d..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_run_arg.c +++ /dev/null @@ -1,158 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'ert_run_context.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include - -#include "ert/util/build_config.h" - -#include -#include -#include -#include -#include - -#include -#include -#include - - -void call_get_queue_index( void * arg ) { - run_arg_type * run_arg = run_arg_safe_cast( arg ); - run_arg_get_queue_index( run_arg ); -} - -void call_set_queue_index( void * arg ) { - run_arg_type * run_arg = run_arg_safe_cast( arg ); - run_arg_set_queue_index( run_arg , 88 ); -} - - -void test_queue_index() { - test_work_area_type * test_area = test_work_area_alloc("run_arg/ENS"); - { - enkf_fs_type * fs = enkf_fs_create_fs("sim" , BLOCK_FS_DRIVER_ID , NULL , true); - run_arg_type * run_arg = run_arg_alloc_ENSEMBLE_EXPERIMENT(fs , 0 , 6 , "path"); - - test_assert_false( run_arg_is_submitted( run_arg ) ); - test_assert_util_abort("run_arg_get_queue_index" , call_get_queue_index , run_arg ); - - run_arg_set_queue_index(run_arg, 78); - test_assert_true( run_arg_is_submitted( run_arg ) ); - test_assert_int_equal( 78 , run_arg_get_queue_index( run_arg )); - - test_assert_util_abort("run_arg_set_queue_index" , call_set_queue_index , run_arg ); - run_arg_free( run_arg ); - enkf_fs_decref( fs ); - } - test_work_area_free( test_area ); -} - -void call_get_result_fs( void * arg ) { - run_arg_type * run_arg = run_arg_safe_cast( arg ); - run_arg_get_result_fs( run_arg ); -} - - -void call_get_update_target_fs( void * arg ) { - run_arg_type * run_arg = run_arg_safe_cast( arg ); - run_arg_get_update_target_fs( run_arg ); -} - - - -void test_SMOOTHER_RUN( ) { - test_work_area_type * test_area = test_work_area_alloc("run_arg/SMOOTHER"); - { - enkf_fs_type * sim_fs = enkf_fs_create_fs("sim" , BLOCK_FS_DRIVER_ID , NULL , true); - enkf_fs_type * target_fs = enkf_fs_create_fs("target" , BLOCK_FS_DRIVER_ID , NULL , true); - run_arg_type * run_arg = run_arg_alloc_SMOOTHER_RUN(sim_fs , target_fs , 0 , 6 , "path"); - test_assert_true( run_arg_is_instance( run_arg )); - test_assert_ptr_equal( run_arg_get_init_fs( run_arg ) , sim_fs ); - test_assert_ptr_equal( run_arg_get_result_fs( run_arg ) , sim_fs ); - test_assert_ptr_equal( run_arg_get_update_target_fs( run_arg ) , target_fs ); - run_arg_free( run_arg ); - - enkf_fs_decref( sim_fs ); - enkf_fs_decref( target_fs ); - } - test_work_area_free( test_area ); -} - - -void alloc_invalid_run_arg(void *arg) { - test_work_area_type * test_area = test_work_area_alloc("run_arg/invalid"); - { - enkf_fs_type * fs = enkf_fs_create_fs("fs" , BLOCK_FS_DRIVER_ID , NULL , true); - run_arg_type * run_arg = run_arg_alloc_SMOOTHER_RUN(fs , fs , 0 , 6 , "path"); // This should explode ... - run_arg_free( run_arg ); - enkf_fs_decref( fs ); - } - test_work_area_free( test_area ); -} - - -void test_invalid_update_on_self( ) { - test_assert_util_abort( "run_arg_alloc" , alloc_invalid_run_arg , NULL); -} - - -void test_INIT_ONLY( ) { - test_work_area_type * test_area = test_work_area_alloc("run_arg/INIT"); - { - enkf_fs_type * init_fs = enkf_fs_create_fs("sim" , BLOCK_FS_DRIVER_ID , NULL , true); - - run_arg_type * run_arg = run_arg_alloc_INIT_ONLY(init_fs , 0 , 6 , "path"); - test_assert_true( run_arg_is_instance( run_arg )); - test_assert_ptr_equal( run_arg_get_init_fs( run_arg ) , init_fs ); - - test_assert_util_abort( "run_arg_get_result_fs" , call_get_result_fs , run_arg ); - test_assert_util_abort( "run_arg_get_update_target_fs" , call_get_update_target_fs , run_arg ); - run_arg_free( run_arg ); - - enkf_fs_decref( init_fs ); - } - test_work_area_free( test_area ); -} - - -void test_ENSEMBLE_EXPERIMENT( ) { - test_work_area_type * test_area = test_work_area_alloc("run_arg/ENS"); - { - enkf_fs_type * fs = enkf_fs_create_fs("sim" , BLOCK_FS_DRIVER_ID , NULL , true); - - run_arg_type * run_arg = run_arg_alloc_ENSEMBLE_EXPERIMENT(fs , 0 , 6 , "path"); - test_assert_true( run_arg_is_instance( run_arg )); - - test_assert_ptr_equal( run_arg_get_init_fs( run_arg ) , fs ); - test_assert_ptr_equal( run_arg_get_result_fs( run_arg ) , fs ); - test_assert_util_abort( "run_arg_get_update_target_fs" , call_get_update_target_fs , run_arg ); - - run_arg_free( run_arg ); - enkf_fs_decref( fs ); - } - test_work_area_free( test_area ); -} - - -int main(int argc , char ** argv) { - test_queue_index(); - test_SMOOTHER_RUN(); - test_INIT_ONLY(); - test_ENSEMBLE_EXPERIMENT(); - test_invalid_update_on_self(); - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_runpath_list.c b/ThirdParty/Ert/libenkf/tests/enkf_runpath_list.c deleted file mode 100644 index 95fcf9c937..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_runpath_list.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_runpath_list.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -void * add_pathlist( void * arg ) { - arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); - runpath_list_type * list = arg_pack_iget_ptr( arg_pack , 0 ); - int offset = arg_pack_iget_int( arg_pack , 1 ); - int bs = arg_pack_iget_int( arg_pack , 2 ); - - int i; - for (i=0; i < bs; i++) - runpath_list_add( list , i + offset , 0, "Path" , "Basename"); - - return NULL; -} - -void test_runpath_list() { - runpath_list_type * list = runpath_list_alloc("DefaultFile"); - - test_assert_int_equal( runpath_list_size( list ) , 0 ); - - runpath_list_add( list , 3 , 0, "path" , "base"); - runpath_list_add( list , 2 , 0, "path" , "base"); - runpath_list_add( list , 1 , 0, "path" , "base"); - - runpath_list_add( list , 3 , 1, "path" , "base"); - runpath_list_add( list , 2 , 1, "path" , "base"); - runpath_list_add( list , 1 , 1, "path" , "base"); - - test_assert_int_equal( runpath_list_size( list ) , 6 ); - test_assert_int_equal( runpath_list_iget_iens( list , 0 ) , 3 ); - test_assert_int_equal( runpath_list_iget_iens( list , 2 ) , 1 ); - test_assert_int_equal( runpath_list_iget_iter( list , 3 ) , 1 ); - - runpath_list_clear( list ); - test_assert_int_equal( runpath_list_size( list ) , 0 ); - - test_assert_string_equal( runpath_list_get_line_fmt( list ) , RUNPATH_LIST_DEFAULT_LINE_FMT ); - { - const char * other_line = "%d %s %s"; - runpath_list_set_line_fmt( list , other_line ); - test_assert_string_equal( runpath_list_get_line_fmt( list ) , other_line ); - } - runpath_list_set_line_fmt( list , NULL ); - test_assert_string_equal( runpath_list_get_line_fmt( list ) , RUNPATH_LIST_DEFAULT_LINE_FMT ); - - { - const int block_size = 100; - const int threads = 100; - thread_pool_type * tp = thread_pool_alloc( threads , true ); - int it; - - for (it = 0; it < threads; it++) { - int iens_offset = it * block_size; - arg_pack_type * arg_pack = arg_pack_alloc(); - - arg_pack_append_ptr( arg_pack , list ); - arg_pack_append_int( arg_pack , iens_offset ); - arg_pack_append_int( arg_pack , block_size ); - - thread_pool_add_job( tp , add_pathlist , arg_pack ); - } - thread_pool_join( tp ); - test_assert_int_equal( runpath_list_size( list ) , block_size * threads ); - - { - test_work_area_type * work_area = test_work_area_alloc("enkf_runpath_list" ); - runpath_list_fprintf( list ); - { - int file_iens; - int file_iter; - char file_path[256]; - char file_base[256]; - int iens; - FILE * stream = util_fopen( runpath_list_get_export_file(list) , "r"); - for (iens = 0; iens < threads * block_size; iens++) { - int fscanf_return = fscanf( stream , "%d %s %s %d" , &file_iens , file_path , file_base, &file_iter); - test_assert_int_equal(fscanf_return, 4 ); - test_assert_int_equal( file_iens , iens ); - test_assert_int_equal( file_iter , 0 ); - } - fclose( stream ); - } - test_work_area_free( work_area ); - } - } - runpath_list_free( list ); -} - - - -void test_config( const char * config_file ) { - ert_test_context_type * test_context = ert_test_context_alloc( "RUNPATH_FILE" , config_file ); - enkf_main_type * enkf_main = ert_test_context_get_main( test_context ); - hook_manager_type * hook_manager = enkf_main_get_hook_manager( enkf_main ); - - ert_test_context_run_worklow( test_context , "ARGECHO_WF"); - { - FILE * stream = util_fopen("runpath_list.txt" , "r"); - char runpath_file[256]; - fscanf(stream , "%s" , runpath_file ); - fclose( stream ); - test_assert_string_equal( runpath_file , hook_manager_get_runpath_list_file( hook_manager )); - } - - ert_test_context_free( test_context ); -} - - -void test_filename() { - runpath_list_type * list = runpath_list_alloc("DefaultFile"); - test_assert_string_equal( "DefaultFile" , runpath_list_get_export_file(list)); - runpath_list_set_export_file( list , "/tmp/file.txt"); - test_assert_string_equal( "/tmp/file.txt" , runpath_list_get_export_file(list)); - runpath_list_free( list ); -} - -int main(int argc , char ** argv) { - util_install_signals(); - { - test_runpath_list(); - test_config( argv[1] ); - test_filename(); - exit(0); - } -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_scale_correlated_std.c b/ThirdParty/Ert/libenkf/tests/enkf_scale_correlated_std.c deleted file mode 100644 index 59fd2aa401..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_scale_correlated_std.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright (C) 2015 Statoil ASA, Norway. - - The file 'enkf_scale_correlated_std.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include -#include - - - - -void test_scaling( ert_test_context_type * test_context , int nobs, const char** obs_keys ) { - stringlist_type * args = stringlist_alloc_new(); - for (int iobs=0; iobs < nobs; iobs++) - stringlist_append_ref( args , obs_keys[iobs]); - - test_assert_true( ert_test_context_run_worklow_job( test_context , "STD_SCALE" , args) ); - stringlist_free( args ); -} - - - -int main(int argc , const char ** argv) { - const char * config_file = argv[1]; - const char * workflow_job_file = argv[2]; - enkf_main_install_SIGNALS(); - { - ert_test_context_type * test_context = ert_test_context_alloc("std_scale_test" , config_file); - - ert_test_context_install_workflow_job( test_context , "STD_SCALE" , workflow_job_file ); - test_scaling(test_context , 1 , ( const char *[1] ) {"WWCT:OP_1"}); - test_scaling(test_context , 2 , ( const char *[2] ) {"WWCT:OP_1", "WWCT:OP_2"}); - test_scaling(test_context , 8 , ( const char *[8] ) {"RPR2_1", "RPR2_2","RPR2_3","RPR2_4","RPR2_5","RPR2_6","RPR2_7","RPR2_8"}); - - ert_test_context_free( test_context ); - } - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_select_case_job.c b/ThirdParty/Ert/libenkf/tests/enkf_select_case_job.c deleted file mode 100644 index 20e19df57b..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_select_case_job.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_select_case_job.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - - -int main(int argc , const char ** argv) { - enkf_main_install_SIGNALS(); - - const char * config_file = argv[1]; - const char * select_case_job = argv[2]; - - ert_test_context_type * test_context = ert_test_context_alloc("SELECT_CASE" , config_file ); - - test_assert_true( ert_test_context_install_workflow_job( test_context , "SELECT_CASE" , select_case_job)); - { - enkf_main_type * enkf_main = ert_test_context_get_main( test_context ); - stringlist_type * args = stringlist_alloc_new(); - stringlist_append_copy( args , "OtherCase"); - - test_assert_string_not_equal( "OtherCase" , enkf_main_get_current_fs( enkf_main )); - ert_test_context_run_worklow_job( test_context , "SELECT_CASE" , args); - test_assert_true( ert_test_context_run_worklow_job( test_context , "SELECT_CASE" , args) ); - test_assert_string_equal( "OtherCase" , enkf_main_get_current_fs( enkf_main )); - - stringlist_free( args ); - } - ert_test_context_free( test_context ); - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_site_config.c b/ThirdParty/Ert/libenkf/tests/enkf_site_config.c deleted file mode 100644 index c709d49b6d..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_site_config.c +++ /dev/null @@ -1,122 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_site_config.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include - - -#include - - - - -#define INCLUDE_KEY "INCLUDE" -#define DEFINE_KEY "DEFINE" - - -void test_empty() { - site_config_type * site_config = site_config_alloc_empty(); - site_config_free( site_config ); -} - - -void test_init(const char * config_file) { - site_config_type * site_config = site_config_alloc_empty(); - config_parser_type * config = config_alloc(); - config_content_type * content; - - site_config_add_config_items( config , true ); - content = config_parse(config , config_file , "--" , INCLUDE_KEY , DEFINE_KEY , NULL , CONFIG_UNRECOGNIZED_WARN , true); - if (!config_content_is_valid(content)) { - config_error_type * errors = config_content_get_errors( content ); - config_error_fprintf( errors , true , stderr ); - test_assert_true( false ); - } - - if (!site_config_init( site_config , content )) { - printf("Loading site_config from config failed\n"); - test_assert_true( false ); - } - - config_content_free( content ); - config_free( config ); - site_config_free( site_config ); -} - - -void test_job_script() { - test_work_area_type * test_area = test_work_area_alloc("site-config"); - { - site_config_type * site_config = site_config_alloc_empty(); - test_assert_false( site_config_has_job_script( site_config )); - - test_assert_false( site_config_set_job_script( site_config , "/does/not/exist" )); - test_assert_false( site_config_has_job_script( site_config )); - - { - FILE * job_script = util_fopen("Script.sh" , "w"); - fclose( job_script ); - } - test_assert_false( site_config_set_job_script( site_config , "Script.sh" )); - test_assert_false( site_config_has_job_script( site_config )); - chmod("Script.sh" , S_IRWXU ); - test_assert_true( site_config_set_job_script( site_config , "Script.sh" )); - test_assert_true( site_config_has_job_script( site_config )); - - test_assert_false( site_config_set_job_script( site_config , "DoesNotExits")); - test_assert_true( site_config_has_job_script( site_config )); - { - char * full_path = util_alloc_realpath( "Script.sh" ); - test_assert_string_equal( full_path , site_config_get_job_script( site_config)); - free( full_path ); - } - site_config_free( site_config ); - } - test_work_area_free( test_area ); -} - - - -int main(int argc , char ** argv) { - const char * site_config_file = argv[1]; - - util_install_signals(); - - test_empty(); - test_init( site_config_file ); - test_job_script(); - - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_state_manual_load_test.c b/ThirdParty/Ert/libenkf/tests/enkf_state_manual_load_test.c deleted file mode 100644 index c9a7cb9a02..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_state_manual_load_test.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_state_manual_load_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - - -int test_load_manually_to_new_case(enkf_main_type * enkf_main) { - int result = 0; - int iens = 0; - int iter = 0; - const char * casename = "new_case"; - enkf_main_select_fs( enkf_main , casename ); - - - enkf_fs_type * fs = enkf_main_get_fs( enkf_main ); - run_arg_type * run_arg = run_arg_alloc_ENSEMBLE_EXPERIMENT(fs , iens , iter , "simulations/run0"); - { - arg_pack_type * arg_pack = arg_pack_alloc(); - arg_pack_append_ptr( arg_pack , enkf_main_iget_state(enkf_main, 0)); - arg_pack_append_ptr( arg_pack , run_arg ); - arg_pack_append_owned_ptr( arg_pack , stringlist_alloc_new() , stringlist_free__); - arg_pack_append_bool( arg_pack, true ); - arg_pack_append_ptr( arg_pack, &result ); - - enkf_state_load_from_forward_model_mt(arg_pack); - arg_pack_free(arg_pack); - } - - return result; -} - - - - -int main(int argc , char ** argv) { - enkf_main_install_SIGNALS(); - const char * root_path = argv[1]; - const char * config_file = argv[2]; - - test_work_area_type * work_area = test_work_area_alloc(config_file); - test_work_area_copy_directory_content( work_area , root_path ); - { - bool strict = true; - enkf_main_type * enkf_main = enkf_main_bootstrap( config_file , strict , true ); - - test_assert_int_equal( 0 , test_load_manually_to_new_case(enkf_main)); - - enkf_main_free( enkf_main ); - } - test_work_area_free(work_area); - - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_state_map.c b/ThirdParty/Ert/libenkf/tests/enkf_state_map.c deleted file mode 100644 index b94c80f3dd..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_state_map.c +++ /dev/null @@ -1,368 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_state_map.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - - -void create_test() { - state_map_type * state_map = state_map_alloc(); - test_assert_true( state_map_is_instance( state_map )); - test_assert_int_equal( 0 , state_map_get_size( state_map )); - test_assert_false( state_map_is_readonly( state_map )); - state_map_free( state_map ); -} - -void get_test( ) { - state_map_type * state_map = state_map_alloc(); - test_assert_int_equal( STATE_UNDEFINED , state_map_iget( state_map , 0 )); - test_assert_int_equal( STATE_UNDEFINED , state_map_iget( state_map , 100 )); - state_map_free( state_map ); -} - -void set_test( ) { - state_map_type * state_map = state_map_alloc(); - state_map_iset( state_map , 0 , STATE_INITIALIZED ); - test_assert_int_equal( STATE_INITIALIZED , state_map_iget( state_map , 0 )); - - state_map_iset( state_map , 100 , STATE_INITIALIZED ); - test_assert_int_equal( STATE_INITIALIZED , state_map_iget( state_map , 100 )); - - test_assert_int_equal( STATE_UNDEFINED , state_map_iget( state_map , 50 )); - test_assert_int_equal( 101 , state_map_get_size( state_map )); - state_map_free( state_map ); -} - - -void load_empty_test() { - state_map_type * state_map = state_map_fread_alloc( "File/does/not/exists" ); - test_assert_true( state_map_is_instance( state_map )); - test_assert_int_equal( 0 , state_map_get_size( state_map )); - state_map_free( state_map ); -} - - -void test_equal() { - state_map_type * state_map1 = state_map_alloc(); - state_map_type * state_map2 = state_map_alloc(); - - test_assert_true( state_map_equal( state_map1 , state_map2 )); - for (int i =0; i < 25; i++) { - state_map_iset( state_map1 , i , STATE_INITIALIZED ); - state_map_iset( state_map2 , i , STATE_INITIALIZED ); - } - test_assert_true( state_map_equal( state_map1 , state_map2 )); - - state_map_iset( state_map2 , 15 , STATE_HAS_DATA ); - test_assert_false( state_map_equal( state_map1 , state_map2 )); - state_map_iset( state_map2 , 15 , STATE_LOAD_FAILURE ); - state_map_iset( state_map2 , 15 , STATE_INITIALIZED ); - test_assert_true( state_map_equal( state_map1 , state_map2 )); - - state_map_iset( state_map2 , 150 , STATE_INITIALIZED ); - test_assert_false( state_map_equal( state_map1 , state_map2 )); -} - - -void test_copy() { - state_map_type * state_map = state_map_alloc(); - state_map_iset( state_map , 0 , STATE_INITIALIZED ); - state_map_iset( state_map , 100 , STATE_INITIALIZED ); - { - state_map_type * copy = state_map_alloc_copy( state_map ); - test_assert_true( state_map_equal( copy , state_map )); - - state_map_iset( state_map , 10 , STATE_INITIALIZED ); - test_assert_false( state_map_equal( copy , state_map )); - - state_map_free( copy ); - } - state_map_free( state_map ); -} - - -void test_io( ) { - test_work_area_type * work_area = test_work_area_alloc( "enkf-state-map" ); - { - state_map_type * state_map = state_map_alloc(); - state_map_type * copy1 , *copy2; - state_map_iset( state_map , 0 , STATE_INITIALIZED ); - state_map_iset( state_map , 100 , STATE_INITIALIZED ); - state_map_fwrite( state_map , "map"); - - copy1 = state_map_fread_alloc( "map" ); - test_assert_true( state_map_equal( state_map , copy1 )); - - copy2 = state_map_alloc(); - test_assert_true( state_map_fread( copy2 , "map" ) ); - test_assert_true( state_map_equal( state_map , copy2 )); - - state_map_iset( copy2 , 67 , STATE_INITIALIZED ); - test_assert_false(state_map_equal( state_map , copy2 )); - - state_map_fread( copy2 , "map"); - test_assert_true( state_map_equal( state_map , copy2 )); - - test_assert_false(state_map_fread( copy2 , "DoesNotExist")); - test_assert_int_equal( 0 , state_map_get_size( copy2 )); - } - test_work_area_free( work_area ); -} - - - -void test_update_undefined( ) { - state_map_type * map = state_map_alloc( ); - - state_map_iset( map , 10 , STATE_INITIALIZED ); - test_assert_int_equal( STATE_UNDEFINED , state_map_iget( map , 5 ) ); - test_assert_int_equal( STATE_INITIALIZED , state_map_iget( map , 10 ) ); - - state_map_update_undefined( map , 5 , STATE_INITIALIZED ); - test_assert_int_equal( STATE_INITIALIZED , state_map_iget( map , 5 ) ); - - state_map_update_undefined( map , 10 , STATE_INITIALIZED ); - test_assert_int_equal( STATE_INITIALIZED , state_map_iget( map , 10 ) ); - - state_map_free( map ); -} - - -void test_update_matching( ) { - state_map_type * map = state_map_alloc( ); - - state_map_iset( map , 10 , STATE_INITIALIZED ); - state_map_iset( map , 3 , STATE_PARENT_FAILURE ); - test_assert_int_equal( STATE_UNDEFINED , state_map_iget( map , 5 ) ); - test_assert_int_equal( STATE_INITIALIZED , state_map_iget( map , 10 ) ); - - state_map_update_matching( map , 5 , STATE_UNDEFINED | STATE_LOAD_FAILURE , STATE_INITIALIZED ); - state_map_update_matching( map , 10 , STATE_UNDEFINED | STATE_LOAD_FAILURE , STATE_INITIALIZED ); - state_map_update_matching( map , 3 , STATE_UNDEFINED | STATE_LOAD_FAILURE , STATE_INITIALIZED ); - - test_assert_int_equal( STATE_INITIALIZED , state_map_iget( map , 5 ) ); - test_assert_int_equal( STATE_INITIALIZED , state_map_iget( map , 10 ) ); - test_assert_int_equal( STATE_PARENT_FAILURE , state_map_iget( map , 3 ) ); - - state_map_update_undefined( map , 10 , STATE_INITIALIZED ); - test_assert_int_equal( STATE_INITIALIZED , state_map_iget( map , 10 ) ); - - state_map_free( map ); -} - - -void test_select_matching( ) { - state_map_type * map = state_map_alloc( ); - bool_vector_type * mask1 = bool_vector_alloc(21 , false); - bool_vector_type * mask2 = bool_vector_alloc(1000 , true); - - state_map_iset( map , 10 , STATE_INITIALIZED ); - state_map_iset( map , 10 , STATE_HAS_DATA ); - state_map_iset( map , 20 , STATE_INITIALIZED ); - state_map_select_matching( map , mask1 , STATE_HAS_DATA | STATE_INITIALIZED ); - state_map_select_matching( map , mask2 , STATE_HAS_DATA | STATE_INITIALIZED ); - - for (int i=0; i < bool_vector_size( mask1 ); i++) { - if (i==10) - test_assert_true( bool_vector_iget( mask1 , i )); - else if (i== 20) - test_assert_true( bool_vector_iget( mask1 , i )); - else { - test_assert_false( bool_vector_iget( mask1 , i )); - test_assert_true( bool_vector_iget( mask2 , i )); - } - } - - state_map_iset( map , 50 , STATE_INITIALIZED ); - state_map_select_matching( map , mask1 , STATE_HAS_DATA | STATE_INITIALIZED ); - test_assert_int_equal(bool_vector_size( mask1 ), 21); - - bool_vector_free( mask1 ); - bool_vector_free( mask2 ); - state_map_free( map ); -} - - -void test_deselect_matching( ) { - state_map_type * map = state_map_alloc( ); - bool_vector_type * mask1 = bool_vector_alloc(0 , false); - bool_vector_type * mask2 = bool_vector_alloc(1000 , true); - - state_map_iset( map , 10 , STATE_INITIALIZED ); - state_map_iset( map , 10 , STATE_HAS_DATA ); - state_map_iset( map , 20 , STATE_INITIALIZED ); - state_map_deselect_matching( map , mask1 , STATE_HAS_DATA | STATE_INITIALIZED ); - state_map_deselect_matching( map , mask2 , STATE_HAS_DATA | STATE_INITIALIZED ); - - test_assert_int_equal( state_map_get_size( map ) , bool_vector_size( mask1 )); - - for (int i=0; i < bool_vector_size( mask1 ); i++) { - if (i==10) - test_assert_false( bool_vector_iget( mask1 , i )); - else if (i== 20) - test_assert_false( bool_vector_iget( mask2 , i )); - else { - test_assert_false( bool_vector_iget( mask1 , i )); - test_assert_true( bool_vector_iget( mask2 , i )); - } - } - - bool_vector_free( mask1 ); - bool_vector_free( mask2 ); - state_map_free( map ); -} - - -void test_set_from_mask() { - int i; - state_map_type * map1 = state_map_alloc(); - state_map_type * map2 = state_map_alloc(); - bool_vector_type * mask = bool_vector_alloc(0, false); - bool_vector_iset(mask , 10 , true); - bool_vector_iset(mask , 20 , true); - - state_map_set_from_mask(map1 , mask , STATE_INITIALIZED); - state_map_set_from_inverted_mask(map2 , mask , STATE_INITIALIZED); - test_assert_int_equal(21 , state_map_get_size(map1)); - test_assert_int_equal(21 , state_map_get_size(map2)); - for (i = 0; i < state_map_get_size(map1); i++) { - if (i == 10 || i== 20) { - test_assert_int_equal( STATE_INITIALIZED , state_map_iget( map1 , i) ); - test_assert_int_equal( STATE_UNDEFINED , state_map_iget(map2 , i)); - } - else { - test_assert_int_equal(STATE_UNDEFINED , state_map_iget(map1 , i )); - test_assert_int_equal( STATE_INITIALIZED , state_map_iget(map2 , i)); - } - - - } -} - - -void test_count_matching() { - state_map_type * map1 = state_map_alloc(); - state_map_iset(map1 , 10 , STATE_INITIALIZED ); - - state_map_iset(map1 , 15 , STATE_INITIALIZED ); - state_map_iset(map1 , 15 , STATE_HAS_DATA ); - - state_map_iset(map1 , 16 , STATE_INITIALIZED ); - state_map_iset(map1 , 16 , STATE_HAS_DATA ); - state_map_iset(map1 , 16 , STATE_LOAD_FAILURE ); - - test_assert_int_equal( 1 , state_map_count_matching( map1 , STATE_HAS_DATA)); - test_assert_int_equal( 2 , state_map_count_matching( map1 , STATE_HAS_DATA | STATE_LOAD_FAILURE)); - test_assert_int_equal( 3 , state_map_count_matching( map1 , STATE_HAS_DATA | STATE_LOAD_FAILURE | STATE_INITIALIZED)); - - state_map_free( map1 ); -} - -// Probably means that the target should be explicitly set to -// undefined before workflows which automatically change case. -void test_transitions() { - - test_assert_false( state_map_legal_transition(STATE_UNDEFINED , STATE_UNDEFINED )); - test_assert_true( state_map_legal_transition(STATE_UNDEFINED , STATE_INITIALIZED )); - test_assert_false( state_map_legal_transition(STATE_UNDEFINED , STATE_HAS_DATA )); - test_assert_false( state_map_legal_transition(STATE_UNDEFINED , STATE_LOAD_FAILURE )); - test_assert_true( state_map_legal_transition(STATE_UNDEFINED , STATE_PARENT_FAILURE )); - - test_assert_false( state_map_legal_transition(STATE_INITIALIZED , STATE_UNDEFINED )); - test_assert_true( state_map_legal_transition(STATE_INITIALIZED , STATE_INITIALIZED )); - test_assert_true( state_map_legal_transition(STATE_INITIALIZED , STATE_HAS_DATA )); - test_assert_true( state_map_legal_transition(STATE_INITIALIZED , STATE_LOAD_FAILURE )); - test_assert_true( state_map_legal_transition(STATE_INITIALIZED , STATE_PARENT_FAILURE )); // Should maybe false - if the commenta baove is taken into account. - - test_assert_false( state_map_legal_transition(STATE_HAS_DATA , STATE_UNDEFINED )); - test_assert_true( state_map_legal_transition(STATE_HAS_DATA , STATE_INITIALIZED )); - test_assert_true( state_map_legal_transition(STATE_HAS_DATA , STATE_HAS_DATA )); - test_assert_true( state_map_legal_transition(STATE_HAS_DATA , STATE_LOAD_FAILURE )); - test_assert_true( state_map_legal_transition(STATE_HAS_DATA , STATE_PARENT_FAILURE )); // Rerun - - test_assert_false( state_map_legal_transition(STATE_LOAD_FAILURE , STATE_UNDEFINED )); - test_assert_true( state_map_legal_transition(STATE_LOAD_FAILURE , STATE_INITIALIZED )); - test_assert_true( state_map_legal_transition(STATE_LOAD_FAILURE , STATE_HAS_DATA )); - test_assert_true( state_map_legal_transition(STATE_LOAD_FAILURE , STATE_LOAD_FAILURE )); - test_assert_false( state_map_legal_transition(STATE_LOAD_FAILURE , STATE_PARENT_FAILURE )); - - test_assert_false( state_map_legal_transition(STATE_PARENT_FAILURE , STATE_UNDEFINED )); - test_assert_true( state_map_legal_transition(STATE_PARENT_FAILURE , STATE_INITIALIZED )); - test_assert_false( state_map_legal_transition(STATE_PARENT_FAILURE , STATE_HAS_DATA )); - test_assert_false( state_map_legal_transition(STATE_PARENT_FAILURE , STATE_LOAD_FAILURE )); - test_assert_true( state_map_legal_transition(STATE_PARENT_FAILURE , STATE_PARENT_FAILURE )); -} - - - -void test_readonly() { - { - state_map_type * map1 = state_map_fread_alloc_readonly("FileDoesNotExist"); - - test_assert_true(state_map_is_instance(map1)); - test_assert_int_equal(0 , state_map_get_size( map1 )); - test_assert_true( state_map_is_readonly( map1 )); - state_map_free(map1); - } - { - test_work_area_type * work_area = test_work_area_alloc("state-map"); - state_map_type * map1 = state_map_alloc(); - - state_map_iset(map1 , 5 , STATE_INITIALIZED); - state_map_iset(map1 , 9 , STATE_INITIALIZED); - - state_map_fwrite(map1 , "map1"); - { - state_map_type * map2 = state_map_fread_alloc_readonly("map1"); - - test_assert_true(state_map_equal(map1 , map2)); - state_map_free(map2); - } - test_work_area_free( work_area ); - state_map_free(map1); - } -} - - -int main(int argc , char ** argv) { - create_test(); - get_test(); - set_test(); - load_empty_test(); - test_equal(); - test_copy(); - test_io(); - test_update_undefined( ); - test_select_matching(); - test_count_matching(); - test_transitions(); - test_readonly(); - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_state_report_step_compatible.c b/ThirdParty/Ert/libenkf/tests/enkf_state_report_step_compatible.c deleted file mode 100644 index 038fde60b0..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_state_report_step_compatible.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_state_report_step_compatible.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - - -bool check_ecl_sum_compatible(const enkf_main_type * enkf_main) -{ - stringlist_type * msg_list = stringlist_alloc_new(); - enkf_state_type * state = enkf_main_iget_state( enkf_main , 0 ); - enkf_fs_type * fs = enkf_main_get_fs( enkf_main ); - run_arg_type * run_arg = run_arg_alloc_ENSEMBLE_EXPERIMENT(fs , 0 , 0 , "simulations/run0"); - - state_map_type * state_map = enkf_fs_get_state_map(fs); - state_map_iset(state_map, 0, STATE_INITIALIZED); - - int error = enkf_state_load_from_forward_model( state , run_arg , msg_list ); - - - stringlist_free( msg_list ); - return (REPORT_STEP_INCOMPATIBLE & error) ? false : true; -} - - - -int main(int argc , char ** argv) { - enkf_main_install_SIGNALS(); - const char * root_path = argv[1]; - const char * config_file = argv[2]; - const char * compatible_str = argv[3]; - bool check_compatible; - - test_assert_true( util_sscanf_bool( compatible_str , &check_compatible)); - - test_work_area_type * work_area = test_work_area_alloc(config_file ); - test_work_area_copy_directory_content( work_area , root_path ); - - bool strict = true; - enkf_main_type * enkf_main = enkf_main_bootstrap( config_file , strict , true ); - - - test_assert_bool_equal(check_compatible , check_ecl_sum_compatible(enkf_main)); - - enkf_main_free( enkf_main ); - test_work_area_free(work_area); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_state_skip_summary_load_test.c b/ThirdParty/Ert/libenkf/tests/enkf_state_skip_summary_load_test.c deleted file mode 100644 index 09a19290fa..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_state_skip_summary_load_test.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_state_no_summary_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - - -bool check_ecl_sum_loaded(const enkf_main_type * enkf_main) -{ - enkf_fs_type * fs = enkf_main_get_fs( enkf_main ); - stringlist_type * msg_list = stringlist_alloc_new(); - enkf_state_type * state1 = enkf_main_iget_state( enkf_main , 0 ); - run_arg_type * run_arg1 = run_arg_alloc_ENSEMBLE_EXPERIMENT( fs , 0 , 0 , "simulations/run0"); - enkf_state_type * state2 = enkf_main_iget_state( enkf_main , 1 ); - run_arg_type * run_arg2 = run_arg_alloc_ENSEMBLE_EXPERIMENT( fs , 0 , 0 , "simulations/run1"); - - - state_map_type * state_map = enkf_fs_get_state_map(fs); - state_map_iset(state_map, 0, STATE_INITIALIZED); - - int error = enkf_state_load_from_forward_model( state1 , run_arg1 , msg_list ); - - - state_map_iset(state_map, 1, STATE_INITIALIZED); - error = enkf_state_load_from_forward_model( state2 , run_arg2 , msg_list ); - - stringlist_free( msg_list ); - return (0 == error); -} - - - -int main(int argc , char ** argv) { - enkf_main_install_SIGNALS(); - const char * root_path = argv[1]; - const char * config_file = argv[2]; - - test_work_area_type * work_area = test_work_area_alloc(config_file ); - test_work_area_copy_directory_content( work_area , root_path ); - - bool strict = true; - enkf_main_type * enkf_main = enkf_main_bootstrap( config_file , strict , true ); - - test_assert_true( check_ecl_sum_loaded(enkf_main) ); - - enkf_main_free( enkf_main ); - test_work_area_free(work_area); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_time_map.c b/ThirdParty/Ert/libenkf/tests/enkf_time_map.c deleted file mode 100644 index 04daccbceb..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_time_map.c +++ /dev/null @@ -1,398 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_time_map.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include "ert/util/build_config.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - -void ecl_test( const char * ecl_case ) { - ecl_sum_type * ecl_sum = ecl_sum_fread_alloc_case( ecl_case , ":"); - time_t start_time = ecl_sum_get_start_time( ecl_sum ); - time_t end_time = ecl_sum_get_end_time( ecl_sum ); - time_map_type * ecl_map = time_map_alloc( ); - - test_assert_true( time_map_summary_update( ecl_map , ecl_sum ) ); - test_assert_true( time_map_summary_update( ecl_map , ecl_sum ) ); - - test_assert_time_t_equal( time_map_get_start_time( ecl_map ) , start_time ); - test_assert_time_t_equal( time_map_get_end_time( ecl_map ) , end_time ); - test_assert_double_equal( time_map_get_end_days( ecl_map ) , ecl_sum_get_sim_length( ecl_sum )); - - time_map_clear( ecl_map ); - time_map_update( ecl_map , 1 , 256 ); - time_map_set_strict( ecl_map , false ); - test_assert_false( time_map_summary_update( ecl_map , ecl_sum )); - - time_map_free( ecl_map ); - ecl_sum_free( ecl_sum ); -} - - -static void map_update( void * arg ) { - vector_type * arg_vector = vector_safe_cast( arg ); - time_map_type * tmap = vector_iget( arg_vector , 0 ); - ecl_sum_type * sum = vector_iget( arg_vector , 1 ); - - time_map_summary_update( tmap , sum ); -} - - - -void test_inconsistent_summary( const char * case1, const char * case2) { - ecl_sum_type * ecl_sum1 = ecl_sum_fread_alloc_case( case1 , ":"); - ecl_sum_type * ecl_sum2 = ecl_sum_fread_alloc_case( case2 , ":"); - - time_map_type * ecl_map = time_map_alloc( ); - - test_assert_true( time_map_summary_update( ecl_map , ecl_sum1 ) ); - { - vector_type * arg = vector_alloc_new(); - vector_append_ref( arg , ecl_map ); - vector_append_ref( arg , ecl_sum2 ); - test_assert_util_abort("time_map_summary_update_abort" , map_update , arg); - vector_free( arg ); - } - - time_map_free( ecl_map ); - ecl_sum_free( ecl_sum1 ); - ecl_sum_free( ecl_sum2 ); -} - -static void alloc_index_map( void * arg) { - arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); - time_map_type * map = arg_pack_iget_ptr( arg_pack , 0 ); - ecl_sum_type * sum = arg_pack_iget_ptr( arg_pack , 1 ); - - time_map_alloc_index_map( map , sum ); -} - - - -void test_refcase( const char * refcase_name , const char * case1, const char * case2 , const char * case3 , const char * case4) { - ecl_sum_type * refcase = ecl_sum_fread_alloc_case( refcase_name , ":"); - ecl_sum_type * ecl_sum1 = ecl_sum_fread_alloc_case( case1 , ":"); - ecl_sum_type * ecl_sum2 = ecl_sum_fread_alloc_case( case2 , ":"); - ecl_sum_type * ecl_sum3 = ecl_sum_fread_alloc_case( case3 , ":"); - ecl_sum_type * ecl_sum4 = ecl_sum_fread_alloc_case( case4 , ":"); - - { - time_map_type * ecl_map = time_map_alloc( ); - test_assert_false( time_map_has_refcase( ecl_map )); - test_assert_true( time_map_attach_refcase( ecl_map , refcase ) ); - test_assert_true( time_map_has_refcase( ecl_map )); - time_map_free( ecl_map ); - } - - - { - time_map_type * ecl_map = time_map_alloc( ); - time_map_attach_refcase( ecl_map , refcase ); - test_assert_true( time_map_summary_update( ecl_map , ecl_sum1 ) ); - } - - { - time_map_type * ecl_map = time_map_alloc( ); - - time_map_set_strict( ecl_map , false ); - time_map_attach_refcase( ecl_map , refcase ); - - test_assert_false( time_map_summary_update( ecl_map , ecl_sum2 ) ); - test_assert_int_equal( 25 , time_map_get_size( ecl_map )); - test_assert_true( time_map_summary_update( ecl_map , ecl_sum1 ) ); - test_assert_int_equal( 63 , time_map_get_size( ecl_map )); - } - - { - time_map_type * ecl_map = time_map_alloc( ); - test_assert_true( time_map_summary_update( ecl_map , ecl_sum2 ) ); - test_assert_false( time_map_attach_refcase( ecl_map , refcase )); - } - - - { - test_work_area_type * work_area = test_work_area_alloc( "time_map/attach_short_refcase"); - { - time_map_type * ecl_map = time_map_alloc( ); - test_assert_true( time_map_summary_update( ecl_map , refcase ) ); - test_assert_true( time_map_update( ecl_map , ecl_sum_get_last_report_step( refcase ) + 1 , ecl_sum_get_end_time( refcase ) + 100 )); - test_assert_true( time_map_update( ecl_map , ecl_sum_get_last_report_step( refcase ) + 2 , ecl_sum_get_end_time( refcase ) + 200 )); - test_assert_true( time_map_update( ecl_map , ecl_sum_get_last_report_step( refcase ) + 3 , ecl_sum_get_end_time( refcase ) + 300 )); - time_map_fwrite( ecl_map , "time_map"); - time_map_free( ecl_map ); - } - { - time_map_type * ecl_map = time_map_alloc( ); - time_map_fread(ecl_map , "time_map"); - test_assert_true( time_map_attach_refcase( ecl_map , refcase ) ); - time_map_free( ecl_map ); - } - test_work_area_free( work_area ); - } - - - - ecl_sum_free( refcase ); - ecl_sum_free( ecl_sum1 ); - ecl_sum_free( ecl_sum2 ); - ecl_sum_free( ecl_sum3 ); - ecl_sum_free( ecl_sum4 ); -} - - -void test_index_map( const char * case1, const char * case2 , const char * case3 , const char * case4) { - ecl_sum_type * ecl_sum1 = ecl_sum_fread_alloc_case( case1 , ":"); - ecl_sum_type * ecl_sum2 = ecl_sum_fread_alloc_case( case2 , ":"); - ecl_sum_type * ecl_sum3 = ecl_sum_fread_alloc_case( case3 , ":"); - ecl_sum_type * ecl_sum4 = ecl_sum_fread_alloc_case( case4 , ":"); - - time_map_type * ecl_map = time_map_alloc( ); - - { - int_vector_type * index_map = time_map_alloc_index_map( ecl_map , ecl_sum1 ); - test_assert_int_equal( int_vector_size( index_map ) , 0); - int_vector_free( index_map ); - } - - test_assert_true( time_map_summary_update( ecl_map , ecl_sum1 ) ); - { - int_vector_type * index_map = time_map_alloc_index_map( ecl_map , ecl_sum1 ); - int i; - for (i=0; i < int_vector_size( index_map ); i++) - test_assert_int_equal( i , int_vector_iget( index_map , i )); - - test_assert_int_equal( int_vector_size( index_map ) , ecl_sum_get_last_report_step( ecl_sum1) + 1); - int_vector_free( index_map ); - } - - /* case2 has an extra tstep in the middle of the case. */ - time_map_set_strict( ecl_map , false ); - test_assert_false( time_map_summary_update( ecl_map , ecl_sum2 ) ); - { - int_vector_type * index_map = time_map_alloc_index_map( ecl_map , ecl_sum2 ); - test_assert_int_equal( int_vector_size( index_map ) , ecl_sum_get_last_report_step( ecl_sum2)); - test_assert_int_equal( int_vector_iget( index_map , 24) , 24); - test_assert_int_equal( int_vector_iget( index_map , 25) , 26); - int_vector_free( index_map ); - } - - - /* case3 has an extra tstep in the middle, and ends prematurely */ - test_assert_false( time_map_summary_update( ecl_map , ecl_sum3 ) ); - { - int_vector_type * index_map = time_map_alloc_index_map( ecl_map , ecl_sum3 ); - test_assert_int_equal( int_vector_size( index_map ) , ecl_sum_get_last_report_step( ecl_sum3)); - int_vector_free( index_map ); - } - - - /* case4 has a missing tstep in the middle - that is not handled; and we abort */ - test_assert_false( time_map_summary_update( ecl_map , ecl_sum4 ) ); - { - arg_pack_type * arg = arg_pack_alloc(); - arg_pack_append_ptr( arg , ecl_map ); - arg_pack_append_ptr( arg , ecl_sum4 ); - - test_assert_util_abort( "time_map_alloc_index_map" , alloc_index_map , arg); - arg_pack_free( arg ); - } - - - - time_map_free( ecl_map ); - ecl_sum_free( ecl_sum1 ); - ecl_sum_free( ecl_sum2 ); - ecl_sum_free( ecl_sum3 ); - ecl_sum_free( ecl_sum4 ); -} - - -void simple_test() { - time_map_type * time_map = time_map_alloc( ); - test_work_area_type * work_area = test_work_area_alloc("enkf_time_map" ); - const char * mapfile = "map"; - - time_map_set_strict( time_map , false ); - test_assert_true( time_map_update( time_map , 0 , 100 ) ); - test_assert_true( time_map_update( time_map , 1 , 200 ) ); - test_assert_true( time_map_update( time_map , 1 , 200 ) ); - test_assert_false( time_map_update( time_map , 1 , 250 ) ); - - test_assert_true( time_map_equal( time_map , time_map ) ); - time_map_fwrite( time_map , mapfile); - { - time_map_type * time_map2 = time_map_alloc( ); - - test_assert_false( time_map_equal( time_map , time_map2 ) ); - time_map_fread( time_map2 , mapfile ); - test_assert_true( time_map_equal( time_map , time_map2 ) ); - time_map_free( time_map2 ); - } - { - time_t mtime1 = util_file_mtime( mapfile ); - sleep(2); - time_map_fwrite( time_map , mapfile); - - test_assert_time_t_equal( mtime1 , util_file_mtime( mapfile ) ); - time_map_update( time_map , 2 , 300 ); - time_map_fwrite( time_map , mapfile); - test_assert_time_t_not_equal( mtime1 , util_file_mtime( mapfile ) ); - } - test_work_area_free( work_area ); -} - - -static void simple_update(void * arg) { - time_map_type * tmap = time_map_safe_cast( arg ); - - time_map_update( tmap , 0 , 101 ); -} - - - -void simple_test_inconsistent() { - time_map_type * time_map = time_map_alloc( ); - - test_assert_true( time_map_update( time_map , 0 , 100 ) ); - time_map_set_strict( time_map , false ); - test_assert_false( time_map_update( time_map , 0 , 101 ) ); - - time_map_set_strict( time_map , true ); - test_assert_util_abort( "time_map_update_abort" , simple_update , time_map ); - - time_map_free( time_map ); -} - - - -#define MAP_SIZE 10000 - -void * update_time_map( void * arg ) { - time_map_type * time_map = time_map_safe_cast( arg ); - int i; - for (i=0; i < MAP_SIZE; i++) - time_map_update( time_map , i , i ); - - test_assert_int_equal( MAP_SIZE , time_map_get_size( time_map )); - return NULL; -} - - -void thread_test() { - time_map_type * time_map = time_map_alloc( ); - test_assert_false( time_map_is_readonly( time_map )); - { - int pool_size = 1000; - thread_pool_type * tp = thread_pool_alloc( pool_size/2 , true ); - - thread_pool_add_job( tp , update_time_map , time_map ); - - thread_pool_join(tp); - thread_pool_free(tp); - } - { - int i; - for (i=0; i < MAP_SIZE; i++) - test_assert_true( time_map_iget( time_map , i ) == i ); - } - time_map_free( time_map ); -} - - - -void test_read_only() { - test_work_area_type * work_area = test_work_area_alloc("time-map"); - { - time_map_type * tm = time_map_alloc( ); - - test_assert_true( time_map_is_instance( tm )); - test_assert_true( time_map_is_strict( tm )); - test_assert_false( time_map_is_readonly( tm )); - - time_map_update( tm , 0 , 0 ); - time_map_update( tm , 1 , 10 ); - time_map_update( tm , 2 , 20 ); - - time_map_fwrite( tm , "case/files/time-map" ); - time_map_free( tm ); - } - { - time_map_type * tm = time_map_fread_alloc_readonly( "case/files/time-map"); - test_assert_time_t_equal( 0 , time_map_iget( tm , 0 )); - test_assert_time_t_equal( 10 , time_map_iget( tm , 1 )); - test_assert_time_t_equal( 20 , time_map_iget( tm , 2 )); - test_assert_int_equal( 3 , time_map_get_size( tm )); - time_map_free( tm ); - } - { - time_map_type * tm = enkf_fs_alloc_readonly_time_map( "case" ); - test_assert_time_t_equal( 0 , time_map_iget( tm , 0 )); - test_assert_time_t_equal( 10 , time_map_iget( tm , 1 )); - test_assert_time_t_equal( 20 , time_map_iget( tm , 2 )); - test_assert_int_equal( 3 , time_map_get_size( tm )); - time_map_free( tm ); - } - { - time_map_type * tm = time_map_fread_alloc_readonly( "DoesNotExist"); - test_assert_true( time_map_is_instance( tm )); - test_assert_true( time_map_is_readonly( tm )); - test_assert_int_equal(0 , time_map_get_size( tm )); - time_map_free( tm ); - } - test_work_area_free( work_area ); -} - - -int main(int argc , char ** argv) { - - enkf_main_install_SIGNALS(); - ert_log_init_log(0 , NULL , false ); // Make sure there will be no logging. - - if (argc == 1) { - simple_test(); - simple_test_inconsistent(); - thread_test(); - } else { - ecl_test( argv[1] ); - test_inconsistent_summary( argv[1] , argv[2]); - test_index_map(argv[1] , argv[2] , argv[3] , argv[4]); - test_refcase( argv[1] , argv[1] , argv[2] , argv[3] , argv[4]); - } - - test_read_only(); - - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/enkf_umask_config_test.c b/ThirdParty/Ert/libenkf/tests/enkf_umask_config_test.c deleted file mode 100644 index afa61e0833..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_umask_config_test.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright (C) 2016 Statoil ASA, Norway. - - This file is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - - - -int main(int argc , char ** argv) { - enkf_main_install_SIGNALS(); - - const char * config_file = argv[1]; - ert_test_context_type * test_context = ert_test_context_alloc("VerifyJobsFileTest" , config_file); - enkf_main_type * enkf_main = ert_test_context_get_main(test_context); - - { - const int ens_size = enkf_main_get_ensemble_size( enkf_main ); - bool_vector_type * iactive = bool_vector_alloc(0, false); - bool_vector_iset( iactive , ens_size - 1 , true ); - - enkf_main_create_run_path(enkf_main , iactive , 0); - bool_vector_free(iactive); - } - - const char * filename = util_alloc_filename(ert_test_context_get_cwd(test_context), - "simulations/run0/jobs.py", NULL); - const char * jobs_file_content = util_fread_alloc_file_content(filename, NULL); - - test_assert_true (strstr(jobs_file_content, "umask = 0022") != NULL); - test_assert_false (strstr(jobs_file_content, "umask = 0023") != NULL); - test_assert_false (strstr(jobs_file_content, "umask = 0032") != NULL); - test_assert_false (strstr(jobs_file_content, "umask = 0122") != NULL); - test_assert_false (strstr(jobs_file_content, "umask = 1022") != NULL); - - ert_test_context_free(test_context); - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_workflow_job_test.c b/ThirdParty/Ert/libenkf/tests/enkf_workflow_job_test.c deleted file mode 100644 index d924dc0440..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_workflow_job_test.c +++ /dev/null @@ -1,494 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_workflow_job_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include -#include - - -ert_test_context_type * create_context( const char * config_file, const char * name ) { - ert_test_context_type * test_context = ert_test_context_alloc(name , config_file); - test_assert_not_NULL(test_context); - return test_context; -} - -void test_create_case_job(ert_test_context_type * test_context, const char * job_name , const char * job_file) { - stringlist_type * args = stringlist_alloc_new(); - stringlist_append_copy( args , "newly_created_case"); - test_assert_true( ert_test_context_install_workflow_job( test_context , job_name , job_file )); - test_assert_true( ert_test_context_run_worklow_job( test_context , job_name , args) ); - - char * new_case = util_alloc_filename( "storage" , "newly_created_case" , NULL); - test_assert_true(util_is_directory(new_case)); - free(new_case); - - stringlist_free( args ); -} - - -void test_init_case_job(ert_test_context_type * test_context, const char * job_name , const char * job_file) { - stringlist_type * args = stringlist_alloc_new(); - enkf_main_type * enkf_main = ert_test_context_get_main(test_context); - - test_assert_true( ert_test_context_install_workflow_job( test_context , "JOB" , job_file ) ); - - //Test init current case from existing - { - enkf_fs_type * cur_fs = enkf_main_mount_alt_fs( enkf_main , "new_current_case" , true ); - enkf_main_select_fs(enkf_main, "new_current_case"); - - test_assert_ptr_not_equal(cur_fs , enkf_main_get_fs( enkf_main )); - - stringlist_append_copy( args, "default"); //case to init from - test_assert_true( ert_test_context_run_worklow_job( test_context , "JOB" , args) ); - - enkf_fs_decref(cur_fs); - } - - { - const char * current_case = enkf_main_get_current_fs( enkf_main ); - test_assert_string_equal(current_case, "new_current_case"); - test_assert_true(enkf_fs_has_node(enkf_main_get_fs(enkf_main), "PERMZ", PARAMETER, 0, 0)); // This had state = ANALYZED; might be unfixable. - - enkf_fs_type * default_fs = enkf_main_mount_alt_fs( enkf_main , "default" , true ); - state_map_type * default_state_map = enkf_fs_get_state_map(default_fs); - state_map_type * current_state_map = enkf_fs_get_state_map(enkf_main_get_fs(enkf_main)); - test_assert_int_equal(state_map_get_size(default_state_map), state_map_get_size(current_state_map)); - enkf_fs_decref(default_fs); - } - - - //Test init case from existing case: - stringlist_clear(args); - stringlist_append_copy(args, "default"); //case to init from - stringlist_append_copy(args, "new_not_current_case"); - test_assert_true( ert_test_context_run_worklow_job( test_context , "JOB" , args) ); - { - enkf_fs_type * fs = enkf_main_mount_alt_fs(enkf_main, "new_not_current_case", true); - test_assert_not_NULL( fs ); - test_assert_true( enkf_fs_has_node(fs, "PERMZ", PARAMETER, 0, 0)); // This had state = ANALYZED; might be unfixable. - - enkf_fs_type * default_fs = enkf_main_mount_alt_fs( enkf_main , "default" , true ); - state_map_type * default_state_map = enkf_fs_get_state_map(default_fs); - state_map_type * new_state_map = enkf_fs_get_state_map(fs); - test_assert_int_equal(state_map_get_size(default_state_map), state_map_get_size(new_state_map)); - enkf_fs_decref(fs); - } - - stringlist_free( args ); -} - - -void test_load_results_job(ert_test_context_type * test_context , const char * job_name , const char * job_file) { - stringlist_type * args = stringlist_alloc_new(); - ert_test_context_install_workflow_job( test_context , job_name , job_file ); - stringlist_append_copy( args , "0"); - stringlist_append_copy( args , ","); - stringlist_append_copy( args , "1"); - test_assert_true( ert_test_context_run_worklow_job( test_context , job_name , args) ); - stringlist_free( args ); -} - - -void test_load_results_iter_job(ert_test_context_type * test_context , const char * job_name , const char * job_file) { - - stringlist_type * args = stringlist_alloc_new(); - ert_test_context_install_workflow_job( test_context , job_name , job_file ); - stringlist_append_copy( args , "0"); - stringlist_append_copy( args , "0"); - stringlist_append_copy( args , ","); - stringlist_append_copy( args , "1"); - test_assert_true( ert_test_context_run_worklow_job( test_context , job_name , args) ); - stringlist_free( args ); -} - - -void test_rank_realizations_on_observations_job(ert_test_context_type * test_context , const char * job_name , const char * job_file) { - stringlist_type * args = stringlist_alloc_new(); - ert_test_context_install_workflow_job( test_context , job_name , job_file ); - - stringlist_append_copy( args , "NameOfObsRanking1"); - stringlist_append_copy( args , "|"); - stringlist_append_copy( args , "WOPR:*"); - test_assert_true( ert_test_context_run_worklow_job( test_context , job_name , args) ); - - stringlist_clear(args); - stringlist_append_copy( args , "NameOfObsRanking2"); - stringlist_append_copy( args, "1-5"); - stringlist_append_copy( args, "55"); - stringlist_append_copy( args , "|"); - stringlist_append_copy( args , "WWCT:*"); - stringlist_append_copy( args , "WOPR:*"); - test_assert_true( ert_test_context_run_worklow_job( test_context , job_name , args) ); - - stringlist_clear(args); - stringlist_append_copy( args , "NameOfObsRanking3"); - stringlist_append_copy( args, "5"); - stringlist_append_copy( args, "55"); - stringlist_append_copy( args, "|"); - test_assert_true( ert_test_context_run_worklow_job( test_context , job_name , args) ); - - stringlist_clear(args); - stringlist_append_copy( args , "NameOfObsRanking4"); - stringlist_append_copy( args, "1,3,5-10"); - stringlist_append_copy( args, "55"); - test_assert_true( ert_test_context_run_worklow_job( test_context , job_name , args) ); - - stringlist_clear(args); - stringlist_append_copy( args , "NameOfObsRanking5"); - test_assert_true( ert_test_context_run_worklow_job( test_context , job_name , args) ); - - stringlist_clear(args); - stringlist_append_copy( args , "NameOfObsRanking6"); - stringlist_append_copy( args, "|"); - stringlist_append_copy( args , "UnrecognizableObservation"); - test_assert_true( ert_test_context_run_worklow_job( test_context , job_name , args) ); - - stringlist_free( args ); -} - - -void test_rank_realizations_on_data_job(ert_test_context_type * test_context , const char * job_name , const char * job_file) { - stringlist_type * args = stringlist_alloc_new(); - ert_test_context_install_workflow_job( test_context , job_name , job_file ); - - stringlist_append_copy( args , "NameOfDataRanking"); - stringlist_append_copy( args , "PORO:1,2,3"); - stringlist_append_copy( args , "false"); - stringlist_append_copy( args , "0"); - test_assert_true( ert_test_context_run_worklow_job( test_context , job_name , args) ); - - stringlist_clear(args); - stringlist_append_copy( args , "NameOfDataRanking2"); - stringlist_append_copy( args , "PORO:1,2,3"); - stringlist_append_copy( args , "false"); - test_assert_true( ert_test_context_run_worklow_job( test_context , job_name , args) ); - - stringlist_free( args ); -} - -void test_export_ranking(ert_test_context_type * test_context , const char * job_name , const char * job_file) { - stringlist_type * args = stringlist_alloc_new(); - ert_test_context_install_workflow_job( test_context , job_name , job_file ); - - stringlist_append_copy( args , "NameOfDataRanking"); - stringlist_append_copy( args , "/tmp/fileToSaveDataRankingIn.txt"); - test_assert_true( ert_test_context_run_worklow_job( test_context , job_name , args) ); - - stringlist_clear(args); - stringlist_append_copy( args , "NameOfObsRanking1"); - stringlist_append_copy( args , "/tmp/fileToSaveObservationRankingIn1.txt"); - test_assert_true( ert_test_context_run_worklow_job( test_context , job_name , args) ); - - stringlist_clear(args); - stringlist_append_copy( args , "NameOfObsRanking6"); - stringlist_append_copy( args , "/tmp/fileToSaveObservationRankingIn6.txt"); - test_assert_true( ert_test_context_run_worklow_job( test_context , job_name , args) ); - - stringlist_free( args ); -} - - -void test_init_misfit_table(ert_test_context_type * test_context , const char * job_name , const char * job_file) { - stringlist_type * args = stringlist_alloc_new(); - ert_test_context_install_workflow_job( test_context , job_name , job_file ); - - enkf_main_type * enkf_main = ert_test_context_get_main(test_context); - enkf_fs_type * fs = enkf_main_get_fs(enkf_main); - - misfit_ensemble_type * misfit_ensemble = enkf_fs_get_misfit_ensemble( fs ); - test_assert_false(misfit_ensemble_initialized(misfit_ensemble)); - - test_assert_true( ert_test_context_run_worklow_job( test_context , job_name , args) ); - - test_assert_true(misfit_ensemble_initialized(misfit_ensemble)); - - stringlist_free( args ); -} - - - - -static void test_export_runpath_file(ert_test_context_type * test_context, - const char * job_name, - const char * job_file, - stringlist_type * args, - int_vector_type * iens_values, - int_vector_type * iter_values) { - - ert_test_context_install_workflow_job( test_context , job_name , job_file ); - test_assert_true( ert_test_context_run_worklow_job( test_context , job_name , args) ); - - { - const enkf_main_type * enkf_main = ert_test_context_get_main(test_context); - hook_manager_type * hook_manager = enkf_main_get_hook_manager( enkf_main ); - const char * runpath_file_name = hook_manager_get_runpath_list_file(hook_manager); - - ecl_config_type * ecl_config = enkf_main_get_ecl_config(enkf_main); - const model_config_type * model_config = enkf_main_get_model_config(enkf_main); - const char * base_fmt = ecl_config_get_eclbase(ecl_config); - const char * runpath_fmt = model_config_get_runpath_as_char(model_config); - - test_assert_true(util_file_exists(runpath_file_name)); - FILE * file = util_fopen(runpath_file_name, "r"); - - int file_iens = 0; - char file_path[256]; - char file_base[256]; - int file_iter = 0; - char * cwd = util_alloc_cwd(); - int counter = 0; - int iens_index = 0; - int iter_index = 0; - - while (4 == fscanf( file , "%d %s %s %d" , &file_iens , file_path , file_base, &file_iter)) { - ++ counter; - - test_assert_true(int_vector_size(iens_values) >= iens_index+1); - test_assert_true(int_vector_size(iter_values) >= iter_index+1); - - int iens = int_vector_iget(iens_values, iens_index); - int iter = int_vector_iget(iter_values, iter_index); - - test_assert_int_equal(file_iens, iens); - test_assert_int_equal(file_iter, iter); - - char * base = util_alloc_sprintf("--%d", iens); - if (base_fmt && (util_int_format_count(base_fmt) == 1)) - base = util_alloc_sprintf(base_fmt, iens); - - test_assert_string_equal(base, file_base); - - char * runpath = ""; - if (util_int_format_count(runpath_fmt) == 1) - runpath = util_alloc_sprintf(runpath_fmt, iens); - else if (util_int_format_count(runpath_fmt) == 2) - runpath = util_alloc_sprintf(runpath_fmt, iens,iter); - - test_assert_string_equal(runpath, file_path); - - if (iens_index+1 < int_vector_size(iens_values)) - ++iens_index; - else if ((iens_index+1 == int_vector_size(iens_values))) { - ++iter_index; - iens_index = 0; - } - - free(base); - free(runpath); - } - - int linecount = int_vector_size(iens_values) * int_vector_size(iter_values); - test_assert_int_equal(linecount, counter); - free(cwd); - fclose(file); - } -} - - - -void test_export_runpath_files(const char * config_file, - const char * config_file_iterations, - const char * job_file_export_runpath) { - - stringlist_type * args = stringlist_alloc_new(); - const char * job_name = "export_job"; - - ert_test_context_type * test_context_iterations = create_context( config_file_iterations, "enkf_workflow_job_test_export_runpath_iter" ); - - { - int_vector_type * iens_values = int_vector_alloc(5,0); - const int iens[5] = {0,1,2,3,4}; - int_vector_set_many(iens_values, 0, &iens[0], 5); - int_vector_type * iter_values = int_vector_alloc(1,0); - - test_export_runpath_file(test_context_iterations, job_name, job_file_export_runpath, args, iens_values, iter_values); - - int_vector_free(iens_values); - int_vector_free(iter_values); - } - { - stringlist_append_copy( args, "0-2"); //realization range - - int_vector_type * iens_values = int_vector_alloc(3,0); - const int iens[] = {0,1,2}; - int_vector_set_many(iens_values, 0, &iens[0], 3); - int_vector_type * iter_values = int_vector_alloc(1,0); - - test_export_runpath_file(test_context_iterations, job_name, job_file_export_runpath, args, iens_values, iter_values); - - int_vector_free(iens_values); - int_vector_free(iter_values); - - stringlist_clear(args); - } - { - stringlist_append_copy( args, "0,3-5"); //realization range - - int_vector_type * iens_values = int_vector_alloc(4,0); - const int iens[] = {0,3,4,5}; - int_vector_set_many(iens_values, 0, &iens[0], 4); - int_vector_type * iter_values = int_vector_alloc(1,0); - - test_export_runpath_file(test_context_iterations, job_name, job_file_export_runpath, args, iens_values, iter_values); - - int_vector_free(iens_values); - int_vector_free(iter_values); - - stringlist_clear(args); - } - { - stringlist_append_copy( args, "1-2"); //realization range - stringlist_append_copy( args, "|"); //delimiter - stringlist_append_copy( args, "1-3"); //iteration range - - int_vector_type * iens_values = int_vector_alloc(2,0); - int iens[] = {1,2}; - int_vector_set_many(iens_values, 0, &iens[0], 2); - int_vector_type * iter_values = int_vector_alloc(3,0); - int iter[] = {1,2,3}; - int_vector_set_many(iter_values, 0, &iter[0], 3); - - test_export_runpath_file(test_context_iterations, job_name, job_file_export_runpath, args, iens_values, iter_values); - - int_vector_free(iens_values); - int_vector_free(iter_values); - - stringlist_clear(args); - } - { - stringlist_append_copy( args, "*"); //realization range - stringlist_append_copy( args, "|"); //delimiter - stringlist_append_copy( args, "*"); //iteration range - - int_vector_type * iens_values = int_vector_alloc(5,0); - int iens[] = {0,1,2,3,4}; - int_vector_set_many(iens_values, 0, &iens[0], 5); - int_vector_type * iter_values = int_vector_alloc(4,0); - int iter[] = {0,1,2,3}; - int_vector_set_many(iter_values, 0, &iter[0], 4); - - test_export_runpath_file(test_context_iterations, job_name, job_file_export_runpath, args, iens_values, iter_values); - - int_vector_free(iens_values); - int_vector_free(iter_values); - - stringlist_clear(args); - } - - ert_test_context_free(test_context_iterations); - ert_test_context_type * test_context = create_context( config_file, "enkf_workflow_job_test_export_runpath" ); - - { - int_vector_type * iens_values = int_vector_alloc(1,0); - int_vector_init_range(iens_values, 0, 25, 1); - int_vector_type * iter_values = int_vector_alloc(1,0); - - test_export_runpath_file(test_context, job_name, job_file_export_runpath, args, iens_values, iter_values); - - int_vector_free(iens_values); - int_vector_free(iter_values); - - stringlist_clear(args); - } - { - stringlist_append_copy( args, "1-3"); //realization range - - int_vector_type * iens_values = int_vector_alloc(3,0); - int iens[] = {1,2,3}; - int_vector_set_many(iens_values, 0, &iens[0], 3); - int_vector_type * iter_values = int_vector_alloc(1,0); - - test_export_runpath_file(test_context, job_name, job_file_export_runpath, args, iens_values, iter_values); - - int_vector_free(iens_values); - int_vector_free(iter_values); - - stringlist_clear(args); - } - { - stringlist_append_copy( args, "1,2"); //realization range - stringlist_append_copy( args, "|"); //delimiter - stringlist_append_copy( args, "1-3"); //iteration range - - int_vector_type * iens_values = int_vector_alloc(2,0); - int iens[] = {1,2}; - int_vector_set_many(iens_values, 0, &iens[0], 2); - int_vector_type * iter_values = int_vector_alloc(1,0); - - test_export_runpath_file(test_context, job_name, job_file_export_runpath, args, iens_values, iter_values); - - int_vector_free(iens_values); - int_vector_free(iter_values); - - stringlist_clear(args); - } - - - ert_test_context_free(test_context); - - - stringlist_free( args ); -} - - - - - -int main(int argc , const char ** argv) { - enkf_main_install_SIGNALS(); - - const char * config_file = argv[1]; - const char * config_file_iterations = argv[2]; - const char * job_file_create_case = argv[3]; - const char * job_file_init_case_job = argv[4]; - const char * job_file_load_results = argv[5]; - const char * job_file_load_results_iter = argv[6]; - const char * job_file_observation_ranking = argv[7]; - const char * job_file_data_ranking = argv[8]; - const char * job_file_ranking_export = argv[9]; - const char * job_file_init_misfit_table = argv[10]; - const char * job_file_export_runpath = argv[11]; - - - ert_test_context_type * test_context = create_context( config_file, "enkf_workflow_job_test" ); - { - test_create_case_job(test_context, "JOB1" , job_file_create_case); - test_init_case_job(test_context, "JOB2", job_file_init_case_job); - test_load_results_job(test_context, "JOB3" , job_file_load_results); - test_load_results_iter_job( test_context, "JOB4" , job_file_load_results_iter ); - test_init_misfit_table(test_context, "JOB5" , job_file_init_misfit_table); - test_rank_realizations_on_observations_job(test_context, "JOB6" , job_file_observation_ranking); - test_rank_realizations_on_data_job(test_context , "JOB7" , job_file_data_ranking); - test_export_ranking(test_context, "JOB8" , job_file_ranking_export); - } - ert_test_context_free( test_context ); - - test_export_runpath_files(config_file, config_file_iterations, job_file_export_runpath); - - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/tests/enkf_workflow_job_test_version.c b/ThirdParty/Ert/libenkf/tests/enkf_workflow_job_test_version.c deleted file mode 100644 index d60e2c799c..0000000000 --- a/ThirdParty/Ert/libenkf/tests/enkf_workflow_job_test_version.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - Copyright (C) 2016 Statoil ASA, Norway. - - The file 'enkf_workflow_job_test_version.c' is part of ERT - - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -/* - These version functions are overrideed here to get a consistent - version mapping. -*/ - -int version_get_major_ert_version( ) { - return 1; -} - - -int version_get_minor_ert_version( ) { - return 2; -} - - -const char* version_get_micro_ert_version( ) { - return "3"; -} - - -void test_version() { - test_assert_int_equal( version_get_major_ert_version( ) , 1 ); - test_assert_int_equal( version_get_minor_ert_version( ) , 2 ); - test_assert_string_equal( version_get_micro_ert_version( ) , "3" ); -} - - -int main(int argc , const char ** argv) { - enkf_main_install_SIGNALS(); - test_version( ); - { - const char * path = argv[1]; - ert_workflow_list_type * workflows = ert_workflow_list_alloc( NULL ); - ert_workflow_list_add_jobs_in_directory( workflows , path ); - - // The CONF1 only exists as default - unversioned - test_assert_true( ert_workflow_list_has_job( workflows , "CONF1")); - - // The CONF2 exists as the default - which is invalid and will not load, - // and CONF2@1 - which should load. - test_assert_false( ert_workflow_list_has_job( workflows , "CONF2@1")); - test_assert_true( ert_workflow_list_has_job( workflows , "CONF2")); - - // The CONF3 only exists as a fully versioned CONF3@1.2.3 - which should load. - test_assert_true( ert_workflow_list_has_job( workflows , "CONF3")); - - // The CONF4 only exists as a fully versioned CONF4@1.2.0 - which should not load. - test_assert_false( ert_workflow_list_has_job( workflows , "CONF4")); - - // The CONF5 exists as a fully versioned CONF5@1.2.0 - which should not load and - // CONF@1.2 which should load. - test_assert_true( ert_workflow_list_has_job( workflows , "CONF5")); - - ert_workflow_list_free( workflows ); - } - exit(0); -} diff --git a/ThirdParty/Ert/libenkf/tests/gen_kw_logarithmic_test.c b/ThirdParty/Ert/libenkf/tests/gen_kw_logarithmic_test.c deleted file mode 100644 index 2747b91a2c..0000000000 --- a/ThirdParty/Ert/libenkf/tests/gen_kw_logarithmic_test.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'gen_kw_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - - - -void test_write_gen_kw_export_file(enkf_main_type * enkf_main) -{ - enkf_state_type * state = enkf_main_iget_state( enkf_main , 0 ); - test_assert_not_NULL(state); - enkf_node_type * enkf_node = enkf_state_get_node( state , "MULTFLT" ); - enkf_node_type * enkf_node2 = enkf_state_get_node( state , "MULTFLT2" ); - test_assert_not_NULL(enkf_node); - test_assert_not_NULL(enkf_node2); - test_assert_true(enkf_node_get_impl_type(enkf_node) == GEN_KW); - test_assert_true(enkf_node_get_impl_type(enkf_node2) == GEN_KW); - - gen_kw_type * gen_kw = enkf_node_value_ptr(enkf_node); - gen_kw_type * gen_kw2 = enkf_node_value_ptr(enkf_node2); - - - { - rng_type * rng = rng_alloc( MZRAN , INIT_DEFAULT ); - const enkf_config_node_type * config = enkf_node_get_config(enkf_node); - const int data_size = enkf_config_node_get_data_size( config, 0 ); - const double mean = 0.0; /* Mean and std are hardcoded - the variability should be in the transformation. */ - const double std = 1.0; - - for (int i=0; i < data_size; ++i) { - double random_number = enkf_util_rand_normal(mean , std , rng); - gen_kw_data_iset(gen_kw, i, random_number); - gen_kw_data_iset(gen_kw2, i, random_number); - } - - rng_free(rng); - } - - - { - enkf_fs_type * init_fs = enkf_main_get_fs( enkf_main ); - run_arg_type * run_arg = run_arg_alloc_INIT_ONLY( init_fs , 0 ,0 , "simulations/run0"); - enkf_state_ecl_write(state, run_arg , init_fs); - test_assert_true(util_file_exists("simulations/run0/parameters.txt")); - run_arg_free( run_arg ); - } - - - { - int buffer_size = 0; - char * file_content = util_fread_alloc_file_content("simulations/run0/parameters.txt", &buffer_size); - - stringlist_type * token_list = stringlist_alloc_from_split(file_content, " \n"); - double value = stringlist_iget_as_double(token_list, 5, NULL); - - test_assert_true(value > 0.0); //Verify precision - test_assert_true(NULL != strstr(file_content, "LOG10_")); //Verify log entry - - stringlist_free(token_list); - free(file_content); - } -} - - - -int main(int argc , char ** argv) { - const char * config_file = argv[1]; - ert_test_context_type * test_context = ert_test_context_alloc("gen_kw_logarithmic_test" , config_file ); - enkf_main_type * enkf_main = ert_test_context_get_main(test_context); - - test_assert_not_NULL(enkf_main); - - test_write_gen_kw_export_file(enkf_main); - - ert_test_context_free( test_context ); - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/gen_kw_test.c b/ThirdParty/Ert/libenkf/tests/gen_kw_test.c deleted file mode 100644 index fdf5e677bd..0000000000 --- a/ThirdParty/Ert/libenkf/tests/gen_kw_test.c +++ /dev/null @@ -1,134 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'gen_kw_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include "ert/util/build_config.h" - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - - - -void test_send_fortio_to_gen_kw_ecl_write(void * arg) { - enkf_main_type * enkf_main = arg; - test_assert_not_NULL(enkf_main); - fortio_type * fortio = fortio_open_writer("my_new_file", false, ECL_ENDIAN_FLIP); - test_assert_not_NULL(fortio); - - enkf_state_type * state = enkf_main_iget_state( enkf_main , 0 ); - test_assert_not_NULL(state); - enkf_node_type * enkf_node = enkf_state_get_node( state , "MULTFLT" ); - test_assert_not_NULL(enkf_node); - const enkf_config_node_type * config_node = enkf_node_get_config(enkf_node); - test_assert_not_NULL(config_node); - - if (GEN_KW == enkf_config_node_get_impl_type(config_node)) { - const char * dummy_path = "dummy_path"; - enkf_node_ecl_write(enkf_node, dummy_path, fortio, 0); - } -} - - -void test_write_gen_kw_export_file(enkf_main_type * enkf_main) -{ - test_assert_not_NULL(enkf_main); - enkf_fs_type * init_fs = enkf_main_get_fs( enkf_main ); - enkf_state_type * state = enkf_main_iget_state( enkf_main , 0 ); - run_arg_type * run_arg = run_arg_alloc_INIT_ONLY( init_fs , 0 ,0 , "simulations/run0"); - test_assert_not_NULL(state); - enkf_node_type * enkf_node = enkf_state_get_node( state , "MULTFLT" ); - - test_assert_not_NULL(enkf_node); - const enkf_config_node_type * config_node = enkf_node_get_config(enkf_node); - test_assert_not_NULL(config_node); - - if (GEN_KW == enkf_config_node_get_impl_type(config_node)) { - enkf_state_ecl_write(state, run_arg , init_fs); - test_assert_true(util_file_exists("simulations/run0/parameters.txt")); - } - run_arg_free( run_arg ); -} - - - -static void read_erroneous_gen_kw_file( void * arg) { - vector_type * arg_vector = vector_safe_cast( arg ); - gen_kw_config_type * gen_kw_config = vector_iget( arg_vector, 0 ); - const char * filename = vector_iget( arg, 1 ); - gen_kw_config_set_parameter_file(gen_kw_config, filename); -} - - -void test_read_erroneous_gen_kw_file() { - const char * parameter_filename = "MULTFLT_with_errors.txt"; - const char * tmpl_filename = "MULTFLT.tmpl"; - - { - FILE * stream = util_fopen(parameter_filename, "w"); - const char * data = util_alloc_sprintf("MULTFLT1 NORMAL 0\nMULTFLT2 RAW\nMULTFLT3 NORMAL 0"); - util_fprintf_string(data, 30, true, stream); - util_fclose(stream); - - FILE * tmpl_stream = util_fopen(tmpl_filename, "w"); - const char * tmpl_data = util_alloc_sprintf(" \n"); - util_fprintf_string(tmpl_data, 30, true, tmpl_stream); - util_fclose(tmpl_stream); - } - - gen_kw_config_type * gen_kw_config = gen_kw_config_alloc_empty("MULTFLT", "<%s>"); - vector_type * arg = vector_alloc_new(); - vector_append_ref( arg , gen_kw_config ); - vector_append_ref(arg, parameter_filename); - - test_assert_util_abort("arg_pack_fscanf", read_erroneous_gen_kw_file, arg); - - vector_free(arg); - gen_kw_config_free(gen_kw_config); -} - - -int main(int argc , char ** argv) { - const char * config_file = argv[1]; - ert_test_context_type * test_context = ert_test_context_alloc("gen_kw_test" , config_file ); - enkf_main_type * enkf_main = ert_test_context_get_main(test_context); - test_assert_not_NULL(enkf_main); - - test_write_gen_kw_export_file(enkf_main); - test_assert_util_abort("gen_kw_ecl_write", test_send_fortio_to_gen_kw_ecl_write, enkf_main); - test_read_erroneous_gen_kw_file(); - - ert_test_context_free( test_context ); - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/obs_vector_tests.c b/ThirdParty/Ert/libenkf/tests/obs_vector_tests.c deleted file mode 100644 index 33485d7c0d..0000000000 --- a/ThirdParty/Ert/libenkf/tests/obs_vector_tests.c +++ /dev/null @@ -1,244 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'enkf_obs_vector_tests.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. - */ - -#include -#include -#include -#include - -#include "ert/enkf/gen_obs.h" - -bool alloc_strippedparameters_noerrors() { - obs_vector_type * obs_vector = obs_vector_alloc(SUMMARY_OBS, "WHAT", NULL, 0); - obs_vector_free(obs_vector); - return true; -} - -/*******Summary obs tests*******************/ -bool scale_std_summary_nodata_no_errors() { - obs_vector_type * obs_vector = obs_vector_alloc(SUMMARY_OBS, "WHAT", NULL, 0); - local_obsdata_node_type * local_node = obs_vector_alloc_local_node( obs_vector ); - obs_vector_scale_std(obs_vector, local_node , 2.0); - obs_vector_free(obs_vector); - local_obsdata_node_free( local_node ); - return true; -} - -bool scale_std_summarysingleobservation_no_errors() { - obs_vector_type * obs_vector = obs_vector_alloc(SUMMARY_OBS, "WHAT", NULL, 1); - summary_obs_type * summary_obs = summary_obs_alloc("SummaryKey", "ObservationKey", 43.2, 2.0, AUTO_CORRF_EXP, 42); - obs_vector_install_node(obs_vector, 0, summary_obs); - test_assert_double_equal(2.0, summary_obs_get_std(summary_obs)); - test_assert_double_equal(1.0, summary_obs_get_std_scaling(summary_obs)); - - { - local_obsdata_node_type * local_node = obs_vector_alloc_local_node( obs_vector ); - obs_vector_scale_std(obs_vector, local_node , 2.0); - local_obsdata_node_free( local_node ); - } - test_assert_double_equal(2.0, summary_obs_get_std_scaling(summary_obs)); - - obs_vector_free(obs_vector); - return true; -} - -bool scale_std_summarymanyobservations_no_errors() { - int num_observations = 100; - double scaling_factor = 1.456; - - obs_vector_type * obs_vector = obs_vector_alloc(SUMMARY_OBS, "WHAT", NULL, num_observations); - - test_assert_bool_equal(0, obs_vector_get_num_active(obs_vector)); - - summary_obs_type * observations[num_observations]; - for (int i = 0; i < num_observations; i++) { - summary_obs_type * summary_obs = summary_obs_alloc("SummaryKey", "ObservationKey", 43.2, i, AUTO_CORRF_EXP, 42); - obs_vector_install_node(obs_vector, i, summary_obs); - observations[i] = summary_obs; - } - - for (int i = 0; i < num_observations; i++) { - summary_obs_type * before_scale = observations[i]; - test_assert_double_equal(i, summary_obs_get_std(before_scale)); - } - - test_assert_bool_equal(num_observations, obs_vector_get_num_active(obs_vector)); - { - local_obsdata_node_type * local_node = obs_vector_alloc_local_node( obs_vector ); - obs_vector_scale_std(obs_vector, local_node , scaling_factor); - local_obsdata_node_free( local_node ); - } - for (int i = 0; i < num_observations; i++) { - summary_obs_type * after_scale = observations[i]; - test_assert_double_equal(scaling_factor, summary_obs_get_std_scaling(after_scale)); - } - - obs_vector_free(obs_vector); - return true; -} - -/************ Block obs tests *****************************************************/ - -bool scale_std_block_nodata_no_errors() { - obs_vector_type * obs_vector = obs_vector_alloc(BLOCK_OBS, "WHAT", NULL, 0); - local_obsdata_node_type * local_node = obs_vector_alloc_local_node( obs_vector ); - obs_vector_scale_std(obs_vector, local_node , 2.0); - local_obsdata_node_free( local_node ); - obs_vector_free(obs_vector); - return true; -} - -block_obs_type * create_block_obs(ecl_grid_type * grid, int size, double value, double std_dev) { - field_config_type * field_config = field_config_alloc_empty( "PRESSURE" , grid , NULL, false ); - int * i = util_calloc(size, sizeof * i); - int * j = util_calloc(size, sizeof * j); - int * k = util_calloc(size, sizeof * k); - double * obs_value = util_calloc(size, sizeof * obs_value); - double * obs_std = util_calloc(size, sizeof * obs_std); - - for (int num = 0; num < size; num++) { - obs_value[num] = value; - obs_std[num] = std_dev; - i[num] = num; - j[num] = num; - k[num] = num; - } - - block_obs_type * block_obs = block_obs_alloc_complete("Label", SOURCE_FIELD, NULL, field_config , grid, size, i, j, k, obs_value, obs_std); - - free(i); - free(j); - free(k); - free(obs_value); - free(obs_std); - field_config_free( field_config ); - - return block_obs; -} - -bool scale_std_block100observations_no_errors() { - int num_observations = 100; - int num_points = 10; - - obs_vector_type * obs_vector = obs_vector_alloc(BLOCK_OBS, "WHAT", NULL, num_observations); - ecl_grid_type * grid = ecl_grid_alloc_rectangular(num_points, num_points, num_points, 1.0, 1.0, 1.0, NULL); - - double scale_factor = 3.3; - double obs_value = 44; - double obs_std = 3.2; - - block_obs_type * observations[num_observations]; - - for (int i = 0; i < num_observations; i++) { - block_obs_type * block_obs = create_block_obs(grid, num_points, obs_value, obs_std); - obs_vector_install_node(obs_vector, i, block_obs); - observations[i] = block_obs; - } - - for (int i = 0; i < num_observations; i++) { - for (int point_nr = 0; point_nr < num_points; point_nr++) { - double value, std; - block_obs_iget(observations[i], point_nr, &value, &std); - test_assert_double_equal(obs_value, value); - test_assert_double_equal(obs_std, std); - } - } - - { - local_obsdata_node_type * local_node = obs_vector_alloc_local_node( obs_vector ); - obs_vector_scale_std(obs_vector, local_node , scale_factor); - local_obsdata_node_free( local_node ); - } - - for (int i = 0; i < num_observations; i++) { - for (int point_nr = 0; point_nr < num_points; point_nr++) { - double value, std; - block_obs_iget(observations[i], point_nr, &value, &std); - test_assert_double_equal(obs_value, value); - test_assert_double_equal(obs_std , std); - test_assert_double_equal(scale_factor , block_obs_iget_std_scaling( observations[i] , point_nr)); - } - } - - ecl_grid_free(grid); - obs_vector_free(obs_vector); - return true; -} - -/*************Gen obs tests************************************************/ - -bool scale_std_gen_nodata_no_errors() { - obs_vector_type * obs_vector = obs_vector_alloc(GEN_OBS, "WHAT", NULL, 0); - local_obsdata_node_type * local_node = obs_vector_alloc_local_node( obs_vector ); - obs_vector_scale_std(obs_vector, local_node , 2.0); - obs_vector_free(obs_vector); - local_obsdata_node_free( local_node ); - return true; -} - -bool scale_std_gen_withdata_no_errors() { - int num_observations = 100; - double value = 42; - double std_dev = 2.2; - double multiplier = 3.4; - - obs_vector_type * obs_vector = obs_vector_alloc(GEN_OBS, "WHAT", NULL, num_observations); - - gen_obs_type * observations[num_observations]; - for (int i = 0; i < num_observations; i++) { - gen_obs_type * gen_obs = gen_obs_alloc(NULL, "WWCT-GEN", NULL, value, std_dev, NULL, NULL, NULL); - obs_vector_install_node(obs_vector, i, gen_obs); - observations[i] = gen_obs; - } - - { - local_obsdata_node_type * local_node = obs_vector_alloc_local_node( obs_vector ); - obs_vector_scale_std(obs_vector, local_node , multiplier); - local_obsdata_node_free( local_node ); - } - - for (int i = 0; i < num_observations; i++) { - char * index_key = util_alloc_sprintf("%d", 0); - double value_new, std_new; - bool valid; - gen_obs_user_get_with_data_index(observations[i], index_key, &value_new, &std_new, &valid); - test_assert_double_equal(std_dev , std_new); - test_assert_double_equal(value, value_new); - test_assert_double_equal(multiplier , gen_obs_iget_std_scaling( observations[i] , 0 )); - free(index_key); - } - - obs_vector_free(obs_vector); - return true; -} - -int main(int argc, char ** argv) { - test_assert_bool_equal(alloc_strippedparameters_noerrors(), true); - test_assert_bool_equal(scale_std_summary_nodata_no_errors(), true); - test_assert_bool_equal(scale_std_summarysingleobservation_no_errors(), true); - test_assert_bool_equal(scale_std_summarymanyobservations_no_errors(), true); - - test_assert_bool_equal(scale_std_block_nodata_no_errors(), true); - test_assert_bool_equal(scale_std_block100observations_no_errors(), true); - - test_assert_bool_equal(scale_std_gen_nodata_no_errors(), true); - test_assert_bool_equal(scale_std_gen_withdata_no_errors(), true); - - exit(0); -} - diff --git a/ThirdParty/Ert/libenkf/tests/statoil_tests.cmake b/ThirdParty/Ert/libenkf/tests/statoil_tests.cmake deleted file mode 100644 index de6baa0cf4..0000000000 --- a/ThirdParty/Ert/libenkf/tests/statoil_tests.cmake +++ /dev/null @@ -1,220 +0,0 @@ -add_executable( enkf_site_config enkf_site_config.c ) -target_link_libraries( enkf_site_config enkf test_util ) -add_test( enkf_site_config ${EXECUTABLE_OUTPUT_PATH}/enkf_site_config /project/res/etc/ERT/site-config) - -add_executable( enkf_gen_data_config enkf_gen_data_config.c ) -target_link_libraries( enkf_gen_data_config enkf test_util ) -add_test( enkf_gen_data_config ${EXECUTABLE_OUTPUT_PATH}/enkf_gen_data_config - ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/gendata_test/RFT_E-3H_21 - ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/gendata_test/RFT_E-3H_21_empty) - -add_executable( enkf_block_obs enkf_block_obs.c ) -target_link_libraries( enkf_block_obs enkf test_util ) -add_test( enkf_block_obs ${EXECUTABLE_OUTPUT_PATH}/enkf_block_obs ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE.EGRID) - -add_executable( enkf_obs_fs enkf_obs_fs.c ) -target_link_libraries( enkf_obs_fs enkf test_util ) -add_test( enkf_obs_fs ${EXECUTABLE_OUTPUT_PATH}/enkf_obs_fs ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/obs_testing/config ) - -add_executable( enkf_magic_string_in_workflows enkf_magic_string_in_workflows.c ) -target_link_libraries( enkf_magic_string_in_workflows enkf test_util ) -add_test( enkf_magic_string_in_workflows ${EXECUTABLE_OUTPUT_PATH}/enkf_magic_string_in_workflows ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/with_data/config ) - -add_executable( enkf_obs_vector_fs enkf_obs_vector_fs.c ) -target_link_libraries( enkf_obs_vector_fs enkf test_util ) -add_test( enkf_obs_vector_fs ${EXECUTABLE_OUTPUT_PATH}/enkf_obs_vector_fs ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/obs_testing/config ) - -add_executable( enkf_plot_data_fs enkf_plot_data_fs.c ) -target_link_libraries( enkf_plot_data_fs enkf test_util ) -add_test( enkf_plot_data_fs ${EXECUTABLE_OUTPUT_PATH}/enkf_plot_data_fs ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/plotData/config ) - -add_executable( enkf_time_map enkf_time_map.c ) -target_link_libraries( enkf_time_map enkf test_util ) -add_test( enkf_time_map1 ${EXECUTABLE_OUTPUT_PATH}/enkf_time_map ) -add_test( enkf_time_map2 ${EXECUTABLE_OUTPUT_PATH}/enkf_time_map ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE - ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/ModifiedSummary/EXTRA_TSTEP - ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/ModifiedSummary/SHORT - ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/ModifiedSummary/MISSING_TSTEP ) - -add_executable( enkf_main_fs enkf_main_fs.c ) -target_link_libraries( enkf_main_fs enkf test_util ) -add_test( enkf_main_fs ${EXECUTABLE_OUTPUT_PATH}/enkf_main_fs ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/plotData/config ) - -add_executable( enkf_main_fs_current_file_test enkf_main_fs_current_file_test.c ) -target_link_libraries( enkf_main_fs_current_file_test enkf test_util ) -add_test( enkf_main_fs_current_file_test ${EXECUTABLE_OUTPUT_PATH}/enkf_main_fs_current_file_test ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/plotData/config ) - -add_executable( enkf_scale_correlated_std enkf_scale_correlated_std.c ) -target_link_libraries( enkf_scale_correlated_std enkf test_util ) -add_test( enkf_scale_correlated_std ${EXECUTABLE_OUTPUT_PATH}/enkf_scale_correlated_std - ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/with_data/config - ${PROJECT_SOURCE_DIR}/share/workflows/jobs/internal/config/STD_SCALE_CORRELATED_OBS ) - -add_executable( enkf_plot_gendata_fs enkf_plot_gendata_fs.c ) -target_link_libraries( enkf_plot_gendata_fs enkf test_util ) -add_test( enkf_plot_gendata_fs ${EXECUTABLE_OUTPUT_PATH}/enkf_plot_gendata_fs - ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/with_GEN_DATA/config ) - -add_test( enkf_state_report_step_compatible_TRUE - ${EXECUTABLE_OUTPUT_PATH}/enkf_state_report_step_compatible ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/ecl_sum_compatible_true config_ecl_sum_compatible_true TRUE) - -add_test( enkf_state_report_step_compatible_FALSE - ${EXECUTABLE_OUTPUT_PATH}/enkf_state_report_step_compatible ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/ecl_sum_compatible_false config_ecl_sum_compatible_false FALSE) - - -#----------------------------------------------------------------- - -add_executable( enkf_state_manual_load_test enkf_state_manual_load_test.c ) -target_link_libraries( enkf_state_manual_load_test enkf test_util ) -add_test( enkf_state_manual_load_test ${EXECUTABLE_OUTPUT_PATH}/enkf_state_manual_load_test ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/ecl_sum_compatible_true config_ecl_sum_compatible_true) - -#----------------------------------------------------------------- - - -add_executable( enkf_state_skip_summary_load_test enkf_state_skip_summary_load_test.c ) -target_link_libraries( enkf_state_skip_summary_load_test enkf test_util ) - -add_test( enkf_state_summary_vars_present - ${EXECUTABLE_OUTPUT_PATH}/enkf_state_skip_summary_load_test ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/ecl_summary_vars_config config_summary_vars) - -add_test( enkf_state_no_summary_vars_present - ${EXECUTABLE_OUTPUT_PATH}/enkf_state_skip_summary_load_test ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/ecl_no_summary_vars_config config_no_summary_vars) - - -#----------------------------------------------------------------- - - -add_executable( enkf_export_field_test enkf_export_field_test.c ) -target_link_libraries( enkf_export_field_test enkf test_util ) - -add_test( enkf_export_field_test - ${EXECUTABLE_OUTPUT_PATH}/enkf_export_field_test ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/export_fields/config - ${PROJECT_SOURCE_DIR}/share/workflows/jobs/internal/config/EXPORT_FIELD - ${PROJECT_SOURCE_DIR}/share/workflows/jobs/internal/config/EXPORT_FIELD_ECL_GRDECL - ${PROJECT_SOURCE_DIR}/share/workflows/jobs/internal/config/EXPORT_FIELD_RMS_ROFF) - - - -add_executable( enkf_workflow_job_test enkf_workflow_job_test.c ) -target_link_libraries( enkf_workflow_job_test enkf test_util ) - -add_test( enkf_workflow_job_test - ${EXECUTABLE_OUTPUT_PATH}/enkf_workflow_job_test ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/with_data/config - ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/enkf_state_runpath/config_runpath_multiple_iterations - ${PROJECT_SOURCE_DIR}/share/workflows/jobs/internal-tui/config/CREATE_CASE - ${PROJECT_SOURCE_DIR}/share/workflows/jobs/internal-tui/config/INIT_CASE_FROM_EXISTING - ${PROJECT_SOURCE_DIR}/share/workflows/jobs/internal/config/LOAD_RESULTS - ${PROJECT_SOURCE_DIR}/share/workflows/jobs/internal/config/LOAD_RESULTS_ITER - ${PROJECT_SOURCE_DIR}/share/workflows/jobs/internal/config/OBSERVATION_RANKING - ${PROJECT_SOURCE_DIR}/share/workflows/jobs/internal/config/DATA_RANKING - ${PROJECT_SOURCE_DIR}/share/workflows/jobs/internal/config/EXPORT_RANKING - ${PROJECT_SOURCE_DIR}/share/workflows/jobs/internal/config/INIT_MISFIT_TABLE - ${PROJECT_SOURCE_DIR}/share/workflows/jobs/internal/config/EXPORT_RUNPATH) - -#----------------------------------------------------------------- - -add_executable( enkf_forward_init_SURFACE enkf_forward_init_SURFACE.c ) -target_link_libraries( enkf_forward_init_SURFACE enkf test_util ) - -add_test( enkf_forward_init_SURFACE_TRUE - ${EXECUTABLE_OUTPUT_PATH}/enkf_forward_init_SURFACE - ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/forward_init/surface config_surface_true - ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/forward_init/surface/Surface.irap - TRUE) - -add_test( enkf_forward_init_SURFACE_FALSE - ${EXECUTABLE_OUTPUT_PATH}/enkf_forward_init_SURFACE - ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/forward_init/surface config_surface_false - ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/forward_init/surface/Surface.irap - FALSE) - -#----------------------------------------------------------------- - -add_executable( enkf_forward_init_FIELD enkf_forward_init_FIELD.c ) -target_link_libraries( enkf_forward_init_FIELD enkf test_util ) - -add_test( enkf_forward_init_FIELD_TRUE - ${EXECUTABLE_OUTPUT_PATH}/enkf_forward_init_FIELD - ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/forward_init/field config_field_true - ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/forward_init/field/petro.grdecl - TRUE) - -add_test( enkf_forward_init_FIELD_FALSE - ${EXECUTABLE_OUTPUT_PATH}/enkf_forward_init_FIELD - ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/forward_init/field config_field_false - ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/forward_init/field/petro.grdecl - FALSE) - -#----------------------------------------------------------------- - -add_executable( enkf_forward_init_transform enkf_forward_init_transform.c ) -target_link_libraries( enkf_forward_init_transform enkf test_util ) - -add_test( enkf_forward_init_transform_TRUE - ${EXECUTABLE_OUTPUT_PATH}/enkf_forward_init_transform - ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/transform transform_forward_init_true - ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/transform/petro.grdecl - TRUE) - -add_test( enkf_forward_init_transform_FALSE - ${EXECUTABLE_OUTPUT_PATH}/enkf_forward_init_transform - ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/transform transform_forward_init_false - ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/transform/petro.grdecl - FALSE) - -#----------------------------------------------------------------- - -add_executable( enkf_export_inactive_cells enkf_export_inactive_cells.c ) -target_link_libraries( enkf_export_inactive_cells enkf test_util ) - -add_test( enkf_export_inactive_cells - ${EXECUTABLE_OUTPUT_PATH}/enkf_export_inactive_cells - ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/export_inactive_cells/config - ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/export_inactive_cells/petro.grdecl) - -#----------------------------------------------------------------- - -add_executable( enkf_refcase_list enkf_refcase_list.c ) -target_link_libraries( enkf_refcase_list enkf test_util ) -add_test( enkf_refcase_list ${EXECUTABLE_OUTPUT_PATH}/enkf_refcase_list ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat*/ECLIPSE) -add_test( enkf_refcase_list2 ${EXECUTABLE_OUTPUT_PATH}/enkf_refcase_list ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat*/ECLIPSE.*) -set_property( TEST enkf_refcase_list PROPERTY LABELS StatoilData ) -set_property( TEST enkf_refcase_list2 PROPERTY LABELS StatoilData ) - -add_executable( enkf_ecl_config enkf_ecl_config.c ) -target_link_libraries( enkf_ecl_config enkf test_util ) -add_test( enkf_ecl_config1 ${EXECUTABLE_OUTPUT_PATH}/enkf_ecl_config ) -add_test( enkf_ecl_config2 ${EXECUTABLE_OUTPUT_PATH}/enkf_ecl_config ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE) -set_property( TEST enkf_ecl_config2 PROPERTY LABELS StatoilData ) - -add_executable( enkf_ecl_config_config enkf_ecl_config_config.c ) -target_link_libraries( enkf_ecl_config_config enkf test_util ) -add_test( enkf_ecl_config_config ${EXECUTABLE_OUTPUT_PATH}/enkf_ecl_config_config ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/ecl_config ) -set_property( TEST enkf_ecl_config_config PROPERTY LABELS StatoilData ) - -set_property( TEST enkf_plot_data_fs PROPERTY LABELS StatoilData ) -set_property( TEST enkf_time_map2 PROPERTY LABELS StatoilData ) -set_property( TEST enkf_site_config PROPERTY LABELS StatoilData ) -set_property( TEST enkf_state_report_step_compatible_TRUE PROPERTY LABELS StatoilData ) -set_property( TEST enkf_state_report_step_compatible_FALSE PROPERTY LABELS StatoilData ) -set_property( TEST enkf_forward_init_SURFACE_FALSE PROPERTY LABELS StatoilData ) -set_property( TEST enkf_forward_init_SURFACE_TRUE PROPERTY LABELS StatoilData ) -set_property( TEST enkf_forward_init_FIELD_FALSE PROPERTY LABELS StatoilData ) -set_property( TEST enkf_forward_init_FIELD_TRUE PROPERTY LABELS StatoilData ) -set_property( TEST enkf_forward_init_transform_TRUE PROPERTY LABELS StatoilData ) -set_property( TEST enkf_forward_init_transform_FALSE PROPERTY LABELS StatoilData ) -set_property( TEST enkf_main_fs PROPERTY LABELS StatoilData ) -set_property( TEST enkf_state_summary_vars_present PROPERTY LABELS StatoilData ) -set_property( TEST enkf_state_no_summary_vars_present PROPERTY LABELS StatoilData ) -set_property( TEST enkf_export_field_test PROPERTY LABELS StatoilData ) -set_property( TEST enkf_workflow_job_test PROPERTY LABELS StatoilData ) -set_property( TEST enkf_main_fs_current_file_test PROPERTY LABELS StatoilData ) -set_property( TEST enkf_state_manual_load_test PROPERTY LABELS StatoilData ) -set_property( TEST enkf_block_obs PROPERTY LABELS StatoilData ) -set_property( TEST enkf_plot_gendata_fs PROPERTY LABELS StatoilData ) -set_property( TEST enkf_export_inactive_cells PROPERTY LABELS StatoilData ) -set_property( TEST enkf_obs_fs PROPERTY LABELS StatoilData ) -set_property( TEST enkf_obs_vector_fs PROPERTY LABELS StatoilData ) -set_property( TEST enkf_magic_string_in_workflows PROPERTY LABELS StatoilData ) -set_property( TEST enkf_gen_data_config PROPERTY LABELS StatoilData ) -set_property( TEST enkf_scale_correlated_std PROPERTY LABELS StatoilData ) \ No newline at end of file diff --git a/ThirdParty/Ert/libenkf/tests/tests.cmake b/ThirdParty/Ert/libenkf/tests/tests.cmake deleted file mode 100644 index 422545a549..0000000000 --- a/ThirdParty/Ert/libenkf/tests/tests.cmake +++ /dev/null @@ -1,254 +0,0 @@ -add_executable( enkf_runpath_list enkf_runpath_list.c ) -target_link_libraries( enkf_runpath_list enkf test_util ) -add_test( enkf_runpath_list ${EXECUTABLE_OUTPUT_PATH}/enkf_runpath_list ${CMAKE_CURRENT_SOURCE_DIR}/data/config/runpath_list/config ) - -add_executable( enkf_plot_tvector enkf_plot_tvector.c ) -target_link_libraries( enkf_plot_tvector enkf test_util ) -add_test( enkf_plot_tvector ${EXECUTABLE_OUTPUT_PATH}/enkf_plot_tvector) - -add_executable( enkf_plot_data enkf_plot_data.c ) -target_link_libraries( enkf_plot_data enkf test_util ) -add_test( enkf_plot_data ${EXECUTABLE_OUTPUT_PATH}/enkf_plot_data) - -add_executable( enkf_ert_run_context enkf_ert_run_context.c ) -target_link_libraries( enkf_ert_run_context enkf test_util ) -add_test( enkf_ert_run_context ${EXECUTABLE_OUTPUT_PATH}/enkf_ert_run_context) - -add_executable( enkf_run_arg enkf_run_arg.c ) -target_link_libraries( enkf_run_arg enkf test_util ) -add_test( enkf_run_arg ${EXECUTABLE_OUTPUT_PATH}/enkf_run_arg) - -add_executable( enkf_gen_obs_load enkf_gen_obs_load.c ) -target_link_libraries( enkf_gen_obs_load enkf test_util ) -add_test( enkf_gen_obs_load ${EXECUTABLE_OUTPUT_PATH}/enkf_gen_obs_load ${PROJECT_SOURCE_DIR}/test-data/local/config/gen_data/config ) - -add_executable( enkf_gen_data_config_parse enkf_gen_data_config_parse.c ) -target_link_libraries( enkf_gen_data_config_parse enkf test_util ) -add_test( enkf_gen_data_config_parse ${EXECUTABLE_OUTPUT_PATH}/enkf_gen_data_config_parse) - -add_executable( enkf_enkf_config_node_gen_data enkf_enkf_config_node_gen_data.c ) -target_link_libraries( enkf_enkf_config_node_gen_data enkf test_util ) -add_test( enkf_enkf_config_node_gen_data ${EXECUTABLE_OUTPUT_PATH}/enkf_enkf_config_node_gen_data) - - -add_executable( enkf_ert_workflow_list enkf_ert_workflow_list.c ) -target_link_libraries( enkf_ert_workflow_list enkf test_util ) -add_test( enkf_ert_workflow_list ${EXECUTABLE_OUTPUT_PATH}/enkf_ert_workflow_list ${PROJECT_SOURCE_DIR}/share/workflows/jobs/internal/config/SCALE_STD) - - -add_executable( enkf_obs_vector enkf_obs_vector.c ) -target_link_libraries( enkf_obs_vector enkf test_util ) -add_test( enkf_obs_vector ${EXECUTABLE_OUTPUT_PATH}/enkf_obs_vector ) - - - - -add_executable( enkf_ensemble_config enkf_ensemble_config.c ) -target_link_libraries( enkf_ensemble_config enkf test_util ) -add_test( enkf_ensemble_config ${EXECUTABLE_OUTPUT_PATH}/enkf_ensemble_config) - -add_executable( enkf_pca_plot enkf_pca_plot.c ) -target_link_libraries( enkf_pca_plot enkf test_util) -add_test( enkf_pca_plot ${EXECUTABLE_OUTPUT_PATH}/enkf_pca_plot) - -add_executable( enkf_cases_config enkf_cases_config.c ) -target_link_libraries( enkf_cases_config enkf test_util ) -add_test( enkf_cases_config ${EXECUTABLE_OUTPUT_PATH}/enkf_cases_config ) - -add_executable( enkf_analysis_config enkf_analysis_config.c ) -target_link_libraries( enkf_analysis_config enkf test_util ) -add_test( enkf_analysis_config ${EXECUTABLE_OUTPUT_PATH}/enkf_analysis_config) - -add_executable( enkf_analysis_config_ext_module enkf_analysis_config_ext_module.c ) -target_link_libraries( enkf_analysis_config_ext_module enkf test_util ) - -ert_module_name( VAR_RML rml_enkf ${LIBRARY_OUTPUT_PATH} ) -add_test( enkf_analysis_config_ext_module ${EXECUTABLE_OUTPUT_PATH}/enkf_analysis_config_ext_module - rml_enkf ${VAR_RML} ) - -add_executable( enkf_analysis_config_analysis_load enkf_analysis_config_analysis_load.c ) -target_link_libraries( enkf_analysis_config_analysis_load enkf test_util) -add_test( enkf_analysis_config_analysis_load ${EXECUTABLE_OUTPUT_PATH}/enkf_analysis_config_analysis_load ${CMAKE_CURRENT_SOURCE_DIR}/data/config/analysis_load_config) -set_property( TEST enkf_analysis_config_analysis_load PROPERTY ENVIRONMENT "ERT_SITE_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/data/config/analysis_load_site_config" ) - -add_executable( enkf_local_obsdata_node enkf_local_obsdata_node.c ) -target_link_libraries( enkf_local_obsdata_node enkf test_util) -add_test( enkf_local_obsdata_node ${EXECUTABLE_OUTPUT_PATH}/enkf_local_obsdata_node ) - -add_executable( enkf_local_obsdata enkf_local_obsdata.c ) -target_link_libraries( enkf_local_obsdata enkf test_util) -add_test( enkf_local_obsdata ${EXECUTABLE_OUTPUT_PATH}/enkf_local_obsdata ) - -add_executable( enkf_active_list enkf_active_list.c ) -target_link_libraries( enkf_active_list enkf test_util) -add_test( enkf_active_list ${EXECUTABLE_OUTPUT_PATH}/enkf_active_list ) - -add_executable( enkf_main enkf_main.c ) -target_link_libraries( enkf_main enkf test_util ) -add_test( enkf_main ${EXECUTABLE_OUTPUT_PATH}/enkf_main ) - -add_executable( enkf_fs enkf_fs.c ) -target_link_libraries( enkf_fs enkf test_util ) -add_test( enkf_fs ${EXECUTABLE_OUTPUT_PATH}/enkf_fs ) - -add_executable( enkf_workflow_job_test_version enkf_workflow_job_test_version.c ) -target_link_libraries( enkf_workflow_job_test_version enkf test_util ) -add_test( enkf_workflow_job_test_version ${EXECUTABLE_OUTPUT_PATH}/enkf_workflow_job_test_version - ${CMAKE_CURRENT_SOURCE_DIR}/data/workflow_jobs ) - - -add_executable( enkf_ert_test_context enkf_ert_test_context.c ) -target_link_libraries( enkf_ert_test_context enkf test_util ) -add_test( enkf_ert_test_context ${EXECUTABLE_OUTPUT_PATH}/enkf_ert_test_context - ${CMAKE_CURRENT_SOURCE_DIR}/data/config/test_context/config - ${CMAKE_CURRENT_SOURCE_DIR}/data/config/test_context/wf_job - ${CMAKE_CURRENT_SOURCE_DIR}/data/config/test_context/wf_job_fail) - - - -add_executable( enkf_plot_gen_kw enkf_plot_gen_kw.c ) -target_link_libraries( enkf_plot_gen_kw enkf test_util ) -add_test( enkf_plot_gen_kw ${EXECUTABLE_OUTPUT_PATH}/enkf_plot_gen_kw ) - -add_executable( enkf_plot_gen_kw_vector enkf_plot_gen_kw_vector.c ) -target_link_libraries( enkf_plot_gen_kw_vector enkf test_util ) -add_test( enkf_plot_gen_kw_vector ${EXECUTABLE_OUTPUT_PATH}/enkf_plot_gen_kw_vector ) - -add_executable( enkf_plot_gen_kw_fs enkf_plot_gen_kw_fs.c ) -target_link_libraries( enkf_plot_gen_kw_fs enkf test_util ) -add_test( enkf_plot_gen_kw_fs ${EXECUTABLE_OUTPUT_PATH}/enkf_plot_gen_kw_fs ${CMAKE_CURRENT_SOURCE_DIR}/data/config/gen_kw_plot/config ) - -add_executable( enkf_plot_genvector enkf_plot_genvector.c ) -target_link_libraries( enkf_plot_genvector enkf test_util ) -add_test( enkf_plot_genvector ${EXECUTABLE_OUTPUT_PATH}/enkf_plot_genvector ) - -add_executable( enkf_plot_gendata enkf_plot_gendata.c ) -target_link_libraries( enkf_plot_gendata enkf test_util ) -add_test( enkf_plot_gendata ${EXECUTABLE_OUTPUT_PATH}/enkf_plot_gendata ) - -add_executable( enkf_config_node enkf_config_node.c ) -target_link_libraries( enkf_config_node enkf test_util ) -add_test( enkf_config_node ${EXECUTABLE_OUTPUT_PATH}/enkf_config_node ) - - -#----------------------------------------------------------------- - -add_executable( gen_kw_test gen_kw_test.c ) -target_link_libraries( gen_kw_test enkf test_util ) - -add_test( gen_kw_test - ${EXECUTABLE_OUTPUT_PATH}/gen_kw_test - ${CMAKE_CURRENT_SOURCE_DIR}/data/config/forward/ert/config_GEN_KW_true) - - -add_executable( gen_kw_logarithmic_test gen_kw_logarithmic_test.c ) -target_link_libraries( gen_kw_logarithmic_test enkf test_util ) - -add_test( gen_kw_logarithmic_test - ${EXECUTABLE_OUTPUT_PATH}/gen_kw_logarithmic_test - ${CMAKE_CURRENT_SOURCE_DIR}/data/config/gen_kw_logarithmic/config_GEN_KW_logarithmic) - - - -#----------------------------------------------------------------- - -add_executable( enkf_forward_init_GEN_KW enkf_forward_init_GEN_KW.c ) -target_link_libraries( enkf_forward_init_GEN_KW enkf test_util ) - -add_test( enkf_forward_init_GEN_KW_TRUE - ${EXECUTABLE_OUTPUT_PATH}/enkf_forward_init_GEN_KW - ${CMAKE_CURRENT_SOURCE_DIR}/data/config/forward/ert config_GEN_KW_true TRUE) - -add_test( enkf_forward_init_GEN_KW_FALSE - ${EXECUTABLE_OUTPUT_PATH}/enkf_forward_init_GEN_KW - ${CMAKE_CURRENT_SOURCE_DIR}/data/config/forward/ert config_GEN_KW_false FALSE) - - -#----------------------------------------------------------------- - -add_executable( enkf_state_report_step_compatible enkf_state_report_step_compatible.c ) -target_link_libraries( enkf_state_report_step_compatible enkf test_util ) - - - - -add_executable( enkf_select_case_job enkf_select_case_job.c ) -target_link_libraries( enkf_select_case_job enkf test_util ) - -add_test( enkf_select_case_job - ${EXECUTABLE_OUTPUT_PATH}/enkf_select_case_job - ${PROJECT_SOURCE_DIR}/test-data/local/snake_oil/snake_oil.ert - ${PROJECT_SOURCE_DIR}/share/workflows/jobs/internal-tui/config/SELECT_CASE) - - -#----------------------------------------------------------------- - - -add_executable( enkf_forward_init_GEN_PARAM enkf_forward_init_GEN_PARAM.c ) -target_link_libraries( enkf_forward_init_GEN_PARAM enkf test_util ) - -add_test( enkf_forward_init_GEN_PARAM_TRUE - ${EXECUTABLE_OUTPUT_PATH}/enkf_forward_init_GEN_PARAM - ${CMAKE_CURRENT_SOURCE_DIR}/data/config/forward/ert config_GEN_PARAM_true TRUE) - -add_test( enkf_forward_init_GEN_PARAM_FALSE - ${EXECUTABLE_OUTPUT_PATH}/enkf_forward_init_GEN_PARAM - ${CMAKE_CURRENT_SOURCE_DIR}/data/config/forward/ert config_GEN_PARAM_false FALSE) - - -add_executable( enkf_umask_config_test enkf_umask_config_test.c ) -target_link_libraries( enkf_umask_config_test enkf test_util ) - -add_test( enkf_umask_config_test - ${EXECUTABLE_OUTPUT_PATH}/enkf_umask_config_test - ${PROJECT_SOURCE_DIR}/test-data/local/simple_config/config_umask) - -#----------------------------------------------------------------- - -add_executable( enkf_iter_config enkf_iter_config.c ) -target_link_libraries( enkf_iter_config enkf test_util ) -add_test( enkf_iter_config ${EXECUTABLE_OUTPUT_PATH}/enkf_iter_config ) - - -add_executable( enkf_model_config enkf_model_config.c ) -target_link_libraries( enkf_model_config enkf test_util ) -add_test( enkf_model_config ${EXECUTABLE_OUTPUT_PATH}/enkf_model_config ) - -add_executable( enkf_rng enkf_rng.c ) -target_link_libraries( enkf_rng enkf test_util ) -add_test( enkf_rng ${EXECUTABLE_OUTPUT_PATH}/enkf_rng ${CMAKE_CURRENT_SOURCE_DIR}/data/config rng) - -add_executable( enkf_forward_load_context enkf_forward_load_context.c ) -target_link_libraries( enkf_forward_load_context enkf test_util ) -add_test( enkf_forward_load_context ${EXECUTABLE_OUTPUT_PATH}/enkf_forward_load_context ${CMAKE_CURRENT_SOURCE_DIR}/data/config forward_load_context) - - -add_executable( enkf_hook_manager_test enkf_hook_manager_test.c ) -target_link_libraries( enkf_hook_manager_test enkf test_util ) -add_test( enkf_hook_manager_test ${EXECUTABLE_OUTPUT_PATH}/enkf_hook_manager_test ) - -add_executable(enkf_obs_tests enkf_obs_tests.c) -target_link_libraries(enkf_obs_tests enkf test_util ) -add_test(enkf_obs_tests ${EXECUTABLE_OUTPUT_PATH}/enkf_obs_tests) - -add_executable(obs_vector_tests obs_vector_tests.c) -target_link_libraries(obs_vector_tests enkf test_util ) -add_test(obs_vector_tests ${EXECUTABLE_OUTPUT_PATH}/obs_vector_tests) - - -add_executable( enkf_state_map enkf_state_map.c ) -target_link_libraries( enkf_state_map enkf test_util ) -add_test( enkf_state_map ${EXECUTABLE_OUTPUT_PATH}/enkf_state_map ) - - -add_executable( enkf_meas_data enkf_meas_data.c ) -target_link_libraries( enkf_meas_data enkf test_util ) -add_test( enkf_meas_data ${EXECUTABLE_OUTPUT_PATH}/enkf_meas_data ) - -add_executable( enkf_ensemble_GEN_PARAM enkf_ensemble_GEN_PARAM.c ) -target_link_libraries( enkf_ensemble_GEN_PARAM enkf test_util ) -add_test( enkf_ensemble_GEN_PARAM ${EXECUTABLE_OUTPUT_PATH}/enkf_ensemble_GEN_PARAM ${CMAKE_CURRENT_SOURCE_DIR}/data/ensemble/GEN_PARAM ) - -add_executable( enkf_ensemble enkf_ensemble.c ) -target_link_libraries( enkf_ensemble enkf test_util ) -add_test( enkf_ensemble ${EXECUTABLE_OUTPUT_PATH}/enkf_ensemble ) diff --git a/ThirdParty/Ert/libert_util/include/ert/util/ert_api_config.h.in b/ThirdParty/Ert/libert_util/include/ert/util/ert_api_config.h.in index 5dfd4b0cc4..11b43d6b19 100644 --- a/ThirdParty/Ert/libert_util/include/ert/util/ert_api_config.h.in +++ b/ThirdParty/Ert/libert_util/include/ert/util/ert_api_config.h.in @@ -15,6 +15,6 @@ #cmakedefine ERT_TIME_T_64BIT_ACCEPT_PRE1970 #cmakedefine ERT_WINDOWS_LFS #cmakedefine ERT_HAVE_PING - +#cmakedefine PING_CMD "@PING_PATH@" diff --git a/ThirdParty/Ert/libert_util/include/ert/util/struct_vector.h b/ThirdParty/Ert/libert_util/include/ert/util/struct_vector.h index 58a9804966..79f56ffe18 100644 --- a/ThirdParty/Ert/libert_util/include/ert/util/struct_vector.h +++ b/ThirdParty/Ert/libert_util/include/ert/util/struct_vector.h @@ -26,14 +26,18 @@ extern "C" { typedef struct struct_vector_struct struct_vector_type; - +typedef int ( struct_vector_cmp_ftype ) (const void * , const void *); struct_vector_type * struct_vector_alloc( int element_size ); void struct_vector_free( struct_vector_type * struct_vector ); int struct_vector_get_size( const struct_vector_type * struct_vector ); void struct_vector_append( struct_vector_type * struct_vector , void * value); void struct_vector_iget( const struct_vector_type * struct_vector , int index , void * value); + void * struct_vector_iget_ptr( const struct_vector_type * struct_vector , int index); void struct_vector_reset( struct_vector_type * struct_vector ); + void struct_vector_reserve( struct_vector_type * struct_vector , int reserve_size); + void * struct_vector_get_data( const struct_vector_type * struct_vector ); + void struct_vector_sort( struct_vector_type * struct_vector , struct_vector_cmp_ftype * cmp); UTIL_IS_INSTANCE_HEADER( struct_vector ); diff --git a/ThirdParty/Ert/libert_util/include/ert/util/test_util.h b/ThirdParty/Ert/libert_util/include/ert/util/test_util.h index 8c68dbe8f8..131ef67735 100644 --- a/ThirdParty/Ert/libert_util/include/ert/util/test_util.h +++ b/ThirdParty/Ert/libert_util/include/ert/util/test_util.h @@ -26,6 +26,7 @@ extern "C" { #include #include +#include #include #if defined(__APPLE__) @@ -123,6 +124,11 @@ extern "C" { void test_install_SIGNALS(void); + jmp_buf * util_abort_test_jump_buffer(); + void test_util_addr2line(); + void test_assert_util_abort(const char * function_name , void call_func (void *) , void * arg); + + #ifdef __cplusplus } #endif diff --git a/ThirdParty/Ert/libert_util/include/ert/util/test_util_abort.h b/ThirdParty/Ert/libert_util/include/ert/util/test_util_abort.h deleted file mode 100644 index 2a2ad843ff..0000000000 --- a/ThirdParty/Ert/libert_util/include/ert/util/test_util_abort.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (C) 2015 Statoil ASA, Norway. - - The file 'test_util_abort.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -/* - This header is purely a convenience header - it is not installed. -*/ - -#ifndef ERT_TEST_UTIL_ABORT -#define ERT_TEST_UTIL_ABORT - -#ifdef __cplusplus -extern "C" { -#endif - -#include - - jmp_buf * util_abort_test_jump_buffer(); - void test_util_addr2line(); - void test_assert_util_abort(const char * function_name , void call_func (void *) , void * arg); - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/ThirdParty/Ert/libert_util/include/ert/util/util.h b/ThirdParty/Ert/libert_util/include/ert/util/util.h index 4121512027..d8a134d8d1 100644 --- a/ThirdParty/Ert/libert_util/include/ert/util/util.h +++ b/ThirdParty/Ert/libert_util/include/ert/util/util.h @@ -294,6 +294,8 @@ typedef enum {left_pad = 0, bool util_string_isspace(const char * s); char * util_alloc_dump_filename(void); + void util_abort_test_set_intercept_function(const char *); + bool util_addr2line_lookup(const void *, char **, char **, int *); void util_exit(const char * fmt , ...); void util_install_signals(void); void util_update_signals(void); diff --git a/ThirdParty/Ert/libert_util/src/CMakeLists.txt b/ThirdParty/Ert/libert_util/src/CMakeLists.txt index ec6cbde855..e2a9d9c228 100644 --- a/ThirdParty/Ert/libert_util/src/CMakeLists.txt +++ b/ThirdParty/Ert/libert_util/src/CMakeLists.txt @@ -33,6 +33,7 @@ set(source_files ert_version.c struct_vector.c perm_vector.c + test_util.c ) set(header_files @@ -71,10 +72,9 @@ set(header_files buffer_string.h perm_vector.h ert_version.h + test_util.h ) -set( test_source test_util.c ) -set( test_headers test_util.h ) # Add compile time variable values to ert_version.c @@ -161,12 +161,7 @@ if (ERT_BUILD_CXX) list( APPEND header_files test_util.hpp ) endif() -add_library( ert_util ${LIBRARY_TYPE} ${source_files} ) -if (BUILD_TESTS) - add_library( test_util ${LIBRARY_TYPE} ${test_source} ) - target_link_libraries( test_util ert_util ) - set_target_properties( test_util PROPERTIES VERSION ${ERT_VERSION_MAJOR}.${ERT_VERSION_MINOR} SOVERSION ${ERT_VERSION_MAJOR} ) -endif() +add_library( ert_util ${source_files} ) message(STATUS "Linking with: ${ERT_EXTERNAL_UTIL_LIBS}") set_target_properties( ert_util PROPERTIES VERSION ${ERT_VERSION_MAJOR}.${ERT_VERSION_MINOR} SOVERSION ${ERT_VERSION_MAJOR} ) diff --git a/ThirdParty/Ert/libert_util/src/struct_vector.c b/ThirdParty/Ert/libert_util/src/struct_vector.c index a60dd086b2..9f17b8e0c0 100644 --- a/ThirdParty/Ert/libert_util/src/struct_vector.c +++ b/ThirdParty/Ert/libert_util/src/struct_vector.c @@ -1,19 +1,19 @@ /* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'struct_vector.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. + Copyright (C) 2014 Statoil ASA, Norway. + + The file 'struct_vector.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT 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. + + ERT 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 + for more details. */ #include @@ -30,7 +30,7 @@ struct struct_vector_struct { int size; int element_size; int alloc_size; - + char * data; }; @@ -43,6 +43,12 @@ static void struct_vector_resize( struct_vector_type * struct_vector , int new_a } +void struct_vector_reserve( struct_vector_type * struct_vector , int reserve_size) { + if (reserve_size > struct_vector->alloc_size) + struct_vector_resize( struct_vector , reserve_size ); +} + + struct_vector_type * struct_vector_alloc( int element_size ) { if (element_size <= 0) { @@ -57,9 +63,9 @@ struct_vector_type * struct_vector_alloc( int element_size ) { vector->alloc_size = 0; vector->element_size = element_size; vector->data = NULL; - + struct_vector_resize( vector , 10 ); - + return vector; } } @@ -88,6 +94,10 @@ void struct_vector_append( struct_vector_type * struct_vector , void * value) { } +void * struct_vector_get_data( const struct_vector_type * struct_vector ) { + return struct_vector->data; +} + void struct_vector_iget( const struct_vector_type * struct_vector , int index , void * value) { if (index < struct_vector->size) { @@ -98,7 +108,21 @@ void struct_vector_iget( const struct_vector_type * struct_vector , int index , } +void * struct_vector_iget_ptr( const struct_vector_type * struct_vector , int index ) { + if (index < struct_vector->size) { + size_t offset = index * struct_vector->element_size; + return &struct_vector->data[offset]; + } else + util_abort("%s: fatal error - invalid index:%d size:%d\n",__func__ , index , struct_vector->size); + return NULL; +} + void struct_vector_reset( struct_vector_type * struct_vector ) { struct_vector->size = 0; } + + +void struct_vector_sort( struct_vector_type * struct_vector , struct_vector_cmp_ftype * cmp) { + qsort(struct_vector->data , struct_vector->size , struct_vector->element_size , cmp); +} diff --git a/ThirdParty/Ert/libert_util/src/test_util.c b/ThirdParty/Ert/libert_util/src/test_util.c index 831fac17fb..760f37d9af 100644 --- a/ThirdParty/Ert/libert_util/src/test_util.c +++ b/ThirdParty/Ert/libert_util/src/test_util.c @@ -29,7 +29,7 @@ #include #include #include - +#include void test_error_exit( const char * fmt , ...) { char * s; @@ -287,12 +287,6 @@ void test_install_SIGNALS(void) { #ifdef HAVE_BACKTRACE #include -#include - - bool util_addr2line_lookup(const void * bt_addr , char ** func_name , char ** file_name , int * line_nr); - jmp_buf * util_abort_test_jump_buffer(); - void util_abort_test_set_intercept_function(const char * function); - void test_util_addr2line() { @@ -315,12 +309,6 @@ void test_util_addr2line() { } - - - - - - void test_assert_util_abort(const char * function_name , void call_func (void *) , void * arg) { bool util_abort_intercepted = false; @@ -343,6 +331,27 @@ void test_assert_util_abort(const char * function_name , void call_func (void *) } } +#else + +/* + These are non-functional stubs. +*/ + +bool util_addr2line_lookup(const void * bt_addr , char ** func_name , char ** file_name , int * line_nr) +{ + return false; +} + +jmp_buf * util_abort_test_jump_buffer() +{ + return NULL; +} + +void util_abort_test_set_intercept_function(const char * function) +{ + return; +} + #endif diff --git a/ThirdParty/Ert/libert_util/src/test_work_area.c b/ThirdParty/Ert/libert_util/src/test_work_area.c index f9010eaf91..2ca36ac7c9 100644 --- a/ThirdParty/Ert/libert_util/src/test_work_area.c +++ b/ThirdParty/Ert/libert_util/src/test_work_area.c @@ -137,8 +137,9 @@ static test_work_area_type * test_work_area_alloc__(const char * prefix , const work_area->original_cwd = util_alloc_cwd(); work_area->cwd = test_cwd; work_area->change_dir = change_dir; - if (change_dir) - util_chdir( work_area->cwd ); + if (change_dir ) + if(util_chdir( work_area->cwd ) != 0) + util_abort("%s: Failed to move into temporary directory: %s", __func__, test_cwd); test_work_area_set_store( work_area , DEFAULT_STORE); diff --git a/ThirdParty/Ert/libert_util/src/util_abort_gnu.c b/ThirdParty/Ert/libert_util/src/util_abort_gnu.c index 19084fcc1e..c595f3fe46 100644 --- a/ThirdParty/Ert/libert_util/src/util_abort_gnu.c +++ b/ThirdParty/Ert/libert_util/src/util_abort_gnu.c @@ -75,7 +75,7 @@ static bool util_addr2line_lookup__(const void * bt_addr , char ** func_name , c } /* 2: Parse stdout output */ - { + if (util_file_exists( stdout_file )) { bool at_eof; FILE * stream = util_fopen(stdout_file , "r"); char * tmp_fname = util_fscanf_alloc_line(stream , &at_eof); @@ -293,7 +293,7 @@ void util_abort__(const char * file , const char * function , int line , const c } fprintf(stderr, "\nSee file: %s for more details of the crash.\nSetting the environment variable \"ERT_SHOW_BACKTRACE\" will show the backtrace on stderr.\n", filename); } - + chmod(filename, 00644); // -rw-r--r-- free(filename); } @@ -304,4 +304,3 @@ void util_abort__(const char * file , const char * function , int line , const c /*****************************************************************/ - diff --git a/ThirdParty/Ert/libert_util/tests/CMakeLists.txt b/ThirdParty/Ert/libert_util/tests/CMakeLists.txt index 33f9d5db2c..2142cab296 100644 --- a/ThirdParty/Ert/libert_util/tests/CMakeLists.txt +++ b/ThirdParty/Ert/libert_util/tests/CMakeLists.txt @@ -1,200 +1,196 @@ -# This should be a space separated list of up to three servers which -# will be tried out when testing the util_ping() functionality. The -# list of servers should behave like this: -# -# 1. First server - this should be an existing server which should return true. -# 2. This should be an invalid hostname - should return false. -# 3. This should be an valid host which does not answer ping - i.e currently off? -set(PING_SERVERS "" CACHE STRING "List of servers for testing ping") - - link_directories( ${ERT_BINARY_DIR}/libert_util/src ) add_executable( test_thread_pool test_thread_pool.c ) -target_link_libraries( test_thread_pool ert_util test_util ) -add_test( test_thread_pool valgrind --error-exitcode=1 --tool=memcheck ${EXECUTABLE_OUTPUT_PATH}/test_thread_pool ) +target_link_libraries( test_thread_pool ert_util ) + +find_library( VALGRIND NAMES valgr ) +if (VALGRIND) + add_test( test_thread_pool valgrind --error-exitcode=1 --tool=memcheck ${EXECUTABLE_OUTPUT_PATH}/test_thread_pool ) +else() + add_test( test_thread_pool ${EXECUTABLE_OUTPUT_PATH}/test_thread_pool ) +endif() add_executable( ert_util_matrix ert_util_matrix.c ) -target_link_libraries( ert_util_matrix ert_util test_util ) +target_link_libraries( ert_util_matrix ert_util ) add_test( ert_util_matrix ${EXECUTABLE_OUTPUT_PATH}/ert_util_matrix ) if (ERT_HAVE_LAPACK) add_executable( ert_util_matrix_lapack ert_util_matrix_lapack.c ) - target_link_libraries( ert_util_matrix_lapack ert_util test_util ) + target_link_libraries( ert_util_matrix_lapack ert_util ) add_test( ert_util_matrix_lapack ${EXECUTABLE_OUTPUT_PATH}/ert_util_matrix_lapack ) add_executable( ert_util_matrix_stat ert_util_matrix_stat.c ) - target_link_libraries( ert_util_matrix_stat ert_util test_util ) + target_link_libraries( ert_util_matrix_stat ert_util ) add_test( ert_util_matrix_stat ${EXECUTABLE_OUTPUT_PATH}/ert_util_matrix_stat ) endif() add_executable( ert_util_subst_list ert_util_subst_list.c ) -target_link_libraries( ert_util_subst_list ert_util test_util ) +target_link_libraries( ert_util_subst_list ert_util ) add_test( ert_util_subst_list ${EXECUTABLE_OUTPUT_PATH}/ert_util_subst_list ) add_executable( ert_util_buffer ert_util_buffer.c ) -target_link_libraries( ert_util_buffer ert_util test_util ) +target_link_libraries( ert_util_buffer ert_util ) add_test( ert_util_buffer ${EXECUTABLE_OUTPUT_PATH}/ert_util_buffer ) add_executable( ert_util_statistics ert_util_statistics.c ) -target_link_libraries( ert_util_statistics ert_util test_util ) +target_link_libraries( ert_util_statistics ert_util ) add_test( ert_util_statistics ${EXECUTABLE_OUTPUT_PATH}/ert_util_statistics ) add_executable( ert_util_copy_file ert_util_copy_file.c ) -target_link_libraries( ert_util_copy_file ert_util test_util ) +target_link_libraries( ert_util_copy_file ert_util ) add_test( ert_util_copy_file ${EXECUTABLE_OUTPUT_PATH}/ert_util_copy_file ${EXECUTABLE_OUTPUT_PATH}/ert_util_copy_file ) add_executable( ert_util_filename ert_util_filename.c ) -target_link_libraries( ert_util_filename ert_util test_util ) +target_link_libraries( ert_util_filename ert_util ) add_test( ert_util_filename ${EXECUTABLE_OUTPUT_PATH}/ert_util_filename ) add_executable( ert_util_sscan_test ert_util_sscan_test.c ) -target_link_libraries( ert_util_sscan_test ert_util test_util ) +target_link_libraries( ert_util_sscan_test ert_util ) add_test( ert_util_sscan_test ${EXECUTABLE_OUTPUT_PATH}/ert_util_sscan_test ) add_executable( ert_util_string_util ert_util_string_util.c ) -target_link_libraries( ert_util_string_util ert_util test_util ) +target_link_libraries( ert_util_string_util ert_util ) add_test( ert_util_string_util ${EXECUTABLE_OUTPUT_PATH}/ert_util_string_util ) add_executable( ert_util_vector_test ert_util_vector_test.c ) -target_link_libraries( ert_util_vector_test ert_util test_util ) +target_link_libraries( ert_util_vector_test ert_util ) add_test( ert_util_vector_test ${EXECUTABLE_OUTPUT_PATH}/ert_util_vector_test ) add_executable( ert_util_cwd_test ert_util_cwd_test.c ) -target_link_libraries( ert_util_cwd_test ert_util test_util ) +target_link_libraries( ert_util_cwd_test ert_util ) add_test( ert_util_cwd_test ${EXECUTABLE_OUTPUT_PATH}/ert_util_cwd_test ${CMAKE_CURRENT_BINARY_DIR}) add_executable( ert_util_relpath_test ert_util_relpath_test.c ) -target_link_libraries( ert_util_relpath_test ert_util test_util ) +target_link_libraries( ert_util_relpath_test ert_util ) add_test( ert_util_relpath_test ${EXECUTABLE_OUTPUT_PATH}/ert_util_relpath_test ) add_executable( ert_util_path_stack_test ert_util_path_stack_test.c ) -target_link_libraries( ert_util_path_stack_test ert_util test_util ) +target_link_libraries( ert_util_path_stack_test ert_util ) add_test( ert_util_path_stack_test ${EXECUTABLE_OUTPUT_PATH}/ert_util_path_stack_test ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) add_executable( ert_util_PATH_test ert_util_PATH_test.c ) -target_link_libraries( ert_util_PATH_test ert_util test_util ) +target_link_libraries( ert_util_PATH_test ert_util ) add_test( ert_util_PATH_test ${EXECUTABLE_OUTPUT_PATH}/ert_util_PATH_test ) add_executable( ert_util_strcat_test ert_util_strcat_test.c ) -target_link_libraries( ert_util_strcat_test ert_util test_util ) +target_link_libraries( ert_util_strcat_test ert_util ) add_test( ert_util_strcat_test ${EXECUTABLE_OUTPUT_PATH}/ert_util_strcat_test ) add_executable( ert_util_sprintf_escape ert_util_sprintf_escape.c ) -target_link_libraries( ert_util_sprintf_escape ert_util test_util ) +target_link_libraries( ert_util_sprintf_escape ert_util ) add_test( ert_util_sprintf_escape ${EXECUTABLE_OUTPUT_PATH}/ert_util_sprintf_escape ) add_executable( ert_util_stringlist_test ert_util_stringlist_test.c ) -target_link_libraries( ert_util_stringlist_test ert_util test_util ) +target_link_libraries( ert_util_stringlist_test ert_util ) add_test( ert_util_stringlist_test ${EXECUTABLE_OUTPUT_PATH}/ert_util_stringlist_test ) add_executable( ert_util_realpath ert_util_realpath.c ) -target_link_libraries( ert_util_realpath ert_util test_util ) +target_link_libraries( ert_util_realpath ert_util ) add_test( ert_util_realpath ${EXECUTABLE_OUTPUT_PATH}/ert_util_realpath ) add_executable( ert_util_hash_test ert_util_hash_test.c ) -target_link_libraries( ert_util_hash_test ert_util test_util ) +target_link_libraries( ert_util_hash_test ert_util ) add_test( ert_util_hash_test ${EXECUTABLE_OUTPUT_PATH}/ert_util_hash_test ) add_executable( ert_util_binary_split ert_util_binary_split.c ) -target_link_libraries( ert_util_binary_split ert_util test_util ) +target_link_libraries( ert_util_binary_split ert_util ) add_test( ert_util_binary_split ${EXECUTABLE_OUTPUT_PATH}/ert_util_binary_split ) add_executable( ert_util_logh ert_util_logh.c ) -target_link_libraries( ert_util_logh ert_util test_util ) +target_link_libraries( ert_util_logh ert_util ) add_test( ert_util_logh ${EXECUTABLE_OUTPUT_PATH}/ert_util_logh ) add_executable( ert_util_rng ert_util_rng.c ) -target_link_libraries( ert_util_rng ert_util test_util ) +target_link_libraries( ert_util_rng ert_util ) add_test( ert_util_rng ${EXECUTABLE_OUTPUT_PATH}/ert_util_rng ) add_executable( ert_util_time_interval ert_util_time_interval.c ) -target_link_libraries( ert_util_time_interval ert_util test_util ) +target_link_libraries( ert_util_time_interval ert_util ) add_test( ert_util_time_interval ${EXECUTABLE_OUTPUT_PATH}/ert_util_time_interval ) add_executable( ert_util_before_after ert_util_before_after.c ) -target_link_libraries( ert_util_before_after ert_util test_util ) +target_link_libraries( ert_util_before_after ert_util ) add_test( ert_util_before_after ${EXECUTABLE_OUTPUT_PATH}/ert_util_before_after ) add_executable( ert_util_approx_equal ert_util_approx_equal.c ) -target_link_libraries( ert_util_approx_equal ert_util test_util ) +target_link_libraries( ert_util_approx_equal ert_util ) add_test( ert_util_approx_equal ${EXECUTABLE_OUTPUT_PATH}/ert_util_approx_equal ) -if (PING_PATH) +if (ERT_HAVE_PING) add_executable( ert_util_ping ert_util_ping.c ) - target_link_libraries( ert_util_ping ert_util test_util ) - add_test( ert_util_ping ${EXECUTABLE_OUTPUT_PATH}/ert_util_ping ${PING_SERVERS}) + target_link_libraries( ert_util_ping ert_util ) + add_test( ert_util_ping ${EXECUTABLE_OUTPUT_PATH}/ert_util_ping) endif() add_executable( ert_util_file_readable ert_util_file_readable.c ) -target_link_libraries( ert_util_file_readable ert_util test_util ) +target_link_libraries( ert_util_file_readable ert_util ) add_test( ert_util_file_readable ${EXECUTABLE_OUTPUT_PATH}/ert_util_file_readable ${FILE_READABLE_SERVERS}) add_executable( ert_util_type_vector_functions ert_util_type_vector_functions.c ) -target_link_libraries( ert_util_type_vector_functions ert_util test_util ) +target_link_libraries( ert_util_type_vector_functions ert_util ) add_test( ert_util_type_vector_functions ${EXECUTABLE_OUTPUT_PATH}/ert_util_type_vector_functions) add_executable( ert_util_ui_return ert_util_ui_return.c ) -target_link_libraries( ert_util_ui_return ert_util test_util ) +target_link_libraries( ert_util_ui_return ert_util ) add_test( ert_util_ui_return ${EXECUTABLE_OUTPUT_PATH}/ert_util_ui_return ) add_executable( ert_util_clamp ert_util_clamp.c ) -target_link_libraries( ert_util_clamp ert_util test_util ) +target_link_libraries( ert_util_clamp ert_util ) add_test( ert_util_clamp ${EXECUTABLE_OUTPUT_PATH}/ert_util_clamp ) add_executable( ert_util_strstr_int_format ert_util_strstr_int_format.c ) -target_link_libraries( ert_util_strstr_int_format ert_util test_util ) +target_link_libraries( ert_util_strstr_int_format ert_util ) add_test( ert_util_strstr_int_format ${EXECUTABLE_OUTPUT_PATH}/ert_util_strstr_int_format ) add_executable( ert_util_parent_path ert_util_parent_path.c ) -target_link_libraries( ert_util_parent_path ert_util test_util ) +target_link_libraries( ert_util_parent_path ert_util ) add_test( ert_util_parent_path ${EXECUTABLE_OUTPUT_PATH}/ert_util_parent_path) add_executable( ert_util_alloc_file_components ert_util_alloc_file_components.c ) -target_link_libraries( ert_util_alloc_file_components ert_util test_util ) +target_link_libraries( ert_util_alloc_file_components ert_util ) add_test( ert_util_alloc_file_components ${EXECUTABLE_OUTPUT_PATH}/ert_util_alloc_file_components) add_executable( ert_util_work_area ert_util_work_area.c ) -target_link_libraries( ert_util_work_area ert_util test_util ) +target_link_libraries( ert_util_work_area ert_util ) add_test( NAME ert_util_work_area COMMAND ${EXECUTABLE_OUTPUT_PATH}/ert_util_work_area data2/file1 ${CMAKE_CURRENT_SOURCE_DIR}/data2/file2 data2 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) add_executable( ert_util_arg_pack ert_util_arg_pack.c) set_target_properties( ert_util_arg_pack PROPERTIES COMPILE_FLAGS "-Werror") -target_link_libraries( ert_util_arg_pack ert_util test_util ) +target_link_libraries( ert_util_arg_pack ert_util ) add_test( ert_util_arg_pack ${EXECUTABLE_OUTPUT_PATH}/ert_util_arg_pack) if (HAVE_BACKTRACE) add_executable( ert_util_abort_gnu_tests ert_util_abort_gnu_tests.c) - target_link_libraries( ert_util_abort_gnu_tests ert_util test_util) + target_link_libraries( ert_util_abort_gnu_tests ert_util ) add_test( ert_util_abort_gnu_tests ${EXECUTABLE_OUTPUT_PATH}/ert_util_abort_gnu_tests) add_executable( ert_util_addr2line ert_util_addr2line.c ) - target_link_libraries( ert_util_addr2line ert_util test_util ) + target_link_libraries( ert_util_addr2line ert_util ) add_test( ert_util_addr2line ${EXECUTABLE_OUTPUT_PATH}/ert_util_addr2line) endif() if (HAVE_UTIL_ABORT_INTERCEPT) add_executable( ert_util_block_fs ert_util_block_fs.c) - target_link_libraries( ert_util_block_fs ert_util test_util) + target_link_libraries( ert_util_block_fs ert_util ) add_test( ert_util_block_fs ${EXECUTABLE_OUTPUT_PATH}/ert_util_block_fs) add_executable( ert_util_struct_vector ert_util_struct_vector.c ) - target_link_libraries( ert_util_struct_vector ert_util test_util ) + target_link_libraries( ert_util_struct_vector ert_util ) add_test( ert_util_struct_vector ${EXECUTABLE_OUTPUT_PATH}/ert_util_struct_vector ) add_executable( ert_util_type_vector_test ert_util_type_vector_test.c ) - target_link_libraries( ert_util_type_vector_test ert_util test_util ) + target_link_libraries( ert_util_type_vector_test ert_util ) add_test( ert_util_type_vector_test ${EXECUTABLE_OUTPUT_PATH}/ert_util_type_vector_test ) endif() if (ERT_HAVE_SPAWN) add_executable( ert_util_spawn ert_util_spawn.c ) - target_link_libraries( ert_util_spawn ert_util test_util ) + target_link_libraries( ert_util_spawn ert_util ) add_test( ert_util_spawn ${EXECUTABLE_OUTPUT_PATH}/ert_util_spawn) endif() diff --git a/ThirdParty/Ert/libert_util/tests/ert_util_abort_gnu_tests.c b/ThirdParty/Ert/libert_util/tests/ert_util_abort_gnu_tests.c index c8f91affce..923240054f 100644 --- a/ThirdParty/Ert/libert_util/tests/ert_util_abort_gnu_tests.c +++ b/ThirdParty/Ert/libert_util/tests/ert_util_abort_gnu_tests.c @@ -1,4 +1,4 @@ -/* +/* * File: ert_util_abort_gnu_tests.c * Author: kflik * @@ -9,7 +9,6 @@ #include #include #include -#include void test_assert_util_abort(const char * function_name , void (void *) , void * arg); diff --git a/ThirdParty/Ert/libert_util/tests/ert_util_addr2line.c b/ThirdParty/Ert/libert_util/tests/ert_util_addr2line.c index c621a3b332..5aa62222c0 100644 --- a/ThirdParty/Ert/libert_util/tests/ert_util_addr2line.c +++ b/ThirdParty/Ert/libert_util/tests/ert_util_addr2line.c @@ -1,19 +1,19 @@ /* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'ert_util_addr2line.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. + Copyright (C) 2012 Statoil ASA, Norway. + + The file 'ert_util_addr2line.c' is part of ERT - Ensemble based Reservoir Tool. + + ERT 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. + + ERT 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 + for more details. */ #include #include @@ -23,7 +23,6 @@ #include #include #include -#include @@ -32,15 +31,15 @@ void test_lookup(bool valid_address, bool change_cwd) { const char * func = __func__; int line; const int max_bt = 50; - void *bt_addr[max_bt]; + void *bt_addr[max_bt]; int size; char * func_name , * file_name; int line_nr; - + line = __LINE__ + 2; - size = backtrace(bt_addr , max_bt); + size = backtrace(bt_addr , max_bt); test_assert_int_equal( size , 4 ); - + if (change_cwd) { char * cwd = util_alloc_cwd(); util_chdir("/tmp"); @@ -80,14 +79,14 @@ int main( int argc , char ** argv) { char * path; char * name; char * dot_name; - /* + /* This bisaaarre hoopsing is to be able to emulate the situation where addr2line can not find the executable; this behaviour is invoked when change_cwd is set to true in the test_lookup() - call. + call. */ util_alloc_file_components( argv[0] , &path , &name, NULL); - + util_chdir(path); dot_name = util_alloc_sprintf("./%s" , name); util_spawn_blocking(dot_name, 0, NULL, NULL, NULL); @@ -96,13 +95,13 @@ int main( int argc , char ** argv) { printf("Testing internal lookup ....\n"); test_lookup(true, false); test_lookup(false , false); - + test_lookup(true, true); test_lookup(false , true); - + printf("Testing external lookup ....\n"); - test_util_addr2line(); - + test_util_addr2line(); + exit(0); } } diff --git a/ThirdParty/Ert/libert_util/tests/ert_util_matrix.c b/ThirdParty/Ert/libert_util/tests/ert_util_matrix.c index ac6492f36c..c3c47a0953 100644 --- a/ThirdParty/Ert/libert_util/tests/ert_util_matrix.c +++ b/ThirdParty/Ert/libert_util/tests/ert_util_matrix.c @@ -28,8 +28,6 @@ #include #include #include -#include - void test_resize() { @@ -96,54 +94,6 @@ void test_dims() { } -void test_det4() { - matrix_type * m = matrix_alloc(4 , 4 ); - rng_type * rng = rng_alloc(MZRAN , INIT_DEV_URANDOM ); - for (int i=0; i < 10; i++) { - matrix_random_init( m , rng ); - { - double det4 = matrix_det4( m ); - double det = matrix_det( m ); - - test_assert_double_equal( det , det4 ); - } - } - - matrix_free( m ); - rng_free( rng ); -} - - -void test_det3() { - matrix_type * m = matrix_alloc(3 , 3 ); - rng_type * rng = rng_alloc(MZRAN , INIT_DEV_URANDOM ); - matrix_random_init( m , rng ); - - { - double det3 = matrix_det3( m ); - double det = matrix_det( m ); - - test_assert_double_equal( det , det3 ); - } - - matrix_free( m ); - rng_free( rng ); -} - - -void test_det2() { - matrix_type * m = matrix_alloc(2,2); - rng_type * rng = rng_alloc(MZRAN , INIT_DEV_URANDOM ); - matrix_random_init( m , rng ); - { - double det2 = matrix_det2( m ); - double det = matrix_det( m ); - - test_assert_double_equal( det , det2 ); - } - matrix_free( m ); - rng_free( rng ); -} void test_readwrite() { @@ -283,9 +233,7 @@ int main( int argc , char ** argv) { test_resize(); test_column_equal(); test_dims(); - test_det2(); - test_det3(); - test_det4(); + test_readwrite(); test_diag_std(); test_masked_copy(); diff --git a/ThirdParty/Ert/libert_util/tests/ert_util_ping.c b/ThirdParty/Ert/libert_util/tests/ert_util_ping.c index 52cd1e16ff..4910a11dcb 100644 --- a/ThirdParty/Ert/libert_util/tests/ert_util_ping.c +++ b/ThirdParty/Ert/libert_util/tests/ert_util_ping.c @@ -30,13 +30,5 @@ int main( int argc , char ** argv) { test_assert_true( util_ping("127.0.0.1" )); test_assert_false( util_ping("does.not.exist")); - if (argc > 1) { - stringlist_type * server_list = stringlist_alloc_from_split( argv[1] , " "); - int is ; - for (is = 0; is < stringlist_get_size( server_list ); is++) { - test_assert_true( util_ping( stringlist_iget( server_list , is ))); - } - } - exit(0); } diff --git a/ThirdParty/Ert/libert_util/tests/ert_util_struct_vector.c b/ThirdParty/Ert/libert_util/tests/ert_util_struct_vector.c index 6e863d0b9f..67a7347964 100644 --- a/ThirdParty/Ert/libert_util/tests/ert_util_struct_vector.c +++ b/ThirdParty/Ert/libert_util/tests/ert_util_struct_vector.c @@ -38,6 +38,8 @@ void test_create() { struct_vector_type * struct_vector = struct_vector_alloc( sizeof d ); test_assert_true( struct_vector_is_instance( struct_vector )); test_assert_int_equal( struct_vector_get_size( struct_vector ) , 0 ); + struct_vector_reserve( struct_vector , 1000 ); + test_assert_int_equal( struct_vector_get_size( struct_vector ) , 0 ); struct_vector_free( struct_vector ); } @@ -59,7 +61,9 @@ void test_append_iget() { struct_vector_append( struct_vector , &d1 ); test_assert_int_equal( struct_vector_get_size( struct_vector ) , 1 ); - + struct_vector_reserve( struct_vector , 0 ); + test_assert_int_equal( struct_vector_get_size( struct_vector ) , 1 ); + test_assert_false( d1.x == d2.x ); test_assert_false( d1.y == d2.y ); test_assert_false( d1.z == d2.z ); @@ -69,6 +73,13 @@ void test_append_iget() { test_assert_true( d1.y == d2.y ); test_assert_true( d1.z == d2.z ); + { + struct test_struct * d = struct_vector_get_data( struct_vector ); + struct test_struct d3 = d[0]; + test_assert_true( d1.x == d3.x ); + test_assert_true( d1.y == d3.y ); + test_assert_true( d1.z == d3.z ); + } struct_vector_reset( struct_vector ); test_assert_int_equal( struct_vector_get_size( struct_vector ) , 0 ); @@ -77,9 +88,53 @@ void test_append_iget() { +int cmp( const void * _d1, const void * _d2) { + const struct test_struct * d1 = (const struct test_struct *) _d1; + const struct test_struct * d2 = (const struct test_struct *) _d2; + + return d1->x - d2->x; +} + + +int rcmp( const void * _d1, const void * _d2) { + return cmp(_d2 , _d1); +} + + + +void test_sort() { + struct test_struct d; + struct_vector_type * struct_vector = struct_vector_alloc( sizeof d ); + for (int i = 0; i < 10; i++) { + struct test_struct d = {.x = 9 - i, + .y = 9 - i, + .z = 9 - i }; + struct_vector_append( struct_vector , &d ); + } + struct_vector_sort( struct_vector , cmp ); + for (int i = 0; i < 9; i++) { + struct test_struct d1; + struct test_struct d2; + struct_vector_iget( struct_vector , i ,&d1 ); + struct_vector_iget( struct_vector , i + 1,&d2 ); + test_assert_true( cmp(&d1 , &d2) <= 0); + } + + struct_vector_sort( struct_vector , rcmp ); + for (int i = 0; i < 9; i++) { + struct test_struct d1; + struct test_struct d2; + struct_vector_iget( struct_vector , i ,&d1 ); + struct_vector_iget( struct_vector , i + 1,&d2 ); + test_assert_true( cmp(&d1 , &d2) >= 0); + } +} + + int main(int argc , char ** argv) { test_create(); test_create_invalid(); test_append_iget(); + test_sort(); } diff --git a/ThirdParty/Ert/libert_util/tests/ert_util_type_vector_test.c b/ThirdParty/Ert/libert_util/tests/ert_util_type_vector_test.c index b75768b500..e5bc248634 100644 --- a/ThirdParty/Ert/libert_util/tests/ert_util_type_vector_test.c +++ b/ThirdParty/Ert/libert_util/tests/ert_util_type_vector_test.c @@ -21,7 +21,6 @@ #include #include #include -#include void assert_equal( bool equal ) { if (!equal) diff --git a/ThirdParty/Ert/libert_utilxx/src/CMakeLists.txt b/ThirdParty/Ert/libert_utilxx/src/CMakeLists.txt index a82f5ee1d5..9ff4095fa7 100644 --- a/ThirdParty/Ert/libert_utilxx/src/CMakeLists.txt +++ b/ThirdParty/Ert/libert_utilxx/src/CMakeLists.txt @@ -8,7 +8,7 @@ set( header_files ) -add_library( ert_utilxx ${LIBRARY_TYPE} ${source_files} ) +add_library( ert_utilxx ${source_files} ) set_target_properties( ert_utilxx PROPERTIES VERSION ${ERT_VERSION_MAJOR}.${ERT_VERSION_MINOR} SOVERSION ${ERT_VERSION_MAJOR}) if (USE_RUNPATH) add_runpath( ert_utilxx ) diff --git a/ThirdParty/Ert/libert_utilxx/tests/CMakeLists.txt b/ThirdParty/Ert/libert_utilxx/tests/CMakeLists.txt index ce609df250..e9cd19572e 100644 --- a/ThirdParty/Ert/libert_utilxx/tests/CMakeLists.txt +++ b/ThirdParty/Ert/libert_utilxx/tests/CMakeLists.txt @@ -1,7 +1,7 @@ add_executable(ert_util_unique_ptr ert_util_unique_ptr.cpp ) -target_link_libraries(ert_util_unique_ptr test_util ert_util) +target_link_libraries(ert_util_unique_ptr ert_util) add_test(ert_util_unique_ptr ${EXECUTABLE_OUTPUT_PATH}/ert_util_unique_ptr) add_executable(ert_util_test_area_xx ert_util_test_area_xx.cpp ) -target_link_libraries(ert_util_test_area_xx test_util ert_utilxx) +target_link_libraries(ert_util_test_area_xx ert_utilxx) add_test(ert_util_test_area_xx ${EXECUTABLE_OUTPUT_PATH}/ert_util_test_area_xx) diff --git a/ThirdParty/Ert/libgeometry/src/CMakeLists.txt b/ThirdParty/Ert/libgeometry/src/CMakeLists.txt index 181eaeecef..c33a248603 100644 --- a/ThirdParty/Ert/libgeometry/src/CMakeLists.txt +++ b/ThirdParty/Ert/libgeometry/src/CMakeLists.txt @@ -1,7 +1,7 @@ set( source_files geo_surface.c geo_util.c geo_pointset.c geo_region.c geo_polygon.c geo_polygon_collection.c) set( header_files geo_surface.h geo_util.h geo_pointset.h geo_region.h geo_polygon.h geo_polygon_collection.h) -add_library( ert_geometry ${LIBRARY_TYPE} ${source_files} ) +add_library( ert_geometry ${source_files} ) set_target_properties( ert_geometry PROPERTIES VERSION ${ERT_VERSION_MAJOR}.${ERT_VERSION_MINOR} SOVERSION ${ERT_VERSION_MAJOR}) target_link_libraries( ert_geometry ert_util ) if (USE_RUNPATH) diff --git a/ThirdParty/Ert/libgeometry/src/geo_surface.c b/ThirdParty/Ert/libgeometry/src/geo_surface.c index c8f42c3136..7d9b443c77 100644 --- a/ThirdParty/Ert/libgeometry/src/geo_surface.c +++ b/ThirdParty/Ert/libgeometry/src/geo_surface.c @@ -60,31 +60,6 @@ static void geo_surface_copy_header( const geo_surface_type * src , geo_surface_ } } - -/* -static int geo_surface_cornerindex( const geo_surface_type * geo_surface , int cell_ix , int cell_iy) { - return (geo_surface->nx + 1) * cell_iy + cell_ix; -} - - -static void geo_surface_init_cells( geo_surface_type * geo_surface ) { - int ix,iy; - geo_surface->cells = util_malloc( geo_surface->nx * geo_surface->ny * sizeof * geo_surface->cells , __func__); - for (iy = 0; iy < geo_surface->ny; iy++) { - for (ix = 0; ix < geo_surface->nx; ix++) { - int cell_index = iy * geo_surface->nx + ix; - - geo_surface->cells[ cell_index ].index_list[0] = geo_surface_cornerindex( geo_surface , ix , iy ); - geo_surface->cells[ cell_index ].index_list[1] = geo_surface_cornerindex( geo_surface , ix + 1 , iy ); - geo_surface->cells[ cell_index ].index_list[2] = geo_surface_cornerindex( geo_surface , ix + 1 , iy + 1); - geo_surface->cells[ cell_index ].index_list[3] = geo_surface_cornerindex( geo_surface , ix , iy + 1); - - } - } -} -*/ - - static geo_surface_type * geo_surface_alloc_empty( bool internal_z ) { geo_surface_type * surface = util_malloc( sizeof * surface ); UTIL_TYPE_ID_INIT( surface , GEO_SURFACE_TYPE_ID ) @@ -116,28 +91,20 @@ static void geo_surface_init_regular( geo_surface_type * surface , const double static bool geo_surface_fscanf_zcoord( const geo_surface_type * surface , FILE * stream , double * zcoord) { - bool OK = false; int index = 0; while (true) { if (fscanf(stream , "%lg" , &zcoord[index]) == 1) index++; else - /* File is too short */ - break; + return false; // File is too short if (index == surface->nx * surface->ny) { double extra_value; int fscanf_return = fscanf( stream , "%lg" , &extra_value); - - /* Check that there is not more data dangling at the end of the file. */ - if (fscanf_return == EOF) - OK = true; - break; + return (fscanf_return == EOF); // no more data dangling at the end of the file. } } - - return OK; } diff --git a/ThirdParty/Ert/libgeometry/tests/CMakeLists.txt b/ThirdParty/Ert/libgeometry/tests/CMakeLists.txt index 9a39bd4e17..3547148055 100644 --- a/ThirdParty/Ert/libgeometry/tests/CMakeLists.txt +++ b/ThirdParty/Ert/libgeometry/tests/CMakeLists.txt @@ -1,18 +1,18 @@ add_executable( geo_util_xlines geo_util_xlines.c ) -target_link_libraries( geo_util_xlines ert_geometry test_util ) +target_link_libraries( geo_util_xlines ert_geometry ) add_test( geo_util_xlines ${EXECUTABLE_OUTPUT_PATH}/geo_util_xlines ) add_executable( geo_polygon geo_polygon.c ) -target_link_libraries( geo_polygon ert_geometry test_util ) +target_link_libraries( geo_polygon ert_geometry ) add_test( geo_polygon ${EXECUTABLE_OUTPUT_PATH}/geo_polygon ) add_executable( geo_polygon_collection geo_polygon_collection.c ) -target_link_libraries( geo_polygon_collection ert_geometry test_util ) +target_link_libraries( geo_polygon_collection ert_geometry ) add_test( geo_polygon_collection ${EXECUTABLE_OUTPUT_PATH}/geo_polygon_collection ) if (STATOIL_TESTDATA_ROOT) add_executable( geo_surface geo_surface.c ) - target_link_libraries( geo_surface ert_geometry test_util ) + target_link_libraries( geo_surface ert_geometry ) add_test( geo_surface ${EXECUTABLE_OUTPUT_PATH}/geo_surface ${PROJECT_SOURCE_DIR}/test-data/Statoil/Geometry/Surface.irap diff --git a/ThirdParty/Ert/libjob_queue/CMakeLists.txt b/ThirdParty/Ert/libjob_queue/CMakeLists.txt deleted file mode 100644 index 9ea4540853..0000000000 --- a/ThirdParty/Ert/libjob_queue/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -set( HAVE_LSF_LIBRARY OFF ) - -set( ERT_LSF_LIB_PATH "" CACHE FILEPATH "Path to search for the LSF libraries" ) -set( ERT_LSF_INCLUDE_PATH "" CACHE FILEPATH "Path to search for the LSF header files" ) - -find_path( LSF_HEADER_PATH lsf/lsf.h - PATHS ${ERT_LSF_INCLUDE_PATH}) - -find_library( LSF_LIBRARY NAMES lsf PATHS ${ERT_LSF_LIB_PATH}) - - - -if (LSF_HEADER_PATH) - if (LSF_LIBRARY) - set( HAVE_LSF_LIBRARY ON ) - endif() -endif() - - -if (HAVE_LSF_LIBRARY) - include_directories( ${LSF_HEADER_PATH} ) - add_definitions( -DHAVE_LSF_LIBRARY ) - message(STATUS "Found LSF as ${LSF_HEADER_PATH} and ${LSF_LIBRARY}") -else() - message(STATUS "LSF not found") -endif() - -add_subdirectory( src ) -if (BUILD_APPLICATIONS) - add_subdirectory( applications ) -endif() - -if (BUILD_TESTS) - add_subdirectory( tests ) -endif() - - diff --git a/ThirdParty/Ert/libjob_queue/applications/CMakeLists.txt b/ThirdParty/Ert/libjob_queue/applications/CMakeLists.txt deleted file mode 100644 index 94693ed1a1..0000000000 --- a/ThirdParty/Ert/libjob_queue/applications/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -if (HAVE_LSF_LIBRARY) - add_executable( block_node block_node.c ) - target_link_libraries( block_node job_queue ert_util) - if (USE_RUNPATH) - add_runpath( block_node ) - endif() - - install(TARGETS block_node DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) -endif() diff --git a/ThirdParty/Ert/libjob_queue/applications/block_node.c b/ThirdParty/Ert/libjob_queue/applications/block_node.c deleted file mode 100644 index 21e5ebbb85..0000000000 --- a/ThirdParty/Ert/libjob_queue/applications/block_node.c +++ /dev/null @@ -1,284 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'block_node.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#define BLOCK_COMMAND "/project/res/bin/block-job" -#define STATOIL_LSF_REQUEST "select[cs && x86_64Linux]" - - - -static lsf_driver_type * lsf_driver; -static vector_type * job_pool; -static hash_type * nodes; - - -typedef struct { - lsf_job_type * lsf_job; - stringlist_type * hostlist; - bool running; - bool block_job; -} block_job_type; - - -typedef struct { - int target; - int current; -} count_pair_type; - - -count_pair_type * count_pair_alloc() { - count_pair_type * pair = util_malloc( sizeof * pair ); - pair->target = 0; - pair->current = 0; - return pair; -} - - - - -block_job_type * block_job_alloc() { - block_job_type * job = util_malloc( sizeof * job ); - - job->lsf_job = NULL; - job->running = false; - job->block_job = false; - job->hostlist = stringlist_alloc_new(); - - return job; -} - - -void block_job_free( block_job_type * block_job ) { - stringlist_free( block_job->hostlist ); - if (block_job->lsf_job) - lsf_job_free( block_job->lsf_job ); - - free( block_job ); -} - - -const char * block_job_get_hostname( const block_job_type * block_job ) { - return stringlist_iget( block_job->hostlist , 0 ); -} - - - -void update_job_status( block_job_type * job ) { - if (!job->running) { - int lsf_status = lsf_driver_get_job_status_lsf( lsf_driver , job->lsf_job ); - if (lsf_status == JOB_STAT_RUN) { - lsf_job_export_hostnames( job->lsf_job , job->hostlist ); - { - int ihost; - for (ihost = 0; ihost < stringlist_get_size( job->hostlist ); ihost++) { - const char * host = stringlist_iget( job->hostlist , ihost ); - if (hash_has_key( nodes, host)) { /* This is one of the instances which should be left running. */ - count_pair_type * pair = hash_get( nodes , host); - if (pair->current < pair->target) { - pair->current += 1; - job->block_job = true; - } - } - } - } - job->running = true; - } - } -} - - - -/*****************************************************************/ - - - -void add_jobs( int chunk_size) { - int i; - char * cwd = util_alloc_cwd(); - for (i=0; i < chunk_size; i++) { - block_job_type * job = block_job_alloc(); - job->lsf_job = lsf_driver_submit_job(lsf_driver , BLOCK_COMMAND , 1 , cwd , "BLOCK" , 0 , NULL ); - vector_append_ref( job_pool , job ); - } - free( cwd ); -} - - -void update_pool_status( bool *all_blocked , int * pending) { - int i; - int pend_count = 0; - *all_blocked = true; - - for (i=0; i < vector_get_size( job_pool ); i++) { - block_job_type * job = vector_iget( job_pool , i ); - update_job_status( job ); - - if (!job->running) - pend_count++; - } - - { - hash_iter_type * iter = hash_iter_alloc( nodes ); - while (!hash_iter_is_complete( iter )) { - const char * hostname = hash_iter_get_next_key( iter ); - const count_pair_type * count = hash_get( nodes , hostname ); - if (count->current < count->target) - *all_blocked = false; - } - } - *pending = pend_count; -} - - -void print_status() { - int total_running = 0; - int total_pending = 0; - for (int i=0; i < vector_get_size( job_pool ); i++) { - block_job_type * job = vector_iget( job_pool , i ); - if (job->running) - total_running += 1; - else - total_pending += 1; - } - printf("Running:%3d Pending: %3d Blocks active: ",total_running , total_pending); - { - hash_iter_type * iter = hash_iter_alloc( nodes ); - while (!hash_iter_is_complete( iter )) { - const char * hostname = hash_iter_get_next_key( iter ); - const count_pair_type * count = hash_get( nodes , hostname ); - printf("%s %d/%d ",hostname , count->current , count->target); - } - printf("\n"); - hash_iter_free( iter ); - } -} - - -void block_node_exit( int signal ) { - int job_nr; - - print_status(); - for (job_nr = 0; job_nr < vector_get_size( job_pool ); job_nr++) { - block_job_type * job = vector_iget( job_pool , job_nr ); - - if (job->block_job) { - printf("Job:%ld is running on host: ", lsf_job_get_jobnr( job->lsf_job )); - stringlist_fprintf( job->hostlist , " " , stdout ); - printf("\n"); - } else - lsf_driver_kill_job( lsf_driver , job->lsf_job ); - - block_job_free( job ); - } - printf("Remember to kill these jobs when the BLOCK is no longer needed\n"); - if (signal != 0) - exit(0); -} - - -int main( int argc, char ** argv) { - if (argc == 1) - util_exit("block_node node1 node2 node3:2 \n"); - - /* Initialize lsf environment */ - util_setenv( "LSF_BINDIR" , "/prog/LSF/9.1/linux2.6-glibc2.3-x86_64/bin" ); - util_setenv( "LSF_LINDIR" , "/prog/LSF/9.1/linux2.6-glibc2.3-x86_64/lib" ); - util_setenv( "XLSF_UIDDIR" , "/prog/LSF/9.1/linux2.6-glibc2.3-x86_64/lib/uid" ); - util_setenv( "LSF_SERVERDIR" , "/prog/LSF/9.1/linux2.6-glibc2.3-x86_64/etc"); - util_setenv( "LSF_ENVDIR" , "/prog/LSF/conf"); - - util_update_path_var( "PATH" , "/prog/LSF/9.1/linux2.6-glibc2.3-x86_64/bin" , false); - util_update_path_var( "LD_LIBRARY_PATH" , "/prog/LSF/9.1/linux2.6-glibc2.3-x86_64/lib" , false); - - - lsf_driver = lsf_driver_alloc(); - if (lsf_driver_get_submit_method( lsf_driver ) != LSF_SUBMIT_INTERNAL) - util_exit("Sorry - the block_node program must be invoked on a proper LSF node \n"); - - { - - int iarg; - int total_blocked_target = 0; - nodes = hash_alloc(); - for (iarg = 1; iarg < argc; iarg++) { - char *node_name; - int num_slots; - - { - char * num_slots_string; - util_binary_split_string( argv[iarg] , ":" , true , &node_name , &num_slots_string); - if (num_slots_string) - util_sscanf_int( num_slots_string , &num_slots); - else - num_slots = 1; - } - - if (!hash_has_key( nodes , node_name)) - hash_insert_hash_owned_ref( nodes , node_name , count_pair_alloc() , free); - - { - count_pair_type * pair = hash_get( nodes , node_name); - pair->target += num_slots; - } - total_blocked_target += num_slots; - } - - signal(SIGINT , block_node_exit ); - { - const int sleep_time = 5; - const int chunk_size = 10; /* We submit this many at a time. */ - const int max_pool_size = 1000; /* The absolute total maximum of jobs we will submit. */ - - bool cont = true; - int pending = 0; - bool all_blocked; - job_pool = vector_alloc_new(); - - while (cont) { - printf("[Ctrl-C to give up] "); fflush( stdout ); - if (cont) sleep( sleep_time ); - if (pending == 0) { - if (vector_get_size( job_pool ) < max_pool_size) - add_jobs( chunk_size ); - } - - update_pool_status( &all_blocked , &pending); - print_status(); - - if (all_blocked) - cont = false; - } - if (!all_blocked) - printf("Sorry - failed to block all the nodes \n"); - - block_node_exit( 0 ); - hash_free( nodes ); - } - } -} diff --git a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/ext_job.h b/ThirdParty/Ert/libjob_queue/include/ert/job_queue/ext_job.h deleted file mode 100644 index d8f79e6a02..0000000000 --- a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/ext_job.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'ext_job.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_EXT_JOB_H -#define ERT_EXT_JOB_H -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include -#include -#include - -typedef struct ext_job_struct ext_job_type; - - -const char * ext_job_get_help_text( const ext_job_type * job ); -void ext_job_set_help_text( ext_job_type * job , const char * help_text); - -void ext_job_fprintf_config(const ext_job_type * ext_job , const char * fmt , FILE * stream); -ext_job_type * ext_job_alloc_copy(const ext_job_type * ); -ext_job_type * ext_job_alloc(const char * , const char * license_root_path , bool private_job); - const char * ext_job_get_name(const ext_job_type * ); -void ext_job_free(ext_job_type * ) ; -void ext_job_free__(void * ); -void ext_job_add_environment(ext_job_type *, const char * , const char * ) ; -void ext_job_save( const ext_job_type * ext_job ); -void ext_job_fprintf(const ext_job_type * , FILE * stream ); -void ext_job_set_private_arg(ext_job_type * , const char * , const char * ); - -void ext_job_set_argc(ext_job_type * , const char ** , int); -void ext_job_python_fprintf(const ext_job_type * , FILE * , const subst_list_type *); -ext_job_type * ext_job_fscanf_alloc(const char * , const char * , bool private_job , const char *, bool search_path); -const stringlist_type * ext_job_get_arglist( const ext_job_type * ext_job ); -bool ext_job_is_shared( const ext_job_type * ext_job ); -bool ext_job_is_private( const ext_job_type * ext_job ); - -void ext_job_set_executable(ext_job_type * ext_job, const char * executable_abs, const char * executable_input, bool search_path); -const char * ext_job_get_executable(const ext_job_type * ext_job); - - - -void ext_job_set_config_file(ext_job_type * ext_job, const char * config_file); -const char * ext_job_get_config_file(const ext_job_type * ext_job); -void ext_job_set_target_file(ext_job_type * ext_job, const char * target_file); -const char * ext_job_get_target_file(const ext_job_type * ext_job); -void ext_job_set_start_file(ext_job_type * ext_job, const char * start_file); -const char * ext_job_get_start_file(const ext_job_type * ext_job); -void ext_job_set_name(ext_job_type * ext_job, const char * name); -const char * ext_job_get_name(const ext_job_type * ext_job); -void ext_job_set_lsf_request(ext_job_type * ext_job, const char * lsf_request); -const char * ext_job_get_lsf_request(const ext_job_type * ext_job); -void ext_job_set_stdin_file(ext_job_type * ext_job, const char * stdin_file); -const char * ext_job_get_stdin_file(const ext_job_type * ext_job); -void ext_job_set_stdout_file(ext_job_type * ext_job, const char * stdout_file); -const char * ext_job_get_stdout_file(const ext_job_type * ext_job); -void ext_job_set_stderr_file(ext_job_type * ext_job, const char * stderr_file); -const char * ext_job_get_stderr_file(const ext_job_type * ext_job); -void ext_job_set_max_running( ext_job_type * ext_job , int max_running); -int ext_job_get_max_running( const ext_job_type * ext_job ); -void ext_job_set_max_running_minutes( ext_job_type * ext_job , int max_running_minutes); -int ext_job_get_max_running_minutes( const ext_job_type * ext_job ); -void ext_job_add_environment(ext_job_type *ext_job , const char * key , const char * value); -void ext_job_clear_environment( ext_job_type * ext_job ); -hash_type * ext_job_get_environment( ext_job_type * ext_job ); -int ext_job_set_private_args_from_string( ext_job_type * ext_job , const char * arg_string ); -const char * ext_job_get_private_args_as_string( ext_job_type * ext_job ); -//const char * ext_job_get_arglist_as_string( ext_job_type * ext_job ); -//void ext_job_set_arglist_from_string( ext_job_type * ext_job , const char * argv_string ); - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/ext_joblist.h b/ThirdParty/Ert/libjob_queue/include/ert/job_queue/ext_joblist.h deleted file mode 100644 index eff19d8d6d..0000000000 --- a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/ext_joblist.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'ext_joblist.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_EXT_JOBLIST_H -#define ERT_EXT_JOBLIST_H -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include -#include -#include - -#include - - -typedef struct ext_joblist_struct ext_joblist_type; - -ext_joblist_type * ext_joblist_alloc(); -void ext_joblist_free(ext_joblist_type * ); -void ext_joblist_add_job(ext_joblist_type * joblist , const char * name , ext_job_type * new_job); -ext_job_type * ext_joblist_get_job(const ext_joblist_type * , const char * ); -ext_job_type * ext_joblist_get_job_copy(const ext_joblist_type * , const char * ); -//void ext_joblist_python_fprintf(const ext_joblist_type * , const stringlist_type * , const char * , const subst_list_type *); -bool ext_joblist_has_job(const ext_joblist_type * , const char * ); -stringlist_type * ext_joblist_alloc_list( const ext_joblist_type * joblist); -bool ext_joblist_del_job( ext_joblist_type * joblist , const char * job_name ); -void ext_joblist_add_jobs_in_directory(ext_joblist_type * joblist , const char * path, const char * license_root_path, bool user_mode, bool search_path ); -int ext_joblist_get_size( const ext_joblist_type * joblist ); - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/forward_model.h b/ThirdParty/Ert/libjob_queue/include/ert/job_queue/forward_model.h deleted file mode 100644 index 6068e64cd1..0000000000 --- a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/forward_model.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'forward_model.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_FORWARD_MODEL_H -#define ERT_FORWARD_MODEL_H -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include -#include - -#include - -typedef struct forward_model_struct forward_model_type ; - - - stringlist_type * forward_model_alloc_joblist( const forward_model_type * forward_model ); - const ext_joblist_type * forward_model_get_joblist(const forward_model_type * ); - void forward_model_clear( forward_model_type * forward_model ); - void forward_model_fprintf(const forward_model_type * , FILE * ); - forward_model_type * forward_model_alloc(const ext_joblist_type * ext_joblist); - void forward_model_parse_init(forward_model_type * forward_model , const char * input_string ); - void forward_model_python_fprintf(const forward_model_type * , const char * , const subst_list_type * , mode_t umask); - void forward_model_free( forward_model_type * ); - forward_model_type * forward_model_alloc_copy(const forward_model_type * forward_model); - void forward_model_iset_job_arg( forward_model_type * forward_model , int job_index , const char * arg , const char * value); - ext_job_type * forward_model_iget_job( forward_model_type * forward_model , int index); - int forward_model_get_length( const forward_model_type * forward_model ); - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/job_list.h b/ThirdParty/Ert/libjob_queue/include/ert/job_queue/job_list.h deleted file mode 100644 index 8193e7a50c..0000000000 --- a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/job_list.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright (C) 2015 Statoil ASA, Norway. - - The file 'job_node.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_JOB_LIST_H -#define ERT_JOB_LIST_H - - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include -#include - - -typedef struct job_list_struct job_list_type; - - job_list_type * job_list_alloc(); - void job_list_free( job_list_type * job_list ); - int job_list_get_size( const job_list_type * job_list ); - void job_list_add_job( job_list_type * job_list , job_queue_node_type * job_node ); - job_queue_node_type * job_list_iget_job( const job_list_type * job_list , int queue_index); - void job_list_reset( job_list_type * job_list ); - void job_list_get_wrlock( job_list_type * list); - void job_list_get_rdlock( job_list_type * list); - void job_list_reader_wait( job_list_type * list, int usleep_time1, int usleep_time2); - void job_list_unlock( job_list_type * list); - - UTIL_SAFE_CAST_HEADER( job_list ); - UTIL_IS_INSTANCE_HEADER( job_list ); - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/job_node.h b/ThirdParty/Ert/libjob_queue/include/ert/job_queue/job_node.h deleted file mode 100644 index b657bba84b..0000000000 --- a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/job_node.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - Copyright (C) 2015 Statoil ASA, Norway. - - The file 'job_node.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_JOB_NODE_H -#define ERT_JOB_NODE_H - - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -/** - This struct holds the job_queue information about one job. Observe - the following: - - 1. This struct is purely static - i.e. it is invisible outside of - this file-scope. - - 2. Typically the driver would like to store some additional - information, i.e. the PID of the running process for the local - driver; that is stored in a (driver specific) struct under the - field job_data. - - 3. If the driver detects that a job has failed it leaves an EXIT - file, the exit status is (currently) not reliably transferred - back to to the job_queue layer. - -*/ - -typedef bool (job_callback_ftype) (void *); -typedef struct job_queue_node_struct job_queue_node_type; - - - bool job_queue_node_status_transition( job_queue_node_type * node , job_queue_status_type * status , job_status_type new_status); - bool job_queue_node_status_confirmed_running(job_queue_node_type * node); - submit_status_type job_queue_node_submit( job_queue_node_type * node , job_queue_status_type * status , queue_driver_type * driver); - void job_queue_node_free_error_info( job_queue_node_type * node ); - void job_queue_node_fscanf_EXIT( job_queue_node_type * node ); - void job_queue_node_clear_error_info(job_queue_node_type * node); - void job_queue_node_clear(job_queue_node_type * node); - void job_queue_node_free_data(job_queue_node_type * node); - job_queue_node_type * job_queue_node_alloc( const char * job_name , - const char * run_path , - const char * run_cmd , - int argc , - const char ** argv , - int num_cpu , - const char * ok_file, - const char * status_file, - const char * exit_file, - job_callback_ftype * done_callback, - job_callback_ftype * retry_callback, - job_callback_ftype * exit_callback, - void * callback_arg); - - - job_queue_node_type * job_queue_node_alloc_simple( const char * job_name , - const char * run_path , - const char * run_cmd , - int argc , - const char ** argv ); - - bool job_queue_node_kill( job_queue_node_type * node , job_queue_status_type * status , queue_driver_type * driver); - void job_queue_node_free(job_queue_node_type * node); - job_status_type job_queue_node_get_status(const job_queue_node_type * node); - void job_queue_node_free_driver_data( job_queue_node_type * node , queue_driver_type * driver); - void job_queue_node_restart( job_queue_node_type * node , job_queue_status_type * status); - bool job_queue_node_update_status( job_queue_node_type * node , job_queue_status_type * status , queue_driver_type * driver); - - const char * job_queue_node_get_run_path( const job_queue_node_type * node); - const char * job_queue_node_get_name( const job_queue_node_type * node); - int job_queue_node_get_submit_attempt( const job_queue_node_type * node); - void job_queue_node_reset_submit_attempt( job_queue_node_type * node); - const char * job_queue_node_get_failed_job( const job_queue_node_type * node); - const char * job_queue_node_get_error_reason( const job_queue_node_type * node); - const char * job_queue_node_get_stderr_capture( const job_queue_node_type * node); - const char * job_queue_node_get_stderr_file( const job_queue_node_type * node); - - time_t job_queue_node_get_sim_start( const job_queue_node_type * node ); - time_t job_queue_node_get_sim_end( const job_queue_node_type * node ); - time_t job_queue_node_get_submit_time( const job_queue_node_type * node ); - double job_queue_node_time_since_sim_start( const job_queue_node_type * node ) ; - void job_queue_node_set_max_confirmation_wait_time( job_queue_node_type * node, time_t time ); - - const char * job_queue_node_get_ok_file( const job_queue_node_type * node); - const char * job_queue_node_get_status_file( const job_queue_node_type * node); - const char * job_queue_node_get_exit_file( const job_queue_node_type * node); - - bool job_queue_node_run_DONE_callback( job_queue_node_type * node ); - bool job_queue_node_run_RETRY_callback( job_queue_node_type * node ); - void job_queue_node_run_EXIT_callback( job_queue_node_type * node ); - int job_queue_node_get_queue_index( const job_queue_node_type * node ); - void job_queue_node_set_queue_index( job_queue_node_type * node , int queue_index); - - void * job_queue_node_get_driver_data( job_queue_node_type * node ); - - UTIL_IS_INSTANCE_HEADER( job_queue_node ); - UTIL_SAFE_CAST_HEADER( job_queue_node ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/job_queue.h b/ThirdParty/Ert/libjob_queue/include/ert/job_queue/job_queue.h deleted file mode 100644 index 48d2df4179..0000000000 --- a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/job_queue.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'job_queue.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_JOB_QUEUE_H -#define ERT_JOB_QUEUE_H -#ifdef __cplusplus -extern "C" { -#endif -#include -#include - -#include - -#include -#include - - - typedef struct job_queue_struct job_queue_type; - - - void job_queue_submit_complete( job_queue_type * queue ); - job_driver_type job_queue_get_driver_type( const job_queue_type * queue ); - void job_queue_set_driver(job_queue_type * queue , queue_driver_type * driver); - bool job_queue_has_driver(const job_queue_type * queue ); - //void job_queue_set_size( job_queue_type * job_queue , int size ); - void job_queue_set_runpath_fmt(job_queue_type * , const path_fmt_type * ); - job_queue_type * job_queue_alloc( int , const char * ok_file , const char * status_file, const char * exit_file); - void job_queue_free(job_queue_type *); - - int job_queue_add_job(job_queue_type * , - const char * run_cmd , - job_callback_ftype * done_callback, - job_callback_ftype * retry_callback, - job_callback_ftype * exit_callback, - void * callback_arg , - int num_cpu , - const char * , - const char * , - int argc , - const char ** argv ); - - bool job_queue_accept_jobs(const job_queue_type * queue); - void job_queue_reset(job_queue_type * queue); - void job_queue_run_jobs(job_queue_type * queue, int num_total_run, bool verbose); - void job_queue_run_jobs_threaded(job_queue_type * queue , int num_total_run, bool verbose); - void * job_queue_run_jobs__(void * ); - void job_queue_start_manager_thread( job_queue_type * job_queue , pthread_t * queue_thread , int job_size , bool verbose); - - job_status_type job_queue_iget_job_status(job_queue_type * , int ); - - int job_queue_iget_status_summary( const job_queue_type * queue , job_status_type status); - time_t job_queue_iget_sim_start( job_queue_type * queue, int job_index); - time_t job_queue_iget_sim_end( job_queue_type * queue, int job_index); - time_t job_queue_iget_submit_time( job_queue_type * queue, int job_index); - void job_queue_iset_max_confirm_wait_time( job_queue_type * queue, int job_index, time_t time ); - - void job_queue_set_max_job_duration(job_queue_type * queue, int max_duration_seconds); - int job_queue_get_max_job_duration(const job_queue_type * queue); - void job_queue_set_job_stop_time(job_queue_type * queue, time_t time); - time_t job_queue_get_job_stop_time(const job_queue_type * queue); - void job_queue_set_auto_job_stop_time(job_queue_type * queue); - bool job_queue_kill_job( job_queue_type * queue , int job_index); - bool job_queue_is_running( const job_queue_type * queue ); - void job_queue_set_max_submit( job_queue_type * job_queue , int max_submit ); - int job_queue_get_max_submit(const job_queue_type * job_queue ); - bool job_queue_get_open(const job_queue_type * job_queue); - bool job_queue_get_pause( const job_queue_type * job_queue ); - void job_queue_set_pause_on( job_queue_type * job_queue); - void job_queue_set_pause_off( job_queue_type * job_queue); - bool job_queue_start_user_exit( job_queue_type * queue); - bool job_queue_get_user_exit( const job_queue_type * queue); - void * job_queue_iget_job_data( job_queue_type * job_queue , int job_nr ); - - int job_queue_get_active_size( const job_queue_type * queue ); - int job_queue_get_num_callback( const job_queue_type * queue); - int job_queue_get_num_running( const job_queue_type * queue); - int job_queue_get_num_pending( const job_queue_type * queue); - int job_queue_get_num_waiting( const job_queue_type * queue); - int job_queue_get_num_complete( const job_queue_type * queue); - int job_queue_get_num_failed( const job_queue_type * queue); - int job_queue_get_num_killed( const job_queue_type * queue); - void * job_queue_iget_driver_data( job_queue_type * queue , int job_index); - const char * job_queue_iget_failed_job( job_queue_type * queue , int job_index); - const char * job_queue_iget_error_reason( job_queue_type * queue , int job_index); - const char * job_queue_iget_stderr_capture( job_queue_type * queue , int job_index); - const char * job_queue_iget_stderr_file( job_queue_type * queue , int job_index); - const char * job_queue_iget_run_path( job_queue_type * queue , int job_index); - void job_queue_iset_external_restart(job_queue_type * queue , int job_index); - job_queue_node_type * job_queue_iget_job( job_queue_type * job_queue , int job_nr ); - bool job_queue_has_driver(const job_queue_type * queue ); - job_queue_node_type * job_queue_iget_node(job_queue_type * queue , int job_index); - int job_queue_get_max_running( const job_queue_type * queue ); - - UTIL_SAFE_CAST_HEADER( job_queue ); - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/job_queue_manager.h b/ThirdParty/Ert/libjob_queue/include/ert/job_queue/job_queue_manager.h deleted file mode 100644 index eb2ee80be1..0000000000 --- a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/job_queue_manager.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'job_queue.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_JOB_QUEUE_MANAGER_H -#define ERT_JOB_QUEUE_MANAGER_H -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include - -typedef struct job_queue_manager_struct job_queue_manager_type; - - job_queue_manager_type * job_queue_manager_alloc( job_queue_type * job_queue ); - void job_queue_manager_free( job_queue_manager_type * manager ); - void job_queue_manager_start_queue( job_queue_manager_type * manager , int num_total_run , bool verbose , bool reset_queue); - bool job_queue_manager_try_wait( job_queue_manager_type * manager , int timeout_seconds); - void job_queue_manager_wait( job_queue_manager_type * manager); - int job_queue_manager_get_num_running( const job_queue_manager_type * manager); - int job_queue_manager_get_num_success( const job_queue_manager_type * manager); - int job_queue_manager_get_num_waiting( const job_queue_manager_type * manager); - int job_queue_manager_get_num_failed( const job_queue_manager_type * manager); - bool job_queue_manager_is_running( const job_queue_manager_type * manager); - - bool job_queue_manager_job_success( const job_queue_manager_type * manager , int job_index); - bool job_queue_manager_job_complete( const job_queue_manager_type * manager , int job_index); - bool job_queue_manager_job_waiting( const job_queue_manager_type * manager , int job_index); - bool job_queue_manager_job_running( const job_queue_manager_type * manager , int job_index); - bool job_queue_manager_job_failed( const job_queue_manager_type * manager , int job_index); - - job_status_type job_queue_manager_iget_job_status(const job_queue_manager_type * manager, int job_index); - - UTIL_IS_INSTANCE_HEADER( job_queue_manager ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/job_queue_status.h b/ThirdParty/Ert/libjob_queue/include/ert/job_queue/job_queue_status.h deleted file mode 100644 index f962a58082..0000000000 --- a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/job_queue_status.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2015 Statoil ASA, Norway. - - The file 'job_status_test.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_JOB_QUEUE_STATUS_H -#define ERT_JOB_QUEUE_STATUS_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - - typedef struct job_queue_status_struct job_queue_status_type; - - job_queue_status_type * job_queue_status_alloc(); - void job_queue_status_free( job_queue_status_type * status ); - int job_queue_status_get_count( job_queue_status_type * status , job_status_type status_type); - void job_queue_status_clear( job_queue_status_type * status ); - void job_queue_status_inc( job_queue_status_type * status_count , job_status_type status_type); - bool job_queue_status_transition( job_queue_status_type * status_count , job_status_type src_status , job_status_type target_status); - int job_queue_status_get_total_count( const job_queue_status_type * status ); - - UTIL_IS_INSTANCE_HEADER( job_queue_status ); - UTIL_SAFE_CAST_HEADER( job_queue_status ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/local_driver.h b/ThirdParty/Ert/libjob_queue/include/ert/job_queue/local_driver.h deleted file mode 100644 index ca178097f8..0000000000 --- a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/local_driver.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'local_driver.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_LOCAL_DRIVER_H -#define ERT_LOCAL_DRIVER_H -#ifdef __cplusplus -extern "C" { -#endif - -#include - - typedef struct local_driver_struct local_driver_type; - typedef struct local_job_struct local_job_type; - - - void * local_driver_alloc(); - - - void * local_driver_submit_job(void * __driver , - const char * submit_cmd , - int num_cpu , - const char * run_path , - const char * job_name , - int argc, - const char ** argv ); - void local_driver_kill_job(void * __driver , void * __job); - void local_driver_free__(void * __driver ); - job_status_type local_driver_get_job_status(void * __driver , void * __job); - void local_driver_free_job(void * __job); - void local_driver_init_option_list(stringlist_type * option_list); - - - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/lsb.h b/ThirdParty/Ert/libjob_queue/include/ert/job_queue/lsb.h deleted file mode 100644 index be5d70509e..0000000000 --- a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/lsb.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'lsb.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - -#ifndef ERT_LSB_H -#define ERT_LSB_H - - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include - -#include - - typedef struct lsb_struct lsb_type; - - - lsb_type * lsb_alloc(); - void lsb_free( lsb_type * lsb); - bool lsb_ready( const lsb_type * lsb); - - int lsb_initialize( const lsb_type * lsb); - int lsb_submitjob( const lsb_type * lsb , struct submit * , struct submitReply *); - int lsb_killjob( const lsb_type * lsb , int lsf_jobnr); - int lsb_openjob( const lsb_type * lsb , int lsf_jobnr); - struct jobInfoEnt * lsb_readjob( const lsb_type * lsb ); - int lsb_closejob( const lsb_type * lsb ); - char * lsb_sys_msg( const lsb_type * lsb ); - stringlist_type * lsb_get_error_list( const lsb_type * lsb ); - - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/lsf_driver.h b/ThirdParty/Ert/libjob_queue/include/ert/job_queue/lsf_driver.h deleted file mode 100644 index 6313ab1851..0000000000 --- a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/lsf_driver.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'lsf_driver.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_LSF_DRIVER_H -#define ERT_LSF_DRIVER_H -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include - - -/* - The options supported by the LSF driver. -*/ -#define LSF_QUEUE "LSF_QUEUE" -#define LSF_RESOURCE "LSF_RESOURCE" -#define LSF_SERVER "LSF_SERVER" -#define LSF_RSH_CMD "LSF_RSH_CMD" // This option is set to DEFAULT_RSH_CMD at driver creation. -#define LSF_LOGIN_SHELL "LSF_LOGIN_SHELL" // Not fully implemented yet -#define LSF_BSUB_CMD "BSUB_CMD" -#define LSF_BJOBS_CMD "BJOBS_CMD" -#define LSF_BKILL_CMD "BKILL_CMD" -#define LSF_BHIST_CMD "BHIST_CMD" -#define LSF_BJOBS_TIMEOUT "BJOBS_TIMEOUT" -#define LSF_DEBUG_OUTPUT "DEBUG_OUTPUT" -#define LSF_SUBMIT_SLEEP "SUBMIT_SLEEP" -#define LSF_EXCLUDE_HOST "EXCLUDE_HOST" - -#define LOCAL_LSF_SERVER "LOCAL" -#define NULL_LSF_SERVER "NULL" -#define DEFAULT_SUBMIT_SLEEP "0" - - typedef enum { - LSF_SUBMIT_INVALID = 0, - LSF_SUBMIT_INTERNAL = 1, - LSF_SUBMIT_LOCAL_SHELL = 2, - LSF_SUBMIT_REMOTE_SHELL = 3 - } lsf_submit_method_enum; - - -typedef struct lsf_driver_struct lsf_driver_type; -typedef struct lsf_job_struct lsf_job_type; - - void lsf_job_export_hostnames( const lsf_job_type * job , stringlist_type * hostlist); - void lsf_job_free(lsf_job_type * job); - long lsf_job_get_jobnr( const lsf_job_type * job ); - - void * lsf_driver_alloc( ); - stringlist_type * lsf_driver_alloc_cmd(lsf_driver_type * driver , - const char * run_path , - const char * job_name , - const char * submit_cmd , - int num_cpu , - int job_argc, - const char ** job_argv); - - void * lsf_driver_submit_job(void * __driver , - const char * submit_cmd , - int num_cpu , - const char * run_path , - const char * job_name , - int argc, - const char ** argv ); - job_status_type lsf_driver_convert_status( int lsf_status ); - void lsf_driver_blacklist_node(void * __driver , void * __job ); - void lsf_driver_kill_job(void * __driver , void * __job ); - void lsf_driver_free__(void * __driver ); - void lsf_driver_free( lsf_driver_type * driver ); - job_status_type lsf_driver_get_job_status(void * __driver , void * __job); - int lsf_driver_get_job_status_lsf(void * __driver , void * __job); - void lsf_driver_free_job(void * __job); - void lsf_driver_display_info( void * __driver , void * __job); - void lsf_driver_set_bjobs_refresh_interval( lsf_driver_type * driver , int refresh_interval); - - void lsf_driver_add_exclude_hosts( lsf_driver_type * driver , const char * excluded); - lsf_submit_method_enum lsf_driver_get_submit_method( const lsf_driver_type * driver ); - - bool lsf_driver_has_option( const void * __driver , const char * option_key); - const void * lsf_driver_get_option( const void * __driver , const char * option_key); - bool lsf_driver_set_option( void * __driver , const char * option_key , const void * value); - void lsf_driver_init_option_list(stringlist_type * option_list); - int lsf_job_parse_bsub_stdout(const char * bsub_cmd, const char * stdout_file); - char * lsf_job_write_bjobs_to_file(const char * bjobs_cmd, lsf_driver_type * driver, const long jobid); - - stringlist_type * lsf_job_alloc_parse_hostnames(const char* fname); - UTIL_SAFE_CAST_HEADER( lsf_driver ); - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/lsf_job_stat.h b/ThirdParty/Ert/libjob_queue/include/ert/job_queue/lsf_job_stat.h deleted file mode 100644 index c6c9ed3725..0000000000 --- a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/lsf_job_stat.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'lsf_driver.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifdef HAVE_LSF_LIBRARY -#include -#else -#define JOB_STAT_NULL 0 -#define JOB_STAT_PEND 1 -#define JOB_STAT_SSUSP 0x08 -#define JOB_STAT_USUSP 0x10 -#define JOB_STAT_PSUSP 0x02 -#define JOB_STAT_RUN 0x04 -#define JOB_STAT_EXIT 0x20 -#define JOB_STAT_DONE 0x40 -#define JOB_STAT_PDONE 0x80 -#define JOB_STAT_UNKWN 0x10000 -#endif diff --git a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/queue_driver.h b/ThirdParty/Ert/libjob_queue/include/ert/job_queue/queue_driver.h deleted file mode 100644 index e03c66da68..0000000000 --- a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/queue_driver.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'queue_driver.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. - */ - -#ifndef ERT_QUEUE_DRIVER_H -#define ERT_QUEUE_DRIVER_H -#ifdef __cplusplus -extern "C" { -#endif - -#include - - typedef enum { - NULL_DRIVER = 0, - LSF_DRIVER = 1, - LOCAL_DRIVER = 2, - RSH_DRIVER = 3, - TORQUE_DRIVER = 4 - } job_driver_type; - -#define JOB_DRIVER_ENUM_DEFS \ -{.value = 0 , .name = "NULL_DRIVER"}, \ -{.value = 1 , .name = "LSF_DRIVER"}, \ -{.value = 2 , .name = "LOCAL_DRIVER"}, \ -{.value = 3 , .name = "RSH_DRIVER"}, \ -{.value = 4 , .name = "TORQUE_DRIVER"} - -#define JOB_DRIVER_ENUM_SIZE 5 - - /* - The options supported by the base queue_driver. - */ -#define MAX_RUNNING "MAX_RUNNING" - - - typedef enum { - JOB_QUEUE_NOT_ACTIVE = 1, /* This value is used in external query routines - for jobs which are (currently) not active. */ - //JOB_QUEUE_LOADING = 2, /* This value is used by external routines. Not used in the libjob_queue implementation. */ - JOB_QUEUE_WAITING = 4, /* A node which is waiting in the internal queue. */ - JOB_QUEUE_SUBMITTED = 8, /* Internal status: It has has been submitted - the next status update will (should) place it as pending or running. */ - JOB_QUEUE_PENDING = 16, /* A node which is pending - a status returned by the external system. I.e LSF */ - JOB_QUEUE_RUNNING = 32, /* The job is running */ - JOB_QUEUE_DONE = 64, /* The job is done - but we have not yet checked if the target file is produced */ - JOB_QUEUE_EXIT = 128, /* The job has exited - check attempts to determine if we retry or go to complete_fail */ - //JOB_QUEUE_RUN_OK = 256, /* The job has completed - and all checks performed by the queue layer indicate success. */ - //JOB_QUEUE_RUN_FAIL = 512, /* The job has completed - but the queue system has detected that it has failed. */ - //JOB_QUEUE_ALL_OK = 1024, /* The job has loaded OK - observe that it is the calling scope which will set the status to this. */ - //JOB_QUEUE_ALL_FAIL = 2048, /* The job has failed completely - the calling scope must set this status. */ - JOB_QUEUE_IS_KILLED = 4096, /* The job has been killed, following a JOB_QUEUE_DO_KILL*/ - JOB_QUEUE_DO_KILL = 8192, /* The the job should be killed, either due to user request, or automated measures - the job can NOT be restarted. */ - JOB_QUEUE_SUCCESS = 16384, - JOB_QUEUE_RUNNING_CALLBACK = 32768, - JOB_QUEUE_FAILED = 65536, - JOB_QUEUE_DO_KILL_NODE_FAILURE = 131072, /* LSF will attempt to blacklist the nodes that failed this job */ - JOB_QUEUE_STATUS_FAILURE = 262144 /* The command to get job_status has failed - let the status remain unchanged. */ - } job_status_type; - -#define JOB_QUEUE_MAX_STATE 14 - - /* - All jobs which are in the status set defined by - JOB_QUEUE_CAN_RESTART can be restarted based on external - user-input. It is OK to try to restart a job which is not in this - state - basically nothing should happen. - */ -#define JOB_QUEUE_CAN_RESTART (JOB_QUEUE_FAILED + JOB_QUEUE_IS_KILLED + JOB_QUEUE_SUCCESS) - - - /* - These are the jobs which can be killed. It is OK to try to kill a - job which is not in this state, the only thing happening is that the - function job_queue_kill_simulation() wil return false. - */ -#define JOB_QUEUE_CAN_KILL (JOB_QUEUE_WAITING + JOB_QUEUE_RUNNING + JOB_QUEUE_PENDING + JOB_QUEUE_SUBMITTED + JOB_QUEUE_DO_KILL + JOB_QUEUE_DO_KILL_NODE_FAILURE) - -#define JOB_QUEUE_WAITING_STATUS (JOB_QUEUE_WAITING + JOB_QUEUE_PENDING) - -#define JOB_QUEUE_CAN_UPDATE_STATUS (JOB_QUEUE_RUNNING + JOB_QUEUE_PENDING + JOB_QUEUE_SUBMITTED) - -#define JOB_QUEUE_COMPLETE_STATUS (JOB_QUEUE_IS_KILLED + JOB_QUEUE_SUCCESS + JOB_QUEUE_FAILED) - - - typedef struct queue_driver_struct queue_driver_type; - - typedef void * (submit_job_ftype) (void * data, const char * cmd, int num_cpu, const char * run_path, const char * job_name, int argc, const char ** argv); - typedef void (blacklist_node_ftype) (void *, void *); - typedef void (kill_job_ftype) (void *, void *); - typedef job_status_type(get_status_ftype) (void *, void *); - typedef void (free_job_ftype) (void *); - typedef void (free_queue_driver_ftype) (void *); - typedef bool (set_option_ftype) (void *, const char*, const void *); - typedef const void * (get_option_ftype) (const void *, const char *); - typedef bool (has_option_ftype) (const void *, const char *); - typedef void (init_option_list_ftype) (stringlist_type *); - - - queue_driver_type * queue_driver_alloc_RSH(const char * rsh_cmd, const hash_type * rsh_hostlist); - queue_driver_type * queue_driver_alloc_LSF(const char * queue_name, const char * resource_request, const char * remote_lsf_server); - queue_driver_type * queue_driver_alloc_TORQUE(); - queue_driver_type * queue_driver_alloc_local(); - queue_driver_type * queue_driver_alloc(job_driver_type type); - - void * queue_driver_submit_job(queue_driver_type * driver, const char * run_cmd, int num_cpu, const char * run_path, const char * job_name, int argc, const char ** argv); - void queue_driver_free_job(queue_driver_type * driver, void * job_data); - void queue_driver_blacklist_node(queue_driver_type * driver, void * job_data); - void queue_driver_kill_job(queue_driver_type * driver, void * job_data); - job_status_type queue_driver_get_status(queue_driver_type * driver, void * job_data); - - const char * queue_driver_get_name(const queue_driver_type * driver); - - bool queue_driver_set_option(queue_driver_type * driver, const char * option_key, const void * value); - const void * queue_driver_get_option(queue_driver_type * driver, const char * option_key); - void queue_driver_init_option_list(queue_driver_type * driver, stringlist_type * option_list); - - void queue_driver_free(queue_driver_type * driver); - void queue_driver_free__(void * driver); - const char * queue_driver_type_enum_iget(int index, int * value); - - typedef enum {SUBMIT_OK = 0 , - SUBMIT_JOB_FAIL = 1 , /* Typically no more attempts. */ - SUBMIT_DRIVER_FAIL = 2 , /* The driver would not take the job - for whatever reason?? */ - SUBMIT_QUEUE_CLOSED = 3 } /* The queue is currently not accepting more jobs - either (temporarilty) - because of pause or it is going down. */ submit_status_type; - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/rsh_driver.h b/ThirdParty/Ert/libjob_queue/include/ert/job_queue/rsh_driver.h deleted file mode 100644 index 2f9f7d9669..0000000000 --- a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/rsh_driver.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rsh_driver.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_RSH_DRIVER_H -#define ERT_RSH_DRIVER_H -#ifdef __cplusplus -extern "C" { -#endif -#include - -#define RSH_HOST "RSH_HOST" -#define RSH_HOSTLIST "RSH_HOSTLIST" -#define RSH_CMD "RSH_CMD" -#define RSH_CLEAR_HOSTLIST "RSH_CLEAR_HOSTLIST" - - typedef struct rsh_driver_struct rsh_driver_type; - typedef struct rsh_job_struct rsh_job_type; - - void rsh_driver_add_host(rsh_driver_type * , const char * , int ); - void * rsh_driver_alloc( ); - - void * rsh_driver_submit_job(void * __driver , - const char * submit_cmd , - int num_cpu , - const char * run_path , - const char * job_name , - int argc, - const char ** argv ); - void rsh_driver_kill_job(void * __driver , void * __job); - void rsh_driver_free__(void * __driver ); - job_status_type rsh_driver_get_job_status(void * __driver , void * __job); - void rsh_driver_free_job(void * __job); - - - bool rsh_driver_set_option( void * __driver, const char * option_key , const void * value ); - const void * rsh_driver_get_option( const void * __driver , const char * option_key); - void rsh_driver_init_option_list(stringlist_type * option_list); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/torque_driver.h b/ThirdParty/Ert/libjob_queue/include/ert/job_queue/torque_driver.h deleted file mode 100644 index e18c7df8e5..0000000000 --- a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/torque_driver.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'torque_driver.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. - */ -#ifndef TORQUE_DRIVER_H -#define TORQUE_DRIVER_H - -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include -#include - - /* - The options supported by the Torque driver. - */ -#define TORQUE_QSUB_CMD "QSUB_CMD" -#define TORQUE_QSTAT_CMD "QSTAT_CMD" -#define TORQUE_QDEL_CMD "QDEL_CMD" -#define TORQUE_QUEUE "QUEUE" -#define TORQUE_NUM_CPUS_PER_NODE "NUM_CPUS_PER_NODE" -#define TORQUE_NUM_NODES "NUM_NODES" -#define TORQUE_KEEP_QSUB_OUTPUT "KEEP_QSUB_OUTPUT" -#define TORQUE_CLUSTER_LABEL "CLUSTER_LABEL" -#define TORQUE_JOB_PREFIX_KEY "JOB_PREFIX" -#define TORQUE_SUBMIT_SLEEP "SUBMIT_SLEEP" -#define TORQUE_DEBUG_OUTPUT "DEBUG_OUTPUT" - -#define TORQUE_DEFAULT_QSUB_CMD "qsub" -#define TORQUE_DEFAULT_QSTAT_CMD "qstat" -#define TORQUE_DEFAULT_QDEL_CMD "qdel" -#define TORQUE_DEFAULT_SUBMIT_SLEEP "0" - - - typedef struct torque_driver_struct torque_driver_type; - typedef struct torque_job_struct torque_job_type; - - - void * torque_driver_alloc(); - - - void * torque_driver_submit_job(void * __driver, - const char * submit_cmd, - int num_cpu, - const char * run_path, - const char * job_name, - int argc, - const char ** argv); - - void torque_driver_kill_job(void * __driver, void * __job); - void torque_driver_free__(void * __driver); - void torque_driver_free(torque_driver_type * driver); - job_status_type torque_driver_get_job_status(void * __driver, void * __job); - void torque_driver_free_job(void * __job); - void torque_driver_set_qstat_refresh_interval(torque_driver_type * driver, int refresh_interval); - - const void * torque_driver_get_option(const void * __driver, const char * option_key); - bool torque_driver_set_option(void * __driver, const char * option_key, const void * value); - void torque_driver_init_option_list(stringlist_type * option_list); - - void torque_job_create_submit_script(const char * run_path, const char * submit_cmd, int argc, const char ** job_argv); - int torque_driver_get_submit_sleep( const torque_driver_type * driver ); - FILE * torque_driver_get_debug_stream( const torque_driver_type * driver ); - - - UTIL_SAFE_CAST_HEADER(torque_driver); - -#ifdef __cplusplus -} -#endif - -#endif /* TORQUE_DRIVER_H */ - diff --git a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/workflow.h b/ThirdParty/Ert/libjob_queue/include/ert/job_queue/workflow.h deleted file mode 100644 index f6b3f7eb98..0000000000 --- a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/workflow.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'workflow.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_WORKFLOW_H -#define ERT_WORKFLOW_H - - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include - -#include -#include - - typedef struct workflow_struct workflow_type; - - const config_error_type * workflow_get_last_error( const workflow_type * workflow); - workflow_type * workflow_alloc( const char * src_file , workflow_joblist_type * joblist); - bool workflow_run( workflow_type * workflow, void * self , bool verbose , const subst_list_type * context); - void workflow_free( workflow_type * workflow ); - void workflow_free__( void * arg ); - - int workflow_get_stack_size( const workflow_type * workflow ); - void * workflow_iget_stack_ptr( const workflow_type * workflow , int index); - void * workflow_pop_stack( workflow_type * workflow ); - - int workflow_size( const workflow_type * workflow); - const workflow_job_type * workflow_iget_job( const workflow_type * workflow, int index); - stringlist_type * workflow_iget_arguments( const workflow_type * workflow, int index); - bool workflow_try_compile( workflow_type * script , const subst_list_type * context); - UTIL_IS_INSTANCE_HEADER( workflow ); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/workflow_job.h b/ThirdParty/Ert/libjob_queue/include/ert/job_queue/workflow_job.h deleted file mode 100644 index 6168beb2d0..0000000000 --- a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/workflow_job.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'workflow_job.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_WORKFLOW_JOB_H -#define ERT_WORKFLOW_JOB_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - - - typedef void * (workflow_job_ftype) (void * self , const stringlist_type * arg ); - typedef struct workflow_job_struct workflow_job_type; - - const char * workflow_job_get_name( const workflow_job_type * workflow_job ); - bool workflow_job_internal( const workflow_job_type * workflow_job ); - config_parser_type * workflow_job_alloc_config(); - workflow_job_type * workflow_job_alloc(const char * name , bool internal); - void workflow_job_free( workflow_job_type * workflow_job ); - void workflow_job_free__( void * arg); - void workflow_job_set_executable( workflow_job_type * workflow_job , const char * executable ); - workflow_job_type * workflow_job_config_alloc( const char * name , config_parser_type * config , const char * config_file); - - void workflow_job_update_config_compiler( const workflow_job_type * workflow_job , config_parser_type * config_compiler ); - void workflow_job_set_executable( workflow_job_type * workflow_job , const char * executable); - char * workflow_job_get_executable( workflow_job_type * workflow_job); - - void workflow_job_set_internal_script( workflow_job_type * workflow_job , const char * script_path); - char* workflow_job_get_internal_script_path( const workflow_job_type * workflow_job); - bool workflow_job_is_internal_script( const workflow_job_type * workflow_job); - - void workflow_job_set_function( workflow_job_type * workflow_job , const char * function); - char * workflow_job_get_function( workflow_job_type * workflow_job); - void workflow_job_set_module( workflow_job_type * workflow_job , const char * module); - char * workflow_job_get_module( workflow_job_type * workflow_job); - void * workflow_job_run( const workflow_job_type * job, void * self , bool verbose , const stringlist_type * arg); - - int workflow_job_get_min_arg( const workflow_job_type * workflow_job ); - int workflow_job_get_max_arg( const workflow_job_type * workflow_job ); - config_item_types workflow_job_iget_argtype( const workflow_job_type * workflow_job, int index); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/workflow_joblist.h b/ThirdParty/Ert/libjob_queue/include/ert/job_queue/workflow_joblist.h deleted file mode 100644 index e8d37af18e..0000000000 --- a/ThirdParty/Ert/libjob_queue/include/ert/job_queue/workflow_joblist.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'workflow_joblist.h' is part of ERT - Ensemble based - Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - - - -#ifndef ERT_WORKFLOW_JOBLIST_H -#define ERT_WORKFLOW_JOBLIST_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -typedef struct workflow_joblist_struct workflow_joblist_type; - - workflow_joblist_type * workflow_joblist_alloc(); - void workflow_joblist_free( workflow_joblist_type * joblist); - const workflow_job_type * workflow_joblist_get_job( const workflow_joblist_type * joblist , const char * job_name); - void workflow_joblist_add_job( workflow_joblist_type * joblist , const workflow_job_type * job); - bool workflow_joblist_add_job_from_file( workflow_joblist_type * joblist , const char * job_name , const char * config_file ); - config_parser_type * workflow_joblist_get_compiler( const workflow_joblist_type * joblist ); - config_parser_type * workflow_joblist_get_job_config( const workflow_joblist_type * joblist ); - bool workflow_joblist_has_job( const workflow_joblist_type * joblist , const char * job_name); - stringlist_type * workflow_joblist_get_job_names(const workflow_joblist_type * joblist); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libjob_queue/src/CMakeLists.txt b/ThirdParty/Ert/libjob_queue/src/CMakeLists.txt deleted file mode 100644 index 4332edbc83..0000000000 --- a/ThirdParty/Ert/libjob_queue/src/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -#configure_file (${CMAKE_CURRENT_SOURCE_DIR}/CMake/include/libjob_queue_build_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/libjob_queue_build_config.h) - - -set(source_files job_queue_status.c forward_model.c queue_driver.c job_queue.c job_node.c job_list.c local_driver.c rsh_driver.c torque_driver.c ext_job.c ext_joblist.c workflow_job.c workflow.c workflow_joblist.c job_queue_manager.c) -set(header_files job_queue.h queue_driver.h local_driver.h job_node.h job_list.h rsh_driver.h torque_driver.h ext_job.h ext_joblist.h forward_model.h workflow_job.h workflow.h workflow_joblist.h job_queue_manager.h) -set_property(SOURCE rsh_driver.c PROPERTY COMPILE_FLAGS "-Wno-error") - -list( APPEND source_files lsf_driver.c) -list( APPEND header_files lsf_driver.h) - -if (HAVE_LSF_LIBRARY) - list( APPEND source_files lsb.c) - list( APPEND header_files lsb.h) -endif() - -add_library( job_queue SHARED ${source_files} ) -set_target_properties( job_queue PROPERTIES VERSION ${ERT_VERSION_MAJOR}.${ERT_VERSION_MINOR} SOVERSION ${ERT_VERSION_MAJOR} ) -target_link_libraries( job_queue config ert_util ) -if (USE_RUNPATH) - add_runpath( job_queue ) -endif() - -target_link_libraries( job_queue dl ) - -if (INSTALL_ERT) - install(TARGETS job_queue DESTINATION ${CMAKE_INSTALL_LIBDIR}) - foreach(header ${header_files}) - install(FILES ../include/ert/job_queue/${header} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/ert/job_queue) - endforeach() -endif() diff --git a/ThirdParty/Ert/libjob_queue/src/ext_job.c b/ThirdParty/Ert/libjob_queue/src/ext_job.c deleted file mode 100644 index 29772ffcb1..0000000000 --- a/ThirdParty/Ert/libjob_queue/src/ext_job.c +++ /dev/null @@ -1,985 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'ext_job.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -/* - About arguments - --------------- - How a job is run is defined in terms of the following variables: - - o stdout_file / stdin_file / stderr_file - o arglist - o .... - - These variables will then contain string values from when the job - configuration is read in, for example this little job - - STDOUT my_stdout - STDERR my_stderr - ARGLIST my_job_input my_job_output - - stdout & stderr are redirected to the files 'my_stdout' and - 'my_stderr' respectively, and when invoked with an exec() call the - job is given the argumentlist: - - my_job_input my_job_output - - This implies that _every_time_ this job is invoked the argumentlist - will be identical; that is clearly quite limiting! To solve this we - have the possibility of performing string substitutions on the - strings in the job defintion prior to executing the job, this is - handled with the privat_args substitutions. The definition for a - copy-file job: - - - EXECUTABLE /bin/cp - ARGLIST - - - This can then be invoked several times, with different key=value - arguments for the SRC_FILE and TARGET_FILE: - - - COPY_FILE(SRC_FILE = file1 , TARGET_FILE = /tmp/file1) - COPY_FILE(SRC_FILE = file2 , TARGET_FILE = /tmp/file2) - -*/ - - - -/* - - -jobList = [ - {"executable" : None, - "environment" : {"LM_LICENSE_PATH" : "1700@osl001lic.hda.hydro.com:1700@osl002lic.hda.hydro.com:1700@osl003lic.hda.hydro.com", - "F_UFMTENDIAN" : "big"}, - "target_file":"222", - "argList" : [], - "stdout" : "eclipse.stdout", - "stderr" : "eclipse.stdout", - "stdin" : "eclipse.stdin"}] -*/ - - -#define EXT_JOB_TYPE_ID 763012 - - -struct ext_job_struct { - UTIL_TYPE_ID_DECLARATION; - char * name; - char * executable; - char * target_file; - char * error_file; /* Job has failed if this is present. */ - char * start_file; /* Will not start if not this file is present */ - char * stdout_file; - char * stdin_file; - char * stderr_file; - char * license_path; /* If this is NULL - it will be unrestricted ... */ - char * license_root_path; - char * config_file; - int max_running; /* 0 means unlimited. */ - int max_running_minutes; /* The maximum number of minutes this job is allowed to run - 0: unlimited. */ - subst_list_type * private_args; /* A substitution list of input arguments which is performed before the external substitutions - - these are the arguments supplied as key=value pairs in the forward model call. */ - char * private_args_string; - char * argv_string; - stringlist_type * argv; /* This should *NOT* start with the executable */ - hash_type * environment; - hash_type * default_mapping; - char * help_text; - - bool private_job; /* Can the current user/delete this job? (private_job == true) means the user can edit it. */ - bool __valid; /* Temporary variable consulted during the bootstrap - when the ext_job is completely initialized this should NOT be consulted anymore. */ -}; - - -static UTIL_SAFE_CAST_FUNCTION( ext_job , EXT_JOB_TYPE_ID) - - - - - - - -static ext_job_type * ext_job_alloc__(const char * name , const char * license_root_path , bool private_job) { - ext_job_type * ext_job = util_malloc(sizeof * ext_job ); - - UTIL_TYPE_ID_INIT( ext_job , EXT_JOB_TYPE_ID); - ext_job->name = util_alloc_string_copy( name ); - ext_job->license_root_path = util_alloc_string_copy( license_root_path ); - ext_job->executable = NULL; - ext_job->stdout_file = NULL; - ext_job->target_file = NULL; - ext_job->error_file = NULL; - ext_job->start_file = NULL; - ext_job->stdin_file = NULL; - ext_job->stderr_file = NULL; - ext_job->environment = hash_alloc(); - ext_job->default_mapping = hash_alloc(); - ext_job->argv = stringlist_alloc_new(); - ext_job->argv_string = NULL; - ext_job->__valid = true; - ext_job->license_path = NULL; - ext_job->config_file = NULL; - ext_job->max_running = 0; /* 0 means unlimited. */ - ext_job->max_running_minutes = 0; /* 0 means unlimited. */ - ext_job->private_job = private_job; /* If private_job == true the job is user editable. */ - ext_job->help_text = NULL; - ext_job->private_args_string = NULL; - - /* - ext_job->private_args is set explicitly in the ext_job_alloc() - and ext_job_alloc_copy() functions. - */ - return ext_job; -} - - -const char * ext_job_get_help_text( const ext_job_type * job ) { - if (job->help_text != NULL) - return job->help_text; - else - return "No help text installed for this job."; -} - - -void ext_job_set_help_text( ext_job_type * job , const char * help_text) { - job->help_text = util_realloc_string_copy( job->help_text , help_text ); -} - -/* - Exported function - must have name != NULL. Observe that the - instance returned from this function is not really usable for - anything. - - Should probably define a minium set of parameters which must be set - before the job is in a valid initialized state. -*/ - -ext_job_type * ext_job_alloc(const char * name , const char * license_root_path , bool private_job) { - ext_job_type * ext_job = ext_job_alloc__(name , license_root_path , private_job); - ext_job->private_args = subst_list_alloc( NULL ); - return ext_job; -} - - - - -ext_job_type * ext_job_alloc_copy(const ext_job_type * src_job) { - ext_job_type * new_job = ext_job_alloc__( src_job->name , src_job->license_root_path , true /* All copies are by default private jobs. */); - - new_job->config_file = util_alloc_string_copy(src_job->config_file); - new_job->executable = util_alloc_string_copy(src_job->executable); - new_job->target_file = util_alloc_string_copy(src_job->target_file); - new_job->error_file = util_alloc_string_copy(src_job->error_file); - new_job->start_file = util_alloc_string_copy(src_job->start_file); - new_job->stdout_file = util_alloc_string_copy(src_job->stdout_file); - new_job->stdin_file = util_alloc_string_copy(src_job->stdin_file); - new_job->stderr_file = util_alloc_string_copy(src_job->stderr_file); - new_job->license_path = util_alloc_string_copy(src_job->license_path); - - ext_job_set_help_text( new_job , src_job->help_text ); - - new_job->max_running_minutes = src_job->max_running_minutes; - new_job->max_running = src_job->max_running; - new_job->private_args = subst_list_alloc_deep_copy( src_job->private_args ); - - /* Copying over all the keys in the environment hash table */ - { - hash_iter_type * iter = hash_iter_alloc( src_job->environment ); - const char * key = hash_iter_get_next_key(iter); - while (key != NULL) { - char * value = hash_get( src_job->environment , key); - hash_insert_hash_owned_ref( new_job->environment , key , util_alloc_string_copy(value) , free); - key = hash_iter_get_next_key(iter); - } - hash_iter_free(iter); - } - - - /* The default mapping. */ - { - hash_iter_type * iter = hash_iter_alloc( src_job->default_mapping ); - const char * key = hash_iter_get_next_key(iter); - while (key != NULL) { - char * value = hash_get( src_job->default_mapping , key); - hash_insert_hash_owned_ref( new_job->default_mapping , key , util_alloc_string_copy(value) , free); - key = hash_iter_get_next_key(iter); - } - hash_iter_free(iter); - } - - - - stringlist_deep_copy( new_job->argv , src_job->argv ); - - return new_job; -} - - - - -void ext_job_free(ext_job_type * ext_job) { - free(ext_job->name); - util_safe_free(ext_job->executable); - util_safe_free(ext_job->stdout_file); - util_safe_free(ext_job->stdin_file); - util_safe_free(ext_job->target_file); - util_safe_free(ext_job->error_file); - util_safe_free(ext_job->stderr_file); - util_safe_free(ext_job->license_path); - util_safe_free(ext_job->license_root_path); - util_safe_free(ext_job->config_file); - util_safe_free(ext_job->argv_string); - util_safe_free(ext_job->help_text); - util_safe_free(ext_job->private_args_string); - - hash_free( ext_job->default_mapping); - hash_free( ext_job->environment ); - stringlist_free(ext_job->argv); - subst_list_free( ext_job->private_args ); - free(ext_job); -} - -void ext_job_free__(void * __ext_job) { - ext_job_free ( ext_job_safe_cast(__ext_job) ); -} - - -static void __update_mode( const char * filename , mode_t add_mode) { - util_addmode_if_owner( filename , add_mode); -} - - -/** - The license_path = - - root_license_path / job_name / job_name - -*/ - -static void ext_job_init_license_control(ext_job_type * ext_job) { - if (ext_job->license_path == NULL) { - ext_job->license_path = util_alloc_sprintf("%s%c%s" , ext_job->license_root_path , UTIL_PATH_SEP_CHAR , ext_job->name ); - util_make_path( ext_job->license_path ); - printf("License for %s in %s \n",ext_job->name , ext_job->license_path); - } -} - - - -void ext_job_set_max_time( ext_job_type * ext_job , int max_time ) { - ext_job->max_running_minutes = max_time; -} - - - -/** - @executable parameter: - The raw executable is either - - an absolute path read directly from config - - an absolute path constructed from the relative path from config - with the assumption that the path was a relative path from the - location of the job description file to the executable. - - @executable_raw parameter: - The raw executable as read from config, unprocessed. - - This method have the following logic: - - @executable exists: - We store the full path as the executable field of the job; and - try to update the mode of the full_path executable to make sure it - is executable. - - @executable does not exist, but @executable_raw exists: - We have found an executable relative to the current working - directory. This is deprecated behaviour, support will later be - removed. Suggest new path to executable to user, relative to job - description file and do a recursive call to this method, using - the absolute path as @executable parameter - - @executable does not exist, @executable_raw does not exist and - is an absolute path: - Write error message - - @executable does not exist, @executable_raw does not exist and - is a relative path: - Search trough the PATH variable to try to locate the executable. - If found, do a recursive call to this method, using the absolute path - as @executable parameter - -*/ - -void ext_job_set_executable(ext_job_type * ext_job, const char * executable_abs, const char * executable_input,bool search_path) { - - if (util_file_exists(executable_abs)) { - /* - The @executable parameter points to an existing file; we store - the full path as the executable field of the job; we also try - to update the mode of the full_path executable to make sure it - is executable. - */ - char * full_path = util_alloc_realpath( executable_abs ); - __update_mode( full_path , S_IRUSR + S_IWUSR + S_IXUSR + S_IRGRP + S_IWGRP + S_IXGRP + S_IROTH + S_IXOTH); /* u:rwx g:rwx o:rx */ - ext_job->executable = util_realloc_string_copy(ext_job->executable , full_path); - free( full_path ); - } else if (util_file_exists(executable_input)) { - /* - This "if" case means that we have found an executable relative - to the current working directory. This is deprecated behaviour, - support will be removed - */ - char * full_path = util_alloc_abs_path(executable_input); - const char * job_description_file = ext_job_get_config_file(ext_job); - char * path_to_job_descr_file = util_split_alloc_dirname(job_description_file); - char * new_relative_path_to_exe = util_alloc_rel_path(path_to_job_descr_file, full_path); - char * relative_config_file = util_alloc_rel_path(NULL , ext_job->config_file); - - fprintf(stderr,"/----------------------------------------------------------------\n"); - fprintf(stderr,"| ** WARNING ** \n"); - fprintf(stderr,"|\n"); - fprintf(stderr,"| The convention for locating the executable in a forward model \n"); - fprintf(stderr,"| job has changed. When using a relative path in the EXECUTABLE \n"); - fprintf(stderr,"| setting in the job description file, the path will be interpreted\n"); - fprintf(stderr,"| relative to the location of the job description file. \n"); - fprintf(stderr,"|\n"); - fprintf(stderr,"| The job:\'%s\' will temporarilty continue to work in the \n",ext_job->name); - fprintf(stderr,"| present form, but it is recommended to update: \n"); - fprintf(stderr,"|\n"); - fprintf(stderr,"| 1. Open the file:%s in an editor \n",relative_config_file); - fprintf(stderr,"|\n"); - fprintf(stderr,"| 2. Change the EXECUTABLE line to: \n"); - fprintf(stderr,"|\n"); - fprintf(stderr,"| EXECUTABLE %s \n" , new_relative_path_to_exe); - fprintf(stderr,"|\n"); - fprintf(stderr,"| The main advantage with this change in behaviour is that the\n"); - fprintf(stderr,"| job description file and the executable can be relocated.\n"); - fprintf(stderr,"\\----------------------------------------------------------------\n\n"); - - ext_job_set_executable(ext_job, full_path, NULL, search_path); - - free(new_relative_path_to_exe); - free(path_to_job_descr_file); - free(full_path); - free(relative_config_file); - - } else if (util_is_abs_path( executable_input )) { - /* If you have given an absolute path (i.e. starting with '/' to - a non existing job we mark it as invalid - no possibility to - provide context replacement afterwards. The job will be - discarded by the calling scope. - */ - fprintf(stderr , "** Warning: the executable:%s can not be found,\n" - " job:%s will not be available.\n" , executable_abs , ext_job->name ); - ext_job->__valid = false; - } else { - if (search_path){ - /* Go through the PATH variable to try to locate the executable. */ - char * path_executable = util_alloc_PATH_executable( executable_input ); - - if (path_executable != NULL) { - ext_job_set_executable( ext_job , path_executable, NULL, search_path ); - free( path_executable ); - } else { - /* We take the chance that user will supply a valid subst key for this later; - if the final executable is not an actually executable file when exporting the - job from ext_job_python_fprintf() a big warning will be written on stderr. - */ - fprintf(stderr , "** Warning: Unable to locate the executable %s for job %s.\n" - " Path to executable must be relative to the job description file, or an absolute path.\n" - " Please update job EXECUTABLE for job %s. \n" , executable_abs , ext_job->name, ext_job->name); - ext_job->__valid = false; - } - } else { - ext_job->executable = util_realloc_string_copy(ext_job->executable , executable_input); - } - } - - /* - If in the end we do not have execute rights to the executable : - discard the job. - */ - if (ext_job->executable != NULL) { - if (util_file_exists(executable_abs)) { - if (!util_is_executable( ext_job->executable )) { - fprintf(stderr , "** You do not have execute rights to:%s - job will not be available.\n" , ext_job->executable); - ext_job->__valid = false; /* Mark the job as NOT successfully installed - the ext_job - instance will later be freed and discarded. */ - } - } - } -} - - - -/** - Observe that this does NOT reread the ext_job instance from the new - config_file. -*/ - - -/*****************************************************************/ -/* Scalar set and get functions */ - -void ext_job_set_config_file(ext_job_type * ext_job, const char * config_file) { - ext_job->config_file = util_realloc_string_copy(ext_job->config_file , config_file); -} - -const char * ext_job_get_config_file(const ext_job_type * ext_job) { - return ext_job->config_file; -} - -void ext_job_set_target_file(ext_job_type * ext_job, const char * target_file) { - ext_job->target_file = util_realloc_string_copy(ext_job->target_file , target_file); -} - -const char * ext_job_get_target_file(const ext_job_type * ext_job) { - return ext_job->target_file; -} - -void ext_job_set_error_file(ext_job_type * ext_job, const char * error_file) { - ext_job->error_file = util_realloc_string_copy(ext_job->error_file , error_file); -} - -const char * ext_job_get_error_file(const ext_job_type * ext_job) { - return ext_job->error_file; -} - -const char * ext_job_get_executable(const ext_job_type * ext_job) { - return ext_job->executable; -} - -void ext_job_set_start_file(ext_job_type * ext_job, const char * start_file) { - ext_job->start_file = util_realloc_string_copy(ext_job->start_file , start_file); -} - -const char * ext_job_get_start_file(const ext_job_type * ext_job) { - return ext_job->start_file; -} - -void ext_job_set_name(ext_job_type * ext_job, const char * name) { - ext_job->name = util_realloc_string_copy(ext_job->name , name); -} - -const char * ext_job_get_name(const ext_job_type * ext_job) { - return ext_job->name; -} -void ext_job_set_stdin_file(ext_job_type * ext_job, const char * stdin_file) { - ext_job->stdin_file = util_realloc_string_copy(ext_job->stdin_file , stdin_file); -} - -const char * ext_job_get_stdin_file(const ext_job_type * ext_job) { - return ext_job->stdin_file; -} - -void ext_job_set_stdout_file(ext_job_type * ext_job, const char * stdout_file) { - ext_job->stdout_file = util_realloc_string_copy(ext_job->stdout_file , stdout_file); -} - -const char * ext_job_get_stdout_file(const ext_job_type * ext_job) { - return ext_job->stdout_file; -} - -void ext_job_set_stderr_file(ext_job_type * ext_job, const char * stderr_file) { - ext_job->stderr_file = util_realloc_string_copy(ext_job->stderr_file , stderr_file); -} - -const char * ext_job_get_stderr_file(const ext_job_type * ext_job) { - return ext_job->stderr_file; -} - -void ext_job_set_max_running( ext_job_type * ext_job , int max_running) { - ext_job->max_running = max_running; - if (max_running > 0) - ext_job_init_license_control( ext_job ); -} - -int ext_job_get_max_running( const ext_job_type * ext_job ) { - return ext_job->max_running; -} - -void ext_job_set_max_running_minutes( ext_job_type * ext_job , int max_running_minutes) { - ext_job->max_running_minutes = max_running_minutes; -} - -int ext_job_get_max_running_minutes( const ext_job_type * ext_job ) { - return ext_job->max_running_minutes; -} - -/*****************************************************************/ - -void ext_job_set_private_arg(ext_job_type * ext_job, const char * key , const char * value) { - subst_list_append_copy( ext_job->private_args , key , value , NULL); -} - -void ext_job_add_environment(ext_job_type *ext_job , const char * key , const char * value) { - hash_insert_hash_owned_ref( ext_job->environment , key , util_alloc_string_copy( value ) , free); -} - - -void ext_job_clear_environment( ext_job_type * ext_job ) { - hash_clear( ext_job->environment ); -} - -hash_type * ext_job_get_environment( ext_job_type * ext_job ) { - return ext_job->environment; -} - - -/*****************************************************************/ - - -static char * __alloc_filtered_string( const char * src_string , const subst_list_type * private_args, const subst_list_type * global_args) { - char * tmp1 = subst_list_alloc_filtered_string( private_args , src_string ); /* internal filtering first */ - char * tmp2; - - if (global_args != NULL) { - tmp2 = subst_list_alloc_filtered_string( global_args , tmp1 ); /* Global filtering. */ - free( tmp1 ); - } else - tmp2 = tmp1; - - return tmp2; - -} - -static void __fprintf_string(FILE * stream , const char * s , const subst_list_type * private_args, const subst_list_type * global_args) { - char * filtered_string = __alloc_filtered_string(s , private_args , global_args ); - fprintf(stream , "\"%s\"" , filtered_string ); - free( filtered_string ); -} - - -static void __fprintf_python_string(FILE * stream , const char * id , const char * value, const subst_list_type * private_args, const subst_list_type * global_args) { - fprintf(stream , "\"%s\" : " , id); - if (value == NULL) - fprintf(stream,"None"); - else - __fprintf_string(stream , value , private_args , global_args); -} - - -static void __fprintf_init_python_list( FILE * stream , const char * id ) { - fprintf(stream , "\"%s\" : " , id); - fprintf(stream,"["); -} - -static void __fprintf_close_python_list( FILE * stream ) { - fprintf(stream,"]"); -} - - - - - -static void __fprintf_python_hash(FILE * stream , const char * id , hash_type * hash, const subst_list_type * private_args, const subst_list_type * global_args) { - fprintf(stream , "\"%s\" : " , id); - int hash_size = hash_get_size(hash); - if (hash_size > 0) { - int counter = 0; - fprintf(stream,"{"); - hash_iter_type * iter = hash_iter_alloc(hash); - const char * key = hash_iter_get_next_key(iter); - while (key != NULL) { - const char * value = hash_get(hash , key); - - fprintf(stream,"\"%s\" : " , key); - __fprintf_string(stream , value , private_args , global_args); - - if (counter < (hash_size - 1)) - fprintf(stream,","); - - key = hash_iter_get_next_key(iter); - } - fprintf(stream,"}"); - } else - fprintf(stream , "None"); -} - - -static void __fprintf_python_int( FILE * stream , const char * key , int value) { - if (value > 0) - fprintf(stream , "\"%s\" : %d" , key , value); - else - fprintf(stream , "\"%s\" : None" , key); -} - - -static void __end_line(FILE * stream) { - fprintf(stream,",\n"); -} - - -static void __indent(FILE * stream, int indent) { - int i; - for (i = 0; i < indent; i++) - fprintf(stream," "); -} - - -/* - This is special cased to support the default mapping. -*/ - -static void ext_job_fprintf_python_argList( const ext_job_type * ext_job , FILE * stream , const subst_list_type * global_args) { - __fprintf_init_python_list( stream , "argList" ); - { - for (int index = 0; index < stringlist_get_size( ext_job->argv ); index++) { - const char * src_string = stringlist_iget( ext_job->argv , index ); - char * filtered_string = __alloc_filtered_string(src_string , ext_job->private_args , global_args ); - if (hash_has_key( ext_job->default_mapping , filtered_string )) - filtered_string = util_realloc_string_copy( filtered_string , hash_get( ext_job->default_mapping , filtered_string )); - - fprintf(stream , "\"%s\"" , filtered_string ); - if (index < (stringlist_get_size( ext_job->argv) - 1)) - fprintf(stream , "," ); - - free( filtered_string ); - } - } - __fprintf_close_python_list( stream ); -} - - - -void ext_job_python_fprintf(const ext_job_type * ext_job, FILE * stream, const subst_list_type * global_args) { - fprintf(stream," {"); - { - __indent(stream, 0); __fprintf_python_string(stream , "name" , ext_job->name , ext_job->private_args , NULL); __end_line(stream); - __indent(stream, 2); __fprintf_python_string(stream , "executable" , ext_job->executable , ext_job->private_args, global_args); __end_line(stream); - __indent(stream, 2); __fprintf_python_string(stream , "target_file" , ext_job->target_file , ext_job->private_args, global_args); __end_line(stream); - __indent(stream, 2); __fprintf_python_string(stream , "error_file" , ext_job->error_file , ext_job->private_args, global_args); __end_line(stream); - __indent(stream, 2); __fprintf_python_string(stream , "start_file" , ext_job->start_file , ext_job->private_args, global_args); __end_line(stream); - __indent(stream, 2); __fprintf_python_string(stream , "stdout" , ext_job->stdout_file , ext_job->private_args, global_args); __end_line(stream); - __indent(stream, 2); __fprintf_python_string(stream , "stderr" , ext_job->stderr_file , ext_job->private_args, global_args); __end_line(stream); - __indent(stream, 2); __fprintf_python_string(stream , "stdin" , ext_job->stdin_file , ext_job->private_args, global_args); __end_line(stream); - __indent(stream, 2); ext_job_fprintf_python_argList(ext_job , stream , global_args); __end_line(stream); - __indent(stream, 2); __fprintf_python_hash(stream , "environment" , ext_job->environment , ext_job->private_args, global_args); __end_line(stream); - __indent(stream, 2); __fprintf_python_string(stream , "license_path" , ext_job->license_path , ext_job->private_args, global_args); __end_line(stream); - __indent(stream, 2); __fprintf_python_int( stream , "max_running_minutes" , ext_job->max_running_minutes ); __end_line(stream); - __indent(stream, 2); __fprintf_python_int( stream , "max_running" , ext_job->max_running ); __end_line(stream); - } - fprintf(stream,"}"); -} - - -#define PRINT_KEY_STRING( stream , key , value ) \ -if (value != NULL) \ -{ \ - fprintf(stream , "%16s ", key); \ - fprintf(stream , "%s\n" , value); \ -} - - -#define PRINT_KEY_INT( stream , key , value ) \ -if (value != 0) \ -{ \ - fprintf(stream , "%16s ", key); \ - fprintf(stream , "%d\n" , value); \ -} - - -/** - Observe that the job will save itself to the internalized - config_file; if you wish to save to some other place you must call - ext_job_set_config_file() first. -*/ - -void ext_job_save( const ext_job_type * ext_job ) { - FILE * stream = util_mkdir_fopen( ext_job->config_file , "w" ); - - PRINT_KEY_STRING( stream , "EXECUTABLE" , ext_job->executable); - PRINT_KEY_STRING( stream , "STDIN" , ext_job->stdin_file); - PRINT_KEY_STRING( stream , "STDERR" , ext_job->stderr_file); - PRINT_KEY_STRING( stream , "STDOUT" , ext_job->stdout_file); - PRINT_KEY_STRING( stream , "TARGET_FILE" , ext_job->target_file); - PRINT_KEY_STRING( stream , "START_FILE" , ext_job->start_file); - PRINT_KEY_STRING( stream , "ERROR_FILE" , ext_job->error_file); - PRINT_KEY_INT( stream , "MAX_RUNNING" , ext_job->max_running); - PRINT_KEY_INT( stream , "MAX_RUNNING_MINUTES" , ext_job->max_running_minutes); - - if (stringlist_get_size( ext_job->argv ) > 0) { - fprintf(stream , "%16s" , "ARGLIST"); - stringlist_fprintf( ext_job->argv , " " , stream ); - fprintf(stream , "\n"); - } - if (hash_get_size( ext_job->environment ) > 0) { - hash_iter_type * hash_iter = hash_iter_alloc( ext_job->environment ); - while (!hash_iter_is_complete( hash_iter )) { - const char * key = hash_iter_get_next_key( hash_iter ); - fprintf(stream, "%16s %16s %s\n" , "ENV" , key , (const char *) hash_get( ext_job->environment , key )); - } - hash_iter_free( hash_iter ); - } - fclose( stream ); -} - -#undef PRINT_KEY_STRING -#undef PRINT_KEY_INT - - - -void ext_job_fprintf(const ext_job_type * ext_job , FILE * stream) { - fprintf(stream , "%s", ext_job->name); - if (subst_list_get_size( ext_job->private_args ) > 0) { - fprintf(stream , "("); - subst_list_fprintf(ext_job->private_args , stream); - fprintf(stream , ")"); - } - fprintf(stream , " "); -} - - -/** - The format variable @fmt should contain two '%s' placeholders - - one for the job name, and one for the job description file. -*/ - -void ext_job_fprintf_config(const ext_job_type * ext_job , const char * fmt , FILE * stream) { - fprintf(stream , fmt , ext_job->name , ext_job->config_file ); -} - - - - - - -ext_job_type * ext_job_fscanf_alloc(const char * name , const char * license_root_path , bool private_job , const char * config_file, bool search_path) { - { - mode_t target_mode = S_IRUSR + S_IWUSR + S_IRGRP + S_IWGRP + S_IROTH; /* u+rw g+rw o+r */ - __update_mode( config_file , target_mode ); - } - - if (util_entry_readable( config_file)) { - ext_job_type * ext_job = NULL; - config_parser_type * config = config_alloc( ); - - { - config_schema_item_type * item; - item = config_add_schema_item(config , "MAX_RUNNING" , false ); config_schema_item_set_argc_minmax(item , 1 , 1 ); config_schema_item_iset_type( item , 0 , CONFIG_INT ); - item = config_add_schema_item(config , "STDIN" , false ); config_schema_item_set_argc_minmax(item , 1 , 1 ); - item = config_add_schema_item(config , "STDOUT" , false ); config_schema_item_set_argc_minmax(item , 1 , 1 ); - item = config_add_schema_item(config , "STDERR" , false ); config_schema_item_set_argc_minmax(item , 1 , 1 ); - item = config_add_schema_item(config , "EXECUTABLE" , true ); config_schema_item_set_argc_minmax(item , 1 , 1 ); config_schema_item_iset_type(item, 0, CONFIG_PATH); - item = config_add_schema_item(config , "TARGET_FILE" , false ); config_schema_item_set_argc_minmax(item , 1 , 1 ); - item = config_add_schema_item(config , "ERROR_FILE" , false ); config_schema_item_set_argc_minmax(item , 1 , 1 ); - item = config_add_schema_item(config , "START_FILE" , false ); config_schema_item_set_argc_minmax(item , 1 , 1 ); - item = config_add_schema_item(config , "ENV" , false ); config_schema_item_set_argc_minmax(item , 2 , 2 ); - item = config_add_schema_item(config , "DEFAULT" , false ); config_schema_item_set_argc_minmax(item , 2 , 2 ); - item = config_add_schema_item(config , "ARGLIST" , false ); config_schema_item_set_argc_minmax(item , 1 , CONFIG_DEFAULT_ARG_MAX ); - item = config_add_schema_item(config , "MAX_RUNNING_MINUTES" , false ); config_schema_item_set_argc_minmax(item , 1 , 1 ); config_schema_item_iset_type( item , 0 , CONFIG_INT ); - } - config_add_alias(config , "EXECUTABLE" , "PORTABLE_EXE"); - - { - config_content_type * content = config_parse(config , config_file , "--" , NULL , NULL , NULL , CONFIG_UNRECOGNIZED_WARN , true); - if (config_content_is_valid( content )) { - ext_job = ext_job_alloc(name , license_root_path , private_job); - ext_job_set_config_file( ext_job , config_file ); - - - if (config_content_has_item(content , "STDIN")) ext_job_set_stdin_file(ext_job , config_content_iget(content , "STDIN" , 0,0)); - if (config_content_has_item(content , "STDOUT")) ext_job_set_stdout_file(ext_job , config_content_iget(content , "STDOUT" , 0,0)); - if (config_content_has_item(content , "STDERR")) ext_job_set_stderr_file(ext_job , config_content_iget(content , "STDERR" , 0,0)); - if (config_content_has_item(content , "ERROR_FILE")) ext_job_set_error_file(ext_job , config_content_iget(content , "ERROR_FILE" , 0,0)); - if (config_content_has_item(content , "TARGET_FILE")) ext_job_set_target_file(ext_job , config_content_iget(content , "TARGET_FILE" , 0,0)); - if (config_content_has_item(content , "START_FILE")) ext_job_set_start_file(ext_job , config_content_iget(content , "START_FILE" , 0,0)); - if (config_content_has_item(content , "MAX_RUNNING")) ext_job_set_max_running(ext_job , config_content_iget_as_int(content , "MAX_RUNNING" , 0,0)); - if (config_content_has_item(content , "MAX_RUNNING_MINUTES")) ext_job_set_max_time(ext_job , config_content_iget_as_int(content , "MAX_RUNNING_MINUTES" , 0,0)); - - - { - const char * executable = config_content_get_value_as_abspath(content , "EXECUTABLE"); - const char * executable_raw = config_content_iget(content , "EXECUTABLE" , 0,0); - ext_job_set_executable(ext_job , executable, executable_raw, search_path); - } - - - { - if (config_content_has_item( content , "ARGLIST")) { - config_content_node_type * arg_node = config_content_get_value_node( content , "ARGLIST"); - int i; - for (i=0; i < config_content_node_get_size( arg_node ); i++) - stringlist_append_copy( ext_job->argv , config_content_node_iget( arg_node , i )); - } - } - - - /** - The code assumes that the hash tables are valid, can not be NULL: - */ - { - if (config_content_has_item( content , "ENV")) { - const config_content_item_type * env_item = config_content_get_item( content , "ENV" ); - for (int ivar = 0; ivar < config_content_item_get_size( env_item ); ivar++) { - const config_content_node_type * env_node = config_content_item_iget_node( env_item , ivar ); - for (int i=0; i < config_content_node_get_size( env_node ); i+= 2) { - const char * key = config_content_node_iget( env_node , i ); - const char * value = config_content_node_iget( env_node , i + 1); - hash_insert_hash_owned_ref( ext_job->environment, key , util_alloc_string_copy( value ) , free); - } - } - } - } - - /* Default mappings; these are used to set values in the argList - which have not been supplied by the calling context. */ - { - if (config_content_has_item( content , "DEFAULT")) { - const config_content_item_type * default_item = config_content_get_item( content , "DEFAULT"); - for (int ivar = 0; ivar < config_content_item_get_size( default_item ); ivar++) { - const config_content_node_type * default_node = config_content_item_iget_node( default_item , ivar ); - for (int i=0; i < config_content_node_get_size( default_node ); i+= 2) { - const char * key = config_content_node_iget( default_node , i ); - const char * value = config_content_node_iget( default_node , i + 1); - hash_insert_hash_owned_ref( ext_job->default_mapping, key , util_alloc_string_copy( value ) , free); - } - } - } - } - - if (!ext_job->__valid) { - /* - Something NOT OK (i.e. EXECUTABLE now); free the job instance and return NULL: - */ - ext_job_free( ext_job ); - ext_job = NULL; - fprintf(stderr,"** Warning: job: \'%s\' not available ... \n", name ); - } - } else { - config_error_type * error = config_content_get_errors( content ); - config_error_fprintf( error , true , stderr ); - fprintf(stderr,"** Warning: job: \'%s\' not available ... \n", name ); - } - config_content_free( content ); - } - config_free(config); - - return ext_job; - } else { - fprintf(stderr,"** Warning: you do not have permission to read file:\'%s\' - job:%s not available. \n", config_file , name); - return NULL; - } -} - - -const stringlist_type * ext_job_get_arglist( const ext_job_type * ext_job ) { - return ext_job->argv; -} - - -/** - -*/ - -//const char * ext_job_get_arglist_as_string( ext_job_type * ext_job ) { -// if (stringlist_get_size( ext_job->argv ) == 0) -// return NULL; -// else { -// const char * sep = " "; -// int argc = stringlist_get_size( ext_job->argv ); -// int i; -// buffer_type * buffer = buffer_alloc( 512 ); -// for (i = 0; i < argc; i++) { -// const char * arg = stringlist_iget( ext_job->argv , i ); -// bool quote = false; -// if (strchr(arg , ' ') != NULL) -// quote = true; -// -// if (quote) -// buffer_fwrite_char( buffer , ' ' ); -// buffer_fwrite_char_ptr( buffer , arg ); -// if (quote) -// buffer_fwrite_char( buffer , ' ' ); -// -// if (i < (argc - 1)) -// buffer_fwrite_char_ptr( buffer , sep ); -// -// buffer_fwrite_char( buffer , '\0'); -// util_safe_free(ext_job->argv_string); -// ext_job->argv_string = buffer_alloc_data_copy( buffer ); -// buffer_free( buffer ); -// -// return ext_job->argv_string; -// } -//} -// -// -//void ext_job_set_arglist_from_string( ext_job_type * ext_job , const char * argv_string ) { -// parser_type * parser = parser_alloc(" " , "\"" , NULL , NULL , NULL , NULL ); -// stringlist_free( ext_job->argv ); -// ext_job->argv = parser_tokenize_buffer( parser , argv_string , true ); -// parser_free( parser ); -//} - - -const char * ext_job_get_private_args_as_string( ext_job_type * ext_job ) { - util_safe_free( ext_job->private_args_string ); - ext_job->private_args_string = subst_list_alloc_string_representation( ext_job->private_args ); - return ext_job->private_args_string; -} - - -/** - Set the internal arguments of the job based on an input string - @arg_string which is of the form: - - key1=value1, key2=value2 , key3=value3 - - The internal private argument list is cleared before adding these - arguments. -*/ - -int ext_job_set_private_args_from_string( ext_job_type * ext_job , const char * arg_string ) { - subst_list_clear( ext_job->private_args ); - return subst_list_add_from_string( ext_job->private_args , arg_string , true ); -} - - - -bool ext_job_is_shared( const ext_job_type * ext_job ) { - return !ext_job->private_job; -} - -bool ext_job_is_private( const ext_job_type * ext_job ) { - return ext_job->private_job; -} - - -#undef ASSERT_TOKENS diff --git a/ThirdParty/Ert/libjob_queue/src/ext_joblist.c b/ThirdParty/Ert/libjob_queue/src/ext_joblist.c deleted file mode 100644 index c55343c302..0000000000 --- a/ThirdParty/Ert/libjob_queue/src/ext_joblist.c +++ /dev/null @@ -1,186 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'ext_joblist.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - - -//#define MODULE_NAME "jobs.py" -//#define JOBLIST_NAME "jobList" - - -/** - About the 'license' system: - --------------------------- - - There is a simple possibility to limit the number of jobs which are - running in parallell. It works like this: - - 1. For the joblist as a whole a license_path is created. This - license path should contain both a uid and pid of the current - process. This ensures that: - - a. The license count is per user and per ert instance. - b. Each ert instance starts with a fresh license count. A - license path, and license files left dangling after unclean - shutdown can just be removed. - - 2. For each job in the joblist a subdirectory is created under the - license_path. - - 3. For each job a license_file is created, and for each time a new - instance is checked out a hard_link to this license_file is - created - i.e. the number of checked out licenses is a - hard_link count (-1). - - Step three here is implemented by the job_dispatch script - actually running the jobs. - - It is essential that the license_root_path is on a volume which is - accessible from all the nodes which will run jobs. Using e.g. /tmp - as license_root_path will fail HARD. - -*/ - - - -/*****************************************************************/ - -struct ext_joblist_struct { - hash_type * jobs; -}; - - - - -ext_joblist_type * ext_joblist_alloc( ) { - ext_joblist_type * joblist = util_malloc( sizeof * joblist ); - joblist->jobs = hash_alloc(); - return joblist; -} - - -void ext_joblist_free(ext_joblist_type * joblist) { - hash_free(joblist->jobs); - free(joblist); -} - - -void ext_joblist_add_job(ext_joblist_type * joblist , const char * name , ext_job_type * new_job) { - hash_insert_hash_owned_ref(joblist->jobs , name , new_job , ext_job_free__); -} - - -ext_job_type * ext_joblist_get_job(const ext_joblist_type * joblist , const char * job_name) { - if (hash_has_key(joblist->jobs , job_name)) - return hash_get(joblist->jobs , job_name); - else { - util_abort("%s: asked for job:%s which does not exist\n",__func__ , job_name); - return NULL; - } -} - - -ext_job_type * ext_joblist_get_job_copy(const ext_joblist_type * joblist , const char * job_name) { - if (hash_has_key(joblist->jobs , job_name)) - return ext_job_alloc_copy(hash_get(joblist->jobs , job_name)); - else { - util_abort("%s: asked for job:%s which does not exist\n",__func__ , job_name); - return NULL; - } -} - - -bool ext_joblist_has_job(const ext_joblist_type * joblist , const char * job_name) { - return hash_has_key(joblist->jobs , job_name); -} - - -stringlist_type * ext_joblist_alloc_list( const ext_joblist_type * joblist) { - return hash_alloc_stringlist( joblist->jobs ); -} - - -/** - Will attempt to remove the job @job_name from the joblist; if the - job is marked as a shared_job (i.e. installed centrally) the user - is not allowed to delete it. In this case the function will fail - silently. - - Returns true if the job is actually removed, and false otherwise. -*/ - -bool ext_joblist_del_job( ext_joblist_type * joblist , const char * job_name ) { - ext_job_type * job = ext_joblist_get_job( joblist , job_name ); - if (!ext_job_is_shared( job )) { - hash_del( joblist->jobs , job_name ); - return true; - } else - return false; -} - - -hash_type * ext_joblist_get_jobs( const ext_joblist_type * joblist ) { - return joblist->jobs; -} - -void ext_joblist_add_jobs_in_directory(ext_joblist_type * joblist , const char * path, const char * license_root_path, bool user_mode, bool search_path ) { - DIR * dirH = opendir( path ); - if (dirH) { - while (true) { - struct dirent * entry = readdir( dirH ); - if (entry != NULL) { - if ((strcmp(entry->d_name , ".") != 0) && (strcmp(entry->d_name , "..") != 0)) { - char * full_path = util_alloc_filename( path , entry->d_name , NULL ); - if (util_is_file( full_path )) { - ext_job_type * new_job = ext_job_fscanf_alloc(entry->d_name, license_root_path, user_mode, full_path, search_path); - if (new_job != NULL) { - ext_joblist_add_job(joblist, entry->d_name, new_job); - } - else{ - fprintf(stderr," Failed to add forward model job: %s \n",full_path); - } - } - free( full_path ); - } - } else - break; - } - closedir( dirH ); - } else - fprintf(stderr, "** Warning: failed to open jobs directory: %s\n", path); -} - - -int ext_joblist_get_size( const ext_joblist_type * joblist ) { - return hash_get_size( joblist->jobs ); -} - diff --git a/ThirdParty/Ert/libjob_queue/src/forward_model.c b/ThirdParty/Ert/libjob_queue/src/forward_model.c deleted file mode 100644 index 6dc51f14d4..0000000000 --- a/ThirdParty/Ert/libjob_queue/src/forward_model.c +++ /dev/null @@ -1,259 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'forward_model.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - - -/** - This file implements a 'forward-model' object. I -*/ - -struct forward_model_struct { - vector_type * jobs; /* The actual jobs in this forward model. */ - const ext_joblist_type * ext_joblist; /* This is the list of external jobs which have been installed - which we can choose from. */ -}; - -#define DEFAULT_JOB_MODULE "jobs.py" -#define DEFAULT_JOBLIST_NAME "jobList" - - - - -forward_model_type * forward_model_alloc(const ext_joblist_type * ext_joblist) { - forward_model_type * forward_model = util_malloc( sizeof * forward_model ); - - forward_model->jobs = vector_alloc_new(); - forward_model->ext_joblist = ext_joblist; - - return forward_model; -} - - -/** - Allocates and returns a stringlist with all the names in the - current forward_model. -*/ -stringlist_type * forward_model_alloc_joblist( const forward_model_type * forward_model ) { - stringlist_type * names = stringlist_alloc_new( ); - int i; - for (i=0; i < vector_get_size( forward_model->jobs ); i++) { - const ext_job_type * job = vector_iget_const( forward_model->jobs , i); - stringlist_append_ref( names , ext_job_get_name( job )); - } - - return names; -} - - -/** - This function adds the job named 'job_name' to the forward model. The return - value is the newly created ext_job instance. This can be used to set private - arguments for this job. -*/ - -ext_job_type * forward_model_add_job(forward_model_type * forward_model , const char * job_name) { - ext_job_type * new_job = ext_joblist_get_job_copy(forward_model->ext_joblist , job_name); - vector_append_owned_ref( forward_model->jobs , new_job , ext_job_free__); - return new_job; -} - - - -/** - This function is used to set private argument values to jobs in the - forward model (i.e. the argument values passed in with KEY=VALUE - pairs in the defining (). - - The use of 'index' to get the job is unfortunate , however one - forward model can contain several instances of the same job, it is - therefor not possible to use name based lookup. -*/ - -void forward_model_iset_job_arg( forward_model_type * forward_model , int job_index , const char * arg , const char * value) { - ext_job_type * job = vector_iget( forward_model->jobs , job_index ); - ext_job_set_private_arg(job , arg , value); -} - - -void forward_model_clear( forward_model_type * forward_model ) { - vector_clear( forward_model->jobs ); -} - - - -void forward_model_free( forward_model_type * forward_model) { - vector_free( forward_model->jobs ); - free(forward_model); -} - - - - -/** - this function takes an input string of the type: - - job1 job2 job3(arg1 = value1, arg2 = value2, arg3= value3) - - and creates a forward model of it. observe the following rules: - - * if the function takes private arguments it is not allowed with space - between the end of the function name and the opening parenthesis. - -*/ - - -void forward_model_parse_init(forward_model_type * forward_model , const char * input_string ) { - //tokenizer_type * tokenizer_alloc(" " , "\'\"" , ",=()" , null , null , null); - //stringlist_type * tokens = tokenizer_buffer( tokenizer , input_string , true); - //stringlist_free( tokens ); - //tokenizer_free( tokenizer ); - - char * p1 = (char *) input_string; - while (true) { - ext_job_type * current_job; - char * job_name; - int job_index; - { - int job_length = strcspn(p1 , " ("); /* scanning until we meet ' ' or '(' */ - job_name = util_alloc_substring_copy(p1 , 0 , job_length); - p1 += job_length; - } - job_index = vector_get_size( forward_model->jobs ); - current_job = forward_model_add_job(forward_model , job_name); - - if (*p1 == '(') { /* the function has arguments. */ - int arg_length = strcspn(p1 , ")"); - if (arg_length == strlen(p1)) - util_abort("%s: paranthesis not terminated for job:%s \n",__func__ , job_name); - { - char * arg_string = util_alloc_substring_copy((p1 + 1) , 0 , arg_length - 1); - ext_job_set_private_args_from_string( current_job , arg_string ); - p1 += (1 + arg_length); - free( arg_string ); - } - } - /*****************************************************************/ - /* At this point we are done with the parsing - the rest of the - code in this while { } construct is only to check that the - input is well formed. */ - - { - int space_length = strspn(p1 , " "); - p1 += space_length; - if (*p1 == '(') - /* detected lonesome '(' */ - util_abort("%s: found space between job:%s and \'(\' - aborting \n",__func__ , job_name); - } - - /* - now p1 should point at the next character after the job, - or after the ')' if the job has arguments. - */ - - free(job_name); - if (*p1 == '\0') /* we have parsed the whole string. */ - break; - - } -} - - - -/*****************************************************************/ - -/* - the name of the pyton module - and the variable in the module, - used when running the remote jobs. -*/ - -void forward_model_python_fprintf(const forward_model_type * forward_model , - const char * path, - const subst_list_type * global_args, - mode_t umask) { - char * module_file = util_alloc_filename(path , DEFAULT_JOB_MODULE , NULL); - FILE * stream = util_fopen(module_file , "w"); - int i; - - fprintf(stream , "%s = [" , DEFAULT_JOBLIST_NAME); - for (i=0; i < vector_get_size(forward_model->jobs); i++) { - const ext_job_type * job = vector_iget_const(forward_model->jobs , i); - ext_job_python_fprintf(job , stream , global_args); - if (i < (vector_get_size( forward_model->jobs ) - 1)) - fprintf(stream,",\n"); - } - fprintf(stream , "]\n"); - fprintf(stream, "umask = %04o\n", umask); - fclose(stream); - free(module_file); -} - -#undef DEFAULT_JOB_MODULE -#undef DEFAULT_JOBLIST_NAME - - - - -forward_model_type * forward_model_alloc_copy(const forward_model_type * forward_model) { - int ijob; - forward_model_type * new; - - new = forward_model_alloc(forward_model->ext_joblist ); - for (ijob = 0; ijob < vector_get_size(forward_model->jobs); ijob++) { - const ext_job_type * job = vector_iget_const( forward_model->jobs , ijob); - vector_append_owned_ref( new->jobs , ext_job_alloc_copy( job ) , ext_job_free__); - } - - return new; -} - -ext_job_type * forward_model_iget_job( forward_model_type * forward_model , int index) { - return vector_iget( forward_model->jobs , index ); -} - - - -void forward_model_fprintf(const forward_model_type * forward_model , FILE * stream) { - int ijob; - fprintf(stream , " "); - for (ijob = 0; ijob < vector_get_size(forward_model->jobs); ijob++) { - ext_job_fprintf( vector_iget(forward_model->jobs , ijob) , stream); - fprintf(stream , " "); - } - fprintf(stream , "\n"); -} - - -const ext_joblist_type * forward_model_get_joblist(const forward_model_type * forward_model) { - return forward_model->ext_joblist; -} - -int forward_model_get_length( const forward_model_type * forward_model ) { - return vector_get_size( forward_model->jobs ); -} diff --git a/ThirdParty/Ert/libjob_queue/src/job_list.c b/ThirdParty/Ert/libjob_queue/src/job_list.c deleted file mode 100644 index 0c8b1b4fab..0000000000 --- a/ThirdParty/Ert/libjob_queue/src/job_list.c +++ /dev/null @@ -1,150 +0,0 @@ -/* - Copyright (C) 2015 Statoil ASA, Norway. - - The file 'job_list.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#define _GNU_SOURCE /* Must define this to get access to pthread_rwlock_t */ -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - - -#define JOB_LIST_TYPE_ID 8154222 - -struct job_list_struct { - UTIL_TYPE_ID_DECLARATION; - int active_size; - int alloc_size; - job_queue_node_type ** jobs; - pthread_rwlock_t lock; -}; - - -UTIL_IS_INSTANCE_FUNCTION( job_list , JOB_LIST_TYPE_ID ) -UTIL_SAFE_CAST_FUNCTION( job_list , JOB_LIST_TYPE_ID ) - -job_list_type * job_list_alloc() { - job_list_type * job_list = util_malloc( sizeof * job_list ); - UTIL_TYPE_ID_INIT( job_list , JOB_LIST_TYPE_ID ); - job_list->active_size = 0; - job_list->alloc_size = 0; - job_list->jobs = NULL; - pthread_rwlock_init( &job_list->lock , NULL); - return job_list; -} - - -void job_list_reset( job_list_type * job_list ) { - int queue_index; - for (queue_index = 0; queue_index < job_list->active_size; queue_index++) { - job_queue_node_type * node = job_list_iget_job( job_list , queue_index ); - job_queue_node_free( node ); - job_list->jobs[queue_index] = NULL; - } - job_list->active_size = 0; -} - - -int job_list_get_size( const job_list_type * job_list ) { - return job_list->active_size; -} - - -/* - This takes ownership to the job node instance. -*/ -void job_list_add_job( job_list_type * job_list , job_queue_node_type * job_node ) { - if (job_list->alloc_size == job_list->active_size) { - -#ifdef QUEUE_DEBUG - int new_alloc_size = job_list->alloc_size + 1; - job_queue_node_type ** new_jobs = util_malloc( sizeof * new_jobs * new_alloc_size ); - memcpy( new_jobs , job_list->jobs , sizeof * new_jobs * job_list->active_size ); - free( job_list->jobs ); - job_list->jobs = new_jobs; -#else - int new_alloc_size = util_int_max( 16 , job_list->alloc_size * 2); - job_list->jobs = util_realloc( job_list->jobs , sizeof * job_list->jobs * new_alloc_size ); -#endif - - job_list->alloc_size = new_alloc_size; - } - - { - int queue_index = job_list_get_size( job_list ); - job_queue_node_set_queue_index(job_node, queue_index ); - job_list->jobs[queue_index] = job_node; - } - job_list->active_size++; - -} - - -job_queue_node_type * job_list_iget_job( const job_list_type * job_list , int queue_index) { - if (queue_index >= 0 && queue_index < job_list->active_size) - return job_list->jobs[queue_index]; - else { - util_abort("%s: invalid queue_index:%d Valid range: [0,%d) \n",__func__ , queue_index , queue_index); - return NULL; - } -} - - -void job_list_free( job_list_type * job_list ) { - if (job_list->alloc_size > 0) { - job_list_reset( job_list ); - free( job_list->jobs ); - } - free( job_list ); -} - - - -void job_list_get_wrlock( job_list_type * list) { - pthread_rwlock_wrlock( &list->lock ); -} - -void job_list_get_rdlock( job_list_type * list) { - pthread_rwlock_rdlock( &list->lock ); -} - - -void job_list_unlock( job_list_type * list) { - pthread_rwlock_unlock( &list->lock ); -} - - -void job_list_reader_wait( job_list_type * list, int usleep_time1, int usleep_time2) { - if (pthread_rwlock_tryrdlock( &list->lock ) == 0) { - // Seems to be no writers waiting - take a short sleep and return. - pthread_rwlock_unlock( &list->lock ); - usleep( usleep_time1 ); - } else - // A writer already has the lock - let more writers get access; sleep longer. - usleep( usleep_time2 ); - -} diff --git a/ThirdParty/Ert/libjob_queue/src/job_node.c b/ThirdParty/Ert/libjob_queue/src/job_node.c deleted file mode 100644 index ab9312d2cf..0000000000 --- a/ThirdParty/Ert/libjob_queue/src/job_node.c +++ /dev/null @@ -1,626 +0,0 @@ -/* - Copyright (C) 2015 Statoil ASA, Norway. - - The file 'job_node.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#define _GNU_SOURCE /* Must define this to get access to pthread_rwlock_t */ -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#define JOB_QUEUE_NODE_TYPE_ID 3315299 -#define INVALID_QUEUE_INDEX -999 - -struct job_queue_node_struct { - UTIL_TYPE_ID_DECLARATION; - int num_cpu; /* How many cpu's will this job need - the driver is free to ignore if not relevant. */ - char *run_cmd; /* The path to the actual executable. */ - char *exit_file; /* The queue will look for the occurence of this file to detect a failure. */ - char *ok_file; /* The queue will look for this file to verify that the job was OK - can be NULL - in which case it is ignored. */ - char *status_file; /* The queue will look for this file to verify that the job is running or has run. */ - char *job_name; /* The name of the job. */ - char *run_path; /* Where the job is run - absolute path. */ - job_callback_ftype *done_callback; - job_callback_ftype *retry_callback; /* To determine if job can be retried */ - job_callback_ftype *exit_callback; /* Callback to perform any cleanup */ - void *callback_arg; - int argc; /* The number of commandline arguments to pass when starting the job. */ - char **argv; /* The commandline arguments. */ - int queue_index; - - /*-----------------------------------------------------------------*/ - char *failed_job; /* Name of the job (in the chain) which has failed. */ - char *error_reason; /* The error message from the failed job. */ - char *stderr_capture; - char *stderr_file; /* Name of the file containing stderr information. */ - /*-----------------------------------------------------------------*/ - - int submit_attempt; /* Which attempt is this ... */ - job_status_type job_status; /* The current status of the job. */ - bool confirmed_running;/* Set to true if file status_file has been detected written. */ - pthread_mutex_t data_mutex; /* Protecting the access to the job_data pointer. */ - void *job_data; /* Driver specific data about this job - fully handled by the driver. */ - time_t submit_time; /* When was the job added to job_queue - the FIRST TIME. */ - time_t sim_start; /* When did the job change status -> RUNNING - the LAST TIME. */ - time_t sim_end ; /* When did the job finish successfully */ - time_t max_confirm_wait;/* Max waiting between sim_start and confirmed_running is 2 minutes */ -}; - - - -void job_queue_node_free_error_info( job_queue_node_type * node ) { - util_safe_free(node->error_reason); - util_safe_free(node->stderr_capture); - util_safe_free(node->stderr_file); - util_safe_free(node->failed_job); -} - - - -/* - When the job script has detected failure it will create a "EXIT" - file in the runpath directory; this function will inspect the EXIT - file and determine which job has failed, the reason the job script - has given to fail the job (typically missing TARGET_FILE) and - capture the stderr from the job. - - The file is XML formatted: - - ------------------------------------------------ - - - Name of job - Reason why the job failed - - Capture of stderr from the job, can typically be - a multiline string. - - - ------------------------------------------------ - - This format is written by the dump_EXIT_file() function in the - job_dispatch.py script. -*/ - -/* - This extremely half-assed XML "parsing" should of course be kept a - secret... -*/ - -static char * __alloc_tag_content( const char * xml_buffer , const char * tag) { - char * open_tag = util_alloc_sprintf("<%s>" , tag); - char * close_tag = util_alloc_sprintf("" , tag); - - char * start_ptr = strstr( xml_buffer , open_tag ); - char * end_ptr = strstr( xml_buffer , close_tag ); - char * tag_content = NULL; - - if ((start_ptr != NULL) && (end_ptr != NULL)) { - int length; - start_ptr += strlen(open_tag); - - length = end_ptr - start_ptr; - tag_content = util_alloc_substring_copy( start_ptr , 0 , length ); - } - - free( open_tag ); - free( close_tag ); - return tag_content; -} - - - - -/** - This code is meant to capture which of the jobs has failed; why it - has failed and the stderr stream of the failing job. Depending on - the failure circumstances the EXIT file might not be around. -*/ - -void job_queue_node_fscanf_EXIT( job_queue_node_type * node ) { - job_queue_node_free_error_info( node ); - if (node->exit_file) { - if (util_file_exists( node->exit_file )) { - char * xml_buffer = util_fread_alloc_file_content( node->exit_file, NULL); - - node->failed_job = __alloc_tag_content( xml_buffer , "job" ); - node->error_reason = __alloc_tag_content( xml_buffer , "reason" ); - node->stderr_capture = __alloc_tag_content( xml_buffer , "stderr"); - node->stderr_file = __alloc_tag_content( xml_buffer , "stderr_file"); - - free( xml_buffer ); - } else - node->failed_job = util_alloc_sprintf("EXIT file:%s not found - load failure?" , node->exit_file); - } -} - - - - - - -UTIL_IS_INSTANCE_FUNCTION( job_queue_node , JOB_QUEUE_NODE_TYPE_ID ) -UTIL_SAFE_CAST_FUNCTION( job_queue_node , JOB_QUEUE_NODE_TYPE_ID ) - - - -int job_queue_node_get_queue_index( const job_queue_node_type * node ) { - if (node->queue_index == INVALID_QUEUE_INDEX) - util_abort("%s: internal error: asked for not-yet-initialized node->queue_index\n",__func__); - return node->queue_index; -} - -void job_queue_node_set_queue_index( job_queue_node_type * node , int queue_index) { - if (node->queue_index == INVALID_QUEUE_INDEX) - node->queue_index = queue_index; - else - util_abort("%s: internal error: atteeempt to reset queue_index \n",__func__); -} - - -/* - The error information is retained even after the job has completed - completely, so that calling scope can ask for it - that is the - reason there are separate free() and clear functions for the error related fields. -*/ - -void job_queue_node_free_data(job_queue_node_type * node) { - util_safe_free( node->job_name ); - util_safe_free( node->exit_file ); - util_safe_free( node->ok_file ); - util_safe_free( node->run_cmd ); - util_free_stringlist( node->argv , node->argc ); - - if (node->job_data != NULL) - util_abort("%s: internal error - driver spesific job data has not been freed - will leak.\n",__func__); -} - - -void job_queue_node_free(job_queue_node_type * node) { - job_queue_node_free_data(node); - job_queue_node_free_error_info(node); - util_safe_free(node->run_path); - - // Since the type of the callback_arg is void* it should maybe be - // registered with a private destructor - or the type should be - // changed to arg_pack? - if (arg_pack_is_instance( node->callback_arg )) - arg_pack_free( node->callback_arg ); - - free(node); -} - - -job_status_type job_queue_node_get_status(const job_queue_node_type * node) { - return node->job_status; -} - - - - - - -/******************************************************************/ -/* - These four functions all require that the caller has aquired the - data lock before entering. -*/ - - - - - -void job_queue_node_reset_submit_attempt( job_queue_node_type * node) { - node->submit_attempt = 0; -} - -int job_queue_node_get_submit_attempt( const job_queue_node_type * node) { - return node->submit_attempt; -} - - - - - - - - - -job_queue_node_type * job_queue_node_alloc_simple( const char * job_name , - const char * run_path , - const char * run_cmd , - int argc , - const char ** argv) { - return job_queue_node_alloc( job_name , run_path , run_cmd , argc , argv , 1, NULL , NULL, NULL, NULL, NULL, NULL, NULL); -} - - -job_queue_node_type * job_queue_node_alloc( const char * job_name , - const char * run_path , - const char * run_cmd , - int argc , - const char ** argv, - int num_cpu, - const char * ok_file, - const char * status_file, - const char * exit_file, - job_callback_ftype * done_callback, - job_callback_ftype * retry_callback, - job_callback_ftype * exit_callback, - void * callback_arg) { - - if (util_is_directory( run_path )) { - job_queue_node_type * node = util_malloc(sizeof * node ); - - UTIL_TYPE_ID_INIT( node , JOB_QUEUE_NODE_TYPE_ID ); - { - /* The data initialized in this block should *NEVER* change. */ - node->job_name = util_alloc_string_copy( job_name ); - - if (util_is_abs_path(run_path)) - node->run_path = util_alloc_string_copy( run_path ); - else - node->run_path = util_alloc_realpath( run_path ); - - node->run_cmd = util_alloc_string_copy( run_cmd ); - node->argc = argc; - node->argv = util_alloc_stringlist_copy( argv , argc ); - node->num_cpu = num_cpu; - - if (ok_file) - node->ok_file = util_alloc_filename(node->run_path , ok_file , NULL); - else - node->ok_file = NULL; - - if (status_file) - node->status_file = util_alloc_filename(node->run_path , status_file , NULL); - else - node->status_file = NULL; - node->confirmed_running = false; - - if (exit_file) - node->exit_file = util_alloc_filename(node->run_path , exit_file , NULL); - else - node->exit_file = NULL; - - node->exit_callback = exit_callback; - node->retry_callback = retry_callback; - node->done_callback = done_callback; - node->callback_arg = callback_arg; - } - { - node->error_reason = NULL; - node->stderr_capture = NULL; - node->stderr_file = NULL; - node->failed_job = NULL; - } - { - node->job_status = JOB_QUEUE_NOT_ACTIVE; - node->queue_index = INVALID_QUEUE_INDEX; - node->submit_attempt = 0; - node->job_data = NULL; /* The allocation is run in single thread mode - we assume. */ - node->sim_start = 0; - node->sim_end = 0; - node->submit_time = time( NULL ); - node->max_confirm_wait= 60*2; /* 2 minutes before we consider job dead. */ - } - - pthread_mutex_init( &node->data_mutex , NULL ); - return node; - } else - return NULL; -} - - -const char * job_queue_node_get_error_reason( const job_queue_node_type * node) { - return node->error_reason; -} - -const char * job_queue_node_get_stderr_capture( const job_queue_node_type * node) { - return node->stderr_capture; -} - - -const char * job_queue_node_get_stderr_file( const job_queue_node_type * node) { - return node->stderr_file; -} - - -const char * job_queue_node_get_exit_file( const job_queue_node_type * node) { - return node->exit_file; -} - - -const char * job_queue_node_get_ok_file( const job_queue_node_type * node) { - return node->ok_file; -} - -const char * job_queue_node_get_status_file( const job_queue_node_type * node) { - return node->status_file; -} - -const char * job_queue_node_get_run_path( const job_queue_node_type * node) { - return node->run_path; -} - -const char * job_queue_node_get_name( const job_queue_node_type * node) { - return node->job_name; -} - -const char * job_queue_node_get_failed_job( const job_queue_node_type * node) { - return node->failed_job; -} - - -time_t job_queue_node_get_sim_start( const job_queue_node_type * node ) { - return node->sim_start; -} - - -time_t job_queue_node_get_sim_end( const job_queue_node_type * node ) { - return node->sim_end; -} - -time_t job_queue_node_get_submit_time( const job_queue_node_type * node ) { - return node->submit_time; -} - -double job_queue_node_time_since_sim_start (const job_queue_node_type * node ) { - return util_difftime_seconds( node->sim_start , time(NULL)); -} - -bool job_queue_node_run_DONE_callback( job_queue_node_type * node ) { - bool OK = true; - if (node->done_callback) - OK = node->done_callback( node->callback_arg ); - - return OK; -} - - -bool job_queue_node_run_RETRY_callback( job_queue_node_type * node ) { - bool retry = false; - if (node->retry_callback) - retry = node->retry_callback( node->callback_arg ); - - return retry; -} - - -void job_queue_node_run_EXIT_callback( job_queue_node_type * node ) { - if (node->exit_callback) - node->exit_callback( node->callback_arg ); -} - -static void job_queue_node_set_status(job_queue_node_type * node , job_status_type new_status) { - if (new_status != node->job_status) { - node->job_status = new_status; - - /* - We record sim start when the node is in state JOB_QUEUE_WAITING - to be sure that we do not miss the start time completely for - very fast jobs which are registered in the state - JOB_QUEUE_RUNNING. - */ - if (new_status == JOB_QUEUE_WAITING) - node->sim_start = time( NULL ); - - if (new_status == JOB_QUEUE_RUNNING) - node->sim_start = time( NULL ); - - if (new_status == JOB_QUEUE_SUCCESS) - node->sim_end = time( NULL ); - - if (new_status == JOB_QUEUE_FAILED) - job_queue_node_fscanf_EXIT( node ); - - } -} - - -submit_status_type job_queue_node_submit( job_queue_node_type * node , job_queue_status_type * status , queue_driver_type * driver) { - submit_status_type submit_status; - pthread_mutex_lock( &node->data_mutex ); - { - void * job_data = queue_driver_submit_job( driver, - node->run_cmd, - node->num_cpu, - node->run_path, - node->job_name, - node->argc, - (const char **) node->argv); - if (job_data != NULL) { - job_status_type old_status = node->job_status; - job_status_type new_status = JOB_QUEUE_SUBMITTED; - - node->job_data = job_data; - node->submit_attempt++; - /* - The status JOB_QUEUE_SUBMITTED is internal, and not - exported anywhere. The job_queue_update_status() will - update this to PENDING or RUNNING at the next call. The - important difference between SUBMITTED and WAITING is - that SUBMITTED have job_data != NULL and the - job_queue_node free function must be called on it. - */ - submit_status = SUBMIT_OK; - job_queue_node_set_status( node , new_status); - job_queue_status_transition(status, old_status, new_status); - } else - /* - In this case the status of the job itself will be - unmodified; i.e. it will still be WAITING, and a new attempt - to submit it will be performed in the next round. - */ - submit_status = SUBMIT_DRIVER_FAIL; - } - pthread_mutex_unlock( &node->data_mutex ); - return submit_status; -} - -static bool job_queue_node_status_update_confirmed_running__(job_queue_node_type * node) { - if (node->confirmed_running) - return true; - - if (!node->status_file) { - node->confirmed_running = true; - return true; - } - - if (util_file_exists(node->status_file)) - node->confirmed_running = true; - return node->confirmed_running; -} - -// if status = running, and current_time > sim_start + max_confirm_wait -// (usually 2 min), check if job is confirmed running (status_file exists). -// If not confirmed, set job to JOB_QUEUE_FAILED. -bool job_queue_node_update_status( job_queue_node_type * node , job_queue_status_type * status , queue_driver_type * driver ) { - bool status_change = false; - pthread_mutex_lock(&node->data_mutex); - { - if (node->job_data) { - job_status_type current_status = job_queue_node_get_status(node); - - bool confirmed = job_queue_node_status_update_confirmed_running__(node); - - if ((current_status & JOB_QUEUE_RUNNING) && !confirmed) { - // it's running, but not confirmed running. - double runtime = job_queue_node_time_since_sim_start(node); - if (runtime >= node->max_confirm_wait) { - // max_confirm_wait has passed since sim_start without success; the job is dead - job_status_type new_status = JOB_QUEUE_DO_KILL_NODE_FAILURE; - status_change = job_queue_status_transition(status, current_status, new_status); - job_queue_node_set_status(node, new_status); - } - } - current_status = job_queue_node_get_status(node); - if (current_status & JOB_QUEUE_CAN_UPDATE_STATUS) { - job_status_type new_status = queue_driver_get_status( driver , node->job_data); - status_change = job_queue_status_transition(status , current_status , new_status); - job_queue_node_set_status(node,new_status); - } - } - } - pthread_mutex_unlock( &node->data_mutex ); - return status_change; -} - -bool job_queue_node_status_transition( job_queue_node_type * node , job_queue_status_type * status , job_status_type new_status) { - bool status_change; - pthread_mutex_lock( &node->data_mutex ); - { - job_status_type old_status = job_queue_node_get_status( node ); - status_change = job_queue_status_transition(status , old_status, new_status); - - if (status_change) - job_queue_node_set_status( node , new_status ); - } - pthread_mutex_unlock( &node->data_mutex ); - return status_change; -} - -void job_queue_node_set_max_confirmation_wait_time(job_queue_node_type * node, time_t time) { - node->max_confirm_wait = time; -} - - -bool job_queue_node_status_confirmed_running(job_queue_node_type * node) { - return node->confirmed_running; -} - - -bool job_queue_node_kill( job_queue_node_type * node , job_queue_status_type * status , queue_driver_type * driver) { - bool result = false; - pthread_mutex_lock( &node->data_mutex ); - { - job_status_type current_status = job_queue_node_get_status( node ); - if (current_status & JOB_QUEUE_CAN_KILL) { - /* - If the job is killed before it is even started no driver - specific job data has been assigned; we therefor must check - the node->job_data pointer before entering. - */ - if (node->job_data) { - queue_driver_kill_job( driver , node->job_data ); - queue_driver_free_job( driver , node->job_data ); - node->job_data = NULL; - } - job_queue_status_transition(status, current_status, JOB_QUEUE_IS_KILLED); - job_queue_node_set_status( node , JOB_QUEUE_IS_KILLED); - result = true; - } - } - pthread_mutex_unlock( &node->data_mutex ); - return result; -} - - -/* - This frees the storage allocated by the driver - the storage - allocated by the queue layer is retained. - - In the case of jobs which are first marked as successfull by the - queue layer, and then subsequently set to status EXIT by the - DONE_callback this function will be called twice; i.e. we must - protect against a double free. -*/ - -void job_queue_node_free_driver_data( job_queue_node_type * node , queue_driver_type * driver) { - pthread_mutex_lock( &node->data_mutex ); - { - if (node->job_data != NULL) - queue_driver_free_job( driver , node->job_data ); - node->job_data = NULL; - } - pthread_mutex_unlock( &node->data_mutex ); -} - - -/* - This returns a pointer to a very internal datastructure; used by the - Job class in Python which interacts directly with the driver - implementation. This is too low level, and the whole Driver / Job - implementation in Python should be changed to only expose the higher - level queue class. -*/ - -void * job_queue_node_get_driver_data( job_queue_node_type * node ) { - return node->job_data; -} - - -void job_queue_node_restart( job_queue_node_type * node , job_queue_status_type * status) { - pthread_mutex_lock( &node->data_mutex ); - { - job_status_type current_status = job_queue_node_get_status( node ); - job_queue_status_transition(status, current_status, JOB_QUEUE_WAITING); - job_queue_node_set_status( node , JOB_QUEUE_WAITING); - job_queue_node_reset_submit_attempt(node); - } - pthread_mutex_unlock( &node->data_mutex ); -} diff --git a/ThirdParty/Ert/libjob_queue/src/job_queue.c b/ThirdParty/Ert/libjob_queue/src/job_queue.c deleted file mode 100644 index f24aa0cf2f..0000000000 --- a/ThirdParty/Ert/libjob_queue/src/job_queue.c +++ /dev/null @@ -1,1357 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'job_queue.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#define _GNU_SOURCE /* Must define this to get access to pthread_rwlock_t */ -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - - -/** - - The running of external jobs is handled thruogh an abstract - job_queue implemented in this file; the job_queue then contains a - 'driver' which actually runs the job. All drivers must support the - following functions - - submit: This will submit a job, and return a pointer to a - newly allocated queue_job instance. - - clean: This will clear up all resources used by the job. - - abort: This will stop the job, and then call clean. - - status: This will get the status of the job. - - - When calling the various driver functions the queue layer needs to - dereference the driver structures, i.e. to get access to the - driver->submit_jobs function. This is currently (rather clumsily?? - implemented like this): - - When implementing a driver the driver struct MUST start like - this: - - struct some_driver { - UTIL_TYPE_ID_DECLARATION - QUEUE_DRIVER_FUNCTIONS - .... - .... - } - - The function allocating a driver instance will just return a - (void *) however in the queue layer the driver is stored as a - queue_driver_type instance which is a struct like this: - - struct queue_driver_struct { - UTIL_TYPE_ID_DECLARATION - QUEUE_DRIVER_FIELDS - } - - I.e. it only contains the pointers common to all the driver - implementations. When calling a driver function the spesific - driver will cast to it's datatype. - - Observe that this library also contains the files ext_joblist and - ext_job, those files implement a particular way of dispatching - external jobs in a series; AFTER THEY HAVE BEEN SUBMITTED. So seen - from the this scope those files do not provide any particluar - functionality; there is no compile-time dependencies either. -*/ - - - -/* - Some words about status - ======================= - - The status of a particular job is given by the job_status field of - the job_queue_node_type, the possible values are given by the enum - job_status_type, defined in queue_driver.h. - - To actually __GET__ the status of a job we use the driver->status() - function which will invoke a driver specific function and return the - new status. - - 1. The driver->status() function is invoked by the - job_queue_update_status() function. This should be invoked by - the same thread as is running the main queue management in - job_queue_run_jobs(). - - - 2. The actual change of status is handled by the function - job_queue_change_node_status(); arbitrary assignments of the - type job->status = new_status is STRICTLY ILLEGAL. - - - 3. When external functions query about the status of a particular - job they get the status value currently stored (i.e. cached) in - the job_node; external scope can NOT initiate a - driver->status() function call. - - This might result in external scope getting a outdated status - - live with it. - - - 4. The name 'status' indicates that this is read-only property; - that is actually not the case. In the main manager function - job_queue_run_jobs() action is taken based on the value of the - status field, and to initiate certain action on jobs the queue - system (and also external scope) can explicitly set the status - of a job (by using the job_queue_change_node_status() function). - - The most promiment example of this is when we want to run a - certain job again, that is achieved with: - - job_queue_node_change_status( queue , node , JOB_QUEUE_WAITING ); - - When the queue manager subsequently finds the job with status - 'JOB_QUEUE_WAITING' it will (re)submit this job. -*/ - - - -/* - Communicating success/failure between the job_script and the job_queue: - ======================================================================= - - The system for communicatin success/failure between the queue system - (i.e. this file) and the job script is quite elaborate. There are - essentially three problems which make this complicated: - - 1. The exit status of the jobs is NOT reliably captured - the job - might very well fail without us detecing it with the exit - status. - - 2. Syncronizing of disks can be quite slow, so altough a job has - completede successfully the files we expect to find might not - present. - - 3. There is layer upon layer here - this file scope (i.e. the - internal queue_system) spawns external jobs in the form of a job - script. This script again spawns a series of real external jobs - like e.g. ECLIPSE and RMS. The job_script does not reliably - capture the exit status of the external programs. - - - The approach to this is as follows: - - 1. If the job (i.e. the job script) finishes with a failure status - we communicate the failure back to the calling scope with no - more ado. - - 2. When a job has finished (seemingly OK) we try hard to determine - whether the job has failed or not. This is based on the - following tests: - - a) If the job has produced an EXIT file it has failed. - - b) If the job has produced an OK file it has succeeded. - - c) If neither EXIT nor OK files have been produced we spin for a - while waiting for one of the files, if none turn up we will - eventually mark the job as failed. - -*/ - - - - - -/** - This struct holds the job_queue information about one job. Observe - the following: - - 1. This struct is purely static - i.e. it is invisible outside of - this file-scope. - - 2. Typically the driver would like to store some additional - information, i.e. the PID of the running process for the local - driver; that is stored in a (driver specific) struct under the - field job_data. - - 3. If the driver detects that a job has failed it leaves an EXIT - file, the exit status is (currently) not reliably transferred - back to to the job_queue layer. - -*/ - -/*****************************************************************/ - -#define JOB_QUEUE_TYPE_ID 665210 - -struct job_queue_struct { - UTIL_TYPE_ID_DECLARATION; - job_list_type * job_list; - job_queue_status_type * status; - char * exit_file; /* The queue will look for the occurence of this file to detect a failure. */ - char * ok_file; /* The queue will look for this file to verify that the job was OK - can be NULL - in which case it is ignored. */ - char * status_file; /* The queue will look for this file to verify that the job is running or has run. If not, ok_file is ignored. */ - queue_driver_type * driver; /* A pointer to a driver instance (LSF|LOCAL|RSH) which actually 'does it'. */ - - bool open; /* True if the queue has been reset and is ready for use, false if the queue has been used and not reset */ - bool user_exit; /* If there comes an external signal to abondond the whole thing user_exit will be set to true, and things start to dwindle down. */ - bool running; - bool pause_on; - bool submit_complete; - - int max_submit; /* The maximum number of submit attempts for one job. */ - int max_ok_wait_time; /* Seconds to wait for an OK file - when the job itself has said all OK. */ - int max_duration; /* Maximum allowed time for a job to run, 0 = unlimited */ - time_t stop_time; /* A job is only allowed to run until this time. 0 = no time set, ignore stop_time */ - unsigned long usleep_time; /* The sleep time before checking for updates. */ - pthread_mutex_t run_mutex; /* This mutex is used to ensure that ONLY one thread is executing the job_queue_run_jobs(). */ - thread_pool_type * work_pool; -}; - - - - - - -/* - Must hold on to: - - 1. A write lock for the job node. - 3. A read lock for the job_list - -*/ -static bool job_queue_change_node_status(job_queue_type * queue , job_queue_node_type * node , job_status_type new_status) { - return job_queue_node_status_transition( node , queue->status , new_status ); -} - - - - -/*****************************************************************/ - - - - - - - -/** - Observe that this function should only query the driver for state - change when the job is currently in one of the states: - - JOB_QUEUE_WAITING || JOB_QUEUE_PENDING || JOB_QUEUE_RUNNING - - The other state transitions are handled by the job_queue itself, - without consulting the driver functions. -*/ - -/* - Will return true if there is any status change. Must already hold - on to joblist readlock -*/ - -static bool job_queue_update_status(job_queue_type * queue ) { - bool update = false; - int ijob; - - for (ijob = 0; ijob < job_list_get_size( queue->job_list ); ijob++) { - job_queue_node_type * node = job_list_iget_job( queue->job_list , ijob ); - bool node_update = job_queue_node_update_status( node , queue->status , queue->driver ); - if (node_update) - update = true; - } - return update; -} - -/* - Must hold on to joblist readlock -*/ - -static submit_status_type job_queue_submit_job(job_queue_type * queue , int queue_index) { - submit_status_type submit_status; - if (queue->user_exit || queue->pause_on) - submit_status = SUBMIT_QUEUE_CLOSED; /* The queue is currently not accepting more jobs. */ - else { - { - job_queue_node_type * node = job_list_iget_job( queue->job_list , queue_index ); - submit_status = job_queue_node_submit( node , queue->status , queue->driver ); - } - } - return submit_status; -} - - - - - - - - - -/** - Will return the number of jobs with status @status. - - #include - - printf("Running jobs...: %03d \n", job_queue_iget_status_summary( queue , JOB_QUEUE_RUNNING )); - printf("Waiting jobs:..: %03d \n", job_queue_iget_status_summary( queue , JOB_QUEUE_WAITING )); - - Observe that if this function is called repeatedly the status might change between - calls, with the consequence that the total number of jobs does not add up - properly. The handles itself autonomously so as long as the return value from this - function is only used for information purposes this does not matter. Alternatively - the function job_queue_export_status_summary(), which does proper locking, can be - used. -*/ - -int job_queue_iget_status_summary( const job_queue_type * queue , job_status_type status) { - return job_queue_status_get_count(queue->status, status); -} - -int job_queue_get_num_callback( const job_queue_type * queue) { - return job_queue_iget_status_summary( queue , JOB_QUEUE_RUNNING_CALLBACK ); -} - -int job_queue_get_num_running( const job_queue_type * queue) { - return job_queue_iget_status_summary( queue , JOB_QUEUE_RUNNING ); -} - -int job_queue_get_num_pending( const job_queue_type * queue) { - return job_queue_iget_status_summary( queue , JOB_QUEUE_PENDING ); -} - -int job_queue_get_num_waiting( const job_queue_type * queue) { - return job_queue_iget_status_summary( queue , JOB_QUEUE_WAITING ); -} - -int job_queue_get_num_complete( const job_queue_type * queue) { - return job_queue_iget_status_summary( queue , JOB_QUEUE_SUCCESS ); -} - -int job_queue_get_num_failed( const job_queue_type * queue) { - return job_queue_iget_status_summary( queue , JOB_QUEUE_FAILED ); -} - -int job_queue_get_num_killed( const job_queue_type * queue) { - return job_queue_iget_status_summary( queue , JOB_QUEUE_IS_KILLED ); -} - -int job_queue_get_active_size( const job_queue_type * queue ) { - return job_list_get_size( queue->job_list ); -} - -void job_queue_set_max_job_duration(job_queue_type * queue, int max_duration_seconds) { - queue->max_duration = max_duration_seconds; -} - -int job_queue_get_max_job_duration(const job_queue_type * queue) { - return queue->max_duration; -} - -void job_queue_set_job_stop_time(job_queue_type * queue, time_t time) { - queue->stop_time = time; -} - -time_t job_queue_get_job_stop_time(const job_queue_type * queue) { - return queue->stop_time; -} - -void job_queue_set_auto_job_stop_time(job_queue_type * queue) { - time_t sum_run_time_succeded_jobs = 0; - int num_succeded_jobs = 0; - - for (int i = 0; i < job_list_get_size( queue->job_list ); i++) { - if (job_queue_iget_job_status(queue,i) == JOB_QUEUE_SUCCESS) { - sum_run_time_succeded_jobs += difftime(job_queue_iget_sim_end(queue, i), job_queue_iget_sim_start(queue, i)); - num_succeded_jobs++; - } - } - - if (num_succeded_jobs > 0) { - time_t avg_run_time_succeded_jobs = sum_run_time_succeded_jobs / num_succeded_jobs; - time_t stop_time = time(NULL) + (avg_run_time_succeded_jobs * 0.25); - job_queue_set_job_stop_time(queue, stop_time); - } -} - -/** - Observe that jobs with status JOB_QUEUE_WAITING can also be killed; for those - jobs the kill should be interpreted as "Forget about this job for now and set - the status JOB_QUEUE_IS_KILLED", however it is important that we not call - the driver->kill() function on it because the job slot will have no data - (i.e. LSF jobnr), and the driver->kill() function will fail if presented with - such a job. - - Only jobs which have a status matching "JOB_QUEUE_CAN_KILL" can be - killed; if the job is not in a killable state the function will do - nothing. This includes trying to kill a job which is not even - found. - - Observe that jobs (slots) with status JOB_QUEUE_NOT_ACTIVE can NOT be - meaningfully killed; that is because these jobs have not yet been submitted - to the queue system, and there is not yet established a mapping between - external id and queue_index. - - Must hold on to joblist:read lock. -*/ - -static bool job_queue_kill_job_node( job_queue_type * queue , job_queue_node_type * node) { - bool result = job_queue_node_kill( node , queue->status , queue->driver ); - return result; -} - -#define ASSIGN_LOCKED_ATTRIBUTE( var , func , ...) \ -job_list_get_rdlock( queue->job_list ); \ -{ \ - job_queue_node_type * node = job_list_iget_job( queue->job_list , job_index ); \ - var = func(__VA_ARGS__); \ -} \ -job_list_unlock( queue->job_list ); - - - -bool job_queue_kill_job( job_queue_type * queue , int job_index) { - bool result; - ASSIGN_LOCKED_ATTRIBUTE( result , job_queue_kill_job_node , queue , node); - return result; -} - - -time_t job_queue_iget_sim_start( job_queue_type * queue, int job_index) { - time_t sim_start; - ASSIGN_LOCKED_ATTRIBUTE( sim_start , job_queue_node_get_sim_start , node ); - return sim_start; -} - - -time_t job_queue_iget_sim_end( job_queue_type * queue, int job_index) { - time_t sim_end; - ASSIGN_LOCKED_ATTRIBUTE( sim_end , job_queue_node_get_sim_end , node ); - return sim_end; -} - - -time_t job_queue_iget_submit_time( job_queue_type * queue, int job_index) { - time_t submit_time; - ASSIGN_LOCKED_ATTRIBUTE( submit_time , job_queue_node_get_submit_time , node ); - return submit_time; -} - -const char * job_queue_iget_run_path( job_queue_type * queue , int job_index) { - const char * run_path; - ASSIGN_LOCKED_ATTRIBUTE(run_path, job_queue_node_get_run_path, node ); - return run_path; -} - - -const char * job_queue_iget_failed_job( job_queue_type * queue , int job_index) { - const char * failed_job; - ASSIGN_LOCKED_ATTRIBUTE(failed_job, job_queue_node_get_failed_job, node ); - return failed_job; -} - - -const char * job_queue_iget_error_reason( job_queue_type * queue , int job_index) { - const char * error_reason; - ASSIGN_LOCKED_ATTRIBUTE(error_reason, job_queue_node_get_error_reason, node ); - return error_reason; -} - - -const char * job_queue_iget_stderr_capture( job_queue_type * queue , int job_index) { - const char * stderr_capture; - ASSIGN_LOCKED_ATTRIBUTE(stderr_capture, job_queue_node_get_stderr_capture, node ); - return stderr_capture; -} - - -const char * job_queue_iget_stderr_file( job_queue_type * queue , int job_index) { - const char * stderr_file; - ASSIGN_LOCKED_ATTRIBUTE(stderr_file, job_queue_node_get_stderr_file, node ); - return stderr_file; -} - - - -job_status_type job_queue_iget_job_status( job_queue_type * queue , int job_index) { - job_status_type job_status; - ASSIGN_LOCKED_ATTRIBUTE(job_status, job_queue_node_get_status , node ); - return job_status; -} - - -void job_queue_iset_max_confirm_wait_time(job_queue_type * queue, int job_index, time_t time) { - job_list_get_rdlock( queue->job_list ); - { - job_queue_node_type * node = job_list_iget_job( queue->job_list , job_index ); - job_queue_node_set_max_confirmation_wait_time( node, time ); - } - job_list_unlock( queue->job_list ); -} - - - - -/** - The external scope asks the queue to restart the the job; we reset - the submit counter to zero. This function should typically be used - in combination with resampling, however that is the responsability - of the calling scope. -*/ - -void job_queue_iset_external_restart(job_queue_type * queue , int job_index) { - job_list_get_rdlock( queue->job_list ); - { - job_queue_node_type * node = job_list_iget_job( queue->job_list , job_index ); - job_queue_node_restart(node,queue->status); - } - job_list_unlock( queue->job_list ); -} - - -/** - The queue system has said that the job completed OK, however the - external scope failed to load all the results and are using this - function to inform the queue system that the job has indeed - failed. The queue system will then either retry the job, or switch - status to JOB_QUEUE_RUN_FAIL. - - - This is a bit dangerous beacuse the queue system has said that the - job was all hunkadory, and freed the driver related resources - attached to the job; it is therefor essential that the - JOB_QUEUE_EXIT code explicitly checks the status of the job node's - driver specific data before dereferencing. -*/ - -void job_queue_iset_external_fail(job_queue_type * queue , int job_index) { - job_list_get_rdlock( queue->job_list ); - { - job_queue_node_type * node = job_list_iget_job( queue->job_list , job_index ); - job_queue_node_status_transition(node,queue->status,JOB_QUEUE_EXIT); - } - job_list_unlock( queue->job_list ); -} - - -/* - This returns a pointer to a very internal datastructure; used by the - Job class in Python which interacts directly with the driver - implementation. This is too low level, and the whole Driver / Job - implementation in Python should be changed to only expose the higher - level queue class. -*/ - -void * job_queue_iget_driver_data( job_queue_type * queue , int job_index) { - void * driver_data; - ASSIGN_LOCKED_ATTRIBUTE(driver_data, job_queue_node_get_driver_data , node ); - return driver_data; -} - - - - -static void job_queue_update_spinner( int * phase ) { - const char * spinner = "-\\|/"; - int spinner_length = strlen( spinner ); - - printf("%c\b" , spinner[ (*phase % spinner_length) ]); - fflush(stdout); - (*phase) += 1; -} - - -static void job_queue_print_summary(job_queue_type *queue, bool status_change ) { - const char * status_fmt = "Waiting: %3d Pending: %3d Running: %3d Checking/Loading: %3d Failed: %3d Complete: %3d [ ]\b\b"; - int string_length = 105; - - if (status_change) { - for (int i=0; i < string_length; i++) - printf("\b"); - - { - int waiting = job_queue_status_get_count( queue->status , JOB_QUEUE_WAITING ); - int pending = job_queue_status_get_count( queue->status , JOB_QUEUE_PENDING ); - - /* - EXIT and DONE are included in "xxx_running", because the target - file has not yet been checked. - */ - int running = job_queue_status_get_count( queue->status , JOB_QUEUE_RUNNING ) + - job_queue_status_get_count( queue->status , JOB_QUEUE_DONE ) + - job_queue_status_get_count( queue->status , JOB_QUEUE_EXIT ); - int complete = job_queue_status_get_count( queue->status , JOB_QUEUE_SUCCESS ); - int failed = job_queue_status_get_count( queue->status , JOB_QUEUE_FAILED ) + - job_queue_status_get_count( queue->status , JOB_QUEUE_IS_KILLED ); - int loading = job_queue_status_get_count( queue->status , JOB_QUEUE_RUNNING_CALLBACK ); - - printf(status_fmt , waiting , pending , running , loading , failed , complete); - } - } -} - - - - - -/** - This function goes through all the nodes and call finalize on - them. What about jobs which were NOT in a CAN_KILL state when the - killing was done, i.e. jobs which are in one of the intermediate - load like states?? They -*/ - -void job_queue_reset(job_queue_type * queue) { - job_list_get_wrlock( queue->job_list ); - job_list_reset( queue->job_list ); - job_list_unlock( queue->job_list ); - job_queue_status_clear(queue->status); - - /* - Be ready for the next run - */ - queue->submit_complete = false; - queue->pause_on = false; - queue->user_exit = false; - queue->open = true; - queue->stop_time = 0; -} - - -bool job_queue_is_running( const job_queue_type * queue ) { - return queue->running; -} - - -static void job_queue_user_exit__( job_queue_type * queue ) { - int queue_index; - for (queue_index = 0; queue_index < job_list_get_size( queue->job_list ); queue_index++) { - job_queue_node_type * node = job_list_iget_job( queue->job_list , queue_index ); - - if (JOB_QUEUE_CAN_KILL & job_queue_node_get_status(node)) - job_queue_node_status_transition(node,queue->status,JOB_QUEUE_DO_KILL); - } -} - - -static bool job_queue_check_node_status_files( const job_queue_type * job_queue , job_queue_node_type * node) { - const char * exit_file = job_queue_node_get_exit_file( node ); - if ((exit_file != NULL) && util_file_exists(exit_file)) - return false; /* It has failed. */ - else { - const char * ok_file = job_queue_node_get_ok_file( node ); - if (ok_file == NULL) - return true; /* If the ok-file has not been set we just return true immediately. */ - else { - int ok_sleep_time = 1; /* Time to wait between checks for OK|EXIT file. */ - int total_wait_time = 0; - - while (true) { - if (util_file_exists( ok_file )) { - return true; - break; - } else { - if (total_wait_time < job_queue->max_ok_wait_time) { - sleep( ok_sleep_time ); - total_wait_time += ok_sleep_time; - } else { - /* We have waited long enough - this does not seem to give any OK file. */ - return false; - break; - } - } - } - } - } -} - - -static void * job_queue_run_DONE_callback( void * arg ) { - arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); - job_queue_type * job_queue = arg_pack_iget_ptr( arg_pack , 0 ); - int queue_index = arg_pack_iget_int( arg_pack , 1 ); - job_list_get_rdlock( job_queue->job_list ); - { - job_queue_node_type * node = job_list_iget_job( job_queue->job_list , queue_index ); - bool OK = job_queue_check_node_status_files( job_queue , node ); - - if (OK) - OK = job_queue_node_run_DONE_callback( node ); - - if (OK) - job_queue_change_node_status( job_queue , node , JOB_QUEUE_SUCCESS ); - else - job_queue_change_node_status( job_queue , node , JOB_QUEUE_EXIT ); - - job_queue_node_free_driver_data( node , job_queue->driver ); - } - job_list_unlock(job_queue->job_list ); - arg_pack_free( arg_pack ); - return NULL; -} - -static void job_queue_handle_DONE( job_queue_type * queue , job_queue_node_type * node) { - job_queue_change_node_status(queue , node , JOB_QUEUE_RUNNING_CALLBACK ); - { - arg_pack_type * arg_pack = arg_pack_alloc(); - arg_pack_append_ptr( arg_pack , queue ); - arg_pack_append_int( arg_pack , job_queue_node_get_queue_index(node)); - thread_pool_add_job( queue->work_pool , job_queue_run_DONE_callback , arg_pack ); - } -} - - -static void * job_queue_run_EXIT_callback( void * arg ) { - arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); - job_queue_type * job_queue = arg_pack_iget_ptr( arg_pack , 0 ); - int queue_index = arg_pack_iget_int( arg_pack , 1 ); - - job_list_get_rdlock( job_queue->job_list ); - { - job_queue_node_type * node = job_list_iget_job( job_queue->job_list , queue_index ); - - if (job_queue_node_get_submit_attempt( node ) < job_queue->max_submit) - job_queue_change_node_status( job_queue , node , JOB_QUEUE_WAITING ); /* The job will be picked up for antother go. */ - else { - bool retry = job_queue_node_run_RETRY_callback( node ); - - if (retry) { - /* OK - we have invoked the retry_callback() - and that has returned true; - giving this job a brand new start. */ - job_queue_node_reset_submit_attempt( node ); - job_queue_change_node_status(job_queue , node , JOB_QUEUE_WAITING); - } else { - // It's time to call it a day - - job_queue_node_run_EXIT_callback( node ); - job_queue_change_node_status(job_queue , node , JOB_QUEUE_FAILED); - } - } - job_queue_node_free_driver_data( node , job_queue->driver ); - } - job_list_unlock(job_queue->job_list ); - arg_pack_free( arg_pack ); - - return NULL; -} - - -static void * job_queue_run_DO_KILL_callback( void * arg ) { - arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); - job_queue_type * job_queue = arg_pack_iget_ptr( arg_pack , 0 ); - int queue_index = arg_pack_iget_int( arg_pack , 1 ); - - job_list_get_rdlock( job_queue->job_list ); - { - job_queue_node_type * node = job_list_iget_job( job_queue->job_list , queue_index ); - job_queue_node_free_driver_data( node , job_queue->driver ); - - // It's time to call it a day - job_queue_node_run_EXIT_callback( node ); - job_queue_change_node_status(job_queue, node, JOB_QUEUE_IS_KILLED); - } - job_list_unlock(job_queue->job_list ); - arg_pack_free( arg_pack ); - return NULL; -} - -static void job_queue_handle_DO_KILL_NODE_FAILURE(job_queue_type * queue, job_queue_node_type * node) { - queue_driver_blacklist_node( queue->driver, node ); - job_queue_change_node_status(queue, node, JOB_QUEUE_DO_KILL); -} - -static void job_queue_handle_DO_KILL( job_queue_type * queue , job_queue_node_type * node) { - job_queue_kill_job_node(queue, node); - job_queue_change_node_status(queue , node , JOB_QUEUE_RUNNING_CALLBACK ); - { - arg_pack_type * arg_pack = arg_pack_alloc(); - arg_pack_append_ptr( arg_pack , queue ); - arg_pack_append_int( arg_pack , job_queue_node_get_queue_index(node)); - thread_pool_add_job( queue->work_pool , job_queue_run_DO_KILL_callback , arg_pack ); - } -} - -static void job_queue_handle_EXIT( job_queue_type * queue , job_queue_node_type * node) { - job_queue_change_node_status(queue , node , JOB_QUEUE_RUNNING_CALLBACK ); - { - arg_pack_type * arg_pack = arg_pack_alloc(); - arg_pack_append_ptr( arg_pack , queue ); - arg_pack_append_int( arg_pack , job_queue_node_get_queue_index(node)); - thread_pool_add_job( queue->work_pool , job_queue_run_EXIT_callback , arg_pack ); - } -} - - - -/*****************************************************************/ - -static void job_queue_check_expired(job_queue_type * queue) { - if ((job_queue_get_max_job_duration(queue) <= 0) && (job_queue_get_job_stop_time(queue) <= 0)) - return; - - for (int i = 0; i < job_list_get_size( queue->job_list ); i++) { - job_queue_node_type * node = job_list_iget_job( queue->job_list , i ); - - if (job_queue_node_get_status(node) == JOB_QUEUE_RUNNING) { - time_t now = time(NULL); - if ( job_queue_get_max_job_duration(queue) > 0) { - double elapsed = difftime(now, job_queue_node_get_sim_start( node )); - if (elapsed > job_queue_get_max_job_duration(queue)) - job_queue_change_node_status(queue, node, JOB_QUEUE_DO_KILL); - } - if (job_queue_get_job_stop_time(queue) > 0) { - if (now >= job_queue_get_job_stop_time(queue)) - job_queue_change_node_status(queue, node, JOB_QUEUE_DO_KILL); - } - } - } -} - -bool job_queue_get_open(const job_queue_type * job_queue) { - return job_queue->open; -} - -void job_queue_check_open(job_queue_type* queue) { - if (!job_queue_get_open(queue)) - util_abort("%s: queue not open and not ready for use; method job_queue_reset must be called before using the queue - aborting\n", __func__ ); -} - -bool job_queue_accept_jobs(const job_queue_type * queue) { - if (queue->user_exit) - return false; - - return queue->open; -} - - -/** - If the total number of jobs is not known in advance the job_queue_run_jobs - function can be called with @num_total_run == 0. In that case it is paramount - to call the function job_queue_submit_complete() whan all jobs have been submitted. - - Observe that this function is assumed to have ~exclusive access to - the jobs array; meaning that: - - 1. The jobs array is read without taking a reader lock. - - 2. Other functions accessing the jobs array concurrently must - take a read lock. - - 3. This function should be the *only* function modifying - the jobs array, and that is done *with* the write lock. - -*/ - -void job_queue_run_jobs(job_queue_type * queue , int num_total_run, bool verbose) { - int trylock = pthread_mutex_trylock( &queue->run_mutex ); - if (trylock != 0) - util_abort("%s: another thread is already running the queue_manager\n",__func__); - else if (!queue->user_exit) { - /* OK - we have got an exclusive lock to the run_jobs code. */ - - //Check if queue is open. Fails hard if not open - job_queue_check_open(queue); - - /* - The number of threads in the thread pool running callbacks. Memory consumption can - potentially be quite high while running the DONE callback - should therefor not use - too many threads. - */ - const int NUM_WORKER_THREADS = 4; - queue->work_pool = thread_pool_alloc( NUM_WORKER_THREADS , true ); - { - bool new_jobs = false; - bool cont = true; - int phase = 0; - - queue->running = true; - do { - bool local_user_exit = false; - job_list_get_rdlock( queue->job_list ); - /*****************************************************************/ - if (queue->user_exit) {/* An external thread has called the job_queue_user_exit() function, and we should kill - all jobs, do some clearing up and go home. Observe that we will go through the - queue handling codeblock below ONE LAST TIME before exiting. */ - job_queue_user_exit__( queue ); - local_user_exit = true; - } - - job_queue_check_expired(queue); - - /*****************************************************************/ - { - bool update_status = job_queue_update_status( queue ); - if (verbose) { - if (update_status || new_jobs) - job_queue_print_summary(queue , update_status ); - job_queue_update_spinner( &phase ); - } - - - { - int num_complete = job_queue_status_get_count(queue->status, JOB_QUEUE_SUCCESS) + - job_queue_status_get_count(queue->status, JOB_QUEUE_FAILED) + - job_queue_status_get_count(queue->status, JOB_QUEUE_IS_KILLED); - - if ((num_total_run > 0) && (num_total_run == num_complete)) - /* The number of jobs completed is equal to the number - of jobs we have said we want to run; so we are finished. - */ - cont = false; - else { - if (num_total_run == 0) { - /* We have not informed about how many jobs we will - run. To check if we are complete we perform the two - tests: - - 1. All the jobs which have been added with - job_queue_add_job() have completed. - - 2. The user has used job_queue_complete_submit() - to signal that no more jobs will be forthcoming. - */ - if ((num_complete == job_list_get_size( queue->job_list )) && queue->submit_complete) - cont = false; - } - } - } - - if (cont) { - /* Submitting new jobs */ - int max_submit = 5; /* This is the maximum number of jobs submitted in one while() { ... } below. - Only to ensure that the waiting time before a status update is not too long. */ - int total_active = job_queue_status_get_count(queue->status, JOB_QUEUE_PENDING) + job_queue_status_get_count(queue->status, JOB_QUEUE_RUNNING); - int num_submit_new; - - { - int max_running = job_queue_get_max_running( queue ); - if (max_running > 0) - num_submit_new = util_int_min( max_submit , max_running - total_active ); - else - /* - If max_running == 0 that should be interpreted as no limit; i.e. the queue layer will - attempt to send an unlimited number of jobs to the driver - the driver can reject the jobs. - */ - num_submit_new = util_int_min( max_submit , job_queue_status_get_count(queue->status, JOB_QUEUE_WAITING)); - } - - new_jobs = false; - if (job_queue_status_get_count(queue->status, JOB_QUEUE_WAITING) > 0) /* We have waiting jobs at all */ - if (num_submit_new > 0) /* The queue can allow more running jobs */ - new_jobs = true; - - if (new_jobs) { - int submit_count = 0; - int queue_index = 0; - - while ((queue_index < job_list_get_size( queue->job_list )) && (num_submit_new > 0)) { - job_queue_node_type * node = job_list_iget_job( queue->job_list , queue_index ); - if (job_queue_node_get_status(node) == JOB_QUEUE_WAITING) { - { - submit_status_type submit_status = job_queue_submit_job(queue , queue_index); - - if (submit_status == SUBMIT_OK) { - num_submit_new--; - submit_count++; - } else if ((submit_status == SUBMIT_DRIVER_FAIL) || (submit_status == SUBMIT_QUEUE_CLOSED)) - break; - } - } - queue_index++; - } - } - - - { - /* - Checking for complete / exited / overtime jobs - */ - int queue_index; - for (queue_index = 0; queue_index < job_list_get_size( queue->job_list ); queue_index++) { - job_queue_node_type * node = job_list_iget_job( queue->job_list , queue_index ); - - switch (job_queue_node_get_status(node)) { - case(JOB_QUEUE_DONE): - job_queue_handle_DONE(queue, node); - break; - case(JOB_QUEUE_EXIT): - job_queue_handle_EXIT(queue, node); - break; - case(JOB_QUEUE_DO_KILL_NODE_FAILURE): - job_queue_handle_DO_KILL_NODE_FAILURE(queue, node); - break; - case(JOB_QUEUE_DO_KILL): - job_queue_handle_DO_KILL(queue, node); - break; - default: - break; - } - - - } - } - } else - /* print an updated status to stdout before exiting. */ - if (verbose) - job_queue_print_summary(queue , true); - } - job_list_unlock( queue->job_list ); - if (local_user_exit) - cont = false; /* This is how we signal that we want to get out . */ - else { - util_yield(); - job_list_reader_wait( queue->job_list , queue->usleep_time , 8 * queue->usleep_time); - } - } while ( cont ); - } - if (verbose) - printf("\n"); - thread_pool_join( queue->work_pool ); - thread_pool_free( queue->work_pool ); - } - - /* - Set the queue's "open" flag to false to signal that the queue is - not ready to be used in a new job_queue_run_jobs or - job_queue_add_job method call as it has not been reset yet. Not - resetting the queue here implies that the queue object is still - available for queries after this method has finished - */ - queue->open = false; - queue->running = false; - pthread_mutex_unlock( &queue->run_mutex ); -} - - - - - -void * job_queue_run_jobs__(void * __arg_pack) { - arg_pack_type * arg_pack = arg_pack_safe_cast(__arg_pack); - job_queue_type * queue = arg_pack_iget_ptr(arg_pack , 0); - int num_total_run = arg_pack_iget_int(arg_pack , 1); - bool verbose = arg_pack_iget_bool(arg_pack , 2); - - job_queue_run_jobs(queue , num_total_run , verbose); - arg_pack_free( arg_pack ); - return NULL; -} - - -void job_queue_start_manager_thread( job_queue_type * job_queue , pthread_t * queue_thread , int job_size , bool verbose) { - - arg_pack_type * queue_args = arg_pack_alloc(); /* This arg_pack will be freed() in the job_que_run_jobs__() */ - arg_pack_append_ptr(queue_args , job_queue); - arg_pack_append_int(queue_args , job_size); - arg_pack_append_bool(queue_args , verbose); - - job_queue->running = true; - pthread_create( queue_thread , NULL , job_queue_run_jobs__ , queue_args); -} - - - - -/** - The most flexible use scenario is as follows: - - 1. The job_queue_run_jobs() is run by one thread. - 2. Jobs are added asyncronously with job_queue_add_job() from othread threads(s). - - - Unfortunately it does not work properly (i.e. Ctrl-C breaks) to use a Python - thread to invoke the job_queue_run_jobs() function; and this function is - mainly a workaround around that problem. The function will create a new - thread and run job_queue_run_jobs() in that thread; the calling thread will - just return. - - No reference is retained to the thread actually running the - job_queue_run_jobs() function. -*/ - - -void job_queue_run_jobs_threaded(job_queue_type * queue , int num_total_run, bool verbose) { - pthread_t queue_thread; - job_queue_start_manager_thread( queue , &queue_thread , num_total_run , verbose ); - pthread_detach( queue_thread ); /* Signal that the thread resources should be cleaned up when - the thread has exited. */ -} - - - -/*****************************************************************/ -/* Adding new jobs - it is complicated ... */ - - -/** - This initializes the non-driver-spesific fields of a job, i.e. the - name, runpath and so on, and sets the job->status == - JOB_QUEUE_WAITING. This status means the job is ready to be - submitted proper to one of the drivers (when a slot is ready). - When submitted the job will get (driver specific) job_data != NULL - and status SUBMITTED. -*/ - - - - -int job_queue_add_job(job_queue_type * queue , - const char * run_cmd , - job_callback_ftype * done_callback, - job_callback_ftype * retry_callback, - job_callback_ftype * exit_callback, - void * callback_arg , - int num_cpu , - const char * run_path , - const char * job_name , - int argc , - const char ** argv) { - - - if (job_queue_accept_jobs(queue)) { - int queue_index; - job_queue_node_type * node = job_queue_node_alloc( job_name , - run_path , - run_cmd , - argc , - argv , - num_cpu , - queue->ok_file , - queue->status_file , - queue->exit_file, - done_callback , - retry_callback , - exit_callback , - callback_arg ); - if (node) { - job_list_get_wrlock( queue->job_list ); - { - job_list_add_job( queue->job_list , node ); - queue_index = job_queue_node_get_queue_index(node); - job_queue_change_node_status(queue , node , JOB_QUEUE_WAITING); - } - job_list_unlock( queue->job_list ); - return queue_index; /* Handle used by the calling scope. */ - } else { - char * cwd = util_alloc_cwd(); - util_abort("%s: failed to create job %s in path: %s cwd:%s \n",__func__ , job_name , run_path , cwd); - return -1; - } - } else - return -1; -} - - -UTIL_SAFE_CAST_FUNCTION( job_queue , JOB_QUEUE_TYPE_ID) - - -/** - Observe that the job_queue returned by this function is NOT ready - for use; a driver must be set explicitly with a call to - job_queue_set_driver() first. -*/ - -job_queue_type * job_queue_alloc(int max_submit , - const char * ok_file , - const char * status_file , - const char * exit_file ) { - - - - job_queue_type * queue = util_malloc(sizeof * queue ); - UTIL_TYPE_ID_INIT( queue , JOB_QUEUE_TYPE_ID); - queue->usleep_time = 250000; /* 1000000 : 1 second */ - queue->max_ok_wait_time = 60; - queue->max_duration = 0; - queue->stop_time = 0; - queue->max_submit = max_submit; - queue->driver = NULL; - queue->ok_file = util_alloc_string_copy( ok_file ); - queue->exit_file = util_alloc_string_copy( exit_file ); - queue->status_file = util_alloc_string_copy( status_file ); - queue->open = true; - queue->user_exit = false; - queue->pause_on = false; - queue->running = false; - queue->submit_complete = false; - queue->work_pool = NULL; - queue->job_list = job_list_alloc( ); - queue->status = job_queue_status_alloc( ); - - pthread_mutex_init( &queue->run_mutex , NULL ); - - return queue; -} - - -/** - When the job_queue_run_jobs() has been called with @total_num_jobs - == 0 that means that the total number of jobs to run is not known - in advance. In that case it is essential to signal the queue when - we will not submit any more jobs, so that it can finalize and - return. That is done with the function job_queue_submit_complete() -*/ - -void job_queue_submit_complete( job_queue_type * queue ){ - queue->submit_complete = true; -} - - - -/** - The calling scope must retain a handle to the current driver and - free it. Should (in principle) be possible to change driver on a - running system whoaaa. Will read and update the max_running value - from the driver. -*/ - -void job_queue_set_driver(job_queue_type * queue , queue_driver_type * driver) { - queue->driver = driver; -} - - -bool job_queue_has_driver(const job_queue_type * queue ) { - if (queue->driver == NULL) - return false; - else - return true; -} - - -void job_queue_set_max_submit( job_queue_type * job_queue , int max_submit ) { - job_queue->max_submit = max_submit; -} - - -int job_queue_get_max_submit(const job_queue_type * job_queue ) { - return job_queue->max_submit; -} - - -/** - Returns true if the queue is currently paused, which means that no - more jobs are submitted. -*/ - -bool job_queue_get_pause( const job_queue_type * job_queue ) { - return job_queue->pause_on; -} - - -void job_queue_set_pause_on( job_queue_type * job_queue) { - job_queue->pause_on = true; -} - - -void job_queue_set_pause_off( job_queue_type * job_queue) { - job_queue->pause_on = false; -} - -/* - An external thread sets the user_exit flag to true, then - subsequently the thread managing the queue will see this, and close - down the queue. Will check that the queue is actually running before - setting the user_exit flag. If the queue does not change to running - state within a timeout limit the user_exit flag is not set, and the - function return false. -*/ - -bool job_queue_start_user_exit( job_queue_type * queue) { - if (!queue->user_exit) { - int timeout_limit = 10 * 1000000; // 10 seconds - int usleep_time = 100000; // 0.1 second - int total_sleep = 0; - - while (true) { - if (queue->running) { - queue->user_exit = true; - break; - } - usleep( usleep_time ); - total_sleep += usleep_time; - - if (total_sleep > timeout_limit) - break; - } - } - return queue->user_exit; -} - -bool job_queue_get_user_exit( const job_queue_type * queue) { - return queue->user_exit; -} - -void job_queue_free(job_queue_type * queue) { - util_safe_free( queue->ok_file ); - util_safe_free( queue->exit_file ); - job_list_free( queue->job_list ); - job_queue_status_free( queue->status ); - free(queue); -} - - - - - - -int job_queue_get_max_running_option(queue_driver_type * driver) { - char * max_running_string = (char*)queue_driver_get_option(driver, MAX_RUNNING); - int max_running; - if (!util_sscanf_int(max_running_string, &max_running)) { - fprintf(stderr, "%s: Unable to parse option MAX_RUNNING with value %s to an int", __func__, max_running_string); - } - return max_running; -} - - -void job_queue_set_max_running_option(queue_driver_type * driver, int max_running) { - char * max_running_string = util_alloc_sprintf("%d", max_running); - queue_driver_set_option(driver, MAX_RUNNING, max_running_string); - free(max_running_string); -} - - -/** - Observe that if the max number of running jobs is decreased, - nothing will be done to reduce the number of jobs currently - running; but no more jobs will be submitted until the number of - running has fallen below the new limit. - - The updated value will also be pushed down to the current driver. - - NOTE: These next three *max_running functions should not be used, rather - use the set_option feature, with MAX_RUNNING. They are (maybe) used by python - therefore not removed. -*/ -int job_queue_get_max_running( const job_queue_type * queue ) { - return job_queue_get_max_running_option(queue->driver); -} - -void job_queue_set_max_running( job_queue_type * queue , int max_running ) { - job_queue_set_max_running_option(queue->driver, max_running); -} diff --git a/ThirdParty/Ert/libjob_queue/src/job_queue_manager.c b/ThirdParty/Ert/libjob_queue/src/job_queue_manager.c deleted file mode 100644 index eeede2c8fb..0000000000 --- a/ThirdParty/Ert/libjob_queue/src/job_queue_manager.c +++ /dev/null @@ -1,182 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'job_queue_manager.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#define _GNU_SOURCE /* Must define this to get access to pthread_rwlock_t */ -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#define JOB_QUEUE_MANAGER_TYPE_ID 81626006 - - - -struct job_queue_manager_struct { - UTIL_TYPE_ID_DECLARATION; - pthread_t queue_thread; - job_queue_type * job_queue; -}; - - -UTIL_IS_INSTANCE_FUNCTION( job_queue_manager , JOB_QUEUE_MANAGER_TYPE_ID ) - - -job_queue_manager_type * job_queue_manager_alloc( job_queue_type * job_queue ) { - job_queue_manager_type * manager = util_malloc( sizeof * manager ); - UTIL_TYPE_ID_INIT( manager , JOB_QUEUE_MANAGER_TYPE_ID ); - manager->job_queue = job_queue; - return manager; -} - - -void job_queue_manager_free( job_queue_manager_type * manager) { - free( manager ); -} - - -void job_queue_manager_start_queue( job_queue_manager_type * manager , int num_total_run , bool verbose , bool reset_queue) { - if (reset_queue) - job_queue_reset( manager->job_queue ); - - job_queue_start_manager_thread( manager->job_queue , &manager->queue_thread , num_total_run , verbose ); -} - - - -void job_queue_manager_wait( job_queue_manager_type * manager) { - pthread_join( manager->queue_thread , NULL ); -} - - -bool job_queue_manager_try_wait( job_queue_manager_type * manager , int timeout_seconds) { - struct timespec ts; - time_t timeout_time = time( NULL ); - - util_inplace_forward_seconds_utc(&timeout_time , timeout_seconds ); - ts.tv_sec = timeout_time; - ts.tv_nsec = 0; - -#ifdef HAVE_TIMEDJOIN - { - int join_return = pthread_timedjoin_np( manager->queue_thread , NULL , &ts); /* Wait for the main thread to complete. */ - if (join_return == 0) - return true; - else - return false; - } -#else - while(true) { - if (pthread_kill(manager->queue_thread, 0) == 0){ - util_yield(); - } else { - return true; - } - - time_t now = time(NULL); - - if(util_difftime_seconds(now, timeout_time) <= 0) { - return false; - } - } - -#endif -} - - - -bool job_queue_manager_is_running( const job_queue_manager_type * manager) { - return job_queue_is_running( manager->job_queue ); -} - - -int job_queue_manager_get_num_waiting( const job_queue_manager_type * manager) { - return job_queue_get_num_waiting( manager->job_queue ); -} - - -int job_queue_manager_get_num_running( const job_queue_manager_type * manager) { - return job_queue_get_num_running( manager->job_queue ); -} - - -int job_queue_manager_get_num_success( const job_queue_manager_type * manager) { - return job_queue_get_num_complete( manager->job_queue ); -} - -int job_queue_manager_get_num_failed( const job_queue_manager_type * manager) { - return job_queue_get_num_failed( manager->job_queue ); -} - - - -bool job_queue_manager_job_complete( const job_queue_manager_type * manager , int job_index) { - job_status_type status = job_queue_iget_job_status( manager->job_queue , job_index ); - if (status & JOB_QUEUE_COMPLETE_STATUS) - return true; - else - return false; -} - - -bool job_queue_manager_job_waiting( const job_queue_manager_type * manager , int job_index) { - job_status_type status = job_queue_iget_job_status( manager->job_queue , job_index ); - if (status & JOB_QUEUE_WAITING_STATUS) - return true; - else - return false; -} - -bool job_queue_manager_job_running( const job_queue_manager_type * manager , int job_index) { - job_status_type status = job_queue_iget_job_status( manager->job_queue , job_index ); - if (status == JOB_QUEUE_RUNNING) - return true; - else - return false; -} - - -bool job_queue_manager_job_failed( const job_queue_manager_type * manager , int job_index) { - job_status_type status = job_queue_iget_job_status( manager->job_queue , job_index ); - if (status == JOB_QUEUE_FAILED) - return true; - else - return false; -} - - -bool job_queue_manager_job_success( const job_queue_manager_type * manager , int job_index) { - job_status_type status = job_queue_iget_job_status( manager->job_queue , job_index ); - if (status == JOB_QUEUE_SUCCESS) - return true; - else - return false; -} - -job_status_type job_queue_manager_iget_job_status(const job_queue_manager_type * manager, int job_index) { - return job_queue_iget_job_status(manager->job_queue, job_index); -} - diff --git a/ThirdParty/Ert/libjob_queue/src/job_queue_status.c b/ThirdParty/Ert/libjob_queue/src/job_queue_status.c deleted file mode 100644 index a862283a07..0000000000 --- a/ThirdParty/Ert/libjob_queue/src/job_queue_status.c +++ /dev/null @@ -1,150 +0,0 @@ -/* - Copyright (C) 2015 Statoil ASA, Norway. - - The file 'job_status_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include - -#include -#include - -#include -#include - -#define JOB_QUEUE_STATUS_TYPE_ID 777620306 - -struct job_queue_status_struct { - UTIL_TYPE_ID_DECLARATION; - int status_list[JOB_QUEUE_MAX_STATE]; - pthread_mutex_t update_mutex; -}; - -static const int status_index[] = { JOB_QUEUE_NOT_ACTIVE , // Initial, allocated job state, job not added - controlled by job_queue - JOB_QUEUE_WAITING , // The job is ready to be started - controlled by job_queue - JOB_QUEUE_SUBMITTED , // Job is submitted to driver - temporary state - controlled by job_queue - JOB_QUEUE_PENDING , // Job is pending, before actual execution - controlled by queue_driver - JOB_QUEUE_RUNNING , // Job is executing - controlled by queue_driver - JOB_QUEUE_DONE , // Job is done (successful or not), temporary state - controlled/returned by by queue_driver - JOB_QUEUE_EXIT , // Job is done, with exit status != 0, temporary state - controlled/returned by by queue_driver - JOB_QUEUE_IS_KILLED , // Job has been killed, due to JOB_QUEUE_DO_KILL, FINAL STATE - controlled by job_queue - JOB_QUEUE_DO_KILL , // User / queue system has requested killing of job - controlled by job_queue / external scope - JOB_QUEUE_SUCCESS , // All good, comes after JOB_QUEUE_DONE, with additional checks, FINAL STATE - controlled by job_queue - JOB_QUEUE_RUNNING_CALLBACK, // Temporary state, while running requested callbacks after an ended job - controlled by job_queue - JOB_QUEUE_FAILED , // Job has failed, no more retries, FINAL STATE - JOB_QUEUE_DO_KILL_NODE_FAILURE // Job has failed, node should be blacklisted - }; - -static int STATUS_INDEX( job_status_type status ) { - int index = 0; - - while (true) { - if (status_index[index] == status) - return index; - - index++; - if (index == JOB_QUEUE_MAX_STATE) - util_abort("%s: failed to get index from status:%d \n",__func__ , status); - } -} - - -UTIL_IS_INSTANCE_FUNCTION( job_queue_status , JOB_QUEUE_STATUS_TYPE_ID ) -UTIL_SAFE_CAST_FUNCTION( job_queue_status , JOB_QUEUE_STATUS_TYPE_ID ) - - -job_queue_status_type * job_queue_status_alloc() { - job_queue_status_type * status = util_malloc( sizeof * status ); - UTIL_TYPE_ID_INIT( status , JOB_QUEUE_STATUS_TYPE_ID ); - pthread_mutex_init( &status->update_mutex , NULL ); - job_queue_status_clear( status ); - return status; -} - - -void job_queue_status_free( job_queue_status_type * status ) { - free( status ); -} - - -void job_queue_status_clear( job_queue_status_type * status ) { - int index; - for (index = 0; index < JOB_QUEUE_MAX_STATE; index++) - status->status_list[ index ] = 0; -} - - -int job_queue_status_get_count( job_queue_status_type * status_count , job_status_type status_type) { - int index = STATUS_INDEX( status_type ); - int count; - - count = status_count->status_list[index]; - - return count; -} - - -void job_queue_status_inc( job_queue_status_type * status_count , job_status_type status_type) { - int index = STATUS_INDEX( status_type ); - - pthread_mutex_lock( &status_count->update_mutex ); - { - int count = status_count->status_list[index]; - status_count->status_list[index] = count + 1; - } - pthread_mutex_unlock( &status_count->update_mutex ); -} - - -static void job_queue_status_dec( job_queue_status_type * status_count , job_status_type status_type) { - int index = STATUS_INDEX( status_type ); - - pthread_mutex_lock( &status_count->update_mutex ); - { - int count = status_count->status_list[index]; - status_count->status_list[index] = count - 1; - } - pthread_mutex_unlock( &status_count->update_mutex ); -} - - -/* - The important point is that each individual ++ and -- operation is - atomic, if the different status counts do not add up perfectly at - all times that is ok. -*/ -bool job_queue_status_transition(job_queue_status_type * status_count, job_status_type src_status, - job_status_type target_status) { - if (src_status == target_status) - return false; - - /* - The target_status indicates that the routine which queried for new - status failed; we just remain in the current status. - */ - if (target_status == JOB_QUEUE_STATUS_FAILURE) - return false; - - job_queue_status_dec( status_count, src_status ); - job_queue_status_inc( status_count, target_status ); - return true; -} - - -int job_queue_status_get_total_count( const job_queue_status_type * status ) { - int total_count = 0; - for (int index = 0; index < JOB_QUEUE_MAX_STATE; index++) - total_count += status->status_list[ index ]; - return total_count; -} diff --git a/ThirdParty/Ert/libjob_queue/src/local_driver.c b/ThirdParty/Ert/libjob_queue/src/local_driver.c deleted file mode 100644 index 52a16d5a64..0000000000 --- a/ThirdParty/Ert/libjob_queue/src/local_driver.c +++ /dev/null @@ -1,202 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'local_driver.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - - -struct local_job_struct { - UTIL_TYPE_ID_DECLARATION; - bool active; - job_status_type status; - pthread_t run_thread; - pid_t child_process; -}; - - -#define LOCAL_DRIVER_TYPE_ID 66196305 -#define LOCAL_JOB_TYPE_ID 63056619 - -struct local_driver_struct { - UTIL_TYPE_ID_DECLARATION; - pthread_attr_t thread_attr; - pthread_mutex_t submit_lock; -}; - -/*****************************************************************/ - - -static UTIL_SAFE_CAST_FUNCTION( local_driver , LOCAL_DRIVER_TYPE_ID ) -UTIL_SAFE_CAST_FUNCTION( local_job , LOCAL_JOB_TYPE_ID ) - - -local_job_type * local_job_alloc() { - local_job_type * job; - job = util_malloc(sizeof * job ); - UTIL_TYPE_ID_INIT( job , LOCAL_JOB_TYPE_ID ); - job->active = false; - job->status = JOB_QUEUE_WAITING; - return job; -} - -void local_job_free(local_job_type * job) { - if (job->active) { - /* Thread clean up */ - } - free(job); -} - - - -job_status_type local_driver_get_job_status(void * __driver, void * __job) { - if (__job == NULL) - /* The job has not been registered at all ... */ - return JOB_QUEUE_NOT_ACTIVE; - else { - local_job_type * job = local_job_safe_cast( __job ); - return job->status; - } -} - - - -void local_driver_free_job( void * __job ) { - local_job_type * job = local_job_safe_cast( __job ); - local_job_free(job); -} - - -void local_driver_kill_job( void * __driver , void * __job) { - local_job_type * job = local_job_safe_cast( __job ); - - if (job->active) { - pthread_cancel( job->run_thread ); - } - - kill( job->child_process , SIGTERM ); -} - - -void * submit_job_thread__(void * __arg) { - arg_pack_type *arg_pack = arg_pack_safe_cast(__arg); - const char *executable = arg_pack_iget_const_ptr(arg_pack, 0); - /* - The arg_pack contains a run_path field as the second argument, - it has therefor been left here as a comment: - - const char * run_path = arg_pack_iget_const_ptr(arg_pack , 1); - */ - int argc = arg_pack_iget_int(arg_pack, 2); - char **argv = arg_pack_iget_ptr(arg_pack, 3); - local_job_type *job = arg_pack_iget_ptr(arg_pack, 4); - - { - int wait_status; - job->child_process = util_spawn(executable, argc, (const char**) argv, NULL, NULL); - util_free_stringlist(argv, argc); - arg_pack_free(arg_pack); - waitpid(job->child_process, &wait_status, 0); - } - - job->status = JOB_QUEUE_DONE; - job->active = false; - pthread_exit(NULL); - return NULL; -} - - - -void * local_driver_submit_job(void * __driver , - const char * submit_cmd , - int num_cpu , /* Ignored */ - const char * run_path , - const char * job_name , - int argc , - const char ** argv ) { - local_driver_type * driver = local_driver_safe_cast( __driver ); - { - local_job_type * job = local_job_alloc(); - arg_pack_type * arg_pack = arg_pack_alloc(); - arg_pack_append_const_ptr( arg_pack , submit_cmd); - arg_pack_append_const_ptr( arg_pack , run_path ); - arg_pack_append_int( arg_pack , argc ); - arg_pack_append_ptr( arg_pack , util_alloc_stringlist_copy( argv , argc )); /* Due to conflict with threads and python GC we take a local copy. */ - arg_pack_append_ptr( arg_pack , job ); - - pthread_mutex_lock( &driver->submit_lock ); - job->active = true; - job->status = JOB_QUEUE_RUNNING; - - if (pthread_create( &job->run_thread , &driver->thread_attr , submit_job_thread__ , arg_pack) != 0) - util_abort("%s: failed to create run thread - aborting \n",__func__); - - pthread_mutex_unlock( &driver->submit_lock ); - return job; - } -} - - - -void local_driver_free(local_driver_type * driver) { - pthread_attr_destroy ( &driver->thread_attr ); - free(driver); - driver = NULL; -} - - -void local_driver_free__(void * __driver) { - local_driver_type * driver = local_driver_safe_cast( __driver ); - local_driver_free( driver ); -} - - -void * local_driver_alloc() { - local_driver_type * local_driver = util_malloc(sizeof * local_driver ); - UTIL_TYPE_ID_INIT( local_driver , LOCAL_DRIVER_TYPE_ID); - pthread_mutex_init( &local_driver->submit_lock , NULL ); - pthread_attr_init( &local_driver->thread_attr ); - pthread_attr_setdetachstate( &local_driver->thread_attr , PTHREAD_CREATE_DETACHED ); - - return local_driver; -} - - -bool local_driver_set_option( void * __driver , const char * option_key , const void * value){ - return false; -} - -void local_driver_init_option_list(stringlist_type * option_list) { - //No options specific for local driver; do nothing -} - -#undef LOCAL_DRIVER_ID -#undef LOCAL_JOB_ID - -/*****************************************************************/ - diff --git a/ThirdParty/Ert/libjob_queue/src/lsb.c b/ThirdParty/Ert/libjob_queue/src/lsb.c deleted file mode 100644 index e9f1f0f252..0000000000 --- a/ThirdParty/Ert/libjob_queue/src/lsb.c +++ /dev/null @@ -1,207 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'lsb.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -/* - This file implements a very small wrapper structure around the - lsb_xxxx() functions from the libbat.so shared library which are - used to submit, monitor and control simulations with LSF. - - Loading and initializing the lsf libraries is quite painful, in an - attempt to reduce unecessary dependencies the lsf libraries are - loaded with dlopen() in the lsb_alloc() function below. This means - that the libjob_queue.so shared library can be loaded without access - to the lsf libraries. -*/ - -#include -#include - -#include - -#include -#include - -#include - - - -typedef int (lsb_submit_ftype) ( struct submit * , struct submitReply *); -typedef int (lsb_openjobinfo_ftype) (int , char * , char * , char * , char * , int); -typedef struct jobInfoEnt * (lsb_readjobinfo_ftype) (int * ); -typedef int (lsb_closejobinfo_ftype) ( ); -typedef int (lsb_forcekilljob_ftype) ( int ); -typedef int (lsb_init_ftype) ( char * ); -typedef char * (lsb_sysmsg_ftype) ( ); - - - -struct lsb_struct { - lsb_submit_ftype * submit; - lsb_openjobinfo_ftype * open_job; - lsb_readjobinfo_ftype * read_job; - lsb_closejobinfo_ftype * close_job; - lsb_forcekilljob_ftype * kill_job; - lsb_init_ftype * lsb_init; - lsb_sysmsg_ftype * sys_msg; - - stringlist_type * error_list; - void * lib_bat; - void * lib_nsl; - void * lib_lsf; - bool ready; -}; - - - -static void * lsb_dlsym( lsb_type * lsb , const char * function_name ) { - void * function = dlsym( lsb->lib_bat , function_name ); - if (!function) { - lsb->ready = false; - stringlist_append_owned_ref( lsb->error_list , util_alloc_sprintf( "Failed to locate symbol:%s dlerror:%s" , function_name , dlerror())); - } - - return function; -} - - -void * lsb_dlopen( lsb_type * lsb , const char * lib_name) { - void * lib_handle = dlopen( lib_name , RTLD_NOW | RTLD_GLOBAL); - if (!lib_handle) { - lsb->ready = false; - stringlist_append_owned_ref( lsb->error_list , util_alloc_sprintf("dlopen(%s) - failed:%s \n" , lib_name , dlerror())); - } - return lib_handle; -} - -/* - The following environment variables must be set (at some stage) before - LSF will work properly: - - LSF_BINDIR $LSF_HOME/bin - LSF_LIBDIR $LSF_HOME/lib - XLSF_UIDDIR $LSF_HOME/lib/uid - LSF_SERVERDIR $LSF_HOME/etc - LSF_ENVDIR /prog/LSF/conf - - The runtime linker must locate the libnsl, libbat and liblsf - libraries using whatever method it usually does. If the loading - fails the lsb object will get the ->ready flag set to false, and the - lsf_driver will discard the lsb instance (and hopefully use shell - commands to perform job management). -*/ - -lsb_type * lsb_alloc() { - lsb_type * lsb = util_malloc( sizeof * lsb ); - lsb->ready = true; - lsb->error_list = stringlist_alloc_new(); - - lsb->lib_nsl = lsb_dlopen(lsb , "libnsl.so" ); - lsb->lib_lsf = lsb_dlopen(lsb , "liblsf.so" ); - lsb->lib_bat = lsb_dlopen(lsb , "libbat.so"); - - if (lsb->lib_bat) { - lsb->submit = (lsb_submit_ftype *) lsb_dlsym( lsb , "lsb_submit"); - lsb->open_job = (lsb_openjobinfo_ftype *) lsb_dlsym( lsb , "lsb_openjobinfo"); - lsb->read_job = (lsb_readjobinfo_ftype *) lsb_dlsym( lsb , "lsb_readjobinfo"); - lsb->close_job = (lsb_closejobinfo_ftype *) lsb_dlsym( lsb , "lsb_closejobinfo"); - lsb->kill_job = (lsb_forcekilljob_ftype *) lsb_dlsym( lsb , "lsb_forcekilljob"); - lsb->lsb_init = (lsb_init_ftype *) lsb_dlsym( lsb , "lsb_init"); - lsb->sys_msg = (lsb_sysmsg_ftype *) lsb_dlsym( lsb , "lsb_sysmsg"); - } - - return lsb; -} - - - -void lsb_free( lsb_type * lsb) { - stringlist_free( lsb->error_list ); - - if (lsb->lib_nsl) - dlclose( lsb->lib_nsl ); - - if (lsb->lib_lsf) - dlclose( lsb->lib_lsf ); - - if (lsb->lib_bat) - dlclose( lsb->lib_bat ); - - free( lsb ); -} - - - -bool lsb_ready( const lsb_type * lsb) { - return lsb->ready; -} - -stringlist_type * lsb_get_error_list( const lsb_type * lsb ) { - return lsb->error_list; -} - - -/*****************************************************************/ - -int lsb_initialize( const lsb_type * lsb) { - /* - The environment variable LSF_ENVDIR must be set to point the - directory containing LSF configuration information, the whole - thing will crash and burn if this is not properly set. - */ - if ( lsb->lsb_init(NULL) != 0 ) { - - fprintf(stderr,"LSF_ENVDIR: "); - if (getenv("LSF_ENVDIR") != NULL) - fprintf(stderr,"%s\n", getenv("LSF_ENVDIR")); - else - fprintf(stderr, "not set\n"); - - util_abort("%s failed to initialize LSF environment : %s \n",__func__ , lsb->sys_msg() ); - } - return 0; -} - - -int lsb_submitjob( const lsb_type * lsb , struct submit * submit_data, struct submitReply * reply_data) { - return lsb->submit( submit_data , reply_data ); -} - - -int lsb_killjob( const lsb_type * lsb , int lsf_jobnr) { - return lsb->kill_job(lsf_jobnr); -} - - -int lsb_openjob( const lsb_type * lsb , int lsf_jobnr) { - return lsb->open_job(lsf_jobnr , NULL , NULL , NULL , NULL , ALL_JOB); -} - - -int lsb_closejob( const lsb_type * lsb) { - return lsb->close_job(); -} - -char * lsb_sys_msg( const lsb_type * lsb) { - return lsb->sys_msg(); -} - - -struct jobInfoEnt * lsb_readjob( const lsb_type * lsb ) { - struct jobInfoEnt * job_info = lsb->read_job( NULL ); - return job_info; -} diff --git a/ThirdParty/Ert/libjob_queue/src/lsf_driver.c b/ThirdParty/Ert/libjob_queue/src/lsf_driver.c deleted file mode 100644 index ef4419b337..0000000000 --- a/ThirdParty/Ert/libjob_queue/src/lsf_driver.c +++ /dev/null @@ -1,1306 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'lsf_driver.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -#ifdef HAVE_LSF_LIBRARY -#include -#endif - - - - -/** - Documentation/examples of programming towards the lsf libraries can - be found in /prog/LSF/7.0/misc/examples -*/ - - -/* - How to call the lsf commands bsub/bjobs/bkill: - ---------------------------------------------- - - The commands to submit, monitor and modify LSF jobs are available - through library calls through the lsf library. This is a good - solution which works well. - - Unfortunately only quite few of the workstations in Statoil are - "designated LSF machines", meaning that they are allowed to talk to - the LIM servers, to be able to use the low-level lsb_xxx() function - calls the host making the calls must configured (by an LSF - administrator) to be a LSF client. - - The lsf_driver can either make use of the proper lsf library calls - (lsb_submit(), lsb_openjobinfo(), ...) or alternatively it can issue - ssh calls to an external LSF_SERVER and call up the bsub/bkill/bjob - executables on the remote server. - - All the functions with 'library' in the name are based on library - calls, and the functions with 'shell' in the name are based on - external functions (the actual calls are through the - util_spawn() function). - - By default the driver will use the library, but if a value is - provided with the LSF_SERVER option, the shell based functions will - be used. Internally this is goverened by the boolean flag - 'use_library_calls'. - - Even though you only intend to submit through the shell commands - bsub / bjobs / bkill the build process still requires access to the - lsf headers and the lsf library; that is probably not optimal. - - - Remote login shell - ------------------ - - When submitting with LSF the job will inherit the current - environment on the submitting host, and not read the users login - files on the remote host where the job is actually executed. E.g. in - situations where submitting host and executing host are - e.g. different operating system versions this might be - unfortunate. The '-L @shell' switch can used with bsub to force lsf - to source schell specific input files prior to executing your - job. This can be achieved with the LSF_LOGIN_SHELL option: - - lsf_driver_set_option( driver , LSF_LOGIN_SHELL , "/bin/csh" ); - -*/ - - - - - -#define LSF_DRIVER_TYPE_ID 10078365 -#define LSF_JOB_TYPE_ID 9963900 -#define MAX_ERROR_COUNT 100 -#define SUBMIT_ERROR_SLEEP 2 -#define BJOBS_REFRESH_TIME "10" -#define DEFAULT_RSH_CMD "/usr/bin/ssh" -#define DEFAULT_BSUB_CMD "bsub" -#define DEFAULT_BJOBS_CMD "bjobs" -#define DEFAULT_BKILL_CMD "bkill" -#define DEFAULT_BHIST_CMD "bhist" - - - -struct lsf_job_struct { - UTIL_TYPE_ID_DECLARATION; - long int lsf_jobnr; - int num_exec_host; - char **exec_host; - char * lsf_jobnr_char; /* Used to look up the job status in the bjobs_cache hash table */ -}; - - - -struct lsf_driver_struct { - UTIL_TYPE_ID_DECLARATION; - char * queue_name; - char * resource_request; - stringlist_type * exclude_hosts; - char * login_shell; - pthread_mutex_t submit_lock; - - lsf_submit_method_enum submit_method; - int submit_sleep; - - int error_count; - int max_error_count; - int submit_error_sleep; - - /*-----------------------------------------------------------------*/ - /* Fields used by the lsf library functions */ -#ifdef HAVE_LSF_LIBRARY - struct submit lsf_request; - struct submitReply lsf_reply; - lsb_type * lsb; -#endif - - /*-----------------------------------------------------------------*/ - /* Fields used by the shell based functions */ - bool debug_output; - int bjobs_refresh_interval; - time_t last_bjobs_update; - hash_type * my_jobs; /* A hash table of all jobs submitted by this ERT instance - - to ensure that we do not check status of old jobs in e.g. ZOMBIE status. */ - hash_type * status_map; - hash_type * bjobs_cache; /* The output of calling bjobs is cached in this table. */ - pthread_mutex_t bjobs_mutex; /* Only one thread should update the bjobs_chache table. */ - char * remote_lsf_server; - char * rsh_cmd; - char * bsub_cmd; - char * bjobs_cmd; - char * bkill_cmd; - char * bhist_cmd; -}; - - - - -/*****************************************************************/ - -UTIL_SAFE_CAST_FUNCTION( lsf_driver , LSF_DRIVER_TYPE_ID) -static UTIL_SAFE_CAST_FUNCTION_CONST( lsf_driver , LSF_DRIVER_TYPE_ID) -static UTIL_SAFE_CAST_FUNCTION( lsf_job , LSF_JOB_TYPE_ID) - -lsf_job_type * lsf_job_alloc() { - lsf_job_type * job; - job = util_malloc(sizeof * job); - job->num_exec_host = 0; - job->exec_host = NULL; - - job->lsf_jobnr = 0; - job->lsf_jobnr_char = NULL; - UTIL_TYPE_ID_INIT( job , LSF_JOB_TYPE_ID); - return job; -} - - - -void lsf_job_free(lsf_job_type * job) { - util_safe_free(job->lsf_jobnr_char); - util_free_stringlist(job->exec_host , job->num_exec_host); - free(job); -} - - -void lsf_job_export_hostnames( const lsf_job_type * job , stringlist_type * hostlist) { - int host_nr; - - stringlist_clear( hostlist ); - for (host_nr = 0; host_nr < job->num_exec_host; host_nr++) - stringlist_append_copy( hostlist , job->exec_host[ host_nr ]); -} - - -long lsf_job_get_jobnr( const lsf_job_type * job ) { - return job->lsf_jobnr; -} - -int lsf_job_parse_bsub_stdout(const char * bsub_cmd, const char * stdout_file) { - int jobid = 0; - if ((util_file_exists(stdout_file)) && (util_file_size(stdout_file) > 0)) { - FILE * stream = util_fopen(stdout_file , "r"); - if (util_fseek_string(stream , "<" , true , true)) { - char * jobid_string = util_fscanf_alloc_upto(stream , ">" , false); - if (jobid_string != NULL) { - util_sscanf_int( jobid_string , &jobid); - free( jobid_string ); - } - } - fclose( stream ); - - if (jobid == 0) { - char * file_content = util_fread_alloc_file_content( stdout_file , NULL ); - fprintf(stderr,"Failed to get lsf job id from file: %s \n",stdout_file ); - fprintf(stderr,"bsub command : %s \n",bsub_cmd ); - fprintf(stderr,"%s\n", file_content); - free( file_content ); - util_abort("%s: \n",__func__); - } - } - return jobid; -} - -/** - * Assumes fname points to a file with content "hname1:hname2:hname3" as written by lsf_job_write_bjobs_to_file - */ -stringlist_type * lsf_job_alloc_parse_hostnames(const char* fname) { - FILE *stream = util_fopen(fname, "r"); - - bool at_eof = false; - while (!at_eof) { - char * line = util_fscanf_alloc_line(stream, &at_eof); - if (line != NULL) { - stringlist_type * hosts = stringlist_alloc_from_split(line, ":"); // bjobs uses : as std. delimiter - - for (int i = 0; i < stringlist_get_size(hosts); i++) { - const char * host = stringlist_iget(hosts, i); - stringlist_type * h = stringlist_alloc_from_split(host, "*"); - stringlist_iset_copy(hosts, i, stringlist_iget(h, stringlist_get_size(h) - 1)); // hostname 4*be-lsf01 -> be-lsf01 - stringlist_free(h); - } - - free(line); - fclose(stream); - return hosts; - } - } - fclose(stream); - return stringlist_alloc_new(); -} - -char* lsf_job_write_bjobs_to_file(const char * bjobs_cmd, lsf_driver_type * driver, const long jobid) { - // will typically run "bjobs -noheader -o 'EXEC_HOST' jobid" - - const char * noheader = "-noheader"; - const char * fields = "EXEC_HOST"; - char * cmd = util_alloc_sprintf("%s %s -o '%s' %d", bjobs_cmd, noheader, fields, jobid); - - char * tmp_file = util_alloc_tmp_file("/tmp", "ert_job_exec_host", true); - - if (driver->submit_method == LSF_SUBMIT_REMOTE_SHELL) { - char ** argv = util_calloc(2, sizeof *argv); - argv[0] = driver->remote_lsf_server; - argv[1] = cmd; - util_spawn_blocking(driver->rsh_cmd, 2, (const char **) argv, tmp_file, NULL); - free(argv); - } else if (driver->submit_method == LSF_SUBMIT_LOCAL_SHELL) { - char ** argv = util_calloc(1, sizeof *argv); - argv[0] = ""; - util_spawn_blocking(cmd, 1, (const char **) argv, tmp_file, NULL); - } - free(cmd); - - return tmp_file; -} - - -static void lsf_driver_internal_error( const lsf_driver_type * driver ) { - fprintf(stderr , "\n\n"); - fprintf(stderr , "*****************************************************************\n"); - fprintf(stderr , "** The LSF driver can be configured and used in many different **\n"); - fprintf(stderr , "** ways. The important point is how we choose to submit: **\n"); - fprintf(stderr , "** **\n"); - fprintf(stderr , "** 1. Using the lsf library calls **\n"); - fprintf(stderr , "** 2. Using the bsub/bjobs/bkill commands locally **\n"); - fprintf(stderr , "** 3. Using the bsub/bjobs/bkill commands through ssh **\n"); - fprintf(stderr , "** **\n"); - fprintf(stderr , "** To chose between these three alternatives you set the remote**\n"); - fprintf(stderr , "** server with the lsf_driver_set_option() function. Passing **\n"); - fprintf(stderr , "** the value NULL will give alternative 1, passing the special **\n"); - fprintf(stderr , "** string \'%s\' will give alternative 2, and any other **\n",LOCAL_LSF_SERVER); - fprintf(stderr , "** value will submit through that host using ssh. **\n"); - fprintf(stderr , "** **\n"); - fprintf(stderr , "** The ability to submit thorugh lsf library calls must be **\n"); - fprintf(stderr , "** compiled in by defining the symbol \'HAVE_LSF_LIBRARY\' when **\n"); - fprintf(stderr , "** compiling. **\n"); - fprintf(stderr , "** **\n"); -#ifdef HAVE_LSF_LIBRARY - fprintf(stderr , "** This lsf driver has support for using lsf library calls. **\n"); -#else - fprintf(stderr , "** This lsf driver does NOT have support for using lsf **\n"); - fprintf(stderr , "** library calls; but you have tried to submit without setting **\n"); - fprintf(stderr , "** a value for LSF_SERVER. Set this and try again. **\n"); -#endif - fprintf(stderr , "*****************************************************************\n\n"); - exit(1); -} - - - -static void lsf_driver_assert_submit_method( const lsf_driver_type * driver ) { - if (driver->submit_method == LSF_SUBMIT_INVALID) { - lsf_driver_internal_error(driver); - } -} - - - - - -stringlist_type * lsf_driver_alloc_cmd(lsf_driver_type * driver , - const char * lsf_stdout , - const char * job_name , - const char * submit_cmd , - int num_cpu , - int job_argc, - const char ** job_argv) { - - stringlist_type * argv = stringlist_alloc_new(); - char * num_cpu_string = util_alloc_sprintf("%d" , num_cpu); - char * quoted_resource_request = NULL; - - /* - The resource request string contains spaces, and when passed - through the shell it must be protected with \"..\"; this applies - when submitting to a remote lsf server with ssh. However when - submitting to the local workstation using a bsub command the - command will be invoked with the util_spawn() command - and no - shell is involved. In this latter case we must avoid the \"...\" - quoting. - */ - - { - stringlist_type * select_list = stringlist_alloc_new(); - if (stringlist_get_size(driver->exclude_hosts) > 0) { - for (int i = 0; i < stringlist_get_size(driver->exclude_hosts); i++) { - char * exclude_host = util_alloc_sprintf("hname!='%s'", stringlist_iget(driver->exclude_hosts, i)); - stringlist_append_owned_ref(select_list, exclude_host); - } - } - - char * excludes_string = NULL; - char * req = ""; - char * resreq = NULL; - - if (stringlist_get_size(select_list) > 0) { - excludes_string = stringlist_alloc_joined_string(select_list, " && "); - if (driver->resource_request != NULL) { - resreq = util_alloc_string_copy(driver->resource_request); - util_string_tr(resreq, ']', ' '); // remove "]" from "select[A && B] - excludes_string = stringlist_alloc_joined_string(select_list, " && "); - req = util_alloc_sprintf("%s && %s]", resreq, excludes_string); - } else { - req = util_alloc_sprintf("select[%s]", excludes_string); - } - } else { - if (driver->resource_request != NULL) { - resreq = util_alloc_string_copy(driver->resource_request); - req = util_alloc_sprintf("%s", resreq); - } - } - if (resreq) - free(resreq); - - if (driver->submit_method == LSF_SUBMIT_REMOTE_SHELL) - quoted_resource_request = util_alloc_sprintf("\"%s\"", req); - else - quoted_resource_request = util_alloc_string_copy(req); - - free(req); - if (excludes_string) - free(excludes_string); - stringlist_free(select_list); - } - - if (driver->submit_method == LSF_SUBMIT_REMOTE_SHELL) - stringlist_append_ref( argv , driver->bsub_cmd); - - stringlist_append_ref( argv , "-o" ); - stringlist_append_copy( argv , lsf_stdout ); - if (driver->queue_name != NULL) { - stringlist_append_ref( argv , "-q" ); - stringlist_append_ref( argv , driver->queue_name ); - } - stringlist_append_ref( argv , "-J" ); - stringlist_append_ref( argv , job_name ); - stringlist_append_ref( argv , "-n" ); - stringlist_append_copy( argv , num_cpu_string ); - - if (quoted_resource_request != NULL) { - stringlist_append_ref( argv , "-R"); - stringlist_append_copy( argv , quoted_resource_request ); - } - - if (driver->login_shell != NULL) { - stringlist_append_ref( argv , "-L"); - stringlist_append_ref( argv , driver->login_shell ); - } - - stringlist_append_ref( argv , submit_cmd); - { - int iarg; - for (iarg = 0; iarg < job_argc; iarg++) - stringlist_append_ref( argv , job_argv[ iarg ]); - } - free( num_cpu_string ); - util_safe_free( quoted_resource_request ); - return argv; -} - - -/** - * Submit internal job (LSF_SUBMIT_INTERNAL) using system calls instead of - * invoking shell commands. This method only works when actually called from - * an LSF node. - * - * Note that this method does not support the EXCLUDE_HOST configuration option. - */ -static int lsf_driver_submit_internal_job( lsf_driver_type * driver , - const char * lsf_stdout , - const char * job_name , - const char * submit_cmd , - int num_cpu , - int argc, - const char ** argv) { - -#ifdef HAVE_LSF_LIBRARY - char * command; - { - buffer_type * command_buffer = buffer_alloc( 256 ); - buffer_strcat( command_buffer , submit_cmd ); - for (int iarg = 0; iarg < argc; iarg++) { - buffer_strcat( command_buffer , " "); - buffer_strcat( command_buffer , argv[ iarg ]); - } - command = buffer_get_data( command_buffer ); - buffer_free_container( command_buffer ); - } - - { - int options = SUB_JOB_NAME + SUB_OUT_FILE; - - if (driver->queue_name != NULL) - options += SUB_QUEUE; - - if (driver->resource_request != NULL) - options += SUB_RES_REQ; - - if (driver->login_shell != NULL) - options += SUB_LOGIN_SHELL; - - driver->lsf_request.options = options; - } - - driver->lsf_request.resReq = driver->resource_request; - driver->lsf_request.loginShell = driver->login_shell; - driver->lsf_request.queue = driver->queue_name; - driver->lsf_request.jobName = (char *) job_name; - driver->lsf_request.outFile = (char *) lsf_stdout; - driver->lsf_request.command = command; - driver->lsf_request.numProcessors = num_cpu; - - { - int lsf_jobnr = lsb_submitjob( driver->lsb , &driver->lsf_request , &driver->lsf_reply ); - free( command ); /* I trust the lsf layer is finished with the command? */ - if (lsf_jobnr <= 0) - fprintf(stderr,"%s: ** Warning: lsb_submit() failed: %s \n",__func__ , lsb_sys_msg( driver->lsb )); - - return lsf_jobnr; - } -#else - lsf_driver_internal_error( driver ); - return -1; -#endif -} - - - -static int lsf_driver_submit_shell_job(lsf_driver_type * driver , - const char * lsf_stdout , - const char * job_name , - const char * submit_cmd , - int num_cpu , - int job_argc, - const char ** job_argv) { - int job_id; - char * tmp_file = util_alloc_tmp_file("/tmp" , "enkf-submit" , true); - - { - stringlist_type * remote_argv = lsf_driver_alloc_cmd( driver , lsf_stdout , job_name , submit_cmd , num_cpu , job_argc , job_argv); - - if (driver->submit_method == LSF_SUBMIT_REMOTE_SHELL) { - char ** argv = util_calloc( 2 , sizeof * argv ); - argv[0] = driver->remote_lsf_server; - argv[1] = stringlist_alloc_joined_string( remote_argv , " "); - - if (driver->debug_output) - printf("Submitting: %s %s %s \n",driver->rsh_cmd , argv[0] , argv[1]); - - util_spawn_blocking(driver->rsh_cmd, 2, (const char **) argv, tmp_file, NULL); - - free( argv[1] ); - free( argv ); - } else if (driver->submit_method == LSF_SUBMIT_LOCAL_SHELL) { - char ** argv = stringlist_alloc_char_ref( remote_argv ); - - if (driver->debug_output) { - printf("Submitting: %s ",driver->bsub_cmd); - stringlist_fprintf(remote_argv , " " , stdout); - printf("\n"); - } - util_spawn_blocking(driver->bsub_cmd, stringlist_get_size( remote_argv), (const char **) argv, tmp_file, tmp_file); - free( argv ); - } - - stringlist_free( remote_argv ); - } - - job_id = lsf_job_parse_bsub_stdout(driver->bsub_cmd , tmp_file); - util_unlink_existing( tmp_file ); - free(tmp_file); - return job_id; -} - - - -static int lsf_driver_get_status__(lsf_driver_type * driver , const char * status, const char * job_id) { - if (hash_has_key( driver->status_map , status)) - return hash_get_int( driver->status_map , status); - else { - util_exit("The lsf_status:%s for job:%s is not recognized; call your LSF administrator - sorry :-( \n", status , job_id); - return -1; - } -} - - - -static void lsf_driver_update_bjobs_table(lsf_driver_type * driver) { - char * tmp_file = util_alloc_tmp_file("/tmp" , "enkf-bjobs" , true); - - if (driver->submit_method == LSF_SUBMIT_REMOTE_SHELL) { - char ** argv = util_calloc( 2 , sizeof * argv); - argv[0] = driver->remote_lsf_server; - argv[1] = util_alloc_sprintf("%s -a" , driver->bjobs_cmd); - util_spawn_blocking(driver->rsh_cmd, 2, (const char **) argv, tmp_file, NULL); - free( argv[1] ); - free( argv ); - } else if (driver->submit_method == LSF_SUBMIT_LOCAL_SHELL) { - char ** argv = util_calloc( 1 , sizeof * argv); - argv[0] = "-a"; - util_spawn_blocking(driver->bjobs_cmd, 1, (const char **) argv, tmp_file, NULL); - free( argv ); - } - - { - char user[32]; - char status[16]; - FILE *stream = util_fopen(tmp_file , "r");; - bool at_eof = false; - hash_clear(driver->bjobs_cache); - util_fskip_lines(stream , 1); - while (!at_eof) { - char * line = util_fscanf_alloc_line(stream , &at_eof); - if (line != NULL) { - int job_id_int; - - if (sscanf(line , "%d %s %s", &job_id_int , user , status) == 3) { - char * job_id = util_alloc_sprintf("%d" , job_id_int); - - if (hash_has_key( driver->my_jobs , job_id )) /* Consider only jobs submitted by this ERT instance - not old jobs lying around from the same user. */ - hash_insert_int(driver->bjobs_cache , job_id , lsf_driver_get_status__( driver , status , job_id)); - - free(job_id); - } - free(line); - } - } - fclose(stream); - } - util_unlink_existing(tmp_file); - free(tmp_file); -} - - - -static int lsf_driver_get_job_status_libary(void * __driver , void * __job) { - if (__job == NULL) - /* the job has not been registered at all ... */ - return JOB_QUEUE_NOT_ACTIVE; - else { - int status; - lsf_driver_type * driver = lsf_driver_safe_cast( __driver ); -#ifdef HAVE_LSF_LIBRARY - lsf_job_type * job = lsf_job_safe_cast( __job ); - if (lsb_openjob( driver->lsb , job->lsf_jobnr) != 1) { - /* - Failed to get information about the job - we boldly assume - the following situation has occured: - - 1. The job is running happily along. - 2. The lsf deamon is not responding for a long time. - 3. The job finishes, and is eventually expired from the LSF job database. - 4. The lsf deamon answers again - but can not find the job... - - */ - fprintf(stderr,"Warning: failed to get status information for job:%ld - assuming it is finished. \n", job->lsf_jobnr); - status = JOB_QUEUE_DONE; - } else { - struct jobInfoEnt *job_info = lsb_readjob( driver->lsb ); - if (job->num_exec_host == 0) { - job->num_exec_host = job_info->numExHosts; - job->exec_host = util_alloc_stringlist_copy( (const char **) job_info->exHosts , job->num_exec_host); - } - status = job_info->status; - lsb_closejob(driver->lsb); - } -#else - lsf_driver_internal_error( driver ); - /* the above function calls exit(), so this value is never returned */ - status = JOB_QUEUE_FAILED; -#endif - - return status; - } -} - - -static bool lsf_driver_run_bhist(lsf_driver_type * driver , lsf_job_type * job , int * pend_time , int * run_time) { - bool bhist_ok = true; - char * output_file = util_alloc_tmp_file("/tmp" , "bhist" , true); - - if (driver->submit_method == LSF_SUBMIT_REMOTE_SHELL) { - char ** argv = util_calloc( 2 , sizeof * argv); - argv[0] = driver->remote_lsf_server; - argv[1] = util_alloc_sprintf("%s %s" , driver->bhist_cmd , job->lsf_jobnr_char); - util_spawn_blocking(driver->rsh_cmd, 2, (const char **) argv, output_file, NULL); - free( argv[1] ); - free( argv ); - } else if (driver->submit_method == LSF_SUBMIT_LOCAL_SHELL) { - char ** argv = util_calloc( 1 , sizeof * argv); - argv[0] = job->lsf_jobnr_char; - util_spawn_blocking(driver->bjobs_cmd, 2, (const char **) argv, output_file, NULL); - free( argv ); - } - - { - char job_id[16]; - char user[32]; - char job_name[32]; - int psusp_time; - - FILE *stream = util_fopen(output_file , "r");; - util_fskip_lines(stream , 2); - - if ( fscanf( stream , "%s %s %s %d %d %d" , job_id , user , job_name , pend_time , &psusp_time , run_time) == 6) - bhist_ok = true; - else - bhist_ok = false; - - fclose( stream ); - } - util_unlink_existing(output_file); - free(output_file); - - return bhist_ok; -} - -/* - When a job has completed you can query the status using the bjobs - command for a while, and then the job will be evicted from the LSF - status table. If there have been connection problems with the LSF - server we can risk a situation where a job has completed and - subsequently evicted from the LSF status table, before we are able - to record the DONE/EXIT status. - - When a job is missing from the bjobs_cache table we as a last resort - invoke the bhist command (which is based on internal LSF data with - much longer lifetime) and measure the change in run_time and - pend_time between two subsequent calls: - - - 1. ((pend_time1 == pend_time2) && (run_time1 == run_time2)) : - Nothing is happening, and we assume that the job is DONE (this - method can not distinguish between DONE and EXIT). - - 2. (run_time2 > run_time1) : The job is running. - - 3. (pend_tim2 > pend_time1) : The job is pending. - - 4. Status unknown - have not got a clue?! -*/ - - -static int lsf_driver_get_bhist_status_shell( lsf_driver_type * driver , lsf_job_type * job) { - int status = JOB_STAT_UNKWN; - int sleep_time = 4; - int run_time1, run_time2, pend_time1 , pend_time2; - - fprintf(stderr,"** Warning: could not find status of job:%s using \'bjobs\' - trying with \'bhist\'.\n" , job->lsf_jobnr_char); - if (!lsf_driver_run_bhist( driver , job , &pend_time1 , &run_time1)) - return status; - - sleep( sleep_time ); - if (!lsf_driver_run_bhist( driver , job , &pend_time2 , &run_time2)) - return status; - - if ((run_time1 == run_time2) && (pend_time1 == pend_time2)) - status = JOB_STAT_DONE; - - if (pend_time2 > pend_time1) - status = JOB_STAT_PEND; - - if (run_time2 > run_time1) - status = JOB_STAT_RUN; - - return status; -} - - -static int lsf_driver_get_job_status_shell(void * __driver , void * __job) { - int status = JOB_STAT_NULL; - - if (__job != NULL) { - lsf_job_type * job = lsf_job_safe_cast( __job ); - lsf_driver_type * driver = lsf_driver_safe_cast( __driver ); - - { - /** - Updating the bjobs_table of the driver involves a significant change in - the internal state of the driver; that is semantically a bit - unfortunate because this is clearly a get() function; to protect - against concurrent updates of this table we use a mutex. - */ - pthread_mutex_lock( &driver->bjobs_mutex ); - { - bool update_cache = ((difftime(time(NULL) , driver->last_bjobs_update) > driver->bjobs_refresh_interval) || - (!hash_has_key( driver->bjobs_cache , job->lsf_jobnr_char) )); - if (update_cache) { - lsf_driver_update_bjobs_table(driver); - driver->last_bjobs_update = time( NULL ); - } - } - pthread_mutex_unlock( &driver->bjobs_mutex ); - - if (hash_has_key( driver->bjobs_cache , job->lsf_jobnr_char) ) - status = hash_get_int(driver->bjobs_cache , job->lsf_jobnr_char); - else { - /* - The job was not in the status cache, this *might* mean that - it has completed/exited and fallen out of the bjobs status - table maintained by LSF. We try calling bhist to get the status. - */ - status = lsf_driver_get_bhist_status_shell( driver , job ); - if (status != JOB_STAT_UNKWN) - hash_insert_int( driver->bjobs_cache , job->lsf_jobnr_char , status ); - } - } - } - - return status; -} - - -job_status_type lsf_driver_convert_status( int lsf_status ) { - job_status_type job_status; - switch (lsf_status) { - case JOB_STAT_NULL: - job_status = JOB_QUEUE_NOT_ACTIVE; - break; - case JOB_STAT_PEND: - job_status = JOB_QUEUE_PENDING; - break; - case JOB_STAT_SSUSP: - job_status = JOB_QUEUE_RUNNING; - break; - case JOB_STAT_USUSP: - job_status = JOB_QUEUE_RUNNING; - break; - case JOB_STAT_PSUSP: - job_status = JOB_QUEUE_RUNNING; - break; - case JOB_STAT_RUN: - job_status = JOB_QUEUE_RUNNING; - break; - case JOB_STAT_DONE: - job_status = JOB_QUEUE_DONE; - break; - case JOB_STAT_EXIT: - job_status = JOB_QUEUE_EXIT; - break; - case JOB_STAT_UNKWN: // Have lost contact with one of the daemons. - job_status = JOB_QUEUE_EXIT; - break; - case JOB_STAT_DONE + JOB_STAT_PDONE: // = 192. JOB_STAT_PDONE: the job had a - // post-execution script which completed - // successfully. - job_status = JOB_QUEUE_DONE; - break; - default: - job_status = JOB_QUEUE_NOT_ACTIVE; - util_abort("%s: unrecognized lsf status code:%d \n",__func__ , lsf_status ); - } - return job_status; -} - - -int lsf_driver_get_job_status_lsf(void * __driver , void * __job) { - int lsf_status; - lsf_driver_type * driver = lsf_driver_safe_cast( __driver ); - - if (driver->submit_method == LSF_SUBMIT_INTERNAL) - lsf_status = lsf_driver_get_job_status_libary(__driver , __job); - else - lsf_status = lsf_driver_get_job_status_shell(__driver , __job); - - return lsf_status; -} - - - -job_status_type lsf_driver_get_job_status(void * __driver , void * __job) { - int lsf_status = lsf_driver_get_job_status_lsf( __driver , __job ); - return lsf_driver_convert_status( lsf_status ); -} - - - - -void lsf_driver_free_job(void * __job) { - lsf_job_type * job = lsf_job_safe_cast( __job ); - lsf_job_free(job); -} - -static void lsf_driver_node_failure(lsf_driver_type * driver, long lsf_job_id) { - fprintf(stderr, "%s attempting to blacklist nodes for job id %ld.\n", __func__, lsf_job_id); - - { - char * fname = lsf_job_write_bjobs_to_file(driver->bsub_cmd, driver, lsf_job_id); - stringlist_type * hosts = lsf_job_alloc_parse_hostnames(fname); - char* hostnames = stringlist_alloc_joined_string(hosts, ", "); - fprintf(stderr, "%s blacklisting nodes %s.\n", __func__, hostnames); - - lsf_driver_add_exclude_hosts(driver, hostnames); - - util_free(hostnames); - stringlist_free(hosts); - util_free(fname); - } - -} - -void lsf_driver_blacklist_node(void * __driver, void * __job) { - lsf_driver_type * driver = lsf_driver_safe_cast(__driver); - lsf_job_type * job = lsf_job_safe_cast(__job); - long lsf_job_id = lsf_job_get_jobnr(job); - lsf_driver_node_failure(driver, lsf_job_id); -} - - -void lsf_driver_kill_job(void * __driver , void * __job) { - lsf_driver_type * driver = lsf_driver_safe_cast( __driver ); - lsf_job_type * job = lsf_job_safe_cast( __job ); - { - if (driver->submit_method == LSF_SUBMIT_INTERNAL) { -#ifdef HAVE_LSF_LIBRARY - lsb_killjob( driver->lsb , job->lsf_jobnr); -#else - lsf_driver_internal_error( driver ); -#endif - } else { - if (driver->submit_method == LSF_SUBMIT_REMOTE_SHELL) { - char ** argv = util_calloc( 2, sizeof * argv ); - argv[0] = driver->remote_lsf_server; - argv[1] = util_alloc_sprintf("%s %s" , driver->bkill_cmd , job->lsf_jobnr_char); - - util_spawn_blocking(driver->rsh_cmd, 2, (const char **) argv, NULL, NULL); - - free( argv[1] ); - free( argv ); - } else if (driver->submit_method == LSF_SUBMIT_LOCAL_SHELL) { - util_spawn_blocking(driver->bkill_cmd, 1, (const char **) &job->lsf_jobnr_char, NULL, NULL); - } - } - } -} - - - - - -void * lsf_driver_submit_job(void * __driver , - const char * submit_cmd , - int num_cpu , - const char * run_path , - const char * job_name , - int argc, - const char ** argv ) { - lsf_driver_type * driver = lsf_driver_safe_cast( __driver ); - lsf_driver_assert_submit_method( driver ); - { - lsf_job_type * job = lsf_job_alloc(); - usleep( driver->submit_sleep ); - - { - char * lsf_stdout = util_alloc_filename(run_path , job_name , "LSF-stdout"); - lsf_submit_method_enum submit_method = driver->submit_method; - pthread_mutex_lock( &driver->submit_lock ); - - if (driver->debug_output) - printf("LSF DRIVER submitting using method:%d \n",submit_method); - - if (submit_method == LSF_SUBMIT_INTERNAL) { - if (stringlist_get_size(driver->exclude_hosts) > 0) - printf("WARNING: EXCLUDE_HOST is not supported with submit method LSF_SUBMIT_INTERNAL"); - job->lsf_jobnr = lsf_driver_submit_internal_job( driver , lsf_stdout , job_name , submit_cmd , num_cpu , argc, argv); - } else { - job->lsf_jobnr = lsf_driver_submit_shell_job( driver , lsf_stdout , job_name , submit_cmd , num_cpu , argc, argv); - job->lsf_jobnr_char = util_alloc_sprintf("%ld" , job->lsf_jobnr); - hash_insert_ref( driver->my_jobs , job->lsf_jobnr_char , NULL ); - } - - pthread_mutex_unlock( &driver->submit_lock ); - free( lsf_stdout ); - } - - if (job->lsf_jobnr > 0) - return job; - else { - /* - The submit failed - the queue system shall handle - NULL return values. - */ - driver->error_count++; - - if (driver->error_count >= driver->max_error_count) - util_exit("Maximum number of submit errors exceeded - giving up\n"); - else { - fprintf(stderr,"** ERROR ** Failed when submitting to LSF - will try again.\n"); - usleep( driver->submit_error_sleep ); - } - - lsf_job_free(job); - return NULL; - } - } -} - - - -void lsf_driver_free(lsf_driver_type * driver ) { - util_safe_free(driver->login_shell); - util_safe_free(driver->queue_name); - util_safe_free(driver->resource_request ); - util_safe_free(driver->remote_lsf_server ); - util_safe_free(driver->rsh_cmd ); - stringlist_free(driver->exclude_hosts); - free( driver->bhist_cmd ); - free( driver->bkill_cmd ); - free( driver->bjobs_cmd ); - free( driver->bsub_cmd ); - - hash_free(driver->status_map); - hash_free(driver->bjobs_cache); - hash_free(driver->my_jobs); - -#ifdef HAVE_LSF_LIBRARY - if (driver->lsb != NULL) - lsb_free( driver->lsb ); -#endif - - free(driver); - driver = NULL; -} - -void lsf_driver_free__(void * __driver ) { - lsf_driver_type * driver = lsf_driver_safe_cast( __driver ); - lsf_driver_free( driver ); -} - - -static void lsf_driver_set_queue( lsf_driver_type * driver, const char * queue ) { - driver->queue_name = util_realloc_string_copy( driver->queue_name , queue); -} - - -static void lsf_driver_set_login_shell( lsf_driver_type * driver, const char * login_shell ) { - driver->login_shell = util_realloc_string_copy( driver->login_shell , login_shell); -} - -static void lsf_driver_set_rsh_cmd( lsf_driver_type * driver , const char * rsh_cmd) { - driver->rsh_cmd = util_realloc_string_copy( driver->rsh_cmd , rsh_cmd ); -} - -static void lsf_driver_set_bsub_cmd( lsf_driver_type * driver , const char * bsub_cmd) { - driver->bsub_cmd = util_realloc_string_copy( driver->bsub_cmd , bsub_cmd ); -} - -static void lsf_driver_set_bjobs_cmd( lsf_driver_type * driver , const char * bjobs_cmd) { - driver->bjobs_cmd = util_realloc_string_copy( driver->bjobs_cmd , bjobs_cmd ); -} - -static void lsf_driver_set_bkill_cmd( lsf_driver_type * driver , const char * bkill_cmd) { - driver->bkill_cmd = util_realloc_string_copy( driver->bkill_cmd , bkill_cmd ); -} - -static void lsf_driver_set_bhist_cmd( lsf_driver_type * driver , const char * bhist_cmd) { - driver->bhist_cmd = util_realloc_string_copy( driver->bhist_cmd , bhist_cmd ); -} - -#ifdef HAVE_LSF_LIBRARY -static void lsf_driver_set_internal_submit( lsf_driver_type * driver) { - /* No remote server has been set - assuming we can issue proper library calls. */ - /* The BSUB_QUEUE variable must NOT be set when using the shell - function, because then stdout is redirected and read. */ - - util_setenv("BSUB_QUIET" , "yes"); - driver->submit_method = LSF_SUBMIT_INTERNAL; - util_safe_free( driver->remote_lsf_server ); - driver->remote_lsf_server = NULL; -} -#endif - -static void lsf_driver_set_remote_server( lsf_driver_type * driver , const char * remote_server) { - if (remote_server == NULL) { -#ifdef HAVE_LSF_LIBRARY - if (driver->lsb) - lsf_driver_set_internal_submit( driver ); - else - lsf_driver_set_remote_server( driver , LOCAL_LSF_SERVER ); // If initializing the lsb layer failed we try the local shell commands. -#endif - } else { - driver->remote_lsf_server = util_realloc_string_copy( driver->remote_lsf_server , remote_server ); - util_unsetenv( "BSUB_QUIET" ); - { - char * tmp_server = util_alloc_strupr_copy( remote_server ); - - if (strcmp(tmp_server , LOCAL_LSF_SERVER) == 0) - driver->submit_method = LSF_SUBMIT_LOCAL_SHELL; - else if (strcmp(tmp_server , NULL_LSF_SERVER) == 0) // We trap the special string 'NULL' and call again with a true NULL pointer. - lsf_driver_set_remote_server( driver , NULL); - else - driver->submit_method = LSF_SUBMIT_REMOTE_SHELL; - - free( tmp_server ); - } - } -} - -void lsf_driver_add_exclude_hosts(lsf_driver_type * driver, const char * excluded) { - stringlist_type * host_list = stringlist_alloc_from_split(excluded, ", "); - for (int i = 0; i < stringlist_get_size(host_list); i++) { - const char * excluded = stringlist_iget(host_list, i); - if (!stringlist_contains(driver->exclude_hosts, excluded)) - stringlist_append_copy(driver->exclude_hosts, excluded); - } -} - -lsf_submit_method_enum lsf_driver_get_submit_method( const lsf_driver_type * driver ) { - return driver->submit_method; -} - - -static bool lsf_driver_set_debug_output( lsf_driver_type * driver , const char * arg) { - bool debug_output; - bool OK = util_sscanf_bool( arg , &debug_output); - if (OK) - driver->debug_output = debug_output; - - return OK; -} - - -static bool lsf_driver_set_submit_sleep( lsf_driver_type * driver , const char * arg) { - double submit_sleep; - bool OK = util_sscanf_double( arg , &submit_sleep); - if (OK) - driver->submit_sleep = (int) (1000000 * submit_sleep); - - return OK; -} - -void lsf_driver_set_bjobs_refresh_interval_option( lsf_driver_type * driver , const char * option_value) { - int refresh_interval; - if (util_sscanf_int( option_value , &refresh_interval)) - lsf_driver_set_bjobs_refresh_interval( driver , refresh_interval ); -} - - - -/*****************************************************************/ -/* Generic functions for runtime manipulation of options. - - LSF_SERVER - LSF_QUEUE - LSF_RESOURCE -*/ - -bool lsf_driver_set_option( void * __driver , const char * option_key , const void * value) { - lsf_driver_type * driver = lsf_driver_safe_cast( __driver ); - bool has_option = true; - { - if (strcmp( LSF_RESOURCE , option_key ) == 0) - driver->resource_request = util_realloc_string_copy( driver->resource_request , value ); - else if (strcmp( LSF_SERVER , option_key) == 0) - lsf_driver_set_remote_server( driver , value ); - else if (strcmp( LSF_QUEUE , option_key) == 0) - lsf_driver_set_queue( driver , value ); - else if (strcmp( LSF_LOGIN_SHELL , option_key) == 0) - lsf_driver_set_login_shell( driver , value ); - else if (strcmp( LSF_RSH_CMD , option_key) == 0) - lsf_driver_set_rsh_cmd( driver , value ); - else if (strcmp( LSF_BSUB_CMD , option_key) == 0) - lsf_driver_set_bsub_cmd( driver , value ); - else if (strcmp( LSF_BJOBS_CMD , option_key) == 0) - lsf_driver_set_bjobs_cmd( driver , value ); - else if (strcmp( LSF_BKILL_CMD , option_key) == 0) - lsf_driver_set_bkill_cmd( driver , value ); - else if (strcmp( LSF_BHIST_CMD , option_key) == 0) - lsf_driver_set_bhist_cmd( driver , value ); - else if (strcmp( LSF_DEBUG_OUTPUT , option_key) == 0) - lsf_driver_set_debug_output( driver , value ); - else if (strcmp( LSF_SUBMIT_SLEEP , option_key) == 0) - lsf_driver_set_submit_sleep( driver , value ); - else if (strcmp( LSF_EXCLUDE_HOST , option_key) == 0) - lsf_driver_add_exclude_hosts( driver , value ); - else if (strcmp( LSF_BJOBS_TIMEOUT , option_key) == 0) - lsf_driver_set_bjobs_refresh_interval_option( driver , value ); - else - has_option = false; - } - return has_option; -} - - -const void * lsf_driver_get_option( const void * __driver , const char * option_key) { - const lsf_driver_type * driver = lsf_driver_safe_cast_const( __driver ); - { - if (strcmp( LSF_RESOURCE , option_key ) == 0) - return driver->resource_request; - else if (strcmp( LSF_SERVER , option_key ) == 0) - return driver->remote_lsf_server; - else if (strcmp( LSF_QUEUE , option_key ) == 0) - return driver->queue_name; - else if (strcmp( LSF_LOGIN_SHELL , option_key ) == 0) - return driver->login_shell; - else if (strcmp( LSF_RSH_CMD , option_key ) == 0) - return driver->rsh_cmd; - else if (strcmp( LSF_BJOBS_CMD , option_key ) == 0) - return driver->bjobs_cmd; - else if (strcmp( LSF_BSUB_CMD , option_key ) == 0) - return driver->bsub_cmd; - else if (strcmp( LSF_BKILL_CMD , option_key ) == 0) - return driver->bkill_cmd; - else if (strcmp( LSF_BHIST_CMD , option_key ) == 0) - return driver->bhist_cmd; - else if (strcmp( LSF_BJOBS_TIMEOUT , option_key ) == 0) { - /* This will leak. */ - char * timeout_string = util_alloc_sprintf( "%d" , driver->bjobs_refresh_interval ); - return timeout_string; - } else { - util_abort("%s: option_id:%s not recognized for LSF driver \n",__func__ , option_key); - return NULL; - } - } -} - - - -bool lsf_driver_has_option( const void * __driver , const char * option_key) { - return false; -} - -void lsf_driver_init_option_list(stringlist_type * option_list) { - stringlist_append_ref(option_list, LSF_QUEUE); - stringlist_append_ref(option_list, LSF_RESOURCE); - stringlist_append_ref(option_list, LSF_SERVER); - stringlist_append_ref(option_list, LSF_RSH_CMD); - stringlist_append_ref(option_list, LSF_LOGIN_SHELL); - stringlist_append_ref(option_list, LSF_BSUB_CMD); - stringlist_append_ref(option_list, LSF_BJOBS_CMD); - stringlist_append_ref(option_list, LSF_BKILL_CMD); - stringlist_append_ref(option_list, LSF_BHIST_CMD); - stringlist_append_ref(option_list, LSF_BJOBS_TIMEOUT); -} - - - -/*****************************************************************/ - -/* - Observe that this driver IS not properly initialized when returning - from this function, the option interface must be used to set the - keys: -*/ - -void lsf_driver_set_bjobs_refresh_interval( lsf_driver_type * driver , int refresh_interval) { - driver->bjobs_refresh_interval = refresh_interval; -} - - - - -static void lsf_driver_lib_init( lsf_driver_type * lsf_driver ) { -#ifdef HAVE_LSF_LIBRARY - memset(&lsf_driver->lsf_request , 0 , sizeof (lsf_driver->lsf_request)); - lsf_driver->lsf_request.beginTime = 0; - lsf_driver->lsf_request.termTime = 0; - lsf_driver->lsf_request.numProcessors = 1; - lsf_driver->lsf_request.maxNumProcessors = 1; - { - int i; - for (i=0; i < LSF_RLIM_NLIMITS; i++) - lsf_driver->lsf_request.rLimits[i] = DEFAULT_RLIMIT; - } - lsf_driver->lsf_request.options2 = 0; - - lsf_driver->lsb = lsb_alloc(); - if (lsb_ready(lsf_driver->lsb)) - lsb_initialize(lsf_driver->lsb); - else { - lsb_free( lsf_driver->lsb ); - lsf_driver->lsb = NULL; - } -#endif -} - - - -static void lsf_driver_shell_init( lsf_driver_type * lsf_driver ) { - lsf_driver->last_bjobs_update = time( NULL ); - lsf_driver->bjobs_cache = hash_alloc(); - lsf_driver->my_jobs = hash_alloc(); - lsf_driver->status_map = hash_alloc(); - lsf_driver->bsub_cmd = NULL; - lsf_driver->bjobs_cmd = NULL; - lsf_driver->bkill_cmd = NULL; - lsf_driver->bhist_cmd = NULL; - - - hash_insert_int(lsf_driver->status_map , "PEND" , JOB_STAT_PEND); - hash_insert_int(lsf_driver->status_map , "SSUSP" , JOB_STAT_SSUSP); - hash_insert_int(lsf_driver->status_map , "PSUSP" , JOB_STAT_PSUSP); - hash_insert_int(lsf_driver->status_map , "USUSP" , JOB_STAT_USUSP); - hash_insert_int(lsf_driver->status_map , "RUN" , JOB_STAT_RUN); - hash_insert_int(lsf_driver->status_map , "EXIT" , JOB_STAT_EXIT); - hash_insert_int(lsf_driver->status_map , "ZOMBI" , JOB_STAT_EXIT); /* The ZOMBI status does not seem to be available from the api. */ - hash_insert_int(lsf_driver->status_map , "DONE" , JOB_STAT_DONE); - hash_insert_int(lsf_driver->status_map , "PDONE" , JOB_STAT_PDONE); /* Post-processor is done. */ - hash_insert_int(lsf_driver->status_map , "UNKWN" , JOB_STAT_UNKWN); /* Uncertain about this one */ - pthread_mutex_init( &lsf_driver->bjobs_mutex , NULL ); -} - - - -void * lsf_driver_alloc( ) { - lsf_driver_type * lsf_driver = util_malloc(sizeof * lsf_driver ); - UTIL_TYPE_ID_INIT( lsf_driver , LSF_DRIVER_TYPE_ID); - lsf_driver->submit_method = LSF_SUBMIT_INVALID; - lsf_driver->login_shell = NULL; - lsf_driver->queue_name = NULL; - lsf_driver->remote_lsf_server = NULL; - lsf_driver->rsh_cmd = NULL; - lsf_driver->resource_request = NULL; - lsf_driver->error_count = 0; - lsf_driver->max_error_count = MAX_ERROR_COUNT; - lsf_driver->submit_error_sleep = SUBMIT_ERROR_SLEEP * 1000000; - lsf_driver->exclude_hosts = stringlist_alloc_new(); - pthread_mutex_init( &lsf_driver->submit_lock , NULL ); - - lsf_driver_lib_init( lsf_driver ); - lsf_driver_shell_init( lsf_driver ); - - lsf_driver_set_option( lsf_driver , LSF_SERVER , NULL ); - lsf_driver_set_option( lsf_driver , LSF_RSH_CMD , DEFAULT_RSH_CMD ); - lsf_driver_set_option( lsf_driver , LSF_BSUB_CMD , DEFAULT_BSUB_CMD ); - lsf_driver_set_option( lsf_driver , LSF_BJOBS_CMD , DEFAULT_BJOBS_CMD ); - lsf_driver_set_option( lsf_driver , LSF_BKILL_CMD , DEFAULT_BKILL_CMD ); - lsf_driver_set_option( lsf_driver , LSF_BHIST_CMD , DEFAULT_BHIST_CMD ); - lsf_driver_set_option( lsf_driver , LSF_DEBUG_OUTPUT , "FALSE"); - lsf_driver_set_option( lsf_driver , LSF_SUBMIT_SLEEP , DEFAULT_SUBMIT_SLEEP); - lsf_driver_set_option( lsf_driver , LSF_BJOBS_TIMEOUT , BJOBS_REFRESH_TIME); - return lsf_driver; -} - - -/*****************************************************************/ - diff --git a/ThirdParty/Ert/libjob_queue/src/queue_driver.c b/ThirdParty/Ert/libjob_queue/src/queue_driver.c deleted file mode 100644 index e171ba5bb0..0000000000 --- a/ThirdParty/Ert/libjob_queue/src/queue_driver.c +++ /dev/null @@ -1,390 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'queue_driver.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. - */ - -#include -#include - -#include - -#include -#include -#include -#include -#include - - -/** - This file implements the datatype queue_driver_type which is an - abstract datatype for communicating with a subsystem for - communcating with other low-level systems for running external - jobs. The job_queue instance, which will handle a queue of jobs, - interacts with the jobs through a queue_driver instance. - - The queue_driver type is a quite small datastructure which "wraps" - and underlying specific driver instance; examples of specific - driver instances are the lsf_driver which communicates with the LSF - system and the local_driver which runs jobs directly on the current - workstation. The queue_driver type contains essentially three - different types of fields: - - 1. Functions pointers for manipulating the jobs, and the state of - the low-level driver. - - 2. An opaque (i.e. void *) pointer to the state of the low level - driver. This will be passed as first argument to all the - function pointers, e.g. like the "self" in Python methods. - - 3. Some data fields which are common to all driver types. - - */ - -#define QUEUE_DRIVER_ID 86516032 - -struct queue_driver_struct { - UTIL_TYPE_ID_DECLARATION; - /* - Function pointers - pointing to low level functions in the implementations of - e.g. lsf_driver. - */ - submit_job_ftype * submit; - free_job_ftype * free_job; - kill_job_ftype * kill_job; - blacklist_node_ftype * blacklist_node; - get_status_ftype * get_status; - free_queue_driver_ftype * free_driver; - set_option_ftype * set_option; - get_option_ftype * get_option; - has_option_ftype * has_option; - init_option_list_ftype * init_options; - - void * data; /* Driver specific data - passed as first argument to the driver functions above. */ - - /* - Generic data - common to all driver types. - */ - char * name; /* String name of driver. */ - job_driver_type driver_type; /* Enum value for driver. */ - char * max_running_string; - int max_running; /* Possible to maintain different max_running values for different - drivers; the value 0 is interpreted as no limit - i.e. the queue layer - will (try) to send an unlimited number of jobs to the driver. */ - -}; - - - -/*****************************************************************/ - - -/*****************************************************************/ - -void queue_driver_set_max_running(queue_driver_type * driver, int max_running) { - driver->max_running_string = util_realloc_sprintf(driver->max_running_string,"%d", max_running); - driver->max_running = max_running; -} - -int queue_driver_get_max_running(const queue_driver_type * driver) { - return driver->max_running; -} - -const char * queue_driver_get_name(const queue_driver_type * driver) { - return driver->name; -} - - -static bool queue_driver_set_generic_option__(queue_driver_type * driver, const char * option_key, const void * value) { - bool option_set = true; - { - if (strcmp(MAX_RUNNING, option_key) == 0) { - int max_running_int = 0; - if (util_sscanf_int(value, &max_running_int)) { - queue_driver_set_max_running(driver, max_running_int); - option_set = true; - } - else - option_set = false; - } else - option_set = false; - } - return option_set; -} - -static void * queue_driver_get_generic_option__(queue_driver_type * driver, const char * option_key) { - if (strcmp(MAX_RUNNING, option_key) == 0) { - return driver->max_running_string; - } else { - util_abort("%s: driver:%s does not support generic option %s\n", __func__, driver->name, option_key); - return NULL; - } -} - -static bool queue_driver_has_generic_option__(queue_driver_type * driver, const char * option_key) { - if (strcmp(MAX_RUNNING, option_key) == 0) - return true; - else - return false; -} - -/** - Set option - can also be used to perform actions - not only setting - of parameters. There is no limit :-) - */ -bool queue_driver_set_option(queue_driver_type * driver, const char * option_key, const void * value) { - if (queue_driver_set_generic_option__(driver, option_key, value)) { - return true; - } else if (driver->set_option != NULL) - /* The actual low level set functions can not fail! */ - return driver->set_option(driver->data, option_key, value); - else { - util_abort("%s: driver:%s does not support run time setting of options\n", __func__, driver->name); - return false; - } - return false; -} - - -/** - Observe that after the driver instance has been allocated it does - NOT support modification of the common fields, only the data owned - by the specific low level driver, i.e. the LSF data, can be - modified runtime. - - The driver returned from the queue_driver_alloc_empty() function is - NOT properly initialized and NOT ready for use. - */ - -static queue_driver_type * queue_driver_alloc_empty() { - queue_driver_type * driver = util_malloc(sizeof * driver); - UTIL_TYPE_ID_INIT(driver, QUEUE_DRIVER_ID); - driver->driver_type = NULL_DRIVER; - driver->submit = NULL; - driver->get_status = NULL; - driver->kill_job = NULL; - driver->free_job = NULL; - driver->free_driver = NULL; - driver->get_option = NULL; - driver->set_option = NULL; - driver->has_option = NULL; - driver->name = NULL; - driver->data = NULL; - driver->max_running_string = NULL; - driver->init_options = NULL; - - queue_driver_set_generic_option__(driver, MAX_RUNNING, "0"); - - return driver; -} - -static UTIL_SAFE_CAST_FUNCTION(queue_driver, QUEUE_DRIVER_ID) - - -/** - The driver created in this function has all the function pointers - correctly initialized; but no options have been set. I.e. unless - the driver in question needs no options (e.g. the LOCAL driver) the - returned driver will NOT be ready for use. - */ - - -queue_driver_type * queue_driver_alloc(job_driver_type type) { - queue_driver_type * driver = queue_driver_alloc_empty(); - driver->driver_type = type; - switch (type) { - case LSF_DRIVER: - driver->submit = lsf_driver_submit_job; - driver->get_status = lsf_driver_get_job_status; - driver->blacklist_node = lsf_driver_blacklist_node; - driver->kill_job = lsf_driver_kill_job; - driver->free_job = lsf_driver_free_job; - driver->free_driver = lsf_driver_free__; - driver->set_option = lsf_driver_set_option; - driver->get_option = lsf_driver_get_option; - driver->has_option = lsf_driver_has_option; - driver->name = util_alloc_string_copy("LSF"); - driver->init_options = lsf_driver_init_option_list; - driver->data = lsf_driver_alloc(); - break; - case LOCAL_DRIVER: - driver->submit = local_driver_submit_job; - driver->get_status = local_driver_get_job_status; - driver->blacklist_node = NULL; - driver->kill_job = local_driver_kill_job; - driver->free_job = local_driver_free_job; - driver->free_driver = local_driver_free__; - driver->name = util_alloc_string_copy("local"); - driver->init_options = local_driver_init_option_list; - driver->data = local_driver_alloc(); - break; - case RSH_DRIVER: - driver->submit = rsh_driver_submit_job; - driver->get_status = rsh_driver_get_job_status; - driver->blacklist_node = NULL; - driver->kill_job = rsh_driver_kill_job; - driver->free_job = rsh_driver_free_job; - driver->free_driver = rsh_driver_free__; - driver->set_option = rsh_driver_set_option; - driver->get_option = rsh_driver_get_option; - driver->name = util_alloc_string_copy("RSH"); - driver->init_options = rsh_driver_init_option_list; - driver->data = rsh_driver_alloc(); - break; - case TORQUE_DRIVER: - driver->submit = torque_driver_submit_job; - driver->get_status = torque_driver_get_job_status; - driver->blacklist_node = NULL; - driver->kill_job = torque_driver_kill_job; - driver->free_job = torque_driver_free_job; - driver->free_driver = torque_driver_free__; - driver->set_option = torque_driver_set_option; - driver->get_option = torque_driver_get_option; - driver->name = util_alloc_string_copy("TORQUE"); - driver->init_options = torque_driver_init_option_list; - driver->data = torque_driver_alloc(); - break; - default: - util_abort("%s: unrecognized driver type:%d \n", __func__, type); - } - - queue_driver_set_generic_option__(driver, MAX_RUNNING, "0"); - return driver; -} - - -/*****************************************************************/ - -bool queue_driver_has_option(queue_driver_type * driver, const char * option_key) { - if (driver->has_option != NULL) - return driver->has_option(driver, option_key); - else - return false; -} - -/*****************************************************************/ - -const void * queue_driver_get_option(queue_driver_type * driver, const char * option_key) { - if (queue_driver_has_generic_option__(driver, option_key)) { - return queue_driver_get_generic_option__(driver, option_key); - } else if (driver->get_option != NULL) - /* The actual low level set functions can not fail! */ - return driver->get_option(driver->data, option_key); - else { - util_abort("%s: driver:%s does not support run time reading of options\n", __func__, driver->name); - return NULL; - } - return NULL; -} - -/*****************************************************************/ - -void queue_driver_init_option_list(queue_driver_type * driver, stringlist_type * option_list) { - //Add options common for all driver types - stringlist_append_ref(option_list, MAX_RUNNING); - - //Add options for the specific driver type - if (driver->init_options) - driver->init_options(option_list); - else - util_abort("%s: driver:%s does not support run time reading of options\n", __func__, driver->name); - } - - -queue_driver_type * queue_driver_alloc_LSF(const char * queue_name, const char * resource_request, const char * remote_lsf_server) { - queue_driver_type * driver = queue_driver_alloc(LSF_DRIVER); - - queue_driver_set_option(driver, LSF_QUEUE, queue_name); - queue_driver_set_option(driver, LSF_RESOURCE, resource_request); - queue_driver_set_option(driver, LSF_SERVER, remote_lsf_server); - - return driver; -} - -queue_driver_type * queue_driver_alloc_TORQUE() { - queue_driver_type * driver = queue_driver_alloc(TORQUE_DRIVER); - return driver; -} - -queue_driver_type * queue_driver_alloc_RSH(const char * rsh_cmd, const hash_type * rsh_hostlist) { - queue_driver_type * driver = queue_driver_alloc(RSH_DRIVER); - - queue_driver_set_option(driver, RSH_HOSTLIST, rsh_hostlist); - queue_driver_set_option(driver, RSH_CMD, rsh_cmd); - - return driver; -} - -queue_driver_type * queue_driver_alloc_local() { - queue_driver_type * driver = queue_driver_alloc(LOCAL_DRIVER); - - /* No options set for the local driver. */ - - return driver; -} - -/* These are the functions used by the job_queue layer. */ - -void * queue_driver_submit_job(queue_driver_type * driver, const char * run_cmd, int num_cpu, const char * run_path, const char * job_name, int argc, const char ** argv) { - return driver->submit(driver->data, run_cmd, num_cpu, run_path, job_name, argc, argv); -} - -void queue_driver_free_job(queue_driver_type * driver, void * job_data) { - driver->free_job(job_data); -} - -void queue_driver_blacklist_node(queue_driver_type * driver, void * job_data) { - if (driver->driver_type == LSF_DRIVER) - driver->blacklist_node(driver->data, job_data); -} - -void queue_driver_kill_job(queue_driver_type * driver, void * job_data) { - driver->kill_job(driver->data, job_data); -} - -job_status_type queue_driver_get_status(queue_driver_type * driver, void * job_data) { - job_status_type status = driver->get_status(driver->data, job_data); - return status; -} - -void queue_driver_free_driver(queue_driver_type * driver) { - driver->free_driver(driver->data); -} - -/*****************************************************************/ - -void queue_driver_free(queue_driver_type * driver) { - queue_driver_free_driver(driver); - util_safe_free(driver->name); - util_safe_free(driver->max_running_string); - free(driver); -} - -void queue_driver_free__(void * driver) { - queue_driver_type * queue_driver = queue_driver_safe_cast(driver); - queue_driver_free(queue_driver); -} - - -/*****************************************************************/ - -/* Small functions to support enum introspection. */ - -const char * queue_driver_type_enum_iget(int index, int * value) { - - return util_enum_iget(index, JOB_DRIVER_ENUM_SIZE, (const util_enum_element_type []) { - JOB_DRIVER_ENUM_DEFS - }, value); -} diff --git a/ThirdParty/Ert/libjob_queue/src/rsh_driver.c b/ThirdParty/Ert/libjob_queue/src/rsh_driver.c deleted file mode 100644 index 5e6aa9d609..0000000000 --- a/ThirdParty/Ert/libjob_queue/src/rsh_driver.c +++ /dev/null @@ -1,484 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rsh_driver.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include - - -#include -#include -#include - -#include -#include - - - - - - -struct rsh_job_struct { - UTIL_TYPE_ID_DECLARATION; - bool active; /* Means that it allocated - not really in use */ - job_status_type status; - pthread_t run_thread; - const char * host_name; /* Currently not set */ - char * run_path; -}; - - - -typedef struct { - char * host_name; - int max_running; /* How many can the host handle. */ - int running; /* How many are currently running on the host (goverened by this driver instance that is). */ - pthread_mutex_t host_mutex; -} rsh_host_type; - - - -#define RSH_DRIVER_TYPE_ID 44963256 -#define RSH_JOB_TYPE_ID 63256701 - - -struct rsh_driver_struct { - UTIL_TYPE_ID_DECLARATION; - pthread_mutex_t submit_lock; - pthread_attr_t thread_attr; - char * rsh_command; - int num_hosts; - int last_host_index; - rsh_host_type **host_list; - hash_type *__host_hash; /* Stupid redundancy ... */ -}; - - - -/******************************************************************/ -static UTIL_SAFE_CAST_FUNCTION_CONST( rsh_driver , RSH_DRIVER_TYPE_ID ) -static UTIL_SAFE_CAST_FUNCTION( rsh_driver , RSH_DRIVER_TYPE_ID ) -static UTIL_SAFE_CAST_FUNCTION( rsh_job , RSH_JOB_TYPE_ID ) - - - -/** - If the host is for some reason not available, NULL should be - returned. Will also return NULL if some funny guy tries to allocate - with max_running <= 0. -*/ - -static rsh_host_type * rsh_host_alloc(const char * host_name , int max_running) { - if (max_running > 0) { - struct addrinfo * result; - if (getaddrinfo(host_name , NULL , NULL , &result) == 0) { - rsh_host_type * host = util_malloc(sizeof * host ); - - host->host_name = util_alloc_string_copy(host_name); - host->max_running = max_running; - host->running = 0; - pthread_mutex_init( &host->host_mutex , NULL ); - - freeaddrinfo( result ); - return host; - } else { - fprintf(stderr,"** Warning: could not locate server: %s \n",host_name); - return NULL; - } - } else - return NULL; -} - - - -static void rsh_host_free(rsh_host_type * rsh_host) { - free(rsh_host->host_name); - free(rsh_host); -} - - -static bool rsh_host_available(rsh_host_type * rsh_host) { - bool available; - - pthread_mutex_lock( &rsh_host->host_mutex ); - { - available = false; - if ((rsh_host->max_running - rsh_host->running) > 0) { // The host has free slots() - bool ping_ok = true; -#ifdef ERT_HAVE_PING - ping_ok = util_ping( rsh_host->host_name ); -#endif - if (ping_ok) { // The host answers to ping() - available = true; - rsh_host->running++; - } - } - } - pthread_mutex_unlock( &rsh_host->host_mutex ); - - return available; -} - - - - - -static void rsh_host_submit_job(rsh_host_type * rsh_host , rsh_job_type * job, const char * rsh_cmd , const char * submit_cmd , int num_cpu , int job_argc , const char ** job_argv) { - /* - Observe that this job has already been added to the running jobs - in the rsh_host_available function. - */ - int argc = job_argc + 2; - const char ** argv = util_malloc( argc * sizeof * argv ); - - argv[0] = rsh_host->host_name; - argv[1] = submit_cmd; - { - int iarg; - for (iarg = 0; iarg < job_argc; iarg++) - argv[iarg + 2] = job_argv[iarg]; - } - - util_spawn_blocking(rsh_cmd, argc, argv, NULL, NULL); /* This call is blocking. */ - job->status = JOB_QUEUE_DONE; - - pthread_mutex_lock( &rsh_host->host_mutex ); - rsh_host->running--; - pthread_mutex_unlock( &rsh_host->host_mutex ); - free( argv ); -} - - -/* - static const char * rsh_host_get_hostname(const rsh_host_type * host) { return host->host_name; } -*/ - - - -static void * rsh_host_submit_job__(void * __arg_pack) { - arg_pack_type * arg_pack = arg_pack_safe_cast(__arg_pack); - char * rsh_cmd = arg_pack_iget_ptr(arg_pack , 0); - rsh_host_type * rsh_host = arg_pack_iget_ptr(arg_pack , 1); - char * submit_cmd = arg_pack_iget_ptr(arg_pack , 2); - int num_cpu = arg_pack_iget_int(arg_pack , 3); - int argc = arg_pack_iget_int(arg_pack , 4); - const char ** argv = arg_pack_iget_ptr(arg_pack , 5); - rsh_job_type * job = arg_pack_iget_ptr(arg_pack , 6); - - rsh_host_submit_job(rsh_host , job , rsh_cmd , submit_cmd , num_cpu , argc , argv); - pthread_exit( NULL ); - arg_pack_free( arg_pack ); -} - - - - - -/*****************************************************************/ - - -/*****************************************************************/ - - - - -rsh_job_type * rsh_job_alloc(const char * run_path) { - rsh_job_type * job; - job = util_malloc(sizeof * job ); - job->active = false; - job->status = JOB_QUEUE_WAITING; - job->run_path = util_alloc_string_copy(run_path); - UTIL_TYPE_ID_INIT( job , RSH_JOB_TYPE_ID ); - return job; -} - - - -void rsh_job_free(rsh_job_type * job) { - free(job->run_path); - free(job); -} - - - - -job_status_type rsh_driver_get_job_status(void * __driver , void * __job) { - if (__job == NULL) - /* The job has not been registered at all ... */ - return JOB_QUEUE_NOT_ACTIVE; - else { - rsh_job_type * job = rsh_job_safe_cast( __job ); - { - if (job->active == false) { - util_abort("%s: internal error - should not query status on inactive jobs \n" , __func__); - return JOB_QUEUE_NOT_ACTIVE; /* Dummy to shut up compiler */ - } else - return job->status; - } - } -} - - - -void rsh_driver_free_job( void * __job ) { - rsh_job_type * job = rsh_job_safe_cast( __job ); - rsh_job_free(job); -} - - - -void rsh_driver_kill_job(void * __driver ,void * __job) { - rsh_job_type * job = rsh_job_safe_cast( __job ); - if (job->active) - pthread_cancel( job->run_thread ); - rsh_job_free( job ); -} - - - -void * rsh_driver_submit_job(void * __driver, - const char * submit_cmd , - int num_cpu , /* Ignored */ - const char * run_path , - const char * job_name , - int argc, - const char ** argv ) { - - rsh_driver_type * driver = rsh_driver_safe_cast( __driver ); - rsh_job_type * job = NULL; - { - /* - command is freed in the start_routine() function - */ - pthread_mutex_lock( &driver->submit_lock ); - { - rsh_host_type * host = NULL; - int ihost; - int host_index = 0; - - if (driver->num_hosts == 0) - util_abort("%s: fatal error - no hosts added to the rsh driver.\n",__func__); - - for (ihost = 0; ihost < driver->num_hosts; ihost++) { - host_index = (ihost + driver->last_host_index) % driver->num_hosts; - if (rsh_host_available(driver->host_list[host_index])) { - host = driver->host_list[host_index]; - break; - } - } - driver->last_host_index = (host_index + 1) % driver->num_hosts; - - if (host != NULL) { - /* A host is available */ - arg_pack_type * arg_pack = arg_pack_alloc(); /* The arg_pack is freed() in the rsh_host_submit_job__() function. - freeing it here is dangerous, because we might free it before the - thread-called function is finished with it. */ - - job = rsh_job_alloc(run_path); - - arg_pack_append_ptr(arg_pack , driver->rsh_command); - arg_pack_append_ptr(arg_pack , host); - arg_pack_append_ptr(arg_pack , (char *) submit_cmd); - arg_pack_append_int(arg_pack , num_cpu ); - arg_pack_append_int(arg_pack , argc ); - arg_pack_append_ptr(arg_pack , argv ); - arg_pack_append_ptr(arg_pack , job); - - { - int pthread_return_value = pthread_create( &job->run_thread , &driver->thread_attr , rsh_host_submit_job__ , arg_pack); - if (pthread_return_value != 0) - util_abort("%s failed to create thread ERROR:%d \n", __func__ , pthread_return_value); - } - job->status = JOB_QUEUE_RUNNING; - job->active = true; - } - } - pthread_mutex_unlock( &driver->submit_lock ); - } - return job; -} - - -void rsh_driver_clear_host_list( rsh_driver_type * driver ) { - int ihost; - for (ihost =0; ihost < driver->num_hosts; ihost++) - rsh_host_free(driver->host_list[ihost]); - util_safe_free(driver->host_list); - - driver->num_hosts = 0; - driver->host_list = NULL; - driver->last_host_index = 0; -} - - -void rsh_driver_free(rsh_driver_type * driver) { - rsh_driver_clear_host_list( driver ); - pthread_attr_destroy ( &driver->thread_attr ); - util_safe_free(driver->rsh_command ); - hash_free( driver->__host_hash ); - free(driver); - driver = NULL; -} - - -void rsh_driver_free__(void * __driver) { - rsh_driver_type * driver = rsh_driver_safe_cast( __driver ); - rsh_driver_free( driver ); -} - - -void rsh_driver_set_host_list( rsh_driver_type * rsh_driver , const hash_type * rsh_host_list) { - rsh_driver_clear_host_list( rsh_driver ); - if (rsh_host_list != NULL) { - hash_iter_type * hash_iter = hash_iter_alloc( rsh_host_list ); - while (!hash_iter_is_complete( hash_iter )) { - const char * host = hash_iter_get_next_key( hash_iter ); - int max_running = hash_get_int( rsh_host_list , host ); - rsh_driver_add_host(rsh_driver , host , max_running); - } - if (rsh_driver->num_hosts == 0) - util_abort("%s: failed to add any valid RSH hosts - aborting.\n",__func__); - } -} - - - - -/** - -*/ - -void * rsh_driver_alloc( ) { - rsh_driver_type * rsh_driver = util_malloc( sizeof * rsh_driver ); - UTIL_TYPE_ID_INIT( rsh_driver , RSH_DRIVER_TYPE_ID ); - pthread_mutex_init( &rsh_driver->submit_lock , NULL ); - pthread_attr_init( &rsh_driver->thread_attr ); - pthread_attr_setdetachstate( &rsh_driver->thread_attr , PTHREAD_CREATE_DETACHED ); - - /** - To simplify the Python wrapper it is possible to pass in NULL as - rsh_host_list pointer, and then subsequently add hosts with - rsh_driver_add_host(). - */ - rsh_driver->num_hosts = 0; - rsh_driver->host_list = NULL; - rsh_driver->last_host_index = 0; - rsh_driver->rsh_command = NULL; - rsh_driver->__host_hash = hash_alloc(); - return rsh_driver; -} - - - -void rsh_driver_add_host(rsh_driver_type * rsh_driver , const char * hostname , int host_max_running) { - rsh_host_type * new_host = rsh_host_alloc(hostname , host_max_running); /* Could in principle update an existing node if the host name is old. */ - if (new_host != NULL) { - rsh_driver->num_hosts++; - rsh_driver->host_list = util_realloc(rsh_driver->host_list , rsh_driver->num_hosts * sizeof * rsh_driver->host_list ); - rsh_driver->host_list[(rsh_driver->num_hosts - 1)] = new_host; - } -} - - -/** - Hostname should be a string as host:max_running, the ":max_running" - part is optional, and will default to 1. -*/ - -void rsh_driver_add_host_from_string(rsh_driver_type * rsh_driver , const char * hostname) { - int host_max_running; - char ** tmp; - char * host; - int tokens; - - util_split_string( hostname , ":" , &tokens , &tmp); - if (tokens > 1) { - if (!util_sscanf_int( tmp[tokens - 1] , &host_max_running)) - util_abort("%s: failed to parse out integer from: %s \n",__func__ , hostname); - host = util_alloc_joined_string((const char **) tmp , tokens - 1 , ":"); - } else - host = util_alloc_string_copy( tmp[0] ); - rsh_driver_add_host( rsh_driver , host , host_max_running ); - - util_free_stringlist( tmp , tokens ); - free( host ); -} - - - - -bool rsh_driver_set_option( void * __driver , const char * option_key , const void * value ) { - rsh_driver_type * driver = rsh_driver_safe_cast( __driver ); - bool has_option = true; - { - if (strcmp(RSH_HOST , option_key) == 0) /* Add one host - value should be hostname:max */ - rsh_driver_add_host_from_string( driver , value ); - else if (strcmp(RSH_HOSTLIST , option_key) == 0) { /* Set full host list - value should be hash of integers. */ - if (value != NULL) { - const hash_type * hash_value = hash_safe_cast_const( value ); - rsh_driver_set_host_list( driver , hash_value ); - } - } else if (strcmp( RSH_CLEAR_HOSTLIST , option_key) == 0) - /* Value is not considered - this is an action, and not a _set operation. */ - rsh_driver_set_host_list( driver , NULL ); - else if (strcmp( RSH_CMD , option_key) == 0) - driver->rsh_command = util_realloc_string_copy( driver->rsh_command , value ); - else - has_option = false; - } - return has_option; -} - - -const void * rsh_driver_get_option( const void * __driver , const char * option_key ) { - const rsh_driver_type * driver = rsh_driver_safe_cast_const( __driver ); - { - if (strcmp( RSH_CMD , option_key ) == 0) - return driver->rsh_command; - else if (strcmp( RSH_HOSTLIST , option_key) == 0) { - int ihost; - hash_clear( driver->__host_hash ); - for (ihost = 0; ihost < driver->num_hosts; ihost++) { - rsh_host_type * host = driver->host_list[ ihost ]; - hash_insert_int( driver->__host_hash , host->host_name , host->max_running); - } - return driver->__host_hash; - } else { - util_abort("%s: get not implemented fro option_id:%s for rsh \n",__func__ , option_key ); - return NULL; - } - } -} - - -void rsh_driver_init_option_list(stringlist_type * option_list) { - stringlist_append_ref(option_list, RSH_HOST); - stringlist_append_ref(option_list, RSH_HOSTLIST); - stringlist_append_ref(option_list, RSH_CMD); - stringlist_append_ref(option_list, RSH_CLEAR_HOSTLIST); -} - -#undef RSH_JOB_ID - -/*****************************************************************/ - diff --git a/ThirdParty/Ert/libjob_queue/src/torque_driver.c b/ThirdParty/Ert/libjob_queue/src/torque_driver.c deleted file mode 100644 index 574aadffab..0000000000 --- a/ThirdParty/Ert/libjob_queue/src/torque_driver.c +++ /dev/null @@ -1,544 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'torque_driver.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. - */ -#include -#include -#include - -#include -#include - -#include - - -#define TORQUE_DRIVER_TYPE_ID 34873653 -#define TORQUE_JOB_TYPE_ID 12312312 - - -struct torque_driver_struct { - UTIL_TYPE_ID_DECLARATION; - char * queue_name; - char * qsub_cmd; - char * qstat_cmd; - char * qdel_cmd; - char * num_cpus_per_node_char; - char * job_prefix; - char * num_nodes_char; - bool keep_qsub_output; - int num_cpus_per_node; - int num_nodes; - char * cluster_label; - int submit_sleep; - FILE * debug_stream; -}; - -struct torque_job_struct { - UTIL_TYPE_ID_DECLARATION; - long int torque_jobnr; - char * torque_jobnr_char; -}; - -UTIL_SAFE_CAST_FUNCTION(torque_driver, TORQUE_DRIVER_TYPE_ID); - -static UTIL_SAFE_CAST_FUNCTION_CONST(torque_driver, TORQUE_DRIVER_TYPE_ID) -static UTIL_SAFE_CAST_FUNCTION(torque_job, TORQUE_JOB_TYPE_ID) - -void * torque_driver_alloc() { - torque_driver_type * torque_driver = util_malloc(sizeof * torque_driver); - UTIL_TYPE_ID_INIT(torque_driver, TORQUE_DRIVER_TYPE_ID); - - torque_driver->queue_name = NULL; - torque_driver->qsub_cmd = NULL; - torque_driver->qstat_cmd = NULL; - torque_driver->qdel_cmd = NULL; - torque_driver->num_cpus_per_node_char = NULL; - torque_driver->num_nodes_char = NULL; - torque_driver->keep_qsub_output = false; - torque_driver->num_cpus_per_node = 1; - torque_driver->num_nodes = 1; - torque_driver->cluster_label = NULL; - torque_driver->job_prefix = NULL; - torque_driver->debug_stream = NULL; - - torque_driver_set_option(torque_driver, TORQUE_QSUB_CMD, TORQUE_DEFAULT_QSUB_CMD); - torque_driver_set_option(torque_driver, TORQUE_QSTAT_CMD, TORQUE_DEFAULT_QSTAT_CMD); - torque_driver_set_option(torque_driver, TORQUE_QDEL_CMD, TORQUE_DEFAULT_QDEL_CMD); - torque_driver_set_option(torque_driver, TORQUE_NUM_CPUS_PER_NODE, "1"); - torque_driver_set_option(torque_driver, TORQUE_NUM_NODES, "1"); - torque_driver_set_option(torque_driver, TORQUE_SUBMIT_SLEEP, TORQUE_DEFAULT_SUBMIT_SLEEP); - - return torque_driver; -} - -static void torque_driver_set_debug_output(torque_driver_type * driver, const char * debug_file) { - if (driver->debug_stream) - fclose( driver->debug_stream ); - - if (debug_file) - driver->debug_stream = util_mkdir_fopen( debug_file , "w"); - else - driver->debug_stream = NULL; -} - - -static void torque_driver_set_qsub_cmd(torque_driver_type * driver, const char * qsub_cmd) { - driver->qsub_cmd = util_realloc_string_copy(driver->qsub_cmd, qsub_cmd); -} - -static void torque_driver_set_qstat_cmd(torque_driver_type * driver, const char * qstat_cmd) { - driver->qstat_cmd = util_realloc_string_copy(driver->qstat_cmd, qstat_cmd); -} - -static void torque_driver_set_qdel_cmd(torque_driver_type * driver, const char * qdel_cmd) { - driver->qdel_cmd = util_realloc_string_copy(driver->qdel_cmd, qdel_cmd); -} - -static void torque_driver_set_queue_name(torque_driver_type * driver, const char * queue_name) { - driver->queue_name = util_realloc_string_copy(driver->queue_name, queue_name); -} - -static bool torque_driver_set_submit_sleep(torque_driver_type * driver, const char* submit_sleep) { - double seconds_sleep; - if (util_sscanf_double( submit_sleep , &seconds_sleep)) { - driver->submit_sleep = (int) (seconds_sleep * 1000000); - return true; - } else - return false; -} - - -static bool torque_driver_set_num_nodes(torque_driver_type * driver, const char* num_nodes_char) { - int num_nodes = 0; - if (util_sscanf_int(num_nodes_char, &num_nodes)) { - driver->num_nodes = num_nodes; - driver->num_nodes_char = util_realloc_string_copy(driver->num_nodes_char, num_nodes_char); - return true; - } else { - return false; - } -} - -static bool torque_driver_set_keep_qsub_output(torque_driver_type * driver, const char* keep_output_bool_as_char) { - bool keep_output_parsed; - - if (util_sscanf_bool(keep_output_bool_as_char, &keep_output_parsed)) { - driver->keep_qsub_output = keep_output_parsed; - return true; - } else { - return false; - } -} - -static void torque_driver_set_job_prefix(torque_driver_type * driver, const char * job_prefix){ - driver->job_prefix = util_realloc_string_copy( driver->job_prefix , job_prefix); -} - -static void torque_driver_set_cluster_label(torque_driver_type * driver, const char* cluster_label) { - driver->cluster_label = util_realloc_string_copy(driver->cluster_label, cluster_label); -} - -static bool torque_driver_set_num_cpus_per_node(torque_driver_type * driver, const char* num_cpus_per_node_char) { - int num_cpus_per_node = 0; - if (util_sscanf_int(num_cpus_per_node_char, &num_cpus_per_node)) { - driver->num_cpus_per_node = num_cpus_per_node; - driver->num_cpus_per_node_char = util_realloc_string_copy(driver->num_cpus_per_node_char, num_cpus_per_node_char); - return true; - } else { - return false; - } -} - -bool torque_driver_set_option(void * __driver, const char * option_key, const void * value) { - torque_driver_type * driver = torque_driver_safe_cast(__driver); - bool option_set = true; - { - if (strcmp(TORQUE_QSUB_CMD, option_key) == 0) - torque_driver_set_qsub_cmd(driver, value); - else if (strcmp(TORQUE_QSTAT_CMD, option_key) == 0) - torque_driver_set_qstat_cmd(driver, value); - else if (strcmp(TORQUE_QDEL_CMD, option_key) == 0) - torque_driver_set_qdel_cmd(driver, value); - else if (strcmp(TORQUE_QUEUE, option_key) == 0) - torque_driver_set_queue_name(driver, value); - else if (strcmp(TORQUE_NUM_CPUS_PER_NODE, option_key) == 0) - option_set = torque_driver_set_num_cpus_per_node(driver, value); - else if (strcmp(TORQUE_NUM_NODES, option_key) == 0) - option_set = torque_driver_set_num_nodes(driver, value); - else if (strcmp(TORQUE_KEEP_QSUB_OUTPUT, option_key) == 0) - option_set = torque_driver_set_keep_qsub_output(driver, value); - else if (strcmp(TORQUE_CLUSTER_LABEL, option_key) == 0) - torque_driver_set_cluster_label(driver, value); - else if (strcmp(TORQUE_JOB_PREFIX_KEY, option_key) == 0) - torque_driver_set_job_prefix(driver, value); - else if (strcmp(TORQUE_DEBUG_OUTPUT, option_key) == 0) - torque_driver_set_debug_output(driver, value); - else if (strcmp(TORQUE_SUBMIT_SLEEP, option_key) == 0) - option_set = torque_driver_set_submit_sleep(driver, value); - else - option_set = false; - } - return option_set; -} - -const void * torque_driver_get_option(const void * __driver, const char * option_key) { - const torque_driver_type * driver = torque_driver_safe_cast_const(__driver); - { - if (strcmp(TORQUE_QSUB_CMD, option_key) == 0) - return driver->qsub_cmd; - else if (strcmp(TORQUE_QSTAT_CMD, option_key) == 0) - return driver->qstat_cmd; - else if (strcmp(TORQUE_QDEL_CMD, option_key) == 0) - return driver->qdel_cmd; - else if (strcmp(TORQUE_QUEUE, option_key) == 0) - return driver->queue_name; - else if (strcmp(TORQUE_NUM_CPUS_PER_NODE, option_key) == 0) - return driver->num_cpus_per_node_char; - else if (strcmp(TORQUE_NUM_NODES, option_key) == 0) - return driver->num_nodes_char; - else if (strcmp(TORQUE_KEEP_QSUB_OUTPUT, option_key) == 0) - return driver->keep_qsub_output ? "1" : "0"; - else if (strcmp(TORQUE_CLUSTER_LABEL, option_key) == 0) - return driver->cluster_label; - else if(strcmp(TORQUE_JOB_PREFIX_KEY, option_key) == 0) - return driver->job_prefix; - else { - util_abort("%s: option_id:%s not recognized for TORQUE driver \n", __func__, option_key); - return NULL; - } - } -} - -void torque_driver_init_option_list(stringlist_type * option_list) { - stringlist_append_ref(option_list, TORQUE_QSUB_CMD); - stringlist_append_ref(option_list, TORQUE_QSTAT_CMD); - stringlist_append_ref(option_list, TORQUE_QDEL_CMD); - stringlist_append_ref(option_list, TORQUE_QUEUE); - stringlist_append_ref(option_list, TORQUE_NUM_CPUS_PER_NODE); - stringlist_append_ref(option_list, TORQUE_NUM_NODES); - stringlist_append_ref(option_list, TORQUE_KEEP_QSUB_OUTPUT); - stringlist_append_ref(option_list, TORQUE_CLUSTER_LABEL); - stringlist_append_ref(option_list, TORQUE_JOB_PREFIX_KEY); -} - -torque_job_type * torque_job_alloc() { - torque_job_type * job; - job = util_malloc(sizeof * job); - job->torque_jobnr_char = NULL; - job->torque_jobnr = 0; - UTIL_TYPE_ID_INIT(job, TORQUE_JOB_TYPE_ID); - - return job; -} - -stringlist_type * torque_driver_alloc_cmd(torque_driver_type * driver, - const char * job_name, - const char * submit_script) { - - - stringlist_type * argv = stringlist_alloc_new(); - - if (driver->keep_qsub_output) { - stringlist_append_ref(argv, "-k"); - stringlist_append_ref(argv, "oe"); - } - - { - char * resource_string; - if (driver->cluster_label) - resource_string = util_alloc_sprintf("nodes=%d:%s:ppn=%d", driver->num_nodes, driver->cluster_label, driver->num_cpus_per_node); - else - resource_string = util_alloc_sprintf("nodes=%d:ppn=%d", driver->num_nodes, driver->num_cpus_per_node); - - stringlist_append_ref(argv, "-l"); - stringlist_append_copy(argv, resource_string); - free(resource_string); - } - - if (driver->queue_name != NULL) { - stringlist_append_ref(argv, "-q"); - stringlist_append_ref(argv, driver->queue_name); - } - - if (job_name != NULL) { - stringlist_append_ref(argv, "-N"); - stringlist_append_ref(argv, job_name); - } - - stringlist_append_ref(argv, submit_script); - - return argv; -} - -static void torque_debug(torque_driver_type * driver , const char * fmt , ...) { - if (driver->debug_stream) { - { - va_list ap; - va_start(ap , fmt); - vfprintf(driver->debug_stream , fmt , ap ); - va_end(ap); - } - fprintf(driver->debug_stream , "\n"); - fsync( fileno(driver->debug_stream) ); - } -} - - -static int torque_job_parse_qsub_stdout(const torque_driver_type * driver, const char * stdout_file) { - int jobid; - { - FILE * stream = util_fopen(stdout_file, "r"); - char * jobid_string = util_fscanf_alloc_upto(stream, ".", false); - - torque_debug(driver, "Torque job ID string: '%s'", jobid_string); - - if (jobid_string == NULL || !util_sscanf_int(jobid_string, &jobid)) { - - char * file_content = util_fread_alloc_file_content(stdout_file, NULL); - fprintf(stderr, "Failed to get torque job id from file: %s \n", stdout_file); - fprintf(stderr, "qsub command : %s \n", driver->qsub_cmd); - fprintf(stderr, "File content: [%s]\n", file_content); - free(file_content); - util_exit("%s: \n", __func__); - } - free(jobid_string); - fclose(stream); - } - return jobid; -} - -void torque_job_create_submit_script(const char * script_filename, const char * submit_cmd, int argc, const char ** job_argv) { - if (submit_cmd == NULL) { - util_abort("%s: cannot create submit script, because there is no executing commmand specified.", __func__); - } - - FILE* script_file = util_fopen(script_filename, "w"); - fprintf(script_file, "#!/bin/sh\n"); - - fprintf(script_file, "%s", submit_cmd); - for (int i = 0; i < argc; i++) { - fprintf(script_file, " %s", job_argv[i]); - } - - util_fclose(script_file); -} - -static void torque_debug_spawn_status_info(torque_driver_type *driver, int status) { - if (WIFEXITED((status))) { - torque_debug(driver, "Torque spawn exited with status=%d", WEXITSTATUS((status))); - } else if (WIFSIGNALED((status))) { - torque_debug(driver, "Torque spawn killed by signal %d", WTERMSIG((status))); - } else if (WIFSTOPPED((status))) { - torque_debug(driver, "Torque spawn stopped by signal %d", WSTOPSIG((status))); - } else if (WIFCONTINUED((status))) { - torque_debug(driver, "Torque spawn continued"); - } else { - torque_debug(driver, "Torque spawn failed with unknown status code: %d", (status)); - } -} - -static int torque_driver_submit_shell_job(torque_driver_type * driver, - const char * run_path, - const char * job_name, - const char * submit_cmd, - int num_cpu, - int job_argc, - const char ** job_argv) { - - usleep( driver->submit_sleep ); - { - int job_id; - char * tmp_std_file = util_alloc_tmp_file("/tmp", "enkf-submit-std", true); - char * tmp_err_file = util_alloc_tmp_file("/tmp", "enkf-submit-err", true); - char * script_filename = util_alloc_filename(run_path, "qsub_script", "sh"); - - torque_debug(driver, "Setting up submit stdout target '%s' for '%s'", tmp_std_file, script_filename); - torque_debug(driver, "Setting up submit stderr target '%s' for '%s'", tmp_err_file, script_filename); - torque_job_create_submit_script(script_filename, submit_cmd, job_argc, job_argv); - { - int p_units_from_driver = driver->num_cpus_per_node * driver->num_nodes; - if (num_cpu > p_units_from_driver) { - util_abort("%s: Error in config, job's config requires %d processing units, but config says %s: %d, and %s: %d, which multiplied becomes: %d \n", - __func__, num_cpu, TORQUE_NUM_CPUS_PER_NODE, driver->num_cpus_per_node, TORQUE_NUM_NODES, driver->num_nodes, p_units_from_driver); - } - { - stringlist_type * remote_argv = torque_driver_alloc_cmd(driver, job_name, script_filename); - torque_debug(driver, "Submit arguments: %s", stringlist_alloc_joined_string(remote_argv, " ")); - char ** argv = stringlist_alloc_char_ref(remote_argv); - int status = util_spawn_blocking(driver->qsub_cmd, stringlist_get_size(remote_argv), (const char **) argv, tmp_std_file, tmp_err_file); - if (status != 0) { - torque_debug_spawn_status_info(driver, status); - } - free(argv); - stringlist_free(remote_argv); - } - } - - job_id = torque_job_parse_qsub_stdout(driver, tmp_std_file); - - util_unlink_existing(tmp_std_file); - util_unlink_existing(tmp_err_file); - free(tmp_std_file); - free(tmp_err_file); - - return job_id; - } -} - -void torque_job_free(torque_job_type * job) { - - util_safe_free(job->torque_jobnr_char); - free(job); -} - -void torque_driver_free_job(void * __job) { - - torque_job_type * job = torque_job_safe_cast(__job); - torque_job_free(job); -} - -void * torque_driver_submit_job(void * __driver, - const char * submit_cmd, - int num_cpu, - const char * run_path, - const char * job_name, - int argc, - const char ** argv) { - torque_driver_type * driver = torque_driver_safe_cast(__driver); - torque_job_type * job = torque_job_alloc(); - - torque_debug( driver , "Submitting job in:%s" , run_path); - { - char * local_job_name = NULL; - if (driver->job_prefix) - local_job_name = util_alloc_sprintf("%s%s",driver->job_prefix, job_name); - else - local_job_name = util_alloc_string_copy( job_name ); - - job->torque_jobnr = torque_driver_submit_shell_job(driver, run_path, local_job_name, submit_cmd, num_cpu, argc, argv); - job->torque_jobnr_char = util_alloc_sprintf("%ld", job->torque_jobnr); - - torque_debug( driver , "Job:%s Id:%d" , run_path , job->torque_jobnr); - free(local_job_name); - } - - if (job->torque_jobnr > 0) - return job; - else { - /* - The submit failed - the queue system shall handle - NULL return values. - */ - torque_job_free(job); - return NULL; - } -} - -static char* torque_driver_get_qstat_status(torque_driver_type * driver, char * jobnr_char) { - char * status = util_malloc(sizeof (char)*2); - char * tmp_file = util_alloc_tmp_file("/tmp", "enkf-qstat", true); - - { - char ** argv = util_calloc(1, sizeof * argv); - argv[0] = jobnr_char; - - util_spawn_blocking(driver->qstat_cmd, 1, (const char **) argv, tmp_file, NULL); - free(argv); - } - - FILE *stream = util_fopen(tmp_file, "r"); - bool at_eof = false; - util_fskip_lines(stream, 2); - char * line = util_fscanf_alloc_line(stream, &at_eof); - fclose(stream); - - if (line != NULL) { - char job_id_full_string[32]; - if (sscanf(line, "%s %*s %*s %*s %s %*s", job_id_full_string, status) == 2) { - char *dotPtr = strchr(job_id_full_string, '.'); - int dotPosition = dotPtr - job_id_full_string; - char* job_id_as_char_ptr = util_alloc_substring_copy(job_id_full_string, 0, dotPosition); - if (strcmp(job_id_as_char_ptr, jobnr_char) != 0) { - util_abort("%s: Job id input (%d) does not match the one found by qstat (%d)\n", __func__, jobnr_char, job_id_as_char_ptr); - } - free(job_id_as_char_ptr); - } - free(line); - } else { - util_abort("%s: Unable to read qstat's output line number 3 from file: %s", __func__, tmp_file); - } - - util_unlink_existing(tmp_file); - free(tmp_file); - - return status; -} - -job_status_type torque_driver_get_job_status(void * __driver, void * __job) { - torque_driver_type * driver = torque_driver_safe_cast(__driver); - torque_job_type * job = torque_job_safe_cast(__job); - char * status = torque_driver_get_qstat_status(driver, job->torque_jobnr_char); - int result = JOB_QUEUE_FAILED; - if (strcmp(status, "R") == 0) { - result = JOB_QUEUE_RUNNING; - } else if (strcmp(status, "E") == 0) { - result = JOB_QUEUE_DONE; - } else if (strcmp(status, "C") == 0) { - result = JOB_QUEUE_DONE; - } else if (strcmp(status, "Q") == 0) { - result = JOB_QUEUE_PENDING; - } else { - fprintf(stderr, "%s: Unknown status found (%s), expecting one of R, E, C and Q.\n", __func__, status); - result = JOB_QUEUE_STATUS_FAILURE; - } - free(status); - - return result; -} - -void torque_driver_kill_job(void * __driver, void * __job) { - - torque_driver_type * driver = torque_driver_safe_cast(__driver); - torque_job_type * job = torque_job_safe_cast(__job); - util_spawn_blocking(driver->qdel_cmd, 1, (const char **) &job->torque_jobnr_char, NULL, NULL); -} - -void torque_driver_free(torque_driver_type * driver) { - torque_driver_set_debug_output(driver, NULL); - util_safe_free(driver->queue_name); - free(driver->qdel_cmd); - free(driver->qstat_cmd); - free(driver->qsub_cmd); - free(driver->num_cpus_per_node_char); - free(driver->num_nodes_char); - if (driver->job_prefix) - free(driver->job_prefix); - - free(driver); -} - -void torque_driver_free__(void * __driver) { - torque_driver_type * driver = torque_driver_safe_cast(__driver); - torque_driver_free(driver); -} - -int torque_driver_get_submit_sleep( const torque_driver_type * driver ) { - return driver->submit_sleep; -} - -FILE * torque_driver_get_debug_stream( const torque_driver_type * driver ) { - return driver->debug_stream; -} diff --git a/ThirdParty/Ert/libjob_queue/src/workflow.c b/ThirdParty/Ert/libjob_queue/src/workflow.c deleted file mode 100644 index c0c132ed81..0000000000 --- a/ThirdParty/Ert/libjob_queue/src/workflow.c +++ /dev/null @@ -1,265 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'workflow.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#define CMD_TYPE_ID 66153 -#define WORKFLOW_TYPE_ID 6762081 -#define WORKFLOW_COMMENT_STRING "--" -#define WORKFLOW_INCLUDE "INCLUDE" - -typedef struct cmd_struct cmd_type; - -struct cmd_struct { - UTIL_TYPE_ID_DECLARATION; - const workflow_job_type * workflow_job; - stringlist_type * arglist; -}; - - - - -struct workflow_struct { - UTIL_TYPE_ID_DECLARATION; - time_t compile_time; - bool compiled; - char * src_file; - vector_type * cmd_list; - workflow_joblist_type * joblist; - config_error_type * last_error; - vector_type * stack; -}; - -/*****************************************************************/ - - -static cmd_type * cmd_alloc( const workflow_job_type * workflow_job , const stringlist_type * arglist) { - cmd_type * cmd = util_malloc( sizeof * cmd ); - UTIL_TYPE_ID_INIT(cmd , CMD_TYPE_ID ); - cmd->workflow_job = workflow_job; - cmd->arglist = stringlist_alloc_deep_copy( arglist ); - return cmd; -} - -static UTIL_SAFE_CAST_FUNCTION( cmd , CMD_TYPE_ID ); - -static void cmd_free( cmd_type * cmd ){ - stringlist_free( cmd->arglist ); - free( cmd ); -} - -static void cmd_free__( void * arg ) { - cmd_type * cmd = cmd_safe_cast( arg ); - cmd_free( cmd ); -} - -/*****************************************************************/ - -static void workflow_add_cmd( workflow_type * workflow , cmd_type * cmd ) { - vector_append_owned_ref( workflow->cmd_list , cmd , cmd_free__ ); -} - - -static void workflow_clear( workflow_type * workflow ) { - vector_clear( workflow->cmd_list ); -} - -static void workflow_store_error( workflow_type * workflow , const config_error_type * error) { - if (workflow->last_error) - config_error_free( workflow->last_error ); - - if (error) - workflow->last_error = config_error_alloc_copy( error ); - else - workflow->last_error = NULL; -} - - - - -bool workflow_try_compile( workflow_type * script , const subst_list_type * context) { - if (util_file_exists( script->src_file )) { - const char * src_file = script->src_file; - char * tmp_file = NULL; - bool update = false; - if (context != NULL) { - tmp_file = util_alloc_tmp_file("/tmp" , "ert-workflow" , false ); - update = subst_list_filter_file( context , script->src_file , tmp_file ); - if (update) { - script->compiled = false; - src_file = tmp_file; - } else { - remove( tmp_file ); - free( tmp_file ); - tmp_file = NULL; - } - } - - { - time_t src_mtime = util_file_mtime( script->src_file ); - if (script->compiled) { - if (util_difftime_seconds( src_mtime , script->compile_time ) > 0 ) - return true; - else { - // Script has been compiled succesfully, but then changed afterwards. - // We try to recompile; if that fails we are left with 'nothing'. - } - } - } - - { - // Try to compile - config_parser_type * config_compiler = workflow_joblist_get_compiler( script->joblist ); - script->compiled = false; - workflow_clear( script ); - { - config_content_type * content = config_parse( config_compiler , src_file , WORKFLOW_COMMENT_STRING , WORKFLOW_INCLUDE , NULL , NULL , CONFIG_UNRECOGNIZED_ERROR , true ); - - if (config_content_is_valid( content )) { - int cmd_line; - for (cmd_line = 0; cmd_line < config_content_get_size(content); cmd_line++) { - const config_content_node_type * node = config_content_iget_node( content , cmd_line ); - const char * jobname = config_content_node_get_kw( node ); - const workflow_job_type * job = workflow_joblist_get_job( script->joblist , jobname ); - cmd_type * cmd = cmd_alloc( job , config_content_node_get_stringlist( node )); - - workflow_add_cmd( script , cmd ); - } - script->compiled = true; - } else - workflow_store_error( script , config_content_get_errors( content )); - - config_content_free( content ); - } - } - - if (tmp_file != NULL) { - if (script->compiled) - remove( tmp_file ); - free( tmp_file ); - } - } - - // It is legal to remove the script after successfull compilation but - // then the context will not be applied at subsequent invocations. - return script->compiled; -} - - -bool workflow_run(workflow_type * workflow, void * self , bool verbose , const subst_list_type * context) { - vector_clear( workflow->stack ); - workflow_try_compile( workflow , context); - - if (workflow->compiled) { - int icmd; - for (icmd = 0; icmd < vector_get_size( workflow->cmd_list ); icmd++) { - const cmd_type * cmd = vector_iget_const( workflow->cmd_list , icmd ); - void * return_value = workflow_job_run( cmd->workflow_job, self , verbose , cmd->arglist ); - vector_push_front_ref( workflow->stack , return_value ); - } - return true; - } else - return false; -} - -int workflow_get_stack_size( const workflow_type * workflow ) { - return vector_get_size( workflow->stack ); -} - - -void * workflow_iget_stack_ptr( const workflow_type * workflow , int index) { - return vector_iget( workflow->stack , index ); -} - - -void * workflow_pop_stack( workflow_type * workflow ) { - return vector_pop_front( workflow->stack); -} - - - -workflow_type * workflow_alloc( const char * src_file , workflow_joblist_type * joblist) { - workflow_type * script = util_malloc( sizeof * script ); - UTIL_TYPE_ID_INIT( script , WORKFLOW_TYPE_ID ); - - script->src_file = util_alloc_string_copy( src_file ); - script->joblist = joblist; - script->cmd_list = vector_alloc_new(); - script->compiled = false; - script->last_error = NULL; - script->stack = vector_alloc_new(); - - workflow_try_compile( script , NULL ); - return script; -} - - -static UTIL_SAFE_CAST_FUNCTION( workflow , WORKFLOW_TYPE_ID ) -UTIL_IS_INSTANCE_FUNCTION( workflow , WORKFLOW_TYPE_ID) - -void workflow_free( workflow_type * workflow ) { - free( workflow->src_file ); - vector_free( workflow->cmd_list ); - vector_free( workflow->stack ); - - if (workflow->last_error) - config_error_free( workflow->last_error ); - - free( workflow ); -} - - -void workflow_free__( void * arg ) { - workflow_type * workflow = workflow_safe_cast( arg ); - workflow_free( workflow ); -} - - -const config_error_type * workflow_get_last_error( const workflow_type * workflow) { - return workflow->last_error; -} - -int workflow_size(const workflow_type * workflow) { - return vector_get_size( workflow->cmd_list ); -} - -const workflow_job_type * workflow_iget_job( const workflow_type * workflow, int index) { - const cmd_type * cmd = vector_iget_const( workflow->cmd_list , index ); - return cmd->workflow_job; -} - -stringlist_type * workflow_iget_arguments( const workflow_type * workflow, int index) { - const cmd_type * cmd = vector_iget_const( workflow->cmd_list , index ); - return cmd->arglist; -} diff --git a/ThirdParty/Ert/libjob_queue/src/workflow_job.c b/ThirdParty/Ert/libjob_queue/src/workflow_job.c deleted file mode 100644 index 63e985b581..0000000000 --- a/ThirdParty/Ert/libjob_queue/src/workflow_job.c +++ /dev/null @@ -1,409 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'workflow_job.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include - - -/* The default values are interepreted as no limit. */ -#define DEFAULT_INTERNAL false - - -#define MIN_ARG_KEY "MIN_ARG" -#define MAX_ARG_KEY "MAX_ARG" -#define ARG_TYPE_KEY "ARG_TYPE" -#define INTERNAL_KEY "INTERNAL" -#define MODULE_KEY "MODULE" -#define FUNCTION_KEY "FUNCTION" -#define SCRIPT_KEY "SCRIPT" -#define EXECUTABLE_KEY "EXECUTABLE" - -#define NULL_STRING "NULL" -#define WORKFLOW_JOB_STRING_TYPE "STRING" -#define WORKFLOW_JOB_INT_TYPE "INT" -#define WORKFLOW_JOB_FLOAT_TYPE "FLOAT" -#define WORKFLOW_JOB_BOOL_TYPE "BOOL" - -#define WORKFLOW_JOB_TYPE_ID 614441 - - -struct workflow_job_struct { - UTIL_TYPE_ID_DECLARATION; - bool internal; - int min_arg; - int max_arg; - int_vector_type * arg_types; // Should contain values from the config_item_types enum in config.h. - char * executable; - char * internal_script_path; - char * module; - char * function; - char * name; - void * lib_handle; - workflow_job_ftype * dl_func; - bool valid; -}; - - -bool workflow_job_internal( const workflow_job_type * workflow_job ) { - return workflow_job->internal; -} - -const char * workflow_job_get_name( const workflow_job_type * workflow_job ) { - return workflow_job->name; -} - - -config_parser_type * workflow_job_alloc_config() { - config_parser_type * config = config_alloc(); - { - config_schema_item_type * item; - - item = config_add_schema_item( config , MIN_ARG_KEY , false ); - config_schema_item_set_argc_minmax( item , 1 , 1 ); - config_schema_item_iset_type( item , 0 , CONFIG_INT ); - - item = config_add_schema_item( config , MAX_ARG_KEY , false ); - config_schema_item_set_argc_minmax( item , 1 , 1 ); - config_schema_item_iset_type( item , 0 , CONFIG_INT ); - - item = config_add_schema_item( config , ARG_TYPE_KEY , false ); - config_schema_item_set_argc_minmax( item , 2 , 2 ); - config_schema_item_iset_type( item , 0 , CONFIG_INT ); - config_schema_item_set_indexed_selection_set( item , 1 , 4 , (const char *[4]) {WORKFLOW_JOB_STRING_TYPE , WORKFLOW_JOB_INT_TYPE , WORKFLOW_JOB_FLOAT_TYPE, WORKFLOW_JOB_BOOL_TYPE}); - - /*****************************************************************/ - item = config_add_schema_item( config , EXECUTABLE_KEY , false ); - config_schema_item_set_argc_minmax( item , 1 , 1 ); - config_schema_item_iset_type( item , 0 , CONFIG_PATH ); - - /*****************************************************************/ - item = config_add_schema_item( config , SCRIPT_KEY , false ); - config_schema_item_set_argc_minmax( item , 1 , 1 ); - config_schema_item_iset_type( item , 0 , CONFIG_PATH ); - - /*---------------------------------------------------------------*/ - - item = config_add_schema_item( config , FUNCTION_KEY , false ); - config_schema_item_set_argc_minmax( item , 1 , 1); - - item = config_add_schema_item( config , MODULE_KEY , false ); - config_schema_item_set_argc_minmax( item , 1 , 1); - /*****************************************************************/ - - item = config_add_schema_item( config , INTERNAL_KEY , false ); - config_schema_item_set_argc_minmax( item , 1 , 1); - config_schema_item_iset_type( item , 0 , CONFIG_BOOL); - } - return config; -} - - - -static UTIL_SAFE_CAST_FUNCTION(workflow_job , WORKFLOW_JOB_TYPE_ID ); - -void workflow_job_update_config_compiler( const workflow_job_type * workflow_job , config_parser_type * config_compiler ) { - config_schema_item_type * item = config_add_schema_item( config_compiler , workflow_job->name , false ); - /* - Ensure that the arg_types mapping is at least as large as the - max_arg value. The arg_type vector will be left padded with - CONFIG_STRING values. - */ - { - int iarg; - config_schema_item_set_argc_minmax( item , workflow_job->min_arg , workflow_job->max_arg ); - for (iarg = 0; iarg < int_vector_size( workflow_job->arg_types ); iarg++) - config_schema_item_iset_type( item , iarg , int_vector_iget( workflow_job->arg_types , iarg )); - } -} - - -workflow_job_type * workflow_job_alloc( const char * name , bool internal ) { - workflow_job_type * workflow_job = util_malloc( sizeof * workflow_job ); - UTIL_TYPE_ID_INIT( workflow_job , WORKFLOW_JOB_TYPE_ID ); - workflow_job->internal = internal; // this can not be changed run-time. - workflow_job->min_arg = CONFIG_DEFAULT_ARG_MIN; - workflow_job->max_arg = CONFIG_DEFAULT_ARG_MAX; - workflow_job->arg_types = int_vector_alloc( 0 , CONFIG_STRING ); - - workflow_job->executable = NULL; - workflow_job->internal_script_path = NULL; - workflow_job->module = NULL; - workflow_job->function = NULL; - - if (name == NULL) - util_abort("%s: trying to create workflow_job with name == NULL - illegal\n",__func__); - else - workflow_job->name = util_alloc_string_copy( name ); - - workflow_job->valid = false; - - return workflow_job; -} - - -void workflow_job_set_executable( workflow_job_type * workflow_job , const char * executable ) { - workflow_job->executable = util_realloc_string_copy( workflow_job->executable , executable ); -} - -char* workflow_job_get_executable( workflow_job_type * workflow_job) { - return workflow_job->executable; -} - -void workflow_job_set_internal_script( workflow_job_type * workflow_job , const char * script_path ) { - workflow_job->internal_script_path = util_realloc_string_copy( workflow_job->internal_script_path , script_path ); -} - -char* workflow_job_get_internal_script_path( const workflow_job_type * workflow_job) { - return workflow_job->internal_script_path; -} - -bool workflow_job_is_internal_script( const workflow_job_type * workflow_job) { - return workflow_job->internal && workflow_job->internal_script_path != NULL; -} - -void workflow_job_set_module( workflow_job_type * workflow_job , const char * module) { - if (strcmp(module ,NULL_STRING) == 0) - module = NULL; - - workflow_job->module = util_realloc_string_copy( workflow_job->module , module ); -} - -char * workflow_job_get_module( workflow_job_type * workflow_job) { - return workflow_job->module; -} - -void workflow_job_set_function( workflow_job_type * workflow_job , const char * function) { - workflow_job->function = util_realloc_string_copy( workflow_job->function , function ); -} - -char * workflow_job_get_function( workflow_job_type * workflow_job) { - return workflow_job->function; -} - -void workflow_job_iset_argtype( workflow_job_type * workflow_job , int iarg , config_item_types type) { - if (type == CONFIG_STRING || type == CONFIG_INT || type == CONFIG_FLOAT || type == CONFIG_BOOL) - int_vector_iset( workflow_job->arg_types , iarg , type ); -} - -void workflow_job_set_min_arg( workflow_job_type * workflow_job , int min_arg) { - workflow_job->min_arg = min_arg; -} - -void workflow_job_set_max_arg( workflow_job_type * workflow_job , int max_arg) { - workflow_job->max_arg = max_arg; -} - -int workflow_job_get_min_arg( const workflow_job_type * workflow_job ) { - return workflow_job->min_arg; -} - -int workflow_job_get_max_arg( const workflow_job_type * workflow_job ) { - return workflow_job->max_arg; -} - -config_item_types workflow_job_iget_argtype( const workflow_job_type * workflow_job, int index) { - return int_vector_safe_iget( workflow_job->arg_types , index ); -} - - - -static void workflow_job_iset_argtype_string( workflow_job_type * workflow_job , int iarg , const char * arg_type) { - config_item_types type = CONFIG_INVALID; - - if (strcmp( arg_type , WORKFLOW_JOB_STRING_TYPE) == 0) - type = CONFIG_STRING; - else if (strcmp( arg_type , WORKFLOW_JOB_INT_TYPE) == 0) - type = CONFIG_INT; - else if (strcmp( arg_type , WORKFLOW_JOB_FLOAT_TYPE) == 0) - type = CONFIG_FLOAT; - else if (strcmp( arg_type , WORKFLOW_JOB_BOOL_TYPE) == 0) - type = CONFIG_BOOL; - - if (type != CONFIG_INVALID) - workflow_job_iset_argtype( workflow_job , iarg , type ); - -} - - -static void workflow_job_validate_internal( workflow_job_type * workflow_job ) { - if (workflow_job->executable == NULL) { - if ((workflow_job->internal_script_path == NULL) && (workflow_job->function != NULL)) { - workflow_job->lib_handle = dlopen( workflow_job->module , RTLD_NOW ); - if (workflow_job->lib_handle != NULL) { - workflow_job->dl_func = (workflow_job_ftype *) dlsym( workflow_job->lib_handle , workflow_job->function ); - if (workflow_job->dl_func != NULL) - workflow_job->valid = true; - else - fprintf(stderr,"Failed to load symbol:%s Error:%s \n",workflow_job->function , dlerror()); - } else { - if (workflow_job->module != NULL) - fprintf(stderr,"Failed to load module:%s Error:%s \n",workflow_job->module , dlerror()); - } - } else if ((workflow_job->internal_script_path != NULL) && (workflow_job->function == NULL)) { - workflow_job->valid = true; - } else { - fprintf(stderr, "Must have function != NULL or internal_script != NULL for internal jobs"); - } - } else { - fprintf(stderr, "Must have executable == NULL for internal jobs\n"); - } -} - - -static void workflow_job_validate_external( workflow_job_type * workflow_job ) { - if (workflow_job->executable != NULL) { - if (util_is_executable( workflow_job->executable ) && - (workflow_job->module == workflow_job->function) && - (workflow_job->module == NULL)) - workflow_job->valid = true; - } -} - - - -static void workflow_job_validate( workflow_job_type * workflow_job ) { - if (workflow_job->internal) - workflow_job_validate_internal( workflow_job ); - else - workflow_job_validate_external( workflow_job ); -} - - - - -workflow_job_type * workflow_job_config_alloc( const char * name , config_parser_type * config , const char * config_file) { - workflow_job_type * workflow_job = NULL; - config_content_type * content = config_parse( config , config_file , "--", NULL , NULL , NULL , CONFIG_UNRECOGNIZED_WARN , true); - if (config_content_is_valid( content )) { - bool internal = DEFAULT_INTERNAL; - if (config_content_has_item( content , INTERNAL_KEY)) - internal = config_content_iget_as_bool( content , INTERNAL_KEY , 0 , 0 ); - - { - workflow_job = workflow_job_alloc( name , internal ); - - if (config_content_has_item( content , MIN_ARG_KEY)) - workflow_job_set_min_arg( workflow_job , config_content_iget_as_int( content , MIN_ARG_KEY , 0 , 0 )); - - if (config_content_has_item( content , MAX_ARG_KEY)) - workflow_job_set_max_arg( workflow_job , config_content_iget_as_int( content , MAX_ARG_KEY , 0 , 0 )); - - { - int i; - for (i=0; i < config_content_get_occurences( content , ARG_TYPE_KEY); i++) { - int iarg = config_content_iget_as_int( content , ARG_TYPE_KEY , i , 0 ); - const char * arg_type = config_content_iget( content , ARG_TYPE_KEY , i , 1 ); - - workflow_job_iset_argtype_string( workflow_job , iarg , arg_type ); - } - } - - if (config_content_has_item( content , MODULE_KEY)) - workflow_job_set_module( workflow_job , config_content_get_value( content , MODULE_KEY)); // Could be a pure so name; or a full path ..... Like executable - - if (config_content_has_item( content , FUNCTION_KEY)) - workflow_job_set_function( workflow_job , config_content_get_value( content , FUNCTION_KEY)); - - if (config_content_has_item( content , EXECUTABLE_KEY)) - workflow_job_set_executable( workflow_job , config_content_get_value_as_abspath( content , EXECUTABLE_KEY)); - - if (config_content_has_item( content , SCRIPT_KEY)) { - workflow_job_set_internal_script( workflow_job , config_content_get_value_as_abspath( content , SCRIPT_KEY)); - } - - workflow_job_validate( workflow_job ); - - if (!workflow_job->valid) { - workflow_job_free( workflow_job ); - workflow_job = NULL; - } - } - } - config_content_free( content ); - return workflow_job; -} - - - - -void workflow_job_free( workflow_job_type * workflow_job ) { - util_safe_free( workflow_job->module ); - util_safe_free( workflow_job->function ); - util_safe_free( workflow_job->executable ); - int_vector_free( workflow_job->arg_types ); - free( workflow_job->name ); - free( workflow_job ); -} - - -void workflow_job_free__( void * arg) { - workflow_job_type * workflow_job = workflow_job_safe_cast( arg ); - workflow_job_free( workflow_job ); -} - -/* - The workflow job can return an arbitrary (void *) pointer. It is the - calling scopes responsability to interpret this object correctly. If - the the workflow job allocates storage the calling scope must - discard it. -*/ - -static void * workflow_job_run_internal( const workflow_job_type * job, void * self , bool verbose , const stringlist_type * arg) { - return job->dl_func( self , arg ); -} - - -static void * workflow_job_run_external( const workflow_job_type * job, bool verbose , const stringlist_type * arg) { - char ** argv = stringlist_alloc_char_copy( arg ); - - util_spawn_blocking(job->executable, stringlist_get_size(arg), (const char **) argv, NULL, NULL); - - if (argv != NULL) { - int i; - for (i=0; i < stringlist_get_size( arg ); i++) - free( argv[i] ); - free( argv ); - } - return NULL; -} - -/* This is the old C way and will only be used from the TUI */ -void * workflow_job_run( const workflow_job_type * job, void * self , bool verbose , const stringlist_type * arg) { - if (job->internal) { - if (workflow_job_is_internal_script(job)) { - fprintf(stderr, "*** Can not run internal script workflow jobs using this method: workflow_job_run()\n"); - return NULL; - } else { - return workflow_job_run_internal( job, self, verbose, arg ); - } - } else { - return workflow_job_run_external( job, verbose, arg ); - } -} diff --git a/ThirdParty/Ert/libjob_queue/src/workflow_joblist.c b/ThirdParty/Ert/libjob_queue/src/workflow_joblist.c deleted file mode 100644 index 23806cc81a..0000000000 --- a/ThirdParty/Ert/libjob_queue/src/workflow_joblist.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'workflow_joblist.c' is part of ERT - Ensemble based - Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include -#include -#include - -#include - -#include -#include - - -struct workflow_joblist_struct { - config_parser_type * workflow_compiler; - config_parser_type * job_config; - - hash_type * joblist; -}; - - -workflow_joblist_type * workflow_joblist_alloc( ) { - workflow_joblist_type * joblist = util_malloc( sizeof * joblist ); - - joblist->job_config = workflow_job_alloc_config(); - joblist->workflow_compiler = config_alloc(); - joblist->joblist = hash_alloc(); - - return joblist; -} - - -void workflow_joblist_free( workflow_joblist_type * joblist) { - config_free( joblist->job_config ); - config_free( joblist->workflow_compiler ); - hash_free( joblist->joblist ); - free( joblist ); -} - - -const workflow_job_type * workflow_joblist_get_job( const workflow_joblist_type * joblist , const char * job_name) { - return hash_get( joblist->joblist , job_name ); -} - - -void workflow_joblist_add_job( workflow_joblist_type * joblist , const workflow_job_type * job) { - hash_insert_hash_owned_ref( joblist->joblist , workflow_job_get_name( job ) , job , workflow_job_free__ ); - workflow_job_update_config_compiler( job , joblist->workflow_compiler ); -} - - -bool workflow_joblist_has_job( const workflow_joblist_type * joblist , const char * job_name) { - workflow_job_type * job = hash_safe_get(joblist->joblist, job_name); - return (NULL != job); -} - -bool workflow_joblist_add_job_from_file( workflow_joblist_type * joblist , const char * job_name , const char * config_file ) { - workflow_job_type * job = workflow_job_config_alloc( job_name , joblist->job_config , config_file ); - if (job) { - workflow_joblist_add_job( joblist , job ); - return true; - } else - return false; -} - - -config_parser_type * workflow_joblist_get_compiler( const workflow_joblist_type * joblist ) { - return joblist->workflow_compiler; -} - - -config_parser_type * workflow_joblist_get_job_config( const workflow_joblist_type * joblist ) { - return joblist->job_config; -} - -stringlist_type * workflow_joblist_get_job_names(const workflow_joblist_type * joblist) { - return hash_alloc_stringlist(joblist->joblist); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/CMakeLists.txt b/ThirdParty/Ert/libjob_queue/tests/CMakeLists.txt deleted file mode 100644 index 873cc1a515..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/CMakeLists.txt +++ /dev/null @@ -1,87 +0,0 @@ -add_executable( job_status_test job_status_test.c ) -add_executable( job_loadOK job_loadOK.c ) -add_executable( job_loadFail job_loadFail.c ) -add_executable( job_node_test job_node_test.c ) -add_executable( job_list_test job_list_test.c ) -add_executable( create_file create_file.c ) -add_executable( job_workflow_test job_workflow_test.c ) -add_executable( job_lsf_parse_bsub_stdout job_lsf_parse_bsub_stdout.c ) -add_executable( job_lsf_exclude_hosts_test job_lsf_exclude_hosts_test.c ) - -target_link_libraries( job_status_test job_queue test_util ) -target_link_libraries( job_workflow_test job_queue test_util ) -target_link_libraries( create_file job_queue test_util ) -target_link_libraries( job_loadOK job_queue test_util ) -target_link_libraries( job_loadFail job_queue test_util ) -target_link_libraries( job_lsf_parse_bsub_stdout job_queue test_util) -target_link_libraries( job_node_test job_queue test_util) -target_link_libraries( job_list_test job_queue test_util) -target_link_libraries( job_lsf_exclude_hosts_test job_queue util ) - -add_test( job_status_test ${EXECUTABLE_OUTPUT_PATH}/job_status_test) -add_test( job_lsf_parse_bsub_stdout ${EXECUTABLE_OUTPUT_PATH}/job_lsf_parse_bsub_stdout ) - -add_test( job_workflow_test ${EXECUTABLE_OUTPUT_PATH}/job_workflow_test ${EXECUTABLE_OUTPUT_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/data/internal_job) - -add_test( job_loadOK1 ${EXECUTABLE_OUTPUT_PATH}/job_loadOK ${CMAKE_CURRENT_SOURCE_DIR}/data/internalOK) -add_test( job_loadOK2 ${EXECUTABLE_OUTPUT_PATH}/job_loadOK ${CMAKE_CURRENT_SOURCE_DIR}/data/externalOK) -add_test( job_loadOK3 ${EXECUTABLE_OUTPUT_PATH}/job_loadOK ${CMAKE_CURRENT_SOURCE_DIR}/data/internalOK ${CMAKE_CURRENT_SOURCE_DIR}/data/externalOK) - -add_test( job_loadFail1 ${EXECUTABLE_OUTPUT_PATH}/job_loadFail ${CMAKE_CURRENT_SOURCE_DIR}/data/internalFail) -add_test( job_loadFail2 ${EXECUTABLE_OUTPUT_PATH}/job_loadFail ${CMAKE_CURRENT_SOURCE_DIR}/data/externalFail) -add_test( job_loadFail3 ${EXECUTABLE_OUTPUT_PATH}/job_loadFail ${CMAKE_CURRENT_SOURCE_DIR}/data/internalFail ${CMAKE_CURRENT_SOURCE_DIR}/data/externalFail) - -add_test( job_node_test ${EXECUTABLE_OUTPUT_PATH}/job_node_test) -add_test( job_list_test valgrind --leak-check=full --error-exitcode=1 ${EXECUTABLE_OUTPUT_PATH}/job_list_test) -add_test( job_lsf_exclude_hosts_test ${EXECUTABLE_OUTPUT_PATH}/job_lsf_exclude_hosts_test ${EXECUTABLE_OUTPUT_PATH}/job_program NULL LOCAL) - -add_executable( job_program_output job_program_output.c ) -target_link_libraries( job_program_output ert_util test_util) - -add_executable( job_queue_test job_job_queue_test.c ) -target_link_libraries( job_queue_test job_queue test_util ) -add_test( job_queue_test ${EXECUTABLE_OUTPUT_PATH}/job_queue_test ${EXECUTABLE_OUTPUT_PATH}/job_program_output ) - -add_executable( job_queue_stress_task job_queue_stress_task.c ) -target_link_libraries( job_queue_stress_task ert_util ) - -add_executable( job_queue_stress_test job_queue_stress_test.c ) -target_link_libraries( job_queue_stress_test job_queue test_util ) -add_test( job_queue_stress_test ${EXECUTABLE_OUTPUT_PATH}/job_queue_stress_test ${EXECUTABLE_OUTPUT_PATH}/job_queue_stress_task False) -add_test( job_queue_user_exit ${EXECUTABLE_OUTPUT_PATH}/job_queue_stress_test ${EXECUTABLE_OUTPUT_PATH}/job_queue_stress_task True) - -add_executable( job_queue_timeout_test job_queue_timeout_test.c ) -target_link_libraries( job_queue_timeout_test job_queue test_util ) -add_test( job_queue_timeout_test ${EXECUTABLE_OUTPUT_PATH}/job_queue_timeout_test ${EXECUTABLE_OUTPUT_PATH}/job_queue_stress_task) - -add_executable( job_queue_driver_test job_queue_driver_test.c ) -target_link_libraries( job_queue_driver_test job_queue test_util ) -add_test( job_queue_driver_test ${EXECUTABLE_OUTPUT_PATH}/job_queue_driver_test ) - - -if (ERT_LSF_SUBMIT_TEST) - include( lsf_tests.cmake ) -endif() - - -add_executable( job_torque_test job_torque_test.c ) -target_link_libraries( job_torque_test job_queue ert_util test_util ) -add_test( job_torque_test ${EXECUTABLE_OUTPUT_PATH}/job_torque_test ) - -add_executable( job_queue_manager job_queue_manager.c ) -target_link_libraries( job_queue_manager job_queue ert_util test_util ) -add_test( job_queue_manager ${EXECUTABLE_OUTPUT_PATH}/job_queue_manager ) - -file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data/qsub_emulators/ DESTINATION ${EXECUTABLE_OUTPUT_PATH}) - -add_executable( job_torque_submit_test job_torque_submit_test.c ) -target_link_libraries( job_torque_submit_test job_queue ert_util test_util ) -add_test(NAME job_torque_submit_test WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} COMMAND ${EXECUTABLE_OUTPUT_PATH}/job_torque_submit_test dummyparam) -set_property(TEST job_torque_submit_test PROPERTY ENVIRONMENT “setenv PATH ${EXECUTABLE_OUTPUT_PATH}:$PATHâ€) - - -add_executable( ext_joblist_test ext_joblist_test.c ) -target_link_libraries( ext_joblist_test job_queue test_util ) -add_test( ext_joblist_test ${EXECUTABLE_OUTPUT_PATH}/ext_joblist_test ${CMAKE_CURRENT_SOURCE_DIR}/data/jobs/util ${CMAKE_CURRENT_SOURCE_DIR}) -set_property(TEST ext_joblist_test PROPERTY LABELS StatoilData ) - diff --git a/ThirdParty/Ert/libjob_queue/tests/create_file.c b/ThirdParty/Ert/libjob_queue/tests/create_file.c deleted file mode 100644 index fbba657756..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/create_file.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'create_file.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include - - -int main( int argc , char ** argv) { - char * filename = argv[1]; - int value = atoi( argv[2] ); - FILE * stream = fopen( filename , "w"); - fprintf(stream , "%d\n", value ); - fclose( stream ); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/data/externalFail b/ThirdParty/Ert/libjob_queue/tests/data/externalFail deleted file mode 100644 index 0f53d812c3..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/data/externalFail +++ /dev/null @@ -1,5 +0,0 @@ -INTERNAL False -MIN_ARG 1 -MAX_ARG 2 -ARG_TYPE 0 STRING -ARG_TYPE 1 INT diff --git a/ThirdParty/Ert/libjob_queue/tests/data/externalOK b/ThirdParty/Ert/libjob_queue/tests/data/externalOK deleted file mode 100644 index 67dec0bef2..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/data/externalOK +++ /dev/null @@ -1,6 +0,0 @@ -INTERNAL False -EXECUTABLE /usr/bin/python -MIN_ARG 1 -MAX_ARG 2 -ARG_TYPE 0 STRING -ARG_TYPE 1 INT diff --git a/ThirdParty/Ert/libjob_queue/tests/data/external_job b/ThirdParty/Ert/libjob_queue/tests/data/external_job deleted file mode 100644 index 5b39223101..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/data/external_job +++ /dev/null @@ -1,5 +0,0 @@ -EXECUTABLE /private/joaho/ERT/git/ert/build/bin/create_file -ARG_TYPE 0 STRING -ARG_TYPE 1 INT -MIN_ARG 2 -MAX_ARG 2 \ No newline at end of file diff --git a/ThirdParty/Ert/libjob_queue/tests/data/internalFail b/ThirdParty/Ert/libjob_queue/tests/data/internalFail deleted file mode 100644 index 40686fc1d5..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/data/internalFail +++ /dev/null @@ -1,6 +0,0 @@ -INTERNAL True -MODULE NULL -MIN_ARG 1 -MAX_ARG 2 -ARG_TYPE 0 STRING -ARG_TYPE 1 INT diff --git a/ThirdParty/Ert/libjob_queue/tests/data/internalOK b/ThirdParty/Ert/libjob_queue/tests/data/internalOK deleted file mode 100644 index 6252998faa..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/data/internalOK +++ /dev/null @@ -1,7 +0,0 @@ -INTERNAL True -MODULE NULL -FUNCTION workflow_job_alloc -MIN_ARG 1 -MAX_ARG 2 -ARG_TYPE 0 STRING -ARG_TYPE 1 INT diff --git a/ThirdParty/Ert/libjob_queue/tests/data/internal_job b/ThirdParty/Ert/libjob_queue/tests/data/internal_job deleted file mode 100644 index 2c86544a44..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/data/internal_job +++ /dev/null @@ -1,5 +0,0 @@ -INTERNAL True -FUNCTION read_file -ARG_TYPE 0 STRING -MIN_ARG 1 -MAX_ARG 1 diff --git a/ThirdParty/Ert/libjob_queue/tests/data/jobs/util/COPY_FILE b/ThirdParty/Ert/libjob_queue/tests/data/jobs/util/COPY_FILE deleted file mode 100644 index 9867a28978..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/data/jobs/util/COPY_FILE +++ /dev/null @@ -1,2 +0,0 @@ -EXECUTABLE /bin/cp -ARGLIST diff --git a/ThirdParty/Ert/libjob_queue/tests/data/jobs/util/REPLACE b/ThirdParty/Ert/libjob_queue/tests/data/jobs/util/REPLACE deleted file mode 100644 index 79e5f19b01..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/data/jobs/util/REPLACE +++ /dev/null @@ -1,6 +0,0 @@ -STDOUT replace.stdout -STDERR replace.stderr - -EXECUTABLE /project/res/x86_64_RH_4/bin/replace.x -ARGLIST - diff --git a/ThirdParty/Ert/libjob_queue/tests/data/jobs/util/STORE_FILE b/ThirdParty/Ert/libjob_queue/tests/data/jobs/util/STORE_FILE deleted file mode 100644 index 0bdb3d3b68..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/data/jobs/util/STORE_FILE +++ /dev/null @@ -1,5 +0,0 @@ -STDOUT store_file.stdout -STDERR store_file.stderr - -EXECUTABLE ../../../Scripts/store_file.py -ARGLIST diff --git a/ThirdParty/Ert/libjob_queue/tests/data/jobs/util/SYMLINK b/ThirdParty/Ert/libjob_queue/tests/data/jobs/util/SYMLINK deleted file mode 100644 index 72ebb65a7c..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/data/jobs/util/SYMLINK +++ /dev/null @@ -1,6 +0,0 @@ -STDERR SYMLINK.stderr -STDOUT SYMLINK.stdout - -EXECUTABLE /bin/ln -ARGLIST -sf - diff --git a/ThirdParty/Ert/libjob_queue/tests/data/qsub_emulators/qdel b/ThirdParty/Ert/libjob_queue/tests/data/qsub_emulators/qdel deleted file mode 100644 index 513e57d5da..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/data/qsub_emulators/qdel +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -echo "#!/bin/sh" > qstat -echo "echo \"Job id Name User Time Use S Queue\"" >> qstat -echo "echo \"------------------------- ---------------- --------------- -------- - -----\"" >> qstat -echo "echo \"1612427.st-lcmm ...130getupdates fama 00:00:01 E normal\"" >> qstat \ No newline at end of file diff --git a/ThirdParty/Ert/libjob_queue/tests/data/qsub_emulators/qstat b/ThirdParty/Ert/libjob_queue/tests/data/qsub_emulators/qstat deleted file mode 100644 index 47ae34dc9b..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/data/qsub_emulators/qstat +++ /dev/null @@ -1 +0,0 @@ -Content will be piped into this file \ No newline at end of file diff --git a/ThirdParty/Ert/libjob_queue/tests/data/qsub_emulators/qsub b/ThirdParty/Ert/libjob_queue/tests/data/qsub_emulators/qsub deleted file mode 100644 index 43ddcb8568..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/data/qsub_emulators/qsub +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -echo 1612427.greier.og.greier -echo "#!/bin/sh" > qstat -echo "echo \"Job id Name User Time Use S Queue\"" >> qstat -echo "echo \"------------------------- ---------------- --------------- -------- - -----\"" >> qstat -echo "echo \"1612427.st-lcmm ...130getupdates fama 00:00:01 R normal\"" >> qstat \ No newline at end of file diff --git a/ThirdParty/Ert/libjob_queue/tests/ext_joblist_test.c b/ThirdParty/Ert/libjob_queue/tests/ext_joblist_test.c deleted file mode 100644 index 5dfdc9848b..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/ext_joblist_test.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'ext_joblist_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -void load_job_directory(ext_joblist_type * joblist , const char * path, const char * license_root_path) { - bool user_mode = false; - ext_joblist_add_jobs_in_directory(joblist , path, license_root_path, user_mode, true ); - test_assert_true( ext_joblist_has_job(joblist, "SYMLINK")); -} - -int main( int argc , char ** argv) { - int status = 0; - ext_joblist_type * joblist = ext_joblist_alloc(); - load_job_directory(joblist , argv[1], argv[2] ); - ext_joblist_free(joblist); - exit( status ); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/job_job_queue_test.c b/ThirdParty/Ert/libjob_queue/tests/job_job_queue_test.c deleted file mode 100644 index a24e5afcd6..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_job_queue_test.c +++ /dev/null @@ -1,491 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'job_queue_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. - */ -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include -#include - -void submit_jobs_to_queue(job_queue_type * queue, test_work_area_type * work_area, char * executable_to_run, int number_of_jobs, int number_of_slowjobs, char* sleep_short, char* sleep_long) { - int submitted_slowjobs = 0; - for (int i = 0; i < number_of_jobs; i++) { - char * runpath = util_alloc_sprintf("%s/%s_%d", test_work_area_get_cwd(work_area), "job", i); - util_make_path(runpath); - - char * sleeptime = sleep_short; - if (submitted_slowjobs < number_of_slowjobs) { - sleeptime = sleep_long; - submitted_slowjobs++; - } - - job_queue_add_job(queue, executable_to_run, NULL, NULL, NULL, NULL, 1, runpath, "Testjob", 2, (const char *[2]) {runpath, sleeptime}); - free(runpath); - } - test_assert_int_equal( number_of_jobs , job_queue_get_active_size(queue) ); -} - -void monitor_job_queue(job_queue_type * queue, int max_job_duration, time_t stop_time, int min_realizations) { - if (min_realizations > 0) { - while (true) { - util_usleep(100); - - //Check if minimum number of realizations have run, and if so, kill the rest after a certain time - if ((job_queue_get_num_complete(queue) >= min_realizations)) { - job_queue_set_max_job_duration(queue, max_job_duration); - job_queue_set_job_stop_time(queue, stop_time); - break; - } - } - } -} - - - -void run_jobs_with_time_limit_test(char * executable_to_run, int number_of_jobs, int number_of_slowjobs, char * sleep_short, char * sleep_long, int max_sleep) { - test_work_area_type * work_area = test_work_area_alloc("job_queue"); - job_queue_type * queue = job_queue_alloc(number_of_jobs, "OK.status", "STATUS", "ERROR"); - - queue_driver_type * driver = queue_driver_alloc_local(); - job_queue_set_driver(queue, driver); - job_queue_set_max_job_duration(queue, max_sleep); - - submit_jobs_to_queue(queue, work_area, executable_to_run, number_of_jobs, number_of_slowjobs, sleep_short, sleep_long); - - job_queue_run_jobs(queue, number_of_jobs, false); - - test_assert_int_equal(number_of_jobs - number_of_slowjobs, job_queue_get_num_complete(queue)); - test_assert_int_equal(number_of_slowjobs, job_queue_get_num_killed(queue)); - - test_assert_bool_equal(false, job_queue_get_open(queue)); - job_queue_reset(queue); - test_assert_bool_equal(true, job_queue_get_open(queue)); - - test_assert_int_equal(0, job_queue_get_num_complete(queue)); - - job_queue_free(queue); - queue_driver_free(driver); - test_work_area_free(work_area); -} - - -void run_and_monitor_jobs(char * executable_to_run, - int number_of_jobs , - int max_job_duration, - time_t stop_time, - int min_realizations, - int min_completed, - int max_completed , - int interval_between_jobs) { - - test_work_area_type * work_area = test_work_area_alloc("job_queue"); - job_queue_type * queue = job_queue_alloc(number_of_jobs, "OK.status", "STATUS", "ERROR"); - job_queue_manager_type * queue_manager = job_queue_manager_alloc( queue ); - queue_driver_type * driver = queue_driver_alloc_local(); - - job_queue_set_driver(queue, driver); - - - int job_run_time = 0; - - for (int i = 0; i < number_of_jobs; i++) { - char * runpath = util_alloc_sprintf("%s/%s_%d", test_work_area_get_cwd(work_area), "job", i); - char * sleeptime = util_alloc_sprintf("%d", job_run_time); - - util_make_path(runpath); - job_queue_add_job(queue, executable_to_run, NULL, NULL, NULL, NULL, 1, runpath, "Testjob", 2, (const char *[2]) {runpath, sleeptime}); - job_run_time += interval_between_jobs; - - free(sleeptime); - free(runpath); - } - job_queue_submit_complete(queue); - job_queue_manager_start_queue(queue_manager,0,false,false); - monitor_job_queue( queue , max_job_duration , stop_time , min_realizations ); - job_queue_manager_wait(queue_manager); - - printf("Completed: %d <= %d <= %d ?\n",min_completed , job_queue_get_num_complete(queue) , max_completed); - test_assert_true(job_queue_get_num_complete(queue) >= min_completed); - test_assert_true(job_queue_get_num_complete(queue) <= max_completed); - - test_assert_int_equal(number_of_jobs - job_queue_get_num_complete( queue ) , job_queue_get_num_killed(queue)); - test_assert_bool_equal(false, job_queue_get_open(queue)); - job_queue_reset(queue); - test_assert_bool_equal(true, job_queue_get_open(queue)); - test_assert_int_equal(0, job_queue_get_num_complete(queue)); - - job_queue_free(queue); - queue_driver_free(driver); - job_queue_manager_free( queue_manager ); - test_work_area_free(work_area); -} - -void run_jobs_time_limit_multithreaded(char * executable_to_run, int number_of_jobs, int number_of_slowjobs, char * sleep_short, char * sleep_long, int max_sleep) { - test_work_area_type * work_area = test_work_area_alloc("job_queue"); - - - job_queue_type * queue = job_queue_alloc(number_of_jobs, "OK.status", "STATUS", "ERROR"); - queue_driver_type * driver = queue_driver_alloc_local(); - job_queue_set_driver(queue, driver); - job_queue_set_max_job_duration(queue, max_sleep); - - arg_pack_type * arg_pack = arg_pack_alloc(); - arg_pack_append_ptr(arg_pack, queue); - arg_pack_append_int(arg_pack, 0); - arg_pack_append_bool(arg_pack, false); - - thread_pool_type * pool = thread_pool_alloc(1, true); - thread_pool_add_job(pool, job_queue_run_jobs__, arg_pack); - - submit_jobs_to_queue(queue, work_area, executable_to_run, number_of_jobs, number_of_slowjobs, sleep_short, sleep_long); - - job_queue_submit_complete(queue); - thread_pool_join(pool); - thread_pool_free(pool); - - test_assert_int_equal(number_of_jobs - number_of_slowjobs, job_queue_get_num_complete(queue)); - test_assert_int_equal(number_of_slowjobs, job_queue_get_num_killed(queue)); - test_assert_bool_equal(false, job_queue_get_open(queue)); - job_queue_reset(queue); - test_assert_bool_equal(true, job_queue_get_open(queue)); - test_assert_int_equal(0, job_queue_get_num_complete(queue)); - - job_queue_free(queue); - queue_driver_free(driver); - test_work_area_free(work_area); -} - -void test1(char ** argv) { - printf("001: Running JobQueueRunJobs_ReuseQueue_AllOk\n"); - - int number_of_jobs = 20; - int number_of_queue_reuse = 10; - - test_work_area_type * work_area = test_work_area_alloc("job_queue"); - - job_queue_type * queue = job_queue_alloc(number_of_jobs, "OK.status", "STATUS", "ERROR"); - queue_driver_type * driver = queue_driver_alloc_local(); - job_queue_set_driver(queue, driver); - - for (int j = 0; j < number_of_queue_reuse; j++) { - submit_jobs_to_queue(queue, work_area, argv[1], number_of_jobs, 0, "0", "0"); - - job_queue_run_jobs(queue, number_of_jobs, false); - - test_assert_int_equal(number_of_jobs, job_queue_get_num_complete(queue)); - test_assert_bool_equal(false, job_queue_get_open(queue)); - job_queue_reset(queue); - test_assert_bool_equal(true, job_queue_get_open(queue)); - test_assert_int_equal(0, job_queue_get_num_complete(queue)); - } - job_queue_free(queue); - queue_driver_free(driver); - test_work_area_free(work_area); - -} - -void test2(char ** argv) { - printf("002: Running JobQueueRunJobs_ReuseQueueWithStopTime_AllOk\n"); - - int number_of_jobs = 3; - int number_of_slow_jobs = 2; - int number_of_queue_reuse = 3; - - test_work_area_type * work_area = test_work_area_alloc("job_queue"); - - job_queue_type * queue = job_queue_alloc(number_of_jobs, "OK.status", "STATUS", "ERROR"); - queue_driver_type * driver = queue_driver_alloc_local(); - job_queue_set_driver(queue, driver); - - for (int j = 0; j < number_of_queue_reuse; j++) { - submit_jobs_to_queue(queue, work_area, argv[1], number_of_jobs, number_of_slow_jobs, "1", "5"); - - job_queue_run_jobs(queue, number_of_jobs, false); - time_t current_time = time(NULL); - job_queue_set_job_stop_time(queue, current_time); - - test_assert_int_equal(number_of_jobs, job_queue_get_num_complete(queue)); - test_assert_bool_equal(false, job_queue_get_open(queue)); - job_queue_reset(queue); - test_assert_bool_equal(true, job_queue_get_open(queue)); - test_assert_int_equal(0, job_queue_get_num_complete(queue)); - } - job_queue_free(queue); - queue_driver_free(driver); - test_work_area_free(work_area); - -} - - -void test3(char ** argv) { - printf("003: Running JobQueueSetStopTime_StopTimeEarly_MinRealisationsAreRun\n"); - - //Use stop_time to to stop jobs after min_realizations are finished - int number_of_jobs = 10; - int min_realizations = 5; - int num_expected_completed = 5; - int max_duration_time = 0; - int interval_between_jobs = 2; - time_t stoptime = time( NULL ); - - run_and_monitor_jobs(argv[1], number_of_jobs , max_duration_time, stoptime, min_realizations, num_expected_completed, num_expected_completed , interval_between_jobs); -} - -void test4(char ** argv) { - printf("004: Running JobQueueSetMaxDuration_Duration5Seconds_KillsAllJobsWithDurationMoreThan5Seconds\n"); - run_jobs_with_time_limit_test(argv[1], 100, 23, "1", "100", 5); -} - - -void test5(char ** argv) { - printf("005: Running JobQueueSetStopTime_StopTimeLate_AllRealisationsAreRun\n"); - - //Use stop_time to to stop jobs after min_realizations are finished - int number_of_jobs = 10; - int min_realizations = 5; - int num_expected_completed = 10; - int max_duration_time = 0; - int interval_between_jobs = 0; - time_t currenttime; - time(¤ttime); - time_t stoptime = currenttime + 15; - run_and_monitor_jobs(argv[1], number_of_jobs , max_duration_time, stoptime, min_realizations, num_expected_completed, num_expected_completed , interval_between_jobs); -} - -void test6(char ** argv) { - printf("006: Running JobQueueSetStopTimeAndMaxDuration_MaxDurationShort_StopTimeLong_MinRealisationsAreRun\n"); - - int number_of_jobs = 10; - int min_realizations = 1; - int num_expected_completed = 1; - int max_duration_time = 1; - int interval_between_jobs = 2; - time_t currenttime; - time(¤ttime); - time_t stoptime = currenttime + 10; - run_and_monitor_jobs(argv[1], number_of_jobs , max_duration_time, stoptime, min_realizations, num_expected_completed, number_of_jobs , interval_between_jobs); - -} - -void test7(char ** argv) { - printf("007: Running JobQueueSetStopTimeAndMaxDuration_MaxDurationLong_StopTimeEarly_MinRealisationsAreRun\n"); - - int number_of_jobs = 10; - int min_realizations = 1; - int num_expected_completed = 1; - int max_duration_time = 10; - int interval_between_jobs = 2; - time_t currenttime; - time(¤ttime); - time_t stoptime = currenttime + 1; - run_and_monitor_jobs(argv[1], number_of_jobs , max_duration_time, stoptime, min_realizations, num_expected_completed, num_expected_completed , interval_between_jobs); -} - -void test8(char ** argv) { - printf("008: Running JobQueueSetMaxDurationAfterMinRealizations_MaxDurationShort_OnlyMinRealizationsAreRun\n"); - - // Must have one job completed, the rest are then killed due to the max_duration_time gets exceeded. - int number_of_jobs = 10; - int min_realizations = 1; - int num_expected_completed = 1; - int max_duration_time = 1; - int interval_between_jobs = 2; - time_t currenttime = 0; - - run_and_monitor_jobs(argv[1], number_of_jobs , max_duration_time, currenttime, min_realizations, num_expected_completed, 3 , interval_between_jobs); -} - -void test9(char ** argv) { - printf("009: Running JobQueueSetMaxDurationAfterMinRealizations_MaxDurationLooong_AllRealizationsAreRun\n"); - - // Min realizations is 1, but the max running time exceeds the time used by any of the jobs, so all run to completion - int number_of_jobs = 10; - int min_realizations = 1; - int num_expected_completed = 10; - int max_duration_time = 12; - int interval_between_jobs = 1; - time_t currenttime = 0; - run_and_monitor_jobs(argv[1], number_of_jobs , max_duration_time, currenttime, min_realizations, num_expected_completed, num_expected_completed , interval_between_jobs); -} - - -void test10(char ** argv) { - printf("010: Running JobQueueSetMaxDurationAfterMinRealizations_MaxDurationSemiLong_MoreThanMinRealizationsAreRun\n"); - - int number_of_jobs = 10; - int min_realizations = 3; - int max_duration_time = 7; - int interval_between_jobs = 2; - time_t currenttime = 0; - run_and_monitor_jobs(argv[1], number_of_jobs , max_duration_time, currenttime, min_realizations, min_realizations , number_of_jobs , interval_between_jobs); -} - -void test11(char ** argv) { - printf("011: Running JobQueueSetMaxDurationAfterMinRealizations_MaxDurationShortButMinRealizationsIsAll_AllRealizationsAreRun\n"); - - // Min is 10, so all run to completion - int number_of_jobs = 10; - int min_realizations = 10; - int num_expected_completed = 10; - int max_duration_time = 1; - int interval_between_jobs = 0; - time_t currenttime = 0; - run_and_monitor_jobs(argv[1], number_of_jobs , max_duration_time, currenttime, min_realizations, num_expected_completed, num_expected_completed , interval_between_jobs); -} - -void test12(char ** argv) { - printf("012: Running JobQueueSetMaxDuration_DurationZero_AllRealisationsAreRun\n"); - run_jobs_with_time_limit_test(argv[1], 10, 0, "1", "100", 0); // 0 as limit means no limit*/ -} - -void test13(char ** argv) { - printf("013: Running JobQueueSetMaxDurationRunJobsLoopInThread_Duration5Seconds_KillsAllJobsWithDurationMoreThan5Seconds\n"); - run_jobs_time_limit_multithreaded(argv[1], 100, 23, "1", "100", 5); -} - -void test14(char ** argv) { - printf("014: Running JobQueueSetAutoStopTime_ThreeQuickJobs_AutoStopTimeKillsTheRest\n"); - - int number_of_jobs = 10; - - test_work_area_type * work_area = test_work_area_alloc("job_queue"); - job_queue_type * queue = job_queue_alloc(number_of_jobs, "OK.status", "STATUS", "ERROR"); - queue_driver_type * driver = queue_driver_alloc_local(); - job_queue_manager_type * queue_manager = job_queue_manager_alloc( queue ); - job_queue_set_driver(queue, driver); - - - int number_of_slowjobs = 7; - int number_of_fastjobs = number_of_jobs - number_of_slowjobs; - char * sleep_short = "0"; - char * sleep_long = "100"; - submit_jobs_to_queue(queue, work_area, argv[1], number_of_jobs, number_of_slowjobs, sleep_short, sleep_long); - job_queue_submit_complete(queue); - job_queue_manager_start_queue( queue_manager , 10 , false , false); - - /* - The jobs are distributed with some very fast, and some quite - long. Here we busy wait until all the fast ones have completed and - then we calculate a stop for the remaining jobs with the - job_queue_set_auto_job_stop_time() function. - */ - - while (true) { - int num_complete = job_queue_get_num_complete(queue); - if (num_complete == number_of_fastjobs) - break; - util_usleep( 100000 ); - } - - job_queue_set_auto_job_stop_time(queue); - job_queue_manager_wait(queue_manager); - - - test_assert_int_equal(number_of_jobs - number_of_slowjobs, job_queue_get_num_complete(queue)); - test_assert_int_equal(number_of_slowjobs, job_queue_get_num_killed(queue)); - - test_assert_bool_equal(false, job_queue_get_open(queue)); - job_queue_reset(queue); - test_assert_bool_equal(true, job_queue_get_open(queue)); - - test_assert_int_equal(0, job_queue_get_num_complete(queue)); - - job_queue_manager_free( queue_manager ); - job_queue_free(queue); - queue_driver_free(driver); - test_work_area_free(work_area); -} - -void test15(char ** argv) { - printf("015: Running JobQueueSetAutoStopTime_NoJobsAreFinished_AutoStopDoesNothing\n"); - - int number_of_jobs = 10; - - test_work_area_type * work_area = test_work_area_alloc("job_queue"); - job_queue_type * queue = job_queue_alloc(number_of_jobs, "OK.status", "STATUS", "ERROR"); - queue_driver_type * driver = queue_driver_alloc_local(); - job_queue_set_driver(queue, driver); - - char * sleep_long = "100"; - - submit_jobs_to_queue(queue, work_area, argv[1], number_of_jobs, number_of_jobs, "0", sleep_long); - - job_queue_set_auto_job_stop_time(queue); - - test_assert_int_equal(0, job_queue_get_num_complete(queue)); - test_assert_bool_equal(true, job_queue_get_open(queue)); - - job_queue_free(queue); - queue_driver_free(driver); - test_work_area_free(work_area); -} - -void test16(char ** argv) { - printf("016: Running JobQueueSetAutoStopTime_AllJobsAreFinished_AutoStopDoesNothing\n"); - - int number_of_jobs = 10; - test_work_area_type * work_area = test_work_area_alloc("job_queue"); - job_queue_type * queue = job_queue_alloc(number_of_jobs, "OK.status", "STATUS", "ERROR"); - - queue_driver_type * driver = queue_driver_alloc_local(); - job_queue_set_driver(queue, driver); - - submit_jobs_to_queue(queue, work_area, argv[1], number_of_jobs, 0, "0", "0"); - - job_queue_run_jobs(queue, number_of_jobs, false); - - test_assert_int_equal(number_of_jobs, job_queue_get_num_complete(queue)); - test_assert_bool_equal(false, job_queue_get_open(queue)); - job_queue_reset(queue); - test_assert_bool_equal(true, job_queue_get_open(queue)); - test_assert_int_equal(0, job_queue_get_num_complete(queue)); - job_queue_free(queue); - queue_driver_free(driver); - test_work_area_free(work_area); -} - - -int main(int argc, char ** argv) { - util_install_signals(); - - test1(argv); - test2(argv); - test3(argv); - test4(argv); - test5(argv); - test6(argv); - test7(argv); - test8(argv); - test9(argv); - test10(argv); - test11(argv); - test12(argv); - test13(argv); - test14(argv); - test15(argv); - test16(argv); - - exit(0); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/job_list_test.c b/ThirdParty/Ert/libjob_queue/tests/job_list_test.c deleted file mode 100644 index 5859623adb..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_list_test.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - Copyright (C) 2015 Statoil ASA, Norway. - - The file 'job_node_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include - -#include "ert/util/build_config.h" - -#include -#include -#include - -#include -#include - - -void test_create() { - job_list_type * list = job_list_alloc(); - test_assert_true( job_list_is_instance( list )); - test_assert_int_equal( 0 , job_list_get_size( list )); - job_list_free( list ); -} - - - -void call_add_job( void * arg ) { - arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); - job_list_type * job_list = arg_pack_iget_ptr( arg_pack , 0 ); - job_queue_node_type * node = arg_pack_iget_ptr( arg_pack , 1 ); - job_list_add_job( job_list , node ); -} - - -void call_iget_job( void * arg ) { - job_list_type * job_list = job_list_safe_cast( arg ); - job_list_iget_job( job_list , 10); -} - - - -void test_add_job() { - job_list_type * list = job_list_alloc(); - job_queue_node_type * node = job_queue_node_alloc_simple("name" , "/tmp" , "/bin/ls" , 0 , NULL); - job_list_add_job( list , node ); - test_assert_int_equal( job_list_get_size( list ) , 1 ); - test_assert_int_equal( job_queue_node_get_queue_index(node) , 0 ); - test_assert_ptr_equal( node , job_list_iget_job(list , 0)); - { - arg_pack_type * arg_pack = arg_pack_alloc( ); - arg_pack_append_ptr( arg_pack , list ); - arg_pack_append_ptr( arg_pack , node ); - test_assert_util_abort("job_queue_node_set_queue_index", call_add_job, arg_pack ); - arg_pack_free( arg_pack ); - } - test_assert_util_abort("job_list_iget_job", call_iget_job, list); - job_list_reset( list ); - test_assert_int_equal( 0 , job_list_get_size( list )); - job_list_free( list ); -} - - -int main( int argc , char ** argv) { - util_install_signals(); - test_create(); - test_add_job(); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/job_loadFail.c b/ThirdParty/Ert/libjob_queue/tests/job_loadFail.c deleted file mode 100644 index a2e5c20d28..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_loadFail.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'job_loadFail.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include - -#include - -#include - - - -bool loadConfig(config_parser_type * config , const char * config_file, config_parser_type * config_compiler) { - bool OK = false; - workflow_job_type * cmd = workflow_job_config_alloc( "NAME" , config , config_file); - - if (cmd != NULL) { - OK = true; - workflow_job_update_config_compiler( cmd , config_compiler ); - workflow_job_free( cmd ); - } - - return OK; -} - - - -int main( int argc , char ** argv) { - int status = 0; - { - config_parser_type * config = workflow_job_alloc_config(); - config_parser_type * config_compiler = config_alloc(); - int iarg; - bool OK = true; - - for (iarg = 1; iarg < argc; iarg++) - OK = OK && (loadConfig( config , argv[iarg] , config_compiler ) == false); - - if (!OK) - status = 1; - - config_free(config_compiler); - config_free(config); - } - exit( status ); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/job_loadOK.c b/ThirdParty/Ert/libjob_queue/tests/job_loadOK.c deleted file mode 100644 index 2e15a636e5..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_loadOK.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'job_loadOK.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include - -#include - -#include - - - -bool loadConfig(config_parser_type * config , const char * config_file , config_parser_type * config_compiler) { - bool OK = false; - workflow_job_type * cmd = workflow_job_config_alloc( "NAME" , config , config_file); - - if (cmd != NULL) { - OK = true; - workflow_job_update_config_compiler( cmd , config_compiler ); - workflow_job_free( cmd ); - } - - return OK; -} - - - -int main( int argc , char ** argv) { - int status = 0; - { - config_parser_type * config = workflow_job_alloc_config(); - config_parser_type * config_compiler = config_alloc(); - int iarg; - bool OK = true; - - for (iarg = 1; iarg < argc; iarg++) - OK = OK && loadConfig( config , argv[iarg] , config_compiler); - - if (!OK) - status = 1; - - config_free(config_compiler); - config_free(config); - } - exit( status ); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/job_lsb.c b/ThirdParty/Ert/libjob_queue/tests/job_lsb.c deleted file mode 100644 index efd340ce4a..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_lsb.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'job_lsb.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include - -#include - -#include - -/* - This test should ideally be run twice in two different environments; - with and without dlopen() access to the lsf libraries. -*/ - -int main( int argc , char ** argv) { - lsb_type * lsb = lsb_alloc(); - - test_assert_not_NULL( lsb ); - if (!lsb_ready(lsb)) { - const stringlist_type * error_list = lsb_get_error_list( lsb ); - stringlist_fprintf(error_list , "\n", stdout); - } - - if (dlopen( "libbat.so" , RTLD_NOW | RTLD_GLOBAL)) - test_assert_true( lsb_ready( lsb )); - else - test_assert_false( lsb_ready( lsb )); - - lsb_free( lsb ); - exit(0); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/job_lsf_exclude_hosts_test.c b/ThirdParty/Ert/libjob_queue/tests/job_lsf_exclude_hosts_test.c deleted file mode 100644 index 6ea2275f8c..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_lsf_exclude_hosts_test.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2016 Statoil ASA, Norway. - * - * This file is part of ERT - Ensemble based Reservoir Tool. - * - * ERT 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. - * - * ERT 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 - * for more details. - */ - -#include -#include -#include - -#include -#include - -#include -#include - -void test_submit(lsf_driver_type * driver, const char * cmd) { - { - char * node1 = "enern"; - char * node2 = "toern"; - char * node3 = "tre-ern.statoil.org"; - char * black1 = util_alloc_sprintf("hname!='%s'", node1); - char * black2 = util_alloc_sprintf("hname!='%s'", node2); - char * black3 = util_alloc_sprintf("hname!='%s'", node3); - char * select = util_alloc_sprintf("select[%s && %s && %s]", black1, black2, black3); - - lsf_driver_add_exclude_hosts(driver, node1); - lsf_driver_add_exclude_hosts(driver, node2); - lsf_driver_add_exclude_hosts(driver, node3); - - { - stringlist_type * argv = lsf_driver_alloc_cmd(driver, "", "NAME", "bsub", 1, 0, NULL); - if (!stringlist_contains(argv, select)) { - printf("%s lsf_driver_alloc_cmd argv does not contain %s\n", __func__, select); - printf("%s lsf_driver_alloc_cmd was %s\n", __func__, stringlist_alloc_joined_string(argv, " ")); - exit(1); - } - } - } -} - -void test_bjobs_parse_hosts() { - const char* full_hostnames = "hname1:4*hname2:13*st-rst666-01-42.st.example.org:1*hname4:hname5\n"; - const char* hostnames = "hname1:hname2:st-rst666-01-42.st.example.org:hname4:hname5"; - stringlist_type * expected = stringlist_alloc_from_split(hostnames,":"); - if (stringlist_get_size(expected) != 5) { - printf("Even expected has wrong size.\n"); - exit(1); - } - - char * fname = util_alloc_tmp_file("/tmp", "ert_job_exec_host", true); - - FILE * fptr; - fptr = fopen(fname, "w"); - fprintf(fptr, full_hostnames); // : is std bjobs delimiter - fclose(fptr); - - stringlist_type * hosts = lsf_job_alloc_parse_hostnames(fname); - - if (!stringlist_equal(expected, hosts)) { - printf("hosts differ: expected [%s] got [%s]\n", - stringlist_alloc_joined_string(expected, ":"), - stringlist_alloc_joined_string(hosts, ":")); - exit(1); - } - - util_unlink_existing(fname); - free(fname); - stringlist_free( hosts ); -} - -int main(int argc, char ** argv) { - lsf_driver_type * driver = lsf_driver_alloc(); - test_submit(driver, argv[1]); - lsf_driver_free(driver); - test_bjobs_parse_hosts(); - exit(0); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/job_lsf_library_submit_test.c b/ThirdParty/Ert/libjob_queue/tests/job_lsf_library_submit_test.c deleted file mode 100644 index f834ebfdf4..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_lsf_library_submit_test.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'job_lsf_submit_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include - -#include -#include - -#include -#include - - - -void test_submit(lsf_driver_type * driver, const char * cmd) { - assert( lsf_driver_set_option(driver , LSF_DEBUG_OUTPUT , "TRUE" ) ); - assert( LSF_SUBMIT_INTERNAL == lsf_driver_get_submit_method( driver )); - { - char * run_path = util_alloc_cwd(); - lsf_job_type * job = lsf_driver_submit_job( driver , cmd , 1 , run_path , "NAME" , 0 , NULL ); - assert( job ); - { - { - int lsf_status = lsf_driver_get_job_status_lsf( driver , job ); - assert( (lsf_status == JOB_STAT_RUN) || (lsf_status == JOB_STAT_PEND) ); - } - - lsf_driver_kill_job( driver , job ); - lsf_driver_set_bjobs_refresh_interval( driver , 0 ); - sleep(1); - - { - int lsf_status = lsf_driver_get_job_status_lsf( driver , job ); - assert( lsf_status == JOB_STAT_EXIT); - } - } - - free( run_path ); - } -} - - - -int main( int argc , char ** argv) { - lsf_driver_type * driver = lsf_driver_alloc(); - test_submit(driver , argv[1]); - lsf_driver_free( driver ); - exit(0); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/job_lsf_parse_bsub_stdout.c b/ThirdParty/Ert/libjob_queue/tests/job_lsf_parse_bsub_stdout.c deleted file mode 100644 index a60c8551a7..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_lsf_parse_bsub_stdout.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - Copyright (C) 2015 Statoil ASA, Norway. - - The file 'job_lsf_submit_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include - - -#include "ert/util/build_config.h" - -#include -#include -#include - -#include - - -void test_empty_file() { - const char * stdout_file = "bsub_empty"; - { - FILE * stream = util_fopen(stdout_file , "w"); - fclose( stream ); - } - test_assert_int_equal( lsf_job_parse_bsub_stdout("bsub" , stdout_file ) , 0); -} - - -void test_OK() { - const char * stdout_file = "bsub_OK"; - { - FILE * stream = util_fopen(stdout_file , "w"); - fprintf(stream , "Job <12345> is submitted to default queue .\n"); - fclose( stream ); - } - test_assert_int_equal( lsf_job_parse_bsub_stdout("bsub" , stdout_file ) , 12345); -} - - -void test_file_does_not_exist() { - test_assert_int_equal( lsf_job_parse_bsub_stdout("bsub" , "does/not/exist") , 0); -} - - - -void parse_invalid( void * arg ) { - const char * filename = (const char*) arg; - lsf_job_parse_bsub_stdout("bsub" , filename); -} - - -void test_parse_fail_abort() { - const char * stdout_file = "bsub_abort"; - { - FILE * stream = util_fopen(stdout_file , "w"); - fprintf(stream , "Job 12345 is submitted to default queue .\n"); - fclose( stream ); - } - test_assert_util_abort( "lsf_job_parse_bsub_stdout" , parse_invalid , (void *) stdout_file ); -} - - -int main(int argc, char ** argv) { - test_work_area_type * work_area = test_work_area_alloc( "bsub_parse_stdout"); - { - test_empty_file(); - test_file_does_not_exist( ); - test_OK(); - test_parse_fail_abort(); - } - test_work_area_free( work_area ); -} - - diff --git a/ThirdParty/Ert/libjob_queue/tests/job_lsf_remote_submit_test.c b/ThirdParty/Ert/libjob_queue/tests/job_lsf_remote_submit_test.c deleted file mode 100644 index 8d1aab392a..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_lsf_remote_submit_test.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'job_lsf_submit_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include - -#include -#include - -#include -#include - - -void test_submit(lsf_driver_type * driver , const char * server , const char * bsub_cmd , const char * bjobs_cmd , const char * bkill_cmd , const char * cmd) { - - test_assert_true( lsf_driver_set_option(driver , LSF_DEBUG_OUTPUT , "TRUE" ) ); - test_assert_true( lsf_driver_set_option(driver , LSF_SERVER , server ) ); - - if (bsub_cmd != NULL) - test_assert_true( lsf_driver_set_option(driver , LSF_BSUB_CMD , server )); - - if (bjobs_cmd != NULL) - test_assert_true( lsf_driver_set_option(driver , LSF_BJOBS_CMD , server ) ); - - if (bkill_cmd != NULL) - test_assert_true( lsf_driver_set_option(driver , LSF_BKILL_CMD , server )); - - { - char * run_path = util_alloc_cwd(); - lsf_job_type * job = lsf_driver_submit_job( driver , cmd , 1 , run_path , "NAME" , 0 , NULL ); - if (job) { - { - int lsf_status = lsf_driver_get_job_status_lsf( driver , job ); - if (!((lsf_status == JOB_STAT_RUN) || (lsf_status == JOB_STAT_PEND))) - test_error_exit("Got lsf_status:%d expected: %d or %d \n",lsf_status , JOB_STAT_RUN , JOB_STAT_PEND); - } - - lsf_driver_kill_job( driver , job ); - lsf_driver_set_bjobs_refresh_interval( driver , 0 ); - sleep(2); - - { - int lsf_status = 0; - for(int i=0; i < 10; i++){ - lsf_status = lsf_driver_get_job_status_lsf( driver , job ); - if (lsf_status != JOB_STAT_EXIT){ - sleep(2); - }else{ - break; - } - } - if (lsf_status != JOB_STAT_EXIT) - test_error_exit("Got lsf_status:%d expected: %d \n",lsf_status , JOB_STAT_EXIT ); - } - } else - test_error_exit("lsf_driver_submit_job() returned NULL \n"); - - - free( run_path ); - } -} - - -int main( int argc , char ** argv) { - util_install_signals(); - { - int iarg; - lsf_driver_type * driver = lsf_driver_alloc(); - - for (iarg = 2; iarg < argc; iarg++) { - const char * server = argv[iarg]; - printf("Testing lsf server:%s \n",server); - test_submit(driver , server , NULL , NULL , NULL , argv[1]); - } - - lsf_driver_free( driver ); - } - exit(0); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/job_lsf_submit_library_test.c b/ThirdParty/Ert/libjob_queue/tests/job_lsf_submit_library_test.c deleted file mode 100644 index ef327d6df7..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_lsf_submit_library_test.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'job_lsf_submit_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include - -#include -#include - -#include -#include - - -void test_submit(lsf_driver_type * driver) { - test_assert_true( lsf_driver_set_option(driver , LSF_DEBUG_OUTPUT , "TRUE" ) ); - test_assert_int_equal( LSF_SUBMIT_INTERNAL , lsf_driver_get_submit_method( driver )); - { - char * run_path = util_alloc_cwd(); - lsf_job_type * job = lsf_driver_submit_job( driver , cmd , 1 , run_path , "NAME" , 0 , NULL ); - if (job) { - { - int lsf_status = lsf_driver_get_job_status_lsf( driver , job ); - if (!((lsf_status == JOB_STAT_RUN) || (lsf_status == JOB_STAT_PEND))) - test_error_exit("Got lsf_status:%d expected: %d or %d \n",lsf_status , JOB_STAT_RUN , JOB_STAT_PEND); - } - - lsf_driver_kill_job( driver , job ); - lsf_driver_set_bjobs_refresh_interval( driver , 0 ); - sleep(1); - - { - int lsf_status = lsf_driver_get_job_status_lsf( driver , job ); - if (lsf_status != JOB_STAT_EXIT) - test_error_exit("Got lsf_status:%d expected: %d \n",lsf_status , JOB_STAT_EXIT ); - } - } else - test_error_exit("lsf_driver_submit_job() returned NULL \n"); - - - free( run_path ); - } -} - - - -int main( int argc , char ** argv) { - lsf_driver_type * driver = lsf_driver_alloc(); - test_submit(driver); - lsf_driver_free( driver ); - exit(0); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/job_lsf_test.c b/ThirdParty/Ert/libjob_queue/tests/job_lsf_test.c deleted file mode 100644 index a4a22b9d99..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_lsf_test.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'job_lsf_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include - -#include - -#include -#include -#include - - -void test_option(lsf_driver_type * driver , const char * option , const char * value) { - test_assert_true( lsf_driver_set_option( driver , option , value)); - test_assert_string_equal(lsf_driver_get_option( driver , option) , value); -} - - -void test_server(lsf_driver_type * driver , const char * server, lsf_submit_method_enum submit_method) { - lsf_driver_set_option(driver , LSF_SERVER , server ); - test_assert_true( lsf_driver_get_submit_method( driver ) == submit_method ); -} - - -void test_status(int lsf_status , job_status_type job_status) { - test_assert_true( lsf_driver_convert_status( lsf_status ) == job_status); -} - - -/* - This test should ideally be run twice in two different environments; - with and without dlopen() access to the lsf libraries. -*/ - -int main( int argc , char ** argv) { - lsf_driver_type * driver = lsf_driver_alloc(); - - test_option( driver , LSF_BSUB_CMD , "Xbsub"); - test_option( driver , LSF_BJOBS_CMD , "Xbsub"); - test_option( driver , LSF_BKILL_CMD , "Xbsub"); - test_option( driver , LSF_RSH_CMD , "RSH"); - test_option( driver , LSF_LOGIN_SHELL , "shell"); - test_option( driver , LSF_BSUB_CMD , "bsub"); - printf("Options OK\n"); - - { - - lsf_submit_method_enum submit_NULL; - lsb_type * lsb = lsb_alloc(); - if (lsb_ready(lsb)) - submit_NULL = LSF_SUBMIT_INTERNAL; - else - submit_NULL = LSF_SUBMIT_LOCAL_SHELL; - - - test_server( driver , NULL , submit_NULL ); - test_server( driver , "LoCaL" , LSF_SUBMIT_LOCAL_SHELL ); - test_server( driver , "LOCAL" , LSF_SUBMIT_LOCAL_SHELL ); - test_server( driver , "XLOCAL" , LSF_SUBMIT_REMOTE_SHELL ); - test_server( driver , NULL , submit_NULL ); - test_server( driver , "NULL" , submit_NULL ); - test_server( driver , "be-grid01" , LSF_SUBMIT_REMOTE_SHELL ); - printf("Servers OK\n"); - - lsb_free( lsb ); - } - test_status( JOB_STAT_PEND , JOB_QUEUE_PENDING ); - test_status( JOB_STAT_PSUSP , JOB_QUEUE_RUNNING ); - test_status( JOB_STAT_USUSP , JOB_QUEUE_RUNNING ); - test_status( JOB_STAT_SSUSP , JOB_QUEUE_RUNNING ); - test_status( JOB_STAT_RUN , JOB_QUEUE_RUNNING ); - test_status( JOB_STAT_NULL , JOB_QUEUE_NOT_ACTIVE ); - test_status( JOB_STAT_DONE , JOB_QUEUE_DONE ); - test_status( JOB_STAT_EXIT , JOB_QUEUE_EXIT ); - test_status( JOB_STAT_UNKWN , JOB_QUEUE_EXIT ); - test_status( 192 , JOB_QUEUE_DONE ); - printf("Status OK \n"); - - exit(0); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/job_node_test.c b/ThirdParty/Ert/libjob_queue/tests/job_node_test.c deleted file mode 100644 index 02ed8026e8..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_node_test.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright (C) 2015 Statoil ASA, Norway. - - The file 'job_node_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include - -#include "ert/util/build_config.h" - -#include -#include -#include - - -void test_create() { - job_queue_node_type * node = job_queue_node_alloc_simple("name" , "/tmp" , "/bin/ls" , 0 , NULL); - test_assert_true( job_queue_node_is_instance( node )); - job_queue_node_free( node ); -} - - - -void call_get_queue_index( void * arg ) { - job_queue_node_type * node = job_queue_node_safe_cast( arg ); - job_queue_node_get_queue_index( node ); -} - - - - -void test_queue_index() { - job_queue_node_type * node = job_queue_node_alloc_simple( "name" , "/tmp" , "/bin/ls" , 0 , NULL ); - test_assert_util_abort("job_queue_node_get_queue_index" , call_get_queue_index , node ); -} - - -void test_path_does_not_exist() { - job_queue_node_type * node = job_queue_node_alloc_simple( "name" , "does-not-exist" , "/bin/ls" , 0 , NULL); - test_assert_NULL( node ); -} - - -int main( int argc , char ** argv) { - util_install_signals(); - test_create(); - test_queue_index(); - test_path_does_not_exist(); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/job_program.c b/ThirdParty/Ert/libjob_queue/tests/job_program.c deleted file mode 100644 index d57e12a030..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_program.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'job_program.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - - -int main( int argc , char ** argv) { - int max_count = 100; - int count = 0; - while (true) { - sleep(1); - count++; - printf("%d/%d \n",count , max_count); - if (count == max_count) - break; - } - exit(0); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/job_program_output.c b/ThirdParty/Ert/libjob_queue/tests/job_program_output.c deleted file mode 100644 index 28cc0ce62a..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_program_output.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'job_program.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -int main( int argc , char ** argv) { - int sleep_time; - util_sscanf_int(argv[2], &sleep_time); - sleep(sleep_time); - - char * filename = util_alloc_filename(argv[1], "OK", "status"); - - if (util_file_exists(argv[1])) { - FILE * file = util_fopen(filename, "w"); - fprintf(file, "All good"); - util_fclose(file); - exit(0); - } else - exit(1); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/job_queue_driver_test.c b/ThirdParty/Ert/libjob_queue/tests/job_queue_driver_test.c deleted file mode 100644 index 6f880f9e51..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_queue_driver_test.c +++ /dev/null @@ -1,170 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'job_queue_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. - */ -#include -#include - -#include -#include - -#include -#include -#include - -#include -#include - -void job_queue_set_driver_(job_driver_type driver_type) { - job_queue_type * queue = job_queue_alloc(10, "OK", "STATUS", "ERROR"); - queue_driver_type * driver = queue_driver_alloc(driver_type); - test_assert_false(job_queue_has_driver(queue)); - - job_queue_set_driver(queue, driver); - test_assert_true(job_queue_has_driver(queue)); - - job_queue_free(queue); - queue_driver_free(driver); - - -} - -void set_option_max_running_max_running_value_set() { - queue_driver_type * driver_torque = queue_driver_alloc(TORQUE_DRIVER); - test_assert_true(queue_driver_set_option(driver_torque, MAX_RUNNING, "42")); - test_assert_string_equal("42", queue_driver_get_option(driver_torque, MAX_RUNNING)); - queue_driver_free(driver_torque); - - - queue_driver_type * driver_lsf = queue_driver_alloc(LSF_DRIVER); - test_assert_true(queue_driver_set_option(driver_lsf, MAX_RUNNING, "72")); - test_assert_string_equal("72", queue_driver_get_option(driver_lsf, MAX_RUNNING)); - queue_driver_free(driver_lsf); -} - -void set_option_max_running_max_running_option_set() { - queue_driver_type * driver_torque = queue_driver_alloc(TORQUE_DRIVER); - test_assert_true(queue_driver_set_option(driver_torque, MAX_RUNNING, "42")); - test_assert_string_equal("42", queue_driver_get_option(driver_torque, MAX_RUNNING)); - queue_driver_free(driver_torque); - -} - -void set_option_invalid_option_returns_false() { - queue_driver_type * driver_torque = queue_driver_alloc(TORQUE_DRIVER); - test_assert_false(queue_driver_set_option(driver_torque, "MAKS_RUNNING", "42")); - queue_driver_free(driver_torque); -} - -void set_option_invalid_value_returns_false() { - queue_driver_type * driver_torque = queue_driver_alloc(TORQUE_DRIVER); - test_assert_false(queue_driver_set_option(driver_torque, "MAX_RUNNING", "2a")); - queue_driver_free(driver_torque); -} - -void set_option_valid_on_specific_driver_returns_true() { - queue_driver_type * driver_torque = queue_driver_alloc(TORQUE_DRIVER); - test_assert_true(queue_driver_set_option(driver_torque, TORQUE_NUM_CPUS_PER_NODE, "33")); - test_assert_string_equal("33", queue_driver_get_option(driver_torque, TORQUE_NUM_CPUS_PER_NODE)); - queue_driver_free(driver_torque); -} - -void get_driver_option_lists() { - //Torque driver option list - { - queue_driver_type * driver_torque = queue_driver_alloc(TORQUE_DRIVER); - stringlist_type * option_list = stringlist_alloc_new(); - queue_driver_init_option_list(driver_torque, option_list); - - test_assert_true(stringlist_contains(option_list, MAX_RUNNING)); - test_assert_true(stringlist_contains(option_list, TORQUE_QSUB_CMD)); - test_assert_true(stringlist_contains(option_list, TORQUE_QSTAT_CMD)); - test_assert_true(stringlist_contains(option_list, TORQUE_QDEL_CMD)); - test_assert_true(stringlist_contains(option_list, TORQUE_QUEUE)); - test_assert_true(stringlist_contains(option_list, TORQUE_NUM_CPUS_PER_NODE)); - test_assert_true(stringlist_contains(option_list, TORQUE_NUM_NODES)); - test_assert_true(stringlist_contains(option_list, TORQUE_KEEP_QSUB_OUTPUT)); - test_assert_true(stringlist_contains(option_list, TORQUE_CLUSTER_LABEL)); - - stringlist_free(option_list); - queue_driver_free(driver_torque); - } - - //Local driver option list (only general queue_driver options) - { - queue_driver_type * driver_local = queue_driver_alloc(LOCAL_DRIVER); - stringlist_type * option_list = stringlist_alloc_new(); - queue_driver_init_option_list(driver_local, option_list); - - test_assert_true(stringlist_contains(option_list, MAX_RUNNING)); - - stringlist_free(option_list); - queue_driver_free(driver_local); - } - - //Lsf driver option list - { - queue_driver_type * driver_lsf = queue_driver_alloc(LSF_DRIVER); - stringlist_type * option_list = stringlist_alloc_new(); - queue_driver_init_option_list(driver_lsf, option_list); - - test_assert_true(stringlist_contains(option_list, MAX_RUNNING)); - test_assert_true(stringlist_contains(option_list, LSF_QUEUE)); - test_assert_true(stringlist_contains(option_list, LSF_RESOURCE)); - test_assert_true(stringlist_contains(option_list, LSF_SERVER)); - test_assert_true(stringlist_contains(option_list, LSF_RSH_CMD)); - test_assert_true(stringlist_contains(option_list, LSF_LOGIN_SHELL)); - test_assert_true(stringlist_contains(option_list, LSF_BSUB_CMD)); - test_assert_true(stringlist_contains(option_list, LSF_BJOBS_CMD)); - test_assert_true(stringlist_contains(option_list, LSF_BKILL_CMD)); - - stringlist_free(option_list); - queue_driver_free(driver_lsf); - } - - //Rsh driver option list - { - queue_driver_type * driver_rsh = queue_driver_alloc(RSH_DRIVER); - stringlist_type * option_list = stringlist_alloc_new(); - queue_driver_init_option_list(driver_rsh, option_list); - - test_assert_true(stringlist_contains(option_list, MAX_RUNNING)); - test_assert_true(stringlist_contains(option_list, RSH_HOST)); - test_assert_true(stringlist_contains(option_list, RSH_HOSTLIST)); - test_assert_true(stringlist_contains(option_list, RSH_CMD)); - test_assert_true(stringlist_contains(option_list, RSH_CLEAR_HOSTLIST)); - - stringlist_free(option_list); - queue_driver_free(driver_rsh); - } -} - -int main(int argc, char ** argv) { - job_queue_set_driver_(LSF_DRIVER); - job_queue_set_driver_(LOCAL_DRIVER); - job_queue_set_driver_(RSH_DRIVER); - job_queue_set_driver_(TORQUE_DRIVER); - - set_option_max_running_max_running_value_set(); - set_option_max_running_max_running_option_set(); - set_option_invalid_option_returns_false(); - set_option_invalid_value_returns_false(); - - set_option_valid_on_specific_driver_returns_true(); - get_driver_option_lists(); - - exit(0); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/job_queue_manager.c b/ThirdParty/Ert/libjob_queue/tests/job_queue_manager.c deleted file mode 100644 index 98419158c3..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_queue_manager.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'job_queue_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. - */ -#include -#include - -#include - -#include -#include - - - - -void test_create() { - job_queue_type * job_queue = job_queue_alloc( 100 , "OK" , "STATUS", "ERROR"); - job_queue_manager_type * manager = job_queue_manager_alloc( job_queue ); - - test_assert_true( job_queue_manager_is_instance( manager )); - - job_queue_manager_free( manager ); - job_queue_free( job_queue ); -} - - - - - - -int main( int argc , char ** argv) { - test_create(); - exit(0); -} - diff --git a/ThirdParty/Ert/libjob_queue/tests/job_queue_stress_task.c b/ThirdParty/Ert/libjob_queue/tests/job_queue_stress_task.c deleted file mode 100644 index b37d97c491..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_queue_stress_task.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'job_queue_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -#include - - -/* - This is a small test job used by the job_queue_stress_test. The job - does the following: - - 0. Chadir to runpath - 1. Create the file @runfile. - 2. Wait with usleep( @usleep_time ). - 3. Remove the @runfile. - 4. Create new file @OK_file - 5. exit. -*/ - -int main(int argc, char ** argv) { - const char * runpath = argv[1]; - const char * runfile = argv[2]; - const char * OK_file = argv[3]; - - int usleep_time; - - util_chdir( runpath ); - util_sscanf_int( argv[4] , &usleep_time ); - { - FILE * stream = util_fopen( runfile , "w"); - fprintf(stream , "Running ... \n"); - fclose( stream ); - } - usleep( usleep_time ); - util_unlink_existing(runfile); - { - FILE * stream = util_fopen( OK_file , "w"); - fprintf(stream , "OK ... \n"); - fclose( stream ); - } - return 0; -} diff --git a/ThirdParty/Ert/libjob_queue/tests/job_queue_stress_test.c b/ThirdParty/Ert/libjob_queue/tests/job_queue_stress_test.c deleted file mode 100644 index e1a4927def..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_queue_stress_test.c +++ /dev/null @@ -1,313 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'job_queue_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. - */ -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -#define JOB_TYPE_ID 77539 -typedef struct { - UTIL_TYPE_ID_DECLARATION; - char * run_path; - bool callback_run; - int queue_index; - int submit_usleep; - int callback_usleep; - int run_usleep; - int argc; - char ** argv; - const char * cmd; -} job_type; - - - -UTIL_SAFE_CAST_FUNCTION( job , JOB_TYPE_ID ) - -job_type * alloc_job( rng_type * rng , const char * cmd) { - const int second = 1000000; - const int submit_min = 0; - const int submit_max = 10 * second; - - const int callback_min = 0.5 * second; - const int callback_max = 2 * second; - - const int run_min = 2 * second; - const int run_max = 10 * second; - - job_type * job = util_malloc( sizeof * job ); - UTIL_TYPE_ID_INIT( job , JOB_TYPE_ID ) - job->callback_run = false; - job->queue_index = -1; - job->submit_usleep = submit_min + rng_get_int( rng , (submit_max - submit_min )); - job->callback_usleep = callback_min + rng_get_int( rng , (callback_max - callback_min )); - job->run_usleep = run_min + rng_get_int( rng , (run_max - run_min )); - job->run_path = util_alloc_sprintf("%08d", rng_get_int(rng , 100000000)); - job->cmd = cmd; - job->argc = 4; - - job->argv = util_malloc( 4 * sizeof * job->argv ); - job->argv[0] = job->run_path; - job->argv[1] = "RUNNING"; - job->argv[2] = "OK"; - job->argv[3] = util_alloc_sprintf("%d", job->run_usleep); - - util_make_path( job->run_path ); - return job; -} - - -job_type ** alloc_jobs( rng_type * rng , int num_jobs , const char * cmd) { - job_type ** jobs = util_malloc( num_jobs * sizeof * jobs ); - for (int i=0; i < num_jobs; i++) { - job_type * job = alloc_job( rng , cmd); - job_safe_cast( job ); - jobs[i] = job; - } - return jobs; -} - - - -bool callback( void * arg ) { - job_type * job = job_safe_cast( arg ); - usleep( job->callback_usleep ); - job->callback_run = true; - return true; -} - - -void * submit_job__( void * arg ) { - arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); - job_type * job = job_safe_cast( arg_pack_iget_ptr( arg_pack , 0 ) ); - job_queue_type * queue = arg_pack_iget_ptr( arg_pack , 1 ); - job->queue_index = job_queue_add_job( queue , job->cmd , callback , NULL , NULL , job , 1 , job->run_path , job->run_path , job->argc , (const char **) job->argv ); - - if (job->queue_index >= 0) - usleep( job->submit_usleep ); - return NULL; -} - - -void submit_jobs( job_queue_type * queue , int num_jobs , job_type ** jobs , thread_pool_type * tp) { - for (int i=0; i < num_jobs; i++) { - job_type * job = jobs[i]; - arg_pack_type * arg = arg_pack_alloc(); - arg_pack_append_ptr( arg , job ); - arg_pack_append_ptr( arg , queue ); - thread_pool_add_job(tp , submit_job__ , arg ); - } -} - - -void check_jobs( int num_jobs , job_type ** jobs ) { - for (int i=0; i < num_jobs; i++) { - job_type * job = jobs[i]; - if (!job->callback_run) - fprintf(stderr,"The callback has not been registered on job:%d/%d \n",i,job->queue_index); - test_assert_true( job->callback_run ); - } -} - - -void * global_status( void * arg ) { - arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); - job_queue_type * job_queue = job_queue_safe_cast( arg_pack_iget_ptr( arg_pack , 0 )); - bool user_exit = arg_pack_iget_bool( arg_pack , 1 ); - bool exit_called = false; - int counter = 0; - int signature = -1; - while (true) { - util_usleep(100000); - - if (job_queue_get_num_complete(job_queue) == job_queue_get_active_size(job_queue)) - break; - - if ((counter % 10) == 0) - printf("Waiting:%03d Running:%03d Callback:%03d Complete:%03d \n", - job_queue_get_num_waiting(job_queue) , - job_queue_get_num_running(job_queue), - job_queue_get_num_callback( job_queue ) , - job_queue_get_num_complete(job_queue)); - - counter++; - - if (user_exit && (job_queue_get_num_complete( job_queue ) >= job_queue_get_active_size(job_queue)/2)) { - - if (job_queue_accept_jobs( job_queue )) { - exit_called = true; - job_queue_start_user_exit( job_queue ); - } - } - - if (exit_called) { - int w = job_queue_get_num_waiting(job_queue); - int r = job_queue_get_num_running(job_queue); - int c = job_queue_get_num_callback( job_queue ); - int f = job_queue_get_num_complete(job_queue); - int new = (w + r*256 + c *256*256 + f *256*256*256); - - if (new == signature) - break; - else - signature = new; - } - } - arg_pack_free( arg_pack ); - return NULL; -} - - -void * status_job__( void * arg ) { - const int usleep_time = 10000; - arg_pack_type * arg_pack = arg_pack_safe_cast( arg ); - job_type * job = job_safe_cast( arg_pack_iget_ptr( arg_pack , 0 ) ); - job_queue_type * queue = arg_pack_iget_ptr( arg_pack , 1 ); - bool user_exit = arg_pack_iget_bool( arg_pack , 2 ); - char * run_file = util_alloc_filename( job->run_path , "RUNNING" , NULL); - - while (true) { - if (job->queue_index >= 0) { - job_status_type status; - if (util_is_file(run_file)) { - status = job_queue_iget_job_status(queue, job->queue_index); - if (util_is_file(run_file)) { - bool status_true = (status == JOB_QUEUE_RUNNING) || (status == JOB_QUEUE_SUBMITTED || (status == JOB_QUEUE_RUNNING_CALLBACK) || (status == JOB_QUEUE_DONE)); - if (!status_true) { - if (user_exit) - status_true = (status == JOB_QUEUE_DO_KILL) || (status == JOB_QUEUE_IS_KILLED || (status == JOB_QUEUE_RUNNING_CALLBACK)); - } - if (!status_true) - fprintf(stderr," Invalid status:%d for job:%d \n",status , job->queue_index ); - test_assert_true( status_true ); - } - } - status = job_queue_iget_job_status(queue, job->queue_index); - if ((status == JOB_QUEUE_SUCCESS) || (status == JOB_QUEUE_IS_KILLED)) - break; - } else { - if (!job_queue_accept_jobs(queue)) - break; - } - - usleep( usleep_time ); - } - - arg_pack_free( arg_pack ); - free( run_file ); - return NULL; -} - - - -void status_jobs( job_queue_type * queue , int num_jobs , bool user_exit , job_type ** jobs , thread_pool_type * tp) { - for (int i=0; i < num_jobs; i++) { - job_type * job = jobs[i]; - arg_pack_type * arg = arg_pack_alloc(); - arg_pack_append_ptr( arg , job ); - arg_pack_append_ptr( arg , queue ); - arg_pack_append_bool( arg , user_exit ); - thread_pool_add_job(tp , status_job__ , arg ); - } - { - arg_pack_type * arg_pack = arg_pack_alloc( ); - - arg_pack_append_ptr( arg_pack , queue ); - arg_pack_append_bool( arg_pack , user_exit ); - thread_pool_add_job( tp , global_status , arg_pack ); - } -} - - -/* - The purpose of this test is to stress the queue system with a - massively multithreaded workload. The test will submit jobs, let - them run and run a callback. The various elements are pimped with - usleep() calls to ensure that all of these actions: - - 1. Submit - 2. Run callback - 3. Check status - - Are performed concurrently. The total runtime of the test should be - ~ 120 seconds. -*/ - - -int main(int argc , char ** argv) { - const int queue_timeout = 180; - const int submit_timeout = 180; - const int status_timeout = 180; - const int number_of_jobs = 50; - const int submit_threads = number_of_jobs / 10 ; - const int status_threads = number_of_jobs + 1; - const char * job = util_alloc_abs_path(argv[1]); - rng_type * rng = rng_alloc( MZRAN , INIT_CLOCK ); - bool user_exit; - test_work_area_type * work_area = test_work_area_alloc("job_queue"); - job_type **jobs = alloc_jobs( rng , number_of_jobs , job); - - job_queue_type * queue = job_queue_alloc(number_of_jobs, "OK", "STATUS", "ERROR"); - queue_driver_type * driver = queue_driver_alloc_local(); - job_queue_manager_type * queue_manager = job_queue_manager_alloc( queue ); - - util_install_signals(); - util_sscanf_bool(argv[2] , &user_exit); - job_queue_set_driver(queue, driver); - job_queue_manager_start_queue(queue_manager, 0, false , true); - - { - thread_pool_type * status_pool = thread_pool_alloc( status_threads , true ); - thread_pool_type * submit_pool = thread_pool_alloc( submit_threads , true ); - - submit_jobs( queue , number_of_jobs , jobs , submit_pool ); - status_jobs( queue , number_of_jobs , user_exit , jobs , status_pool ); - - if (!thread_pool_try_join( submit_pool , submit_timeout )) - util_exit("Joining submit pool failed \n"); - thread_pool_free( submit_pool ); - job_queue_submit_complete(queue); - if (!thread_pool_try_join( status_pool , status_timeout)) - util_exit("Joining status pool failed \n"); - thread_pool_free( status_pool ); - } - - if (!job_queue_manager_try_wait(queue_manager , queue_timeout)) - util_exit("job_queue never completed \n"); - - job_queue_manager_free(queue_manager); - job_queue_free(queue); - if (!user_exit) - check_jobs( number_of_jobs , jobs ); - - queue_driver_free(driver); - test_work_area_free(work_area); - rng_free( rng ); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/job_queue_timeout_test.c b/ThirdParty/Ert/libjob_queue/tests/job_queue_timeout_test.c deleted file mode 100644 index 041bf9314d..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_queue_timeout_test.c +++ /dev/null @@ -1,149 +0,0 @@ -/* - Copyright (C) 2016 Statoil ASA, Norway. - - This file is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. - */ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - -#define JOB_TYPE_ID 77539 -typedef struct -{ - UTIL_TYPE_ID_DECLARATION; - char * run_path; - bool callback_run; - int queue_index; - int submit_usleep; - int callback_usleep; - int run_usleep; - int argc; - char ** argv; - const char * cmd; -} job_type; - -UTIL_SAFE_CAST_FUNCTION(job, JOB_TYPE_ID) - -job_type * alloc_job(int ind, const char * cmd) { - job_type * job = util_malloc(sizeof *job); - UTIL_TYPE_ID_INIT(job, JOB_TYPE_ID) - job->callback_run = false; - job->queue_index = -1; - job->submit_usleep = 0; - job->callback_usleep = 0; - job->run_usleep = 2 * 1000*1000; // 4 sec - job->run_path = util_alloc_sprintf("timeout_test_%d", ind); - job->cmd = cmd; - job->argc = 4; - - job->argv = util_malloc(4 * sizeof *job->argv); - job->argv[0] = job->run_path; - job->argv[1] = "RUNNING"; - job->argv[2] = "OK"; - job->argv[3] = util_alloc_sprintf("%d", job->run_usleep); - - util_make_path(job->run_path); - return job; -} - -job_type ** alloc_jobs(int num_jobs, const char * cmd) { - job_type ** jobs = util_malloc(num_jobs * sizeof *jobs); - for (int i = 0; i < num_jobs; i++) { - job_type * job = alloc_job(i, cmd); - job_safe_cast(job); - jobs[i] = job; - } - return jobs; -} - - -void submit_jobs(job_queue_type * queue, int num_jobs, job_type ** jobs) { - for (int i = 0; i < num_jobs; i++) { - job_type * job = jobs[i]; - - job->queue_index = job_queue_add_job(queue, job->cmd, NULL, NULL, NULL, job, 1, job->run_path, job->run_path, - job->argc, (const char **) job->argv); - } -} - -void check_jobs(int num_jobs, job_type ** jobs) { - for (int i = 0; i < num_jobs; i++) { - job_type * job = jobs[i]; - if (!job->callback_run) - fprintf(stderr, "The callback has not been registered on job:%d/%d \n", i, job->queue_index); - test_assert_true(job->callback_run); - } -} - -int main(int argc, char ** argv) { - setbuf(stdout, NULL); - - const int number_of_jobs = 1; - util_alloc_abs_path(argv[1]); - - const int running_timeout = 0; - const int sec = 1000*1000; - - test_work_area_type * work_area = test_work_area_alloc("job_timeout"); - test_work_area_set_store(work_area, true); - - job_type **jobs = alloc_jobs(number_of_jobs, argv[1]); - - job_queue_type * queue = job_queue_alloc(number_of_jobs, "OK", "DOES_NOT_EXIST", "ERROR"); - queue_driver_type * driver = queue_driver_alloc_local(); - job_queue_manager_type * queue_manager = job_queue_manager_alloc(queue); - - util_install_signals(); - job_queue_set_driver(queue, driver); - job_queue_manager_start_queue(queue_manager, number_of_jobs, false, true); - - { - submit_jobs(queue, number_of_jobs, jobs); - - if (job_queue_get_active_size(queue) > 0) { - job_queue_iset_max_confirm_wait_time(queue, 0, running_timeout); // job 0 - } else { - util_exit("Job failed to be queued!\n"); - } - - usleep(1 * sec); // 1.0 sec - int job_status = job_queue_iget_job_status(queue, 0); - - if (job_status != JOB_QUEUE_IS_KILLED) { - util_exit("Job should have been killed, had status %d != %d\n", job_status, JOB_QUEUE_IS_KILLED); - } - } - if (!job_queue_manager_try_wait(queue_manager, 5 * sec)) - util_exit("job_queue never completed \n"); - job_queue_manager_free(queue_manager); - job_queue_free(queue); - queue_driver_free(driver); - test_work_area_free(work_area); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/job_status_test.c b/ThirdParty/Ert/libjob_queue/tests/job_status_test.c deleted file mode 100644 index 2dca4b664d..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_status_test.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - Copyright (C) 2015 Statoil ASA, Norway. - - The file 'job_status_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include "ert/util/build_config.h" - -#include -#include -#include -#include - - -void call_get_status( void * arg ) { - job_queue_status_type * job_status = job_queue_status_safe_cast( arg ); - job_queue_status_get_count( job_status , JOB_QUEUE_DONE + JOB_QUEUE_DO_KILL); -} - - - -void test_create() { - job_queue_status_type * status = job_queue_status_alloc(); - test_assert_true( job_queue_status_is_instance( status )); - test_assert_int_equal( job_queue_status_get_count( status , JOB_QUEUE_DONE ) , 0 ); - test_assert_util_abort( "STATUS_INDEX" , call_get_status , status ); - job_queue_status_free( status ); -} - - -void * add_sim( void * arg ) { - job_queue_status_type * job_status = job_queue_status_safe_cast( arg ); - job_queue_status_inc( job_status , JOB_QUEUE_WAITING ); - return NULL; -} - - -void * user_exit( void * arg ) { - job_queue_status_type * job_status = job_queue_status_safe_cast( arg ); - job_queue_status_transition( job_status , JOB_QUEUE_WAITING , JOB_QUEUE_DO_KILL); - return NULL; -} - - -void * user_done( void * arg ) { - job_queue_status_type * job_status = job_queue_status_safe_cast( arg ); - job_queue_status_transition( job_status , JOB_QUEUE_WAITING , JOB_QUEUE_DONE); - return NULL; -} - - - -void test_update() { - int N = 15000; - pthread_t * thread_list = util_malloc( 2*N*sizeof * thread_list); - int num_exit_threads = 0; - int num_done_threads = 0; - job_queue_status_type * status = job_queue_status_alloc(); - - test_assert_int_equal( 0 , job_queue_status_get_total_count( status )); - for (int i=0; i < 2*N; i++) - add_sim( status ); - test_assert_int_equal( 2*N , job_queue_status_get_count( status , JOB_QUEUE_WAITING )); - - { - int i = 0; - while (true) { - int thread_status; - - if ((i % 2) == 0) { - thread_status = pthread_create( &thread_list[i] , NULL , user_exit , status ); - if (thread_status == 0) - num_exit_threads++; - else - break; - } else { - thread_status = pthread_create( &thread_list[i] , NULL , user_done , status ); - if (thread_status == 0) - num_done_threads++; - else - break; - } - - i++; - if (i == N) - break; - } - } - if ((num_done_threads + num_exit_threads) == 0) { - fprintf(stderr, "Hmmm - not a single thread created - very suspicious \n"); - exit(1); - } - - for (int i=0; i < num_done_threads + num_exit_threads; i++) - pthread_join( thread_list[i] , NULL ); - - test_assert_int_equal( 2*N - num_done_threads - num_exit_threads , job_queue_status_get_count( status , JOB_QUEUE_WAITING )); - test_assert_int_equal( num_exit_threads , job_queue_status_get_count( status , JOB_QUEUE_DO_KILL )); - test_assert_int_equal( num_done_threads , job_queue_status_get_count( status , JOB_QUEUE_DONE )); - - test_assert_int_equal( 2*N , job_queue_status_get_total_count( status )); - job_queue_status_free( status ); -} - - -int main( int argc , char ** argv) { - util_install_signals(); - test_create(); - test_update(); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/job_torque_submit_test.c b/ThirdParty/Ert/libjob_queue/tests/job_torque_submit_test.c deleted file mode 100644 index d4854ab611..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_torque_submit_test.c +++ /dev/null @@ -1,117 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'job_torque_submit_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. - */ -#include -#include -#include - -#include -#include -#include - -#include - -void assert_status( torque_driver_type * driver, torque_job_type * job, int status_mask) { - int torque_status = torque_driver_get_job_status(driver, job); - if ((torque_status & status_mask) == 0) - test_exit("Incorrect status:%d - expected overlap with: %d\n" , torque_status , status_mask); -} - - - -void test_submit(torque_driver_type * driver, const char * cmd) { - char * run_path = util_alloc_cwd(); - torque_job_type * job = torque_driver_submit_job(driver, cmd, 1, run_path, "TEST-TORQUE-SUBMIT", 0, NULL); - - if (job != NULL) { - assert_status( driver , job, JOB_QUEUE_RUNNING + JOB_QUEUE_PENDING); - torque_driver_kill_job(driver, job); - printf("Waiting 2 seconds"); - for (int i = 0; i < 2; i++) { - printf("."); - fflush(stdout); - sleep(1); - } - printf("\n"); - - int torque_status = torque_driver_get_job_status(driver, job); - if (torque_status != JOB_QUEUE_EXIT && torque_status != JOB_QUEUE_DONE) { - exit(1); - test_exit("After kill of job, the status is %d, it should have been JOB_QUEUE_EXIT, which is %d\n", torque_status, JOB_QUEUE_EXIT); - } - } else { - exit(1); - test_exit("Function %s returned null-pointer to job, terminating test.", "torque_driver_submit_job"); - } - - free(run_path); - torque_driver_free_job(job); -} - -void test_submit_nocommand(torque_driver_type * driver) { - test_submit(driver, NULL); -} - - - - -void test_submit_failed_qstat(torque_driver_type * driver, const char * cmd) { - char * run_path = util_alloc_cwd(); - torque_job_type * job = torque_driver_submit_job(driver, cmd, 1, run_path, "TEST-TORQUE-SUBMIT", 0, NULL); - - { - test_work_area_type * work_area = test_work_area_alloc("torque-failed-qstat"); - test_work_area_copy_file( work_area , torque_driver_get_option( driver , TORQUE_QSTAT_CMD )); - assert_status( driver , job , JOB_QUEUE_RUNNING + JOB_QUEUE_PENDING); - - { - char * qstat_cmd = util_alloc_abs_path( "qstat.local" ); - FILE * stream = util_fopen( qstat_cmd , "w"); - fprintf(stream , "#!/bin/sh\n"); - fprintf(stream , "echo XYZ - Error\n"); - fclose( stream ); - util_addmode_if_owner(qstat_cmd, S_IXUSR ); - torque_driver_set_option(driver, TORQUE_QSTAT_CMD, qstat_cmd); - free( qstat_cmd ); - } - - assert_status( driver , job , JOB_QUEUE_STATUS_FAILURE ); - test_work_area_free( work_area ); - } - - torque_driver_free_job(job); - free(run_path); -} - - - -int main(int argc, char ** argv) { - torque_driver_type * driver = torque_driver_alloc(); - if (argc == 1) { - test_submit_nocommand(driver); - } else if (argc == 2) { - test_submit(driver, argv[1]); - test_submit_failed_qstat( driver , argv[1] ); - } else { - printf("Only accepts zero or one arguments (the job script to run)\n"); - exit(1); - } - printf("Submit, status and kill OK\n"); - torque_driver_free(driver); - - exit(0); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/job_torque_test.c b/ThirdParty/Ert/libjob_queue/tests/job_torque_test.c deleted file mode 100644 index 11f27602b3..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_torque_test.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'job_lsf_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. - */ -#include -#include -#include - -#include -#include -#include -#include - -void test_option(torque_driver_type * driver, const char * option, const char * value) { - test_assert_true(torque_driver_set_option(driver, option, value)); - test_assert_string_equal(torque_driver_get_option(driver, option), value); -} - -void setoption_setalloptions_optionsset() { - torque_driver_type * driver = torque_driver_alloc(); - - test_option(driver, TORQUE_QSUB_CMD, "XYZaaa"); - test_option(driver, TORQUE_QSTAT_CMD, "xyZfff"); - test_option(driver, TORQUE_QDEL_CMD, "ZZyfff"); - test_option(driver, TORQUE_QUEUE, "superhigh"); - test_option(driver, TORQUE_NUM_CPUS_PER_NODE, "42"); - test_option(driver, TORQUE_NUM_NODES, "36"); - test_option(driver, TORQUE_KEEP_QSUB_OUTPUT, "1"); - test_option(driver, TORQUE_KEEP_QSUB_OUTPUT, "0"); - test_option(driver, TORQUE_CLUSTER_LABEL, "thecluster"); - test_option(driver, TORQUE_JOB_PREFIX_KEY, "coolJob"); - - test_assert_int_equal( 0 , torque_driver_get_submit_sleep(driver)); - test_assert_NULL( torque_driver_get_debug_stream(driver) ); - - test_assert_true( torque_driver_set_option( driver , TORQUE_SUBMIT_SLEEP , "0.25")); - test_assert_int_equal( 250000 , torque_driver_get_submit_sleep(driver)); - - test_assert_true( torque_driver_set_option( driver , TORQUE_DEBUG_OUTPUT , "/tmp/torqueue_debug.txt")); - test_assert_not_NULL( torque_driver_get_debug_stream(driver) ); - - printf("Options OK\n"); - torque_driver_free(driver); -} - -void setoption_set_typed_options_wrong_format_returns_false() { - torque_driver_type * driver = torque_driver_alloc(); - test_assert_false(torque_driver_set_option(driver, TORQUE_NUM_CPUS_PER_NODE, "42.2")); - test_assert_false(torque_driver_set_option(driver, TORQUE_NUM_CPUS_PER_NODE, "fire")); - test_assert_false(torque_driver_set_option(driver, TORQUE_NUM_NODES, "42.2")); - test_assert_false(torque_driver_set_option(driver, TORQUE_NUM_NODES, "fire")); - test_assert_true(torque_driver_set_option(driver, TORQUE_KEEP_QSUB_OUTPUT, "true")); - test_assert_true(torque_driver_set_option(driver, TORQUE_KEEP_QSUB_OUTPUT, "1")); - test_assert_false(torque_driver_set_option(driver, TORQUE_KEEP_QSUB_OUTPUT, "ja")); - test_assert_false(torque_driver_set_option(driver, TORQUE_KEEP_QSUB_OUTPUT, "22")); - test_assert_false(torque_driver_set_option(driver, TORQUE_KEEP_QSUB_OUTPUT, "1.1")); - test_assert_false(torque_driver_set_option(driver, TORQUE_SUBMIT_SLEEP, "X45")); -} - -void getoption_nooptionsset_defaultoptionsreturned() { - torque_driver_type * driver = torque_driver_alloc(); - test_assert_string_equal(torque_driver_get_option(driver, TORQUE_QSUB_CMD), TORQUE_DEFAULT_QSUB_CMD); - test_assert_string_equal(torque_driver_get_option(driver, TORQUE_QSTAT_CMD), TORQUE_DEFAULT_QSTAT_CMD); - test_assert_string_equal(torque_driver_get_option(driver, TORQUE_QDEL_CMD), TORQUE_DEFAULT_QDEL_CMD); - test_assert_string_equal(torque_driver_get_option(driver, TORQUE_KEEP_QSUB_OUTPUT), "0"); - test_assert_string_equal(torque_driver_get_option(driver, TORQUE_NUM_CPUS_PER_NODE), "1"); - test_assert_string_equal(torque_driver_get_option(driver, TORQUE_NUM_NODES), "1"); - test_assert_string_equal(torque_driver_get_option(driver, TORQUE_CLUSTER_LABEL), NULL ); - test_assert_string_equal(torque_driver_get_option(driver, TORQUE_JOB_PREFIX_KEY), NULL); - - printf("Default options OK\n"); - torque_driver_free(driver); -} - -void create_submit_script_script_according_to_input() { - test_work_area_type * work_area = test_work_area_alloc("job_torque_test" ); - const char * script_filename = "qsub_script.sh"; - - { - char ** args = util_calloc(2, sizeof * args); - args[0] = "/tmp/jaja/"; - args[1] = "number2arg"; - torque_job_create_submit_script(script_filename, "job_program.py", 2, (const char **) args); - free( args ); - } - - { - FILE* file_stream = util_fopen(script_filename, "r"); - bool at_eof = false; - - char * line = util_fscanf_alloc_line(file_stream, &at_eof); - test_assert_string_equal("#!/bin/sh", line); - free(line); - - line = util_fscanf_alloc_line(file_stream, &at_eof); - test_assert_string_equal("job_program.py /tmp/jaja/ number2arg", line); - free(line); - - line = util_fscanf_alloc_line(file_stream, &at_eof); - free(line); - test_assert_true(at_eof); - - fclose(file_stream); - } - test_work_area_free( work_area ); -} - - -int main(int argc, char ** argv) { - getoption_nooptionsset_defaultoptionsreturned(); - setoption_setalloptions_optionsset(); - - setoption_set_typed_options_wrong_format_returns_false(); - create_submit_script_script_according_to_input(); - exit(0); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/job_workflow_test.c b/ThirdParty/Ert/libjob_queue/tests/job_workflow_test.c deleted file mode 100644 index 22c8481f43..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/job_workflow_test.c +++ /dev/null @@ -1,182 +0,0 @@ -/* - Copyright (C) 2012 Statoil ASA, Norway. - - The file 'job_workflow_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include - - -void create_workflow( const char * workflow_file , const char * tmp_file , int value) { - FILE * stream = util_fopen( workflow_file , "w"); - fprintf(stream , "CREATE_FILE %s %d\n" , tmp_file , value); - fprintf(stream , "READ_FILE %s\n" , tmp_file ); - fclose( stream ); - - printf("Have created:%s \n",workflow_file ); -} - - -void create_error_workflow( const char * workflow_file , const char * tmp_file , int value) { - FILE * stream = util_fopen( workflow_file , "w"); - fprintf(stream , "CREATE_FILE %s %d\n" , tmp_file , value); - fprintf(stream , "XREAD_FILE %s\n" , tmp_file ); - fclose( stream ); - - printf("Have created:%s \n",workflow_file ); -} - - -void * read_file( void * self , const stringlist_type * args) { - printf("Running read_file \n"); - int * value = (int *) self; - FILE * stream = util_fopen(stringlist_iget(args , 0 ) , "r"); - fscanf(stream , "%d" , value ); - fclose( stream ); - { - int * return_value = util_malloc( sizeof * return_value ); - return_value[0] = value[0]; - - return return_value; - } -} - - -static void create_exjob( const char * workflow , const char * bin_path) -{ - FILE * stream = util_fopen( workflow , "w"); - fprintf(stream , "EXECUTABLE \"%s/create_file\"\n" , bin_path); - fprintf(stream , "ARG_TYPE 1 INT\n"); - fprintf(stream , "MIN_ARG 2\n"); - fprintf(stream , "MAX_ARG 2\n"); - fclose(stream); -} - - -void test_has_job(const char * job) { - workflow_joblist_type * joblist = workflow_joblist_alloc(); - - test_assert_false( workflow_joblist_has_job( joblist , "NoNotThis")); - test_assert_true( workflow_joblist_add_job_from_file( joblist , "CREATE_FILE" , job) ); - test_assert_true( workflow_joblist_has_job( joblist , "CREATE_FILE")); - - workflow_joblist_free( joblist ); -} - - -int main( int argc , char ** argv) { - const char * exjob_file = "job"; - const char * bin_path = argv[1]; - const char * internal_workflow = argv[2]; - test_work_area_type * work_area = test_work_area_alloc( "job_workflow_test" ); - - signal(SIGSEGV , util_abort_signal); - create_exjob( exjob_file , bin_path ); - test_has_job( exjob_file ); - { - - int int_value = rand(); - int read_value = 100; - workflow_joblist_type * joblist = workflow_joblist_alloc(); - - if (!workflow_joblist_add_job_from_file( joblist , "CREATE_FILE" , exjob_file)) { - remove( exjob_file ); - test_error_exit("Loading job CREATE_FILE failed\n"); - } else - remove( exjob_file ); - - if (!workflow_joblist_add_job_from_file( joblist , "READ_FILE" , internal_workflow)) - test_error_exit("Loading job READ_FILE failed\n"); - - { - config_parser_type * workflow_compiler = workflow_joblist_get_compiler( joblist ); - if (config_get_schema_size( workflow_compiler ) != 2) - test_error_exit("Config compiler - wrong size \n"); - } - - - { - const char * workflow_file = "workflow"; - const char * tmp_file = "fileX"; - workflow_type * workflow; - - create_workflow( workflow_file , tmp_file , int_value ); - workflow = workflow_alloc(workflow_file , joblist ); - unlink( workflow_file ); - - { - bool runOK; - runOK = workflow_run( workflow , &read_value , false , NULL); - if (runOK) { - if (int_value != read_value) - test_error_exit("Wrong numeric value read back \n"); - - test_assert_int_equal( workflow_get_stack_size( workflow ) , 2 ); - test_assert_not_NULL( workflow_iget_stack_ptr( workflow , 0 ) ); - test_assert_NULL( workflow_iget_stack_ptr( workflow , 1 ) ); - - { - void * return_value = workflow_iget_stack_ptr( workflow , 0 ); - int return_int = *((int *) return_value); - if (int_value != return_int) - test_error_exit("Wrong numeric value read back \n"); - - test_assert_not_NULL( workflow_pop_stack( workflow )); - test_assert_NULL( workflow_pop_stack( workflow )); - test_assert_int_equal( workflow_get_stack_size( workflow ) , 0 ); - - free( return_value ); - - } - } else { - unlink( tmp_file ); - test_error_exit("Workflow did not run\n"); - } - unlink( tmp_file ); - } - } - workflow_joblist_free( joblist ); - - } - { - workflow_joblist_type * joblist = workflow_joblist_alloc(); - const char * workflow_file = "workflow"; - const char * tmp_file = "fileX"; - int read_value; - int int_value = 100; - workflow_type * workflow; - - create_workflow( workflow_file , tmp_file , int_value ); - workflow = workflow_alloc(workflow_file , joblist ); - unlink( workflow_file ); - test_assert_false( workflow_run( workflow , &read_value , false , NULL) ); - test_assert_int_equal( workflow_get_stack_size( workflow ) , 0 ); - } - test_work_area_free( work_area ); - exit(0); -} diff --git a/ThirdParty/Ert/libjob_queue/tests/lsf_tests.cmake b/ThirdParty/Ert/libjob_queue/tests/lsf_tests.cmake deleted file mode 100644 index b7336f97fb..0000000000 --- a/ThirdParty/Ert/libjob_queue/tests/lsf_tests.cmake +++ /dev/null @@ -1,57 +0,0 @@ -# The testing of the lsf submit capabilities is quite troublesome for -# two reasons, and therefor by default disabled: -# -# -# 1. The shell based LSF commands require that user running the -# bsub/bjobs/bxxx command has passwordless ssh configured to log in -# to the lsf server. When the build and testing is run as a common -# 'jenkins' user this becomes difficult. -# -# 2. Submitting through the lsf library requires that the build/test -# server actually is a LIM host; which it typically is not. -# -#----------------------------------------------------------------- -# -# This should be a space separated list of servers which will be -# tried out when testing the LSF submit capability. The test program -# will interpret the special strings 'NULL' and 'LOCAL' as follows: -# -# NULL: Submit using the linked in library functions. -# LOCAL: Submit using shell commands on the current server -# -set(LSF_SERVER "" CACHE STRING "List of LSF servers for testing") - -if (HAVE_LSF_LIBRARY) - add_executable( job_lsf_test job_lsf_test.c ) - target_link_libraries( job_lsf_test job_queue util test_util ) - add_test( job_lsf_test ${EXECUTABLE_OUTPUT_PATH}/job_lsf_test ) -endif() - - - -if (HAVE_LSF_LIBRARY) - add_executable( job_lsb job_lsb.c ) - target_link_libraries( job_lsb job_queue util test_util ) - add_test( job_lsb ${EXECUTABLE_OUTPUT_PATH}/job_lsb ) -endif() - -add_executable( job_lsf_remote_submit_test job_lsf_remote_submit_test.c ) -target_link_libraries( job_lsf_remote_submit_test job_queue util test_util ) - -add_executable( job_lsf_library_submit_test job_lsf_library_submit_test.c ) -target_link_libraries( job_lsf_library_submit_test job_queue util ) - -add_executable( job_program job_program.c ) - -if (LSF_SERVER) - add_test( job_lsf_remote_submit_test ${EXECUTABLE_OUTPUT_PATH}/job_lsf_remote_submit_test ${EXECUTABLE_OUTPUT_PATH}/job_program ${LSF_SERVER} NULL LOCAL) -else() - add_test( job_lsf_remote_submit_test ${EXECUTABLE_OUTPUT_PATH}/job_lsf_remote_submit_test ${EXECUTABLE_OUTPUT_PATH}/job_program NULL LOCAL) -endif() -set_property( TEST job_lsf_remote_submit_test PROPERTY LABELS StatoilData) - -# The test program is installed - actually running the test must be -# handled completely on the outside of this build system. -if (INSTALL_ERT) - install(TARGETS job_program job_lsf_library_submit_test DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) -endif() diff --git a/ThirdParty/Ert/librms/CMakeLists.txt b/ThirdParty/Ert/librms/CMakeLists.txt deleted file mode 100644 index 2e88f5e50d..0000000000 --- a/ThirdParty/Ert/librms/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -add_subdirectory( src ) -if (BUILD_APPLICATIONS) - add_subdirectory( applications ) -endif() - -if (BUILD_TESTS) - add_subdirectory( tests ) -endif() - - diff --git a/ThirdParty/Ert/librms/applications/CMakeLists.txt b/ThirdParty/Ert/librms/applications/CMakeLists.txt deleted file mode 100644 index 48cbff4f02..0000000000 --- a/ThirdParty/Ert/librms/applications/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -add_executable( rms_extract rms_extract.c ) -add_executable( rms_setname rms_setname.c ) -add_executable( rms_stat rms_stat.c ) -add_executable( rms_test rms_test.c ) -add_executable( tag_list tag_list.c ) - - -set(program_list rms_extract rms_setname rms_stat rms_test tag_list) -foreach(prog ${program_list}) - target_link_libraries( ${prog} rms ecl util ) - if (USE_RUNPATH) - add_runpath( ${prog} ) - endif() - - #----------------------------------------------------------------- - - set (destination ${CMAKE_INSTALL_PREFIX}/bin) - - if (INSTALL_ERT) - install(TARGETS ${prog} DESTINATION ${destination}) - if (INSTALL_GROUP) - install(CODE "EXECUTE_PROCESS(COMMAND chgrp ${INSTALL_GROUP} ${destination}/${prog})") - install(CODE "EXECUTE_PROCESS(COMMAND chmod g+w ${destination}/${prog})") - endif() - endif() -endforeach() diff --git a/ThirdParty/Ert/librms/applications/rms_extract.c b/ThirdParty/Ert/librms/applications/rms_extract.c deleted file mode 100644 index cffd6dad58..0000000000 --- a/ThirdParty/Ert/librms/applications/rms_extract.c +++ /dev/null @@ -1,104 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rms_extract.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include - -#include -#include -#include - - -void split_name(const char * arg, char **_old_name , char **_new_name) { - char * new_name; - char * old_name; - int i; - int old_name_len = 0; - - for (i=0; i < strlen(arg); i++) { - if (arg[i] == '=') - old_name_len = i; - } - - if (old_name_len > 0) { - old_name = util_alloc_substring_copy(arg , 0 , old_name_len); - new_name = util_alloc_string_copy(&arg[old_name_len + 1]); - } else { - old_name = util_alloc_string_copy(arg); - new_name = old_name; - } - - *_old_name = old_name; - *_new_name = new_name; -} - - - - -int main (int argc , char **argv) { - { - if (argc <= 2) { - fprintf(stderr,"rms_extract.x filename tag1(=new_tag1) tag2 ... \n"); - abort(); - } - } - { - const char * filename = argv[1]; - int i; - rms_tag_type * dim_tag; - rms_file_type *file = rms_file_alloc(filename , false); - printf("Skal laste inn file: %s \n",filename); - rms_file_fread(file); - dim_tag = rms_file_get_dim_tag_ref(file); - - for (i = 2; i < argc; i++) { - char * new_name; - char * old_name; - char * new_file; - - split_name(argv[i] , &old_name , &new_name); - printf("Exctracting %s -> %s \n" , old_name , new_name); fflush(stdout); - new_file = util_alloc_filename(NULL , new_name , "ROFF"); - - { - rms_tag_type * tag; - rms_file_type * out_file = rms_file_alloc(new_file , false); - FILE *stream = rms_file_fopen_w(out_file); - rms_file_init_fwrite(out_file , "parameter"); - rms_tag_fwrite(dim_tag , stream); - - tag = rms_file_get_tag_ref(file , "parameter" , "name" , old_name , true); - rms_tag_fwrite_parameter(new_name, rms_tag_get_datakey(tag) , stream); - rms_file_complete_fwrite(out_file); - fclose(stream); - } - if (new_name == old_name) - free(new_name); - else { - free(new_name); - free(old_name); - } - } - rms_file_free(file); - return 0; - } -} - diff --git a/ThirdParty/Ert/librms/applications/rms_setname.c b/ThirdParty/Ert/librms/applications/rms_setname.c deleted file mode 100644 index b1a250df72..0000000000 --- a/ThirdParty/Ert/librms/applications/rms_setname.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rms_setname.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include -#include - - -int main (int argc , char **argv) { - int i; - char *name; - int name_length; - argv++; - argc--; - - name = argv[0]; - name_length = strlen(name) + 1; - - argv++; - argc--; - for (i = 0; i < argc; i++) { - rms_file_type *file = rms_file_alloc(argv[i] , false); - rms_tagkey_type *tagkey; - rms_tag_type *tag; - rms_file_fread(file); - - tag = rms_file_get_tag_ref(file , "parameter" , NULL , NULL , true); - tagkey = rms_tag_get_key(tag , "name"); - rms_tagkey_manual_realloc_data(tagkey , name_length); - rms_tagkey_set_data(tagkey , name); - rms_file_fwrite(file , "parameter"); - rms_file_free(file); - } - - return 0; -} - diff --git a/ThirdParty/Ert/librms/applications/rms_stat.c b/ThirdParty/Ert/librms/applications/rms_stat.c deleted file mode 100644 index 770d84176d..0000000000 --- a/ThirdParty/Ert/librms/applications/rms_stat.c +++ /dev/null @@ -1,119 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rms_stat.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include -#include - - - -void convert_test(const char * rms_file, const char * ecl_path) { - rms_file_2eclipse(rms_file , ecl_path , false , 1); -} - - -int main (int argc , char **argv) { - char * tagname; - rms_tagkey_type *mean , *std; - rms_tag_type *dim_tag; - bool log_transform = false; - rms_file_type *file; - - if (argc < 4) { - printf("%s: PARAM-NAME file1 file2 file3 .....\n",argv[0]); - exit(1); - } - - - file = rms_file_alloc(argv[2] , false); - tagname = argv[1]; - dim_tag = rms_file_fread_alloc_tag(file , "dimensions" , NULL , NULL); - mean = rms_file_fread_alloc_data_tagkey(file , "parameter" , "name" , tagname); - std = rms_tagkey_copyc(mean); - - rms_file_free_data(file); - rms_stats_mean_std(mean , std , tagname , argc - 2 , (const char **) &argv[2] , log_transform); - - { - char * outfile = malloc(strlen(tagname) + strlen("_stats.ROFF") + 1); - sprintf(outfile , "%s_stats.ROFF" , tagname); - rms_file_set_filename(file , outfile , false); - printf("Statistics collected in: %s \n",outfile); - free(outfile); - } - - { - char * out_tag = malloc(strlen(tagname) + 6); - FILE *stream = rms_file_fopen_w(file); - rms_file_init_fwrite(file , "parameter"); - rms_tag_fwrite(dim_tag , stream); - sprintf(out_tag , "%s.mean" , tagname); rms_tag_fwrite_parameter(out_tag , mean , stream); - sprintf(out_tag , "%s.std" , tagname); rms_tag_fwrite_parameter(out_tag , std , stream); - rms_file_complete_fwrite(file); - fclose(stream); - free(out_tag); - } - - rms_tag_free(dim_tag); - rms_tagkey_free(mean); - rms_tagkey_free(std); - rms_file_free_data(file); - rms_file_free(file); - - exit(1); - - { - const int ens_size = 100; - char **file_list; - double **X; - int i , j; - file_list = malloc(ens_size * sizeof * file_list); - for (i=0; i < ens_size; i++) { - file_list[i] = malloc(100); - sprintf(file_list[i] , "PERMX_%04d.INC" , i + 1); - } - - - X = malloc(ens_size * sizeof *X); - for (i=0; i < ens_size; i++) - X[i] = malloc(ens_size * sizeof *X[i]); - - for (i=0; i < ens_size; i++) - for (j=0; j < ens_size; j++) - X[i][j] = 0; - - for (i=0; i < ens_size; i++) - X[i][i] = 1.0; - - rms_stats_update_ens("Posterior" , "Post2" , (const char **) file_list , "PERMX" , ens_size , (const double **) X); - - for (i=0; i < ens_size; i++) { - free(X[i]); - free(file_list[i]); - } - free(X); - free(file_list); - } - - return 0; -} - diff --git a/ThirdParty/Ert/librms/applications/rms_test.c b/ThirdParty/Ert/librms/applications/rms_test.c deleted file mode 100644 index fea7328777..0000000000 --- a/ThirdParty/Ert/librms/applications/rms_test.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rms_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include -#include - - - -void convert_test(const char * rms_file, const char * ecl_path) { - rms_file_2eclipse(rms_file , ecl_path , false , 1); -} - - -int main (int argc , char **argv) { - rms_tagkey_type *mean , *std; - rms_tag_type *dim_tag; - bool log_transform = false; - - rms_file_type *file = rms_file_alloc(argv[1] , false); - dim_tag = rms_file_fread_alloc_tag(file , "dimensions" , NULL , NULL); - mean = rms_file_fread_alloc_data_tagkey(file , "parameter" , "name" , "PERMX"); - std = rms_tagkey_copyc(mean); - - rms_file_free_data(file); - rms_stats_mean_std(mean , std , "PERMX" , argc - 1 , (const char **) &argv[1] , log_transform); - rms_file_set_filename(file , "Stats.ROFF" , false); - - { - FILE *stream = rms_file_fopen_w(file); - rms_file_init_fwrite(file , "parameter"); - rms_tag_fwrite(dim_tag , stream); - rms_tag_fwrite_parameter("mean:PERMX" , mean , stream); - rms_tag_fwrite_parameter("std:PERMX" , std , stream); - rms_file_complete_fwrite(file); - fclose(stream); - } - - rms_tag_free(dim_tag); - rms_tagkey_free(mean); - rms_tagkey_free(std); - rms_file_free_data(file); - rms_file_free(file); - - exit(1); - - { - const int ens_size = 100; - char **file_list; - double **X; - int i , j; - file_list = malloc(ens_size * sizeof * file_list); - for (i=0; i < ens_size; i++) { - file_list[i] = malloc(100); - sprintf(file_list[i] , "PERMX_%04d.INC" , i + 1); - } - - - X = malloc(ens_size * sizeof *X); - for (i=0; i < ens_size; i++) - X[i] = malloc(ens_size * sizeof *X[i]); - - for (i=0; i < ens_size; i++) - for (j=0; j < ens_size; j++) - X[i][j] = 0; - - for (i=0; i < ens_size; i++) - X[i][i] = 1.0; - - rms_stats_update_ens("Posterior" , "Post2" , (const char **) file_list , "PERMX" , ens_size , (const double **) X); - - for (i=0; i < ens_size; i++) { - free(X[i]); - free(file_list[i]); - } - free(X); - free(file_list); - } - - return 0; -} - diff --git a/ThirdParty/Ert/librms/applications/tag_list.c b/ThirdParty/Ert/librms/applications/tag_list.c deleted file mode 100644 index 0f755c1bd1..0000000000 --- a/ThirdParty/Ert/librms/applications/tag_list.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'tag_list.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include -#include - - - -int main (int argc , char **argv) { - int i; - - argc--; - argv++; - - for (i = 0; i < argc; i++) { - rms_file_type *file = rms_file_alloc(argv[i] , false); - rms_file_fread(file); - rms_file_fprintf(file , stdout); - rms_file_free(file); - } - - return 0; -} - diff --git a/ThirdParty/Ert/librms/include/ert/rms/rms_export.h b/ThirdParty/Ert/librms/include/ert/rms/rms_export.h deleted file mode 100644 index 67886dcdd8..0000000000 --- a/ThirdParty/Ert/librms/include/ert/rms/rms_export.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rms_export.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_RMS_EXPORT_H -#define ERT_RMS_EXPORT_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - - -void rms_export_roff_from_keyword(const char *filename, ecl_grid_type *ecl_grid, - ecl_kw_type **ecl_kw, int size); - - - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/ThirdParty/Ert/librms/include/ert/rms/rms_file.h b/ThirdParty/Ert/librms/include/ert/rms/rms_file.h deleted file mode 100644 index c8dc136e89..0000000000 --- a/ThirdParty/Ert/librms/include/ert/rms/rms_file.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rms_file.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_RMS_FILE_H -#define ERT_RMS_FILE_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -#include - -typedef struct rms_file_struct rms_file_type; - -void rms_file_2eclipse(const char * rms_file , const char * , bool , int ); -void rms_file_fclose(rms_file_type *); -FILE * rms_file_fopen_r(rms_file_type *rms_file); -FILE * rms_file_fopen_w(rms_file_type *rms_file); -void rms_file_set_filename(rms_file_type * , const char * , bool); -rms_file_type * rms_file_alloc (const char *, bool ); -void rms_file_fread (rms_file_type *); -void rms_file_fwrite (rms_file_type * , const char *); -void rms_file_fprintf (const rms_file_type * , FILE *); -void rms_file_free (rms_file_type *); -void rms_file_free_data (rms_file_type *); -rms_tag_type * rms_file_get_dim_tag_ref(const rms_file_type * ); -rms_tag_type * rms_file_get_tag_ref (const rms_file_type *, const char *, const char *, const char * , bool); -void rms_file_assert_dimensions(const rms_file_type *, int , int , int ); -rms_tag_type * rms_file_fread_alloc_tag(rms_file_type * , const char *, const char *, const char *); -rms_tagkey_type * rms_file_fread_alloc_data_tagkey(rms_file_type * , const char *, const char *, const char *); -void rms_file_complete_fwrite(const rms_file_type *); -void rms_file_init_fwrite(const rms_file_type * , const char *); -void rms_file_get_dims(const rms_file_type * , int * ); -FILE * rms_file_get_FILE(const rms_file_type * ); -void rms_file_add_dimensions(rms_file_type * , int , int , int , bool); -bool rms_file_is_roff(FILE * ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/librms/include/ert/rms/rms_stats.h b/ThirdParty/Ert/librms/include/ert/rms/rms_stats.h deleted file mode 100644 index d9193a5849..0000000000 --- a/ThirdParty/Ert/librms/include/ert/rms/rms_stats.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rms_stats.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_RMS_STATS_H -#define ERT_RMS_STATS_H -#ifdef __cplusplus -extern "C" { -#endif - -#include - -void rms_stats_mean_std(rms_tagkey_type * , rms_tagkey_type * , const char * , int , const char ** , bool); -void rms_stats_update_ens(const char * , const char *, const char **, const char *, int , const double **); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/librms/include/ert/rms/rms_tag.h b/ThirdParty/Ert/librms/include/ert/rms/rms_tag.h deleted file mode 100644 index c0a42d63eb..0000000000 --- a/ThirdParty/Ert/librms/include/ert/rms/rms_tag.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rms_tag.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_RMS_TAG_H -#define ERT_RMS_TAG_H -#ifdef __cplusplus -extern "C" { -#endif -#include -#include -#include - -#include - -#include - - - -typedef struct rms_tag_struct rms_tag_type; - -int rms_tag_get_datakey_sizeof_ctype(const rms_tag_type * ); -const char * rms_tag_get_namekey_name(const rms_tag_type * ); -const char * rms_tag_get_name(const rms_tag_type *); -rms_tagkey_type * rms_tag_get_datakey(const rms_tag_type *); -void rms_tag_free(rms_tag_type *); -void rms_tag_free__(void * arg); -rms_tag_type * rms_tag_fread_alloc(FILE *, hash_type *, bool , bool *); -bool rms_tag_name_eq(const rms_tag_type *, const char * , const char *, const char *); -rms_tagkey_type * rms_tag_get_key(const rms_tag_type *, const char *); -void rms_tag_fwrite_filedata(const char * , FILE *stream); -void rms_tag_fwrite_eof(FILE *stream); -void rms_tag_fwrite(const rms_tag_type * , FILE * ); -void rms_tag_fprintf(const rms_tag_type * , FILE * ); -const char * rms_tag_name_ref(const rms_tag_type * ); -rms_tag_type * rms_tag_alloc_dimensions(int , int , int ); -void rms_tag_fwrite_dimensions(int , int , int , FILE *); -void rms_tag_fwrite_parameter(const char *, const rms_tagkey_type *, FILE *); -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/librms/include/ert/rms/rms_tagkey.h b/ThirdParty/Ert/librms/include/ert/rms/rms_tagkey.h deleted file mode 100644 index 821eba8a10..0000000000 --- a/ThirdParty/Ert/librms/include/ert/rms/rms_tagkey.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rms_tagkey.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_RMS_TAGKEY_H -#define ERT_RMS_TAGKEY_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include - -#include - -#include - -typedef struct rms_tagkey_struct rms_tagkey_type; - - -bool rms_tagkey_cmp(const rms_tagkey_type * , const rms_tagkey_type * ); -void rms_tagkey_free(rms_tagkey_type *); -rms_tagkey_type * rms_tagkey_alloc_empty(bool); -rms_tagkey_type * rms_tagkey_alloc_complete(const char * , int , rms_type_enum , const void * , bool); -const char * rms_tagkey_get_name(const rms_tagkey_type *); -rms_type_enum rms_tagkey_get_rms_type(const rms_tagkey_type * ); -ecl_type_enum rms_tagkey_get_ecl_type(const rms_tagkey_type * ); -void rms_tagkey_manual_realloc_data(rms_tagkey_type * , int ); -void rms_tagkey_set_data(rms_tagkey_type * , const void * ); - -bool rms_tagkey_char_eq(const rms_tagkey_type *, const char *); -void rms_tagkey_free_(void *); -void * rms_tagkey_copyc_(const void *); -void rms_tagkey_load(rms_tagkey_type *, bool , FILE *, hash_type *); -void * rms_tagkey_get_data_ref(const rms_tagkey_type *); -void rms_tagkey_fwrite(const rms_tagkey_type * , FILE *); -void rms_tagkey_fprintf(const rms_tagkey_type * , FILE *); -rms_tagkey_type * rms_tagkey_copyc(const rms_tagkey_type *); -int rms_tagkey_get_size(const rms_tagkey_type *); - - -rms_tagkey_type * rms_tagkey_alloc_byteswap(); -rms_tagkey_type * rms_tagkey_alloc_creationDate(); -rms_tagkey_type * rms_tagkey_alloc_filetype(const char * ); -rms_tagkey_type * rms_tagkey_alloc_dim(const char * , int ); -rms_tagkey_type * rms_tagkey_alloc_parameter_name(const char * ); - -void rms_tagkey_assign(rms_tagkey_type * , const rms_tagkey_type *); -void rms_tagkey_apply(rms_tagkey_type * , double (f) (double)); -void rms_tagkey_inplace_log10(rms_tagkey_type * ); -void rms_tagkey_inplace_sqr(rms_tagkey_type *); -void rms_tagkey_inplace_sqrt(rms_tagkey_type *); -void rms_tagkey_inplace_mul(rms_tagkey_type * , const rms_tagkey_type *); -void rms_tagkey_inplace_add(rms_tagkey_type * , const rms_tagkey_type *); -void rms_tagkey_inplace_add_scaled(rms_tagkey_type * , const rms_tagkey_type * , double); -void rms_tagkey_scale(rms_tagkey_type * , double ); -void rms_tagkey_clear(rms_tagkey_type * ); -int rms_tagkey_get_sizeof_ctype(const rms_tagkey_type * ); -void rms_tagkey_max_min(const rms_tagkey_type * , void *, void *); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/librms/include/ert/rms/rms_type.h b/ThirdParty/Ert/librms/include/ert/rms/rms_type.h deleted file mode 100644 index 124b5b4c5c..0000000000 --- a/ThirdParty/Ert/librms/include/ert/rms/rms_type.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rms_type.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_RMS_TYPE_H -#define ERT_RMS_TYPE_H -#ifdef __cplusplus -extern "C" { -#endif -#include -#include - - -typedef enum rms_type_enum_def rms_type_enum; - -enum rms_type_enum_def {rms_char_type , rms_float_type , rms_double_type , rms_bool_type , rms_byte_type , rms_int_type}; - -/* This *really* should not be exported ... */ - -typedef struct { - rms_type_enum rms_type; - int sizeof_ctype; - -} __rms_type; - -/*****************************************************************/ - -void rms_type_free(void *); -__rms_type * rms_type_alloc(rms_type_enum , int ); -const void * rms_type_copyc(const void * ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/librms/include/ert/rms/rms_util.h b/ThirdParty/Ert/librms/include/ert/rms/rms_util.h deleted file mode 100644 index adf913b24d..0000000000 --- a/ThirdParty/Ert/librms/include/ert/rms/rms_util.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rms_util.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_RMS_UTIL_H -#define ERT_RMS_UTIL_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include - -#include - -#define RMS_INACTIVE_DOUBLE -999.00 -#define RMS_INACTIVE_FLOAT -999.00 -#define RMS_INACTIVE_INT -999 - - -rms_type_enum rms_util_convert_ecl_type(ecl_type_enum ); -int rms_util_global_index_from_eclipse_ijk(int, int, int, int, int, int); -void rms_util_translate_undef(void * , int , int , const void * , const void * ); -void rms_util_set_fortran_data(void *, const void * , int , int , int , int); -void rms_util_read_fortran_data(const void *, void * , int , int , int , int); -void rms_util_fskip_string(FILE *); -int rms_util_fread_strlen(FILE *); -bool rms_util_fread_string(char * , int , FILE *); -void rms_util_fwrite_string(const char * string , FILE *stream); -void rms_util_fwrite_comment(const char * , FILE *); -void rms_util_fwrite_newline(FILE *stream); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/librms/src/CMakeLists.txt b/ThirdParty/Ert/librms/src/CMakeLists.txt deleted file mode 100644 index 606e86e815..0000000000 --- a/ThirdParty/Ert/librms/src/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -set( source_files rms_file.c rms_util.c rms_tag.c rms_type.c rms_tagkey.c rms_stats.c rms_export.c) -set( header_files rms_file.h rms_util.h rms_tag.h rms_type.h rms_tagkey.h rms_stats.h rms_export.h) - -add_library( rms ${LIBRARY_TYPE} ${source_files} ) -set_target_properties( rms PROPERTIES VERSION ${ERT_VERSION_MAJOR}.${ERT_VERSION_MINOR} SOVERSION ${ERT_VERSION_MAJOR} ) -target_link_libraries( rms ecl ) -if (USE_RUNPATH) - add_runpath( rms ) -endif() - - -#----------------------------------------------------------------- -if (INSTALL_ERT) - install(TARGETS rms DESTINATION ${CMAKE_INSTALL_LIBDIR}) - foreach(header ${header_files}) - install(FILES ../include/ert/rms/${header} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/ert/rms) - endforeach() -endif() - diff --git a/ThirdParty/Ert/librms/src/readme.overview b/ThirdParty/Ert/librms/src/readme.overview deleted file mode 100644 index 5b3c3dff52..0000000000 --- a/ThirdParty/Ert/librms/src/readme.overview +++ /dev/null @@ -1,55 +0,0 @@ -The EnKF functionality is organized in xxx libraries with different -functionalities. The different libraries depend on eachother, and the -libraries must be built in correct order. The dependencies is as -follows: - -libhash : -libutil : libhash -libecl : libhash libutil -librms : libecl libutil libhash -libsched : libecl linutil libhash -libenkf : libecl libsched librm linutil libhash - - -libhash: This library implements the classes hash_type, set_type and - list_type. - -libutil: This library is a collection utility routines. Observe that - this library only implements routines, and not statefull - objects. - -libecl: This library implements functions for reading/writing ECLIPSE - restart/summary/init/grid files. - -libsched: This library implements a basic SCHEDULE file parser. - -librms: This library implements (basic) reader and writer for binary - RMS ROFF files. - -libenkf: This library implements various high level objects for EnKF - functionality. - ------------------------------------------------------------------ - -All the makefiles start with the statement: - -include "path_config" - -The file path_config is *not* under version control, this is on -purpose because every user can/should have a private confiiguration of -paths. The file path_config should define make-variables for the -location of all the libraries, this is an example of a valid -path-config file: - - LIBHASH_HOME = /h/a152128/EnKF/EnKF/libhash - LIBUTIL_HOME = /h/a152128/EnKF/EnKF/libutil - LIBSCHED_HOME = /h/a152128/EnKF/EnKF/libsched - LIBRMS_HOME = /h/a152128/EnKF/EnKF/librms - LIBECL_HOME = /h/a152128/EnKF/EnKF/libecl - LIBENKF_HOME = /h/a152128/EnKF/EnKF/libenkf - -In this example all libraries have a common path prefix, that is not -a requirement. - - - diff --git a/ThirdParty/Ert/librms/src/rms_export.c b/ThirdParty/Ert/librms/src/rms_export.c deleted file mode 100644 index 672eb25025..0000000000 --- a/ThirdParty/Ert/librms/src/rms_export.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rms_export.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - -#include - -#include -#include - -#include -#include -#include - - -void rms_export_roff_from_keyword(const char *filename, ecl_grid_type *ecl_grid, - ecl_kw_type **ecl_kw, int size) { - - rms_file_type *rms_file; - rms_tagkey_type *data_key; - int nx, ny, nz, active_size; - int i, j, k; - int global_size; - int n; - - ecl_grid_get_dims(ecl_grid, &nx, &ny, &nz, &active_size); - global_size = ecl_grid_get_global_size(ecl_grid); - - rms_file = rms_file_alloc(filename, false); - rms_file_fopen_w(rms_file); - - rms_file_init_fwrite(rms_file , "parameter"); - rms_tag_fwrite_dimensions(nx , ny , nz , rms_file_get_FILE(rms_file)); - - for (n = 0; n < size; n++) { - float *src_data; - float *target_data; - - src_data = (float *) ecl_kw_get_void_ptr(ecl_kw[n]); - target_data = util_calloc(global_size , sizeof * target_data ); - - for (k=0; k < nz; k++) { - for (j=0; j < ny; j++) { - for (i=0; i < nx; i++) { - int index1D; - int index3D; - double fill = RMS_INACTIVE_FLOAT; - /* TODO: - * This currently only supports FLOAT / REAL type. - */ - - index1D = ecl_grid_get_active_index3(ecl_grid, i, j, k); - index3D = rms_util_global_index_from_eclipse_ijk(nx, ny, nz, i, j, k); - - if (index1D >= 0) - target_data[index3D] = src_data[index1D]; - else - memcpy(&target_data[index3D] , &fill, sizeof(float)); - } - } - } - - data_key = rms_tagkey_alloc_complete("data", global_size, - rms_util_convert_ecl_type(ecl_kw_get_type(ecl_kw[n])), target_data, true); - rms_tag_fwrite_parameter(ecl_kw_get_header8(ecl_kw[n]), data_key, - rms_file_get_FILE(rms_file)); - rms_tagkey_free(data_key); - - util_safe_free(target_data); - } - - rms_file_complete_fwrite(rms_file); - rms_file_fclose(rms_file); - rms_file_free(rms_file); - -} diff --git a/ThirdParty/Ert/librms/src/rms_file.c b/ThirdParty/Ert/librms/src/rms_file.c deleted file mode 100644 index 26a4f6aa44..0000000000 --- a/ThirdParty/Ert/librms/src/rms_file.c +++ /dev/null @@ -1,492 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rms_file.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -/*****************************************************************/ -static const char * rms_ascii_header = "roff-asc"; -static const char * rms_binary_header = "roff-bin"; - -static const char * rms_comment1 = "ROFF file"; -static const char * rms_comment2 = "Creator: RMS - Reservoir Modelling System, version 8.1"; -/* - static const char * rms_parameter_tagname = "parameter"; -*/ - - - - - -struct rms_file_struct { - char * filename; - bool endian_convert; - bool fmt_file; - hash_type * type_map; - vector_type * tag_list; - FILE * stream; -}; - - - -/*****************************************************************/ -/* Pure roff routines */ - - - - -static bool rms_fmt_file(const rms_file_type *rms_file) { - bool fmt_file; - char filetype[9]; - rms_util_fread_string( filetype , 9 , rms_file->stream); - - if (strncmp(filetype , rms_binary_header , 8) == 0) - fmt_file = false; - else if (strncmp(filetype , rms_ascii_header , 8) == 0) - fmt_file = true; - else { - fprintf(stderr,"%s: header : %8s not recognized in file: %s - aborting \n",__func__ , filetype , rms_file->filename); - abort(); - } - return fmt_file; -} - - - -static void rms_file_add_tag(rms_file_type *rms_file , const rms_tag_type *tag) { - vector_append_owned_ref(rms_file->tag_list , tag , rms_tag_free__ ); -} - - -void rms_file_add_dimensions(rms_file_type * rms_file , int nX , int nY , int nZ , bool save) { - if (rms_file_get_tag_ref(rms_file , "dimensions" , NULL , NULL , false) != NULL) { - fprintf(stderr,"%s: dimensions tag already persent in rms_file object - aborting \n",__func__); - abort(); - } - { - rms_tag_type * dim_tag = rms_tag_alloc_dimensions(nX , nY , nZ); - rms_file_add_tag(rms_file , dim_tag); - if (save) - rms_tag_fwrite(dim_tag , rms_file->stream); - } -} - - -rms_tag_type * rms_file_get_tag_ref(const rms_file_type *rms_file , - const char *tagname , - const char *keyname , - const char *keyvalue, bool abort_on_error) { - - rms_tag_type *return_tag = NULL; - bool cont; - { - int index = 0; - while (cont) { - if (index < vector_get_size( rms_file->tag_list )) { - rms_tag_type *tag = vector_iget( rms_file->tag_list , index ); - if (rms_tag_name_eq(tag , tagname , keyname , keyvalue)) { - return_tag = tag; - cont = false; - } else - index++; - } else - cont = false; - } - } - - if (return_tag == NULL && abort_on_error) { - if (keyname != NULL && keyvalue != NULL) - fprintf(stderr,"%s: failed to find tag:%s with key:%s=%s in file:%s - aborting \n",__func__ , tagname , keyname , keyvalue , rms_file->filename); - else - fprintf(stderr,"%s: failed to find tag:%s in file:%s - aborting \n",__func__ , tagname , rms_file->filename); - } - return return_tag; -} - - - - - - -/** - This function allocates and rms_file_type * handle, but it does - not load the file content. -*/ - - -rms_file_type * rms_file_alloc(const char *filename, bool fmt_file) { - rms_file_type *rms_file = malloc(sizeof *rms_file); - rms_file->endian_convert = false; - rms_file->type_map = hash_alloc(); - rms_file->tag_list = vector_alloc_new(); - - hash_insert_hash_owned_ref(rms_file->type_map , "byte" , rms_type_alloc(rms_byte_type , 1) , rms_type_free); - hash_insert_hash_owned_ref(rms_file->type_map , "bool" , rms_type_alloc(rms_bool_type, 1) , rms_type_free); - hash_insert_hash_owned_ref(rms_file->type_map , "int" , rms_type_alloc(rms_int_type , 4) , rms_type_free); - hash_insert_hash_owned_ref(rms_file->type_map , "float" , rms_type_alloc(rms_float_type , 4) , rms_type_free); - hash_insert_hash_owned_ref(rms_file->type_map , "double" , rms_type_alloc(rms_double_type , 8) , rms_type_free); - - hash_insert_hash_owned_ref(rms_file->type_map , "char" , rms_type_alloc(rms_char_type , -1) , rms_type_free); /* Char are a f*** mix of vector and scalar */ - - rms_file->filename = NULL; - rms_file->stream = NULL; - rms_file_set_filename(rms_file , filename , fmt_file); - return rms_file; -} - - - - - - -void rms_file_set_filename(rms_file_type * rms_file , const char *filename , bool fmt_file) { - rms_file->filename = util_realloc_string_copy(rms_file->filename , filename); - rms_file->fmt_file = fmt_file; -} - - - -void rms_file_free_data(rms_file_type * rms_file) { - vector_clear( rms_file->tag_list ); -} - - - -void rms_file_free(rms_file_type * rms_file) { - rms_file_free_data(rms_file); - vector_free( rms_file->tag_list ); - hash_free(rms_file->type_map); - free(rms_file->filename); - free(rms_file); -} - - -static int rms_file_get_dim(const rms_tag_type *tag , const char *dim_name) { - rms_tagkey_type *key = rms_tag_get_key(tag , dim_name); - if (key == NULL) { - fprintf(stderr,"%s: failed to find tagkey:%s aborting \n" , __func__ , dim_name); - abort(); - } - return * (int *) rms_tagkey_get_data_ref(key); -} - - - -void rms_file_assert_dimensions(const rms_file_type *rms_file , int nx , int ny , int nz) { - bool OK = true; - rms_tag_type *tag = rms_file_get_tag_ref(rms_file , "dimensions" , NULL , NULL , true); - OK = (nx == rms_file_get_dim(tag , "nX")); - OK = OK && (ny == rms_file_get_dim(tag , "nY")); - OK = OK && (nz == rms_file_get_dim(tag , "nZ")); - - if (!OK) { - fprintf(stderr,"%s: dimensions on file: %s (%d, %d, %d) did not match with input dimensions (%d,%d,%d) - aborting \n",__func__ , rms_file->filename, - rms_file_get_dim(tag , "nX"), rms_file_get_dim(tag , "nY"), rms_file_get_dim(tag , "nZ"), - nx , ny , nz); - abort(); - } -} - -rms_tag_type * rms_file_get_dim_tag_ref(const rms_file_type * rms_file) { - return rms_file_get_tag_ref(rms_file , "dimensions" , NULL , NULL , true); -} - - -void rms_file_get_dims(const rms_file_type * rms_file , int * dims) { - rms_tag_type *tag = rms_file_get_dim_tag_ref(rms_file); - dims[0] = rms_file_get_dim(tag , "nX"); - dims[1] = rms_file_get_dim(tag , "nY"); - dims[2] = rms_file_get_dim(tag , "nZ"); -} - - -FILE * rms_file_get_FILE(const rms_file_type * rms_file) { return rms_file->stream; } - - -static void rms_file_init_fread(rms_file_type * rms_file) { - - rms_file->fmt_file = rms_fmt_file( rms_file ); - if (rms_file->fmt_file) { - fprintf(stderr,"%s only binary files implemented - aborting \n",__func__); - abort(); - } - /* Skipping two comment lines ... */ - rms_util_fskip_string(rms_file->stream); - rms_util_fskip_string(rms_file->stream); - { - bool eof_tag; - rms_tag_type * filedata_tag = rms_tag_fread_alloc(rms_file->stream , rms_file->type_map , rms_file->endian_convert , &eof_tag); - rms_tagkey_type * byteswap_key = rms_tag_get_key(filedata_tag , "byteswaptest"); - if (byteswap_key == NULL) { - fprintf(stderr,"%s: failed to find filedata/byteswaptest - aborting \n", __func__); - abort(); - } - int byteswap_value = *( int *) rms_tagkey_get_data_ref(byteswap_key); - if (byteswap_value == 1) - rms_file->endian_convert = false; - else - rms_file->endian_convert = true; - rms_tag_free(filedata_tag); - } -} - - - -rms_tag_type * rms_file_fread_alloc_tag(rms_file_type * rms_file , const char *tagname , const char * keyname , const char *keyvalue ) { - rms_tag_type * tag = NULL; - rms_file_fopen_r(rms_file); - { - - bool cont = true; - bool tag_found = false; - long int start_pos = util_ftell(rms_file->stream); - util_fseek(rms_file->stream , 0 , SEEK_SET); - rms_file_init_fread(rms_file); - while (cont) { - bool eof_tag; - rms_tag_type * tmp_tag = rms_tag_fread_alloc(rms_file->stream , rms_file->type_map , rms_file->endian_convert , &eof_tag); - if (rms_tag_name_eq(tmp_tag , tagname , keyname , keyvalue)) { - tag_found = true; - tag = tmp_tag; - } else - rms_tag_free(tmp_tag); - if (tag_found || eof_tag) - cont = false; - } - if (tag == NULL) { - util_fseek(rms_file->stream , start_pos , SEEK_SET); - util_abort("%s: could not find tag: \"%s\" (with %s=%s) in file:%s - aborting.\n",__func__ , tagname , keyname , keyvalue , rms_file->filename); - } - } - rms_file_fclose(rms_file); - return tag; -} - - - -FILE * rms_file_fopen_r(rms_file_type *rms_file) { - rms_file->stream = util_fopen(rms_file->filename , "r"); - return rms_file->stream; -} - - -FILE * rms_file_fopen_w(rms_file_type *rms_file) { - rms_file->stream = util_mkdir_fopen(rms_file->filename , "w"); - return rms_file->stream; -} - -void rms_file_fclose(rms_file_type * rms_file) { - fclose(rms_file->stream); - rms_file->stream = NULL; -} - - -rms_tagkey_type * rms_file_fread_alloc_data_tagkey(rms_file_type * rms_file , const char *tagname , const char * keyname , const char *keyvalue) { - rms_tag_type * tag = rms_file_fread_alloc_tag(rms_file , tagname , keyname , keyvalue); - if (tag != NULL) { - rms_tagkey_type *tagkey = rms_tagkey_copyc( rms_tag_get_key(tag , "data") ); - rms_tag_free(tag); - return tagkey; - } else - return NULL; -} - - - -void rms_file_fread(rms_file_type *rms_file) { - rms_file_fopen_r(rms_file); - rms_file_init_fread(rms_file); - - /* The main read loop */ - { - bool eof_tag = false; - while (!eof_tag) { - rms_tag_type * tag = rms_tag_fread_alloc(rms_file->stream , rms_file->type_map , rms_file->endian_convert , &eof_tag ); - if (!eof_tag) - rms_file_add_tag(rms_file , tag); - else - rms_tag_free(tag); - - } - } - rms_file_fclose(rms_file); -} - - - -/*static */ -void rms_file_init_fwrite(const rms_file_type * rms_file , const char * filetype) { - if (!rms_file->fmt_file) - rms_util_fwrite_string(rms_binary_header , rms_file->stream); - else { - fprintf(stderr,"%s: Sorry only binary writes implemented ... \n",__func__); - rms_util_fwrite_string(rms_ascii_header , rms_file->stream); - } - - rms_util_fwrite_comment(rms_comment1 , rms_file->stream); - rms_util_fwrite_comment(rms_comment2 , rms_file->stream); - rms_tag_fwrite_filedata(filetype , rms_file->stream); -} - - - -void rms_file_complete_fwrite(const rms_file_type * rms_file) { - rms_tag_fwrite_eof(rms_file->stream); -} - - - -void rms_file_fwrite(rms_file_type * rms_file, const char * filetype) { - rms_file_fopen_w(rms_file); - rms_file_init_fwrite(rms_file , filetype ); - - { - int tag_index; - for (tag_index = 0; tag_index < vector_get_size( rms_file->tag_list ); tag_index++) { - const rms_tag_type *tag = vector_iget_const( rms_file->tag_list , tag_index ); - rms_tag_fwrite(tag , rms_file->stream); - } - } - - rms_file_complete_fwrite(rms_file ); - rms_file_fclose(rms_file); -} - - -void rms_file_fprintf(const rms_file_type *rms_file , FILE *stream) { - fprintf(stream , "<%s>\n",rms_file->filename); - { - int tag_index; - for (tag_index = 0; tag_index < vector_get_size( rms_file->tag_list ); tag_index++) { - const rms_tag_type *tag = vector_iget_const( rms_file->tag_list , tag_index ); - rms_tag_fprintf(tag , rms_file->stream); - } - } - fprintf(stream , "\n",rms_file->filename); -} - - - -/* - Hardcoded assumption that the parameter type is float - otherwise this - will break hard. -*/ - -void rms_file_2eclipse(const char * rms_file , const char * ecl_path, bool ecl_fmt_file , int ecl_file_nr) { - char * rms_base_file; - int dims[3] , size; - rms_file_type *file = rms_file_alloc(rms_file , false); - rms_file_fread(file); - rms_file_get_dims(file , dims); - size = dims[0] * dims[1] * dims[2] ; - - util_alloc_file_components(rms_file , NULL , &rms_base_file , NULL); - { - float * ecl_data = malloc(size * sizeof * ecl_data); - int tag_index; - for (tag_index = 0; tag_index < vector_get_size( file->tag_list ); tag_index++) { - rms_tag_type * rms_tag = vector_iget( file->tag_list , tag_index ); - - if (rms_tag_name_eq(rms_tag , "parameter" , NULL , NULL)) { - rms_tagkey_type * rms_tagkey = rms_tag_get_datakey(rms_tag); - const float * data = rms_tagkey_get_data_ref(rms_tagkey); - rms_util_set_fortran_data(ecl_data , data , sizeof * ecl_data , dims[0] , dims[1] , dims[2]); - - { - float rms_undef = -999; - float ecl_undef = 0; - rms_util_translate_undef(ecl_data , size , rms_tagkey_get_sizeof_ctype(rms_tagkey) , &rms_undef , &ecl_undef); - } - - { - const char * tagname = rms_tag_get_namekey_name(rms_tag); - char * ecl_base = malloc(4 + strlen(tagname) + 2); - char * ecl_file; - - sprintf(ecl_base , "%s_%04d" , tagname , ecl_file_nr); - ecl_file = util_alloc_filename(ecl_path , ecl_base , NULL); - if (util_same_file(ecl_file , rms_file)) { - fprintf(stderr,"%s: attempt to overwrite %s -> %s - aborting \n",__func__ , rms_file , ecl_file); - abort(); - } - - ecl_kw_fwrite_param(ecl_file , ecl_fmt_file , tagname , ECL_FLOAT_TYPE , size , ecl_data); - free(ecl_base); - free(ecl_file); - - } - } - } - free(ecl_data); - } - free(rms_base_file); -} - - - -bool rms_file_is_roff(FILE * stream) { - const int len = strlen(rms_comment1); - char *header = malloc(strlen(rms_comment1) + 1); - const long int current_pos = util_ftell(stream); - bool roff_file = false; - - util_fseek(stream , 1 + 1 + 8 , SEEK_CUR); /* Skipping #roff-bin#0# WILL Fail with formatted files */ - rms_util_fread_string(header , len+1 , stream); - if (strncmp(rms_comment1 , header , len) == 0) - roff_file = true; - - util_fseek(stream , current_pos , SEEK_SET); - free(header); - return roff_file; -} - - -/*****************************************************************/ -/* Old hack version: */ - - -void old_rms_roff_load(const char *filename , const char *param_name , float *param) { - const int offset = 327 + strlen(param_name); - int n_read; - int size; - FILE *stream = fopen(filename , "r"); - - util_fseek(stream , offset , SEEK_SET); - fread(&size , 1 , sizeof size , stream); - n_read = fread(param , sizeof *param , size , stream); - - fclose(stream); - if (n_read != size) { - fprintf(stderr,"%s: wanted:%d elements - only read:%d - aborting \n",__func__, size , n_read); - abort(); - } -} diff --git a/ThirdParty/Ert/librms/src/rms_stats.c b/ThirdParty/Ert/librms/src/rms_stats.c deleted file mode 100644 index 0de7946029..0000000000 --- a/ThirdParty/Ert/librms/src/rms_stats.c +++ /dev/null @@ -1,143 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rms_stats.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include - -#include -#include -#include -#include - - - - - -void rms_stats_mean_std(rms_tagkey_type * mean , rms_tagkey_type * std , const char *parameter_name , int files , const char **filelist , bool log_transform) { - int filenr; - double norm = 1.0 / files; - - rms_tagkey_clear(mean); - rms_tagkey_clear(std); - - - printf("Loading: "); - for (filenr = 0; filenr < files; filenr++) { - printf("%s",filelist[filenr]); fflush(stdout); - { - rms_file_type *rms_file = rms_file_alloc(filelist[filenr] , false); - rms_tagkey_type * file_tag = rms_file_fread_alloc_data_tagkey(rms_file, "parameter" , "name" , parameter_name); - - if (log_transform) - rms_tagkey_inplace_log10(file_tag); - - rms_tagkey_inplace_add_scaled(mean , file_tag , norm); - rms_tagkey_inplace_sqr(file_tag); - rms_tagkey_inplace_add_scaled(std , file_tag , norm); - rms_tagkey_free(file_tag); - - rms_file_free(rms_file); - } - { - int j; - for (j = 0; j < strlen(filelist[filenr]); j++) fputc('\b' , stdout); - } - } - printf("\n"); - - { - rms_tagkey_type * mean2; - mean2 = rms_tagkey_copyc(mean); - rms_tagkey_inplace_sqr(mean2); - - rms_tagkey_inplace_add_scaled(std , mean2 , -1.0); - rms_tagkey_inplace_sqrt(std); - rms_tagkey_free(mean2); - } -} - - - -void rms_stats_update_ens(const char *prior_path , const char *posterior_path , const char **file_list , const char *param_name , int ens_size , const double **X) { - int iens , j; - rms_tagkey_type ** prior; - rms_tagkey_type * post ; - rms_tag_type * dim_tag = NULL; - - if (!util_is_directory(posterior_path)) { - fprintf(stderr,"%s: posterior_path:%s does not exist - aborting \n",__func__ , posterior_path); - abort(); - } - - prior = malloc(ens_size * sizeof * prior); - printf("Loading: "); - for (iens = 0; iens < ens_size; iens++) { - char * file_name = util_alloc_filename(prior_path , file_list[iens] , NULL); - printf("%s",file_name); fflush(stdout); - { - rms_file_type * rms_file = rms_file_alloc(file_name , false); - prior[iens] = rms_file_fread_alloc_data_tagkey(rms_file , "parameter" , "name" , param_name); - - if (iens == 0) - dim_tag = rms_file_fread_alloc_tag(rms_file , "dimensions" , NULL , NULL); - - rms_file_free(rms_file); - } - for (j = 0; j < strlen(file_name); j++) fputc('\b' , stdout); - - - free(file_name); - } - printf("\n"); - - printf("Writing: "); - post = rms_tagkey_copyc(prior[0]); - for (iens = 0; iens < ens_size; iens++) { - rms_tagkey_clear(post); - - for (j=0; j < iens; j++) - rms_tagkey_inplace_add_scaled(post , prior[j] , X[iens][j]); - - { - char * file_name = util_alloc_filename(posterior_path , file_list[iens] , NULL); - rms_file_type *file = rms_file_alloc(file_name , false); - FILE *stream = rms_file_fopen_w(file); - - printf("%s",file_name); fflush(stdout); - rms_file_init_fwrite(file , "parameter"); - rms_tag_fwrite(dim_tag , stream); - rms_tag_fwrite_parameter(param_name , post , stream); - rms_file_complete_fwrite(file); - fclose(stream); - rms_file_free(file); - - for (j = 0; j < strlen(file_name); j++) fputc('\b' , stdout); - free(file_name); - } - } - printf("\n"); - - rms_tag_free(dim_tag); - rms_tagkey_free(post); - for (iens = 0; iens < ens_size; iens++) - rms_tagkey_free(prior[iens]); - free(prior); -} - diff --git a/ThirdParty/Ert/librms/src/rms_tag.c b/ThirdParty/Ert/librms/src/rms_tag.c deleted file mode 100644 index 078fc859df..0000000000 --- a/ThirdParty/Ert/librms/src/rms_tag.c +++ /dev/null @@ -1,315 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rms_tag.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -static const char * rms_eof_tag = "eof"; -static const char * rms_starttag_string = "tag"; -static const char * rms_endtag_string = "endtag"; - - -#define SHARED 0 -#define OWNED_REF 1 -#define COPY 2 - -#define RMS_TAG_TYPE_ID 4431296 - -struct rms_tag_struct { - UTIL_TYPE_ID_DECLARATION; - char * name; - vector_type * key_list; - hash_type * key_hash; /* Hash of tagkey instances */ -}; - -/*****************************************************************/ - - -rms_tag_type * rms_tag_alloc(const char * name) { - rms_tag_type *tag = malloc(sizeof *tag); - UTIL_TYPE_ID_INIT( tag , RMS_TAG_TYPE_ID ) - tag->name = NULL; - tag->key_hash = hash_alloc(); - tag->key_list = vector_alloc_new(); - if (name != NULL) - tag->name = util_alloc_string_copy(name); - return tag; -} - - -static UTIL_SAFE_CAST_FUNCTION( rms_tag , RMS_TAG_TYPE_ID ) - - -void rms_tag_free(rms_tag_type *tag) { - free(tag->name); - hash_free(tag->key_hash); - vector_free(tag->key_list); - free(tag); -} - -void rms_tag_free__(void * arg) { - rms_tag_type * tag = rms_tag_safe_cast( arg ); - rms_tag_free( tag ); -} - - -const char * rms_tag_get_name(const rms_tag_type *tag) { - return tag->name; -} - - - -/*static*/ -void rms_tag_fread_header(rms_tag_type *tag , FILE *stream , bool *eof_tag) { - char *buffer; - *eof_tag = false; - buffer = util_calloc( 4 , sizeof * buffer); - if (rms_util_fread_string(buffer , 4 , stream )) { - if (strcmp(buffer , rms_starttag_string) == 0) { - /* OK */ - { - char *tmp = util_calloc( rms_util_fread_strlen(stream) + 1 , sizeof * tmp); - rms_util_fread_string(tmp , 0 , stream); - tag->name = tmp; - if (strcmp(tag->name , rms_eof_tag) == 0) - *eof_tag = true; - } - } else - util_abort("%s: not at tag - header aborting \n",__func__); - } else - util_abort("%s: not at tag - header aborting \n",__func__); - - free(buffer); -} - - - -/** - This function does a "two-level" comparison. - - 1. tag->name is compared with tagname. - 2. Iff test number one succeeds we go further to step2. The second will always suceed if tagkey_name == NULL. - -*/ - -bool rms_tag_name_eq(const rms_tag_type *tag , const char * tagname , const char *tagkey_name , const char *keyvalue) { - bool eq = false; - if (strcmp(tag->name , tagname) == 0) { - if (tagkey_name != NULL && keyvalue != NULL) { - if (hash_has_key(tag->key_hash , tagkey_name)) { - const rms_tagkey_type *tagkey = hash_get(tag->key_hash , tagkey_name); - eq = rms_tagkey_char_eq(tagkey , keyvalue); - } - } else - eq = true; - } - return eq; -} - - - - -rms_tagkey_type * rms_tag_get_key(const rms_tag_type *tag , const char *keyname) { - if (hash_has_key(tag->key_hash , keyname)) - return hash_get(tag->key_hash, keyname); - else - return NULL; -} - - -rms_tagkey_type * rms_tag_get_datakey(const rms_tag_type *tag) { - return rms_tag_get_key(tag , "data"); -} - - -const char * rms_tag_get_namekey_name(const rms_tag_type * tag) { - rms_tagkey_type * name_key = rms_tag_get_key(tag , "name"); - if (name_key == NULL) - util_abort("%s: no name tagkey defined for this tag - aborting \n",__func__); - - return rms_tagkey_get_data_ref(name_key); -} - - -int rms_tag_get_datakey_sizeof_ctype(const rms_tag_type * tag) { - rms_tagkey_type * data_key = rms_tag_get_key(tag , "data"); - if (data_key == NULL) - util_abort("%s: no data tagkey defined for this tag - aborting \n",__func__); - - return rms_tagkey_get_sizeof_ctype(data_key); -} - - - - - -void rms_tag_add_tagkey(rms_tag_type *tag , const rms_tagkey_type *tagkey, int mem_mode) { - rms_tagkey_type * tagkey_copy; - - switch (mem_mode) { - case(COPY): - tagkey_copy = rms_tagkey_copyc(tagkey); - vector_append_owned_ref( tag->key_list , tagkey_copy , rms_tagkey_free_ ); - hash_insert_ref(tag->key_hash , rms_tagkey_get_name(tagkey_copy) , tagkey_copy); - break; - case(OWNED_REF): - vector_append_owned_ref( tag->key_list , tagkey , rms_tagkey_free_ ); - hash_insert_ref(tag->key_hash , rms_tagkey_get_name(tagkey) , tagkey); - break; - case(SHARED): - vector_append_ref( tag->key_list , tagkey ); - hash_insert_ref(tag->key_hash , rms_tagkey_get_name(tagkey) , tagkey); - break; - } -} - - - -static bool rms_tag_at_endtag(FILE *stream) { - const int init_pos = util_ftell(stream); - bool at_endtag; - char tag[7]; - if (rms_util_fread_string(tag , 7 , stream)) { - if (strcmp(tag , rms_endtag_string) == 0) - at_endtag = true; - else - at_endtag = false; - } else - at_endtag = false; - - if (!at_endtag) - util_fseek(stream , init_pos , SEEK_SET); - return at_endtag; -} - - -void rms_fread_tag(rms_tag_type *tag, FILE *stream , hash_type *type_map , bool endian_convert , bool *at_eof) { - rms_tag_fread_header(tag , stream , at_eof); - if (!*at_eof) { - while (! rms_tag_at_endtag(stream)) { - rms_tagkey_type *tagkey = rms_tagkey_alloc_empty(endian_convert); - rms_tagkey_load(tagkey , endian_convert , stream , type_map); - rms_tag_add_tagkey(tag , tagkey , COPY); - rms_tagkey_free(tagkey); - } - } -} - - - -rms_tag_type * rms_tag_fread_alloc(FILE *stream , hash_type *type_map , bool endian_convert , bool *at_eof) { - rms_tag_type *tag = rms_tag_alloc(NULL); - rms_fread_tag(tag , stream , type_map , endian_convert , at_eof); - return tag; -} - - - -void rms_tag_fwrite(const rms_tag_type * tag , FILE * stream) { - rms_util_fwrite_string("tag" , stream); - rms_util_fwrite_string(tag->name , stream); - { - - int i; - for (i=0; i < vector_get_size( tag->key_list ); i++) { - const rms_tagkey_type * tagkey = vector_iget_const( tag->key_list , i ); - rms_tagkey_fwrite( tagkey , stream); - } - - } - rms_util_fwrite_string("endtag" , stream); -} - - -void rms_tag_fprintf(const rms_tag_type * tag , FILE * stream) { - fprintf(stream , " <%s>\n",tag->name); - { - - int i; - for (i=0; i < vector_get_size( tag->key_list ); i++) { - const rms_tagkey_type * tagkey = vector_iget_const( tag->key_list , i ); - rms_tagkey_fprintf( tagkey , stream); - } - - } - fprintf(stream , " \n",tag->name); -} - - -void rms_tag_fwrite_eof(FILE *stream) { - rms_tag_type * tag = rms_tag_alloc("eof"); - rms_tag_fwrite(tag , stream); - rms_tag_free(tag); -} - - -void rms_tag_fwrite_filedata(const char * filetype, FILE *stream) { - rms_tag_type * tag = rms_tag_alloc("filedata"); - - rms_tag_add_tagkey(tag , rms_tagkey_alloc_byteswap() , OWNED_REF); - rms_tag_add_tagkey(tag , rms_tagkey_alloc_filetype(filetype) , OWNED_REF); - rms_tag_add_tagkey(tag , rms_tagkey_alloc_creationDate() , OWNED_REF); - - rms_tag_fwrite(tag , stream); - rms_tag_free(tag); -} - - -rms_tag_type * rms_tag_alloc_dimensions(int nX , int nY , int nZ) { - rms_tag_type * tag = rms_tag_alloc("dimensions"); - - rms_tag_add_tagkey(tag , rms_tagkey_alloc_dim("nX", nX) , OWNED_REF); - rms_tag_add_tagkey(tag , rms_tagkey_alloc_dim("nY", nY) , OWNED_REF); - rms_tag_add_tagkey(tag , rms_tagkey_alloc_dim("nZ", nZ) , OWNED_REF); - - return tag; -} - - -void rms_tag_fwrite_dimensions(int nX , int nY , int nZ , FILE *stream) { - rms_tag_type * tag = rms_tag_alloc_dimensions(nX , nY , nZ); - rms_tag_fwrite(tag , stream); - rms_tag_free(tag); -} - - -void rms_tag_fwrite_parameter(const char *param_name , const rms_tagkey_type *data_key, FILE *stream) { - rms_tag_type * tag = rms_tag_alloc("parameter"); - - rms_tag_add_tagkey(tag , rms_tagkey_alloc_parameter_name(param_name) , OWNED_REF); - rms_tag_add_tagkey(tag , data_key , SHARED); - rms_tag_fwrite(tag , stream); - rms_tag_free(tag); - -} - - -const char *rms_tag_name_ref(const rms_tag_type * tag) { - return tag->name; -} - - diff --git a/ThirdParty/Ert/librms/src/rms_tagkey.c b/ThirdParty/Ert/librms/src/rms_tagkey.c deleted file mode 100644 index 3e0fb2ccd1..0000000000 --- a/ThirdParty/Ert/librms/src/rms_tagkey.c +++ /dev/null @@ -1,718 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rms_tagkey.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -static const char * rms_array_string = "array"; - -static const char rms_type_names[6][7] = {{"char\0"}, - {"float\0"}, - {"double\0"}, - {"bool\0"}, - {"byte\0"}, - {"int\0"}}; - -static const int rms_type_size[6] = {1 , 4 , 8 , 1 , 1 , 4}; /* */ - - -struct rms_tagkey_struct { - int size; - int sizeof_ctype; - int data_size; - int alloc_size; - rms_type_enum rms_type; - char *name; - void *data; - bool endian_convert; - bool shared_data; -}; - - -/*****************************************************************/ - - - -/*****************************************************************/ - - -static void rms_tagkey_assert_fnum(const rms_tagkey_type * tagkey) { - if (!(tagkey->rms_type == rms_float_type || tagkey->rms_type == rms_double_type)) { - fprintf(stderr,"%s: tried to perform numerical operataion on rms_type: %s invalid/not implemented\n",__func__ , rms_type_names[tagkey->rms_type]); - abort(); - } -} - -static void rms_tagkey_assert_fnum2(const rms_tagkey_type * tagkey1 , const rms_tagkey_type *tagkey2) { - rms_tagkey_assert_fnum(tagkey1); - rms_tagkey_assert_fnum(tagkey2); - if (tagkey1->size != tagkey2->size || tagkey1->rms_type != tagkey2->rms_type) { - fprintf(stderr,"%s: tried to combine tagkey with different size/type - aborting \n",__func__); - abort(); - } -} - - -void rms_tagkey_clear(rms_tagkey_type * tagkey) { - int i; - rms_tagkey_assert_fnum(tagkey); - switch (tagkey->rms_type) { - case(rms_double_type): - { - double *tmp = (double *) tagkey->data; - for (i=0; i < tagkey->size; i++) - tmp[i] = 0; - } - break; - case(rms_float_type): - { - float *tmp = (float *) tagkey->data; - for (i=0; i < tagkey->size; i++) - tmp[i] = 0; - } - break; - default: - fprintf(stderr,"%s: only implemented for rms_double_type and rms_float_type - aborting \n",__func__); - abort(); - } -} - - -void rms_tagkey_apply(rms_tagkey_type * tagkey , double (f) (double)) { -int i; - rms_tagkey_assert_fnum(tagkey); - switch (tagkey->rms_type) { - case(rms_double_type): - { - double *tmp = (double *) tagkey->data; - for (i=0; i < tagkey->size; i++) - tmp[i] = f(tmp[i]); - } - break; - - case(rms_float_type): - { - float *tmp = (float *) tagkey->data; - for (i=0; i < tagkey->size; i++) - tmp[i] = f(tmp[i]); - } - break; - - default: - fprintf(stderr,"%s: only implemented for rms_double_type and rms_float_type - aborting \n",__func__); - abort(); - } -} - - -void rms_tagkey_inplace_sqr(rms_tagkey_type * tagkey) { - int i; - rms_tagkey_assert_fnum(tagkey); - switch (tagkey->rms_type) { - case(rms_double_type): - { - double *tmp = (double *) tagkey->data; - for (i=0; i < tagkey->size; i++) - tmp[i] *= tmp[i]; - } - break; - - case(rms_float_type): - { - float *tmp = (float *) tagkey->data; - for (i=0; i < tagkey->size; i++) - tmp[i] *= tmp[i]; - } - break; - - default: - fprintf(stderr,"%s: only implemented for rms_double_type and rms_float_type - aborting \n",__func__); - abort(); - } -} - - -void rms_tagkey_assign(rms_tagkey_type * new, const rms_tagkey_type *src) { - memcpy(new->data , src->data , new->size * new->sizeof_ctype); -} - - -void rms_tagkey_inplace_log10(rms_tagkey_type * tagkey) { - int i; - rms_tagkey_assert_fnum(tagkey); - switch (tagkey->rms_type) { - case(rms_double_type): - { - double *tmp = (double *) tagkey->data; - for (i=0; i < tagkey->size; i++) - tmp[i] = log10(tmp[i]); - } - break; - - case(rms_float_type): - { - float *tmp = (float *) tagkey->data; - for (i=0; i < tagkey->size; i++) - tmp[i] = log10(tmp[i]); - } - break; - - default: - fprintf(stderr,"%s: only implemented for rms_double_type and rms_float_type - aborting \n",__func__); - abort(); - } -} - - -void rms_tagkey_inplace_sqrt(rms_tagkey_type * tagkey) { - int i; - rms_tagkey_assert_fnum(tagkey); - switch (tagkey->rms_type) { - case(rms_double_type): - { - double *tmp = (double *) tagkey->data; - for (i=0; i < tagkey->size; i++) - tmp[i] = sqrt(util_double_max(0.0 , tmp[i])); - } - break; - - case(rms_float_type): - { - float *tmp = (float *) tagkey->data; - for (i=0; i < tagkey->size; i++) - tmp[i] = sqrtf(util_float_max(0.0 , tmp[i])); - } - break; - - default: - fprintf(stderr,"%s: only implemented for rms_double_type and rms_float_type - aborting \n",__func__); - abort(); - } -} - - -void rms_tagkey_scale(rms_tagkey_type * tagkey , double scale_factor) { - int i; - rms_tagkey_assert_fnum(tagkey); - switch (tagkey->rms_type) { - case(rms_double_type): - { - double *tmp = (double *) tagkey->data; - for (i=0; i < tagkey->size; i++) - tmp[i] *= scale_factor; - } - break; - - case(rms_float_type): - { - float *tmp = (float *) tagkey->data; - for (i=0; i < tagkey->size; i++) - tmp[i] *= scale_factor; - } - break; - - default: - fprintf(stderr,"%s: only implemented for rms_double_type and rms_float_type - aborting \n",__func__); - abort(); - } -} - - -void rms_tagkey_inplace_add(rms_tagkey_type * tagkey , const rms_tagkey_type *delta) { - int i; - rms_tagkey_assert_fnum2(tagkey , delta); - switch (tagkey->rms_type) { - case(rms_double_type): - { - double *tmp1 = (double *) tagkey->data; - const double *tmp2 = (const double *) delta->data; - for (i=0; i < tagkey->size; i++) - tmp1[i] += tmp2[i]; - } - break; - - case(rms_float_type): - { - float *tmp1 = (float *) tagkey->data; - const float *tmp2 = (const float *) delta->data; - for (i=0; i < tagkey->size; i++) - tmp1[i] += tmp2[i]; - } - break; - - default: - fprintf(stderr,"%s: only implemented for rms_double_type and rms_float_type - aborting \n",__func__); - abort(); - } -} - - -void rms_tagkey_inplace_add_scaled(rms_tagkey_type * tagkey , const rms_tagkey_type *delta, double factor) { - int i; - rms_tagkey_assert_fnum2(tagkey , delta); - switch (tagkey->rms_type) { - case(rms_double_type): - { - double *tmp1 = (double *) tagkey->data; - const double *tmp2 = (const double *) delta->data; - for (i=0; i < tagkey->size; i++) - tmp1[i] += tmp2[i] * factor; - } - break; - - case(rms_float_type): - { - float *tmp1 = (float *) tagkey->data; - const float *tmp2 = (const float *) delta->data; - for (i=0; i < tagkey->size; i++) - tmp1[i] += tmp2[i] * factor; - } - break; - - default: - fprintf(stderr,"%s: only implemented for rms_double_type and rms_float_type - aborting \n",__func__); - abort(); - } -} - - -void rms_tagkey_inplace_mul(rms_tagkey_type * tagkey , const rms_tagkey_type *delta) { - int i; - rms_tagkey_assert_fnum2(tagkey , delta); - switch (tagkey->rms_type) { - case(rms_double_type): - { - double *tmp1 = (double *) tagkey->data; - const double *tmp2 = (const double *) delta->data; - for (i=0; i < tagkey->size; i++) - tmp1[i] *= tmp2[i]; - } - break; - - case(rms_float_type): - { - float *tmp1 = (float *) tagkey->data; - const float *tmp2 = (const float *) delta->data; - for (i=0; i < tagkey->size; i++) - tmp1[i] *= tmp2[i]; - } - break; - - default: - fprintf(stderr,"%s: only implemented for rms_double_type and rms_float_type - aborting \n",__func__); - abort(); - } -} - - -#define TAGKEY_MAX_MIN(type) \ -{ \ - type * data = rms_tagkey_get_data_ref(tagkey); \ - type max = -data[0]; \ - type min = data[0]; \ - int i; \ - for (i=1; i < tagkey->size; i++) \ - util_update_ ## type ## _max_min(data[i] , &max , &min); \ - memcpy(_max , &max , tagkey->sizeof_ctype); \ - memcpy(_min , &min , tagkey->sizeof_ctype); \ -} - - - -void rms_tagkey_max_min(const rms_tagkey_type * tagkey , void * _max , void *_min) { - switch (tagkey->rms_type) { - case(rms_float_type): - TAGKEY_MAX_MIN(float); - break; - case(rms_double_type): - TAGKEY_MAX_MIN(double); - break; - case(rms_int_type): - TAGKEY_MAX_MIN(int); - break; - default: - fprintf(stderr,"%s: invalid type for element sum \n",__func__); - abort(); - } -} - -#undef TAGKEY_MAX_MIN - - - - - -void rms_tagkey_free_(void *_tagkey) { - rms_tagkey_type * tagkey = (rms_tagkey_type *) _tagkey; - rms_tagkey_free(tagkey); -} - - -static void rms_tagkey_alloc_data(rms_tagkey_type *tagkey) { - if (!tagkey->shared_data) { - - if (tagkey->data_size > tagkey->alloc_size) { - void *tmp = realloc(tagkey->data , tagkey->data_size); - if (tmp == NULL) { - fprintf(stderr,"%s: failed to allocate: %d bytes of storage - aborting \n",__func__ , tagkey->data_size); - abort(); - } - tagkey->data = tmp; - tagkey->alloc_size = tagkey->data_size; - - } - } -} - - - - -rms_tagkey_type * rms_tagkey_copyc(const rms_tagkey_type *tagkey) { - rms_tagkey_type *new_tagkey = rms_tagkey_alloc_empty(tagkey->endian_convert); - - new_tagkey->alloc_size = 0; - new_tagkey->size = tagkey->size; - new_tagkey->sizeof_ctype = tagkey->sizeof_ctype; - new_tagkey->data_size = tagkey->data_size; - new_tagkey->rms_type = tagkey->rms_type; - new_tagkey->data = NULL; - new_tagkey->shared_data = tagkey->shared_data; - - rms_tagkey_alloc_data(new_tagkey); - memcpy(new_tagkey->data , tagkey->data , tagkey->data_size); - new_tagkey->name = util_alloc_string_copy(tagkey->name); - return new_tagkey; -} - - -void * rms_tagkey_copyc_(const void * _tagkey) { - const rms_tagkey_type * tagkey = (const rms_tagkey_type *) _tagkey; - return rms_tagkey_copyc(tagkey); -} - - -static void rms_tagkey_set_data_size(rms_tagkey_type *tagkey , FILE *stream , int strlen) { - - if (tagkey->rms_type == rms_char_type) { - if (stream != NULL) { - const long int init_pos = util_ftell(stream); - int i; - for (i=0; i < tagkey->size; i++) - rms_util_fskip_string(stream); - tagkey->data_size = util_ftell(stream) - init_pos; - util_fseek(stream , init_pos , SEEK_SET); - } else - tagkey->data_size = strlen + 1; - } else - tagkey->data_size = tagkey->size * tagkey->sizeof_ctype; -} - - - -static void rms_tagkey_fread_data(rms_tagkey_type *tagkey , bool endian_convert , FILE *stream) { - if (tagkey->alloc_size < tagkey->data_size) { - fprintf(stderr,"%s: fatal error buffer to small - aborting \n",__func__); - abort(); - } - - int bytes_read = fread(tagkey->data , 1 , tagkey->data_size , stream); - if (bytes_read != tagkey->data_size) { - fprintf(stderr,"%s: failed to read %d bytes - premature EOF? \n",__func__ , tagkey->data_size); - fprintf(stderr,"%s: tagkey: %s \n",__func__ , tagkey->name); - abort(); - } - if (endian_convert) - if (tagkey->sizeof_ctype > 1) - util_endian_flip_vector(tagkey->data , tagkey->sizeof_ctype , tagkey->size); -} - -void rms_tagkey_manual_realloc_data(rms_tagkey_type * tagkey , int data_size) { - tagkey->data_size = data_size; - rms_tagkey_alloc_data(tagkey); -} - -void rms_tagkey_set_data(rms_tagkey_type * tagkey , const void * data) { - if (tagkey->shared_data) - tagkey->data = (void *) data; - else - memcpy(tagkey->data , data , tagkey->data_size); -} - - - - -static void rms_fread_tagkey_header(rms_tagkey_type *tagkey , FILE *stream, hash_type *type_map) { - bool is_array; - char type_string[7]; - - rms_util_fread_string(type_string , 7 , stream); - if (strcmp(type_string , rms_array_string) == 0) { - is_array = true; - rms_util_fread_string(type_string , 7 , stream); - } else - is_array = false; - - { - __rms_type * rms_t = hash_get(type_map , type_string); - tagkey->rms_type = rms_t->rms_type; - tagkey->sizeof_ctype = rms_t->sizeof_ctype; - } - - tagkey->name = realloc(tagkey->name , rms_util_fread_strlen(stream) + 1); - - rms_util_fread_string(tagkey->name , 0 , stream); - if (is_array) - fread(&tagkey->size , 1 , sizeof tagkey->size, stream); - else - tagkey->size = 1; - rms_tagkey_set_data_size(tagkey , stream , -1); -} - - - -static void rms_fread_realloc_tagkey(rms_tagkey_type *tagkey , bool endian_convert , FILE *stream , hash_type *type_map) { - - rms_fread_tagkey_header(tagkey , stream , type_map); - rms_tagkey_alloc_data(tagkey); - rms_tagkey_fread_data(tagkey , endian_convert , stream); - -} - - - -static void rms_tagkey_fwrite_data(const rms_tagkey_type * tagkey , FILE *stream) { - int elm = fwrite(tagkey->data , 1 , tagkey->data_size , stream); - if (elm != tagkey->data_size) { - fprintf(stderr,"%s: failed to write %d bytes to file [tagkey:%s] - aborting \n",__func__ , tagkey->data_size , tagkey->name); - abort(); - } -} - - -void rms_tagkey_fwrite(const rms_tagkey_type * tagkey , FILE *stream) { - if (tagkey->size > 1) - rms_util_fwrite_string("array" , stream); - rms_util_fwrite_string(rms_type_names[tagkey->rms_type] , stream); - rms_util_fwrite_string(tagkey->name , stream); - if (tagkey->size > 1) { - fwrite(&tagkey->size , sizeof tagkey->size , 1 , stream); - rms_util_fwrite_newline(stream); - } - rms_tagkey_fwrite_data(tagkey , stream); -} - -void rms_tagkey_fprintf(const rms_tagkey_type * tagkey, FILE *stream) { - fprintf(stream," <%s> %6d %s",tagkey->name , tagkey->size , rms_type_names[tagkey->rms_type]); - if (tagkey->size == 1) { - if (tagkey->rms_type == rms_int_type) - fprintf(stream, " = %d ",(( int *) tagkey->data)[0]); - else if (tagkey->rms_type == rms_char_type) - fprintf(stream, " = %s ",( char *) tagkey->data); - } - fprintf(stream,"\n"); -} - - -const char * rms_tagkey_get_name(const rms_tagkey_type *tagkey) { - return tagkey->name; -} - -void * rms_tagkey_get_data_ref(const rms_tagkey_type *tagkey) { - return tagkey->data; -} - - -void rms_tagkey_load(rms_tagkey_type *tagkey , bool endian_convert , FILE *stream, hash_type *type_map) { - rms_fread_realloc_tagkey(tagkey , endian_convert , stream , type_map); -} - - -bool rms_tagkey_char_eq(const rms_tagkey_type *tagkey , const char *keyvalue) { - bool eq = false; - if (tagkey->rms_type == rms_char_type) { - if (strcmp(keyvalue , tagkey->data) == 0) - eq = true; - } - return eq; -} - - -rms_tagkey_type * rms_tagkey_alloc_empty(bool endian_convert) { - - rms_tagkey_type *tagkey = malloc(sizeof *tagkey); - tagkey->alloc_size = 0; - tagkey->data_size = 0; - tagkey->size = 0; - tagkey->name = NULL; - tagkey->data = NULL; - tagkey->endian_convert = endian_convert; - tagkey->shared_data = false; - - return tagkey; - -} - - -static rms_tagkey_type * rms_tagkey_alloc_initialized(const char * name , int size , rms_type_enum rms_type , bool endian_convert) { - rms_tagkey_type *tagkey = rms_tagkey_alloc_empty(endian_convert); - tagkey->size = size; - tagkey->rms_type = rms_type; - tagkey->sizeof_ctype = rms_type_size[rms_type]; - tagkey->data_size = tagkey->size * tagkey->sizeof_ctype; - tagkey->name = util_alloc_string_copy(name); - return tagkey; -} - - -rms_tagkey_type * rms_tagkey_alloc_complete(const char * name , int size , rms_type_enum rms_type , const void * data , bool shared_data) { - rms_tagkey_type * tag = rms_tagkey_alloc_initialized(name , size , rms_type , false); - tag->shared_data = shared_data; - - rms_tagkey_alloc_data(tag); - rms_tagkey_set_data(tag , data); - - return tag; -} - - -int rms_tagkey_get_sizeof_ctype(const rms_tagkey_type * key) { - return key->sizeof_ctype; -} - - -rms_type_enum rms_tagkey_get_rms_type(const rms_tagkey_type * key) { - return key->rms_type; -} - - -ecl_type_enum rms_tagkey_get_ecl_type(const rms_tagkey_type * key) { - ecl_type_enum ecl_type; - switch (key->rms_type) { - case(rms_float_type): - ecl_type = ECL_FLOAT_TYPE; - break; - case(rms_double_type): - ecl_type = ECL_DOUBLE_TYPE; - break; - case(rms_int_type): - ecl_type = ECL_INT_TYPE; - break; - default: - fprintf(stderr,"%s: sorry rms_type: %d not implemented - aborting \n",__func__ , key->rms_type); - abort(); - } - return ecl_type; -} - - - - -void rms_tagkey_free(rms_tagkey_type *tagkey) { - if (tagkey->name != NULL) free(tagkey->name); - - if (!tagkey->shared_data) - if (tagkey->data != NULL) free(tagkey->data); - - free(tagkey); -} - - -rms_tagkey_type * rms_tagkey_alloc_byteswap() { - rms_tagkey_type *tagkey = rms_tagkey_alloc_initialized("byteswaptest" , 1 , rms_int_type , false); - rms_tagkey_alloc_data(tagkey); - ((int *) tagkey->data)[0] = 1; - return tagkey; -} - - -rms_tagkey_type * rms_tagkey_alloc_filetype(const char * filetype) { - rms_tagkey_type *tagkey = rms_tagkey_alloc_initialized("filetype" , 1 , rms_char_type , false); - rms_tagkey_set_data_size(tagkey , NULL , strlen(filetype)); - rms_tagkey_alloc_data(tagkey); - sprintf(tagkey->data , "%s" , filetype); - return tagkey; -} - - -rms_tagkey_type * rms_tagkey_alloc_parameter_name(const char * parameter_name) { - rms_tagkey_type *tagkey = rms_tagkey_alloc_initialized("name" , 1 , rms_char_type , false); - rms_tagkey_set_data_size(tagkey , NULL , strlen(parameter_name)); - rms_tagkey_alloc_data(tagkey); - sprintf(tagkey->data , "%s" , parameter_name); - return tagkey; -} - - -rms_tagkey_type * rms_tagkey_alloc_creationDate() { - const int len = strlen("08/05/2007 08:31:39"); - struct tm ts; - time_t now; - rms_tagkey_type *tagkey = rms_tagkey_alloc_initialized("creationDate" , 1 , rms_char_type , false); - - now = time(NULL); - localtime_r(&now , &ts); - - rms_tagkey_set_data_size(tagkey , NULL , len); - rms_tagkey_alloc_data(tagkey); - sprintf(tagkey->data , "%02d/%02d/%4d %02d:%02d:%02d" , - ts.tm_mday, - ts.tm_mon, - ts.tm_year + 1900, - ts.tm_hour, - ts.tm_min, - ts.tm_sec); - - return tagkey; -} - - -rms_tagkey_type * rms_tagkey_alloc_dim(const char * dim, int value) { - rms_tagkey_type *tagkey = rms_tagkey_alloc_initialized(dim , 1 , rms_int_type , false); - rms_tagkey_alloc_data(tagkey); - ((int *) tagkey->data)[0] = value; - return tagkey; -} - - -int rms_tagkey_get_size(const rms_tagkey_type * tagkey) { return tagkey->size; } - - -/** - This function will compare two tagkeys, and return true if they are - equal. If they differ in size/type/... or other fundamental ways a - false is immediately returned. -*/ - -bool rms_tagkey_cmp(const rms_tagkey_type * tagkey1 , const rms_tagkey_type * tagkey2) { - if (tagkey1->size != tagkey2->size) return false; - if (tagkey1->rms_type != tagkey2->rms_type) return false; - if (memcmp(tagkey1->data , tagkey1->data , tagkey1->size * tagkey1->sizeof_ctype) == 0) - return true; - else - return false; -} diff --git a/ThirdParty/Ert/librms/src/rms_type.c b/ThirdParty/Ert/librms/src/rms_type.c deleted file mode 100644 index 5d3e44a744..0000000000 --- a/ThirdParty/Ert/librms/src/rms_type.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rms_type.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -/*****************************************************************/ -/* A microscopic (purely internal) type object only used - for storing the hash type_map */ -/*****************************************************************/ - - - - -void rms_type_free(void *rms_t) { - free( (__rms_type *) rms_t); -} - - -static __rms_type * rms_type_set(__rms_type *rms_t , rms_type_enum rms_type , int sizeof_ctype) { - rms_t->rms_type = rms_type; - rms_t->sizeof_ctype = sizeof_ctype; - return rms_t; -} - - -__rms_type * rms_type_alloc(rms_type_enum rms_type, int sizeof_ctype) { - __rms_type *rms_t = malloc(sizeof *rms_t); - rms_type_set(rms_t , rms_type , sizeof_ctype); - return rms_t; -} - - -const void * rms_type_copyc(const void *__rms_t) { - const __rms_type *rms_t = (const __rms_type *) __rms_t; - __rms_type *new_t = rms_type_alloc(rms_t->rms_type , rms_t->sizeof_ctype); - return new_t; -} diff --git a/ThirdParty/Ert/librms/src/rms_util.c b/ThirdParty/Ert/librms/src/rms_util.c deleted file mode 100644 index 16dd6533bd..0000000000 --- a/ThirdParty/Ert/librms/src/rms_util.c +++ /dev/null @@ -1,178 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'rms_util.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - -#include - -#include - -#include - - - - -/* - This translates from the RMS data layout to "Fortan / ECLIPSE" data - layout. - - RMS: k index is running fastest *AND* backwards. - F90: i is running fastest, and k is running the 'normal' way. - - This function should be *THE ONLY* place in the code where explicit mention - is made to the RMS ordering sequence. -*/ - - -int rms_util_global_index_from_eclipse_ijk(int nx, int ny , int nz , int i , int j , int k) { - return i*ny*nz + j*nz + (nz - k - 1); -} - - - -void rms_util_set_fortran_data(void *_f90_data , const void * _rms_data, int sizeof_ctype , int nx, int ny , int nz) { - char *f90_data = (char *) _f90_data; - const char *rms_data = (const char *) _rms_data; - int i,j,k,rms_index, f90_index; - for (i=0; i < nx; i++) - for (j=0; j < ny; j++) - for (k= 0; k < nz; k++) { - rms_index = rms_util_global_index_from_eclipse_ijk(nx,ny,nz,i,j,k); - f90_index = i + j*nx + k*nx*ny; - memcpy(&f90_data[f90_index * sizeof_ctype] , &rms_data[rms_index * sizeof_ctype] , sizeof_ctype); - } -} - - - -void rms_util_read_fortran_data(const void *_f90_data , void * _rms_data, int sizeof_ctype , int nx, int ny , int nz) { - const char *f90_data = (const char *) _f90_data; - char *rms_data = (char *) _rms_data; - int i,j,k,rms_index, f90_index; - - for (i=0; i < nx; i++) - for (j=0; j < ny; j++) - for (k= 0; k < nz; k++) { - rms_index = rms_util_global_index_from_eclipse_ijk(nx,ny,nz,i,j,k); - f90_index = i + j*nx + k*nx*ny; - memcpy(&rms_data[rms_index * sizeof_ctype] , &f90_data[f90_index * sizeof_ctype] , sizeof_ctype); - } -} - - - -void rms_util_translate_undef(void * _data , int size , int sizeof_ctype , const void * old_undef , const void * new_undef) { - char * data = (char *) _data; - int i; - for (i=0; i < size; i++) { - if (memcmp( &data[i*sizeof_ctype] , old_undef , sizeof_ctype) == 0) - memcpy( &data[i*sizeof_ctype] , new_undef , sizeof_ctype); - } -} - - -void rms_util_fskip_string(FILE *stream) { - char c; - bool cont = true; - while (cont) { - fread(&c , 1 , 1 , stream); - if (c == 0) - cont = false; - } -} - - -int rms_util_fread_strlen(FILE *stream) { - long int init_pos = util_ftell(stream); - int len; - rms_util_fskip_string(stream); - len = util_ftell(stream) - init_pos; - util_fseek(stream , init_pos , SEEK_SET); - return len; -} - - -/* - max_length *includes* the trailing \0. -*/ -bool rms_util_fread_string(char *string , int max_length , FILE *stream) { - bool read_ok = true; - bool cont = true; - long int init_pos = util_ftell(stream); - int pos = 0; - while (cont) { - fread(&string[pos] , sizeof *string , 1 , stream); - if (string[pos] == 0) { - read_ok = true; - cont = false; - } else { - pos++; - if (max_length > 0) { - if (pos == max_length) { - read_ok = false; - util_fseek(stream , init_pos , SEEK_SET); - cont = false; - } - } - } - } - - return read_ok; -} - - -void rms_util_fwrite_string(const char * string , FILE *stream) { - fwrite(string , sizeof * string , strlen(string) , stream); - fputc('\0' , stream); -} - -void rms_util_fwrite_comment(const char * comment , FILE *stream) { - fputc('#' , stream); - fwrite(comment , sizeof * comment , strlen(comment) , stream); - fputc('#' , stream); - fputc('\0' , stream); -} - - -void rms_util_fwrite_newline(FILE *stream) { - return; -} - - -rms_type_enum rms_util_convert_ecl_type(ecl_type_enum ecl_type) { - rms_type_enum rms_type = rms_int_type; /* Shut up the compiler */ - switch (ecl_type) { - case(ECL_INT_TYPE): - rms_type = rms_int_type; - break; - case(ECL_FLOAT_TYPE): - rms_type = rms_float_type; - break; - case(ECL_DOUBLE_TYPE): - rms_type = rms_double_type; - break; - default: - util_abort("%s: Conversion ecl_type -> rms_type not supported for ecl_type:%s \n",__func__ , ecl_util_get_type_name(ecl_type)); - } - return rms_type; -} - - diff --git a/ThirdParty/Ert/librms/tests/CMakeLists.txt b/ThirdParty/Ert/librms/tests/CMakeLists.txt deleted file mode 100644 index 1e296b020f..0000000000 --- a/ThirdParty/Ert/librms/tests/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -if (STATOIL_TESTDATA_ROOT) - - add_executable( rms_file_test rms_file_test.c ) - target_link_libraries( rms_file_test rms test_util ) - - add_test( rms_file_test - ${EXECUTABLE_OUTPUT_PATH}/rms_file_test - ${PROJECT_SOURCE_DIR}/test-data/Statoil/config/rms_file_test/rms_file) - - set_property( TEST rms_file_test PROPERTY LABELS StatoilData ) - -endif() \ No newline at end of file diff --git a/ThirdParty/Ert/librms/tests/rms_file_test.c b/ThirdParty/Ert/librms/tests/rms_file_test.c deleted file mode 100644 index adbdc0ba1e..0000000000 --- a/ThirdParty/Ert/librms/tests/rms_file_test.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright (C) 2014 Statoil ASA, Norway. - - The file 'rms_file_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include -#include -#include -#include - -#include -#include - -#include -#include - - - -void test_rms_file_fread_alloc_data_tag(rms_file_type * rms_file) { - rms_tag_type * parameter_tag = rms_file_fread_alloc_tag(rms_file , "parameter" , NULL , NULL); - test_assert_not_NULL(parameter_tag); - test_assert_string_equal("parameter", rms_tag_get_name(parameter_tag)); - rms_tag_free(parameter_tag); -} - - -void test_rms_file_fread_alloc_data_tagkey(rms_file_type *rms_file) { - rms_tagkey_type * name_tagkey = rms_file_fread_alloc_data_tagkey(rms_file , "parameter" , NULL , NULL); - test_assert_not_NULL(name_tagkey); - test_assert_int_equal(rms_float_type, rms_tagkey_get_rms_type(name_tagkey)); - rms_tagkey_free(name_tagkey); -} - - -int main(int argc , char ** argv) { - const char * filename = argv[1]; - rms_file_type * rms_file = rms_file_alloc(filename , false); - test_assert_not_NULL(rms_file); - - test_rms_file_fread_alloc_data_tag(rms_file); - test_rms_file_fread_alloc_data_tagkey(rms_file); - - rms_file_free(rms_file); - exit(0); -} diff --git a/ThirdParty/Ert/libsched/CMakeLists.txt b/ThirdParty/Ert/libsched/CMakeLists.txt deleted file mode 100644 index 3edab07684..0000000000 --- a/ThirdParty/Ert/libsched/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -add_subdirectory( src ) -if (BUILD_APPLICATONS) - add_subdirectory( applications ) -endif() - -if (BUILD_TESTS) - add_subdirectory( tests ) -endif() diff --git a/ThirdParty/Ert/libsched/applications/CMakeLists.txt b/ThirdParty/Ert/libsched/applications/CMakeLists.txt deleted file mode 100644 index 83f41113b9..0000000000 --- a/ThirdParty/Ert/libsched/applications/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -link_directories( ${ERT_BINARY_DIR}/libsched/src ) - -include_directories( ${libutil_build_path} ) -include_directories( ${libutil_src_path} ) -include_directories( ${libsched_src_path} ) -include_directories( ${libecl_src_path} ) - -add_executable( sched_summary.x sched_summary.c ) - -set(program_list sched_summary.x) -foreach(prog ${program_list}) - target_link_libraries( ${prog} sched ecl ert_util ) - if (USE_RUNPATH) - add_runpath( ${prog} ) - endif() - #----------------------------------------------------------------- - if (SCHED_INSTALL_PREFIX) - set (destination ${SCHED_INSTALL_PREFIX}/bin) - else() - set (destination bin) - endif() - - if (INSTALL_ERT) - install(TARGETS ${prog} DESTINATION ${destination}) - if (INSTALL_GROUP) - install(CODE "EXECUTE_PROCESS(COMMAND chgrp ${INSTALL_GROUP} ${destination}/${prog})") - install(CODE "EXECUTE_PROCESS(COMMAND chmod g+w ${destination}/${prog})") - endif() - endif() -endforeach() diff --git a/ThirdParty/Ert/libsched/applications/get_well_list.c b/ThirdParty/Ert/libsched/applications/get_well_list.c deleted file mode 100644 index 1d5e9aec4e..0000000000 --- a/ThirdParty/Ert/libsched/applications/get_well_list.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'get_well_list.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include - -int main(int argc, char **argv) -{ - if(argc < 2) - { - printf("Usage: get_well_list.x my_sched_file.SCH\n"); - return 0; - } - - int num_wells; - char ** well_list; - - sched_file_type * sched_file = NULL; - history_type * history = NULL; - - - sched_file = sched_file_alloc(-1); - sched_file_parse(sched_file, -1 , argv[1]); - - - history = history_alloc_from_sched_file(sched_file); - - well_list = history_alloc_well_list(history, &num_wells); - - for(int well_nr = 0; well_nr < num_wells; well_nr++) - printf("%s\n", well_list[well_nr]); - - history_free(history); - sched_file_free(sched_file); - util_free_stringlist(well_list, num_wells); - - return 0; -} diff --git a/ThirdParty/Ert/libsched/applications/gruptree_test.c b/ThirdParty/Ert/libsched/applications/gruptree_test.c deleted file mode 100644 index 06fc7eed27..0000000000 --- a/ThirdParty/Ert/libsched/applications/gruptree_test.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'gruptree_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include - -int main() -{ - gruptree_type * gruptree = gruptree_alloc(); - gruptree_register_grup(gruptree, "INJE", "FIELD"); - gruptree_register_well(gruptree, "WI1" , "INJE"); - gruptree_register_well(gruptree, "WI2" , "INJE"); - gruptree_register_well(gruptree, "WI3" , "INJE"); - gruptree_register_well(gruptree, "WI4" , "INJE"); - - gruptree_register_grup(gruptree, "PLATA", "FIELD"); - gruptree_register_grup(gruptree, "INJE", "PLATA"); - gruptree_register_grup(gruptree, "PROD", "PLATA"); - gruptree_register_well(gruptree, "WP1", "PROD"); - gruptree_register_well(gruptree, "WP2", "PROD"); - gruptree_register_well(gruptree, "WP3", "PROD"); - gruptree_register_well(gruptree, "WP4", "PROD"); - gruptree_register_well(gruptree, "WP5", "PROD"); - - gruptree_register_grup(gruptree, "PLATB", "FIELD"); - gruptree_register_well(gruptree, "WPB1", "PLATB"); - - gruptree_printf_grup_wells(gruptree, "FIELD"); - gruptree_printf_grup_wells(gruptree, "PLATA"); - gruptree_printf_grup_wells(gruptree, "PLATB"); - gruptree_printf_grup_wells(gruptree, "INJE"); - gruptree_printf_grup_wells(gruptree, "PROD"); - - printf("Letting PLATB be a subgroup of PLATA.\n"); - gruptree_register_grup(gruptree, "PLATB", "PLATA"); - gruptree_register_well(gruptree, "SVADA", "FIELD"); - - gruptree_printf_grup_wells(gruptree, "PLATA"); - gruptree_printf_grup_wells(gruptree, "FIELD"); - - printf("Trying to copy the gruptree...\n"); - gruptree_type * gruptree_cpy = gruptree_copyc(gruptree); - - printf("Freeing the old gruptree..\n"); - gruptree_free(gruptree); - - printf("Trying to access new gruptree..\n"); - gruptree_printf_grup_wells(gruptree_cpy, "FIELD"); - gruptree_printf_grup_wells(gruptree_cpy, "PLATA"); - gruptree_printf_grup_wells(gruptree_cpy, "INJE"); - - printf("Writing gruptree to disk..\n"); - FILE * stream = util_fopen("gruptree_stor.bin", "w"); - gruptree_fwrite(gruptree_cpy, stream); - - printf("Closing stream and free'ing gruptre..\n"); - fclose(stream); - gruptree_free(gruptree_cpy); - - printf("Reading gruptree from disk, hang on to yer helmet..\n"); - stream = util_fopen("gruptree_stor.bin", "r"); - gruptree = gruptree_fread_alloc(stream); - fclose(stream); - - printf("Trying to access new gruptree..\n"); - gruptree_printf_grup_wells(gruptree, "FIELD"); - gruptree_printf_grup_wells(gruptree, "PLATA"); - gruptree_printf_grup_wells(gruptree, "INJE"); - - printf("Cleaning up..\n"); - gruptree_free(gruptree); - - - return 0; -} diff --git a/ThirdParty/Ert/libsched/applications/perturb_history/group_rate.c b/ThirdParty/Ert/libsched/applications/perturb_history/group_rate.c deleted file mode 100644 index 71557b6664..0000000000 --- a/ThirdParty/Ert/libsched/applications/perturb_history/group_rate.c +++ /dev/null @@ -1,220 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'group_rate.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define GROUP_RATE_ID 6681055 - - -struct group_rate_struct { - UTIL_TYPE_ID_DECLARATION; - char * name; - bool producer; - double_vector_type * base_rate; - double_vector_type * shift; - double_vector_type * min_shift; - double_vector_type * max_shift; - stringlist_type * min_shift_string; - stringlist_type * max_shift_string; - sched_phase_enum phase; - const time_t_vector_type * time_vector; - vector_type * well_rates; - const sched_history_type * sched_history; -}; - - - -void group_rate_update_wconhist( group_rate_type * group_rate , sched_kw_wconhist_type * kw, int restart_nr ) { - int well_nr; - for (well_nr = 0; well_nr < vector_get_size( group_rate->well_rates ); well_nr++) { - well_rate_type * well_rate = vector_iget( group_rate->well_rates , well_nr ); - well_rate_update_wconhist( well_rate ,kw , restart_nr ); - } -} - - -void group_rate_update_wconinje( group_rate_type * group_rate , sched_kw_wconinje_type * kw, int restart_nr ) { - int well_nr; - for (well_nr = 0; well_nr < vector_get_size( group_rate->well_rates ); well_nr++) { - well_rate_type * well_rate = vector_iget( group_rate->well_rates , well_nr ); - well_rate_update_wconinje( well_rate ,kw , restart_nr ); - } -} - - - - - -group_rate_type * group_rate_alloc(const sched_history_type * sched_history , const time_t_vector_type * time_vector , const char * name , const char * phase , const char * type_string , const char * filename) { - group_rate_type * group_rate = util_malloc( sizeof * group_rate , __func__); - UTIL_TYPE_ID_INIT( group_rate , GROUP_RATE_ID ); - group_rate->name = util_alloc_string_copy( name ); - group_rate->time_vector = time_vector; - group_rate->shift = double_vector_alloc(0,0); - group_rate->base_rate = double_vector_alloc(0,0); - group_rate->min_shift = double_vector_alloc(0 , 0); - group_rate->max_shift = double_vector_alloc(0 , 0); - group_rate->min_shift_string = stringlist_alloc_new(); - group_rate->max_shift_string = stringlist_alloc_new(); - group_rate->phase = sched_phase_type_from_string( phase ); - group_rate->sched_history = sched_history; - { - if (strcmp( type_string , "INJECTOR") == 0) - group_rate->producer = false; - else if ( strcmp( type_string , "PRODUCER") == 0) - group_rate->producer = true; - } - - fscanf_2ts( time_vector , filename , group_rate->min_shift_string , group_rate->max_shift_string ); - group_rate->well_rates = vector_alloc_new(); - return group_rate; -} - - -void group_rate_init( group_rate_type * group_rate ) { - - for (int iw = 0; iw < vector_get_size( group_rate->well_rates ); iw++) { - const well_rate_type * well_rate = vector_iget( group_rate->well_rates , iw ); - for (int tstep = 0; tstep < well_rate_get_length( well_rate ); tstep++) - double_vector_iadd( group_rate->base_rate , tstep , well_rate_iget_rate( well_rate , tstep )); - } - - for (int i = 0; i < stringlist_get_size( group_rate->min_shift_string ); i++) { - double_vector_iset( group_rate->min_shift , i , sscanfp( double_vector_safe_iget( group_rate->base_rate , i ) , stringlist_iget( group_rate->min_shift_string , i))); - double_vector_iset( group_rate->max_shift , i , sscanfp( double_vector_safe_iget( group_rate->base_rate , i ) , stringlist_iget( group_rate->max_shift_string , i))); - } - -} - - - - - - -static UTIL_SAFE_CAST_FUNCTION( group_rate , GROUP_RATE_ID ); - -void group_rate_free( group_rate_type * group_rate ) { - free( group_rate->name ); - double_vector_free( group_rate->shift ); - double_vector_free( group_rate->base_rate ); - double_vector_free( group_rate->min_shift ); - double_vector_free( group_rate->max_shift ); - vector_free( group_rate->well_rates ); - free( group_rate ); -} - - -void group_rate_free__( void * arg ) { - group_rate_type * group_rate = group_rate_safe_cast( arg ); - group_rate_free( group_rate ); -} - - - -bool group_rate_is_producer( const group_rate_type * group_rate ) { - return group_rate->producer; -} - -sched_phase_enum group_rate_get_phase( const group_rate_type * group_rate ) { - return group_rate->phase; -} - - -const char * group_rate_get_name( const group_rate_type * group_rate ) { - return group_rate->name; -} - - -double_vector_type * group_rate_get_shift( group_rate_type * group_rate ) { - return group_rate->shift; -} - - -void group_rate_add_well_rate( group_rate_type * group_rate , well_rate_type * well_rate) { - if (well_rate_get_phase( well_rate ) == group_rate->phase) { - char * key = util_alloc_sprintf("%s:%s" , well_rate_get_name( well_rate ) , sched_phase_type_string( group_rate->phase )); - vector_append_owned_ref( group_rate->well_rates , well_rate , well_rate_free__ ); - free( key ); - } -} - - - - -void group_rate_sample( group_rate_type * group_rate ) { - int length = time_t_vector_size( group_rate->time_vector ); - double * group_shift = util_malloc( length * sizeof * group_shift , __func__); - int * well_count = util_malloc( length * sizeof * well_count , __func__); - int num_wells = vector_get_size( group_rate->well_rates ); - int i,well_nr; - - for (i = 0; i < length; i++) { - group_shift[i] = 0; - well_count[i] = 0; - } - - for (well_nr=0; well_nr < num_wells; well_nr++) { - well_rate_type * well_rate = vector_iget( group_rate->well_rates , well_nr ); - well_rate_sample_shift( well_rate ); - { - const double * well_shift = double_vector_get_ptr( well_rate_get_shift( well_rate )); - for (i = 0; i < length; i++) { - group_shift[i] += well_shift[i]; - if (well_rate_well_open( well_rate , i )) - well_count[i] += 1; - } - } - } - - { - for (i = 0; i < length; i++) { - if (group_shift[i] > double_vector_iget( group_rate->max_shift , i)) { - double adjustment = -(group_shift[i] - double_vector_iget(group_rate->max_shift , i)) / well_count[i]; - for (well_nr = 0; well_nr < num_wells; well_nr++) { - well_rate_type * well_rate = vector_iget( group_rate->well_rates , well_nr ); - well_rate_ishift( well_rate , i , adjustment ); - } - } else if (group_shift[i] < double_vector_iget( group_rate->min_shift , i )) { - double adjustment = -(group_shift[i] - double_vector_iget(group_rate->min_shift , i)) / well_count[i]; - for (well_nr = 0; well_nr < num_wells; well_nr++) { - well_rate_type * well_rate = vector_iget( group_rate->well_rates , well_nr ); - well_rate_ishift( well_rate , i , adjustment ); - } - } - } - } - - - - free( well_count ); - free( group_shift ); - -} diff --git a/ThirdParty/Ert/libsched/applications/perturb_history/group_rate.h b/ThirdParty/Ert/libsched/applications/perturb_history/group_rate.h deleted file mode 100644 index d38e899909..0000000000 --- a/ThirdParty/Ert/libsched/applications/perturb_history/group_rate.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'group_rate.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_GROUP_RATE_H -#define ERT_GROUP_RATE_H - -#include -#include -#include -#include - -typedef struct group_rate_struct group_rate_type; -group_rate_type * group_rate_alloc(const sched_history_type * sched_history , const time_t_vector_type * time_vector , const char * name , const char * phase, const char * type_string , const char * filename); -void group_rate_free__( void * arg ); -void group_rate_add_well_rate( group_rate_type * group_rate , well_rate_type * well_rate); -sched_phase_enum group_rate_get_phase( const group_rate_type * group_rate ); -void group_rate_sample( group_rate_type * group_rate ); -void group_rate_update_wconhist( group_rate_type * group_rate , sched_kw_wconhist_type * kw, int restart_nr ); -void group_rate_update_wconinje( group_rate_type * group_rate , sched_kw_wconinje_type * kw, int restart_nr ); -bool group_rate_is_producer( const group_rate_type * group_rate ); -void group_rate_init( group_rate_type * group_rate ); - -#endif diff --git a/ThirdParty/Ert/libsched/applications/perturb_history/pert.conf b/ThirdParty/Ert/libsched/applications/perturb_history/pert.conf deleted file mode 100644 index 18f71b015b..0000000000 --- a/ThirdParty/Ert/libsched/applications/perturb_history/pert.conf +++ /dev/null @@ -1,15 +0,0 @@ -DATA_FILE Example_01_base.data -SCHEDULE_FILE target.SCH -TARGET tmp/sched_%d.SCH -NUM_REALIZATIONS 100 -GROUP_RATE GROUP1 OIL PRODUCER GROUP1.min_max - -WELL_RATE GROUP1 OP_1 50 OP1.stat -WELL_RATE GROUP1 OP_2 50 OP1.stat -WELL_RATE GROUP1 OP_3 50 OP1.stat -WELL_RATE GROUP1 OP_4 50 OP1.stat -WELL_RATE GROUP1 OP_5 50 OP1.stat - - - ---GROUP_RATE GROUP WATER GROUP2.min_max diff --git a/ThirdParty/Ert/libsched/applications/perturb_history/pert_util.c b/ThirdParty/Ert/libsched/applications/perturb_history/pert_util.c deleted file mode 100644 index 511761036e..0000000000 --- a/ThirdParty/Ert/libsched/applications/perturb_history/pert_util.c +++ /dev/null @@ -1,186 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'pert_util.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static inline int randint() { - return rand(); -} - - -void rand_dbl(int N , double max , double *R) { - int i; - for (i=0; i < N; i++) - R[i] = randint() * max / RAND_MAX; -} - - -double rand_normal(double mean , double std) { - const double pi = 3.141592653589; - double R[2]; - rand_dbl(2 , 1.0 , R); - return mean + std * sqrt(-2.0 * log(R[0])) * cos(2.0 * pi * R[1]); -} - - -void rand_stdnormal_vector(int size , double *R) { - int i; - for (i = 0; i < size; i++) - R[i] = rand_normal(0.0 , 1.0); -} - - - - -/*****************************************************************/ - -static void set_ts(const time_t_vector_type * time_vector , stringlist_type * stringlist , time_t start_date , time_t end_date , const char * string_value) { - int i; - for (i=0; i < time_t_vector_size( time_vector ); i++) { - time_t t = time_t_vector_iget( time_vector , i ); - if ((t >= start_date) && (t < end_date)) - stringlist_iset_copy( stringlist , i , string_value ); - } -} - -/** - File format: - - * - 12/07/2009 500 577 - 12/07/2009 - 16/09/2009 672 666 - 17/09/2009 - * 100 10% - - - 1. Both dates can be replaced with '*' - which is implied to mean - either the start date, or the end date. - - 2. The formatting of the data strings is 100% NAZI - no spaces - allowed. - - 3. The date intervals are half-open, [date1,date2). - - 4. The date lines can overlap - they are applied in line-order. - - 5. The last float value (i.e. 577 and 666 on the liness above) can - be a percent value; that should indicated with '%' immediately - following the number. The percent number should be in the - interval [0,100]. The bool vector tsp is updated to indicate - whether the data should be interpreted as percent or not. - -*/ - - -static void load_exit( FILE * stream , const char * filename) { - - fprintf(stderr," Something wrong around line:%d of file:%s\n",util_get_current_linenr( stream ) , filename ); - fprintf(stderr," Each line should be:\n date1 - date2 value\nwhere date should be formatted as 12/06/2003. \n"); - exit(1); - -} - - -void fscanf_2ts(const time_t_vector_type * time_vector , const char * filename , stringlist_type * s1 , stringlist_type * s2) { - time_t start_time = time_t_vector_get_first( time_vector ); - time_t end_time = time_t_vector_get_last( time_vector ) + 1; - - { - stringlist_clear( s1 ); - stringlist_clear( s2 ); - for (int i=0; i < time_t_vector_size( time_vector ); i++) { - stringlist_append_ref( s1 , NULL ); - stringlist_append_ref( s2 , NULL ); - } - } - - { - FILE * stream = util_fopen( filename , "r"); - char datestring1[32]; - char datestring2[32]; - char dash; - char value1string[32]; - char value2string[32]; - - while (true) { - int read_count = fscanf(stream , "%s %c %s %s %s" , datestring1 , &dash , datestring2, value1string , value2string); - if (read_count == 5) { - bool OK = true; - time_t t1 = -1; - time_t t2 = -1; - if (util_string_equal( datestring1 , "*")) - t1 = start_time; - else - OK = util_sscanf_date( datestring1 , &t1 ); - - if (util_string_equal( datestring2 , "*")) - t2 = end_time; - else - OK = (OK && util_sscanf_date( datestring2 , &t2 )); - - if (OK) { - set_ts( time_vector , s1 , t1 , t2 , value1string ); - set_ts( time_vector , s2 , t1 , t2 , value2string ); - } else - load_exit( stream , filename ); - - } else { - if (read_count == EOF) - break; - else - load_exit( stream , filename ); - } - } - fclose( stream ); - } -} - - -double sscanfp( double base_value , const char * value_string ) { - double value , parse_value; - char * error_ptr; - - if (value_string == NULL) - return 0; - - parse_value = strtod( value_string , &error_ptr); - if (error_ptr[0] == '%') - value = base_value * parse_value * 0.01; - else { - if (error_ptr[0] == '\0') - value = parse_value; - else { - value = 0; - util_exit("Failed to parse \'%s\' as valid number. \n",value_string ); - } - } - - return value; -} - - -/*****************************************************************/ - - - diff --git a/ThirdParty/Ert/libsched/applications/perturb_history/pert_util.h b/ThirdParty/Ert/libsched/applications/perturb_history/pert_util.h deleted file mode 100644 index aa0a0d41c2..0000000000 --- a/ThirdParty/Ert/libsched/applications/perturb_history/pert_util.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'pert_util.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_PERT_UTIL_H -#define ERT_PERT_UTIL_H -#include -#include -#include -#include - -void rand_dbl(int N , double max , double *R); -double rand_normal(double mean , double std); -void rand_stdnormal_vector(int size , double *R); -void fscanf_2ts(const time_t_vector_type * time_vector , const char * filename , stringlist_type * s1 , stringlist_type * s2); -double sscanfp( double base_value , const char * value_string ); - - -#endif diff --git a/ThirdParty/Ert/libsched/applications/perturb_history/perturb_history.c b/ThirdParty/Ert/libsched/applications/perturb_history/perturb_history.c deleted file mode 100644 index 5fd86a438c..0000000000 --- a/ThirdParty/Ert/libsched/applications/perturb_history/perturb_history.c +++ /dev/null @@ -1,240 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'perturb_history.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/*****************************************************************/ - - -void perturb_wconhist( void * void_kw , int restart_nr , void * arg) { - sched_kw_wconhist_type * kw = sched_kw_wconhist_safe_cast( void_kw ); - { - hash_type * group_hash = hash_safe_cast( arg ); - hash_iter_type * group_iter = hash_iter_alloc( group_hash ); - while (!hash_iter_is_complete( group_iter )) { - group_rate_type * group_rate = hash_iter_get_next_value( group_iter ); - if (group_rate_is_producer( group_rate )) - group_rate_update_wconhist( group_rate , kw , restart_nr ); - } - } -} - - - -void perturb_wconinje( void * void_kw , int restart_nr , void * arg) { - sched_kw_wconinje_type * kw = sched_kw_wconinje_safe_cast( void_kw ); - { - hash_type * group_hash = hash_safe_cast( arg ); - hash_iter_type * group_iter = hash_iter_alloc( group_hash ); - while (!hash_iter_is_complete( group_iter )) { - group_rate_type * group_rate = hash_iter_get_next_value( group_iter ); - if (!group_rate_is_producer( group_rate )) - group_rate_update_wconinje( group_rate , kw , restart_nr ); - } - } -} - - - - -void config_init(config_parser_type * config ) { - config_item_type * item; - - config_add_key_value(config , "NUM_REALIZATIONS" , true , CONFIG_INT ); - config_add_key_value(config , "SCHEDULE_FILE" , true , CONFIG_EXISTING_FILE); - config_add_key_value(config , "DATA_FILE" , true , CONFIG_EXISTING_FILE); - config_add_key_value(config , "TARGET" , true , CONFIG_STRING ); - - - - item = config_add_item( config , "GROUP_RATE" , false , true ); /* Group name as part of parsing */ - config_item_set_argc_minmax(item , 4 , 4 , 4 , (const config_item_types[4]) { CONFIG_STRING, /* Group name */ - CONFIG_STRING , /* Phase */ - CONFIG_STRING , /* PRODUCER / INJECTOR */ - CONFIG_EXISTING_FILE}); /* File with min / max shift */ - config_item_set_indexed_selection_set( item , 1 , 3 , (const char *[3]) { "OIL" , "GAS" , "WATER"}); - config_item_set_indexed_selection_set( item , 2 , 2 , (const char *[2]) { "PRODUCER" , "INJECTOR"}); - - - - item = config_add_item( config , "WELL_RATE" , false , true ); /* Group name as part of parsing */ - config_item_set_argc_minmax(item , 4 , 4 , 4 , (const config_item_types[4]) { CONFIG_STRING, /* GROUP NAME */ - CONFIG_STRING , /* Well name */ - CONFIG_FLOAT , /* Corr_length (days) */ - CONFIG_EXISTING_FILE});/* File with mean , std shift */ -} - - - -void load_groups( const config_parser_type * config , const sched_file_type * sched_file , hash_type * group_rates , const sched_history_type * sched_history , const time_t_vector_type * time_vector ) { - int i; - for (i=0; i < config_get_occurences( config , "GROUP_RATE" ); i++) { - const char * group_name = config_iget( config , "GROUP_RATE" , i , 0 ); - const char * phase_string = config_iget( config , "GROUP_RATE" , i , 1 ); - const char * type_string = config_iget( config , "GROUP_RATE" , i , 2 ); - const char * min_max_file = config_iget( config , "GROUP_RATE" , i , 3 ); - - group_rate_type * group_rate = group_rate_alloc( sched_history , time_vector , group_name , phase_string , type_string , min_max_file ); - hash_insert_hash_owned_ref( group_rates , group_name , group_rate , group_rate_free__); - } - - - - for (i=0; i < config_get_occurences( config , "WELL_RATE" ); i++) { - const char * group_name = config_iget( config , "WELL_RATE" , i , 0 ); - const char * well_name = config_iget( config , "WELL_RATE" , i , 1 ); - double corr_length = config_iget_as_double( config , "WELL_RATE" , i , 2 ); - const char * stat_file = config_iget( config , "WELL_RATE" , i , 3 ); - - well_rate_type * well_rate; - group_rate_type * group_rate = hash_get( group_rates , group_name ); - well_rate = well_rate_alloc( sched_history , time_vector , well_name , corr_length , stat_file , group_rate_get_phase( group_rate) , group_rate_is_producer( group_rate )); - group_rate_add_well_rate( group_rate , well_rate ); - } - - { - hash_iter_type * group_iter = hash_iter_alloc( group_rates ); - while (!hash_iter_is_complete( group_iter )) { - group_rate_type * group_rate = hash_iter_get_next_value( group_iter ); - group_rate_init( group_rate ); - } - hash_iter_free( group_iter ); - } -} - - - - -void sample( hash_type * group_rates ) { - hash_iter_type * group_iter = hash_iter_alloc( group_rates ); - - while (!hash_iter_is_complete( group_iter )) { - group_rate_type * group_rate = hash_iter_get_next_value( group_iter ); - group_rate_sample( group_rate ); - } - - hash_iter_free( group_iter ); -} - -void debug (const time_t_vector_type * time_vector ) { - stringlist_type * s1 = stringlist_alloc_new(); - stringlist_type * s2 = stringlist_alloc_new(); - fscanf_2ts( time_vector , "/d/proj/bg/oseberg2/ressim/aoreln2/2001b/pert_hist/stat/test5/OSB/B-29_OIL.stat" , s1 , s2 ); - - for (int i = 0; i < stringlist_get_size( s1 ); i++) { - util_fprintf_date( time_t_vector_iget( time_vector , i ) , stdout); - printf(" %7s -> %7s \n",stringlist_iget(s1 , i) , stringlist_iget(s2,i)); - } - exit(1); -} - - -int main( int argc , char ** argv ) { - hash_type * group_rates = hash_alloc(); - config_parser_type * config = config_alloc(); - char * config_file; - { - char * config_base; - char * config_ext; - char * run_path; - - if (util_is_link( argv[1] )) { /* The command line argument given is a symlink - we start by changing to */ - /* the real location of the configuration file. */ - char * realpath = util_alloc_link_target( argv[1] ); - util_alloc_file_components(realpath , &run_path , &config_base , &config_ext); - free( realpath ); - } else - util_alloc_file_components( argv[1] , &run_path , &config_base , &config_ext); - - if (run_path != NULL) { - printf("Changing to directory: %s \n",run_path); - if (chdir( run_path) != 0) - util_exit("Hmmmm - failed to change to directory:%s \n",run_path); - } - config_file = util_alloc_filename(NULL , config_base , config_ext); - util_safe_free( config_base ); - util_safe_free( config_ext ); - util_safe_free( run_path ); - } - - config_init( config ); - config_parse(config , config_file , "--" , NULL , "DEFINE" , false , true ); - { - sched_history_type * sched_history = sched_history_alloc(":"); - const char * data_file = config_iget( config , "DATA_FILE" , 0 , 0 ); - const char * sched_file_name = config_iget( config , "SCHEDULE_FILE" , 0 , 0 ); - path_fmt_type * sched_fmt = path_fmt_alloc_path_fmt( config_iget( config , "TARGET" , 0 , 0) ); - const int num_realizations = config_iget_as_int(config , "NUM_REALIZATIONS" , 0 , 0 ); - msg_type * msg = msg_alloc("Creating file: ", false); - - time_t start_date = ecl_util_get_start_date( data_file ); - time_t_vector_type * time_vector; - /* Loading input and creating well/group objects. */ - { - sched_file_type * sched_file = sched_file_parse_alloc( sched_file_name , start_date ); - sched_history_update( sched_history , sched_file ); - - time_vector = sched_file_alloc_time_t_vector( sched_file ); - load_groups( config , sched_file ,group_rates , sched_history , time_vector ); - sched_file_free( sched_file ); - } - - - /* Sampling and creating output */ - { - int i; - msg_show( msg ); - for (i = 0; i < num_realizations; i++) { - //sched_file_type * sched_file = sched_file_alloc_copy( ); - sched_file_type * sched_file = sched_file_parse_alloc( sched_file_name , start_date ); - sample( group_rates ); - sched_file_update( sched_file , WCONHIST , perturb_wconhist , group_rates ); - sched_file_update( sched_file , WCONINJE , perturb_wconinje , group_rates ); - - { - char * new_file = path_fmt_alloc_file(sched_fmt , true , i ); - sched_file_fprintf( sched_file , new_file , false); - msg_update( msg , new_file ); - free( new_file ); - } - sched_file_free( sched_file ); - } - } - msg_free( msg , true ); - sched_history_free( sched_history ); - } - config_free( config ); - hash_free( group_rates ); -} diff --git a/ThirdParty/Ert/libsched/applications/perturb_history/well_rate.c b/ThirdParty/Ert/libsched/applications/perturb_history/well_rate.c deleted file mode 100644 index 788d91b2f1..0000000000 --- a/ThirdParty/Ert/libsched/applications/perturb_history/well_rate.c +++ /dev/null @@ -1,259 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'well_rate.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define WELL_RATE_ID 6681055 - - -struct well_rate_struct { - UTIL_TYPE_ID_DECLARATION; - char * name; - double corr_length; - bool producer; - double_vector_type * shift; - double_vector_type * mean_shift; - double_vector_type * std_shift; - stringlist_type * mean_shift_string; - stringlist_type * std_shift_string; - double_vector_type * rate; - double_vector_type * base_value; - bool_vector_type * percent_std; - sched_phase_enum phase; - const time_t_vector_type * time_vector; - const sched_history_type * sched_history; -}; - - - - - - -void well_rate_update_wconhist( well_rate_type * well_rate , sched_kw_wconhist_type * kw, int restart_nr ) { - double shift = double_vector_iget( well_rate->shift , restart_nr ); - switch (well_rate->phase) { - case(OIL): - sched_kw_wconhist_shift_orat( kw , well_rate->name , shift); - break; - case(GAS): - sched_kw_wconhist_shift_grat( kw , well_rate->name , shift); - break; - case(WATER): - sched_kw_wconhist_shift_wrat( kw , well_rate->name , shift); - break; - } -} - - -void well_rate_update_wconinje( well_rate_type * well_rate , sched_kw_wconinje_type * kw, int restart_nr ) { - sched_kw_wconinje_shift_surface_flow( kw , well_rate->name , double_vector_iget( well_rate->shift , restart_nr )); - return; -} - - - - -/* - a = exp(-(t_i - t_(i-1)) / corr_length) - y(i) = a*y(i - 1) + (1 - a) * N(mean(i) , std(i)) - -*/ - -void well_rate_sample_shift( well_rate_type * well_rate ) { - int size = time_t_vector_size( well_rate->time_vector ); - double * R = util_malloc( size * sizeof * R , __func__); - int i; - rand_stdnormal_vector( size , R ); - for (i=0; i < size; i++) - R[i] = R[i] * double_vector_iget( well_rate->std_shift , i ) + double_vector_iget( well_rate->mean_shift , i ); - - double_vector_iset( well_rate->shift , 0 , R[0]); - - for (i=1; i < size; i++) { - double dt = 1.0 * (time_t_vector_iget( well_rate->time_vector , i ) - time_t_vector_iget( well_rate->time_vector , i - 1)) / (24 * 3600); /* Days */ - double a = exp(-dt / well_rate->corr_length ); - double shift = a * double_vector_iget( well_rate->shift , i - 1 ) + (1 - a) * R[i]; - double base_rate = double_vector_safe_iget( well_rate->base_value , i); - - /* The time series is sampled - irrespective of whether the well is open or not. */ - - if ((shift + base_rate) < 0) - shift = -base_rate; - - if (sched_history_well_open( well_rate->sched_history , well_rate->name , i)) - double_vector_iset( well_rate->shift , i , shift ); - else - double_vector_iset( well_rate->shift , i , 0); - - } - free( R ); -} - -/* - Ensures that the final rate is >= 0; this might lead to a minor - violation of the parent-groups constraints. -*/ - -void well_rate_ishift( well_rate_type * well_rate , int index, double new_shift) { - if (sched_history_well_open( well_rate->sched_history , well_rate->name , index)) { - double base_rate = double_vector_safe_iget( well_rate->base_value , index); - double shift = double_vector_safe_iget( well_rate->shift , index) + new_shift; - - if ((base_rate + shift) < 0) - shift = -base_rate; - double_vector_iset( well_rate->shift , index , shift ); - } -} - - -double well_rate_iget_rate( const well_rate_type * well_rate , int report_step ) { - return double_vector_safe_iget( well_rate->base_value , report_step ); -} - -int well_rate_get_length( const well_rate_type * well_rate ) { - return double_vector_size( well_rate->base_value ); -} - - - -well_rate_type * well_rate_alloc(const sched_history_type * sched_history , const time_t_vector_type * time_vector , const char * name , double corr_length , const char * filename, sched_phase_enum phase, bool producer) { - well_rate_type * well_rate = util_malloc( sizeof * well_rate , __func__); - UTIL_TYPE_ID_INIT( well_rate , WELL_RATE_ID ); - well_rate->name = util_alloc_string_copy( name ); - well_rate->time_vector = time_vector; - well_rate->corr_length = corr_length; - well_rate->shift = double_vector_alloc(0,0); - well_rate->mean_shift = double_vector_alloc(0 , 0); - well_rate->std_shift = double_vector_alloc(0 , 0); - well_rate->mean_shift_string = stringlist_alloc_new(); - well_rate->std_shift_string = stringlist_alloc_new(); - well_rate->base_value = double_vector_alloc(0 , 0); - well_rate->rate = double_vector_alloc(0 , 0); - well_rate->phase = phase; - well_rate->sched_history= sched_history; - well_rate->percent_std = bool_vector_alloc( 0 , false ); - well_rate->producer = producer; - fscanf_2ts( time_vector , filename , well_rate->mean_shift_string , well_rate->std_shift_string); - - { - char * key; - if (well_rate->producer) { - switch(well_rate->phase) { - case (WATER): - key = util_alloc_sprintf("WWPRH%s%s" , sched_history_get_join_string( sched_history ) , well_rate->name ); - break; - case( GAS ): - key = util_alloc_sprintf("WGPRH%s%s" , sched_history_get_join_string( sched_history ) , well_rate->name ); - break; - case( OIL ): - key = util_alloc_sprintf("WOPRH%s%s" , sched_history_get_join_string( sched_history ) , well_rate->name ); - break; - default: - key = NULL; - util_abort("%s: unknown phase identitifier: %d \n",__func__ , well_rate->phase); - } - } else { - switch(well_rate->phase) { - case (WATER): - key = util_alloc_sprintf("WWIRH%s%s" , sched_history_get_join_string( sched_history ) , well_rate->name ); - break; - case( GAS ): - key = util_alloc_sprintf("WGIRH%s%s" , sched_history_get_join_string( sched_history ) , well_rate->name ); - break; - case( OIL ): - key = util_alloc_sprintf("WOIRH%s%s" , sched_history_get_join_string( sched_history ) , well_rate->name ); - break; - default: - util_abort("%s: unknown phase identitifier: %d \n",__func__ , well_rate->phase); - key = NULL; - } - } - - if (sched_history_has_key( sched_history , key)) { - sched_history_init_vector( sched_history , key , well_rate->base_value ); - well_rate_eval_stat( well_rate ); - } else - fprintf(stderr,"** Warning - schedule history does not have key:%s - suspicious?\n", key ); - - free( key ); - } - return well_rate; -} - - -bool well_rate_well_open( const well_rate_type * well_rate , int index ) { - return sched_history_well_open( well_rate->sched_history , well_rate->name , index ); -} - - -void well_rate_eval_stat( well_rate_type * well_rate ) { - for (int i = 0; i < stringlist_get_size( well_rate->mean_shift_string ); i++) { - double mean_shift = sscanfp( double_vector_safe_iget( well_rate->base_value , i ) , stringlist_iget( well_rate->mean_shift_string , i)); - double std_shift = sscanfp( double_vector_safe_iget( well_rate->base_value , i ) , stringlist_iget( well_rate->std_shift_string , i)); - - double_vector_iset( well_rate->mean_shift , i , mean_shift ); - double_vector_iset( well_rate->std_shift , i , std_shift); - } -} - - -static UTIL_SAFE_CAST_FUNCTION( well_rate , WELL_RATE_ID ); - - -void well_rate_free( well_rate_type * well_rate ) { - free( well_rate->name ); - double_vector_free( well_rate->shift ); - double_vector_free( well_rate->mean_shift ); - double_vector_free( well_rate->std_shift ); - double_vector_free( well_rate->base_value ); - bool_vector_free( well_rate->percent_std ); - free( well_rate ); -} - -void well_rate_free__( void * arg ) { - well_rate_type * well_rate = well_rate_safe_cast( arg ); - well_rate_free( well_rate ); -} - - - -sched_phase_enum well_rate_get_phase( const well_rate_type * well_rate ) { - return well_rate->phase; -} - - -const char * well_rate_get_name( const well_rate_type * well_rate ) { - return well_rate->name; -} - - -double_vector_type * well_rate_get_shift( well_rate_type * well_rate ) { - return well_rate->shift; -} diff --git a/ThirdParty/Ert/libsched/applications/perturb_history/well_rate.h b/ThirdParty/Ert/libsched/applications/perturb_history/well_rate.h deleted file mode 100644 index 65ea8cfe56..0000000000 --- a/ThirdParty/Ert/libsched/applications/perturb_history/well_rate.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'well_rate.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_WELL_RATE_H -#define ERT_WELL_RATE_H - -#include -#include -#include -#include -#include -#include - -typedef struct well_rate_struct well_rate_type; -well_rate_type * well_rate_alloc(const sched_history_type * sched_history , - const time_t_vector_type * time_vector , - const char * name , double corr_length , const char * filename, sched_phase_enum phase, bool producer); -void well_rate_free__( void * arg ); -double_vector_type * well_rate_get_shift( well_rate_type * well_rate ); -sched_phase_enum well_rate_get_phase( const well_rate_type * well_rate ); -const char * well_rate_get_name( const well_rate_type * well_rate ); -void well_rate_sample_shift( well_rate_type * well_rate ); -bool well_rate_well_open( const well_rate_type * well_rate , int index ); -void well_rate_ishift( well_rate_type * well_rate ,int index, double new_shift); -void well_rate_update_wconhist( well_rate_type * well_rate , sched_kw_wconhist_type * kw, int restart_nr ); -void well_rate_update_wconinje( well_rate_type * well_rate , sched_kw_wconinje_type * kw, int restart_nr ); -double well_rate_iget_rate( const well_rate_type * well_rate , int report_step ); -int well_rate_get_length( const well_rate_type * well_rate ); -void well_rate_eval_stat( well_rate_type * well_rate ); - -#endif diff --git a/ThirdParty/Ert/libsched/applications/sched_summary.c b/ThirdParty/Ert/libsched/applications/sched_summary.c deleted file mode 100644 index 460305fadc..0000000000 --- a/ThirdParty/Ert/libsched/applications/sched_summary.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_summary.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include - -#include - -#include -#include - - - - - - - -int main (int argc , char ** argv) { - time_t start_time; - if (argc < 3) - util_exit("usage: ECLIPSE.DATA SCHEDULE_FILE ...\n"); - { - const char * data_file = argv[1]; - const char * schedule_file = argv[2]; - start_time = ecl_util_get_start_date( data_file ); - { - sched_history_type * sched_history = sched_history_alloc( ":" ); - sched_file_type * sched_file = sched_file_alloc(start_time); - sched_file_parse(sched_file , schedule_file); - sched_history_update( sched_history , sched_file ); - - { - stringlist_type * key_list = stringlist_alloc_new(); - - for (int iarg=3; iarg < argc; iarg++) { - if( sched_history_has_key( sched_history , argv[iarg] )) - stringlist_append_ref( key_list , argv[iarg]); - else - fprintf(stderr,"** Warning the SCHEDULE file does not contain the key: %s \n",argv[iarg]); - } - - sched_history_fprintf( sched_history , key_list , stdout ); - stringlist_free( key_list ) ; - } - } - } -} diff --git a/ThirdParty/Ert/libsched/applications/sched_test.c b/ThirdParty/Ert/libsched/applications/sched_test.c deleted file mode 100644 index 1aa98b8200..0000000000 --- a/ThirdParty/Ert/libsched/applications/sched_test.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_test.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include - -#include -#include -#include -#include -#include - - - -int main(int argc, char **argv) -{ - time_t start_time; - start_time = util_make_date(1,1,2000); - start_time = util_make_date(1,1,1988); - sched_file_type * sched_file = sched_file_parse_alloc( argv[1] , start_time); - sched_history_type * sched_history = sched_history_alloc(":"); - sched_history_update( sched_history , sched_file ); - sched_history_install_index( sched_history ); - - sched_history_fprintf_group_structure( sched_history , 300 ); - printf("FOPRH %g \n",sched_history_iget( sched_history , "FOPRH" , 139)); - //printf("GWPRH:AN %g \n",sched_history_iget( sched_history , "GOPRH:AN" , 139)); - //printf("WWIRH:C-1 %g \n",sched_history_iget( sched_history , "WWIRH:C-1" , 139)); - //printf("WOPRH:C-15C %g \n",sched_history_iget( sched_history , "WOPRH:B-6A" , 300)); - //printf("WOPRH:C-15C %g \n",sched_history_iget( sched_history , "WOPRH:B-6A" , 400)); - - sched_history_free( sched_history ); - sched_file_free( sched_file ); -} diff --git a/ThirdParty/Ert/libsched/applications/update_ir.c b/ThirdParty/Ert/libsched/applications/update_ir.c deleted file mode 100644 index 2d6302d4b3..0000000000 --- a/ThirdParty/Ert/libsched/applications/update_ir.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'update_ir.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void scale_injectors(void * void_kw , int report_step , void * arg) { - sched_kw_wconinje_type * kw = sched_kw_wconinje_safe_cast( void_kw ); - hash_type * well_hash = hash_safe_cast( arg ); - hash_iter_type * hash_iter = hash_iter_alloc( well_hash ); - - - while ( !hash_iter_is_complete(hash_iter) ) { - const char * well = hash_iter_get_next_key( hash_iter ); - double scale_factor = hash_get_double( well_hash , well ); - - sched_kw_wconinje_scale_surface_flow(kw , well , scale_factor); - printf("Scaling injector: %s/%g \n",well , scale_factor); - } - hash_iter_free( hash_iter ); -} - - - -static hash_type * parse_multir( const char * multir_file ) { - parser_type * parser = parser_alloc(" \n\t",NULL ,NULL , NULL , NULL , NULL); - stringlist_type * tokens = parser_tokenize_file ( parser , multir_file , true ); - hash_type * hash = hash_alloc(); - int i; - - for (i = 0; i < stringlist_get_size(tokens); i += 2) { - const char * well = stringlist_iget( tokens , i); - const char * multir_st = stringlist_iget( tokens , i + 1); - double multir; - - if (util_sscanf_double( multir_st , &multir)) - hash_insert_double( hash , well , multir); - else - util_abort("%s: failed to parse: %s as double \n",__func__ , multir_st); - - } - stringlist_free( tokens ); - parser_free( parser ); - return hash; -} - - -void install_SIGNALS(void) { - signal(SIGSEGV , util_abort_signal); - signal(SIGINT , util_abort_signal); - signal(SIGKILL , util_abort_signal); -} - - - - -int main(int argc, char **argv) -{ - if(argc < 4) - { - printf("Usage: sched_test.x data_file my_sched_file.SCH update_ir.txt \n"); - return 0; - } - - time_t start_time; - int num_restart_files; - int last_restart_file; - char * data_file = argv[1]; - char * schedule_file = argv[2]; - char * multir_file = argv[3]; - - hash_type * hash; - sched_file_type * sched_file; - - start_time = ecl_util_get_start_date( data_file ); - sched_file = sched_file_parse_alloc( schedule_file , start_time); - unlink( schedule_file ); - hash = parse_multir( multir_file ); - sched_file_update(sched_file , WCONINJE , scale_injectors , hash); - sched_file_fprintf(sched_file , schedule_file ); - sched_file_free( sched_file ); - hash_free( hash ); - - - return 0; -} diff --git a/ThirdParty/Ert/libsched/include/ert/sched/group_history.h b/ThirdParty/Ert/libsched/include/ert/sched/group_history.h deleted file mode 100644 index 2b43b6ee2f..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/group_history.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'group_history.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_GROUP_HISTORY_H -#define ERT_GROUP_HISTORY_H - -#ifdef __cplusplus -extern "C" { -#endif -#include -#include -#include - -typedef struct group_history_struct group_history_type; - - -bool group_history_group_exists( const group_history_type * group_history , int report_step); -group_history_type * group_history_alloc( const char * group_name , const time_t_vector_type * time , int report_step ); -void group_history_free( group_history_type * group_history ); -void group_history_free__( void * arg ); -void group_history_add_child(group_history_type * group_history , void * child_history , const char * child_name , int report_step ); -void group_history_init_child_names( group_history_type * group_history , int report_step , stringlist_type * child_names ); -const char * group_history_get_name( const group_history_type * group_history ); -void group_history_fprintf( const group_history_type * group_history , int report_step , bool recursive , FILE * stream ); - - -double group_history_iget_GOPRH( const void * __group_history , int report_step ); -double group_history_iget_GGPRH( const void * __group_history , int report_step ); -double group_history_iget_GWPRH( const void * __group_history , int report_step ); -double group_history_iget_GWCTH( const void * __group_history , int report_step ); -double group_history_iget_GGORH( const void * __group_history , int report_step ); - -double group_history_iget_GWPTH( const void * __group_history , int report_step ); -double group_history_iget_GOPTH( const void * __group_history , int report_step ); -double group_history_iget_GGPTH( const void * __group_history , int report_step ); - -double group_history_iget( const void * index , int report_step ); - -UTIL_IS_INSTANCE_HEADER( group_history ); - - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/group_index.h b/ThirdParty/Ert/libsched/include/ert/sched/group_index.h deleted file mode 100644 index 6bfef0be59..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/group_index.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'group_index.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_GROUP_INDEX_H -#define ERT_GROUP_INDEX_H - -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include - -typedef struct group_index_struct group_index_type; - -group_index_type * group_index_alloc( const char * group_name , const char * variable , const void * state_ptr , sched_history_callback_ftype * func ); -void group_index_free( group_index_type * group_index ); -void group_index_free__( void * arg ); -sched_history_callback_ftype * group_index_get_callback( const group_index_type * group_index ); -const void * group_index_get_state__( const void * index ); -const void * group_index_get_state( const group_index_type * group_index ); -const char * group_index_get_name( const group_index_type * group_index ); -const char * group_index_get_variable( const group_index_type * group_index ); - - - -UTIL_IS_INSTANCE_HEADER( group_index ); -UTIL_SAFE_CAST_HEADER_CONST( group_index ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/gruptree.h b/ThirdParty/Ert/libsched/include/ert/sched/gruptree.h deleted file mode 100644 index 3a1344f540..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/gruptree.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'gruptree.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_GRUPTREE_H -#define ERT_GRUPTREE_H -#ifdef __cplusplus -extern "C" { -#endif - -#include - -typedef struct gruptree_struct gruptree_type; - -gruptree_type * gruptree_alloc(); -gruptree_type * gruptree_copyc(const gruptree_type *); -gruptree_type * gruptree_fread_alloc(FILE *); -void gruptree_fwrite(const gruptree_type *, FILE *); -void gruptree_free(gruptree_type *); - - -void gruptree_register_grup(gruptree_type *, const char *, const char *); -void gruptree_register_well(gruptree_type *, const char *, const char *); -bool gruptree_has_grup(const gruptree_type *, const char *); -char ** gruptree_alloc_grup_well_list(gruptree_type *, const char *, int *); -void gruptree_printf_grup_wells(gruptree_type *, const char *); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/history.h b/ThirdParty/Ert/libsched/include/ert/sched/history.h deleted file mode 100644 index e35c54ce46..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/history.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'history.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_HISTORY_H -#define ERT_HISTORY_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -#include -#include -#include - -#include - -#include - - -typedef enum { - SCHEDULE = 0, - REFCASE_SIMULATED = 1, /* ecl_sum_get_well_var( "WWCT" ); */ - REFCASE_HISTORY = 2, /* ecl_sum_get_well_var( "WWCTH" ); */ - HISTORY_SOURCE_INVALID = 10 -} history_source_type; - - - -typedef struct history_struct history_type; - - history_source_type history_get_source_type( const char * string_source ); - -// Manipulators. - void history_free(history_type *); - history_type * history_alloc_from_sched_file(const char * sep_string , const sched_file_type *); - history_type * history_alloc_from_refcase(const ecl_sum_type * refcase , bool use_h_keywords); - const char * history_get_source_string( history_source_type history_source ); - bool history_init_ts( const history_type * history , const char * summary_key , double_vector_type * value, bool_vector_type * valid); - -// Accessors. - time_t history_get_start_time( const history_type * history ); - int history_get_last_restart(const history_type *); - double history_get_var_from_sum_key(const history_type *, int, const char *, bool *); - double history_get_well_var(const history_type * , int, const char *, const char *, bool *); - double history_get_group_var(const history_type *, int, const char *, const char *, bool *); - void history_alloc_time_series_from_summary_key(const history_type *, const char *, double **, bool **); - time_t history_iget_node_start_time(const history_type *, int); - time_t history_iget_node_end_time(const history_type *, int); - int history_get_restart_nr_from_days(const history_type *, double days); - time_t history_get_time_t_from_restart_nr( const history_type * history , int restart_nr); - int history_get_restart_nr_from_time_t( const history_type * history , time_t time); - - UTIL_IS_INSTANCE_HEADER( history ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/sched_blob.h b/ThirdParty/Ert/libsched/include/ert/sched/sched_blob.h deleted file mode 100644 index b7a0b8f9eb..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/sched_blob.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_blob.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SCHED_BLOB_H -#define ERT_SCHED_BLOB_H -#ifdef __cplusplus -extern "C" { -#endif -#include - -typedef struct sched_blob_struct sched_blob_type; - - -void sched_blob_append_token( sched_blob_type * blob , const char * token ); -sched_blob_type * sched_blob_alloc( ); -void sched_blob_free( sched_blob_type * blob ); -void sched_blob_fprintf( const sched_blob_type * blob , FILE * stream ); -int sched_blob_get_size( const sched_blob_type * blob ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/sched_file.h b/ThirdParty/Ert/libsched/include/ert/sched/sched_file.h deleted file mode 100644 index 4a29160b4b..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/sched_file.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_file.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SCHED_FILE_H -#define ERT_SCHED_FILE_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include - -#include -#include - -typedef struct sched_file_struct sched_file_type; -typedef struct sched_block_struct sched_block_type; - - -typedef void (sched_file_callback_ftype)( void * sched_kw , int restart_nr , void * arg); - -void sched_file_add_fixed_length_kw( sched_file_type * sched_file , const char * kw , int length ); -sched_file_type * sched_file_alloc(time_t); -sched_file_type * sched_file_safe_cast(void * ); -void sched_file_free(sched_file_type *); -void sched_file_parse(sched_file_type *, const char *); -void sched_file_parse_append(sched_file_type * , const char * ); -sched_file_type * sched_file_parse_alloc(const char * , time_t); -void sched_file_fprintf_i(const sched_file_type *, int, const char *); -void sched_file_fprintf(const sched_file_type * sched_file, const char * file); - -int sched_file_get_num_restart_files(const sched_file_type *); -int sched_file_get_restart_nr_from_time_t(const sched_file_type *, time_t); -int sched_file_get_restart_nr_from_days(const sched_file_type * , double ); -int sched_file_iget_block_size(const sched_file_type *, int); -int sched_file_time_t_to_restart_file(const sched_file_type *, time_t); - -time_t sched_file_iget_block_start_time(const sched_file_type *, int); -time_t sched_file_iget_block_end_time(const sched_file_type *, int); -double sched_file_iget_block_start_days(const sched_file_type * sched_file, int i); -double sched_file_iget_block_end_days(const sched_file_type * sched_file, int i); -double sched_file_get_sim_days(const sched_file_type * sched_file , int report_step); -time_t sched_file_get_sim_time(const sched_file_type * sched_file , int report_step); - -sched_kw_type * sched_file_ijget_block_kw_ref(const sched_file_type *, int, int); -int sched_file_get_restart_file_from_time_t(const sched_file_type * , time_t ); -void sched_file_summarize(const sched_file_type * , FILE * ); -sched_file_type * sched_file_alloc_copy(const sched_file_type * , bool); -time_t_vector_type * sched_file_alloc_time_t_vector( const sched_file_type * sched_file ); - -void sched_file_update_blocks(sched_file_type * sched_file, int restart1 , int restart2 , sched_kw_type_enum kw_type, sched_file_callback_ftype * callback, void * arg); -void sched_file_update(sched_file_type * sched_file, sched_kw_type_enum kw_type, sched_file_callback_ftype * callback, void * arg); -bool sched_file_well_open( const sched_file_type * sched_file , int restart_nr , const char * well_name ); -const char * sched_file_iget_filename( const sched_file_type * sched_file , int file_nr ); - - -int sched_block_get_size(const sched_block_type * block); -sched_kw_type * sched_block_iget_kw(sched_block_type * block, int i); -sched_block_type * sched_file_iget_block(const sched_file_type * sched_file, int i); - - - -double sched_file_well_wconhist_rate( const sched_file_type * sched_file , - int restart_nr , - const char * well_name); - -double sched_file_well_wconinje_rate( const sched_file_type * sched_file , - int restart_nr , - const char * well_name); - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/sched_history.h b/ThirdParty/Ert/libsched/include/ert/sched/sched_history.h deleted file mode 100644 index dfdd35fa53..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/sched_history.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_history.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SCHED_HISTORY_H -#define ERT_SCHED_HISTORY_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include - -#include - -typedef struct sched_history_struct sched_history_type; - - - time_t sched_history_iget_time_t( const sched_history_type * sched_history , int restart_nr ); - void sched_history_update( sched_history_type * sched_history, const sched_file_type * sched_file ); - sched_history_type * sched_history_alloc( const char * sep_string ); - void sched_history_free( sched_history_type * sched_history ); - double sched_history_iget( const sched_history_type * sched_history , const char * key , int report_step); - void sched_history_init_vector( const sched_history_type * sched_history , const char * key , double_vector_type * value); - void sched_history_fprintf_group_structure( sched_history_type * sched_history , int report_step ); - const char * sched_history_get_join_string( const sched_history_type * sched_history ); - void sched_history_fprintf_index_keys( const sched_history_type * sched_history , FILE * stream ); - bool sched_history_has_key( const sched_history_type * sched_history , const char * key); - void sched_history_fprintf( const sched_history_type * sched_history , const stringlist_type * key_list , FILE * stream); - bool sched_history_well_open( const sched_history_type * sched_history , const char * well_name , int report_step ); - bool sched_history_has_well( const sched_history_type * sched_history , const char * well_name); - bool sched_history_has_group( const sched_history_type * sched_history , const char * group_name); - bool sched_history_group_exists( const sched_history_type * sched_history , const char * group_name , int report_step ); - int sched_history_get_last_history( const sched_history_type * sched_history ); - bool sched_history_open( const sched_history_type * sched_history , const char * key , int report_step); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw.h b/ThirdParty/Ert/libsched/include/ert/sched/sched_kw.h deleted file mode 100644 index 854fb66dd1..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SCHED_KW_H -#define ERT_SCHED_KW_H -#ifdef __cplusplus -extern "C" { -#endif -#include -#include -#include - -#include - -#include - -typedef struct sched_kw_struct sched_kw_type; - - - -/*****************************************************************/ - - - - void sched_kw_free__(void *); - const char * sched_kw_get_type_name( const sched_kw_type * sched_kw ); - sched_kw_type_enum sched_kw_get_type(const sched_kw_type *); - sched_kw_type * sched_kw_token_alloc(const stringlist_type * tokens, int * token_index, hash_type * fixed_length_table, bool * foundEND); - void sched_kw_fprintf(const sched_kw_type *, FILE *); - void sched_kw_free(sched_kw_type *); - - sched_kw_type * sched_kw_alloc_copy(const sched_kw_type * ); - sched_kw_type ** sched_kw_split_alloc_DATES(const sched_kw_type *, int *); - time_t sched_kw_get_new_time(const sched_kw_type *, time_t); - char ** sched_kw_alloc_well_list(const sched_kw_type *, int *); - hash_type * sched_kw_alloc_well_obs_hash(const sched_kw_type *); - void sched_kw_alloc_child_parent_list(const sched_kw_type *, char ***, char ***, int *); - void * sched_kw_get_data( sched_kw_type * kw); - const void * sched_kw_get_const_data( const sched_kw_type * kw); - void sched_kw_set_restart_nr( sched_kw_type * kw , int restart_nr); - const char * sched_kw_get_name( const sched_kw_type * kw); - bool sched_kw_has_well( const sched_kw_type * sched_kw , const char * well ); - bool sched_kw_well_open( const sched_kw_type * sched_kw , const char * well ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_compdat.h b/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_compdat.h deleted file mode 100644 index 7bfdd246bb..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_compdat.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_compdat.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SCHED_KW_COMPDAT_H -#define ERT_SCHED_KW_COMPDAT_H -#include - -#include -#include - -#include - -typedef struct sched_kw_compdat_struct sched_kw_compdat_type; - -sched_kw_compdat_type * sched_kw_compdat_alloc(); -void sched_kw_compdat_free(sched_kw_compdat_type * ); -void sched_kw_compdat_fprintf(const sched_kw_compdat_type * , FILE *); -sched_kw_compdat_type * sched_kw_compdat_fread_alloc(FILE *stream); -void sched_kw_compdat_fwrite(const sched_kw_compdat_type * , FILE *stream); - - -KW_HEADER(compdat) - - -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_dates.h b/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_dates.h deleted file mode 100644 index ffe14ef9e6..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_dates.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_dates.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SCHED_KW_DATES -#define ERT_SCHED_KW_DATES -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include - -#include - - -typedef struct sched_kw_dates_struct sched_kw_dates_type; - -sched_kw_dates_type * sched_kw_dates_fscanf_alloc(FILE * , bool *, const char * ); -void sched_kw_dates_fprintf(const sched_kw_dates_type * , FILE *); -void sched_kw_dates_free(sched_kw_dates_type * ); -void sched_kw_dates_fwrite(const sched_kw_dates_type * , FILE * ); -sched_kw_dates_type * sched_kw_dates_fread_alloc(FILE * ); - -int sched_kw_dates_get_size(const sched_kw_dates_type *); -sched_kw_dates_type * sched_kw_dates_alloc_from_time_t(time_t ); -time_t sched_kw_dates_iget_date(const sched_kw_dates_type *, int); -/*******************************************************************/ - - - -KW_HEADER(dates) - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_gruptree.h b/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_gruptree.h deleted file mode 100644 index c6b59f26b0..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_gruptree.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_gruptree.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SCHED_KW_GRUPTREE_H -#define ERT_SCHED_KW_GRUPTREE_H -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include - -#include - -typedef struct sched_kw_gruptree_struct sched_kw_gruptree_type; - -//void sched_kw_gruptree_free (sched_kw_gruptree_type *); -//void sched_kw_gruptree_fprintf (const sched_kw_gruptree_type *, FILE * ); -void sched_kw_gruptree_alloc_child_parent_list(const sched_kw_gruptree_type *, char ***, char ***, int *); -void sched_kw_gruptree_init_child_parent_list( const sched_kw_gruptree_type * kw , stringlist_type * child , stringlist_type * parent); - -/*******************************************************************/ - - - -KW_HEADER(gruptree) - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_include.h b/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_include.h deleted file mode 100644 index 64c23f3a55..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_include.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_include.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SCHED_KW_INCLUDE_H -#define ERT_SCHED_KW_INCLDUE_H - -#include - -#include - -typedef struct sched_kw_include_struct sched_kw_include_type; - - -sched_kw_include_type * sched_kw_include_fscanf_alloc( FILE *, bool *, const char *); -void sched_kw_include_free(sched_kw_include_type * ); -void sched_kw_include_fprintf(const sched_kw_include_type * , FILE *); -void sched_kw_include_fwrite(const sched_kw_include_type *, FILE *); -sched_kw_include_type * sched_kw_include_fread_alloc( FILE *); - -KW_HEADER(include) - -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_tstep.h b/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_tstep.h deleted file mode 100644 index 492ac80c5f..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_tstep.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_tstep.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SCHED_KW_TSTEP -#define ERT_SCHED_KW_TSTEP -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include - -#include - -typedef struct sched_kw_tstep_struct sched_kw_tstep_type; - -sched_kw_tstep_type * sched_kw_tstep_fscanf_alloc(FILE *, bool *, const char *); -void sched_kw_tstep_free(sched_kw_tstep_type * ); -void sched_kw_tstep_fprintf(const sched_kw_tstep_type *, FILE *); -void sched_kw_tstep_fwrite(const sched_kw_tstep_type * , FILE *); -sched_kw_tstep_type * sched_kw_tstep_fread_alloc(FILE *); - -int sched_kw_tstep_get_size(const sched_kw_tstep_type *); -sched_kw_tstep_type * sched_kw_tstep_alloc_from_double(double); -double sched_kw_tstep_iget_step(const sched_kw_tstep_type *, int); -time_t sched_kw_tstep_get_new_time(const sched_kw_tstep_type *, time_t); -int sched_kw_tstep_get_length( const sched_kw_tstep_type * kw); - - -/*******************************************************************/ - - - -KW_HEADER(tstep) -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_untyped.h b/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_untyped.h deleted file mode 100644 index c291ae5547..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_untyped.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_untyped.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SCHED_KW_UNTYPED_H -#define ERT_SCHED_KW_UNTYPED_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include - -#include - -typedef struct sched_kw_untyped_struct sched_kw_untyped_type; - -sched_kw_untyped_type * sched_kw_untyped_alloc(const stringlist_type * tokens , int * token_index , int rec_len); -sched_kw_untyped_type * sched_kw_untyped_alloc_empty(const char * , int rec_len); -void sched_kw_untyped_fprintf(const sched_kw_untyped_type *, FILE *); -void sched_kw_untyped_free(sched_kw_untyped_type * ); -sched_kw_untyped_type * sched_kw_untyped_fread_alloc(FILE *); -void sched_kw_untyped_fwrite(const sched_kw_untyped_type * , FILE *); -void sched_kw_untyped_add_line(sched_kw_untyped_type * , const char *, bool); -void sched_kw_untyped_add_tokens( sched_kw_untyped_type * kw , const stringlist_type * tokens); -char ** sched_kw_untyped_iget_entries_alloc(const sched_kw_untyped_type *, int, int *); - -/*******************************************************************/ - -KW_FREE_HEADER(untyped) -KW_FPRINTF_HEADER(untyped) -KW_COPYC_HEADER(untyped) - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_wconhist.h b/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_wconhist.h deleted file mode 100644 index 712178b278..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_wconhist.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_wconhist.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SCHED_KW_WCONHIST_H -#define ERT_SCHED_KW_WCONHIST_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include -#include -#include -#include - -#include -#include - -typedef struct sched_kw_wconhist_struct sched_kw_wconhist_type; -typedef struct wconhist_state_struct wconhist_state_type; - -#define WCONHIST_DEFAULT_STATUS OPEN - -sched_kw_wconhist_type * sched_kw_wconhist_fscanf_alloc( FILE *, bool *, const char *); -void sched_kw_wconhist_free(sched_kw_wconhist_type * ); -void sched_kw_wconhist_fprintf(const sched_kw_wconhist_type * , FILE *); -void sched_kw_wconhist_fwrite(const sched_kw_wconhist_type *, FILE *); -sched_kw_wconhist_type * sched_kw_wconhist_fread_alloc( FILE *); -hash_type * sched_kw_wconhist_alloc_well_obs_hash(const sched_kw_wconhist_type *); -double sched_kw_wconhist_get_orat( sched_kw_wconhist_type * kw , const char * well_name); -void sched_kw_wconhist_scale_orat( sched_kw_wconhist_type * kw , const char * well_name, double factor); -void sched_kw_wconhist_set_surface_flow( sched_kw_wconhist_type * kw , const char * well_name , double orat); -bool sched_kw_wconhist_has_well( const sched_kw_wconhist_type * kw , const char * well_name); -bool sched_kw_wconhist_well_open( const sched_kw_wconhist_type * kw, const char * well_name); -void sched_kw_wconhist_shift_orat( sched_kw_wconhist_type * kw , const char * well_name, double shift_value); -void sched_kw_wconhist_shift_grat( sched_kw_wconhist_type * kw , const char * well_name, double shift_value); -void sched_kw_wconhist_shift_wrat( sched_kw_wconhist_type * kw , const char * well_name, double shift_value); -void sched_kw_wconhist_update_state(const sched_kw_wconhist_type * kw , wconhist_state_type * state , const char * well_name , int report_step ); - -void sched_kw_wconhist_init_well_list( const sched_kw_wconhist_type * kw , stringlist_type * well_list); - - - -void wconhist_state_free__( void * arg ); -wconhist_state_type * wconhist_state_alloc( const time_t_vector_type * time); -void wconhist_state_free( wconhist_state_type * wconhist ); - -double wconhist_state_iget_STAT( const void * state , int report_step ); - //well_status_enum wconhist_state_iget_status( const void * state , int report_step ); -well_cm_enum wconhist_state_iget_WMCTLH( const void * state , int report_step ); -double wconhist_state_iget_WBHPH( const void * state , int report_step ); -double wconhist_state_iget_WOPRH( const void * state , int report_step ); -double wconhist_state_iget_WGPRH( const void * state , int report_step ); -double wconhist_state_iget_WWPRH( const void * state , int report_step ); -double wconhist_state_iget_WWCTH(const void * state , int report_step ); -double wconhist_state_iget_WGORH(const void * state , int report_step ); -double wconhist_state_iget_WOPTH( const void * state , int report_step ); -double wconhist_state_iget_WWPTH( const void * state , int report_step ); -double wconhist_state_iget_WGPTH( const void * state , int report_step ); - -void sched_kw_wconhist_close_state(wconhist_state_type * state , int report_step ); - - -UTIL_SAFE_CAST_HEADER( sched_kw_wconhist ); -/*******************************************************************/ - - - -KW_HEADER(wconhist) - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_wconinj.h b/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_wconinj.h deleted file mode 100644 index f97d855326..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_wconinj.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_wconinj.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SCHED_KW_WCONINJ_H -#define ERT_SCHED_KW_WCONINJ_H - - -#ifdef __cplusplus -extern "C" { -#endif -#include -#include - -#include -#include - -#include - - -typedef struct sched_kw_wconinj_struct sched_kw_wconinj_type; - - -char ** sched_kw_wconinj_alloc_wells_copy( const sched_kw_wconinj_type * , int * ); - -/*******************************************************************/ - -KW_HEADER(wconinj) - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_wconinje.h b/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_wconinje.h deleted file mode 100644 index 436a56a86a..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_wconinje.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_wconinje.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SCHED_KW_WCONINJE_H -#define ERT_SCHED_KW_WCONINJE_H - - -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include -#include -#include - -#include -#include - - -typedef struct sched_kw_wconinje_struct sched_kw_wconinje_type; -typedef struct wconinje_state_struct wconinje_state_type; - - -sched_phase_enum sched_kw_wconinje_get_phase( const sched_kw_wconinje_type * kw , const char * well_name); -bool sched_kw_wconinje_well_open( const sched_kw_wconinje_type * kw, const char * well_name); -char ** sched_kw_wconinje_alloc_wells_copy( const sched_kw_wconinje_type * , int * ); - -void sched_kw_wconinje_set_surface_flow( const sched_kw_wconinje_type * kw , const char * well, double surface_flow); -void sched_kw_wconinje_scale_surface_flow( const sched_kw_wconinje_type * kw , const char * well, double factor); -double sched_kw_wconinje_get_surface_flow( const sched_kw_wconinje_type * kw , const char * well); -bool sched_kw_wconinje_has_well( const sched_kw_wconinje_type * , const char * ); -sched_kw_wconinje_type * sched_kw_wconinje_safe_cast( void * arg ); -void sched_kw_wconinje_shift_surface_flow( const sched_kw_wconinje_type * kw , const char * well_name , double delta_surface_flow); -bool sched_kw_wconinje_buffer_fwrite( const sched_kw_wconinje_type * kw , const char * well_name , buffer_type * buffer); -bool sched_kw_wconinje_historical( const sched_kw_wconinje_type * kw ); - -void sched_kw_wconinje_close_state(wconinje_state_type * state , int report_step ); -void sched_kw_wconinje_update_state( const sched_kw_wconinje_type * kw , wconinje_state_type * state , const char * well_name , int report_step ); -void wconinje_state_free__( void * arg ); -wconinje_state_type * wconinje_state_alloc( const char * well_name , const time_t_vector_type * time); -void wconinje_state_free( wconinje_state_type * wconinje ); -double wconinje_state_iget_WGIRH( const void * __state , int report_step ); -double wconinje_state_iget_WWIRH( const void * __state , int report_step ); -void sched_kw_wconinje_init_well_list( const sched_kw_wconinje_type * kw , stringlist_type * well_list); - -/*******************************************************************/ - - - -KW_HEADER(wconinje) - - - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_wconinjh.h b/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_wconinjh.h deleted file mode 100644 index 2b4b7d9a64..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_wconinjh.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_wconinjh.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SCHED_KW_WCONINJH_H -#define ERT_SCHED_KW_WCONINJH_H -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include -#include -#include - -#include -#include - - - -typedef struct sched_kw_wconhist_struct sched_kw_wconinjh_type; -typedef struct wconinjh_state_struct wconinjh_state_type; - -sched_kw_wconinjh_type * sched_kw_wconinjh_fscanf_alloc( FILE *, bool *, const char *); -void sched_kw_wconinjh_free(sched_kw_wconinjh_type * ); -void sched_kw_wconinjh_fprintf(const sched_kw_wconinjh_type * , FILE *); -void sched_kw_wconinjh_fwrite(const sched_kw_wconinjh_type *, FILE *); -sched_kw_wconinjh_type * sched_kw_wconinjh_fread_alloc( FILE *); - -hash_type * sched_kw_wconinjh_alloc_well_obs_hash(const sched_kw_wconinjh_type *); - -void sched_kw_wconinjh_init_well_list( const sched_kw_wconinjh_type * kw , stringlist_type * well_list); -void sched_kw_wconinjh_update_state( const sched_kw_wconinjh_type * kw , wconinjh_state_type * state , const char * well_name , int report_step ); -void wconinjh_state_free__( void * arg ); -wconinjh_state_type * wconinjh_state_alloc( const time_t_vector_type * time); -void wconinjh_state_free( wconinjh_state_type * wconinjh ); -void sched_kw_wconinjh_close_state(wconinjh_state_type * state , int report_step ); - -sched_phase_enum wconinjh_state_iget_phase( const wconinjh_state_type * state , int report_step); -well_status_enum wconinjh_state_iget_status( const wconinjh_state_type * state , int report_step ); - - -double wconinjh_state_iget_WWIRH( const void * __state , int report_step) ; -double wconinjh_state_iget_WGIRH( const void * __state , int report_step) ; -double wconinjh_state_iget_WOIRH( const void * __state , int report_step) ; -double wconinjh_state_iget_WBHPH( const void * __state , int report_step) ; -double wconinjh_state_iget_WTHPH( const void * __state , int report_step) ; -double wconinjh_state_iget_WVPRH( const void * __state , int report_step) ; -int wconinjh_state_iget_vfp_table_nr( const wconinjh_state_type * state , int report_step) ; - -/*******************************************************************/ -KW_HEADER(wconinjh) - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_wconprod.h b/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_wconprod.h deleted file mode 100644 index 4ccd93a02c..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_wconprod.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_wconprod.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SCHED_KW_WCONPROD_H -#define ERT_SCHED_KW_WCONPROD_H - - -#ifdef __cplusplus -extern "C" { -#endif -#include - - - typedef struct sched_kw_wconprod_struct sched_kw_wconprod_type; - - - char ** sched_kw_wconprod_alloc_wells_copy( const sched_kw_wconprod_type * , int * ); - void sched_kw_wconprod_init_well_list( const sched_kw_wconprod_type * kw , stringlist_type * well_list); - - - -KW_HEADER(wconprod) - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_welspecs.h b/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_welspecs.h deleted file mode 100644 index d07acef2a9..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/sched_kw_welspecs.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_welspecs.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SCHED_KW_WELSPECS_H -#define ERT_SCHED_KW_WELSPECS_H -#ifdef __cplusplus -extern "C" { -#endif -#include -#include - -#include - -#include - - - -/*************************************************************/ - -typedef struct sched_kw_welspecs_struct sched_kw_welspecs_type; - - - -sched_kw_welspecs_type * sched_kw_welspecs_fscanf_alloc(FILE *, bool *, const char *); -sched_kw_welspecs_type * sched_kw_welspecs_fread_alloc(FILE *); -void sched_kw_welspecs_free(sched_kw_welspecs_type *); -void sched_kw_welspecs_fprintf(const sched_kw_welspecs_type *, FILE *); -void sched_kw_welspecs_fwrite(const sched_kw_welspecs_type *, FILE *); - -void sched_kw_welspecs_alloc_child_parent_list(const sched_kw_welspecs_type *, char ***, char ***, int *); -void sched_kw_welspecs_init_child_parent_list( const sched_kw_welspecs_type * kw , stringlist_type * child , stringlist_type * parent); -/*******************************************************************/ - - - -KW_HEADER(welspecs) - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/sched_macros.h b/ThirdParty/Ert/libsched/include/ert/sched/sched_macros.h deleted file mode 100644 index f578e8ac82..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/sched_macros.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_macros.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SCHED_MACROS_H_ -#define ERT_SCHED_MACROS_H_ - - - -/*********************************** -Macros for "voidifications" of the data handlers. - - - *_IMPL - The implementation - - *_HEADER - Header - - None. - Name. - -***********************************/ - -#define KW_FREE(KW) sched_kw_## KW ##_free__ -#define KW_FPRINTF(KW) sched_kw_## KW ##_fprintf__ -#define KW_COPYC(KW) sched_kw_## KW ##_copyc__ -#define KW_ALLOC(KW) sched_kw_## KW ##_alloc__ - -#define GET_DATA_HANDLERS(DH, KWNAME) \ -DH.token_alloc = KW_ALLOC( KWNAME) ; \ -DH.free = KW_FREE( KWNAME) ; \ -DH.fprintf = KW_FPRINTF( KWNAME) ; \ -DH.copyc = NULL/*KW_ALLOC_COPY(KWNAME)*/ ; - -/*******************************************************************/ - -#define KW_ALLOC_IMPL(KW) \ -void * sched_kw_## KW ##_alloc__(const stringlist_type * tokens , int * token_index ) \ -{ \ - return (void *) sched_kw_## KW ##_alloc(tokens , token_index); \ -} - - -#define KW_FPRINTF_IMPL(KW) \ -void sched_kw_## KW ##_fprintf__(const void * kw, FILE * stream) \ -{ \ - sched_kw_## KW ##_fprintf((const sched_kw_## KW ##_type *) kw, stream); \ -} \ - -#define KW_FREE_IMPL(KW) \ -void sched_kw_## KW ##_free__(void * kw) \ -{ \ - sched_kw_## KW ##_free((sched_kw_## KW ##_type *) kw);\ -} \ - - -#define KW_COPYC_IMPL(KW) \ -void * sched_kw_## KW ##_copyc__(const void * kw) { \ - return sched_kw_ ## KW ## _copyc(kw); \ -} - -#define KW_IMPL(KW) \ -KW_FREE_IMPL(KW) \ -KW_FPRINTF_IMPL(KW) \ -KW_ALLOC_IMPL(KW) \ -KW_COPYC_IMPL(KW) - - - -/*******************************************************************/ - -#define KW_ALLOC_HEADER(KW) \ -void * sched_kw_## KW ##_alloc__(const stringlist_type * tokens , int * token_index) ; \ - -#define KW_COPYC_HEADER(KW) \ -void * sched_kw_## KW ##_copyc__(const void *); \ - -#define KW_FPRINTF_HEADER(KW) \ -void sched_kw_## KW ##_fprintf__(const void *, FILE * ); \ - -#define KW_FREE_HEADER(KW) \ -void sched_kw_## KW ##_free__(void *); \ - -#endif - - -#define KW_HEADER(KW) \ -KW_FREE_HEADER(KW) \ -KW_FPRINTF_HEADER(KW) \ -KW_ALLOC_HEADER(KW) \ -KW_COPYC_HEADER(KW) diff --git a/ThirdParty/Ert/libsched/include/ert/sched/sched_time.h b/ThirdParty/Ert/libsched/include/ert/sched/sched_time.h deleted file mode 100644 index 179b27ed3f..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/sched_time.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_time.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SCHED_TIME_H -#define ERT_SCHED_TIME_H -#ifdef __cplusplus -extern "C" { -#endif -#include - -typedef struct sched_time_struct sched_time_type; - -sched_time_type * sched_time_alloc( time_t date , double tstep_length , sched_time_enum time_type ); -void sched_time_free( sched_time_type * time_node ); -void sched_time_free__( void * arg ); -time_t sched_time_get_date( const sched_time_type * time_node ); -time_t sched_time_get_type( const sched_time_type * time_node ); -time_t sched_time_get_target( const sched_time_type * time_node , time_t current_time); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/sched_types.h b/ThirdParty/Ert/libsched/include/ert/sched/sched_types.h deleted file mode 100644 index a8b7b60cf1..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/sched_types.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_types.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SCHED_TYPES_H -#define ERT_SCHED_TYPES_H -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/** - Contains numerous typedefs for the types used in the sched_kw keywords. -*/ - - -/* - The two (supported) keywords used for time stepping. -*/ - -typedef enum { DATES_TIME = 1, - TSTEP_TIME = 2 } sched_time_enum; - - - -typedef double (sched_history_callback_ftype) (const void * , int); - - - - -typedef enum { INJECTOR = 1, - PRODUCER = 2 } well_state_well_type; - - - -/** - This enum is used for internalizing both the sched_kw_wconhist - keyword, and the sched_kw_wconinje keyword. Observe that the 'AUTO' - mode is only applicable when used in injector context. -*/ - - -typedef enum { DEFAULT = 0, - OPEN = 1, - STOP = 2, - SHUT = 3, - AUTO = 4 } well_status_enum; - - -/** - There is no default injector type. -*/ -typedef enum {WATER = 0 , - GAS = 1 , - OIL = 2 } sched_phase_enum; - - -/** - This enum is used to enumerate the different control modes. Observe - that the enum is used BOTH by the WCONHIST and the WCONINJE - keywords (only the enum value 'RESV' is actually shared between the - two keywords. - - The final element in the enum 'CM_SHUT' is only used internally; that - will never be in the schedule file. -*/ - -typedef enum {RESV = 0, /* Injector || Producer */ - RATE = 1, /* Injector */ - BHP = 2, /* Injector */ - THP = 3, /* Injector */ - GRUP = 4, /* Injector */ - ORAT = 5, /* Producer */ - WRAT = 6, /* Producrer */ - GRAT = 7, /* Producer */ - LRAT = 8, /* Producer */ - CM_SHUT = 100 } well_cm_enum; - - -#define CM_RATE_STRING "RATE" -#define CM_RESV_STRING "RESV" -#define CM_BHP_STRING "BHP" -#define CM_THP_STRING "THP" -#define CM_GRUP_STRING "GRUP" -#define CM_ORAT_STRING "ORAT" -#define CM_WRAT_STRING "WRAT" -#define CM_GRAT_STRING "GRAT" -#define CM_LRAT_STRING "LRAT" - - -/*****************************************************************/ - -#define FIELD_GROUP "FIELD" - -/*****************************************************************/ - - - -typedef enum {NONE = 0, - WCONHIST = 1, - DATES = 2, - COMPDAT = 4, - TSTEP = 8, - TIME = 16, /* Not implemented support */ - WELSPECS = 32, - GRUPTREE = 64, - INCLUDE = 128, - UNTYPED = 256, - WCONINJ = 512, - WCONINJE = 1024, - WCONINJH = 2048, - WCONPROD = 4096, - NUM_SCHED_KW_TYPES = 8192} sched_kw_type_enum; - - -sched_kw_type_enum sched_kw_type_from_string(const char * kw_name); -const char * sched_kw_type_name(sched_kw_type_enum kw_type); - -/*****************************************************************/ -sched_phase_enum sched_phase_type_from_string(const char * type_string); -const char * sched_phase_type_string(sched_phase_enum type); -const char * sched_types_get_status_string(well_status_enum status); -well_status_enum sched_types_get_status_from_string(const char * st_string); - -well_cm_enum sched_types_get_cm_from_string(const char * cm_string , bool wconhist); -const char * sched_types_get_cm_string( well_cm_enum cm ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/sched_util.h b/ThirdParty/Ert/libsched/include/ert/sched/sched_util.h deleted file mode 100644 index d7b0171955..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/sched_util.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_util.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_SCHED_UTIL_H -#define ERT_SCHED_UTIL_H -#ifdef __cplusplus -extern "C" { -#endif -#include -#include - -#include - -#define SCHED_KW_DEFAULT_ITEM "*" - -char * sched_util_alloc_line(FILE *, bool *); -void sched_util_parse_line(const char * , int * , char *** , int , bool *); - - -void sched_util_fprintf_int(bool , int , int , FILE *); -void sched_util_fprintf_dbl(bool , double , int , int , FILE *); -double sched_util_atof(const char *); -int sched_util_atoi(const char *); -void sched_util_fprintf_qst(bool , const char * , int , FILE *); -void sched_util_fprintf_tokenlist(int num_token , const char ** token_list , const bool * def); -void sched_util_skip_trailing_tokens( const stringlist_type * tokens , int * __token_index ); -void sched_util_skip_newline( const stringlist_type * tokens , int * __token_index ); -stringlist_type * sched_util_alloc_line_tokens( const stringlist_type * tokens , bool untyped , int num_tokens , int * __token_index); -void sched_util_init_default(const stringlist_type * line_tokens , bool * def); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/well_history.h b/ThirdParty/Ert/libsched/include/ert/sched/well_history.h deleted file mode 100644 index 617d4da657..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/well_history.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'well_history.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_WELL_HISTORY -#define ERT_WELL_HISTORY - -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include -#include -#include -#include - -typedef struct well_history_struct well_history_type; - - - - - bool well_history_is_producer( const well_history_type * well_history , int report_step ); - wconhist_state_type * well_history_get_wconhist( well_history_type * well_history ); - well_history_type * well_history_alloc( const char * well_name , const time_t_vector_type * time); - void well_history_free__(void * arg); - void well_history_add_keyword( well_history_type * well_history, const sched_kw_type * sched_kw , int report_step ); - const void * well_history_get_state_ptr( const well_history_type * well_history , sched_kw_type_enum kw_type ); - const char * well_history_get_name( const well_history_type * well_history ); - - sched_kw_type_enum well_history_iget_active_kw( const well_history_type * history , int report_step ); - double well_history_iget( well_index_type * index , int report_step ); - void well_history_set_parent( well_history_type * child_well , int report_step , const group_history_type * parent_group); - group_history_type * well_history_get_parent( well_history_type * child_well , int report_step ); - - bool well_history_well_open( const well_history_type * well_history , int report_step ); - double well_history_iget_WGPRH( const well_history_type * well_history , int report_step ); - double well_history_iget_WOPRH( const well_history_type * well_history , int report_step ); - double well_history_iget_WWPRH( const well_history_type * well_history , int report_step ); - - UTIL_IS_INSTANCE_HEADER( well_history ); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/ThirdParty/Ert/libsched/include/ert/sched/well_index.h b/ThirdParty/Ert/libsched/include/ert/sched/well_index.h deleted file mode 100644 index 15c7cd1589..0000000000 --- a/ThirdParty/Ert/libsched/include/ert/sched/well_index.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'well_index.h' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#ifndef ERT_WELL_INDEX_H -#define ERT_WELL_INDEX_H - -#ifdef __cplusplus -extern "C" { -#endif -#include - -#include - -typedef struct well_index_struct well_index_type; - - -well_index_type * well_index_alloc( const char * well_name , const char * variable , const void * state_ptr , sched_kw_type_enum kw_type , sched_history_callback_ftype * func); -void well_index_free( well_index_type * well_index ); -void well_index_free__( void * arg ); -void well_index_add_type( well_index_type * index , sched_kw_type_enum kw_type , sched_history_callback_ftype * func); -sched_history_callback_ftype * well_index_get_callback( const well_index_type * well_index , sched_kw_type_enum kw_type); -const void * well_index_get_state__( const void * index ); -const void * well_index_get_state( const well_index_type * well_index ); -const char * well_index_get_name( const well_index_type * well_index ); -const char * well_index_get_variable( const well_index_type * well_index ); - - -UTIL_IS_INSTANCE_HEADER( well_index ); -UTIL_SAFE_CAST_HEADER_CONST( well_index ); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/ThirdParty/Ert/libsched/src/CMakeLists.txt b/ThirdParty/Ert/libsched/src/CMakeLists.txt deleted file mode 100644 index f98e985b36..0000000000 --- a/ThirdParty/Ert/libsched/src/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -set( source_files sched_history.c group_index.c sched_time.c sched_blob.c well_index.c well_history.c group_history.c sched_types.c sched_kw.c sched_file.c sched_kw_untyped.c sched_kw_gruptree.c sched_kw_tstep.c sched_kw_dates.c sched_kw_wconhist.c sched_kw_wconinjh.c sched_kw_welspecs.c sched_util.c history.c sched_kw_wconprod.c sched_kw_wconinj.c sched_kw_wconinje.c sched_kw_compdat.c sched_kw_include.c gruptree.c) - -set( header_files sched_history.h sched_time.h group_index.h sched_blob.h well_index.h group_history.h well_history.h sched_types.h sched_file.h sched_kw.h sched_kw_untyped.h sched_kw_gruptree.h sched_kw_tstep.h sched_kw_dates.h sched_kw_wconhist.h sched_kw_wconinjh.h sched_kw_welspecs.h sched_util.h history.h sched_kw_wconprod.h sched_kw_wconinj.h sched_kw_wconinje.h sched_kw_compdat.h sched_kw_include.h sched_macros.h gruptree.h) - -include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ) -include_directories( ${libutil_build_path} ) -include_directories( ${libutil_src_path} ) - -add_library( sched ${LIBRARY_TYPE} ${source_files} ) -set_target_properties( sched PROPERTIES VERSION ${ERT_VERSION_MAJOR}.${ERT_VERSION_MINOR} SOVERSION ${ERT_VERSION_MAJOR} ) - -target_link_libraries( sched ert_util ecl) -if (USE_RUNPATH) - add_runpath( sched ) -endif() -#----------------------------------------------------------------- -if (INSTALL_ERT) - install(TARGETS sched DESTINATION ${CMAKE_INSTALL_LIBDIR}) - foreach(header ${header_files}) - install(FILES ../include/ert/sched/${header} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/ert/sched) - endforeach() -endif() - - diff --git a/ThirdParty/Ert/libsched/src/group_history.c b/ThirdParty/Ert/libsched/src/group_history.c deleted file mode 100644 index 50adb787bd..0000000000 --- a/ThirdParty/Ert/libsched/src/group_history.c +++ /dev/null @@ -1,391 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'group_history.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -#define GROUP_HISTORY_TYPE_ID 5100635 - - -struct group_history_struct { - UTIL_TYPE_ID_DECLARATION; - char * group_name; - bool well_group; /* If true this group contains wells, otehrwise it contains other groups. */ - const time_t_vector_type * time; - int start_time; /* At which report step was this group first defined? */ - size_t_vector_type * parent; - size_t_vector_type * children; - vector_type * children_storage; - int __active_step; /* Internal variable to ensure that several repeated calls to add_child / del_child work on the correct child_hash instance. */ -}; - -UTIL_SAFE_CAST_FUNCTION( group_history , GROUP_HISTORY_TYPE_ID ) -UTIL_SAFE_CAST_FUNCTION_CONST( group_history , GROUP_HISTORY_TYPE_ID ) -UTIL_IS_INSTANCE_FUNCTION( group_history , GROUP_HISTORY_TYPE_ID) - -group_history_type * group_history_alloc( const char * group_name , const time_t_vector_type * time , int report_step) { - group_history_type * group_history = util_malloc( sizeof * group_history ); - - UTIL_TYPE_ID_INIT( group_history , GROUP_HISTORY_TYPE_ID ); - - group_history->time = time; - group_history->group_name = util_alloc_string_copy( group_name ); - group_history->children_storage = vector_alloc_new(); - group_history->children = size_t_vector_alloc(0,0); - group_history->start_time = report_step; - /* - We install an empty child hash immediately - so the children - table will never contain NULL. - */ - { - hash_type * child_hash = hash_alloc(); - vector_append_owned_ref( group_history->children_storage , child_hash , hash_free__ ); - size_t_vector_iset_default( group_history->children , 0 , ( size_t ) child_hash ); - } - - - group_history->parent = size_t_vector_alloc(0, ( size_t ) NULL ); - group_history->__active_step = -1; - return group_history; -} - - - -void group_history_free( group_history_type * group_history ) { - vector_free( group_history->children_storage ); - size_t_vector_free( group_history->children ); - size_t_vector_free( group_history->parent ); - - free( group_history->group_name ); - free( group_history ); -} - - -bool group_history_group_exists( const group_history_type * group_history , int report_step) { - if ( report_step >= group_history->start_time) - return true; - else - return false; -} - - - -void group_history_free__( void * arg ){ - group_history_type * group_history = group_history_safe_cast( arg ); - group_history_free( group_history ); -} - - -static void group_history_set_parent( group_history_type * child_group , int report_step , const group_history_type * parent_group) { - size_t_vector_iset_default( child_group->parent , report_step , ( size_t ) parent_group); -} - - -static group_history_type * group_history_get_parent( group_history_type * child_group , int report_step ) { - return (group_history_type *) size_t_vector_safe_iget( child_group->parent , report_step ); -} - - - -static void group_history_ensure_private_child_list(group_history_type * group_history , int report_step) { - if (group_history->__active_step != report_step) { - /* - We wish to modify the child-parent relationships at this - report_step; and the internal flag __active_step tells us that - the current elemement in the children pointer table is not - created at this report step; i.e. we must create a new child - hash instance and install at this report step. - - For each repeated call the input parameter @report_step must - be >= @report_step from the previous call; otherwise things - will break hard. - */ - - hash_type * new_child_hash = hash_alloc(); /* Allocate the new new hash table, - and fill it up with the current list - of children. */ - { - hash_type * old_child_hash = ( hash_type * ) size_t_vector_safe_iget( group_history->children , report_step ); - hash_iter_type * old_iter = hash_iter_alloc( old_child_hash ); - while (!hash_iter_is_complete( old_iter )) { - const char * child_name = hash_iter_get_next_key( old_iter ); - void * child = hash_get( old_child_hash , child_name ); - - hash_insert_ref( new_child_hash , child_name , child ); - } - hash_iter_free( old_iter ); - } - - vector_append_owned_ref( group_history->children_storage , new_child_hash , hash_free__ ); /* Store it in the storge area. */ - size_t_vector_iset_default( group_history->children , report_step , ( size_t ) new_child_hash ); - group_history->__active_step = report_step; - } -} - - -static void group_history_del_child( group_history_type * group_history , const char * child_name , int report_step ) { - group_history_ensure_private_child_list( group_history , report_step ); - { - hash_type * child_hash = (hash_type *) size_t_vector_iget( group_history->children , report_step ); - hash_del( child_hash , child_name ); - } -} - - -void group_history_fprintf(const group_history_type * group_history , int report_step , bool recursive , FILE * stream ) { - fprintf(stream , "\n----------------------------------------------------------------------\n"); - fprintf(stream , "Group: %s \n",group_history->group_name); - - { - hash_type * child_hash = (hash_type *) size_t_vector_safe_iget( group_history->children , report_step ); - hash_iter_type * child_iter = hash_iter_alloc( child_hash ); - int counter = 0; - while (!hash_iter_is_complete( child_iter )) { - - const char * name = hash_iter_get_next_key( child_iter ); - const void * child = hash_get( child_hash , name ); - if ( group_history_is_instance( child )) - fprintf(stream , "%8s(G) ",name); - else - fprintf(stream , "%8s(W) ",name); - counter++; - if ((counter % 4) == 0) - fprintf(stream , "\n"); - - } - fprintf(stream , "\n----------------------------------------------------------------------\n"); - if (recursive) { - hash_iter_restart( child_iter ); - while (!hash_iter_is_complete( child_iter )) { - - const char * name = hash_iter_get_next_key( child_iter ); - const void * child = hash_get( child_hash , name ); - if ( group_history_is_instance( child )) - group_history_fprintf( child , report_step , recursive , stream ); - } - } - hash_iter_free( child_iter ); - } -} - - -void group_history_add_child(group_history_type * group_history , void * child_history , const char * child_name , int report_step ) { - bool well_child = well_history_is_instance( child_history ) ? true : false; - - - /* - If the child is already in a parent-child relationship; the child - must first be orphaned by removing it as a child from parents' child-list. - */ - - { - group_history_type * old_parent; - if (well_child) - old_parent = well_history_get_parent( child_history , report_step ); - else - old_parent = group_history_get_parent( child_history , report_step ); - - if (old_parent != NULL) - group_history_del_child( old_parent , child_name , report_step ); - } - - - group_history_ensure_private_child_list( group_history , report_step ); - /*1: Establishing the child relationship. */ - { - hash_type * child_hash; - child_hash = (hash_type *) size_t_vector_iget( group_history->children , report_step ); /* This should NOT use the safe_iget() function, because we always should work an per-report_step instance. */ - hash_insert_ref( child_hash , child_name , child_history); /* Establish parent -> child link. */ - } - - - /*2: Setting the opposite, i.e. parent <- child relationship. */ - if (well_child) - well_history_set_parent( child_history , report_step , group_history ); - else if (group_history_is_instance( child_history )) - group_history_set_parent( child_history , report_step , group_history ); - -} - - -void group_history_init_child_names( group_history_type * group_history , int report_step , stringlist_type * child_names ) { - stringlist_clear( child_names ); - { - hash_type * child_hash = (hash_type *) size_t_vector_safe_iget( group_history->children , report_step ); /* Get a pointer to child hash instance valid at this report_step. */ - hash_iter_type * child_iter = hash_iter_alloc( child_hash ); - while ( !hash_iter_is_complete( child_iter )) { - const char * child_name = hash_iter_get_next_key( child_iter ); - stringlist_append_copy( child_names , child_name ); - } - hash_iter_free( child_iter ); - } -} - - -const char * group_history_get_name( const group_history_type * group_history ) { - return group_history->group_name; -} - - -/*****************************************************************/ - -double group_history_iget_GOPRH( const void * __group_history , int report_step ) { - const group_history_type * group_history = group_history_safe_cast_const( __group_history ); - { - double GOPRH = 0; - - hash_type * child_hash = (hash_type *) size_t_vector_safe_iget( group_history->children , report_step ); /* Get a pointer to child hash instance valid at this report_step. */ - hash_iter_type * child_iter = hash_iter_alloc( child_hash ); - while ( !hash_iter_is_complete( child_iter )) { - const char * child_name = hash_iter_get_next_key( child_iter ); - const void * child = hash_get( child_hash , child_name ); - if (group_history_is_instance( child )) - GOPRH += group_history_iget_GOPRH( child , report_step ); - else { - double WOPRH = well_history_iget_WOPRH( child , report_step ); - GOPRH += WOPRH; - } - } - hash_iter_free( child_iter ); - - return GOPRH; - } -} - - - -double group_history_iget_GWPRH( const void * __group_history , int report_step ) { - const group_history_type * group_history = group_history_safe_cast_const( __group_history ); - { - double GWPRH = 0; - - hash_type * child_hash = (hash_type *) size_t_vector_safe_iget( group_history->children , report_step ); /* Get a pointer to child hash instance valid at this report_step. */ - hash_iter_type * child_iter = hash_iter_alloc( child_hash ); - while ( !hash_iter_is_complete( child_iter )) { - const char * child_name = hash_iter_get_next_key( child_iter ); - const void * child = hash_get( child_hash , child_name ); - if (group_history_is_instance( child )) - GWPRH += group_history_iget_GWPRH( child , report_step ); - else - GWPRH += well_history_iget_WWPRH( child , report_step ); - } - hash_iter_free( child_iter ); - - return GWPRH; - } -} - - - - -double group_history_iget_GGPRH( const void * __group_history , int report_step ) { - const group_history_type * group_history = group_history_safe_cast_const( __group_history ); - { - double GGPRH = 0; - - hash_type * child_hash = (hash_type *) size_t_vector_safe_iget( group_history->children , report_step ); /* Get a pointer to child hash instance valid at this report_step. */ - hash_iter_type * child_iter = hash_iter_alloc( child_hash ); - while ( !hash_iter_is_complete( child_iter )) { - const char * child_name = hash_iter_get_next_key( child_iter ); - const void * child = hash_get( child_hash , child_name ); - if (group_history_is_instance( child )) - GGPRH += group_history_iget_GGPRH( child , report_step ); - else - GGPRH += well_history_iget_WGPRH( child , report_step ); - } - hash_iter_free( child_iter ); - - return GGPRH; - } -} - - -double group_history_iget_GGPTH( const void * __group_history , int report_step ) { - const group_history_type * group_history = group_history_safe_cast_const( __group_history ); - double GGPTH = 0; - for (int tstep = 1; tstep <= report_step; tstep++) { - double days = (time_t_vector_iget( group_history->time , tstep ) - time_t_vector_iget( group_history->time , tstep - 1)) * 1.0 / 86400 ; - double rate = group_history_iget_GGPRH( __group_history , tstep ); - GGPTH += rate * days; - } - return GGPTH; -} - - -double group_history_iget_GOPTH( const void * __group_history , int report_step ) { - const group_history_type * group_history = group_history_safe_cast_const( __group_history ); - double GOPTH = 0; - for (int tstep = 1; tstep <= report_step; tstep++) { - double days = (time_t_vector_iget( group_history->time , tstep ) - time_t_vector_iget( group_history->time , tstep - 1)) * 1.0 / 86400 ; - double rate = group_history_iget_GOPRH( __group_history , tstep ); - GOPTH += rate * days; - } - return GOPTH; -} - - -double group_history_iget_GWPTH( const void * __group_history , int report_step ) { - const group_history_type * group_history = group_history_safe_cast_const( __group_history ); - double GWPTH = 0; - for (int tstep = 1; tstep <= report_step; tstep++) { - double days = (time_t_vector_iget( group_history->time , tstep ) - time_t_vector_iget( group_history->time , tstep - 1)) * 1.0 / 86400 ; - double rate = group_history_iget_GWPRH( __group_history , tstep ); - GWPTH += rate * days; - } - return GWPTH; -} - - - - -double group_history_iget_GGORH( const void * __group_history , int report_step ) { - double GGPRH = group_history_iget_GGPRH( __group_history , report_step ); - double GOPRH = group_history_iget_GOPRH( __group_history , report_step ); - - return GGPRH / GOPRH; -} - - - -double group_history_iget_GWCTH( const void * __group_history , int report_step ) { - double GWPRH = group_history_iget_GWPRH( __group_history , report_step ); - double GOPRH = group_history_iget_GOPRH( __group_history , report_step ); - - return GWPRH / GOPRH; -} - - - - - - -double group_history_iget( const void * index , int report_step ) { - const group_history_type * group_history = group_index_get_state__( index ); - sched_history_callback_ftype * func = group_index_get_callback( index ); - - return func( group_history , report_step ); -} diff --git a/ThirdParty/Ert/libsched/src/group_index.c b/ThirdParty/Ert/libsched/src/group_index.c deleted file mode 100644 index 1078242c10..0000000000 --- a/ThirdParty/Ert/libsched/src/group_index.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'group_index.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -#include -#include -#include - -#include -#include - - -#define GROUP_INDEX_TYPE_ID 96580631 - - -struct group_index_struct { - UTIL_TYPE_ID_DECLARATION; - char * group_name; - char * variable; - const void * group_history; - sched_history_callback_ftype * func; -}; - - - - - -UTIL_IS_INSTANCE_FUNCTION( group_index , GROUP_INDEX_TYPE_ID ) -UTIL_SAFE_CAST_FUNCTION_CONST( group_index , GROUP_INDEX_TYPE_ID ) - - -group_index_type * group_index_alloc( const char * group_name , const char * variable , const void * group_history , sched_history_callback_ftype * func ) { - group_index_type * group_index = util_malloc( sizeof * group_index ); - - UTIL_TYPE_ID_INIT( group_index , GROUP_INDEX_TYPE_ID ); - - group_index->func = func; - group_index->group_history = group_history; - group_index->group_name = util_alloc_string_copy( group_name ); - group_index->variable = util_alloc_string_copy( variable ); - - - return group_index; -} - - -void group_index_free( group_index_type * index ) { - free( index->group_name ); - free( index->variable ); - free( index ); -} - - -void group_index_free__( void * arg ) { - group_index_free( (group_index_type *) arg ); -} - - - -sched_history_callback_ftype * group_index_get_callback( const group_index_type * group_index ) { - return group_index->func; -} - - -const char * group_index_get_name( const group_index_type * group_index ) { - return group_index->group_name; -} - -const char * group_index_get_variable( const group_index_type * group_index ) { - return group_index->variable; -} - - - -const void * group_index_get_state( const group_index_type * group_index ) { - return group_index->group_history; -} - - - -const void * group_index_get_state__( const void * index ) { - const group_index_type * group_index = group_index_safe_cast_const( index ); - return group_index_get_state( group_index ); -} - - diff --git a/ThirdParty/Ert/libsched/src/gruptree.c b/ThirdParty/Ert/libsched/src/gruptree.c deleted file mode 100644 index 67da8d5bb7..0000000000 --- a/ThirdParty/Ert/libsched/src/gruptree.c +++ /dev/null @@ -1,546 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'gruptree.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include - -#include - - -/* - The gruptree struct is made for internalizing the - GRUPTREE keyword from a schedule section. - - It provides functions which allows for easy - manipulating of, and access to, the tree structure. - - Since the gruptree may change during simulation, - and the changes are usually only given in differences, - i.e. the whole gruptree is NOT restated, we provide a - way to easily create a new gruptree to reflect the changes. - - - - EXAMPLE: - - Schedule file: - ---------------------------- - - SKIPREST - .... - .... - - GRUPTREE - GRPA FIELD/ - GRPB FIELD/ - INJE GRPA/ - / - - TSTEP - 100 / - .... - .... - - GRUPTREE - INJE GRPB / - PROD GRPA / - / - - TSTEP - 200 / - ... - ... - ---------------------------- - - Now, after the first timestep, INJE is no longer - a subgroup of GRPA, but GRPB. However, the rest - of the GRUPTREE at the first time step is still - valid! Note also that a new group PROD has been - added. - - Suppose that you want to create two gruptree's - one for each time step. This can be done as follows. - - - C code: - ---------------------------- - - gruptree_type * tree_one = gruptree_alloc(); - gruptree_register_grup(tree_two, "GRPA", "FIELD"); - gruptree_register_grup(tree_two, "GRPB", "FIELD"); - gruptree_register_grup(tree_two, "INJE", "GRPA"); - - gruptree_type * tree_two = gruptree_copyc(tree_one); - gruptree_register_grup(tree_two, "INJE", "GRPB"); - gruptree_register_grup(tree_two, "PROD", "GRPA"); - - ..... - ..... - - gruptree_free(tree_one); - gruptree_free(tree_two); -*/ - - - -typedef struct grup_struct grup_type; -typedef struct well_struct well_type; - - - -struct grup_struct{ - bool isleaf; - bool isfield; /* Field node can have both wells and grups as children. */ - char * name; - - const grup_type * parent; - hash_type * children; /* If not a leaf grup, pointers to other grups, - if leaf grup, pointers to wells. Special case - for FIELD, which can contain both wells and - grups. */ -}; - - - -struct well_struct{ - char * name; - const grup_type * parent; -}; - - - -struct gruptree_struct{ - hash_type * grups; - hash_type * wells; -}; - - - -/*************************************************************************/ - - - -static grup_type * grup_alloc(const char * name, const grup_type * parent) -{ - grup_type * grup = util_malloc(sizeof * grup); - - grup->isleaf = true; - grup->isfield = false; - grup->name = util_alloc_string_copy(name); - grup->parent = parent; - grup->children = hash_alloc(); - - return grup; -} - - - -static void grup_free(grup_type * grup) -{ - free(grup->name); - hash_free(grup->children); - free(grup); -} - - - -static void grup_free__(void * grup) -{ - grup_free( (grup_type *) grup); -} - - - -static const char * grup_get_parent_name(const grup_type * grup) -{ - if(grup->parent != NULL) - return grup->parent->name; - else - return NULL; -} - - - -static well_type * well_alloc(const char * name, const grup_type * parent) -{ - well_type * well = util_malloc(sizeof * well); - well->name = util_alloc_string_copy(name); - well->parent = parent; - return well; -} - - -static void well_free(well_type * well) -{ - free(well->name); - free(well); -} - - - -static void well_free__(void * well) -{ - well_free( (well_type *) well); -} - - - -static const char * well_get_parent_name(const well_type * well) -{ - return well->parent->name; -} - - - -/** - This function is called recursively ... -*/ -static void gruptree_well_hash_iter__(gruptree_type * gruptree, const char * grupname, hash_type * well_hash) -{ - - if(!hash_has_key(gruptree->grups, grupname)) - util_abort("%s: Internal error - grupname %s is not in hash.\n", __func__, grupname); - - grup_type * grup = hash_get(gruptree->grups, grupname); - if(grup->isfield) - util_abort("%s: Internal error - no support for grups with isfield flag.\n", __func__); - - if(!grup->isleaf) - { - int size = hash_get_size(grup->children); - char ** keylist = hash_alloc_keylist(grup->children); - - for(int i=0; ichildren); - char ** keylist = hash_alloc_keylist(grup->children); - for(int i=0; iwells, keylist[i]); - hash_insert_ref(well_hash, keylist[i], well); - } - util_free_stringlist(keylist, size); - } -} - - - -static gruptree_type * gruptree_alloc_empty() -{ - gruptree_type * gruptree = util_malloc(sizeof * gruptree); - gruptree->grups = hash_alloc(); - gruptree->wells = hash_alloc(); - return gruptree; -} - - - -/*************************************************************************/ - - -gruptree_type * gruptree_alloc() -{ - gruptree_type * gruptree = gruptree_alloc_empty(); - - grup_type * field = grup_alloc("FIELD", NULL); - field->isfield = true; - hash_insert_hash_owned_ref(gruptree->grups, "FIELD", field, grup_free__); - - return gruptree; -} - - - -void gruptree_free(gruptree_type * gruptree) -{ - hash_free(gruptree->grups); - hash_free(gruptree->wells); - free(gruptree); -} - - - -void gruptree_register_grup(gruptree_type * gruptree, const char * name, const char * parent_name) -{ - grup_type * parent; - grup_type * newgrp; - - ////////////////////////////////////////////////////////// - - if(name == NULL) - util_abort("%s: Trying to insert group %s with NULL name - aborting.\n", __func__, name); - if(parent_name == NULL) - util_abort("%s: Trying to insert group %s with NULL parent - aborting.\n", __func__, name); - if(strcmp(name, parent_name) == 0) - util_abort("%s: Trying to insert group %s with itself as parent - aborting.\n", __func__, name); - - if(strcmp(name, "FIELD") == 0) - util_abort("%s: Internal error - insertion of group FIELD is not allowed - aborting.\n", __func__); - - ////////////////////////////////////////////////////////// - - if(!hash_has_key(gruptree->grups, parent_name)) - gruptree_register_grup(gruptree, parent_name, "FIELD"); - - parent = hash_get(gruptree->grups, parent_name); - - if(parent->isleaf && !parent->isfield && hash_get_size(parent->children) > 0) - { - util_abort("%s: Group %s contains wells, cannot contain other groups.\n", __func__, parent_name); - } - - if(hash_has_key(gruptree->grups, name)) - { - newgrp = hash_get(gruptree->grups, name); - hash_del(newgrp->parent->children, name); - - newgrp->parent = parent; - } - else - { - newgrp = grup_alloc(name, parent); - hash_insert_hash_owned_ref(gruptree->grups, name, newgrp, grup_free__); - } - - parent->isleaf = false; - hash_insert_ref(parent->children, name, newgrp); -} - - - -void gruptree_register_well(gruptree_type * gruptree, const char * name, const char * parent_name) -{ - grup_type * parent; - well_type * well; - - if(!hash_has_key(gruptree->grups, parent_name)) - gruptree_register_grup(gruptree, parent_name, "FIELD"); - - parent = hash_get(gruptree->grups, parent_name); - - if(!parent->isleaf && !parent->isfield) - util_abort("%s: Group %s is not FIELD and contains other groups, cannot contain wells.\n", __func__, parent_name); - - if(hash_has_key(gruptree->wells, name)) - { - well = hash_get(gruptree->wells, name); - hash_del(well->parent->children, name); - well->parent = parent; - } - else - { - well = well_alloc(name, parent); - hash_insert_hash_owned_ref(gruptree->wells, name, well, well_free__); - } - hash_insert_ref(well->parent->children, name, well); -} - - - -bool gruptree_has_grup(const gruptree_type * gruptree, const char * grupname) -{ - if(hash_has_key(gruptree->grups, grupname)) - { - return true; - } - else - { - return false; - } -} - - -char ** gruptree_alloc_grup_well_list(gruptree_type * gruptree, const char * grupname, int * num_wells) -{ - char ** well_names; - - if(!hash_has_key(gruptree->grups, grupname)) - util_abort("%s: Group %s is not present in the gruptree.\n", __func__, grupname); - - if(strcmp(grupname, "FIELD") == 0) - { - *num_wells = hash_get_size(gruptree->wells); - well_names = hash_alloc_keylist(gruptree->wells); - } - else - { - hash_type * well_hash = hash_alloc(); - gruptree_well_hash_iter__(gruptree, grupname, well_hash); - - *num_wells = hash_get_size(well_hash); - well_names = hash_alloc_keylist(well_hash); - - hash_free(well_hash); - } - - return well_names; -} - - - -gruptree_type * gruptree_copyc(const gruptree_type * gruptree) -{ - gruptree_type * gruptree_new = gruptree_alloc(); - - { - int num_grups = hash_get_size(gruptree->grups); - char ** grup_list = hash_alloc_keylist(gruptree->grups); - for(int i=0; igrups, grup_list[i]); - gruptree_register_grup(gruptree_new, grup_list[i], grup_get_parent_name(grup)); - } - util_free_stringlist(grup_list, num_grups); - } - - { - int num_wells = hash_get_size(gruptree->wells); - char ** well_list = hash_alloc_keylist(gruptree->wells); - for(int i=0; iwells, well_list[i]); - gruptree_register_well(gruptree_new, well_list[i], well_get_parent_name(well)); - } - util_free_stringlist(well_list, num_wells); - - } - - return gruptree_new; -} - - - -void gruptree_fwrite(const gruptree_type * gruptree, FILE * stream) -{ - { - int num_grups = hash_get_size(gruptree->grups); - char ** grup_list = hash_alloc_keylist(gruptree->grups); - - util_fwrite(&num_grups, sizeof num_grups, 1, stream, __func__); - - for(int i=0; igrups, grup_list[i]); - const char * parent_name = grup_get_parent_name(grup); - - util_fwrite_string(grup_list[i], stream); - util_fwrite_string(parent_name, stream); - } - util_free_stringlist(grup_list, num_grups); - } - - { - int num_wells = hash_get_size(gruptree->wells); - char ** well_list = hash_alloc_keylist(gruptree->wells); - - util_fwrite(&num_wells, sizeof num_wells, 1, stream, __func__); - - for(int i=0; iwells, well_list[i]); - const char * parent_name = well_get_parent_name(well); - util_fwrite_string(well_list[i], stream); - util_fwrite_string(parent_name, stream); - } - util_free_stringlist(well_list, num_wells); - - } - -} - - - -gruptree_type * gruptree_fread_alloc(FILE * stream) -{ - gruptree_type * gruptree = gruptree_alloc(); - { - int num_grups; - util_fread(&num_grups, sizeof num_grups, 1, stream, __func__); - for(int i=0; i - for more details. -*/ - -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - - -#define HISTORY_TYPE_ID 66143109 - -struct history_struct{ - UTIL_TYPE_ID_DECLARATION; - const ecl_sum_type * refcase; /* ecl_sum instance used when the data are taken from a summary instance. Observe that this is NOT owned by history instance.*/ - const sched_file_type * sched_file; /* Not owned. */ - sched_history_type * sched_history; - history_source_type source; -}; - - -history_source_type history_get_source_type( const char * string_source ) { - history_source_type source_type = HISTORY_SOURCE_INVALID; - - if (strcmp( string_source , "REFCASE_SIMULATED") == 0) - source_type = REFCASE_SIMULATED; - else if (strcmp( string_source , "REFCASE_HISTORY") == 0) - source_type = REFCASE_HISTORY; - else if (strcmp( string_source , "SCHEDULE") == 0) - source_type = SCHEDULE; - else - util_abort("%s: Sorry source:%s not recognized\n",__func__ , string_source); - - return source_type; -} - - -const char * history_get_source_string( history_source_type history_source ) { - switch( history_source ) { - case( REFCASE_SIMULATED ): - return "REFCASE_SIMULATED"; - break; - case(REFCASE_HISTORY ): - return "REFCASE_HISTORY"; - break; - case(SCHEDULE ): - return "SCHEDULE"; - break; - default: - util_abort("%s: internal fuck up \n",__func__); - return NULL; - } -} - - -UTIL_IS_INSTANCE_FUNCTION( history , HISTORY_TYPE_ID ) - - -static history_type * history_alloc_empty( ) -{ - history_type * history = util_malloc(sizeof * history); - UTIL_TYPE_ID_INIT( history , HISTORY_TYPE_ID ); - history->refcase = NULL; - history->sched_history = NULL; - history->sched_file = NULL; - return history; -} - - - -/******************************************************************/ -// Exported functions for manipulating history_type. Acess functions further below. - - -void history_free(history_type * history) -{ - if (history->sched_history != NULL) - sched_history_free( history->sched_history ); - - free(history); -} - - -history_type * history_alloc_from_sched_file(const char * sep_string , const sched_file_type * sched_file) -{ - history_type * history = history_alloc_empty( ); - history->sched_file = sched_file; - history->sched_history = sched_history_alloc( sep_string ); - sched_history_update( history->sched_history , sched_file ); - history->source = SCHEDULE; - - return history; -} - - -history_type * history_alloc_from_refcase(const ecl_sum_type * refcase , bool use_h_keywords) { - history_type * history = history_alloc_empty( true ); - - history->refcase = refcase; /* This function does not really do anthing - it just sets the ecl_sum field of the history instance. */ - if (use_h_keywords) - history->source = REFCASE_HISTORY; - else - history->source = REFCASE_SIMULATED; - - return history; -} - - - - - -/******************************************************************/ -// Exported functions for accessing history_type. - - - - -int history_get_last_restart(const history_type * history) { - if (history->refcase != NULL) - return ecl_sum_get_last_report_step( history->refcase); - else - return sched_history_get_last_history( history->sched_history ); -} - - - - - - - - -bool history_init_ts( const history_type * history , const char * summary_key , double_vector_type * value, bool_vector_type * valid) { - bool initOK = false; - - double_vector_reset( value ); - bool_vector_reset( valid ); - bool_vector_set_default( valid , false); - - if (history->source == SCHEDULE) { - - for (int tstep = 0; tstep <= sched_history_get_last_history(history->sched_history); tstep++) { - if (sched_history_open( history->sched_history , summary_key , tstep)) { - initOK = true; - bool_vector_iset( valid , tstep , true ); - double_vector_iset( value , tstep , sched_history_iget( history->sched_history , summary_key , tstep)); - } else - bool_vector_iset( valid , tstep , false ); - } - - - } else { - - char * local_key; - if (history->source == REFCASE_HISTORY) { - /* Must create a new key with 'H' for historical values. */ - const ecl_smspec_type * smspec = ecl_sum_get_smspec( history->refcase ); - const char * join_string = ecl_smspec_get_join_string( smspec ); - ecl_smspec_var_type var_type = ecl_smspec_identify_var_type( summary_key ); - - if ((var_type == ECL_SMSPEC_WELL_VAR) || (var_type == ECL_SMSPEC_GROUP_VAR)) - local_key = util_alloc_sprintf( "%sH%s%s" , - ecl_sum_get_keyword( history->refcase , summary_key ) , - join_string , - ecl_sum_get_wgname( history->refcase , summary_key )); - else if (var_type == ECL_SMSPEC_FIELD_VAR) - local_key = util_alloc_sprintf( "%sH" , ecl_sum_get_keyword( history->refcase , summary_key )); - else - local_key = NULL; // If we try to get historical values of e.g. Region quantities it will fail. - } else - local_key = (char *) summary_key; - - if (local_key) { - if (ecl_sum_has_general_var( history->refcase , local_key )) { - for (int tstep = 0; tstep <= history_get_last_restart(history); tstep++) { - int time_index = ecl_sum_iget_report_end( history->refcase , tstep ); - if (time_index >= 0) { - double_vector_iset( value , tstep , ecl_sum_get_general_var( history->refcase , time_index , local_key )); - bool_vector_iset( valid , tstep , true ); - } else - bool_vector_iset( valid , tstep , false ); /* Did not have this report step */ - } - initOK = true; - } - - if (history->source == REFCASE_HISTORY) - free( local_key ); - } - } - return initOK; -} - - -time_t history_get_start_time( const history_type * history ) { - if (history->source == SCHEDULE) - return sched_history_iget_time_t( history->sched_history , 0); - else - return ecl_sum_get_start_time( history->refcase ); -} - - - -/* Uncertain about the first node - offset problems +++ ?? - Changed to use node_end_time() at svn ~ 2850 - - Changed to sched_history at svn ~2940 -*/ -time_t history_get_time_t_from_restart_nr( const history_type * history , int restart_nr) { - if (history->source == SCHEDULE) - return sched_history_iget_time_t( history->sched_history , restart_nr); - else { - if (restart_nr == 0) - return ecl_sum_get_start_time( history->refcase ); - else - return ecl_sum_get_report_time( history->refcase , restart_nr ); - } -} - - -int history_get_restart_nr_from_time_t( const history_type * history , time_t time) { - if (time == history_get_start_time( history )) - return 0; - else { - if (history->source == SCHEDULE) - return sched_file_get_restart_nr_from_time_t( history->sched_file , time ); - else { - int report_step = ecl_sum_get_report_step_from_time( history->refcase , time ); - if (report_step >= 1) - return report_step; - else { - int mday,year,month; - util_set_date_values_utc( time , &mday , &month , &year); - util_abort("%s: Date: %02d/%02d/%04d does not cooincide with any report time. Aborting.\n", __func__ , mday , month , year); - return -1; - } - } - } -} - - -int history_get_restart_nr_from_days( const history_type * history , double sim_days) { - if (history->source == SCHEDULE) - return sched_file_get_restart_nr_from_days( history->sched_file , sim_days); - else { - int report_step = ecl_sum_get_report_step_from_days( history->refcase , sim_days); - if (report_step >= 1) - return report_step; - else { - util_abort("%s: Days:%g does not cooincide with any report time. Aborting.\n", __func__ , sim_days); - return -1; - } - } -} - - - diff --git a/ThirdParty/Ert/libsched/src/sched_blob.c b/ThirdParty/Ert/libsched/src/sched_blob.c deleted file mode 100644 index 1c1b394924..0000000000 --- a/ThirdParty/Ert/libsched/src/sched_blob.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_blob.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include -#include - -#include -#include -#include - - - - - -struct sched_blob_struct { - char * buffer; - time_t start_time; - sched_time_type * time_step; /* Either a date into the 'future' - or a TSTEP. This is the end time of the blob.*/ -}; - - - -static void sched_blob_append_buffer( sched_blob_type * blob , const char * new_buffer ) { - blob->buffer = util_strcat_realloc( blob->buffer , new_buffer ); -} - - -void sched_blob_append_token( sched_blob_type * blob , const char * token ) { - char * new_buffer = util_calloc( (strlen(token) + 2) , sizeof * new_buffer ); - sched_blob_append_buffer( blob , new_buffer ); - free( new_buffer ); -} - - - -sched_blob_type * sched_blob_alloc() { - sched_blob_type * blob = util_malloc( sizeof * blob ); - blob->buffer = NULL; - blob->time_step = NULL; - return blob; -} - - -int sched_blob_get_size( const sched_blob_type * blob ) { - if (blob->buffer == NULL) - return 0; - else - return strlen( blob->buffer ); -} - - - -void sched_blob_free( sched_blob_type * blob ) { - util_safe_free( blob->buffer ); - if (blob->time_step != NULL) - sched_time_free( blob->time_step ); - free( blob ); -} - - - - -void sched_blob_fprintf( const sched_blob_type * blob , FILE * stream ) { - fprintf(stream , "%s" , blob->buffer ); -} diff --git a/ThirdParty/Ert/libsched/src/sched_file.c b/ThirdParty/Ert/libsched/src/sched_file.c deleted file mode 100644 index 4a54d02720..0000000000 --- a/ThirdParty/Ert/libsched/src/sched_file.c +++ /dev/null @@ -1,1013 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_file.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -/* This sched_file.c contains code for internalizing an ECLIPSE - schedule file. - - Two structs are defined in this file: - - 1. The sched_file_struct, which can be accessed externaly - through various interface functions. - - 2. The sched_block_struct, which is for internal use. - - The internalization function 'sched_file_parse' splits the ECLIPSE - schedule file into a sequence of 'sched_block_type's, where a single - block contains one or more keywords. Except for the first block, which - is empty per definition, the last keyword in a block will always be - a timing keyword like DATES or TSTEP. Thus, the number of blocks in - the sched_file_struct will always cooincide with the number of - restart files in the ECLIPSE simulation. In order to make this work, - TSTEP and DATES keyword containing multiple data, are split into - a sequence of keywords. - - Note the following: - - 1. This implies that scheduling data after the last timing - keyword is irrelevant. This is similar to how ECLIPSE works. - - 2. Scheduling data after keyword END is ignored, since this - is interpreted as the end of the SCHEDULE section. - -*/ - -#define SCHED_FILE_TYPE_ID 677198 - -struct sched_block_struct { - vector_type * kw_list; /* A list of sched_kw's in the block. */ - time_t block_start_time; - time_t block_end_time; - hash_type * kw_hash; /* Hash table indexed with kw_name - containing vectors of kw instances . */ -}; - - - -struct sched_file_struct { - UTIL_TYPE_ID_DECLARATION; - hash_type * fixed_length_table; /* A hash table of keywords with a fixed length, i.e. not '/' terminated. */ - vector_type * kw_list; - vector_type * kw_list_by_type; - vector_type * blocks; /* A list of chronologically sorted sched_block_type's. */ - stringlist_type * files; /* The name of the files which have been parsed to generate this sched_file instance. */ - time_t start_time; /* The start of the simulation. */ - bool hasEND; -}; - - - -/************************************************************************/ - - - -static sched_block_type * sched_block_alloc_empty() -{ - sched_block_type * block = util_malloc(sizeof * block); - block->kw_list = vector_alloc_new(); - block->kw_hash = hash_alloc(); - return block; -} - - - - - -static void sched_block_free(sched_block_type * block) -{ - vector_free( block->kw_list ); - hash_free( block->kw_hash ); - free(block); -} - - - -static void sched_block_free__(void * block) -{ - sched_block_free( (sched_block_type *) block); -} - - - -static void sched_block_add_kw(sched_block_type * block, const sched_kw_type * kw) -{ - vector_append_ref(block->kw_list , kw ); - if (!hash_has_key( block->kw_hash , sched_kw_get_name( kw ))) - hash_insert_hash_owned_ref( block->kw_hash , sched_kw_get_name( kw ) , vector_alloc_new() , vector_free__); - - { - vector_type * kw_vector = hash_get( block->kw_hash , sched_kw_get_name( kw )); - vector_append_ref( kw_vector , kw ); - } -} - - -sched_kw_type * sched_block_iget_kw(sched_block_type * block, int i) -{ - return vector_iget( block->kw_list , i); -} - - - - - -static void sched_block_fprintf(const sched_block_type * block, FILE * stream) -{ - int i; - for (i=0; i < vector_get_size(block->kw_list); i++) { - const sched_kw_type * sched_kw = vector_iget_const( block->kw_list , i); - sched_kw_fprintf(sched_kw, stream); - } -} - - - -int sched_block_get_size(const sched_block_type * block) -{ - return vector_get_size(block->kw_list); -} - - - - - -static sched_kw_type * sched_block_get_last_kw_ref(sched_block_type * block) -{ - int last_index = vector_get_size( block->kw_list ) - 1; - return sched_block_iget_kw( block , last_index ); -} - - - -static void sched_file_add_block(sched_file_type * sched_file, sched_block_type * block) -{ - vector_append_owned_ref(sched_file->blocks , block , sched_block_free__); -} - - - -sched_block_type * sched_file_iget_block(const sched_file_type * sched_file, int i) -{ - return vector_iget(sched_file->blocks , i); -} - -/** - This is a fucking mess: - - block[0] start_time - start_time - block[1] start_time - time of first report, i.e. X0001 - block[2] X0001 - X0002 - .... - - The reason for this funny convention is to ensure one-to-one index - correspondance between the restart files and the sched_file blocks - (I think ...). -*/ - - - -static void sched_file_build_block_dates(sched_file_type * sched_file) -{ - int num_restart_files = sched_file_get_num_restart_files(sched_file); - time_t curr_time, new_time; - - if(num_restart_files < 1) - util_abort("%s: Error - empty sched_file - aborting.\n", __func__); - - /* Special case for block 0. */ - sched_block_type * sched_block = sched_file_iget_block(sched_file, 0); - sched_block->block_start_time = sched_file->start_time ; - sched_block->block_end_time = sched_file->start_time ; - - curr_time = sched_file->start_time; - for(int i=1; iblock_start_time = curr_time; - - sched_kw_type * timing_kw = sched_block_get_last_kw_ref(sched_block); - new_time = sched_kw_get_new_time(timing_kw, curr_time); - - if(curr_time > new_time) - util_abort("%s: Schedule file contains negative timesteps - aborting.\n",__func__); - - curr_time = new_time; - sched_block->block_end_time = curr_time; - } -} - - - - -/******************************************************************************/ - - - -static void sched_file_add_kw( sched_file_type * sched_file , const sched_kw_type * kw) { - vector_append_owned_ref( sched_file->kw_list , kw , sched_kw_free__); -} - - -static void sched_file_update_index( sched_file_type * sched_file ) { - int ikw; - - - /* By type index */ - { - if (sched_file->kw_list_by_type != NULL) - vector_free( sched_file->kw_list_by_type ); - sched_file->kw_list_by_type = vector_alloc_NULL_initialized( NUM_SCHED_KW_TYPES ); - for (ikw = 0; ikw < vector_get_size( sched_file->kw_list ); ikw++) { - const sched_kw_type * kw = vector_iget_const( sched_file->kw_list , ikw ); - sched_kw_type_enum type = sched_kw_get_type( kw ); - { - vector_type * tmp = vector_iget( sched_file->kw_list_by_type , type ); - - if (tmp == NULL) { - tmp = vector_alloc_new(); - vector_iset_owned_ref( sched_file->kw_list_by_type , type , tmp , vector_free__ ); - } - - vector_append_ref( tmp , kw ); - } - } - } - - - - /* Block based on restart number. */ - { - time_t current_time; - sched_block_type * current_block; - vector_clear( sched_file->blocks ); - - /* - Adding a pseudo block at the start which runs from the start of - time (i.e. EPOCH start 01/01/1970) to simulation start. - */ - current_block = sched_block_alloc_empty( 0 ); - current_block->block_start_time = sched_file->start_time;//-1; /* Need this funny node - hhmmmmmm */ - current_block->block_end_time = sched_file->start_time; - sched_file_add_block( sched_file , current_block ); - - current_block = sched_block_alloc_empty( 0 ); - current_block->block_start_time = sched_file->start_time; - current_time = sched_file->start_time; - - for (ikw = 0; ikw < vector_get_size( sched_file->kw_list ); ikw++) { - const sched_kw_type * kw = vector_iget_const( sched_file->kw_list , ikw ); - sched_kw_type_enum type = sched_kw_get_type( kw ); - { - sched_block_add_kw( current_block , kw ); - if(type == DATES || type == TSTEP || type == TIME) { - /** - Observe that when we enocunter a time-based keyword we do the following: - - 1. Finish the the current block by setting the end_time - field and add this block to the sched_file - structure. - - 2. Create a new block starting at current time. - - ------- - - Blocks are not actually added to the sched_file instance - before they are terminated with a DATES/TSTEP - keyword. This implies that keywords which come after the - last DATES/TSTEP keyword are lost. - */ - - current_time = sched_kw_get_new_time( kw , current_time ); - - /* Finishing off the current block, and adding it to the sched_file. */ - current_block->block_end_time = current_time; - sched_file_add_block( sched_file , current_block ); - - /* Creating a new block - not yet added to the sched_file. */ - current_block = sched_block_alloc_empty( vector_get_size( sched_file->blocks )); - current_block->block_start_time = current_time; - } - } - } - /* - Free the last block, which has not been added to the sched_file - object. - */ - sched_block_free( current_block ); - } -} - - - -void sched_file_add_fixed_length_kw( sched_file_type * sched_file , const char * kw , int length ) { - hash_insert_int( sched_file->fixed_length_table, kw , length ); -} - - - -static void sched_file_init_fixed_length( sched_file_type * sched_file ) { - sched_file_add_fixed_length_kw(sched_file , "NEXTSTEP" , 1); - sched_file_add_fixed_length_kw(sched_file , "RPTSCHED" , 1); - sched_file_add_fixed_length_kw(sched_file , "DRSDT" , 1); - sched_file_add_fixed_length_kw(sched_file , "SKIPREST" , 0); - sched_file_add_fixed_length_kw(sched_file , "NOECHO" , 0); - sched_file_add_fixed_length_kw(sched_file , "ECHO" , 0); - sched_file_add_fixed_length_kw(sched_file , "RPTRST" , 1); - sched_file_add_fixed_length_kw(sched_file , "TUNING" , 3); - sched_file_add_fixed_length_kw(sched_file , "WHISTCTL" , 1); - sched_file_add_fixed_length_kw(sched_file , "TIME" , 1); - sched_file_add_fixed_length_kw(sched_file , "VAPPARS" , 1); - sched_file_add_fixed_length_kw(sched_file , "NETBALAN" , 1); - sched_file_add_fixed_length_kw(sched_file , "WPAVE" , 1); - sched_file_add_fixed_length_kw(sched_file , "VFPTABL" , 1); - sched_file_add_fixed_length_kw(sched_file , "GUIDERAT" , 1); - sched_file_add_fixed_length_kw(sched_file , "MESSAGES" , 1); - sched_file_add_fixed_length_kw(sched_file , "LIFTOPT" , 1); -} - - -sched_file_type * sched_file_alloc(time_t start_time) -{ - sched_file_type * sched_file = util_malloc(sizeof * sched_file); - UTIL_TYPE_ID_INIT( sched_file , SCHED_FILE_TYPE_ID); - sched_file->kw_list = vector_alloc_new(); - sched_file->kw_list_by_type = NULL; - sched_file->blocks = vector_alloc_new(); - sched_file->files = stringlist_alloc_new(); - sched_file->start_time = start_time; - sched_file->fixed_length_table = hash_alloc(); - sched_file->hasEND = false; - sched_file_init_fixed_length( sched_file ); - { - char * fixed_length_file = getenv("SCHEDULE_FIXED_LENGTH"); - if ((fixed_length_file != NULL) && (util_entry_readable( fixed_length_file ))) { - FILE * stream = util_fopen(fixed_length_file , "r"); - char kw[32]; - int len; - bool OK = true; - - do { - if (fscanf(stream , "%s %d" , kw , &len) == 2) - sched_file_add_fixed_length_kw( sched_file , kw , len); - else - OK = false; - } while (OK); - fclose( stream); - } - } - return sched_file; -} - - -UTIL_SAFE_CAST_FUNCTION(sched_file , SCHED_FILE_TYPE_ID); - - -void sched_file_free(sched_file_type * sched_file) -{ - vector_free( sched_file->blocks ); - vector_free( sched_file->kw_list ); - if (sched_file->kw_list_by_type != NULL) - vector_free( sched_file->kw_list_by_type ); - - stringlist_free( sched_file->files ); - hash_free( sched_file->fixed_length_table ); - free(sched_file); -} - - -/** - This function will allocate a time_t_vector instance, which - contains all the time_t values for this schedule_file - starting - with the start_date. -*/ - -time_t_vector_type * sched_file_alloc_time_t_vector( const sched_file_type * sched_file ) { - time_t_vector_type * vector = time_t_vector_alloc(0,0); - int i; - time_t_vector_append( vector , sched_file->start_time ); - for (i=1; i < vector_get_size( sched_file->blocks ); i++) { - const sched_block_type * block = vector_iget_const( sched_file->blocks , i ); - time_t_vector_append( vector , block->block_end_time ); - } - return vector; -} - - -static stringlist_type * sched_file_tokenize( const char * filename ) { - stringlist_type * token_list; - basic_parser_type * parser = basic_parser_alloc(" \t" , /* Splitters */ - "\'\"" , /* Quoters */ - "\n" , /* Specials - splitters which will be kept. */ - "\r" , /* Delete set - these are just deleted. */ - "--" , /* Comment start */ - "\n"); /* Comment end */ - bool strip_quote_marks = false; - token_list = basic_parser_tokenize_file( parser , filename , strip_quote_marks ); - basic_parser_free( parser ); - - return token_list; -} - - -/** - This function parses 'further', i.e typically adding another - schedule file to the sched_file instance. -*/ - -void sched_file_parse_append(sched_file_type * sched_file , const char * filename) { - bool foundEND = false; - stringlist_type * token_list = sched_file_tokenize( filename ); - sched_kw_type * current_kw; - int token_index = 0; - do { - sched_util_skip_newline( token_list , &token_index ); - current_kw = sched_kw_token_alloc(token_list , &token_index , sched_file->fixed_length_table, &foundEND); - if (current_kw != NULL) { - sched_kw_type_enum type = sched_kw_get_type(current_kw); - if (type == DATES || type == TSTEP || type == TIME) { - int i , num_steps; - sched_kw_type ** sched_kw_dates = sched_kw_split_alloc_DATES(current_kw, &num_steps); - sched_kw_free(current_kw); - - for(i=0; ihasEND = true; - - stringlist_append_copy( sched_file->files , filename ); - sched_file_build_block_dates(sched_file); - sched_file_update_index( sched_file ); - stringlist_free( token_list ); -} - - -void sched_file_simple_parse( const char * filename , time_t start_time) { - stringlist_type * token_list = sched_file_tokenize( filename ); - const int num_tokens = stringlist_get_size( token_list ); - int token_index = 0; - do { - sched_kw_type_enum kw_type = sched_kw_type_from_string( stringlist_iget( token_list , token_index )); - if ((kw_type == DATES) || (kw_type == TSTEP)) { - - } - } while( token_index < num_tokens ); - - stringlist_free( token_list ); -} - - - -void sched_file_parse(sched_file_type * sched_file, const char * filename) -{ - /* - Add the first empty pseudo block - this runs from time -infty:start_date. - */ - sched_file_add_block(sched_file , sched_block_alloc_empty()); - sched_file_parse_append( sched_file , filename ); -} - - - -sched_file_type * sched_file_parse_alloc(const char * filename , time_t start_date) { - sched_file_type * sched_file = sched_file_alloc( start_date ); - sched_file_parse(sched_file , filename); - return sched_file; -} - - - -int sched_file_get_num_restart_files(const sched_file_type * sched_file) -{ - return vector_get_size(sched_file->blocks); -} - - - -static void sched_file_fprintf_i__(const sched_file_type * sched_file, int last_restart_file, const char * file , bool addEND) -{ - FILE * stream = util_fopen(file, "w"); - int num_restart_files = sched_file_get_num_restart_files(sched_file); - - - last_restart_file = util_int_min( last_restart_file , num_restart_files - 1); - - if (last_restart_file > num_restart_files) { - util_abort("%s: you asked for restart nr:%d - the last available restart nr is: %d \n",__func__ , last_restart_file , num_restart_files); - /* Must abort here because the calling scope is expecting to find last_restart_file. */ - } - - for(int i=0; i<= last_restart_file; i++) - { - const sched_block_type * sched_block = vector_iget_const( sched_file->blocks , i); - sched_block_fprintf(sched_block, stream); - } - - if (addEND) - fprintf(stream, "END\n"); - - fclose(stream); -} - - -void sched_file_fprintf_i(const sched_file_type * sched_file, int last_restart_file, const char * file) { - sched_file_fprintf_i__( sched_file , last_restart_file , file , true); -} - - -/* Writes the complete schedule file. */ -void sched_file_fprintf(const sched_file_type * sched_file, const char * file) -{ - int num_restart_files = sched_file_get_num_restart_files(sched_file); - sched_file_fprintf_i__( sched_file , num_restart_files - 1 , file , sched_file->hasEND); -} - - - - - -/* - const char * sched_file_get_filename(const sched_file_type * sched_file) { - return sched_file->filename; - } -*/ - - -int sched_file_get_restart_nr_from_time_t(const sched_file_type * sched_file, time_t time) -{ - int num_restart_files = sched_file_get_num_restart_files(sched_file); - for( int i=0; i time) { - int mday,year,month; - util_set_date_values_utc( time , &mday , &month , &year); - util_abort("%s: Date: %02d/%02d/%04d does not cooincide with any report time. Aborting.\n", __func__ , mday , month , year); - } else if (block_end_time == time) - return i; - } - - // If we are here, time did'nt correspond a restart file. Abort. - { - int mday,year,month; - util_set_date_values_utc( time , &mday , &month , &year); - util_abort("%s: Date: %02d/%02d/%04d does not cooincide with any report time. Aborting.\n", __func__ , mday , month , year); - } - return 0; -} - - -/** - This function finds the restart_nr for the a number of days after - simulation start. -*/ - -int sched_file_get_restart_nr_from_days(const sched_file_type * sched_file , double days) { - time_t time = sched_file_iget_block_start_time(sched_file, 0); - util_inplace_forward_days_utc( &time , days); - return sched_file_get_restart_nr_from_time_t(sched_file , time); -} - - - -time_t sched_file_iget_block_start_time(const sched_file_type * sched_file, int i) -{ - sched_block_type * block = sched_file_iget_block(sched_file, i); - return block->block_start_time; -} - - - -time_t sched_file_iget_block_end_time(const sched_file_type * sched_file, int i) -{ - sched_block_type * block = sched_file_iget_block(sched_file, i); - return block->block_end_time; -} - - -double sched_file_iget_block_start_days(const sched_file_type * sched_file, int i) -{ - sched_block_type * block = sched_file_iget_block(sched_file, i); - return util_difftime_days( sched_file->start_time , block->block_start_time ); -} - - -double sched_file_iget_block_end_days(const sched_file_type * sched_file, int i) -{ - sched_block_type * block = sched_file_iget_block(sched_file, i); - return util_difftime_days( sched_file->start_time , block->block_end_time ); -} - - -double sched_file_get_sim_days(const sched_file_type * sched_file , int report_step) { - return sched_file_iget_block_end_days( sched_file , report_step ); -} - - -time_t sched_file_get_sim_time(const sched_file_type * sched_file , int report_step) { - return sched_file_iget_block_end_time( sched_file , report_step ); -} - - -const char * sched_file_iget_filename( const sched_file_type * sched_file , int file_nr ) { - return stringlist_iget( sched_file->files , file_nr ); -} - - - - -int sched_file_iget_block_size(const sched_file_type * sched_file, int block_nr) -{ - sched_block_type * block = sched_file_iget_block(sched_file, block_nr); - return sched_block_get_size(block); -} - - - -sched_kw_type * sched_file_ijget_block_kw_ref(const sched_file_type * sched_file, int block_nr, int kw_nr) -{ - sched_block_type * block = sched_file_iget_block(sched_file, block_nr); - sched_kw_type * sched_kw = sched_block_iget_kw(block, kw_nr); - return sched_kw; -} - - - -static void __sched_file_summarize_line(int restart_nr , time_t start_time , time_t t , FILE * stream) { - double days = util_difftime( start_time , t , NULL , NULL , NULL , NULL) / (24 * 3600); - int mday , month , year; - - util_set_date_values_utc(t , &mday , &month , &year); - fprintf(stream , "%02d/%02d/%04d %7.1f days %04d \n", mday , month , year , days , restart_nr); -} - - - - -void sched_file_summarize(const sched_file_type * sched_file , FILE * stream) { - int len = sched_file_get_num_restart_files(sched_file); - time_t start_time = sched_file_iget_block_start_time(sched_file , 0); - for(int i=1; istart_time); - - for (ikw = 0; ikw < vector_get_size( src->kw_list ); ikw++) { - sched_kw_type * kw = vector_iget( src->kw_list , ikw ); - sched_file_add_kw( target , kw ); - } - - - { - int i; - for (i = 0; i < stringlist_get_size( src->files ); i++) { - if (deep_copy) - stringlist_append_copy( target->files , stringlist_iget(src->files , i)); - else - stringlist_append_ref( target->files , stringlist_iget(src->files , i)); - } - } - - sched_file_update_index( target ); - return target; -} - - -/*****************************************************************/ - - -static void sched_file_update_block(sched_block_type * block , - int restart_nr, - sched_kw_type_enum kw_type , - sched_file_callback_ftype * callback, - void * arg) { - int ikw; - for (ikw = 0; ikw < vector_get_size(block->kw_list); ikw++) { - sched_kw_type * sched_kw = sched_block_iget_kw( block , ikw); - if (sched_kw_get_type( sched_kw ) == kw_type) - callback( sched_kw_get_data( sched_kw) , restart_nr , arg); /* Calling back to 'user-space' to actually do the update. */ - } -} - - - -/** - This function is designed to facilitate 'user-space' update of the - keywords in the schedule file based on callbacks. The function is - called with two report steps, a type ID of the sched_kw type which - should be updated, and a function pointer which will be invoked on - all the relevant keywords. -*/ - - - -void sched_file_update_blocks(sched_file_type * sched_file, - int restart1 , - int restart2 , - sched_kw_type_enum kw_type, - sched_file_callback_ftype * callback, - void * callback_arg) { - - int restart_nr; - if (restart2 > sched_file_get_num_restart_files(sched_file)) - restart2 = sched_file_get_num_restart_files(sched_file) - 1; - - for (restart_nr = restart1; restart_nr <= restart2; restart_nr++) { - sched_block_type * sched_block = sched_file_iget_block( sched_file , restart_nr ); - sched_file_update_block( sched_block , restart_nr , kw_type , callback , callback_arg); - } -} - - - -/** - Update a complete schedule file by using callbacks to - 'user-space'. Say for instance you want to scale up the oilrate in - well P1. This could be achieved with the following code: - - -- This function is written by the user of the library - in a remote scope. - - void increase_orat_callback(void * void_kw , int restart_nr , void * arg) { - double scale_factor = *(( double * ) arg); - sched_kw_wconhist_type * kw = sched_kw_wconhist_safe_cast( void_kw ); - sched_kw_wconhist_scale_orat( wconhist_kw , "P1" , scale_factor); - } - - .... - .... - - sched_file_update(sched_file , WCONHIST , increase_orat_callback , &scale_factor); - - Observe the following about the callback: - - * The sched_kw input argument comes as a void pointer, and an - sched_kw_xxx_safe_cast() function should be used on input to - check. - - * The user-space level does *NOT* have access to the internals - of the sched_kw_xxxx type, so the library must provide - functions for the relevant state modifications. - - * The last argumnt (void * arg) - can of course be anything and - his brother. - -*/ - - -void sched_file_update(sched_file_type * sched_file, - sched_kw_type_enum kw_type, - sched_file_callback_ftype * callback, - void * callback_arg) { - - sched_file_update_blocks(sched_file , 1 , sched_file_get_num_restart_files(sched_file) - 1 , kw_type , callback , callback_arg); - -} - - - -/*****************************************************************/ -/** - This function will count the number of TSTEP / DATES keywords in a - schedule file, without actually internalizing the file. This - function 'should' be used for schedule files which we do not manage - to parse. -*/ - -int sched_file_step_count( const char * filename ) { - stringlist_type * token_list = sched_file_tokenize( filename ); - int token_index = 0; - int step_count = 0; - do { - const char * current_token = stringlist_iget( token_list , token_index ); - sched_kw_type_enum kw_type = sched_kw_type_from_string( current_token ); - - if (kw_type == DATES) { - sched_kw_type * sched_kw = sched_kw_token_alloc( token_list , &token_index , NULL , NULL); - const sched_kw_dates_type * dates_kw = sched_kw_get_data( sched_kw ); - step_count += sched_kw_dates_get_size( dates_kw ); - sched_kw_free( sched_kw ); - } else if (kw_type == TSTEP ) { - sched_kw_type * sched_kw = sched_kw_token_alloc( token_list , &token_index , NULL , NULL); - const sched_kw_tstep_type * tstep_kw = sched_kw_get_data( sched_kw ); - step_count += sched_kw_tstep_get_length( tstep_kw ); - sched_kw_free( sched_kw ); - } else - token_index++; - - } while ( token_index < stringlist_get_size( token_list )); - stringlist_free( token_list ); - return step_count; -} - - -/*****************************************************************/ - - -//void sched_file_merge( const char * filename , time_t start_date , time_t insert_date , bool append_string , const char * insert_string) { -// stringlist_type * token_list = sched_file_tokenize( filename ); -// int token_index = 0; -// int step_count = 0; -// bool has_date = false; -// -// do { -// time_t current_time = start_date; -// const char * current_token = stringlist_iget( token_list , token_index ); -// sched_kw_type_enum kw_type = sched_kw_type_from_string( current_token ); -// -// if ((kw_type == DATES) || (kw_type == TSTEP)) { -// int istep , num_step; -// sched_kw_type * sched_kw = sched_kw_token_alloc( token_list , &token_index , NULL); -// sched_kw_type ** split_kw = sched_kw_split_alloc_DATES( sched_kw , &num_step ); -// -// for (istep = 0; istep < num_step; istep++) { -// if (kw_type == DATES) { -// const sched_kw_dates_type * dates_kw = sched_kw_get_data( sched_kw ); -// current_time = sched_kw_dates_iget_date( dates_kw , 0 ); -// } -// if (current_time == insert_date) { -// /* -// We are currently looking at a DATES keyword EXACTLY at -// the date we should insert at. If append_string == false -// we let the new string go in immediately, otherwise we set -// has_date to true and continue one more time_step (then -// the current_time > insert_date test will kick in). -// */ -// has_date = true; -// if (!append_string) { -// -// } -// } -// } -// sched_kw_free( sched_kw ); -// -// } else -// token_index++; -// -// } while ( token_index < stringlist_get_size( token_list )); -// -//} -// - - -/*****************************************************************/ - - - -/** - Currently ONLY applicable to WCONHIST producers. - - -*/ - -bool sched_file_well_open( const sched_file_type * sched_file , - int restart_nr , - const char * well_name) { - - bool well_found = false; - bool well_open = false; - int block_nr = restart_nr; - while (!well_found && (block_nr >= 0)) { - sched_block_type * block = sched_file_iget_block( sched_file , block_nr ); - - if (hash_has_key( block->kw_hash , "WCONHIST")) { - const vector_type * wconhist_vector = hash_get( block->kw_hash , "WCONHIST"); - int i; - for (i=0; i < vector_get_size( wconhist_vector ); i++) { - const sched_kw_type * kw = vector_iget_const( wconhist_vector , i ); - if (sched_kw_has_well( kw , well_name )) { - well_found = true; - well_open = sched_kw_well_open( kw , well_name ); - } - } - } - - - if (hash_has_key( block->kw_hash , "WCONINJE")) { - const vector_type * wconinje_vector = hash_get( block->kw_hash , "WCONINJE"); - int i; - for (i=0; i < vector_get_size( wconinje_vector ); i++) { - const sched_kw_type * kw = vector_iget_const( wconinje_vector , i ); - if (sched_kw_has_well( kw , well_name )) { - well_found = true; - well_open = sched_kw_well_open( kw , well_name ); - } - } - } - - - - block_nr--; - } - return well_open; -} - - - - - -double sched_file_well_wconhist_rate( const sched_file_type * sched_file , - int restart_nr , - const char * well_name) { - double rate = -1; - bool well_found = false; - int block_nr = restart_nr; - - while (!well_found && (block_nr >= 0)) { - sched_block_type * block = sched_file_iget_block( sched_file , block_nr ); - - if (hash_has_key( block->kw_hash , "WCONHIST")) { - const vector_type * wconhist_vector = hash_get( block->kw_hash , "WCONHIST"); - int i; - for (i=0; i < vector_get_size( wconhist_vector ); i++) { - sched_kw_type * kw = vector_iget( wconhist_vector , i ); - if (sched_kw_has_well( kw , well_name )) { - well_found = true; - rate = sched_kw_wconhist_get_orat( sched_kw_get_data( kw ) , well_name ); - } - } - } - block_nr--; - } - return rate; -} - - - -double sched_file_well_wconinje_rate( const sched_file_type * sched_file , - int restart_nr , - const char * well_name) { - double rate = -1; - bool well_found = false; - int block_nr = restart_nr; - - while (!well_found && (block_nr >= 0)) { - sched_block_type * block = sched_file_iget_block( sched_file , block_nr ); - - if (hash_has_key( block->kw_hash , "WCONINJE")) { - const vector_type * wconhist_vector = hash_get( block->kw_hash , "WCONINJE"); - int i; - for (i=0; i < vector_get_size( wconhist_vector ); i++) { - sched_kw_type * kw = vector_iget( wconhist_vector , i ); - if (sched_kw_has_well( kw , well_name )) { - well_found = true; - rate = sched_kw_wconinje_get_surface_flow( sched_kw_get_data( kw ) , well_name ); - } - } - } - - block_nr--; - } - return rate; -} - diff --git a/ThirdParty/Ert/libsched/src/sched_history.c b/ThirdParty/Ert/libsched/src/sched_history.c deleted file mode 100644 index adb732ca85..0000000000 --- a/ThirdParty/Ert/libsched/src/sched_history.c +++ /dev/null @@ -1,756 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_history.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -struct sched_history_struct { - hash_type * well_history; /* Hash table of well_history_type instances. */ - hash_type * group_history; - time_t_vector_type * time; - hash_type * index; - char * sep_string; - bool_vector_type * historical; /* This is meant to flag whether a certain report_step is "historical", or - if it is in prediction_mode; changing back and forth between the two - modes seem quite broken behaviour, but I guess it is perfectly - legitimate. */ - int last_history_step; /* The last historical report_step (i.e. the total length is 1+ this value). */ -}; - - -#define FIELD_GROUP "FIELD" - - - - - -/*****************************************************************/ - -well_history_type * sched_history_get_well( const sched_history_type * sched_history , const char * well_name ); - - - -static void sched_history_install_well_index( sched_history_type * sched_history , well_index_type * well_index , const char ** var_list , const char * well_name) { - int index = 0; - char * gen_key = NULL; - const char * var = var_list[ index ]; - bool first = true; - - while ( var != NULL ) { - gen_key = util_realloc_sprintf( gen_key , "%s%s%s" , var , sched_history->sep_string , well_name ); - - if (first) { - first = false; - hash_insert_hash_owned_ref( sched_history->index , gen_key , well_index , well_index_free__); - } else - hash_insert_ref( sched_history->index , gen_key , well_index ); - - index++; - var = var_list[ index ]; - } - - if (first) - util_abort("%s: internal error - empty var_list \n",__func__); - free( gen_key ); -} - - - -static void sched_history_install_group_index( sched_history_type * sched_history , group_index_type * group_index , const char ** var_list , const char * group_name) { - int index = 0; - char * gen_key = NULL; - const char * var = var_list[ index ]; - bool first = true; - - while ( var != NULL ) { - gen_key = util_realloc_sprintf( gen_key , "%s%s%s" , var , sched_history->sep_string , group_name ); - - if (first) { - first = false; - hash_insert_hash_owned_ref( sched_history->index , gen_key , group_index , group_index_free__); - } else - hash_insert_ref( sched_history->index , gen_key , group_index ); - - index++; - var = var_list[ index ]; - } - - if (first) - util_abort("%s: internal error - empty var_list \n",__func__); - free( gen_key ); -} - - - - - -#define VAR_LIST(...) (const char *[]) { __VA_ARGS__ , NULL } - -void sched_history_install_index( sched_history_type * sched_history ) { - /*1: Installing well based keys like WOPRH. */ - { - hash_iter_type * well_iter = hash_iter_alloc( sched_history->well_history ); - while (!hash_iter_is_complete( well_iter )) { - const char * well_name = hash_iter_get_next_key( well_iter ); - const well_history_type * well = hash_get( sched_history->well_history , well_name ); - - /* WOPR */ - { - well_index_type * well_index = well_index_alloc( well_name , "WOPRH" , well , WCONHIST , wconhist_state_iget_WOPRH ); - sched_history_install_well_index( sched_history , well_index , VAR_LIST("WOPR" , "WOPRH") , well_name); - } - - - /* WGPR */ - { - well_index_type * well_index = well_index_alloc( well_name , "WGPRH" , well , WCONHIST , wconhist_state_iget_WGPRH ); - sched_history_install_well_index( sched_history , well_index , VAR_LIST("WGPR" , "WGPRH") , well_name); - } - - - /* WWPR */ - { - well_index_type * well_index = well_index_alloc( well_name , "WWPRH" , well , WCONHIST , wconhist_state_iget_WWPRH ); - sched_history_install_well_index( sched_history , well_index , VAR_LIST("WWPR" , "WWPRH") , well_name); - } - - - /* WWCT */ - { - well_index_type * well_index = well_index_alloc( well_name , "WWCTH" , well , WCONHIST , wconhist_state_iget_WWCTH ); - sched_history_install_well_index( sched_history , well_index , VAR_LIST("WWCT" , "WWCTH") , well_name); - } - - /* WGOR */ - { - well_index_type * well_index = well_index_alloc( well_name , "WGORH" , well , WCONHIST , wconhist_state_iget_WGORH ); - sched_history_install_well_index( sched_history , well_index , VAR_LIST("WGOR" , "WGORH") , well_name); - } - - /* WGPT */ - { - well_index_type * well_index = well_index_alloc( well_name , "WGPTH" , well , WCONHIST , wconhist_state_iget_WGPTH ); - sched_history_install_well_index( sched_history , well_index , VAR_LIST("WGPT" , "WGPTH") , well_name); - } - - /* WOPT */ - { - well_index_type * well_index = well_index_alloc( well_name , "WOPTH" , well , WCONHIST , wconhist_state_iget_WOPTH ); - sched_history_install_well_index( sched_history , well_index , VAR_LIST("WOPT" , "WOPTH") , well_name); - } - - /* WWPT */ - { - well_index_type * well_index = well_index_alloc( well_name , "WWPTH" , well , WCONHIST , wconhist_state_iget_WWPTH ); - sched_history_install_well_index( sched_history , well_index , VAR_LIST("WWPT" , "WWPTH") , well_name); - } - - /* STAT */ - { - well_index_type * well_index = well_index_alloc( well_name , "STAT" , well , WCONHIST , wconhist_state_iget_STAT ); - sched_history_install_well_index( sched_history , well_index , VAR_LIST("STAT" ) , well_name); - } - - - /* WWIRH - this can be got from _either_ the WCONINJH keyowrord - or the WCONINJE keyword (provided the latter is in rate - controlled mode. ) */ - { - well_index_type * well_index = well_index_alloc( well_name , "WWIRH" , well , WCONINJH , wconinjh_state_iget_WWIRH ); /* The first type */ - well_index_add_type( well_index , WCONINJE , wconinje_state_iget_WWIRH ); /* The second type */ - sched_history_install_well_index( sched_history , well_index , VAR_LIST("WWIRH" , "WWIR") , well_name); - } - - /* WGIRH - this can be got from _either_ the WCONINJH keyowrord - or the WCONINJE keyword (provided the latter is in rate - controlled mode. ) */ - { - well_index_type * well_index = well_index_alloc( well_name , "WGIRH" , well , WCONINJH , wconinjh_state_iget_WGIRH ); /* The first type */ - well_index_add_type( well_index , WCONINJE , wconinje_state_iget_WGIRH ); /* The second type */ - sched_history_install_well_index( sched_history , well_index , VAR_LIST("WGIRH" , "WGIR") , well_name); - } - } - hash_iter_free( well_iter ); - } - - - - /*2: Installing group based indices */ - { - hash_iter_type * group_iter = hash_iter_alloc( sched_history->group_history ); - while (!hash_iter_is_complete( group_iter )) { - const char * group_name = hash_iter_get_next_key( group_iter ); - const group_history_type * group = hash_get( sched_history->group_history , group_name ); - - /* GOPR */ - { - group_index_type * group_index = group_index_alloc( group_name , "GOPRH" , group , group_history_iget_GOPRH ); - sched_history_install_group_index( sched_history , group_index , VAR_LIST("GOPR" , "GOPRH") , group_name); - } - - /* GGPR */ - { - group_index_type * group_index = group_index_alloc( group_name , "GGPRH" , group , group_history_iget_GGPRH ); - sched_history_install_group_index( sched_history , group_index , VAR_LIST("GGPR" , "GGPRH") , group_name); - } - - /* GWPR */ - { - group_index_type * group_index = group_index_alloc( group_name , "GWPRH" , group , group_history_iget_GWPRH ); - sched_history_install_group_index( sched_history , group_index , VAR_LIST("GWPR" , "GWPRH") , group_name); - } - - /* GWCT */ - { - group_index_type * group_index = group_index_alloc( group_name , "GWCTH" , group , group_history_iget_GWCTH ); - sched_history_install_group_index( sched_history , group_index , VAR_LIST("GWCT" , "GWCTH") , group_name); - } - - /* GGOR */ - { - group_index_type * group_index = group_index_alloc( group_name , "GGORH" , group , group_history_iget_GGORH ); - sched_history_install_group_index( sched_history , group_index , VAR_LIST("GGOR" , "GGORH") , group_name); - } - - /* GOPT */ - { - group_index_type * group_index = group_index_alloc( group_name , "GOPTH" , group , group_history_iget_GOPTH ); - sched_history_install_group_index( sched_history , group_index , VAR_LIST("GOPT" , "GOPTH") , group_name); - } - - /* GGPT */ - { - group_index_type * group_index = group_index_alloc( group_name , "GGPTH" , group , group_history_iget_GGPTH ); - sched_history_install_group_index( sched_history , group_index , VAR_LIST("GGPT" , "GGPTH") , group_name); - } - - /* GWPT */ - { - group_index_type * group_index = group_index_alloc( group_name , "GWPTH" , group , group_history_iget_GWPTH ); - sched_history_install_group_index( sched_history , group_index , VAR_LIST("GWPT" , "GWPTH") , group_name); - } - } - hash_iter_free( group_iter ); - } - - - /*3: Installing field based indices (which is just an alias to the FIELD group); */ - { - const group_history_type * group = hash_get( sched_history->group_history , FIELD_GROUP ); - const char * group_name = FIELD_GROUP; - - /* FWPRH */ - { - group_index_type * group_index = group_index_alloc( group_name , "GWPRH" , group , group_history_iget_GWPRH ); - hash_insert_hash_owned_ref( sched_history->index , "FWPRH" , group_index , group_index_free__ ); - hash_insert_ref( sched_history->index , "FWPR" , group_index); - } - - /* FOPRH */ - { - group_index_type * group_index = group_index_alloc( group_name , "GOPRH" , group , group_history_iget_GOPRH ); - hash_insert_hash_owned_ref( sched_history->index , "FOPRH" , group_index , group_index_free__ ); - hash_insert_ref( sched_history->index , "FOPR" , group_index); - } - - /* FGPRH */ - { - group_index_type * group_index = group_index_alloc( group_name , "GGPRH" , group , group_history_iget_GGPRH ); - hash_insert_hash_owned_ref( sched_history->index , "FGPRH" , group_index , group_index_free__ ); - hash_insert_ref( sched_history->index , "FGPR" , group_index); - } - - /* FWPTH */ - { - group_index_type * group_index = group_index_alloc( group_name , "GWPTH" , group , group_history_iget_GWPTH ); - hash_insert_hash_owned_ref( sched_history->index , "FWPTH" , group_index , group_index_free__ ); - hash_insert_ref( sched_history->index , "FWPT" , group_index); - } - - /* FOPTH */ - { - group_index_type * group_index = group_index_alloc( group_name , "GOPTH" , group , group_history_iget_GOPTH ); - hash_insert_hash_owned_ref( sched_history->index , "FOPTH" , group_index , group_index_free__ ); - hash_insert_ref( sched_history->index , "FOPT" , group_index); - } - - /* FGPTH */ - { - group_index_type * group_index = group_index_alloc( group_name , "GGPTH" , group , group_history_iget_GGPTH ); - hash_insert_hash_owned_ref( sched_history->index , "FGPTH" , group_index , group_index_free__ ); - hash_insert_ref( sched_history->index , "FGPT" , group_index); - } - - /* FGORH */ - { - group_index_type * group_index = group_index_alloc( group_name , "GGORH" , group , group_history_iget_GGORH ); - hash_insert_hash_owned_ref( sched_history->index , "FGORH" , group_index , group_index_free__ ); - hash_insert_ref( sched_history->index , "FGOR" , group_index); - } - - /* FWCTH */ - { - group_index_type * group_index = group_index_alloc( group_name , "GWCTH" , group , group_history_iget_GWCTH ); - hash_insert_hash_owned_ref( sched_history->index , "FWCTH" , group_index , group_index_free__ ); - hash_insert_ref( sched_history->index , "FWCT" , group_index); - } - } -} -#undef VAR_LIST - - - - -double sched_history_iget( const sched_history_type * sched_history , const char * key , int report_step) { - void * index = hash_get( sched_history->index , key ); - if (!bool_vector_safe_iget( sched_history->historical , report_step )) - fprintf(stderr,"** Warning - report step:%d is in the prediction phase - can NOT ask for historical data! \n",report_step); - - if (well_index_is_instance( index )) - return well_history_iget( index , report_step ); - else if (group_index_is_instance( index )) - return group_history_iget( index , report_step ); - else { - util_abort("%s: can not determine internal type of:%s - fatal internal error\n", __func__ , key); - return 0; - } -} - - - - - - -void sched_history_init_vector( const sched_history_type * sched_history , const char * key , double_vector_type * value) { - const bool * historical = bool_vector_get_ptr( sched_history->historical ); - double_vector_reset( value ); - for (int i=0; i < time_t_vector_size( sched_history->time ); i++) { - if (historical[i]) - double_vector_iset( value , i , sched_history_iget( sched_history , key , i)); - else - break; - } -} - - - -static void sched_history_realloc( sched_history_type * sched_history ) { - if (sched_history->well_history != NULL) - hash_free( sched_history->well_history ); - sched_history->well_history = hash_alloc(); - - if (sched_history->group_history != NULL) - hash_free( sched_history->group_history ); - sched_history->group_history = hash_alloc(); - - if (sched_history->historical != NULL) - bool_vector_free( sched_history->historical ); - sched_history->historical = bool_vector_alloc( 0 , true ); - - if (sched_history->time != NULL) - time_t_vector_free(sched_history->time); - sched_history->time = time_t_vector_alloc( 0 , 0 ); - sched_history->last_history_step = 0; -} - - - -time_t sched_history_iget_time_t( const sched_history_type * sched_history , int restart_nr ) { - return time_t_vector_iget( sched_history->time , restart_nr ); -} - - -sched_history_type * sched_history_alloc( const char * sep_string ) { - sched_history_type * sched_history = util_malloc( sizeof * sched_history ); - - sched_history->well_history = NULL; - sched_history->group_history = NULL; - sched_history->time = NULL; - sched_history->historical = NULL; - sched_history->index = hash_alloc(); - sched_history->sep_string = util_alloc_string_copy( sep_string ); - sched_history_realloc( sched_history ); - - return sched_history; -} - - - -void sched_history_free( sched_history_type * sched_history ) { - time_t_vector_free( sched_history->time ); - bool_vector_free( sched_history->historical ); - hash_free( sched_history->well_history ); - hash_free( sched_history->group_history ); - hash_free( sched_history->index ); - free( sched_history->sep_string ); - free( sched_history ); -} - - - -well_history_type * sched_history_get_well( const sched_history_type * sched_history , const char * well_name ) { - return hash_get( sched_history->well_history , well_name ); -} - - -group_history_type * sched_history_get_group( const sched_history_type * sched_history , const char * group_name ) { - return hash_get( sched_history->group_history , group_name ); -} - - - -static void sched_history_add_wells( sched_history_type * sched_history , const sched_kw_welspecs_type * welspecs , const stringlist_type * wells) { - for (int iw = 0; iw < stringlist_get_size( wells ); iw++) { - const char * well = stringlist_iget( wells , iw ); - if (!hash_has_key( sched_history->well_history , well)) - hash_insert_hash_owned_ref( sched_history->well_history , well , well_history_alloc( well , sched_history->time ), well_history_free__ ); - - /* Could possibly extract more information from the welspecs - keyword and update well_history object here, but it does not - seem to contain any more interesting info??? - */ - - } -} - - -static void sched_history_add_group( sched_history_type * sched_history , group_history_type * new_group, group_history_type * parent_group , int report_step ) { - hash_insert_hash_owned_ref( sched_history->group_history , group_history_get_name( new_group ) , new_group , group_history_free__ ); - if (parent_group == NULL) - parent_group = sched_history_get_group( sched_history , FIELD_GROUP ); - - group_history_add_child( parent_group , new_group , group_history_get_name( new_group ) , report_step ); -} - - -/** - Because the FIELD group is added without any parent; it does not - use the standard sched_history_group_add() function. */ - -static void sched_history_add_FIELD_group( sched_history_type * sched_history ) { - group_history_type * field_group = group_history_alloc( FIELD_GROUP , sched_history->time , 0 ); - hash_insert_hash_owned_ref( sched_history->group_history , FIELD_GROUP , field_group , group_history_free__ ); -} - - -void sched_history_fprintf_group_structure( sched_history_type * sched_history , int report_step ) { - group_history_type * field_group = sched_history_get_group( sched_history , FIELD_GROUP ); - group_history_fprintf( field_group , report_step , true ,stdout ); -} - - -static void sched_history_add_groups_gruptree( sched_history_type * sched_history , const sched_kw_gruptree_type * gruptree , int report_step , const stringlist_type * child_groups , const stringlist_type * parent_groups) { - for (int i = 0; i < stringlist_get_size( child_groups ); i++) { - const char * parent_group_name = stringlist_iget( parent_groups , i ); - const char * child_group_name = stringlist_iget( child_groups , i ); - group_history_type * parent_group; - group_history_type * child_group; - - - if (!hash_has_key( sched_history->group_history , parent_group_name )) - sched_history_add_group( sched_history , group_history_alloc( parent_group_name , sched_history->time , report_step) , NULL , report_step ); - parent_group = sched_history_get_group( sched_history , parent_group_name ); - - if (!hash_has_key( sched_history->group_history , child_group_name )) - sched_history_add_group( sched_history , group_history_alloc( child_group_name , sched_history->time , report_step ) , parent_group , report_step ); - child_group = sched_history_get_group( sched_history , child_group_name ); - - group_history_add_child( parent_group , child_group , child_group_name , report_step); - } -} - - -int sched_history_get_last_history( const sched_history_type * sched_history ) { - return sched_history->last_history_step; -} - - -static void sched_history_set_historical( sched_history_type * sched_history , int report_step ) { - bool_vector_iset_default( sched_history->historical , report_step , true ); - sched_history->last_history_step = report_step; -} - - -/** - When new wells are added with the WELSPECS keyword their parent - group is implicitly introduced as the second argument of the - WELSPEC keyword, in addition the GRUPTREE keyword will also - implicitly introduce groups. - - This functions creates group_history objects for all the groups - introduced by the WELSPECS keyword, and attach wells to them (the - input parameters @wells and @groups come driectly from the welspecs - keyword, via the sched_kw_welspecs_init_child_parent_list() - function. -*/ - - -static void sched_history_add_groups_welspecs( sched_history_type * sched_history , const sched_kw_welspecs_type * welspecs , int report_step , const stringlist_type * wells, const stringlist_type * groups) { - for (int i = 0; i < stringlist_get_size( groups ); i++) { - const char * group_name = stringlist_iget( groups , i ); - const char * well_name = stringlist_iget( wells , i ); - well_history_type * well = sched_history_get_well( sched_history , well_name ); - group_history_type * group; - if (!hash_has_key( sched_history->group_history , group_name )) - sched_history_add_group( sched_history , group_history_alloc( group_name , sched_history->time , report_step ) , NULL , report_step ); - - group = sched_history_get_group( sched_history , group_name ); - group_history_add_child( group , well , well_name , report_step); - } -} - - - - -void sched_history_update( sched_history_type * sched_history, const sched_file_type * sched_file ) { - - sched_history_realloc( sched_history ); - sched_history_add_FIELD_group( sched_history ); - { - int block_nr; - stringlist_type * well_list = stringlist_alloc_new(); - stringlist_type * group_list = stringlist_alloc_new(); - - for (block_nr = 0; block_nr < sched_file_get_num_restart_files( sched_file ); block_nr++) { - sched_block_type * block = sched_file_iget_block( sched_file , block_nr ); - int kw_nr; - int report_step = block_nr; - - time_t_vector_iset( sched_history->time , block_nr , sched_file_iget_block_end_time( sched_file , block_nr)); - for (kw_nr = 0; kw_nr < sched_block_get_size( block ); kw_nr++) { - sched_kw_type * kw = sched_block_iget_kw( block , kw_nr ); - sched_kw_type_enum kw_type = sched_kw_get_type( kw ); - - switch( kw_type ) { - case(WCONHIST): - { - const sched_kw_wconhist_type * wconhist = sched_kw_get_data( kw ); - sched_kw_wconhist_init_well_list( wconhist , well_list ); - int iw; - for (iw = 0; iw < stringlist_get_size( well_list ); iw++) { - const char * well_name = stringlist_iget( well_list , iw ); - well_history_type * well_history = sched_history_get_well( sched_history , well_name ); - well_history_add_keyword( well_history , kw , report_step ); - } - } - sched_history_set_historical( sched_history , block_nr ); - break; - case(WCONPROD): /* This is only added to turn the well OFF from WCONHIST behaviour. It is currently not - possible to query the well for anything when it is in WCONPROD state. */ - - { - const sched_kw_wconprod_type * wconprod = sched_kw_get_data( kw ); - sched_kw_wconprod_init_well_list( wconprod , well_list ); - int iw; - for (iw = 0; iw < stringlist_get_size( well_list ); iw++) { - const char * well_name = stringlist_iget( well_list , iw ); - well_history_type * well_history = sched_history_get_well( sched_history , well_name ); - well_history_add_keyword( well_history , kw , report_step); - } - } - bool_vector_iset_default( sched_history->historical , block_nr , false ); - break; - case(WCONINJE): - { - const sched_kw_wconinje_type * wconinje = sched_kw_get_data( kw ); - sched_kw_wconinje_init_well_list( wconinje , well_list ); - int iw; - for (iw = 0; iw < stringlist_get_size( well_list ); iw++) { - const char * well_name = stringlist_iget( well_list , iw ); - well_history_type * well_history = sched_history_get_well( sched_history , well_name ); - well_history_add_keyword( well_history , kw , report_step); - } - if (sched_kw_wconinje_historical( wconinje )) - sched_history_set_historical( sched_history , block_nr ); - } - break; - case(WCONINJH): - /* ... */ - sched_history_set_historical( sched_history , block_nr ); - break; - case(WELSPECS): - { - const sched_kw_welspecs_type * welspecs = sched_kw_get_data( kw ); - sched_kw_welspecs_init_child_parent_list( welspecs , well_list , group_list ); - sched_history_add_wells( sched_history , welspecs , well_list ); - sched_history_add_groups_welspecs( sched_history , welspecs , report_step , well_list , group_list ); - for (int iw = 0; iw < stringlist_get_size( well_list ); iw++) { - const char * well_name = stringlist_iget( well_list , iw ); - well_history_type * well_history = sched_history_get_well( sched_history , well_name ); - well_history_add_keyword( well_history , kw , report_step); - } - } - break; - case(GRUPTREE): - { - const sched_kw_gruptree_type * gruptree = sched_kw_get_data( kw ); - stringlist_type * parent_group_list = group_list; - stringlist_type * child_group_list = well_list; - - sched_kw_gruptree_init_child_parent_list( gruptree , child_group_list , parent_group_list ); - sched_history_add_groups_gruptree( sched_history , gruptree , report_step , well_list , group_list ); - } - break; - default: - /* */ - break; - } - } - } - stringlist_free( well_list ); - stringlist_free( group_list ); - } - sched_history_install_index( sched_history ); -} - - -const char * sched_history_get_join_string( const sched_history_type * sched_history ) { - return sched_history->sep_string; -} - - -bool sched_history_has_well( const sched_history_type * sched_history , const char * well_name) { - return hash_has_key( sched_history->well_history , well_name ); -} - -bool sched_history_has_group( const sched_history_type * sched_history , const char * group_name) { - return hash_has_key( sched_history->group_history , group_name ); -} - -bool sched_history_has_key( const sched_history_type * sched_history , const char * key) { - return hash_has_key( sched_history->index , key ); -} - -bool sched_history_well_open( const sched_history_type * sched_history , const char * well_name , int report_step ) { - const well_history_type * well_history = sched_history_get_well( sched_history , well_name ); - return well_history_well_open( well_history , report_step ); -} - - - -/** - Will take a general key as input, and return the result of - schd_history_well_open() or sched_history_group_exists() - respectively - depending on the type key refers to. -*/ - -bool sched_history_open( const sched_history_type * sched_history , const char * key , int report_step) { - if(hash_has_key(sched_history->index, key)) { - const void * index = hash_get(sched_history->index , key ); - if (well_index_is_instance( index )) { - const well_index_type * well_index = well_index_safe_cast_const( index ); - const char * well_name = well_index_get_name( well_index ); - return sched_history_well_open( sched_history , well_name , report_step); - } else if (group_index_is_instance( index )) { - const group_index_type * group_index = group_index_safe_cast_const( index ); - const char * group_name = group_index_get_name( group_index ); - return sched_history_group_exists( sched_history , group_name , report_step); - } else { - util_abort("%s: - hmm internal fuckup \n",__func__); - return false; - } - } - return false; -} - - - - - -/** - This function checks if the group @group exists (i.e. has been - defined with the GRUPTREE or WELSPECS keyword) at the report_step - @report_step; if the group does not exist in the schedule file - _AT_ALL_ - the function will fail HARD. Use the function - sched_history_has_group() to check if a group is in the schedule - file at all. -*/ - - -bool sched_history_group_exists( const sched_history_type * sched_history , const char * group_name , int report_step ) { - const group_history_type * group_history = sched_history_get_group( sched_history , group_name ); - return group_history_group_exists( group_history , report_step ); -} - - - -void sched_history_fprintf_index_keys( const sched_history_type * sched_history , FILE * stream ) { - hash_iter_type * iter = hash_iter_alloc( sched_history->index ); - int c = 0; - while (!hash_iter_is_complete( iter )) { - fprintf(stream , "%18s" , hash_iter_get_next_key( iter )); - c += 1; - if ((c % 6) == 0) - fprintf(stream , "\n"); - } - hash_iter_free( iter ); -} - - - - -void sched_history_fprintf( const sched_history_type * sched_history , const stringlist_type * key_list , FILE * stream) { - int step = 1; - time_t start_time = time_t_vector_iget( sched_history->time , 0); - int total_length = bool_vector_size( sched_history->historical ); - while (true) { - if (bool_vector_safe_iget( sched_history->historical , step)) { - { - int mday,month,year; - time_t t = time_t_vector_iget( sched_history->time , step ); - double days = (t - start_time) * 1.0 / 86400; - util_set_date_values_utc( t , &mday , &month , &year); - //fprintf(stream , "%02d-%02d-%4d " , mday , month , year ); - fprintf(stream , " %5.0f " , days); - } - - for (int ikey =0; ikey < stringlist_get_size( key_list ); ikey++) - fprintf(stream , "%16.3f " , sched_history_iget( sched_history , stringlist_iget( key_list , ikey) , step)); - - fprintf( stream, "\n"); - } else - break; // We have completed the historical period - and switched to prediction - step++; - - if (step == total_length) - break; - } -} - - diff --git a/ThirdParty/Ert/libsched/src/sched_kw.c b/ThirdParty/Ert/libsched/src/sched_kw.c deleted file mode 100644 index 8ca0a9c182..0000000000 --- a/ThirdParty/Ert/libsched/src/sched_kw.c +++ /dev/null @@ -1,564 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -/* - The structure sched_kw_type is used for internalization - of arbitrary keywords in an ECLIPSE schedule file/section. - - Two structs are defined in this file: - - 1. The sched_kw_type, which can be accessed externaly - through various interface functions. - 2. The data_handlers_type, which provides an abstraction - for the data_handling of the various keywords. This - is for internal use only. - - Keywords from the ECLIPSE schedule are divided into three - different groups: - - 1. Fully internalized keywords, e.g. GRUPTREE. - Functions implementing the data_handlers and - more for these keywords are found in separate - files, e.g. sched_kw_gruptree.c. - - 2. Keywords which are known to have a fixed number - of records, but not having a full internal - representation. The number of records for these - keywords are specified in the function - get_fixed_record_length in the file - sched_kw_untyped.c - - 3. Keywords which are not implemented and have a - variable record length. These are handled - automatically by sched_kw_untyped.c. - -*/ - -typedef void * (data_token_alloc_proto) ( const stringlist_type * , int * ); -typedef void (data_free_proto) ( void *); -typedef void (data_fprintf_proto) ( const void *, FILE *); -typedef void * (alloc_copy_proto) ( const void *); - - -struct data_handlers_struct { - data_token_alloc_proto * token_alloc; - data_free_proto * free; - data_fprintf_proto * fprintf; - alloc_copy_proto * copyc; -}; - - -struct sched_kw_struct { - char * kw_name; - sched_kw_type_enum type; - int restart_nr; /* The block nr owning this instance. */ - - - /* Function pointers to work on the data pointer. */ - data_token_alloc_proto * alloc; - data_free_proto * free; - data_fprintf_proto * fprintf; - alloc_copy_proto * copyc; - - void * data; /* A void point pointer to a detailed implementation - i.e. sched_kw_wconhist. */ -}; - - - - - - - - - -/*****************************************************************/ - -/** - Nothing like a little manual inheritance.... -*/ - -static sched_kw_type * sched_kw_alloc_empty( const char * kw_name ) { - sched_kw_type * kw = util_malloc(sizeof * kw); - kw->kw_name = util_alloc_string_copy( kw_name ); - kw->type = sched_kw_type_from_string( kw_name ); - - switch( kw->type ) { - case(WCONHIST): - kw->alloc = sched_kw_wconhist_alloc__; - kw->free = sched_kw_wconhist_free__; - kw->fprintf = sched_kw_wconhist_fprintf__; - kw->copyc = sched_kw_wconhist_copyc__; - break; - case(DATES): - kw->alloc = sched_kw_dates_alloc__; - kw->free = sched_kw_dates_free__; - kw->fprintf = sched_kw_dates_fprintf__; - kw->copyc = sched_kw_dates_copyc__; - break; - case(TSTEP): - kw->alloc = sched_kw_tstep_alloc__; - kw->free = sched_kw_tstep_free__; - kw->fprintf = sched_kw_tstep_fprintf__; - kw->copyc = sched_kw_tstep_copyc__; - break; - case(COMPDAT): - kw->alloc = sched_kw_compdat_alloc__; - kw->free = sched_kw_compdat_free__; - kw->fprintf = sched_kw_compdat_fprintf__; - kw->copyc = sched_kw_compdat_copyc__; - break; - case(WELSPECS): - kw->alloc = sched_kw_welspecs_alloc__; - kw->free = sched_kw_welspecs_free__; - kw->fprintf = sched_kw_welspecs_fprintf__; - kw->copyc = sched_kw_welspecs_copyc__; - break; - case(GRUPTREE): - kw->alloc = sched_kw_gruptree_alloc__; - kw->free = sched_kw_gruptree_free__; - kw->fprintf = sched_kw_gruptree_fprintf__; - kw->copyc = sched_kw_gruptree_copyc__; - break; - case(INCLUDE): - kw->alloc = sched_kw_include_alloc__; - kw->free = sched_kw_include_free__; - kw->fprintf = sched_kw_include_fprintf__; - kw->copyc = sched_kw_include_copyc__; - break; - case(UNTYPED): - /** - Observe that the untyped keyword uses a custom allocator - function, because it needs to get the keyword length as extra - input. - */ - kw->alloc = NULL; - kw->free = sched_kw_untyped_free__; - kw->fprintf = sched_kw_untyped_fprintf__; - kw->copyc = sched_kw_untyped_copyc__; - break; - case(WCONINJ): - kw->alloc = sched_kw_wconinj_alloc__; - kw->free = sched_kw_wconinj_free__; - kw->fprintf = sched_kw_wconinj_fprintf__; - kw->copyc = sched_kw_wconinj_copyc__; - break; - case(WCONINJE): - kw->alloc = sched_kw_wconinje_alloc__; - kw->free = sched_kw_wconinje_free__; - kw->fprintf = sched_kw_wconinje_fprintf__; - kw->copyc = sched_kw_wconinje_copyc__; - break; - case(WCONINJH): - kw->alloc = sched_kw_wconinjh_alloc__; - kw->free = sched_kw_wconinjh_free__; - kw->fprintf = sched_kw_wconinjh_fprintf__; - kw->copyc = sched_kw_wconinjh_copyc__; - break; - case(WCONPROD): - kw->alloc = sched_kw_wconprod_alloc__; - kw->free = sched_kw_wconprod_free__; - kw->fprintf = sched_kw_wconprod_fprintf__; - kw->copyc = sched_kw_wconprod_copyc__; - break; - default: - util_abort("%s: unrecognized type:%d \n",__func__ , kw->type ); - } - return kw; -} - - - - -/* - This tries to check if kw_name is a valid keyword in an ECLIPSE - schedule file. It is essentially based on checking that there are - not more argeuments on the line: - - OK: - ------------------- - RPTSCHED - arg1 arg2 arg2 .... - - - Invalid: - ------------------- - RPTSCHED arg1 arg2 arg3 ... - - Quite naive .... -*/ -static void sched_kw_name_assert(const char * kw_name , FILE * stream) -{ - if(kw_name == NULL) { - fprintf(stderr,"** Parsing SCHEDULE file line-nr: %d \n",util_get_current_linenr(stream)); - util_abort("%s: Internal error - trying to dereference NULL pointer.\n",__func__); - } - - { - bool valid_kw = true; - for (int i = 0; i < strlen(kw_name); i++) - if (isspace(kw_name[i])) - valid_kw = false; - - if (!valid_kw) { - if (stream != NULL) - fprintf(stderr,"** Parsing SCHEDULE file line-nr: %d \n",util_get_current_linenr(stream)); - util_abort("%s: \"%s\" is not a valid schedule kw - aborting.\n",__func__ , kw_name); - } - } -} - - - - -static sched_kw_type ** sched_kw_tstep_split_alloc(const sched_kw_type * sched_kw, int * num_steps) -{ - *num_steps = sched_kw_tstep_get_size(sched_kw->data); - sched_kw_type ** sched_kw_tsteps = util_malloc(*num_steps * sizeof * sched_kw_tsteps); - - for(int i=0; i<*num_steps; i++) { - sched_kw_tsteps[i] = sched_kw_alloc_empty( "TSTEP" ); - double step = sched_kw_tstep_iget_step((const sched_kw_tstep_type *) sched_kw->data, i); - sched_kw_tsteps[i]->data = sched_kw_tstep_alloc_from_double(step); - } - - return sched_kw_tsteps; -} - - - -static sched_kw_type ** sched_kw_dates_split_alloc(const sched_kw_type * sched_kw, int * num_steps) -{ - *num_steps = sched_kw_dates_get_size(sched_kw->data); - sched_kw_type ** sched_kw_dates = util_malloc(*num_steps * sizeof * sched_kw_dates); - - for(int i=0; i<*num_steps; i++) { - sched_kw_dates[i] = sched_kw_alloc_empty( "DATES" ); - time_t date = sched_kw_dates_iget_date((const sched_kw_dates_type *) sched_kw->data, i); - sched_kw_dates[i]->data = sched_kw_dates_alloc_from_time_t(date); - } - return sched_kw_dates; -} -/*****************************************************************/ - - - - - -const char * sched_kw_get_type_name( const sched_kw_type * sched_kw ) { - return sched_kw_type_name( sched_kw->type ); -} - - -sched_kw_type_enum sched_kw_get_type(const sched_kw_type * sched_kw) -{ - return sched_kw->type; -} - - -static void sched_kw_alloc_data( sched_kw_type * kw , const stringlist_type * token_list , int * token_index , hash_type * fixed_length_table) { - if (kw->type == UNTYPED) { - int rec_len = -1; - if (hash_has_key( fixed_length_table , kw->kw_name )) - rec_len = hash_get_int( fixed_length_table , kw->kw_name ); - kw->data = sched_kw_untyped_alloc( token_list , token_index , rec_len ); - } else - kw->data = kw->alloc( token_list , token_index ); -} - - -sched_kw_type * sched_kw_token_alloc(const stringlist_type * token_list, int * token_index, hash_type * fixed_length_table, bool * foundEND) { - if (*token_index >= stringlist_get_size( token_list )) - return NULL; - else { - const char * kw_name = stringlist_iget( token_list , *token_index ); - (*token_index) += 1; - sched_kw_name_assert(kw_name , NULL); - if (strcmp(kw_name,"END") == 0) { - if (foundEND != NULL) - *foundEND = true; - - return NULL; - } else { - sched_kw_type * sched_kw = sched_kw_alloc_empty( kw_name ); - sched_kw->restart_nr = -1; - - sched_util_skip_newline( token_list , token_index ); - sched_kw_alloc_data( sched_kw , token_list , token_index , fixed_length_table); - - return sched_kw; - } - } -} - - -const char * sched_kw_get_name( const sched_kw_type * kw) { return kw->kw_name; } - - - -void sched_kw_set_restart_nr( sched_kw_type * kw , int restart_nr) { - kw->restart_nr = restart_nr; -} - - - -void sched_kw_free(sched_kw_type * sched_kw) -{ - sched_kw->free(sched_kw->data); - free(sched_kw->kw_name); - free(sched_kw); -} - - - -void sched_kw_free__(void * sched_kw_void) -{ - sched_kw_type * sched_kw = (sched_kw_type *) sched_kw_void; - sched_kw_free(sched_kw); -} - - - -/* - This will print the kw in ECLIPSE style formating. -*/ -void sched_kw_fprintf(const sched_kw_type * sched_kw, FILE * stream) -{ - sched_kw->fprintf(sched_kw->data, stream); -} - - - - - - - -/* - This function takes a kw related to timing, such as DATES or TSTEP - and converts it into a series of kw's with one timing event in each - kw. Note that TIME (ECL300 only) is not supported. -*/ -sched_kw_type ** sched_kw_split_alloc_DATES(const sched_kw_type * sched_kw, int * num_steps) -{ - switch(sched_kw_get_type(sched_kw)) - { - case(TSTEP): - return sched_kw_tstep_split_alloc(sched_kw, num_steps); - break; - case(DATES): - return sched_kw_dates_split_alloc(sched_kw, num_steps); - break; - case(TIME): - util_abort("%s: Sorry - no support for TIME kw yet. Please use TSTEP.\n", __func__); - return NULL; - break; - default: - util_abort("%s: Internal error - aborting.\n", __func__); - return NULL; - } -} - - - -time_t sched_kw_get_new_time(const sched_kw_type * sched_kw, time_t curr_time) -{ - time_t new_time = -1; - switch(sched_kw_get_type(sched_kw)) - { - case(TSTEP): - new_time = sched_kw_tstep_get_new_time((const sched_kw_tstep_type *) sched_kw->data, curr_time); - break; - case(DATES): - new_time = sched_kw_dates_iget_date((const sched_kw_dates_type *) sched_kw->data , 0); - break; - case(TIME): - util_abort("%s: Sorry - no support for TIME kw. Please use TSTEP.\n", __func__); - break; - default: - util_abort("%s: Internal error - trying to get time from non-timing kw - aborting.\n", __func__); - break; - } - - return new_time; -} - - - -char ** sched_kw_alloc_well_list(const sched_kw_type * sched_kw, int * num_wells) -{ - switch(sched_kw_get_type(sched_kw)) - { - case(WCONPROD): - return sched_kw_wconprod_alloc_wells_copy( (const sched_kw_wconprod_type *) sched_kw->data , num_wells); - break; - case(WCONINJE): - return sched_kw_wconinje_alloc_wells_copy( (const sched_kw_wconinje_type *) sched_kw->data , num_wells); - break; - case(WCONINJ): - return sched_kw_wconinj_alloc_wells_copy( (const sched_kw_wconinj_type *) sched_kw->data , num_wells); - break; - case(WCONHIST): - { - hash_type * well_obs = sched_kw_wconhist_alloc_well_obs_hash( (sched_kw_wconhist_type *) sched_kw->data); - *num_wells = hash_get_size(well_obs); - char ** well_list = hash_alloc_keylist(well_obs); - hash_free(well_obs); - return well_list; - } - break; - case(WCONINJH): - { - hash_type * well_obs = sched_kw_wconinjh_alloc_well_obs_hash( (sched_kw_wconinjh_type *) sched_kw->data); - *num_wells = hash_get_size(well_obs); - char ** well_list = hash_alloc_keylist(well_obs); - hash_free(well_obs); - return well_list; - } - break; - default: - util_abort("%s: Internal error - trying to get well list from non-well kw - aborting.\n", __func__); - return NULL; - } -} - - - -hash_type * sched_kw_alloc_well_obs_hash(const sched_kw_type * sched_kw) -{ - switch(sched_kw_get_type(sched_kw)) - { - case(WCONHIST): - { - return sched_kw_wconhist_alloc_well_obs_hash( (sched_kw_wconhist_type *) sched_kw->data); - } - case(WCONINJH): - { - return sched_kw_wconinjh_alloc_well_obs_hash( (sched_kw_wconinjh_type *) sched_kw->data); - } - default: - { - util_abort("%s: Internal error - trying to get well observations from non-history kw - aborting.\n", __func__); - return NULL; - } - } -} - - - -void sched_kw_alloc_child_parent_list(const sched_kw_type * sched_kw, char *** children, char *** parents, int * num_pairs) -{ - switch(sched_kw_get_type(sched_kw)) - { - case(GRUPTREE): - { - sched_kw_gruptree_alloc_child_parent_list((sched_kw_gruptree_type *) sched_kw->data, children, parents, num_pairs); - break; - } - case(WELSPECS): - { - sched_kw_welspecs_alloc_child_parent_list((sched_kw_welspecs_type *) sched_kw->data, children, parents, num_pairs); - break; - } - default: - { - util_abort("%s: Internal error - trying to get GRUPTREE from non-gruptre kw - aborting.\n", __func__); - } - } -} - - -/** - Only WCONHIST -*/ - -bool sched_kw_has_well( const sched_kw_type * sched_kw , const char * well ) { - sched_kw_type_enum type = sched_kw_get_type( sched_kw ); - if (type == WCONHIST) - return sched_kw_wconhist_has_well( sched_kw->data , well); - else if (type == WCONINJE) - return sched_kw_wconinje_has_well( sched_kw->data , well); - else - return false; -} - - - -/** - Only WCONHIST & WCONINJE -*/ - -bool sched_kw_well_open( const sched_kw_type * sched_kw , const char * well ) { - sched_kw_type_enum type = sched_kw_get_type( sched_kw ); - if (type == WCONHIST) - return sched_kw_wconhist_well_open( sched_kw->data , well); - else if (type == WCONINJE) - return sched_kw_wconinje_well_open( sched_kw->data , well); - else - return false; -} - - - -sched_kw_type * sched_kw_alloc_copy(const sched_kw_type * src) { - sched_kw_type * target = NULL; - - return target; -} - - -/* - Returns an untyped poiniter to the spesific implementation. Used by - the sched_file_update system. A bit careful with this one... -*/ - -void * sched_kw_get_data( sched_kw_type * kw) { - return kw->data; -} - -const void * sched_kw_get_const_data( const sched_kw_type * kw) { - return kw->data; -} - - diff --git a/ThirdParty/Ert/libsched/src/sched_kw_compdat.c b/ThirdParty/Ert/libsched/src/sched_kw_compdat.c deleted file mode 100644 index f4bd8101cc..0000000000 --- a/ThirdParty/Ert/libsched/src/sched_kw_compdat.c +++ /dev/null @@ -1,306 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_compdat.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - - -#define COMPDAT_NUM_KW 14 -#define SCHED_KW_COMPDAT_ID 771882 - -typedef enum {X, Y , Z , FX , FY} well_dir_type; -#define WELL_DIR_DEFAULT Z -#define WELL_DIR_X_STRING "X" -#define WELL_DIR_Y_STRING "Y" -#define WELL_DIR_Z_STRING "Z" -#define WELL_DIR_FX_STRING "FX" -#define WELL_DIR_FY_STRING "FZ" - - - -typedef enum {OPEN , AUTO , SHUT} comp_state_type; -#define COMP_DEFAULT_STATE OPEN -#define COMP_OPEN_STRING "OPEN" -#define COMP_AUTO_STRING "AUTO" -#define COMP_SHUT_STRING "SHUT" - - - -/* - Structure to hold one line (typically one completed cell) in a compdat section. -*/ - -typedef struct { - char *well; /* Name of well */ - int i,j,k1,k2; /* The i,j,k coordinated of the perforated cell. */ - well_dir_type well_dir; /* Which direction does the well penetrate the grid block */ - comp_state_type state; /* What state is this completion in: AUTO|SHUT|OPEN */ - int sat_table; - double conn_factor; - double well_diameter; - double eff_perm; - double skin_factor; - double D_factor; - double r0; - - /* - def : Read as defaulted, not as defined. - */ - bool def[COMPDAT_NUM_KW]; -} comp_type; - - - -struct sched_kw_compdat_struct { - UTIL_TYPE_ID_DECLARATION; - vector_type * completions; -}; - - - -/** - make_lookup comp_get_state_string comp_get_state_from_string comp_state_type AUTO COMP_AUTO_STRING OPEN COMP_OPEN_STRING SHUT COMP_SHUT_STRING -*/ - - - -static char * comp_get_state_string(comp_state_type state) { - switch(state) { - case(AUTO): - return COMP_AUTO_STRING; - case(OPEN): - return COMP_OPEN_STRING; - case(SHUT): - return COMP_SHUT_STRING; - default: - util_abort("%s: internal error \n",__func__); - return NULL; - } -} - - - -static char * comp_get_dir_string(well_dir_type dir) { - switch(dir) { - case(X): - return WELL_DIR_X_STRING; - case(Y): - return WELL_DIR_Y_STRING; - case(Z): - return WELL_DIR_Z_STRING; - case(FX): - return WELL_DIR_FX_STRING; - case(FY): - return WELL_DIR_FY_STRING; - default: - util_abort("%s: internal fuckup \n",__func__); - return NULL; - } -} - - -static well_dir_type comp_get_well_dir_from_string(const char * well_dir) { - if (strcmp(well_dir , WELL_DIR_X_STRING) == 0) - return X; - else if (strcmp(well_dir , WELL_DIR_Y_STRING) == 0) - return Y; - else if (strcmp(well_dir , WELL_DIR_Z_STRING) == 0) - return Z; - else if (strcmp(well_dir , WELL_DIR_FX_STRING) == 0) - return FX; - else if (strcmp(well_dir , WELL_DIR_FY_STRING) == 0) - return FY; - else { - util_abort("%s: internal fuckup \n",__func__); - return -1; - } -} - - - -static comp_state_type comp_get_state_from_string(const char * state) { - if (strcmp(state , COMP_AUTO_STRING) == 0) - return AUTO; - else if (strcmp(state , COMP_OPEN_STRING) == 0) - return OPEN; - else if (strcmp(state , COMP_SHUT_STRING) == 0) - return SHUT; - else { - util_abort("%s: did not recognize:%s as valid completion state: (%s|%s|%s) \n",__func__ , state , COMP_AUTO_STRING , COMP_OPEN_STRING , COMP_SHUT_STRING); - return -1; - } -} - - - - - - -static void comp_sched_fprintf(const comp_type * comp , FILE *stream) { - fprintf(stream , " "); - sched_util_fprintf_qst(comp->def[0] , comp->well , 8 , stream); - sched_util_fprintf_int(comp->def[1] , comp->i , 4 , stream); - sched_util_fprintf_int(comp->def[2] , comp->j , 4 , stream); - sched_util_fprintf_int(comp->def[3] , comp->k1 , 4 , stream); - sched_util_fprintf_int(comp->def[4] , comp->k2 , 4 , stream); - sched_util_fprintf_qst(comp->def[5] , comp_get_state_string( comp->state ) , 4 , stream); - sched_util_fprintf_int(comp->def[6] , comp->sat_table , 6 , stream); - sched_util_fprintf_dbl(comp->def[7] , comp->conn_factor , 9 , 3 , stream); - sched_util_fprintf_dbl(comp->def[8] , comp->well_diameter , 9 , 3 , stream); - sched_util_fprintf_dbl(comp->def[9] , comp->eff_perm , 9 , 3 , stream); - sched_util_fprintf_dbl(comp->def[10], comp->skin_factor , 9 , 3 , stream); - sched_util_fprintf_dbl(comp->def[11], comp->D_factor , 9 , 3 , stream); - sched_util_fprintf_qst(comp->def[12], comp_get_dir_string( comp->well_dir) , 2 , stream); - sched_util_fprintf_dbl(comp->def[13], comp->r0 , 9 , 3 , stream); - fprintf(stream , " /\n"); -} - - - - -static comp_type * comp_alloc_empty( ) { - comp_type *node = util_malloc(sizeof * node); - node->well = NULL; - return node; -} - - -static comp_type * comp_alloc_from_tokens( const stringlist_type * line_tokens ) { - comp_type * comp = comp_alloc_empty(); - sched_util_init_default( line_tokens , comp->def ); - - - comp->well = util_alloc_string_copy(stringlist_iget( line_tokens , 0)); - comp->i = sched_util_atoi(stringlist_iget( line_tokens , 1)); - comp->j = sched_util_atoi(stringlist_iget( line_tokens , 2)); - comp->k1 = sched_util_atoi(stringlist_iget( line_tokens , 3)); - comp->k2 = sched_util_atoi(stringlist_iget( line_tokens , 4)); - - if (comp->def[5]) - comp->state = COMP_DEFAULT_STATE; - else - comp->state = comp_get_state_from_string( stringlist_iget( line_tokens , 5 )); - - comp->sat_table = sched_util_atoi(stringlist_iget( line_tokens , 6)); - comp->conn_factor = sched_util_atof(stringlist_iget( line_tokens , 7)); - comp->well_diameter = sched_util_atof(stringlist_iget( line_tokens , 8)); - comp->eff_perm = sched_util_atof(stringlist_iget( line_tokens , 9)); - comp->skin_factor = sched_util_atof(stringlist_iget( line_tokens , 10)); - comp->D_factor = sched_util_atof(stringlist_iget( line_tokens , 11)); - - if (comp->def[12]) - comp->well_dir = WELL_DIR_DEFAULT; - else - comp->well_dir = comp_get_well_dir_from_string( stringlist_iget( line_tokens , 12 )); - - comp->r0 = sched_util_atof(stringlist_iget( line_tokens , 13)); - return comp; -} - - - -static void comp_free(comp_type *comp) { - free(comp->well); - free(comp); -} - - -static void comp_free__(void *__comp) { - comp_type *comp = (comp_type *) __comp; - comp_free(comp); -} - - - - - -void sched_kw_compdat_fprintf(const sched_kw_compdat_type *kw , FILE *stream) { - fprintf(stream , "COMPDAT\n"); - { - int index; - for (index = 0; index < vector_get_size( kw->completions ); index++) { - const comp_type * comp = vector_iget_const( kw->completions , index ); - comp_sched_fprintf(comp , stream); - } - } - fprintf(stream , "/\n\n"); -} - - - -sched_kw_compdat_type * sched_kw_compdat_alloc_empty( ) { - sched_kw_compdat_type * kw = util_malloc(sizeof *kw ); - kw->completions = vector_alloc_new(); - UTIL_TYPE_ID_INIT( kw , SCHED_KW_COMPDAT_ID ); - return kw; -} - - -UTIL_SAFE_CAST_FUNCTION( sched_kw_compdat , SCHED_KW_COMPDAT_ID ) - -void sched_kw_compdat_add_comp( sched_kw_compdat_type * kw , comp_type * comp) { - vector_append_owned_ref(kw->completions , comp , comp_free__); -} - - -sched_kw_compdat_type * sched_kw_compdat_alloc(const stringlist_type * tokens , int * token_index ) { - sched_kw_compdat_type * kw = sched_kw_compdat_alloc_empty(); - int eokw = false; - do { - stringlist_type * line_tokens = sched_util_alloc_line_tokens( tokens , false , COMPDAT_NUM_KW , token_index ); - if (line_tokens == NULL) - eokw = true; - else { - comp_type * comp = comp_alloc_from_tokens( line_tokens ); - sched_kw_compdat_add_comp( kw , comp ); - stringlist_free( line_tokens ); - } - } - - while (!eokw); - return kw; -} - - - - - -void sched_kw_compdat_free(sched_kw_compdat_type * kw) { - vector_free(kw->completions); - free(kw); -} - - -sched_kw_compdat_type * sched_kw_compdat_copyc(const sched_kw_compdat_type * kw) { - util_abort("%s: not implemented ... \n",__func__); - return NULL; -} - - -/*****************************************************************/ -KW_IMPL(compdat) - diff --git a/ThirdParty/Ert/libsched/src/sched_kw_dates.c b/ThirdParty/Ert/libsched/src/sched_kw_dates.c deleted file mode 100644 index ed3e8f0806..0000000000 --- a/ThirdParty/Ert/libsched/src/sched_kw_dates.c +++ /dev/null @@ -1,203 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_dates.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include -#include - - -#define DATES_FMT " %d \'%s\' %4d / \n" // The format string used when writing dates the arguments are (day , month_string , year). - - -struct sched_kw_dates_struct { - vector_type * time_list; -}; - - -/*****************************************************************/ - - - -static sched_kw_dates_type * sched_kw_dates_alloc_empty() -{ - sched_kw_dates_type *dates = util_malloc(sizeof *dates); - dates->time_list = vector_alloc_new(); - return dates; -} - - - -static const char * get_month_string_from_int(int month_nr) -{ - switch(month_nr) - { - case(1): return "JAN"; - case(2): return "FEB"; - case(3): return "MAR"; - case(4): return "APR"; - case(5): return "MAY"; - case(6): return "JUN"; - case(7): return "JUL"; - case(8): return "AUG"; - case(9): return "SEP"; - case(10): return "OCT"; - case(11): return "NOV"; - case(12): return "DEC"; - default: - util_abort("%s: Internal error - %i is not a month nr.\n",__func__,month_nr); - return "ERR\0"; - } - -} - - -static time_t parse_time_t(const char * day_string , const char * month_string , const char * year_string) { - int mday , month , year; - time_t time = -1; - - month = ecl_util_get_month_nr(month_string); - if (month < 0) - util_abort("%s: failed to interpret:%s a month name \n",__func__ , month_string ); - - if (util_sscanf_int(day_string , &mday) && util_sscanf_int(year_string , &year)) - time = util_make_date_utc(mday , month , year); - else - util_abort("%s: fatal error when extracting date from:%s %s %s \n", __func__, day_string , month_string , year_string); - - return time; -} - - - - - - - - - -/*****************************************************************/ - - -sched_kw_dates_type * sched_kw_dates_alloc(const stringlist_type * tokens , int * token_index ) { - sched_kw_dates_type * kw = sched_kw_dates_alloc_empty(); - int eokw = false; - do { - stringlist_type * line_tokens = sched_util_alloc_line_tokens( tokens , false, 0 , token_index ); - if (line_tokens == NULL) - eokw = true; - else { - if (stringlist_get_size( line_tokens ) == 3) { - const char * day_string = stringlist_iget( line_tokens , 0 ); - const char * month_string = stringlist_iget( line_tokens , 1 ); - const char * year_string = stringlist_iget( line_tokens , 2 ); - - time_t date = parse_time_t( day_string , month_string , year_string ); - sched_time_type * time_node = sched_time_alloc( date , 0 , DATES_TIME ); - vector_append_owned_ref( kw->time_list , time_node , sched_time_free__ ); - } else { - stringlist_fprintf( line_tokens , " " , stdout ); - util_abort("%s: malformed DATES keyword\n",__func__); - } - stringlist_free( line_tokens ); - } - - } while (!eokw); - return kw; -} - - - - -void sched_kw_dates_fprintf(const sched_kw_dates_type *kw , FILE *stream) { - fprintf(stream,"DATES\n"); - { - int i; - for (i=0; i < vector_get_size( kw->time_list ); i++) { - const sched_time_type * time_node = vector_iget_const( kw->time_list , i ); - if (sched_time_get_type( time_node ) == DATES_TIME) { - time_t date = sched_time_get_date( time_node ); - int day, month, year; - util_set_date_values_utc(date, &day, &month, &year); - fprintf(stream , DATES_FMT , day, get_month_string_from_int(month), year ); - } else - util_abort("%s: internal type fuckup \n",__func__); - } - fprintf(stream , "/\n\n"); - } -} - - - -void sched_kw_dates_free(sched_kw_dates_type * kw) { - vector_free(kw->time_list); - free(kw); -} - - - -int sched_kw_dates_get_size(const sched_kw_dates_type * kw) -{ - return vector_get_size(kw->time_list); -} - - - -sched_kw_dates_type * sched_kw_dates_alloc_from_time_t(time_t date) -{ - sched_kw_dates_type * kw = sched_kw_dates_alloc_empty(); - sched_time_type * time_node = sched_time_alloc( date , 0 , DATES_TIME ); - vector_append_owned_ref(kw->time_list , time_node , sched_time_free__); - return kw; -} - - - -time_t sched_kw_dates_iget_date(const sched_kw_dates_type * kw, int i) -{ - const sched_time_type * time_node = vector_iget_const( kw->time_list , i ); - return sched_time_get_date( time_node ); -} - - - - -sched_kw_dates_type * sched_kw_dates_copyc(const sched_kw_dates_type * kw) { - util_abort("%s: not implemented ... \n",__func__); - return NULL; -} - - - - -/***********************************************************************/ - - - -KW_IMPL(dates) - diff --git a/ThirdParty/Ert/libsched/src/sched_kw_gruptree.c b/ThirdParty/Ert/libsched/src/sched_kw_gruptree.c deleted file mode 100644 index 5352772811..0000000000 --- a/ThirdParty/Ert/libsched/src/sched_kw_gruptree.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_gruptree.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -#include -#include -#include - -#include -#include -#include - - -struct sched_kw_gruptree_struct -{ - hash_type * gruptree_hash; /* The use of hash implies that the ordering within one GRUPTREE instance is not retained. */ -}; - - - -/***********************************************************************/ - - - -static void sched_kw_gruptree_add_well(sched_kw_gruptree_type * kw , const char * child_group , const char * parent_group) { - hash_insert_string(kw->gruptree_hash, child_group , parent_group); -} - - -static sched_kw_gruptree_type * sched_kw_gruptree_alloc_empty() -{ - sched_kw_gruptree_type * kw = util_malloc(sizeof * kw); - kw->gruptree_hash = hash_alloc(); - - return kw; -}; - - - -/***********************************************************************/ - - -sched_kw_gruptree_type * sched_kw_gruptree_alloc(const stringlist_type * tokens , int * token_index ) { - sched_kw_gruptree_type * kw = sched_kw_gruptree_alloc_empty(); - int eokw = false; - do { - stringlist_type * line_tokens = sched_util_alloc_line_tokens( tokens , false , 0 , token_index ); - if (line_tokens == NULL) - eokw = true; - else { - const char * parent_group = "FIELD"; - const char * child_group = stringlist_iget( line_tokens , 0 ); - if (stringlist_get_size( line_tokens ) == 2) - parent_group = stringlist_iget( line_tokens , 1 ); - - sched_kw_gruptree_add_well(kw , child_group , parent_group ); - - stringlist_free( line_tokens ); - } - - } while (!eokw); - return kw; -} - - - -void sched_kw_gruptree_free(sched_kw_gruptree_type * kw) -{ - hash_free(kw->gruptree_hash); - free(kw); -}; - - -void sched_kw_gruptree_fprintf(const sched_kw_gruptree_type * kw, FILE * stream) -{ - - fprintf(stream, "GRUPTREE\n"); - { - const int num_keys = hash_get_size(kw->gruptree_hash); - char ** child_list = hash_alloc_keylist(kw->gruptree_hash); - int i; - - for (i = 0; i < num_keys; i++) { - const char * parent_name = hash_get_string(kw->gruptree_hash , child_list[i]); - fprintf(stream," '%s' '%s' /\n",child_list[i] , parent_name); - } - util_free_stringlist( child_list , num_keys ); - } - fprintf(stream,"/\n\n"); -}; - - - - -void sched_kw_gruptree_init_child_parent_list( const sched_kw_gruptree_type * kw , stringlist_type * child , stringlist_type * parent) { - stringlist_clear( child ); - stringlist_clear( parent ); - { - hash_iter_type * iter = hash_iter_alloc( kw->gruptree_hash ); - while (!hash_iter_is_complete( iter )) { - const char * child_group = hash_iter_get_next_key( iter ); - const char * parent_group = hash_get_string( kw->gruptree_hash , child_group ); - - stringlist_append_copy( child , child_group ); /* <- The iterator keys go out of scope when hash_iter_free() is called. */ - stringlist_append_ref( parent , parent_group ); - } - hash_iter_free( iter ); - } -} - - - - -void sched_kw_gruptree_alloc_child_parent_list(const sched_kw_gruptree_type * kw, char *** __children, char *** __parents, int * num_pairs) -{ - *num_pairs = hash_get_size(kw->gruptree_hash); - char ** children = hash_alloc_keylist(kw->gruptree_hash); - char ** parents = util_malloc(*num_pairs * sizeof * parents); - - for(int child_nr = 0; child_nr < *num_pairs; child_nr++) - { - parents[child_nr] = util_alloc_string_copy(hash_get_string(kw->gruptree_hash, children[child_nr])); - } - - *__children = children; - *__parents = parents; -} - - - -static sched_kw_gruptree_type * sched_kw_gruptree_copyc(const sched_kw_gruptree_type * src) { - sched_kw_gruptree_type * target = sched_kw_gruptree_alloc_empty(); - hash_iter_type * iter = hash_iter_alloc(src->gruptree_hash); - const char * kw = hash_iter_get_next_key(iter); - while (kw != NULL) { - char * parent_name = hash_get_string(src->gruptree_hash , kw); - hash_insert_string( target->gruptree_hash , kw , parent_name); - kw = hash_iter_get_next_key(iter); - } - hash_iter_free(iter); - return target; -} - - - -/***********************************************************************/ - -KW_IMPL(gruptree) diff --git a/ThirdParty/Ert/libsched/src/sched_kw_include.c b/ThirdParty/Ert/libsched/src/sched_kw_include.c deleted file mode 100644 index 11a58e8dd8..0000000000 --- a/ThirdParty/Ert/libsched/src/sched_kw_include.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_include.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - - -/** - This file implemtents support for the INCLUDE keyword in the - SCHEDULE files. Observe that the implementation is extremely - minimal, all it does is: - - 1. Recognize the INCLUDE keyword. - 2. Internalize the string representing the included file. - - It does NOT descent into any recursive parsing. The main reason to - have this support is to let the untyped parser "safely" read up to - the next "/" (that approach ill be completely fooled by path - separators in INCLUDE statements). -*/ - -#define SCHED_KW_INCLUDE_ID 1085006 - - -struct sched_kw_include_struct { - UTIL_TYPE_ID_DECLARATION; - char * include_file; /* The file to include ... */ -}; - - -static sched_kw_include_type * sched_kw_include_alloc_empty() { - sched_kw_include_type * kw = util_malloc( sizeof * kw ); - UTIL_TYPE_ID_INIT(kw , SCHED_KW_INCLUDE_ID); - kw->include_file = NULL; - return kw; -} - - -static void sched_kw_include_set_file( sched_kw_include_type * kw , const char * file) { - kw->include_file = util_alloc_string_copy( file ); -} - - - -sched_kw_include_type * sched_kw_include_alloc(const stringlist_type * tokens , int * token_index ) { - sched_kw_include_type * kw = sched_kw_include_alloc_empty(); - stringlist_type * line_tokens = sched_util_alloc_line_tokens( tokens , false , 0 , token_index ); - if (line_tokens == NULL) - util_abort("%s: fatal error when parsing INCLUDE \n",__func__); - - if (stringlist_get_size( line_tokens ) != 1) - util_abort("%s: fatal error when parsing INCLUDE \n",__func__); - - sched_kw_include_set_file( kw , stringlist_iget( line_tokens , 0 )); - - return kw; -} - - - - -void sched_kw_include_free( sched_kw_include_type * kw ) { - util_safe_free( kw->include_file ); - free( kw ); -} - - -void sched_kw_include_fprintf( const sched_kw_include_type * kw , FILE * stream ) { - fprintf(stream , "INCLUDE\n"); - fprintf(stream , " \'%s\' /\n\n" , kw->include_file); -} - - -sched_kw_include_type * sched_kw_include_copyc( const sched_kw_include_type * kw ) { - sched_kw_include_type * copy = sched_kw_include_alloc_empty(); - sched_kw_include_set_file( copy , kw->include_file ); - return copy; -} - - - -KW_IMPL(include) diff --git a/ThirdParty/Ert/libsched/src/sched_kw_tstep.c b/ThirdParty/Ert/libsched/src/sched_kw_tstep.c deleted file mode 100644 index b9ed608360..0000000000 --- a/ThirdParty/Ert/libsched/src/sched_kw_tstep.c +++ /dev/null @@ -1,151 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_tstep.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include - -#include -#include -#include - - - -struct sched_kw_tstep_struct { - double_vector_type * tstep_list; -}; - - - -/*****************************************************************/ - - -static void sched_kw_tstep_add_tstep( sched_kw_tstep_type * kw, double tstep ) { - double_vector_append( kw->tstep_list , tstep ); -} - - -static void sched_kw_tstep_add_tstep_string( sched_kw_tstep_type * kw, const char * tstep_string) { - double tstep; - if (util_sscanf_double( tstep_string , &tstep )) - sched_kw_tstep_add_tstep(kw , tstep ); - else - util_abort("%s: failed to parse:%s as a floating point number \n",__func__ , tstep_string); -} - - - - - - -static sched_kw_tstep_type * sched_kw_tstep_alloc_empty(){ - sched_kw_tstep_type *tstep = util_malloc(sizeof * tstep ); - tstep->tstep_list = double_vector_alloc(0 , 0); - return tstep; -} - - - -/*****************************************************************/ - -sched_kw_tstep_type * sched_kw_tstep_alloc(const stringlist_type * tokens , int * token_index ) { - sched_kw_tstep_type * kw = sched_kw_tstep_alloc_empty(); - stringlist_type * line_tokens = sched_util_alloc_line_tokens( tokens , false , 0 , token_index ); - - if (line_tokens == NULL) - util_abort("%s: hmmmm - TSTEP keyword without and data \n",__func__); - else { - int i; - - for (i=0; i < stringlist_get_size( line_tokens ); i++) - sched_kw_tstep_add_tstep_string( kw , stringlist_iget( line_tokens , i )); - - stringlist_free( line_tokens ); - } - - return kw; -} - - -void sched_kw_tstep_fprintf(const sched_kw_tstep_type *kw , FILE *stream) { - fprintf(stream,"TSTEP\n "); - { - int i; - for (i=0; i < double_vector_size( kw->tstep_list ); i++) - fprintf(stream, "%7.3f", double_vector_iget( kw->tstep_list , i)); - } - fprintf(stream , " /\n\n"); -} - - - -void sched_kw_tstep_free(sched_kw_tstep_type * kw) { - double_vector_free(kw->tstep_list); - free(kw); -} - - - -int sched_kw_tstep_get_size(const sched_kw_tstep_type * kw) -{ - return double_vector_size(kw->tstep_list); -} - - - -sched_kw_tstep_type * sched_kw_tstep_alloc_from_double(double step) -{ - sched_kw_tstep_type * kw = sched_kw_tstep_alloc_empty(); - double_vector_append( kw->tstep_list , step ); - return kw; -} - -sched_kw_tstep_type * sched_kw_tstep_copyc(const sched_kw_tstep_type * kw) { - util_abort("%s: not implemented ... \n",__func__); - return NULL; -} - - - -double sched_kw_tstep_iget_step(const sched_kw_tstep_type * kw, int i) -{ - return double_vector_iget( kw->tstep_list , i ); -} - - -int sched_kw_tstep_get_length( const sched_kw_tstep_type * kw) { - return double_vector_size( kw->tstep_list ); -} - -time_t sched_kw_tstep_get_new_time(const sched_kw_tstep_type *kw, time_t curr_time) -{ - double step_days = sched_kw_tstep_iget_step(kw , 0); - time_t new_time = curr_time; - util_inplace_forward_days_utc(&new_time, step_days); - return new_time; -} - - -/*****************************************************************/ - -KW_IMPL(tstep) - - diff --git a/ThirdParty/Ert/libsched/src/sched_kw_untyped.c b/ThirdParty/Ert/libsched/src/sched_kw_untyped.c deleted file mode 100644 index 2439d9dc95..0000000000 --- a/ThirdParty/Ert/libsched/src/sched_kw_untyped.c +++ /dev/null @@ -1,184 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_untyped.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include -#include - -#include -#include - - - - -struct sched_kw_untyped_struct { - int rec_len; - char *kw_name; /* The name of the current keyword. */ - char *buffer; /* The content of the keyword is just appended in one char * pointer. */ -}; - - - -/*****************************************************************/ - -//static int get_fixed_record_length(const char * kw_name) -//{ -// -// if( strcmp(kw_name , "RPTSCHED") == 0) { return 1;} -// if( strcmp(kw_name , "DRSDT" ) == 0) { return 1;} -// if( strcmp(kw_name , "SKIPREST") == 0) { return 0;} -// if( strcmp(kw_name , "RPTRST" ) == 0) { return 1;} -// if( strcmp(kw_name , "TUNING" ) == 0) { return 3;} -// if( strcmp(kw_name , "WHISTCTL") == 0) { return 1;} -// if( strcmp(kw_name , "TIME" ) == 0) { return 1;} -// if( strcmp(kw_name , "VAPPARS" ) == 0) { return 1;} -// if( strcmp(kw_name , "NETBALAN") == 0) { return 1;} -// if( strcmp(kw_name , "WPAVE" ) == 0) { return 1;} -// if( strcmp(kw_name , "VFPTABL" ) == 0) { return 1;} -// if( strcmp(kw_name , "GUIDERAT") == 0) { return 1;} -// -// return -1; /* Can not use 0 - because some KW actually have 0 as a valid fixed value. */ -//} - - - -sched_kw_untyped_type * sched_kw_untyped_alloc_empty(const char * kw_name , int rec_len) { - sched_kw_untyped_type * kw = util_malloc(sizeof *kw ); - kw->kw_name = util_alloc_string_copy(kw_name); - kw->rec_len = rec_len; - kw->buffer = NULL; - return kw; -} - - - -/** This is exported for the keywords which are just a minimum extension of untyped. */ -void sched_kw_untyped_add_line(sched_kw_untyped_type * kw , const char *line, bool pad) { - if (pad) { - char * padded_line = util_alloc_sprintf(" %s\n" , line); - kw->buffer = util_strcat_realloc(kw->buffer , padded_line); - free(padded_line); - } else - kw->buffer = util_strcat_realloc(kw->buffer , line); -} - - - -/*****************************************************************/ - - -void sched_kw_untyped_add_tokens( sched_kw_untyped_type * kw , const stringlist_type * line_tokens) { - char * line_buffer = stringlist_alloc_joined_string( line_tokens , " "); - sched_kw_untyped_add_line(kw, line_buffer , true ); - free( line_buffer ); -} - - - - - -sched_kw_untyped_type * sched_kw_untyped_alloc(const stringlist_type * tokens , int * token_index , int rec_len) { - const char * kw_name = NULL; - - /* First part - get hold of the kw name */ - { - int kw_index = (*token_index) - 1; - do { - kw_name = stringlist_iget( tokens , kw_index); - if (util_string_isspace( kw_name )) - kw_name = NULL; /* Try again */ - kw_index--; - } while (kw_name == NULL && (kw_index >= 0)); - - if (kw_name == NULL) - util_abort("%s: internal error - failed to identify untyped kw name \n",__func__); - } - - - { - bool eokw = false; - sched_kw_untyped_type * kw = sched_kw_untyped_alloc_empty( kw_name , rec_len); - int line_nr = 0; - do { - stringlist_type * line_tokens = sched_util_alloc_line_tokens( tokens , true , 0 , token_index ); - line_nr++; - if (line_tokens == NULL) { - eokw = true; - if (line_nr < kw->rec_len) - util_abort("%s: premature end of keyword:%s \n",__func__ , kw_name); - } else { - sched_kw_untyped_add_tokens( kw , line_tokens ); - stringlist_free( line_tokens ); - } - - if (line_nr == kw->rec_len) - eokw = true; - - } while (!eokw); - return kw; - } -} - - - - -void sched_kw_untyped_fprintf(const sched_kw_untyped_type *kw , FILE *stream) { - fprintf(stream , "%s \n" , kw->kw_name); - { - if (kw->buffer != NULL) - fprintf(stream , "%s" , kw->buffer); - - if(kw->rec_len < 0) - fprintf(stream , "/\n\n"); - else - fprintf(stream, "\n\n"); - } -} - - - -void sched_kw_untyped_free(sched_kw_untyped_type * kw) { - util_safe_free(kw->buffer); - free(kw->kw_name); - free(kw); -} - -sched_kw_untyped_type * sched_kw_untyped_copyc(const sched_kw_untyped_type * kw) { - util_abort("%s: not implemented ... \n",__func__); - return NULL; -} - -/*****************************************************************/ - -KW_FREE_IMPL(untyped) -KW_FPRINTF_IMPL(untyped) -KW_COPYC_IMPL(untyped) - - - - - - - - - - diff --git a/ThirdParty/Ert/libsched/src/sched_kw_wconhist.c b/ThirdParty/Ert/libsched/src/sched_kw_wconhist.c deleted file mode 100644 index c5cfe31ed8..0000000000 --- a/ThirdParty/Ert/libsched/src/sched_kw_wconhist.c +++ /dev/null @@ -1,719 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_wconhist.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - -/* - Define the maximum number of keywords in a WCONHIST record. - Note that this includes wet gas rate, which is only supported - by ECL 300. -*/ - -#define WCONHIST_NUM_KW 11 -#define SCHED_KW_WCONHIST_ID 771054 /* Very random intgere for checking type-cast. */ -#define WCONHIST_TYPE_ID 7752053 - - -typedef struct wconhist_well_struct wconhist_well_type; - - - -struct wconhist_well_struct{ - /* - def: Read as defaulted, not defined! - */ - bool def[WCONHIST_NUM_KW]; - - char * name; - well_status_enum status; - well_cm_enum cmode; - double orat; - double wrat; - double grat; - int vfptable; - double alift; - double thp; - double bhp; - double wgrat; -}; - - - -struct sched_kw_wconhist_struct{ - UTIL_TYPE_ID_DECLARATION; - vector_type * wells; -}; - - -/*****************************************************************/ - -/** - Contains values for ORAT, GRAT, .... for one well for the complete - history; this is orthogonal to the regualar sched_kw_wconhist - keyowrd which contains the same data for all (or at least many ...) - wells at one time instant. -*/ - -struct wconhist_state_struct { - UTIL_TYPE_ID_DECLARATION; - const time_t_vector_type * time; /* Shared vector with the report_step -> time_t mapping .*/ - int_vector_type * state; /* Contains values from the well_status_enum. */ - int_vector_type * cmode; /* Contains values from the well_cm_enum. */ - double_vector_type * oil_rate; - double_vector_type * water_rate; - double_vector_type * gas_rate; - int_vector_type * vfp_table; - double_vector_type * art_lift; - double_vector_type * thp; - double_vector_type * bhp; - double_vector_type * wgas_rate; -}; - - - -/*****************************************************************/ - - - -static wconhist_well_type * wconhist_well_alloc_empty( ) -{ - wconhist_well_type * well = util_malloc(sizeof * well); - well->name = NULL; - well->status = WCONHIST_DEFAULT_STATUS; - return well; -} - - - -static void wconhist_well_free(wconhist_well_type * well) -{ - free(well->name); - free(well); -} - - - -static void wconhist_well_free__(void * well) -{ - wconhist_well_free( (wconhist_well_type *) well); -} - - - -static void wconhist_well_fprintf(const wconhist_well_type * well, FILE * stream) -{ - fprintf(stream, " "); - sched_util_fprintf_qst(well->def[0], well->name , 8, stream); - sched_util_fprintf_qst(well->def[1], sched_types_get_status_string(well->status) , 4, stream); - sched_util_fprintf_qst(well->def[2], sched_types_get_cm_string(well->cmode) , 4, stream); - sched_util_fprintf_dbl(well->def[3], well->orat , 11, 3, stream); - sched_util_fprintf_dbl(well->def[4], well->wrat , 11, 3, stream); - sched_util_fprintf_dbl(well->def[5], well->grat , 11, 3, stream); - sched_util_fprintf_int(well->def[6], well->vfptable , 4 , stream); - sched_util_fprintf_dbl(well->def[7], well->alift , 11, 3, stream); - sched_util_fprintf_dbl(well->def[8], well->thp , 11, 3, stream); - sched_util_fprintf_dbl(well->def[9] , well->bhp , 11, 3, stream); - sched_util_fprintf_dbl(well->def[10], well->wgrat , 11, 3, stream); - fprintf(stream, "/\n"); -} - - - - - - -static wconhist_well_type * wconhist_well_alloc_from_tokens(const stringlist_type * line_tokens ) { - wconhist_well_type * well = wconhist_well_alloc_empty( ); - sched_util_init_default( line_tokens , well->def ); - - well->name = util_alloc_string_copy(stringlist_iget(line_tokens, 0)); - - if(!well->def[1]) - well->status = sched_types_get_status_from_string(stringlist_iget(line_tokens , 1)); - if (well->status == DEFAULT) - well->status = WCONHIST_DEFAULT_STATUS; - - - if(!well->def[2]) - well->cmode = sched_types_get_cm_from_string(stringlist_iget(line_tokens , 2) , true); - - well->orat = sched_util_atof(stringlist_iget(line_tokens , 3)); - well->wrat = sched_util_atof(stringlist_iget(line_tokens , 4)); - well->grat = sched_util_atof(stringlist_iget(line_tokens , 5)); - well->vfptable = sched_util_atoi(stringlist_iget(line_tokens , 6)); - well->alift = sched_util_atof(stringlist_iget(line_tokens , 7)); - well->thp = sched_util_atof(stringlist_iget(line_tokens , 8)); - well->bhp = sched_util_atof(stringlist_iget(line_tokens , 9)); - well->wgrat = sched_util_atof(stringlist_iget(line_tokens , 10)); - - return well; -} - - - - - - -static hash_type * wconhist_well_export_obs_hash(const wconhist_well_type * well) -{ - hash_type * obs_hash = hash_alloc(); - - if(!well->def[3]) - hash_insert_double(obs_hash, "WOPR", well->orat); - - if(!well->def[4]) - hash_insert_double(obs_hash, "WWPR", well->wrat); - - if(!well->def[5]) - hash_insert_double(obs_hash, "WGPR", well->grat); - - if(!well->def[8]) - hash_insert_double(obs_hash, "WTHP", well->thp); - - if(!well->def[9]) - hash_insert_double(obs_hash, "WBHP", well->bhp); - - if(!well->def[10]) - hash_insert_double(obs_hash, "WWGPR", well->wgrat); - - // Water cut. - if(!well->def[3] && !well->def[4]) - { - double wct; - if(well->orat + well->wrat > 0.0) - wct = well->wrat / (well->orat + well->wrat); - else - wct = 0.0; - - hash_insert_double(obs_hash, "WWCT", wct); - } - - // Gas oil ratio. - if(!well->def[3] && !well->def[5]) - { - double gor; - if(well->orat > 0.0) - { - gor = well->grat / well->orat; - hash_insert_double(obs_hash, "WGOR", gor); - } - } - - return obs_hash; -} - - -static void sched_kw_wconhist_add_well( sched_kw_wconhist_type * kw , wconhist_well_type * well) { - vector_append_owned_ref(kw->wells, well, wconhist_well_free__); -} - - - - -static sched_kw_wconhist_type * sched_kw_wconhist_alloc_empty() -{ - sched_kw_wconhist_type * kw = util_malloc(sizeof * kw); - UTIL_TYPE_ID_INIT( kw , SCHED_KW_WCONHIST_ID ); - kw->wells = vector_alloc_new(); - return kw; -} - - - -sched_kw_wconhist_type * sched_kw_wconhist_safe_cast( void * arg ) { - sched_kw_wconhist_type * kw = (sched_kw_wconhist_type * ) arg; - if (kw->__type_id == SCHED_KW_WCONHIST_ID) - return kw; - else { - util_abort("%s: runtime cast failed \n",__func__); - return NULL; - } -} - - - -/***********************************************************************/ - - - -sched_kw_wconhist_type * sched_kw_wconhist_alloc(const stringlist_type * tokens , int * token_index ) { - sched_kw_wconhist_type * kw = sched_kw_wconhist_alloc_empty(); - int eokw = false; - do { - stringlist_type * line_tokens = sched_util_alloc_line_tokens( tokens , false , WCONHIST_NUM_KW , token_index ); - if (line_tokens == NULL) - eokw = true; - else { - wconhist_well_type * well = wconhist_well_alloc_from_tokens( line_tokens ); - sched_kw_wconhist_add_well( kw , well ); - stringlist_free( line_tokens ); - } - - } while (!eokw); - return kw; -} - - -void sched_kw_wconhist_free(sched_kw_wconhist_type * kw) -{ - vector_free(kw->wells); - free(kw); -} - - - -void sched_kw_wconhist_fprintf(const sched_kw_wconhist_type * kw, FILE * stream) -{ - int size = vector_get_size(kw->wells); - - fprintf(stream, "WCONHIST\n"); - for(int i=0; iwells, i); - wconhist_well_fprintf(well, stream); - } - fprintf(stream,"/\n\n"); -} - - -/***********************************************************************/ - - - -hash_type * sched_kw_wconhist_alloc_well_obs_hash(const sched_kw_wconhist_type * kw) -{ - hash_type * well_hash = hash_alloc(); - - int num_wells = vector_get_size(kw->wells); - - for(int well_nr=0; well_nrwells, well_nr); - hash_type * obs_hash = wconhist_well_export_obs_hash(well); - hash_insert_hash_owned_ref(well_hash, well->name, obs_hash, hash_free__); - } - - return well_hash; -} - -sched_kw_wconhist_type * sched_kw_wconhist_copyc(const sched_kw_wconhist_type * kw) { - util_abort("%s: not implemented ... \n",__func__); - return NULL; -} - - - -/***********************************************************************/ -/* Functions exported for the sched_file_update api. */ - - - -/** Will return NULL if the well is not present. */ -static wconhist_well_type * sched_kw_wconhist_get_well( const sched_kw_wconhist_type * kw , const char * well_name) { - int size = vector_get_size(kw->wells); - wconhist_well_type * well = NULL; - int index = 0; - do { - wconhist_well_type * iwell = vector_iget( kw->wells , index); - if (strcmp( well_name , iwell->name ) == 0) - well = iwell; - - index++; - } while ((well == NULL) && (index < size)); - return well; -} - - -/*****************************************************************/ - - -double sched_kw_wconhist_get_orat( sched_kw_wconhist_type * kw , const char * well_name) { - wconhist_well_type * well = sched_kw_wconhist_get_well( kw , well_name ); - if (well != NULL) - return well->orat; - else - return -1; -} - -void sched_kw_wconhist_scale_orat( sched_kw_wconhist_type * kw , const char * well_name, double factor) { - wconhist_well_type * well = sched_kw_wconhist_get_well( kw , well_name ); - if (well != NULL) - well->orat *= factor; -} - -void sched_kw_wconhist_shift_orat( sched_kw_wconhist_type * kw , const char * well_name, double shift_value) { - wconhist_well_type * well = sched_kw_wconhist_get_well( kw , well_name ); - if (well != NULL) { - well->orat += shift_value; - if (well->orat < 0) - well->orat = 0; - } -} - -void sched_kw_wconhist_set_orat( sched_kw_wconhist_type * kw , const char * well_name , double orat) { - wconhist_well_type * well = sched_kw_wconhist_get_well( kw , well_name ); - if (well != NULL) - well->orat = orat; -} - -/*****************************************************************/ -/* WRAT functions */ - -double sched_kw_wconhist_get_wrat( sched_kw_wconhist_type * kw , const char * well_name) { - wconhist_well_type * well = sched_kw_wconhist_get_well( kw , well_name ); - if (well != NULL) - return well->wrat; - else - return -1; -} - -void sched_kw_wconhist_scale_wrat( sched_kw_wconhist_type * kw , const char * well_name, double factor) { - wconhist_well_type * well = sched_kw_wconhist_get_well( kw , well_name ); - if (well != NULL) - well->wrat *= factor; -} - -void sched_kw_wconhist_shift_wrat( sched_kw_wconhist_type * kw , const char * well_name, double shift_value) { - wconhist_well_type * well = sched_kw_wconhist_get_well( kw , well_name ); - if (well != NULL) { - well->wrat += shift_value; - if (well->wrat < 0) - well->wrat = 0; - } -} - -void sched_kw_wconhist_set_wrat( sched_kw_wconhist_type * kw , const char * well_name , double wrat) { - wconhist_well_type * well = sched_kw_wconhist_get_well( kw , well_name ); - if (well != NULL) - well->wrat = wrat; -} - -/*****************************************************************/ -/* GRAT functions */ - -double sched_kw_wconhist_get_grat( sched_kw_wconhist_type * kw , const char * well_name) { - wconhist_well_type * well = sched_kw_wconhist_get_well( kw , well_name ); - if (well != NULL) - return well->grat; - else - return -1; -} - -void sched_kw_wconhist_scale_grat( sched_kw_wconhist_type * kw , const char * well_name, double factor) { - wconhist_well_type * well = sched_kw_wconhist_get_well( kw , well_name ); - if (well != NULL) - well->grat *= factor; -} - -void sched_kw_wconhist_shift_grat( sched_kw_wconhist_type * kw , const char * well_name, double shift_value) { - wconhist_well_type * well = sched_kw_wconhist_get_well( kw , well_name ); - if (well != NULL) { - well->grat += shift_value; - if (well->grat < 0) - well->grat = 0; - } -} - -void sched_kw_wconhist_set_grat( sched_kw_wconhist_type * kw , const char * well_name , double grat) { - wconhist_well_type * well = sched_kw_wconhist_get_well( kw , well_name ); - if (well != NULL) - well->grat = grat; -} - - -/*****************************************************************/ - - -bool sched_kw_wconhist_has_well( const sched_kw_wconhist_type * kw , const char * well_name) { - wconhist_well_type * well = sched_kw_wconhist_get_well( kw , well_name ); - if (well == NULL) - return false; - else - return true; -} - -/** - This keyword checks if the well @well_name is open in this wconhist - instance. The check is quite simple: if the wconhist instance has - this well, and that well has status == OPEN AND a finite rate of at - least one phase - we return true, in ALL other cases we return - false. - - Observe that this function has no possibility to check well-names - +++ - if you ask for a non-existing well you will just get false. -*/ - - -bool sched_kw_wconhist_well_open( const sched_kw_wconhist_type * kw, const char * well_name) { - wconhist_well_type * well = sched_kw_wconhist_get_well( kw , well_name ); - if (well == NULL) - return false; - else { - /* OK - we have the well. */ - if (well->status == OPEN) { - /* The well seems to be open - any rates around? */ - if ((well->orat + well->grat + well->wrat) > 0.0) - return true; - else - return false; - } else - return false; - } -} - -/*****************************************************************/ - - -/** - Will update the input parameter @well_list to contain all the - well_names present in the current sced_kw_wconhist keyword. -*/ - -void sched_kw_wconhist_init_well_list( const sched_kw_wconhist_type * kw , stringlist_type * well_list) { - stringlist_clear( well_list ); - { - int iw; - for (iw = 0; iw < vector_get_size( kw->wells ); iw++) { - const wconhist_well_type * well = vector_iget_const( kw->wells , iw ); - stringlist_append_ref( well_list , well->name ); - } - } -} - - -/*****************************************************************/ - -static UTIL_SAFE_CAST_FUNCTION_CONST( wconhist_state , WCONHIST_TYPE_ID) -static UTIL_SAFE_CAST_FUNCTION( wconhist_state , WCONHIST_TYPE_ID) - - - - -static double well_util_total( const time_t_vector_type * time, const double_vector_type * rate , int report_step ) { - double total = 0; - for (int index = 1; index <= report_step; index++) { - /* It is a HARD assumption that the rate values in @rate are given as volume / day. */ - double days = (time_t_vector_iget( time , index ) - time_t_vector_iget( time , index - 1)) / 86400; - total += days * double_vector_iget( rate , index ); - } - - return total; -} - - -double wconhist_state_iget_WOPTH( const void * state , int report_step ) { - const wconhist_state_type * wconhist_state = wconhist_state_safe_cast_const( state ); - return well_util_total( wconhist_state->time , wconhist_state->oil_rate , report_step ); -} - - -double wconhist_state_iget_WGPTH( const void * state , int report_step ) { - const wconhist_state_type * wconhist_state = wconhist_state_safe_cast_const( state ); - return well_util_total( wconhist_state->time , wconhist_state->gas_rate , report_step ); -} - - -double wconhist_state_iget_WWPTH( const void * state , int report_step ) { - const wconhist_state_type * wconhist_state = wconhist_state_safe_cast_const( state ); - return well_util_total( wconhist_state->time , wconhist_state->water_rate , report_step ); -} - - -/* - Functions implementing the wconhist state; the naming convention - here should follow the one used in summary files, i.e. WOPR to get Oil Production Rate. -*/ - - -double wconhist_state_iget_WBHPH( const void * state , int report_step ) { - const wconhist_state_type * wconhist_state = wconhist_state_safe_cast_const( state ); - return double_vector_safe_iget( wconhist_state->bhp , report_step ); -} - - -double wconhist_state_iget_WOPRH( const void * state , int report_step ) { - const wconhist_state_type * wconhist_state = wconhist_state_safe_cast_const( state ); - return double_vector_safe_iget( wconhist_state->oil_rate , report_step ); -} - - -double wconhist_state_iget_WGPRH( const void * state , int report_step ) { - const wconhist_state_type * wconhist_state = wconhist_state_safe_cast_const( state ); - return double_vector_safe_iget( wconhist_state->gas_rate , report_step ); -} - - -double wconhist_state_iget_WWPRH( const void * state , int report_step ) { - const wconhist_state_type * wconhist_state = wconhist_state_safe_cast_const( state ); - return double_vector_safe_iget( wconhist_state->water_rate , report_step ); -} - - -double wconhist_state_iget_WWCTH( const void * state , int report_step ) { - double WWPR = wconhist_state_iget_WWPRH( state , report_step ); - double WOPR = wconhist_state_iget_WOPRH( state , report_step ); - - return WWPR / ( WWPR + WOPR ); -} - - -double wconhist_state_iget_WGORH(const void * state , int report_step ) { - double WGPR = wconhist_state_iget_WGPRH( state , report_step ); - double WOPR = wconhist_state_iget_WOPRH( state , report_step ); - return WGPR / WOPR; -} - - -/* - Uncertain about this memnonic?? -*/ - -well_cm_enum wconhist_state_iget_WMCTLH( const void * state , int report_step ) { - const wconhist_state_type * wconhist_state = wconhist_state_safe_cast_const( state ); - return int_vector_iget( wconhist_state->cmode , report_step ); -} - - -//well_status_enum wconhist_state_iget_status( const void * state , int report_step ) { - -// All callbacks return double ... should really be an enum value -double wconhist_state_iget_STAT( const void * state , int report_step ) { - const wconhist_state_type * wconhist_state = wconhist_state_safe_cast_const( state ); - return int_vector_iget( wconhist_state->state , report_step ); -} - - - -wconhist_state_type * wconhist_state_alloc( const time_t_vector_type * time) { - wconhist_state_type * wconhist = util_malloc( sizeof * wconhist ); - UTIL_TYPE_ID_INIT( wconhist , WCONHIST_TYPE_ID ); - - wconhist->time = time; - wconhist->state = int_vector_alloc( 0 , WCONHIST_DEFAULT_STATUS ); - wconhist->cmode = int_vector_alloc( 0 , 0 ); - - wconhist->oil_rate = double_vector_alloc( 0 , 0 ); - wconhist->gas_rate = double_vector_alloc( 0 , 0 ); - wconhist->water_rate = double_vector_alloc( 0 , 0 ); - - /* - The vfp_table and art_list keywords have an EXTREMELY ugly - DEFAULT behaviour - it changes as function of time: - - 1. The first occurence of a default value should be interpreted - as a '0'. - - 2. The second occurence of a default value should be interpreted - as 'No change prom previous value' - whatever that was. - - This behaviour is not properly supported in this implementation. - */ - - - wconhist->vfp_table = int_vector_alloc( 0 , 0 ); - wconhist->art_lift = double_vector_alloc( 0 , 0); - - wconhist->thp = double_vector_alloc( 0 , 0 ); - wconhist->bhp = double_vector_alloc( 0 , 0 ); - wconhist->wgas_rate = double_vector_alloc( 0 , 0 ); - - return wconhist; -} - - -void wconhist_state_free( wconhist_state_type * wconhist ) { - int_vector_free( wconhist->state ); - int_vector_free( wconhist->cmode ); - int_vector_free( wconhist->vfp_table ); - - double_vector_free( wconhist->oil_rate ); - double_vector_free( wconhist->gas_rate ); - double_vector_free( wconhist->water_rate ); - double_vector_free( wconhist->art_lift ); - double_vector_free( wconhist->thp ); - double_vector_free( wconhist->bhp ); - double_vector_free( wconhist->wgas_rate ); - - free( wconhist ); -} - - -void wconhist_state_free__( void * arg ) { - wconhist_state_free( wconhist_state_safe_cast( arg )); -} - - - -void sched_kw_wconhist_update_state(const sched_kw_wconhist_type * kw , wconhist_state_type * state , const char * well_name , int report_step ) { - - wconhist_well_type * well = sched_kw_wconhist_get_well( kw , well_name ); - if (well != NULL) { - - int_vector_iset_default( state->state , report_step , well->status ); - int_vector_iset_default( state->cmode , report_step , well->cmode ); - double_vector_iset_default( state->oil_rate , report_step , well->orat ); - double_vector_iset_default( state->water_rate , report_step , well->wrat ); - double_vector_iset_default( state->gas_rate , report_step , well->grat ); - int_vector_iset_default( state->vfp_table , report_step , well->vfptable ); - double_vector_iset_default( state->art_lift , report_step , well->alift ); - double_vector_iset_default( state->thp , report_step , well->thp ); - double_vector_iset_default( state->bhp , report_step , well->bhp ); - double_vector_iset_default( state->wgas_rate , report_step , well->wgrat ); - - } -} - - - -void sched_kw_wconhist_close_state( wconhist_state_type * state , int report_step ) { - int_vector_iset_default( state->state , report_step , SHUT ); /* SHUT or STOP?? This will fuck up a bit when what is actually happening is that the well goes over to - WCONPROD control, because the WCONPROD keyword is not internalized at all; so the well be stuck in this - status. */ - int_vector_iset_default( state->cmode , report_step , CM_SHUT ); - /* - If code ever ends up by querying one of the states below here - there is something wrong. - */ - - double_vector_iset_default( state->oil_rate , report_step , -1); - double_vector_iset_default( state->water_rate , report_step , -1); - double_vector_iset_default( state->gas_rate , report_step , -1); - int_vector_iset_default( state->vfp_table , report_step , -1); - double_vector_iset_default( state->art_lift , report_step , -1); - double_vector_iset_default( state->thp , report_step , -1); - double_vector_iset_default( state->bhp , report_step , -1); - double_vector_iset_default( state->wgas_rate , report_step , -1); - -} - - -KW_IMPL(wconhist) diff --git a/ThirdParty/Ert/libsched/src/sched_kw_wconinj.c b/ThirdParty/Ert/libsched/src/sched_kw_wconinj.c deleted file mode 100644 index fdfb0986b9..0000000000 --- a/ThirdParty/Ert/libsched/src/sched_kw_wconinj.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_wconinj.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include - -#include -#include -#include - - - -/** - This file implements a very basic support for the WCONINJ - keyword. It internalizes a list of well names, apart from that all - information is just tucked into a untyped keyword. - - This means that all the functionality which is supported by the - sched_kw_wconinj implementation is asking for well names. - - It is an independent implementation - but the original - implementation is PURE COPY AND PASTE from the WCONPROD - implementation. -*/ - - - - - -struct sched_kw_wconinj_struct { - sched_kw_untyped_type * untyped_kw; - stringlist_type * wells; -}; - - - - - -static sched_kw_wconinj_type * sched_kw_wconinj_alloc_empty(bool alloc_untyped) -{ - sched_kw_wconinj_type * kw = util_malloc(sizeof * kw); - kw->wells = stringlist_alloc_new(); - if (alloc_untyped) - kw->untyped_kw = sched_kw_untyped_alloc_empty("WCONINJ" , -1 /* -1: Variable length keyword */ ); - else - kw->untyped_kw = NULL; - return kw; -} - - - -void sched_kw_wconinj_free(sched_kw_wconinj_type * kw) -{ - stringlist_free(kw->wells); - sched_kw_untyped_free(kw->untyped_kw); -} - - -static void sched_kw_wconinj_add_well(sched_kw_wconinj_type * kw , const char * well) { - stringlist_append_copy(kw->wells , well); -} - - - - - -sched_kw_wconinj_type * sched_kw_wconinj_alloc(const stringlist_type * tokens , int * token_index ) { - sched_kw_wconinj_type * kw = sched_kw_wconinj_alloc_empty( true ); - int eokw = false; - do { - stringlist_type * line_tokens = sched_util_alloc_line_tokens( tokens , false , 0 , token_index ); - if (line_tokens == NULL) - eokw = true; - else { - char * well = util_alloc_dequoted_copy( stringlist_iget( line_tokens , 0 ) ); - sched_kw_wconinj_add_well(kw , well); - sched_kw_untyped_add_tokens(kw->untyped_kw , line_tokens); - stringlist_free( line_tokens ); - free( well ); - } - - } while (!eokw); - return kw; -} - - -void sched_kw_wconinj_fprintf(const sched_kw_wconinj_type * kw , FILE * stream) { - sched_kw_untyped_fprintf( kw->untyped_kw , stream ); -} - - -char ** sched_kw_wconinj_alloc_wells_copy( const sched_kw_wconinj_type * kw , int * num_wells) { - *num_wells = stringlist_get_size( kw->wells ); - return stringlist_alloc_char_copy( kw->wells ); -} - -sched_kw_wconinj_type * sched_kw_wconinj_copyc(const sched_kw_wconinj_type * kw) { - util_abort("%s: not implemented ... \n",__func__); - return NULL; -} - - - -/*****************************************************************/ - -KW_IMPL(wconinj) - diff --git a/ThirdParty/Ert/libsched/src/sched_kw_wconinje.c b/ThirdParty/Ert/libsched/src/sched_kw_wconinje.c deleted file mode 100644 index 767966238f..0000000000 --- a/ThirdParty/Ert/libsched/src/sched_kw_wconinje.c +++ /dev/null @@ -1,526 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_wconinje.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - -#define DEFAULT_INJECTOR_STATE OPEN - -#define SCHED_KW_WCONINJE_ID 99165 -#define WCONINJE_TYPE_ID 5705235 -#define WCONINJE_NUM_KW 10 -#define ECL_DEFAULT_KW "*" - - -struct sched_kw_wconinje_struct { - int __type_id; - vector_type * wells; /* A vector of wconinje_well_type instances. */ -}; - - - -typedef struct { - bool def[WCONINJE_NUM_KW]; /* Has the item been defaulted? */ - - char * name; /* This does NOT support well_name_root or well list notation. */ - sched_phase_enum injector_type; /* Injecting GAS/WATER/OIL */ - well_status_enum status; /* Well is open/shut/??? */ - well_cm_enum cmode; /* How is the well controlled? */ - double surface_flow; - double reservoir_flow; - double BHP_target; - double THP_target; - int vfp_table_nr; - double vapoil_conc; -} wconinje_well_type; - - - - - -struct wconinje_state_struct { - UTIL_TYPE_ID_DECLARATION; - char * well_name; - const time_t_vector_type * time; - int_vector_type * phase; /* Contains values from sched_phase_enum */ - int_vector_type * state; /* Contains values from the well_status_enum. */ - int_vector_type * cmode; /* Contains values from the well_cm_enum. */ - double_vector_type * surface_flow; - double_vector_type * reservoir_flow; - double_vector_type * bhp_limit; - double_vector_type * thp_limit; - int_vector_type * vfp_table_nr; - double_vector_type * vapoil; -}; - - - - -/*****************************************************************/ -/* Implemeentation of the internal wconinje_well_type data type. */ - - - - - - - - - - -static wconinje_well_type * wconinje_well_alloc_empty() -{ - wconinje_well_type * well = util_malloc(sizeof * well); - well->name = NULL; - return well; -} - - - -static void wconinje_well_free(wconinje_well_type * well) -{ - free(well->name); - free(well); -} - - - -static void wconinje_well_free__(void * well) -{ - wconinje_well_free( (wconinje_well_type *) well); -} - - - - - -static wconinje_well_type * wconinje_well_alloc_from_tokens(const stringlist_type * line_tokens ) { - wconinje_well_type * well = wconinje_well_alloc_empty(); - sched_util_init_default( line_tokens , well->def ); - - well->name = util_alloc_string_copy( stringlist_iget( line_tokens , 0 )); - well->injector_type = sched_phase_type_from_string(stringlist_iget(line_tokens , 1)); - well->cmode = sched_types_get_cm_from_string( stringlist_iget( line_tokens , 3 ) , false); - well->surface_flow = sched_util_atof( stringlist_iget( line_tokens , 4 )); - well->reservoir_flow = sched_util_atof(stringlist_iget(line_tokens , 5 )); - well->BHP_target = sched_util_atof(stringlist_iget(line_tokens , 6 )); - well->THP_target = sched_util_atof( stringlist_iget( line_tokens , 7 )); - well->vfp_table_nr = sched_util_atoi( stringlist_iget( line_tokens , 8)); - well->vapoil_conc = sched_util_atof( stringlist_iget( line_tokens , 9 )); - - well->status = sched_types_get_status_from_string( stringlist_iget( line_tokens , 2 )); - if (well->status == DEFAULT) - well->status = DEFAULT_INJECTOR_STATE; - return well; -} - - - -static void wconinje_well_fprintf(const wconinje_well_type * well, FILE * stream) -{ - fprintf(stream, " "); - sched_util_fprintf_qst(well->def[0], well->name , 8, stream); - sched_util_fprintf_qst(well->def[1], sched_phase_type_string(well->injector_type) , 5, stream); /* 5 ?? */ - sched_util_fprintf_qst(well->def[2], sched_types_get_status_string(well->status) , 4, stream); - sched_util_fprintf_qst(well->def[3], sched_types_get_cm_string(well->cmode) , 4, stream); - sched_util_fprintf_dbl(well->def[4], well->surface_flow , 11, 3, stream); - sched_util_fprintf_dbl(well->def[5], well->reservoir_flow , 11, 3, stream); - sched_util_fprintf_dbl(well->def[6], well->BHP_target , 11, 3, stream); - sched_util_fprintf_dbl(well->def[7], well->THP_target , 11, 3, stream); - sched_util_fprintf_int(well->def[8], well->vfp_table_nr , 4, stream); - sched_util_fprintf_dbl(well->def[9], well->vapoil_conc , 11, 3, stream); - fprintf(stream, "/ \n"); -} - - -/*****************************************************************/ - - - - -static sched_kw_wconinje_type * sched_kw_wconinje_alloc_empty() { - sched_kw_wconinje_type * kw = util_malloc(sizeof * kw); - kw->wells = vector_alloc_new(); - kw->__type_id = SCHED_KW_WCONINJE_ID; - return kw; -} - -sched_kw_wconinje_type * sched_kw_wconinje_safe_cast( void * arg ) { - sched_kw_wconinje_type * kw = (sched_kw_wconinje_type * ) arg; - if (kw->__type_id == SCHED_KW_WCONINJE_ID) - return kw; - else { - util_abort("%s: runtime cast failed \n",__func__); - return NULL; - } -} - - - - -void sched_kw_wconinje_free(sched_kw_wconinje_type * kw) -{ - vector_free( kw->wells ); - free(kw); -} - - -static void sched_kw_wconinje_add_well( sched_kw_wconinje_type * kw , const wconinje_well_type * well) { - vector_append_owned_ref(kw->wells , well , wconinje_well_free__); -} - - - - - -sched_kw_wconinje_type * sched_kw_wconinje_alloc(const stringlist_type * tokens , int * token_index ) { - sched_kw_wconinje_type * kw = sched_kw_wconinje_alloc_empty(); - int eokw = false; - do { - stringlist_type * line_tokens = sched_util_alloc_line_tokens( tokens , false , WCONINJE_NUM_KW , token_index ); - if (line_tokens == NULL) - eokw = true; - else { - wconinje_well_type * well = wconinje_well_alloc_from_tokens( line_tokens ); - sched_kw_wconinje_add_well( kw , well ); - stringlist_free( line_tokens ); - } - } while (!eokw); - return kw; -} - - - -void sched_kw_wconinje_fprintf(const sched_kw_wconinje_type * kw , FILE * stream) { - int size = vector_get_size(kw->wells); - - fprintf(stream, "WCONINJE\n"); - for(int i=0; iwells, i); - wconinje_well_fprintf(well, stream); - } - fprintf(stream,"/\n\n"); -} - - - -char ** sched_kw_wconinje_alloc_wells_copy( const sched_kw_wconinje_type * kw , int * num_wells) { - int size = vector_get_size(kw->wells); - - char ** well_names = util_malloc( size * sizeof * well_names ); - for(int i=0; iwells, i); - well_names[i] = util_alloc_string_copy(well->name); - } - *num_wells = size; - return well_names; -} - - - - -/*****************************************************************/ -/* Functions exporting content to be used with the sched_file_update - api. */ - -/** Will return NULL if the well is not present. */ -static wconinje_well_type * sched_kw_wconinje_get_well( const sched_kw_wconinje_type * kw , const char * well_name) { - int size = vector_get_size(kw->wells); - wconinje_well_type * well = NULL; - int index = 0; - do { - wconinje_well_type * iwell = vector_iget( kw->wells , index); - if (strcmp( well_name , iwell->name ) == 0) - well = iwell; - - index++; - } while ((well == NULL) && (index < size)); - return well; -} - - - -double sched_kw_wconinje_get_surface_flow( const sched_kw_wconinje_type * kw , const char * well_name) { - wconinje_well_type * well = sched_kw_wconinje_get_well( kw , well_name ); - if (well != NULL) - return well->surface_flow; - else - return -1; -} - -void sched_kw_wconinje_scale_surface_flow( const sched_kw_wconinje_type * kw , const char * well_name, double factor) { - wconinje_well_type * well = sched_kw_wconinje_get_well( kw , well_name ); - if (well != NULL) - well->surface_flow *= factor; -} - -void sched_kw_wconinje_set_surface_flow( const sched_kw_wconinje_type * kw , const char * well_name , double surface_flow) { - wconinje_well_type * well = sched_kw_wconinje_get_well( kw , well_name ); - if (well != NULL) - well->surface_flow = surface_flow; -} - - - -void sched_kw_wconinje_shift_surface_flow( const sched_kw_wconinje_type * kw , const char * well_name , double delta_surface_flow) { - wconinje_well_type * well = sched_kw_wconinje_get_well( kw , well_name ); - if (well != NULL) - well->surface_flow += delta_surface_flow; -} - - -sched_phase_enum sched_kw_wconinje_get_phase( const sched_kw_wconinje_type * kw , const char * well_name) { - wconinje_well_type * well = sched_kw_wconinje_get_well( kw , well_name ); - if (well != NULL) - return well->injector_type; - else - return -1; -} - - - -bool sched_kw_wconinje_has_well( const sched_kw_wconinje_type * kw , const char * well_name) { - wconinje_well_type * well = sched_kw_wconinje_get_well( kw , well_name ); - if (well == NULL) - return false; - else - return true; -} - - -sched_kw_wconinje_type * sched_kw_wconinje_copyc(const sched_kw_wconinje_type * kw) { - util_abort("%s: not implemented ... \n",__func__); - return NULL; -} - - -bool sched_kw_wconinje_well_open( const sched_kw_wconinje_type * kw, const char * well_name) { - wconinje_well_type * well = sched_kw_wconinje_get_well( kw , well_name ); - if (well == NULL) - return false; - else { - /* OK - we have the well. */ - - if (well->status == OPEN) { - /* The well seems to be open - any rates around? */ - if (well->surface_flow > 0) - return true; - else - return false; - } else - return false; } -} - -/*****************************************************************/ - - -/*****************************************************************/ - -wconinje_state_type * wconinje_state_alloc( const char * well_name , const time_t_vector_type * time) { - wconinje_state_type * wconinje = util_malloc( sizeof * wconinje); - UTIL_TYPE_ID_INIT( wconinje , WCONINJE_TYPE_ID ); - - wconinje->phase = int_vector_alloc( 0 , 0 ); - wconinje->state = int_vector_alloc( 0 , 0 ); /* Default wconinje state ? */ - wconinje->cmode = int_vector_alloc( 0 , 0 ); /* Default control mode ?? */ - wconinje->surface_flow = double_vector_alloc( 0 , 0 ); - wconinje->reservoir_flow = double_vector_alloc( 0 , 0 ); - wconinje->bhp_limit = double_vector_alloc( 0 , 0 ); - wconinje->thp_limit = double_vector_alloc( 0 , 0 ); - wconinje->vfp_table_nr = int_vector_alloc( 0 , 0 ); - wconinje->vapoil = double_vector_alloc( 0 ,0 ); - wconinje->time = time; - wconinje->well_name = util_alloc_string_copy( well_name ); - - return wconinje; -} - - -static UTIL_SAFE_CAST_FUNCTION( wconinje_state , WCONINJE_TYPE_ID ) -static UTIL_SAFE_CAST_FUNCTION_CONST( wconinje_state , WCONINJE_TYPE_ID ) - -void wconinje_state_free( wconinje_state_type * wconinje ) { - - int_vector_free(wconinje->phase); - int_vector_free(wconinje->state); - int_vector_free(wconinje->cmode); - double_vector_free(wconinje->surface_flow); - double_vector_free(wconinje->reservoir_flow); - double_vector_free(wconinje->bhp_limit); - double_vector_free(wconinje->thp_limit); - int_vector_free(wconinje->vfp_table_nr); - double_vector_free(wconinje->vapoil); - free( wconinje->well_name ); - free( wconinje ); - -} - -void wconinje_state_free__( void * arg ) { - wconinje_state_free( wconinje_state_safe_cast( arg )); -} - - - -/** - This function asks for the historical water injection rate; however - this is the WCONINJE keyword, and it is NOT necessarily meaningful - to query this keyword for that rate. To be meaningfull we check the - following conditions: - - 1. We verify that the well is rate-controlled; then the behaviour - of the well should(??) coincide with that of wells specifed by - the WCONINJH keyword. - - 2. We verify that the injected phase is indeed water. - - If these conditions are not met 0 is returned, AND a warning is - written to stderr. -*/ - -double wconinje_state_iget_WWIRH( const void * __state , int report_step ) { - const wconinje_state_type * state = wconinje_state_safe_cast_const( __state ); - sched_phase_enum phase = int_vector_safe_iget( state->phase , report_step ); - well_cm_enum cmode = int_vector_safe_iget( state->cmode , report_step); - - if (( phase == WATER) && (cmode == RATE)) - return double_vector_safe_iget( state->surface_flow , report_step); - else { - if ( phase != WATER ) - fprintf(stderr,"** Warning you have asked for historical water injection rate in well:%s which is not a water injector.\n", state->well_name); - - if ( cmode != RATE ) - fprintf(stderr,"** Warning you have asked for historical water injection rate in well:%s which is not rate controlled - I have no clue?! \n" , state->well_name); - - return 0; - } -} - -/** - See comment above wconinje_state_get_WWIRH(); -*/ -double wconinje_state_iget_WGIRH( const void * __state , int report_step ) { - const wconinje_state_type * state = wconinje_state_safe_cast_const( __state ); - sched_phase_enum phase = int_vector_safe_iget( state->phase , report_step ); - well_cm_enum cmode = int_vector_safe_iget( state->cmode , report_step); - - if (( phase == GAS) && (cmode == RATE)) - return double_vector_safe_iget( state->surface_flow , report_step); - else { - if ( phase != GAS ) - fprintf(stderr,"** Warning you have asked for historical gas injection rate in well:%s(%d) which is not a gas injector.\n", state->well_name, report_step); - - if ( cmode != RATE ) - fprintf(stderr,"** Warning you have asked for historical gas injection rate in well:%s(%d) which is not rate controlled - I have no clue?! \n" , state->well_name, report_step); - - return 0; - } -} - -/** - Will update the input parameter @well_list to contain all the - well_names present in the current sced_kw_wconhist keyword. -*/ - -void sched_kw_wconinje_init_well_list( const sched_kw_wconinje_type * kw , stringlist_type * well_list) { - stringlist_clear( well_list ); - { - int iw; - for (iw = 0; iw < vector_get_size( kw->wells ); iw++) { - const wconinje_well_type * well = vector_iget_const( kw->wells , iw ); - stringlist_append_ref( well_list , well->name ); - } - } -} - - -/** - For production the WCONHIST keyword will (typically) be used for - the historical period, and WCONPROD for the predicton. This can be - used to differentiate between hisorical period and prediction - period. When it comes to injection things are not so clear; - typically the WCONINJE keyword is used both for prediction and - historical period. - - This function will check if all the wells (at least one) in the - WCONINJE keyword are rate-controlled, if so it is interpreted as - beeing in the historical period. -*/ - -bool sched_kw_wconinje_historical( const sched_kw_wconinje_type * kw ) { - bool historical = false; - int iw; - for (iw = 0; iw < vector_get_size( kw->wells ); iw++) { - const wconinje_well_type * well = vector_iget_const( kw->wells , iw ); - if (well->cmode == RATE) { - historical = true; - break; - } - } - return historical; -} - - - - - -void sched_kw_wconinje_update_state( const sched_kw_wconinje_type * kw , wconinje_state_type * state , const char * well_name , int report_step ) { - wconinje_well_type * well = sched_kw_wconinje_get_well( kw , well_name ); - if (well != NULL) { - int_vector_iset_default(state->phase , report_step , well->injector_type ); - int_vector_iset_default(state->state , report_step , well->status); - int_vector_iset_default(state->cmode , report_step , well->cmode); - double_vector_iset_default(state->surface_flow , report_step , well->surface_flow); - double_vector_iset_default(state->reservoir_flow , report_step , well->reservoir_flow); - double_vector_iset_default(state->bhp_limit , report_step , well->BHP_target); - double_vector_iset_default(state->thp_limit , report_step , well->THP_target); - int_vector_iset_default(state->vfp_table_nr , report_step , well->vfp_table_nr); - double_vector_iset_default(state->vapoil , report_step , well->vapoil_conc); - } -} - - -void sched_kw_wconinje_close_state(wconinje_state_type * state , int report_step ) { - fprintf(stderr,"** Warning: %s not implemented \n",__func__); - //int_vector_iset_default( state->state , report_step , SHUT ); /* SHUT or STOP ?? */ - //double_vector_iset_default(state->injection_rate , report_step , -1 ); - //double_vector_iset_default(state->bhp , report_step , -1 ); - //double_vector_iset_default(state->thp , report_step , -1 ); - //int_vector_iset_default(state->vfp_table_nr , report_step , -1 ); - //double_vector_iset_default(state->vapoil , report_step , -1 ); -} - - - - - -KW_IMPL(wconinje) diff --git a/ThirdParty/Ert/libsched/src/sched_kw_wconinjh.c b/ThirdParty/Ert/libsched/src/sched_kw_wconinjh.c deleted file mode 100644 index 42e954bb03..0000000000 --- a/ThirdParty/Ert/libsched/src/sched_kw_wconinjh.c +++ /dev/null @@ -1,436 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_wconinjh.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#define WCONINJH_TYPE_ID 88163977 -#define WCONINJH_NUM_KW 8 - - -struct sched_kw_wconhist_struct{ - vector_type * wells; -}; - - -typedef struct wconinjh_well_struct wconinjh_well_type; - - - -struct wconinjh_well_struct{ - /* - def: Read as defaulted, not defined! - */ - bool def[WCONINJH_NUM_KW]; - - char * name; - sched_phase_enum inj_phase; - well_status_enum status; - double inj_rate; - double bhp; - double thp; - int vfptable; - double vapdiscon; -}; - - -struct wconinjh_state_struct { - UTIL_TYPE_ID_DECLARATION; - const time_t_vector_type * time; - int_vector_type * phase; /* Contains values from sched_phase_enum */ - int_vector_type * state; /* Contains values from the well_status_enum. */ - double_vector_type * injection_rate; - double_vector_type * bhp; - double_vector_type * thp; - int_vector_type * vfp_table_nr; - double_vector_type * vapoil; -}; - - - -static wconinjh_well_type * wconinjh_well_alloc_empty() -{ - wconinjh_well_type * well = util_malloc(sizeof * well); - well->name = NULL; - return well; -} - - - -static void wconinjh_well_free(wconinjh_well_type * well) -{ - free(well->name); - free(well); -} - - - -static void wconinjh_well_free__(void * well) -{ - wconinjh_well_free( (wconinjh_well_type *) well); -} - - - -/** Will return NULL if the well is not present. */ -static wconinjh_well_type * sched_kw_wconinjh_get_well( const sched_kw_wconinjh_type * kw , const char * well_name) { - int size = vector_get_size(kw->wells); - wconinjh_well_type * well = NULL; - int index = 0; - do { - wconinjh_well_type * iwell = vector_iget( kw->wells , index); - if (strcmp( well_name , iwell->name ) == 0) - well = iwell; - - index++; - } while ((well == NULL) && (index < size)); - return well; -} - - -static void wconinjh_well_fprintf(const wconinjh_well_type * well, FILE * stream) -{ - fprintf(stream, " "); - sched_util_fprintf_qst(well->def[0], well->name , 8 , stream); - sched_util_fprintf_qst(well->def[1], sched_phase_type_string(well->inj_phase) , 5 , stream); - sched_util_fprintf_qst(well->def[2], sched_types_get_status_string(well->status) , 4 , stream); - sched_util_fprintf_dbl(well->def[3], well->inj_rate , 9 , 3 , stream); - sched_util_fprintf_dbl(well->def[4], well->bhp , 9 , 3 , stream); - sched_util_fprintf_dbl(well->def[5], well->thp , 9 , 3 , stream); - sched_util_fprintf_int(well->def[6], well->vfptable , 4 , stream); - sched_util_fprintf_dbl(well->def[7], well->vapdiscon , 9 , 3 , stream); - fprintf(stream, "/\n"); -} - - - - - - - - - -static wconinjh_well_type * wconinjh_well_alloc_from_tokens(const stringlist_type * line_tokens ) { - - wconinjh_well_type * well = wconinjh_well_alloc_empty(); - sched_util_init_default( line_tokens , well->def ); - - well->name = util_alloc_string_copy(stringlist_iget(line_tokens , 0)); - well->inj_phase = sched_phase_type_from_string(stringlist_iget(line_tokens , 1)); - well->status = sched_types_get_status_from_string(stringlist_iget(line_tokens , 2)); - well->inj_rate = sched_util_atof(stringlist_iget(line_tokens , 3)); - well->bhp = sched_util_atof(stringlist_iget(line_tokens , 4)); - well->thp = sched_util_atof(stringlist_iget(line_tokens , 5)); - well->vfptable = sched_util_atoi(stringlist_iget(line_tokens , 6)); - well->vapdiscon = sched_util_atof(stringlist_iget(line_tokens , 7)); - - return well; -} - - - -static hash_type * wconinjh_well_export_obs_hash(const wconinjh_well_type * well) { - hash_type * obs_hash = hash_alloc(); - - if(!well->def[3]) - { - switch(well->inj_phase) - { - case(WATER): - hash_insert_double(obs_hash, "WWIR", well->inj_rate); - break; - case(GAS): - hash_insert_double(obs_hash, "WGIR", well->inj_rate); - break; - case(OIL): - hash_insert_double(obs_hash, "WOIR", well->inj_rate); - break; - default: - break; - } - } - if(!well->def[4]) - hash_insert_double(obs_hash, "WBHP", well->bhp); - if(!well->def[5]) - hash_insert_double(obs_hash, "WTHP", well->thp); - - return obs_hash; -} - - -static void sched_kw_wconinjh_add_well( sched_kw_wconinjh_type * kw , wconinjh_well_type * well) { - vector_append_owned_ref(kw->wells , well , wconinjh_well_free__); -} - - - -static sched_kw_wconinjh_type * sched_kw_wconinjh_alloc_empty() -{ - sched_kw_wconinjh_type * kw = util_malloc(sizeof * kw); - kw->wells = vector_alloc_new(); - return kw; -} - - - -/***********************************************************************/ - - -sched_kw_wconinjh_type * sched_kw_wconinjh_alloc(const stringlist_type * tokens , int * token_index ) { - sched_kw_wconinjh_type * kw = sched_kw_wconinjh_alloc_empty(); - int eokw = false; - do { - stringlist_type * line_tokens = sched_util_alloc_line_tokens( tokens , false, WCONINJH_NUM_KW , token_index ); - if (line_tokens == NULL) - eokw = true; - else { - wconinjh_well_type * well = wconinjh_well_alloc_from_tokens( line_tokens ); - sched_kw_wconinjh_add_well( kw , well ); - stringlist_free( line_tokens ); - } - } while (!eokw); - return kw; -} - - -void sched_kw_wconinjh_free(sched_kw_wconinjh_type * kw) -{ - vector_free(kw->wells); - free(kw); -} - - - -void sched_kw_wconinjh_fprintf(const sched_kw_wconinjh_type * kw, FILE * stream) -{ - int size = vector_get_size(kw->wells); - - fprintf(stream, "WCONINJH\n"); - for(int i=0; iwells, i ); - wconinjh_well_fprintf(well, stream); - } - fprintf(stream,"/\n\n"); -} - - - - -/***********************************************************************/ - - - -hash_type * sched_kw_wconinjh_alloc_well_obs_hash(const sched_kw_wconinjh_type * kw) -{ - hash_type * well_hash = hash_alloc(); - - int num_wells = vector_get_size(kw->wells); - - for(int well_nr=0; well_nrwells, well_nr); - hash_type * obs_hash = wconinjh_well_export_obs_hash(well); - hash_insert_hash_owned_ref(well_hash, well->name, obs_hash, hash_free__); - } - - return well_hash; -} - -sched_kw_wconinjh_type * sched_kw_wconinjh_copyc(const sched_kw_wconinjh_type * kw) { - util_abort("%s: not implemented ... \n",__func__); - return NULL; -} - - -/*****************************************************************/ - -void sched_kw_wconinjh_init_well_list( const sched_kw_wconinjh_type * kw , stringlist_type * well_list) { - stringlist_clear( well_list ); - { - int iw; - for (iw = 0; iw < stringlist_get_size( well_list ); iw++) { - const wconinjh_well_type * well = vector_iget_const( kw->wells , iw ); - stringlist_append_ref( well_list , well->name ); - } - } -} - - - - -/*****************************************************************/ - -wconinjh_state_type * wconinjh_state_alloc( const time_t_vector_type* time) { - wconinjh_state_type * wconinjh = util_malloc( sizeof * wconinjh); - UTIL_TYPE_ID_INIT( wconinjh , WCONINJH_TYPE_ID ); - - wconinjh->time = time; - wconinjh->phase = int_vector_alloc( 0 , 0 ); - wconinjh->state = int_vector_alloc( 0 , 0 ); /* Default wconinjh state ? */ - wconinjh->injection_rate = double_vector_alloc( 0 , 0 ); - wconinjh->bhp = double_vector_alloc( 0 , 0 ); - wconinjh->thp = double_vector_alloc( 0 , 0 ); - wconinjh->vfp_table_nr = int_vector_alloc( 0 , 0 ); - wconinjh->vapoil = double_vector_alloc( 0 ,0 ); - - return wconinjh; -} - -UTIL_SAFE_CAST_FUNCTION( wconinjh_state , WCONINJH_TYPE_ID ) -UTIL_SAFE_CAST_FUNCTION_CONST( wconinjh_state , WCONINJH_TYPE_ID ) - -void wconinjh_state_free( wconinjh_state_type * wconinjh ) { - - int_vector_free( wconinjh->phase ); - int_vector_free( wconinjh->state ); - double_vector_free( wconinjh->injection_rate ); - double_vector_free( wconinjh->bhp ); - double_vector_free( wconinjh->thp ); - int_vector_free( wconinjh->vfp_table_nr ); - double_vector_free( wconinjh->vapoil ); - - free( wconinjh ); -} - - - -void wconinjh_state_free__( void * arg ) { - wconinjh_state_free( wconinjh_state_safe_cast( arg )); -} - - -/** - memnonic ?? -*/ - - -sched_phase_enum wconinjh_state_iget_phase( const wconinjh_state_type * state , int report_step) { - return int_vector_safe_iget( state->phase , report_step ); -} - - -well_status_enum wconinjh_state_iget_status( const wconinjh_state_type * state , int report_step ) { - return int_vector_safe_iget( state->state , report_step ); -} - -/** - Water injection rate - will return 0.0 if inj_phase == GAS. -*/ - -double wconinjh_state_iget_WWIRH( const void * __state , int report_step) { - const wconinjh_state_type * state = wconinjh_state_safe_cast_const( __state ); - if (wconinjh_state_iget_phase( state , report_step ) == WATER) - return double_vector_safe_iget( state->injection_rate , report_step); - else - return 0.0; -} - - -/** - Gas injection rate - will return 0.0 if inj_phase == WATER. -*/ - -double wconinjh_state_iget_WGIRH( const void * __state , int report_step) { - const wconinjh_state_type * state = wconinjh_state_safe_cast_const( __state ); - if (wconinjh_state_iget_phase( state , report_step ) == GAS) - return double_vector_safe_iget( state->injection_rate , report_step); - else - return 0.0; -} - - -/** - OIL injection rate - will return 0.0 if inj_phase == WATER|GAS -*/ - -double wconinjh_state_iget_WOIRH( const void * __state , int report_step) { - const wconinjh_state_type * state = wconinjh_state_safe_cast_const( __state ); - if (wconinjh_state_iget_phase( state , report_step ) == OIL) - return double_vector_safe_iget( state->injection_rate , report_step); - else - return 0.0; -} - - - -double wconinjh_state_iget_WBHPH( const void * __state , int report_step) { - const wconinjh_state_type * state = wconinjh_state_safe_cast_const( __state ); - return double_vector_safe_iget( state->bhp , report_step ); -} - - -double wconinjh_state_iget_WTHPH( const void * __state , int report_step) { - const wconinjh_state_type * state = wconinjh_state_safe_cast_const( __state ); - return double_vector_safe_iget( state->thp , report_step ); -} - -/** Memnonic ??*/ -double wconinjh_state_iget_WVPRH( const void * __state , int report_step) { - const wconinjh_state_type * state = wconinjh_state_safe_cast_const( __state ); - return double_vector_safe_iget( state->vapoil , report_step ); -} - - -int wconinjh_state_iget_vfp_table_nr( const wconinjh_state_type * state , int report_step) { - return int_vector_safe_iget( state->vfp_table_nr , report_step ); -} - - - - -void sched_kw_wconinjh_close_state(wconinjh_state_type * state , int report_step ) { - int_vector_iset_default( state->state , report_step , SHUT ); /* SHUT or STOP ?? */ - double_vector_iset_default(state->injection_rate , report_step , -1 ); - double_vector_iset_default(state->bhp , report_step , -1 ); - double_vector_iset_default(state->thp , report_step , -1 ); - int_vector_iset_default(state->vfp_table_nr , report_step , -1 ); - double_vector_iset_default(state->vapoil , report_step , -1 ); -} - - -void sched_kw_wconinjh_update_state( const sched_kw_wconinjh_type * kw , wconinjh_state_type * state , const char * well_name , int report_step ) { - wconinjh_well_type * well = sched_kw_wconinjh_get_well( kw , well_name ); - if (well != NULL) { - int_vector_iset_default(state->phase , report_step , well->inj_phase ); - int_vector_iset_default(state->state , report_step , well->status ); - double_vector_iset_default(state->injection_rate , report_step , well->inj_rate); - double_vector_iset_default(state->bhp , report_step , well->bhp); - double_vector_iset_default(state->thp , report_step , well->thp); - int_vector_iset_default(state->vfp_table_nr , report_step , well->vfptable); - double_vector_iset_default(state->vapoil , report_step , well->vapdiscon); - } -} - - - - -/***********************************************************************/ -KW_IMPL(wconinjh) diff --git a/ThirdParty/Ert/libsched/src/sched_kw_wconprod.c b/ThirdParty/Ert/libsched/src/sched_kw_wconprod.c deleted file mode 100644 index 07a9549544..0000000000 --- a/ThirdParty/Ert/libsched/src/sched_kw_wconprod.c +++ /dev/null @@ -1,134 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_wconprod.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include - -#include -#include -#include - - - - -/** - This file implements a very basic support for the WCONPROD - keyword. It internalizes a list of well names, apart from that all - information is just tucked into a untyped keyword. - - This means that all the functionality which is sppurted by the - sched_kw_wconprod implementation is asking for well names. -*/ - - - - -struct sched_kw_wconprod_struct { - sched_kw_untyped_type * untyped_kw; - stringlist_type * wells; -}; - - - - - -static sched_kw_wconprod_type * sched_kw_wconprod_alloc_empty(bool alloc_untyped) -{ - sched_kw_wconprod_type * kw = util_malloc(sizeof * kw); - kw->wells = stringlist_alloc_new(); - if (alloc_untyped) - kw->untyped_kw = sched_kw_untyped_alloc_empty("WCONPROD" , -1 /* -1: Variable length keyword */); - else - kw->untyped_kw = NULL; - return kw; -} - - - -void sched_kw_wconprod_free(sched_kw_wconprod_type * kw) -{ - stringlist_free( kw->wells ); - sched_kw_untyped_free(kw->untyped_kw); - free( kw ); -} - - -static void sched_kw_wconprod_add_well(sched_kw_wconprod_type * kw , const char * well) { - stringlist_append_copy(kw->wells , well); -} - - - - - -sched_kw_wconprod_type * sched_kw_wconprod_alloc(const stringlist_type * tokens , int * token_index ) { - sched_kw_wconprod_type * kw = sched_kw_wconprod_alloc_empty( true ); - int eokw = false; - do { - stringlist_type * line_tokens = sched_util_alloc_line_tokens( tokens , true , 0 , token_index ); - if (line_tokens == NULL) - eokw = true; - else { - char * well = util_alloc_dequoted_copy( stringlist_iget( line_tokens , 0 ) ); - sched_kw_wconprod_add_well(kw , well); - sched_kw_untyped_add_tokens(kw->untyped_kw , line_tokens); - stringlist_free( line_tokens ); - free( well ); - } - - } while (!eokw); - return kw; -} - - -void sched_kw_wconprod_fprintf(const sched_kw_wconprod_type * kw , FILE * stream) { - sched_kw_untyped_fprintf( kw->untyped_kw , stream ); -} - - -char ** sched_kw_wconprod_alloc_wells_copy( const sched_kw_wconprod_type * kw , int * num_wells) { - *num_wells = stringlist_get_size( kw->wells ); - return stringlist_alloc_char_copy( kw->wells ); -} - - -sched_kw_wconprod_type * sched_kw_wconprod_copyc(const sched_kw_wconprod_type * kw) { - util_abort("%s: not implemented ... \n",__func__); - return NULL; -} - - -void sched_kw_wconprod_init_well_list( const sched_kw_wconprod_type * kw , stringlist_type * well_list) { - stringlist_clear( well_list ); - { - int iw; - for (iw = 0; iw < stringlist_get_size( kw->wells ); iw++) - stringlist_append_ref( well_list , stringlist_iget( kw->wells , iw) ); - } -} - - - -/*****************************************************************/ - -KW_IMPL(wconprod) - diff --git a/ThirdParty/Ert/libsched/src/sched_kw_welspecs.c b/ThirdParty/Ert/libsched/src/sched_kw_welspecs.c deleted file mode 100644 index c78a8fafda..0000000000 --- a/ThirdParty/Ert/libsched/src/sched_kw_welspecs.c +++ /dev/null @@ -1,507 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_kw_welspecs.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include - - - -/* - TODO - - Create lookup STRING -> ENUM for all types and fix all strcmp! - -*/ - -/* - Define the maximum number of keywords in a WELSPEC record. - Note that this includes FrontSim and ECLIPSE 300 KWs. -*/ -#define WELSPECS_NUM_KW 16 -#define ECL_DEFAULT_KW "*" - - -#define DEFAULT_INFLOW_EQUATION IE_STD -#define DEFAULT_AUTO_SHUT_TYPE AS_SHUT -#define DEFAULT_CROSSFLOW_ABILITY CF_YES -#define DEFAULT_HDSTAT_TYPE HD_SEG - - -struct sched_kw_welspecs_struct -{ - vector_type * welspec_list; -}; - - -/* - See ECLIPSE Reference Manual, section WELSPECS for an explantion of - the members in the welspec_type struct. -*/ - -typedef enum {PH_OIL , PH_WAT , PH_GAS , PH_LIQ} phase_type; -#define PH_OIL_STRING "OIL" -#define PH_WAT_STRING "WATER" -#define PH_GAS_STRING "GAS" -#define PH_LIQ_STRING "LIQ" - - - -typedef enum {IE_STD, IE_NO, IE_RG, IE_YES, IE_PP, IE_GPP} inflow_eq_type; -#define IE_STD_STRING "STD" -#define IE_NO_STRING "NO" -#define IE_RG_STRING "R-G" -#define IE_YES_STRING "YES" -#define IE_PP_STRING "P-P" -#define IE_GPP_STRING "GPP" - - - -typedef enum {AS_STOP, AS_SHUT} auto_shut_type; -#define AS_STOP_STRING "STOP" -#define AS_SHUT_STRING "SHUT" - - - -typedef enum {CF_YES, CF_NO} crossflow_type; -#define CF_YES_STRING "YES" -#define CF_NO_STRING "NO" - -typedef enum {HD_SEG, HD_AVG} hdstat_head_type; -#define HD_SEG_STRING "SEG" -#define HD_AVG_STRING "AVG" - -typedef struct -{ - /* - def : Read as defaulted, not as defined. - */ - bool def[WELSPECS_NUM_KW]; - - char * name; - char * group; - int hh_i; - int hh_j; - double md; - phase_type phase; - double drain_rad; - inflow_eq_type inflow_eq; - auto_shut_type auto_shut; - crossflow_type crossflow; - int pvt_region; - hdstat_head_type hdstat_head; - int fip_region; - char * fs_kw1; - char * fs_kw2; - char * ecl300_kw; -} welspec_type; - - - -static char * get_phase_string(phase_type phase) -{ - switch(phase) - { - case(PH_OIL): - return PH_OIL_STRING; - case(PH_WAT): - return PH_WAT_STRING; - case(PH_GAS): - return PH_GAS_STRING; - case(PH_LIQ): - return PH_LIQ_STRING; - default: - return ECL_DEFAULT_KW; - } -}; - - - -static char * get_inflow_eq_string(inflow_eq_type eq) -{ - switch(eq) - { - case(IE_STD): - return IE_STD_STRING; - case(IE_NO): - return IE_NO_STRING; - case(IE_RG): - return IE_NO_STRING; - case(IE_YES): - return IE_YES_STRING; - case(IE_PP): - return IE_PP_STRING; - case(IE_GPP): - return IE_GPP_STRING; - default: - return ECL_DEFAULT_KW; - } -}; - - - -static char * get_auto_shut_string(auto_shut_type as) -{ - switch(as) - { - case(AS_STOP): - return AS_STOP_STRING; - case(AS_SHUT): - return AS_SHUT_STRING; - default: - return ECL_DEFAULT_KW; - } -}; - - - -static char * get_crossflow_string(crossflow_type cf) -{ - switch(cf) - { - case(CF_YES): - return CF_YES_STRING; - case(CF_NO): - return CF_NO_STRING; - default: - return ECL_DEFAULT_KW; - } -} - - - -static char * get_hdstat_head_string(hdstat_head_type hd) -{ - switch(hd) - { - case(HD_SEG): - return HD_SEG_STRING; - case(HD_AVG): - return HD_AVG_STRING; - default: - return ECL_DEFAULT_KW; - } -}; - - - -static inflow_eq_type get_inflow_eq_from_string(const char * string) -{ - if(strcmp(string , IE_STD_STRING) == 0) - return IE_STD; - else if(strcmp(string, IE_NO_STRING) == 0) - return IE_NO; - else if(strcmp(string, IE_RG_STRING) == 0) - return IE_RG; - else if(strcmp(string, IE_YES_STRING) == 0) - return IE_YES; - else if(strcmp(string, IE_PP_STRING) == 0) - return IE_PP; - else if(strcmp(string, IE_GPP_STRING) == 0) - return IE_GPP; - else if (strcmp(string , SCHED_KW_DEFAULT_ITEM) == 0) - return DEFAULT_INFLOW_EQUATION; - else - util_abort("%s: Inflow equation %s not recognized - aborting.\n",__func__, string); - return IE_STD; -} - - - -/* No default is defined according to the documentation. */ -static phase_type get_phase_from_string(const char * string) -{ - if(strcmp(string , PH_OIL_STRING) == 0) - return PH_OIL; - else if(strcmp(string, PH_WAT_STRING) == 0) - return PH_WAT; - else if(strcmp(string, PH_GAS_STRING) == 0) - return PH_GAS; - else if(strcmp(string, PH_LIQ_STRING) == 0) - return PH_LIQ; - else - util_abort("%s: Phase %s not recognized - aborting.\n",__func__,string); - return 0; -} - - - -static auto_shut_type get_auto_shut_from_string(const char * string) -{ - if(strcmp(string, AS_STOP_STRING) == 0) - return AS_STOP; - else if (strcmp(string,AS_SHUT_STRING) == 0) - return AS_SHUT; - else if (strcmp(string , SCHED_KW_DEFAULT_ITEM) == 0) - return DEFAULT_AUTO_SHUT_TYPE; - else - util_abort("%s: Automatic shut-in mode %s not recognized - aborting.\n",__func__,string); - return 0; -} - - - -static crossflow_type get_crossflow_from_string(const char * string) -{ - if(strcmp(string ,CF_YES_STRING) == 0) - return CF_YES; - else if(strcmp(string,CF_NO_STRING) == 0) - return CF_NO; - else if(strcmp(string,SCHED_KW_DEFAULT_ITEM) == 0) - return DEFAULT_CROSSFLOW_ABILITY; - else - util_abort("%s: Crossflow ability mode %s not recognized - aborting.\n",__func__,string); - return 0; -} - - - -static hdstat_head_type get_hdstat_head_from_string(const char * string) -{ - if(strcmp(string ,HD_SEG_STRING) == 0) - return HD_SEG; - else if(strcmp(string,HD_AVG_STRING) == 0) - return HD_AVG; - else if(strcmp(string,SCHED_KW_DEFAULT_ITEM) == 0) - return DEFAULT_HDSTAT_TYPE; - else - util_abort("%s: Hydrostatic head model %s not recognized - aborting.\n",__func__,string); - return 0; -} - - - -static void welspec_sched_fprintf(const welspec_type * ws, FILE * stream) -{ - fprintf(stream, " "); - sched_util_fprintf_qst(ws->def[0] , ws->name , 8, stream); - sched_util_fprintf_qst(ws->def[1] , ws->group , 8, stream); - sched_util_fprintf_int(ws->def[2] , ws->hh_i , 4, stream); - sched_util_fprintf_int(ws->def[3] , ws->hh_j , 4, stream); - sched_util_fprintf_dbl(ws->def[4] , ws->md , 8, 3, stream); - sched_util_fprintf_qst(ws->def[5] , get_phase_string(ws->phase) , 5, stream); - sched_util_fprintf_dbl(ws->def[6] , ws->drain_rad , 8, 3, stream); - sched_util_fprintf_qst(ws->def[7] , get_inflow_eq_string(ws->inflow_eq) , 3, stream); - sched_util_fprintf_qst(ws->def[8] , get_auto_shut_string(ws->auto_shut) , 4, stream); - sched_util_fprintf_qst(ws->def[9] , get_crossflow_string(ws->crossflow) , 3, stream); - sched_util_fprintf_int(ws->def[10] , ws->pvt_region , 4, stream); - sched_util_fprintf_qst(ws->def[11] , get_hdstat_head_string(ws->hdstat_head) , 3, stream); - sched_util_fprintf_int(ws->def[12] , ws->fip_region , 4, stream); - /* - sched_util_fprintf_qst(ws->def[13] , ws->fs_kw1 , 8, stream); - sched_util_fprintf_qst(ws->def[14] , ws->fs_kw2 , 8, stream); - sched_util_fprintf_qst(ws->def[15] , ws->ecl300_kw , 8, stream); - */ - fprintf(stream,"/\n"); -}; - - - -static welspec_type * welspec_alloc_empty() -{ - welspec_type *ws = util_malloc(sizeof *ws); - - ws->name = NULL; - ws->group = NULL; - ws->fs_kw1 = NULL; - ws->fs_kw2 = NULL; - ws->ecl300_kw = NULL; - - return ws; -} - - - - - - -static void welspec_free(welspec_type * ws) -{ - free(ws->group ); - util_safe_free(ws->fs_kw1 ); - util_safe_free(ws->fs_kw2 ); - util_safe_free(ws->ecl300_kw); - free(ws->name); - free(ws); -}; - - - -static void welspec_free__(void * __ws) -{ - welspec_type * ws = (welspec_type *) __ws; - welspec_free(ws); -}; - - - - -static welspec_type * welspec_alloc_from_tokens(const stringlist_type * line_tokens ) -{ - welspec_type * ws = welspec_alloc_empty(); - sched_util_init_default( line_tokens , ws->def ); - ws->name = util_alloc_string_copy(stringlist_iget( line_tokens , 0)); - - if(ws->def[1]) - ws->group = util_alloc_string_copy("FIELD"); - else - ws->group = util_alloc_string_copy(stringlist_iget( line_tokens , 1 )); - - ws->hh_i = sched_util_atoi(stringlist_iget( line_tokens , 2)); - ws->hh_j = sched_util_atoi(stringlist_iget( line_tokens , 3)); - ws->md = sched_util_atof(stringlist_iget( line_tokens , 4)); - ws->phase = get_phase_from_string(stringlist_iget( line_tokens , 5)); - ws->drain_rad = sched_util_atof(stringlist_iget( line_tokens , 6)); - ws->inflow_eq = get_inflow_eq_from_string(stringlist_iget( line_tokens , 7)); - ws->auto_shut = get_auto_shut_from_string(stringlist_iget( line_tokens , 8)); - ws->crossflow = get_crossflow_from_string(stringlist_iget( line_tokens , 9)); - ws->pvt_region = sched_util_atoi(stringlist_iget( line_tokens , 10)); - ws->hdstat_head = get_hdstat_head_from_string(stringlist_iget( line_tokens , 11)); - ws->fip_region = sched_util_atoi(stringlist_iget( line_tokens , 12)); - - ws->fs_kw1 = util_alloc_string_copy(stringlist_iget( line_tokens , 13)); /* Reserved for use with FRONTSIM */ - ws->fs_kw2 = util_alloc_string_copy(stringlist_iget( line_tokens , 14)); /* Reserved for use with FRONTSIM */ - ws->ecl300_kw = util_alloc_string_copy(stringlist_iget( line_tokens , 15)); /* Could not find this in the dcoumentation ...??? */ - - return ws; -}; - - - - - - -static sched_kw_welspecs_type * sched_kw_welspecs_alloc_empty() -{ - sched_kw_welspecs_type * kw = util_malloc(sizeof * kw ); - kw->welspec_list = vector_alloc_new(); - return kw; -}; - - -static void sched_kw_welspecs_add_well( sched_kw_welspecs_type * kw , const welspec_type * ws) { - vector_append_owned_ref( kw->welspec_list , ws , welspec_free__ ); -} - - -/*****************************************************************************/ - - -sched_kw_welspecs_type * sched_kw_welspecs_alloc(const stringlist_type * tokens , int * token_index ) { - sched_kw_welspecs_type * kw = sched_kw_welspecs_alloc_empty(); - int eokw = false; - do { - stringlist_type * line_tokens = sched_util_alloc_line_tokens( tokens , false , WELSPECS_NUM_KW , token_index ); - if (line_tokens == NULL) - eokw = true; - else { - welspec_type * well = welspec_alloc_from_tokens( line_tokens ); - sched_kw_welspecs_add_well( kw , well ); - stringlist_free( line_tokens ); - } - - } while (!eokw); - return kw; -} - - - - -void sched_kw_welspecs_free(sched_kw_welspecs_type * kw) -{ - vector_free(kw->welspec_list); - free(kw); -}; - - - -void sched_kw_welspecs_fprintf(const sched_kw_welspecs_type * kw, FILE * stream) -{ - fprintf(stream, "WELSPECS\n"); - int i; - for (i=0; i < vector_get_size( kw->welspec_list ); i++) { - const welspec_type * ws = vector_iget_const( kw->welspec_list , i ); - welspec_sched_fprintf(ws, stream); - } - fprintf(stream,"/\n\n"); -}; - - - - -void sched_kw_welspecs_init_child_parent_list( const sched_kw_welspecs_type * kw , stringlist_type * child , stringlist_type * parent) { - stringlist_clear( child ); - stringlist_clear( parent ); - { - for (int i=0; i < vector_get_size( kw->welspec_list ); i++) { - const welspec_type * well = vector_iget_const(kw->welspec_list , i); - stringlist_append_ref( child , well->name ); - - if (!well->def[1]) - stringlist_append_ref( parent , well->group ); - else - stringlist_append_ref( parent , FIELD_GROUP ); - - } - } -} - - - - -void sched_kw_welspecs_alloc_child_parent_list(const sched_kw_welspecs_type * kw, char *** __children, char *** __parents, int * num_pairs) -{ - int num_wells = vector_get_size(kw->welspec_list); - char ** children = util_malloc(num_wells * sizeof * children); - char ** parents = util_malloc(num_wells * sizeof * parents); - - for(int well_nr = 0; well_nr < num_wells; well_nr++) - { - const welspec_type * well = vector_iget_const(kw->welspec_list , well_nr); - children[well_nr] = util_alloc_string_copy(well->name); - if(!well->def[1]) - parents[well_nr] = util_alloc_string_copy(well->group); - else - parents[well_nr] = util_alloc_string_copy("FIELD"); - } - - *num_pairs = num_wells; - *__children = children; - *__parents = parents; -} - - -sched_kw_welspecs_type * sched_kw_welspecs_copyc(const sched_kw_welspecs_type * kw) { - util_abort("%s: not implemented ... \n",__func__); - return NULL; -} - - - -/***********************************************************************/ - -KW_IMPL(welspecs) diff --git a/ThirdParty/Ert/libsched/src/sched_time.c b/ThirdParty/Ert/libsched/src/sched_time.c deleted file mode 100644 index 612baae633..0000000000 --- a/ThirdParty/Ert/libsched/src/sched_time.c +++ /dev/null @@ -1,112 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_time.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include - -#include -#include - -/*****************************************************************/ - -/** - The sched_time_type is an attempt at unifiing the DATES and TSTEP - keywords; they are both related to stepping forward in time. For a - reasonable control over the timestepping we need (at least) two - pieces of information: - - 1. What is true time at the start/end of the current step. - 2. How long is the step. - - The DATES keywords give the true time at the end of the step, - whereas the TSTEP keyword gives the length of the step. -*/ - -#define SCHED_TIME_TYPE_ID 66195407 - -struct sched_time_struct { - UTIL_TYPE_ID_DECLARATION; - time_t date; - double tstep_length; /* Length of TSTEP - in days. */ - sched_time_enum time_type; -}; - - - - -sched_time_type * sched_time_alloc( time_t date , double tstep_length , sched_time_enum time_type ) { - sched_time_type * time_node = util_malloc( sizeof * time_node ); - UTIL_TYPE_ID_INIT( time_node , SCHED_TIME_TYPE_ID ); - time_node->time_type = time_type; - time_node->tstep_length = tstep_length; - time_node->date = date; - - return time_node; -} - -static UTIL_SAFE_CAST_FUNCTION( sched_time , SCHED_TIME_TYPE_ID ) - -void sched_time_free( sched_time_type * time_node ) { - free( time_node ); -} - -void sched_time_free__( void * arg ) { - sched_time_free( sched_time_safe_cast( arg )); -} - - -time_t sched_time_get_date( const sched_time_type * time_node ) { - return time_node->date; -} - - -/** - This function will return the true time at the end of this step, - for a time_node which represents a DATES instance the function will - just return the actual date, for a TSTEP it will step forward - starting at the input @current_time. -*/ - -time_t sched_time_get_target( const sched_time_type * time_node , time_t current_time) { - time_t target; - - switch( time_node->time_type ) { - case( DATES_TIME ): - target = time_node->date; - break; - case( TSTEP_TIME ): - target = current_time; - util_inplace_forward_days_utc( &target , time_node->tstep_length ); - break; - default: - util_abort("%s: invalid time_type value:%d \n",__func__ , time_node->time_type ); - } - - return target; -} - - - -time_t sched_time_get_type( const sched_time_type * time_node ) { - return time_node->time_type; -} - diff --git a/ThirdParty/Ert/libsched/src/sched_types.c b/ThirdParty/Ert/libsched/src/sched_types.c deleted file mode 100644 index 4d98aff14b..0000000000 --- a/ThirdParty/Ert/libsched/src/sched_types.c +++ /dev/null @@ -1,261 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_types.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -#include - -#include - -#define SCHED_KW_DEFAULT_ITEM "*" - - -#define TYPE_WATER_STRING "WATER" -#define TYPE_GAS_STRING "GAS" -#define TYPE_OIL_STRING "OIL" - -const char * sched_phase_type_string(sched_phase_enum type) { - switch (type) { - case(WATER): - return TYPE_WATER_STRING; - case(GAS): - return TYPE_GAS_STRING; - case(OIL): - return TYPE_OIL_STRING; - default: - return SCHED_KW_DEFAULT_ITEM; - } -} - -sched_phase_enum sched_phase_type_from_string(const char * type_string) { - if (strcmp(type_string , TYPE_WATER_STRING) == 0) - return WATER; - else if (strcmp(type_string , TYPE_GAS_STRING) == 0) - return GAS; - else if (strcmp(type_string , TYPE_OIL_STRING) == 0) - return OIL; - else { - util_abort("%s: Could not recognize:%s as injector phase. Valid values are: [%s, %s, %s] \n",__func__ , type_string , TYPE_WATER_STRING , TYPE_GAS_STRING , TYPE_OIL_STRING); - return 0; - } -} - - -/*****************************************************************/ - - -#define WCONHIST_STRING "WCONHIST" -#define DATES_STRING "DATES" -#define COMPDAT_STRING "COMPDAT" -#define TSTEP_STRING "TSTEP" -#define TIME_STRING "TIME" -#define WELSPECS_STRING "WELSPECS" -#define GRUPTREE_STRING "GRUPTREE" -#define INCLUDE_STRING "INCLUDE" -#define WCONINJ_STRING "WCONINJ" -#define WCONINJE_STRING "WCONINJE" -#define WCONINJH_STRING "WCONINJH" -#define WCONPROD_STRING "WCONPROD" - -#define UNTYPED_STRING "UNTYPED" - - - - - -/** - This function does a direct translation of a string name to - implementation type - i.e. an enum instance. Observe that - (currently) no case-normalization is performed. -*/ - -sched_kw_type_enum sched_kw_type_from_string(const char * kw_name) -{ - sched_kw_type_enum kw_type = UNTYPED; - - if ( strcmp(kw_name, GRUPTREE_STRING ) == 0) kw_type = GRUPTREE ; - else if( strcmp(kw_name, TSTEP_STRING ) == 0) kw_type = TSTEP ; - else if( strcmp(kw_name, INCLUDE_STRING ) == 0) kw_type = INCLUDE ; - else if( strcmp(kw_name, TIME_STRING ) == 0) kw_type = TIME ; - else if( strcmp(kw_name, DATES_STRING ) == 0) kw_type = DATES ; - else if( strcmp(kw_name, WCONHIST_STRING ) == 0) kw_type = WCONHIST ; - else if( strcmp(kw_name, WELSPECS_STRING ) == 0) kw_type = WELSPECS ; - else if( strcmp(kw_name, WCONINJ_STRING ) == 0) kw_type = WCONINJ ; - else if( strcmp(kw_name, WCONINJE_STRING ) == 0) kw_type = WCONINJE ; - else if( strcmp(kw_name, WCONINJH_STRING ) == 0) kw_type = WCONINJH ; - else if( strcmp(kw_name, WCONPROD_STRING ) == 0) kw_type = WCONPROD ; - else if( strcmp(kw_name, COMPDAT_STRING ) == 0) kw_type = COMPDAT ; - - return kw_type; -} - - -const char * sched_kw_type_name(sched_kw_type_enum kw_type) { - if ( kw_type == GRUPTREE ) return GRUPTREE_STRING ; - else if ( kw_type == TSTEP ) return TSTEP_STRING ; - else if ( kw_type == INCLUDE ) return INCLUDE_STRING ; - else if ( kw_type == TIME ) return TIME_STRING ; - else if ( kw_type == DATES ) return DATES_STRING ; - else if ( kw_type == WCONHIST ) return WCONHIST_STRING ; - else if ( kw_type == WELSPECS ) return WELSPECS_STRING ; - else if ( kw_type == WCONINJ ) return WCONINJ_STRING ; - else if ( kw_type == WCONINJE ) return WCONINJE_STRING ; - else if ( kw_type == WCONINJH ) return WCONINJH_STRING ; - else if ( kw_type == WCONPROD ) return WCONPROD_STRING ; - else if ( kw_type == COMPDAT ) return COMPDAT_STRING ; - - return UNTYPED_STRING; /* Unknown type */ -} - - -/*****************************************************************/ - -#define STATUS_OPEN_STRING "OPEN" -#define STATUS_STOP_STRING "STOP" -#define STATUS_SHUT_STRING "SHUT" -#define STATUS_AUTO_STRING "AUTO" - - -const char * sched_types_get_status_string(well_status_enum status) -{ - switch(status) { - case(OPEN): - return STATUS_OPEN_STRING; - case(STOP): - return STATUS_STOP_STRING; - case(SHUT): - return STATUS_SHUT_STRING; - case(AUTO): - return STATUS_AUTO_STRING; - case(DEFAULT): - return SCHED_KW_DEFAULT_ITEM; - default: - util_abort("%s: invalid status:%d \n",__func__ , status ); - return 0; - } -} - - - -well_status_enum sched_types_get_status_from_string(const char * st_string) -{ - if (strcmp( st_string , SCHED_KW_DEFAULT_ITEM ) == 0) - return DEFAULT; - /* - Must be checked by calling scope whether DEFAULT is a valid - return - and then subsequently apply the correct value. - */ - else if( strcmp(st_string, STATUS_OPEN_STRING) == 0) - return OPEN; - else if( strcmp(st_string, STATUS_STOP_STRING) == 0) - return STOP; - else if( strcmp(st_string, STATUS_SHUT_STRING) == 0) - return SHUT; - else if( strcmp(st_string, STATUS_AUTO_STRING) == 0) - return AUTO; - else - { - util_abort("%s: Could not recognize %s as a well status.\n", __func__, st_string); - return 0; - } -} - - -/*****************************************************************/ - - -const char * sched_types_get_cm_string( well_cm_enum cm ) { - switch(cm) { - case( RESV ): - return CM_RESV_STRING; - break; - case( RATE ): - return CM_RATE_STRING; - break; - case( BHP ): - return CM_BHP_STRING; - break; - case( THP ): - return CM_THP_STRING; - break; - case( GRUP ): - return CM_GRUP_STRING; - break; - case( ORAT ): - return CM_ORAT_STRING; - break; - case( WRAT ): - return CM_WRAT_STRING; - break; - case( GRAT ): - return CM_GRAT_STRING; - break; - case( LRAT ): - return CM_LRAT_STRING; - break; - default: - util_abort("%s: invalid value: %s \n", cm ); - return 0; - } -} - - - - -/** - Must use the strncmp(x,x,4) function for comparison, because - suddenly files with control mode 'GRUP ' appear; and ECLIPSE - appearantly eats that nicely. -*/ - - -well_cm_enum sched_types_get_cm_from_string(const char * cm_string , bool wconhist) -{ - if (wconhist) { - if( strcmp(cm_string, CM_ORAT_STRING) == 0) - return ORAT; - else if(strcmp(cm_string, CM_WRAT_STRING) == 0) - return WRAT; - else if(strcmp(cm_string, CM_GRAT_STRING) == 0) - return GRAT; - else if(strcmp(cm_string, CM_LRAT_STRING) == 0) - return LRAT; - else if(strcmp(cm_string, CM_RESV_STRING) == 0) - return RESV; - else { - util_abort("%s: Could not recognize %s as a control mode.\n", __func__, cm_string); - return 0; - } - } else { - if( strncmp(cm_string, CM_RATE_STRING , 4) == 0) - return RATE; - else if(strncmp(cm_string, CM_RESV_STRING , 4) == 0) - return RESV; - else if(strncmp(cm_string, CM_BHP_STRING , 4) == 0) - return BHP; - else if(strncmp(cm_string, CM_THP_STRING, 4) == 0) - return THP; - else if(strncmp(cm_string, CM_GRUP_STRING , 4) == 0) - return GRUP; - else { - util_abort("%s: Could not recognize \'%s\' as a control mode. Valid values are: [%s, %s, %s, %s, %s] \n", __func__, cm_string, - CM_RATE_STRING , CM_RESV_STRING , CM_BHP_STRING, CM_THP_STRING, CM_GRUP_STRING); - return 0; - } - } -} diff --git a/ThirdParty/Ert/libsched/src/sched_util.c b/ThirdParty/Ert/libsched/src/sched_util.c deleted file mode 100644 index 54667586aa..0000000000 --- a/ThirdParty/Ert/libsched/src/sched_util.c +++ /dev/null @@ -1,359 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'sched_util.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include -#include - -#include -#include - -#include - -/** - This file implements small utility functions used by the rest of - the libsched library. -*/ - - -static const int strip_comment = 1; -static const int strip_space = 2; - - -static char * strip_line_alloc(const char * line) { - const char comment_char = '-'; - const char *space = " \t"; - const int strip_mode = strip_comment + strip_space; - char * new_line = NULL; - int offset, length,pos; - bool cont , quote_on , dash_on; /* The quote_on variable protects againts premature termination based on '/' in path specifications. */ - - /* Strip intial white-space */ - if (strip_mode & strip_space) - offset = strspn(line , space); - else - offset = 0; - - - dash_on = false; - quote_on = false; - cont = true; - length = 0; - if (line[offset] != '\0') { - pos = offset; - do { - if (line[pos] == '\'' || line[pos] == '"') - quote_on = !quote_on; - - if (strip_mode & strip_comment) { - if (!quote_on) { - if (line[pos] == comment_char) { - if (dash_on) { - cont = false; - length = pos - offset - 1; - } else - dash_on = true; - } else - dash_on = false; - } - } - - if (cont) { - if (pos == (strlen(line) - 1)) { - length = pos - offset + 1; - cont = false; - } - } - - if (cont) - pos++; - } while (cont); - - /* - Remove trailing space: - */ - - if (strip_mode & strip_space) { - if (offset + length > 0) { - while (line[offset + length - 1] == ' ') - length--; - } - } - - if (length > 0) - new_line = util_realloc_substring_copy(NULL , &line[offset] , length); - else - new_line = NULL; - - } - - return new_line; -} - - -/*****************************************************************/ - - - -char * sched_util_alloc_line(FILE *stream , bool *at_eof) { - char *tmp_line = util_fscanf_alloc_line(stream , at_eof); - char * line = strip_line_alloc( tmp_line ); - - free(tmp_line); - return line; -} - - - - - - -/** - * We parse up to the terminating '/' - but it is NOT included in the returned string - - The num_tokens variable is only used to fill up with defaults at the end. -*/ -stringlist_type * sched_util_alloc_line_tokens( const stringlist_type * tokens , bool untyped , int num_tokens , int * __token_index ) { - /** First part - identify the right start/end of the token list */ - stringlist_type * line_tokens = NULL; - int token_index = *__token_index; - int token_length = stringlist_get_size( tokens ); - int line_start; - int line_end; - bool at_eokw = false; - { - line_start = token_index; - const char * current_token; - { - bool at_eol = false; - do { - current_token = stringlist_iget( tokens , token_index ); - if (strcmp( current_token , "/" ) == 0) - at_eol = true; - - token_index++; - - // The schedule file is not correctly terminated with a "/". - if (token_index == token_length) - at_eol = true; - - } while (!at_eol); - } - line_end = token_index; - if ((line_end - line_start) == 1) - /* - This line *only* contained a terminating '/'. This marks the - end of the kewyord. - */ - at_eokw = true; - } - - - /* Second part - filling in with defaults+++ */ - if (!at_eokw) { - line_tokens = stringlist_alloc_new( ); - if (untyped) { /* In case of untyped we basically do nothing with the content - even keeping the trailing '/'. */ - int it; - for (it = line_start; it < line_end; it++) { - const char * token = stringlist_iget( tokens , it ); - stringlist_append_copy(line_tokens , token ); - } - } else { - int it; - for (it = line_start; it < (line_end - 1); it++) { - const char * token = stringlist_iget( tokens , it ); - char * dequoted_token = util_alloc_dequoted_copy( token ); - - if (util_string_equal( dequoted_token , SCHED_KW_DEFAULT_ITEM )) /* The item is just '*' */ - stringlist_append_copy(line_tokens , SCHED_KW_DEFAULT_ITEM ); - else { - char repeated_value[32]; - long int items; - if (sscanf(dequoted_token , "%ld*%s" , &items , repeated_value) == 2) { /* It is a '5*8.60' item - i.e. the value 8.60 repeated five times. */ - int counter = 0; - do { - stringlist_append_copy(line_tokens , repeated_value); - counter++; - } while ( counter < items ); - } else { - char * star_ptr = (char *) dequoted_token; - items = strtol(dequoted_token , &star_ptr , 10); /* The item is a repeated default: '5*' */ - if (star_ptr != token && util_string_equal( star_ptr , SCHED_KW_DEFAULT_ITEM )) { - for (int i=0; i < items; i++) - stringlist_append_copy( line_tokens , SCHED_KW_DEFAULT_ITEM ); - } else /* The item is a non-default value. */ - stringlist_append_copy(line_tokens , dequoted_token ); - } - } - free( dequoted_token ); - } - } - } - - - /** Skip trailing garbage */ - sched_util_skip_trailing_tokens( tokens , &token_index ); - sched_util_skip_newline( tokens , &token_index ); - - /* Append default items at the end until we have num_tokens length. */ - if (line_tokens != NULL) { - while (stringlist_get_size( line_tokens ) < num_tokens) - stringlist_append_copy( line_tokens , SCHED_KW_DEFAULT_ITEM ); - } - - *__token_index = token_index; - return line_tokens; -} - - - - -void sched_util_fprintf_default(int width , FILE * stream) { - fprintf(stream , "1*"); - for (int i=0; i < (width - 2); i++) - fputc(' ' , stream); -} - - -/** - All the sched_util_fprintf_xxx() functions start by putting out one - ' ', to ensure against overlapping fields. -*/ - - -void sched_util_fprintf_dbl(bool def, double value , int width , int dec , FILE *stream) { - fputc(' ' , stream); - if (def) - sched_util_fprintf_default( width , stream); - else - util_fprintf_double(value , width , dec , 'f' , stream); -} - - - -void sched_util_fprintf_int(bool def, int value , int width , FILE *stream) { - fputc(' ' , stream); - if (def) { - sched_util_fprintf_default( width , stream); - } else - util_fprintf_int(value , width , stream); -} - - -/* - The formatting is ridicolusly inflexible - don't touch this shit. -*/ - -void sched_util_fprintf_qst(bool def, const char *s , int width , FILE *stream) { - fputc(' ' , stream); - if (def) { - sched_util_fprintf_default( width , stream ); - } else { - for (int i=0; i < (width - strlen(s)); i++) - fputc(' ' , stream); - - fprintf(stream , "\'%s\'" , s); - } -} - - - -/** - The atof / atoi functions accept either 'NULL' or '*' as default - values, in that case numeric 0 is returned. -*/ - -double sched_util_atof(const char *token) { - if (token != NULL) { - double value = 0; - if (!util_string_equal( token , SCHED_KW_DEFAULT_ITEM)) { - if (!util_sscanf_double(token , &value)) - util_abort("%s: failed to parse:\"%s\" as floating point number. \n",__func__ , token); - } - return value; - } else - return 0.0; -} - - - -int sched_util_atoi(const char *token) { - if (token != NULL) { - int value = 0; - if (!util_string_equal( token , SCHED_KW_DEFAULT_ITEM)) { - if (!util_sscanf_int(token , &value)) - util_abort("%s: failed to parse:\"%s\" as integer \n",__func__ , token); - } - return value; - } else - return 0; -} - - - -/* Simple utility function used for debugging. */ -void sched_util_fprintf_tokenlist(int num_token , const char ** token_list , const bool * def) { - int i; - for (i = 0; i < num_token; i++) { - if (def[i]) - fprintf(stdout , " \'*\' " ); - else - fprintf(stdout , " \'%s\' " , token_list[i]); - } - fprintf(stdout , "\n"); -} - - - -/** - This should repeatedly skip tokens until the token_index points to - a newline. Should return with token_index pointing at the first newline character. -*/ - -void sched_util_skip_trailing_tokens( const stringlist_type * tokens , int * __token_index ) { - int token_index = *__token_index; - int len = stringlist_get_size( tokens ); - while ( (token_index < len) && (!stringlist_iequal( tokens , token_index , "\n"))) { - token_index++; - } - *__token_index = token_index; -} - - -void sched_util_skip_newline( const stringlist_type * tokens , int * __token_index ) { - int token_index = *__token_index; - int len = stringlist_get_size( tokens ); - while ( (token_index < len) && (stringlist_iequal( tokens , token_index , "\n"))) { - token_index++; - } - *__token_index = token_index; -} - - - - - -void sched_util_init_default(const stringlist_type * line_tokens , bool * def) { - int i; - for (i = 0; i < stringlist_get_size( line_tokens ); i++) { - if (util_string_equal( stringlist_iget( line_tokens , i ) , SCHED_KW_DEFAULT_ITEM)) - def[i] = true; - else - def[i] = false; - } -} diff --git a/ThirdParty/Ert/libsched/src/tests/sched_test_01.SCH b/ThirdParty/Ert/libsched/src/tests/sched_test_01.SCH deleted file mode 100644 index dd72f07a20..0000000000 --- a/ThirdParty/Ert/libsched/src/tests/sched_test_01.SCH +++ /dev/null @@ -1,2371 +0,0 @@ -SKIPREST - - -GRUPTREE - 'OREI' 'FIELD' / - 'TARB' 'FIELD' / - 'RFTWELLS' 'FIELD' / - 'NESS' 'FIELD' / - 'ORE' 'FIELD' / -/ - -WELSPECS - 'C-21' 'NESS' 21 27 1* 'OIL' 1* 1* 1* 'YES' 1* 1* 1* / -/ - -COMPDAT - 'C-21' 21 27 7 7 'OPEN' 1* 0.010 0.216 0.818 2* 'Y' 8.192 / - 'C-21' 21 27 8 8 'OPEN' 1* 0.037 0.216 3.030 2* 'Y' 8.931 / - 'C-21' 21 27 9 9 'OPEN' 1* 34.630 0.216 2817.208 2* 'Y' 8.436 / - 'C-21' 21 28 9 9 'OPEN' 1* 14.497 0.216 1168.521 2* 'Y' 8.105 / - 'C-21' 21 28 10 10 'OPEN' 1* 42.936 0.216 3544.366 2* 'Y' 8.995 / - 'C-21' 21 28 11 11 'OPEN' 1* 42.429 0.216 3500.982 2* 'Y' 8.977 / - 'C-21' 21 28 12 12 'OPEN' 1* 42.342 0.216 3495.926 2* 'Y' 9.002 / - 'C-21' 21 28 13 13 'OPEN' 1* 29.462 0.216 2431.726 2* 'Y' 8.990 / - 'C-21' 21 28 14 14 'OPEN' 1* 5.991 0.216 486.714 2* 'Y' 8.384 / - 'C-21' 21 28 15 15 'OPEN' 1* 46.367 0.216 3788.829 2* 'Y' 8.601 / - 'C-21' 21 28 16 16 'OPEN' 1* 32.257 0.216 2655.136 2* 'Y' 8.881 / -/ - -WCONHIST - 'C-21' 'OPEN' 'RESV' 1224.545 4.455 160283.364 1* 1* 1* 1* 1* / -/ - -DATES - 26 'OCT' 1993 / -/ - -WCONHIST - 'C-21' 'OPEN' 'RESV' 1387.167 4.833 181534.167 1* 1* 1* 1* 1* / -/ - -DATES - 01 'NOV' 1993 / -/ - -WCONHIST - 'C-21' 'OPEN' 'RESV' 1689.071 7.500 219186.718 1* 1* 1* 1* 1* / -/ - -DATES - 15 'NOV' 1993 / -/ - -WCONHIST - 'C-21' 'OPEN' 'RESV' 1873.813 7.750 242244.937 1* 1* 1* 1* 1* / -/ - -DATES - 01 'DEC' 1993 / -/ - -WCONHIST - 'C-21' 'OPEN' 'RESV' 1884.467 6.933 262115.000 1* 1* 1* 1* 1* / -/ - -DATES - 16 'DEC' 1993 / -/ - -WELSPECS - 'C-18AT2' 'NESS' 37 26 1* 'OIL' 1* 1* 1* 'YES' 1* 1* 1* / -/ - -COMPDAT - 'C-18AT2' 36 26 7 7 'OPEN' 1* 68.922 0.216 5481.595 2* 'X' 7.653 / - 'C-18AT2' 36 26 8 8 'OPEN' 1* 89.467 0.216 7026.742 2* 'X' 7.256 / - 'C-18AT2' 36 26 9 9 'OPEN' 1* 25.025 0.216 1958.073 2* 'X' 7.142 / - 'C-18AT2' 36 27 9 9 'OPEN' 1* 67.656 0.216 5325.417 2* 'X' 7.324 / - 'C-18AT2' 36 27 10 10 'OPEN' 1* 57.636 0.216 4508.869 2* 'X' 7.137 / - 'C-18AT2' 36 27 12 12 'OPEN' 1* 48.558 0.216 3834.346 2* 'Y' 7.423 / - 'C-18AT2' 36 27 13 13 'OPEN' 1* 76.818 0.216 6094.799 2* 'X' 7.574 / - 'C-18AT2' 36 27 14 14 'OPEN' 1* 78.248 0.216 6196.442 2* 'Y' 7.513 / - 'C-18AT2' 36 27 15 15 'OPEN' 1* 18.304 0.216 1476.768 2* 'X' 8.138 / - 'C-18AT2' 35 27 15 15 'OPEN' 1* 52.068 0.216 4153.243 2* 'Y' 7.749 / - 'C-18AT2' 35 27 16 16 'OPEN' 1* 5.124 0.216 404.276 2* 'Y' 7.395 / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 1877.125 72.750 256186.375 1* 1* 1* 1* 1* / - 'C-21' 'OPEN' 'RESV' 1591.000 2.875 217475.000 1* 1* 1* 1* 1* / -/ - -DATES - 24 'DEC' 1993 / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 1787.000 3.500 223750.750 1* 1* 1* 1* 1* / - 'C-21' 'OPEN' 'RESV' 2038.625 3.875 274779.250 1* 1* 1* 1* 1* / -/ - -DATES - 01 'JAN' 1994 / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 1581.258 3.290 199459.420 1* 1* 1* 1* 1* / - 'C-21' 'OPEN' 'RESV' 1124.032 2.226 153597.742 1* 1* 1* 1* 1* / -/ - -DATES - 01 'FEB' 1994 / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 2186.607 2.643 273473.857 1* 1* 1* 1* 1* / - 'C-21' 'OPEN' 'ORAT' 676.000 0.000 76898.000 1* 1* 1* 1* 1* / -/ - -DATES - 01 'MAR' 1994 / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 2348.900 1.400 281540.300 1* 1* 1* 1* 1* / -/ - -DATES - 11 'MAR' 1994 / -/ - -WELSPECS - 'C-22' 'NESS' 25 10 1* 'OIL' 1* 1* 1* 'YES' 1* 1* 1* / -/ - -COMPDAT - 'C-22' 25 11 4 4 'OPEN' 1* 0.006 0.216 0.542 2* 'Y' 10.016 / - 'C-22' 25 11 5 5 'OPEN' 1* 47.218 0.216 3948.662 2* 'Y' 9.529 / - 'C-22' 25 11 6 6 'OPEN' 1* 49.888 0.216 4103.013 2* 'Y' 8.849 / - 'C-22' 25 11 7 7 'OPEN' 1* 44.747 0.216 3779.700 2* 'Y' 9.968 / - 'C-22' 25 11 8 8 'OPEN' 1* 46.326 0.216 3882.668 2* 'Y' 9.625 / - 'C-22' 25 11 9 9 'OPEN' 1* 14.678 0.216 1238.033 2* 'Y' 9.903 / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 1736.429 1.143 214222.810 1* 1* 1* 1* 1* / -/ - -WCONINJH - 'C-22' 'GAS' 'OPEN' 479677.143 4* / -/ - -WEFAC - 'C-22' 0.050 1* / -/ - -DATES - 01 'APR' 1994 / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 1754.233 1.033 222623.866 1* 1* 1* 1* 1* / -/ - -WCONINJH - 'C-22' 'GAS' 'OPEN' 558840.566 4* / -/ - -DATES - 01 'MAY' 1994 / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 1620.290 1.032 203119.097 1* 1* 1* 1* 1* / -/ - -WCONINJH - 'C-22' 'GAS' 'OPEN' 651149.646 4* / -/ - -DATES - 01 'JUN' 1994 / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 882.867 0.667 115927.967 1* 1* 1* 1* 1* / -/ - -WCONINJH - 'C-22' 'GAS' 'OPEN' 243341.733 4* / -/ - -DATES - 01 'JUL' 1994 / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 1886.778 1.111 248306.333 1* 1* 1* 1* 1* / -/ - -WCONINJH - 'C-21' 'OIL' 'OPEN' 792.000 4* / - 'C-22' 'GAS' 'OPEN' 819116.111 4* / -/ - -DATES - 10 'JUL' 1994 / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 1649.136 1.182 223808.136 1* 1* 1* 1* 1* / -/ - -WCONINJH - 'C-22' 'GAS' 'OPEN' 646226.818 4* / -/ - -DATES - 01 'AUG' 1994 / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 1652.355 1.323 222730.581 1* 1* 1* 1* 1* / -/ - -WCONINJH - 'C-22' 'GAS' 'OPEN' 605224.871 4* / -/ - -DATES - 01 'SEP' 1994 / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 1426.167 2.633 193760.133 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 156246.400 5* / -/ - -DATES - 01 'OCT' 1994 / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 766.161 1.968 100942.774 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 18869.387 5* / -/ - -DATES - 01 'NOV' 1994 / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 795.533 2.300 104841.267 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 90.467 5* / -/ - -DATES - 01 'DEC' 1994 / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 0.000 0.000 0.000 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 195342.387 5* / -/ - -DATES - 01 'JAN' 1995 / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 227.484 0.548 29827.323 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-21' 'OIL' 'OPEN' 'RATE' 193.000 4* 140.000 / - 'C-22' 'GAS' 'OPEN' 'RATE' 3.000 5* / -/ - -DATES - 01 'FEB' 1995 / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 68.821 0.571 9703.643 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 99263.250 5* / -/ - -DATES - 01 'MAR' 1995 / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 0.000 0.000 0.000 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 0.000 5* / -/ - -DATES - 05 'MAR' 1995 / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 154601.223 5* / -/ - -DATES - 01 'APR' 1995 / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 80.700 0.067 10955.633 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 334557.733 5* / -/ - -DATES - 01 'MAY' 1995 / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 0.000 0.000 0.000 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 11822.000 5* / -/ - -DATES - 03 'MAY' 1995 / -/ - -WELSPECS - 'C-19' 'NESS' 39 14 1* 'OIL' 1* 1* 1* 'YES' 1* 1* 1* / -/ - -COMPDAT - 'C-19' 35 23 13 13 'OPEN' 1* 229.211 0.216 17591.568 2* 'Y' 6.592 / - 'C-19' 35 23 14 14 'OPEN' 1* 42.518 0.216 3286.223 2* 'Y' 6.786 / - 'C-19' 35 24 15 15 'OPEN' 1* 49.616 0.216 3818.562 2* 'Y' 6.668 / - 'C-19' 35 24 16 16 'OPEN' 1* 148.076 0.216 11340.899 2* 'Y' 6.536 / - 'C-19' 35 25 16 16 'OPEN' 1* 0.164 0.216 12.543 2* 'Y' 6.514 / - 'C-19' 34 25 16 16 'OPEN' 1* 128.420 0.216 9830.735 2* 'Y' 6.523 / - 'C-19' 34 25 15 15 'OPEN' 1* 137.101 0.216 10497.277 2* 'Y' 6.528 / - 'C-19' 34 26 15 15 'OPEN' 1* 71.365 0.216 5444.541 2* 'Y' 6.433 / - 'C-19' 34 26 14 14 'OPEN' 1* 423.367 0.216 32285.266 2* 'Y' 6.421 / - 'C-19' 33 26 14 14 'OPEN' 1* 68.448 0.216 5231.526 2* 'Y' 6.481 / - 'C-19' 33 27 14 14 'OPEN' 1* 36.744 0.216 2805.661 2* 'Y' 6.455 / - 'C-19' 33 27 13 13 'OPEN' 1* 354.667 0.216 27036.137 2* 'Y' 6.411 / - 'C-19' 33 27 12 12 'OPEN' 1* 100.458 0.216 7650.032 2* 'Y' 6.385 / - 'C-19' 33 28 12 12 'OPEN' 1* 207.460 0.216 15797.470 2* 'Y' 6.383 / - 'C-19' 32 28 12 12 'OPEN' 1* 103.805 0.216 7940.809 2* 'Y' 6.504 / - 'C-19' 32 28 11 11 'OPEN' 1* 247.786 0.216 18955.656 2* 'Y' 6.505 / - 'C-19' 32 28 10 10 'OPEN' 1* 15.303 0.216 1169.531 2* 'Y' 6.479 / - 'C-19' 32 29 10 10 'OPEN' 1* 234.073 0.216 17885.273 2* 'Y' 6.473 / - 'C-19' 32 29 9 9 'OPEN' 1* 229.050 0.216 17487.535 2* 'Y' 6.452 / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 724.200 0.400 97579.200 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 1539.000 0.200 217940.000 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 80904.400 5* / -/ - -DATES - 08 'MAY' 1995 / -/ - -WELOPEN - 'C-18AT2' 'SHUT' 5* / -/ - -WCONHIST - 'C-18AT2' 'OPEN' 'RESV' 0.000 0.000 0.000 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 0.000 0.000 0.000 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 1397129.958 5* / -/ - -DATES - 01 'JUN' 1995 / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 1231730.867 5* / -/ - -DATES - 01 'JUL' 1995 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 743.806 0.903 98001.065 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-21' 'OIL' 'OPEN' 'RATE' 185.000 4* 140.000 / - 'C-22' 'GAS' 'OPEN' 'RATE' 1056146.097 5* / -/ - -DATES - 01 'AUG' 1995 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1407.419 1.355 187173.000 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 828277.161 5* / -/ - -DATES - 01 'SEP' 1995 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1508.367 1.533 202018.233 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 1143498.596 5* / -/ - -DATES - 01 'OCT' 1995 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1498.774 3.484 201044.645 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 747797.940 5* / -/ - -DATES - 01 'NOV' 1995 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1793.867 4.967 235738.933 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 6199.333 5* / -/ - -DATES - 01 'DEC' 1995 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1663.613 4.000 213511.581 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 25271.548 5* / -/ - -DATES - 01 'JAN' 1996 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1775.194 4.935 240048.999 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-21' 'OIL' 'OPEN' 'RATE' 631.000 4* 140.000 / - 'C-22' 'GAS' 'OPEN' 'RATE' 140338.484 5* / -/ - -DATES - 01 'FEB' 1996 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1652.724 2.241 222332.586 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 950214.931 5* / -/ - -DATES - 01 'MAR' 1996 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1725.484 9.290 230628.806 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 2084133.706 5* / -/ - -DATES - 01 'APR' 1996 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 526.000 6.167 71888.300 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 1933211.663 5* / -/ - -DATES - 01 'MAY' 1996 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 0.000 0.000 0.000 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 1013670.933 5* / -/ - -DATES - 14 'MAY' 1996 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 274.889 0.333 36549.611 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 1589912.667 5* / -/ - -DATES - 01 'JUN' 1996 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1536.467 2.467 204058.100 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 1554288.467 5* / -/ - -DATES - 01 'JUL' 1996 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1613.581 3.032 218370.516 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-21' 'OIL' 'OPEN' 'RATE' 218.000 4* 140.000 / - 'C-22' 'GAS' 'OPEN' 'RATE' 1235698.871 5* / -/ - -DATES - 01 'AUG' 1996 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1036.452 5.290 139989.097 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 1371492.000 5* / -/ - -DATES - 01 'SEP' 1996 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1251.400 12.300 159855.400 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 1322016.400 5* / -/ - -DATES - 01 'OCT' 1996 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1060.097 9.548 133908.323 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 1416153.194 5* / -/ - -DATES - 01 'NOV' 1996 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 282.067 2.400 38423.667 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 1457440.167 5* / -/ - -DATES - 01 'DEC' 1996 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 913.968 8.290 112852.935 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 1271679.935 5* / -/ - -DATES - 01 'JAN' 1997 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1035.258 4.774 136802.323 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-21' 'WATER' 'OPEN' 'RATE' 30.000 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1639220.968 5* / -/ - -DATES - 01 'FEB' 1997 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1124.571 3.250 144670.929 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 1550006.964 5* / -/ - -DATES - 01 'MAR' 1997 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1175.258 3.323 154152.548 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 1482430.452 5* / -/ - -DATES - 01 'APR' 1997 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 431.567 1.167 59562.733 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 1238856.135 5* / -/ - -DATES - 01 'MAY' 1997 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 0.000 0.000 0.000 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 1466411.577 5* / -/ - -DATES - 27 'MAY' 1997 / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 1364049.800 5* / -/ - -DATES - 01 'JUN' 1997 / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 1101468.800 5* / -/ - -DATES - 01 'JUL' 1997 / -/ - -WCONHIST - 'C-21' 'OPEN' 'ORAT' 218.000 121.000 28240.000 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 1478819.677 5* / -/ - -DATES - 01 'AUG' 1997 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 568.677 0.548 72328.065 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 1380280.839 5* / -/ - -DATES - 01 'SEP' 1997 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1262.267 1.067 165176.733 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 1439918.967 5* / -/ - -DATES - 01 'OCT' 1997 / -/ - -WELSPECS - 'C-5' 'NESS' 13 8 1* 'OIL' 1* 1* 1* 'YES' 1* 1* 1* / -/ - -COMPDAT - 'C-5' 13 8 14 14 'OPEN' 1* 13.245 0.216 1224.200 2* 'Y' 15.284 / - 'C-5' 13 8 15 15 'OPEN' 1* 39.248 0.216 3513.834 2* 'Y' 13.074 / - 'C-5' 13 8 16 16 'OPEN' 1* 38.694 0.216 3553.848 2* 'Y' 14.801 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1429.968 1.065 188085.065 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 11034.381 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1431240.968 5* / -/ - -DATES - 01 'NOV' 1997 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1258.786 1.000 163203.286 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 0.000 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1435134.286 5* / -/ - -DATES - 15 'NOV' 1997 / -/ - -WELSPECS - 'C-13AT2' 'NESS' 19 18 1* 'OIL' 1* 1* 1* 'YES' 1* 1* 1* / -/ - -COMPDAT - 'C-13AT2' 29 34 9 9 'OPEN' 1* 121.326 0.216 9346.453 2* 'X' 6.694 / - 'C-13AT2' 29 35 9 9 'OPEN' 1* 375.257 0.216 28875.219 2* 'X' 6.663 / - 'C-13AT2' 30 35 9 9 'OPEN' 1* 138.022 0.216 10675.971 2* 'X' 6.808 / - 'C-13AT2' 30 35 10 10 'OPEN' 1* 183.016 0.216 14241.644 2* 'X' 6.980 / - 'C-13AT2' 30 35 11 11 'OPEN' 1* 117.303 0.216 9168.256 2* 'X' 7.109 / - 'C-13AT2' 30 36 11 11 'OPEN' 1* 17.959 0.216 1424.767 2* 'X' 7.571 / - 'C-13AT2' 30 36 12 12 'OPEN' 1* 99.268 0.216 7846.105 2* 'X' 7.453 / - 'C-13AT2' 30 36 13 13 'OPEN' 1* 0.017 0.216 1.378 2* 'X' 7.801 / - 'C-13AT2' 31 36 13 13 'OPEN' 1* 0.037 0.216 3.027 2* 'X' 8.661 / - 'C-13AT2' 31 36 14 14 'OPEN' 1* 52.970 0.216 4373.898 2* 'X' 9.006 / - 'C-13AT2' 31 36 15 15 'OPEN' 1* 0.040 0.216 3.353 2* 'X' 9.478 / - 'C-13AT2' 31 36 16 16 'OPEN' 1* 0.045 0.216 3.729 2* 'X' 9.093 / -/ - -WCONHIST - 'C-13AT2' 'OPEN' 'RESV' 0.000 0.000 0.000 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 1574.750 2.062 203144.500 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 1277878.125 5* / -/ - -DATES - 01 'DEC' 1997 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1146.290 2.355 151768.935 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-22' 'GAS' 'OPEN' 'RATE' 913591.742 5* / -/ - -DATES - 01 'JAN' 1998 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1288.792 3.500 175683.082 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 0.572 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1074695.633 5* / -/ - -DATES - 25 'JAN' 1998 / -/ - -WELSPECS - 'C-8T2K' 'NESS' 30 10 1* 'OIL' 1* 1* 1* 'YES' 1* 1* 1* / -/ - -COMPDAT - 'C-8T2K' 31 10 7 7 'OPEN' 1* 6.795 0.216 639.355 2* 'Y' 16.699 / - 'C-8T2K' 31 10 8 8 'OPEN' 1* 0.026 0.216 2.363 2* 'Y' 14.962 / - 'C-8T2K' 31 10 9 9 'OPEN' 1* 26.041 0.216 2400.479 2* 'Y' 15.069 / - 'C-8T2K' 31 11 9 9 'OPEN' 1* 4.488 0.216 435.816 2* 'Z' 19.631 / - 'C-8T2K' 31 11 10 10 'OPEN' 1* 30.057 0.216 2768.771 2* 'Y' 15.019 / - 'C-8T2K' 31 11 11 11 'OPEN' 1* 29.819 0.216 2787.005 2* 'Y' 16.142 / - 'C-8T2K' 31 11 12 12 'OPEN' 1* 29.203 0.216 2762.936 2* 'Y' 17.166 / - 'C-8T2K' 31 11 13 13 'OPEN' 1* 30.673 0.216 2781.058 2* 'Y' 13.895 / - 'C-8T2K' 31 11 14 14 'OPEN' 1* 29.100 0.216 2752.839 2* 'Y' 17.154 / - 'C-8T2K' 31 11 15 15 'OPEN' 1* 29.579 0.216 2764.073 2* 'Y' 16.128 / - 'C-8T2K' 31 11 16 16 'OPEN' 1* 29.467 0.216 2753.624 2* 'Y' 16.129 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1944.714 5.286 265860.567 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 3936.561 5* / - 'C-8T2K' 'GAS' 'OPEN' 'RATE' 378417.286 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 893178.580 5* / -/ - -DATES - 01 'FEB' 1998 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 845.964 2.643 114837.607 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 20041.754 5* / - 'C-8T2K' 'GAS' 'OPEN' 'RATE' 271288.035 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 1000.000 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 859225.321 5* / -/ - -DATES - 01 'MAR' 1998 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 686.613 0.548 84423.806 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 539.029 5* / - 'C-8T2K' 'GAS' 'OPEN' 'RATE' 0.000 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 150693.548 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1025833.516 5* / -/ - -DATES - 01 'APR' 1998 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 786.267 0.700 114509.967 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 395.357 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 258560.001 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 949555.735 5* / -/ - -DATES - 01 'MAY' 1998 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1838.839 9.484 303938.548 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 1510.949 5* / - 'C-8T2K' 'GAS' 'OPEN' 'RATE' 48.065 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 222492.613 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1088516.452 5* / -/ - -DATES - 01 'JUN' 1998 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 3037.091 16.636 590102.320 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 8662.463 5* / - 'C-8T2K' 'GAS' 'OPEN' 'RATE' 149.273 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 269844.182 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1011561.227 5* / -/ - -DATES - 23 'JUN' 1998 / -/ - -WELOPEN - 'C-8T2K' 'SHUT' 5* / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 2992.000 15.000 660209.125 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 0.000 5* / - 'C-8T2K' 'GAS' 'OPEN' 'RATE' 0.000 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 291418.500 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 945577.867 5* / -/ - -DATES - 01 'JUL' 1998 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 2096.968 28.452 511463.355 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 1905.761 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 296592.548 5* / - 'C-21' 'OIL' 'OPEN' 'RATE' 249.000 4* 140.000 / - 'C-22' 'GAS' 'OPEN' 'RATE' 989500.518 5* / -/ - -DATES - 01 'AUG' 1998 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 2014.161 32.355 499951.292 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 373.335 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 355086.097 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1104129.710 5* / -/ - -DATES - 01 'SEP' 1998 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 2393.300 29.333 573772.099 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 5477.893 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 344129.433 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1071732.435 5* / -/ - -DATES - 01 'OCT' 1998 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1663.742 12.806 572738.869 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 12534.623 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 390771.097 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1166055.161 5* / -/ - -DATES - 01 'NOV' 1998 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1243.867 10.400 410035.033 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 10580.132 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 343892.800 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 918766.369 5* / -/ - -DATES - 01 'DEC' 1998 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1218.226 10.516 398008.613 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 6268.938 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 394672.161 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1131794.869 5* / -/ - -DATES - 01 'JAN' 1999 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 669.806 6.290 265957.871 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 14613.365 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 695321.065 5* / - 'C-21' 'WATER' 'OPEN' 'RATE' 261.000 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1108820.841 5* / -/ - -DATES - 01 'FEB' 1999 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 632.679 1.750 219156.250 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 25185.743 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 477539.893 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1161119.179 5* / -/ - -DATES - 01 'MAR' 1999 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1279.839 3.645 454776.097 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 22290.146 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 360616.226 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1204084.645 5* / -/ - -DATES - 01 'APR' 1999 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1223.433 3.600 428480.033 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 25595.163 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 355382.067 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1387249.000 5* / -/ - -DATES - 01 'MAY' 1999 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1176.032 3.387 443610.967 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 28055.677 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 324908.129 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1297890.903 5* / -/ - -DATES - 01 'JUN' 1999 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 604.967 1.633 222805.065 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 12464.191 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 159622.133 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 594618.637 5* / -/ - -DATES - 01 'JUL' 1999 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 754.032 1.806 251992.452 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 39104.203 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 50033.452 5* / - 'C-21' 'GAS' 'OPEN' 'RATE' 56671.000 4* 0.000215135 / - 'C-22' 'GAS' 'OPEN' 'RATE' 1332732.258 5* / -/ - -DATES - 01 'AUG' 1999 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 0.000 0.000 0.000 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 30585.698 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 3580.645 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1130730.613 5* / -/ - -DATES - 01 'SEP' 1999 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 674.700 0.700 240749.333 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 16201.437 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 331169.467 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 768833.669 5* / -/ - -DATES - 01 'OCT' 1999 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 998.065 1.323 329109.355 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 13937.428 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 373573.613 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 844154.353 5* / -/ - -DATES - 01 'NOV' 1999 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1136.933 1.200 390925.767 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 20674.413 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 447641.432 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1001040.765 5* / -/ - -DATES - 01 'DEC' 1999 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1080.839 1.097 403727.065 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 25753.132 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 470490.324 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1017267.228 5* / -/ - -DATES - 01 'JAN' 2000 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1169.323 8.387 425524.034 1* 1* 1* 1* 1* / - 'C-21' 'OPEN' 'ORAT' 115.000 66.000 44716.000 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 52017.197 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 502873.225 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 944509.131 5* / -/ - -DATES - 01 'FEB' 2000 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1084.931 8.966 385280.690 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 48058.918 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 457486.414 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1015348.862 5* / -/ - -DATES - 01 'MAR' 2000 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 405.581 3.194 137765.161 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 46766.333 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 477722.484 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 798971.032 5* / -/ - -DATES - 01 'APR' 2000 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 713.933 6.433 262273.367 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 53853.466 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 483743.234 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 813487.798 5* / -/ - -DATES - 01 'MAY' 2000 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 647.935 5.419 227722.258 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 43736.787 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 460786.646 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 801484.387 5* / -/ - -DATES - 01 'JUN' 2000 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 777.033 4.600 241693.467 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 57244.080 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 448467.100 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 758476.800 5* / -/ - -DATES - 01 'JUL' 2000 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 977.065 4.548 250727.065 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 50720.655 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 492895.807 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 886439.968 5* / -/ - -DATES - 01 'AUG' 2000 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 819.419 4.032 206844.548 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 37957.494 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 503092.291 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 964582.835 5* / -/ - -DATES - 01 'SEP' 2000 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 506.567 2.900 140249.133 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 40924.206 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 414451.167 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 895560.002 5* / -/ - -DATES - 01 'OCT' 2000 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 841.194 5.452 403911.322 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 28618.119 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 538214.452 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 990095.157 5* / -/ - -DATES - 01 'NOV' 2000 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 527.333 1.267 199187.966 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 26082.540 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 513635.435 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 921066.669 5* / -/ - -DATES - 01 'DEC' 2000 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 242.097 0.419 88378.903 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 25390.255 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 521458.544 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 956081.871 5* / -/ - -DATES - 01 'JAN' 2001 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 0.000 0.000 0.000 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 33085.100 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 259986.386 5* / - 'C-21' 'OIL' 'OPEN' 'RATE' 408.000 4* 140.000 / - 'C-22' 'GAS' 'OPEN' 'RATE' 978383.099 5* / -/ - -DATES - 01 'FEB' 2001 / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 48205.999 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 0.000 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1149495.714 5* / -/ - -DATES - 08 'FEB' 2001 / -/ - -WELOPEN - 'C-19' 'SHUT' 0 0 0 2* / -/ - -COMPDAT - 'C-19' 39 14 6 6 'OPEN' 1* 25.266 0.216 1990.187 2* 'Y' 7.346 / - 'C-19' 39 15 6 6 'OPEN' 1* 53.485 0.216 4277.886 2* 'Y' 7.839 / - 'C-19' 39 15 7 7 'OPEN' 1* 104.233 0.216 8176.943 2* 'Y' 7.221 / - 'C-19' 39 15 8 8 'OPEN' 1* 0.338 0.216 26.100 2* 'Y' 6.719 / - 'C-19' 39 16 8 8 'OPEN' 1* 0.087 0.216 6.671 2* 'Y' 6.676 / - 'C-19' 38 16 8 8 'OPEN' 1* 0.131 0.216 10.099 2* 'Y' 6.670 / - 'C-19' 37 18 11 11 'OPEN' 1* 36.701 0.216 2834.485 2* 'Y' 6.765 / - 'C-19' 37 18 12 12 'OPEN' 1* 201.696 0.216 15589.941 2* 'Y' 6.788 / - 'C-19' 37 18 13 13 'OPEN' 1* 32.173 0.216 2482.740 2* 'Y' 6.742 / - 'C-19' 37 19 13 13 'OPEN' 1* 0.094 0.216 7.293 2* 'Y' 6.764 / - 'C-19' 36 19 13 13 'OPEN' 1* 86.499 0.216 6665.573 2* 'Y' 6.703 / - 'C-19' 36 19 14 14 'OPEN' 1* 0.278 0.216 21.410 2* 'Y' 6.649 / - 'C-19' 36 20 14 14 'OPEN' 1* 278.325 0.216 21398.139 2* 'Y' 6.639 / - 'C-19' 36 20 13 13 'OPEN' 1* 218.830 0.216 16861.514 2* 'Y' 6.700 / - 'C-19' 36 21 13 13 'OPEN' 1* 284.727 0.216 21878.511 2* 'Y' 6.624 / - 'C-19' 36 21 12 12 'OPEN' 1* 200.525 0.216 15398.416 2* 'Y' 6.607 / - 'C-19' 36 22 13 13 'OPEN' 1* 38.955 0.216 2991.239 2* 'Y' 6.605 / - 'C-19' 36 22 12 12 'OPEN' 1* 124.228 0.216 9534.560 2* 'Y' 6.593 / - 'C-19' 35 23 13 13 'OPEN' 1* 229.211 0.216 17591.568 2* 'Y' 6.592 / - 'C-19' 35 23 14 14 'OPEN' 1* 42.518 0.216 3286.223 2* 'Y' 6.786 / - 'C-19' 35 24 15 15 'OPEN' 1* 49.616 0.216 3818.562 2* 'Y' 6.668 / - 'C-19' 35 24 16 16 'OPEN' 1* 148.076 0.216 11340.899 2* 'Y' 6.536 / - 'C-19' 35 25 16 16 'OPEN' 1* 0.164 0.216 12.543 2* 'Y' 6.514 / - 'C-19' 34 25 16 16 'OPEN' 1* 128.420 0.216 9830.735 2* 'Y' 6.523 / - 'C-19' 34 25 15 15 'OPEN' 1* 137.101 0.216 10497.277 2* 'Y' 6.528 / - 'C-19' 34 26 15 15 'OPEN' 1* 71.365 0.216 5444.541 2* 'Y' 6.433 / - 'C-19' 34 26 14 14 'OPEN' 1* 423.367 0.216 32285.266 2* 'Y' 6.421 / - 'C-19' 33 26 14 14 'OPEN' 1* 68.448 0.216 5231.526 2* 'Y' 6.481 / - 'C-19' 33 27 14 14 'OPEN' 1* 36.744 0.216 2805.661 2* 'Y' 6.455 / - 'C-19' 33 27 13 13 'OPEN' 1* 354.667 0.216 27036.137 2* 'Y' 6.411 / - 'C-19' 33 27 12 12 'OPEN' 1* 100.458 0.216 7650.032 2* 'Y' 6.385 / - 'C-19' 33 28 12 12 'OPEN' 1* 207.460 0.216 15797.470 2* 'Y' 6.383 / - 'C-19' 32 28 12 12 'OPEN' 1* 103.805 0.216 7940.809 2* 'Y' 6.504 / - 'C-19' 32 28 11 11 'OPEN' 1* 247.786 0.216 18955.656 2* 'Y' 6.505 / - 'C-19' 32 28 10 10 'OPEN' 1* 15.303 0.216 1169.531 2* 'Y' 6.479 / - 'C-19' 32 29 10 10 'OPEN' 1* 234.073 0.216 17885.273 2* 'Y' 6.473 / - 'C-19' 32 29 9 9 'OPEN' 1* 229.050 0.216 17487.535 2* 'Y' 6.452 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 0.000 0.000 0.000 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 48219.119 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1011353.905 5* / -/ - -DATES - 01 'MAR' 2001 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1523.613 3.355 377079.903 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 44450.684 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 57961.419 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 806393.129 5* / -/ - -DATES - 01 'APR' 2001 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 3059.900 7.200 760971.400 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 30528.657 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 354455.933 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 694052.267 5* / -/ - -DATES - 01 'MAY' 2001 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 2687.355 5.452 775058.710 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 42701.446 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 529185.839 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 546850.484 5* / -/ - -DATES - 01 'JUN' 2001 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1218.133 1.533 433342.800 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 24848.297 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 293138.300 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 427921.300 5* / -/ - -DATES - 01 'JUL' 2001 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1113.839 44.581 440213.742 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 31708.122 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 451100.903 5* / - 'C-21' 'WATER' 'OPEN' 'RATE' 166.000 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 797749.744 5* / -/ - -DATES - 01 'AUG' 2001 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1288.387 46.903 718752.871 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 43430.110 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 512932.968 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 697510.258 5* / -/ - -DATES - 01 'SEP' 2001 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1363.800 59.133 705664.433 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 45018.711 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 503202.568 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 706524.433 5* / -/ - -DATES - 01 'OCT' 2001 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1393.355 64.806 745196.839 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 47425.574 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 531249.773 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 665642.871 5* / -/ - -DATES - 01 'NOV' 2001 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1252.133 57.833 642884.867 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 48107.967 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 539024.932 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 697369.600 5* / -/ - -DATES - 01 'DEC' 2001 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1058.065 2.194 425976.549 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 47502.032 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 538549.613 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 630823.806 5* / -/ - -DATES - 01 'JAN' 2002 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1076.516 0.903 537676.194 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 48660.038 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 476819.227 5* / - 'C-21' 'GAS' 'OPEN' 'RATE' 140756.000 4* 0.000215135 / - 'C-22' 'GAS' 'OPEN' 'RATE' 626401.806 5* / -/ - -DATES - 01 'FEB' 2002 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 1183.679 1.036 610370.393 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 36004.610 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 520335.967 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 694726.250 5* / -/ - -DATES - 01 'MAR' 2002 / -/ - -WCONHIST - 'C-19' 'OPEN' 'RESV' 652.720 0.760 340383.720 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 24264.599 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 405655.040 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 458198.200 5* / -/ - -DATES - 26 'MAR' 2002 / -/ - -WELSPECS - 'C-17D' 'NESS' 36 30 1* 'OIL' 1* 1* 1* 'YES' 1* 1* 1* / -/ - -COMPDAT - 'C-17D' 36 30 5 5 'OPEN' 1* 53.414 0.216 4126.272 2* 'Y' 6.772 / - 'C-17D' 36 31 5 5 'OPEN' 1* 7.861 0.216 603.112 2* 'Y' 6.584 / - 'C-17D' 36 31 6 6 'OPEN' 1* 0.075 0.216 5.840 2* 'Y' 7.062 / - 'C-17D' 36 31 7 7 'OPEN' 1* 77.855 0.216 6135.617 2* 'Y' 7.361 / - 'C-17D' 36 31 8 8 'OPEN' 1* 107.452 0.216 8206.291 2* 'Y' 6.460 / - 'C-17D' 37 31 8 8 'OPEN' 1* 15.268 0.216 1165.169 2* 'Y' 6.440 / - 'C-17D' 37 32 7 7 'OPEN' 1* 0.036 0.216 2.753 2* 'Y' 6.525 / - 'C-17D' 37 33 6 6 'OPEN' 1* 144.823 0.216 11093.169 2* 'Y' 6.539 / - 'C-17D' 37 33 5 5 'OPEN' 1* 240.429 0.216 18386.318 2* 'Y' 6.495 / - 'C-17D' 37 34 5 5 'OPEN' 1* 212.427 0.216 16247.310 2* 'Y' 6.499 / - 'C-17D' 37 34 4 4 'OPEN' 1* 47.838 0.216 3651.416 2* 'Y' 6.446 / - 'C-17D' 38 39 6 6 'OPEN' 1* 146.727 0.216 11248.045 2* 'Y' 6.561 / - 'C-17D' 38 40 6 6 'OPEN' 1* 222.667 0.216 17060.746 2* 'Y' 6.547 / - 'C-17D' 37 43 5 5 'OPEN' 1* 37.466 0.216 2867.317 2* 'Y' 6.516 / - 'C-17D' 37 43 4 4 'OPEN' 1* 248.842 0.216 19042.551 2* 'Y' 6.513 / - 'C-17D' 37 44 4 4 'OPEN' 1* 223.144 0.216 17067.840 2* 'Y' 6.501 / - 'C-17D' 37 44 5 5 'OPEN' 1* 122.738 0.216 9415.716 2* 'Y' 6.580 / - 'C-17D' 37 45 5 5 'OPEN' 1* 337.905 0.216 25852.387 2* 'Y' 6.508 / - 'C-17D' 37 45 6 6 'OPEN' 1* 71.841 0.216 5490.406 2* 'Y' 6.479 / - 'C-17D' 37 46 6 6 'OPEN' 1* 207.826 0.216 15880.383 2* 'Y' 6.474 / - 'C-17D' 37 46 5 5 'OPEN' 1* 132.209 0.216 10104.258 2* 'Y' 6.479 / - 'C-17D' 37 47 5 5 'OPEN' 1* 450.314 0.216 34420.406 2* 'Y' 6.483 / - 'C-17D' 37 48 5 5 'OPEN' 1* 253.673 0.216 19399.193 2* 'Y' 6.496 / - 'C-17D' 37 49 5 5 'OPEN' 1* 0.081 0.216 6.202 2* 'Y' 6.481 / - 'C-17D' 37 49 6 6 'OPEN' 1* 0.143 0.216 10.919 2* 'Y' 6.474 / - 'C-17D' 37 50 6 6 'OPEN' 1* 0.154 0.216 11.738 2* 'Y' 6.483 / - 'C-17D' 38 50 6 6 'OPEN' 1* 0.032 0.216 2.461 2* 'Y' 6.446 / - 'C-17D' 38 51 4 4 'OPEN' 1* 0.039 0.216 3.068 2* 'Y' 6.935 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 13.333 12.500 7337.167 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 7.500 0.000 1984.500 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 10823.693 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 4934.500 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 220494.500 5* / -/ - -DATES - 01 'APR' 2002 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 1430.567 80.500 341077.267 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 1053.733 0.967 556946.400 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 32093.420 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 511044.367 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 760140.233 5* / -/ - -DATES - 01 'MAY' 2002 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 1035.935 41.710 377582.516 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 886.968 70.581 446392.193 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 36899.383 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 536468.548 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 691940.644 5* / -/ - -DATES - 01 'JUN' 2002 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 253.200 0.033 83361.100 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 850.300 104.133 574315.567 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 28361.940 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 430408.269 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 531053.567 5* / -/ - -DATES - 01 'JUL' 2002 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 74.581 0.000 21145.871 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 817.258 19.452 486586.675 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 22606.703 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 541137.806 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 0.000 5* / -/ - -DATES - 01 'AUG' 2002 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 0.000 0.000 19.613 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 811.161 11.161 496220.743 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 24811.485 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 630671.839 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 104471.129 5* / -/ - -DATES - 01 'SEP' 2002 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 0.000 0.000 0.000 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 661.133 57.300 412005.767 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 21819.563 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 569409.467 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 233.067 5* / -/ - -DATES - 01 'OCT' 2002 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 399.548 23.677 85037.742 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 723.161 129.548 480822.516 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 20918.064 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 615731.839 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 17718.129 5* / -/ - -DATES - 01 'NOV' 2002 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 290.800 6.300 174601.967 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 574.433 27.933 360413.733 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 11992.711 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 597995.067 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 4186.000 5* / -/ - -DATES - 01 'DEC' 2002 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 423.935 11.387 382036.258 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 813.645 43.194 527662.323 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 27290.653 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 568576.226 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1984.839 5* / -/ - -DATES - 01 'JAN' 2003 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 575.387 35.516 509974.548 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 641.419 78.000 413161.871 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 46915.403 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 610799.452 5* / - 'C-21' 'OIL' 'OPEN' 'RATE' 206.000 4* 140.000 / - 'C-22' 'GAS' 'OPEN' 'RATE' 122928.194 5* / -/ - -DATES - 01 'FEB' 2003 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 156.357 8.393 181800.929 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 830.964 102.143 530429.679 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 55980.850 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 662084.429 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 647112.609 5* / -/ - -DATES - 01 'MAR' 2003 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 0.161 0.000 585.000 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 669.258 85.387 425507.839 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 16919.533 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 653643.387 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 228890.742 5* / -/ - -DATES - 01 'APR' 2003 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 91.100 4.833 65637.933 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 609.367 89.767 430083.932 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 23347.952 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 524380.201 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 0.000 5* / -/ - -DATES - 01 'MAY' 2003 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 100.806 6.710 84103.516 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 522.323 82.581 340785.323 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 28703.622 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 423693.710 5* / -/ - -DATES - 01 'JUN' 2003 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 0.867 0.033 930.767 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 641.133 62.333 438901.933 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 30736.323 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 447400.633 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 15159.700 5* / -/ - -DATES - 01 'JUL' 2003 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 119.806 8.677 126503.548 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 665.710 65.710 387251.839 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 28296.093 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 637559.032 5* / - 'C-21' 'GAS' 'OPEN' 'RATE' 187518.000 4* 0.000215135 / - 'C-22' 'GAS' 'OPEN' 'RATE' 0.000 5* / -/ - -DATES - 01 'AUG' 2003 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 323.290 0.387 129316.000 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 804.839 68.806 600458.613 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 46596.784 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 562862.710 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 592031.903 5* / -/ - -DATES - 01 'SEP' 2003 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 307.400 0.267 150269.300 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 966.367 81.000 730195.570 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 66282.127 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 675212.033 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1091625.233 5* / -/ - -DATES - 01 'OCT' 2003 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 164.806 0.000 63481.226 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 905.129 90.903 824197.484 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 60133.631 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 553955.129 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 905042.353 5* / -/ - -DATES - 01 'NOV' 2003 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 0.000 0.000 0.000 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 1213.000 107.000 1172024.254 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 75595.519 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 1091.938 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1354812.188 5* / -/ - -DATES - 17 'NOV' 2003 / -/ - -WELOPEN - 'C-13AT2' 'SHUT' 0 0 0 2* / -/ - -COMPDAT - 'C-13AT2' 22 27 15 15 'OPEN' 1* 68.994 0.216 5339.784 2* 'Y' 6.824 / - 'C-13AT2' 22 27 16 16 'OPEN' 1* 162.174 0.216 12530.677 2* 'Y' 6.778 / - 'C-13AT2' 22 28 16 16 'OPEN' 1* 31.885 0.216 2467.733 2* 'Y' 6.824 / - 'C-13AT2' 23 28 16 16 'OPEN' 1* 29.573 0.216 2285.517 2* 'Y' 6.784 / - 'C-13AT2' 23 28 15 15 'OPEN' 1* 29.634 0.216 2295.352 2* 'Y' 6.847 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 104.643 0.071 58672.785 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 1079.929 98.786 1082911.929 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 71343.963 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 610784.857 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1431670.429 5* / -/ - -DATES - 01 'DEC' 2003 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 224.355 0.194 104331.742 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 854.097 78.839 594182.839 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 66903.877 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 621793.357 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1041548.161 5* / -/ - -DATES - 01 'JAN' 2004 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 165.839 54.710 126789.097 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 723.452 52.903 368399.258 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 64954.763 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 633223.032 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1037734.550 5* / -/ - -DATES - 01 'FEB' 2004 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 386.483 121.931 279919.725 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 890.138 44.931 488803.519 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 57010.221 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 600900.448 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1172543.413 5* / -/ - -DATES - 01 'MAR' 2004 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 466.194 125.000 432198.418 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 1290.097 88.355 387124.323 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 16226.168 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 609270.387 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1114658.772 5* / -/ - -DATES - 01 'APR' 2004 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 0.000 0.000 0.000 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 1168.067 64.000 435236.300 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 4452.067 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 617182.167 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1386763.400 5* / -/ - -DATES - 01 'MAY' 2004 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 276.581 99.548 218693.065 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 1080.710 58.290 347040.000 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 2285.329 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 614213.194 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1616394.548 5* / -/ - -DATES - 01 'JUN' 2004 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 252.467 78.133 260664.467 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 1006.267 49.733 375247.967 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 355.837 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 650779.167 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1605165.133 5* / -/ - -DATES - 01 'JUL' 2004 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 174.161 54.839 165662.290 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 1128.581 80.194 386713.935 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 147.318 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 657043.226 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1864440.226 5* / -/ - -DATES - 01 'AUG' 2004 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 487.161 146.677 442460.000 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 1057.000 131.871 389415.581 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 24.397 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 650134.226 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1804685.387 5* / -/ - -DATES - 01 'SEP' 2004 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 6.900 2.467 5354.400 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 951.233 127.333 314914.900 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 0.000 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 483098.467 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1158197.367 5* / -/ - -DATES - 01 'OCT' 2004 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 2.500 0.643 2266.143 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 1313.929 130.357 442969.000 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 0.000 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 2463440.714 5* / -/ - -DATES - 15 'OCT' 2004 / -/ - -WELOPEN - 'C-17D' 'SHUT' 0 0 0 2* / -/ - -COMPDAT - 'C-17D' 37 32 7 7 'OPEN' 1* 0.036 0.216 2.753 2* 'Y' 6.525 / - 'C-17D' 37 33 6 6 'OPEN' 1* 144.823 0.216 11093.169 2* 'Y' 6.539 / - 'C-17D' 37 33 5 5 'OPEN' 1* 240.429 0.216 18386.318 2* 'Y' 6.495 / - 'C-17D' 37 34 5 5 'OPEN' 1* 212.427 0.216 16247.310 2* 'Y' 6.499 / - 'C-17D' 37 34 4 4 'OPEN' 1* 47.838 0.216 3651.416 2* 'Y' 6.446 / - 'C-17D' 38 39 6 6 'OPEN' 1* 146.727 0.216 11248.045 2* 'Y' 6.561 / - 'C-17D' 38 40 6 6 'OPEN' 1* 222.667 0.216 17060.746 2* 'Y' 6.547 / - 'C-17D' 37 43 5 5 'OPEN' 1* 37.466 0.216 2867.317 2* 'Y' 6.516 / - 'C-17D' 37 43 4 4 'OPEN' 1* 248.842 0.216 19042.551 2* 'Y' 6.513 / - 'C-17D' 37 44 4 4 'OPEN' 1* 223.144 0.216 17067.840 2* 'Y' 6.501 / - 'C-17D' 37 44 5 5 'OPEN' 1* 122.738 0.216 9415.716 2* 'Y' 6.580 / - 'C-17D' 37 45 5 5 'OPEN' 1* 337.905 0.216 25852.387 2* 'Y' 6.508 / - 'C-17D' 37 45 6 6 'OPEN' 1* 71.841 0.216 5490.406 2* 'Y' 6.479 / - 'C-17D' 37 46 6 6 'OPEN' 1* 207.826 0.216 15880.383 2* 'Y' 6.474 / - 'C-17D' 37 46 5 5 'OPEN' 1* 132.209 0.216 10104.258 2* 'Y' 6.479 / - 'C-17D' 37 47 5 5 'OPEN' 1* 450.314 0.216 34420.406 2* 'Y' 6.483 / - 'C-17D' 37 48 5 5 'OPEN' 1* 253.673 0.216 19399.193 2* 'Y' 6.496 / - 'C-17D' 37 49 5 5 'OPEN' 1* 0.081 0.216 6.202 2* 'Y' 6.481 / - 'C-17D' 37 49 6 6 'OPEN' 1* 0.143 0.216 10.919 2* 'Y' 6.474 / - 'C-17D' 37 50 6 6 'OPEN' 1* 0.154 0.216 11.738 2* 'Y' 6.483 / - 'C-17D' 38 50 6 6 'OPEN' 1* 0.032 0.216 2.461 2* 'Y' 6.446 / - 'C-17D' 38 51 4 4 'OPEN' 1* 0.039 0.216 3.068 2* 'Y' 6.935 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 687.941 150.471 473113.469 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 1230.235 114.235 353778.000 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 130834.529 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1758995.059 5* / -/ - -DATES - 01 'NOV' 2004 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 530.667 199.033 420183.333 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 1163.933 149.600 377031.933 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 25810.140 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 369752.801 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1468401.644 5* / -/ - -DATES - 01 'DEC' 2004 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 11.387 6.290 10531.871 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 289.903 42.290 97046.968 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 67840.581 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 0.000 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1096572.228 5* / -/ - -DATES - 01 'JAN' 2005 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 97.053 83.737 87742.474 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 942.632 134.684 226690.263 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 26636.079 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1519183.579 5* / -/ - -DATES - 20 'JAN' 2005 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 125.583 109.500 113940.750 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 1081.667 167.500 300570.833 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 0.000 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 1300000.000 1* 600.000 3* / - 'C-22' 'GAS' 'OPEN' 'RATE' 562529.918 5* / -/ - -DATES - 01 'FEB' 2005 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 1.071 1.107 1109.821 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 1087.679 179.750 395600.714 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 28442.948 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 1282130.357 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 524656.248 5* / -/ - -DATES - 01 'MAR' 2005 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 554.226 166.387 649349.935 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 1173.774 169.548 576941.903 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 65629.595 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 1258322.258 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 0.000 5* / -/ - -DATES - 01 'APR' 2005 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 67.633 16.600 94114.333 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 1194.467 160.567 556157.433 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 60492.032 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 1249630.767 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 400465.133 5* / -/ - -DATES - 01 'MAY' 2005 / -/ - -WCONHIST - 'C-17D' 'OPEN' 'RESV' 7.290 1.290 2866.710 1* 1* 1* 1* 1* / - 'C-19' 'OPEN' 'RESV' 997.097 153.097 611673.452 1* 1* 1* 1* 1* / -/ - -WCONINJE - 'C-5' 'GAS' 'OPEN' 'RATE' 53075.411 5* / - 'C-13AT2' 'GAS' 'OPEN' 'RATE' 1242915.290 5* / - 'C-22' 'GAS' 'OPEN' 'RATE' 1766845.006 5* / -/ - -DATES - 01 'JUN' 2005 / -/ - -END diff --git a/ThirdParty/Ert/libsched/src/tests/sched_test_02.SCH b/ThirdParty/Ert/libsched/src/tests/sched_test_02.SCH deleted file mode 100644 index 6832f7b691..0000000000 --- a/ThirdParty/Ert/libsched/src/tests/sched_test_02.SCH +++ /dev/null @@ -1,24 +0,0 @@ -GRUPTREE - FOO FIELD / -/ - - -WCONHIST - 'OP_1' 'OPEN' 'ORAT' 7996.000 4.000 1.46402E+006 5* / - 'OP_2' 'OPEN' 'ORAT' 7998.000 2.000 1461075.000 5* / -/ - -DATES - 11 'JAN' 2000 / -/ - -WCONHIST - 'OP_3' 'OPEN' 'ORAT' 7999.000 1.000 1471824.000 5* / - 'OP_4' 'SHUT' 'ORAT' 2451.000 4252.000 453703.000 5* / - 'OP_5' 'SHUT' 'ORAT' 1186.000 6814.000 206655.000 5* / -/ - -DATES - 10 'FEB' 2000 / - 20 'FEB' 2000 / -/ diff --git a/ThirdParty/Ert/libsched/src/tests/sched_test_04.SCH b/ThirdParty/Ert/libsched/src/tests/sched_test_04.SCH deleted file mode 100644 index dd589e8574..0000000000 --- a/ThirdParty/Ert/libsched/src/tests/sched_test_04.SCH +++ /dev/null @@ -1,175 +0,0 @@ -SKIPREST - -RPTSCHED - RESTART=2 / - --- SET 'NO RESOLUTION' OPTION -DRSDT - 0 / - --- WELL SPECIFICATION DATA --- --- WELL GROUP LOCATION BHP PI --- NAME NAME I J DEPTH DEFN --- m -WELSPECS - 'WWI1' 'G' 1 1 -1 'WATER' / - 'WP1' 'G' 30 30 -1 'OIL' / -/ - - --- COMPLETION SPECIFICATION DATA --- --- WELL -LOCATION- OPEN/ SAT CONN WELL --- NAME I J K1 K2 SHUT TAB FACT DIAM --- m2 -COMPDAT - 'WWI1' 1 1 1 5 'OPEN' 0 -1 0.5 -1 0 0 / - 'WP1' 30 30 1 5 'OPEN' 0 -1 0.5 -1 0 0 / -/ - --- PRODUCTION WELL CONTROLS --- --- WELL OPEN/ CNTL OIL WATER GAS LIQU RES BHP.TARGET --- NAME SHUT MODE RATE RATE RATE RATE RATE PRESS --- sm3/day sm3/day sm3/day sm3/day rm3/day bar - --- USED IF THE WELL IS CONTROLED BY THE OIL RATE -WCONPROD - 'WP1' 'OPEN' 'LRAT' 3* 2000 1* 30 0 0 0 / --- 'WP2' 'OPEN' 'ORAT' 2000 4* 30 0 0 0 / --- 'WP3' 'OPEN' 'ORAT' 2000 4* 30 0 0 0 / --- 'WP4' 'OPEN' 'ORAT' 2000 4* 30 0 0 0 / -/ - --- INJECTION WELL CONTROLS --- --- WELL INJ OPEN/ CNTL FLOW BHP.TARGET --- NAME TYPE SHUT MODE RATE PRESS --- sm3/day bar -WCONINJE - 'WWI1' 'WAT' 'SHUT' 'RATE' 6000 1* 400 / -/ - - -RPTRST -BASIC=2 / - -DATES - 1 'FEB' 2004 / -/ ---END0001 - - -DATES - 1 'APR' 2005 / -/ ---END0002 - - -COMPDAT - 'WWI1' 1 1 1 5 'OPEN' 0 -1 0.5 -1 0 0 / - 'WP1' 30 30 1 5 'OPEN' 0 -1 0.5 -1 0 0 / -/ - - -WCONPROD - 'WP1' 'OPEN' 'LRAT' 3* 5500 1* 30 0 0 0 / - / -WCONINJE - 'WWI1' 'WAT' 'OPEN' 'RATE' 6000 1* 400 / -/ - - ---TSTEP ---5*91.3125 / ---456.5625 / -DATES - 1 'JUL' 2006 / -/ - ---END0003 - -COMPDAT - 'WWI1' 1 1 1 5 'OPEN' 0 -1 0.5 -1 0 0 / - 'WP1' 30 30 1 5 'OPEN' 0 -1 0.5 -1 0 0 / -/ - - ---TSTEP ---5*91.3125 / ---456.5625 / -DATES - 1 'OCT' 2007 / -/ ---END0004 - -COMPDAT - 'WWI1' 1 1 1 5 'OPEN' 0 -1 0.5 -1 0 0 / - 'WP1' 30 30 1 5 'OPEN' 0 -1 0.5 -1 0 0 / -/ - - ---TSTEP ---5*91.3125 / ---456.5625 / -DATES - 1 'JAN' 2009 / -/ ---END0005 - -COMPDAT - 'WWI1' 1 1 1 5 'OPEN' 0 -1 0.5 -1 0 0 / - 'WP1' 30 30 1 5 'OPEN' 0 -1 0.5 -1 0 0 / -/ - - ---TSTEP ---5*91.3125 / ---456.5625 / -DATES - 1 'APR' 2010 / -/ ---END0006 - -COMPDAT - 'WWI1' 1 1 1 5 'OPEN' 0 -1 0.5 -1 0 0 / - 'WP1' 30 30 1 5 'OPEN' 0 -1 0.5 -1 0 0 / -/ - - ---TSTEP ---91.3125 / ---456.5625 / -DATES - 1 'JUL' 2011 / -/ ---END0007 - -COMPDAT - 'WWI1' 1 1 1 5 'OPEN' 0 -1 0.5 -1 0 0 / - 'WP1' 30 30 1 5 'OPEN' 0 -1 0.5 -1 0 0 / -/ - ---TSTEP ---91.3125 / ---456.5625 / - -DATES - 1 'OCT' 2012 / -/ ---END0008 - -COMPDAT - 'WWI1' 1 1 1 5 'OPEN' 0 -1 0.5 -1 0 0 / - 'WP1' 30 30 1 5 'OPEN' 0 -1 0.5 -1 0 0 / -/ - ---TSTEP ---91.3125 / -DATES - 1 'JAN' 2013 / -/ ---END0009 - -END diff --git a/ThirdParty/Ert/libsched/src/well_history.c b/ThirdParty/Ert/libsched/src/well_history.c deleted file mode 100644 index 41f673a9dd..0000000000 --- a/ThirdParty/Ert/libsched/src/well_history.c +++ /dev/null @@ -1,309 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'well_history.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - - -#define WELL_HISTORY_TYPE_ID 44431872 - - - /** - The following paradigm applies to the schedule files: - - o It is based on keywords which will apply until the next - occurence of the same keyword. - - o It is naturaly organized in blocks delimited by DATES / TSTEP - keywords. - - - Example - ------- - - DATES - 1 'JAN' 2000 / - - WCONHIST - 'OP_1' 'OPEN' 'ORAT' 7996.000 4.000 1.46402E+006 5* / - / - - DATES - 1 'FEB' 2000 / - - <--- What is the oil rate here? - - DATES - 1 'MAR' 2000 / - - - END - - - In this example an historical oil production rate of 7996 is - specified for immediately following the DATES keyword at - 1. 'JAN' - but what is the oil production rate at 15.th of - February? The point is that the 7996 rate applies until it is - set again, i.e. the DATES / TSTEP are not that suitable as block - units. - - - To support this behaviour the vector types from vector_template.c - are well suited; setting the default with - e.g. double_vector_set_default() will ascertain that the default - value is returned for all subsequent gets from the vector beyond - the set length. (That was clear ....) - -*/ - - - -struct well_history_struct { - UTIL_TYPE_ID_DECLARATION; - char * well_name; - int_vector_type * kw_type; /* This enum should be one of: NONE(default), WCONHIST , WCONINJE and WCONINJH (sched_kw_type_enum in sched_types.h). */ - size_t_vector_type * active_state; /* Contains pointer to the currently active of the xxx_state objects. The size_t_vector instance is abused to store pointer values (i.e. addresses). */ - wconhist_state_type * wconhist_state; - wconinje_state_type * wconinje_state; - wconinjh_state_type * wconinjh_state; - size_t_vector_type * parent; - bool_vector_type * well_open; -}; - - - -UTIL_SAFE_CAST_FUNCTION( well_history , WELL_HISTORY_TYPE_ID ) -static UTIL_SAFE_CAST_FUNCTION_CONST( well_history , WELL_HISTORY_TYPE_ID ) -UTIL_IS_INSTANCE_FUNCTION( well_history , WELL_HISTORY_TYPE_ID) - - -well_history_type * well_history_alloc( const char * well_name , const time_t_vector_type * time) { - well_history_type * well_history = util_malloc( sizeof * well_history ); - UTIL_TYPE_ID_INIT( well_history , WELL_HISTORY_TYPE_ID ); - well_history->well_name = util_alloc_string_copy( well_name ); - well_history->kw_type = int_vector_alloc(0 , NONE); - well_history->wconhist_state = wconhist_state_alloc( time ); - well_history->wconinje_state = wconinje_state_alloc( well_name , time ); - well_history->wconinjh_state = wconinjh_state_alloc( time ); - well_history->active_state = size_t_vector_alloc(0 , 0); - well_history->parent = size_t_vector_alloc(0 , 0); - well_history->well_open = bool_vector_alloc( 0 , false ); - return well_history; - } - - - -void well_history_set_parent( well_history_type * child_well , int report_step , const group_history_type * parent_group) { - size_t_vector_iset_default( child_well->parent , report_step , ( size_t ) parent_group); -} - -group_history_type * well_history_get_parent( well_history_type * child_well , int report_step ) { - return (group_history_type *) size_t_vector_safe_iget( child_well->parent , report_step ); -} - -void well_history_free( well_history_type * well_history ) { - free( well_history->well_name ); - int_vector_free( well_history->kw_type ); - wconhist_state_free( well_history->wconhist_state ); - wconinjh_state_free( well_history->wconinjh_state ); - wconinje_state_free( well_history->wconinje_state ); - size_t_vector_free( well_history->active_state ); - bool_vector_free( well_history->well_open ); - size_t_vector_free( well_history->parent ); - free( well_history ); -} - - -void well_history_free__( void * arg ) { - well_history_free( well_history_safe_cast( arg )); -} - - - - /*****************************************************************/ - - - - void well_history_add_keyword( well_history_type * well_history, const sched_kw_type * sched_kw , int report_step ) { - sched_kw_type_enum new_type = sched_kw_get_type( sched_kw ); - sched_kw_type_enum current_type = int_vector_safe_iget( well_history->kw_type , report_step ); - - if ((new_type != current_type) && (current_type != NONE)) { - /* - The well is changing type and we must "close" the current - status first. - */ - switch( current_type ) { - case( WCONHIST ): - sched_kw_wconhist_close_state( well_history->wconhist_state , report_step ); - break; - case( WCONINJH): - sched_kw_wconinjh_close_state( well_history->wconinjh_state , report_step ); - break; - case( WCONINJE): - sched_kw_wconinje_close_state( well_history->wconinje_state , report_step ); - break; - default: - break; - } - } - - int_vector_iset_default( well_history->kw_type , report_step , new_type ); - switch( new_type ) { - case(WCONHIST): - size_t_vector_iset_default( well_history->active_state , report_step , ( long ) well_history->wconhist_state ); - bool_vector_iset_default( well_history->well_open , report_step , sched_kw_wconhist_well_open( sched_kw_get_const_data( sched_kw ) , well_history->well_name )); - sched_kw_wconhist_update_state(sched_kw_get_const_data( sched_kw ) , well_history->wconhist_state , well_history->well_name , report_step ); - break; - case(WCONINJH): - size_t_vector_iset_default( well_history->active_state , report_step , ( long ) well_history->wconinjh_state ); - sched_kw_wconinjh_update_state(sched_kw_get_const_data( sched_kw ) , well_history->wconinjh_state , well_history->well_name , report_step ); - break; - case(WCONINJE): - size_t_vector_iset_default( well_history->active_state , report_step , ( long ) well_history->wconinje_state ); - bool_vector_iset_default( well_history->well_open , report_step , sched_kw_wconinje_well_open( sched_kw_get_const_data( sched_kw ) , well_history->well_name )); - sched_kw_wconinje_update_state(sched_kw_get_const_data( sched_kw ) , well_history->wconinje_state , well_history->well_name , report_step ); - break; - default: - break; - // Nothing wrong with this (I think) ?? - } - } - -/*****************************************************************/ - -wconhist_state_type * well_history_get_wconhist( well_history_type * well_history ) { - return well_history->wconhist_state; -} - -/*****************************************************************/ - - -sched_kw_type_enum well_history_iget_active_kw( const well_history_type * well_history , int report_step ) { - return int_vector_safe_iget( well_history->kw_type , report_step ); -} - - -const void * well_history_get_state_ptr( const well_history_type * well_history , sched_kw_type_enum kw_type ) { - switch( kw_type ) { - case(WCONHIST): - return well_history->wconhist_state; - break; - case(WCONINJH): - return well_history->wconinjh_state; - break; - case(WCONINJE): - return well_history->wconinje_state; - break; - default: - util_abort("%s: non-handled enum value \n",__func__); - return NULL; - } -} - - -const char * well_history_get_name( const well_history_type * well_history ) { - return well_history->well_name; -} - - -bool well_history_well_open( const well_history_type * well_history , int report_step ) { - return bool_vector_safe_iget( well_history->well_open , report_step ); -} - - - - - -double well_history_iget( well_index_type * index , int report_step ) { - const well_history_type * well_history = well_history_safe_cast_const( well_index_get_state( index )); - sched_kw_type_enum current_type = int_vector_safe_iget( well_history->kw_type , report_step ); - sched_history_callback_ftype * func = well_index_get_callback( index , current_type ); - - if (func != NULL) { - void * state_ptr = (void *) size_t_vector_safe_iget( well_history->active_state , report_step ); - return func( state_ptr , report_step ); - } else - return 0; /* Quite polite - just returning 0 for funny requests. */ -} - - - - -double well_history_iget_WOPRH( const well_history_type * well_history , int report_step ) { - sched_kw_type_enum current_type = int_vector_safe_iget( well_history->kw_type , report_step ); - if (current_type == WCONHIST) { - void * state_ptr = (void *) size_t_vector_safe_iget( well_history->active_state , report_step ); - return wconhist_state_iget_WOPRH( state_ptr , report_step ); - } else - return 0; /* If it is not in WCONHIST state we return 0 with no further ado. */ -} - - -double well_history_iget_WWPRH( const well_history_type * well_history , int report_step ) { - sched_kw_type_enum current_type = int_vector_safe_iget( well_history->kw_type , report_step ); - if (current_type == WCONHIST) { - void * state_ptr = (void *) size_t_vector_safe_iget( well_history->active_state , report_step ); - return wconhist_state_iget_WWPRH( state_ptr , report_step ); - } else - return 0; /* If it is not in WCONHIST state we return 0 with no further ado. */ -} - - -double well_history_iget_WGPRH( const well_history_type * well_history , int report_step ) { - sched_kw_type_enum current_type = int_vector_safe_iget( well_history->kw_type , report_step ); - if (current_type == WCONHIST) { - void * state_ptr = (void *) size_t_vector_safe_iget( well_history->active_state , report_step ); - return wconhist_state_iget_WGPRH( state_ptr , report_step ); - } else - return 0; /* If it is not in WCONHIST state we return 0 with no further ado. */ -} - - -bool well_history_is_producer( const well_history_type * well_history , int report_step ) { - bool producer = false; - sched_kw_type_enum current_type = int_vector_safe_iget( well_history->kw_type , report_step ); - switch( current_type ) { - case( WCONHIST ): - producer = true; - break; - case( WCONINJE) : - producer = false; - break; - case( WCONINJH ): - producer = false; - break; - default: - util_abort("%s: --- \n",__func__); - } - return producer; -} diff --git a/ThirdParty/Ert/libsched/src/well_index.c b/ThirdParty/Ert/libsched/src/well_index.c deleted file mode 100644 index d7d35a54e5..0000000000 --- a/ThirdParty/Ert/libsched/src/well_index.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - Copyright (C) 2011 Statoil ASA, Norway. - - The file 'well_index.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -#include -#include -#include - -#include -#include - - -#define WELL_INDEX_TYPE_ID 99780634 - -struct well_index_struct { - UTIL_TYPE_ID_DECLARATION; - const void * state_ptr; - char * well_name; - char * variable; /* Because many variables can be accessed both as eg WOPRH and WOPR the - variable might not match the name used when looking up this index. The - variable field should always contain the true historical (i.e. xxxxH) - variable, as that is the most correct way to access the values of the - schedule file. */ - int_vector_type * kw_type; - size_t_vector_type * func; -}; - - - - - -UTIL_IS_INSTANCE_FUNCTION( well_index , WELL_INDEX_TYPE_ID ) -UTIL_SAFE_CAST_FUNCTION_CONST( well_index , WELL_INDEX_TYPE_ID ) - - - -void well_index_add_type( well_index_type * index , sched_kw_type_enum kw_type , sched_history_callback_ftype * func) { - int_vector_append( index->kw_type , kw_type ); - size_t_vector_append( index->func , ( size_t ) func ); -} - - - -well_index_type * well_index_alloc( const char * well_name , const char * variable , const void * state_ptr , sched_kw_type_enum kw_type , sched_history_callback_ftype * func ) { - well_index_type * well_index = util_malloc( sizeof * well_index ); - - UTIL_TYPE_ID_INIT( well_index , WELL_INDEX_TYPE_ID ); - - well_index->well_name = util_alloc_string_copy( well_name ); - well_index->variable = util_alloc_string_copy( variable ); - well_index->kw_type = int_vector_alloc( 0 , 0 ); - well_index->func = size_t_vector_alloc( 0 , 0 ); - well_index->state_ptr = state_ptr; - - well_index_add_type( well_index , kw_type , func ); - return well_index; -} - - -void well_index_free( well_index_type * index ) { - size_t_vector_free( index->func ); - int_vector_free( index->kw_type ); - free( index->well_name ); - free( index->variable ); - free( index ); -} - - -void well_index_free__( void * arg ) { - well_index_free( (well_index_type *) arg ); -} - -const char * well_index_get_name( const well_index_type * well_index ) { - return well_index->well_name; -} - -const char * well_index_get_variable( const well_index_type * well_index ) { - return well_index->variable; -} - - - - -sched_history_callback_ftype * well_index_get_callback( const well_index_type * well_index , sched_kw_type_enum kw_type) { - sched_history_callback_ftype * func = NULL; - int iindex = 0; - while (true) { - if (int_vector_iget( well_index->kw_type , iindex) == kw_type) { - func = ( sched_history_callback_ftype *) size_t_vector_iget( well_index->func , iindex ); - break; - } - - - iindex++; - if (iindex == int_vector_size( well_index->kw_type )) - break; - } - - return func; -} - - - -const void * well_index_get_state( const well_index_type * well_index ) { - return well_index->state_ptr; -} - - - -const void * well_index_get_state__( const void * index ) { - const well_index_type * well_index = well_index_safe_cast_const( index ); - return well_index_get_state( well_index ); -} diff --git a/ThirdParty/Ert/libsched/tests/CMakeLists.txt b/ThirdParty/Ert/libsched/tests/CMakeLists.txt deleted file mode 100644 index 24d27ba2e2..0000000000 --- a/ThirdParty/Ert/libsched/tests/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -#add_executable( sched_load sched_load.c ) -#target_link_libraries( sched_load sched test_util ) -#add_test( sched_load ${EXECUTABLE_OUTPUT_PATH}/sched_load ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Heidrun/Schedule.sch ) - -#add_executable( sched_tokenize sched_tokenize.c ) -#target_link_libraries( sched_tokenize sched test_util ) -#add_test( sched_tokenize ${EXECUTABLE_OUTPUT_PATH}/sched_tokenize ${CMAKE_CURRENT_SOURCE_DIR}/test-data/token_test1 ) - -if (STATOIL_TESTDATA_ROOT) - add_executable( sched_history_summary sched_history_summary.c ) - target_link_libraries( sched_history_summary sched test_util ) - add_test( sched_history_summary1 ${EXECUTABLE_OUTPUT_PATH}/sched_history_summary ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Gurbat/ECLIPSE ) - add_test( sched_history_summary2 ${EXECUTABLE_OUTPUT_PATH}/sched_history_summary ${PROJECT_SOURCE_DIR}/test-data/Statoil/ECLIPSE/Snorre/SNORRE ) - - #set_property( TEST sched_load PROPERTY LABELS StatoilData) - set_property( TEST sched_history_summary1 PROPERTY LABELS StatoilData) - set_property( TEST sched_history_summary2 PROPERTY LABELS StatoilData) -endif() diff --git a/ThirdParty/Ert/libsched/tests/sched_history_summary.c b/ThirdParty/Ert/libsched/tests/sched_history_summary.c deleted file mode 100644 index 6f94d38d36..0000000000 --- a/ThirdParty/Ert/libsched/tests/sched_history_summary.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - Copyright (C) 2013 Statoil ASA, Norway. - - The file 'sched_history_summary.c' is part of ERT - Ensemble based Reservoir Tool. - - ERT 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. - - ERT 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 - for more details. -*/ - -#include - -#include - -#include - -#include - - - -int main(int argc, char **argv) { - char * sum_case = argv[1]; - ecl_sum_type * refcase = ecl_sum_fread_alloc_case( sum_case , ":" ); - history_type * hist_h = history_alloc_from_refcase( refcase , true ); - history_type * hist_sim = history_alloc_from_refcase( refcase , false ); - - test_assert_true( history_is_instance( hist_h ) ); - test_assert_true( history_is_instance( hist_sim ) ); - test_assert_int_equal( history_get_last_restart( hist_sim ) , ecl_sum_get_last_report_step( refcase ) ); - test_assert_int_equal( history_get_last_restart( hist_h ) , ecl_sum_get_last_report_step( refcase ) ); - - { - double_vector_type * value_sim = double_vector_alloc(0 , 0); - double_vector_type * value_h = double_vector_alloc(0 , 0); - bool_vector_type * valid_sim = bool_vector_alloc( 0 , false ); - bool_vector_type * valid_h = bool_vector_alloc( 0 , false ); - - test_assert_true( history_init_ts( hist_sim , "FOPT" , value_sim , valid_sim )); - test_assert_true( history_init_ts( hist_h , "FOPT" , value_h , valid_h )); - { - int step; - for (step = 1; step < ecl_sum_get_last_report_step( refcase ); step++) { - test_assert_true( bool_vector_iget( valid_sim , step )); - test_assert_true( bool_vector_iget( valid_h , step )); - { - int time_index = ecl_sum_iget_report_end( refcase , step ); - test_assert_double_equal( ecl_sum_get_general_var( refcase , time_index , "FOPT" ) , double_vector_iget( value_sim , step )); - test_assert_double_equal( ecl_sum_get_general_var( refcase , time_index , "FOPTH" ) , double_vector_iget( value_h , step )); - } - } - } - bool_vector_free( valid_sim ); - bool_vector_free( valid_h ); - - double_vector_free( value_sim ); - double_vector_free( value_h ); - } - - - history_free( hist_h ); - history_free( hist_sim ); - ecl_sum_free( refcase ); - exit(0); -} diff --git a/ThirdParty/Ert/python/CMakeLists.txt b/ThirdParty/Ert/python/CMakeLists.txt index a032f3141c..291b431b70 100644 --- a/ThirdParty/Ert/python/CMakeLists.txt +++ b/ThirdParty/Ert/python/CMakeLists.txt @@ -1,39 +1,21 @@ -include(cmake/find_python_module.cmake) -include(cmake/python_module_versions.cmake) # finds version +install( DIRECTORY cmake DESTINATION share ) -FIND_PACKAGE(PythonInterp 2.7 EXACT) -if (NOT DEFINED PYTHON_EXECUTABLE) - message("Python2.7 interpreter not found - Python wrappers not enabled") - return() -endif() +set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules") +include(init_python) +init_python( 2.7 ) -python_module(numpy 1.7.1) +find_python_package(numpy 1.7.1 ${PYTHON_INSTALL_PREFIX}) if (NOT DEFINED PY_numpy) - message("numpy module not found - Python wrappers not enabled") + message(WARNING "numpy module not found - Python wrappers not enabled") + set( BUILD_PYTHON OFF PARENT_SCOPE ) return() endif() -if (ERT_BUILD_GUI) - python_module(PyQt4 4.8.0) - if(NOT DEFINED PY_PyQt4) - message(SEND_ERROR "Cannot build GUI without PyQt4") - endif() - python_module( matplotlib 1.2.0 ) - python_module( pandas 0.15.1 ) - python_module( scipy 0.16.1 ) -endif() - -if (EXISTS "/etc/debian_version") - set( PYTHON_PACKAGE_PATH "dist-packages") -else() - set( PYTHON_PACKAGE_PATH "site-packages") -endif() -set(PYTHON_INSTALL_PREFIX "lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/${PYTHON_PACKAGE_PATH}" CACHE STRING "Subdirectory to install Python modules in") - - if (BUILD_TESTS) add_subdirectory( tests ) endif() add_subdirectory( python ) + + diff --git a/ThirdParty/Ert/python/README b/ThirdParty/Ert/python/README index 6fd7d377d9..10154c0b78 100644 --- a/ThirdParty/Ert/python/README +++ b/ThirdParty/Ert/python/README @@ -4,4 +4,4 @@ Python. More detailed documentation of the wrapping can be found in -docs/devel.txt. +doc/devel.txt. diff --git a/ThirdParty/Ert/cmake/python.cmake2 b/ThirdParty/Ert/python/cmake/Modules/add_python_package.cmake similarity index 83% rename from ThirdParty/Ert/cmake/python.cmake2 rename to ThirdParty/Ert/python/cmake/Modules/add_python_package.cmake index 740fe86618..9d1527d309 100644 --- a/ThirdParty/Ert/cmake/python.cmake2 +++ b/ThirdParty/Ert/python/cmake/Modules/add_python_package.cmake @@ -1,6 +1,3 @@ -if (NOT PYTHONINTERP_FOUND) - find_package (PythonInterp REQUIRED) -endif () function(add_python_package target package_path source_files install_package) set(build_files "") @@ -27,14 +24,14 @@ function(add_python_package target package_path source_files install_package) add_custom_command( OUTPUT ${build_file} COMMAND ${PYTHON_EXECUTABLE} - ARGS ${PROJECT_SOURCE_DIR}/cmake/cmake_pyc2 ${source_file} ${build_file} + ARGS ${PROJECT_BINARY_DIR}/bin/cmake_pyc ${source_file} ${build_file} ${dependent_target}) list(APPEND build_files ${build_file} ) if (install_package) install(FILES ${build_file} DESTINATION ${CMAKE_INSTALL_PREFIX}/${package_path}) - install(CODE "execute_process(COMMAND ${PROJECT_SOURCE_DIR}/cmake/cmake_pyc_file ${install_file})") + install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/bin/cmake_pyc_file ${install_file})") endif() endforeach() diff --git a/ThirdParty/Ert/python/cmake/Modules/add_python_test.cmake b/ThirdParty/Ert/python/cmake/Modules/add_python_test.cmake new file mode 100644 index 0000000000..26583c5090 --- /dev/null +++ b/ThirdParty/Ert/python/cmake/Modules/add_python_test.cmake @@ -0,0 +1,38 @@ +# This macro will create a ctest based on the supplied TEST_CLASS. The +# TEST_CLASS argument should correspond to a valid Python path, i.e. +# +# >> import ${TEST_CLASS} +# +# should work. The actual test is by running a small test script which +# will invoke normal Python test discovery functionality. This is a +# macro, and relevant variables must be crrectly set in calling scope +# before it is invoked: +# +# PYTHON_TEST_RUNNER: Path to executable which will load the testcase +# given by ${TEST_CLASS} and run it. +# +# +# CTEST_PYTHONPATH: Normal colon separated path variable, should at +# least include the binary root directory of the current python +# installation, but can in addition contain the path to +# additional packages. The PYTHON_TEST_RUNNER should inspect the +# $CTEST_PYTHONPATH environment variable and update sys.path +# accordingly. + +macro( addPythonTest TEST_CLASS ) + set(TEST_NAME ${TEST_CLASS}) + + add_test(NAME ${TEST_NAME} + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX}" + COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/bin/ctest_run_python ${TEST_CLASS} ) + + set(oneValueArgs LABELS) + cmake_parse_arguments(TEST_OPTIONS "" "${oneValueArgs}" "" ${ARGN}) + if(TEST_OPTIONS_LABELS) + set_property(TEST ${TEST_NAME} PROPERTY LABELS "Python:${TEST_OPTIONS_LABELS}") + else() + set_property(TEST ${TEST_NAME} PROPERTY LABELS "Python") + endif() + + set_property(TEST ${TEST_NAME} PROPERTY ENVIRONMENT "CTEST_PYTHONPATH=${CTEST_PYTHONPATH}") +endmacro( ) diff --git a/ThirdParty/Ert/python/cmake/Modules/find_python_package.cmake b/ThirdParty/Ert/python/cmake/Modules/find_python_package.cmake new file mode 100644 index 0000000000..9cfd68f6aa --- /dev/null +++ b/ThirdParty/Ert/python/cmake/Modules/find_python_package.cmake @@ -0,0 +1,63 @@ +# try import python module, if success, check its version, store as PY_module. +# the module is imported as-is, hence the case (e.g. PyQt4) must be correct. +function(find_python_package_version package) + set(PY_VERSION_ACCESSOR "__version__") + set(PY_package_name ${package}) + + if(${package} MATCHES "PyQt4") + set(PY_package_name "PyQt4.Qt") + set(PY_VERSION_ACCESSOR "PYQT_VERSION_STR") + endif() + + execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" "import os.path; import inspect; import ${PY_package_name} as py_m; print(\"%s;%s\" % (py_m.${PY_VERSION_ACCESSOR} , os.path.dirname(os.path.dirname(inspect.getfile(py_m)))))" + RESULT_VARIABLE _${package}_fail# error code 0 if success + OUTPUT_VARIABLE stdout_output # major.minor.patch + ERROR_VARIABLE stderr_output + OUTPUT_STRIP_TRAILING_WHITESPACE) + + if(NOT _${package}_fail) + list(GET stdout_output 0 version) + set(PY_${package} ${version}) # local scope, for message + set(PY_${package} ${version} PARENT_SCOPE) + + list(GET stdout_output 1 path) + set(PY_${package}_PATH ${path}) # local scope, for message + set(PY_${package}_PATH ${path} PARENT_SCOPE) + endif() +endfunction() + + +# If we find the correct module and new enough version, set PY_package, where +# "package" is the given argument to the version we found else, display warning +# and do not set any variables. +function(find_python_package package version python_prefix) + + if (CMAKE_PREFIX_PATH) + set( ORG_PYTHONPATH $ENV{PYTHONPATH} ) + foreach ( PREFIX_PATH ${CMAKE_PREFIX_PATH} ) + set(THIS_PYTHONPATH "${PREFIX_PATH}/${python_prefix}") + set(ENV{PYTHONPATH} "${THIS_PYTHONPATH}:${ORG_PYTHONPATH}") + find_python_package_version(${package}) + if (DEFINED PY_${package}) + if (${PY_${package}_PATH} STREQUAL ${THIS_PYTHONPATH}) + set(CTEST_PYTHONPATH "${PY_${package}_PATH}:${CTEST_PYTHONPATH}" PARENT_SCOPE) + endif() + break( ) + endif() + endforeach() + set(ENV{PYTHONPATH} ${ORG_PYTHONPATH}) + else() + find_python_package_version(${package}) + endif() + + if(NOT DEFINED PY_${package}) + message("Could not find Python package " ${package}) + elseif(${PY_${package}} VERSION_LESS ${version}) + message(WARNING "Python package ${package} too old. " + "Wanted ${version}, found ${PY_${package}}") + else() + message(STATUS "Found ${package}. ${PY_${package}} >= ${version} in ${PY_${package}_PATH}") + set(PY_${package} ${version} PARENT_SCOPE) + set(PY_${package}_PATH ${PY_${package}_PATH} PARENT_SCOPE) + endif() +endfunction() diff --git a/ThirdParty/Ert/python/cmake/Modules/init_python.cmake b/ThirdParty/Ert/python/cmake/Modules/init_python.cmake new file mode 100644 index 0000000000..414879259c --- /dev/null +++ b/ThirdParty/Ert/python/cmake/Modules/init_python.cmake @@ -0,0 +1,175 @@ +# This macro will initialize the current cmake session for Python. The +# macro starts by looking for the Python interpreter of correct +# version. When a Python interepreter of the correct version has been +# located the macro will continue to set variables, load other cmake +# modules and generate scripts to be used in the remaining part of the +# cmake process. +# +# Variables which will be set: +# ---------------------------- +# +# PYTHON_INSTALL_PREFIX: All python packages will be located in +# ${GLOBAL_PREFIX}/${PYTHON_INSTALL_PREFIX} - this applies both +# when searching for dependencies and when installing. +# +# CTEST_PYTHONPATH: Normal ':' separated path variables which is +# passed to the test runner. Should contain the PYTHONPATH to +# all third party packages which are not in the default search +# path. The CTEST_PYTHONPATH variable will be updated by the +# python_package( ) function when searching for third party +# packages. +# +# +# New functions/macros which will be available: +# --------------------------------------------- +# +# add_python_package( ): This function will copy python source files +# to the build directory, 'compile' them and set up installation. +# +# +# add_python_test( ): Set up a test based on invoking a Python test +# class with a small python executable front end. +# +# find_python_package( ): Will search for a python package. +# +# +# New scripts generated: +# ---------------------- +# +# +# cmake_pyc: Small script which will run in-place Python compilation +# of a directory tree recursively. +# +# cmake_pyc_file: Small script which will compile one python file. +# +# ctest_run_python: Small script which will invoke one Python test class. +# +# All the generated scripts will be located in ${PROJECT_BINARY_DIR}/bin. +# +# +# Downstream projects should use this as: +# +# include( init_python ) +# init_python( 2.7 ) +# ... + +macro(init_python target_version) + + FIND_PACKAGE(PythonInterp) + if (NOT DEFINED PYTHON_EXECUTABLE) + message(WARNING "Python interpreter not found - Python wrappers not enabled") + set( BUILD_PYTHON OFF PARENT_SCOPE ) + return() + endif() + + if (NOT "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" STREQUAL "${target_version}") + message(WARNING "Need Python version ${target_version}, found version: ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} - Python wrappers not enabled") + set( BUILD_PYTHON OFF PARENT_SCOPE ) + return() + endif() + + if (EXISTS "/etc/debian_version") + set( PYTHON_PACKAGE_PATH "dist-packages") + else() + set( PYTHON_PACKAGE_PATH "site-packages") + endif() + + set(PYTHON_INSTALL_PREFIX "lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/${PYTHON_PACKAGE_PATH}" CACHE STRING "Subdirectory to install Python modules in") + set(CTEST_PYTHONPATH ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX}) + configure_python_env( ) + include(add_python_test) + include(find_python_package) + include(add_python_package) +endmacro() + + + +# The function configure_python_env( ) will generate three small +# Python scripts which will be located in ${PROJECT_BINARY_DIR}/bin +# and will be used when 'compiling' and testing Python code. The +# function will be called from the init_python() macro. + +function( configure_python_env ) + +FILE(WRITE "${PROJECT_BINARY_DIR}/bin/ctest_run_python" +"import sys +import os +from unittest import TextTestRunner + + +def runTestCase(tests, verbosity=0): + test_result = TextTestRunner(verbosity=verbosity).run(tests) + + if len(test_result.errors) or len(test_result.failures): + test_result.printErrors() + sys.exit(1) + + +def update_path(): + for path in os.environ['CTEST_PYTHONPATH'].split(':'): + sys.path.insert(0 , path) + + +if __name__ == '__main__': + update_path( ) + from ecl.test import ErtTestRunner + + for test_class in sys.argv[1:]: + tests = ErtTestRunner.getTestsFromTestClass(test_class) + + # Set verbosity to 2 to see which test method in a class that fails. + runTestCase(tests, verbosity=0) +") + +#----------------------------------------------------------------- + +FILE(WRITE "${PROJECT_BINARY_DIR}/bin/cmake_pyc" +" +import py_compile +import os +import os.path +import sys +import shutil + + +src_file = sys.argv[1] +target_file = sys.argv[2] + +(target_path , tail) = os.path.split( target_file ) +if not os.path.exists( target_path ): + try: + os.makedirs( target_path ) + except: + # When running make with multiple processes there might be a + # race to create this directory. + pass + +shutil.copyfile( src_file , target_file ) +shutil.copystat( src_file , target_file ) +try: + py_compile.compile( target_file , doraise = True) +except Exception as error: + sys.exit('py_compile(%s) failed:%s' % (target_file , error)) +") + +#----------------------------------------------------------------- + +FILE(WRITE "${PROJECT_BINARY_DIR}/bin/cmake_pyc_file" +" +import py_compile +import os +import sys +import os.path + +# Small 'python compiler' used in the build system for ert. + +for file in sys.argv[1:]: + try: + py_compile.compile( file , doraise = True ) + except Exception as error: + sys.exit('py_compile(%s) failed:%s' % (file , error)) +") + + + +endfunction() \ No newline at end of file diff --git a/ThirdParty/Ert/python/cmake/find_python_module.cmake b/ThirdParty/Ert/python/cmake/find_python_module.cmake deleted file mode 100644 index a0218650b3..0000000000 --- a/ThirdParty/Ert/python/cmake/find_python_module.cmake +++ /dev/null @@ -1,27 +0,0 @@ -# Found from: github user ivansafrin -# -# Find if a Python module is installed -# Found at http://www.cmake.org/pipermail/cmake/2011-January/041666.html -# To use do: find_python_module(PyQt4 REQUIRED) -function(find_python_module module) - string(TOUPPER ${module} module_upper) - if(NOT PY_${module_upper}) - if(ARGC GREATER 1 AND ARGV1 STREQUAL "REQUIRED") - set(${module}_FIND_REQUIRED TRUE) - endif() - # A module's location is usually a directory, but for binary modules - # it's a .so file. - execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" - "import re, ${module}; print(re.compile('/__init__.py.*').sub('',${module}.__file__))" - RESULT_VARIABLE _${module}_status - OUTPUT_VARIABLE _${module}_location - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) - - if(NOT _${module}_status) - set(PY_${module_upper} ${_${module}_location} CACHE STRING - "Location of Python module ${module}") - endif() - endif(NOT PY_${module_upper}) - find_package_handle_standard_args(PY_${module} DEFAULT_MSG PY_${module_upper}) -endfunction(find_python_module) diff --git a/ThirdParty/Ert/python/cmake/python_module_versions.cmake b/ThirdParty/Ert/python/cmake/python_module_versions.cmake deleted file mode 100644 index e34f9f8407..0000000000 --- a/ThirdParty/Ert/python/cmake/python_module_versions.cmake +++ /dev/null @@ -1,40 +0,0 @@ -# try import python module, if success, check its version, store as PY_module. -# the module is imported as-is, hence the case (e.g. PyQt4) must be correct. -function(python_module_version module) - set(PY_VERSION_ACCESSOR "__version__") - set(PY_module_name ${module}) - - if(${module} MATCHES "PyQt4") - set(PY_module_name "PyQt4.Qt") - set(PY_VERSION_ACCESSOR "PYQT_VERSION_STR") - endif() - - execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" "import ${PY_module_name} as py_m; print(py_m.${PY_VERSION_ACCESSOR})" - RESULT_VARIABLE _${module}_fail# error code 0 if success - OUTPUT_VARIABLE _${module}_version# major.minor.patch - ERROR_VARIABLE stderr_output - OUTPUT_STRIP_TRAILING_WHITESPACE) - - if(NOT _${module}_fail) - set(PY_${module} ${_${module}_version})# local scope, for message - set(PY_${module} ${_${module}_version} PARENT_SCOPE) - endif() -endfunction() - - -# If we find the correct module and new enough version, set PY_package, where -# "package" is the given argument to the version we found else, display warning -# and do not set any variables. -function(python_module package version) - python_module_version(${package}) - - if(NOT DEFINED PY_${package}) - message("Could not find Python module " ${package}) - elseif(${PY_${package}} VERSION_LESS ${version}) - message(WARNING "Python module ${package} too old. " - "Wanted ${version}, found ${PY_${package}}") - else() - message(STATUS "Found ${package}. ${PY_${package}} >= ${version}") - set(PY_${package} ${version} PARENT_SCOPE) - endif() -endfunction() diff --git a/ThirdParty/Ert/python/python/CMakeLists.txt b/ThirdParty/Ert/python/python/CMakeLists.txt index bf7bce2091..c6d592545b 100644 --- a/ThirdParty/Ert/python/python/CMakeLists.txt +++ b/ThirdParty/Ert/python/python/CMakeLists.txt @@ -1,8 +1,5 @@ +configure_file(test_env.py.in ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX}/test_env.py ) + add_subdirectory(cwrap) -add_subdirectory( ert ) -if (BUILD_ERT) - if (ERT_BUILD_GUI) - add_subdirectory( ert_gui ) - endif() -endif() +add_subdirectory( ecl ) add_subdirectory( bin ) diff --git a/ThirdParty/Ert/python/python/bin/CMakeLists.txt b/ThirdParty/Ert/python/python/bin/CMakeLists.txt new file mode 100644 index 0000000000..0410f2a073 --- /dev/null +++ b/ThirdParty/Ert/python/python/bin/CMakeLists.txt @@ -0,0 +1,24 @@ +if (BUILD_ERT) + set(application_list + ert_tcp_server + ertshell + ert_upgrade_fs107 + ) + foreach(prog ${application_list} ) + file(COPY ${prog} DESTINATION ${EXECUTABLE_OUTPUT_PATH}) + endforeach() +endif() + + + +if (INSTALL_ERT) + set (destination ${CMAKE_INSTALL_PREFIX}/bin) + foreach(prog ${application_list} ) + install(PROGRAMS ${prog} DESTINATION ${destination}) + if (INSTALL_GROUP) + install(CODE "EXECUTE_PROCESS(COMMAND chgrp ${INSTALL_GROUP} ${destination}/${prog})") + install(CODE "EXECUTE_PROCESS(COMMAND chmod g+w ${destination}/${prog})") + endif() + endforeach() +endif() + diff --git a/ThirdParty/Ert/python/python/bin/ert_tcp_server b/ThirdParty/Ert/python/python/bin/ert_tcp_server new file mode 100644 index 0000000000..caa75d9da7 --- /dev/null +++ b/ThirdParty/Ert/python/python/bin/ert_tcp_server @@ -0,0 +1,53 @@ +#!/usr/bin/env python +import argparse +import socket +import sys + +from ert.server.ertrpcserver import ErtRPCServer + +default_port = 0 + +parser = argparse.ArgumentParser() + +parser.add_argument("--port", type=int, default=default_port, dest="port") +parser.add_argument("--host", default=socket.gethostname(), dest="host") +parser.add_argument("--localhost", default=False, action="store_true", dest="localhost") +parser.add_argument("--log-file", default="ert-server.log", dest="log_file") +parser.add_argument("--log-level", type=int, default=1, dest="log_level") +parser.add_argument("config_file") + +args = parser.parse_args() + +config_file = args.config_file +port = args.port +log_level = args.log_level + + +# By default the server will bind with the publicly available hostname +# socket.gethostname() - meaning that clients can connect from +# anywhere, but by using the --localhost switch the server can be +# instructed to only accept connections from localhost. +# +# On some computers the socket.gethostname() will not include the +# domain name; that will not work and we exit the server and ask the +# user to supply the full hostname using --host. + +if args.localhost: + host = "localhost" +else: + host = args.host + if host.count(".") == 0: + sys.exit("Sorry - could not determine FQDN for server - use the --host option to supply.") + +server = ErtRPCServer(config_file, host, port, log_requests=log_level > 1, verbose_queue=True) + +try: + print("ERT Server running on port: %d at host: %s" % (server.port, host)) + server.start() +except KeyboardInterrupt: + try: + server.stop() + print("ERT Server 'smoothly' killed the running jobs") + except Exception as e: + print("Unable to stop server 'gracefully'!") + raise e diff --git a/ThirdParty/Ert/python/python/bin/ert_upgrade_fs107 b/ThirdParty/Ert/python/python/bin/ert_upgrade_fs107 new file mode 100644 index 0000000000..4374b5dcfc --- /dev/null +++ b/ThirdParty/Ert/python/python/bin/ert_upgrade_fs107 @@ -0,0 +1,76 @@ +#!/usr/bin/env python +import sys +import os +import os.path + +from ert.config import ConfigParser, ContentTypeEnum, UnrecognizedEnum +from ert.enkf import TimeMap,EnkfFs +from ert.ecl import EclSum + +#TimeMap._upgrade107 = + + +def parse(config_file): + parser = ConfigParser( ) + item = parser.add("REFCASE", False ) + item.iset_type(0 , ContentTypeEnum.CONFIG_PATH ) + + item = parser.add("ENSPATH" , False ) + item.iset_type(0 , ContentTypeEnum.CONFIG_EXISTING_PATH ) + + content = parser.parse( config_file , unrecognized = UnrecognizedEnum.CONFIG_UNRECOGNIZED_IGNORE ) + if "REFCASE" in content: + refcase = EclSum( content.getValue( "REFCASE" )) + else: + refcase = None + + if "ENSPATH" in content: + path = content["ENSPATH"] + enspath = path[0].getPath( ) + else: + enspath = "storage" + + + return enspath , refcase + + +def upgrade(ens_path, refcase): + for case in os.listdir( ens_path ): + full_case = os.path.join( ens_path , case ) + if os.path.isdir( full_case ): + version = EnkfFs.diskVersion( full_case ) + try: + version = EnkfFs.diskVersion( full_case ) + except IOError: + print "The case:%s was ignored" % full_case + continue + + if version < 105: + print "Very old case: %s ignored - you should probably delete this" % full_case + continue + + if version < 107: + print "Upgrading %s to version 107" % full_case + + time_map_file = os.path.join( full_case , "files/time-map") + if os.path.isfile( time_map_file ): + time_map = TimeMap( time_map_file) + assert( isinstance( refcase , EclSum )) + time_map.upgrade107( refcase ) + time_map.fwrite( time_map_file ) + else: + print "No time-map file found" + + EnkfFs.updateVersion( full_case, version , 107 ) + fs = EnkfFs( full_case ) + + +if len(sys.argv) != 2: + sys.exit("Script must have exactly one argument: config_file") + +config_file = sys.argv[1] +ens_path , refcase = parse( config_file ) +if refcase: + print "Upgrading storage:%s with refcase:%s" % (ens_path , refcase.case ) +upgrade( ens_path , refcase ) + diff --git a/ThirdParty/Ert/python/python/bin/ertshell b/ThirdParty/Ert/python/python/bin/ertshell new file mode 100644 index 0000000000..e8d53e0a63 --- /dev/null +++ b/ThirdParty/Ert/python/python/bin/ertshell @@ -0,0 +1,35 @@ +#!/usr/bin/env python +import os +from PyQt4.QtGui import QApplication +import sys + +import ert_gui +from ert_gui.ertwidgets import resourceIcon +from ert_gui.shell import ErtShell +from ert_gui.tools import HelpCenter + + +if __name__ == '__main__': + if os.getenv("ERT_SHARE_PATH"): + ert_share_path = os.getenv("ERT_SHARE_PATH") + else: + ert_share_path = os.path.realpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../../share")) + + ert_gui.ertwidgets.img_prefix = ert_share_path + "/gui/img/" + + help_center = HelpCenter("ERT") + help_center.setHelpLinkPrefix(os.getenv("ERT_SHARE_PATH") + "/gui/help/") + + + app = QApplication(sys.argv) + app.setWindowIcon(resourceIcon("application/window_icon_cutout")) + + ert_shell = ErtShell() + if len(sys.argv) > 1: + ert_shell.onecmd('load_config %s' % sys.argv[1]) + + if len(sys.argv) > 2: + for workflow in sys.argv[2:]: + ert_shell.onecmd('workflows run %s' % workflow) + + ert_shell.cmdloop() \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/cwrap/basecclass.py b/ThirdParty/Ert/python/python/cwrap/basecclass.py index 3f7e008fb0..306a8375bd 100644 --- a/ThirdParty/Ert/python/python/cwrap/basecclass.py +++ b/ThirdParty/Ert/python/python/cwrap/basecclass.py @@ -14,16 +14,20 @@ # See the GNU General Public License at # for more details. +from __future__ import (absolute_import, division, + print_function, unicode_literals) + +import six + import ctypes from .metacwrap import MetaCWrap +@six.add_metaclass(MetaCWrap) class BaseCClass(object): - __metaclass__ = MetaCWrap - namespaces = {} def __init__(self, c_pointer, parent=None, is_reference=False): - if c_pointer == 0 or c_pointer is None: + if not c_pointer: raise ValueError("Must have a valid (not null) pointer value!") if c_pointer < 0: @@ -47,13 +51,6 @@ class BaseCClass(object): def _ad_str(self): return 'at 0x%x' % self._address() - @classmethod - def cNamespace(cls): - """ @rtype: CNamespace """ - if cls not in BaseCClass.namespaces: - BaseCClass.namespaces[cls] = CNamespace(cls.__name__) - return BaseCClass.namespaces[cls] - @classmethod def from_param(cls, c_class_object): if c_class_object is not None and not isinstance(c_class_object, BaseCClass): @@ -136,7 +133,7 @@ class BaseCClass(object): if not self.__is_reference: # Important to check the c_pointer; in the case of failed object creation # we can have a Python object with c_pointer == None. - if self.__c_pointer > 0: + if self.__c_pointer: self.free() def _invalidateCPointer(self): diff --git a/ThirdParty/Ert/python/python/cwrap/basecenum.py b/ThirdParty/Ert/python/python/cwrap/basecenum.py index df4ff8b1df..b86e1b0d64 100644 --- a/ThirdParty/Ert/python/python/cwrap/basecenum.py +++ b/ThirdParty/Ert/python/python/cwrap/basecenum.py @@ -14,12 +14,15 @@ # See the GNU General Public License at # for more details. +from __future__ import absolute_import, division, print_function, unicode_literals + +import six + import ctypes from .metacwrap import MetaCWrap - +@six.add_metaclass(MetaCWrap) class BaseCEnum(object): - __metaclass__ = MetaCWrap enum_namespace = {} def __init__(self, *args, **kwargs): @@ -48,6 +51,7 @@ class BaseCEnum(object): @classmethod def addEnum(cls, name, value): + name = str(name) if not isinstance(value, int): raise ValueError("Value must be an integer!") diff --git a/ThirdParty/Ert/python/python/cwrap/basecvalue.py b/ThirdParty/Ert/python/python/cwrap/basecvalue.py index f5711c5a63..2c9f582792 100644 --- a/ThirdParty/Ert/python/python/cwrap/basecvalue.py +++ b/ThirdParty/Ert/python/python/cwrap/basecvalue.py @@ -14,13 +14,18 @@ # See the GNU General Public License at # for more details. -from ctypes import pointer, c_long, c_int, c_bool, c_float, c_double, c_byte, \ - c_short, c_char, c_ubyte, c_ushort, c_uint, c_ulong +from __future__ import (absolute_import, division, + print_function, unicode_literals) + +import six + +from ctypes import (pointer, c_long, c_int, c_bool, c_float, c_double, c_byte, + c_short, c_char, c_ubyte, c_ushort, c_uint, c_ulong) from .metacwrap import MetaCWrap +@six.add_metaclass(MetaCWrap) class BaseCValue(object): - __metaclass__ = MetaCWrap DATA_TYPE = None LEGAL_TYPES = [c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, c_long, c_ulong, c_bool, c_char, c_float, c_double] diff --git a/ThirdParty/Ert/python/python/cwrap/cfile.py b/ThirdParty/Ert/python/python/cwrap/cfile.py index 69344bd165..4b46d420f9 100644 --- a/ThirdParty/Ert/python/python/cwrap/cfile.py +++ b/ThirdParty/Ert/python/python/cwrap/cfile.py @@ -15,7 +15,8 @@ # for more details. import ctypes -from .prototype import Prototype +import six +from .prototype import Prototype, PrototypeError from .basecclass import BaseCClass class CFILE(BaseCClass): @@ -54,7 +55,7 @@ class CFILE(BaseCClass): If the supplied argument is not of type py_file the function will raise a TypeException. - Examples: ert.ecl.ecl_kw.EclKW.fprintf_grdecl() + Examples: ecl.ecl.ecl_kw.EclKW.fprintf_grdecl() """ c_ptr = self._as_file(py_file) try: diff --git a/ThirdParty/Ert/python/python/cwrap/clib.py b/ThirdParty/Ert/python/python/cwrap/clib.py index c1a1fb71e5..2c24cb43fb 100644 --- a/ThirdParty/Ert/python/python/cwrap/clib.py +++ b/ThirdParty/Ert/python/python/cwrap/clib.py @@ -17,13 +17,13 @@ Observe that to ensure that all libraries are loaded through the same code path, all required libraries should be loaded explicitly through -the use of import statements; i.e. the ert.geo package requires the +the use of import statements; i.e. the ecl.geo package requires the libert_util librarary, to ensure that the correct version of the libert_util.so library file is loaded we should manually load that first as: - import ert.util - GEO_LIB = ert.load("libert_geometry") + import ecl.util + GEO_LIB = ecl.load("libert_geometry") Otherwise the standard operating system dependency resolve code will be invoked when loading libert_geometry, and that could in principle diff --git a/ThirdParty/Ert/python/python/cwrap/metacwrap.py b/ThirdParty/Ert/python/python/cwrap/metacwrap.py index 21ece69391..52ccb970ce 100644 --- a/ThirdParty/Ert/python/python/cwrap/metacwrap.py +++ b/ThirdParty/Ert/python/python/cwrap/metacwrap.py @@ -14,6 +14,10 @@ # See the GNU General Public License at # for more details. +from __future__ import (absolute_import, division, + print_function, unicode_literals) +import six + import re from types import MethodType @@ -59,4 +63,5 @@ class MetaCWrap(type): if attr.shouldBeBound(): method = MethodType(attr, None, cls) + #method = six.create_bound_method(attr, cls) setattr(cls, key, method) diff --git a/ThirdParty/Ert/python/python/ecl/CMakeLists.txt b/ThirdParty/Ert/python/python/ecl/CMakeLists.txt new file mode 100644 index 0000000000..3ba6f862bc --- /dev/null +++ b/ThirdParty/Ert/python/python/ecl/CMakeLists.txt @@ -0,0 +1,14 @@ +set(PYTHON_SOURCES + __init__.py +) +add_python_package("python.ecl" ${PYTHON_INSTALL_PREFIX}/ecl "${PYTHON_SOURCES}" True) + +add_subdirectory(ecl) +add_subdirectory(geo) +add_subdirectory(test) +add_subdirectory(util) +add_subdirectory(well) + +configure_file(ecl_lib_info_build.py.in ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX}/ecl/__ecl_lib_info.py ) +configure_file(ecl_lib_info_install.py.in ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX}/ecl_lib_info_install.py ) +install(FILES ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX}/ecl_lib_info_install.py DESTINATION ${PYTHON_INSTALL_PREFIX}/ecl RENAME __ecl_lib_info.py) diff --git a/ThirdParty/Ert/python/python/ert/__init__.py b/ThirdParty/Ert/python/python/ecl/__init__.py similarity index 83% rename from ThirdParty/Ert/python/python/ert/__init__.py rename to ThirdParty/Ert/python/python/ecl/__init__.py index 737a77b205..c5496bbb79 100644 --- a/ThirdParty/Ert/python/python/ert/__init__.py +++ b/ThirdParty/Ert/python/python/ecl/__init__.py @@ -18,12 +18,10 @@ ert - Ensemble Reservoir Tool - a package for reservoir modeling. The ert package itself has no code, but contains several subpackages: -ert.ecl: Package for working with ECLIPSE files. The far most mature +ecl.ecl: Package for working with ECLIPSE files. The far most mature package in ert. -ert.job_queue: - -ert.util: +ecl.util: The ert package is based on wrapping the libriaries from the ERT C code with ctypes; an essential part of ctypes approach is to load the @@ -57,7 +55,10 @@ before giving up completely. """ import os.path import sys + import warnings +warnings.simplefilter('always', DeprecationWarning) # see #1437 + from cwrap import load as cwrapload try: @@ -66,22 +67,22 @@ except ImportError: pass -required_version_hex = 0x02060000 +required_version_hex = 0x02070000 -ert_lib_path = None +ecl_lib_path = None ert_so_version = "" __version__ = "0.0.0" -# 1. Try to load the __ert_lib_info module; this module has been +# 1. Try to load the __ecl_lib_info module; this module has been # configured by cmake during the build configuration process. The # module should contain the variable lib_path pointing to the # directory with shared object files. try: - import __ert_lib_info - ert_lib_path = __ert_lib_info.lib_path - ert_so_version = __ert_lib_info.so_version - __version__ = __ert_lib_info.__version__ + import __ecl_lib_info + ecl_lib_path = __ecl_lib_info.lib_path + ert_so_version = __ecl_lib_info.so_version + __version__ = __ecl_lib_info.__version__ except ImportError: pass except AttributeError: @@ -102,23 +103,23 @@ if env_lib_path: # Check that the final ert_lib_path setting corresponds to an existing # directory. -if ert_lib_path: - if not os.path.isdir( ert_lib_path ): - ert_lib_path = None +if ecl_lib_path: + if not os.path.isdir( ecl_lib_path ): + ecl_lib_path = None if sys.hexversion < required_version_hex: - raise Exception("ERT Python requires at least version 2.6 of Python") + raise Exception("ERT Python requires Python 2.7.") # This load() function is *the* function actually loading shared # libraries. def load(name): - return cwrapload( name , path = ert_lib_path , so_version = ert_so_version) + return cwrapload(name, path=ecl_lib_path, so_version=ert_so_version) -from ert.util import Version -from ert.util import updateAbortSignals +from .util import Version +from .util import updateAbortSignals updateAbortSignals( ) diff --git a/ThirdParty/Ert/python/python/ert/ecl/CMakeLists.txt b/ThirdParty/Ert/python/python/ecl/ecl/CMakeLists.txt similarity index 85% rename from ThirdParty/Ert/python/python/ert/ecl/CMakeLists.txt rename to ThirdParty/Ert/python/python/ecl/ecl/CMakeLists.txt index 45a545aa19..c1cb314101 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/CMakeLists.txt +++ b/ThirdParty/Ert/python/python/ecl/ecl/CMakeLists.txt @@ -1,9 +1,7 @@ set(PYTHON_SOURCES __init__.py - ecl.py ecl_3d_file.py ecl_3dkw.py - ecl_case.py ecl_file.py ecl_file_view.py ecl_grav.py @@ -28,9 +26,11 @@ set(PYTHON_SOURCES ecl_sum_keyword_vector.py ecl_cmp.py ecl_sum_var_type.py + ecl_type.py + ecl_grid_generator.py ) -add_python_package("python.ert.ecl" ${PYTHON_INSTALL_PREFIX}/ert/ecl "${PYTHON_SOURCES}" True) +add_python_package("python.ecl.ecl" ${PYTHON_INSTALL_PREFIX}/ecl/ecl "${PYTHON_SOURCES}" True) add_subdirectory(faults) add_subdirectory(rft) diff --git a/ThirdParty/Ert/python/python/ert/ecl/__init__.py b/ThirdParty/Ert/python/python/ecl/ecl/__init__.py similarity index 90% rename from ThirdParty/Ert/python/python/ert/ecl/__init__.py rename to ThirdParty/Ert/python/python/ecl/ecl/__init__.py index e5a506e337..1c6b26062d 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/__init__.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/__init__.py @@ -28,6 +28,9 @@ wrap the content of the c-file ecl_xxx.c The main content is: ecl_kw/EclKW: This class holds one ECLIPSE keyword, like SWAT, in restart format. + ecl_type/EclDataType: This class is used to represent the data type + of the elements in EclKW. + ecl_file/EclFile: This class is used to load an ECLIPSE file in restart format, alternatively only parts of the file can be loaded. Internally it consists of a collection of EclKW @@ -36,6 +39,9 @@ wrap the content of the c-file ecl_xxx.c The main content is: ecl_grid/EclGrid: This will load an ECLIPSE GRID or EGRID file, and can then subsequently be used for queries about the grid. + ecl_grid_generator/EclGridGenerator: This can be used to generate various + grids. + ecl_sum/EclSum: This will load summary results from an ECLIPSE run; both data file(s) and the SMSPEC file. The EclSum object can be used as basis for queries on summary vectors. @@ -66,21 +72,22 @@ per module organization: namespace 'ecl'. """ -import ert.util -import ert.geo +import ecl.util +import ecl.geo from cwrap import Prototype class EclPrototype(Prototype): - lib = ert.load("libecl") + lib = ecl.load("libecl") def __init__(self, prototype, bind=True): super(EclPrototype, self).__init__(EclPrototype.lib, prototype, bind=bind) -ECL_LIB = ert.load("libecl") +ECL_LIB = ecl.load("libecl") -from .ecl_util import EclFileEnum, EclFileFlagEnum, EclPhaseEnum, EclTypeEnum, EclUnitTypeEnum , EclUtil +from .ecl_util import EclFileEnum, EclFileFlagEnum, EclPhaseEnum, EclUnitTypeEnum , EclUtil +from .ecl_type import EclTypeEnum, EclDataType from .ecl_sum_var_type import EclSumVarType from .ecl_sum_tstep import EclSumTStep from .ecl_sum import EclSum #, EclSumVector, EclSumNode, EclSMSPECNode @@ -104,3 +111,4 @@ from .ecl_sum_node import EclSumNode from .ecl_sum_vector import EclSumVector from .ecl_npv import EclNPV , NPVPriceVector from .ecl_cmp import EclCmp +from .ecl_grid_generator import EclGridGenerator diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_3d_file.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_3d_file.py similarity index 97% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_3d_file.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_3d_file.py index 27a5ef71c7..449641efee 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_3d_file.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_3d_file.py @@ -14,7 +14,7 @@ # See the GNU General Public License at # for more details. -from ert.ecl import EclFile, Ecl3DKW +from ecl.ecl import EclFile, Ecl3DKW class Ecl3DFile(EclFile): diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_3dkw.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_3dkw.py similarity index 92% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_3dkw.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_3dkw.py index d62c1f0f18..1d1a3ace11 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_3dkw.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_3dkw.py @@ -14,8 +14,10 @@ # See the GNU General Public License at # for more details. -from __future__ import print_function -from ecl_kw import EclKW +from __future__ import (absolute_import, division, + print_function, unicode_literals) + +from .ecl_kw import EclKW class Ecl3DKW(EclKW): """ @@ -35,7 +37,7 @@ class Ecl3DKW(EclKW): Usage example: - from ert.ecl import EclInitFile,EclGrid + from ecl.ecl import EclInitFile,EclGrid grid = EclGrid("ECLIPSE.EGRID") file = EclInitFile(grid , "ECLIPSE.INIT") @@ -64,18 +66,20 @@ class Ecl3DKW(EclKW): PERMX property. """ - - @classmethod - def create(cls , kw , grid , value_type , default_value = 0 , global_active = False): + def __init__(self, kw , grid , value_type , default_value = 0 , global_active = False): if global_active: size = grid.getGlobalSize() else: - size = grid.getNumActive( ) + size = grid.getNumActive( ) + super(Ecl3DKW , self).__init__( kw , size , value_type) + self.grid = grid + self.global_active = global_active + self.setDefault( default_value ) - new_kw = super(Ecl3DKW , cls).create( kw , size , value_type) - new_kw.grid = grid - new_kw.global_active = global_active - new_kw.setDefault( default_value ) + + @classmethod + def create(cls , kw , grid , value_type , default_value = 0 , global_active = False): + new_kw = Ecl3DKW(kw , grid , value_type , default_value , global_active) return new_kw @classmethod @@ -164,7 +168,7 @@ class Ecl3DKW(EclKW): 2. Convert the keyword to a 3D keyword. - from ert.ecl import EclGrid,EclKW,Ecl3DKW + from ecl.ecl import EclGrid,EclKW,Ecl3DKW grid = EclGrid("ECLIPSE.EGRID") poro = EclKW.read_grdecl(open("poro.grdecl") , "PORO") diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_cmp.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_cmp.py similarity index 99% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_cmp.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_cmp.py index 8608730ec1..38f76f2c28 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_cmp.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_cmp.py @@ -14,7 +14,7 @@ # See the GNU General Public License at # for more details. -from ert.ecl import EclSum +from ecl.ecl import EclSum class EclCase(object): diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_file.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_file.py similarity index 94% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_file.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_file.py index e0eeb4f98a..111b081fd1 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_file.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_file.py @@ -39,10 +39,10 @@ import re import types import datetime import ctypes -import warnings + from cwrap import BaseCClass -from ert.ecl import EclPrototype, EclKW, EclFileEnum, EclFileView -from ert.util import CTime +from ecl.ecl import EclPrototype, EclKW, EclFileEnum, EclFileView +from ecl.util import CTime class EclFile(BaseCClass): @@ -87,7 +87,7 @@ class EclFile(BaseCClass): @classmethod def restart_block( cls , filename , dtime = None , report_step = None): raise NotImplementedError("The restart_block implementation has been removed - open file normally and use EclFileView.") - + @classmethod @@ -100,7 +100,7 @@ class EclFile(BaseCClass): corresponding to @report_step can be found. Since this is a classmethod it is invoked like this: - import ert.ecl.ecl as ecl + import ecl.ecl.ecl as ecl .... if ecl.EclFile.contains_report_step("ECLIPSE.UNRST" , 20): print "OK - file contains report step 20" @@ -124,7 +124,7 @@ class EclFile(BaseCClass): time corresponding to @dtime can be found. Since this is a classmethod it is invoked like this: - import ert.ecl.ecl as ecl + import ecl.ecl.ecl as ecl .... if ecl.EclFile.contains_sim_time("ECLIPSE.UNRST" , datetime.datetime( 2007 , 10 , 10) ): print "OK - file contains 10th of October 2007" @@ -174,8 +174,7 @@ class EclFile(BaseCClass): def __repr__(self): fn = self.getFilename() wr = ', read/write' if self._writable() else '' - ad = self._ad_str() - return 'EclFile("%s"%s) %s' % (fn,wr,ad) + return self._create_repr('"%s"%s' % (fn,wr)) def __init__( self , filename , flags = 0): @@ -209,7 +208,7 @@ class EclFile(BaseCClass): super(EclFile , self).__init__(c_ptr) self.global_view = self._get_global_view( ) self.global_view.setParent( self ) - + def save_kw( self , kw ): """ @@ -254,8 +253,16 @@ class EclFile(BaseCClass): self.close() - def blockView(self, kw , kw_index): - return self.global_view.blockView( kw , kw_index ) + def blockView(self, kw, kw_index): + if not kw in self: + raise KeyError('No such keyword "%s".' % kw) + ls = self.global_view.numKeywords(kw) + idx = kw_index + if idx < 0: + idx += ls + if 0 <= idx < ls: + return self.global_view.blockView(kw, idx) + raise IndexError('Index out of range, must be in [0, %d), was %d.' % (ls, kw_index)) def blockView2(self, start_kw , stop_kw , start_index): @@ -264,9 +271,9 @@ class EclFile(BaseCClass): def restartView( self, seqnum_index = None, report_step = None , sim_time = None , sim_days = None): return self.global_view.restartView( seqnum_index, report_step , sim_time, sim_days ) - - + + def select_block( self, kw , kw_index): raise NotImplementedError("The select_block implementation has been removed - use EclFileView") @@ -311,7 +318,7 @@ class EclFile(BaseCClass): is a non-unified restart file (or not a restart file at all), the method will do nothing and return False. """ - + @@ -343,10 +350,18 @@ class EclFile(BaseCClass): for swat in restart_file["SWAT"]: .... """ + if isinstance(index, int): + ls = len(self) + idx = index + if idx < 0: + idx += ls + if 0 <= idx < ls: + return self.global_view[idx] + else: + raise IndexError('Index must be in [0, %d), was: %d.' % (ls, index)) return self.global_view[index] - def iget_kw( self , index , copy = False): """ Will return EclKW instance nr @index. @@ -394,7 +409,7 @@ class EclFile(BaseCClass): def iget_named_kw( self , kw_name , index , copy = False): return self.global_view.iget_named_kw( kw_name , index ) - + def restart_get_kw( self , kw_name , dtime , copy = False): """Will return EclKW @kw_name from restart file at time @dtime. @@ -493,7 +508,7 @@ class EclFile(BaseCClass): header_dict = {} for index in range(len(self)): kw = self[index] - header_dict[ kw.name ] = True + header_dict[ kw.getName() ] = True return header_dict.keys() @@ -534,11 +549,12 @@ class EclFile(BaseCClass): probably be tricked by other file types also containing an INTEHEAD keyword. """ - dates = [] if self.has_kw('SEQNUM'): + dates = [] for index in range( self.num_named_kw( 'SEQNUM' )): dates.append( self.iget_restart_sim_time( index )) - else: + return dates + elif 'INTEHEAD' in self: # This is a uber-hack; should export the ecl_rsthead # object as ctypes structure. intehead = self["INTEHEAD"][0] @@ -546,8 +562,8 @@ class EclFile(BaseCClass): month = intehead[65] day = intehead[64] date = datetime.datetime( year , month , day ) - dates = [ date ] - return dates + return [ date ] + return None @property @@ -564,7 +580,7 @@ class EclFile(BaseCClass): """ return self.global_view.numKeywords( kw ) - + def has_kw( self , kw , num = 0): """ Check if current EclFile instance has a keyword @kw. @@ -572,11 +588,8 @@ class EclFile(BaseCClass): If the optional argument @num is given it will check if the EclFile has at least @num occurences of @kw. """ - num_named_kw = self.num_named_kw( kw ) - if num_named_kw > num: - return True - else: - return False + + return self.num_named_kw( kw ) > num def __contains__(self , kw): """ @@ -644,14 +657,8 @@ class EclFile(BaseCClass): """ Name of the file currently loaded. """ - return self._get_src_file( ) - - - @property - def name(self): - warnings.warn("The name property is deprecated - use getFilename( )" , DeprecationWarning) - return self.getFilename() - + fn = self._get_src_file() + return str(fn) if fn else '' def fwrite( self , fortio ): """ @@ -662,7 +669,7 @@ class EclFile(BaseCClass): This method will write the current EclFile instance to a FortIO stream already opened for writing: - import ert.ecl.ecl as ecl + import ecl.ecl.ecl as ecl ... fortio = ecl.FortIO( "FILE.XX" ) file.fwrite( fortio ) diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_file_view.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_file_view.py similarity index 72% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_file_view.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_file_view.py index 0e30b1d931..558f585e60 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_file_view.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_file_view.py @@ -1,7 +1,24 @@ -import types +# Copyright (C) 2017 Statoil ASA, Norway. +# +# This file is part of ERT - Ensemble based Reservoir Tool. +# +# ERT 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. +# +# ERT 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 +# for more details. + +from __future__ import absolute_import, division, print_function, unicode_literals +from six import string_types from cwrap import BaseCClass -from ert.ecl import EclPrototype, EclKW -from ert.util import CTime +from ecl.ecl import EclPrototype +from ecl.util import CTime class EclFileView(BaseCClass): TYPE_NAME = "ecl_file_view" @@ -13,7 +30,7 @@ class EclFileView(BaseCClass): _create_block_view = EclPrototype("ecl_file_view_ref ecl_file_view_add_blockview( ecl_file_view , char*, int )") _create_block_view2 = EclPrototype("ecl_file_view_ref ecl_file_view_add_blockview2( ecl_file_view , char*, char*, int )") _restart_view = EclPrototype("ecl_file_view_ref ecl_file_view_add_restart_view( ecl_file_view , int, int, time_t, double )") - + def __init__(self): raise NotImplementedError("Can not instantiate directly") @@ -23,7 +40,8 @@ class EclFileView(BaseCClass): return self._iget_kw( index ).setParent( parent = self ) - + def __repr__(self): + return 'EclFileView(size = %d) %s' % (len(self), self._ad_str()) def iget_named_kw(self, kw_name , index): if not kw_name in self: @@ -31,7 +49,7 @@ class EclFileView(BaseCClass): if index >= self.numKeywords( kw_name ): raise IndexError("Too large index: %d" % index) - + return self._iget_named_kw( kw_name , index ).setParent( parent = self ) @@ -64,12 +82,15 @@ class EclFileView(BaseCClass): .... """ - if isinstance( index , types.IntType): - if index < 0 or index >= len(self): - raise IndexError + if isinstance( index , int): + ls = len(self) + idx = index + if idx < 0: + idx += ls + if 0 <= idx < ls: + return self.__iget(idx) else: - kw = self.__iget( index ) - return kw + raise IndexError('Index must be in [0, %d), was: %d.' % (ls, index)) if isinstance( index , slice ): indices = index.indices( len(self) ) @@ -78,7 +99,9 @@ class EclFileView(BaseCClass): kw_list.append( self[i] ) return kw_list else: - if isinstance( index , types.StringType): + if isinstance( index , bytes): + index = index.decode('ascii') + if isinstance( index , string_types): if index in self: kw_index = index kw_list = [] @@ -93,55 +116,61 @@ class EclFileView(BaseCClass): def __len__(self): return self._get_size( ) - - + + def __contains__(self , kw): if self.numKeywords(kw) > 0: return True else: return False - + def numKeywords(self , kw): return self._get_num_named_kw( kw ) - + def uniqueSize(self): return self._get_unique_size( ) def blockView2(self , start_kw , stop_kw, start_index): + idx = start_index if start_kw: if not start_kw in self: raise KeyError("The keyword:%s is not in file" % start_kw) - if start_index >= self.numKeywords( start_kw ): - raise IndexError("Index too high") - + ls = self.numKeywords(start_kw) + if idx < 0: + idx += ls + if not (0 <= idx < ls): + raise IndexError('Index must be in [0, %d), was: %d.' % (ls, start_index)) + if stop_kw: if not stop_kw in self: raise KeyError("The keyword:%s is not in file" % stop_kw) - view = self._create_block_view2( start_kw , stop_kw , start_index ) + view = self._create_block_view2(start_kw, stop_kw, idx) view.setParent( parent = self ) return view - - + def blockView(self , kw , kw_index): num = self.numKeywords( kw ) if num == 0: raise KeyError("Unknown keyword: %s" % kw) - if kw_index >= num: - raise IndexError("Index too high") - + idx = kw_index + if idx < 0: + idx += num + + if not (0 <= idx < num): + raise IndexError('Index must be in [0, %d), was: %d.' % (num, kw_index)) + view = self._create_block_view( kw , kw_index ) view.setParent( parent = self ) return view - def restartView(self , seqnum_index = None, report_step = None , sim_time = None , sim_days = None): if report_step is None: report_step = -1 @@ -154,7 +183,7 @@ class EclFileView(BaseCClass): if seqnum_index is None: seqnum_index = -1 - + view = self._restart_view( seqnum_index , report_step , CTime( sim_time ) , sim_days ) if view is None: raise ValueError("No such restart block could be identiefied") diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_grav.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_grav.py similarity index 99% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_grav.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_grav.py index 5b06f7b953..fee8ea71dc 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_grav.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_grav.py @@ -22,7 +22,7 @@ different surveys. The implementation is a thin wrapper around the ecl_grav.c implementation in the libecl library. """ from cwrap import BaseCClass -from ert.ecl import EclPhaseEnum, EclPrototype +from ecl.ecl import EclPhaseEnum, EclPrototype class EclGrav(BaseCClass): @@ -84,7 +84,7 @@ class EclGrav(BaseCClass): to load the @restart_view argument is: import datetime - from ert.ecl import EclRestartFile + from ecl.ecl import EclRestartFile ... ... date = datetime.datetime( year , month , day ) diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_grav_calc.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_grav_calc.py similarity index 98% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_grav_calc.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_grav_calc.py index 793ad89586..44e5c2006c 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_grav_calc.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_grav_calc.py @@ -14,7 +14,7 @@ # See the GNU General Public License at # for more details. -from ert.ecl import EclPrototype +from ecl.ecl import EclPrototype _phase_deltag = EclPrototype("double ecl_grav_phase_deltag( double, double ,double , ecl_grid , ecl_file , ecl_kw , ecl_kw , ecl_kw , ecl_kw , ecl_kw , ecl_kw") diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_grid.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_grid.py similarity index 88% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_grid.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_grid.py index 28f9c998d9..7d9bdb6a65 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_grid.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_grid.py @@ -1,18 +1,18 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'ecl_grid.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. +# Copyright (C) 2011 Statoil ASA, Norway. +# +# The file 'ecl_grid.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT 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. +# +# ERT 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 +# for more details. """ Module to load and query ECLIPSE GRID/EGRID files. @@ -25,14 +25,15 @@ wrapper around the ecl_grid.c implementation from the libecl library. """ import ctypes +import warnings import numpy import sys -import warnings import os.path import math +import itertools from cwrap import CFILE, BaseCClass -from ert.util import IntVector -from ert.ecl import EclPrototype, EclTypeEnum, EclKW, FortIO, EclUnitTypeEnum +from ecl.util import IntVector +from ecl.ecl import EclPrototype, EclDataType, EclKW, FortIO, EclUnitTypeEnum class EclGrid(BaseCClass): @@ -42,7 +43,7 @@ class EclGrid(BaseCClass): TYPE_NAME = "ecl_grid" _fread_alloc = EclPrototype("void* ecl_grid_load_case__( char* , bool )" , bind = False) - _grdecl_create = EclPrototype("ecl_grid_obj ecl_grid_alloc_GRDECL_kw( int , int , int , ecl_kw , ecl_kw , ecl_kw , ecl_kw)" , bind = False) + _grdecl_create = EclPrototype("ecl_grid_obj ecl_grid_alloc_GRDECL_kw( int , int , int , ecl_kw , ecl_kw , ecl_kw , ecl_kw)" , bind = False) _alloc_rectangular = EclPrototype("ecl_grid_obj ecl_grid_alloc_rectangular( int , int , int , double , double , double , int*)" , bind = False) _exists = EclPrototype("bool ecl_grid_exists( char* )" , bind = False) @@ -50,7 +51,7 @@ class EclGrid(BaseCClass): _get_cell_lgr = EclPrototype("ecl_grid_ref ecl_grid_get_cell_lgr1( ecl_grid , int )") _num_coarse_groups = EclPrototype("int ecl_grid_get_num_coarse_groups( ecl_grid )") _in_coarse_group1 = EclPrototype("bool ecl_grid_cell_in_coarse_group1( ecl_grid , int)") - _free = EclPrototype("void ecl_grid_free( ecl_grid )") + _free = EclPrototype("void ecl_grid_free( ecl_grid )") _get_nx = EclPrototype("int ecl_grid_get_nx( ecl_grid )") _get_ny = EclPrototype("int ecl_grid_get_ny( ecl_grid )") _get_nz = EclPrototype("int ecl_grid_get_nz( ecl_grid )") @@ -60,13 +61,13 @@ class EclGrid(BaseCClass): _get_name = EclPrototype("char* ecl_grid_get_name( ecl_grid )") _ijk_valid = EclPrototype("bool ecl_grid_ijk_valid(ecl_grid , int , int , int)") _get_active_index3 = EclPrototype("int ecl_grid_get_active_index3( ecl_grid , int , int , int)") - _get_global_index3 = EclPrototype("int ecl_grid_get_global_index3( ecl_grid , int , int , int)") - _get_active_index1 = EclPrototype("int ecl_grid_get_active_index1( ecl_grid , int )") - _get_active_fracture_index1 = EclPrototype("int ecl_grid_get_active_fracture_index1( ecl_grid , int )") - _get_global_index1A = EclPrototype("int ecl_grid_get_global_index1A( ecl_grid , int )") - _get_global_index1F = EclPrototype("int ecl_grid_get_global_index1F( ecl_grid , int )") + _get_global_index3 = EclPrototype("int ecl_grid_get_global_index3( ecl_grid , int , int , int)") + _get_active_index1 = EclPrototype("int ecl_grid_get_active_index1( ecl_grid , int )") + _get_active_fracture_index1 = EclPrototype("int ecl_grid_get_active_fracture_index1( ecl_grid , int )") + _get_global_index1A = EclPrototype("int ecl_grid_get_global_index1A( ecl_grid , int )") + _get_global_index1F = EclPrototype("int ecl_grid_get_global_index1F( ecl_grid , int )") _get_ijk1 = EclPrototype("void ecl_grid_get_ijk1( ecl_grid , int , int* , int* , int*)") - _get_ijk1A = EclPrototype("void ecl_grid_get_ijk1A( ecl_grid , int , int* , int* , int*)") + _get_ijk1A = EclPrototype("void ecl_grid_get_ijk1A( ecl_grid , int , int* , int* , int*)") _get_xyz3 = EclPrototype("void ecl_grid_get_xyz3( ecl_grid , int , int , int , double* , double* , double*)") _get_xyz1 = EclPrototype("void ecl_grid_get_xyz1( ecl_grid , int , double* , double* , double*)") _get_cell_corner_xyz1 = EclPrototype("void ecl_grid_get_cell_corner_xyz1( ecl_grid , int , int , double* , double* , double*)") @@ -84,12 +85,12 @@ class EclGrid(BaseCClass): _get_cell_dx = EclPrototype("double ecl_grid_get_cell_dx1( ecl_grid , int )") _get_cell_dy = EclPrototype("double ecl_grid_get_cell_dy1( ecl_grid , int )") _get_depth = EclPrototype("double ecl_grid_get_cdepth1( ecl_grid , int )") - _fwrite_grdecl = EclPrototype("void ecl_grid_grdecl_fprintf_kw( ecl_grid , ecl_kw , char* , FILE , double)") + _fwrite_grdecl = EclPrototype("void ecl_grid_grdecl_fprintf_kw( ecl_grid , ecl_kw , char* , FILE , double)") _load_column = EclPrototype("void ecl_grid_get_column_property( ecl_grid , ecl_kw , int , int , double_vector)") _get_top = EclPrototype("double ecl_grid_get_top2( ecl_grid , int , int )") _get_top1A = EclPrototype("double ecl_grid_get_top1A(ecl_grid , int )") - _get_bottom = EclPrototype("double ecl_grid_get_bottom2( ecl_grid , int , int )") - _locate_depth = EclPrototype("int ecl_grid_locate_depth( ecl_grid , double , int , int )") + _get_bottom = EclPrototype("double ecl_grid_get_bottom2( ecl_grid , int , int )") + _locate_depth = EclPrototype("int ecl_grid_locate_depth( ecl_grid , double , int , int )") _invalid_cell = EclPrototype("bool ecl_grid_cell_invalid1( ecl_grid , int)") _valid_cell = EclPrototype("bool ecl_grid_cell_valid1( ecl_grid , int)") _get_distance = EclPrototype("void ecl_grid_get_distance( ecl_grid , int , int , double* , double* , double*)") @@ -103,8 +104,8 @@ class EclGrid(BaseCClass): _global_kw_copy = EclPrototype("void ecl_grid_global_kw_copy( ecl_grid , ecl_kw , ecl_kw)") _create_volume_keyword = EclPrototype("ecl_kw_obj ecl_grid_alloc_volume_kw( ecl_grid , bool)") - - + + @classmethod def loadFromGrdecl(cls , filename): """Will create a new EclGrid instance from grdecl file. @@ -112,7 +113,7 @@ class EclGrid(BaseCClass): This function will scan the input file @filename and look for the keywords required to build a grid. The following keywords are required: - + SPECGRID ZCORN COORD In addition the function will look for and use the ACTNUM and @@ -128,11 +129,11 @@ class EclGrid(BaseCClass): if os.path.isfile(filename): with open(filename) as f: - specgrid = EclKW.read_grdecl(f, "SPECGRID", ecl_type=EclTypeEnum.ECL_INT_TYPE, strict=False) + specgrid = EclKW.read_grdecl(f, "SPECGRID", ecl_type=EclDataType.ECL_INT, strict=False) zcorn = EclKW.read_grdecl(f, "ZCORN") coord = EclKW.read_grdecl(f, "COORD") try: - actnum = EclKW.read_grdecl(f, "ACTNUM", ecl_type=EclTypeEnum.ECL_INT_TYPE) + actnum = EclKW.read_grdecl(f, "ACTNUM", ecl_type=EclDataType.ECL_INT) except ValueError: actnum = None @@ -154,7 +155,7 @@ class EclGrid(BaseCClass): return EclGrid( filename ) else: return EclGrid.loadFromGrdecl( filename ) - + @classmethod def create(cls , specgrid , zcorn , coord , actnum , mapaxes = None ): @@ -173,29 +174,25 @@ class EclGrid(BaseCClass): zcorn_kw = file.iget_named_kw( "ZCORN" , 0) coord_kw = file.iget_named_kw( "COORD" , 0) actnum_kw = file.iget_named_kw( "ACTNUM" , 0 ) - + grid = EclGrid.create( specgrid_kw , zcorn_kw , coord_kw , actnum_kw) - - If you are so inclined ... + + If you are so inclined ... """ return cls._grdecl_create( specgrid[0] , specgrid[1] , specgrid[2] , zcorn , coord , actnum , mapaxes ) - - - @classmethod - def create_rectangular(cls , dims , dV , actnum = None): - warnings.warn("The create_rectangular method is deprecated - use createRectangular( )" , DeprecationWarning) - return cls.createRectangular( dims , dV , actnum ) - - - @classmethod - def createRectangular(cls , dims , dV , actnum = None): + def createRectangular(cls, dims , dV , actnum = None): """ Will create a new rectangular grid. @dims = (nx,ny,nz) @dVg = (dx,dy,dz) - - With the default value @actnum == None all cells will be active, + + With the default value @actnum == None all cells will be active, """ + + warnings.warn("EclGrid.createRectangular is deprecated. " + + "Please used the similar method in EclGridGenerator!", + DeprecationWarning) + if actnum is None: ecl_grid = cls._alloc_rectangular( dims[0] , dims[1] , dims[2] , dV[0] , dV[1] , dV[2] , None ) else: @@ -204,7 +201,7 @@ class EclGrid(BaseCClass): for (index , value) in enumerate(actnum): tmp[index] = value actnum = tmp - + if not len(actnum) == dims[0] * dims[1] * dims[2]: raise ValueError("ACTNUM size mismatch: len(ACTNUM):%d Expected:%d" % (len(actnum) , dims[0] * dims[1] * dims[2])) ecl_grid = cls._alloc_rectangular( dims[0] , dims[1] , dims[2] , dV[0] , dV[1] , dV[2] , actnum.getDataPtr() ) @@ -216,7 +213,6 @@ class EclGrid(BaseCClass): return ecl_grid - def __init__(self , filename , apply_mapaxes = True): """ Will create a grid structure from an EGRID or GRID file. @@ -226,7 +222,7 @@ class EclGrid(BaseCClass): super(EclGrid, self).__init__(c_ptr) else: raise IOError("Loading grid from:%s failed" % filename) - self.__str__ = self.__repr__ + def free(self): self._free( ) @@ -250,6 +246,12 @@ class EclGrid(BaseCClass): xyz_s = '%dx%dx%d' % (self.getNX(),self.getNY(),self.getNZ()) return self._create_repr('%s%s, global_size = %d, active_size = %d' % (name, xyz_s, g_size, a_size)) + def __len__(self): + """ + len(grid) wil return the total number of cells. + """ + return self._get_global_size( ) + def equal(self , other , include_lgr = True , include_nnc = False , verbose = False): """ Compare the current grid with the other grid. @@ -261,49 +263,7 @@ class EclGrid(BaseCClass): def dualGrid(self): """Is this grid dual porosity model?""" - return self._dual_grid( ) - - @property - def dual_grid( self ): - warnings.warn("The dual_grid property is deprecated - use dualGrid( ) method" , DeprecationWarning) - return self.dualGrid( ) - - - @property - def nx( self ): - warnings.warn("The nx property is deprecated - use getNX( ) method" , DeprecationWarning) - return self.getNX() - - @property - def ny( self ): - warnings.warn("The ny property is deprecated - use getNY( ) method" , DeprecationWarning) - return self.getNY() - - @property - def nz( self ): - warnings.warn("The nz property is deprecated - use getNZ( ) method" , DeprecationWarning) - return self.getNZ() - - @property - def size( self ): - warnings.warn("The size property is deprecated - use getGlobalSize( ) method" , DeprecationWarning) - return self.getGlobalSize( ) - - @property - def nactive( self ): - warnings.warn("The nactive property is deprecated - use getNumActive( ) method" , DeprecationWarning) - return self.getNumActive( ) - - @property - def nactive_fracture( self ): - warnings.warn("The nactive_fracture property is deprecated - use getNumActiveFracture( ) method" , DeprecationWarning) - return self.getNumActiveFracture( ) - - @property - def dims( self ): - warnings.warn("The dims property is deprecated - use getDims() method instead" , DeprecationWarning) - return self.getDims( ) - + return self._dual_grid( ) def getDims(self): """A tuple of four elements: (nx , ny , nz , nactive).""" @@ -312,7 +272,7 @@ class EclGrid(BaseCClass): self.getNZ( ) , self.getNumActive( ) ) - + def getNX(self): """ The number of elements in the x direction""" return self._get_nx( ) @@ -344,7 +304,7 @@ class EclGrid(BaseCClass): x = ctypes.c_double() y = ctypes.c_double() z = ctypes.c_double() - + if lower_left is None: i1 = 0 j1 = 0 @@ -356,22 +316,22 @@ class EclGrid(BaseCClass): if not 0 < j1 < self.getNY(): raise ValueError("lower_left j coordinate invalid") - + if upper_right is None: i2 = self.getNX() j2 = self.getNY() else: i2,j2 = upper_right - + if not 1 < i2 <= self.getNX(): raise ValueError("upper_right i coordinate invalid") if not 1 < j2 <= self.getNY(): raise ValueError("upper_right j coordinate invalid") - + if not i1 < i2: raise ValueError("Must have lower_left < upper_right") - + if not j1 < j2: raise ValueError("Must have lower_left < upper_right") @@ -396,22 +356,16 @@ class EclGrid(BaseCClass): def getName(self): """ - Name of the current grid. - + Name of the current grid, returns a string. + For the main grid this is the filename given to the constructor when loading the grid; for an LGR this is the name of the LGR. If the grid instance has been created with the create() classmethod this can be None. """ - return self._get_name( ) + n = self._get_name() + return str(n) if n else '' - - @property - def name( self ): - warnings.warn("The name property is deprecated - use getName() method instead" , DeprecationWarning) - return self.getName() - - def global_index( self , active_index = None, ijk = None): """ Will convert either active_index or (i,j,k) to global index. @@ -424,7 +378,7 @@ class EclGrid(BaseCClass): This method will convert @active_index or @ijk to a global index. Exactly one of the arguments @active_index, - @global_index or @ijk must be supplied. + @global_index or @ijk must be supplied. The method is used extensively internally in the EclGrid class; most methods which take coordinate input pass through @@ -440,34 +394,34 @@ class EclGrid(BaseCClass): if ijk: set_count += 1 - + if not set_count == 1: raise ValueError("Exactly one of the kewyord arguments active_index, global_index or ijk must be set") - + if not active_index is None: global_index = self._get_global_index1A( active_index ) elif ijk: nx = self.getNX() ny = self.getNY() nz = self.getNZ() - + i,j,k = ijk if not 0 <= i < nx: - raise IndexError("Invalid value i:%d Range: [%d,%d)" % (i , 0 , nx)) + raise IndexError("Invalid value i:%d Range: [%d,%d)" % (i , 0 , nx)) if not 0 <= j < ny: - raise IndexError("Invalid value j:%d Range: [%d,%d)" % (j , 0 , ny)) - + raise IndexError("Invalid value j:%d Range: [%d,%d)" % (j , 0 , ny)) + if not 0 <= k < nz: - raise IndexError("Invalid value k:%d Range: [%d,%d)" % (k , 0 , nz)) + raise IndexError("Invalid value k:%d Range: [%d,%d)" % (k , 0 , nz)) global_index = self._get_global_index3( i,j,k) else: if not 0 <= global_index < self.getGlobalSize(): - raise IndexError("Invalid value global_index:%d Range: [%d,%d)" % (global_index , 0 , self.getGlobalSize())) + raise IndexError("Invalid value global_index:%d Range: [%d,%d)" % (global_index , 0 , self.getGlobalSize())) return global_index - + def get_active_index( self , ijk = None , global_index = None): """ @@ -535,7 +489,7 @@ class EclGrid(BaseCClass): gi = self.__global_index( global_index = global_index , ijk = ijk , active_index = active_index) return self._valid_cell( gi ) - + def active( self , ijk = None , global_index = None): """ @@ -581,9 +535,9 @@ class EclGrid(BaseCClass): Find true position of cell center. Will return world position of the center of a cell in the - grid. The return value is a tuple of three elements: + grid. The return value is a tuple of three elements: (utm_x , utm_y , depth). - + The cells of a grid can be specified in three different ways: (i,j,k) : As a tuple of i,j,k values. @@ -592,21 +546,21 @@ class EclGrid(BaseCClass): global index is related to (i,j,k) as: global_index = i + j*nx + k*nx*ny - + active_index : A number in the range [0,nactive). - + For many of the EclGrid methods a cell can be specified using any of these three methods. Observe that one and only method is allowed: OK: - pos1 = grid.get_xyz( active_index = 100 ) - pos2 = grid.get_xyz( ijk = (10,20,7 )) + pos1 = grid.get_xyz( active_index = 100 ) + pos2 = grid.get_xyz( ijk = (10,20,7 )) Crash and burn: - pos3 = grid.get_xyz( ijk = (10,20,7 ) , global_index = 10) + pos3 = grid.get_xyz( ijk = (10,20,7 ) , global_index = 10) pos4 = grid.get_xyz() - + All the indices in the EclGrid() class are zero offset, this is in contrast to ECLIPSE which has an offset 1 interface. """ @@ -641,7 +595,7 @@ class EclGrid(BaseCClass): if not 0 <= k <= self.getNZ(): raise IndexError("Invalid K value:%d - valid range: [0,%d]" % (k , self.getNZ())) - + x = ctypes.c_double() y = ctypes.c_double() z = ctypes.c_double() @@ -653,9 +607,9 @@ class EclGrid(BaseCClass): """ Will look up xyz of corner nr @corner_nr - - lower layer: upper layer - + + lower layer: upper layer + 2---3 6---7 | | | | 0---1 4---5 @@ -668,16 +622,10 @@ class EclGrid(BaseCClass): self._get_cell_corner_xyz1( gi , corner_nr , ctypes.byref(x) , ctypes.byref(y) , ctypes.byref(z)) return (x.value , y.value , z.value) - - def get_corner_xyz(self, corner_nr , active_index = None , global_index = None , ijk = None): - warnings.warn("The get_corner_xyz() method has been renamed: getCellCorner()" , DeprecationWarning) - return self.getCellCorner(corner_nr , active_index , global_index , ijk) - - def getNodeXYZ(self , i,j,k): """ This function returns the position of Vertex (i,j,k). - + The coordinates are in the inclusive interval [0,nx] x [0,ny] x [0,nz]. """ nx = self.getNX() @@ -685,7 +633,7 @@ class EclGrid(BaseCClass): nz = self.getNZ() corner = 0 - + if i == nx: i -= 1 corner += 1 @@ -699,7 +647,7 @@ class EclGrid(BaseCClass): corner += 4 if self._ijk_valid( i , j , k): - return self.get_corner_xyz( corner , global_index = i + j*nx + k*nx*ny ) + return self.getCellCorner( corner , global_index = i + j*nx + k*nx*ny ) else: raise IndexError("Invalid coordinates: (%d,%d,%d) " % (i,j,k)) @@ -707,11 +655,11 @@ class EclGrid(BaseCClass): def getLayerXYZ(self , xy_corner , layer): nx = self.getNX() - + (j , i) = divmod(xy_corner , nx + 1) k = layer return self.getNodeXYZ(i,j,k) - + def distance( self , global_index1 , global_index2): @@ -755,7 +703,7 @@ class EclGrid(BaseCClass): """ Bottom of the reservoir; in the column (@i , @j). """ - return self._get_bottom( i , j ) + return self._get_bottom( i , j ) def locate_depth( self , depth , i , j ): """ @@ -815,7 +763,7 @@ class EclGrid(BaseCClass): def findCellXY(self , x, y , k): """Will find the i,j of cell with utm coordinates x,y. - + The @k input is the layer you are interested in, the allowed values for k are [0,nz]. If the coordinates (x,y) are found to be outside the grid a ValueError exception is raised. @@ -830,7 +778,7 @@ class EclGrid(BaseCClass): raise ValueError("Could not find the point:(%g,%g) in layer:%d" % (x,y,k)) else: raise IndexError("Invalid layer value:%d" % k) - + @staticmethod def d_cmp(a,b): @@ -839,7 +787,7 @@ class EclGrid(BaseCClass): def findCellCornerXY(self , x, y , k): """Will find the corner nr of corner closest to utm coordinates x,y. - + The @k input is the layer you are interested in, the allowed values for k are [0,nz]. If the coordinates (x,y) are found to be outside the grid a ValueError exception is raised. @@ -850,7 +798,7 @@ class EclGrid(BaseCClass): corner_shift = 4 else: corner_shift = 0 - + nx = self.getNX() x0,y0,z0 = self.getCellCorner( corner_shift , ijk = (i,j,k)) d0 = math.sqrt( (x0 - x)*(x0 - x) + (y0 - y)*(y0 - y)) @@ -871,7 +819,7 @@ class EclGrid(BaseCClass): l = [(d0 , c0) , (d1,c1) , (d2 , c2) , (d3,c3)] l.sort( EclGrid.d_cmp ) return l[0][1] - + def cell_regular(self, active_index = None , global_index = None , ijk = None): @@ -897,7 +845,7 @@ class EclGrid(BaseCClass): """ gi = self.__global_index( ijk = ijk , active_index = active_index , global_index = global_index) return self._get_cell_volume( gi) - + def cell_dz( self , active_index = None , global_index = None , ijk = None): """ @@ -929,11 +877,11 @@ class EclGrid(BaseCClass): dy = self._get_cell_dy( gi ) dz = self._get_cell_thickness( gi ) return (dx,dy,dz) - + def getNumLGR(self): - + """ How many LGRs are attached to this main grid? @@ -942,13 +890,8 @@ class EclGrid(BaseCClass): """ return self._num_lgr( ) - - @property - def num_lgr( self ): - warnings.warn("The num_lgr property is deprecated - use getNumLGR() method instead" , DeprecationWarning) - return self.getNumLGR() - + def has_lgr( self , lgr_name ): """ Query if the grid has an LGR with name @lgr_name. @@ -962,7 +905,7 @@ class EclGrid(BaseCClass): def get_lgr( self , lgr_name ): """ Get EclGrid instance with LGR content. - + Return an EclGrid instance based on the LGR named @lgr_name. The LGR grid instance is in most questions like an ordinary grid instance; the only difference is that it can not @@ -977,17 +920,17 @@ class EclGrid(BaseCClass): return lgr else: raise KeyError("No such LGR:%s" % lgr_name) - + def get_cell_lgr( self, active_index = None , global_index = None , ijk = None): """ Get EclGrid instance located in cell. - + Will query the current grid instance if the cell given by @active_index, @global_index or @ijk has been refined with an LGR. Will return None if the cell in question has not been refined, the return value can be used for further queries. - + See get_xyz() for documentation of the input parameters. """ gi = self.__global_index( ijk = ijk , active_index = active_index , global_index = global_index) @@ -998,7 +941,7 @@ class EclGrid(BaseCClass): else: raise IndexError("No LGR defined for this cell") - + def grid_value( self , kw , i , j , k): """ Will evalute @kw in location (@i,@j,@k). @@ -1032,7 +975,7 @@ class EclGrid(BaseCClass): initialized with a suitable default value. """ self._load_column( kw , i , j , column) - + def createKW( self , array , kw_name , pack): """ @@ -1048,29 +991,29 @@ class EclGrid(BaseCClass): if dims[0] == self.getNX() and dims[1] == self.getNY() and dims[2] == self.getNZ(): dtype = array.dtype if dtype == numpy.int32: - type = EclTypeEnum.ECL_INT_TYPE + type = EclDataType.ECL_INT elif dtype == numpy.float32: - type = EclTypeEnum.ECL_FLOAT_TYPE + type = EclDataType.ECL_FLOAT elif dtype == numpy.float64: - type = EclTypeEnum.ECL_DOUBLE_TYPE + type = EclDataType.ECL_DOUBLE else: sys.exit("Do not know how to create ecl_kw from type:%s" % dtype) - + if pack: size = self.getNumActive() else: size = self.getGlobalSize() - + if len(kw_name) > 8: # Silently truncate to length 8 - ECLIPSE has it's challenges. - kw_name = kw_name[0:8] + kw_name = kw_name[0:8] kw = EclKW( kw_name , size , type ) active_index = 0 global_index = 0 - for k in range( self.nz ): - for j in range( self.ny ): - for i in range( self.nx ): + for k in range( self.getNZ() ): + for j in range( self.getNY() ): + for i in range( self.getNX() ): if pack: if self.active( global_index = global_index ): kw[active_index] = array[i,j,k] @@ -1080,15 +1023,15 @@ class EclGrid(BaseCClass): kw[global_index] = int( array[i,j,k] ) else: kw[global_index] = array[i,j,k] - + global_index += 1 return kw raise ValueError("Wrong size / dimension on array") - + def coarse_groups(self): """ - Will return the number of coarse groups in this grid. + Will return the number of coarse groups in this grid. """ return self._num_coarse_groups( ) @@ -1118,12 +1061,12 @@ class EclGrid(BaseCClass): method: value = grid.grid_value( ecl_kw , i , j , k ) - + """ if len(ecl_kw) == self.getNumActive() or len(ecl_kw) == self.getGlobalSize(): array = numpy.ones( [ self.getGlobalSize() ] , dtype = ecl_kw.dtype) * default kwa = ecl_kw.array - if len(ecl_kw) == self.size: + if len(ecl_kw) == self.getGlobalSize(): for i in range(kwa.size): array[i] = kwa[i] else: @@ -1132,12 +1075,15 @@ class EclGrid(BaseCClass): if self.active( global_index = global_index ): array[global_index] = kwa[data_index] data_index += 1 - + array = array.reshape( [self.getNX() , self.getNY() , self.getNZ()] , order = 'F') return array else: - raise ValueError("Keyword: %s has invalid size(%d), must be either nactive:%d or nx*ny*nz:%d" % (ecl_kw.name , ecl_kw.size , self.nactive ,self.size)) - + err_msg_fmt = 'Keyword "%s" has invalid size %d; must be either nactive=%d or nx*ny*nz=%d' + err_msg = err_msg_fmt % (ecl_kw, len(ecl_kw), self.getNumActive(), + self.getGlobalSize()) + raise ValueError(err_msg) + def save_grdecl(self , pyfile, output_unit = EclUnitTypeEnum.ECL_METRIC_UNITS): """ Will write the the grid content as grdecl formatted keywords. @@ -1145,7 +1091,7 @@ class EclGrid(BaseCClass): Will only write the main grid. """ cfile = CFILE( pyfile ) - self._fprintf_grdecl( cfile , output_unit) + self._fprintf_grdecl2( cfile , output_unit) def save_EGRID( self , filename , output_unit = EclUnitTypeEnum.ECL_METRIC_UNITS): """ @@ -1159,7 +1105,7 @@ class EclGrid(BaseCClass): """ self._fwrite_GRID2( filename, output_unit ) - + def write_grdecl( self , ecl_kw , pyfile , special_header = None , default_value = 0): """ Writes an EclKW instance as an ECLIPSE grdecl formatted file. @@ -1167,8 +1113,8 @@ class EclGrid(BaseCClass): The input argument @ecl_kw must be an EclKW instance of size nactive or nx*ny*nz. If the size is nactive the inactive cells will be filled with @default_value; hence the function will - always write nx*ny*nz elements. - + always write nx*ny*nz elements. + The data in the @ecl_kw argument can be of type integer, float, double or bool. In the case of bool the default value must be specified as 1 (True) or 0 (False). @@ -1182,10 +1128,10 @@ class EclGrid(BaseCClass): pyfile.close() """ - + if len(ecl_kw) == self.getNumActive() or len(ecl_kw) == self.getGlobalSize(): cfile = CFILE( pyfile ) - self._fwrite_grdecl2( ecl_kw , special_header , cfile , default_value ) + self._fwrite_grdecl( ecl_kw , special_header , cfile , default_value ) else: raise ValueError("Keyword: %s has invalid size(%d), must be either nactive:%d or nx*ny*nz:%d" % (ecl_kw.getName() , len(ecl_kw) , self.getNumActive() , self.getGlobalSize())) @@ -1198,9 +1144,9 @@ class EclGrid(BaseCClass): def compressedKWCopy(self, kw): if len(kw) == self.getNumActive(): - return kw.copy( ) + return kw.copy( ) elif len(kw) == self.getGlobalSize(): - kw_copy = EclKW( kw.getName() , self.getNumActive() , kw.getEclType()) + kw_copy = EclKW( kw.getName() , self.getNumActive() , kw.data_type) self._compressed_kw_copy( kw_copy , kw) return kw_copy else: @@ -1210,7 +1156,7 @@ class EclGrid(BaseCClass): if len(kw) == self.getGlobalSize( ): return kw.copy( ) elif len(kw) == self.getNumActive(): - kw_copy = EclKW( kw.getName() , self.getGlobalSize() , kw.getEclType()) + kw_copy = EclKW( kw.getName() , self.getGlobalSize() , kw.data_type) kw_copy.assign( default_value ) self._global_kw_copy( kw_copy , kw) return kw_copy @@ -1219,7 +1165,7 @@ class EclGrid(BaseCClass): def exportACTNUMKw(self): - actnum = EclKW.create("ACTNUM" , self.getGlobalSize() , EclTypeEnum.ECL_INT_TYPE) + actnum = EclKW("ACTNUM" , self.getGlobalSize() , EclDataType.ECL_INT) self._init_actnum( actnum.getDataPtr() ) return actnum @@ -1239,7 +1185,7 @@ class EclGrid(BaseCClass): The oil in place calculation shown above could easily be implemented by iterating over the soil kw, however using the - volume keyword has two advantages: + volume keyword has two advantages: 1. The calculation of cell volumes is quite time consuming, by storing the results in a kw they can be reused. @@ -1250,9 +1196,6 @@ class EclGrid(BaseCClass): By default the kw will only have values for the active cells, but by setting the optional variable @active_size to False you will get volume values for all cells in the grid. - """ + """ return self._create_volume_keyword( active_size ) - - - diff --git a/ThirdParty/Ert/python/python/ecl/ecl/ecl_grid_generator.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_grid_generator.py new file mode 100644 index 0000000000..b40e6ca335 --- /dev/null +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_grid_generator.py @@ -0,0 +1,351 @@ +# Copyright (C) 2017 Statoil ASA, Norway. +# +# The file 'ecl_grid_generator.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT 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. +# +# ERT 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 +# for more details. + +import itertools +import numpy + +from ecl.util import IntVector +from ecl.ecl import EclGrid, EclKW, EclDataType, EclPrototype + +class EclGridGenerator: + + _alloc_rectangular = EclPrototype("ecl_grid_obj ecl_grid_alloc_rectangular( int , int , int , double , double , double , int*)" , bind = False) + + @classmethod + def createRectangular(cls, dims , dV , actnum = None): + """ + Will create a new rectangular grid. @dims = (nx,ny,nz) @dVg = (dx,dy,dz) + + With the default value @actnum == None all cells will be active, + """ + if actnum is None: + ecl_grid = cls._alloc_rectangular( dims[0] , dims[1] , dims[2] , dV[0] , dV[1] , dV[2] , None ) + else: + if not isinstance(actnum , IntVector): + tmp = IntVector(initial_size = len(actnum)) + for (index , value) in enumerate(actnum): + tmp[index] = value + actnum = tmp + + if not len(actnum) == dims[0] * dims[1] * dims[2]: + raise ValueError("ACTNUM size mismatch: len(ACTNUM):%d Expected:%d" % (len(actnum) , dims[0] * dims[1] * dims[2])) + ecl_grid = cls._alloc_rectangular( dims[0] , dims[1] , dims[2] , dV[0] , dV[1] , dV[2] , actnum.getDataPtr() ) + + # If we have not succeeded in creatin the grid we *assume* the + # error is due to a failed malloc. + if ecl_grid is None: + raise MemoryError("Failed to allocated regualar grid") + + return ecl_grid + + @classmethod + def createSingleCellGrid(cls, corners): + """ + Provided with the corners of the grid in a similar manner as the eight + corners are output for a single cell, this method will create a grid + consisting of a single cell with the specified corners as its corners. + """ + + zcorn = [corners[i][2] for i in range(8)] + + flatten = lambda l : [elem for sublist in l for elem in sublist] + coord = [(corners[i], corners[i+4]) for i in range(4)] + coord = flatten(flatten(coord)) + + def constructFloatKW(name, values): + kw = EclKW(name, len(values), EclDataType.ECL_FLOAT) + for i in range(len(values)): + kw[i] = values[i] + return kw + + grid = EclGrid.create((1,1,1), constructFloatKW("ZCORN", zcorn), constructFloatKW("COORD", coord), None) + + if not corners == [grid.getCellCorner(i, 0) for i in range(8)]: + raise AssertionError("Failed to generate single cell grid. " + + "Did not end up the expected corners.") + + return grid + + @classmethod + def createGrid(cls, dims, dV, offset=1, + escape_origo_shift=(1,1,0), + irregular_offset=False, irregular=False, concave=False, + faults=False, scale=1, translation=(0,0,0), rotate=False, + misalign=False): + """ + Will create a new grid where each cell is a parallelogram (skewed by z-value). + The number of cells are given by @dims = (nx, ny, nz) and the dimention + of each cell by @dV = (dx, dy, dz). + + All cells are guaranteed to not be self-intersecting. Hence, no twisted + cells and somewhat meaningfull cells. + + @offset gives how much the layers should fluctuate or "wave" as you + move along the X-axis. + + @irregular_offset decides whether the offset should be constant or + increase by dz/2 every now and then. + + @irregular if true some of the layers will be inclining and others + declining at the start. + + @concave decides whether the cells are to be convex or not. In + particular, if set to False, all cells of the grid will be concave. + + @escape_origo_shift is used to prevent any cell of having corners in (0,0,z) + as there is a heuristic in ecl_grid.c that marks such cells as tainted. + + @faults decides if there are to be faults in the grid. + + @scale A positive number that scales the "lower" endpoint of all + coord's. In particular, @scale != 1 creates trapeziod cells in both the XZ + and YZ-plane. + + @translation the lower part of the grid is translated ("slided") by the specified + additive factor. + + @rotate the lower part of the grid is rotated 90 degrees around its + center. + + @misalign will toggle COORD's slightly in various directions to break + alignment + + Note that cells in the lowermost layer can have multiple corners + at the same point. + + For testing it should give good coverage of the various scenarios this + method can produce, by leting @dims be (10,10,10), @dV=(2,2,2), @offset=1, + and try all 4 different configurations of @concave and + @irregular_offset. + """ + + nx, ny, nz = dims + dx, dy, dz = dV + + # Validate arguments + if min(dims + dV) <= 0: + raise ValueError("Expected positive grid and cell dimentions") + + if offset < 0: + raise ValueError("Expected non-negative offset") + + if irregular and offset + (dz/2. if irregular_offset else 0) > dz: + raise AssertionError("Arguments can result in self-" + + "intersecting cells. Increase dz, deactivate eiter " + + "irregular or irregular_offset, or decrease offset to avoid " + + "any problems") + + verbose = lambda l : [elem for elem in l for i in range(2)][1:-1:] + flatten = lambda l : [elem for sublist in l for elem in sublist] + + # Compute zcorn + z = escape_origo_shift[2] + zcorn = [z]*(4*nx*ny) + for k in range(nz-1): + z = z+dz + local_offset = offset + (dz/2. if irregular_offset and k%2 == 0 else 0) + + layer = [] + for i in range(ny+1): + shift = ((i if concave else 0) + (k/2 if irregular else 0)) % 2 + path = [z if i%2 == shift else z+local_offset for i in range(nx+1)] + layer.append(verbose(path)) + + zcorn = zcorn + (2*flatten(verbose(layer))) + + z = z+dz + zcorn = zcorn + ([z]*(4*nx*ny)) + + if faults: + # Ensure that drop does not align with grid structure + drop = (offset+dz)/2. if abs(offset-dz/2.) > 0.2 else offset + 0.4 + zcorn = cls.__createFaults(nx, ny, nz, zcorn, drop) + + cls.assertZcorn(nx, ny, nz, zcorn) + + # Compute coord + coord = [] + for j, i in itertools.product(range(ny+1), range(nx+1)): + x, y = i*dx+escape_origo_shift[0], j*dy+escape_origo_shift[1] + coord = coord + [x, y, escape_origo_shift[2], x, y, z] + + # Apply transformations + lower_center = ( + nx*dx/2. + escape_origo_shift[0], + ny*dy/2. + escape_origo_shift[1] + ) + + if misalign: + coord = cls.__misalignCoord(coord, dims, dV) + + coord = cls.__scaleCoord(coord, scale, lower_center) + + if rotate: + coord = cls.__rotateCoord(coord, lower_center) + + coord = cls.__translateCoord(coord, translation) + + cls.assertCoord(nx, ny, nz, coord) + + # Construct grid + def constructFloatKW(name, values): + kw = EclKW(name, len(values), EclDataType.ECL_FLOAT) + for i in range(len(values)): + kw[i] = values[i] + return kw + + return EclGrid.create(dims, constructFloatKW("ZCORN", zcorn), constructFloatKW("COORD", coord), None) + + @classmethod + def __createFaults(cls, nx, ny, nz, zcorn, drop): + """ + Will create several faults consisting of all cells such that either its + i or j index is 1 modulo 3. + """ + + plane_size = 4*nx*ny + for x, y, z in itertools.product(range(nx), range(ny), range(nz)): + if x%3 != 1 and y%3 != 1: + continue + + corner = [0]*8 + corner[0] = 2*z*plane_size + 4*y*nx + 2*x + corner[1] = corner[0] + 1 + corner[2] = corner[0] + 2*nx + corner[3] = corner[2] + 1 + + for i in range(4, 8): + corner[i] = corner[i-4] + plane_size + + for c in corner: + zcorn[c] = zcorn[c] + drop + + return zcorn + + @classmethod + def assertZcorn(cls, nx, ny, nz, zcorn): + """ + + Raises an AssertionError if the zcorn is not as expected. In + patricular, it is verified that: + + - zcorn has the approperiate length (8*nx*ny*nz) and + - that no cell is twisted. + + """ + + if len(zcorn) != 8*nx*ny*nz: + raise AssertionError( + "Expected len(zcorn) to be %d, was %d" % + (8*nx*ny*nz, len(zcorn)) + ) + + plane_size = 4*nx*ny + for p in range(8*nx*ny*nz - plane_size): + if zcorn[p] > zcorn[p + plane_size]: + raise AssertionError( + "Twisted cell was created. " + + "Decrease offset or increase dz to avoid this!" + ) + + @classmethod + def __scaleCoord(cls, coord, scale, lower_center): + coord = numpy.array([ + map(float, coord[i:i+6:]) + for i in range(0, len(coord), 6) + ]) + origo = numpy.array(3*[0.] + list(lower_center) + [0]) + scale = numpy.array(3*[1.] + 2*[scale] + [1]) + + coord = scale * (coord-origo) + origo + return coord.flatten().tolist() + + @classmethod + def __misalignCoord(cls, coord, dims, dV): + nx, ny, nz = dims + + coord = numpy.array([ + map(float, coord[i:i+6:]) + for i in range(0, len(coord), 6) + ]) + + adjustment = numpy.array([ + (0, 0, 0, i*dV[0]/2., j*dV[1]/2., 0) for i, j in itertools.product([-1, 0, 1], repeat=2) + ]) + + for i, c in enumerate(coord): + # Leave the outermost coords alone + if i < nx+1 or i >= len(coord)-(nx+1): + continue + if i%(nx+1) in [0, nx]: + continue + + c += adjustment[i%len(adjustment)] + + return coord.flatten().tolist() + + @classmethod + def __rotateCoord(cls, coord, lower_center): + coord = numpy.array([ + map(float, coord[i:i+6:]) + for i in range(0, len(coord), 6) + ]) + + origo = numpy.array(3*[0.] + list(lower_center) + [0]) + coord -= origo + + for c in coord: + c[3], c[4] = -c[4], c[3] + + coord += origo + return coord.flatten().tolist() + + @classmethod + def __translateCoord(cls, coord, translation): + coord = numpy.array([ + map(float, coord[i:i+6:]) + for i in range(0, len(coord), 6) + ]) + translation = numpy.array(3*[0.] + list(translation)) + + coord = coord + translation + return coord.flatten().tolist() + + @classmethod + def assertCoord(cls, nx, ny, nz, coord): + """ + + Raises an AssertionError if the coord is not as expected. In + particular, it is verfied that: + + - coord has the approperiate length (6*(nx+1)*(ny+1)) and + - that all values are positive. + + """ + + if len(coord) != 6*(nx+1)*(ny+1): + raise AssertionError( + "Expected len(coord) to be %d, was %d" % + (6*(nx+1)*(ny+1), len(coord)) + ) + + if min(coord) < 0: + raise AssertionError("Negative COORD values was generated. " + + "This is likely due to a tranformation. " + + "Increasing the escape_origio_shift will most likely " + + "fix the problem") + + diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_init_file.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_init_file.py similarity index 94% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_init_file.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_init_file.py index 587f194c3b..0b53571149 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_init_file.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_init_file.py @@ -14,7 +14,7 @@ # See the GNU General Public License at # for more details. -from ert.ecl import EclFileEnum , EclFile, Ecl3DKW , Ecl3DFile +from ecl.ecl import EclFileEnum , EclFile, Ecl3DKW , Ecl3DFile class EclInitFile(Ecl3DFile): diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_kw.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_kw.py similarity index 80% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_kw.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_kw.py index 2ea130f0da..dac994f3cb 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_kw.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_kw.py @@ -1,18 +1,18 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'ecl_kw.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. +# Copyright (C) 2011 Statoil ASA, Norway. +# +# The file 'ecl_kw.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT 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. +# +# ERT 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 +# for more details. """ Support for working with one keyword from ECLIPSE file. @@ -22,11 +22,11 @@ of a simple header and blocks of data. A keyword typically looks like: 'SWAT ' 10000 'REAL' 0.05 0.08 0.08 0.10 0.11 0.11 0.10 0.09 - .... + .... I.e. it starts with of header consisting of a 8 characters name, a length and a datatype, immediately followed by the actual -data. +data. Altough the term "restart format" is used to describe the format, this particular format is not limited to restart files; it is (at least) @@ -37,24 +37,42 @@ files. This module also has (some) support for working with GRDECL The ecl_kw.py implementation wraps the ecl_kw.c implementation from the libecl library. """ + +from __future__ import absolute_import, division, print_function, unicode_literals + import ctypes -import types import warnings import numpy from cwrap import CFILE, BaseCClass -from ert.ecl import EclTypeEnum, EclUtil, EclPrototype +from ecl.ecl import EclDataType +from ecl.ecl import EclTypeEnum, EclUtil, EclPrototype +def dump_type_deprecation_warning(): + warnings.warn("EclTypeEnum is deprecated. " + + "You should instead provide an EclDataType", + DeprecationWarning) -class classprop(object): - def __init__(self , f): - self.f = classmethod( f ) - - def __get__(self , *a): - return self.f.__get__(*a)() - +def constant_size_data_type(ecl_type): + return (ecl_type in [ + EclTypeEnum.ECL_CHAR_TYPE, + EclTypeEnum.ECL_FLOAT_TYPE, + EclTypeEnum.ECL_DOUBLE_TYPE, + EclTypeEnum.ECL_INT_TYPE, + EclTypeEnum.ECL_BOOL_TYPE, + EclTypeEnum.ECL_MESS_TYPE + ]) +def warn_and_cast_data_type(data_type): + if isinstance(data_type, EclDataType): + return data_type + if isinstance(data_type, EclTypeEnum): + if not constant_size_data_type(data_type): + raise ValueError("Cannot cast EclTypeEnum (%d) to EclDataType due " + "to non-constant size. Please provide an EclDataType instead.") + dump_type_deprecation_warning() + return EclDataType(data_type) class EclKW(BaseCClass): """ @@ -75,11 +93,11 @@ class EclKW(BaseCClass): int_kw_set = set( ["PVTNUM" , "FIPNUM" , "EQLNUM" , "FLUXNUM" , "MULTNUM" , "ACTNUM" , "SPECGRID" , "REGIONS"] ) TYPE_NAME = "ecl_kw" - _alloc_new = EclPrototype("void* ecl_kw_alloc( char* , int , ecl_type_enum )", bind = False) + _alloc_new = EclPrototype("void* ecl_kw_alloc_python( char* , int , ecl_data_type )", bind = False) _fread_alloc = EclPrototype("ecl_kw_obj ecl_kw_fread_alloc( fortio )" , bind = False) - _load_grdecl = EclPrototype("ecl_kw_obj ecl_kw_fscanf_alloc_grdecl_dynamic__( FILE , char* , bool , int )" , bind = False) + _load_grdecl = EclPrototype("ecl_kw_obj ecl_kw_fscanf_alloc_grdecl_dynamic_python( FILE , char* , bool , ecl_data_type )" , bind = False) _fseek_grdecl = EclPrototype("bool ecl_kw_grdecl_fseek_kw(char* , bool , FILE )" , bind = False) - + _sub_copy = EclPrototype("ecl_kw_obj ecl_kw_alloc_sub_copy( ecl_kw , char*, int , int)") _copyc = EclPrototype("ecl_kw_obj ecl_kw_alloc_copy( ecl_kw )") _slice_copyc = EclPrototype("ecl_kw_obj ecl_kw_alloc_slice_copy( ecl_kw , int , int , int )") @@ -91,6 +109,8 @@ class EclKW(BaseCClass): _get_type = EclPrototype("ecl_type_enum ecl_kw_get_type( ecl_kw )") _iget_char_ptr = EclPrototype("char* ecl_kw_iget_char_ptr( ecl_kw , int )") _iset_char_ptr = EclPrototype("void ecl_kw_iset_char_ptr( ecl_kw , int , char*)") + _iget_string_ptr = EclPrototype("char* ecl_kw_iget_string_ptr( ecl_kw , int )") + _iset_string_ptr = EclPrototype("void ecl_kw_iset_string_ptr( ecl_kw , int, char*)") _iget_bool = EclPrototype("bool ecl_kw_iget_bool( ecl_kw , int)") _iset_bool = EclPrototype("bool ecl_kw_iset_bool( ecl_kw , int, bool)") _iget_int = EclPrototype("int ecl_kw_iget_int( ecl_kw , int )") @@ -103,6 +123,7 @@ class EclKW(BaseCClass): _fwrite = EclPrototype("void ecl_kw_fwrite( ecl_kw , fortio )") _get_header = EclPrototype("char* ecl_kw_get_header ( ecl_kw )") _set_header = EclPrototype("void ecl_kw_set_header_name ( ecl_kw , char*)") + _get_data_type = EclPrototype("ecl_data_type_obj ecl_kw_get_data_type_python(ecl_kw)"); _int_sum = EclPrototype("int ecl_kw_element_sum_int( ecl_kw )") _float_sum = EclPrototype("double ecl_kw_element_sum_float( ecl_kw )") @@ -114,12 +135,11 @@ class EclKW(BaseCClass): _equal = EclPrototype("bool ecl_kw_equal( ecl_kw , ecl_kw )") _equal_numeric = EclPrototype("bool ecl_kw_numeric_equal( ecl_kw , ecl_kw , double , double)") - _assert_binary = EclPrototype("bool ecl_kw_assert_binary_numeric( ecl_kw , ecl_kw )") + _assert_binary = EclPrototype("bool ecl_kw_size_and_numeric_type_equal( ecl_kw , ecl_kw )") _scale_int = EclPrototype("void ecl_kw_scale_int( ecl_kw , int )") _scale_float = EclPrototype("void ecl_kw_scale_float_or_double( ecl_kw , double )") _shift_int = EclPrototype("void ecl_kw_shift_int( ecl_kw , int )") _shift_float = EclPrototype("void ecl_kw_shift_float_or_double( ecl_kw , double )") - _assert_numeric = EclPrototype("bool ecl_kw_assert_numeric( ecl_kw )") _copy_data = EclPrototype("void ecl_kw_memcpy_data( ecl_kw , ecl_kw )") _set_int = EclPrototype("void ecl_kw_scalar_set_int( ecl_kw , int )") _set_float = EclPrototype("void ecl_kw_scalar_set_float_or_double( ecl_kw , double )") @@ -130,7 +150,7 @@ class EclKW(BaseCClass): _fix_uninitialized = EclPrototype("void ecl_kw_fix_uninitialized( ecl_kw ,int , int , int, int*)") _first_different = EclPrototype("int ecl_kw_first_different( ecl_kw , ecl_kw , int , double, double)") _resize = EclPrototype("void ecl_kw_resize( ecl_kw , int)") - + @classmethod def createCReference(cls, c_ptr, parent=None): ecl_kw = super(EclKW, cls).createCReference(c_ptr , parent = parent) @@ -150,8 +170,8 @@ class EclKW(BaseCClass): ecl_kw.__private_init() return ecl_kw - - + + @classmethod def add_int_kw(cls , kw): """Will add keyword @kw to the standard set of integer keywords.""" @@ -162,57 +182,29 @@ class EclKW(BaseCClass): """Will remove keyword @kw from the standard set of integer keywords.""" cls.int_kw_set.discard( kw ) - @classprop - def int_kw( cls ): - warnings.warn("The EclKW.int_kw class property has been deprecated - use class method: EclKW.intKeywords( )" , DeprecationWarning ) - return cls.intKeywords( ) - - @classmethod def intKeywords(cls): """Will return the current set of integer keywords.""" return cls.int_kw_set - - - @classmethod - def create( cls , name, size , data_type): - """ - Creates a brand new EclKW instance. - - This method will create a grand spanking new EclKW - instance. The instance will get name @name (silently truncated - to eight characters), @size elements and datatype @data_type. Using - this method you could create a SOIL keyword with: - - soil_kw = EclKW.create( "SOIL" , 10000 , ECL_FLOAT_TYPE ) - - """ - warnings.warn("The EclKW.create( ) method has been deprecated - use EclKW( %s , %s , %s )" % (name , size , data_type) , DeprecationWarning ) - return cls( name , size , data_type ) - - - - - def slice_copy( self , slice_range ): (start , stop , step) = slice_range.indices( len(self) ) if stop > start: return self._slice_copyc( start , stop , step) else: return None - + def copy( self ): """ Will create a deep copy of the current kw instance. """ return self._copyc( ) - - + + @classmethod def read_grdecl( cls , fileH , kw , strict = True , ecl_type = None): """ @@ -220,7 +212,7 @@ class EclKW(BaseCClass): This constructor can be used to load an EclKW instance from a grdecl formatted file; the input files for petrophysical - properties are typically given as grdecl files. + properties are typically given as grdecl files. The @file argument should be a Python filehandle to an open file. The @kw argument should be the keyword header you are @@ -236,7 +228,7 @@ class EclKW(BaseCClass): program to create grdecl files with more than 8 character length headers, this implementation will refuse to even try loading them. In that case you will have to rename the - keywords in your file - sorry. A TypeError exception + keywords in your file - sorry. A TypeError exception will be raised if @kw has more than 8 characters. The implementation in ert can read integer and float type @@ -247,12 +239,12 @@ class EclKW(BaseCClass): of presedence, is as follows: 1. The optional argument @ecl_type can be used to specify - the type: + the type: - special_int_kw = EclKW.read_grdecl( fileH , 'INTKW' , ecl_type = ECL_INT_TYPE ) + special_int_kw = EclKW.read_grdecl( fileH , 'INTKW' , ecl_type = ECL_INT ) - If ecl_type is different from ECL_INT_TYPE or - ECL_FLOAT_TYPE a TypeError exception will be raised. + If ecl_type is different from ECL_INT or + ECL_FLOAT a TypeError exception will be raised. If ecl_type == None (the default), the method will continue to point 2. or 3. to determine the correct type. @@ -262,44 +254,50 @@ class EclKW(BaseCClass): 'int_kw_set' the type will be ECL_INT_TYPE. pvtnum_kw = EclKW.read_grdecl( fileH , 'PVTNUM' ) - + Observe that (currently) no case conversions take place when checking the 'int_kw_set'. The current built in set is accesible through the int_kw property. - 3. Otherwise the default is float, i.e. ECL_FLOAT_TYPE. + 3. Otherwise the default is float, i.e. ECL_FLOAT. + EclKw reads grdecl with EclDataType poro_kw = EclKW.read_grdecl( fileH , 'PORO') - + Observe that since the grdecl files are quite weakly structured it is difficult to verify the integrity of the files, malformed input might therefor pass unnoticed before things blow up at a later stage. - + [1]: It is possible, but not recommended, to pass in None for @kw, in which case the method will load the first keyword it finds in the file. """ - + cfile = CFILE( fileH ) if kw: if len(kw) > 8: raise TypeError("Sorry keyword:%s is too long, must be eight characters or less." % kw) - + if ecl_type is None: if cls.int_kw_set.__contains__( kw ): - ecl_type = EclTypeEnum.ECL_INT_TYPE + ecl_type = EclDataType.ECL_INT else: - ecl_type = EclTypeEnum.ECL_FLOAT_TYPE + ecl_type = EclDataType.ECL_FLOAT - if not ecl_type in [EclTypeEnum.ECL_FLOAT_TYPE , EclTypeEnum.ECL_INT_TYPE]: - raise TypeError("The type:%d is invalid when loading keyword:%s" % (ecl_type , kw)) + ecl_type = warn_and_cast_data_type(ecl_type) + + if not isinstance(ecl_type, EclDataType): + raise TypeError("Expected EclDataType, was: %s" % type(ecl_type)) + + if not ecl_type in [EclDataType.ECL_FLOAT , EclDataType.ECL_INT]: + raise ValueError("The type:%s is invalid when loading keyword:%s" % (ecl_type.type_name, kw)) return cls._load_grdecl( cfile , kw , strict , ecl_type ) - + @classmethod def fseek_grdecl( cls , fileH , kw , rewind = False): """ @@ -309,7 +307,7 @@ class EclKW(BaseCClass): pointer will be positioned at the start of the kw, if the search fails the function will return false and the file pointer will be repositioned at the position it had prior to - the call. + the call. Only @kw instances which are found at the beginning of a line (with optional leading space characters) are considered, @@ -318,7 +316,7 @@ class EclKW(BaseCClass): -- PERMX EQUIL PERMX / - + The function will start searching from the current position in the file and forwards, if the optional argument @rewind is @@ -327,15 +325,6 @@ class EclKW(BaseCClass): """ cfile = CFILE( fileH ) return cls._fseek_grdecl( kw , rewind , cfile) - - - - @classmethod - def grdecl_load( cls , file , kw , ecl_type = EclTypeEnum.ECL_FLOAT_TYPE): - """Use read_grdecl() instead.""" - warnings.warn("The grdecl_load method has been renamed to read_grdecl()" , DeprecationWarning) - return cls.read_grdecl(file , kw , ecl_type ) - @classmethod @@ -373,42 +362,49 @@ class EclKW(BaseCClass): """ if len(name) > 8: raise ValueError("Sorry - maximum eight characters in keyword name") + + data_type = warn_and_cast_data_type(data_type) + + if not isinstance(data_type, EclDataType): + raise TypeError("Expected an EclDataType, received: %s" % + type(data_type)) + c_ptr = self._alloc_new( name , size , data_type ) super(EclKW, self).__init__(c_ptr) self.__private_init() - + def __private_init(self): self.data_ptr = None - ecl_type = self._get_type( ) - if ecl_type == EclTypeEnum.ECL_INT_TYPE: + if self.data_type.is_int(): self.data_ptr = self._int_ptr( ) - self.dtype = numpy.int32 + self.dtype = numpy.int32 self.str_fmt = "%8d" - elif ecl_type == EclTypeEnum.ECL_FLOAT_TYPE: + elif self.data_type.is_float(): self.data_ptr = self._float_ptr( ) self.dtype = numpy.float32 self.str_fmt = "%13.4f" - elif ecl_type == EclTypeEnum.ECL_DOUBLE_TYPE: + elif self.data_type.is_double(): self.data_ptr = self._double_ptr( ) - self.dtype = numpy.float64 + self.dtype = numpy.float64 self.str_fmt = "%13.4f" else: # Iteration not supported for CHAR / BOOL self.data_ptr = None self.dtype = None - if ecl_type == EclTypeEnum.ECL_CHAR_TYPE: + if self.data_type.is_char(): self.str_fmt = "%8s" - elif ecl_type == EclTypeEnum.ECL_BOOL_TYPE: + elif self.data_type.is_bool(): self.str_fmt = "%d" - else: + elif self.data_type.is_mess(): self.str_fmt = "%s" #"Message type" - - + elif self.data_type.is_string(): + self.str_fmt = "%" + str(self.data_type.element_size) + "s" + else: + raise ValueError("Unknown EclDataType (%s)!" % self.data_type.type_name) - def sub_copy(self , offset , count , new_header = None): """ Will create a new block copy of the src keyword. @@ -423,25 +419,24 @@ class EclKW(BaseCClass): new1 = src.sub_copy(0 , 10, new_header = "NEW1") new2 = src.sub_copy(10 , -1 , new_header = "NEW2") - + If the count or index arguments are in some way invalid the method will raise IndexError. """ - if offset < 0 or offset >= self.size: - raise IndexError("Offset:%d invalid - valid range:[0,%d)" % (offset , self.size)) + if offset < 0 or offset >= len(self): + raise IndexError("Offset:%d invalid - valid range:[0,%d)" % (offset , len(self))) - if offset + count > self.size: + if offset + count > len(self): raise IndexError("Invalid value of (offset + count):%d" % (offset + count)) return self._sub_copy( new_header , offset , count ) - + def isNumeric(self): """ Will check if the keyword contains numeric data, i.e int, float or double. """ - return self._assert_numeric( ) - + return self.data_type.is_numeric() def ecl_kw_instance( self ): return True @@ -454,7 +449,7 @@ class EclKW(BaseCClass): """ return self._get_size( ) - + def __deep_copy__(self , memo): """ Python special routine used to perform deep copy. @@ -471,7 +466,7 @@ class EclKW(BaseCClass): length = self.__len__() if index < 0: # We allow one level of negative indexing - index += self.size + index += len(self) if index < 0 or index >= length: raise IndexError @@ -479,11 +474,12 @@ class EclKW(BaseCClass): if self.data_ptr: return self.data_ptr[ index ] else: - ecl_type = self.getEclType( ) - if ecl_type == EclTypeEnum.ECL_BOOL_TYPE: + if self.data_type.is_bool(): return self._iget_bool( index) - elif ecl_type == EclTypeEnum.ECL_CHAR_TYPE: + elif self.data_type.is_char(): return self._iget_char_ptr( index ) + elif self.data_type.is_string(): + return self._iget_string_ptr( index ) else: raise TypeError("Internal implementation error ...") elif isinstance( index , slice): @@ -496,11 +492,11 @@ class EclKW(BaseCClass): """ Function to support index based assignment: kw[index] = value """ - if isinstance( index , types.IntType): + if isinstance( index , int): length = len(self) if index < 0: # Will only wrap backwards once - index = self.size + index + index = len(self) + index if index < 0 or index >= length: raise IndexError @@ -508,11 +504,12 @@ class EclKW(BaseCClass): if self.data_ptr: self.data_ptr[ index ] = value else: - ecl_type = self.getEclType( ) - if ecl_type == EclTypeEnum.ECL_BOOL_TYPE: + if self.data_type.is_bool(): self._iset_bool( index , value) - elif ecl_type == EclTypeEnum.ECL_CHAR_TYPE: + elif self.data_type.is_char(): return self._iset_char_ptr( index , value) + elif self.data_type.is_string(): + return self._iset_string_ptr( index, value) else: raise SystemError("Internal implementation error ...") elif isinstance( index , slice): @@ -526,7 +523,7 @@ class EclKW(BaseCClass): ################################################################# - + def __IMUL__(self , factor , mul = True): if self.isNumeric(): @@ -542,8 +539,7 @@ class EclKW(BaseCClass): if not mul: factor = 1.0 / factor - ecl_type = self.getEclType( ) - if ecl_type == EclTypeEnum.ECL_INT_TYPE: + if self.data_type.is_int(): if isinstance( factor , int ): self._scale_int( factor ) else: @@ -555,9 +551,9 @@ class EclKW(BaseCClass): raise TypeError("Only muliplication with scalar supported") else: raise TypeError("Not numeric type") - + return self - + def __IADD__(self , delta , add = True): if self.isNumeric(): @@ -575,8 +571,7 @@ class EclKW(BaseCClass): else: sign = -1 - ecl_type = self.getEclType( ) - if ecl_type == EclTypeEnum.ECL_INT_TYPE: + if self.data_type.is_int(): if isinstance( delta , int ): self._shift_int( delta * sign) else: @@ -588,7 +583,7 @@ class EclKW(BaseCClass): raise TypeError("Type mismatch") else: raise TypeError("Type / size mismatch") - + return self def __iadd__(self , delta): @@ -605,7 +600,7 @@ class EclKW(BaseCClass): ################################################################# - + def __abs__(self): if self.isNumeric(): copy = self.copy() @@ -613,9 +608,9 @@ class EclKW(BaseCClass): return copy else: raise TypeError("The __abs__() function is only implemented for numeric types") - - + + def __add__(self , delta): copy = self.copy() copy += delta @@ -630,8 +625,8 @@ class EclKW(BaseCClass): return copy def __rsub__( self , delta): - return self.__sub__( delta ) * -1 - + return self.__sub__( delta ) * -1 + def __mul__(self , factor): copy = self.copy() copy *= factor @@ -639,12 +634,12 @@ class EclKW(BaseCClass): def __rmul__(self , factor): return self.__mul__( factor ) - + def __div__(self , factor): copy = self.copy() copy /= factor return copy - + # No __rdiv__() def sum(self): @@ -654,21 +649,20 @@ class EclKW(BaseCClass): String: Raise ValueError exception. Bool: The number of true values """ - ecl_type = self.getEclType( ) - if ecl_type == EclTypeEnum.ECL_CHAR_TYPE: - raise ValueError("The keyword:%s is of string type - sum is not implemented" % self.get_name()) - elif ecl_type == EclTypeEnum.ECL_INT_TYPE: + if self.data_type.is_int(): return self._int_sum( ) - elif ecl_type == EclTypeEnum.ECL_FLOAT_TYPE: + elif self.data_type.is_float(): return self._float_sum( ) - elif ecl_type == EclTypeEnum.ECL_DOUBLE_TYPE: + elif self.data_type.is_double(): return self._float_sum( ) - elif ecl_type == EclTypeEnum.ECL_BOOL_TYPE: + elif self.data_type.is_bool(): sum = 0 for elm in self: if elm: sum += 1 return sum + else: + raise ValueError('The keyword "%s" is of string type - sum is not implemented' % self.getName()) @@ -680,7 +674,7 @@ class EclKW(BaseCClass): return self._assert_binary( other ) ################################################################# - + def assign(self , value , mask = None , force_active = False): """ Assign a value to current kw instance. @@ -698,7 +692,7 @@ class EclKW(BaseCClass): to only parts of the EclKW. In the example below we select all the elements with PORO below 0.10, and then assign EQLNUM value 88 to those cells: - + grid = ecl.EclGrid("ECLIPSE.EGRID") reg = ecl.EclRegion( grid , false ) init = ecl.EclFile("ECLIPSE.INIT") @@ -706,9 +700,9 @@ class EclKW(BaseCClass): poro = init["PORO"][0] eqlnum = init["EQLNUM"][0] reg.select_below( poro , 0.10 ) - + eqlnum.assign( 88 , mask = reg ) - + The EclRegion instance has two equivalent sets of selected indices; one consisting of active indices and one consisting of global indices. By default the assign() method will select @@ -732,8 +726,7 @@ class EclKW(BaseCClass): if mask: mask.set_kw( self , value , force_active ) else: - ecl_type = self.getEclType( ) - if ecl_type == EclTypeEnum.ECL_INT_TYPE: + if self.data_type.is_int(): if isinstance( value , int ): self._set_int( value ) else: @@ -754,7 +747,7 @@ class EclKW(BaseCClass): mask.iadd_kw( self , other , force_active ) else: return self.__iadd__( other ) - + def sub(self , other , mask = None , force_active = False): """ See method assign() for documentation of optional arguments @@ -804,7 +797,7 @@ class EclKW(BaseCClass): kw.apply( math.sin ) kw.apply( cutoff , arg = 0.10 ) - + See method assign() for documentation of optional arguments @mask and @force_active. """ @@ -818,10 +811,10 @@ class EclKW(BaseCClass): self.data_ptr[index] = func( self.data_ptr[index] ) else: if arg: - for i in range(self.size): + for i in range(len(self)): self.data_ptr[i] = func( self.data_ptr[i] , arg) else: - for i in range(self.size): + for i in range(len(self)): self.data_ptr[i] = func( self.data_ptr[i] ) @@ -879,61 +872,15 @@ class EclKW(BaseCClass): The number of bytes this keyword would occupy in a BINARY file. """ return self._get_fortio_size( ) - - - @property - def fortio_size(self): - warnings.warn("The fortio_size property is deprecated - use method fortIOSize()" , DeprecationWarning) - return self.fortIOSize() - - - @property - def size(self): - warnings.warn("The size property is deprecated - use built in len(..) " , DeprecationWarning) - return len(self) def setName( self , name ): if len(name) > 8: raise ValueError("Sorry: the name property must be max 8 characters long :-(") self._set_header( name ) - - def set_name( self , name ): - warnings.warn("The set_name method is deprectaed - use setName( )" , DeprecationWarning) - self.setName( name ); - - - def get_name( self ): - warnings.warn("The set_name method is deprectaed - use getName( )" , DeprecationWarning) - return self.getName() - - - name = property( get_name , set_name ) - def getName(self): - return self._get_header( ) - - - @property - def min_max( self ): - warnings.warn("The min_max property has been renamed to method getMinMax()" , DeprecationWarning) - return self.getMinMax() - - - @property - def max( self ): - warnings.warn("The max property has been renamed to method getMax()" , DeprecationWarning) - mm = self.getMinMax() - return mm[1] - - - @property - def min( self ): - warnings.warn("The min property has been renamed to method getMin()" , DeprecationWarning) - mm = self.getMinMax() - return mm[0] - - + n = self._get_header( ) + return str(n) if n else '' def resize(self , new_size): """ @@ -947,7 +894,7 @@ class EclKW(BaseCClass): # need to call the __private_init() method again. self.__private_init() - + def getMinMax(self): """ Will return a touple (min,max) for numerical types. @@ -955,16 +902,15 @@ class EclKW(BaseCClass): Will raise TypeError exception if the keyword is not of numerical type. """ - ecl_type = self.getEclType( ) - if ecl_type == EclTypeEnum.ECL_FLOAT_TYPE: + if self.data_type.is_float(): min_ = ctypes.c_float() max_ = ctypes.c_float() self._max_min_float( ctypes.byref( max_ ) , ctypes.byref( min_ )) - elif ecl_type == EclTypeEnum.ECL_DOUBLE_TYPE: + elif self.data_type.is_double(): min_ = ctypes.c_double() max_ = ctypes.c_double() self._max_min_double( ctypes.byref( max_ ) , ctypes.byref( min_ )) - elif ecl_type == EclTypeEnum.ECL_INT_TYPE: + elif self.data_type.is_int(): min_ = ctypes.c_int() max_ = ctypes.c_int() self._max_min_int( ctypes.byref( max_ ) , ctypes.byref( min_ )) @@ -976,47 +922,41 @@ class EclKW(BaseCClass): def getMax( self ): mm = self.getMinMax() return mm[1] - - + + def getMin( self ): mm = self.getMinMax() return mm[0] - - @property - def numeric(self): - warnings.warn("The numeric property has been renamed to method isNumeric()" , DeprecationWarning) - return self.isNumeric( ) - - @property def type( self ): return self.getEclType() @property - def type_name( self ): - return self.typeName( ) + def data_type( self ): + return self._get_data_type() - def typeName(self): - return EclUtil.type_name( self.getEclType( )) + @property + def type_name( self ): + return self.data_type.type_name + + def typeName( self ): + return self.data_type.type_name def getEclType(self): + warnings.warn("EclTypeEnum is deprecated. " + + "You should instead provide an EclDataType", + DeprecationWarning) + return self._get_type( ) - - + + @property - def header( self ): - return (self.name , self.size , self.type_name ) + def header(self): + return (self.getName(), len(self), self.typeName()) - - def iget( self , index ): - from warnings import warn - warn("The iget() method is deprecated use array notation: kw[index] instead.", DeprecationWarning) - return self.__getitem__( index ) - - @property def array(self): a = self.data_ptr @@ -1025,7 +965,7 @@ class EclKW(BaseCClass): a.__parent__ = self # Inhibit GC return a - + def str_data( self , width , index1 , index2 , fmt): """ Helper function for str() method. @@ -1040,7 +980,7 @@ class EclKW(BaseCClass): s+= "\n" return s - + def str(self , width = 5 , max_lines = 10 , fmt = None): """ Return string representation of kw for pretty printing. @@ -1059,19 +999,19 @@ class EclKW(BaseCClass): the elements. The implementation of the builtin method __str__() is based on this method. """ - s = "%-8s %8d %-4s\n" % (self.name , self.size , self.type_name) - lines = self.size / width + s = "%-8s %8d %-4s\n" % (self.getName() , len(self) , self.typeName()) + lines = len(self) // width if not fmt: fmt = self.str_fmt + " " if max_lines is None or lines <= max_lines: - s += self.str_data( width , 0 , self.size , fmt) + s += self.str_data( width , 0 , len(self) , fmt) else: - s1 = width * max_lines / 2 + s1 = width * max_lines // 2 s += self.str_data( width , 0 , s1 , fmt) s += " .... \n" - s += self.str_data( width , self.size - s1 , self.size , fmt) - + s += self.str_data( width , len(self) - s1 , len(self) , fmt) + return s def __str__(self): @@ -1097,7 +1037,7 @@ class EclKW(BaseCClass): ct = ctypes.c_int else: raise ValueError("Invalid type - numpy array only valid for int/float/double") - + ap = ctypes.cast(self.data_ptr, ctypes.POINTER(ct * len(self))) return numpy.frombuffer(ap.contents, dtype = self.dtype) @@ -1113,21 +1053,7 @@ class EclKW(BaseCClass): """ view = self.numpyView( ) return numpy.copy( view ) - - @property - def numpy_array( self ): - warnings.warn("The EclKW.numpy_array property has been deprecated - use method: numpyView( ) or numpyCopy( ) instead" , DeprecationWarning ) - if self.data_ptr: - a = self.array - value = numpy.zeros( a.size , dtype = self.dtype) - for i in range( a.size ): - value[i] = a[i] - - - - - def fwrite( self , fortio ): self._fwrite( fortio ) @@ -1140,20 +1066,20 @@ class EclKW(BaseCClass): opened file. In the example below we load the porosity from an existing GRDECL file, set all poro values below 0.05 to 0.00 and write back an updated GRDECL file. - - poro = ecl.EclKW.load_grdecl( open("poro1.grdecl" , "r") , "PORO" ) + + poro = ecl.EclKW.read_grdecl( open("poro1.grdecl" , "r") , "PORO" ) grid = ecl.EclGrid( "ECLIPSE.EGRID" ) reg = ecl.EclRegion( grid , False ) - + reg.select_below( poro , 0.05 ) poro.assign( 0.0 , mask = reg ) fileH = open( "poro2.grdecl" , "w") poro.write_grdecl( fileH ) fileH.close() - + """ - cfile = CFILE( file ) + cfile = CFILE( file ) self._fprintf_grdecl( cfile ) @@ -1190,25 +1116,24 @@ class EclKW(BaseCClass): def getDataPtr(self): - ecl_type = self.getEclType( ) - if ecl_type == EclTypeEnum.ECL_INT_TYPE: + if self.data_type.is_int(): return self._int_ptr( ) - elif ecl_type == EclTypeEnum.ECL_FLOAT_TYPE: + elif self.data_type.is_float(): return self._float_ptr( ) - elif ecl_type == EclTypeEnum.ECL_DOUBLE_TYPE: + elif self.data_type.is_double(): return self._double_ptr( ) else: raise ValueError("Only numeric types can export data pointer") - - def firstDifferent(kw1 , kw2 , offset = 0 , epsilon = 0 , abs_epsilon = None , rel_epsilon = None): - if len(kw1) != len(kw2): + + def firstDifferent(self , other , offset = 0 , epsilon = 0 , abs_epsilon = None , rel_epsilon = None): + if len(self) != len(other): raise ValueError("Keywords must have equal size") - if offset >= len(kw1): - raise IndexError("Offset:%d invalid - size:%d" % (offset , len(kw1))) + if offset >= len(self): + raise IndexError("Offset:%d invalid - size:%d" % (offset , len(self))) - if kw1.getEclType() != kw2.getEclType(): + if self.getEclType() != other.getEclType(): raise TypeError("The two keywords have different type") if abs_epsilon is None: @@ -1217,4 +1142,4 @@ class EclKW(BaseCClass): if rel_epsilon is None: rel_epsilon = epsilon - return kw1._first_different( kw2 , offset , abs_epsilon , rel_epsilon ) + return self._first_different( other , offset , abs_epsilon , rel_epsilon ) diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_npv.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_npv.py similarity index 99% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_npv.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_npv.py index 95232fe158..ebdbdf7df2 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_npv.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_npv.py @@ -17,7 +17,7 @@ import re import datetime import numbers -from ert.ecl import EclSum +from ecl.ecl import EclSum class NPVParseKey(object): @@ -29,7 +29,7 @@ class NPVParseKey(object): def __call__(self , matchObject): key = matchObject.group(1) smspecNode = self.baseCase.smspec_node( key ) - if smspecNode.is_total: + if smspecNode.isTotal(): var = key.replace(":" , "_") self.NPV.addKey( key , var ) return var + "[i]" diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_region.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_region.py similarity index 91% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_region.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_region.py index 1dbb1a1d37..d34c3f3b72 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_region.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_region.py @@ -1,18 +1,18 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'ecl_region.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. +# Copyright (C) 2011 Statoil ASA, Norway. +# +# The file 'ecl_region.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT 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. +# +# ERT 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 +# for more details. """ Module used to select cells based on many different criteria. @@ -26,12 +26,12 @@ When the selection process is complete the region instance can be queried for the corresponding list of indices. """ import ctypes -import warnings + from cwrap import BaseCClass -from ert.ecl.faults import Layer -from ert.ecl import EclKW, EclTypeEnum, EclPrototype -from ert.geo import CPolyline -from ert.util import IntVector +from ecl.ecl.faults import Layer +from ecl.ecl import EclKW, EclDataType, EclPrototype +from ecl.geo import CPolyline +from ecl.util import IntVector def select_method(select): @@ -87,7 +87,7 @@ class EclRegion(BaseCClass): _scale_kw_float = EclPrototype("void ecl_region_scale_kw_float( ecl_region , ecl_kw , float, bool ) ") _scale_kw_double = EclPrototype("void ecl_region_scale_kw_double( ecl_region , ecl_kw , double , bool) ") - _free = EclPrototype("void ecl_region_free( ecl_region )") + _free = EclPrototype("void ecl_region_free( ecl_region )") _reset = EclPrototype("void ecl_region_reset( ecl_region )") _select_all = EclPrototype("void ecl_region_select_all( ecl_region )") _deselect_all = EclPrototype("void ecl_region_deselect_all( ecl_region )") @@ -101,8 +101,8 @@ class EclRegion(BaseCClass): _deselect_in_interval = EclPrototype("void ecl_region_deselect_in_interval( ecl_region, ecl_kw, float , float )") _invert_selection = EclPrototype("void ecl_region_invert_selection( ecl_region )") - _select_box = EclPrototype("void ecl_region_select_from_ijkbox(ecl_region , int , int , int , int , int , int)") - _deselect_box = EclPrototype("void ecl_region_deselect_from_ijkbox(ecl_region , int , int , int , int , int , int)") + _select_box = EclPrototype("void ecl_region_select_from_ijkbox(ecl_region , int , int , int , int , int , int)") + _deselect_box = EclPrototype("void ecl_region_deselect_from_ijkbox(ecl_region , int , int , int , int , int , int)") _imul_kw = EclPrototype("void ecl_region_kw_imul( ecl_region , ecl_kw , ecl_kw , bool)") _idiv_kw = EclPrototype("void ecl_region_kw_idiv( ecl_region , ecl_kw , ecl_kw , bool)") _iadd_kw = EclPrototype("void ecl_region_kw_iadd( ecl_region , ecl_kw , ecl_kw , bool)") @@ -163,7 +163,7 @@ class EclRegion(BaseCClass): _select_from_layer = EclPrototype("void ecl_region_select_from_layer( ecl_region , layer , int , int)") _deselect_from_layer = EclPrototype("void ecl_region_deselect_from_layer( ecl_region , layer , int , int)") - + def __init__(self , grid , preselect): """ Create a new region selector for cells in @grid. @@ -216,14 +216,14 @@ class EclRegion(BaseCClass): inplace & operator, i.e. reg1 &= reg2 - + will eventually call this method. """ if isinstance(other , EclRegion): self._intersect( other) else: raise TypeError("Ecl region can only intersect with other EclRegion instances") - + return self @@ -239,7 +239,7 @@ class EclRegion(BaseCClass): raise TypeError("Ecl region can only subtract with other EclRegion instances") return self - + def __ior__(self , other): """ @@ -257,7 +257,7 @@ class EclRegion(BaseCClass): self._combine( other) else: raise TypeError("Ecl region can only be combined with other EclRegion instances") - + return self def __iadd__(self , other): @@ -276,7 +276,7 @@ class EclRegion(BaseCClass): operator: new_reg = reg1 | reg2 - + """ new_region = self.copy() new_region.__ior__( other ) @@ -316,19 +316,19 @@ class EclRegion(BaseCClass): def union_with( self, other): """ Will update self with the union of @self and @other. - - See doscumentation of __ior__(). + + See doscumentation of __ior__(). """ return self.__ior__( other ) def intersect_with( self, other): """ Will update self with the intersection of @self and @other. - - See doscumentation of __iand__(). + + See doscumentation of __iand__(). """ return self.__iand__( other ) - + def copy( self ): return self.__deep_copy__( {} ) @@ -346,7 +346,7 @@ class EclRegion(BaseCClass): ################################################################## - + @select_method def select_more( self , ecl_kw , limit , intersect = False): """ @@ -365,13 +365,13 @@ class EclRegion(BaseCClass): swat_kw = restart_file["SWAT"][0] grid = ecl.EclGrid( "ECLIPSE.EGRID" ) region = ecl.EclRegion( grid , False ) - + region.select_more( swat_kw , 0.85 ) """ self._select_more( ecl_kw , limit ) - + def deselect_more( self , ecl_kw , limit): """ @@ -385,7 +385,7 @@ class EclRegion(BaseCClass): def select_less( self , ecl_kw , limit , intersect = False): """ Select all cells where keyword @ecl_kw is below @limit. - + See select_more() for further documentation. """ self._select_less( ecl_kw , limit ) @@ -393,7 +393,7 @@ class EclRegion(BaseCClass): def deselect_less( self , ecl_kw , limit): """ Deselect all cells where keyword @ecl_kw is below @limit. - + See select_more() for further documentation. """ self._deselect_less( ecl_kw , limit ) @@ -412,11 +412,13 @@ class EclRegion(BaseCClass): pvtnum_kw = init_file.iget_named_kw( "PVTNUM" , 0 ) grid = ecl.EclGrid( "ECLIPSE.GRID" ) region = ecl.EclRegion( grid , False ) - + region.select_equal( pvtnum_kw , 2 ) region.select_equal( pvtnum_kw , 4 ) """ + if not ecl_kw.data_type.is_int(): + raise ValueError("The select_equal method must have an integer valued keyword - got:%s" % ecl_kw.typeName( )) self._select_equal( ecl_kw , value ) @@ -426,6 +428,8 @@ class EclRegion(BaseCClass): See select_equal() for further documentation. """ + if not ecl_kw.data_type.is_int(): + raise ValueError("The select_equal method must have an integer valued keyword - got:%s" % ecl_kw.typeName( )) self._deselect_equal( ecl_kw , value ) @select_method @@ -436,8 +440,8 @@ class EclRegion(BaseCClass): Will select all the cells where EclKW instance @ecl_kw has value in the half-open interval [@lower_limit , @upper_limit). The input argument @ecl_kw must have size - nactive or nx*ny*nz, and it must be of type ECL_FLOAT_TYPE. - + nactive or nx*ny*nz, and it must be of type ECL_FLOAT_TYPE. + The following example will select all cells with porosity in the range [0.15,0.20): @@ -445,9 +449,9 @@ class EclRegion(BaseCClass): poro_kw = init_file.iget_named_kw( "PORO" , 0 ) grid = ecl.EclGrid( "ECLIPSE.GRID" ) region = ecl.EclRegion( grid , False ) - + region.select_in_range( poro_kw , 0.15, 0.20 ) - + """ self._select_in_interval( ecl_kw , lower_limit , upper_limit) @@ -494,7 +498,7 @@ class EclRegion(BaseCClass): def select_cmp_more( self , kw1 , kw2 , intersect = False): """ Will select all cells where kw2 > kw1. - + See select_cmp_less() for further documentation. """ self._select_cmp_more( kw1 , kw2 ) @@ -502,7 +506,7 @@ class EclRegion(BaseCClass): def deselect_cmp_more( self , kw1 , kw2): """ Will deselect all cells where kw2 > kw1. - + See select_cmp_less() for further documentation. """ self._deselect_cmp_more( kw1 , kw2 ) @@ -553,7 +557,7 @@ class EclRegion(BaseCClass): """ self.deselect_all() - @select_method + @select_method def select_deep( self , depth , intersect = False): """ Will select all cells below @depth. @@ -566,7 +570,7 @@ class EclRegion(BaseCClass): """ self._deselect_deep_cells(depth) - @select_method + @select_method def select_shallow( self, depth , intersect = False): """ Will select all cells above @depth. @@ -650,7 +654,7 @@ class EclRegion(BaseCClass): def deselect_box( self , ijk1 , ijk2 ): """ Will deselect all elements in box. - + See select_box() for further documentation. """ self._deselect_box( ijk1[0] , ijk2[0] , ijk1[1] , ijk2[1] , ijk1[2] , ijk2[2]) @@ -684,7 +688,7 @@ class EclRegion(BaseCClass): @select_method def select_kslice( self , k1 , k2 , intersect = False): """ - Will select all cells with k in [@k1, @k2]. @i1 and @i2 are zero offset. + Will select all cells with k in [@k1, @k2]. @i1 and @i2 are zero offset. """ self._select_kslice( k1,k2) @@ -745,7 +749,7 @@ class EclRegion(BaseCClass): def deselect_below_plane( self , n , p): """ Will deselect all the cells 'below' the plane defined by n & p. - + See method 'select_above_plane' for further documentation. """ (n_vec , p_vec) = self.__init_plane_select( n , p ) @@ -763,7 +767,7 @@ class EclRegion(BaseCClass): (100,100) the @points list should be: points = [(0,0) , (0,100) , (100,100) , (100,0)] - + The elements in the points list should be (utm_x, utm_y) values. These values will be compared with the centerpoints of the cells in the grid. The selection is based the top k=0 @@ -798,7 +802,7 @@ class EclRegion(BaseCClass): """ self._deselect_outside_polygon( CPolyline( init_points = points )) - + @select_method def selectTrue( self , ecl_kw , intersect = False): """ @@ -814,14 +818,14 @@ class EclRegion(BaseCClass): """ self._select_false( ecl_kw ) - + @select_method def selectFromLayer(self , layer , k , value, intersect = False): """Will select all the cells in in @layer with value @value - at vertical coordinate @k. The input @layer should be of type Layer - from the - ert.ecl.faults.layer module. The k value must in the range + ecl.ecl.faults.layer module. The k value must in the range [0,grid.nz) and the dimensions of the layer must correspond exactly to nx,ny of the grid. """ @@ -834,10 +838,10 @@ class EclRegion(BaseCClass): if grid.getNY() != layer.getNY(): raise ValueError("NY dimension mismatch. Grid:%d layer:%d" % (grid.getNY() , layer.getNY())) - + self._select_from_layer( layer , k , value ) - + ################################################################# @@ -846,13 +850,13 @@ class EclRegion(BaseCClass): """ Helper function to apply a function with one scalar arg on target_kw. """ - type = target_kw.getEclType( ) - if func_dict.has_key( type ): - func = func_dict[ type ] + data_type = target_kw.data_type + if func_dict.has_key( data_type ): + func = func_dict[ data_type ] func( target_kw, scalar , force_active ) else: raise Exception("scalar_apply_kw() only supported for INT/FLOAT/DOUBLE") - + def iadd_kw( self , target_kw , delta_kw , force_active = False): """ The functions iadd_kw(), copy_kw(), set_kw(), scale_kw() and @@ -877,9 +881,9 @@ class EclRegion(BaseCClass): """ See usage documentation on iadd_kw(). """ - self.scalar_apply_kw( ecl_kw , shift , {EclTypeEnum.ECL_INT_TYPE : self._shift_kw_int, - EclTypeEnum.ECL_FLOAT_TYPE : self._shift_kw_float , - EclTypeEnum.ECL_DOUBLE_TYPE : self._shift_kw_double} , force_active) + self.scalar_apply_kw( ecl_kw , shift , {EclDataType.ECL_INT : self._shift_kw_int, + EclDataType.ECL_FLOAT : self._shift_kw_float , + EclDataType.ECL_DOUBLE : self._shift_kw_double} , force_active) def isub_kw( self , target_kw , delta_kw , force_active = False): if isinstance(delta_kw , EclKW): @@ -889,15 +893,15 @@ class EclRegion(BaseCClass): raise TypeError("Type mismatch") else: self.shift_kw( target_kw , -delta_kw , force_active = force_active) - + def scale_kw( self , ecl_kw , scale , force_active = False): """ See usage documentation on iadd_kw(). """ - self.scalar_apply_kw( ecl_kw , scale , {EclTypeEnum.ECL_INT_TYPE : self._scale_kw_int, - EclTypeEnum.ECL_FLOAT_TYPE : self._scale_kw_float , - EclTypeEnum.ECL_DOUBLE_TYPE : self._scale_kw_double} , force_active) + self.scalar_apply_kw( ecl_kw , scale , {EclDataType.ECL_INT : self._scale_kw_int, + EclDataType.ECL_FLOAT : self._scale_kw_float , + EclDataType.ECL_DOUBLE : self._scale_kw_double} , force_active) def imul_kw(self, target_kw , other , force_active = False): if isinstance(other , EclKW): @@ -927,21 +931,21 @@ class EclRegion(BaseCClass): self._copy_kw( target_kw , src_kw , force_active ) else: raise TypeError("Type mismatch") - + def set_kw( self , ecl_kw , value , force_active = False): """ See usage documentation on iadd_kw(). """ - self.scalar_apply_kw( ecl_kw , value , {EclTypeEnum.ECL_INT_TYPE : self._set_kw_int, - EclTypeEnum.ECL_FLOAT_TYPE : self._set_kw_float , - EclTypeEnum.ECL_DOUBLE_TYPE : self._set_kw_double} , force_active) + self.scalar_apply_kw( ecl_kw , value , {EclDataType.ECL_INT : self._set_kw_int, + EclDataType.ECL_FLOAT : self._set_kw_float , + EclDataType.ECL_DOUBLE : self._set_kw_double} , force_active) + - ################################################################# - def ecl_region_instance( ): + def ecl_region_instance(self): """ Helper function (attribute) to support run-time typechecking. """ @@ -965,7 +969,7 @@ class EclRegion(BaseCClass): global_list.setParent(self) return global_list - + def getIJKList(self): """ WIll return a Python list of (ij,k) tuples for the region. @@ -974,39 +978,8 @@ class EclRegion(BaseCClass): ijk_list = [] for g in global_list: ijk_list.append( self.grid.get_ijk( global_index = g ) ) - + return ijk_list - - - - - @property - def active_list(self): - warnings.warn("The active_list property is deprecated - use method \'getActiveList()\' instead." , DeprecationWarning) - return self.getActiveList() - - - @property - def global_list(self): - warnings.warn("The global_list property is deprecated - use method \'getGlobalList()\' instead." , DeprecationWarning) - return self.getGlobalList() - - - @property - def active_size( self ): - """ - Number of active cells in region. - """ - warnings.warn("The active_size property is deprecated - use \'len(getActiveList())\' instead." , DeprecationWarning) - return len(self.getActiveList()) - - @property - def global_size( self ): - """ - Number of global cells in region. - """ - warnings.warn("The global_size property is deprecated - use \'len(getGlobalList())\' instead." , DeprecationWarning) - return len(self.getGlobalList()) def contains_ijk( self , i,j,k): """ @@ -1028,7 +1001,7 @@ class EclRegion(BaseCClass): """ return self._contains_active( active_index ) - + def kw_index_list(self , ecl_kw , force_active): c_ptr = self._get_kw_index_list( ecl_kw , force_active) index_list = IntVector.createCReference( c_ptr, self ) @@ -1040,18 +1013,3 @@ class EclRegion(BaseCClass): def setName(self , name): self._set_name( name ) - - - def set_name( self , name ): - warnings.warn("The name property / set_name method is deprecated - use method \'setName()\' instead." , DeprecationWarning) - self.setName( name ) - - - def get_name( self ): - warnings.warn("The name property / get_name method is deprecated - use method \'getName()\' instead." , DeprecationWarning) - return self.getName( ) - - - name = property( get_name , set_name ) - - diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_restart_file.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_restart_file.py similarity index 89% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_restart_file.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_restart_file.py index f36f6a6ba3..a67393a68c 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_restart_file.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_restart_file.py @@ -14,8 +14,8 @@ # See the GNU General Public License at # for more details. -from ert.util import CTime -from ert.ecl import EclPrototype , EclFile, Ecl3DKW , Ecl3DFile, EclFileEnum +from ecl.util import CTime +from ecl.ecl import EclPrototype , EclFile, Ecl3DKW , Ecl3DFile, EclFileEnum from cwrap import BaseCClass class EclRestartHead(BaseCClass): @@ -26,7 +26,9 @@ class EclRestartHead(BaseCClass): _get_report_step = EclPrototype("int ecl_rsthead_get_report_step(ecl_rsthead)") _get_sim_time = EclPrototype("time_t ecl_rsthead_get_sim_time(ecl_rsthead)") _get_sim_days = EclPrototype("double ecl_rsthead_get_sim_days(ecl_rsthead)") - + _get_nxconz = EclPrototype("int ecl_rsthead_get_nxconz(ecl_rsthead)") + _get_ncwmax = EclPrototype("int ecl_rsthead_get_ncwmax(ecl_rsthead)") + def __init__(self , kw_arg = None , rst_view = None): if kw_arg is None and rst_view is None: raise ValueError('Cannot construct EclRestartHead without one of kw_arg and rst_view, both were None!') @@ -53,6 +55,11 @@ class EclRestartHead(BaseCClass): def getSimDays(self): return self._get_sim_days( ) + def well_details(self): + return {"NXCONZ" : self._get_nxconz(), + "NCWMAX" : self._get_ncwmax()} + + class EclRestartFile(Ecl3DFile): @@ -129,3 +136,13 @@ class EclRestartFile(Ecl3DFile): time_list.append( (header.getReportStep() , header.getSimDate( ) , header.getSimDays( )) ) return time_list + + + def headers(self): + self.assertHeaders() + return self.rst_headers + + + def get_header(self, index): + self.assertHeaders() + return self.rst_headers[index] diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_rft.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_rft.py similarity index 86% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_rft.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_rft.py index 0499508e1a..fdfae66487 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_rft.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_rft.py @@ -17,11 +17,11 @@ Module for loading ECLIPSE RFT files. """ -import types -import warnings +from __future__ import absolute_import, division, print_function, unicode_literals + from cwrap import BaseCClass -from ert.ecl import EclRFTCell, EclPLTCell, EclPrototype -from ert.util import CTime +from ecl.ecl import EclRFTCell, EclPLTCell, EclPrototype +from ecl.util import CTime class EclRFT(BaseCClass): """The EclRFT class contains the information for *one* RFT. @@ -74,7 +74,22 @@ class EclRFT(BaseCClass): def free(self): self._free( ) - + + def __repr__(self): + rs = [] + rs.append('completed_cells = %d' % len(self)) + rs.append('date = %s' % self.getDate()) + if self.is_RFT(): + rs.append('RFT') + if self.is_PLT(): + rs.append('PLT') + if self.is_SEGMENT(): + rs.append('SEGMENT') + if self.is_MSW(): + rs.append('MSW') + rstr = ', '.join(rs) + return self._create_repr(rstr) + def __len__(self): """ The number of completed cells in this RFT. @@ -106,31 +121,12 @@ class EclRFT(BaseCClass): return self._is_MSW( ) - @property - def type(self): - # Enum: ecl_rft_enum from ecl_rft_node.h - # RFT = 1 - # PLT = 2 - # Segment = 3 -- Not properly implemented - """ - Deprecated - use query methods: is_RFT(), is_PLT() and is_SEGMENT() instead. - """ - warnings.warn("The property type is deprecated, use the query methods is_RFT(), is_PLT() and is_SEGMENT() instead." , DeprecationWarning) - return self._get_type( ) - - def getWellName(self): """ The name of the well we are considering. """ return self._get_well( ) - @property - def well(self): - warnings.warn("The property well is deprecated, use the getWellName() method instead." , DeprecationWarning) - return self.getWellName( ) - - def getDate(self): """ The date when this RFT/PLT/... was recorded. @@ -138,22 +134,6 @@ class EclRFT(BaseCClass): ct = CTime(self._get_date( )) return ct.date() - - @property - def date(self): - warnings.warn("The property date is deprecated, use the getDate() instead." , DeprecationWarning) - return self.getDate() - - - @property - def size(self): - """ - The number of completed cells. - """ - warnings.warn("The property size is deprecated, use the built in len( ) function instead." , DeprecationWarning) - return len(self) - - def __cell_ref( self , cell_ptr ): if self.is_RFT(): return EclRFTCell.createCReference( cell_ptr , self ) @@ -164,7 +144,7 @@ class EclRFT(BaseCClass): def assert_cell_index( self , index ): - if isinstance( index , types.IntType): + if isinstance( index , int): length = self.__len__() if index < 0 or index >= length: raise IndexError @@ -325,13 +305,8 @@ class EclRFTFile(BaseCClass): Returns the total number of distinct wells in the RFT file. """ return self._get_num_wells( ) - - @property - def num_wells( self ): - warnings.warn("The property num_wells is deprecated, use the getNumWells() instead." , DeprecationWarning) - return self.getNumWells() - + def getHeaders(self): """ Returns a list of two tuples (well_name , date) for the whole file. @@ -339,14 +314,9 @@ class EclRFTFile(BaseCClass): header_list = [] for i in (range(self._get_size( None , CTime(-1)))): rft = self.iget( i ) - header_list.append( (rft.well , rft.date) ) + header_list.append( (rft.getWellName() , rft.getDate()) ) return header_list - @property - def headers(self): - warnings.warn("The property headers is deprecated, use the getHeaders() instead." , DeprecationWarning) - return self.getHeaders() - def iget(self , index): """ @@ -370,13 +340,7 @@ class EclRFTFile(BaseCClass): def free(self): self._free( ) - - - - - - - - - + def __repr__(self): + w = len(self) + return self._create_repr('wells = %d' % w) diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_rft_cell.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_rft_cell.py similarity index 85% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_rft_cell.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_rft_cell.py index 1933681c16..6c6e312a2b 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_rft_cell.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_rft_cell.py @@ -14,9 +14,8 @@ # See the GNU General Public License at # for more details. -import warnings from cwrap import BaseCClass -from ert.ecl import EclPrototype +from ecl.ecl import EclPrototype class RFTCell(BaseCClass): @@ -43,40 +42,9 @@ class RFTCell(BaseCClass): - def warn(self , old , new): - msg = """ - -The cell property:%s has been deprecated, and the method:%s() should -be used instead. Observe that the new method %s() returns coordinate -values starting at 0, whereas the old property %s returned values -starting at 1; hence you must adapt the calling code when you change -from %s -> %s() -""" % (old , new , new , old , old , new) - warnings.warn( msg , DeprecationWarning ) - def free(self): self._free( ) - @property - def i(self): - self.warn("i" , "get_i") - return self.get_i() + 1 - - @property - def j(self): - self.warn("j" , "get_j") - return self.get_j() + 1 - - @property - def k(self): - self.warn("k" , "get_k") - return self.get_k() + 1 - - @property - def ijk(self): - self.warn("ijk" , "get_ijk") - return (self.get_i() + 1 , self.get_j() + 1 , self.get_k() + 1) - def get_i(self): return self._get_i( ) @@ -110,7 +78,7 @@ class EclRFTCell(RFTCell): def __init__(self , i , j , k , depth , pressure , swat , sgas): c_ptr = self._alloc_RFT( i , j , k , depth , pressure , swat , sgas ) - super(RFTCell , self).__init__( c_ptr ) + super(EclRFTCell , self).__init__( c_ptr ) @property def swat(self): @@ -146,7 +114,7 @@ class EclPLTCell(RFTCell): def __init__(self , i , j , k , depth , pressure , orat , grat , wrat , conn_start ,conn_end, flowrate , oil_flowrate , gas_flowrate , water_flowrate ): c_ptr = self._alloc_PLT( i , j , k , depth , pressure , orat , grat , wrat , conn_start ,conn_end, flowrate , oil_flowrate , gas_flowrate , water_flowrate ) - super( RFTCell , self).__init__( c_ptr ) + super( EclPLTCell , self).__init__( c_ptr ) @property diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_smspec_node.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_smspec_node.py similarity index 88% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_smspec_node.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_smspec_node.py index ef21c26c88..f651df551a 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_smspec_node.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_smspec_node.py @@ -1,7 +1,21 @@ -import warnings +# Copyright (C) 2016 Statoil ASA, Norway. +# +# This file is part of ERT - Ensemble based Reservoir Tool. +# +# ERT 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. +# +# ERT 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 +# for more details. from cwrap import BaseCClass -from ert.ecl import EclPrototype +from ecl.ecl import EclPrototype class EclSMSPECNode(BaseCClass): @@ -32,21 +46,6 @@ class EclSMSPECNode(BaseCClass): super(EclSMSPECNode, self).__init__(0) # null pointer raise NotImplementedError("Class can not be instantiated directly!") - @property - def is_total(self): - warnings.warn("The is_total property is deprecated - use method isTotal()" , DeprecationWarning) - return self.isTotal( ) - - @property - def is_rate(self): - warnings.warn("The is_rate property is deprecated - use method isRate()" , DeprecationWarning) - return self.isRate() - - @property - def is_historical(self): - warnings.warn("The is_historical property is deprecated - use method isHistorical()" , DeprecationWarning) - return self.isHistorical( ) - @property def unit(self): """ diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_subsidence.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_subsidence.py similarity index 98% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_subsidence.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_subsidence.py index 3c395d7db6..dedba06ec7 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_subsidence.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_subsidence.py @@ -23,7 +23,7 @@ different surveys. The implementation is a thin wrapper around the ecl_subsidence.c implementation in the libecl library. """ from cwrap import BaseCClass -from ert.ecl import EclPrototype +from ecl.ecl import EclPrototype class EclSubsidence(BaseCClass): @@ -79,7 +79,7 @@ class EclSubsidence(BaseCClass): to load the @restart_file argument is: import datetime - import ert.ecl.ecl as ecl + import ecl.ecl.ecl as ecl ... ... date = datetime.datetime( year , month , day ) diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_sum.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_sum.py similarity index 99% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_sum.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_sum.py index 457f9c1362..0a4d99bf4c 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_sum.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_sum.py @@ -31,18 +31,18 @@ import os.path # index as the first argument and the key/key_index as second # argument. In the python code this order has been reversed. from cwrap import BaseCClass, CFILE -from ert.ecl import EclSumTStep -from ert.ecl import EclSumVarType -from ert.ecl.ecl_sum_vector import EclSumVector -from ert.ecl.ecl_smspec_node import EclSMSPECNode -from ert.util import StringList, CTime, DoubleVector, TimeVector, IntVector -from ert.ecl import EclPrototype +from ecl.ecl import EclSumTStep +from ecl.ecl import EclSumVarType +from ecl.ecl.ecl_sum_vector import EclSumVector +from ecl.ecl.ecl_smspec_node import EclSMSPECNode +from ecl.util import StringList, CTime, DoubleVector, TimeVector, IntVector +from ecl.ecl import EclPrototype #, EclSumKeyWordVector -#import ert.ecl_plot.sum_plot as sum_plot +#import ecl.ecl_plot.sum_plot as sum_plot # The date2num function is a verbatim copy of the _to_ordinalf() # function from the matplotlib.dates module. Inserted here only to @@ -160,7 +160,6 @@ class EclSum(BaseCClass): else: super(EclSum, self).__init__(c_pointer) self.__private_init( ) - self.__str__ = self.__repr__ self._load_case = load_case @@ -584,7 +583,7 @@ class EclSum(BaseCClass): def blockedProduction(self , totalKey , timeRange): node = self.smspec_node(totalKey) - if node.is_total: + if node.isTotal(): total = DoubleVector() for t in timeRange: if t < CTime(self.start_time): @@ -1241,5 +1240,5 @@ class EclSum(BaseCClass): -import ert.ecl.ecl_sum_keyword_vector +import ecl.ecl.ecl_sum_keyword_vector EclSum._dump_csv_line = EclPrototype("void ecl_sum_fwrite_interp_csv_line(ecl_sum , time_t , ecl_sum_vector, FILE)" , bind = False) diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_sum_keyword_vector.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_sum_keyword_vector.py similarity index 98% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_sum_keyword_vector.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_sum_keyword_vector.py index 01d586e5fa..336c0697eb 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_sum_keyword_vector.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_sum_keyword_vector.py @@ -24,7 +24,7 @@ import datetime # argument. In the python code this order has been reversed. from cwrap import BaseCClass -from ert.ecl import EclPrototype +from ecl.ecl import EclPrototype diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_sum_node.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_sum_node.py similarity index 87% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_sum_node.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_sum_node.py index eb2f4ee1b0..ed4ccfc680 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_sum_node.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_sum_node.py @@ -1,4 +1,5 @@ -class EclSumNode: +class EclSumNode(object): + def __init__(self, mini_step, report_step, days, date, mpl_date, value): """ EclSumNode is a 'struct' with a summary value and time. @@ -23,5 +24,5 @@ class EclSumNode: self.date = date self.mpl_date = mpl_date - def __str__(self): - return "" % ( self.days, self.value ) \ No newline at end of file + def __repr__(self): + return "EclSumNode(days=%d, value=%g)" % (self.days, self.value) diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_sum_tstep.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_sum_tstep.py similarity index 97% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_sum_tstep.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_sum_tstep.py index 1d5f3bf97e..e0995bb8aa 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_sum_tstep.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_sum_tstep.py @@ -1,6 +1,6 @@ from cwrap import BaseCClass -from ert.ecl import EclPrototype -from ert.util import CTime +from ecl.ecl import EclPrototype +from ecl.util import CTime class EclSumTStep(BaseCClass): diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_sum_var_type.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_sum_var_type.py similarity index 98% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_sum_var_type.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_sum_var_type.py index 51ac02bb12..73039c39eb 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_sum_var_type.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_sum_var_type.py @@ -14,7 +14,7 @@ # See the GNU General Public License at # for more details. from cwrap import BaseCEnum -from ert.ecl import ECL_LIB +from ecl.ecl import ECL_LIB class EclSumVarType(BaseCEnum): diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_sum_vector.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_sum_vector.py similarity index 89% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_sum_vector.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_sum_vector.py index de43cd8623..3080a65306 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_sum_vector.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_sum_vector.py @@ -1,6 +1,22 @@ +# Copyright (C) 2017 Statoil ASA, Norway. +# +# This file is part of ERT - Ensemble based Reservoir Tool. +# +# ERT 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. +# +# ERT 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 +# for more details. + from __future__ import print_function import warnings -from ert.ecl.ecl_sum_node import EclSumNode +from ecl.ecl.ecl_sum_node import EclSumNode class EclSumVector(object): @@ -24,7 +40,7 @@ class EclSumVector(object): self.parent = parent self.key = key self.report_only = report_only - + if report_only: warnings.warn("The report_only flag to the EclSumVector will be removed" , DeprecationWarning) @@ -109,7 +125,7 @@ class EclSumVector(object): return self.__report_step - def __iget__( self, index ): + def __iget( self, index ): """ Will return an EclSumNode for element @index; should be called through the [] operator, otherwise you can come across @@ -151,7 +167,7 @@ class EclSumVector(object): if index < 0 or index > length: raise KeyError("Invalid index:%d out of range [0:%d)" % ( index, length)) else: - return self.__iget__(index) + return self.__iget(index) elif isinstance(index, slice): # Observe that the slice based lookup does __not__ return # a proper EclSumVector instance; it will merely return @@ -160,7 +176,7 @@ class EclSumVector(object): index = start sub_vector = [] while index < stop: - sub_vector.append(self.__iget__(index)) + sub_vector.append(self.__iget(index)) index += step return sub_vector @@ -172,7 +188,7 @@ class EclSumVector(object): Will return the first EclSumNode in this vector. """ self.assert_values() - return self.__iget__(0) + return self.__iget(0) @property def last( self ): @@ -182,7 +198,7 @@ class EclSumVector(object): self.assert_values() index = len(self.__values) - 1 - return self.__iget__(index) + return self.__iget(index) @property def last_value( self ): @@ -192,7 +208,7 @@ class EclSumVector(object): self.assert_values() index = len(self.__values) - 1 - return self.__iget__(index).value + return self.__iget(index).value def get_interp( self, days=None, date=None): @@ -258,7 +274,7 @@ class EclSumVector(object): time_index = self.first_gt_index(limit) print(time_index) if time_index >= 0: - return self.__iget__(time_index) + return self.__iget(time_index) else: return None @@ -283,6 +299,6 @@ class EclSumVector(object): """ time_index = self.first_lt_index(limit) if time_index >= 0: - return self.__iget__(time_index) + return self.__iget(time_index) else: return None diff --git a/ThirdParty/Ert/python/python/ecl/ecl/ecl_type.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_type.py new file mode 100644 index 0000000000..a16109caa3 --- /dev/null +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_type.py @@ -0,0 +1,184 @@ +# Copyright (C) 2017 Statoil ASA, Norway. +# +# The file 'ecl_type.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT 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. +# +# ERT 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 +# for more details. + +from cwrap import BaseCClass, BaseCEnum +from ecl.ecl import EclPrototype + +class EclTypeEnum(BaseCEnum): + TYPE_NAME="ecl_type_enum" + ECL_CHAR_TYPE = None + ECL_FLOAT_TYPE = None + ECL_DOUBLE_TYPE = None + ECL_INT_TYPE = None + ECL_BOOL_TYPE = None + ECL_MESS_TYPE = None + ECL_STRING_TYPE = None + +EclTypeEnum.addEnum("ECL_CHAR_TYPE" , 0 ) +EclTypeEnum.addEnum("ECL_FLOAT_TYPE" , 1 ) +EclTypeEnum.addEnum("ECL_DOUBLE_TYPE" , 2 ) +EclTypeEnum.addEnum("ECL_INT_TYPE" , 3 ) +EclTypeEnum.addEnum("ECL_BOOL_TYPE" , 4 ) +EclTypeEnum.addEnum("ECL_MESS_TYPE" , 5 ) +EclTypeEnum.addEnum("ECL_STRING_TYPE" , 7 ) + +#----------------------------------------------------------------- + +class EclDataType(BaseCClass): + + TYPE_NAME = "ecl_data_type" + + _alloc = EclPrototype("void* ecl_type_alloc_python(ecl_type_enum, size_t)", bind=False) + _alloc_from_type = EclPrototype("void* ecl_type_alloc_from_type_python(ecl_type_enum)", bind=False) + _alloc_from_name = EclPrototype("void* ecl_type_alloc_from_name_python(char*)", bind = False) + _free = EclPrototype("void ecl_type_free_python(ecl_data_type)") + _get_type = EclPrototype("ecl_type_enum ecl_type_get_type_python(ecl_data_type)") + _get_element_size = EclPrototype("size_t ecl_type_get_sizeof_ctype_fortio_python(ecl_data_type)") + _is_int = EclPrototype("bool ecl_type_is_int_python(ecl_data_type)") + _is_char = EclPrototype("bool ecl_type_is_char_python(ecl_data_type)") + _is_float = EclPrototype("bool ecl_type_is_float_python(ecl_data_type)") + _is_double = EclPrototype("bool ecl_type_is_double_python(ecl_data_type)") + _is_mess = EclPrototype("bool ecl_type_is_mess_python(ecl_data_type)") + _is_bool = EclPrototype("bool ecl_type_is_bool_python(ecl_data_type)") + _is_string = EclPrototype("bool ecl_type_is_string_python(ecl_data_type)") + _get_name = EclPrototype("char* ecl_type_alloc_name_python(ecl_data_type)") + _is_numeric = EclPrototype("bool ecl_type_is_numeric_python(ecl_data_type)") + _is_equal = EclPrototype("bool ecl_type_is_equal_python(ecl_data_type, ecl_data_type)") + + def __init__(self, type_enum = None, element_size = None, type_name = None): + self._assert_valid_arguments(type_enum, element_size, type_name) + + if type_name: + c_ptr = self._alloc_from_name(type_name) + elif element_size is None: + c_ptr = self._alloc_from_type(type_enum) + else: + c_ptr = self._alloc(type_enum, element_size) + + super(EclDataType, self).__init__(c_ptr) + + def _assert_valid_arguments(self, type_enum, element_size, type_name): + if type_name is not None: + if type_enum is not None or element_size is not None: + err_msg = ("Type name given (%s). Expected both " + + "type_enum and element_size to be None") + raise ValueError(err_msg % type_name) + + elif type_enum is None: + raise ValueError("Both type_enum and type_name is None!") + + elif type_enum == EclTypeEnum.ECL_STRING_TYPE: + if element_size is None: + raise ValueError("When creating an ECL_STRING one must " + + "provide an element size!") + + if not (0 <= element_size <= 999): + raise ValueError("Expected element_size to be in the range " + + "[0, 999], was: %d" % element_size) + + @property + def type(self): + return self._get_type() + + @property + def element_size(self): + return self._get_element_size() + + @property + def type_name(self): + return self._get_name() + + def free(self): + self._free() + + def is_int(self): + return self._is_int() + + def is_char(self): + return self._is_char() + + def is_float(self): + return self._is_float() + + def is_double(self): + return self._is_double() + + def is_mess(self): + return self._is_mess() + + def is_bool(self): + return self._is_bool() + + def is_string(self): + return self._is_string() + + def is_numeric(self): + return self._is_numeric() + + def is_equal(self, other): + return self._is_equal(other) + + def __eq__(self, other): + if isinstance(other, self.__class__): + return self.is_equal(other) + return False + + def __ne__(self, other): + return not self.__eq__(other) + + def __hash__(self): + return hash((self.type, self. element_size)) + + @classmethod + def create_from_type_name(cls, name): + return EclDataType(type_name = name) + + # Enables one to fetch a type as EclDataType.ECL_XXXX + class classproperty(object): + + def __init__(self, fget): + self.fget = fget + + def __get__(self, owner_self, owner_cls): + return self.fget(owner_cls) + + @classproperty + def ECL_INT(cls): + return EclDataType(EclTypeEnum.ECL_INT_TYPE) + + @classproperty + def ECL_FLOAT(cls): + return EclDataType(EclTypeEnum.ECL_FLOAT_TYPE) + + @classproperty + def ECL_DOUBLE(cls): + return EclDataType(EclTypeEnum.ECL_DOUBLE_TYPE) + + @classproperty + def ECL_BOOL(cls): + return EclDataType(EclTypeEnum.ECL_BOOL_TYPE) + + @classproperty + def ECL_MESS(cls): + return EclDataType(EclTypeEnum.ECL_MESS_TYPE) + + @classproperty + def ECL_CHAR(cls): + return EclDataType(EclTypeEnum.ECL_CHAR_TYPE) + + @classmethod + def ECL_STRING(cls, elem_size): + return EclDataType(EclTypeEnum.ECL_STRING_TYPE, elem_size) diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_util.py b/ThirdParty/Ert/python/python/ecl/ecl/ecl_util.py similarity index 86% rename from ThirdParty/Ert/python/python/ert/ecl/ecl_util.py rename to ThirdParty/Ert/python/python/ecl/ecl/ecl_util.py index a122029cc8..2849c5d604 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_util.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/ecl_util.py @@ -26,7 +26,7 @@ functions from ecl_util.c which are not bound to any class type. """ import ctypes from cwrap import BaseCEnum -from ert.ecl import EclPrototype, ECL_LIB +from ecl.ecl import EclPrototype, ECL_LIB class EclFileEnum(BaseCEnum): TYPE_NAME="ecl_file_enum" @@ -68,24 +68,6 @@ EclPhaseEnum.addEnum("ECL_GAS_PHASE" , 2 ) EclPhaseEnum.addEnum("ECL_WATER_PHASE" , 4 ) -#----------------------------------------------------------------- - -class EclTypeEnum(BaseCEnum): - TYPE_NAME="ecl_type_enum" - ECL_CHAR_TYPE = None - ECL_FLOAT_TYPE = None - ECL_DOUBLE_TYPE = None - ECL_INT_TYPE = None - ECL_BOOL_TYPE = None - ECL_MESS_TYPE = None - -EclTypeEnum.addEnum("ECL_CHAR_TYPE" , 0 ) -EclTypeEnum.addEnum("ECL_FLOAT_TYPE" , 1 ) -EclTypeEnum.addEnum("ECL_DOUBLE_TYPE" , 2 ) -EclTypeEnum.addEnum("ECL_INT_TYPE" , 3 ) -EclTypeEnum.addEnum("ECL_BOOL_TYPE" , 4 ) -EclTypeEnum.addEnum("ECL_MESS_TYPE" , 5 ) - #----------------------------------------------------------------- class EclUnitTypeEnum(BaseCEnum): @@ -119,7 +101,6 @@ EclFileFlagEnum.addEnum("ECL_FILE_WRITABLE" , 2 ) class EclUtil(object): _get_num_cpu = EclPrototype("int ecl_util_get_num_cpu( char* )", bind = False) _get_file_type = EclPrototype("ecl_file_enum ecl_util_get_file_type( char* , bool* , int*)" , bind = False) - _get_type_name = EclPrototype("char* ecl_util_get_type_name( int )" , bind = False) _get_start_date = EclPrototype("time_t ecl_util_get_start_date( char* )" , bind = False) _get_report_step = EclPrototype("int ecl_util_filename_report_nr( char* )" , bind = False) @@ -143,10 +124,6 @@ class EclUtil(object): file_type , fmt , step = EclUtil.inspectExtension( filename ) return file_type - @staticmethod - def type_name(ecl_type): - return EclUtil._get_type_name(ecl_type) - @staticmethod def get_start_date(datafile): return EclUtil._get_start_date(datafile).datetime() @@ -180,5 +157,4 @@ class EclUtil(object): get_num_cpu = EclUtil.get_num_cpu get_file_type = EclUtil.get_file_type -type_name = EclUtil.type_name get_start_date = EclUtil.get_start_date diff --git a/ThirdParty/Ert/python/python/ert/ecl/faults/CMakeLists.txt b/ThirdParty/Ert/python/python/ecl/ecl/faults/CMakeLists.txt similarity index 60% rename from ThirdParty/Ert/python/python/ert/ecl/faults/CMakeLists.txt rename to ThirdParty/Ert/python/python/ecl/ecl/faults/CMakeLists.txt index bedc35aa82..d7955a8c6e 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/faults/CMakeLists.txt +++ b/ThirdParty/Ert/python/python/ecl/ecl/faults/CMakeLists.txt @@ -9,4 +9,4 @@ set(PYTHON_SOURCES layer.py ) -add_python_package("python.ert.ecl.faults" ${PYTHON_INSTALL_PREFIX}/ert/ecl/faults "${PYTHON_SOURCES}" True) +add_python_package("python.ecl.ecl.faults" ${PYTHON_INSTALL_PREFIX}/ecl/ecl/faults "${PYTHON_SOURCES}" True) diff --git a/ThirdParty/Ert/python/python/ert/ecl/faults/__init__.py b/ThirdParty/Ert/python/python/ecl/ecl/faults/__init__.py similarity index 100% rename from ThirdParty/Ert/python/python/ert/ecl/faults/__init__.py rename to ThirdParty/Ert/python/python/ecl/ecl/faults/__init__.py diff --git a/ThirdParty/Ert/python/python/ert/ecl/faults/fault.py b/ThirdParty/Ert/python/python/ecl/ecl/faults/fault.py similarity index 59% rename from ThirdParty/Ert/python/python/ert/ecl/faults/fault.py rename to ThirdParty/Ert/python/python/ecl/ecl/faults/fault.py index 326ad0fc05..d65fed4406 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/faults/fault.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/faults/fault.py @@ -1,40 +1,39 @@ -# Copyright (C) 2014 Statoil ASA, Norway. -# -# The file 'fault.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. +# Copyright (C) 2014 Statoil ASA, Norway. +# +# The file 'fault.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT 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. +# +# ERT 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 +# for more details. -from ert.ecl import EclTypeEnum -from ert.geo import Polyline , CPolyline , GeometryTools -from ert.util import stat -from ert.util import Matrix +from ecl.geo import Polyline, CPolyline, GeometryTools +from ecl.util import stat +from ecl.util import Matrix from .fault_line import FaultLine -from .fault_segments import FaultSegment , SegmentMap +from .fault_segments import FaultSegment, SegmentMap class Layer(object): - def __init__(self, grid , K): - assert( isinstance(K , int) ) + def __init__(self, grid, K): + assert(isinstance(K, int)) self.__grid = grid self.__K = K self.__fault_lines = [] self.__segment_map = SegmentMap() self.__processed = False - - def addSegment(self , segment): - self.__segment_map.addSegment( segment ) + + def addSegment(self, segment): + self.__segment_map.addSegment(segment) self.__processed = False def __len__(self): @@ -45,7 +44,7 @@ class Layer(object): self.processSegments() return iter(self.__fault_lines) - def __getitem__(self , index): + def __getitem__(self, index): self.processSegments() return self.__fault_lines[index] @@ -59,8 +58,8 @@ class Layer(object): neighbor_cells += fl.getNeighborCells() return neighbor_cells - def getPolyline(self , name = None): - polyline = CPolyline( name = name) + def getPolyline(self, name=None): + polyline = CPolyline(name=name) for fl in self: polyline += fl.getPolyline() return polyline @@ -79,49 +78,50 @@ class Layer(object): def numLines(self): return len(self) - - # A fault can typically consist of several non connected fault - # segments; right after reading the fault input these can be in a - # complete mess: - # - # 1. The different part of the fault can be in random order. - # - # 2. Within each fault line the micro segments can be ordered in - # reverse. - # - # This method goes through some desparate heuristics trying to - # sort things out. - def __sortFaultLines(self): + """A fault can typically consist of several non connected fault + segments; right after reading the fault input these can be in + a complete mess: + + 1. The different part of the fault can be in random order. + + 2. Within each fault line the micro segments can be ordered in + reverse. + + This method goes through some desparate heuristics trying to sort + things out. + + """ + N = len(self.__fault_lines) - x = Matrix(N , 1) - y = Matrix(N , 1) + x = Matrix(N, 1) + y = Matrix(N, 1) for index,line in enumerate(self.__fault_lines): xc,yc = line.center() - + x[index,0] = xc y[index,0] = yc # y = beta[0] + beta[1] * x # = a + b * x - beta = stat.polyfit(2 , x , y) + beta = stat.polyfit(2, x, y) a = beta[0] b = beta[1] perm_list = [] for index,line in enumerate(self.__fault_lines): - x0 , y0 = line.center() + x0, y0 = line.center() d = x0 + b*(y0 - a) - perm_list.append((index , d)) - perm_list.sort(key = lambda x: x[1]) + perm_list.append((index, d)) + perm_list.sort(key=lambda x: x[1]) fault_lines = [] for (index,d) in perm_list: - fault_lines.append( self.__fault_lines[ index ]) - self.__fault_lines = fault_lines + fault_lines.append(self.__fault_lines[ index ]) + self.__fault_lines = fault_lines + - for line in self.__fault_lines: x1,y1 = line.startPoint() x2,y2 = line.endPoint() @@ -130,27 +130,27 @@ class Layer(object): if d1 > d2: line.reverse() - - - + + + def processSegments(self): if self.__processed: return while self.__segment_map: - fault_line = FaultLine(self.__grid , self.__K) - self.__fault_lines.append( fault_line ) + fault_line = FaultLine(self.__grid, self.__K) + self.__fault_lines.append(fault_line) current_segment = self.__segment_map.popStart() while current_segment: append = fault_line.tryAppend(current_segment) if not append: - fault_line = FaultLine(self.__grid , self.__K) - self.__fault_lines.append( fault_line ) + fault_line = FaultLine(self.__grid, self.__K) + self.__fault_lines.append(fault_line) fault_line.tryAppend(current_segment) - current_segment.next_segment = self.__segment_map.popNext( current_segment ) + current_segment.next_segment = self.__segment_map.popNext(current_segment) current_segment = current_segment.next_segment if len(self.__fault_lines) > 1: @@ -165,18 +165,18 @@ class Layer(object): class Fault(object): allowed_faces = ["X","Y","Z","I","J","K","X-","Y-","Z-","I-","J-","K-"] - def __init__(self, grid , name): + def __init__(self, grid, name): self.__grid = grid self.__name = name self.__layer_map = {} self.__layer_list = [] - (self.nx , self.ny , self.nz , nactive) = grid.dims - + (self.nx, self.ny, self.nz, nactive) = grid.getDims() + def __str__(self): return "Fault:%s" % self.__name - def __getitem__(self , K): + def __getitem__(self, K): if not self.hasLayer(K): self.addLayer(K) layer = self.__layer_map[K] @@ -191,40 +191,40 @@ class Fault(object): yield layer - def hasLayer(self , K): - return self.__layer_map.has_key( K ) + def hasLayer(self, K): + return self.__layer_map.has_key(K) - def addLayer(self , K): - layer = Layer(self.__grid , K) + def addLayer(self, K): + layer = Layer(self.__grid, K) self.__layer_map[K] = layer - self.__layer_list.append( layer ) - + self.__layer_list.append(layer) - def createSegment(self , I1 , I2 , J1 , J2 , face): - if face in ["X" , "I"]: + + def createSegment(self, I1, I2, J1, J2, face): + if face in ["X", "I"]: C1 = I1 + 1 + J1*(self.nx + 1) C2 = C1 + (1 + J2 - J1) * (self.nx + 1) - elif face in ["X-" , "I-"]: + elif face in ["X-", "I-"]: C1 = I1 + J1*(self.nx + 1) C2 = C1 + (1 + J2 - J1) * (self.nx + 1) - elif face in ["Y" , "J"]: + elif face in ["Y", "J"]: C1 = I1 + (J1 + 1) * (self.nx + 1) C2 = C1 + (1 + I2 - I1) - elif face in ["Y-" , "J-"]: + elif face in ["Y-", "J-"]: C1 = I1 + J1 * (self.nx + 1) C2 = C1 + (1 + I2 - I1) else: return None - - return FaultSegment(C1,C2) - - - def addRecord(self , I1 , I2 , J1 , J2 , K1 , K2 , face): + return FaultSegment(C1,C2) + + + + def addRecord(self, I1, I2, J1, J2, K1, K2, face): if not face in Fault.allowed_faces: raise ValueError("Invalid face:%s" % face) - + if I1 > I2: raise ValueError("Invalid I1 I2 indices") @@ -233,7 +233,7 @@ class Fault(object): if K1 > K2: raise ValueError("Invalid K1 K2 indices") - + if I1 < 0 or I1 >= self.nx: raise ValueError("Invalid I1:%d" % I1) if I2 < 0 or I2 >= self.nx: @@ -260,17 +260,17 @@ class Fault(object): if face in ["Z","K"]: if K1 != K2: raise ValueError("For face:%s we must have K1 == K2" % face) - + #----------------------------------------------------------------- - + for K in range(K1,K2+1): if not self.hasLayer(K): self.addLayer(K) layer = self.__layer_map[K] segment = self.createSegment(I1,I2,J1,J2,face) if segment: - layer.addSegment( segment ) - + layer.addSegment(segment) + def getName(self): return self.__name @@ -282,91 +282,64 @@ class Fault(object): neighbor_cells += layer.getNeighborCells() return neighbor_cells - - def getPolyline(self , k): - layer = self[k] - return layer.getPolyline( name = "Polyline[%s]" % self.getName() ) - - def getIJPolyline(self , k): + def getPolyline(self, k): + layer = self[k] + return layer.getPolyline(name="Polyline[%s]" % self.getName()) + + + def getIJPolyline(self, k): layer = self[k] return layer.getIJPolyline() - - def numLines( self , k): + + def numLines(self, k): layer = self[k] return layer.numLines() - - - def extendToFault(self , other_fault , k): - polyline = self.getIJPolyline(k) - - p0 = polyline[-2] - p1 = polyline[-1] - ray_dir = GeometryTools.lineToRay( p0 , p1 ) - intersections = GeometryTools.rayPolygonIntersections( p1 , ray_dir , other_fault.getIJPolyline(k)) - if intersections: - p2 = intersections[0][1] - return [p1 , (int(p2[0]) , int(p2[1])) ] - - p0 = polyline[1] - p1 = polyline[0] - ray_dir = GeometryTools.lineToRay( p0 , p1 ) - intersections = GeometryTools.rayPolygonIntersections( p1 , ray_dir , other_fault.getIJPolyline(k)) - if intersections: - if len(intersections) > 1: - d_list = [ GeometryTools.distance( p1 , p[1] ) for p in intersections ] - index = d_list.index( min(d_list) ) - else: - index = 0 - p2 = intersections[index][1] - return [p1 , (int(p2[0]) , int(p2[1])) ] - - raise ValueError("The fault %s can not be extended to intersect with:%s in layer:%d" % (self.getName() , other_fault.getName() , k+1 )) @staticmethod - def __rayIntersect(p0, p1 , polyline): - ray_dir = GeometryTools.lineToRay( p0 , p1 ) - intersections = GeometryTools.rayPolygonIntersections( p1 , ray_dir , polyline) + def __rayIntersect(p0, p1, polyline): + ray_dir = GeometryTools.lineToRay(p0, p1) + intersections = GeometryTools.rayPolygonIntersections(p1, ray_dir, polyline) if intersections: if len(intersections) > 1: - d_list = [ GeometryTools.distance( p1 , p[1] ) for p in intersections ] - index = d_list.index( min(d_list) ) + d_list = [ GeometryTools.distance(p1, p[1]) for p in intersections ] + index = d_list.index(min(d_list)) else: index = 0 p2 = intersections[index][1] - return [p1 , p2] + return [p1, p2] else: return None - def connectWithPolyline(self , polyline , k): + def connectWithPolyline(self, polyline, k): """ """ - if self.intersectsPolyline( polyline , k ): + if self.intersectsPolyline(polyline, k): return None else: - self_polyline = self.getPolyline( k ) + self_polyline = self.getPolyline(k) if len(self_polyline) > 0: - return self_polyline.connect( polyline ) + return self_polyline.connect(polyline) else: return None - def connect(self , target , k): + def connect(self, target, k): if isinstance(target, Fault): polyline = target.getPolyline(k) else: polyline = target - return self.connectWithPolyline( polyline , k ) + return self.connectWithPolyline(polyline, k) - def extendToPolyline(self , polyline , k): + def extendToPolyline(self, polyline, k): """Extends the fault until it intersects @polyline in layer @k. - The return value is a list [(x1,y1) , (x2,y2)] where (x1,y1) + The return value is a list [(x1,y1), (x2,y2)] where (x1,y1) is on the tip of the fault, and (x2,y2) is on the polyline. If the fault already intersects polyline None is returned, if no intersection is found a ValueError exception is raised. @@ -380,78 +353,77 @@ class Fault(object): +------------+ D | | | - | +-------C + | +-------C B-----+ | A - + The algorithm will then try to intersect the following rays with the polyline, the first match will return: - 1. (Pc , Pd) - 2. (Pb , Pa) - 3. (Pa , Pd) - 4. (Pd , Pa) + 1. (Pc, Pd) + 2. (Pb, Pa) + 3. (Pa, Pd) + 4. (Pd, Pa) The fault object is not directed in any way; i.e. in the case both (Pc,Pd) and (Pb,Pa) intersects the polyline it is impossible to know which intersection is returned, without actually consulting the construction of the fault object. """ - if self.intersectsPolyline(polyline , k): + if self.intersectsPolyline(polyline, k): return None - fault_polyline = self.getPolyline( k ) + fault_polyline = self.getPolyline(k) p0 = fault_polyline[-2] p1 = fault_polyline[-1] - extension = self.__rayIntersect(p0 , p1 , polyline) + extension = self.__rayIntersect(p0, p1, polyline) if extension: return extension - + p0 = fault_polyline[1] p1 = fault_polyline[0] - extension = self.__rayIntersect(p0 , p1 , polyline) + extension = self.__rayIntersect(p0, p1, polyline) if extension: return extension p0 = fault_polyline[0] p1 = fault_polyline[-1] - extension = self.__rayIntersect(p0 , p1 , polyline) + extension = self.__rayIntersect(p0, p1, polyline) if extension: return extension p0 = fault_polyline[-1] p1 = fault_polyline[0] - extension = self.__rayIntersect(p0 , p1 , polyline) + extension = self.__rayIntersect(p0, p1, polyline) if extension: return extension - raise ValueError("The fault %s can not be extended to intersect with polyline:%s in layer:%d" % (self.getName() , polyline.getName() , k+1)) + raise ValueError("The fault %s can not be extended to intersect with polyline:%s in layer:%d" % (self.getName(), polyline.getName(), k+1)) - - def intersectsPolyline(self , polyline , k): + + def intersectsPolyline(self, polyline, k): fault_line = self.getPolyline(k) - return fault_line.intersects( polyline ) + return fault_line.intersects(polyline) - def intersectsFault(self , other_fault , k): + def intersectsFault(self, other_fault, k): fault_line = other_fault.getPolyline(k) - return self.intersectsPolyline( fault_line , k ) + return self.intersectsPolyline(fault_line, k) - - def extendToFault(self , fault , k): + def extendToFault(self, fault, k): fault_line = fault.getPolyline(k) - return self.extendToPolyline(fault_line , k) + return self.extendToPolyline(fault_line, k) - def extendToEdge(self, edge , k): - if isinstance(edge , Fault): - return self.extendToFault( edge , k ) + def extendToEdge(self, edge, k): + if isinstance(edge, Fault): + return self.extendToFault(edge, k) else: - return self.extendToPolyline( edge , k ) - + return self.extendToPolyline(edge, k) - def extendToBBox(self , bbox , k , start = True): + + def extendToBBox(self, bbox, k, start=True): fault_polyline = self.getPolyline(k) if start: p0 = fault_polyline[1] @@ -459,9 +431,9 @@ class Fault(object): else: p0 = fault_polyline[-2] p1 = fault_polyline[-1] - + ray_dir = GeometryTools.lineToRay(p0,p1) - intersections = GeometryTools.rayPolygonIntersections( p1 , ray_dir , bbox) + intersections = GeometryTools.rayPolygonIntersections(p1, ray_dir, bbox) if intersections: p2 = intersections[0][1] if self.getName(): @@ -469,44 +441,44 @@ class Fault(object): else: name = None - return CPolyline( name = name , init_points = [(p1[0] , p1[1]) , p2]) + return CPolyline(name=name, init_points=[(p1[0], p1[1]), p2]) else: raise Exception("Logical error - must intersect with bounding box") - - - def endJoin(self , other , k): + + + def endJoin(self, other, k): fault_polyline = self.getPolyline(k) - if isinstance(other , Fault): + if isinstance(other, Fault): other_polyline = other.getPolyline(k) else: other_polyline = other - return GeometryTools.joinPolylines( fault_polyline , other_polyline ) - + return GeometryTools.joinPolylines(fault_polyline, other_polyline) - def connectPolylineOnto(self , polyline , k): - if self.intersectsPolyline( polyline , k): + + def connectPolylineOnto(self, polyline, k): + if self.intersectsPolyline(polyline, k): return None self_polyline = self.getPolyline(k) - return polyline.connect( self_polyline ) - + return polyline.connect(self_polyline) - def extendPolylineOnto(self , polyline , k): - if self.intersectsPolyline( polyline , k): + + def extendPolylineOnto(self, polyline, k): + if self.intersectsPolyline(polyline, k): return None if len(polyline) > 1: fault_polyline = self.getPolyline(k) - ext1 = self.__rayIntersect( polyline[-2] , polyline[-1] , fault_polyline ) - ext2 = self.__rayIntersect( polyline[0] , polyline[1] , fault_polyline ) - + ext1 = self.__rayIntersect(polyline[-2], polyline[-1], fault_polyline) + ext2 = self.__rayIntersect(polyline[0] , polyline[1] , fault_polyline) + if ext1 and ext2: - d1 = GeometryTools.distance( ext1[0] , ext1[1] ) - d2 = GeometryTools.distance( ext2[0] , ext2[1] ) + d1 = GeometryTools.distance(ext1[0], ext1[1]) + d2 = GeometryTools.distance(ext2[0], ext2[1]) if d1 < d2: return ext1 @@ -523,12 +495,12 @@ class Fault(object): @staticmethod - def intersectFaultRays(ray1 , ray2): + def intersectFaultRays(ray1, ray2): p1,dir1 = ray1 p2,dir2 = ray2 if p1 == p2: return [] - + dx = p2[0] - p1[0] dy = p2[1] - p1[1] if dx != 0: @@ -546,11 +518,11 @@ class Fault(object): else: xc = p1[0] yc = p2[1] - - coord_list = [p1 , (xc,yc) , p2] + + coord_list = [p1, (xc,yc), p2] else: coord_list = [p1,p2] - + return coord_list @@ -570,60 +542,60 @@ class Fault(object): # Horizontal line if p2[1] != p1[1]: raise Exception("Invalid direction") - + dy = 0 if p2[0] > p1[0]: dx = 1 else: dx = -1 - return [p2 , (dx,dy)] + return [p2, (dx,dy)] - - def getEndRays(self , k): + + def getEndRays(self, k): polyline = self.getIJPolyline(k) - + p0 = polyline[0] p1 = polyline[1] p2 = polyline[-2] p3 = polyline[-1] - return (Fault.intRay(p1,p0) , Fault.intRay(p2,p3)) + return (Fault.intRay(p1,p0), Fault.intRay(p2,p3)) + + + - - - @staticmethod - def joinFaults(fault1 , fault2 , k): + def joinFaults(fault1, fault2, k): fault1_rays = fault1.getEndRays(k) fault2_rays = fault2.getEndRays(k) - - if fault1.intersectsFault( fault2 , k ): + + if fault1.intersectsFault(fault2, k): return None count = 0 join = None try: - join = Fault.intersectFaultRays( fault1_rays[0] , fault2_rays[0] ) + join = Fault.intersectFaultRays(fault1_rays[0], fault2_rays[0]) count += 1 except ValueError: pass try: - join = Fault.intersectFaultRays( fault1_rays[0] , fault2_rays[1] ) + join = Fault.intersectFaultRays(fault1_rays[0], fault2_rays[1]) count += 1 except ValueError: pass try: - join = Fault.intersectFaultRays( fault1_rays[1] , fault2_rays[0] ) + join = Fault.intersectFaultRays(fault1_rays[1], fault2_rays[0]) count += 1 except ValueError: pass try: - join = Fault.intersectFaultRays( fault1_rays[1] , fault2_rays[1] ) + join = Fault.intersectFaultRays(fault1_rays[1], fault2_rays[1]) count += 1 except ValueError: pass @@ -631,14 +603,9 @@ class Fault(object): if count == 1: xy_list = [] for ij in join: - xyz = fault1.__grid.getNodeXYZ( ij[0] , ij[1] , k ) - xy_list.append( (xyz[0] , xyz[1]) ) + xyz = fault1.__grid.getNodeXYZ(ij[0], ij[1], k) + xy_list.append((xyz[0], xyz[1])) return xy_list else: - return fault1.endJoin( fault2 , k ) - #raise ValueError("Faults %s and %s could not be uniquely joined" % (fault1.getName() , fault2.getName())) - - - - + return fault1.endJoin(fault2, k) diff --git a/ThirdParty/Ert/python/python/ert/ecl/faults/fault_block.py b/ThirdParty/Ert/python/python/ecl/ecl/faults/fault_block.py similarity index 95% rename from ThirdParty/Ert/python/python/ert/ecl/faults/fault_block.py rename to ThirdParty/Ert/python/python/ecl/ecl/faults/fault_block.py index d21a94f303..76830ba0c1 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/faults/fault_block.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/faults/fault_block.py @@ -15,10 +15,10 @@ # for more details. import ctypes -from ert.ecl import EclPrototype +from ecl.ecl import EclPrototype from cwrap import BaseCClass -from ert.geo import Polyline, GeometryTools , CPolylineCollection -from ert.util import DoubleVector , IntVector +from ecl.geo import Polyline, GeometryTools , CPolylineCollection +from ecl.util import DoubleVector , IntVector class FaultBlockCell(object): def __init__(self , i,j,k ,x,y,z): @@ -51,6 +51,7 @@ class FaultBlock(BaseCClass): _get_global_index_list = EclPrototype("int_vector_ref fault_block_get_global_index_list(fault_block)") _trace_edge = EclPrototype("void fault_block_trace_edge( fault_block, double_vector , double_vector , int_vector)") _get_neighbours = EclPrototype("void fault_block_list_neighbours( fault_block , bool , geo_polygon_collection , int_vector)") + _free = EclPrototype("void fault_block_free__(fault_block)") def __init__(self , *args , **kwargs): diff --git a/ThirdParty/Ert/python/python/ert/ecl/faults/fault_block_collection.py b/ThirdParty/Ert/python/python/ecl/ecl/faults/fault_block_collection.py similarity index 98% rename from ThirdParty/Ert/python/python/ert/ecl/faults/fault_block_collection.py rename to ThirdParty/Ert/python/python/ecl/ecl/faults/fault_block_collection.py index e2d6524545..14b9d6d9ae 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/faults/fault_block_collection.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/faults/fault_block_collection.py @@ -16,7 +16,7 @@ from cwrap import BaseCClass -from ert.ecl import EclPrototype +from ecl.ecl import EclPrototype class FaultBlockCollection(BaseCClass): diff --git a/ThirdParty/Ert/python/python/ert/ecl/faults/fault_block_layer.py b/ThirdParty/Ert/python/python/ecl/ecl/faults/fault_block_layer.py similarity index 96% rename from ThirdParty/Ert/python/python/ert/ecl/faults/fault_block_layer.py rename to ThirdParty/Ert/python/python/ecl/ecl/faults/fault_block_layer.py index 3b876f317a..d2c0b953ee 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/faults/fault_block_layer.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/faults/fault_block_layer.py @@ -16,8 +16,8 @@ from __future__ import print_function from cwrap import BaseCClass -from ert.ecl import EclTypeEnum, EclPrototype -from ert.ecl.faults import Fault +from ecl.ecl import EclDataType, EclPrototype +from ecl.ecl.faults import Fault class FaultBlockLayer(BaseCClass): TYPE_NAME = "fault_block_layer" @@ -92,7 +92,7 @@ class FaultBlockLayer(BaseCClass): """ ok = self._scan_keyword( fault_block_kw ) if not ok: - raise ValueError("The fault block keyword had wrong type/size: type:%s size:%d grid_size:%d" % (fault_block_kw.typeName() , len(fault_block_kw) , self.grid_ref.getGlobalSize())) + raise ValueError("The fault block keyword had wrong type/size: type:%s size:%d grid_size:%d" % (fault_block_kw.type_name , len(fault_block_kw) , self.grid_ref.getGlobalSize())) def loadKeyword(self , fault_block_kw): @@ -152,7 +152,7 @@ class FaultBlockLayer(BaseCClass): if len(kw) != self.grid_ref.getGlobalSize(): raise ValueError("The size of the target keyword must be equal to the size of the grid. Got:%d Expected:%d" % (len(kw) , self.grid_ref.getGlobalSize())) - if kw.getEclType() != EclTypeEnum.ECL_INT_TYPE: + if not kw.data_type.is_int(): raise TypeError("The target kewyord must be of integer type") self._export_kw( kw ) diff --git a/ThirdParty/Ert/python/python/ert/ecl/faults/fault_collection.py b/ThirdParty/Ert/python/python/ecl/ecl/faults/fault_collection.py similarity index 59% rename from ThirdParty/Ert/python/python/ert/ecl/faults/fault_collection.py rename to ThirdParty/Ert/python/python/ecl/ecl/faults/fault_collection.py index 4d03a1d160..ca180d7cc5 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/faults/fault_collection.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/faults/fault_collection.py @@ -1,27 +1,27 @@ -# Copyright (C) 2014 Statoil ASA, Norway. -# -# The file 'fault_collection.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. +# Copyright (C) 2014 Statoil ASA, Norway. +# +# The file 'fault_collection.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT 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. +# +# ERT 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 +# for more details. import re from .fault import Fault -from ert.ecl import EclGrid +from ecl.ecl import EclGrid comment_regexp = re.compile("--.*") def dequote(s): - if s[0] in ["'" , '"']: + if s[0] in ["'", '"']: if s[0] == s[-1]: return s[1:-1] else: @@ -31,57 +31,56 @@ def dequote(s): class FaultCollection(object): - def __init__(self , grid = None , *file_list): + def __init__(self, grid=None, *file_list): self.__fault_list = [] self.__fault_map = {} + self.__grid = grid - if grid is not None: - if not isinstance(grid , EclGrid): + if self.__grid is not None: + if not isinstance(self.__grid, EclGrid): raise ValueError("When supplying a list of files to load - you must have a grid") - for file in file_list: - self.load(grid , file) + self.load(self.__grid, file) - - def __contains__(self , fault_name): - return self.__fault_map.has_key( fault_name ) + def __contains__(self, fault_name): + return self.__fault_map.has_key(fault_name) def __len__(self): return len(self.__fault_list) - def __getitem__(self , index): - if isinstance(index , str): + def __getitem__(self, index): + if isinstance(index, str): return self.__fault_map[index] - elif isinstance(index , int): + elif isinstance(index, int): return self.__fault_list[index] else: raise TypeError("Argument must be fault name or number") def __iter__(self): return iter(self.__fault_list) - + def getGrid(self): return self.__grid - - def getFault(self , name): - return self.__getitem__(name) + + def getFault(self, name): + return self[name] - def hasFault(self , fault_name): + def hasFault(self, fault_name): return fault_name in self - + def addFault(self, fault): self.__fault_map[fault.getName()] = fault - self.__fault_list.append( fault ) - + self.__fault_list.append(fault) - def splitLine(self , line): + + def splitLine(self, line): tmp = line.split() if not tmp[-1] == "/": raise ValueError("Line:%s does not end with /" % line) @@ -98,31 +97,30 @@ class FaultCollection(object): K2 = int(tmp[6]) - 1 face = dequote(tmp[7]) - return (fault_name , I1,I2,J1,J2,K1,K2 , face) + return (fault_name, I1,I2,J1,J2,K1,K2, face) - - def loadFaults(self , grid , fileH): + + def loadFaults(self, grid, fileH): for line in fileH: - line = comment_regexp.sub("" , line) + line = comment_regexp.sub("", line) line = line.strip() if line == "/": break if line: - (name , I1 , I2 , J1 , J2 , K1 , K2 , face) = self.splitLine( line ) + (name, I1, I2, J1, J2, K1, K2, face) = self.splitLine(line) if not self.hasFault(name): - fault = Fault( grid , name) - self.addFault( fault ) + fault = Fault(grid, name) + self.addFault(fault) else: fault = self.getFault(name) - fault.addRecord(I1 , I2 , J1 , J2 , K1 , K2 , face) + fault.addRecord(I1, I2, J1, J2, K1, K2, face) - def load(self , grid , file_name): + def load(self, grid, file_name): with open(file_name) as fileH: for line in fileH: if line.startswith("FAULTS"): - self.loadFaults(grid , fileH) - + self.loadFaults(grid, fileH) diff --git a/ThirdParty/Ert/python/python/ert/ecl/faults/fault_line.py b/ThirdParty/Ert/python/python/ecl/ecl/faults/fault_line.py similarity index 99% rename from ThirdParty/Ert/python/python/ert/ecl/faults/fault_line.py rename to ThirdParty/Ert/python/python/ecl/ecl/faults/fault_line.py index 581f18fa15..e2ed3f9c26 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/faults/fault_line.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/faults/fault_line.py @@ -16,8 +16,8 @@ from __future__ import print_function import sys -from ert.util import DoubleVector,stat -from ert.geo import CPolyline +from ecl.util import DoubleVector,stat +from ecl.geo import CPolyline from .fault_segments import FaultSegment diff --git a/ThirdParty/Ert/python/python/ert/ecl/faults/fault_segments.py b/ThirdParty/Ert/python/python/ecl/ecl/faults/fault_segments.py similarity index 100% rename from ThirdParty/Ert/python/python/ert/ecl/faults/fault_segments.py rename to ThirdParty/Ert/python/python/ecl/ecl/faults/fault_segments.py diff --git a/ThirdParty/Ert/python/python/ert/ecl/faults/layer.py b/ThirdParty/Ert/python/python/ecl/ecl/faults/layer.py similarity index 98% rename from ThirdParty/Ert/python/python/ert/ecl/faults/layer.py rename to ThirdParty/Ert/python/python/ecl/ecl/faults/layer.py index dc91705e43..6b5a27ad51 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/faults/layer.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/faults/layer.py @@ -16,8 +16,8 @@ import ctypes from cwrap import BaseCClass -from ert.ecl import EclPrototype -from ert.util import IntVector +from ecl.ecl import EclPrototype +from ecl.util import IntVector class Layer(BaseCClass): @@ -54,7 +54,7 @@ class Layer(BaseCClass): @classmethod def copy(cls , src): layer = Layer( src.getNX() , src.getNY()) - self._copy( layer , src ) + layer._copy( layer , src ) return layer @@ -184,10 +184,10 @@ class Layer(BaseCClass): i2,j2 = p2 if i1 == i2 or j1 == j2: if not 0 <= i2 <= nx: - raise ValueError("i value:%d invalid. Valid range: [0,%d] " % (i , i2)) + raise ValueError("i value:%d invalid. Valid range: [0,%d] " % (i1 , i2)) if not 0 <= j2 <= ny: - raise ValueError("i value:%d invalid. Valid range: [0,%d] " % (j , j2)) + raise ValueError("i value:%d invalid. Valid range: [0,%d] " % (j1 , j2)) self._add_ijbarrier( i1 , j1 , i2 , j2 ) p1 = p2 diff --git a/ThirdParty/Ert/python/python/ert/ecl/fortio.py b/ThirdParty/Ert/python/python/ecl/ecl/fortio.py similarity index 78% rename from ThirdParty/Ert/python/python/ert/ecl/fortio.py rename to ThirdParty/Ert/python/python/ecl/ecl/fortio.py index 5929d126c2..3acd2f43ce 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/fortio.py +++ b/ThirdParty/Ert/python/python/ecl/ecl/fortio.py @@ -40,7 +40,7 @@ import ctypes import os import sys from cwrap import BaseCClass -from ert.ecl import EclPrototype +from ecl.ecl import EclPrototype class FortIO(BaseCClass): @@ -51,17 +51,17 @@ class FortIO(BaseCClass): READ_AND_WRITE_MODE = 3 APPEND_MODE = 4 - _open_reader = EclPrototype("void* fortio_open_reader(char*, bool, bool)" , bind = False) - _open_writer = EclPrototype("void* fortio_open_writer(char*, bool, bool)" , bind = False) - _open_readwrite = EclPrototype("void* fortio_open_readwrite(char*, bool, bool)" , bind = False) - _open_append = EclPrototype("void* fortio_open_append(char*, bool, bool)" , bind = False) - _guess_fortran = EclPrototype("bool fortio_looks_like_fortran_file(char* , bool)" , bind = False) + _open_reader = EclPrototype("void* fortio_open_reader(char*, bool, bool)", bind=False) + _open_writer = EclPrototype("void* fortio_open_writer(char*, bool, bool)", bind=False) + _open_readwrite = EclPrototype("void* fortio_open_readwrite(char*, bool, bool)", bind=False) + _open_append = EclPrototype("void* fortio_open_append(char*, bool, bool)", bind=False) + _guess_fortran = EclPrototype("bool fortio_looks_like_fortran_file(char*, bool)", bind=False) _write_record = EclPrototype("void fortio_fwrite_record(fortio, char*, int)") _get_position = EclPrototype("long fortio_ftell(fortio)") _seek = EclPrototype("void fortio_fseek(fortio, long, int)") _close = EclPrototype("bool fortio_fclose(fortio)") - _truncate = EclPrototype("bool fortio_ftruncate(fortio , long)") + _truncate = EclPrototype("bool fortio_ftruncate(fortio, long)") _filename = EclPrototype("char* fortio_filename_ref(fortio)") @@ -85,14 +85,14 @@ class FortIO(BaseCClass): all the pressure keywords to another file: import sys - from ert.ecl import FortIO,ElcFile + from ecl.ecl import FortIO, EclFile rst_file = EclFile(sys.argv[1]) - fortio = FortIO( "PRESSURE" , mode=FortIO.WRITE_MODE) + fortio = FortIO("PRESSURE", mode=FortIO.WRITE_MODE) for kw in rst_file: if kw.name() == "PRESSURE": - kw.write( fortio ) + kw.write(fortio) fortio.close() @@ -100,10 +100,9 @@ class FortIO(BaseCClass): method based on a context manager and the with statement. """ - if mode == FortIO.READ_MODE or mode == FortIO.APPEND_MODE or mode == FortIO.READ_AND_WRITE_MODE: - if not os.path.exists(file_name): - raise IOError("File '%s' does not exist!" % file_name) - + read_modes = (FortIO.READ_MODE, FortIO.APPEND_MODE, FortIO.READ_AND_WRITE_MODE) + if mode in read_modes and not os.path.exists(file_name): + raise IOError('No such file "%s".' % file_name) if mode == FortIO.READ_MODE: c_pointer = self._open_reader(file_name, fmt_file, endian_flip_header) elif mode == FortIO.WRITE_MODE: @@ -116,48 +115,49 @@ class FortIO(BaseCClass): raise UserWarning("Unknown mode: %d" % mode) self.__mode = mode - + if not c_pointer: + raise IOError('Failed to open FortIO file "%s".' % file_name) super(FortIO, self).__init__(c_pointer) def close(self): if self: - self._close( ) - self._invalidateCPointer( ) + self._close() + self._invalidateCPointer() def getPosition(self): """ @rtype: long """ - return self._get_position( ) + return self._get_position() - def truncate(self , size = None): + def truncate(self, size=None): """Will truncate the file to new size. If the method is called without a size argument the stream will be truncated to the current position. """ if size is None: - size = self.getPosition( ) + size = self.getPosition() - if not self._truncate( size ): - raise IOError("Truncate of fortran filehandle:%s failed" % self.filename() ) + if not self._truncate(size): + raise IOError("Truncate of fortran filehandle:%s failed" % self.filename()) def filename(self): - return self._filename( ) + return self._filename() - def seek(self, position , whence = 0): + def seek(self, position, whence=0): # SEEK_SET = 0 # SEEK_CUR = 1 # SEEK_END = 2 - self._seek(position , whence) + self._seek(position, whence) @classmethod - def isFortranFile(cls , filename , endian_flip = True): + def isFortranFile(cls, filename, endian_flip=True): """@rtype: bool @type filename: str @@ -167,7 +167,7 @@ class FortIO(BaseCClass): file written in fortran style. ASCII files will return false, even if they are structured as ECLIPSE keywords. """ - return cls._guess_fortran( filename , endian_flip ) + return cls._guess_fortran(filename, endian_flip) def free(self): @@ -176,7 +176,7 @@ class FortIO(BaseCClass): class FortIOContextManager(object): - def __init__(self , fortio): + def __init__(self, fortio): self.__fortio = fortio def __enter__(self): @@ -184,29 +184,24 @@ class FortIOContextManager(object): def __exit__(self, exc_type, exc_val, exc_tb): self.__fortio.close() - return False + return exc_type is not None -def openFortIO( file_name , mode = FortIO.READ_MODE , fmt_file = False , endian_flip_header = True): +def openFortIO(file_name, mode=FortIO.READ_MODE, fmt_file=False, endian_flip_header=True): """Will create FortIO based context manager for use with with. The with: statement and context managers is a good alternative in the situation where you need to ensure resource cleanup. import sys - from ert.ecl import FortIO,ElcFile + from ecl.ecl import FortIO, EclFile rst_file = EclFile(sys.argv[1]) - with openFortIO( "PRESSURE" , mode = FortIO.WRITE_MODE) as fortio: + with openFortIO("PRESSURE", mode=FortIO.WRITE_MODE) as fortio: for kw in rst_file: if kw.name() == "PRESSURE": - kw.write( fortio ) + kw.write(fortio) """ - return FortIOContextManager( FortIO( file_name , mode = mode , fmt_file = fmt_file , endian_flip_header = endian_flip_header )) - - - - - - + return FortIOContextManager(FortIO(file_name, mode=mode, fmt_file=fmt_file, + endian_flip_header=endian_flip_header)) diff --git a/ThirdParty/Ert/python/python/ert/ecl/local.cmake b/ThirdParty/Ert/python/python/ecl/ecl/local.cmake similarity index 81% rename from ThirdParty/Ert/python/python/ert/ecl/local.cmake rename to ThirdParty/Ert/python/python/ecl/ecl/local.cmake index 2eb2643d73..f2431a2a7a 100644 --- a/ThirdParty/Ert/python/python/ert/ecl/local.cmake +++ b/ThirdParty/Ert/python/python/ecl/ecl/local.cmake @@ -9,5 +9,5 @@ if (EXISTS ${ECL_LOCAL_TARGET}) endif() if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ecl_local.py") - add_python_package( "Python ert.ecl.ecl_local" ${PYTHON_INSTALL_PREFIX}/ert/ecl "ecl_local.py" True) -endif() \ No newline at end of file + add_python_package( "Python ecl.ecl.ecl_local" ${PYTHON_INSTALL_PREFIX}/ecl/ecl "ecl_local.py" True) +endif() diff --git a/ThirdParty/Ert/python/python/ecl/ecl/rft/CMakeLists.txt b/ThirdParty/Ert/python/python/ecl/ecl/rft/CMakeLists.txt new file mode 100644 index 0000000000..d41bccb489 --- /dev/null +++ b/ThirdParty/Ert/python/python/ecl/ecl/rft/CMakeLists.txt @@ -0,0 +1,6 @@ +set(PYTHON_SOURCES + __init__.py + well_trajectory.py +) + +add_python_package("python.ecl.ecl.rft" ${PYTHON_INSTALL_PREFIX}/ecl/ecl/rft "${PYTHON_SOURCES}" True) diff --git a/ThirdParty/Ert/python/python/ert/ecl/rft/__init__.py b/ThirdParty/Ert/python/python/ecl/ecl/rft/__init__.py similarity index 100% rename from ThirdParty/Ert/python/python/ert/ecl/rft/__init__.py rename to ThirdParty/Ert/python/python/ecl/ecl/rft/__init__.py diff --git a/ThirdParty/Ert/python/python/ert/ecl/rft/well_trajectory.py b/ThirdParty/Ert/python/python/ecl/ecl/rft/well_trajectory.py similarity index 100% rename from ThirdParty/Ert/python/python/ert/ecl/rft/well_trajectory.py rename to ThirdParty/Ert/python/python/ecl/ecl/rft/well_trajectory.py diff --git a/ThirdParty/Ert/python/python/ert/ert_lib_info_build.py.in b/ThirdParty/Ert/python/python/ecl/ecl_lib_info_build.py.in similarity index 100% rename from ThirdParty/Ert/python/python/ert/ert_lib_info_build.py.in rename to ThirdParty/Ert/python/python/ecl/ecl_lib_info_build.py.in diff --git a/ThirdParty/Ert/python/python/ert/ert_lib_info_install.py.in b/ThirdParty/Ert/python/python/ecl/ecl_lib_info_install.py.in similarity index 100% rename from ThirdParty/Ert/python/python/ert/ert_lib_info_install.py.in rename to ThirdParty/Ert/python/python/ecl/ecl_lib_info_install.py.in diff --git a/ThirdParty/Ert/python/python/ert/geo/CMakeLists.txt b/ThirdParty/Ert/python/python/ecl/geo/CMakeLists.txt similarity index 52% rename from ThirdParty/Ert/python/python/ert/geo/CMakeLists.txt rename to ThirdParty/Ert/python/python/ecl/geo/CMakeLists.txt index 379d3df00d..563a73db75 100644 --- a/ThirdParty/Ert/python/python/ert/geo/CMakeLists.txt +++ b/ThirdParty/Ert/python/python/ecl/geo/CMakeLists.txt @@ -3,10 +3,11 @@ set(PYTHON_SOURCES cpolyline.py cpolyline_collection.py geometry_tools.py + geo_pointset.py + geo_region.py polyline.py xyz_io.py surface.py ) -add_python_package("python.ert.geo" ${PYTHON_INSTALL_PREFIX}/ert/geo "${PYTHON_SOURCES}" True) - +add_python_package("python.ecl.geo" ${PYTHON_INSTALL_PREFIX}/ecl/geo "${PYTHON_SOURCES}" True) diff --git a/ThirdParty/Ert/python/python/ert/geo/__init__.py b/ThirdParty/Ert/python/python/ecl/geo/__init__.py similarity index 90% rename from ThirdParty/Ert/python/python/ert/geo/__init__.py rename to ThirdParty/Ert/python/python/ecl/geo/__init__.py index 0049bc6ea2..6818408383 100644 --- a/ThirdParty/Ert/python/python/ert/geo/__init__.py +++ b/ThirdParty/Ert/python/python/ecl/geo/__init__.py @@ -17,18 +17,18 @@ Simple package for working with 2D geometry. """ -import ert +import ecl from cwrap import Prototype -import ert.util class GeoPrototype(Prototype): - lib = ert.load("libert_geometry") + lib = ecl.load("libert_geometry") def __init__(self, prototype, bind=True): super(GeoPrototype, self).__init__(GeoPrototype.lib, prototype, bind=bind) - +from .geo_pointset import GeoPointset +from .geo_region import GeoRegion from .cpolyline import CPolyline from .cpolyline_collection import CPolylineCollection from .polyline import Polyline diff --git a/ThirdParty/Ert/python/python/ert/geo/cpolyline.py b/ThirdParty/Ert/python/python/ecl/geo/cpolyline.py similarity index 98% rename from ThirdParty/Ert/python/python/ert/geo/cpolyline.py rename to ThirdParty/Ert/python/python/ecl/geo/cpolyline.py index 42293f831e..4014059ed8 100644 --- a/ThirdParty/Ert/python/python/ert/geo/cpolyline.py +++ b/ThirdParty/Ert/python/python/ecl/geo/cpolyline.py @@ -20,7 +20,7 @@ import ctypes import os.path from cwrap import BaseCClass -from ert.geo import GeoPrototype +from ecl.geo import GeoPrototype from .geometry_tools import GeometryTools @@ -41,7 +41,7 @@ class CPolyline(BaseCClass): _equal = GeoPrototype("bool geo_polygon_equal( geo_polygon , geo_polygon )") - def __init__(self, name = None , init_points = []): + def __init__(self, name = None , init_points = ()): c_ptr = self._alloc_new( name ) super(CPolyline , self).__init__( c_ptr ) for (xc, yc) in init_points: diff --git a/ThirdParty/Ert/python/python/ert/geo/cpolyline_collection.py b/ThirdParty/Ert/python/python/ecl/geo/cpolyline_collection.py similarity index 98% rename from ThirdParty/Ert/python/python/ert/geo/cpolyline_collection.py rename to ThirdParty/Ert/python/python/ecl/geo/cpolyline_collection.py index 3df802dd93..b93f5596d9 100644 --- a/ThirdParty/Ert/python/python/ert/geo/cpolyline_collection.py +++ b/ThirdParty/Ert/python/python/ecl/geo/cpolyline_collection.py @@ -19,7 +19,7 @@ Create a polygon import ctypes from cwrap import BaseCClass -from ert.geo import GeoPrototype, CPolyline +from ecl.geo import GeoPrototype, CPolyline class CPolylineCollection(BaseCClass): diff --git a/ThirdParty/Ert/python/python/ecl/geo/geo_pointset.py b/ThirdParty/Ert/python/python/ecl/geo/geo_pointset.py new file mode 100644 index 0000000000..ff9fa3b2ec --- /dev/null +++ b/ThirdParty/Ert/python/python/ecl/geo/geo_pointset.py @@ -0,0 +1,79 @@ +# Copyright (C) 2017 Statoil ASA, Norway. +# +# This file is part of ERT - Ensemble based Reservoir Tool. +# +# ERT 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. +# +# ERT 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 +# for more details. +from cwrap import BaseCClass +from ecl.geo import GeoPrototype + +class GeoPointset(BaseCClass): + TYPE_NAME = "geo_pointset" + + _alloc = GeoPrototype("void* geo_pointset_alloc(bool)", bind=False) + _free = GeoPrototype("void geo_pointset_free(geo_pointset)") + #_add_xyz = GeoPrototype("void geo_pointset_add_xyz(geo_pointset, double, double, double)") + _get_size = GeoPrototype("int geo_pointset_get_size(geo_pointset)") + #_iget_xy = GeoPrototype("void geo_pointset_iget_xy(geo_pointset, int, double*, double*)") + #_get_zcoord = GeoPrototype("double* geo_pointset_get_zcoord(geo_pointset)") + _equal = GeoPrototype("bool geo_pointset_equal(geo_pointset, geo_pointset)") + _iget_z = GeoPrototype("double geo_pointset_iget_z(geo_pointset, int)") + #_iset_z = GeoPrototype("void geo_pointset_iset_z(geo_pointset, int, double)") + #_memcpy = GeoPrototype("void geo_pointset_memcpy(geo_pointset, geo_pointset, bool)") + #_shift_z = GeoPrototype("void geo_pointset_shift_z(geo_pointset, double)") + #_assign_z = GeoPrototype("void geo_pointset_assign_z(geo_pointset, double)") + #_scale_z = GeoPrototype("void geo_pointset_scale_z(geo_pointset, double)") + #_imul = GeoPrototype("void geo_pointset_imul(geo_pointset, geo_pointset)") + #_iadd = GeoPrototype("void geo_pointset_iadd(geo_pointset, geo_pointset)") + #_isub = GeoPrototype("void geo_pointset_isub(geo_pointset, geo_pointset)") + #_isqrt = GeoPrototype("void geo_pointset_isqrt(geo_pointset)") + + + def __init__(self, external_z=False): + c_ptr = self._alloc(external_z) + if c_ptr: + super(GeoPointset, self).__init__(c_ptr) + else: + ext = 'external' if external_z else 'internal' + raise ValueError('Failed to construct GeoPointset with %s_z.' % ext) + + @staticmethod + def fromSurface(surface): + return surface.getPointset() + + def __eq__(self, other): + if isinstance(other, GeoPointset): + return self._equal(other) + return NotImplemented + + def __getitem__(self, key): + size = len(self) + if isinstance(key, int): + idx = key + if idx < 0: + idx += size + if 0 <= idx < size: + return self._iget_z(idx) + else: + raise IndexError('Invalid index, must be in [0, %d), was: %d.' % (size, key)) + else: + # TODO implement slicing? + raise ValueError('Index must be int, not %s.' % type(key)) + + def __len__(self): + return self._get_size() + + def __repr__(self): + return self._create_repr('len=%d' % len(self)) + + def free(self): + self._free() diff --git a/ThirdParty/Ert/python/python/ecl/geo/geo_region.py b/ThirdParty/Ert/python/python/ecl/geo/geo_region.py new file mode 100644 index 0000000000..a4238d8650 --- /dev/null +++ b/ThirdParty/Ert/python/python/ecl/geo/geo_region.py @@ -0,0 +1,121 @@ +# Copyright (C) 2017 Statoil ASA, Norway. +# +# This file is part of ERT - Ensemble based Reservoir Tool. +# +# ERT 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. +# +# ERT 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 +# for more details. +from cwrap import BaseCClass +from ecl.util import IntVector +from ecl.geo import GeoPrototype +from .cpolyline import CPolyline +from ctypes import c_double + +cpair = c_double * 2 # this is a function that maps two doubles to a double* + +class GeoRegion(BaseCClass): + TYPE_NAME = "geo_region" + + _alloc = GeoPrototype("void* geo_region_alloc(geo_pointset, bool)", bind=False) + _free = GeoPrototype("void geo_region_free(geo_region)") + _reset = GeoPrototype("void geo_region_reset(geo_region)") + _get_index_list = GeoPrototype("int_vector_ref geo_region_get_index_list(geo_region)") + _select_inside_polygon = GeoPrototype("void geo_region_select_inside_polygon(geo_region, geo_polygon)") + _select_outside_polygon = GeoPrototype("void geo_region_select_outside_polygon(geo_region, geo_polygon)") + _deselect_inside_polygon = GeoPrototype("void geo_region_deselect_inside_polygon(geo_region, geo_polygon)") + _deselect_outside_polygon = GeoPrototype("void geo_region_deselect_outside_polygon(geo_region, geo_polygon)") + _select_above_line = GeoPrototype("void geo_region_select_above_line(geo_region, double*, double*)") + _select_below_line = GeoPrototype("void geo_region_select_below_line(geo_region, double*, double*)") + _deselect_above_line = GeoPrototype("void geo_region_deselect_above_line(geo_region, double*, double*)") + _deselect_below_line = GeoPrototype("void geo_region_deselect_below_line(geo_region, double*, double*)") + + + def __init__(self, pointset, preselect=False): + self._preselect = True if preselect else False + c_ptr = self._alloc(pointset, self._preselect) + if c_ptr: + super(GeoRegion, self).__init__(c_ptr) + else: + raise ValueError('Could not construct GeoRegion from pointset %s.' % pointset) + + + def getActiveList(self): + return self._get_index_list() + + def _assert_polygon(self, polygon): + if not isinstance(polygon, CPolyline): + raise ValueError('Need to select with a CPolyline, not %s.' + % type(polygon)) + + + def _construct_cline(self, line): + """Takes a line ((x1,y1), (x2,y2)) and returns two double[2]* but + reordered to (x1x2, y1y2). + """ + try: + p1, p2 = line + x1, y1 = map(float, p1) + x2, y2 = map(float, p2) + except Exception as err: + err_msg = 'Select with pair ((x1,y1), (x2,y2)), not %s (%s).' + raise ValueError(err_msg % (line, err)) + x1x2_ptr = cpair(x1, x2) + y1y2_ptr = cpair(y1, y2) + return x1x2_ptr, y1y2_ptr + + + def select_inside(self, polygon): + self._assert_polygon(polygon) + self._select_inside_polygon(polygon) + + def select_outside(self, polygon): + self._assert_polygon(polygon) + self._select_outside_polygon(polygon) + + def deselect_inside(self, polygon): + self._assert_polygon(polygon) + self._deselect_inside_polygon(polygon) + + def deselect_outside(self, polygon): + self._assert_polygon(polygon) + self._deselect_outside_polygon(polygon) + + + def select_above(self, line): + x_ptr, y_ptr = self._construct_cline(line) + self._select_above_line(x_ptr, y_ptr) + + def select_below(self, line): + x_ptr, y_ptr = self._construct_cline(line) + self._select_below_line(x_ptr, y_ptr) + + def deselect_above(self, line): + x_ptr, y_ptr = self._construct_cline(line) + self._deselect_above_line(x_ptr, y_ptr) + + def deselect_below(self, line): + x_ptr, y_ptr = self._construct_cline(line) + self._deselect_below_line(x_ptr, y_ptr) + + + def __len__(self): + """Returns the size of the active list, not the size of the + underlying pointset""" + return len(self._get_index_list()) + + def __repr__(self): + ls = len(self) + il = repr(self.getActiveList()) + pres = 'preselected' if self._preselect else 'not preselected' + return self._create_repr('size=%d, active_list=<%s>, %s' % (ls, il, pres)) + + def free(self): + self._free() diff --git a/ThirdParty/Ert/python/python/ert/geo/geometry_tools.py b/ThirdParty/Ert/python/python/ecl/geo/geometry_tools.py similarity index 100% rename from ThirdParty/Ert/python/python/ert/geo/geometry_tools.py rename to ThirdParty/Ert/python/python/ecl/geo/geometry_tools.py diff --git a/ThirdParty/Ert/python/python/ert/geo/polyline.py b/ThirdParty/Ert/python/python/ecl/geo/polyline.py similarity index 100% rename from ThirdParty/Ert/python/python/ert/geo/polyline.py rename to ThirdParty/Ert/python/python/ecl/geo/polyline.py diff --git a/ThirdParty/Ert/python/python/ert/geo/surface.py b/ThirdParty/Ert/python/python/ecl/geo/surface.py similarity index 75% rename from ThirdParty/Ert/python/python/ert/geo/surface.py rename to ThirdParty/Ert/python/python/ecl/geo/surface.py index 799a1377c0..6dfeae9b9a 100644 --- a/ThirdParty/Ert/python/python/ert/geo/surface.py +++ b/ThirdParty/Ert/python/python/ecl/geo/surface.py @@ -18,10 +18,11 @@ Create a polygon """ import os.path import ctypes +from numpy import zeros from cwrap import BaseCClass -from ert.geo import GeoPrototype - +from ecl.geo import GeoPrototype +from ecl.geo import GeoPointset class Surface(BaseCClass): TYPE_NAME = "surface" @@ -44,7 +45,8 @@ class Surface(BaseCClass): _imul = GeoPrototype("void geo_surface_imul( surface , surface )") _isub = GeoPrototype("void geo_surface_isub( surface , surface )") _isqrt = GeoPrototype("void geo_surface_isqrt( surface )") - _iget_xy = GeoPrototype("void geo_surface_iget_xy(surface, int, double*, double*)") + _iget_xy = GeoPrototype("void geo_surface_iget_xy(surface, int, double*, double*)") + _get_pointset = GeoPrototype("geo_pointset_ref geo_surface_get_pointset(surface)") def __init__(self, filename=None, nx=None, ny=None, xinc=None, yinc=None, @@ -158,7 +160,6 @@ class Surface(BaseCClass): self._isqrt( ) return self - def sqrt(self): """ @@ -183,7 +184,7 @@ class Surface(BaseCClass): """ self._write( filename ) - + def assign(self , value): """ @@ -201,28 +202,32 @@ class Surface(BaseCClass): self._iset_zvalue(index , value) else: - raise TypeError("Invalid index type:%s - must be integer" % index) + raise TypeError("Invalid index type:%s - must be integer" % index) - def __getitem__(self , index): if isinstance(index , int): - if index >= len(self): + idx = index + ls = len(self) + if idx < 0: + idx += ls + if 0 <= idx < ls: + return self._iget_zvalue(idx) + else: raise IndexError("Invalid index:%d - valid range [0,%d)" % (index , len(self))) - if index < 0: - index += len(self) - - return self._iget_zvalue( index) else: - raise TypeError("Invalid index type:%s - must be integer" % index) + raise TypeError("Invalid index type:%s - must be integer" % index) def getXY(self, index): + """Gets the index'th (x,y) coordinate""" if isinstance(index, int): - if index < 0: - index += len(self) - if index >= len(self) or index < 0: + idx = index + if idx < 0: + idx += len(self) + if not 0 <= idx < len(self): raise IndexError("Invalid index:%d - valid range [0,%d)" % (index, len(self))) + index = idx else: raise TypeError("Invalid index type:%s - must be integer" % index) @@ -234,12 +239,47 @@ class Surface(BaseCClass): def getNX(self): - return self._get_nx( ) + return self._get_nx() def getNY(self): - return self._get_ny( ) + return self._get_ny() + + def getPointset(self): + return self._get_pointset() + + def _assert_idx_or_i_and_j(self, idx, i, j): + if idx is None: + if i is None or j is None: + raise ValueError('idx is None, i and j must be ints, was %s and %s.' % (i, j)) + else: + if i is not None or j is not None: + raise ValueError('idx is set, i and j must be None, was %s and %s.' % (i, j)) + + + def getXYZ(self, idx=None, i=None, j=None): + """Returns a tuple of 3 floats, (x,y,z) for given global index, or i and j.""" + self._assert_idx_or_i_and_j(idx, i, j) + if idx is None: + nx, ny = self.getNX(), self.getNY() + i_idx, j_idx = i,j + if i_idx < 0: + i_idx += self.getNX() + if j_idx < 0: + j_idx += self.getNY() + if 0 <= i_idx < self.getNX() and 0 <= j_idx < self.getNY(): + idx = j_idx * self.getNX() + i_idx + else: + fmt = 'Index error: i=%d not in [0,nx=%d) or j=%d not in [0,ny=%d).' + raise IndexError(fmt % (i, nx, j, ny)) + x,y = self.getXY(idx) + z = self[idx] + return (x,y,z) def free(self): - self._free( ) + self._free() + + def __repr__(self): + cnt = 'nx=%d, ny=%d' % (self.getNX(), self.getNY()) + return self._create_repr(cnt) diff --git a/ThirdParty/Ert/python/python/ert/geo/xyz_io.py b/ThirdParty/Ert/python/python/ecl/geo/xyz_io.py similarity index 100% rename from ThirdParty/Ert/python/python/ert/geo/xyz_io.py rename to ThirdParty/Ert/python/python/ecl/geo/xyz_io.py diff --git a/ThirdParty/Ert/python/python/ert/test/CMakeLists.txt b/ThirdParty/Ert/python/python/ecl/test/CMakeLists.txt similarity index 61% rename from ThirdParty/Ert/python/python/ert/test/CMakeLists.txt rename to ThirdParty/Ert/python/python/ecl/test/CMakeLists.txt index 36a244aa8a..bce318e98c 100644 --- a/ThirdParty/Ert/python/python/ert/test/CMakeLists.txt +++ b/ThirdParty/Ert/python/python/ecl/test/CMakeLists.txt @@ -8,8 +8,10 @@ set(PYTHON_SOURCES test_area.py temp_area.py path_context.py + lint_test_case.py + import_test_case.py ) -add_python_package("python.ert.test" ${PYTHON_INSTALL_PREFIX}/ert/test "${PYTHON_SOURCES}" True) +add_python_package("python.ecl.test" ${PYTHON_INSTALL_PREFIX}/ecl/test "${PYTHON_SOURCES}" True) add_subdirectory(ecl_mock) diff --git a/ThirdParty/Ert/python/python/ert/test/__init__.py b/ThirdParty/Ert/python/python/ecl/test/__init__.py similarity index 78% rename from ThirdParty/Ert/python/python/ert/test/__init__.py rename to ThirdParty/Ert/python/python/ecl/test/__init__.py index a6e32a5a82..de61efbb8c 100644 --- a/ThirdParty/Ert/python/python/ert/test/__init__.py +++ b/ThirdParty/Ert/python/python/ecl/test/__init__.py @@ -6,7 +6,5 @@ from .test_area import TestArea , TestAreaContext from .temp_area import TempArea , TempAreaContext from .ert_test_runner import ErtTestRunner from .path_context import PathContext -try: - from .ert_test_context import ErtTestContext, ErtTest -except ImportError: - pass +from .lint_test_case import LintTestCase +from .import_test_case import ImportTestCase diff --git a/ThirdParty/Ert/python/python/ecl/test/ecl_mock/CMakeLists.txt b/ThirdParty/Ert/python/python/ecl/test/ecl_mock/CMakeLists.txt new file mode 100644 index 0000000000..19ffbf7540 --- /dev/null +++ b/ThirdParty/Ert/python/python/ecl/test/ecl_mock/CMakeLists.txt @@ -0,0 +1,7 @@ +set(PYTHON_SOURCES + __init__.py + ecl_sum_mock.py +) + +# The ecl_mock package is not installed. +add_python_package("python.ecl.test.ecl_mock" ${PYTHON_INSTALL_PREFIX}/ecl/test/ecl_mock "${PYTHON_SOURCES}" False) diff --git a/ThirdParty/Ert/python/python/ert/test/ecl_mock/__init__.py b/ThirdParty/Ert/python/python/ecl/test/ecl_mock/__init__.py similarity index 100% rename from ThirdParty/Ert/python/python/ert/test/ecl_mock/__init__.py rename to ThirdParty/Ert/python/python/ecl/test/ecl_mock/__init__.py diff --git a/ThirdParty/Ert/python/python/ert/test/ecl_mock/ecl_sum_mock.py b/ThirdParty/Ert/python/python/ecl/test/ecl_mock/ecl_sum_mock.py similarity index 97% rename from ThirdParty/Ert/python/python/ert/test/ecl_mock/ecl_sum_mock.py rename to ThirdParty/Ert/python/python/ecl/test/ecl_mock/ecl_sum_mock.py index 3b0e3f4f7d..eb2b779229 100644 --- a/ThirdParty/Ert/python/python/ert/test/ecl_mock/ecl_sum_mock.py +++ b/ThirdParty/Ert/python/python/ecl/test/ecl_mock/ecl_sum_mock.py @@ -1,5 +1,5 @@ import datetime -from ert.ecl import EclSum +from ecl.ecl import EclSum def mock_func(ecl_sum , key , days): diff --git a/ThirdParty/Ert/python/python/ert/test/ert_test_context.py b/ThirdParty/Ert/python/python/ecl/test/ert_test_context.py similarity index 92% rename from ThirdParty/Ert/python/python/ert/test/ert_test_context.py rename to ThirdParty/Ert/python/python/ecl/test/ert_test_context.py index ab2fffe14d..dd89c5a720 100644 --- a/ThirdParty/Ert/python/python/ert/test/ert_test_context.py +++ b/ThirdParty/Ert/python/python/ecl/test/ert_test_context.py @@ -1,17 +1,17 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'test_work_area.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 +# Copyright (C) 2013 Statoil ASA, Norway. +# +# The file 'test_work_area.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT 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. +# +# ERT 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 # for more details. import os.path diff --git a/ThirdParty/Ert/python/python/ert/test/ert_test_runner.py b/ThirdParty/Ert/python/python/ecl/test/ert_test_runner.py similarity index 100% rename from ThirdParty/Ert/python/python/ert/test/ert_test_runner.py rename to ThirdParty/Ert/python/python/ecl/test/ert_test_runner.py diff --git a/ThirdParty/Ert/python/python/ert/test/extended_testcase.py b/ThirdParty/Ert/python/python/ecl/test/extended_testcase.py similarity index 54% rename from ThirdParty/Ert/python/python/ert/test/extended_testcase.py rename to ThirdParty/Ert/python/python/ecl/test/extended_testcase.py index 31ad8e3de7..d1adb0ecfa 100644 --- a/ThirdParty/Ert/python/python/ert/test/extended_testcase.py +++ b/ThirdParty/Ert/python/python/ecl/test/extended_testcase.py @@ -2,6 +2,7 @@ import numbers import os import os.path import traceback +import sys try: from unittest2 import TestCase @@ -9,8 +10,23 @@ except ImportError: from unittest import TestCase from .source_enumerator import SourceEnumerator -from ert.util import installAbortSignals -from ert.util import Version +from ecl.util import installAbortSignals +from ecl.util import Version + +TESTDATA_ROOT = None +SHARE_ROOT = None +SOURCE_ROOT = None +BUILD_ROOT = None +try: + from test_env import * + assert( os.path.isdir( TESTDATA_ROOT )) + assert( os.path.isdir( SOURCE_ROOT )) + assert( os.path.isdir( BUILD_ROOT )) + if not SHARE_ROOT is None: + assert( os.path.isdir( SHARE_ROOT )) +except ImportError: + sys.stderr.write("Warning: could not import file test_env.py - this might lead to test failures.") + class _AssertNotRaisesContext(object): @@ -42,19 +58,23 @@ class ExtendedTestCase(TestCase): super(ExtendedTestCase , self).__init__(*args , **kwargs) - def assertFloatEqual(self, first, second, msg=None): + def __str__(self): + return 'ExtendedTestCase( TESTADATA_ROOT=%s, SOURCE_ROOT=%s, SHARE_ROOT=%s, BUILD_ROOT=%s)' % (TESTDATA_ROOT, + SOURCE_ROOT, + SHARE_ROOT, + BUILD_ROOT) - if msg is None: - msg = "Value %f and %f are not almost equal!" % (first, second) - - if isinstance(first, numbers.Number) and isinstance(second, numbers.Number): - tolerance = 1e-6 - diff = abs(first - second) + def assertFloatEqual(self, first, second, msg=None, tolerance=1e-6): + try: + f_first, f_second = float(first), float(second) + diff = abs(f_first - f_second) scale = max(1, abs(first) + abs(second)) - + if msg is None: + msg = "Floats not equal: |%f - %f| > %g" % (f_first, f_second, tolerance) self.assertTrue(diff < tolerance * scale, msg=msg) - else: - self.fail("Elements not comparable as float: %s and %s" % (first, second)) + except TypeError: + self.fail("Cannot compare as floats: %s (%s) and %s (%s)" % + (first, type(first), second, type(second))) def assertAlmostEqualList(self, first, second, msg=None): @@ -108,7 +128,7 @@ class ExtendedTestCase(TestCase): return buffer1 == buffer2 def assertEnumIsFullyDefined(self, enum_class, enum_name, source_path, verbose=False): - enum_values = SourceEnumerator.findEnumerators(enum_name, source_path) + enum_values = SourceEnumerator.findEnumerators(enum_name, os.path.join( SOURCE_ROOT , source_path)) for identifier, value in enum_values: if verbose: @@ -119,82 +139,15 @@ class ExtendedTestCase(TestCase): self.assertEqual(class_value, value, "Enum value for identifier: %s does not match: %s != %s" % (identifier, class_value, value)) - def setTestDataRoot(self, testdata_root): - self.__testdata_root = testdata_root - if not os.path.exists(self.__testdata_root): - raise IOError("Path:%s not found" % self.__testdata_root) - - def setShareRoot(self, share_root): - self.__share_root = share_root - if not os.path.exists(self.__share_root): - raise IOError("Path: %s not found" % self.__share_root) - - - def createTestPath(self, path, testdata_root=None): - if testdata_root is None and self.__testdata_root is None: - file_path = os.path.realpath(__file__) - build_root = os.path.realpath(os.path.join(os.path.dirname(file_path), "../../../../test-data/")) - site_packages_build_root = os.path.realpath(os.path.join(os.path.dirname(file_path), "../../../../../../test-data/")) - src_root = os.path.realpath(os.path.join(os.path.dirname(file_path), "../../../../test-data/")) - env_root = os.getenv("ERT_TEST_ROOT_PATH") - - if env_root is not None and os.path.exists(env_root): - root = os.path.realpath(env_root) - elif os.path.exists(build_root): - root = os.path.realpath(build_root) - elif os.path.exists(site_packages_build_root): - root = os.path.realpath(site_packages_build_root) - elif os.path.exists(src_root): - root = os.path.realpath(src_root) - else: - root = None - - self.setTestDataRoot(root) - - root_path = self.__testdata_root - if testdata_root is not None: - if not os.path.exists(testdata_root): - raise IOError("Path: %s not found" % testdata_root) - - root_path = testdata_root - - return os.path.realpath(os.path.join(root_path , path)) - - - def createSharePath(self, path, share_root=None): - if share_root is None and self.__share_root is None: - self.setShareRoot(ExtendedTestCase.findShareRoot()) - - root_path = self.__share_root - if share_root is not None: - if not os.path.exists(share_root): - raise IOError("Path: %s not found" % share_root) - - root_path = share_root - - return os.path.realpath(os.path.join(root_path , path)) + @staticmethod + def createSharePath(path): + return os.path.realpath(os.path.join(SHARE_ROOT , path)) @staticmethod - def findShareRoot(): - file_path = os.path.realpath(__file__) - build_root = os.path.realpath(os.path.join(os.path.dirname(file_path), "../../../../share/")) - site_packages_build_root = os.path.realpath(os.path.join(os.path.dirname(file_path), "../../../../../../share/")) - src_root = os.path.realpath(os.path.join(os.path.dirname(file_path), "../../../../share/")) - env_root = os.getenv("ERT_SHARE_PATH") + def createTestPath(path): + return os.path.realpath(os.path.join(TESTDATA_ROOT , path)) - if env_root is not None and os.path.exists(env_root): - root = os.path.realpath(env_root) - elif os.path.exists(build_root): - root = os.path.realpath(build_root) - elif os.path.exists(site_packages_build_root): - root = os.path.realpath(site_packages_build_root) - elif os.path.exists(src_root): - root = os.path.realpath(src_root) - else: - root = None - - return root def assertNotRaises(self, func=None): @@ -223,4 +176,3 @@ class ExtendedTestCase(TestCase): return True else: return False - diff --git a/ThirdParty/Ert/python/python/ecl/test/import_test_case.py b/ThirdParty/Ert/python/python/ecl/test/import_test_case.py new file mode 100644 index 0000000000..f803f3c57c --- /dev/null +++ b/ThirdParty/Ert/python/python/ecl/test/import_test_case.py @@ -0,0 +1,49 @@ +# Copyright (C) 2017 Statoil ASA, Norway. +# +# This file is part of ERT - Ensemble based Reservoir Tool. +# +# ERT 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. +# +# ERT 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 +# for more details. + +import importlib +import os +import sys +import traceback +import unittest +import inspect + +class ImportTestCase(unittest.TestCase): + + + def import_module(self , module): + mod = importlib.import_module( module ) + return mod + + def import_package(self, package): + module = self.import_module( package ) + path = os.path.dirname( inspect.getfile( module ) ) + + for entry in sorted(os.listdir(path)): + entry_path = os.path.join(path, entry) + if os.path.isdir( entry_path ): + module = os.path.basename( entry ) + sub_module = "%s.%s" % (package , module) + self.import_package( sub_module ) + else: + module, ext = os.path.splitext( entry ) + if module == "__init__": + continue + + if ext == "py": + self.import_module("%s.%s" % (package , module)) + + return True diff --git a/ThirdParty/Ert/python/python/ecl/test/lint_test_case.py b/ThirdParty/Ert/python/python/ecl/test/lint_test_case.py new file mode 100644 index 0000000000..069c6f4af3 --- /dev/null +++ b/ThirdParty/Ert/python/python/ecl/test/lint_test_case.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python +# Copyright (C) 2017 Statoil ASA, Norway. +# +# This file is part of ERT - Ensemble based Reservoir Tool. +# +# ERT 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. +# +# ERT 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 +# for more details. + +import sys +import fnmatch +import os +import unittest +try: + from pylint import epylint as lint +except ImportError: + sys.stderr.write("Could not import pylint module - lint based testing will be skipped\n") + lint = None + + +class LintTestCase(unittest.TestCase): + """This class is a test case for linting.""" + + LINT_ARGS = ['-d', 'R,C,W'] + \ + ['--extension-pkg-whitelist=numpy'] + + + @staticmethod + def _get_lintable_files(paths, whitelist=()): + """Recursively traverses all folders in paths for *.py files""" + matches = [] + for folder in paths: + for root, _, filenames in os.walk(folder): + for filename in fnmatch.filter(filenames, '*.py'): + if filename not in whitelist: + matches.append(os.path.join(root, filename)) + return matches + + + def assertLinted(self, paths, whitelist=()): # noqa + """Takes a path to a folder or a list of paths to folders and recursively finds + all *.py files within that folder except the ones with filenames in whitelist. + + Will assert lint.lint(fname) == 0 for every *.py file found. + """ + if lint is None: + self.skipTest("pylint not installed") + + if isinstance(paths, str): + paths = [paths] + files = self._get_lintable_files(paths, whitelist=whitelist) + for f in files: + self.assertEqual(0, lint.lint(f, self.LINT_ARGS), 'Linting required for %s' % f) diff --git a/ThirdParty/Ert/python/python/ert/test/path_context.py b/ThirdParty/Ert/python/python/ecl/test/path_context.py similarity index 100% rename from ThirdParty/Ert/python/python/ert/test/path_context.py rename to ThirdParty/Ert/python/python/ecl/test/path_context.py diff --git a/ThirdParty/Ert/python/python/ecl/test/source_enumerator.py b/ThirdParty/Ert/python/python/ecl/test/source_enumerator.py new file mode 100644 index 0000000000..e0c76300f1 --- /dev/null +++ b/ThirdParty/Ert/python/python/ecl/test/source_enumerator.py @@ -0,0 +1,39 @@ +import os +import re + +class SourceEnumerator(object): + + @classmethod + def removeComments(cls, code_string): + code_string = re.sub(re.compile("/\*.*?\*/",re.DOTALL ) ,"" ,code_string) # remove all occurance streamed comments (/*COMMENT */) from string + code_string = re.sub(re.compile("//.*?\n" ) ,"" ,code_string) # remove all occurance singleline comments (//COMMENT\n ) from string + return code_string + + + @classmethod + def findEnum(cls, enum_name, full_source_file_path): + with open(full_source_file_path, "r") as f: + text = f.read() + + text = SourceEnumerator.removeComments(text) + + enum_pattern = re.compile("typedef\s+enum\s+\{(.*?)\}\s*(\w+?);", re.DOTALL) + + for enum in enum_pattern.findall(text): + if enum[1] == enum_name: + return enum[0] + + raise ValueError("Enum with name: '%s' not found!" % enum_name) + + + @classmethod + def findEnumerators(cls, enum_name, source_file): + enum_text = SourceEnumerator.findEnum(enum_name, source_file) + + enumerator_pattern = re.compile("(\w+?)\s*?=\s*?(\d+)") + + enumerators = [] + for enumerator in enumerator_pattern.findall(enum_text): + enumerators.append((enumerator[0], int(enumerator[1]))) + + return enumerators diff --git a/ThirdParty/Ert/python/python/ert/test/temp_area.py b/ThirdParty/Ert/python/python/ecl/test/temp_area.py similarity index 98% rename from ThirdParty/Ert/python/python/ert/test/temp_area.py rename to ThirdParty/Ert/python/python/ecl/test/temp_area.py index d7271f103b..4679eed017 100644 --- a/ThirdParty/Ert/python/python/ert/test/temp_area.py +++ b/ThirdParty/Ert/python/python/ecl/test/temp_area.py @@ -16,7 +16,7 @@ import os import os.path -from ert.util import UtilPrototype +from ecl.util import UtilPrototype from . import TestArea class TempArea(TestArea): diff --git a/ThirdParty/Ert/python/python/ert/test/test_area.py b/ThirdParty/Ert/python/python/ecl/test/test_area.py similarity index 99% rename from ThirdParty/Ert/python/python/ert/test/test_area.py rename to ThirdParty/Ert/python/python/ecl/test/test_area.py index e7414f0412..0d2cb1cf57 100644 --- a/ThirdParty/Ert/python/python/ert/test/test_area.py +++ b/ThirdParty/Ert/python/python/ecl/test/test_area.py @@ -16,7 +16,7 @@ import os.path from cwrap import BaseCClass -from ert.util import UtilPrototype +from ecl.util import UtilPrototype class TestArea(BaseCClass): diff --git a/ThirdParty/Ert/python/python/ert/test/test_run.py b/ThirdParty/Ert/python/python/ecl/test/test_run.py similarity index 100% rename from ThirdParty/Ert/python/python/ert/test/test_run.py rename to ThirdParty/Ert/python/python/ecl/test/test_run.py diff --git a/ThirdParty/Ert/python/python/ert/util/CMakeLists.txt b/ThirdParty/Ert/python/python/ecl/util/CMakeLists.txt similarity index 83% rename from ThirdParty/Ert/python/python/ert/util/CMakeLists.txt rename to ThirdParty/Ert/python/python/ecl/util/CMakeLists.txt index d07fc4c308..4f8ecb2888 100644 --- a/ThirdParty/Ert/python/python/ert/util/CMakeLists.txt +++ b/ThirdParty/Ert/python/python/ecl/util/CMakeLists.txt @@ -27,6 +27,6 @@ set(PYTHON_SOURCES path_format.py ) -add_python_package("python.ert.util" ${PYTHON_INSTALL_PREFIX}/ert/util "${PYTHON_SOURCES}" True) +add_python_package("python.ecl.util" ${PYTHON_INSTALL_PREFIX}/ecl/util "${PYTHON_SOURCES}" True) add_subdirectory(enums) diff --git a/ThirdParty/Ert/python/python/ert/util/__init__.py b/ThirdParty/Ert/python/python/ecl/util/__init__.py similarity index 94% rename from ThirdParty/Ert/python/python/ert/util/__init__.py rename to ThirdParty/Ert/python/python/ecl/util/__init__.py index 4666961e76..c9071da3c7 100644 --- a/ThirdParty/Ert/python/python/ert/util/__init__.py +++ b/ThirdParty/Ert/python/python/ecl/util/__init__.py @@ -36,12 +36,15 @@ The modules included in the util package are: """ -import ert +from __future__ import (absolute_import, division, + print_function, unicode_literals) + +import ecl from cwrap import Prototype class UtilPrototype(Prototype): - lib = ert.load("libert_util") + lib = ecl.load("libert_util") def __init__(self, prototype, bind=True): super(UtilPrototype, self).__init__(UtilPrototype.lib, prototype, bind=bind) diff --git a/ThirdParty/Ert/python/python/ert/util/arg_pack.py b/ThirdParty/Ert/python/python/ecl/util/arg_pack.py similarity index 98% rename from ThirdParty/Ert/python/python/ert/util/arg_pack.py rename to ThirdParty/Ert/python/python/ecl/util/arg_pack.py index 1297514086..e20bd3fe99 100644 --- a/ThirdParty/Ert/python/python/ert/util/arg_pack.py +++ b/ThirdParty/Ert/python/python/ecl/util/arg_pack.py @@ -15,7 +15,7 @@ # for more details. from cwrap import BaseCClass -from ert.util import UtilPrototype +from ecl.util import UtilPrototype class ArgPack(BaseCClass): diff --git a/ThirdParty/Ert/python/python/ert/util/bool_vector.py b/ThirdParty/Ert/python/python/ecl/util/bool_vector.py similarity index 89% rename from ThirdParty/Ert/python/python/ert/util/bool_vector.py rename to ThirdParty/Ert/python/python/ecl/util/bool_vector.py index 9e68cd699a..9f920628a9 100644 --- a/ThirdParty/Ert/python/python/ert/util/bool_vector.py +++ b/ThirdParty/Ert/python/python/ecl/util/bool_vector.py @@ -14,10 +14,7 @@ # See the GNU General Public License at # for more details. - -import warnings - -from ert.util import VectorTemplate, UtilPrototype +from ecl.util import VectorTemplate, UtilPrototype class BoolVector(VectorTemplate): @@ -98,25 +95,6 @@ class BoolVector(VectorTemplate): """ return cls._create_active_mask(range_string) - @classmethod - def active_mask(cls, range_string): - """ - Will create a BoolVector instance with the values from @range_string. - - The range_string input should be of the type "1,3-5,9,17", - i.e. integer values separated by commas, and dashes to - represent ranges. If the input string contains ANY invalid - characters the returned active list will be empty: - - "1,4-7,10" => {F,T,F,F,T,T,T,T,F,F,T} - "1,4-7,10X" => {} - - The empty list will evaluate to false - @rtype: BoolVector - """ - warnings.warn("The active_mask(cls, rangs_string) method has been renamed: createActiveMask(cls, rangs_string)", DeprecationWarning) - return cls._create_active_mask(range_string) - def updateActiveMask(self, range_string): """ Updates a bool vector based on a range string. @@ -141,7 +119,7 @@ class BoolVector(VectorTemplate): return bool_vector def createActiveList(self): - """ @rtype: ert.util.IntVector """ + """ @rtype: ecl.util.IntVector """ return self._active_list(self) def _tostr(self, arr = None): diff --git a/ThirdParty/Ert/python/python/ert/util/buffer.py b/ThirdParty/Ert/python/python/ecl/util/buffer.py similarity index 96% rename from ThirdParty/Ert/python/python/ert/util/buffer.py rename to ThirdParty/Ert/python/python/ecl/util/buffer.py index 9fa3a36dce..44a96cfd62 100644 --- a/ThirdParty/Ert/python/python/ert/util/buffer.py +++ b/ThirdParty/Ert/python/python/ecl/util/buffer.py @@ -15,7 +15,7 @@ # for more details. from cwrap import BaseCClass -from ert.util import UtilPrototype +from ecl.util import UtilPrototype class Buffer(BaseCClass): diff --git a/ThirdParty/Ert/python/python/ert/util/cthread_pool.py b/ThirdParty/Ert/python/python/ecl/util/cthread_pool.py similarity index 98% rename from ThirdParty/Ert/python/python/ert/util/cthread_pool.py rename to ThirdParty/Ert/python/python/ecl/util/cthread_pool.py index 07a4eb7213..5c5824b2b7 100644 --- a/ThirdParty/Ert/python/python/ert/util/cthread_pool.py +++ b/ThirdParty/Ert/python/python/ecl/util/cthread_pool.py @@ -17,7 +17,7 @@ import ctypes from cwrap import BaseCClass -from ert.util import UtilPrototype +from ecl.util import UtilPrototype class CThreadPool(BaseCClass): diff --git a/ThirdParty/Ert/python/python/ert/util/ctime.py b/ThirdParty/Ert/python/python/ecl/util/ctime.py similarity index 99% rename from ThirdParty/Ert/python/python/ert/util/ctime.py rename to ThirdParty/Ert/python/python/ecl/util/ctime.py index d0fc1c1ef2..04d7d42e2a 100644 --- a/ThirdParty/Ert/python/python/ert/util/ctime.py +++ b/ThirdParty/Ert/python/python/ecl/util/ctime.py @@ -20,7 +20,7 @@ import datetime import time from cwrap import BaseCValue -from ert.util import UtilPrototype +from ecl.util import UtilPrototype class CTime(BaseCValue): diff --git a/ThirdParty/Ert/python/python/ert/util/double_vector.py b/ThirdParty/Ert/python/python/ecl/util/double_vector.py similarity index 99% rename from ThirdParty/Ert/python/python/ert/util/double_vector.py rename to ThirdParty/Ert/python/python/ecl/util/double_vector.py index 548dcbc5c6..28a39cfc20 100644 --- a/ThirdParty/Ert/python/python/ert/util/double_vector.py +++ b/ThirdParty/Ert/python/python/ecl/util/double_vector.py @@ -14,7 +14,7 @@ # See the GNU General Public License at # for more details. -from ert.util import VectorTemplate, UtilPrototype +from ecl.util import VectorTemplate, UtilPrototype class DoubleVector(VectorTemplate): diff --git a/ThirdParty/Ert/python/python/ert/util/enums/CMakeLists.txt b/ThirdParty/Ert/python/python/ecl/util/enums/CMakeLists.txt similarity index 56% rename from ThirdParty/Ert/python/python/ert/util/enums/CMakeLists.txt rename to ThirdParty/Ert/python/python/ecl/util/enums/CMakeLists.txt index a1f96b233e..18c2673477 100644 --- a/ThirdParty/Ert/python/python/ert/util/enums/CMakeLists.txt +++ b/ThirdParty/Ert/python/python/ecl/util/enums/CMakeLists.txt @@ -6,5 +6,5 @@ set(PYTHON_SOURCES llsq_result_enum.py ) -add_python_package("python.ert.util.enums" ${PYTHON_INSTALL_PREFIX}/ert/util/enums "${PYTHON_SOURCES}" True) +add_python_package("python.ecl.util.enums" ${PYTHON_INSTALL_PREFIX}/ecl/util/enums "${PYTHON_SOURCES}" True) diff --git a/ThirdParty/Ert/python/python/ert/util/enums/__init__.py b/ThirdParty/Ert/python/python/ecl/util/enums/__init__.py similarity index 100% rename from ThirdParty/Ert/python/python/ert/util/enums/__init__.py rename to ThirdParty/Ert/python/python/ecl/util/enums/__init__.py diff --git a/ThirdParty/Ert/python/python/ert/util/enums/llsq_result_enum.py b/ThirdParty/Ert/python/python/ecl/util/enums/llsq_result_enum.py similarity index 100% rename from ThirdParty/Ert/python/python/ert/util/enums/llsq_result_enum.py rename to ThirdParty/Ert/python/python/ecl/util/enums/llsq_result_enum.py diff --git a/ThirdParty/Ert/python/python/ert/util/enums/rng_alg_type_enum.py b/ThirdParty/Ert/python/python/ecl/util/enums/rng_alg_type_enum.py similarity index 100% rename from ThirdParty/Ert/python/python/ert/util/enums/rng_alg_type_enum.py rename to ThirdParty/Ert/python/python/ecl/util/enums/rng_alg_type_enum.py diff --git a/ThirdParty/Ert/python/python/ert/util/enums/rng_init_mode_enum.py b/ThirdParty/Ert/python/python/ecl/util/enums/rng_init_mode_enum.py similarity index 100% rename from ThirdParty/Ert/python/python/ert/util/enums/rng_init_mode_enum.py rename to ThirdParty/Ert/python/python/ecl/util/enums/rng_init_mode_enum.py diff --git a/ThirdParty/Ert/python/python/ert/util/enums/ui_return_status_enum.py b/ThirdParty/Ert/python/python/ecl/util/enums/ui_return_status_enum.py similarity index 100% rename from ThirdParty/Ert/python/python/ert/util/enums/ui_return_status_enum.py rename to ThirdParty/Ert/python/python/ecl/util/enums/ui_return_status_enum.py diff --git a/ThirdParty/Ert/python/python/ert/util/hash.py b/ThirdParty/Ert/python/python/ecl/util/hash.py similarity index 98% rename from ThirdParty/Ert/python/python/ert/util/hash.py rename to ThirdParty/Ert/python/python/ecl/util/hash.py index dbf2086197..bd2a18289d 100644 --- a/ThirdParty/Ert/python/python/ert/util/hash.py +++ b/ThirdParty/Ert/python/python/ecl/util/hash.py @@ -16,7 +16,7 @@ from ctypes import c_void_p from cwrap import BaseCClass -from ert.util import StringList, UtilPrototype +from ecl.util import StringList, UtilPrototype class Hash(BaseCClass): diff --git a/ThirdParty/Ert/python/python/ert/util/install_abort_signals.py b/ThirdParty/Ert/python/python/ecl/util/install_abort_signals.py similarity index 89% rename from ThirdParty/Ert/python/python/ert/util/install_abort_signals.py rename to ThirdParty/Ert/python/python/ecl/util/install_abort_signals.py index 01cd6c74b1..59cddabe75 100644 --- a/ThirdParty/Ert/python/python/ert/util/install_abort_signals.py +++ b/ThirdParty/Ert/python/python/ecl/util/install_abort_signals.py @@ -1,4 +1,4 @@ -from ert.util import UtilPrototype +from ecl.util import UtilPrototype def installAbortSignals(): diff --git a/ThirdParty/Ert/python/python/ert/util/int_vector.py b/ThirdParty/Ert/python/python/ecl/util/int_vector.py similarity index 99% rename from ThirdParty/Ert/python/python/ert/util/int_vector.py rename to ThirdParty/Ert/python/python/ecl/util/int_vector.py index 0809d5b0cc..277a76f9eb 100644 --- a/ThirdParty/Ert/python/python/ert/util/int_vector.py +++ b/ThirdParty/Ert/python/python/ecl/util/int_vector.py @@ -14,7 +14,7 @@ # See the GNU General Public License at # for more details. -from ert.util import VectorTemplate, UtilPrototype +from ecl.util import VectorTemplate, UtilPrototype class IntVector(VectorTemplate): diff --git a/ThirdParty/Ert/python/python/ert/util/log.py b/ThirdParty/Ert/python/python/ecl/util/log.py similarity index 97% rename from ThirdParty/Ert/python/python/ert/util/log.py rename to ThirdParty/Ert/python/python/ecl/util/log.py index 550a18e07f..2e766b83a6 100644 --- a/ThirdParty/Ert/python/python/ert/util/log.py +++ b/ThirdParty/Ert/python/python/ecl/util/log.py @@ -16,7 +16,7 @@ from __future__ import print_function from cwrap import BaseCClass -from ert.util import UtilPrototype +from ecl.util import UtilPrototype class Log(BaseCClass): diff --git a/ThirdParty/Ert/python/python/ert/util/lookup_table.py b/ThirdParty/Ert/python/python/ecl/util/lookup_table.py similarity index 99% rename from ThirdParty/Ert/python/python/ert/util/lookup_table.py rename to ThirdParty/Ert/python/python/ecl/util/lookup_table.py index 4cb6fb87f2..6497a8273c 100644 --- a/ThirdParty/Ert/python/python/ert/util/lookup_table.py +++ b/ThirdParty/Ert/python/python/ecl/util/lookup_table.py @@ -16,7 +16,7 @@ from cwrap import BaseCClass -from ert.util import UtilPrototype +from ecl.util import UtilPrototype class LookupTable(BaseCClass): diff --git a/ThirdParty/Ert/python/python/ert/util/matrix.py b/ThirdParty/Ert/python/python/ecl/util/matrix.py similarity index 99% rename from ThirdParty/Ert/python/python/ert/util/matrix.py rename to ThirdParty/Ert/python/python/ecl/util/matrix.py index e4ddafea31..1c8392daba 100644 --- a/ThirdParty/Ert/python/python/ert/util/matrix.py +++ b/ThirdParty/Ert/python/python/ecl/util/matrix.py @@ -29,7 +29,7 @@ from cwrap import BaseCClass,CFILE -from ert.util import UtilPrototype +from ecl.util import UtilPrototype class Matrix(BaseCClass): diff --git a/ThirdParty/Ert/python/python/ert/util/path_format.py b/ThirdParty/Ert/python/python/ecl/util/path_format.py similarity index 92% rename from ThirdParty/Ert/python/python/ert/util/path_format.py rename to ThirdParty/Ert/python/python/ecl/util/path_format.py index 165cff2905..0fe290891e 100644 --- a/ThirdParty/Ert/python/python/ert/util/path_format.py +++ b/ThirdParty/Ert/python/python/ecl/util/path_format.py @@ -1,5 +1,5 @@ from cwrap import BaseCClass -from ert.util import UtilPrototype +from ecl.util import UtilPrototype class PathFormat(BaseCClass): diff --git a/ThirdParty/Ert/python/python/ert/util/permutation_vector.py b/ThirdParty/Ert/python/python/ecl/util/permutation_vector.py similarity index 96% rename from ThirdParty/Ert/python/python/ert/util/permutation_vector.py rename to ThirdParty/Ert/python/python/ecl/util/permutation_vector.py index a5c272304f..dabbd3788f 100644 --- a/ThirdParty/Ert/python/python/ert/util/permutation_vector.py +++ b/ThirdParty/Ert/python/python/ecl/util/permutation_vector.py @@ -1,5 +1,5 @@ from cwrap import BaseCClass -from ert.util import UtilPrototype +from ecl.util import UtilPrototype class PermutationVector(BaseCClass): diff --git a/ThirdParty/Ert/python/python/ert/util/profiler.py b/ThirdParty/Ert/python/python/ecl/util/profiler.py similarity index 78% rename from ThirdParty/Ert/python/python/ert/util/profiler.py rename to ThirdParty/Ert/python/python/ecl/util/profiler.py index 0493689bfc..ab35189cc9 100644 --- a/ThirdParty/Ert/python/python/ert/util/profiler.py +++ b/ThirdParty/Ert/python/python/ecl/util/profiler.py @@ -1,4 +1,10 @@ -import StringIO +from __future__ import absolute_import, division, print_function, unicode_literals + +try: + from StringIO import StringIO +except ImportError: + from io import StringIO + import cProfile import pstats import sys @@ -18,7 +24,7 @@ class Profiler(object): def stopProfiler(cls, sort_method="cumulative"): if cls.__profiler is not None: cls.__profiler.disable() - stream = StringIO.StringIO() + stream = StringIO() stats_printer = pstats.Stats(cls.__profiler, stream=stream).sort_stats(sort_method) stats_printer.print_stats() cls.__profiler = None diff --git a/ThirdParty/Ert/python/python/ert/util/rng.py b/ThirdParty/Ert/python/python/ecl/util/rng.py similarity index 96% rename from ThirdParty/Ert/python/python/ert/util/rng.py rename to ThirdParty/Ert/python/python/ecl/util/rng.py index 26e8eb623e..a747d31887 100644 --- a/ThirdParty/Ert/python/python/ert/util/rng.py +++ b/ThirdParty/Ert/python/python/ecl/util/rng.py @@ -16,8 +16,8 @@ import os.path from cwrap import BaseCClass -from ert.util import UtilPrototype -from ert.util.enums import RngInitModeEnum, RngAlgTypeEnum +from ecl.util import UtilPrototype +from ecl.util.enums import RngInitModeEnum, RngAlgTypeEnum class RandomNumberGenerator(BaseCClass): diff --git a/ThirdParty/Ert/python/python/ert/util/stat.py b/ThirdParty/Ert/python/python/ecl/util/stat.py similarity index 93% rename from ThirdParty/Ert/python/python/ert/util/stat.py rename to ThirdParty/Ert/python/python/ecl/util/stat.py index 8efcbe587b..d219a7869a 100644 --- a/ThirdParty/Ert/python/python/ert/util/stat.py +++ b/ThirdParty/Ert/python/python/ecl/util/stat.py @@ -16,14 +16,14 @@ from collections import Sequence from cwrap import PrototypeError -from ert.util import LLSQResultEnum, UtilPrototype, Matrix +from ecl.util import LLSQResultEnum, UtilPrototype, Matrix quantile = UtilPrototype("double statistics_empirical_quantile(double_vector, double)") -"""@type: (ert.util.DoubleVector, float)->float""" +"""@type: (ecl.util.DoubleVector, float)->float""" quantile_sorted = UtilPrototype("double statistics_empirical_quantile(double_vector, double)") -"""@type: (ert.util.DoubleVector, float)->float""" +"""@type: (ecl.util.DoubleVector, float)->float""" try: _polyfit = UtilPrototype("llsq_result_enum matrix_stat_polyfit(matrix, matrix, matrix, matrix)") diff --git a/ThirdParty/Ert/python/python/ert/util/stringlist.py b/ThirdParty/Ert/python/python/ecl/util/stringlist.py similarity index 81% rename from ThirdParty/Ert/python/python/ert/util/stringlist.py rename to ThirdParty/Ert/python/python/ecl/util/stringlist.py index e4de156c68..f4e22b03c6 100644 --- a/ThirdParty/Ert/python/python/ert/util/stringlist.py +++ b/ThirdParty/Ert/python/python/ecl/util/stringlist.py @@ -30,9 +30,9 @@ be an iterable consisting of strings, and the strings property will return a normal python list of string objects, used in this way you hardly need to notice that the StringList class is at play. """ - -from ert.util import UtilPrototype -from types import StringType, IntType +from __future__ import absolute_import, division, print_function, unicode_literals +from six import string_types +from ecl.util import UtilPrototype from cwrap import BaseCClass @@ -76,13 +76,17 @@ class StringList(BaseCClass): c_ptr = self._alloc() super(StringList, self).__init__(c_ptr) - if initial: - for s in initial: - if isinstance(s, StringType): - self.append(s) - else: - raise TypeError("Item: %s not a string" % s) + self._append_all(initial) + + def _append_all(self, lst): + for s in lst: + if isinstance(s, bytes): + s.decode('ascii') + if isinstance(s, string_types): + self.append(s) + else: + raise TypeError('Item is not a string: "%s".' % s) def __eq__(self , other): @@ -101,7 +105,7 @@ class StringList(BaseCClass): def __setitem__(self, index, value): - if isinstance(index, IntType): + if isinstance(index, int): length = len(self) if index < 0: # Will only wrap backwards once @@ -109,7 +113,9 @@ class StringList(BaseCClass): if index < 0 or index >= length: raise IndexError("index must be in range %d <= %d < %d" % (0, index, len(self))) - if isinstance(value, StringType): + if isinstance(value, bytes): + value = value.decode('ascii') + if isinstance(value, string_types): self._iset(index, value) else: raise TypeError("Item: %s not string type" % value) @@ -122,7 +128,7 @@ class StringList(BaseCClass): The __getitem__ method supports negative, i.e. from the right, indexing; but not slices. """ - if isinstance(index, IntType): + if isinstance(index, int): length = len(self) if index < 0: index += length @@ -143,7 +149,9 @@ class StringList(BaseCClass): def __iadd__(self , other): - if isinstance(other , str): + if isinstance(other, bytes): + other.decode('ascii') + if isinstance(other , string_types): raise TypeError("Can not add strings with + - use append()") for s in other: self.append( s ) @@ -157,7 +165,9 @@ class StringList(BaseCClass): def __ior__(self , other): - if isinstance(other , str): + if isinstance(other, bytes): + other.decode('ascii') + if isinstance(other , string_types): raise TypeError("Can not | with string.") for s in other: if not s in self: @@ -203,6 +213,12 @@ class StringList(BaseCClass): buffer += "]" return buffer + def __repr__(self): + return 'StringList(size = %d) %s' % (len(self), self._ad_str()) + + def empty(self): + """Returns true if and only if list is empty.""" + return len(self) == 0 def pop(self): """ @@ -210,10 +226,10 @@ class StringList(BaseCClass): Will raise IndexError if list is empty. """ - if len(self): + if not self.empty(): return self._pop() else: - raise IndexError("pop() failed - the list is empty") + raise IndexError("List empty. Cannot call pop().") def append(self, s): @@ -221,11 +237,13 @@ class StringList(BaseCClass): Appends a new string @s to list. If the input argument is not a string the string representation will be appended. """ - if isinstance(s, StringType): + if isinstance(s, bytes): + s.decode('ascii') + if isinstance(s, string_types): self._append(s) else: self._append(str(s)) - + @property def strings(self): @@ -245,10 +263,10 @@ class StringList(BaseCClass): """ Will return the last element in list. Raise IndexError if empty. """ - if len(self) > 0: + if not self.empty(): return self._last() else: - raise IndexError("The list is empty") + raise IndexError("List empty. No such element last().") def sort(self, cmp_flag=0): @@ -267,21 +285,24 @@ class StringList(BaseCClass): def index(self, value): """ @rtype: int """ - assert isinstance(value, str) - return self._find_first( value) + if isinstance(value, bytes): + value.decode('ascii') + if isinstance(value, string_types): + return self._find_first(value) + raise KeyError('Cannot index by "%s", lst.index() needs a string.' % str(type(value))) def free(self): self._free() def front(self): - if len(self) > 0: + if not self.empty(): return self._front() else: - raise IndexError + raise IndexError('List empty. No such element front().') def back(self): - if len(self) > 0: + if not self.empty(): return self._back() else: - raise IndexError + raise IndexError('List empty. No such element back().') diff --git a/ThirdParty/Ert/python/python/ert/util/substitution_list.py b/ThirdParty/Ert/python/python/ecl/util/substitution_list.py similarity index 98% rename from ThirdParty/Ert/python/python/ert/util/substitution_list.py rename to ThirdParty/Ert/python/python/ecl/util/substitution_list.py index d0902b7f45..925a9de086 100644 --- a/ThirdParty/Ert/python/python/ert/util/substitution_list.py +++ b/ThirdParty/Ert/python/python/ecl/util/substitution_list.py @@ -1,5 +1,5 @@ from cwrap import BaseCClass -from ert.util import UtilPrototype +from ecl.util import UtilPrototype class SubstitutionList(BaseCClass): diff --git a/ThirdParty/Ert/python/python/ert/util/thread_pool.py b/ThirdParty/Ert/python/python/ecl/util/thread_pool.py similarity index 100% rename from ThirdParty/Ert/python/python/ert/util/thread_pool.py rename to ThirdParty/Ert/python/python/ecl/util/thread_pool.py diff --git a/ThirdParty/Ert/python/python/ert/util/time_vector.py b/ThirdParty/Ert/python/python/ecl/util/time_vector.py similarity index 99% rename from ThirdParty/Ert/python/python/ert/util/time_vector.py rename to ThirdParty/Ert/python/python/ecl/util/time_vector.py index 68b39dc17e..7821057fc7 100644 --- a/ThirdParty/Ert/python/python/ert/util/time_vector.py +++ b/ThirdParty/Ert/python/python/ecl/util/time_vector.py @@ -16,7 +16,7 @@ import datetime import re -from ert.util import VectorTemplate, CTime, UtilPrototype +from ecl.util import VectorTemplate, CTime, UtilPrototype class TimeVector(VectorTemplate): diff --git a/ThirdParty/Ert/python/python/ert/util/ui_return.py b/ThirdParty/Ert/python/python/ecl/util/ui_return.py similarity index 95% rename from ThirdParty/Ert/python/python/ert/util/ui_return.py rename to ThirdParty/Ert/python/python/ecl/util/ui_return.py index e0bad99bdb..cfe4b28180 100644 --- a/ThirdParty/Ert/python/python/ert/util/ui_return.py +++ b/ThirdParty/Ert/python/python/ecl/util/ui_return.py @@ -14,10 +14,13 @@ # See the GNU General Public License at # for more details. +from __future__ import (absolute_import, division, + print_function, unicode_literals) + from cwrap import BaseCClass -from ert.util import UtilPrototype -from enums import UIReturnStatusEnum - +from ecl.util import UtilPrototype +from .enums import UIReturnStatusEnum + class UIReturn(BaseCClass): TYPE_NAME = "ui_return" diff --git a/ThirdParty/Ert/python/python/ert/util/util_func.py b/ThirdParty/Ert/python/python/ecl/util/util_func.py similarity index 98% rename from ThirdParty/Ert/python/python/ert/util/util_func.py rename to ThirdParty/Ert/python/python/ecl/util/util_func.py index 382b000ac6..0d9e4aa2ac 100644 --- a/ThirdParty/Ert/python/python/ert/util/util_func.py +++ b/ThirdParty/Ert/python/python/ecl/util/util_func.py @@ -17,7 +17,7 @@ Module with utility functions from util.c """ -from ert.util import UtilPrototype +from ecl.util import UtilPrototype strcmp_int = UtilPrototype("int util_strcmp_int( char* , char* )") """ diff --git a/ThirdParty/Ert/python/python/ert/util/vector_template.py b/ThirdParty/Ert/python/python/ecl/util/vector_template.py similarity index 83% rename from ThirdParty/Ert/python/python/ert/util/vector_template.py rename to ThirdParty/Ert/python/python/ecl/util/vector_template.py index 31085903c5..56b96c582b 100644 --- a/ThirdParty/Ert/python/python/ert/util/vector_template.py +++ b/ThirdParty/Ert/python/python/ecl/util/vector_template.py @@ -40,11 +40,12 @@ The C-level has implementations for several fundamental types like float and size_t not currently implemented in the Python version. """ +from __future__ import absolute_import, division, print_function, unicode_literals + import sys -from types import IntType, SliceType from cwrap import CFILE, BaseCClass -from ert.util import UtilPrototype +from ecl.util import UtilPrototype @@ -178,14 +179,14 @@ class VectorTemplate(BaseCClass): """ s = "" - lines = len(self) / width + lines = len(self) // width if not fmt: fmt = self.default_format + " " if max_lines is None or lines <= max_lines: s += self.str_data(width, 0, len(self), fmt) else: - s1 = width * max_lines / 2 + s1 = width * max_lines // 2 s += self.str_data(width, 0, s1, fmt) s += " .... \n" s += self.str_data(width, len(self) - s1, len(self), fmt) @@ -203,7 +204,7 @@ class VectorTemplate(BaseCClass): """ Implements read [] operator - @index can be slice instance. """ - if isinstance(index, IntType): + if isinstance(index, int): length = len(self) idx = index if idx < 0: @@ -213,7 +214,7 @@ class VectorTemplate(BaseCClass): return self._iget(idx) else: raise IndexError('Index must be in range %d <= %d < %d.' % (0, index, length)) - elif isinstance(index, SliceType): + elif isinstance(index, slice): return self.strided_copy(index) else: raise TypeError("Index should be integer or slice type.") @@ -223,7 +224,7 @@ class VectorTemplate(BaseCClass): Implements write [] operator - @index must be integer or slice. """ ls = len(self) - if isinstance(index, IntType): + if isinstance(index, int): idx = index if idx < 0: idx += ls @@ -232,7 +233,7 @@ class VectorTemplate(BaseCClass): for i in range(*index.indices(ls)): self[i] = value else: - raise TypeError("Index should be integer type, not %s." % type(index)) + raise TypeError("Index should be integer type") ################################################################## # Mathematical operations: @@ -559,3 +560,88 @@ class VectorTemplate(BaseCClass): vector = cls( ) vector.initRange( min_value , max_value , delta ) return vector + + def _strided_copy(self, *_): + raise NotImplementedError() + def _rshift(self, *_): + raise NotImplementedError() + def _lshift(self, *_): + raise NotImplementedError() + def _alloc(self, *_): + raise NotImplementedError() + def _element_size(self, *_): + raise NotImplementedError() + def _contains(self, *_): + raise NotImplementedError() + def _pop(self, *_): + raise NotImplementedError() + def default_format(self, *_): + raise NotImplementedError() + def _iget(self, *_): + raise NotImplementedError() + def _iset(self, *_): + raise NotImplementedError() + def _inplace_add(self, *_): + raise NotImplementedError() + def _shift(self, *_): + raise NotImplementedError() + def _alloc_copy(self, *_): + raise NotImplementedError() + def _inplace_mul(self, *_): + raise NotImplementedError() + def _scale(self, *_): + raise NotImplementedError() + def _memcpy(self, *_): + raise NotImplementedError() + def _assign(self, *_): + raise NotImplementedError() + def _size(self, *_): + raise NotImplementedError() + def _fprintf(self, *_): + raise NotImplementedError() + def _get_max(self, *_): + raise NotImplementedError() + def _get_min(self, *_): + raise NotImplementedError() + def _get_min_index(self, *_): + raise NotImplementedError() + def _get_max_index(self, *_): + raise NotImplementedError() + def _append(self, *_): + raise NotImplementedError() + def _idel_block(self, *_): + raise NotImplementedError() + def _sort(self, *_): + raise NotImplementedError() + def _rsort(self, *_): + raise NotImplementedError() + def _reset(self, *_): + raise NotImplementedError() + def _safe_iget(self, *_): + raise NotImplementedError() + def _set_read_only(self, *_): + raise NotImplementedError() + def _get_read_only(self, *_): + raise NotImplementedError() + def _set_default(self, *_): + raise NotImplementedError() + def _get_default(self, *_): + raise NotImplementedError() + def _free(self, *_): + raise NotImplementedError() + def _permute(self, *_): + raise NotImplementedError() + def _sort_perm(self, *_): + raise NotImplementedError() + def _rsort_perm(self, *_): + raise NotImplementedError() + def _select_unique(self, *_): + raise NotImplementedError() + def _element_sum(self, *_): + raise NotImplementedError() + def _get_data_ptr(self, *_): + raise NotImplementedError() + def _count_equal(self, *_): + raise NotImplementedError() + def _init_range(self, *_): + raise NotImplementedError() diff --git a/ThirdParty/Ert/python/python/ert/util/version.py b/ThirdParty/Ert/python/python/ecl/util/version.py similarity index 87% rename from ThirdParty/Ert/python/python/ert/util/version.py rename to ThirdParty/Ert/python/python/ecl/util/version.py index 7b2e2d5abf..95b8957ea7 100644 --- a/ThirdParty/Ert/python/python/ert/util/version.py +++ b/ThirdParty/Ert/python/python/ecl/util/version.py @@ -1,4 +1,4 @@ -from ert.util import UtilPrototype +from ecl.util import UtilPrototype def cmp_method(method): @@ -46,6 +46,15 @@ class Version(object): def __str__(self): return self.versionString() + def __repr__(self): + major, minor, micro = self.versionTuple() + commit = self._git_commit_short() + status = 'production' + if self.isDevelVersion(): + status = 'development' + fmt = 'Version(major=%d, minor=%d, micro="%s", commit="%s", status="%s")' + return fmt % (major, minor, micro, commit, status) + @cmp_method def __eq__(self, other): return self.versionTuple() == other.versionTuple() diff --git a/ThirdParty/Ert/python/python/ert/well/CMakeLists.txt b/ThirdParty/Ert/python/python/ecl/well/CMakeLists.txt similarity index 67% rename from ThirdParty/Ert/python/python/ert/well/CMakeLists.txt rename to ThirdParty/Ert/python/python/ecl/well/CMakeLists.txt index c9601f7487..b37c7f17c4 100644 --- a/ThirdParty/Ert/python/python/ert/well/CMakeLists.txt +++ b/ThirdParty/Ert/python/python/ecl/well/CMakeLists.txt @@ -9,5 +9,5 @@ set(PYTHON_SOURCES well_type_enum.py ) -add_python_package("python.ert.well" ${PYTHON_INSTALL_PREFIX}/ert/well "${PYTHON_SOURCES}" True) +add_python_package("python.ecl.well" ${PYTHON_INSTALL_PREFIX}/ecl/well "${PYTHON_SOURCES}" True) diff --git a/ThirdParty/Ert/python/python/ert/well/__init__.py b/ThirdParty/Ert/python/python/ecl/well/__init__.py similarity index 84% rename from ThirdParty/Ert/python/python/ert/well/__init__.py rename to ThirdParty/Ert/python/python/ecl/well/__init__.py index de69509186..5050afb29e 100644 --- a/ThirdParty/Ert/python/python/ert/well/__init__.py +++ b/ThirdParty/Ert/python/python/ecl/well/__init__.py @@ -1,12 +1,12 @@ -import ert -import ert.util -import ert.geo -import ert.ecl +import ecl +import ecl.util +import ecl.geo +import ecl.ecl from cwrap import Prototype class WellPrototype(Prototype): - lib = ert.load("libecl_well") + lib = ecl.load("libecl_well") def __init__(self, prototype, bind=True): super(WellPrototype, self).__init__(WellPrototype.lib, prototype, bind=bind) diff --git a/ThirdParty/Ert/python/python/ert/well/well_connection.py b/ThirdParty/Ert/python/python/ecl/well/well_connection.py similarity index 93% rename from ThirdParty/Ert/python/python/ert/well/well_connection.py rename to ThirdParty/Ert/python/python/ecl/well/well_connection.py index a4870ff2d8..8dc86af3ac 100644 --- a/ThirdParty/Ert/python/python/ert/well/well_connection.py +++ b/ThirdParty/Ert/python/python/ecl/well/well_connection.py @@ -1,5 +1,5 @@ from cwrap import BaseCClass -from ert.well import WellPrototype, WellConnectionDirectionEnum +from ecl.well import WellPrototype, WellConnectionDirectionEnum class WellConnection(BaseCClass): TYPE_NAME = "well_connection" @@ -81,7 +81,7 @@ class WellConnection(BaseCClass): msw = ' (multi segment)' if self.isMultiSegmentWell() else '' dir = WellConnectionDirectionEnum(self.direction()) addr = self._address() - return 'WellConnection(%s %s%s%s, direction = %s) at 0x%x' % (ijk, frac, open_, msw, dir, addr) + return 'WellConnection(%s %s%s%s, rates = (O:%s,G:%s,W:%s), direction = %s) at 0x%x' % (ijk, frac, open_, msw, self.oilRate(), self.gasRate(), self.waterRate(), dir, addr) def gasRate(self): return self._gas_rate() diff --git a/ThirdParty/Ert/python/python/ert/well/well_connection_direction_enum.py b/ThirdParty/Ert/python/python/ecl/well/well_connection_direction_enum.py similarity index 100% rename from ThirdParty/Ert/python/python/ert/well/well_connection_direction_enum.py rename to ThirdParty/Ert/python/python/ecl/well/well_connection_direction_enum.py diff --git a/ThirdParty/Ert/python/python/ert/well/well_info.py b/ThirdParty/Ert/python/python/ecl/well/well_info.py similarity index 95% rename from ThirdParty/Ert/python/python/ert/well/well_info.py rename to ThirdParty/Ert/python/python/ecl/well/well_info.py index 160a0659fb..31276ec8b2 100644 --- a/ThirdParty/Ert/python/python/ert/well/well_info.py +++ b/ThirdParty/Ert/python/python/ecl/well/well_info.py @@ -1,7 +1,7 @@ from cwrap import BaseCClass -from ert.ecl import EclGrid -from ert.ecl.ecl_file import EclFile -from ert.well import WellTimeLine, WellPrototype +from ecl.ecl import EclGrid +from ecl.ecl.ecl_file import EclFile +from ecl.well import WellTimeLine, WellPrototype class WellInfo(BaseCClass): @@ -33,7 +33,6 @@ class WellInfo(BaseCClass): self.addWellFile(item, load_segment_information) else: self.addWellFile(rst_file, load_segment_information) - self.__str__ = self.__repr__ def __repr__(self): diff --git a/ThirdParty/Ert/python/python/ert/well/well_segment.py b/ThirdParty/Ert/python/python/ecl/well/well_segment.py similarity index 98% rename from ThirdParty/Ert/python/python/ert/well/well_segment.py rename to ThirdParty/Ert/python/python/ecl/well/well_segment.py index 99a527cd97..6e7aeb2f40 100644 --- a/ThirdParty/Ert/python/python/ert/well/well_segment.py +++ b/ThirdParty/Ert/python/python/ecl/well/well_segment.py @@ -1,5 +1,5 @@ from cwrap import BaseCClass -from ert.well import WellPrototype +from ecl.well import WellPrototype class WellSegment(BaseCClass): TYPE_NAME = "well_segment" diff --git a/ThirdParty/Ert/python/python/ert/well/well_state.py b/ThirdParty/Ert/python/python/ecl/well/well_state.py similarity index 94% rename from ThirdParty/Ert/python/python/ert/well/well_state.py rename to ThirdParty/Ert/python/python/ecl/well/well_state.py index 103f16f4ff..6d0cadf567 100644 --- a/ThirdParty/Ert/python/python/ert/well/well_state.py +++ b/ThirdParty/Ert/python/python/ecl/well/well_state.py @@ -1,6 +1,6 @@ from cwrap import BaseCClass -from ert.well import WellTypeEnum, WellConnection, WellPrototype -from ert.util import CTime +from ecl.well import WellTypeEnum, WellConnection, WellPrototype +from ecl.util import CTime class WellState(BaseCClass): TYPE_NAME = "well_state" @@ -30,7 +30,7 @@ class WellState(BaseCClass): _gas_rate_si = WellPrototype("double well_state_get_gas_rate_si(well_state)") _water_rate_si = WellPrototype("double well_state_get_water_rate_si(well_state)") _volume_rate_si = WellPrototype("double well_state_get_volume_rate_si(well_state)") - + _get_global_well_head = WellPrototype("well_connection_ref well_state_get_global_wellhead(well_state)") def __init__(self): raise NotImplementedError("Class can not be instantiated directly") @@ -46,6 +46,11 @@ class WellState(BaseCClass): def free(self): pass + def wellHead(self): + well_head = self._get_global_well_head() + well_head.setParent( self ) + return well_head + def wellNumber(self): """ @rtype: int """ return self._well_number( ) diff --git a/ThirdParty/Ert/python/python/ert/well/well_time_line.py b/ThirdParty/Ert/python/python/ecl/well/well_time_line.py similarity index 95% rename from ThirdParty/Ert/python/python/ert/well/well_time_line.py rename to ThirdParty/Ert/python/python/ecl/well/well_time_line.py index 2ea55bf9df..bc42a20e82 100644 --- a/ThirdParty/Ert/python/python/ert/well/well_time_line.py +++ b/ThirdParty/Ert/python/python/ecl/well/well_time_line.py @@ -1,5 +1,5 @@ from cwrap import BaseCClass -from ert.well import WellState, WellPrototype +from ecl.well import WellState, WellPrototype class WellTimeLine(BaseCClass): TYPE_NAME = "well_time_line" diff --git a/ThirdParty/Ert/python/python/ert/well/well_type_enum.py b/ThirdParty/Ert/python/python/ecl/well/well_type_enum.py similarity index 100% rename from ThirdParty/Ert/python/python/ert/well/well_type_enum.py rename to ThirdParty/Ert/python/python/ecl/well/well_type_enum.py diff --git a/ThirdParty/Ert/python/python/ert/CMakeLists.txt b/ThirdParty/Ert/python/python/ert/CMakeLists.txt deleted file mode 100644 index 708c201d2d..0000000000 --- a/ThirdParty/Ert/python/python/ert/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -set(PYTHON_SOURCES - __init__.py -) -add_python_package("python.ert" ${PYTHON_INSTALL_PREFIX}/ert "${PYTHON_SOURCES}" True) - -add_subdirectory(ecl) -add_subdirectory(geo) -add_subdirectory(test) -add_subdirectory(util) -add_subdirectory(well) - -IF (BUILD_ERT) - set( ERT_SITE_INIT_TARGET "" CACHE FILE "Name of optional external site init module for top level ert package") - if (EXISTS ${ERT_SITE_INIT_TARGET}) - message(STATUS "Using ert site init module: ${ERT_SITE_INIT_TARGET}") - install(FILES ${ERT_SITE_INIT_TARGET} DESTINATION ${PYTHON_INSTALL_PREFIX}/ert RENAME ert_site_init.py) - endif() - add_subdirectory(analysis) - add_subdirectory(config) - add_subdirectory(enkf) - add_subdirectory(job_queue) - add_subdirectory(rms) - add_subdirectory(sched) - add_subdirectory(server) -ENDIF() - - -configure_file(ert_lib_info_build.py.in ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX}/ert/__ert_lib_info.py ) -configure_file(ert_lib_info_install.py.in ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX}/ert_lib_info_install.py ) -install(FILES ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX}/ert_lib_info_install.py DESTINATION ${PYTHON_INSTALL_PREFIX}/ert RENAME __ert_lib_info.py) diff --git a/ThirdParty/Ert/python/python/ert/analysis/CMakeLists.txt b/ThirdParty/Ert/python/python/ert/analysis/CMakeLists.txt deleted file mode 100644 index 5f20dd0a2a..0000000000 --- a/ThirdParty/Ert/python/python/ert/analysis/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - analysis_module.py - linalg.py -) - -add_python_package("python.ert.analysis." ${PYTHON_INSTALL_PREFIX}/ert/analysis/ "${PYTHON_SOURCES}" True) - -add_subdirectory(enums) diff --git a/ThirdParty/Ert/python/python/ert/analysis/__init__.py b/ThirdParty/Ert/python/python/ert/analysis/__init__.py deleted file mode 100644 index 58bae50467..0000000000 --- a/ThirdParty/Ert/python/python/ert/analysis/__init__.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file '__init__.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - - -import ert -from cwrap import Prototype -import ert.util - -class AnalysisPrototype(Prototype): - lib = ert.load("libanalysis") - - def __init__(self, prototype, bind=True): - super(AnalysisPrototype, self).__init__(AnalysisPrototype.lib, prototype, bind=bind) - - - -ANALYSIS_LIB = ert.load("libanalysis") - -from .enums import AnalysisModuleOptionsEnum, AnalysisModuleLoadStatusEnum - -from .analysis_module import AnalysisModule -from .linalg import Linalg diff --git a/ThirdParty/Ert/python/python/ert/analysis/analysis_module.py b/ThirdParty/Ert/python/python/ert/analysis/analysis_module.py deleted file mode 100644 index f73d0380a4..0000000000 --- a/ThirdParty/Ert/python/python/ert/analysis/analysis_module.py +++ /dev/null @@ -1,188 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'analysis_module.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from cwrap import BaseCClass -from ert.util.rng import RandomNumberGenerator -from ert.analysis import AnalysisPrototype - -from ert.util import Matrix - -class AnalysisModule(BaseCClass): - TYPE_NAME = "analysis_module" - - _alloc_external = AnalysisPrototype("void* analysis_module_alloc_external(rng, char*)" , bind = False) - _alloc_internal = AnalysisPrototype("void* analysis_module_alloc_internal(rng, char*)" , bind = False) - _free = AnalysisPrototype("void analysis_module_free(analysis_module)") - _get_lib_name = AnalysisPrototype("char* analysis_module_get_lib_name(analysis_module)") - _get_module_internal = AnalysisPrototype("bool analysis_module_internal(analysis_module)") - _set_var = AnalysisPrototype("bool analysis_module_set_var(analysis_module, char*, char*)") - _get_table_name = AnalysisPrototype("char* analysis_module_get_table_name(analysis_module)") - _get_name = AnalysisPrototype("char* analysis_module_get_name(analysis_module)") - _check_option = AnalysisPrototype("bool analysis_module_check_option(analysis_module, long)") - _has_var = AnalysisPrototype("bool analysis_module_has_var(analysis_module, char*)") - _get_double = AnalysisPrototype("double analysis_module_get_double(analysis_module, char*)") - _get_int = AnalysisPrototype("int analysis_module_get_int(analysis_module, char*)") - _get_bool = AnalysisPrototype("bool analysis_module_get_bool(analysis_module, char*)") - _get_str = AnalysisPrototype("char* analysis_module_get_ptr(analysis_module, char*)") - _init_update = AnalysisPrototype("void analysis_module_init_update(analysis_module, bool_vector , matrix , matrix , matrix , matrix, matrix)") - _updateA = AnalysisPrototype("void analysis_module_updateA(analysis_module, matrix , matrix , matrix , matrix, matrix, matrix, void*)") - _initX = AnalysisPrototype("void analysis_module_initX(analysis_module, matrix , matrix , matrix , matrix , matrix, matrix, matrix)") - - - # The VARIABLE_NAMES field is a completly broken special case - # which only applies to the rml module. - VARIABLE_NAMES = { - "LAMBDA0": {"type": float, "description": "Initial Lambda"}, - "USE_PRIOR": {"type": bool, "description": "Use both Prior and Observation Variability"}, - "LAMBDA_REDUCE": {"type": float, "description": "Lambda Reduction Factor"}, - "LAMBDA_INCREASE": {"type": float, "description": "Lambda Incremental Factor"}, - "LAMBDA_MIN": {"type": float, "description": "Minimum Lambda"}, - "LOG_FILE": {"type": str, "description": "Log File"}, - "CLEAR_LOG": {"type": bool, "description": "Clear Existing Log File"}, - "LAMBDA_RECALCULATE": {"type": bool, "description": "Recalculate Lambda after each Iteration"}, - "ENKF_TRUNCATION": {"type": float, "description": "Singular value truncation"}, - "ENKF_NCOMP": {"type": int, "description": "ENKF_NCOMP"}, - "CV_NFOLDS": {"type": int, "description": "CV_NFOLDS"}, - "FWD_STEP_R2_LIMIT": {"type": float, "description": "FWD_STEP_R2_LIMIT"}, - "CV_PEN_PRESS": {"type": bool, "description": "CV_PEN_PRESS"} - } - - def __init__(self, rng , name = None , lib_name = None): - if name is None and lib_name is None: - raise ValueError("Must supply exactly one of lib or lib_name") - - if name and lib_name: - raise ValueError("Must supply exactly one of name or lib_name") - - if lib_name: - c_ptr = self._alloc_external(rng, lib_name ) - else: - c_ptr = self._alloc_internal( rng , name ) - if not c_ptr: - raise KeyError("Failed to load internal module:%s" % name) - - super(AnalysisModule, self).__init__(c_ptr) - - - def getVariableNames(self): - """ @rtype: list of str """ - items = [] - for name in AnalysisModule.VARIABLE_NAMES: - if self.hasVar(name): - items.append(name) - return items - - def getVariableValue(self, name): - """ @rtype: int or float or bool or str """ - variable_type = self.getVariableType(name) - if variable_type == float: - return self.getDouble(name) - elif variable_type == bool: - return self.getBool(name) - elif variable_type == str: - return self.getStr(name) - elif variable_type == int: - return self.getInt(name) - - def getVariableType(self, name): - """ :rtype: type """ - return AnalysisModule.VARIABLE_NAMES[name]["type"] - - def getVariableDescription(self, name): - """ :rtype: str """ - return AnalysisModule.VARIABLE_NAMES[name]["description"] - - def getVar(self, name): - return self.getVariableValue( name ) - - def free(self): - self._free( ) - - def __repr__(self): - nm = self.name() - tn = self.getTableName() - ln = self.getLibName() - mi = 'internal' if self.getInternal() else 'external' - ad = self._ad_str() - fmt = 'AnalysisModule(name = %s, table = %s, lib = %s, %s) %s' - return fmt % (nm, tn, ln, mi, ad) - - def getLibName(self): - return self._get_lib_name( ) - - def getInternal(self): - return self._get_module_internal( ) - - def __assertVar(self , var_name): - if not self.hasVar(var_name): - raise KeyError("Module does not support key:%s" % var_name) - - def setVar(self, var_name, value): - self.__assertVar( var_name ) - string_value = str(value) - return self._set_var(var_name, string_value) - - - def getTableName(self): - return self._get_table_name( ) - - def getName(self): - """ :rtype: str """ - return self.name() - - def name(self): - return self._get_name( ) - - def checkOption(self, flag): - return self._check_option(flag) - - def hasVar(self, var): - """ :rtype: bool """ - return self._has_var(var) - - def getDouble(self, var): - """ :rtype: float """ - self.__assertVar( var ) - return self._get_double(var) - - def getInt(self, var): - """ :rtype: int """ - self.__assertVar( var ) - return self._get_int(var) - - def getBool(self, var): - """ :rtype: bool """ - self.__assertVar( var ) - return self._get_bool(var) - - def getStr(self, var): - """ :rtype: str """ - self.__assertVar( var ) - return self._get_str(var) - - - def initUpdate(self, mask, S, R, dObs, E, D): - self._init_update(mask, S, R, dObs, E, D) - - - def updateA(self, A, S, R, dObs, E, D): - self._updateA(A, S, R, dObs, E, D, None) - - - def initX(self, A, S, R, dObs, E, D): - X = Matrix( A.columns() , A.columns()) - self._initX(X, A, S, R, dObs, E, D) - return X diff --git a/ThirdParty/Ert/python/python/ert/analysis/enums/CMakeLists.txt b/ThirdParty/Ert/python/python/ert/analysis/enums/CMakeLists.txt deleted file mode 100644 index 55b145c74b..0000000000 --- a/ThirdParty/Ert/python/python/ert/analysis/enums/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - analysis_module_options_enum.py - analysis_module_load_status_enum.py -) - -add_python_package("python.ert.analysis.enums" ${PYTHON_INSTALL_PREFIX}/ert/analysis/enums "${PYTHON_SOURCES}" True) - - - diff --git a/ThirdParty/Ert/python/python/ert/analysis/enums/__init__.py b/ThirdParty/Ert/python/python/ert/analysis/enums/__init__.py deleted file mode 100644 index fecedb4bc1..0000000000 --- a/ThirdParty/Ert/python/python/ert/analysis/enums/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .analysis_module_options_enum import AnalysisModuleOptionsEnum -from .analysis_module_load_status_enum import AnalysisModuleLoadStatusEnum - diff --git a/ThirdParty/Ert/python/python/ert/analysis/enums/analysis_module_load_status_enum.py b/ThirdParty/Ert/python/python/ert/analysis/enums/analysis_module_load_status_enum.py deleted file mode 100644 index 285b85aa8b..0000000000 --- a/ThirdParty/Ert/python/python/ert/analysis/enums/analysis_module_load_status_enum.py +++ /dev/null @@ -1,35 +0,0 @@ - -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'analysis_module_load_status_enum.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - - -from cwrap import BaseCEnum -from ert.analysis import ANALYSIS_LIB - - -class AnalysisModuleLoadStatusEnum(BaseCEnum): - TYPE_NAME = "analysis_module_load_status_enum" - LOAD_OK = None - DLOPEN_FAILURE = None - LOAD_SYMBOL_TABLE_NOT_FOUND = None - -AnalysisModuleLoadStatusEnum.addEnum("LOAD_OK", 0) -AnalysisModuleLoadStatusEnum.addEnum("DLOPEN_FAILURE", 1) -AnalysisModuleLoadStatusEnum.addEnum("LOAD_SYMBOL_TABLE_NOT_FOUND", 2) - - - - diff --git a/ThirdParty/Ert/python/python/ert/analysis/enums/analysis_module_options_enum.py b/ThirdParty/Ert/python/python/ert/analysis/enums/analysis_module_options_enum.py deleted file mode 100644 index 7a5e35c4f6..0000000000 --- a/ThirdParty/Ert/python/python/ert/analysis/enums/analysis_module_options_enum.py +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'analysis_module_options_enum.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCEnum -from ert.analysis import ANALYSIS_LIB - - -class AnalysisModuleOptionsEnum(BaseCEnum): - TYPE_NAME = "analysis_module_options_enum" - ANALYSIS_NEED_ED = None - ANALYSIS_USE_A = None - ANALYSIS_UPDATE_A = None - ANALYSIS_SCALE_DATA = None - ANALYSIS_ITERABLE = None - -AnalysisModuleOptionsEnum.addEnum("ANALYSIS_NEED_ED" , 1) -AnalysisModuleOptionsEnum.addEnum("ANALYSIS_USE_A" , 4) -AnalysisModuleOptionsEnum.addEnum("ANALYSIS_UPDATE_A" , 8) -AnalysisModuleOptionsEnum.addEnum("ANALYSIS_SCALE_DATA" , 16) -AnalysisModuleOptionsEnum.addEnum("ANALYSIS_ITERABLE" , 32) - - - - diff --git a/ThirdParty/Ert/python/python/ert/analysis/linalg.py b/ThirdParty/Ert/python/python/ert/analysis/linalg.py deleted file mode 100644 index 35782dfcd8..0000000000 --- a/ThirdParty/Ert/python/python/ert/analysis/linalg.py +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (C) 2015 Statoil ASA, Norway. -# -# The file 'linalg.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from cwrap import BaseCClass -from ert.analysis import AnalysisPrototype - - -__all__ = ["numPC"] - -class Linalg(BaseCClass): - """ - The linalg class is a purely static class which mainly serves as a - namespace for a collection of ensemble based linear algebra - methods. - """ - _get_num_PC = AnalysisPrototype("int enkf_linalg_num_PC( matrix , double)" , bind = False) - - @staticmethod - def numPC(S , truncation): - if 0 < truncation <= 1: - return Linalg._get_num_PC( S , truncation ) - else: - raise ValueError("truncation must be in the interval (0,1]") - diff --git a/ThirdParty/Ert/python/python/ert/config/CMakeLists.txt b/ThirdParty/Ert/python/python/ert/config/CMakeLists.txt deleted file mode 100644 index b0dcd2bb79..0000000000 --- a/ThirdParty/Ert/python/python/ert/config/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - schema_item.py - config_error.py - config_parser.py - config_content.py - config_settings.py - content_type_enum.py - unrecognized_enum.py -) - -add_python_package("python.ert.config" ${PYTHON_INSTALL_PREFIX}/ert/config "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert/config/__init__.py b/ThirdParty/Ert/python/python/ert/config/__init__.py deleted file mode 100644 index c17a9349b9..0000000000 --- a/ThirdParty/Ert/python/python/ert/config/__init__.py +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file '__init__.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import Prototype -import ert -import ert.util - -class ConfigPrototype(Prototype): - lib = ert.load("libconfig") - - def __init__(self, prototype, bind=True): - super(ConfigPrototype, self).__init__(ConfigPrototype.lib, prototype, bind=bind) - -from .unrecognized_enum import UnrecognizedEnum -from .content_type_enum import ContentTypeEnum -from .config_error import ConfigError -from .schema_item import SchemaItem -from .config_content import ConfigContent , ContentItem, ContentNode -from .config_parser import ConfigParser -from .config_settings import ConfigSettings diff --git a/ThirdParty/Ert/python/python/ert/config/config_content.py b/ThirdParty/Ert/python/python/ert/config/config_content.py deleted file mode 100644 index 8a207bfcf7..0000000000 --- a/ThirdParty/Ert/python/python/ert/config/config_content.py +++ /dev/null @@ -1,204 +0,0 @@ -# Copyright (C) 2015 Statoil ASA, Norway. -# -# The file 'config_content.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -import os.path - -from ert.config import UnrecognizedEnum, ContentTypeEnum, ConfigError, ConfigPrototype, SchemaItem -from cwrap import BaseCClass - - -class ContentNode(BaseCClass): - TYPE_NAME = "content_node" - - _iget = ConfigPrototype("char* config_content_node_iget( content_node , int)") - _size = ConfigPrototype("int config_content_node_get_size( content_node )") - _get_full_string = ConfigPrototype("char* config_content_node_get_full_string( content_node , char* )") - _iget_type = ConfigPrototype("config_content_type_enum config_content_node_iget_type( content_node , int)") - _iget_as_abspath = ConfigPrototype("char* config_content_node_iget_as_abspath( content_node , int)") - _iget_as_relpath = ConfigPrototype("char* config_content_node_iget_as_relpath( content_node , int)") - _iget_as_string = ConfigPrototype("char* config_content_node_iget( content_node , int)") - _iget_as_int = ConfigPrototype("int config_content_node_iget_as_int( content_node , int)") - _iget_as_double = ConfigPrototype("double config_content_node_iget_as_double( content_node , int)") - _iget_as_path = ConfigPrototype("char* config_content_node_iget_as_path( content_node , int)") - _iget_as_bool = ConfigPrototype("bool config_content_node_iget_as_bool( content_node , int)") - _iget_as_isodate = ConfigPrototype("time_t config_content_node_iget_as_isodate( content_node , int)") - - typed_get = { - ContentTypeEnum.CONFIG_STRING: _iget_as_string, - ContentTypeEnum.CONFIG_INT: _iget_as_int, - ContentTypeEnum.CONFIG_FLOAT: _iget_as_double, - ContentTypeEnum.CONFIG_PATH: _iget_as_path, - ContentTypeEnum.CONFIG_EXISTING_PATH: _iget_as_path, - ContentTypeEnum.CONFIG_BOOL: _iget_as_bool, - ContentTypeEnum.CONFIG_ISODATE: _iget_as_isodate - } - - - def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") - - def __len__(self): - return self._size() - - def __assertIndex(self , index): - if isinstance(index, int): - if index < 0: - index += len(self) - - if not 0 <= index < len(self): - raise IndexError - return index - else: - raise TypeError("Invalid argument type: %s" % index) - - - def __getitem__(self, index): - index = self.__assertIndex(index) - - content_type = self._iget_type(index) - typed_get = self.typed_get[content_type] - return typed_get(self, index) - - def getPath(self , index = 0, absolute = True , relative_start = None): - index = self.__assertIndex(index) - content_type = self._iget_type(index) - if content_type in [ContentTypeEnum.CONFIG_EXISTING_PATH , ContentTypeEnum.CONFIG_PATH]: - if absolute: - return self._iget_as_abspath(index) - else: - if relative_start is None: - return self._iget_as_relpath(index) - else: - abs_path = self._iget_as_abspath(index) - return os.path.relpath( abs_path , relative_start ) - else: - raise TypeError("The getPath() method can only be called on PATH items") - - def content(self, sep=" "): - return self._get_full_string(sep) - - - def igetString(self , index): - index = self.__assertIndex(index) - return self._iget(index ) - - - def asList(self): - return [x for x in self] - - - -class ContentItem(BaseCClass): - TYPE_NAME = "content_item" - - _alloc = ConfigPrototype("void* config_content_item_alloc( schema_item , void* )" , bind = False ) - _size = ConfigPrototype("int config_content_item_get_size( content_item )") - _iget_content_node = ConfigPrototype("content_node_ref config_content_item_iget_node( content_item , int)") - _free = ConfigPrototype("void config_content_item_free( content_item )") - - def __init__(self , schema_item): - path_elm = None - c_ptr = self._alloc( schema_item , path_elm) - super( ContentItem, self).__init__(c_ptr) - - - def __len__(self): - return self._size() - - - def __getitem__(self, index): - if isinstance(index, int): - if index < 0: - index += len(self) - - if (index >= 0) and (index < len(self)): - return self._iget_content_node(index).setParent(self) - else: - raise IndexError - else: - raise TypeError("[] operator must have integer index") - - def last(self): - return self[-1] - - def getValue(self , item_index = -1 , node_index = 0): - node = self[item_index] - return node[node_index] - - - def free(self): - self._free( ) - - - -class ConfigContent(BaseCClass): - TYPE_NAME = "config_content" - - _free = ConfigPrototype("void config_content_free( config_content )") - _is_valid = ConfigPrototype("bool config_content_is_valid( config_content )") - _has_key = ConfigPrototype("bool config_content_has_item( config_content , char*)") - _get_item = ConfigPrototype("content_item_ref config_content_get_item( config_content , char*)") - _get_errors = ConfigPrototype("config_error_ref config_content_get_errors( config_content )") - _get_warnings = ConfigPrototype("stringlist_ref config_content_get_warnings( config_content )") - - def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") - - def __contains__(self , key): - return self._has_key(key) - - def setParser(self , parser): - self._parser = parser - - - def __getitem__(self , key): - if key in self: - item = self._get_item(key) - item.setParent( self ) - return item - else: - if key in self._parser: - schema_item = SchemaItem( key ) - return ContentItem( schema_item ) - else: - raise KeyError("No such key: %s" % key) - - - def hasKey(self,key): - return key in self - - - def getValue(self , key , item_index = -1 , node_index = 0): - item = self[key] - return item.getValue( item_index , node_index ) - - - def isValid(self): - return self._is_valid() - - - def free(self): - self._free() - - - def getErrors(self): - """ @rtype: ConfigError """ - return self._get_errors() - - - def getWarnings(self): - """ @rtype: ConfigError """ - return self._get_warnings( ) diff --git a/ThirdParty/Ert/python/python/ert/config/config_error.py b/ThirdParty/Ert/python/python/ert/config/config_error.py deleted file mode 100644 index 515adc8908..0000000000 --- a/ThirdParty/Ert/python/python/ert/config/config_error.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'enkf_fs.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from ert.config import ConfigPrototype -from cwrap import BaseCClass - - - -class ConfigError(BaseCClass): - TYPE_NAME = "config_error" - _free = ConfigPrototype("void config_error_free(config_error)") - _count = ConfigPrototype("int config_error_count(config_error)") - _iget = ConfigPrototype("char* config_error_iget(config_error, int)") - - def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") - - def __getitem__(self, index): - """ @rtype: str """ - if not isinstance(index, int): - raise TypeError("Expected an integer") - - size = len(self) - if index >= size: - raise IndexError("Index out of range: %d < %d" % (index, size)) - - return self._iget(index) - - def __len__(self): - """ @rtype: int """ - return self._count() - - def free(self): - self._free() - diff --git a/ThirdParty/Ert/python/python/ert/config/config_parser.py b/ThirdParty/Ert/python/python/ert/config/config_parser.py deleted file mode 100644 index c4f75049f7..0000000000 --- a/ThirdParty/Ert/python/python/ert/config/config_parser.py +++ /dev/null @@ -1,84 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'config_parser.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -import sys -import os.path - -from ert.config import UnrecognizedEnum, ContentTypeEnum , ConfigContent, ConfigPrototype -from cwrap import BaseCClass - - -class ConfigParser(BaseCClass): - TYPE_NAME = "config_parser" - - _alloc = ConfigPrototype("void* config_alloc( )", bind=False) - _add = ConfigPrototype("schema_item_ref config_add_schema_item( config_parser , char* , bool)") - _free = ConfigPrototype("void config_free( config_parser )") - _parse = ConfigPrototype("config_content_obj config_parse( config_parser , char* , char* , char* , char* , hash , config_unrecognized_enum , bool )") - _get_schema_item = ConfigPrototype("schema_item_ref config_get_schema_item( config_parser , char*)") - _has_schema_item = ConfigPrototype("bool config_has_schema_item( config_parser , char*)") - - def __init__(self): - c_ptr = self._alloc() - super(ConfigParser, self).__init__(c_ptr) - - - def __contains__(self , keyword): - return self._has_schema_item( keyword ) - - - def add(self, keyword, required=False , value_type = None): - item = self._add(keyword, required).setParent( self ) - if value_type: - item.iset_type( 0 , value_type ) - - return item - - - def getSchemaItem(self , keyword): - if keyword in self: - item = self._get_schema_item(keyword) - item.setParent( self ) - else: - raise KeyError("Config parser does not have item:%s" % keyword) - - - def parse(self, config_file, comment_string="--", include_kw="INCLUDE", define_kw="DEFINE", - pre_defined_kw_map=None, unrecognized=UnrecognizedEnum.CONFIG_UNRECOGNIZED_WARN, validate=True): - """ @rtype: ConfigContent """ - - assert isinstance(unrecognized, UnrecognizedEnum) - - - if os.path.exists(config_file): - config_content = self._parse(config_file, comment_string, include_kw, define_kw, pre_defined_kw_map, unrecognized, validate) - config_content.setParser( self ) - - if not config_content.isValid(): - if validate: - sys.stderr.write("Errors parsing:%s \n" % config_file) - for count, error in enumerate(config_content.getErrors()): - sys.stderr.write(" %02d:%s\n" % (count , error)) - - raise ValueError("Parsing:%s failed" % config_file) - - return config_content - else: - raise IOError("File: %s does not exists" % config_file) - - - def free(self): - self._free() diff --git a/ThirdParty/Ert/python/python/ert/config/config_settings.py b/ThirdParty/Ert/python/python/ert/config/config_settings.py deleted file mode 100644 index 1536e27d5c..0000000000 --- a/ThirdParty/Ert/python/python/ert/config/config_settings.py +++ /dev/null @@ -1,141 +0,0 @@ -# Copyright (C) 2017 Statoil ASA, Norway. -# -# The file 'config_settings.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from cwrap import BaseCClass - -from ert.config import ConfigPrototype, ContentTypeEnum -from ert.config import SchemaItem - - -class ConfigSettings(BaseCClass): - TYPE_NAME = "config_settings" - _alloc = ConfigPrototype("void* config_settings_alloc(char*)", bind = False) - _free = ConfigPrototype("void config_settings_free(config_settings)") - - _add_setting = ConfigPrototype("bool config_settings_add_setting(config_settings , char* , config_content_type_enum, char*)") - _add_double_setting = ConfigPrototype("void config_settings_add_double_setting(config_settings , char* , double)") - _add_int_setting = ConfigPrototype("void config_settings_add_int_setting(config_settings , char* , int)") - _add_string_setting = ConfigPrototype("void config_settings_add_string_setting(config_settings , char* , char*)") - _add_bool_setting = ConfigPrototype("void config_settings_add_bool_setting(config_settings , char* , bool)") - _has_key = ConfigPrototype("bool config_settings_has_key(config_settings , char*)") - _get_type = ConfigPrototype("config_content_type_enum config_settings_get_value_type(config_settings, char*)") - _init_parser = ConfigPrototype("void config_settings_init_parser(config_settings, config_parser, bool)") - _apply = ConfigPrototype("void config_settings_apply(config_settings, config_content)") - _alloc_keys = ConfigPrototype("stringlist_obj config_settings_alloc_keys(config_settings)") - - _get = ConfigPrototype("char* config_settings_get_value(config_settings, char*)") - _get_int = ConfigPrototype("int config_settings_get_int_value(config_settings, char*)") - _get_double = ConfigPrototype("double config_settings_get_double_value(config_settings, char*)") - _get_bool = ConfigPrototype("bool config_settings_get_bool_value(config_settings, char*)") - - _set = ConfigPrototype("bool config_settings_set_value(config_settings, char*, char*)") - _set_int = ConfigPrototype("bool config_settings_set_int_value(config_settings, char*, int)") - _set_double = ConfigPrototype("bool config_settings_set_double_value(config_settings, char*, double)") - _set_bool = ConfigPrototype("bool config_settings_set_bool_value(config_settings, char*, bool)") - - - - - def __init__(self , root_key): - c_ptr = ConfigSettings._alloc( root_key ) - super(ConfigSettings, self).__init__(c_ptr) - - - def __contains__(self, key): - return self._has_key( key ) - - - def __getitem__(self,key): - if key in self: - value_type = self._get_type( key ) - if value_type == ContentTypeEnum.CONFIG_INT: - return self._get_int( key ) - - if value_type == ContentTypeEnum.CONFIG_FLOAT: - return self._get_double( key ) - - if value_type == ContentTypeEnum.CONFIG_BOOL: - return self._get_bool( key ) - - return self._get( key ) - else: - raise KeyError("Settings object does not support key:%s" % key) - - - def __setitem__(self, key, value): - if key in self: - value_type = self._get_type( key ) - - if value_type == ContentTypeEnum.CONFIG_INT: - self._set_int( key , value) - return - - if value_type == ContentTypeEnum.CONFIG_FLOAT: - self._set_double( key , value) - return - - if value_type == ContentTypeEnum.CONFIG_BOOL: - if type(value) is bool: - self._set_bool( key , value ) - return - else: - raise TypeError("Type of %s should be boolean" % key) - - if not self._set( key , value ): - raise TypeError("Setting %s=%s failed \n" % (key , value)) - else: - raise KeyError("Settings object does not support key:%s" % key) - - - - def free(self): - self._free( ) - - - def addSetting(self, key , value_type, initial_value): - if not self._add_setting( key , value_type , str(initial_value) ): - raise TypeError("Failed to add setting %s with initial value %s" % (key , initial_value)) - - - def addIntSetting(self, key , initial_value): - self._add_int_setting( key , initial_value ) - - def addDoubleSetting(self, key , initial_value): - self._add_double_setting( key , initial_value ) - - def addStringSetting(self, key , initial_value): - self._add_string_setting( key , initial_value ) - - def addBoolSetting(self, key , initial_value): - self._add_bool_setting( key , initial_value ) - - def initParser(self , parser, required = False): - self._init_parser( parser , required ) - - - def apply(self , config_content): - self._apply( config_content ) - - - def keys(self): - return self._alloc_keys( ) - - - def getType(self , key): - if key in self: - return self._get_type( key ) - else: - raise KeyError("No such key:%s" % key) diff --git a/ThirdParty/Ert/python/python/ert/config/content_type_enum.py b/ThirdParty/Ert/python/python/ert/config/content_type_enum.py deleted file mode 100644 index f5ba67e0b7..0000000000 --- a/ThirdParty/Ert/python/python/ert/config/content_type_enum.py +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'content_type_enum.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from cwrap import BaseCEnum - -class ContentTypeEnum(BaseCEnum): - TYPE_NAME = "config_content_type_enum" - CONFIG_STRING = None - CONFIG_INT = None - CONFIG_FLOAT = None - CONFIG_PATH = None - CONFIG_EXISTING_PATH = None - CONFIG_BOOL = None - CONFIG_CONFIG = None - CONFIG_BYTESIZE = None - CONFIG_EXECUTABLE = None - CONFIG_ISODATE = None - CONFIG_INVALID = None - -ContentTypeEnum.addEnum("CONFIG_STRING", 1) -ContentTypeEnum.addEnum("CONFIG_INT", 2) -ContentTypeEnum.addEnum("CONFIG_FLOAT", 4) -ContentTypeEnum.addEnum("CONFIG_PATH", 8) -ContentTypeEnum.addEnum("CONFIG_EXISTING_PATH", 16) -ContentTypeEnum.addEnum("CONFIG_BOOL", 32) -ContentTypeEnum.addEnum("CONFIG_CONFIG", 64) -ContentTypeEnum.addEnum("CONFIG_BYTESIZE", 128) -ContentTypeEnum.addEnum("CONFIG_EXECUTABLE", 256) -ContentTypeEnum.addEnum("CONFIG_ISODATE", 512) -ContentTypeEnum.addEnum("CONFIG_INVALID", 1024) diff --git a/ThirdParty/Ert/python/python/ert/config/schema_item.py b/ThirdParty/Ert/python/python/ert/config/schema_item.py deleted file mode 100644 index 551c14f9df..0000000000 --- a/ThirdParty/Ert/python/python/ert/config/schema_item.py +++ /dev/null @@ -1,100 +0,0 @@ -# Copyright (C) 2016 Statoil ASA, Norway. -# -# This file is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -import ctypes - -from ert.util import UtilPrototype -from ert.config import ContentTypeEnum , ConfigPrototype -from cwrap import BaseCClass - - -class SchemaItem(BaseCClass): - TYPE_NAME = "schema_item" - - _alloc = ConfigPrototype("void* config_schema_item_alloc( char* , bool )", bind=False) - _free = ConfigPrototype("void config_schema_item_free( schema_item )") - _iget_type = ConfigPrototype("config_content_type_enum config_schema_item_iget_type( schema_item, int)") - _iset_type = ConfigPrototype("void config_schema_item_iset_type( schema_item , int , config_content_type_enum)") - _set_argc_minmax = ConfigPrototype("void config_schema_item_set_argc_minmax( schema_item , int , int)") - _add_alternative = ConfigPrototype("void config_schema_item_add_indexed_alternative(schema_item , int , char*)") - _set_deprecated = ConfigPrototype("void config_schema_item_set_deprecated(schema_item , char*)") - _valid_string = ConfigPrototype("bool config_schema_item_valid_string(config_content_type_enum , char*)", bind = False) - _sscanf_bool = UtilPrototype("bool util_sscanf_bool( char* , bool*)", bind = False) - - def __init__(self, keyword, required=False): - c_ptr = self._alloc(keyword, required) - super(SchemaItem, self).__init__(c_ptr) - - @classmethod - def validString(cls , value_type, value): - return cls._valid_string( value_type , value ) - - - - @classmethod - def convert(cls, value_type, value_string): - if cls.validString(value_type , value_string): - if value_type == ContentTypeEnum.CONFIG_INT: - return int(value_string) - - if value_type == ContentTypeEnum.CONFIG_FLOAT: - return float(value_string) - - if value_type == ContentTypeEnum.CONFIG_BOOL: - value = ctypes.c_bool() - SchemaItem._sscanf_bool( value_string , ctypes.byref( value )) - return value.value - - return value_string - else: - raise ValueError("Invalid string value: %s" % value_string) - - - - def iget_type( self, index): - """ @rtype: ContentTypeEnum """ - return self._iget_type(index) - - def iset_type( self, index, schema_type ): - """ - @type schema_type: ContentTypeEnum - """ - assert isinstance(schema_type, ContentTypeEnum) - self._iset_type(index, schema_type) - - def set_argc_minmax(self, minimum, maximum): - self._set_argc_minmax(minimum, maximum) - - - def initSelection(self , index , alternatives): - for alt in alternatives: - self.addAlternative( index , alt ) - - - def addAlternative(self , index , alt): - self._add_alternative( index , alt ) - - def setDeprecated(self , msg): - """This method can be used to mark this item as deprecated. - - If the deprecated item is used in a configuration file the - @msg will be added to the warnings of the ConfigContent - object, - """ - self._set_deprecated( msg ) - - - def free(self): - self._free() diff --git a/ThirdParty/Ert/python/python/ert/config/unrecognized_enum.py b/ThirdParty/Ert/python/python/ert/config/unrecognized_enum.py deleted file mode 100644 index 2a707e60a6..0000000000 --- a/ThirdParty/Ert/python/python/ert/config/unrecognized_enum.py +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'unrecognized_enum.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from cwrap import BaseCEnum - -class UnrecognizedEnum(BaseCEnum): - TYPE_NAME = "config_unrecognized_enum" - CONFIG_UNRECOGNIZED_IGNORE = None - CONFIG_UNRECOGNIZED_WARN = None - CONFIG_UNRECOGNIZED_ERROR = None - -UnrecognizedEnum.addEnum("CONFIG_UNRECOGNIZED_IGNORE", 0) -UnrecognizedEnum.addEnum("CONFIG_UNRECOGNIZED_WARN", 1) -UnrecognizedEnum.addEnum("CONFIG_UNRECOGNIZED_ERROR", 2) diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl.py b/ThirdParty/Ert/python/python/ert/ecl/ecl.py deleted file mode 100644 index 2f78a24430..0000000000 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl.py +++ /dev/null @@ -1,98 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'ecl.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -""" -Convenience module importing all symbols in the ecl package. - -This module is purely for convenience; it explicitly imports all the -symbols from all the other modules into the common 'ecl' -namespace. The whole point of this excercise is to facilitate the -following construction: - - import ert.ecl.ecl as ecl <-- Import this module; and create the - namespace 'ecl' - ... - ... - sum = ecl.EclSum( "ECLIPSE.DATA") <-- Classes EclSum and EclGrid are now - grid = ecl.EclGrid("ECLIPSE.EGRID") accessible under the ecl namespace. - -It is not necessary to use the this module. See the doc/import.txt -document in the ert-python source distribution for more details of -module import and namespace resolution. -# """ -# import libecl -# from ecl_kw import EclKW -# from ecl_case import EclCase -# from ecl_file import EclFile -# from ecl_sum import EclSum -# from ecl_rft import EclRFTFile , EclRFT -# from ecl_rft_cell import EclRFTCell, EclPLTCell -# from ecl_grid import EclGrid -# from ecl_grav import EclGrav -# from ecl_subsidence import EclSubsidence -# from ecl_region import EclRegion -# from fortio import FortIO -# import ecl_util -# from ecl_util import * - -import os - -warning_message = """ - -The ecl namespace is deprecated and will go away. You are advised to -use one of these alternatives when importing the ert.ecl modules and -classes: - ---------------------------------------------------------------------- -Common prefix: -import ert.ecl as ecl - -Direct import of classes: -from ert.ecl import EclGrid,EclSum ---------------------------------------------------------------------- - -The environment variable ERT_SILENCE_WARNINGS is a colon separated -list which can be used to silence warnings. To silence this particular -warning set: - -ERT_SILENCE_WARNINGS = \"eclimport\" - -""" - - -from warnings import warn - -ert_silence_warnings = os.environ.get("ERT_SILENCE_WARNINGS") -if ert_silence_warnings: - silent_warnings = set( ert_silence_warnings.split(":")) -else: - silent_warnings = set() - -if not "eclimport" in silent_warnings: - warn(warning_message , DeprecationWarning) - - -from .ecl_sum import EclSum #, EclSumVector, EclSumNode, EclSMSPECNode -from .ecl_rft_cell import EclPLTCell, EclRFTCell -from .ecl_rft import EclRFT, EclRFTFile -from .ecl_kw import EclKW -from .ecl_file import EclFile -from .fortio import FortIO -from .ecl_grid import EclGrid -from .ecl_region import EclRegion -from .ecl_case import EclCase -from .ecl_subsidence import EclSubsidence -from .ecl_grav_calc import deltag, phase_deltag -from .ecl_grav import EclGrav diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_case.py b/ThirdParty/Ert/python/python/ert/ecl/ecl_case.py deleted file mode 100644 index 77d046e57b..0000000000 --- a/ThirdParty/Ert/python/python/ert/ecl/ecl_case.py +++ /dev/null @@ -1,190 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'ecl_case.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -""" -Implements EclCase class which is a container for one ECLIPSE case. - -This module is a pure Python module which does not directly invoke any -C based functions. -""" -import os -import warnings -from ert.ecl import EclRFTFile, EclGrid, EclSum, EclUtil - - - -class EclCase: - """ - Small container for one ECLIPSE case. - - Mostly a wrapper around an ECLIPSE datafile, along with properties - to load the corresponding summary, grid and rft files. In addition - there are methods run() and submit() to run the ECLIPSE - simulation. - """ - def __init__(self , input_case): - """ - Create a new case based on path/basename. - - The @input_case argument should be the basename of the ECLIPSE - case, it can contain an additional path component. The - @input_case argument can contain an extension, but that is not - necessary; it does not need to point an existing file. - - These are all valid: - - case1 = EclCase( "ECLIPSE" ) - case2 = EclCase( "relative/path/ECLIPSE.SMSPEC" ) - case3 = EclCase( "/absolute/path/simulation/ECLIPSE_3.xxx" ) - - """ - warnings.warn("The EclCase class is deprecated - instantiate the EclSum / EclGrid / ... classes directly." , DeprecationWarning) - - self.case = input_case - (path , tmp) = os.path.split( input_case ) - if path: - self.__path = os.path.abspath( path ) - else: - self.__path = os.getcwd() - (self.__base , self.ext) = os.path.splitext( tmp ) - - self.__sum = None - self.__grid = None - self.__data_file = None - self.__rft = None - - - @property - def datafile( self ): - """ - Will return the full path to the ECLIPSE data file. - - Observe that this method is purely about string manipulation; - i.e. it is not checked if the datafile actually exists. - """ - - if not self.__data_file: - self.__data_file = "%s/%s.DATA" % ( self.__path , self.__base ) - return self.__data_file - - - @property - def sum( self ): - """ - An EclSum instance for the current case; or None. - - Observe that accessing the summary of a running ECLIPSE - simulation, i.e. to check progress, is extremely error - prone. During the actual simulation the summary files on disk - are invalid a large part of the time, and an attempt to load - at these times will lead to an instant 'crash and burn'. - """ - if not self.__sum: - self.__sum = EclSum( self.case ) - return self.__sum - - - @property - def grid( self ): - """ - An EclGrid instance for the current case; or None. - """ - if not self.__grid: - self.__grid = EclGrid( self.case ) - return self.__grid - - - @property - def rft_file( self ): - """ - An EclRFTFile instance for the current case; or None. - """ - if not self.__rft: - self.__rft = EclRFTFile( self.case ) - return self.__rft - - - @property - def base( self ): - """ - Will return the ECLIPSE basename of the current case. - """ - return self.__base - - - @property - def path( self ): - """ - Will return the absolute path of the current case. - """ - return self.__path - - - def run( self, - ecl_cmd = None, - ecl_version = None, - driver = None, - driver_type = None, - driver_options = None, - blocking = False ): - """ - Will start an ECLIPSE simulation of the current case. - - The method has a long and nasty argument list, but all - arguments have sensible defaults, and you probably do not need - to enter any at all. The arguments are as follows: - - ecl_cmd: The command used to run ECLIPSE. This will - typically be a script of some kind. The command will be - called with three commandline arguments: version datafile - num_cpu - - ecl_version: The eclipse version you want to use, this - should be a string of the type "2010.2". - - driver: This should be an instance of Driver() from - ert.job_queue.driver. If driver is None the method will - create a new driver instance. - - driver_type: If the driver is none the method will create a - new driver instance, it will create a driver of this type - (i.e. LOCAL, LSF or RSH). - - driver_options: When creating a new driver, these options - will be used. - - blocking: If blocking is True the method will not return - before the simulation is complete, otherwise the method - will return immediately. If blocking is False the ECLIPSE - simulation will continue even if the python script - exits. - - Observe that there are some dependencies between the arguments: - - * If both driver and driver_type are present the existing - driver instance will be used, and the driver_type argument - will be ignored. - - * The driver_options argument will only be used when - creating a new driver instance, and will not be used to - modify an existing driver instance. - """ - import ert.job_queue.driver as queue_driver - - num_cpu = EclUtil.get_num_cpu( self.datafile ) - argv = [ecl_version , self.datafile , num_cpu] - - job = driver.submit( self.base , ecl_cmd , self.path , argv , blocking = blocking) - return job diff --git a/ThirdParty/Ert/python/python/ert/ecl/ecl_queue.py b/ThirdParty/Ert/python/python/ert/ecl/ecl_queue.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/python/python/ert/ecl/rft/CMakeLists.txt b/ThirdParty/Ert/python/python/ert/ecl/rft/CMakeLists.txt deleted file mode 100644 index 9a13752492..0000000000 --- a/ThirdParty/Ert/python/python/ert/ecl/rft/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - well_trajectory.py -) - -add_python_package("python.ert.ecl.rft" ${PYTHON_INSTALL_PREFIX}/ert/ecl/rft "${PYTHON_SOURCES}" True) diff --git a/ThirdParty/Ert/python/python/ert/enkf/CMakeLists.txt b/ThirdParty/Ert/python/python/ert/enkf/CMakeLists.txt deleted file mode 100644 index 06b481ddac..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/CMakeLists.txt +++ /dev/null @@ -1,56 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - active_list.py - analysis_config.py - analysis_iter_config.py - custom_kw_config_set.py - ecl_config.py - enkf_fs.py - enkf_fs_manager.py - enkf_linalg.py - enkf_main.py - enkf_obs.py - enkf_simulation_runner.py - enkf_state.py - ensemble_config.py - ert_log.py - ert_run_context.py - ert_template.py - ert_templates.py - ert_workflow_list.py - key_manager.py - local_config.py - local_dataset.py - local_ministep.py - local_obsdata.py - local_obsdata_node.py - local_updatestep.py - meas_block.py - meas_data.py - model_config.py - node_id.py - obs_block.py - obs_data.py - plot_settings.py - hook_manager.py - hook_workflow.py - run_arg.py - runpath_list.py - site_config.py - state_map.py - summary_key_matcher.py - summary_key_set.py - forward_load_context.py - es_update.py -) - -add_python_package("python.ert.enkf" ${PYTHON_INSTALL_PREFIX}/ert/enkf "${PYTHON_SOURCES}" True) - -add_subdirectory(config) -add_subdirectory(data) -add_subdirectory(enums) -add_subdirectory(export) -add_subdirectory(observations) -add_subdirectory(plot) -add_subdirectory(plot_data) -add_subdirectory(util) diff --git a/ThirdParty/Ert/python/python/ert/enkf/__init__.py b/ThirdParty/Ert/python/python/ert/enkf/__init__.py deleted file mode 100644 index 91457ab6b8..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/__init__.py +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file '__init__.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - - -import ert -from cwrap import Prototype -import ert.util -import ert.geo -import ert.ecl -import ert.rms -import ert.analysis -import ert.sched -import ert.config -import ert.job_queue - -class EnkfPrototype(Prototype): - lib = ert.load("libenkf") - - def __init__(self, prototype, bind=True): - super(EnkfPrototype, self).__init__(EnkfPrototype.lib, prototype, bind=bind) - - - -ENKF_LIB = ert.load("libenkf") - -from .enums import * - -from .node_id import NodeId - -from .enkf_linalg import EnkfLinalg -from .util import TimeMap -from .state_map import StateMap -from .summary_key_set import SummaryKeySet -from .summary_key_matcher import SummaryKeyMatcher -from .custom_kw_config_set import CustomKWConfigSet -from .enkf_fs import EnkfFs - -from .ert_workflow_list import ErtWorkflowList -from .active_list import ActiveList -from .config import * -from .data import * - -from .local_dataset import LocalDataset -from .local_obsdata_node import LocalObsdataNode -from .local_obsdata import LocalObsdata -from .local_ministep import LocalMinistep -from .local_updatestep import LocalUpdateStep - -from .observations import * - -from .obs_block import ObsBlock -from .obs_data import ObsData -from .meas_block import MeasBlock -from .meas_data import MeasData - -from .analysis_iter_config import AnalysisIterConfig -from .analysis_config import AnalysisConfig -from .ecl_config import EclConfig - -from .ensemble_config import EnsembleConfig -from .enkf_obs import EnkfObs -from .enkf_state import EnKFState -from .ert_template import ErtTemplate -from .ert_templates import ErtTemplates -from .local_config import LocalConfig -from .model_config import ModelConfig -from .plot_settings import PlotSettings -from .site_config import SiteConfig -from .runpath_list import RunpathList, RunpathNode -from .hook_workflow import HookWorkflow -from .hook_manager import HookManager - -from .es_update import ESUpdate -from .enkf_simulation_runner import EnkfSimulationRunner -from .enkf_fs_manager import EnkfFsManager -from .run_arg import RunArg -from .ert_run_context import ErtRunContext -from .enkf_main import EnKFMain -from .ert_log import ErtLog -from .forward_load_context import ForwardLoadContext - -from ert.job_queue import ErtScript as ErtScript -from ert.job_queue import ErtPlugin as ErtPlugin, CancelPluginException as CancelPluginException diff --git a/ThirdParty/Ert/python/python/ert/enkf/active_list.py b/ThirdParty/Ert/python/python/ert/enkf/active_list.py deleted file mode 100644 index 520db63ed6..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/active_list.py +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright (C) 2015 Statoil ASA, Norway. -# -# The file 'active_list.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.enkf import ActiveMode - -class ActiveList(BaseCClass): - TYPE_NAME = "active_list" - - _alloc = EnkfPrototype("void* active_list_alloc()", bind = False) - _free = EnkfPrototype("void active_list_free(active_list)") - _add_index = EnkfPrototype("void active_list_add_index(active_list , int)") - _asize = EnkfPrototype("int active_list_get_active_size(active_list, int)") - _get_mode = EnkfPrototype("active_mode_enum active_list_get_mode(active_list)") - - def __init__(self): - c_ptr = self._alloc() - super(ActiveList, self).__init__(c_ptr) - - def getMode(self): - return self._get_mode() - - def addActiveIndex(self, index): - self._add_index(index) - - def getActiveSize(self, default_value): - """In mode PARTLY_ACTIVE, we return the size of the active set; In mode - INACTIVE 0 is returned and if the mode is ALL_ACTIVE, the input - default_value is returned. - """ - mode = self.getMode() - if mode == ActiveMode.PARTLY_ACTIVE: - return self._asize(0) - if mode == ActiveMode.INACTIVE: - return 0 - return default_value - - def free(self): - self._free() - - def __repr__(self): - size = '' - if self.getMode() == ActiveMode.PARTLY_ACTIVE: - size = ', active_size = %d' % self._asize(0) - cnt = 'mode = %s%s' % (self.getMode(), size) - return self._create_repr(cnt) diff --git a/ThirdParty/Ert/python/python/ert/enkf/analysis_config.py b/ThirdParty/Ert/python/python/ert/enkf/analysis_config.py deleted file mode 100644 index 3f6a004a3a..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/analysis_config.py +++ /dev/null @@ -1,151 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'analysis_config.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.enkf import AnalysisIterConfig -from ert.analysis import AnalysisModule -from ert.util import StringList - - -class AnalysisConfig(BaseCClass): - TYPE_NAME = "analysis_config" - _alloc = EnkfPrototype("void* analysis_config_alloc()", bind = False) - _free = EnkfPrototype("void analysis_config_free( analysis_config )") - _get_rerun = EnkfPrototype("int analysis_config_get_rerun( analysis_config )") - _set_rerun = EnkfPrototype("void analysis_config_set_rerun( analysis_config, bool)") - _get_rerun_start = EnkfPrototype("int analysis_config_get_rerun_start( analysis_config )") - _set_rerun_start = EnkfPrototype("void analysis_config_set_rerun_start( analysis_config, int)") - _get_log_path = EnkfPrototype("char* analysis_config_get_log_path( analysis_config)") - _set_log_path = EnkfPrototype("void analysis_config_set_log_path( analysis_config, char*)") - _get_merge_observations = EnkfPrototype("bool analysis_config_get_merge_observations(analysis_config)") - _set_merge_observations = EnkfPrototype("void analysis_config_set_merge_observations(analysis_config, bool)") - _get_iter_config = EnkfPrototype("analysis_iter_config_ref analysis_config_get_iter_config(analysis_config)") - _have_enough_realisations = EnkfPrototype("bool analysis_config_have_enough_realisations(analysis_config, int, int)") - _get_max_runtime = EnkfPrototype("int analysis_config_get_max_runtime(analysis_config)") - _set_max_runtime = EnkfPrototype("void analysis_config_set_max_runtime(analysis_config, int)") - _get_stop_long_running = EnkfPrototype("bool analysis_config_get_stop_long_running(analysis_config)") - _set_stop_long_running = EnkfPrototype("void analysis_config_set_stop_long_running(analysis_config, bool)") - _get_active_module_name = EnkfPrototype("char* analysis_config_get_active_module_name(analysis_config)") - _get_module_list = EnkfPrototype("stringlist_obj analysis_config_alloc_module_names(analysis_config)") - _get_module = EnkfPrototype("analysis_module_ref analysis_config_get_module(analysis_config, char*)") - _select_module = EnkfPrototype("bool analysis_config_select_module(analysis_config, char*)") - _has_module = EnkfPrototype("bool analysis_config_has_module(analysis_config, char*)") - _get_alpha = EnkfPrototype("double analysis_config_get_alpha(analysis_config)") - _set_alpha = EnkfPrototype("void analysis_config_set_alpha(analysis_config, double)") - _get_std_cutoff = EnkfPrototype("double analysis_config_get_std_cutoff(analysis_config)") - _set_std_cutoff = EnkfPrototype("void analysis_config_set_std_cutoff(analysis_config, double)") - _set_global_std_scaling = EnkfPrototype("void analysis_config_set_global_std_scaling(analysis_config, double)") - _get_global_std_scaling = EnkfPrototype("double analysis_config_get_global_std_scaling(analysis_config)") - - def __init__(self): - c_ptr = AnalysisConfig._alloc() - super(AnalysisConfig , self).__init__(c_ptr) - - - def get_rerun(self): - return self._get_rerun() - - def set_rerun(self, rerun): - self._set_rerun(rerun) - - def get_rerun_start(self): - return self._get_rerun_start() - - def set_rerun_start(self, index): - self._set_rerun_start(index) - - def get_log_path(self): - return self._get_log_path() - - def set_log_path(self, path): - self._set_log_path(path) - - def getEnkfAlpha(self): - """ :rtype: float """ - return self._get_alpha() - - def setEnkfAlpha(self, alpha): - self._set_alpha(alpha) - - def getStdCutoff(self): - """ :rtype: float """ - return self._get_std_cutoff() - - def setStdCutoff(self, std_cutoff): - self._set_std_cutoff(std_cutoff) - - def get_merge_observations(self): - return self._get_merge_observations() - - def set_merge_observations(self, merge_observations): - return self._set_merge_observations(merge_observations) - - def getAnalysisIterConfig(self): - """ @rtype: AnalysisIterConfig """ - return self._get_iter_config().setParent(self) - - def get_stop_long_running(self): - """ @rtype: bool """ - return self._get_stop_long_running() - - def set_stop_long_running(self, stop_long_running): - self._set_stop_long_running(stop_long_running) - - def get_max_runtime(self): - """ @rtype: int """ - return self._get_max_runtime() - - def set_max_runtime(self, max_runtime): - self._set_max_runtime(max_runtime) - - def free(self): - self._free() - - def activeModuleName(self): - """ :rtype: str """ - return self._get_active_module_name() - - def getModuleList(self): - """ :rtype: StringList """ - return self._get_module_list() - - def getModule(self, module_name): - """ @rtype: AnalysisModule """ - return self._get_module(module_name) - - def hasModule(self, module_name): - """ @rtype: bool """ - return self._has_module(module_name) - - - def selectModule(self, module_name): - """ @rtype: bool """ - return self._select_module(module_name) - - def getActiveModule(self): - """ :rtype: AnalysisModule """ - return self.getModule(self.activeModuleName()) - - def setGlobalStdScaling(self, std_scaling): - self._set_global_std_scaling(std_scaling) - - def getGlobalStdScaling(self): - return self._get_global_std_scaling() - - def haveEnoughRealisations(self, realizations, ensemble_size): - return self._have_enough_realisations(realizations, ensemble_size) - - diff --git a/ThirdParty/Ert/python/python/ert/enkf/analysis_iter_config.py b/ThirdParty/Ert/python/python/ert/enkf/analysis_iter_config.py deleted file mode 100644 index 91c9ff1250..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/analysis_iter_config.py +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'analysis_iter_config.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype - -class AnalysisIterConfig(BaseCClass): - TYPE_NAME = "analysis_iter_config" - - _alloc = EnkfPrototype("void* analysis_iter_config_alloc( )", bind = False) - _free = EnkfPrototype("void analysis_iter_config_free( analysis_iter_config )") - _set_num_iterations = EnkfPrototype("void analysis_iter_config_set_num_iterations(analysis_iter_config, int)") - _get_num_iterations = EnkfPrototype("int analysis_iter_config_get_num_iterations(analysis_iter_config)") - _get_num_retries = EnkfPrototype("int analysis_iter_config_get_num_retries_per_iteration(analysis_iter_config)") - _num_iterations_set = EnkfPrototype("bool analysis_iter_config_num_iterations_set(analysis_iter_config)") - _set_case_fmt = EnkfPrototype("void analysis_iter_config_set_case_fmt( analysis_iter_config , char* )") - _get_case_fmt = EnkfPrototype("char* analysis_iter_config_get_case_fmt( analysis_iter_config)") - _case_fmt_set = EnkfPrototype("bool analysis_iter_config_case_fmt_set(analysis_iter_config)") - - def __init__(self): - c_ptr = self._alloc() - super(AnalysisIterConfig , self).__init__(c_ptr) - - def getNumIterations(self): - """ @rtype: int """ - return self._get_num_iterations() - - def __len__(self): - """Returns number of iterations.""" - return self.getNumIterations() - - def setNumIterations(self, num_iterations): - self._set_num_iterations(num_iterations) - - def numIterationsSet(self): - return self._num_iterations_set() - - def getNumRetries(self): - """ @rtype: int """ - return self._get_num_retries() - - def getCaseFormat(self): - """ @rtype: str """ - return self._get_case_fmt() - - def setCaseFormat(self, case_fmt): - self._set_case_fmt(case_fmt) - - def caseFormatSet(self): - return self._case_fmt_set() - - def free(self): - self._free() - - def _short_case_fmt(self, maxlen=10): - fmt = getCaseFormat() - if len(fmt) <= maxlen: - return fmt - return fmt[:maxlen-2] + ".." - - def __repr__(self): - cfs = 'format = False' - if self.caseFormatSet(): - cfs = 'format = True' - fmt = self._short_case_fmt() - ret = 'AnalysisIterConfig(iterations = %d, retries = %d, fmt = %s, %s) at 0x%x' - its = len(self) - rets = self.getNumRetries() - return ret % (its, rets, fmt, cfs, self._address) diff --git a/ThirdParty/Ert/python/python/ert/enkf/config/CMakeLists.txt b/ThirdParty/Ert/python/python/ert/enkf/config/CMakeLists.txt deleted file mode 100644 index c87926f16f..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/config/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - custom_kw_config.py - enkf_config_node.py - field_type_enum.py - field_config.py - gen_data_config.py - gen_kw_config.py - summary_config.py -) - -add_python_package("python.ert.enkf.config" ${PYTHON_INSTALL_PREFIX}/ert/enkf/config "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert/enkf/config/__init__.py b/ThirdParty/Ert/python/python/ert/enkf/config/__init__.py deleted file mode 100644 index 55f02ef61e..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/config/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -from .custom_kw_config import CustomKWConfig -from .field_config import FieldConfig -from .field_type_enum import FieldTypeEnum -from .gen_data_config import GenDataConfig -from .gen_kw_config import GenKwConfig -from .summary_config import SummaryConfig -from .enkf_config_node import EnkfConfigNode - - -__all__ = ["FieldConfig", - "FieldTypeEnum", - "CustomKWConfig", - "GenKwConfig", - "GenDataConfig", - "EnkfConfigNode", - "SummaryConfig"] diff --git a/ThirdParty/Ert/python/python/ert/enkf/config/custom_kw_config.py b/ThirdParty/Ert/python/python/ert/enkf/config/custom_kw_config.py deleted file mode 100644 index df01cf71c1..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/config/custom_kw_config.py +++ /dev/null @@ -1,120 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'field_config.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -import sys - -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.util import StringList, IntegerHash - - -class CustomKWConfig(BaseCClass): - TYPE_NAME = "custom_kw_config" - - _alloc_empty = EnkfPrototype("void* custom_kw_config_alloc_empty(char*, char*, char*)", bind = False) - _alloc_with_definition = EnkfPrototype("void* custom_kw_config_alloc_with_definition(char*, integer_hash)", bind = False) - _get_name = EnkfPrototype("char* custom_kw_config_get_name(custom_kw_config)") - _get_result_file = EnkfPrototype("char* custom_kw_config_get_result_file(custom_kw_config)") - _get_output_file = EnkfPrototype("char* custom_kw_config_get_output_file(custom_kw_config)") - _parse_result_file = EnkfPrototype("bool custom_kw_config_parse_result_file(custom_kw_config, char*, stringlist)") - _has_key = EnkfPrototype("bool custom_kw_config_has_key(custom_kw_config, char*)") - _key_is_double = EnkfPrototype("bool custom_kw_config_key_is_double(custom_kw_config, char*)") - _index_of_key = EnkfPrototype("int custom_kw_config_index_of_key(custom_kw_config, char*)") - _size = EnkfPrototype("int custom_kw_config_size(custom_kw_config)") - _keys = EnkfPrototype("stringlist_obj custom_kw_config_get_keys(custom_kw_config)") - _free = EnkfPrototype("void custom_kw_config_free(custom_kw_config)") - - def __init__(self, key, result_file, output_file=None, definition=None): - """ - @type key: str - @type result_file: str - @type output_file: str - @type definition: dict - """ - - if definition is not None: - if result_file is not None and output_file is not None: - sys.stderr.write("[%s] Will ignore result file and output file when constructing with a definition." % self.__class__.__name__) - - type_hash = CustomKWConfig.convertDefinition(definition) - c_ptr = self._alloc_with_definition(key, type_hash) - else: - c_ptr = self._alloc_empty(key, result_file, output_file) - super(CustomKWConfig, self).__init__(c_ptr) - - def getName(self): - """ @rtype: str """ - return self.name() - - def name(self): - return self._get_name() - - def getResultFile(self): - """ @rtype: str """ - return self._get_result_file() - - def getOutputFile(self): - """ @rtype: str """ - return self._get_output_file() - - def parseResultFile(self, result_file, result): - """ @rtype: bool """ - return self._parse_result_file(result_file, result) - - def keyIsDouble(self, key): - """ @rtype: bool """ - return self._key_is_double(key) - - def indexOfKey(self, key): - """ @rtype: int """ - return self._index_of_key(key) - - def __contains__(self, item): - """ @rtype: bool """ - return self._has_key(item) - - def __len__(self): - """ @rtype: int """ - return self._size() - - def __iter__(self): - keys = self.getKeys() - index = 0 - while index < len(keys): - yield keys[index] - index += 1 - - def free(self): - self._free() - - def __repr__(self): - return 'CustomKWConfig(name = %s, len = %d) %s' % (self.name(), len(self), self._ad_str()) - - def getKeys(self): - """ @rtype: StringList """ - return self._keys() - - @classmethod - def convertDefinition(cls, definition): - """ @rtype: IntegerHash """ - type_hash = IntegerHash() - - for key, value_type in definition.iteritems(): - if value_type == float: - value_type = 1 - else: - value_type = 0 #str - type_hash[key] = value_type - return type_hash diff --git a/ThirdParty/Ert/python/python/ert/enkf/config/enkf_config_node.py b/ThirdParty/Ert/python/python/ert/enkf/config/enkf_config_node.py deleted file mode 100644 index c7101a1dff..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/config/enkf_config_node.py +++ /dev/null @@ -1,143 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'enkf_config_node.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.enkf.config import FieldConfig, GenDataConfig, GenKwConfig, SummaryConfig, CustomKWConfig -from ert.enkf.enums import EnkfTruncationType, ErtImplType, LoadFailTypeEnum, EnkfVarType -from ert.ecl import EclGrid -from ert.util import PathFormat - -class EnkfConfigNode(BaseCClass): - TYPE_NAME = "enkf_config_node" - - _alloc_summary_node = EnkfPrototype("enkf_config_node_obj enkf_config_node_alloc_summary(char*, load_fail_type)", bind = False) - _alloc_field_node = EnkfPrototype("enkf_config_node_obj enkf_config_node_alloc_field(char*, ecl_grid, void*, bool)", bind = False) - _get_ref = EnkfPrototype("void* enkf_config_node_get_ref(enkf_config_node)") #todo: fix return type - _get_impl_type = EnkfPrototype("ert_impl_type_enum enkf_config_node_get_impl_type(enkf_config_node)") - _get_enkf_outfile = EnkfPrototype("char* enkf_config_node_get_enkf_outfile(enkf_config_node)") - _get_min_std_file = EnkfPrototype("char* enkf_config_node_get_min_std_file(enkf_config_node)") - _get_enkf_infile = EnkfPrototype("char* enkf_config_node_get_enkf_infile(enkf_config_node)") - _get_init_file = EnkfPrototype("char* enkf_config_node_get_FIELD_fill_file(enkf_config_node, path_fmt)") - _get_init_file_fmt = EnkfPrototype("char* enkf_config_node_get_init_file_fmt(enkf_config_node)") - _get_var_type = EnkfPrototype("enkf_var_type_enum enkf_config_node_get_var_type(enkf_config_node)") #todo: fix return type as enum - _get_key = EnkfPrototype("char* enkf_config_node_get_key(enkf_config_node)") - _get_obs_keys = EnkfPrototype("stringlist_ref enkf_config_node_get_obs_keys(enkf_config_node)") - _update_state_field = EnkfPrototype("void enkf_config_node_update_state_field(enkf_config_node, enkf_truncation_type_enum, double, double)") - _free = EnkfPrototype("void enkf_config_node_free(enkf_config_node)") - - def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") - - def getImplementationType( self ): - """ @rtype: ErtImplType """ - return self._get_impl_type() - - def getVariableType( self ): - return self._get_var_type() - - def getPointerReference(self): - return self._get_ref() - - def getInitFile(self, model_config): - return self._enkf_config_node_get_init_file(model_config.getRunpathFormat()) - - # def get_min_std_file(self): - # return self._get_min_std_file() - - # def get_enkf_outfile(self): - # return self._get_enkf_outfile() - - def getFieldModelConfig(self): - """ @rtype: FieldConfig """ - return FieldConfig.createCReference(self._get_ref(), parent=self) - - def getDataModelConfig(self): - """ @rtype: GenDataConfig """ - return GenDataConfig.createCReference(self._get_ref(), parent=self) - - def getKeywordModelConfig(self): - """ @rtype: GenKWConfig """ - return GenKwConfig.createCReference(self._get_ref(), parent=self) - - def getCustomKeywordModelConfig(self): - """ @rtype: CustomKWConfig """ - return CustomKWConfig.createCReference(self._get_ref(), parent=self) - - # def get_enkf_infile(self): - # return self._get_enkf_infile() - - # def alloc_node(self): - # return EnkfNode(self) - - # def get_init_file_fmt(self): - # return self._get_init_file_fmt() - - def getObservationKeys(self): - """ @rtype: StringList """ - return self._get_obs_keys().setParent(self) - - def updateStateField(self, truncation, value_min, value_max): - assert isinstance(truncation, EnkfTruncationType) - self._update_state_field(truncation, value_min, value_max) - - @classmethod - def createSummaryConfigNode(cls, key, load_fail_type): - """ - @type key: str - @type load_fail_type: LoadFailTypeEnum - @rtype: EnkfConfigNode - """ - - assert isinstance(load_fail_type, LoadFailTypeEnum) - return cls._alloc_summary_node(key, load_fail_type) - - @classmethod - def createFieldConfigNode(cls, key, grid, trans_table = None, forward_init = False): - """ - @type grid: EclGrid - @rtype: EnkfConfigNode - """ - return cls._alloc_field_node(key, grid, trans_table, forward_init) - - def free(self): - self._free() - - def __repr__(self): - key = self.getKey() - vt = self.getVariableType() - imp = self.getImplementationType() - content = 'key = %s, var_type = %s, implementation = %s' % (key, vt, imp) - return self._create_repr(content) - - def getModelConfig(self): - implementation_type = self.getImplementationType() - - if implementation_type == ErtImplType.FIELD: - return self.getFieldModelConfig() - elif implementation_type == ErtImplType.GEN_DATA: - return self.getDataModelConfig() - elif implementation_type == ErtImplType.GEN_KW: - return self.getKeywordModelConfig() - elif implementation_type == ErtImplType.CUSTOM_KW: - return self.getCustomKeywordModelConfig() - elif implementation_type == ErtImplType.SUMMARY: - return SummaryConfig.createCReference(self.getPointerReference(), parent=self) - else: - print("[EnkfConfigNode::getModelConfig()] Unhandled implementation model type: %i" % implementation_type) - # raise NotImplementedError("Unknown model type: %i" % type) - - def getKey(self): - return self._get_key() diff --git a/ThirdParty/Ert/python/python/ert/enkf/config/field_config.py b/ThirdParty/Ert/python/python/ert/enkf/config/field_config.py deleted file mode 100644 index ce3594ca37..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/config/field_config.py +++ /dev/null @@ -1,98 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# This file is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass - -from ert.enkf import EnkfPrototype -from ert.enkf.enums import EnkfFieldFileFormatEnum -from ert.ecl import EclGrid -from .field_type_enum import FieldTypeEnum - -class FieldConfig(BaseCClass): - TYPE_NAME = "field_config" - - _alloc = EnkfPrototype("void* field_config_alloc_empty(char* , ecl_grid , void* , bool)", bind = False) - _free = EnkfPrototype("void field_config_free( field_config )") - _get_type = EnkfPrototype("field_type_enum field_config_get_type(field_config)") - _get_truncation_mode = EnkfPrototype("int field_config_get_truncation_mode(field_config)") - _get_truncation_min = EnkfPrototype("double field_config_get_truncation_min(field_config)") - _get_truncation_max = EnkfPrototype("double field_config_get_truncation_max(field_config)") - _get_init_transform_name = EnkfPrototype("char* field_config_get_init_transform_name(field_config)") - _get_output_transform_name = EnkfPrototype("char* field_config_get_output_transform_name(field_config)") - _ijk_active = EnkfPrototype("bool field_config_ijk_active(field_config, int, int, int)") - _get_nx = EnkfPrototype("int field_config_get_nx(field_config)") - _get_ny = EnkfPrototype("int field_config_get_ny(field_config)") - _get_nz = EnkfPrototype("int field_config_get_nz(field_config)") - _get_grid = EnkfPrototype("ecl_grid_ref field_config_get_grid(field_config)") - _export_format = EnkfPrototype("enkf_field_file_format_enum field_config_default_export_format(char*)", bind = False) - _guess_filetype = EnkfPrototype("enkf_field_file_format_enum field_config_guess_file_type(char*)", bind = False) - - def __init__(self , kw , grid): - c_ptr = self._alloc( kw , grid , None , False ) - super(FieldConfig, self).__init__(c_ptr) - - @classmethod - def exportFormat(cls , filename): - export_format = cls._export_format( filename ) - if export_format in [ EnkfFieldFileFormatEnum.ECL_GRDECL_FILE , EnkfFieldFileFormatEnum.RMS_ROFF_FILE ]: - return export_format - else: - raise ValueError("Could not determine grdecl / roff format from:%s" % filename) - - @classmethod - def guessFiletype(cls, filename): - return cls._guess_filetype(filename) - - def get_type(self): - return self._get_type() - - def get_truncation_mode(self): - return self._get_truncation_mode() - - def get_truncation_min(self): - return self._get_truncation_min() - - def get_init_transform_name(self): - return self._get_init_transform_name() - - def get_output_transform_name(self): - return self._get_output_transform_name() - - def get_truncation_max(self): - return self._get_truncation_max() - - def get_nx(self): - return self._get_nx() - - def get_ny(self): - return self._get_ny() - - def get_nz(self): - return self._get_nz() - - def get_grid(self): - return self._get_grid() - - def ijk_active(self, i, j, k): - return self._ijk_active(i, j, k) - - def free(self): - self._free() - - def __repr__(self): - tp = self.get_type() - nx,ny,nz = self.get_nx(),self.get_ny(),self.get_nz() - cnt = 'type = %s, nx = %d, ny = %d, nz = %d' % (tp, nx,ny,nz) - return self._create_repr(cnt) diff --git a/ThirdParty/Ert/python/python/ert/enkf/config/gen_data_config.py b/ThirdParty/Ert/python/python/ert/enkf/config/gen_data_config.py deleted file mode 100644 index 0c832b7123..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/config/gen_data_config.py +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'gen_data_config.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.enkf.enums import GenDataFileType - - -class GenDataConfig(BaseCClass): - TYPE_NAME = "gen_data_config" - - _alloc = EnkfPrototype("void* gen_data_config_alloc_GEN_DATA_result( char* , gen_data_file_format_type)", bind = False) - _free = EnkfPrototype("void gen_data_config_free( gen_data_config )") - _get_output_format = EnkfPrototype("gen_data_file_format_type gen_data_config_get_output_format(gen_data_config)") - _get_input_format = EnkfPrototype("gen_data_file_format_type gen_data_config_get_input_format(gen_data_config)") - _get_template_file = EnkfPrototype("char* gen_data_config_get_template_file(gen_data_config)") - _get_template_key = EnkfPrototype("char* gen_data_config_get_template_key(gen_data_config)") - _get_initial_size = EnkfPrototype("int gen_data_config_get_initial_size(gen_data_config)") - _has_report_step = EnkfPrototype("bool gen_data_config_has_report_step(gen_data_config, int)") - _get_data_size = EnkfPrototype("int gen_data_config_get_data_size__(gen_data_config , int)") - _get_key = EnkfPrototype("char* gen_data_config_get_key(gen_data_config)") - _get_active_mask = EnkfPrototype("bool_vector_ref gen_data_config_get_active_mask(gen_data_config)") - _get_num_report_step = EnkfPrototype("int gen_data_config_num_report_step(gen_data_config)") - _iget_report_step = EnkfPrototype("int gen_data_config_iget_report_step(gen_data_config, int)") - - - def __init__(self, key , input_format = GenDataFileType.ASCII): - # Can currently only create GEN_DATA instances which should be used - # as result variables. - c_pointer = self._alloc( key , input_format ) - super(GenDataConfig, self).__init__(c_pointer) - - - def get_template_file(self): - return self._get_template_file() - - def get_template_key(self): - return self._get_template_key() - - def getDataSize(self , report_step): - data_size = self._get_data_size(report_step) - if data_size < 0: - raise ValueError("No data has been loaded for %s at report step:%d " % (self.getName() , report_step)) - else: - return data_size - - def getActiveMask(self): - return self._get_active_mask() - - def getName(self): - return self.name() - def name(self): - return self._get_key() - - def get_initial_size(self): - return self._get_initial_size() - - def getOutputFormat(self): - return self._get_output_format() - - def getInputFormat(self): - return self._get_input_format() - - def free(self): - self._free() - - def __repr__(self): - nm = self.name() - tk = self.get_template_key() - iz = self.get_initial_size() - return 'GenDataConfig(name = %s, template_key = %s, initial_size = %d) %s' % (nm, tk, iz, self._ad_str()) - - def hasReportStep(self, report_step): - """ @rtype: bool """ - return self._has_report_step(report_step) - - def getNumReportStep(self): - """ @rtype: int """ - return self._get_num_report_step() - - def getReportStep(self, index): - """ @rtype: int """ - return self._iget_report_step(index) - - def getReportSteps(self): - """ @rtype: list of int """ - return [self.getReportStep(index) for index in range(self.getNumReportStep())] diff --git a/ThirdParty/Ert/python/python/ert/enkf/config/gen_kw_config.py b/ThirdParty/Ert/python/python/ert/enkf/config/gen_kw_config.py deleted file mode 100644 index 9dba4a3665..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/config/gen_kw_config.py +++ /dev/null @@ -1,95 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'gen_kw_config.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.util import StringList - - -class GenKwConfig(BaseCClass): - TYPE_NAME = "gen_kw_config" - - _free = EnkfPrototype("void gen_kw_config_free( gen_kw_config )") - _alloc_empty = EnkfPrototype("void* gen_kw_config_alloc_empty( char*, char* )", bind = False) - _get_template_file = EnkfPrototype("char* gen_kw_config_get_template_file(gen_kw_config)") - _set_template_file = EnkfPrototype("void gen_kw_config_set_template_file(gen_kw_config , char*)") - _get_parameter_file = EnkfPrototype("char* gen_kw_config_get_parameter_file(gen_kw_config)") - _set_parameter_file = EnkfPrototype("void gen_kw_config_set_parameter_file(gen_kw_config, char*)") - _alloc_name_list = EnkfPrototype("stringlist_obj gen_kw_config_alloc_name_list(gen_kw_config)") - _should_use_log_scale = EnkfPrototype("bool gen_kw_config_should_use_log_scale(gen_kw_config, int)") - _get_key = EnkfPrototype("char* gen_kw_config_get_key(gen_kw_config)") - _size = EnkfPrototype("int gen_kw_config_get_data_size(gen_kw_config)") - _iget_name = EnkfPrototype("char* gen_kw_config_iget_name(gen_kw_config, int)") - - - def __init__(self, key, template_file , parameter_file , tag_fmt = "<%s>"): - """ - @type key: str - @type tag_fmt: str - """ - c_ptr = self._alloc_empty(key, tag_fmt) - if c_ptr: - super(GenKwConfig, self).__init__(c_ptr) - else: - raise ValueError('Could not instantiate GenKwConfig with key="%s" and tag_fmt="%s"' % (key, tag_fmt)) - self._key = key - self._tag_fmt = tag_fmt - self.setTemplateFile(template_file) - self.setParameterFile(parameter_file) - self.__str__ = self.__repr__ - - - def setTemplateFile(self, template_file): - self._set_template_file(template_file) - - def getTemplateFile(self): - return self._get_template_file() - - def getParameterFile(self): - return self._get_parameter_file() - - def setParameterFile(self, parameter_file): - self._set_parameter_file(parameter_file) - - def getKeyWords(self): - """ @rtype: StringList """ - return self._alloc_name_list() - - def shouldUseLogScale(self, index): - """ @rtype: bool """ - return self._should_use_log_scale(index) - - def free(self): - self._free() - - def __repr__(self): - return 'GenKwConfig(key = "%s", tag_fmt = "%s") at 0x%x' % (self._key, self._tag_fmt, self._address()) - - def getKey(self): - """ @rtype: str """ - return self._get_key() - - def __len__(self): - return self._size() - - def __getitem__(self, index): - """ @rtype: str """ - return self._iget_name(index) - - def __iter__(self): - index = 0 - while index < len(self): - yield self[index] - index += 1 diff --git a/ThirdParty/Ert/python/python/ert/enkf/config/summary_config.py b/ThirdParty/Ert/python/python/ert/enkf/config/summary_config.py deleted file mode 100644 index f398b8ed3d..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/config/summary_config.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'field_config.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass - -class SummaryConfig(BaseCClass): - TYPE_NAME = "summary_config" - - def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") - - def __repr__(self): - return 'SummaryConfig() %s' % self._ad_str() - - def free(self): - pass diff --git a/ThirdParty/Ert/python/python/ert/enkf/custom_kw_config_set.py b/ThirdParty/Ert/python/python/ert/enkf/custom_kw_config_set.py deleted file mode 100644 index 08ee7f1a6e..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/custom_kw_config_set.py +++ /dev/null @@ -1,47 +0,0 @@ -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.enkf.config.custom_kw_config import CustomKWConfig - - -class CustomKWConfigSet(BaseCClass): - TYPE_NAME = "custom_kw_config_set" - - _alloc = EnkfPrototype("void* custom_kw_config_set_alloc()", bind = False) - _alloc_from_file = EnkfPrototype("void* custom_kw_config_set_alloc_from_file(char*)", bind = False) - _free = EnkfPrototype("void custom_kw_config_set_free(custom_kw_config_set)") - _reset = EnkfPrototype("void custom_kw_config_set_reset(custom_kw_config_set)") - _add_config = EnkfPrototype("void custom_kw_config_set_add_config(custom_kw_config_set, custom_kw_config)") - _update_config = EnkfPrototype("void custom_kw_config_set_update_config(custom_kw_config_set, custom_kw_config)") - _fwrite = EnkfPrototype("void custom_kw_config_set_fwrite(custom_kw_config_set, char*)") - _get_keys = EnkfPrototype("stringlist_obj custom_kw_config_set_get_keys_alloc(custom_kw_config_set)") - - def __init__(self, filename=None): - if filename is None: - c_ptr = self._alloc() - else: - c_ptr = self._alloc_from_file(filename) - super(CustomKWConfigSet, self).__init__(c_ptr) - - - def addConfig(self, config): - """ @type config: CustomKWConfig """ - assert isinstance(config, CustomKWConfig) - self._add_config(config) - - def getStoredConfigKeys(self): - """ @rtype: StringList """ - return self._get_keys() - - def updateConfig(self, config): - """ @type config: CustomKWConfig """ - self._update_config(config) - - def fwrite(self, filename): - """ @type filename: str """ - self._fwrite(filename) - - def reset(self): - self._reset() - - def free(self): - self._free() diff --git a/ThirdParty/Ert/python/python/ert/enkf/data/CMakeLists.txt b/ThirdParty/Ert/python/python/ert/enkf/data/CMakeLists.txt deleted file mode 100644 index 8e2d82822b..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/data/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - custom_kw.py - enkf_node.py - field.py - gen_data.py - gen_kw.py -) - -add_python_package("python.ert.enkf.data" ${PYTHON_INSTALL_PREFIX}/ert/enkf/data "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert/enkf/data/__init__.py b/ThirdParty/Ert/python/python/ert/enkf/data/__init__.py deleted file mode 100644 index 86fe547005..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/data/__init__.py +++ /dev/null @@ -1,11 +0,0 @@ -from .custom_kw import CustomKW -from .field import Field -from .gen_data import GenData -from .gen_kw import GenKw -from .enkf_node import EnkfNode - -__all__ = ["Field", - "CustomKW", - "GenKw", - "GenData", - "EnkfNode",] diff --git a/ThirdParty/Ert/python/python/ert/enkf/data/custom_kw.py b/ThirdParty/Ert/python/python/ert/enkf/data/custom_kw.py deleted file mode 100644 index dc7ad620a3..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/data/custom_kw.py +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'field_config.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.enkf.config import CustomKWConfig - - -class CustomKW(BaseCClass): - TYPE_NAME = "custom_kw" - - _alloc = EnkfPrototype("void* custom_kw_alloc(custom_kw_config)", bind = False) - _free = EnkfPrototype("void custom_kw_free(custom_kw)") - _fload = EnkfPrototype("bool custom_kw_fload(custom_kw, char*)") - _key_is_null = EnkfPrototype("bool custom_kw_key_is_null(custom_kw, char*)") - _iget_as_double = EnkfPrototype("double custom_kw_iget_as_double(custom_kw, int)") - _iget_as_string = EnkfPrototype("char* custom_kw_iget_as_string(custom_kw, int)") - _set_string = EnkfPrototype("void custom_kw_set_string(custom_kw, char*, char*)") - _set_double = EnkfPrototype("void custom_kw_set_double(custom_kw, char*, double)") - _get_config = EnkfPrototype("custom_kw_config_ref custom_kw_get_config(custom_kw)") - - def __init__(self, custom_kw_config): - assert isinstance(custom_kw_config, CustomKWConfig) - c_ptr = self._alloc(custom_kw_config) - if c_ptr: - super(CustomKW, self).__init__(c_ptr) - else: - raise ValueError('Unable to construct CustomKW with given config!') - - def fload(self, filename): - """ - @type filename: str - @rtype: bool - """ - return self._fload(filename) - - - def __getitem__(self, key): - """ @rtype: str or float """ - config = self.getConfig() - - if not key in config: - raise KeyError("The key: '%s' is not available!" % key) - - index = config.indexOfKey(key) - - if self._key_is_null(key): - return None - - if config.keyIsDouble(key): - return self._iget_as_double(index) - - return self._iget_as_string(index) - - def __setitem__(self, key, value): - """ - @type key: str - @type value: float|int|str - """ - - config = self.getConfig() - - if not key in config: - raise KeyError("The key: '%s' is not available!" % key) - - if isinstance(value, (float, int, long)): - self._set_double(key, value) - else: - self._set_string(key, str(value)) - - - def getConfig(self): - """ @rtype: CustomKWConfig """ - return self._get_config() - - def free(self): - self._free() - - def __repr__(self): - return 'CustomKw() %s' % self._ad_str() diff --git a/ThirdParty/Ert/python/python/ert/enkf/data/enkf_node.py b/ThirdParty/Ert/python/python/ert/enkf/data/enkf_node.py deleted file mode 100644 index 1d000572b3..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/data/enkf_node.py +++ /dev/null @@ -1,138 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'enkf_node.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -import sys -from ert.enkf.enums import ErtImplType -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype, EnkfFs, NodeId -from ert.enkf.data import GenKw, GenData, CustomKW, Field - -class EnkfNode(BaseCClass): - TYPE_NAME = "enkf_node" - _alloc = EnkfPrototype("void* enkf_node_alloc(enkf_config_node)", bind = False) - _alloc_private = EnkfPrototype("void* enkf_node_alloc_private_container(enkf_config_node)", bind = False) - _free = EnkfPrototype("void enkf_node_free(enkf_node)") - _get_name = EnkfPrototype("char* enkf_node_get_key(enkf_node)") - _value_ptr = EnkfPrototype("void* enkf_node_value_ptr(enkf_node)") - _try_load = EnkfPrototype("bool enkf_node_try_load(enkf_node, enkf_fs, node_id)") - _store = EnkfPrototype("bool enkf_node_store(enkf_node, enkf_fs, bool, node_id)") - _get_impl_type = EnkfPrototype("ert_impl_type_enum enkf_node_get_impl_type(enkf_node)") - - def __init__(self, config_node, private=False): - self._private = private - if private: - c_pointer = self._alloc_private(config_node) - else: - c_pointer = self._alloc(config_node) - - if c_pointer: - super(EnkfNode, self).__init__(c_pointer, config_node, True) - else: - p_err = 'private ' if private else '' - raise ValueError('Unable to create %sEnkfNode from given config node.' % p_err) - - @classmethod - def exportMany(cls , config_node , file_format , fs , iens_list , report_step = 0 , file_type = None , arg = None): - node = EnkfNode( config_node ) - for iens in iens_list: - filename = file_format % iens - node_id = NodeId( report_step , iens ) - if node.tryLoad(fs , node_id): - if node.export( filename , file_type = file_type , arg = arg): - print("%s[%03d] -> %s" % (config_node.getKey() , iens , filename)) - else: - sys.stderr.write("** ERROR: Could not load realisation:%d - export failed" % iens) - - - def export(self , filename , file_type = None , arg = None): - impl_type = self.getImplType() - if impl_type == ErtImplType.FIELD: - field_node = self.asField( ) - return field_node.export( filename , file_type = file_type , init_file = arg) - else: - raise NotImplementedError("The export method is only implemented for field") - - - - def valuePointer(self): - return self._value_ptr( ) - - - def getImplType(self): - """ @rtype: ert.enkf.enums.ert_impl_type_enum.ErtImplType """ - return self._get_impl_type( ) - - - def asGenData(self): - """ @rtype: GenData """ - impl_type = self.getImplType( ) - assert impl_type == ErtImplType.GEN_DATA - - return GenData.createCReference(self.valuePointer(), self) - - def asGenKw(self): - """ @rtype: GenKw """ - impl_type = self.getImplType( ) - assert impl_type == ErtImplType.GEN_KW - - return GenKw.createCReference(self.valuePointer(), self) - - def asCustomKW(self): - """ @rtype: CustomKW """ - impl_type = self.getImplType( ) - assert impl_type == ErtImplType.CUSTOM_KW - - return CustomKW.createCReference(self.valuePointer(), self) - - def asField(self): - """ @rtype: CustomKW """ - impl_type = self.getImplType( ) - assert impl_type == ErtImplType.FIELD - - return Field.createCReference(self.valuePointer(), self) - - def tryLoad(self, fs, node_id): - """ - @type fs: EnkfFS - @type node_id: NodeId - @rtype: bool - """ - if not isinstance(fs, EnkfFs): - raise TypeError('fs must be an EnkfFs, not %s' % type(fs)) - if not isinstance(node_id, NodeId): - raise TypeError('node_id must be a NodeId, not %s' % type(node_id)) - - return self._try_load(fs, node_id) - - def name(self): - """ @rtype: str """ - return self._get_name( ) - - def load(self, fs, node_id): - if not self.tryLoad(fs, node_id): - raise Exception("Could not load node: %s iens: %d report: %d" % (self.name(), node_id.iens, node_id.report_step)) - - def save(self, fs, node_id): - assert isinstance(fs, EnkfFs) - assert isinstance(node_id, NodeId) - - return self._store(fs, False, node_id) - - def free(self): - self._free( ) - - def __repr__(self): - pp = ', private' if self._private else '' - return 'EnkfNode(name = "%s"%s) %s' % (self.name(), pp, self._ad_str()) diff --git a/ThirdParty/Ert/python/python/ert/enkf/data/field.py b/ThirdParty/Ert/python/python/ert/enkf/data/field.py deleted file mode 100644 index 431ba2086c..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/data/field.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'field.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -import sys - -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.enkf.config import FieldConfig - - -class Field(BaseCClass): - TYPE_NAME = "field" - - _free = EnkfPrototype("void field_free( field )") - _ijk_get_double = EnkfPrototype("double field_ijk_get_double(field, int, int, int)") - _export = EnkfPrototype("void field_export(field, char* , fortio , enkf_field_file_format_enum , bool , char*)") - - def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") - - - def ijk_get_double(self, i, j, k): - return self._ijk_get_double(i, j, k) - - - def export(self , filename , file_type = None , init_file = None): - output_transform = False - if file_type is None: - try: - file_type = FieldConfig.exportFormat( filename ) - except ValueError: - sys.stderr.write("Sorry - could not infer output format from filename:%s\n" % filename) - return False - - self._export(filename , None , file_type , output_transform , init_file ) - return True - - - def free(self): - self._free() diff --git a/ThirdParty/Ert/python/python/ert/enkf/data/gen_data.py b/ThirdParty/Ert/python/python/ert/enkf/data/gen_data.py deleted file mode 100644 index 6275d4e4bd..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/data/gen_data.py +++ /dev/null @@ -1,62 +0,0 @@ -from cwrap import BaseCClass -from ert.util import DoubleVector -from ert.enkf import EnkfPrototype - - -class GenData(BaseCClass): - TYPE_NAME = "gen_data" - _alloc = EnkfPrototype("void* gen_data_alloc()", bind = False) - _free = EnkfPrototype("void gen_data_free(gen_data)") - _size = EnkfPrototype("int gen_data_get_size(gen_data)") - _iget = EnkfPrototype("double gen_data_iget_double(gen_data , int)"); - _export = EnkfPrototype("void gen_data_export(gen_data , char*, gen_data_file_format_type, fortio)") - _export_data = EnkfPrototype("void gen_data_export_data(gen_data , double_vector)") - - def __init__(self): - c_ptr = self._alloc() - if c_ptr: - super(GenData, self).__init__(c_ptr) - else: - raise ValueError('Unable to construct GenData object.') - - - def __len__(self): - """ @rtype: int """ - return self._size() - - - def free(self): - self._free( ) - - def __repr__(self): - return 'GenData(len = %d) %s' % (len(self), self._ad_str()) - - def export(self, file_name, file_format_type, fortio): - """ - @type: str - @type: GenDataFileType - @type: FortIO - """ - self._export(file_name, file_format_type, fortio) - - - def getData(self): - data = DoubleVector() - self._export_data( data ) - return data - - def __getitem__( self, idx ): - """Returns an item, or a list if idx is a slice. - Note: When idx is a slice it does not return a new GenData! - """ - ls = len(self) - if isinstance( idx, int ): - if idx < 0: - idx += ls - if 0 <= idx < ls: - return self._iget(idx) - raise IndexError('List index out of range.') - if isinstance( idx, slice ): - vec = self.getData() - return [vec[i] for i in range(*idx.indices(ls))] - raise TypeError('List indices must be integers, not %s.' % str(type(idx))) diff --git a/ThirdParty/Ert/python/python/ert/enkf/data/gen_kw.py b/ThirdParty/Ert/python/python/ert/enkf/data/gen_kw.py deleted file mode 100644 index 84bd4ef413..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/data/gen_kw.py +++ /dev/null @@ -1,152 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'gen_kw.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -import os.path - -from cwrap import BaseCClass, CFILE - -from ert.util import DoubleVector -from ert.enkf import EnkfPrototype -from ert.enkf.config import GenKwConfig - - -class GenKw(BaseCClass): - TYPE_NAME = "gen_kw" - _alloc = EnkfPrototype("void* gen_kw_alloc(gen_kw_config)", bind = False) - _free = EnkfPrototype("void gen_kw_free(gen_kw_config)") - _export_parameters = EnkfPrototype("void gen_kw_write_export_file(gen_kw , FILE)") - _export_template = EnkfPrototype("void gen_kw_ecl_write_template(gen_kw , char* )") - _data_iget = EnkfPrototype("double gen_kw_data_iget(gen_kw, int, bool)") - _data_iset = EnkfPrototype("void gen_kw_data_iset(gen_kw, int, double)") - _set_values = EnkfPrototype("void gen_kw_data_set_vector(gen_kw, double_vector)") - _data_get = EnkfPrototype("double gen_kw_data_get(gen_kw, char*, bool)") - _data_set = EnkfPrototype("void gen_kw_data_set(gen_kw, char*, double)") - _size = EnkfPrototype("int gen_kw_data_size(gen_kw)") - _has_key = EnkfPrototype("bool gen_kw_data_has_key(gen_kw, char*)") - _ecl_write = EnkfPrototype("void gen_kw_ecl_write(gen_kw, char* , char* , FILE)") - _iget_key = EnkfPrototype("char* gen_kw_get_name(gen_kw, int)") - - - def __init__(self, gen_kw_config): - """ - @type gen_kw_config: GenKwConfig - """ - c_ptr = self._alloc(gen_kw_config) - - if c_ptr: - super(GenKw, self).__init__(c_ptr) - self.__str__ = self.__repr__ - else: - raise ValueError('Cannot issue a GenKw from the given keyword config: %s.' % str(gen_kw_config)) - - - def exportParameters(self, file_name): - """ @type: str """ - with open(file_name , "w") as py_file: - cfile = CFILE( py_file ) - self._export_parameters(cfile) - - - def exportTemplate(self, file_name): - """ @type: str """ - self._export_template(file_name) - - - def __getitem__(self, key): - """ - @type key: int or str - @rtype: float - """ - do_transform = False - if isinstance(key, str): - if not key in self: - raise KeyError("Key %s does not exist" % (key)) - return self._data_get(key, do_transform) - elif isinstance(key, int): - if not 0 <= key < len(self): - raise IndexError("Index out of range 0 <= %d < %d" % (key, len(self))) - return self._data_iget(key, do_transform) - else: - raise TypeError("Illegal type for indexing, must be int or str, got: %s" % (key)) - - - def __setitem__(self, key, value): - """ - @type key: int or str - @type value: float - """ - if isinstance(key, str): - if not key in self: - raise KeyError("Key %s does not exist" % (key)) - self._data_set(key, value) - elif isinstance(key, int): - if not 0 <= key < len(self): - raise IndexError("Index out of range 0 <= %d < %d" % (key, len(self))) - self._data_iset(key, value) - else: - raise TypeError("Illegal type for indexing, must be int or str, got: %s" % (key)) - - - def items(self): - do_transform = False - v = [] - for index in range(len(self)): - v.append( ( self._iget_key( index ) , - self._data_iget(index, do_transform)) ) - return v - - - def eclWrite(self , path , filename , export_file = None): - if not path is None: - if not os.path.isdir(path): - raise IOError("The directory:%s does not exist" % path) - if export_file: - with open(export_file , "w") as fileH: - self._ecl_write(path , filename , CFILE( fileH )) - else: - self._ecl_write( path , filename , None ) - - - def setValues(self , values): - if len(values) == len(self): - if isinstance(values , DoubleVector): - self._set_values( d ) - else: - d = DoubleVector() - for (index,v) in enumerate(values): - if isinstance(v, (int,long,float)): - d[index] = v - else: - raise TypeError("Values must numeric: %s is invalid" % v) - self._set_values( d ) - else: - raise ValueError("Size mismatch between GenKW and values") - - def __len__(self): - """ @rtype: int """ - return self._size( ) - - - def __contains__(self, item): - return self._has_key(item) - - - def free(self): - self._free() - - def __repr__(self): - return 'GenKw(len = %d) at 0x%x' % (len(self), self._address()) - - diff --git a/ThirdParty/Ert/python/python/ert/enkf/ecl_config.py b/ThirdParty/Ert/python/python/ert/enkf/ecl_config.py deleted file mode 100644 index 6b480cab30..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/ecl_config.py +++ /dev/null @@ -1,181 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'ecl_config.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from warnings import warn - -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.util import StringList -from ert.ecl import EclSum -from ert.ecl import EclGrid -from ert.util import UIReturn -from ert.sched import SchedFile - -class EclConfig(BaseCClass): - TYPE_NAME = "ecl_config" - - _alloc = EnkfPrototype("void* ecl_config_alloc( )", bind = False) - _free = EnkfPrototype("void ecl_config_free( ecl_config )") - _get_eclbase = EnkfPrototype("char* ecl_config_get_eclbase( ecl_config )") - _validate_eclbase = EnkfPrototype("ui_return_obj ecl_config_validate_eclbase( ecl_config , char*)") - _set_eclbase = EnkfPrototype("void ecl_config_set_eclbase( ecl_config , char*)") - _get_data_file = EnkfPrototype("char* ecl_config_get_data_file(ecl_config)") - _set_data_file = EnkfPrototype("void ecl_config_set_data_file(ecl_config , char*)") - _validate_data_file = EnkfPrototype("ui_return_obj ecl_config_validate_data_file(ecl_config , char*)") - _get_gridfile = EnkfPrototype("char* ecl_config_get_gridfile(ecl_config)") - _set_gridfile = EnkfPrototype("void ecl_config_set_grid(ecl_config, char*)") - _validate_gridfile = EnkfPrototype("ui_return_obj ecl_config_validate_grid(ecl_config, char*)") - _get_grid = EnkfPrototype("ecl_grid_ref ecl_config_get_grid(ecl_config)") - _get_schedule_file = EnkfPrototype("char* ecl_config_get_schedule_file(ecl_config)") - _set_schedule_file = EnkfPrototype("void ecl_config_set_schedule_file(ecl_config, char*, char*)") - _validate_schedule_file = EnkfPrototype("ui_return_obj ecl_config_validate_schedule_file(ecl_config, char*)") - _get_sched_file = EnkfPrototype("sched_file_ref ecl_config_get_sched_file(ecl_config)") - _get_init_section = EnkfPrototype("char* ecl_config_get_init_section(ecl_config)") - _set_init_section = EnkfPrototype("void ecl_config_set_init_section(ecl_config, char*)") - _validate_init_section = EnkfPrototype("ui_return_obj ecl_config_validate_init_section(ecl_config, char*)") - _get_refcase_name = EnkfPrototype("char* ecl_config_get_refcase_name(ecl_config)") - _get_refcase = EnkfPrototype("ecl_sum_ref ecl_config_get_refcase(ecl_config)") - _load_refcase = EnkfPrototype("void ecl_config_load_refcase(ecl_config, char*)") - _validate_refcase = EnkfPrototype("ui_return_obj ecl_config_validate_refcase(ecl_config, char*)") - _has_refcase = EnkfPrototype("bool ecl_config_has_refcase(ecl_config)") - _get_static_kw_list = EnkfPrototype("stringlist_ref ecl_config_get_static_kw_list(ecl_config)") - _clear_static_kw = EnkfPrototype("void ecl_config_clear_static_kw(ecl_config)") - _add_static_kw = EnkfPrototype("void ecl_config_add_static_kw(ecl_config, char*)") - _get_depth_unit = EnkfPrototype("char* ecl_config_get_depth_unit(ecl_config)") - _get_pressure_unit = EnkfPrototype("char* ecl_config_get_pressure_unit(ecl_config)") - - def __init__(self): - c_ptr = self._alloc() - if c_ptr: - super(EclConfig, self).__init__(c_ptr) - else: - raise RuntimeError('Internal error: Failed constructing EclConfig!') - - def free(self): - self._free() - - #----------------------------------------------------------------- - - def getEclBase(self): - """ @rtype: str """ - return self._get_eclbase() - - def validateEclBase(self , eclbase_fmt): - return self._validate_eclbase(eclbase_fmt) - - # Warning: You should probably use the EnkFMain.setEclBase() method to update the Eclipse basename format - def setEclBase(self , eclbase): - self._set_eclbase(eclbase) - - #----------------------------------------------------------------- - - def getDataFile(self): - return self._get_data_file() - - def setDataFile(self , datafile): - self._set_data_file( datafile) - - def validateDataFile( self , datafile ): - """ @rtype: UIReturn """ - return self._validate_data_file( datafile ) - - #----------------------------------------------------------------- - - def get_gridfile(self): - """ @rtype: str """ - return self._get_gridfile() - - def set_gridfile(self, gridfile): - self._set_gridfile(gridfile) - - def validateGridFile(self , gridfile): - return self._validate_gridfile(gridfile) - - def get_grid(self): - warning_message = "The method get_grid() is deprecated. Use getGrid() instead" - warn(warning_message) - return self.getGrid( ) - - def getGrid(self): - return self._get_grid() - - #----------------------------------------------------------------- - - def getScheduleFile(self): - return self._get_schedule_file() - - def setScheduleFile(self, schedule_file, target_file = None): - self._set_schedule_file(schedule_file, target_file) - - def validateScheduleFile(self , schedule_file): - return self._validate_schedule_file(schedule_file) - - def get_sched_file(self): - return self._get_sched_file() - - #----------------------------------------------------------------- - - def getInitSection(self): - return self._get_init_section() - - def setInitSection(self, init_section): - self._set_init_section(init_section) - - def validateInitSection(self, init_section): - return self._validate_init_section(init_section) - - #----------------------------------------------------------------- - - def getRefcaseName(self): - return self._get_refcase_name() - - def loadRefcase(self, refcase): - self._load_refcase(refcase) - - def getRefcase(self): - """ @rtype: EclSum """ - refcase = self._get_refcase() - if not refcase is None: - refcase.setParent(self) - - return refcase - - - def validateRefcase(self, refcase): - return self._validate_refcase(refcase) - - def hasRefcase(self): - """ @rtype: bool """ - return self._has_refcase() - - #----------------------------------------------------------------- - - def get_static_kw_list(self): - """ @rtype: StringList """ - return self._get_static_kw_list().setParent(self) - - def clear_static_kw(self): - self._clear_static_kw() - - def add_static_kw(self, kw): - self._add_static_kw(kw) - - #----------------------------------------------------------------- - - def getDepthUnit(self): - return self._get_depth_unit() - - def getPressureUnit(self): - return self._get_pressure_unit() diff --git a/ThirdParty/Ert/python/python/ert/enkf/enkf_fs.py b/ThirdParty/Ert/python/python/ert/enkf/enkf_fs.py deleted file mode 100644 index b75dcb4dac..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/enkf_fs.py +++ /dev/null @@ -1,163 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'enkf_fs.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.enkf import TimeMap, StateMap, SummaryKeySet, CustomKWConfigSet -from ert.enkf.enums import EnKFFSType - - -class EnkfFs(BaseCClass): - TYPE_NAME = "enkf_fs" - - _mount = EnkfPrototype("void* enkf_fs_mount(char* )", bind = False) - _exists = EnkfPrototype("bool enkf_fs_exists(char*)", bind = False) - _disk_version = EnkfPrototype("int enkf_fs_disk_version(char*)", bind = False) - _update_disk_version = EnkfPrototype("bool enkf_fs_update_disk_version(char*, int, int)", bind = False) - _decref = EnkfPrototype("int enkf_fs_decref(enkf_fs)") - _get_refcount = EnkfPrototype("int enkf_fs_get_refcount(enkf_fs)") - _has_node = EnkfPrototype("bool enkf_fs_has_node(enkf_fs, char*, int, int, int, int)") - _has_vector = EnkfPrototype("bool enkf_fs_has_vector(enkf_fs, char*, int, int, int)") - _fread_node = EnkfPrototype("void enkf_fs_fread_node(enkf_fs, buffer, char*, int, int, int, int)") - _fread_vector = EnkfPrototype("void enkf_fs_fread_vector(enkf_fs, buffer, char*, int, int, int)") - _get_case_name = EnkfPrototype("char* enkf_fs_get_case_name(enkf_fs)") - _is_read_only = EnkfPrototype("bool enkf_fs_is_read_only(enkf_fs)") - _get_writecount = EnkfPrototype("int enkf_fs_get_write_count(enkf_fs)") - _fsync = EnkfPrototype("void enkf_fs_fsync(enkf_fs)") - _create = EnkfPrototype("enkf_fs_ref enkf_fs_create_fs(char* , enkf_fs_type_enum , void* , bool)", bind = False) - _get_time_map = EnkfPrototype("time_map_ref enkf_fs_get_time_map(enkf_fs)") - _get_state_map = EnkfPrototype("state_map_ref enkf_fs_get_state_map(enkf_fs)") - _summary_key_set = EnkfPrototype("summary_key_set_ref enkf_fs_get_summary_key_set(enkf_fs)") - _config_kw_config_set = EnkfPrototype("custom_kw_config_set_ref enkf_fs_get_custom_kw_config_set(enkf_fs)") - - def __init__(self, mount_point): - c_ptr = self._mount(mount_point) - super(EnkfFs, self).__init__(c_ptr) - - self.__umounted = False # Keep track of umounting so we only do it once - - - @classmethod - def createCReference(cls, c_pointer, parent=None): - obj = super(EnkfFs, cls).createCReference(c_pointer, parent) - if not obj is None: - obj.__umounted = False - return obj - - - # def has_node(self, node_key, var_type, report_step, iens, state): - # return self._has_node(node_key, var_type, report_step, iens, state) - # - # def has_vector(self, node_key, var_type, iens, state): - # return self._has_vector(node_key, var_type, iens, state) - # - # - # def fread_node(self, key, type, step, member, value): - # buffer = Buffer(100) - # self._fread_node(buffer, key, type, step, member, value) - # - # def fread_vector(self, key, type, member, value): - # buffer = Buffer(100) - # self._fread_vector(buffer, key, type, member, value) - - def getTimeMap(self): - """ @rtype: TimeMap """ - self.__checkIfUmounted() - return self._get_time_map().setParent(self) - - def getStateMap(self): - """ @rtype: StateMap """ - self.__checkIfUmounted() - return self._get_state_map().setParent(self) - - def getCaseName(self): - """ @rtype: str """ - self.__checkIfUmounted() - return self._get_case_name() - - def isReadOnly(self): - """ @rtype: bool """ - self.__checkIfUmounted() - return self._is_read_only() - - def refCount(self): - self.__checkIfUmounted() - return self._get_refcount() - - def writeCount(self): - return self._get_writecount() - - @classmethod - def exists(cls, path): - return cls._exists(path) - - @classmethod - def diskVersion(cls, path): - disk_version = cls._disk_version(path) - if disk_version < 0: - raise IOError("No such filesystem: %s" % path) - return disk_version - - - @classmethod - def updateVersion(cls, path, src_version , target_version): - return cls._update_disk_version(path , src_version ,target_version) - - - @classmethod - def createFileSystem(cls, path, fs_type, arg=None , mount = False): - assert isinstance(path, str) - assert isinstance(fs_type, EnKFFSType) - fs = cls._create(path, fs_type, arg, mount) - return fs - - - def __checkIfUmounted(self): - if self.__umounted: - raise AssertionError("The EnkfFs instance has been umounted!") - - def umount(self): - if not self.__umounted: - self._decref() - self.__umounted = True - - def free(self): - self.umount() - - def __repr__(self): - cn = self.getCaseName() - wc = self.writeCount() - ad = self._ad_str() - return 'EnkfFs(case_name = %s, write_count = %d) %s' % (cn, wc, ad) - - def fsync(self): - self._fsync() - - def getSummaryKeySet(self): - """ @rtype: SummaryKeySet """ - return self._summary_key_set().setParent(self) - - def realizationList(self, state): - """ - Will return list of realizations with state == the specified state. - @type state: ert.enkf.enums.RealizationStateEnum - @rtype: ert.util.IntVector - """ - state_map = self.getStateMap() - return state_map.realizationList(state) - - def getCustomKWConfigSet(self): - """ @rtype: CustomKWConfigSet """ - return self._config_kw_config_set() diff --git a/ThirdParty/Ert/python/python/ert/enkf/enkf_fs_manager.py b/ThirdParty/Ert/python/python/ert/enkf/enkf_fs_manager.py deleted file mode 100644 index 3f609a7dcc..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/enkf_fs_manager.py +++ /dev/null @@ -1,304 +0,0 @@ -import os.path -from cwrap import BaseCClass -from ert.enkf import EnkfFs, StateMap, TimeMap, RealizationStateEnum, EnkfInitModeEnum, EnkfPrototype -from ert.util import StringList, BoolVector - -import re - -def naturalSortKey(s, _nsre=re.compile('([0-9]+)')): - return [int(text) if text.isdigit() else text.lower() for text in re.split(_nsre, s)] - -class FileSystemRotator(object): - def __init__(self, capacity): - super(FileSystemRotator, self).__init__() - self._capacity = capacity - """:type: int""" - self._fs_list = [] - """:type: list of str""" - self._fs_map = {} - """:type: dict[str, EnkfFs]""" - - def __len__(self): - return len(self._fs_list) - - def addFileSystem(self, file_system, full_name): - if self.atCapacity(): - self.dropOldestFileSystem() - - self._fs_list.append(full_name) - self._fs_map[full_name] = file_system - - def dropOldestFileSystem(self): - if len(self._fs_list) > 0: - case_name = self._fs_list[0] - fs = self._fs_map[case_name] - fs.umount() - del self._fs_list[0] - del self._fs_map[case_name] - - - def atCapacity(self): - return len(self._fs_list) == self._capacity - - def __contains__(self, full_case_name): - return full_case_name in self._fs_list - - def __getitem__(self, case): - """ @rtype: EnkfFs """ - if isinstance(case, str): - return self._fs_map[case] - elif isinstance(case, int) and 0 <= case < len(self): - case_name = self._fs_list[case] - return self._fs_map[case_name] - else: - raise IndexError("Value '%s' is not a proper index or case name." % case) - - - def umountAll(self): - while len(self._fs_list) > 0: - self.dropOldestFileSystem() - - - -# For normal use from ert all filesystems will be located in the same -# folder in the filesystem - corresponding to the ENSPATH setting in -# the config file; in this implementation that setting is stored in -# the @mount_root field. Currently @mount_root is fixed to the value -# returned by EnKFMain.getMountPoint(), but in principle a different -# path could be sent as the the optional second argument to the -# getFS() method. - -class EnkfFsManager(BaseCClass): - TYPE_NAME = "enkf_fs_manager" - - _get_current_fs = EnkfPrototype("enkf_fs_ref enkf_main_get_fs_ref(enkf_fs_manager)") - _switch_fs = EnkfPrototype("void enkf_main_set_fs(enkf_fs_manager, enkf_fs, char*)") - _fs_exists = EnkfPrototype("bool enkf_main_fs_exists(enkf_fs_manager, char*)") - _alloc_caselist = EnkfPrototype("stringlist_obj enkf_main_alloc_caselist(enkf_fs_manager)") - _set_case_table = EnkfPrototype("void enkf_main_set_case_table(enkf_fs_manager, char*)") - _ensemble_size = EnkfPrototype("int enkf_main_get_ensemble_size(enkf_fs_manager)") - - _is_initialized = EnkfPrototype("bool enkf_main_is_initialized(enkf_fs_manager, bool_vector)") - _is_case_initialized = EnkfPrototype("bool enkf_main_case_is_initialized(enkf_fs_manager, char*, bool_vector)") - _initialize_from_scratch = EnkfPrototype("void enkf_main_initialize_from_scratch(enkf_fs_manager, enkf_fs , stringlist, bool_vector, enkf_init_mode_enum)") - _initialize_case_from_existing = EnkfPrototype("void enkf_main_init_case_from_existing(enkf_fs_manager, enkf_fs, int, enkf_fs)") - _custom_initialize_from_existing = EnkfPrototype("void enkf_main_init_current_case_from_existing_custom(enkf_fs_manager, enkf_fs, int, stringlist, bool_vector)") - _initialize_current_case_from_existing = EnkfPrototype("void enkf_main_init_current_case_from_existing(enkf_fs_manager, enkf_fs, int)") - - _alloc_readonly_state_map = EnkfPrototype("state_map_obj enkf_main_alloc_readonly_state_map(enkf_fs_manager, char*)") - _alloc_readonly_time_map = EnkfPrototype("time_map_obj enkf_main_alloc_readonly_time_map(enkf_fs_manager, char*)") - - DEFAULT_CAPACITY = 5 - - def __init__(self, enkf_main, capacity=DEFAULT_CAPACITY): - """ - @type enkf_main: ert.enkf.EnKFMain - @type capacity: int - """ - super(EnkfFsManager, self).__init__(enkf_main.from_param(enkf_main).value, parent=enkf_main, is_reference=True) - - self._fs_rotator = FileSystemRotator(capacity) - self._mount_root = enkf_main.getMountPoint() - - self._fs_type = enkf_main.getModelConfig().getFSType() - self._fs_arg = None - - self.getCurrentFileSystem() - - def _createFullCaseName(self, mount_root, case_name): - return os.path.join(mount_root, case_name) - - - def getFileSystem(self, case_name, mount_root=None): - """ - @rtype: EnkfFs - """ - if mount_root is None: - mount_root = self._mount_root - - full_case_name = self._createFullCaseName(mount_root, case_name) - - if not full_case_name in self._fs_rotator: - if not EnkfFs.exists(full_case_name): - if self._fs_rotator.atCapacity(): - self._fs_rotator.dropOldestFileSystem() - - EnkfFs.createFileSystem(full_case_name, self._fs_type, self._fs_arg) - - new_fs = EnkfFs(full_case_name) - self._fs_rotator.addFileSystem(new_fs, full_case_name) - - fs = self._fs_rotator[full_case_name] - - return fs - - def isCaseRunning(self, case_name, mount_root=None): - """ Returns true if case is mounted and write_count > 0 - @rtype: bool - """ - if self.isCaseMounted(case_name, mount_root): - case_fs = self.getFileSystem(case_name, mount_root) - return case_fs.writeCount() > 0 - return False - - - def caseExists(self, case_name): - """ @rtype: bool """ - return case_name in self.getCaseList() - - - def caseHasData(self, case_name): - """ @rtype: bool """ - case_has_data = False - state_map = self.getStateMapForCase(case_name) - - for state in state_map: - if state == RealizationStateEnum.STATE_HAS_DATA: - case_has_data = True - - return case_has_data - - - def getCurrentFileSystem(self): - """ Returns the currently selected file system - @rtype: EnkfFs - """ - current_fs = self._get_current_fs() - case_name = current_fs.getCaseName() - full_name = self._createFullCaseName(self._mount_root, case_name) - - if not full_name in self._fs_rotator: - self._fs_rotator.addFileSystem(current_fs, full_name) - else: - current_fs.umount() - - return self.getFileSystem(case_name, self._mount_root) - - - def umount(self): - self._fs_rotator.umountAll() - - - def getFileSystemCount(self): - return len(self._fs_rotator) - - - def getEnsembleSize(self): - """ @rtype: int """ - return self._ensemble_size( ) - - - def switchFileSystem(self, file_system): - """ - @type file_system: EnkfFs - """ - self._switch_fs(file_system, None) - - - def isCaseInitialized(self, case): - return self._is_case_initialized(case, None) - - def isInitialized(self): - """ @rtype: bool """ - return self._is_initialized(None) # what is the bool_vector mask??? - - - def getCaseList(self): - """ @rtype: list[str] """ - caselist = [case for case in self._alloc_caselist()] - return sorted(caselist, key=naturalSortKey) - - - def customInitializeCurrentFromExistingCase(self, source_case, source_report_step, member_mask, node_list): - """ - @type source_case: str - @type source_report_step: int - @type member_mask: ert.util.BoolVector - @type node_list: ert.util.StringList - """ - source_case_fs = self.getFileSystem(source_case) - self._custom_initialize_from_existing(source_case_fs, source_report_step, node_list, member_mask) - - def initializeCurrentCaseFromExisting(self, source_fs, source_report_step): - """ - @type source_fs: EnkfFs - @type source_report_step: int - """ - self._initialize_current_case_from_existing(source_fs, source_report_step) - - def initializeCaseFromExisting(self, source_fs, source_report_step, target_fs): - """ - @type source_fs: EnkfFs - @type source_report_step: int - @type target_fs: EnkfFs - """ - self._initialize_case_from_existing(source_fs, source_report_step, target_fs) - - def initializeCaseFromScratch(self, case, parameter_list, from_iens, to_iens, force_init=True): - """ - @type case: EnkfFs - @type parameter_list: ert.util.StringList - @type to_iens: int - @type from_iens: int - @type force_init: bool - """ - mask = BoolVector( initial_size = self.getEnsembleSize( ) , default_value = False ) - for iens in range(from_iens,to_iens+1): - mask[iens] = True - - if force_init: - init_mode = EnkfInitModeEnum.INIT_FORCE - else: - init_mode = EnkfInitModeEnum.INIT_CONDITIONAL - - self._initialize_from_scratch(case, parameter_list, mask , init_mode) - - - - def initializeFromScratch(self, parameter_list, from_iens, to_iens, force_init=True): - """ - @type parameter_list: ert.util.StringList - @type to_iens: int - @type from_iens: int - @type force_init: bool - """ - case = self.getCurrentFileSystem() - self.initializeCaseFromScratch(case, parameter_list, from_iens, to_iens, force_init) - - def isCaseMounted(self, case_name, mount_root=None): - """ - @type case_name: str - @type mount_root: str - @rtype: bool - """ - if mount_root is None: - mount_root = self._mount_root - - full_case_name = self._createFullCaseName(mount_root, case_name) - - return full_case_name in self._fs_rotator - - def getStateMapForCase(self, case): - """ - @type case: str - @rtype: StateMap - """ - if self.isCaseMounted(case): - fs = self.getFileSystem(case) - return fs.getStateMap() - else: - return self._alloc_readonly_state_map(case) - - def getTimeMapForCase(self, case): - """ - @type case: str - @rtype: TimeMap - """ - return self._alloc_readonly_time_map(case) - - def isCaseHidden(self, case_name): - """ - @rtype: bool - """ - return case_name.startswith(".") - diff --git a/ThirdParty/Ert/python/python/ert/enkf/enkf_linalg.py b/ThirdParty/Ert/python/python/ert/enkf/enkf_linalg.py deleted file mode 100644 index 5f04554d1e..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/enkf_linalg.py +++ /dev/null @@ -1,20 +0,0 @@ -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.util import Matrix , DoubleVector - -class EnkfLinalg(BaseCClass): - TYPE_NAME = "EnkfLinalg" - - _get_PC = EnkfPrototype("void enkf_linalg_get_PC(matrix, matrix, double, int, matrix, matrix, double_vector)", bind = False) - - @classmethod - def calculatePrincipalComponents(cls, S0, D_obs, truncation, ncomp, PC, PC_obs, singular_values): - assert isinstance(S0, Matrix) - assert isinstance(D_obs, Matrix) - assert isinstance(truncation, (float, int)) - assert isinstance(ncomp, int) - assert isinstance(PC, Matrix) - assert isinstance(PC_obs, Matrix) - assert isinstance(singular_values , DoubleVector) - - cls._get_PC(S0, D_obs, truncation, ncomp, PC, PC_obs , singular_values) diff --git a/ThirdParty/Ert/python/python/ert/enkf/enkf_main.py b/ThirdParty/Ert/python/python/ert/enkf/enkf_main.py deleted file mode 100644 index 70b9fa3169..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/enkf_main.py +++ /dev/null @@ -1,316 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'ecl_kw.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -import ctypes -from cwrap import BaseCClass - -from ert.enkf import EnkfPrototype, AnalysisConfig, EclConfig, EnkfObs, EnKFState, LocalConfig, ModelConfig, EnsembleConfig, PlotSettings, SiteConfig, ENKF_LIB, EnkfSimulationRunner, EnkfFsManager, ErtWorkflowList, HookManager, HookWorkflow, ESUpdate -from ert.enkf.enums import EnkfInitModeEnum -from ert.enkf.key_manager import KeyManager -from ert.util import SubstitutionList, Log - - - -class EnKFMain(BaseCClass): - TYPE_NAME = "enkf_main" - _alloc = EnkfPrototype("void* enkf_main_bootstrap(char*, bool, bool)", bind = False) - _create_new_config = EnkfPrototype("void enkf_main_create_new_config(char* , char*, char* , int)", bind = False) - - _free = EnkfPrototype("void enkf_main_free(enkf_main)") - _get_ensemble_size = EnkfPrototype("int enkf_main_get_ensemble_size( enkf_main )") - _get_ens_config = EnkfPrototype("ens_config_ref enkf_main_get_ensemble_config( enkf_main )") - _get_model_config = EnkfPrototype("model_config_ref enkf_main_get_model_config( enkf_main )") - _get_local_config = EnkfPrototype("local_config_ref enkf_main_get_local_config( enkf_main )") - _get_analysis_config = EnkfPrototype("analysis_config_ref enkf_main_get_analysis_config( enkf_main)") - _get_site_config = EnkfPrototype("site_config_ref enkf_main_get_site_config( enkf_main)") - _get_ecl_config = EnkfPrototype("ecl_config_ref enkf_main_get_ecl_config( enkf_main)") - _get_plot_config = EnkfPrototype("plot_settings_ref enkf_main_get_plot_config( enkf_main)") - _set_eclbase = EnkfPrototype("ui_return_obj enkf_main_set_eclbase( enkf_main, char*)") - _set_datafile = EnkfPrototype("void enkf_main_set_data_file( enkf_main, char*)") - _get_schedule_prediction_file = EnkfPrototype("char* enkf_main_get_schedule_prediction_file( enkf_main )") - _set_schedule_prediction_file = EnkfPrototype("void enkf_main_set_schedule_prediction_file( enkf_main , char*)") - _get_data_kw = EnkfPrototype("subst_list_ref enkf_main_get_data_kw(enkf_main)") - _clear_data_kw = EnkfPrototype("void enkf_main_clear_data_kw(enkf_main)") - _add_data_kw = EnkfPrototype("void enkf_main_add_data_kw(enkf_main, char*, char*)") - _resize_ensemble = EnkfPrototype("void enkf_main_resize_ensemble(enkf_main, int)") - _del_node = EnkfPrototype("void enkf_main_del_node(enkf_main, char*)") - _get_obs = EnkfPrototype("enkf_obs_ref enkf_main_get_obs(enkf_main)") - _load_obs = EnkfPrototype("void enkf_main_load_obs(enkf_main, char* , bool)") - _get_pre_clear_runpath = EnkfPrototype("bool enkf_main_get_pre_clear_runpath(enkf_main)") - _set_pre_clear_runpath = EnkfPrototype("void enkf_main_set_pre_clear_runpath(enkf_main, bool)") - _iget_keep_runpath = EnkfPrototype("int enkf_main_iget_keep_runpath(enkf_main, int)") - _iset_keep_runpath = EnkfPrototype("void enkf_main_iset_keep_runpath(enkf_main, int, int_vector)") - _get_templates = EnkfPrototype("ert_templates_ref enkf_main_get_templates(enkf_main)") - _get_site_config_file = EnkfPrototype("char* enkf_main_get_site_config_file(enkf_main)") - _get_history_length = EnkfPrototype("int enkf_main_get_history_length(enkf_main)") - _get_observations = EnkfPrototype("void enkf_main_get_observations(enkf_main, char*, int, long*, double*, double*)") - _get_observation_count = EnkfPrototype("int enkf_main_get_observation_count(enkf_main, char*)") - _iget_state = EnkfPrototype("enkf_state_ref enkf_main_iget_state(enkf_main, int)") - _get_workflow_list = EnkfPrototype("ert_workflow_list_ref enkf_main_get_workflow_list(enkf_main)") - _get_hook_manager = EnkfPrototype("hook_manager_ref enkf_main_get_hook_manager(enkf_main)") - _get_user_config_file = EnkfPrototype("char* enkf_main_get_user_config_file(enkf_main)") - _get_mount_point = EnkfPrototype("char* enkf_main_get_mount_root( enkf_main )") - _export_field = EnkfPrototype("bool enkf_main_export_field(enkf_main, char*, char*, bool_vector, enkf_field_file_format_enum, int)") - _export_field_with_fs = EnkfPrototype("bool enkf_main_export_field_with_fs(enkf_main, char*, char*, bool_vector, enkf_field_file_format_enum, int, enkf_fs_manager)") - _load_from_forward_model = EnkfPrototype("int enkf_main_load_from_forward_model_from_gui(enkf_main, int, bool_vector, enkf_fs)") - _create_run_path = EnkfPrototype("void enkf_main_icreate_run_path(enkf_main , run_arg)") - _submit_simulation = EnkfPrototype("void enkf_main_isubmit_job(enkf_main , run_arg)") - _alloc_run_context_ENSEMBLE_EXPERIMENT= EnkfPrototype("ert_run_context_obj enkf_main_alloc_ert_run_context_ENSEMBLE_EXPERIMENT( enkf_main , enkf_fs , bool_vector , enkf_init_mode_enum , int)") - _get_runpath_list = EnkfPrototype("runpath_list_ref enkf_main_get_runpath_list(enkf_main)") - _add_node = EnkfPrototype("void enkf_main_add_node(enkf_main, enkf_config_node)") - - - - def __init__(self, model_config, strict = True, verbose = True): - c_ptr = self._alloc(model_config, strict, verbose) - super(EnKFMain, self).__init__(c_ptr) - - # The model_config argument can be None; the only reason to - # allow that possibility is to be able to test that the - # site-config loads correctly. - if model_config is None: - self.__simulation_runner = None - self.__fs_manager = None - self.__es_update = None - else: - self.__simulation_runner = EnkfSimulationRunner(self) - self.__fs_manager = EnkfFsManager(self) - self.__es_update = ESUpdate(self) - - - self.__key_manager = KeyManager(self) - - @staticmethod - def loadSiteConfig(): - """ - This method will load the site config file; the sole purpose - of this method is testing. - """ - EnKFMain( None ) - - - @classmethod - def createCReference(cls, c_pointer, parent=None): - obj = super(EnKFMain, cls).createCReference(c_pointer, parent) - obj.__simulation_runner = EnkfSimulationRunner(obj) - obj.__fs_manager = EnkfFsManager(obj) - return obj - - - @staticmethod - def createNewConfig(config_file, storage_path, dbase_type, num_realizations): - return EnKFMain._create_new_config(config_file, storage_path, dbase_type, num_realizations) - - def getRealisation(self , iens): - """ @rtype: EnKFState """ - if 0 <= iens < self.getEnsembleSize(): - return self._iget_state(iens).setParent(self) - else: - raise IndexError("iens value:%d invalid Valid range: [0,%d)" % (iens , self.getEnsembleSize())) - - - def set_eclbase(self, eclbase): - self._set_eclbase(eclbase) - - def umount(self): - if not self.__fs_manager is None: - self.__fs_manager.umount() - - def free(self): - self.umount() - self._free( ) - - def __repr__(self): - ens = self.getEnsembleSize() - cfg = self.getUserConfigFile() - cnt = 'ensemble_size = %d, config_file = %s' % (ens,cfg) - return self._create_repr(cnt) - - def getEnsembleSize(self): - """ @rtype: int """ - return self._get_ensemble_size( ) - - def resizeEnsemble(self, value): - self._resize_ensemble(value) - - def ensembleConfig(self): - """ @rtype: EnsembleConfig """ - return self._get_ens_config( ).setParent(self) - - def analysisConfig(self): - """ @rtype: AnalysisConfig """ - return self._get_analysis_config( ).setParent(self) - - def getModelConfig(self): - """ @rtype: ModelConfig """ - return self._get_model_config( ).setParent(self) - - def logh(self): - """ @rtype: Log """ - return self._get_logh( ).setParent(self) - - def getLocalConfig(self): - """ @rtype: LocalConfig """ - config = self._get_local_config( ).setParent(self) - config.initAttributes( self.ensembleConfig() , self.getObservations() , self.eclConfig().getGrid() ) - return config - - - def siteConfig(self): - """ @rtype: SiteConfig """ - return self._get_site_config( ).setParent(self) - - def eclConfig(self): - """ @rtype: EclConfig """ - return self._get_ecl_config( ).setParent(self) - - def plotConfig(self): - """ @rtype: PlotConfig """ - return self._get_plot_config( ).setParent(self) - - def set_datafile(self, datafile): - self._set_datafile(datafile) - - - def get_schedule_prediction_file(self): - schedule_prediction_file = self._get_schedule_prediction_file( ) - return schedule_prediction_file - - def set_schedule_prediction_file(self, file): - self._set_schedule_prediction_file(file) - - def getDataKW(self): - """ @rtype: SubstitutionList """ - return self._get_data_kw( ) - - def clearDataKW(self): - self._clear_data_kw( ) - - def addDataKW(self, key, value): - self._add_data_kw(key, value) - - - def getMountPoint(self): - return self._get_mount_point( ) - - - def del_node(self, key): - self._del_node(key) - - def getObservations(self): - """ @rtype: EnkfObs """ - return self._get_obs( ).setParent(self) - - def loadObservations(self , obs_config_file , clear = True): - self._load_obs(obs_config_file , clear) - - - def get_pre_clear_runpath(self): - pre_clear = self._get_pre_clear_runpath( ) - return pre_clear - - def set_pre_clear_runpath(self, value): - self._set_pre_clear_runpath(value) - - def iget_keep_runpath(self, iens): - ikeep = self._iget_keep_runpath(iens) - return ikeep - - def iset_keep_runpath(self, iens, keep_runpath): - self._iset_keep_runpath(iens, keep_runpath) - - def get_templates(self): - return self._get_templates( ).setParent(self) - - def get_site_config_file(self): - return self._get_site_config_file( ) - - def getUserConfigFile(self): - """ @rtype: str """ - config_file = self._get_user_config_file( ) - return config_file - - - def getHistoryLength(self): - return self._get_history_length( ) - - def getMemberRunningState(self, ensemble_member): - """ @rtype: EnKFState """ - return self._iget_state(ensemble_member).setParent(self) - - def get_observations(self, user_key, obs_count, obs_x, obs_y, obs_std): - return self._get_observations(user_key, obs_count, obs_x, obs_y, obs_std) - - def get_observation_count(self, user_key): - return self._get_observation_count(user_key) - - - def getESUpdate(self): - """ @rtype: ESUpdate """ - return self.__es_update - - def getEnkfSimulationRunner(self): - """ @rtype: EnkfSimulationRunner """ - return self.__simulation_runner - - def getEnkfFsManager(self): - """ @rtype: EnkfFsManager """ - return self.__fs_manager - - def getKeyManager(self): - """ :rtype: KeyManager """ - return self.__key_manager - - def getWorkflowList(self): - """ @rtype: ErtWorkflowList """ - return self._get_workflow_list( ).setParent(self) - - def getHookManager(self): - """ @rtype: HookManager """ - return self._get_hook_manager( ) - - def exportField(self, keyword, path, iactive, file_type, report_step, state, enkfFs): - """ - @type keyword: str - @type path: str - @type iactive: BoolVector - @type file_type: EnkfFieldFileFormatEnum - @type report_step: int - @type enkfFs: EnkfFs - - """ - assert isinstance(keyword, str) - return self._export_field_with_fs(keyword, path, iactive, file_type, report_step, state, enkfFs) - - def loadFromForwardModel(self, realization, iteration, fs): - """Returns the number of loaded realizations""" - return self._load_from_forward_model(iteration, realization, fs) - - def createRunPath(self , run_arg): - self._create_run_path( run_arg) - - def submitSimulation(self , run_arg): - self._submit_simulation( run_arg) - - - def getRunContextENSEMPLE_EXPERIMENT(self , fs , iactive , init_mode = EnkfInitModeEnum.INIT_CONDITIONAL , iteration = 0): - return self._alloc_run_context_ENSEMBLE_EXPERIMENT( fs , iactive , init_mode , iteration ) - - - def getRunpathList(self): - return self._get_runpath_list( ) - - def addNode(self, enkf_config_node): - self._add_node(enkf_config_node) diff --git a/ThirdParty/Ert/python/python/ert/enkf/enkf_obs.py b/ThirdParty/Ert/python/python/ert/enkf/enkf_obs.py deleted file mode 100644 index 2049dcbc92..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/enkf_obs.py +++ /dev/null @@ -1,174 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'enkf_obs.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -import os.path - -from cwrap import BaseCClass -from ert.util import StringList, IntVector -from ert.sched import History -from ert.ecl import EclSum , EclGrid -from ert.enkf import EnkfPrototype -from ert.enkf import EnkfFs, LocalObsdataNode , LocalObsdata, MeasData, ObsData -from ert.enkf.enums import EnkfObservationImplementationType - -from ert.enkf.observations import ObsVector - - -class EnkfObs(BaseCClass): - TYPE_NAME = "enkf_obs" - - _alloc = EnkfPrototype("void* enkf_obs_alloc( history , time_map , ecl_grid , ecl_sum , ens_config )", bind = False) - _free = EnkfPrototype("void enkf_obs_free( enkf_obs )") - _get_size = EnkfPrototype("int enkf_obs_get_size( enkf_obs )") - _load = EnkfPrototype("bool enkf_obs_load( enkf_obs , char*)") - _clear = EnkfPrototype("void enkf_obs_clear( enkf_obs )") - _alloc_typed_keylist = EnkfPrototype("stringlist_obj enkf_obs_alloc_typed_keylist(enkf_obs, enkf_obs_impl_type)") - _alloc_matching_keylist = EnkfPrototype("stringlist_obj enkf_obs_alloc_matching_keylist(enkf_obs, char*)") - _has_key = EnkfPrototype("bool enkf_obs_has_key(enkf_obs, char*)") - _obs_type = EnkfPrototype("enkf_obs_impl_type enkf_obs_get_type(enkf_obs, char*)") - _get_vector = EnkfPrototype("obs_vector_ref enkf_obs_get_vector(enkf_obs, char*)") - _iget_vector = EnkfPrototype("obs_vector_ref enkf_obs_iget_vector(enkf_obs, int)") - _iget_obs_time = EnkfPrototype("time_t enkf_obs_iget_obs_time(enkf_obs, int)") - _add_obs_vector = EnkfPrototype("void enkf_obs_add_obs_vector(enkf_obs, obs_vector)") - _get_obs_and_measure_data = EnkfPrototype("void enkf_obs_get_obs_and_measure_data(enkf_obs, enkf_fs, local_obsdata, int_vector, meas_data, obs_data)") - _create_all_active_obs = EnkfPrototype("local_obsdata_obj enkf_obs_alloc_all_active_local_obs( enkf_obs , char*)"); - _scale_correlated_std = EnkfPrototype("double enkf_obs_scale_correlated_std( enkf_obs , enkf_fs , int_vector , local_obsdata)"); - _local_scale_std = EnkfPrototype("void enkf_obs_local_scale_std( enkf_obs , local_obsdata , double)"); - - def __init__(self , ensemble_config , history = None , external_time_map = None , grid = None , refcase = None ): - c_ptr = self._alloc( history , external_time_map , grid , refcase , ensemble_config ) - super(EnkfObs, self).__init__(c_ptr) - - def __len__(self): - return self._get_size() - - def __contains__(self , key): - return self._has_key(key) - - def __iter__(self): - """ @rtype: ObsVector """ - iobs = 0 - while iobs < len(self): - vector = self[iobs] - yield vector - iobs += 1 - - - def __getitem__(self, key_or_index): - """ @rtype: ObsVector """ - if isinstance(key_or_index, str): - if self.hasKey(key_or_index): - return self._get_vector(key_or_index).setParent(self) - else: - raise KeyError("Unknown key: %s" % key_or_index) - elif isinstance(key_or_index, int): - idx = key_or_index - if idx < 0: - idx += len(self) - if 0 <= idx < len(self): - return self._iget_vector(idx).setParent(self) - else: - raise IndexError("Invalid index: %d. Valid range is [0, %d)." % (key_or_index, len(self))) - else: - raise TypeError("Key or index must be of type str or int, not %s." % str(type(key_or_index))) - - - def createLocalObsdata(self , key , add_active_steps = True): - # Use getAllActiveLocalObsdata() - raise NotImplementedError("Hmmm C function: enkf_obs_alloc_all_active_local_obs() removed") - - - - def getAllActiveLocalObsdata(self , key = "ALL-OBS"): - return self._create_all_active_obs( key ) - - - - def getTypedKeylist(self, observation_implementation_type): - """ - @type observation_implementation_type: EnkfObservationImplementationType - @rtype: StringList - """ - return self._alloc_typed_keylist(observation_implementation_type) - - def obsType(self , key): - if key in self: - return self._obs_type(key) - else: - raise KeyError("Unknown observation key:%s" % key) - - - def getMatchingKeys(self , pattern , obs_type = None): - """ - Will return a list of all the observation keys matching the input - pattern. The matching is based on fnmatch(). - """ - key_list = self._alloc_matching_keylist(pattern) - if obs_type: - new_key_list = [] - for key in key_list: - if self.obsType( key ) == obs_type: - new_key_list.append( key ) - return new_key_list - else: - return key_list - - - def hasKey(self, key): - """ @rtype: bool """ - return key in self - - - def getObservationTime(self, index): - """ @rtype: CTime """ - return self._iget_obs_time(index) - - - def addObservationVector(self, observation_vector): - assert isinstance(observation_vector, ObsVector) - - observation_vector.convertToCReference(self) - - self._add_obs_vector(observation_vector) - - def getObservationAndMeasureData(self, fs, local_obsdata, active_list, meas_data, obs_data): - assert isinstance(fs, EnkfFs) - assert isinstance(local_obsdata, LocalObsdata) - assert isinstance(active_list, IntVector) - assert isinstance(meas_data, MeasData) - assert isinstance(obs_data, ObsData) - - self._get_obs_and_measure_data(fs, local_obsdata, active_list, meas_data, obs_data) - - - def scaleCorrelatedStd( self , fs , local_obsdata , active_list): - return self._scale_correlated_std( fs , active_list , local_obsdata ) - - def localScaleStd( self , local_obsdata , scale_factor): - return self._local_scale_std(local_obsdata, scale_factor) - - def load(self , config_file): - if not os.path.isfile( config_file ): - raise IOError('The observation config file "%s" does not exist.' % config_file) - return self._load( config_file ) - - def clear(self): - self._clear() - - def free(self): - self._free() - - def __repr__(self): - return 'EnkfObs(len = %d) at 0x%x' % (len(self), self._address()) diff --git a/ThirdParty/Ert/python/python/ert/enkf/enkf_simulation_runner.py b/ThirdParty/Ert/python/python/ert/enkf/enkf_simulation_runner.py deleted file mode 100644 index 40cfc61cc8..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/enkf_simulation_runner.py +++ /dev/null @@ -1,44 +0,0 @@ -from cwrap import BaseCClass -from ert.enkf import EnkfFs -from ert.enkf import EnkfPrototype -from ert.enkf.enums import EnkfInitModeEnum -from ert.util import BoolVector - - -class EnkfSimulationRunner(BaseCClass): - TYPE_NAME = "enkf_simulation_runner" - - _create_run_path = EnkfPrototype("bool enkf_main_create_run_path(enkf_simulation_runner, bool_vector, int)") - _run_simple_step = EnkfPrototype("int enkf_main_run_simple_step(enkf_simulation_runner, bool_vector, enkf_init_mode_enum, int)") - - def __init__(self, enkf_main): - assert isinstance(enkf_main, BaseCClass) - super(EnkfSimulationRunner, self).__init__(enkf_main.from_param(enkf_main).value, parent=enkf_main, is_reference=True) - self.ert = enkf_main - """:type: ert.enkf.EnKFMain """ - - def runSimpleStep(self, active_realization_mask, initialization_mode, iter_nr): - """ @rtype: int """ - assert isinstance(active_realization_mask, BoolVector) - assert isinstance(initialization_mode, EnkfInitModeEnum) - return self._run_simple_step(active_realization_mask, initialization_mode , iter_nr) - - def createRunPath(self, active_realization_mask, iter_nr): - """ @rtype: bool """ - assert isinstance(active_realization_mask, BoolVector) - return self._create_run_path(active_realization_mask, iter_nr) - - def runEnsembleExperiment(self, active_realization_mask=None): - """ @rtype: int """ - if active_realization_mask is None: - count = self.ert.getEnsembleSize() - active_realization_mask = BoolVector(default_value=True, initial_size=count) - - iter_nr = 0 - return self.runSimpleStep(active_realization_mask, EnkfInitModeEnum.INIT_CONDITIONAL, iter_nr) - - - def runWorkflows(self , runtime): - """:type ert.enkf.enum.HookRuntimeEnum""" - hook_manager = self.ert.getHookManager() - hook_manager.runWorkflows( runtime , self.ert ) diff --git a/ThirdParty/Ert/python/python/ert/enkf/enkf_state.py b/ThirdParty/Ert/python/python/ert/enkf/enkf_state.py deleted file mode 100644 index e5b85d141a..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/enkf_state.py +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'enkf_state.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.enkf.enums import EnkfInitModeEnum, EnkfVarType -from ert.job_queue import JobStatusType - - -class EnKFState(BaseCClass): - TYPE_NAME = "enkf_state" - _free = EnkfPrototype("void* enkf_state_free( enkf_state )") - _has_key = EnkfPrototype("bool enkf_state_has_node( enkf_state , char* )") - _get_node = EnkfPrototype("enkf_node_ref enkf_state_has_node( enkf_state , char* )") - _add_subst_kw = EnkfPrototype("void enkf_state_add_subst_kw( enkf_state , char* , char* , char*)") - _get_subst_list = EnkfPrototype("subst_list_ref enkf_state_get_subst_list( enkf_state )") - _get_ens_config = EnkfPrototype("ens_config_ref enkf_state_get_ensemble_config( enkf_state )") - _initialize = EnkfPrototype("void enkf_state_initialize( enkf_state , enkf_fs , stringlist , enkf_init_mode_enum)") - - def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") - - - def __getitem__(self , kw): - """ @rtype: ert.enkf.data.enkf_node.EnkfNode """ - if isinstance(kw , str): - if kw in self: - node = self._get_node( kw ) - node.setParent( self ) - return node - else: - raise KeyError("The state object does not have node:%s" % kw) - else: - raise TypeError("The kw type must be string. Input:%s" % kw) - - - def __contains__(self , kw): - return self._has_key( kw ) - - - def hasKey(self , kw): - """ @rtype: bool """ - return kw in self - - - def getNode(self , kw): - """ @rtype: ert.enkf.data.enkf_node.EnkfNode """ - return self[kw] - - - def free(self): - self._free( ) - - - def addSubstKeyword(self , key , value): - """ - Will add a key -> value pair which can be used for search replace - operations in the data file. Observe that the key will be - surrounded by \'<\' and \'>\'. - """ - doc_string = None - if isinstance(value , str): - self._add_subst_kw( key , value , doc_string ) - else: - raise TypeError("The value argument must be a string") - - def getDataKW(self): - """ - Will return the substitution map for this realisation. - """ - return self._get_subst_list( ) - - - def ensembleConfig(self): - """ @rtype: EnsembleConfig """ - return self._get_ens_config( ) - def initialize( self , fs , param_list = None , init_mode = EnkfInitModeEnum.INIT_CONDITIONAL): - if param_list is None: - ens_config = self.ensembleConfig( ) - param_list = ens_config.getKeylistFromVarType( EnkfVarType.PARAMETER ) - self._initialize( fs , param_list , init_mode ) diff --git a/ThirdParty/Ert/python/python/ert/enkf/ensemble_config.py b/ThirdParty/Ert/python/python/ert/enkf/ensemble_config.py deleted file mode 100644 index 29e8ab3c1d..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/ensemble_config.py +++ /dev/null @@ -1,114 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'ensemble_config.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass -from ert.util import StringList -from ert.enkf import EnkfPrototype, SummaryKeyMatcher -from ert.enkf.config import EnkfConfigNode, CustomKWConfig -from ert.enkf.enums import EnkfVarType, ErtImplType - - - -class EnsembleConfig(BaseCClass): - TYPE_NAME = "ens_config" - _alloc = EnkfPrototype("void* ensemble_config_alloc()" , bind = False) - _free = EnkfPrototype("void ensemble_config_free( ens_config )") - _has_key = EnkfPrototype("bool ensemble_config_has_key( ens_config , char* )") - _size = EnkfPrototype("int ensemble_config_get_size( ens_config)") - _get_node = EnkfPrototype("enkf_config_node_ref ensemble_config_get_node( ens_config , char*)") - _alloc_keylist = EnkfPrototype("stringlist_obj ensemble_config_alloc_keylist( ens_config )") - _add_summary = EnkfPrototype("enkf_config_node_ref ensemble_config_add_summary( ens_config, char*, int)") - _add_gen_kw = EnkfPrototype("enkf_config_node_ref ensemble_config_add_gen_kw( ens_config, char*)") - _add_field = EnkfPrototype("enkf_config_node_ref ensemble_config_add_field( ens_config, char*, ecl_grid)") - _alloc_keylist_from_var_type = EnkfPrototype("stringlist_obj ensemble_config_alloc_keylist_from_var_type(ens_config, enkf_var_type_enum)") - _alloc_keylist_from_impl_type = EnkfPrototype("stringlist_obj ensemble_config_alloc_keylist_from_impl_type(ens_config, ert_impl_type_enum)") - _add_node = EnkfPrototype("void ensemble_config_add_node( ens_config , enkf_config_node )") - _summary_key_matcher = EnkfPrototype("summary_key_matcher_ref ensemble_config_get_summary_key_matcher(ens_config)") - _add_defined_custom_kw = EnkfPrototype("enkf_config_node_ref ensemble_config_add_defined_custom_kw(ens_config, char*, integer_hash)") - - - - def __init__(self): - c_ptr = self._alloc( ) - super(EnsembleConfig , self).__init__(c_ptr) - - - def __len__(self): - return self._size( ) - - - def __getitem__(self , key): - """ @rtype: EnkfConfigNode """ - if key in self: - return self._get_node(key).setParent(self) - else: - raise KeyError("The key:%s is not in the ensemble configuration" % key) - - - def getNode(self, key): - return self[key] - - - def alloc_keylist(self): - """ @rtype: StringList """ - return self._alloc_keylist( ) - - def add_summary(self, key): - """ @rtype: EnkfConfigNode """ - return self._add_summary(key, 2).setParent(self) - - def add_gen_kw(self, key): - """ @rtype: EnkfConfigNode """ - return self._add_gen_kw(key).setParent(self) - - - def addNode(self , config_node): - assert isinstance(config_node , EnkfConfigNode) - self._add_node( config_node ) - config_node.setParent( self ) - - - def add_field(self, key, eclipse_grid): - """ @rtype: EnkfConfigNode """ - return self._add_field(key, eclipse_grid).setParent(self) - - def getKeylistFromVarType(self, var_mask): - """ @rtype: StringList """ - assert isinstance(var_mask, EnkfVarType) - return self._alloc_keylist_from_var_type(var_mask) - - def getKeylistFromImplType(self, ert_impl_type): - """ @rtype: StringList """ - assert isinstance(ert_impl_type, ErtImplType) - return self._alloc_keylist_from_impl_type(ert_impl_type) - - def __contains__(self, key): - return self._has_key( key) - - def getSummaryKeyMatcher(self): - """ @rtype: SummaryKeyMatcher """ - return self._summary_key_matcher( ) - - def free(self): - self._free( ) - - def addDefinedCustomKW(self, group_name, definition): - """ @rtype: EnkfConfigNode """ - if not group_name in self: - type_hash = CustomKWConfig.convertDefinition(definition) - self._add_defined_custom_kw(group_name, type_hash) - - return self[group_name] - diff --git a/ThirdParty/Ert/python/python/ert/enkf/enums/CMakeLists.txt b/ThirdParty/Ert/python/python/ert/enkf/enums/CMakeLists.txt deleted file mode 100644 index 27be30d855..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/enums/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - enkf_field_file_format_enum.py - enkf_fs_type_enum.py - enkf_init_modes_enum.py - enkf_obs_impl_type_enum.py - enkf_run_enum.py - enkf_truncation_type.py - enkf_var_type_enum.py - ert_impl_type_enum.py - load_fail_type_enum.py - realization_state_enum.py - gen_data_file_type_enum.py - active_mode_enum.py - hook_runtime_enum.py -) - -add_python_package("python.ert.enkf.enums" ${PYTHON_INSTALL_PREFIX}/ert/enkf/enums "${PYTHON_SOURCES}" True) diff --git a/ThirdParty/Ert/python/python/ert/enkf/enums/__init__.py b/ThirdParty/Ert/python/python/ert/enkf/enums/__init__.py deleted file mode 100644 index d3b4382658..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/enums/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -from .enkf_field_file_format_enum import EnkfFieldFileFormatEnum -from .load_fail_type_enum import LoadFailTypeEnum -from .enkf_var_type_enum import EnkfVarType -from .enkf_run_enum import EnkfRunType -from .enkf_obs_impl_type_enum import EnkfObservationImplementationType -from .ert_impl_type_enum import ErtImplType -from .enkf_init_modes_enum import EnkfInitModeEnum -from .realization_state_enum import RealizationStateEnum -from .enkf_truncation_type import EnkfTruncationType -from .enkf_fs_type_enum import EnKFFSType -from .gen_data_file_type_enum import GenDataFileType -from .active_mode_enum import ActiveMode -from .hook_runtime_enum import HookRuntime - -__all__ = ["EnkfFieldFileFormatEnum", - "LoadFailTypeEnum", - "EnkfVarType", - "EnkfRunType", - "EnkfObservationImplementationType", - "ErtImplType", - "EnkfInitModeEnum", - "RealizationStateEnum", - "EnkfTruncationType", - "EnKFFSType", - "GenDataFileType", - "ActiveMode", - "HookRuntime"] diff --git a/ThirdParty/Ert/python/python/ert/enkf/enums/enkf_field_file_format_enum.py b/ThirdParty/Ert/python/python/ert/enkf/enums/enkf_field_file_format_enum.py deleted file mode 100644 index 5a05a11002..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/enums/enkf_field_file_format_enum.py +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'enkf_field_file_format_enum.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCEnum - -class EnkfFieldFileFormatEnum(BaseCEnum): - TYPE_NAME = "enkf_field_file_format_enum" - UNDEFINED_FORMAT = None - RMS_ROFF_FILE = None - ECL_KW_FILE = None - ECL_KW_FILE_ACTIVE_CELLS = None - ECL_KW_FILE_ALL_CELLS = None - ECL_GRDECL_FILE = None - ECL_FILE = None - FILE_FORMAT_NULL = None - -EnkfFieldFileFormatEnum.addEnum("UNDEFINED_FORMAT", 0) -EnkfFieldFileFormatEnum.addEnum("RMS_ROFF_FILE", 1) -EnkfFieldFileFormatEnum.addEnum("ECL_KW_FILE", 2) -EnkfFieldFileFormatEnum.addEnum("ECL_KW_FILE_ACTIVE_CELLS", 3) -EnkfFieldFileFormatEnum.addEnum("ECL_KW_FILE_ALL_CELLS", 4) -EnkfFieldFileFormatEnum.addEnum("ECL_GRDECL_FILE", 5) -EnkfFieldFileFormatEnum.addEnum("ECL_FILE", 6) -EnkfFieldFileFormatEnum.addEnum("FILE_FORMAT_NULL", 7) diff --git a/ThirdParty/Ert/python/python/ert/enkf/enums/enkf_fs_type_enum.py b/ThirdParty/Ert/python/python/ert/enkf/enums/enkf_fs_type_enum.py deleted file mode 100644 index 1a4a471dce..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/enums/enkf_fs_type_enum.py +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (C) 2014 Statoil ASA, Norway. -# -# The file 'enkf_fs_type_enum.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCEnum - - -class EnKFFSType(BaseCEnum): - TYPE_NAME = "enkf_fs_type_enum" - INVALID_DRIVER_ID = None - PLAIN_DRIVER_ID = None - BLOCK_FS_DRIVER_ID = None - -EnKFFSType.addEnum("INVALID_DRIVER_ID", 0) -EnKFFSType.addEnum("PLAIN_DRIVER_ID", 1005) -EnKFFSType.addEnum("BLOCK_FS_DRIVER_ID", 3001) diff --git a/ThirdParty/Ert/python/python/ert/enkf/enums/enkf_init_modes_enum.py b/ThirdParty/Ert/python/python/ert/enkf/enums/enkf_init_modes_enum.py deleted file mode 100644 index f19c6adc12..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/enums/enkf_init_modes_enum.py +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'content_type_enum.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCEnum - -class EnkfInitModeEnum(BaseCEnum): - TYPE_NAME = "enkf_init_mode_enum" - INIT_NONE = None - INIT_CONDITIONAL = None - INIT_FORCE = None - - -EnkfInitModeEnum.addEnum("INIT_NONE", 0) -EnkfInitModeEnum.addEnum("INIT_CONDITIONAL", 1) -EnkfInitModeEnum.addEnum("INIT_FORCE", 2) diff --git a/ThirdParty/Ert/python/python/ert/enkf/enums/enkf_obs_impl_type_enum.py b/ThirdParty/Ert/python/python/ert/enkf/enums/enkf_obs_impl_type_enum.py deleted file mode 100644 index a8abbffab9..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/enums/enkf_obs_impl_type_enum.py +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'enkf_obs_impl_type_enum.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCEnum - -class EnkfObservationImplementationType(BaseCEnum): - TYPE_NAME = "enkf_obs_impl_type" - GEN_OBS = None - SUMMARY_OBS = None - BLOCK_OBS = None - -EnkfObservationImplementationType.addEnum("GEN_OBS", 1) -EnkfObservationImplementationType.addEnum("SUMMARY_OBS", 2) -EnkfObservationImplementationType.addEnum("BLOCK_OBS", 3) diff --git a/ThirdParty/Ert/python/python/ert/enkf/enums/enkf_run_enum.py b/ThirdParty/Ert/python/python/ert/enkf/enums/enkf_run_enum.py deleted file mode 100644 index 9e23bdb208..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/enums/enkf_run_enum.py +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'content_type_enum.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCEnum - -class EnkfRunType(BaseCEnum): - TYPE_NAME = "enkf_run_mode_enum" - ENKF_ASSIMILATION = None - ENSEMBLE_EXPERIMENT = None - SMOOTHER_UPDATED = None - INIT_ONLY = None - - -EnkfRunType.addEnum("ENKF_ASSIMILATION" , 1) -EnkfRunType.addEnum("ENSEMBLE_EXPERIMENT" , 2) -EnkfRunType.addEnum("SMOOTHER_UPDATE" , 4) -EnkfRunType.addEnum("INIT_ONLY" , 8) diff --git a/ThirdParty/Ert/python/python/ert/enkf/enums/enkf_truncation_type.py b/ThirdParty/Ert/python/python/ert/enkf/enums/enkf_truncation_type.py deleted file mode 100644 index 326fa0b8a2..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/enums/enkf_truncation_type.py +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'content_type_enum.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCEnum - -class EnkfTruncationType(BaseCEnum): - TYPE_NAME = "enkf_truncation_type_enum" - TRUNCATE_NONE = None - TRUNCATE_MIN = None - TRUNCATE_MAX = None - -EnkfTruncationType.addEnum("TRUNCATE_NONE", 0) -EnkfTruncationType.addEnum("TRUNCATE_MIN", 1) -EnkfTruncationType.addEnum("TRUNCATE_MAX", 2) diff --git a/ThirdParty/Ert/python/python/ert/enkf/enums/enkf_var_type_enum.py b/ThirdParty/Ert/python/python/ert/enkf/enums/enkf_var_type_enum.py deleted file mode 100644 index 823b369326..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/enums/enkf_var_type_enum.py +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'content_type_enum.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCEnum - -class EnkfVarType(BaseCEnum): - TYPE_NAME = "enkf_var_type_enum" - INVALID_VAR = None - PARAMETER = None - DYNAMIC_STATE = None - DYNAMIC_RESULT = None - STATIC_STATE = None - INDEX_STATE = None - - -EnkfVarType.addEnum("INVALID_VAR", 0) -EnkfVarType.addEnum("PARAMETER", 1) -EnkfVarType.addEnum("DYNAMIC_STATE", 2) -EnkfVarType.addEnum("DYNAMIC_RESULT", 4) -EnkfVarType.addEnum("STATIC_STATE", 8) -EnkfVarType.addEnum("INDEX_STATE", 16) diff --git a/ThirdParty/Ert/python/python/ert/enkf/enums/ert_impl_type_enum.py b/ThirdParty/Ert/python/python/ert/enkf/enums/ert_impl_type_enum.py deleted file mode 100644 index 4d204f1ae8..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/enums/ert_impl_type_enum.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'ert_impl_type_enum.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCEnum - - -class ErtImplType(BaseCEnum): - TYPE_NAME = "ert_impl_type_enum" - INVALID = None - IMPL_TYPE_OFFSET = None - STATIC = None # MULTZ has been removed & MULTFLT - FIELD = None # WELL has been removed - GEN_KW = None # RELPERM has been removed & HAVANA_FAULT - CUSTOM_KW = None - SUMMARY = None # TPGZONE has been removed - GEN_DATA = None # PILOT_POINT has been removed - SURFACE = None - CONTAINER = None - - -ErtImplType.addEnum("INVALID", 0) -ErtImplType.addEnum("IMPL_TYPE_OFFSET", 100) -ErtImplType.addEnum("STATIC", 100) -ErtImplType.addEnum("FIELD", 104) -ErtImplType.addEnum("GEN_KW", 107) -ErtImplType.addEnum("CUSTOM_KW", 108) -ErtImplType.addEnum("SUMMARY", 110) -ErtImplType.addEnum("GEN_DATA", 113) -ErtImplType.addEnum("SURFACE", 114) -ErtImplType.addEnum("CONTAINER", 115) diff --git a/ThirdParty/Ert/python/python/ert/enkf/enums/gen_data_file_type_enum.py b/ThirdParty/Ert/python/python/ert/enkf/enums/gen_data_file_type_enum.py deleted file mode 100644 index 62fb9867c3..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/enums/gen_data_file_type_enum.py +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'gen_data_file_type_enum.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCEnum -from ert.enkf import EnkfPrototype - - -class GenDataFileType(BaseCEnum): - TYPE_NAME = "gen_data_file_format_type" - GEN_DATA_UNDEFINED = None - ASCII = None # The file is ASCII file with a vector of numbers formatted with "%g" - ASCII_TEMPLATE = None # The data is inserted into a user defined template file. - BINARY_DOUBLE = None # The data is in a binary file with doubles. - BINARY_FLOAT = None # The data is in a binary file with floats. - -GenDataFileType.addEnum("GEN_DATA_UNDEFINED", 0) -GenDataFileType.addEnum("ASCII", 1) -GenDataFileType.addEnum("ASCII_TEMPLATE", 2) -GenDataFileType.addEnum("BINARY_DOUBLE", 3) -GenDataFileType.addEnum("BINARY_FLOAT", 4) diff --git a/ThirdParty/Ert/python/python/ert/enkf/enums/hook_runtime_enum.py b/ThirdParty/Ert/python/python/ert/enkf/enums/hook_runtime_enum.py deleted file mode 100644 index 45a1663b6d..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/enums/hook_runtime_enum.py +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (C) 2016 Statoil ASA, Norway. -# -# The file 'hook_runtime_enum.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCEnum - -class HookRuntime(BaseCEnum): - TYPE_NAME = "hook_runtime_enum" - PRE_SIMULATION = None - POST_SIMULATION = None - PRE_UPDATE = None - POST_UPDATE = None - - -HookRuntime.addEnum("PRE_SIMULATION" , 0) -HookRuntime.addEnum("POST_SIMULATION" , 1) -HookRuntime.addEnum("PRE_UPDATE" , 2) -HookRuntime.addEnum("POST_UPDATE" , 3) diff --git a/ThirdParty/Ert/python/python/ert/enkf/enums/load_fail_type_enum.py b/ThirdParty/Ert/python/python/ert/enkf/enums/load_fail_type_enum.py deleted file mode 100644 index b21808a453..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/enums/load_fail_type_enum.py +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'content_type_enum.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCEnum - -class LoadFailTypeEnum(BaseCEnum): - TYPE_NAME = "load_fail_type" - LOAD_FAIL_SILENT = None - LOAD_FAIL_WARN = None - LOAD_FAIL_EXIT = None - - -LoadFailTypeEnum.addEnum("LOAD_FAIL_SILENT", 0) -LoadFailTypeEnum.addEnum("LOAD_FAIL_WARN", 2) -LoadFailTypeEnum.addEnum("LOAD_FAIL_EXIT", 4) diff --git a/ThirdParty/Ert/python/python/ert/enkf/enums/realization_state_enum.py b/ThirdParty/Ert/python/python/ert/enkf/enums/realization_state_enum.py deleted file mode 100644 index 20ce63d7a9..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/enums/realization_state_enum.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'ert_impl_type_enum.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCEnum - -class RealizationStateEnum(BaseCEnum): - TYPE_NAME = "realisation_state_enum" - STATE_UNDEFINED = None - STATE_INITIALIZED = None - STATE_HAS_DATA = None - STATE_LOAD_FAILURE = None - STATE_PARENT_FAILURE = None - -RealizationStateEnum.addEnum("STATE_UNDEFINED", 1) -RealizationStateEnum.addEnum("STATE_INITIALIZED", 2) -RealizationStateEnum.addEnum("STATE_HAS_DATA", 4) -RealizationStateEnum.addEnum("STATE_LOAD_FAILURE", 8) -RealizationStateEnum.addEnum("STATE_PARENT_FAILURE", 16) diff --git a/ThirdParty/Ert/python/python/ert/enkf/ert_log.py b/ThirdParty/Ert/python/python/ert/enkf/ert_log.py deleted file mode 100644 index 499bf2c320..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/ert_log.py +++ /dev/null @@ -1,20 +0,0 @@ -from ert.enkf import EnkfPrototype - - -class ErtLog(object): - _init = EnkfPrototype("void ert_log_init_log(int, char*, bool)", bind=False) - _write_log = EnkfPrototype("void ert_log_add_message_py(int, char*)", bind=False) - _get_filename = EnkfPrototype("char* ert_log_get_filename()", bind=False) - - @classmethod - def init(cls, log_level, log_filename, verbose): - cls._init(log_level, log_filename, verbose) - - @classmethod - def log(cls, log_level, message): - cls._write_log(log_level, message) - - @classmethod - def getFilename(cls): - """ @rtype: string """ - return cls._get_filename() diff --git a/ThirdParty/Ert/python/python/ert/enkf/ert_run_context.py b/ThirdParty/Ert/python/python/ert/enkf/ert_run_context.py deleted file mode 100644 index f4f12757be..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/ert_run_context.py +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright (C) 2014 Statoil ASA, Norway. -# -# The file 'enkf_fs.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.enkf import TimeMap, StateMap, RunArg -from ert.util import PathFormat, StringList - -class ErtRunContext(BaseCClass): - TYPE_NAME = "ert_run_context" - - _alloc_runpath_list = EnkfPrototype("stringlist_obj ert_run_context_alloc_runpath_list(bool_vector, path_fmt, subst_list, int)", bind = False) - _alloc_runpath = EnkfPrototype("char* ert_run_context_alloc_runpath(int, path_fmt, subst_list, int)", bind = False) - _get_size = EnkfPrototype("int ert_run_context_get_size( ert_run_context )") - _free = EnkfPrototype("void ert_run_context_free( ert_run_context )") - _iget = EnkfPrototype("run_arg_ref ert_run_context_iget_arg( ert_run_context , int)") - _iens_get = EnkfPrototype("run_arg_ref ert_run_context_iens_get_arg( ert_run_context , int)") - - def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") - - def __len__(self): - return self._get_size() - - def __getitem__(self , index): - if isinstance(index, int): - if 0 <= index < len(self): - run_arg = self._iget(index) - run_arg.setParent( self ) - return run_arg - else: - raise IndexError("Index:%d invalid. Legal range: [0,%d)" % (index , len(self))) - else: - raise TypeError("Invalid type - expetected integer") - - def iensGet(self , iens): - run_arg = self._iens_get(iens) - if run_arg is not None: - run_arg.setParent(self) - return run_arg - else: - raise ValueError("Run context does not have run argument for iens:%d" % iens) - - def free(self): - self._free() - - def __repr__(self): - return 'ErtRunContext(size = %d) %s' % (len(self), self._ad_str()) - - @classmethod - def createRunpathList(cls, mask, runpath_fmt, subst_list, iter=0): - """ @rtype: ert.util.stringlist.StringList """ - return cls._alloc_runpath_list(mask, runpath_fmt, subst_list, iter) - - - @classmethod - def createRunpath(cls, iens , runpath_fmt, subst_list, iter=0): - """ @rtype: str """ - return cls._alloc_runpath(iens, runpath_fmt, subst_list, iter) diff --git a/ThirdParty/Ert/python/python/ert/enkf/ert_template.py b/ThirdParty/Ert/python/python/ert/enkf/ert_template.py deleted file mode 100644 index 66df26159b..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/ert_template.py +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'ert_template.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype - - -class ErtTemplate(BaseCClass): - TYPE_NAME = "ert_template" - - _free = EnkfPrototype("void ert_template_free( ert_template )") - _get_template_file = EnkfPrototype("char* ert_template_get_template_file(ert_template)") - _get_target_file = EnkfPrototype("char* ert_template_get_target_file(ert_template)") - _get_args_as_string = EnkfPrototype("char* ert_template_get_args_as_string(ert_template)") - - def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") - - def get_template_file(self): - """ @rtype: str """ - return self._get_template_file() - - def get_target_file(self): - """ @rtype: str """ - return self._get_target_file() - - def get_args_as_string(self): - """ @rtype: str """ - return self._get_args_as_string() - - def free(self): - self._free() diff --git a/ThirdParty/Ert/python/python/ert/enkf/ert_templates.py b/ThirdParty/Ert/python/python/ert/enkf/ert_templates.py deleted file mode 100644 index aa4d39ef5e..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/ert_templates.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'ert_templates.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype, ErtTemplate -from ert.util import StringList - - -class ErtTemplates(BaseCClass): - TYPE_NAME = "ert_templates" - - _free = EnkfPrototype("void ert_templates_free( ert_templates )") - _alloc_list = EnkfPrototype("stringlist_ref ert_templates_alloc_list(ert_templates)") - _get_template = EnkfPrototype("ert_template_ref ert_templates_get_template(ert_templates, char*)") - _clear = EnkfPrototype("void ert_templates_clear(ert_templates)") - _add_template = EnkfPrototype("ert_template_ref ert_templates_add_template(ert_templates, char*, char*, char*, char*)") - - def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") - - def getTemplateNames(self): - """ @rtype: StringList """ - return self._alloc_list().setParent(self) - - def clear(self): - self._clear() - - def get_template(self, key): - """ @rtype: ErtTemplate """ - return self._get_template(key).setParent(self) - - def add_template(self, key, template_file, target_file, arg_string): - """ @rtype: ErtTemplate """ - return self._add_template(key, template_file, target_file, arg_string).setParent(self) - - def free(self): - self._free() diff --git a/ThirdParty/Ert/python/python/ert/enkf/ert_workflow_list.py b/ThirdParty/Ert/python/python/ert/enkf/ert_workflow_list.py deleted file mode 100644 index 9c1ee6726b..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/ert_workflow_list.py +++ /dev/null @@ -1,77 +0,0 @@ -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.util import StringList, SubstitutionList -from ert.job_queue import Workflow, WorkflowJob - - -class ErtWorkflowList(BaseCClass): - TYPE_NAME = "ert_workflow_list" - - _alloc_namelist = EnkfPrototype("stringlist_obj ert_workflow_list_alloc_namelist(ert_workflow_list)") - _has_workflow = EnkfPrototype("bool ert_workflow_list_has_workflow(ert_workflow_list, char*)") - _get_workflow = EnkfPrototype("workflow_ref ert_workflow_list_get_workflow(ert_workflow_list, char*)") - _get_context = EnkfPrototype("subst_list_ref ert_workflow_list_get_context(ert_workflow_list)") - _add_job = EnkfPrototype("void ert_workflow_list_add_job(ert_workflow_list, char*, char*)") - _has_job = EnkfPrototype("bool ert_workflow_list_has_job(ert_workflow_list, char*)") - _get_job = EnkfPrototype("workflow_job_ref ert_workflow_list_get_job(ert_workflow_list, char*)") - _get_job_names = EnkfPrototype("stringlist_obj ert_workflow_list_get_job_names(ert_workflow_list)") - _free = EnkfPrototype("void ert_workflow_list_free(ert_workflow_list)") - - def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") - - def getWorkflowNames(self): - """ @rtype: StringList """ - return self._alloc_namelist() - - def __contains__(self, workflow_name): - assert isinstance(workflow_name, str) - return self._has_workflow(workflow_name) - - def __getitem__(self, item): - """ @rtype: Workflow """ - if not item in self: - raise KeyError("Item '%s' is not in the list of available workflows." % item) - - return self._get_workflow(item).setParent(self) - - def getContext(self): - """ @rtype: SubstitutionList """ - return self._get_context() - - def free(self): - self._free() - - def __str__(self): - return 'ErtWorkflowList with jobs: %s' + str(self.getJobNames()) - - def addJob(self, job_name, job_path): - """ - @type job_name: str - @type job_path: str - """ - self._add_job(job_name, job_path) - - def hasJob(self, job_name): - """ - @type job_name: str - @rtype: bool - """ - return self._has_job(job_name) - - def getJob(self, job_name): - """ @rtype: WorkflowJob """ - return self._get_job(job_name) - - def getJobNames(self): - """ @rtype: StringList """ - return self._get_job_names() - - def getPluginJobs(self): - """ @rtype: list of WorkflowJob """ - plugins = [] - for job_name in self.getJobNames(): - job = self.getJob(job_name) - if job.isPlugin(): - plugins.append(job) - return plugins diff --git a/ThirdParty/Ert/python/python/ert/enkf/es_update.py b/ThirdParty/Ert/python/python/ert/enkf/es_update.py deleted file mode 100644 index eeed5b00a7..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/es_update.py +++ /dev/null @@ -1,35 +0,0 @@ -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype - -class ESUpdate(BaseCClass): - TYPE_NAME="es_update" - _smoother_update = EnkfPrototype("bool enkf_main_smoother_update(es_update, enkf_fs, enkf_fs)") - - def __init__(self , ert): - assert isinstance(ert , BaseCClass) - super(ESUpdate, self).__init__(ert.from_param(ert).value , parent=ert , is_reference=True) - self.ert = ert - self.analysis_config = self.ert.analysisConfig( ) - - - def hasModule(self, name): - """ - Will check if we have analysis module @name. - """ - return self.analysis_config.hasModule( name ) - - - def getModule(self,name): - if self.hasModule( name ): - self.analysis_config.getModule( name ) - else: - raise KeyError("No such module:%s " % name) - - - def setGlobalStdScaling(self , weight): - self.analysis_config.setGlobalStdScaling( weight ) - - - - def smootherUpdate( self , data_fs , target_fs): - return self._smoother_update(data_fs , target_fs ) diff --git a/ThirdParty/Ert/python/python/ert/enkf/export/CMakeLists.txt b/ThirdParty/Ert/python/python/ert/enkf/export/CMakeLists.txt deleted file mode 100644 index 54dca03101..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/export/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - arg_loader.py - custom_kw_collector.py - design_matrix_reader.py - gen_data_collector.py - gen_data_observation_collector.py - gen_kw_collector.py - misfit_collector.py - summary_collector.py - summary_observation_collector.py -) - -add_python_package("python.ert.enkf.export" ${PYTHON_INSTALL_PREFIX}/ert/enkf/export "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert/enkf/export/__init__.py b/ThirdParty/Ert/python/python/ert/enkf/export/__init__.py deleted file mode 100644 index 6bd788d815..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/export/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -from .design_matrix_reader import DesignMatrixReader -from .summary_observation_collector import SummaryObservationCollector -from .summary_collector import SummaryCollector -from .gen_kw_collector import GenKwCollector -from .gen_data_collector import GenDataCollector -from .gen_data_observation_collector import GenDataObservationCollector -from .misfit_collector import MisfitCollector -from .custom_kw_collector import CustomKWCollector -from .arg_loader import ArgLoader - -__all__ = ["DesignMatrixReader", - "SummaryCollector", - "SummaryObservationCollector", - "GenKwCollector", - "MisfitCollector", - "CustomKWCollector", - "GenDataCollector", - "GenDataObservationCollector", - "ArgLoader"] - diff --git a/ThirdParty/Ert/python/python/ert/enkf/export/arg_loader.py b/ThirdParty/Ert/python/python/ert/enkf/export/arg_loader.py deleted file mode 100644 index ffb57dc1c1..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/export/arg_loader.py +++ /dev/null @@ -1,46 +0,0 @@ -from __future__ import print_function -import math -from pandas import DataFrame, MultiIndex -import numpy -from ert.enkf import ErtImplType, EnKFMain, EnkfFs, RealizationStateEnum, GenKwConfig -from ert.enkf.plot_data import EnsemblePlotGenData -from ert.util import BoolVector - - -class ArgLoader(object): - - @staticmethod - def load(filename , column_names = None): - rows = 0 - columns = 0 - with open(filename,"r") as fileH: - for line in fileH.readlines(): - rows += 1 - columns = max(columns , len( line.split()) ) - - if not column_names is None: - if len(column_names) <= columns: - columns = len(column_names) - else: - raise ValueError("To many coloumns in input") - - data = numpy.empty(shape=(rows , columns) , dtype=numpy.float64) - data.fill( numpy.nan ) - - row = 0 - with open(filename) as fileH: - for line in fileH.readlines(): - tmp = line.split( ) - print(tmp) - for column in range(columns): - data[row][column] = float(tmp[column]) - row += 1 - - - if column_names is None: - column_names = [] - for column in range(columns): - column_names.append( "Column%d" % column ) - - data_frame = DataFrame( data = data , columns = column_names) - return data_frame diff --git a/ThirdParty/Ert/python/python/ert/enkf/export/custom_kw_collector.py b/ThirdParty/Ert/python/python/ert/enkf/export/custom_kw_collector.py deleted file mode 100644 index e696c488d0..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/export/custom_kw_collector.py +++ /dev/null @@ -1,66 +0,0 @@ -from pandas import DataFrame -from ert.enkf import ErtImplType, EnKFMain, EnkfFs, RealizationStateEnum, CustomKWConfig, EnkfNode, NodeId -from ert.enkf.key_manager import KeyManager - - -class CustomKWCollector(object): - - @staticmethod - def getAllCustomKWKeys(ert): - """ @rtype: list of str """ - key_manager = KeyManager(ert) - return key_manager.customKwKeys() - - @staticmethod - def groupKeys(keys): - grouped_keys = {} - for key in keys: - name, keyword = key.split(":") - - if not name in grouped_keys: - grouped_keys[name] = [] - - grouped_keys[name].append(keyword) - - return grouped_keys - - - @staticmethod - def loadAllCustomKWData(ert, case_name, keys=None): - """ - @type ert: EnKFMain - @type case_name: str - @type keys: list of str - @rtype: DataFrame - """ - fs = ert.getEnkfFsManager().getFileSystem(case_name) - - realizations = fs.realizationList(RealizationStateEnum.STATE_HAS_DATA | RealizationStateEnum.STATE_INITIALIZED) - - custom_kw_keys = CustomKWCollector.getAllCustomKWKeys(ert) - - if keys is not None: - custom_kw_keys = [key for key in keys if key in custom_kw_keys] # ignore keys that doesn't exist - - custom_kw_data = DataFrame(index=realizations, columns=custom_kw_keys) - custom_kw_data.index.name = "Realization" - - custom_kw_keys = CustomKWCollector.groupKeys(custom_kw_keys) - - for name in custom_kw_keys: - ensemble_config_node = ert.ensembleConfig().getNode(name) - enkf_node = EnkfNode(ensemble_config_node) - - keys = custom_kw_keys[name] - - for realization_number in realizations: - node_id = NodeId(0, realization_number) - if enkf_node.tryLoad(fs, node_id): - custom_kw = enkf_node.asCustomKW() - - for key in keys: - value = custom_kw[key] - custom_kw_data["%s:%s" % (name, key)][realization_number] = value - - return custom_kw_data - diff --git a/ThirdParty/Ert/python/python/ert/enkf/export/design_matrix_reader.py b/ThirdParty/Ert/python/python/ert/enkf/export/design_matrix_reader.py deleted file mode 100644 index 0e31707f03..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/export/design_matrix_reader.py +++ /dev/null @@ -1,15 +0,0 @@ -import pandas as pd -from pandas import DataFrame - - -class DesignMatrixReader(object): - - @staticmethod - def loadDesignMatrix(filename): - """@rtype: DataFrame""" - dm = pd.read_csv(filename, delim_whitespace=True) - """ @type dm: pd.DataFrame """ - dm = dm.rename(columns={dm.columns[0]:"Realization"}) - dm = dm.set_index(["Realization"]) - - return dm diff --git a/ThirdParty/Ert/python/python/ert/enkf/export/gen_data_collector.py b/ThirdParty/Ert/python/python/ert/enkf/export/gen_data_collector.py deleted file mode 100644 index 867483999c..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/export/gen_data_collector.py +++ /dev/null @@ -1,45 +0,0 @@ -import math -from pandas import DataFrame, MultiIndex -import numpy -from ert.enkf import ErtImplType, EnKFMain, EnkfFs, RealizationStateEnum, GenKwConfig -from ert.enkf.plot_data import EnsemblePlotGenData -from ert.util import BoolVector - - -class GenDataCollector(object): - - @staticmethod - def loadGenData(ert, case_name, key, report_step): - """@type ert: EnKFMain - @type case_name: str - @type key: str - @type report_step: int - @rtype: DataFrame - - In the returned dataframe the realisation index runs along the - rows, and the gen_data element index runs vertically along the - columns. - """ - fs = ert.getEnkfFsManager().getFileSystem(case_name) - realizations = fs.realizationList( RealizationStateEnum.STATE_HAS_DATA ) - config_node = ert.ensembleConfig().getNode(key) - gen_data_config = config_node.getModelConfig() - - ensemble_data = EnsemblePlotGenData( config_node , fs , report_step ) - # The data size and active can only be inferred *after* the EnsembleLoad. - data_size = gen_data_config.getDataSize( report_step ) - active_mask = gen_data_config.getActiveMask() - - data_array = numpy.empty(shape=(data_size , len(realizations)) , dtype=numpy.float64) - data_array.fill( numpy.nan ) - for realization_index, realization_number in enumerate(realizations): - realization_vector = ensemble_data[realization_number] - - if len(realization_vector) > 0: # Must check because of a bug changing between different case with different states - for data_index in range(data_size): - if active_mask[data_index]: - value = realization_vector[data_index] - data_array[data_index][realization_index] = value - - return DataFrame( data = data_array , columns = realizations ) - diff --git a/ThirdParty/Ert/python/python/ert/enkf/export/gen_data_observation_collector.py b/ThirdParty/Ert/python/python/ert/enkf/export/gen_data_observation_collector.py deleted file mode 100644 index bde51f3353..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/export/gen_data_observation_collector.py +++ /dev/null @@ -1,73 +0,0 @@ -from pandas import DataFrame -from ert.enkf import EnKFMain, EnkfFs, EnkfObservationImplementationType - - -class GenDataObservationCollector(object): - - @staticmethod - def getAllObservationKeys(ert): - """ - @type ert: EnKFMain - @rtype: list of str - """ - enkf_obs = ert.getObservations() - observation_keys = enkf_obs.getTypedKeylist(EnkfObservationImplementationType.GEN_OBS) - return [key for key in observation_keys] - - @staticmethod - def getObservationKeyForDataKey(ert, data_key, data_report_step): - """ - @type ert: EnKFMain - @rtype: str - """ - observation_key = None - - enkf_obs = ert.getObservations() - for obs_vector in enkf_obs: - report_step = obs_vector.activeStep() - key = obs_vector.getDataKey() - - if key == data_key and report_step == data_report_step: - observation_key = obs_vector.getObservationKey() - - return observation_key - - - @staticmethod - def loadGenDataObservations(ert, case_name, key): - """ - @type ert: EnKFMain - @type case_name: str - @type key: name of an observation key - @rtype: DataFrame - """ - fs = ert.getEnkfFsManager().getFileSystem(case_name) - - available_observation_keys = GenDataObservationCollector.getAllObservationKeys(ert) - if not key in available_observation_keys: - raise KeyError("Key '%s' is not a valid observation key") - - columns = [key] - std_columns = ["STD_%s" % key] - - enkf_obs = ert.getObservations() - - index_set = set() - obs_vector = enkf_obs[key] - report_step = obs_vector.activeStep() - - obs_node = obs_vector.getNode(report_step) - # """ :type: ert.enkf.observations.GenObservation """ - - for obs_index in range(len(obs_node)): - index_set.add(obs_node.getIndex(obs_index)) - - index_list = sorted(list(index_set)) - data = DataFrame(index=index_list, columns=columns + std_columns) - - for obs_index, (value, std) in enumerate(obs_node): - data_index = obs_node.getIndex(obs_index) - data[key][data_index] = value - data["STD_%s" % key][data_index] = std - - return data diff --git a/ThirdParty/Ert/python/python/ert/enkf/export/gen_kw_collector.py b/ThirdParty/Ert/python/python/ert/enkf/export/gen_kw_collector.py deleted file mode 100644 index 00bc1417f5..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/export/gen_kw_collector.py +++ /dev/null @@ -1,73 +0,0 @@ -import math -from pandas import DataFrame, MultiIndex -import numpy -from ert.enkf import ErtImplType, EnKFMain, EnkfFs, RealizationStateEnum, GenKwConfig -from ert.enkf.key_manager import KeyManager -from ert.enkf.plot_data import EnsemblePlotGenKW -from ert.util import BoolVector - - -class GenKwCollector(object): - - @staticmethod - def createActiveList(ert, fs): - state_map = fs.getStateMap() - ens_mask = BoolVector(False, ert.getEnsembleSize()) - state_map.selectMatching(ens_mask, RealizationStateEnum.STATE_INITIALIZED | RealizationStateEnum.STATE_HAS_DATA) - active_list = BoolVector.createActiveList(ens_mask) - - return [iens for iens in active_list] - - @staticmethod - def getAllGenKwKeys(ert): - """ @rtype: list of str """ - key_manager = KeyManager(ert) - return key_manager.genKwKeys() - - @staticmethod - def loadAllGenKwData(ert, case_name, keys=None): - """ - @type ert: EnKFMain - @type case_name: str - @type keys: list of str - @rtype: DataFrame - """ - fs = ert.getEnkfFsManager().getFileSystem(case_name) - - realizations = GenKwCollector.createActiveList(ert, fs) - - gen_kw_keys = GenKwCollector.getAllGenKwKeys(ert) - - if keys is not None: - gen_kw_keys = [key for key in keys if key in gen_kw_keys] # ignore keys that doesn't exist - - gen_kw_array = numpy.empty(shape=(len(gen_kw_keys), len(realizations)), dtype=numpy.float64) - gen_kw_array.fill(numpy.nan) - - for column_index, key in enumerate(gen_kw_keys): - key, keyword = key.split(":") - - use_log_scale = False - if key.startswith("LOG10_"): - key = key[6:] - use_log_scale = True - - ensemble_config_node = ert.ensembleConfig().getNode(key) - ensemble_data = EnsemblePlotGenKW(ensemble_config_node, fs) - keyword_index = ensemble_data.getIndexForKeyword(keyword) - - for realization_index, realization_number in enumerate(realizations): - realization_vector = ensemble_data[realization_number] - - value = realization_vector[keyword_index] - - if use_log_scale: - value = math.log10(value) - - gen_kw_array[column_index][realization_index] = value - - gen_kw_data = DataFrame(data=numpy.transpose(gen_kw_array), index=realizations, columns=gen_kw_keys) - gen_kw_data.index.name = "Realization" - - return gen_kw_data - diff --git a/ThirdParty/Ert/python/python/ert/enkf/export/misfit_collector.py b/ThirdParty/Ert/python/python/ert/enkf/export/misfit_collector.py deleted file mode 100644 index fa0ebea40b..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/export/misfit_collector.py +++ /dev/null @@ -1,53 +0,0 @@ -from pandas import DataFrame -import numpy -from ert.enkf import EnKFMain, EnkfFs, RealizationStateEnum -from ert.enkf.key_manager import KeyManager -from ert.util import BoolVector - - -class MisfitCollector(object): - - @staticmethod - def createActiveList(ert, fs): - state_map = fs.getStateMap() - ens_mask = BoolVector(False, ert.getEnsembleSize()) - state_map.selectMatching(ens_mask, RealizationStateEnum.STATE_HAS_DATA) - active_list = BoolVector.createActiveList(ens_mask) - - return [iens for iens in active_list] - - @staticmethod - def getAllMisfitKeys(ert, sort_keys=True): - """ @rtype: list of str """ - key_manager = KeyManager(ert) - return key_manager.misfitKeys(sort_keys=sort_keys) - - @staticmethod - def loadAllMisfitData(ert, case_name): - """ - @type ert: EnKFMain - @type case_name: str - @rtype: DataFrame - """ - fs = ert.getEnkfFsManager().getFileSystem(case_name) - - realizations = MisfitCollector.createActiveList(ert, fs) - misfit_keys = MisfitCollector.getAllMisfitKeys(ert, sort_keys=False) - misfit_sum_index = len(misfit_keys) - 1 - - misfit_array = numpy.empty(shape=(len(misfit_keys), len(realizations)), dtype=numpy.float64) - misfit_array.fill(numpy.nan) - misfit_array[misfit_sum_index] = 0.0 - - for column_index, obs_vector in enumerate(ert.getObservations()): - - for realization_index, realization_number in enumerate(realizations): - misfit = obs_vector.getTotalChi2(fs, realization_number) - - misfit_array[column_index][realization_index] = misfit - misfit_array[misfit_sum_index][realization_index] += misfit - - misfit_data = DataFrame(data=numpy.transpose(misfit_array), index=realizations, columns=misfit_keys) - misfit_data.index.name = "Realization" - - return misfit_data diff --git a/ThirdParty/Ert/python/python/ert/enkf/export/summary_collector.py b/ThirdParty/Ert/python/python/ert/enkf/export/summary_collector.py deleted file mode 100644 index 322ad3d946..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/export/summary_collector.py +++ /dev/null @@ -1,67 +0,0 @@ -from pandas import DataFrame, MultiIndex -import numpy -from ert.enkf import ErtImplType, EnKFMain, EnkfFs, RealizationStateEnum -from ert.enkf.key_manager import KeyManager -from ert.enkf.plot_data import EnsemblePlotData -from ert.util import BoolVector - - -class SummaryCollector(object): - - @staticmethod - def createActiveList(ert, fs): - state_map = fs.getStateMap() - ens_mask = BoolVector(False, ert.getEnsembleSize()) - state_map.selectMatching(ens_mask, RealizationStateEnum.STATE_HAS_DATA) - active_list = BoolVector.createActiveList(ens_mask) - - return [iens for iens in active_list] - - @staticmethod - def getAllSummaryKeys(ert): - """ @rtype: list of str """ - key_manager = KeyManager(ert) - return key_manager.summaryKeys() - - @staticmethod - def loadAllSummaryData(ert, case_name, keys=None): - """ - @type ert: EnKFMain - @type case_name: str - @type keys: list of str - @rtype: DataFrame - """ - fs = ert.getEnkfFsManager().getFileSystem(case_name) - - time_map = fs.getTimeMap() - dates = [time_map[index].datetime() for index in range(1, len(time_map))] - realizations = SummaryCollector.createActiveList(ert, fs) - - summary_keys = SummaryCollector.getAllSummaryKeys(ert) - if keys is not None: - summary_keys = [key for key in keys if key in summary_keys] # ignore keys that doesn't exist - - summary_array = numpy.empty(shape=(len(summary_keys), len(realizations) * len(dates)), dtype=numpy.float64) - summary_array.fill(numpy.nan) - - for key_index, key in enumerate(summary_keys): - ensemble_config_node = ert.ensembleConfig().getNode(key) - ensemble_data = EnsemblePlotData(ensemble_config_node, fs) - summary_row = summary_array[key_index] - - for realization_index, realization_number in enumerate(realizations): - realization_vector = ensemble_data[realization_number] - column_index = realization_index * len(dates) - - for index in range(1, len(realization_vector)): - if realization_vector.isActive(index): - # assert time_map[index] == realization_vector.getTime(index) - # assert time_map[index].datetime() == dates[index - 1] - value = realization_vector.getValue(index) - summary_row[column_index + index - 1] = value - - - multi_index = MultiIndex.from_product([realizations, dates], names=["Realization", "Date"]) - summary_data = DataFrame(data=numpy.transpose(summary_array), index=multi_index, columns=summary_keys) - return summary_data - diff --git a/ThirdParty/Ert/python/python/ert/enkf/export/summary_observation_collector.py b/ThirdParty/Ert/python/python/ert/enkf/export/summary_observation_collector.py deleted file mode 100644 index 7eb9df6f31..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/export/summary_observation_collector.py +++ /dev/null @@ -1,65 +0,0 @@ -from pandas import DataFrame, MultiIndex -import numpy -from ert.enkf import ErtImplType, EnKFMain, EnkfFs, RealizationStateEnum, EnkfObservationImplementationType -from ert.enkf.key_manager import KeyManager -from ert.enkf.plot_data import EnsemblePlotData -from ert.util import BoolVector - - -class SummaryObservationCollector(object): - - @staticmethod - def getAllObservationKeys(ert): - """ - @type ert: EnKFMain - @rtype: list of str - """ - key_manager = KeyManager(ert) - return key_manager.summaryKeysWithObservations() - - @staticmethod - def loadObservationData(ert, case_name, keys=None): - """ - @type ert: EnKFMain - @type case_name: str - @type keys: list of str - @rtype: DataFrame - """ - fs = ert.getEnkfFsManager().getFileSystem(case_name) - - time_map = fs.getTimeMap() - dates = [time_map[index].datetime() for index in range(1, len(time_map))] - - summary_keys = SummaryObservationCollector.getAllObservationKeys(ert) - if keys is not None: - summary_keys = [key for key in keys if key in summary_keys] # ignore keys that doesn't exist - - columns = summary_keys - std_columns = ["STD_%s" % key for key in summary_keys] - - df = DataFrame(index=dates, columns=columns + std_columns) - - for key in summary_keys: - observation_keys = ert.ensembleConfig().getNode(key).getObservationKeys() - - for obs_key in observation_keys: - observations = ert.getObservations() - observation_data = observations[obs_key] - history_length = ert.getHistoryLength() - - for index in range(0, history_length): - if observation_data.isActive(index): - obs_time = observations.getObservationTime(index).datetime() - node = observation_data.getNode(index) - value = node.getValue() - std = node.getStandardDeviation() - - df[key][obs_time] = value - df["STD_%s" % key][obs_time] = std - - - return df - - @classmethod - def summaryKeyHasObservations(cls, ert, key): - return len(ert.ensembleConfig().getNode(key).getObservationKeys()) > 0 diff --git a/ThirdParty/Ert/python/python/ert/enkf/forward_load_context.py b/ThirdParty/Ert/python/python/ert/enkf/forward_load_context.py deleted file mode 100644 index 8c2f4d7335..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/forward_load_context.py +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (C) 2016 Statoil ASA, Norway. -# -# The file 'forward_load_context.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from ert.enkf import EnkfPrototype -from cwrap import BaseCClass - - -# The Python wrapping of the forward_load_context is extremely -# minimal; when creating the Python implementation the only purpose -# was to get an existing test through. - - -class ForwardLoadContext(BaseCClass): - TYPE_NAME = "forward_load_context" - _alloc = EnkfPrototype("void* forward_load_context_alloc( run_arg , bool , ecl_config , char* , stringlist )" , bind = False) - _select_step = EnkfPrototype("void forward_load_context_select_step( forward_load_context , int )") - _get_step = EnkfPrototype("int forward_load_context_get_load_step( forward_load_context)") - _free = EnkfPrototype("void forward_load_context_free( forward_load_context)") - - - def __init__(self , run_arg = None , load_summary = False , ecl_config = None , ecl_base = None , messages = None , report_step = None): - c_ptr = self._alloc(run_arg , load_summary , ecl_config , ecl_base , messages) - super(ForwardLoadContext, self).__init__(c_ptr) - if not report_step is None: - self.selectStep( report_step ) - - - def getLoadStep( self ): - return self._get_step( ) - - - def selectStep(self , report_step): - self._select_step( report_step) - - - def free(self): - self._free( ) - diff --git a/ThirdParty/Ert/python/python/ert/enkf/hook_manager.py b/ThirdParty/Ert/python/python/ert/enkf/hook_manager.py deleted file mode 100644 index 482aa3d71d..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/hook_manager.py +++ /dev/null @@ -1,54 +0,0 @@ -import os -import sys -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype - -class HookManager(BaseCClass): - TYPE_NAME = "hook_manager" - - _get_runpath_list_file = EnkfPrototype("char* hook_manager_get_runpath_list_file(hook_manager)") - _get_runpath_list = EnkfPrototype("runpath_list_ref hook_manager_get_runpath_list(hook_manager)") - _iget_hook_workflow = EnkfPrototype("hook_workflow_ref hook_manager_iget_hook_workflow(hook_manager, int)") - _size = EnkfPrototype("int hook_manager_get_size(hook_manager)") - - def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") - - def __len__(self): - """ @rtype: int """ - return self._size() - - def __repr__(self): - return 'HookManager(size = %d) %s' % (len(self), self._ad_str()) - - def __getitem__(self, index): - """ @rtype: Hook workflow """ - assert isinstance(index, int) - if index < 0: - index += len(self) - if 0 <= index < len(self): - return self._iget_hook_workflow(index) - else: - raise IndexError("Invalid index. Valid range: [0, %d)." % len(self)) - - def checkRunpathListFile(self): - """ @rtype: bool """ - runpath_list_file = self._get_runpath_list_file() - - if not os.path.exists(runpath_list_file): - sys.stderr.write("** Warning: the file: %s with a list of runpath directories was not found - hook workflow will probably fail.\n" % runpath_list_file) - - def getRunpathList(self): - """ @rtype: RunpathList """ - return self._get_runpath_list() - - def runWorkflows(self , run_time , ert_self): - - workflow_list = ert_self.getWorkflowList() - for hook_workflow in self: - - if (hook_workflow.getRunMode() is not run_time): - continue - - workflow = hook_workflow.getWorkflow() - workflow.run(ert_self, context=workflow_list.getContext()) diff --git a/ThirdParty/Ert/python/python/ert/enkf/hook_workflow.py b/ThirdParty/Ert/python/python/ert/enkf/hook_workflow.py deleted file mode 100644 index c17ffebfc6..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/hook_workflow.py +++ /dev/null @@ -1,20 +0,0 @@ -import os -import sys -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype, RunpathList - -class HookWorkflow(BaseCClass): - TYPE_NAME = "hook_workflow" - - _get_workflow = EnkfPrototype("workflow_ref hook_workflow_get_workflow(hook_workflow)") - _get_runmode = EnkfPrototype("hook_runtime_enum hook_workflow_get_run_mode(hook_workflow)") - - def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") - - def getWorkflow(self): - """ @rtype: Workflow """ - return self._get_workflow() - - def getRunMode(self): - return self._get_runmode() diff --git a/ThirdParty/Ert/python/python/ert/enkf/key_manager.py b/ThirdParty/Ert/python/python/ert/enkf/key_manager.py deleted file mode 100644 index e86c65c5b2..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/key_manager.py +++ /dev/null @@ -1,172 +0,0 @@ -from ert.enkf import ErtImplType, GenKwConfig, CustomKWConfig - - -class KeyManager(object): - - def __init__(self, ert): - super(KeyManager, self).__init__() - """ - @type ert: ert.enkf.EnKFMain - """ - self.__ert = ert - - self.__all_keys = None - self.__all_keys_with_observations = None - self.__summary_keys = None - self.__summary_keys_with_observations = None - self.__gen_data_keys = None - self.__gen_data_keys_with_observations = None - self.__gen_kw_keys = None - self.__custom_kw_keys = None - self.__misfit_keys = None - - - def ert(self): - """ :rtype: ert.enkf.EnKFMain """ - return self.__ert - - def ensembleConfig(self): - """ :rtype: ert.enkf.EnsembleConfig """ - return self.ert().ensembleConfig() - - def summaryKeys(self): - """ :rtype: list of str """ - if self.__summary_keys is None: - self.__summary_keys = sorted([key for key in self.ensembleConfig().getKeylistFromImplType(ErtImplType.SUMMARY)], key=lambda k : k.lower()) - - return self.__summary_keys - - def summaryKeysWithObservations(self): - """ :rtype: list of str """ - if self.__summary_keys_with_observations is None: - self.__summary_keys_with_observations = sorted([key for key in self.summaryKeys() if len(self.ensembleConfig().getNode(key).getObservationKeys()) > 0], key=lambda k : k.lower()) - - return self.__summary_keys_with_observations - - def genKwKeys(self): - """ :rtype: list of str """ - if self.__gen_kw_keys is None: - gen_kw_keys = self.ert().ensembleConfig().getKeylistFromImplType(ErtImplType.GEN_KW) - gen_kw_keys = [key for key in gen_kw_keys] - - gen_kw_list = [] - for key in gen_kw_keys: - enkf_config_node = self.ert().ensembleConfig().getNode(key) - gen_kw_config = enkf_config_node.getModelConfig() - assert isinstance(gen_kw_config, GenKwConfig) - - for keyword_index, keyword in enumerate(gen_kw_config): - gen_kw_list.append("%s:%s" % (key, keyword)) - - if gen_kw_config.shouldUseLogScale(keyword_index): - gen_kw_list.append("LOG10_%s:%s" % (key, keyword)) - - self.__gen_kw_keys = sorted(gen_kw_list, key=lambda k : k.lower()) - - return self.__gen_kw_keys - - - def customKwKeys(self): - """ :rtype: list of str """ - if self.__custom_kw_keys is None: - custom_kw_keys = self.ert().ensembleConfig().getKeylistFromImplType(ErtImplType.CUSTOM_KW) - - keys = [] - for name in custom_kw_keys: - enkf_config_node = self.ert().ensembleConfig().getNode(name) - custom_kw_config = enkf_config_node.getModelConfig() - assert isinstance(custom_kw_config, CustomKWConfig) - - for key in custom_kw_config: - keys.append("%s:%s" % (name, key)) - - self.__custom_kw_keys = sorted([key for key in keys], key=lambda k : k.lower()) - - return self.__custom_kw_keys - - - def genDataKeys(self): - """ :rtype: list of str """ - if self.__gen_data_keys is None: - gen_data_keys = self.ert().ensembleConfig().getKeylistFromImplType(ErtImplType.GEN_DATA) - gen_data_list = [] - for key in gen_data_keys: - enkf_config_node = self.ert().ensembleConfig().getNode(key) - gen_data_config = enkf_config_node.getDataModelConfig() - - for report_step in gen_data_config.getReportSteps(): - gen_data_list.append("%s@%d" % (key, report_step)) - - self.__gen_data_keys = sorted(gen_data_list, key=lambda k : k.lower()) - - return self.__gen_data_keys - - def genDataKeysWithObservations(self): - """ :rtype: list of str """ - if self.__gen_data_keys_with_observations is None: - enkf_obs = self.ert().getObservations() - gen_data_obs_keys = [] - for obs_vector in enkf_obs: - report_step = obs_vector.activeStep() - key = obs_vector.getDataKey() - - gen_data_key = "%s@%d" % (key, report_step) - if gen_data_key in self.genDataKeys(): - gen_data_obs_keys.append(gen_data_key) - - self.__gen_data_keys_with_observations = gen_data_obs_keys - - return self.__gen_data_keys_with_observations - - def misfitKeys(self, sort_keys=True): - """ @rtype: list of str """ - if self.__misfit_keys is None: - keys = [] - for obs_vector in self.ert().getObservations(): - key = "MISFIT:%s" % obs_vector.getObservationKey() - keys.append(key) - - keys.append("MISFIT:TOTAL") - - self.__misfit_keys = sorted(keys, key=lambda k : k.lower()) if sort_keys else keys - - return self.__misfit_keys - - - def allDataTypeKeys(self): - """ :rtype: list of str """ - if self.__all_keys is None: - self.__all_keys = self.summaryKeys() + self.genKwKeys() + self.customKwKeys() + self.genDataKeys() - - return self.__all_keys - - def allDataTypeKeysWithObservations(self): - """ :rtype: list of str """ - if self.__all_keys_with_observations is None: - self.__all_keys_with_observations = self.summaryKeysWithObservations() + self.genDataKeysWithObservations() - - return self.__all_keys_with_observations - - def isKeyWithObservations(self, key): - """ :rtype: bool """ - return key in self.allDataTypeKeysWithObservations() - - def isSummaryKey(self, key): - """ :rtype: bool """ - return key in self.summaryKeys() - - def isGenKwKey(self, key): - """ :rtype: bool """ - return key in self.genKwKeys() - - def isCustomKwKey(self, key): - """ :rtype: bool """ - return key in self.customKwKeys() - - def isGenDataKey(self, key): - """ :rtype: bool """ - return key in self.genDataKeys() - - def isMisfitKey(self, key): - """ :rtype: bool """ - return key in self.misfitKeys() \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert/enkf/local_config.py b/ThirdParty/Ert/python/python/ert/enkf/local_config.py deleted file mode 100644 index 4324392f0c..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/local_config.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'local_config.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.enkf import LocalUpdateStep -from ert.enkf.local_ministep import LocalMinistep -from ert.analysis import AnalysisModule - - -class LocalConfig(BaseCClass): - TYPE_NAME = "local_config" - - _free = EnkfPrototype("void local_config_free( local_config )") - _clear = EnkfPrototype("void local_config_clear( local_config )") - _get_updatestep = EnkfPrototype("local_updatestep_ref local_config_get_updatestep( local_config )") - _get_ministep = EnkfPrototype("local_ministep_ref local_config_get_ministep( local_config, char*)") - _create_ministep = EnkfPrototype("void local_config_alloc_ministep( local_config, char*, analysis_module)") - _attach_ministep = EnkfPrototype("void local_updatestep_add_ministep( local_updatestep, local_ministep)", bind = False) - _get_obsdata = EnkfPrototype("local_obsdata_ref local_config_get_obsdata( local_config, char*)") - _create_obsdata = EnkfPrototype("void local_config_alloc_obsdata( local_config, char*)") - _copy_obsdata = EnkfPrototype("local_obsdata_ref local_config_alloc_obsdata_copy( local_config, char*, char*)") - _has_obsdata = EnkfPrototype("bool local_config_has_obsdata( local_config, char*)") - _get_dataset = EnkfPrototype("local_dataset_ref local_config_get_dataset( local_config, char*)") - _create_dataset = EnkfPrototype("void local_config_alloc_dataset( local_config, char*)") - _copy_dataset = EnkfPrototype("local_dataset_ref local_config_alloc_dataset_copy( local_config, char*, char*)") - _has_dataset = EnkfPrototype("bool local_config_has_dataset( local_config, char*)") - _write_local_config_summary_file = EnkfPrototype("void local_config_summary_fprintf( local_config, char*)") - - - def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") - - - # The LocalConfig class is created as a reference to an existing - # underlying C structure by the method - # EnkFMain.local_config(). When the pointer to the C - # local_config_type object has been properly wrapped we 'decorate' - # the Python object with references to the ensemble_config , - # observations and grid. - # - # This implies that the Python object LocalConfig is richer than - # the underlying C object local_config_type; the extra attributes - # are only used for validation. - - def initAttributes(self , ensemble_config , obs , grid): - self.ensemble_config = ensemble_config - self.obs = obs - self.grid = grid - - - def __getObservations(self): - return self.obs - - def __getEnsembleConfig(self): - return self.ensemble_config - - def getGrid(self): - # The grid can be None - return self.grid - - def free(self): - self._free() - - def clear(self): - self._clear() - - def createMinistep(self, mini_step_key, analysis_module = None): - """ @rtype: Ministep """ - assert isinstance(mini_step_key, str) - if analysis_module: - assert isinstance(analysis_module, AnalysisModule) - self._create_ministep(mini_step_key, analysis_module) - return self.getMinistep(mini_step_key) - - def createObsdata(self, obsdata_key): - """ @rtype: Obsdata """ - assert isinstance(obsdata_key, str) - if self._has_obsdata(obsdata_key): - raise ValueError("Tried to add existing observation key:%s " % obsdata_key) - - self._create_obsdata(obsdata_key) - obsdata = self.getObsdata(obsdata_key) - obsdata.initObservations( self.__getObservations() ) - return obsdata - - - def copyObsdata(self, src_key, target_key): - """ @rtype: Obsdata """ - assert isinstance(src_key, str) - assert isinstance(target_key, str) - obsdata = self._copy_obsdata(src_key, target_key) - obsdata.initObservations( self.__getObservations() ) - return obsdata - - - def createDataset(self, dataset_key): - """ @rtype: Dataset """ - assert isinstance(dataset_key, str) - if self._has_dataset(dataset_key): - raise ValueError("Tried to add existing data key:%s " % dataset_key) - - self._create_dataset(dataset_key) - data = self.getDataset(dataset_key) - data.initEnsembleConfig( self.__getEnsembleConfig() ) - return data - - - def copyDataset(self, src_key, target_key): - """ @rtype: Dataset """ - assert isinstance(src_key, str) - assert isinstance(target_key, str) - data = self._copy_dataset(src_key, target_key) - data.initEnsembleConfig( self.__getEnsembleConfig() ) - return data - - - def getUpdatestep(self): - """ @rtype: UpdateStep """ - return self._get_updatestep() - - - def getMinistep(self, mini_step_key): - """ @rtype: Ministep """ - assert isinstance(mini_step_key, str) - return self._get_ministep(mini_step_key) - - def getObsdata(self, obsdata_key): - """ @rtype: Obsdata """ - assert isinstance(obsdata_key, str) - return self._get_obsdata(obsdata_key) - - def getDataset(self, dataset_key): - """ @rtype: Dataset """ - assert isinstance(dataset_key, str) - return self._get_dataset(dataset_key) - - - def attachMinistep(self, update_step, mini_step): - assert isinstance(mini_step, LocalMinistep) - assert isinstance(update_step, LocalUpdateStep) - self._attach_ministep(update_step, mini_step) - - - def writeSummaryFile(self, filename): - """ - Writes a summary of the local config object - The summary contains the Obsset with their respective - number of observations and the Datasets with the number of active indices - """ - assert isinstance(filename, str) - self._write_local_config_summary_file(filename) diff --git a/ThirdParty/Ert/python/python/ert/enkf/local_dataset.py b/ThirdParty/Ert/python/python/ert/enkf/local_dataset.py deleted file mode 100644 index a1b5e2af28..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/local_dataset.py +++ /dev/null @@ -1,88 +0,0 @@ -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.ecl import EclRegion - -class LocalDataset(BaseCClass): - TYPE_NAME = "local_dataset" - - _alloc = EnkfPrototype("void* local_dataset_alloc(char*)", bind = False) - _size = EnkfPrototype("void* local_dataset_get_size(local_dataset)") - _has_key = EnkfPrototype("bool local_dataset_has_key(local_dataset, char*)") - _free = EnkfPrototype("void local_dataset_free(local_dataset)") - _name = EnkfPrototype("char* local_dataset_get_name(local_dataset)") - _add_node = EnkfPrototype("void local_dataset_add_node(local_dataset, char*)") - _del_node = EnkfPrototype("void local_dataset_del_node(local_dataset, char*)") - _active_list = EnkfPrototype("active_list_ref local_dataset_get_node_active_list(local_dataset, char*)") - - def __init__(self, name): - raise NotImplementedError("Class can not be instantiated directly!") - - - def initEnsembleConfig(self , config): - self.ensemble_config = config - - - def __len__(self): - """ @rtype: int """ - return self._size() - - def __contains__(self , key): - """ @rtype: bool """ - return self._has_key(key) - - def __delitem__(self, key): - assert isinstance(key, str) - if key in self: - self._del_node(key) - else: - raise KeyError('Unknown key "%s"' % key) - - def name(self): - return self._name() - def getName(self): - """ deprecated. @rtype: str """ - return self.name() - - def addNode(self, key): - assert isinstance(key, str) - if key in self.ensemble_config: - if not self._has_key(key): - self._add_node(key) - else: - raise KeyError('Tried to add existing data key "%s".' % key) - else: - raise KeyError('Tried to add data key "%s" not in ensemble.' % key) - - - def addNodeWithIndex(self, key, index): - assert isinstance(key, str) - assert isinstance(index, int) - - self.addNode( key ) - active_list = self.getActiveList(key) - active_list.addActiveIndex(index) - - - def addField(self, key, ecl_region): - assert isinstance(key, str) - assert isinstance(ecl_region, EclRegion) - - self.addNode( key ) - active_list = self.getActiveList(key) - active_region = ecl_region.getActiveList() - for i in active_region: - active_list.addActiveIndex(i) - - - def getActiveList(self, key): - """ @rtype: ActiveList """ - if key in self: - return self._active_list(key) - else: - raise KeyError('Local key "%s" not recognized.' % key) - - def free(self): - self._free() - - def __repr__(self): - return 'LocalDataset(name = %s, len = %d) at 0x%x' % (self.name(), len(self), self._address()) diff --git a/ThirdParty/Ert/python/python/ert/enkf/local_ministep.py b/ThirdParty/Ert/python/python/ert/enkf/local_ministep.py deleted file mode 100644 index 39cd2352af..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/local_ministep.py +++ /dev/null @@ -1,64 +0,0 @@ -import ert.util -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype, LocalObsdata, LocalObsdataNode, LocalDataset - -class LocalMinistep(BaseCClass): - TYPE_NAME = "local_ministep" - - _alloc = EnkfPrototype("void* local_ministep_alloc(char*)", bind = False) - _add_node = EnkfPrototype("void local_ministep_add_obsdata_node(local_ministep, local_obsdata_node)") - _get_local_obs_data = EnkfPrototype("local_obsdata_ref local_ministep_get_obsdata(local_ministep)") - _get_local_data = EnkfPrototype("local_dataset_ref local_ministep_get_dataset(local_ministep , char*)") - _has_local_data = EnkfPrototype("bool local_ministep_has_dataset(local_ministep , char*)") - _free = EnkfPrototype("void local_ministep_free(local_ministep)") - _attach_obsdata = EnkfPrototype("void local_ministep_add_obsdata(local_ministep, local_obsdata)") - _attach_dataset = EnkfPrototype("void local_ministep_add_dataset(local_ministep, local_dataset)") - _name = EnkfPrototype("char* local_ministep_get_name(local_ministep)") - _data_size = EnkfPrototype("int local_ministep_get_num_dataset(local_ministep)") - - def __init__(self, ministep_key): - raise NotImplementedError("Class can not be instantiated directly!") - - # Will used the data keys; and ignore observation keys. - def __getitem__(self, data_key): - if isinstance(data_key, int): - raise TypeError('Keys must be strings, not int!') - if data_key in self: - return self._get_local_data(data_key) - else: - raise KeyError('No such data key: "%s"' % data_key) - - def __len__(self): - return self._data_size() - - def __contains__(self , data_key): - return self._has_local_data(data_key) - - def addNode(self, node): - assert isinstance(node, LocalObsdataNode) - self._add_node(node) - - def attachObsset(self, obs_set): - assert isinstance(obs_set, LocalObsdata) - self._attach_obsdata(obs_set) - - - def attachDataset(self, dataset): - assert isinstance(dataset, LocalDataset) - self._attach_dataset(dataset) - - def getLocalObsData(self): - """ @rtype: LocalObsdata """ - return self._get_local_obs_data() - - def name(self): - return self._name() - def getName(self): - """ deprecated. @rtype: str """ - return self.name() - - def free(self): - self._free() - - def __repr__(self): - return 'LocalMinistep(name = %s, len = %d) at 0x%x' % (self.name(), len(self), self._address()) diff --git a/ThirdParty/Ert/python/python/ert/enkf/local_obsdata.py b/ThirdParty/Ert/python/python/ert/enkf/local_obsdata.py deleted file mode 100644 index df9f8456c9..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/local_obsdata.py +++ /dev/null @@ -1,148 +0,0 @@ -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype, LocalObsdataNode - - -class LocalObsdata(BaseCClass): - TYPE_NAME = "local_obsdata" - - _alloc = EnkfPrototype("void* local_obsdata_alloc(char*)", bind = False) - _free = EnkfPrototype("void local_obsdata_free(local_obsdata)") - _size = EnkfPrototype("int local_obsdata_get_size(local_obsdata)") - _has_node = EnkfPrototype("bool local_obsdata_has_node(local_obsdata, char*)") - _add_node = EnkfPrototype("bool local_obsdata_add_node(local_obsdata, local_obsdata_node)") - _del_node = EnkfPrototype("void local_obsdata_del_node(local_obsdata, char*)") - _clear = EnkfPrototype("void local_dataset_clear(local_obsdata)") - _name = EnkfPrototype("char* local_obsdata_get_name(local_obsdata)") - _iget_node = EnkfPrototype("local_obsdata_node_ref local_obsdata_iget(local_obsdata, int)") - _get_node = EnkfPrototype("local_obsdata_node_ref local_obsdata_get(local_obsdata, char*)") - _active_list = EnkfPrototype("active_list_ref local_obsdata_get_node_active_list(local_obsdata, char*)") - - def __init__(self, name , obs = None): - # The obs instance should be a EnkFObs instance; some circular dependency problems - # by importing it right away. It is not really optional, but it is made optional - # here to be able to give a decent error message for old call sites which did not - # supply the obs argument. - if obs is None: - msg = """ - -The LocalObsdata constructor has recently changed, as a second -argument you should pass the EnkFObs instance with all the -observations. You can typically get this instance from the ert main -object as: - - obs = ert.getObservations() - local_obs = LocalObsData("YOUR-KEY" , obs) - -""" - raise Exception( msg ) - - assert isinstance(name, str) - - c_ptr = self._alloc(name) - if c_ptr: - super(LocalObsdata, self).__init__(c_ptr) - self.initObservations( obs ) - else: - raise ValueError('Unable to construct LocalObsdata with name "%s" from given obs.' % name) - - - def initObservations(self , obs): - self.obs = obs - - def __len__(self): - """ @rtype: int """ - return self._size() - - - def __getitem__(self, key): - """ @rtype: LocalObsdataNode """ - if isinstance(key , int): - if key < 0: - key += len(self) - if 0 <= key < len(self): - node_ = self._iget_node(key) - node_.setParent(self) - return node_ - else: - raise IndexError('Invalid index, valid range is [0, %d)' % len(self)) - else: - if key in self: - node_ = self._get_node(key) - node_.setParent(self) - return node_ - else: - raise KeyError('Unknown key "%s".' % key) - - def __iter__(self): - cur = 0 - while cur < len(self): - yield self[cur] - cur += 1 - - def __contains__(self, item): - """ @rtype: bool """ - if isinstance(item, str): - return self._has_node(item) - elif isinstance(item, LocalObsdataNode): - return self._has_node(item.getKey()) - - return False - - def __delitem__(self, key): - assert isinstance(key, str) - if key in self: - self._del_node(key) - else: - raise KeyError('Unknown key "%s".' % key) - - def addNode(self, key, add_all_timesteps = True): - """ @rtype: LocalObsdataNode """ - assert isinstance(key, str) - if key in self.obs: - node = LocalObsdataNode(key , add_all_timesteps) - if node not in self: - node.convertToCReference(self) - self._add_node(node) - return node - else: - raise KeyError("Tried to add existing observation key:%s " % key) - else: - raise KeyError("The observation node: %s is not recognized observation key" % key) - - - def addNodeAndRange(self, key, step_1, step_2): - """ @rtype: LocalObsdataNode """ - """ The time range will be removed in the future... """ - assert isinstance(key, str) - assert isinstance(step_1, int) - assert isinstance(step_2, int) - node = self.addNode( key ) - node.addRange(step_1, step_2) - return node - - - def clear(self): - self._clear() - - - def addObsVector(self , obs_vector): - self.addNode( obs_vector.getObservationKey() ) - - def name(self): - return self._name() - def getName(self): - """ deprecated. @rtype: str """ - return self.name() - - def getActiveList(self, key): - """ @rtype: ActiveList """ - if key in self: - return self._active_list(key) - else: - raise KeyError('Local key "%s" not recognized.' % key) - - def free(self): - self._free() - - def __repr__(self): - return 'LocalObsdata(len = %d, name = %s) at 0x%x' % (len(self), self.name(), self._address()) diff --git a/ThirdParty/Ert/python/python/ert/enkf/local_obsdata_node.py b/ThirdParty/Ert/python/python/ert/enkf/local_obsdata_node.py deleted file mode 100644 index c3b47f384b..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/local_obsdata_node.py +++ /dev/null @@ -1,59 +0,0 @@ -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype - -class LocalObsdataNode(BaseCClass): - TYPE_NAME = "local_obsdata_node" - - _alloc = EnkfPrototype("void* local_obsdata_node_alloc(char* , bool)", bind = False) - _free = EnkfPrototype("void local_obsdata_node_free(local_obsdata_node)") - _get_key = EnkfPrototype("char* local_obsdata_node_get_key(local_obsdata_node)") - _add_range = EnkfPrototype("void local_obsdata_node_add_range(local_obsdata_node, int, int)") - _add_step = EnkfPrototype("void local_obsdata_node_add_tstep(local_obsdata_node, int)") - _tstep_active = EnkfPrototype("bool local_obsdata_node_tstep_active(local_obsdata_node, int)") - _all_timestep_active = EnkfPrototype("bool local_obsdata_node_all_timestep_active(local_obsdata_node)") - _set_all_timestep_active = EnkfPrototype("void local_obsdata_node_set_all_timestep_active(local_obsdata_node, bool)") - _get_active_list = EnkfPrototype("active_list_ref local_obsdata_node_get_active_list(local_obsdata_node)") - - def __init__(self, obs_key , all_timestep_active = True): - if isinstance(obs_key, str): - c_ptr = self._alloc(obs_key , all_timestep_active) - if c_ptr: - super(LocalObsdataNode, self).__init__(c_ptr) - else: - raise ArgumentError('Unable to construct LocalObsdataNode with key = "%s".' % obs_key) - else: - raise TypeError('LocalObsdataNode needs string, not %s.' % str(type(obs_key))) - - def key(self): - return self._get_key() - def getKey(self): - return self.key() - - def addRange(self, step_1, step_2): - assert isinstance(step_1, int) - assert isinstance(step_2, int) - self._add_range(step_1, step_2) - - - def addTimeStep(self , step): - self._add_step( step ) - - - def free(self): - self._free() - - def __repr__(self): - return 'LocalObsdataNode(key = %s) %s' % (self.key(), self._ad_str()) - - def tstepActive(self , tstep): - return self._tstep_active(tstep) - - - def getActiveList(self): - return self._get_active_list() - - def allTimeStepActive(self): - return self._all_timestep_active() - - def setAllTimeStepActive(self, flag): - return self._set_all_timestep_active( flag ) diff --git a/ThirdParty/Ert/python/python/ert/enkf/local_updatestep.py b/ThirdParty/Ert/python/python/ert/enkf/local_updatestep.py deleted file mode 100644 index 5552533d05..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/local_updatestep.py +++ /dev/null @@ -1,43 +0,0 @@ -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype, LocalMinistep - -class LocalUpdateStep(BaseCClass): - TYPE_NAME = "local_updatestep" - - _alloc = EnkfPrototype("void local_updatestep_alloc(char*)", bind = False) - _size = EnkfPrototype("int local_updatestep_get_num_ministep(local_updatestep)") - _iget_ministep = EnkfPrototype("local_ministep_ref local_updatestep_iget_ministep(local_updatestep, int)") - _free = EnkfPrototype("void local_updatestep_free(local_updatestep)") - _attach_ministep = EnkfPrototype("void local_updatestep_add_ministep(local_updatestep, local_ministep)") - _name = EnkfPrototype("char* local_updatestep_get_name(local_updatestep)") - - def __init__(self, updatestep_key): - raise NotImplementedError("Class can not be instantiated directly!") - - def __len__(self): - """ @rtype: int """ - return self._size() - - def __getitem__(self, index): - """ @rtype: LocalMinistep """ - if not isinstance(index, int): - raise TypeError('Keys must be ints, not %s' % str(type(index))) - if index < 0: - index += len(self) - if 0 <= index < len(self): - return self._iget_ministep(index) - else: - raise IndexError('Invalid index, valid range: [0, %d)' % len(self)) - - def attachMinistep(self, ministep): - assert isinstance(ministep, LocalMinistep) - self._attach_ministep(ministep) - - def name(self): - return self._name() - def getName(self): - """ deprecated. @rtype: str """ - return self.name() - - def free(self): - self._free(self) diff --git a/ThirdParty/Ert/python/python/ert/enkf/meas_block.py b/ThirdParty/Ert/python/python/ert/enkf/meas_block.py deleted file mode 100644 index da4d6ec125..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/meas_block.py +++ /dev/null @@ -1,98 +0,0 @@ -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.enkf.obs_data import ObsData -from ert.util import Matrix, IntVector , BoolVector - - -class MeasBlock(BaseCClass): - TYPE_NAME = "meas_block" - - _alloc = EnkfPrototype("void* meas_block_alloc( char* , bool_vector , int)", bind = False) - _free = EnkfPrototype("void meas_block_free( meas_block )") - _get_active_ens_size = EnkfPrototype("int meas_block_get_active_ens_size( meas_block )") - _get_total_ens_size = EnkfPrototype("int meas_block_get_total_ens_size( meas_block )") - _get_total_obs_size = EnkfPrototype("int meas_block_get_total_obs_size( meas_block )") - _iget_value = EnkfPrototype("double meas_block_iget( meas_block , int , int)") - _iset_value = EnkfPrototype("void meas_block_iset( meas_block , int , int , double)") - _iget_mean = EnkfPrototype("double meas_block_iget_ens_mean( meas_block , int )") - _iget_std = EnkfPrototype("double meas_block_iget_ens_std( meas_block , int )") - _iens_active = EnkfPrototype("bool meas_block_iens_active( meas_block , int )") - - def __init__(self , obs_key , obs_size , ens_mask): - assert(isinstance(ens_mask , BoolVector)) - c_ptr = self._alloc( obs_key , ens_mask , obs_size ) - if c_ptr: - super(MeasBlock , self).__init__(c_ptr) - else: - raise ValueError('Unable to construct MeasBlock.') - - def __str__(self): - s = "" - for iobs in range(self.getObsSize()): - s += "[" - for iens in range(self.getTotalEnsSize()): - if self.iensActive(iens): - s += "%6.3g " % self[iobs,iens] - else: - s += " X " - - s += "]\n" - return s - - def getObsSize(self): - return self._get_total_obs_size() - - - def getActiveEnsSize(self): - return self._get_active_ens_size() - - - def getTotalEnsSize(self): - return self._get_total_ens_size() - - - def __assert_index(self , index): - if isinstance(index , tuple): - iobs,iens = index - if not 0 <= iobs < self.getObsSize(): - raise IndexError("Invalid iobs value:%d Valid range: [0,%d)" % (iobs , self.getObsSize())) - - if not 0 <= iens < self.getTotalEnsSize(): - raise IndexError("Invalid iens value:%d Valid range: [0,%d)" % (iobs , self.getTotalEnsSize())) - - if not self.iensActive( iens ): - raise ValueError("Ensemble member:%d is not active - can not be accessed in the MeasBlock()" % iens) - - return iobs,iens - else: - raise TypeError("The index argument must be 2-tuple") - - - def __setitem__(self, index, value): - iobs , iens = self.__assert_index(index) - self._iset_value( iens , iobs , value ) - - - def __getitem__(self, index): - iobs,iens = self.__assert_index(index) - return self._iget_value( iens , iobs ) - - def iensActive(self , iens): - return self._iens_active( iens ) - - - def free(self): - self._free() - - - def igetMean(self , iobs): - if 0 <= iobs < self.getObsSize(): - return self._iget_mean(iobs) - else: - raise IndexError("Invalid observation index:%d valid range: [0,%d)" % (iobs , self.getObsSize())) - - def igetStd(self , iobs): - if 0 <= iobs < self.getObsSize(): - return self._iget_std(iobs) - else: - raise IndexError("Invalid observation index:%d valid range: [0,%d)" % (iobs , self.getObsSize())) diff --git a/ThirdParty/Ert/python/python/ert/enkf/meas_data.py b/ThirdParty/Ert/python/python/ert/enkf/meas_data.py deleted file mode 100644 index 14ca5ebf10..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/meas_data.py +++ /dev/null @@ -1,99 +0,0 @@ -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.enkf.obs_data import ObsData -from ert.util import Matrix, IntVector - - -class MeasData(BaseCClass): - TYPE_NAME = "meas_data" - - _alloc = EnkfPrototype("void* meas_data_alloc(bool_vector)", bind = False) - _free = EnkfPrototype("void meas_data_free(meas_data)") - _get_active_obs_size = EnkfPrototype("int meas_data_get_active_obs_size(meas_data)") - _get_active_ens_size = EnkfPrototype("int meas_data_get_active_ens_size( meas_data )") - _get_total_ens_size = EnkfPrototype("int meas_data_get_total_ens_size( meas_data )") - _get_num_blocks = EnkfPrototype("int meas_data_get_num_blocks( meas_data )") - _has_block = EnkfPrototype("bool meas_data_has_block( meas_data , char* )") - _get_block = EnkfPrototype("meas_block_ref meas_data_get_block( meas_data , char*)") - _allocS = EnkfPrototype("matrix_obj meas_data_allocS(meas_data)") - _add_block = EnkfPrototype("meas_block_ref meas_data_add_block(meas_data, char* , int , int)") - _iget_block = EnkfPrototype("meas_block_ref meas_data_iget_block( meas_data , int)") - - _deactivate_outliers = EnkfPrototype("void enkf_analysis_deactivate_std_zero(obs_data, meas_data)", bind = False) - - def __init__(self, ens_mask): - c_ptr = self._alloc(ens_mask) - if c_ptr: - super(MeasData, self).__init__(c_ptr) - else: - raise ValueError('Unable to construct MeasData from given ensemble mask of type %s.' % str(type(ens_mask))) - - def __len__(self): - return self._get_num_blocks() - - - def __contains__(self , index): - if isinstance(index , str): - return self._has_block(index) - else: - raise TypeError('The in operator expects a string argument, got "%s".' % str(index)) - - - def __getitem__(self , index): - if isinstance(index , str): - if index in self: - return self._get_block(index) - else: - raise KeyError('The obs block "%s" is not recognized' % index) - elif isinstance(index,int): - if index < 0: - index += len(self) - - if 0 <= index < len(self): - return self._iget_block(index) - else: - raise IndexError("Index out of range, should have 0 <= %d < %d." % (index, len(self))) - else: - raise TypeError("The index variable must string or integer") - - - def __repr__(self): - fmt = 'MeasData(len = %d, total ens = %d, active obs = %d, active ens = %d) at 0x%x' - return fmt % (len(self), self.getTotalEnsSize(), - self.getActiveObsSize(), self.getActiveEnsSize(), self._address()) - - def __str__(self): - return '\n'.join([str(block) for block in self]) - - - def createS(self): - """ @rtype: Matrix """ - S = self._allocS() - if S is None: - raise ValueError("Failed to create S active size : [%d,%d]" % (self.getActiveEnsSize() , self.activeObsSize( ))) - return S - - - def deactivateZeroStdSamples(self, obs_data): - assert isinstance(obs_data, ObsData) - self._deactivate_outliers(obs_data, self) - - - def addBlock(self , obs_key , report_step , obs_size): - return self._add_block( obs_key , report_step , obs_size ) - - - def activeObsSize(self): - return self._get_active_obs_size() - - - def getActiveEnsSize(self): - return self._get_active_ens_size() - - - def getTotalEnsSize(self): - return self._get_total_ens_size() - - - def free(self): - self._free() diff --git a/ThirdParty/Ert/python/python/ert/enkf/model_config.py b/ThirdParty/Ert/python/python/ert/enkf/model_config.py deleted file mode 100644 index fc262a4ed9..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/model_config.py +++ /dev/null @@ -1,120 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'model_config.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass -from ert.ecl import EclSum -from ert.enkf import EnkfPrototype -from ert.sched import HistorySourceEnum, SchedFile -from ert.job_queue import ForwardModel -from ert.util import PathFormat - - -class ModelConfig(BaseCClass): - TYPE_NAME = "model_config" - - _free = EnkfPrototype("void model_config_free( model_config )") - _get_forward_model = EnkfPrototype("forward_model_ref model_config_get_forward_model(model_config)") - _get_max_internal_submit = EnkfPrototype("int model_config_get_max_internal_submit(model_config)") - _set_max_internal_submit = EnkfPrototype("void model_config_set_max_internal_submit(model_config, int)") - _get_case_table_file = EnkfPrototype("char* model_config_get_case_table_file(model_config)") - _get_runpath_as_char = EnkfPrototype("char* model_config_get_runpath_as_char(model_config)") - _select_runpath = EnkfPrototype("bool model_config_select_runpath(model_config, char*)") - _set_runpath = EnkfPrototype("void model_config_set_runpath(model_config, char*)") - _get_enspath = EnkfPrototype("char* model_config_get_enspath(model_config)") - _get_fs_type = EnkfPrototype("enkf_fs_type_enum model_config_get_dbase_type(model_config)") - _get_history = EnkfPrototype("history_ref model_config_get_history(model_config)") - _get_history_source = EnkfPrototype("history_source_enum model_config_get_history_source(model_config)") - _select_history = EnkfPrototype("bool model_config_select_history(model_config, history_source_enum, sched_file, ecl_sum)") - _has_history = EnkfPrototype("bool model_config_has_history(model_config)") - _gen_kw_export_file = EnkfPrototype("char* model_config_get_gen_kw_export_file(model_config)") - _runpath_requires_iterations = EnkfPrototype("bool model_config_runpath_requires_iter(model_config)") - _get_jobname_fmt = EnkfPrototype("char* model_config_get_jobname_fmt(model_config)") - _get_runpath_fmt = EnkfPrototype("path_fmt_ref model_config_get_runpath_fmt(model_config)") - - def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") - - - def hasHistory(self): - return self._has_history() - - def get_history_source(self): - """ @rtype: HistorySourceEnum """ - return self._get_history_source() - - def set_history_source(self, history_source, sched_file, refcase): - """ - @type history_source: HistorySourceEnum - @type sched_file: SchedFile - @type refcase: EclSum - @rtype: bool - """ - assert isinstance(history_source, HistorySourceEnum) - assert isinstance(sched_file, SchedFile) - assert isinstance(refcase, EclSum) - return self._select_history(history_source, sched_file, refcase) - - - def get_max_internal_submit(self): - """ @rtype: int """ - return self._get_max_internal_submit() - - def set_max_internal_submit(self, max_value): - self._get_max_internal_submit(max_value) - - def getForwardModel(self): - """ @rtype: ForwardModel """ - return self._get_forward_model().setParent(self) - - def get_case_table_file(self): - """ @rtype: str """ - return self._get_case_table_file() - - def getRunpathAsString(self): - """ @rtype: str """ - return self._get_runpath_as_char() - - def selectRunpath(self, path_key): - """ @rtype: bool """ - return self._select_runpath(path_key) - - def setRunpath(self, path_format): - self._set_runpath(path_format) - - def free(self): - self._free() - - def getFSType(self): - return self._get_fs_type() - - def getGenKWExportFile(self): - """ @rtype: str """ - return self._gen_kw_export_file() - - def runpathRequiresIterations(self): - """ @rtype: bool """ - return self._runpath_requires_iterations() - - def getJobnameFormat(self): - """ @rtype: str """ - return self._get_jobname_fmt() - - def getEnspath(self): - """ @rtype: str """ - return self._get_enspath() - - def getRunpathFormat(self): - """ @rtype: PathFormat """ - return self._get_runpath_fmt() diff --git a/ThirdParty/Ert/python/python/ert/enkf/node_id.py b/ThirdParty/Ert/python/python/ert/enkf/node_id.py deleted file mode 100644 index 66ed856cf9..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/node_id.py +++ /dev/null @@ -1,23 +0,0 @@ -from ctypes import Structure, c_int -from cwrap import Prototype - -class NodeId(Structure): - """ - NodeId is specified in enkf_types.h - """ - _fields_ = [("report_step", c_int), - ("iens", c_int)] - - def __init__(self, report_step, realization_number): - """ - @type report_step: int - @type realization_number: int - """ - super(NodeId, self).__init__(report_step, realization_number) - - def __repr__(self): - rs = self.report_step - ie = self.iens - return 'NodeId(report_step = %d, iens = %d)' % (rs, ie) - -Prototype.registerType( "node_id" , NodeId ) diff --git a/ThirdParty/Ert/python/python/ert/enkf/obs_block.py b/ThirdParty/Ert/python/python/ert/enkf/obs_block.py deleted file mode 100644 index aa8cc97887..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/obs_block.py +++ /dev/null @@ -1,65 +0,0 @@ -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.util import Matrix - - -class ObsBlock(BaseCClass): - TYPE_NAME = "obs_block" - - _alloc = EnkfPrototype("void* obs_block_alloc(char*, int, matrix, bool, double)", bind = False) - _free = EnkfPrototype("void obs_block_free(obs_block)") - _total_size = EnkfPrototype("int obs_block_get_size( obs_block )") - _active_size = EnkfPrototype("int obs_block_get_active_size( obs_block )") - _iset = EnkfPrototype("void obs_block_iset( obs_block , int , double , double)") - _iget_value = EnkfPrototype("double obs_block_iget_value( obs_block , int)") - _iget_std = EnkfPrototype("double obs_block_iget_std( obs_block , int)") - - def __init__(self , obs_key , obs_size , global_std_scaling=1.0): - error_covar = None - error_covar_owner = False - c_pointer = self._alloc(obs_key , obs_size , error_covar , error_covar_owner, global_std_scaling) - super(ObsBlock, self).__init__(c_pointer) - - - def totalSize(self): - return self._total_size() - - def activeSize(self): - return self.active() - def active(self): - return self._active_size() - def __len__(self): - """Returns the total size""" - return self.totalSize() - - def __setitem__(self , index , value): - if len(value) != 2: - raise TypeError("The value argument must be a two element tuple: (value , std)") - d, std = value - - if isinstance(index , int): - if index < 0: - index += len(self) - if 0 <= index < len(self): - self._iset(index, d, std) - else: - raise IndexError("Invalid index: %d. Valid range: [0,%d)" % (index , len(self))) - else: - raise TypeError("The index item must be integer, not %s." % str(type(index))) - - - def __getitem__(self , index): - if isinstance(index , int): - if index < 0: - index += len(self) - if 0 <= index < len(self): - value = self._iget_value(index) - std = self._iget_std(index) - return (value,std) - else: - raise IndexError("Invalid index:%d - valid range: [0,%d)" % (index , len(self))) - else: - raise TypeError("The index item must be integer, not %s." % str(type(index))) - - def free(self): - self._free() diff --git a/ThirdParty/Ert/python/python/ert/enkf/obs_data.py b/ThirdParty/Ert/python/python/ert/enkf/obs_data.py deleted file mode 100644 index e3a7693e58..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/obs_data.py +++ /dev/null @@ -1,93 +0,0 @@ -from types import NoneType -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.util import Matrix - - -class ObsData(BaseCClass): - TYPE_NAME = "obs_data" - - _alloc = EnkfPrototype("void* obs_data_alloc(double)", bind = False) - _free = EnkfPrototype("void obs_data_free(obs_data)") - _total_size = EnkfPrototype("int obs_data_get_total_size(obs_data)") - _scale = EnkfPrototype("void obs_data_scale(obs_data, matrix, matrix, matrix, matrix, matrix)") - _scale_matrix = EnkfPrototype("void obs_data_scale_matrix(obs_data, matrix)") - _scale_Rmatrix = EnkfPrototype("void obs_data_scale_Rmatrix(obs_data, matrix)") - _iget_value = EnkfPrototype("double obs_data_iget_value(obs_data, int)") - _iget_std = EnkfPrototype("double obs_data_iget_std(obs_data, int)") - _add_block = EnkfPrototype("obs_block_ref obs_data_add_block(obs_data , char* , int , matrix , bool)") - _allocdObs = EnkfPrototype("matrix_obj obs_data_allocdObs(obs_data)") - _allocR = EnkfPrototype("matrix_obj obs_data_allocR(obs_data)") - _allocD = EnkfPrototype("matrix_obj obs_data_allocD(obs_data , matrix , matrix)") - _allocE = EnkfPrototype("matrix_obj obs_data_allocE(obs_data , rng , int)") - - def __init__(self, global_std_scaling=1.0): - c_pointer = self._alloc(global_std_scaling) - super(ObsData, self).__init__(c_pointer) - - def __len__(self): - """ @rtype: int """ - return self._total_size() - - def __getitem__(self , index): - if index < 0: - index += len(self) - - if 0 <= index < len(self): - value = self._iget_value( index ) - std = self._iget_std( index ) - return (value,std) - - raise IndexError("Invalid index:%d valid range: [0,%d)" % (index , len(self))) - - - def __str__(self): - s = "" - for pair in self: - s += "(%g, %g)\n" % pair - return s - - def __repr__(self): - return 'ObsData(total_size = %d) at 0x%x' % (len(self), self._address()) - - def addBlock(self , obs_key , obs_size): - error_covar = None - error_covar_owner = False - return self._add_block(obs_key , obs_size , error_covar , error_covar_owner) - - - def createDObs(self): - """ @rtype: Matrix """ - return self._allocdObs() - - def createR(self): - """ @rtype: Matrix """ - return self._allocR() - - def createD(self , E , S): - """ @rtype: Matrix """ - return self._allocD(E , S) - - def createE( self , rng , active_ens_size): - """ @rtype: Matrix """ - return self._allocE(rng , active_ens_size) - - def scaleMatrix(self, m): - self._scale_matrix( m ) - - - def scaleRMatrix(self, R): - self._scale_Rmatrix( R ) - - - def scale(self, S, E=None, D=None, R=None, D_obs=None): - assert isinstance(S, Matrix) - assert isinstance(E, (Matrix, NoneType)) - assert isinstance(D, (Matrix, NoneType)) - assert isinstance(R, (Matrix, NoneType)) - assert isinstance(D_obs, (Matrix, NoneType)) - self._scale(S, E, D, R, D_obs) - - - def free(self): - self._free() diff --git a/ThirdParty/Ert/python/python/ert/enkf/observations/CMakeLists.txt b/ThirdParty/Ert/python/python/ert/enkf/observations/CMakeLists.txt deleted file mode 100644 index d93d1d65f6..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/observations/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - block_observation.py - block_data_config.py - gen_observation.py - obs_vector.py - summary_observation.py -) - -add_python_package("python.ert.enkf.observations" ${PYTHON_INSTALL_PREFIX}/ert/enkf/observations "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert/enkf/observations/__init__.py b/ThirdParty/Ert/python/python/ert/enkf/observations/__init__.py deleted file mode 100644 index 485088ff71..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/observations/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from .summary_observation import SummaryObservation -from .gen_observation import GenObservation -from .block_data_config import BlockDataConfig -from .block_observation import BlockObservation -from .obs_vector import ObsVector diff --git a/ThirdParty/Ert/python/python/ert/enkf/observations/block_data_config.py b/ThirdParty/Ert/python/python/ert/enkf/observations/block_data_config.py deleted file mode 100644 index fe29b02556..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/observations/block_data_config.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (C) 2016 Statoil ASA, Norway. -# -# This file is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass -from ert.enkf import NodeId, FieldConfig -from ert.enkf import EnkfPrototype -import ctypes - -class BlockDataConfig(BaseCClass): - TYPE_NAME = "block_data_config" - - def __init__(self): - raise NotImplementedError('Cannot instantiate BlockDataConfig!') - - @classmethod - def from_param(cls , instance): - if instance is None: - return ctypes.c_void_p() - elif isinstance(instance , FieldConfig): - return FieldConfig.from_param( instance ) - - # The Container class which is used to support summary based - # source in the BLOCK_OBS configuration is not yet supported - # in Python. - - #elif isinstance(instance , ContainerConfig): - # return ContainerConfig.from_param( instance ) - else: - raise ValueError("Currently ONLY field data is supported") diff --git a/ThirdParty/Ert/python/python/ert/enkf/observations/block_observation.py b/ThirdParty/Ert/python/python/ert/enkf/observations/block_observation.py deleted file mode 100644 index 81b6ef673f..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/observations/block_observation.py +++ /dev/null @@ -1,105 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'block_obs.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.enkf import NodeId, FieldConfig -from ert.enkf.observations import BlockDataConfig - - -class BlockObservation(BaseCClass): - TYPE_NAME = "block_obs" - - _alloc = EnkfPrototype("void* block_obs_alloc( char* , block_data_config , ecl_grid )", bind = False) - _free = EnkfPrototype("void block_obs_free( block_obs )") - _iget_i = EnkfPrototype("int block_obs_iget_i(block_obs, int)") - _iget_j = EnkfPrototype("int block_obs_iget_j( block_obs, int)") - _iget_k = EnkfPrototype("int block_obs_iget_k( block_obs , int)") - _get_size = EnkfPrototype("int block_obs_get_size( block_obs )") - _get_std = EnkfPrototype("double block_obs_iget_std( block_obs, int )") - _get_std_scaling = EnkfPrototype("double block_obs_iget_std_scaling( block_obs, int )") - _update_std_scaling = EnkfPrototype("void block_obs_update_std_scale(block_obs , double , active_list)") - _get_value = EnkfPrototype("double block_obs_iget_value( block_obs, int)") - _get_depth = EnkfPrototype("double block_obs_iget_depth( block_obs, int)") - _add_field_point = EnkfPrototype("void block_obs_append_field_obs( block_obs, int,int,int,double,double)") - _add_summary_point = EnkfPrototype("void block_obs_append_summary_obs( block_obs, int, int, int, double, double)") - _iget_data = EnkfPrototype("double block_obs_iget_data(block_obs, void*, int, node_id)") - - - - def __init__(self , obs_key , data_config , grid): - c_ptr = self._alloc( obs_key , data_config , grid ) - super(BlockObservation, self).__init__(c_ptr) - - - def getCoordinate(self, index): - """ @rtype: tuple of (int, int, int) """ - i = self._iget_i(index) - j = self._iget_j(index) - k = self._iget_k(index) - return i, j, k - - def __len__(self): - """ @rtype: int """ - return self._get_size() - - def __iter__(self): - cur = 0 - while cur < len(self): - yield cur - cur += 1 - - def addPoint(self , i,j,k , value , std , sum_key = None): - if sum_key is None: - self._add_field_point(i,j,k,value,std) - else: - self._add_summary_point(i,j,k,sum_key,value,std) - - - def getValue(self, index): - """ @rtype: float """ - return self._get_value(index) - - def getStd(self, index): - """ @rtype: float """ - return self._get_std(index) - - def getStdScaling(self , index): - """ @rtype: float """ - return self._get_std_scaling(index) - - def updateStdScaling(self , factor , active_list): - self._update_std_scaling(factor , active_list) - - - def getDepth(self, index): - """ @rtype: float """ - return self._get_depth(index) - - def getData(self, state, obs_index, node_id): - """ - @type state: c_void_p - @type obs_index: int - @type node_id: NodeId - @rtype: float """ - - return self._iget_data(state, obs_index, node_id) - - - def free(self): - self._free() - - def __repr__(self): - return 'BlockObservation(size = %d) at 0x%x' % (len(self), self._address()) diff --git a/ThirdParty/Ert/python/python/ert/enkf/observations/gen_observation.py b/ThirdParty/Ert/python/python/ert/enkf/observations/gen_observation.py deleted file mode 100644 index 4214868546..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/observations/gen_observation.py +++ /dev/null @@ -1,116 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'gen_observation.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -import os.path - -from cwrap import BaseCClass -from ert.util import IntVector -from ert.enkf import EnkfPrototype -from ert.enkf import GenDataConfig - - -class GenObservation(BaseCClass): - TYPE_NAME = "gen_obs" - - _alloc = EnkfPrototype("void* gen_obs_alloc__(gen_data_config , char*)", bind = False) - _free = EnkfPrototype("void gen_obs_free(gen_obs)") - _load = EnkfPrototype("void gen_obs_load_observation(gen_obs , char*)") - _scalar_set = EnkfPrototype("void gen_obs_set_scalar(gen_obs , double , double)") - _get_std = EnkfPrototype("double gen_obs_iget_std(gen_obs, int)") - _get_value = EnkfPrototype("double gen_obs_iget_value(gen_obs, int)") - _get_std_scaling = EnkfPrototype("double gen_obs_iget_std_scaling(gen_obs, int)") - _get_size = EnkfPrototype("int gen_obs_get_size(gen_obs)") - _get_data_index = EnkfPrototype("int gen_obs_get_obs_index(gen_obs, int)") - _load_data_index = EnkfPrototype("void gen_obs_load_data_index(gen_obs , char*)") - _add_data_index = EnkfPrototype("void gen_obs_attach_data_index(gen_obs , int_vector)") - _update_std_scaling = EnkfPrototype("void gen_obs_update_std_scale(gen_obs , double , active_list)") - - def __init__(self , obs_key , data_config , scalar_value = None , obs_file = None , data_index = None): - c_ptr = self._alloc( data_config , obs_key ) - if c_ptr: - super(GenObservation, self).__init__(c_ptr) - else: - raise ValueError('Unable to construct GenObservation with given obs_key and data_config!') - - if scalar_value is None and obs_file is None: - raise ValueError("Exactly one the scalar_value and obs_file arguments must be present") - - if scalar_value is not None and obs_file is not None: - raise ValueError("Exactly one the scalar_value and obs_file arguments must be present") - - if obs_file is not None: - if not os.path.isfile( obs_file ): - raise IOError("The file with observation data:%s does not exist" % obs_file ) - else: - self._load( obs_file ) - else: - obs_value , obs_std = scalar_value - self._scalar_set( obs_value , obs_std ) - - if not data_index is None: - if os.path.isfile( data_index ): - self._load_data_index( data_index ) - else: - index_list = IntVector.active_list( data_index ) - self._add_data_index( index_list ) - - - def __len__(self): - return self._get_size() - - def __getitem__(self , obs_index): - if obs_index < 0: - obs_index += len(self) - - if 0 <= obs_index < len(self): - return (self.getValue(obs_index) , self.getStandardDeviation(obs_index)) - else: - raise IndexError("Invalid index. Valid range: [0,%d)" % len(self)) - - - def getValue(self, obs_index): - """ @rtype: float """ - return self._get_value(obs_index) - - def getStandardDeviation(self, obs_index): - """ @rtype: float """ - return self._get_std(obs_index) - - def getStdScaling(self, obs_index): - """ @rtype: float """ - return self._get_std_scaling(obs_index) - - def updateStdScaling(self , factor , active_list): - self._update_std_scaling(factor , active_list) - - - def getSize(self): - """ @rtype: float """ - return len(self) - - def getIndex(self, obs_index): - """ @rtype: int """ - return self.getDataIndex( obs_index ) - - def getDataIndex(self, obs_index): - return self._get_data_index(obs_index) - - def free(self): - self._free() - - def __repr__(self): - si = len(self) - ad = self._ad_str() - return 'GenObservation(size = %d) %s' % (si, ad) diff --git a/ThirdParty/Ert/python/python/ert/enkf/observations/obs_vector.py b/ThirdParty/Ert/python/python/ert/enkf/observations/obs_vector.py deleted file mode 100644 index 76823de656..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/observations/obs_vector.py +++ /dev/null @@ -1,167 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'obs_vector.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.enkf.config import EnkfConfigNode -from ert.enkf.enums import EnkfObservationImplementationType -from ert.enkf.observations import BlockObservation, SummaryObservation, GenObservation - - -class ObsVector(BaseCClass): - TYPE_NAME = "obs_vector" - - _alloc = EnkfPrototype("void* obs_vector_alloc(enkf_obs_impl_type, char*, enkf_config_node, int)", bind = False) - _free = EnkfPrototype("void obs_vector_free( obs_vector )") - _get_state_kw = EnkfPrototype("char* obs_vector_get_state_kw( obs_vector )") - _get_key = EnkfPrototype("char* obs_vector_get_key( obs_vector )") - _iget_node = EnkfPrototype("void* obs_vector_iget_node( obs_vector, int)") - _get_num_active = EnkfPrototype("int obs_vector_get_num_active( obs_vector )") - _iget_active = EnkfPrototype("bool obs_vector_iget_active( obs_vector, int)") - _get_impl_type = EnkfPrototype("enkf_obs_impl_type obs_vector_get_impl_type( obs_vector)") - _install_node = EnkfPrototype("void obs_vector_install_node(obs_vector, int, void*)") - _get_next_active_step = EnkfPrototype("int obs_vector_get_next_active_step(obs_vector, int)") - _has_data = EnkfPrototype("bool obs_vector_has_data(obs_vector , bool_vector , enkf_fs)") - _get_config_node = EnkfPrototype("enkf_config_node_ref obs_vector_get_config_node(obs_vector)") - _get_total_chi2 = EnkfPrototype("double obs_vector_total_chi2(obs_vector, enkf_fs, int)") - _get_obs_key = EnkfPrototype("char* obs_vector_get_obs_key(obs_vector)") - _get_step_list = EnkfPrototype("int_vector_ref obs_vector_get_step_list(obs_vector)") - _create_local_node = EnkfPrototype("local_obsdata_node_obj obs_vector_alloc_local_node(obs_vector)") - - def __init__(self, observation_type, observation_key, config_node, num_reports): - """ - @type observation_type: EnkfObservationImplementationType - @type observation_key: str - @type config_node: EnkfConfigNode - @type num_reports: int - """ - assert isinstance(observation_type, EnkfObservationImplementationType) - assert isinstance(observation_key, str) - assert isinstance(config_node, EnkfConfigNode) - assert isinstance(num_reports, int) - c_ptr = self._alloc(observation_type, observation_key, config_node, num_reports) - super(ObsVector, self).__init__(c_ptr) - - - def getDataKey(self): - """ @rtype: str """ - return self._get_state_kw() - - def getObservationKey(self): - """ @rtype: str """ - return self.getKey() - - def getKey(self): - return self._get_key() - - def getObsKey(self): - return self._get_obs_key() - - - def getNode(self, index): - """ @rtype: SummaryObservation or BlockObservation or GenObservation""" - - pointer = self._iget_node(index) - - node_type = self.getImplementationType() - if node_type == EnkfObservationImplementationType.SUMMARY_OBS: - return SummaryObservation.createCReference(pointer, self) - elif node_type == EnkfObservationImplementationType.BLOCK_OBS: - return BlockObservation.createCReference(pointer, self) - elif node_type == EnkfObservationImplementationType.GEN_OBS: - return GenObservation.createCReference(pointer, self) - else: - raise AssertionError("Node type '%s' currently not supported!" % node_type) - - - def __iter__(self): - """ Iterate over active report steps; return node""" - cur = -1 - run = True - for step in self.getStepList(): - yield self.getNode( step ) - - - - def getStepList(self): - """ - Will return an IntVector with the active report steps. - """ - return self._get_step_list() - - def activeStep(self): - """Assuming the observation is only active for one report step, this - method will return that report step - if it is active for more - than one report step the method will raise an exception. - """ - step_list = self.getStepList() - if len(step_list): - return step_list[0] - else: - raise ValueError("The activeStep() method can *ONLY* be called for obervations with one active step") - - - def getActiveCount(self): - """ @rtype: int """ - return len(self) - def __len__(self): - return self._get_num_active() - - def isActive(self, index): - """ @rtype: bool """ - return self._iget_active(index) - - def getNextActiveStep(self, previous_step=-1): - """ @rtype: int """ - return self._get_next_active_step(previous_step) - - def getImplementationType(self): - """ @rtype: EnkfObservationImplementationType """ - return self._get_impl_type() - - def installNode(self, index, node): - assert isinstance(node, SummaryObservation) - node.convertToCReference(self) - self._install_node(index, node.from_param(node)) - - def getConfigNode(self): - """ @rtype: EnkfConfigNode """ - return self._get_config_node().setParent(self) - - - def createLocalObs(self): - """ - Will create a LocalObsDataNode instance with all timesteps set. - """ - return self._create_local_node() - - - def hasData(self, active_mask, fs): - """ @rtype: bool """ - return self._has_data(active_mask, fs) - - def free(self): - self._free() - - def __repr__(self): - dk = 'data_key = %s' % self.getDataKey() - kk = 'key = %s' % self.getKey() - ok = 'obs_key = %s' % self.getObsKey() - na = 'num_active = %d' % len(self) - return 'ObsVector(%s, %s, %s, %s) %s' % (na, kk, ok, dk, self._ad_str()) - - def getTotalChi2(self, fs, realization_number): - """ @rtype: float """ - return self._get_total_chi2(fs, realization_number) diff --git a/ThirdParty/Ert/python/python/ert/enkf/observations/summary_observation.py b/ThirdParty/Ert/python/python/ert/enkf/observations/summary_observation.py deleted file mode 100644 index f71e1a3c91..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/observations/summary_observation.py +++ /dev/null @@ -1,84 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'summary_observation.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype - - -class SummaryObservation(BaseCClass): - TYPE_NAME = "summary_obs" - - _alloc = EnkfPrototype("void* summary_obs_alloc(char*, char*, double, double, char*, double)", bind = False) - _free = EnkfPrototype("void summary_obs_free(summary_obs)") - _get_value = EnkfPrototype("double summary_obs_get_value(summary_obs)") - _get_std = EnkfPrototype("double summary_obs_get_std(summary_obs)") - _get_std_scaling = EnkfPrototype("double summary_obs_get_std_scaling(summary_obs)") - _get_summary_key = EnkfPrototype("char* summary_obs_get_summary_key(summary_obs)") - _update_std_scale = EnkfPrototype("void summary_obs_update_std_scale(summary_obs , double , active_list)") - - - def __init__(self, summary_key, observation_key, value, std, auto_corrf_name=None, auto_corrf_param=0.0): - assert isinstance(summary_key, str) - assert isinstance(observation_key, str) - assert isinstance(value, float) - assert isinstance(std, float) - - if auto_corrf_name is not None: - assert isinstance(auto_corrf_name, str) - - assert isinstance(auto_corrf_param, float) - c_ptr = self._alloc(summary_key, observation_key, value, std, auto_corrf_name, auto_corrf_param) - if c_ptr: - super(SummaryObservation, self).__init__(c_ptr) - else: - raise ValueError('Unable to construct SummaryObservation with given configuration!') - - def getValue(self): - """ @rtype: float """ - return self._get_value() - - def getStandardDeviation(self): - """ @rtype: float """ - return self._get_std() - - def getStdScaling(self , index = 0): - """ @rtype: float """ - return self._get_std_scaling() - - def __len__(self): - return 1 - - - def getSummaryKey(self): - """ @rtype: str """ - return self._get_summary_key() - - - def updateStdScaling(self , factor , active_list): - self._update_std_scale(factor , active_list) - - - def free(self): - self._free() - - def __repr__(self): - sk = self.getSummaryKey() - va = self.getValue() - sd = self.getStandardDeviation() - sc = self.getStdScaling() - ad = self._address() - fmt = 'SummaryObservation(key = %s, value = %f, std = %f, std_scaling = %f) at 0x%x' - return fmt % (sk, va, sd, sc, ad) diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot/CMakeLists.txt b/ThirdParty/Ert/python/python/ert/enkf/plot/CMakeLists.txt deleted file mode 100644 index 4ce39c00f6..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - block_observation_data_fetcher.py - data_fetcher.py - ensemble_block_data_fetcher.py - ensemble_data_fetcher.py - ensemble_gen_data_fetcher.py - ensemble_gen_kw_fetcher.py - observation_data_fetcher.py - observation_gen_data_fetcher.py - pca_fetcher.py - refcase_data_fetcher.py -) - -add_python_package("python.ert.enkf.plot" ${PYTHON_INSTALL_PREFIX}/ert/enkf/plot "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot/__init__.py b/ThirdParty/Ert/python/python/ert/enkf/plot/__init__.py deleted file mode 100644 index 75ecfa73b1..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -from .data_fetcher import DataFetcher -from .observation_data_fetcher import ObservationDataFetcher -from .refcase_data_fetcher import RefcaseDataFetcher -from .ensemble_data_fetcher import EnsembleDataFetcher -from .ensemble_block_data_fetcher import EnsembleBlockDataFetcher -from .block_observation_data_fetcher import BlockObservationDataFetcher -from .ensemble_gen_kw_fetcher import EnsembleGenKWFetcher -from .ensemble_gen_data_fetcher import EnsembleGenDataFetcher -from .observation_gen_data_fetcher import ObservationGenDataFetcher -from .pca_fetcher import PcaDataFetcher \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot/block_observation_data_fetcher.py b/ThirdParty/Ert/python/python/ert/enkf/plot/block_observation_data_fetcher.py deleted file mode 100644 index a5ea24e4ee..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot/block_observation_data_fetcher.py +++ /dev/null @@ -1,107 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'block_observation_data_fetcher.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from ert.enkf import EnkfObservationImplementationType -from ert.enkf.observations import BlockObservation -from ert.enkf.plot import DataFetcher - - -class BlockObservationDataFetcher(DataFetcher): - def __init__(self, ert): - super(BlockObservationDataFetcher, self).__init__(ert) - self.__selected_report_step_index = None - - def setSelectedReportStepIndex(self, index): - self.__selected_report_step_index = index - - def fetchSupportedKeys(self): - observations = self.ert().getObservations() - string_list = observations.getTypedKeylist(EnkfObservationImplementationType.BLOCK_OBS) - return [key for key in string_list] - - def __fetchObservationData(self, block_observation): - assert isinstance(block_observation, BlockObservation) - - data = { - "continuous": False, - "x": [], - "y": [], - "std": [], - "min_y": None, - "max_y": None, - "min_x": None, - "max_x": None - } - - for index in block_observation: - std = block_observation.getStd(index) - y = block_observation.getDepth(index) - x = block_observation.getValue(index) - - data["std"].append(std) - data["y"].append(y) - data["x"].append(x) - - adjusted_x = self.adjustX(x, std) - - if data["min_x"] is None or data["min_x"] > adjusted_x: - data["min_x"] = adjusted_x - - if data["max_x"] is None or data["max_x"] < x + std: - data["max_x"] = x + std - - - if data["min_y"] is None or data["min_y"] > y: - data["min_y"] = y - - if data["max_y"] is None or data["max_y"] < y: - data["max_y"] = y - - return data - - @staticmethod - def adjustX(x, std): - if x >= 0: - return max(0, x - std) - - return x - std - - def hasData(self, key): - """ @rtype: bool """ - observations = self.ert().getObservations() - if not observations.hasKey(key): - return False - - return observations[key].getActiveCount() > 0 - - def fetchData(self, key, case=None): - observations = self.ert().getObservations() - assert observations.hasKey(key) - - observation_vector = observations[key] - - report_step_data = [] - for report_step in observation_vector: - block_observation = observation_vector.getNode(report_step) - data = self.__fetchObservationData(block_observation) - data["report_step"] = report_step - report_step_data.append(data) - - - if self.__selected_report_step_index is not None: - return report_step_data[self.__selected_report_step_index] - else: - return report_step_data - diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot/data_fetcher.py b/ThirdParty/Ert/python/python/ert/enkf/plot/data_fetcher.py deleted file mode 100644 index b67769f2dc..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot/data_fetcher.py +++ /dev/null @@ -1,30 +0,0 @@ -from ert.enkf.enkf_main import EnKFMain - - -class DataFetcher(object): - def __init__(self, ert): - super(DataFetcher, self).__init__() - assert isinstance(ert, EnKFMain) - self.__ert = ert - self.__supported_keys = None - - def fetchData(self, key, case=None): - raise NotImplementedError() - - def ert(self): - return self.__ert - - def fetchSupportedKeys(self): - raise NotImplementedError() - - def getSupportedKeys(self): - if self.__supported_keys is None: - self.__supported_keys = self.fetchSupportedKeys() - return self.__supported_keys - - def supportsKey(self, key): - return key in self.getSupportedKeys() - - - - diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot/ensemble_block_data_fetcher.py b/ThirdParty/Ert/python/python/ert/enkf/plot/ensemble_block_data_fetcher.py deleted file mode 100644 index 6b9e763088..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot/ensemble_block_data_fetcher.py +++ /dev/null @@ -1,109 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'ensemble_block_data_fetcher.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from ert.enkf.enums import ErtImplType -from ert.enkf.plot import DataFetcher -from ert.enkf.plot_data import PlotBlockDataLoader, PlotBlockData - - -class EnsembleBlockDataFetcher(DataFetcher): - def __init__(self, ert): - super(EnsembleBlockDataFetcher, self).__init__(ert) - self.__selected_report_step_index = None - - def __fetchSimulationData(self, block_data): - """ - @type block_data: PlotBlockData - @rtype dict - """ - data = { - "x": [], - "y": [], - "min_x_values": [], - "max_x_values": [], - "min_y": None, - "max_y": None, - "min_x": None, - "max_x": None - } - - depth_vector = block_data.getDepth() - - for depth in depth_vector: - data["y"].append(depth) - data["min_x_values"].append(None) - data["max_x_values"].append(None) - - - min_y = min(data["y"]) - max_y = max(data["y"]) - - if data["min_y"] is None or data["min_y"] > min_y: - data["min_y"] = min_y - - if data["max_y"] is None or data["max_y"] < max_y: - data["max_y"] = max_y - - for block_vector in block_data: - x = [] - data["x"].append(x) - - for index in range(len(block_vector)): - value = block_vector[index] - x.append(value) - if data["min_x"] is None or data["min_x"] > value: - data["min_x"] = value - - if data["max_x"] is None or data["max_x"] < value: - data["max_x"] = value - - if data["min_x_values"][index] is None or data["min_x_values"][index] > value: - data["min_x_values"][index] = value - - if data["max_x_values"][index] is None or data["max_x_values"][index] < value: - data["max_x_values"][index] = value - - return data - - def fetchData(self, key, case=None): - enkf_fs = self.ert().getEnkfFsManager().getFileSystem(case) - observations = self.ert().getObservations() - assert observations.hasKey(key) - - observation_vector = observations[key] - - loader = PlotBlockDataLoader(observation_vector) - - report_step_data = [] - for report_step in observation_vector: - block_data = loader.load(enkf_fs, report_step) - data = self.__fetchSimulationData(block_data) - data["report_step"] = report_step - - report_step_data.append(data) - - if self.__selected_report_step_index is not None: - return report_step_data[self.__selected_report_step_index] - else: - return report_step_data - - def fetchSupportedKeys(self): - string_list = self.ert().ensembleConfig().getKeylistFromImplType(ErtImplType.SUMMARY) - return [key for key in string_list] - - def setSelectedReportStepIndex(self, index): - self.__selected_report_step_index = index - diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot/ensemble_data_fetcher.py b/ThirdParty/Ert/python/python/ert/enkf/plot/ensemble_data_fetcher.py deleted file mode 100644 index d8828b631a..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot/ensemble_data_fetcher.py +++ /dev/null @@ -1,73 +0,0 @@ -from ert.enkf import EnsembleConfig -from ert.enkf.plot_data import EnsemblePlotData -from ert.enkf.enums import ErtImplType -from ert.enkf.plot.data_fetcher import DataFetcher - - -class EnsembleDataFetcher(DataFetcher): - def __init__(self, ert): - super(EnsembleDataFetcher, self).__init__(ert) - - def fetchSupportedKeys(self): - """ @rtype: list of str """ - return [key for key in self.ert().ensembleConfig().getKeylistFromImplType(ErtImplType.SUMMARY)] - - - def getEnsembleConfigNode(self, key): - """ @rtype: EnsembleConfig """ - ensemble_config = self.ert().ensembleConfig() - assert key in ensemble_config - return ensemble_config.getNode(key) - - - def fetchData(self, key, case=None): - ensemble_config_node = self.getEnsembleConfigNode(key) - enkf_fs = self.ert().getEnkfFsManager().getFileSystem(case) - ensemble_plot_data = EnsemblePlotData(ensemble_config_node, enkf_fs) - - data = { - "x": [], - "y": [], - "min_y_values": [], - "max_y_values": [], - "min_y": None, - "max_y": None, - "min_x": None, - "max_x": None - } - - time_map = enkf_fs.getTimeMap() - - for index in range(1, len(time_map)): - data["x"].append(time_map[index].ctime()) - data["min_y_values"].append(None) - data["max_y_values"].append(None) - - data["min_x"] = data["x"][0] - data["max_x"] = data["x"][len(data["x"]) - 1] - - - for vector in ensemble_plot_data: - y = [] - data["y"].append(y) - - # skip index 0 (not a valid simulation value...) - for index in range(len(vector) - 1): - if vector.isActive(index + 1): - y_value = vector.getValue(index + 1) - y.append(y_value) - - if data["min_y"] is None or data["min_y"] > y_value: - data["min_y"] = y_value - - if data["max_y"] is None or data["max_y"] < y_value: - data["max_y"] = y_value - - - if data["min_y_values"][index] is None or data["min_y_values"][index] > y_value: - data["min_y_values"][index] = y_value - - if data["max_y_values"][index] is None or data["max_y_values"][index] < y_value: - data["max_y_values"][index] = y_value - - return data diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot/ensemble_gen_data_fetcher.py b/ThirdParty/Ert/python/python/ert/enkf/plot/ensemble_gen_data_fetcher.py deleted file mode 100644 index c248169c36..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot/ensemble_gen_data_fetcher.py +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright (C) 2014 Statoil ASA, Norway. -# -# The file 'ensemble_gen_data_fetcher.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from ert.enkf.plot_data import EnsemblePlotGenData -from ert.enkf.plot import DataFetcher - - -class EnsembleGenDataFetcher(DataFetcher): - def __init__(self, ert): - super(EnsembleGenDataFetcher, self).__init__(ert) - - def fetchSupportedKeys(self): - gen_data_list = [] - - return gen_data_list - - def getEnsembleConfigNode(self, key): - """ @rtype: EnsembleConfig """ - ensemble_config = self.ert().ensembleConfig() - assert key in ensemble_config - return ensemble_config.getNode(key) - - def fetchData(self, key, case=None): - key, report_step = key.split("@") - report_step = int(report_step) - - ensemble_config_node = self.getEnsembleConfigNode(key) - enkf_fs = self.ert().getEnkfFsManager().getFileSystem(case) - ensemble_plot_gen_data = EnsemblePlotGenData(ensemble_config_node, enkf_fs, report_step) - - data = {"x": [], - "y": [], - "min_y_values": [value for value in ensemble_plot_gen_data.getMinValues()], - "max_y_values": [value for value in ensemble_plot_gen_data.getMaxValues()], - "min_y": None, - "max_y": None, - "min_x": 0, - "max_x": None} - - data["x"] = [index for index in range(len(data["min_y_values"]))] - data["max_x"] = len(data["min_y_values"]) - 1 - - for vector in ensemble_plot_gen_data: - y = [] - data["y"].append(y) - - for value in vector: - y.append(value) - - if data["min_y"] is None or data["min_y"] > value: - data["min_y"] = value - - if data["max_y"] is None or data["max_y"] < value: - data["max_y"] = value - - - - return data - diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot/ensemble_gen_kw_fetcher.py b/ThirdParty/Ert/python/python/ert/enkf/plot/ensemble_gen_kw_fetcher.py deleted file mode 100644 index 2dd7e1a942..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot/ensemble_gen_kw_fetcher.py +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright (C) 2014 Statoil ASA, Norway. -# -# The file 'ensemble_gen_kw_fetcher.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from ert.enkf.config.gen_kw_config import GenKwConfig -from ert.enkf.enums.ert_impl_type_enum import ErtImplType -from ert.enkf.plot import DataFetcher -from ert.enkf.plot_data import EnsemblePlotGenKW - - -class EnsembleGenKWFetcher(DataFetcher): - def __init__(self, ert): - super(EnsembleGenKWFetcher, self).__init__(ert) - - def fetchSupportedKeys(self): - gen_kw_keys = self.ert().ensembleConfig().getKeylistFromImplType(ErtImplType.GEN_KW) - gen_kw_list = [] - for key in gen_kw_keys: - enkf_config_node = self.ert().ensembleConfig().getNode(key) - model_config = enkf_config_node.getModelConfig() - assert isinstance(model_config, GenKwConfig) - - model_keys = model_config.getKeyWords() - for key_word in model_keys: - gen_kw_list.append("%s:%s" % (key, key_word)) - - return gen_kw_list - - - def getEnsembleConfigNode(self, key): - """ @rtype: EnsembleConfig """ - ensemble_config = self.ert().ensembleConfig() - assert key in ensemble_config - return ensemble_config.getNode(key) - - - def fetchData(self, key, case=None): - key, keyword = key.split(":") - ensemble_config_node = self.getEnsembleConfigNode(key) - enkf_fs = self.ert().getEnkfFsManager().getFileSystem(case) - ensemble_plot_gen_kw = EnsemblePlotGenKW(ensemble_config_node, enkf_fs) - keyword_index = ensemble_plot_gen_kw.getIndexForKeyword(keyword) - - use_log_scale = ensemble_plot_gen_kw.shouldUseLogScale(keyword_index) - - data = {"x": [0], - "y": [], - "min_y": None, - "max_y": None, - "min_x": 0, - "max_x": 0, - "use_log_scale": use_log_scale} - - for vector in ensemble_plot_gen_kw: - y = [] - data["y"].append(y) - - if len(vector) > keyword_index: - value = vector.getValue(keyword_index) - y.append(value) - - if data["min_y"] is None or data["min_y"] > value: - data["min_y"] = value - - if data["max_y"] is None or data["max_y"] < value: - data["max_y"] = value - - return data - diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot/observation_data_fetcher.py b/ThirdParty/Ert/python/python/ert/enkf/plot/observation_data_fetcher.py deleted file mode 100644 index c6e4830e81..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot/observation_data_fetcher.py +++ /dev/null @@ -1,91 +0,0 @@ -from ert.enkf import EnkfObservationImplementationType -from ert.enkf.enums import ErtImplType -from ert.enkf.plot import DataFetcher - - -class ObservationDataFetcher(DataFetcher): - def __init__(self, ert): - super(ObservationDataFetcher, self).__init__(ert) - - def getObservationKeys(self): - observations = self.ert().getObservations() - keys = observations.getTypedKeylist(EnkfObservationImplementationType.SUMMARY_OBS) - keys = sorted(keys) - return keys - - def fetchSupportedKeys(self): - """ @rtype: list of str """ - return sorted([key for key in self.ert().ensembleConfig().getKeylistFromImplType(ErtImplType.SUMMARY)]) - - def __getObservationData(self, key, data): - observations = self.ert().getObservations() - assert observations.hasKey(key) - - observation_data = observations[key] - active_count = observation_data.getActiveCount() - - history_length = self.ert().getHistoryLength() - for index in range(0, history_length): - if observation_data.isActive(index): - x_value = int(observations.getObservationTime(index).ctime()) - data["x"].append(x_value) - - #: :type: SummaryObservation - node = observation_data.getNode(index) - - y_value = node.getValue() - std = node.getStandardDeviation() - data["y"].append(float(y_value)) - data["std"].append(float(std)) - - if data["min_x"] is None or data["min_x"] > x_value: - data["min_x"] = x_value - - if data["max_x"] is None or data["max_x"] < x_value: - data["max_x"] = x_value - - - adjusted_y = self.adjustY(y_value, std) - - if data["min_y"] is None or data["min_y"] > adjusted_y: - data["min_y"] = adjusted_y - - if data["max_y"] is None or data["max_y"] < y_value + std: - data["max_y"] = y_value + std - - if active_count == 1: - data["continuous"] = False - - @staticmethod - def adjustY(y, std): - if y >= 0: - return max(0, y - std) - - return y - std - - - def fetchData(self, key, case=None): - obs_keys = self.ert().ensembleConfig().getNode(key).getObservationKeys() - history_length = self.ert().getHistoryLength() - - data = {"continuous": True, - "x": None, - "y": None, - "std": None, - "min_y": None, - "max_y": None, - "min_x": None, - "max_x": None} - - if len(obs_keys) == 0: - return data - - data["x"] = [] - data["y"] = [] - data["std"] = [] - - for obs_key in obs_keys: - self.__getObservationData(obs_key, data) - - return data - diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot/observation_gen_data_fetcher.py b/ThirdParty/Ert/python/python/ert/enkf/plot/observation_gen_data_fetcher.py deleted file mode 100644 index 31c9a2eee5..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot/observation_gen_data_fetcher.py +++ /dev/null @@ -1,115 +0,0 @@ -# Copyright (C) 2014 Statoil ASA, Norway. -# -# The file 'observation_gen_data_fetcher.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from ert.enkf.enums.ert_impl_type_enum import ErtImplType -from ert.enkf.plot import DataFetcher - - -class ObservationGenDataFetcher(DataFetcher): - def __init__(self, ert): - super(ObservationGenDataFetcher, self).__init__(ert) - - def fetchSupportedKeys(self): - gen_data_keys = self.ert().ensembleConfig().getKeylistFromImplType(ErtImplType.GEN_DATA) - gen_data_list = [] - for key in gen_data_keys: - obs_keys = self.ert().ensembleConfig().getNode(key).getObservationKeys() - for obs_key in obs_keys: - obs_vector = self.ert().getObservations()[obs_key] - for report_step in obs_vector.getStepList(): - gen_data_list.append("%s@%d" % (key, report_step)) - - return gen_data_list - - def __getObservationData(self, key, report_step): - data = {"continuous": True, - "x": [], - "y": [], - "std": [], - "min_y": None, - "max_y": None, - "min_x": None, - "max_x": None} - - observations = self.ert().getObservations() - assert observations.hasKey(key) - - gen_obs = observations[key].getNode(report_step) - - size = gen_obs.getSize() - - data["min_x"] = 0 - data["max_x"] = size - 1 - for index in range(0, size): - std = gen_obs.getStandardDeviation(index) - data["std"].append(std) - y_value = gen_obs.getValue(index) - data["y"].append(y_value) - - adjusted_y = self.adjustY(y_value, std) - - if data["min_y"] is None or data["min_y"] > adjusted_y: - data["min_y"] = adjusted_y - - if data["max_y"] is None or data["max_y"] < y_value + std: - data["max_y"] = y_value + std - - obs_index = gen_obs.getIndex(index) - data["x"].append(obs_index) - - return data - - - def getObsKeyForKey(self, key, key_report_step): - obs_keys = self.ert().ensembleConfig().getNode(key).getObservationKeys() - for obs_key in obs_keys: - obs_vector = self.ert().getObservations()[obs_key] - for report_step in obs_vector.getStepList(): - if report_step == key_report_step: - return obs_key - - raise UserWarning("Observation key for key '%s' not found!" % key) - - - def getAllObsKeysForKey(self, key): - key, report_step = key.split("@") - return self.ert().ensembleConfig().getNode(key).getObservationKeys() - - - def hasData(self, key): - """ @rtype: bool """ - key, report_step = key.split("@") - observations = self.ert().getObservations() - obs_key = self.getObsKeyForKey(key, int(report_step)) - if not observations.hasKey(obs_key): - return False - - return observations[obs_key].getActiveCount() > 0 - - def fetchData(self, key, case=None): - key, report_step = key.split("@") - - key_report_step = int(report_step) - obs_key = self.getObsKeyForKey(key, key_report_step) - - return self.__getObservationData(obs_key, key_report_step) - - - @staticmethod - def adjustY(y, std): - if y >= 0: - return max(0, y - std) - - return y - std diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot/pca_fetcher.py b/ThirdParty/Ert/python/python/ert/enkf/plot/pca_fetcher.py deleted file mode 100644 index adbb256f34..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot/pca_fetcher.py +++ /dev/null @@ -1,182 +0,0 @@ -from ert.enkf.plot import DataFetcher, ObservationGenDataFetcher, BlockObservationDataFetcher, EnsembleDataFetcher -from ert.enkf.plot_data import PcaPlotData -from ert.enkf.enums import RealizationStateEnum, EnkfObservationImplementationType -from ert.enkf import LocalObsdata, LocalObsdataNode, EnkfLinalg, MeasData, ObsData -from ert.util import Matrix, BoolVector, DoubleVector - - -class PcaDataFetcher(DataFetcher): - def __init__(self, ert): - super(PcaDataFetcher, self).__init__(ert) - self.__prior_singular_values = None - - def fetchSupportedKeys(self): - summary_keys = EnsembleDataFetcher(self.ert()).getSupportedKeys() - - keys = [] - for key in summary_keys: - obs_keys = self.ert().ensembleConfig().getNode(key).getObservationKeys() - if len(obs_keys) > 0: - keys.append(key) - - keys += BlockObservationDataFetcher(self.ert()).getSupportedKeys() - keys += ObservationGenDataFetcher(self.ert()).getSupportedKeys() - - return keys - - - def truncationOrNumberOfComponents(self, truncation_or_ncomp): - """ @rtype: (float, int) """ - truncation = -1 - ncomp = -1 - - if truncation_or_ncomp < 1: - truncation = truncation_or_ncomp - else: - ncomp = int(truncation_or_ncomp) - - return truncation, ncomp - - - def calculatePrincipalComponent(self, fs, local_obsdata, truncation_or_ncomp=3): - pc = Matrix(1, 1) - pc_obs = Matrix(1, 1) - singular_values = DoubleVector() - - state_map = fs.getStateMap() - ens_mask = BoolVector(False, self.ert().getEnsembleSize()) - state_map.selectMatching(ens_mask, RealizationStateEnum.STATE_HAS_DATA) - active_list = ens_mask.createActiveList( ) - - if len(ens_mask) > 0: - meas_data = MeasData(ens_mask) - obs_data = ObsData() - - self.ert().getObservations().getObservationAndMeasureData(fs, local_obsdata, active_list, meas_data, obs_data) - - meas_data.deactivateZeroStdSamples(obs_data) - - active_size = len(obs_data) - - if active_size > 0: - S = meas_data.createS() - D_obs = obs_data.createDObs() - - truncation, ncomp = self.truncationOrNumberOfComponents(truncation_or_ncomp) - - obs_data.scale(S, D_obs=D_obs) - EnkfLinalg.calculatePrincipalComponents(S, D_obs, truncation, ncomp, pc, pc_obs, singular_values) - if self.__prior_singular_values is None: - self.__prior_singular_values = singular_values - else: - for row in range(pc.rows()): - factor = singular_values[row]/self.__prior_singular_values[row] - pc.scaleRow( row , factor ) - pc_obs.scaleRow( row , factor ) - - - return PcaPlotData(local_obsdata.getName(), pc , pc_obs , singular_values) - return None - - - - def getAllObsKeys(self): - observations = self.ert().getObservations() - summary_obs_keys = observations.getTypedKeylist(EnkfObservationImplementationType.SUMMARY_OBS) - gen_data_obs_keys = observations.getTypedKeylist(EnkfObservationImplementationType.GEN_OBS) - block_obs_keys = observations.getTypedKeylist(EnkfObservationImplementationType.BLOCK_OBS) - - summary_obs_keys = [key for key in summary_obs_keys] - gen_data_obs_keys = [key for key in gen_data_obs_keys] - block_obs_keys = [key for key in block_obs_keys] - - return summary_obs_keys + gen_data_obs_keys + block_obs_keys - - - def getObsKeys(self, data_key): - ensemble_data_fetcher = EnsembleDataFetcher(self.ert()) - block_observation_data_fetcher = BlockObservationDataFetcher(self.ert()) - gen_data_observation_data_fetcher = ObservationGenDataFetcher(self.ert()) - - if ensemble_data_fetcher.supportsKey(data_key): - return self.ert().ensembleConfig().getNode(data_key).getObservationKeys() - elif block_observation_data_fetcher.supportsKey(data_key): - return [data_key] - elif gen_data_observation_data_fetcher.supportsKey(data_key): - return gen_data_observation_data_fetcher.getAllObsKeysForKey(data_key) - - - def filterObsKeys(self, obs_keys, fs): - active_mask = BoolVector(True, self.ert().getEnsembleSize()) - ert_obs = self.ert().getObservations() - - result = [] - for obs_key in obs_keys: - obsVector = ert_obs[obs_key] - if obsVector.hasData(active_mask, fs): - result.append(obs_key) - return result - - - def fetchData(self, obs_keys, case=None): - data = {"x": None, - "y": None, - "obs_y": None, - "min_y": None, - "max_y": None, - "min_x": None, - "max_x": None} - - fs = self.ert().getEnkfFsManager().getFileSystem(case) - obs_keys = self.filterObsKeys(obs_keys, fs) - - step_1 = 0 - step_2 = self.ert().getHistoryLength() - - local_obsdata = LocalObsdata("PCA Observations %s" % case) - - for obs_key in obs_keys: - if not obs_key in local_obsdata: - obs_node = LocalObsdataNode(obs_key) - obs_node.addRange(step_1, step_2) - local_obsdata.addNode(obs_node) - - if len(local_obsdata) > 0: - pca_data = self.calculatePrincipalComponent(fs, local_obsdata) - - if pca_data is not None: - data["x"] = [] - data["y"] = [] - data["obs_y"] = [] - - data["min_x"] = 1 - data["max_x"] = len(pca_data) - - component_number = 0 - for pca_vector in pca_data: - component_number += 1 - data["x"].append(component_number) - - obs_y = pca_vector.getObservation() - - if data["min_y"] is None or data["min_y"] > obs_y: - data["min_y"] = obs_y - - if data["max_y"] is None or data["max_y"] < obs_y: - data["max_y"] = obs_y - - data["obs_y"].append(obs_y) - for index, value in enumerate(pca_vector): - if len(data["y"]) == index: - data["y"].append([]) - - y = data["y"][index] - y.append(value) - - if data["min_y"] is None or data["min_y"] > value: - data["min_y"] = value - - if data["max_y"] is None or data["max_y"] < value: - data["max_y"] = value - - return data diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot/refcase_data_fetcher.py b/ThirdParty/Ert/python/python/ert/enkf/plot/refcase_data_fetcher.py deleted file mode 100644 index cc4d1ce158..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot/refcase_data_fetcher.py +++ /dev/null @@ -1,81 +0,0 @@ -from ert.ecl import EclSum, EclSumVector, EclSumNode -from ert.enkf.enums import ErtImplType -from ert.enkf.plot.data_fetcher import DataFetcher - - -class RefcaseDataFetcher(DataFetcher): - def __init__(self, ert): - super(RefcaseDataFetcher, self).__init__(ert) - self.report_times = {} - - - def hasRefcase(self): - """ @rtype: bool """ - return self.ert().eclConfig().hasRefcase() - - def getRefCase(self): - """ @rtype: EclSum """ - return self.ert().eclConfig().getRefcase() - - def getSummaryKeys(self): - """ @rtype: StringList """ - return self.ert().ensembleConfig().getKeylistFromImplType(ErtImplType.SUMMARY) - - - def fetchData(self, key, case=None): - data = {"x": None, - "y": None, - "min_y": None, - "max_y": None, - "min_x": None, - "max_x": None} - - if not self.hasRefcase(): - return data - - - refcase = self.getRefCase() - vector = refcase.get_vector(key, report_only=False) - - data["x"] = [] - data["y"] = [] - - for index in range(1, len(vector)): - node = vector[index] - - x_value = self.getReportStepTimeFromRefcase(refcase, node.report_step) - data["x"].append(int(x_value)) - - if data["min_x"] is None or data["min_x"] > x_value: - data["min_x"] = x_value - - if data["max_x"] is None or data["max_x"] < x_value: - data["max_x"] = x_value - - - value = node.value - data["y"].append(float(value)) - - if data["min_y"] is None or data["min_y"] > value: - data["min_y"] = value - - if data["max_y"] is None or data["max_y"] < value: - data["max_y"] = value - - return data - - - def getReportStepTimeFromRefcase(self, refcase, report_step): - if not report_step in self.report_times: - self.report_times[report_step] = EclSum.cNamespace().get_report_time(refcase, report_step).ctime() - - return self.report_times[report_step] - - - - - - - - - diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot_data/CMakeLists.txt b/ThirdParty/Ert/python/python/ert/enkf/plot_data/CMakeLists.txt deleted file mode 100644 index b56289400e..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot_data/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - ensemble_plot_data.py - ensemble_plot_data_vector.py - ensemble_plot_gen_data.py - ensemble_plot_gen_data_vector.py - ensemble_plot_gen_kw.py - ensemble_plot_gen_kw_vector.py - pca_plot_data.py - pca_plot_vector.py - plot_block_data.py - plot_block_data_loader.py - plot_block_vector.py -) - -add_python_package("python.ert.enkf.plot_data" ${PYTHON_INSTALL_PREFIX}/ert/enkf/plot_data "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot_data/__init__.py b/ThirdParty/Ert/python/python/ert/enkf/plot_data/__init__.py deleted file mode 100644 index 5e957583af..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot_data/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -from .ensemble_plot_data_vector import EnsemblePlotDataVector -from .ensemble_plot_data import EnsemblePlotData -from .plot_block_vector import PlotBlockVector -from .plot_block_data import PlotBlockData -from .plot_block_data_loader import PlotBlockDataLoader -from .ensemble_plot_gen_data_vector import EnsemblePlotGenDataVector -from .ensemble_plot_gen_data import EnsemblePlotGenData -from .ensemble_plot_gen_kw_vector import EnsemblePlotGenKWVector -from .ensemble_plot_gen_kw import EnsemblePlotGenKW -from .pca_plot_vector import PcaPlotVector -from .pca_plot_data import PcaPlotData - diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot_data/ensemble_plot_data.py b/ThirdParty/Ert/python/python/ert/enkf/plot_data/ensemble_plot_data.py deleted file mode 100644 index 937bfa4804..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot_data/ensemble_plot_data.py +++ /dev/null @@ -1,54 +0,0 @@ -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.enkf.config import EnkfConfigNode -from ert.enkf.enkf_fs import EnkfFs -from ert.util import BoolVector - - -class EnsemblePlotData(BaseCClass): - TYPE_NAME = "ensemble_plot_data" - - _alloc = EnkfPrototype("void* enkf_plot_data_alloc(enkf_config_node)", bind = False) - _load = EnkfPrototype("void enkf_plot_data_load(ensemble_plot_data, enkf_fs, char*, bool_vector)") - _size = EnkfPrototype("int enkf_plot_data_get_size(ensemble_plot_data)") - _get = EnkfPrototype("ensemble_plot_data_vector_ref enkf_plot_data_iget(ensemble_plot_data, int)") - _free = EnkfPrototype("void enkf_plot_data_free(ensemble_plot_data)") - - - def __init__(self, ensemble_config_node, file_system=None, user_index=None, input_mask=None): - assert isinstance(ensemble_config_node, EnkfConfigNode) - - c_pointer = self._alloc(ensemble_config_node) - super(EnsemblePlotData, self).__init__(c_pointer) - - if not file_system is None: - self.load(file_system, user_index, input_mask) - - - def load(self, file_system, user_index=None, input_mask=None): - assert isinstance(file_system, EnkfFs) - if not input_mask is None: - assert isinstance(input_mask, BoolVector) - - self._load(file_system, user_index, input_mask) - - def __len__(self): - """ @rtype: int """ - return self._size() - - def __getitem__(self, index): - """ @rtype: EnsemblePlotDataVector """ - return self._get(index) - - def __iter__(self): - cur = 0 - while cur < len(self): - yield self[cur] - cur += 1 - - - def free(self): - self._free() - - def __repr__(self): - return 'EnsemblePlotData(size = %d) %s' % (len(self), self._ad_str()) diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot_data/ensemble_plot_data_vector.py b/ThirdParty/Ert/python/python/ert/enkf/plot_data/ensemble_plot_data_vector.py deleted file mode 100644 index 2293dc854d..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot_data/ensemble_plot_data_vector.py +++ /dev/null @@ -1,35 +0,0 @@ -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.util import CTime - - - -class EnsemblePlotDataVector(BaseCClass): - TYPE_NAME = "ensemble_plot_data_vector" - - _size = EnkfPrototype("int enkf_plot_tvector_size(ensemble_plot_data_vector)") - _get_value = EnkfPrototype("double enkf_plot_tvector_iget_value(ensemble_plot_data_vector, int)") - _get_time = EnkfPrototype("time_t enkf_plot_tvector_iget_time(ensemble_plot_data_vector, int)") - _is_active = EnkfPrototype("bool enkf_plot_tvector_iget_active(ensemble_plot_data_vector, int)") - - def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") - - def __len__(self): - """ @rtype: int """ - return self._size() - - def getValue(self, index): - """ @rtype: float """ - return self._get_value(index) - - def getTime(self, index): - """ @rtype: CTime """ - return self._get_time(index) - - def isActive(self, index): - """ @rtype: bool """ - return self._is_active(index) - - def __repr__(self): - return 'EnsemblePlotDataVector(size = %d) %s' % (len(self), self._ad_str()) diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot_data/ensemble_plot_gen_data.py b/ThirdParty/Ert/python/python/ert/enkf/plot_data/ensemble_plot_gen_data.py deleted file mode 100644 index 35e94f54e8..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot_data/ensemble_plot_gen_data.py +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright (C) 2014 Statoil ASA, Norway. -# -# The file 'ensemble_plot_gen_data.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.enkf.config import EnkfConfigNode -from ert.enkf.enkf_fs import EnkfFs -from ert.enkf.enums.ert_impl_type_enum import ErtImplType -from ert.util import BoolVector, DoubleVector - - -class EnsemblePlotGenData(BaseCClass): - TYPE_NAME = "ensemble_plot_gen_data" - - _alloc = EnkfPrototype("void* enkf_plot_gendata_alloc(enkf_config_node)", bind = False) - _size = EnkfPrototype("int enkf_plot_gendata_get_size(ensemble_plot_gen_data)") - _load = EnkfPrototype("void enkf_plot_gendata_load(ensemble_plot_gen_data, enkf_fs, int, bool_vector)") - _get = EnkfPrototype("ensemble_plot_gen_data_vector_ref enkf_plot_gendata_iget(ensemble_plot_gen_data, int)") - _min_values = EnkfPrototype("double_vector_ref enkf_plot_gendata_get_min_values(ensemble_plot_gen_data)") - _max_values = EnkfPrototype("double_vector_ref enkf_plot_gendata_get_max_values(ensemble_plot_gen_data)") - _free = EnkfPrototype("void enkf_plot_gendata_free(ensemble_plot_gen_data)") - - def __init__(self, ensemble_config_node, file_system, report_step, input_mask=None): - assert isinstance(ensemble_config_node, EnkfConfigNode) - assert ensemble_config_node.getImplementationType() == ErtImplType.GEN_DATA - - c_ptr = self._alloc(ensemble_config_node) - if c_ptr: - super(EnsemblePlotGenData, self).__init__(c_ptr) - else: - raise ValueError('Unable to construct EnsemplePlotGenData from given config node!') - - self.__load(file_system, report_step, input_mask) - - - def __load(self, file_system, report_step, input_mask=None): - assert isinstance(file_system, EnkfFs) - if not input_mask is None: - assert isinstance(input_mask, BoolVector) - - self._load(file_system, report_step, input_mask) - - def __len__(self): - """ @rtype: int """ - return self._size() - - def __getitem__(self, index): - """ @rtype: EnsemblePlotGenDataVector """ - return self._get(index) - - def __iter__(self): - cur = 0 - while cur < len(self): - yield self[cur] - cur += 1 - - - def getMaxValues(self): - """ @rtype: DoubleVector """ - return self._max_values().setParent(self) - - def getMinValues(self): - """ @rtype: DoubleVector """ - return self._min_values().setParent(self) - - def free(self): - self._free() - - def __repr__(self): - return 'EnsemblePlotGenData(size = %d) %s' % (len(self), self._ad_str()) diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot_data/ensemble_plot_gen_data_vector.py b/ThirdParty/Ert/python/python/ert/enkf/plot_data/ensemble_plot_gen_data_vector.py deleted file mode 100644 index e2590b7755..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot_data/ensemble_plot_gen_data_vector.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (C) 2014 Statoil ASA, Norway. -# -# The file 'ensemble_plot_gen_data_vector.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype - -class EnsemblePlotGenDataVector(BaseCClass): - TYPE_NAME = "ensemble_plot_gen_data_vector" - - _size = EnkfPrototype("int enkf_plot_genvector_get_size(ensemble_plot_gen_data_vector)") - _get_value = EnkfPrototype("double enkf_plot_genvector_iget(ensemble_plot_gen_data_vector, int)") - - def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") - - def __len__(self): - """ @rtype: int """ - return self._size() - - def __repr__(self): - return 'EnsemblePlotGenDataVector(size = %d) %s' % (len(self), self._ad_str()) - - def getValue(self, index): - """ @rtype: float """ - return self[index] - - def __iter__(self): - cur = 0 - while cur < len(self): - yield self[cur] - cur += 1 - - def __getitem__(self, index): - """ @rtype: float """ - return self._get_value(index) diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot_data/ensemble_plot_gen_kw.py b/ThirdParty/Ert/python/python/ert/enkf/plot_data/ensemble_plot_gen_kw.py deleted file mode 100644 index 9a4df23674..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot_data/ensemble_plot_gen_kw.py +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright (C) 2014 Statoil ASA, Norway. -# -# The file 'ensemble_plot_gen_kw.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.enkf.config import EnkfConfigNode -from ert.enkf.enkf_fs import EnkfFs -from ert.enkf.enums.ert_impl_type_enum import ErtImplType -from ert.util import BoolVector -from ert.enkf.plot_data import EnsemblePlotGenKWVector - - -class EnsemblePlotGenKW(BaseCClass): - TYPE_NAME = "ensemble_plot_gen_kw" - - _alloc = EnkfPrototype("void* enkf_plot_gen_kw_alloc(enkf_config_node)", bind = False) - _size = EnkfPrototype("int enkf_plot_gen_kw_get_size(ensemble_plot_gen_kw)") - _load = EnkfPrototype("void enkf_plot_gen_kw_load(ensemble_plot_gen_kw, enkf_fs, bool, int, bool_vector)") - _get = EnkfPrototype("ensemble_plot_gen_kw_vector_ref enkf_plot_gen_kw_iget(ensemble_plot_gen_kw, int)") - _iget_key = EnkfPrototype("char* enkf_plot_gen_kw_iget_key(ensemble_plot_gen_kw, int)") - _get_keyword_count = EnkfPrototype("int enkf_plot_gen_kw_get_keyword_count(ensemble_plot_gen_kw)") - _should_use_log_scale = EnkfPrototype("bool enkf_plot_gen_kw_should_use_log_scale(ensemble_plot_gen_kw, int)") - _free = EnkfPrototype("void enkf_plot_gen_kw_free(ensemble_plot_gen_kw)") - - def __init__(self, ensemble_config_node, file_system, input_mask=None): - assert isinstance(ensemble_config_node, EnkfConfigNode) - assert ensemble_config_node.getImplementationType() == ErtImplType.GEN_KW - - c_pointer = self._alloc(ensemble_config_node) - super(EnsemblePlotGenKW, self).__init__(c_pointer) - - self.__load(file_system, input_mask) - - - def __load(self, file_system, input_mask=None): - assert isinstance(file_system, EnkfFs) - if not input_mask is None: - assert isinstance(input_mask, BoolVector) - - self._load(file_system, True, 0, input_mask) - - def __len__(self): - """ @rtype: int """ - return self._size() - - def __getitem__(self, index): - """ @rtype: EnsemblePlotGenKWVector """ - return self._get(index) - - def __iter__(self): - cur = 0 - while cur < len(self): - yield self[cur] - cur += 1 - - def getKeyWordCount(self): - """ @rtype: int """ - return self._get_keyword_count() - - def getKeyWordForIndex(self, index): - """ @rtype: str """ - return self._iget_key(index) - - def getIndexForKeyword(self, keyword): - """ @rtype: int """ - for index in range(self.getKeyWordCount()): - kw = self.getKeyWordForIndex(index) - if kw == keyword: - return index - return None - - def shouldUseLogScale(self, index): - """ @rtype: bool """ - return bool(self._should_use_log_scale(index)) - - def free(self): - self._free() - - def __repr__(self): - return 'EnsemblePlotGenKW(size = %d) %s' % (len(self), self._ad_str()) diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot_data/ensemble_plot_gen_kw_vector.py b/ThirdParty/Ert/python/python/ert/enkf/plot_data/ensemble_plot_gen_kw_vector.py deleted file mode 100644 index 532677223b..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot_data/ensemble_plot_gen_kw_vector.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (C) 2014 Statoil ASA, Norway. -# -# The file 'ensemble_plot_gen_kw_vector.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype - -class EnsemblePlotGenKWVector(BaseCClass): - TYPE_NAME = "ensemble_plot_gen_kw_vector" - - _size = EnkfPrototype("int enkf_plot_gen_kw_vector_get_size(ensemble_plot_gen_kw_vector)") - _get_value = EnkfPrototype("double enkf_plot_gen_kw_vector_iget(ensemble_plot_gen_kw_vector, int)") - - - def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") - - def __len__(self): - """ @rtype: int """ - return self._size() - - def getValue(self, index): - """ @rtype: float """ - return self[index] - - def __iter__(self): - cur = 0 - while cur < len(self): - yield self[cur] - cur += 1 - - def __getitem__(self, index): - """ @rtype: float """ - return self._get_value(index) - - def __repr__(self): - return 'EnsemblePlotGenKWVector(size = %d) %s' % (len(self), self._ad_str()) diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot_data/pca_plot_data.py b/ThirdParty/Ert/python/python/ert/enkf/plot_data/pca_plot_data.py deleted file mode 100644 index 5bad403329..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot_data/pca_plot_data.py +++ /dev/null @@ -1,63 +0,0 @@ -from cwrap import BaseCClass - -from ert.enkf import EnkfPrototype -from ert.util import Matrix -from ert.enkf.plot_data import PcaPlotVector - - -class PcaPlotData(BaseCClass): - TYPE_NAME = "pca_plot_data" - - _alloc = EnkfPrototype("void* pca_plot_data_alloc(char*, matrix, matrix , double_vector)", bind = False) - _component_count = EnkfPrototype("int pca_plot_data_get_size(pca_plot_data)") - _realization_count = EnkfPrototype("int pca_plot_data_get_ens_size(pca_plot_data)") - _get = EnkfPrototype("pca_plot_vector_ref pca_plot_data_iget_vector(pca_plot_data, int)") - _get_name = EnkfPrototype("char* pca_plot_data_get_name(pca_plot_data)") - _get_singular_values = EnkfPrototype("double_vector_ref pca_plot_data_get_singular_values(pca_plot_data)") - _free = EnkfPrototype("void pca_plot_data_free(pca_plot_data)") - - def __init__(self, name, principal_component_matrix, observation_principal_component_matrix, singular_values): - assert isinstance(name, str) - assert isinstance(principal_component_matrix, Matrix) - assert isinstance(observation_principal_component_matrix, Matrix) - - c_pointer = self._alloc(name, principal_component_matrix, observation_principal_component_matrix , singular_values) - super(PcaPlotData, self).__init__(c_pointer) - - def componentCount(self): - return len(self) - def realizationCount(self): - return self._realization_count() - def name(self): - return self._get_name() - - def __len__(self): - """ @rtype: int """ - return self._component_count() - - - def __getitem__(self, index): - """ @rtype: PcaPlotVector """ - assert isinstance(index, int) - return self._get(index).setParent(self) - - def __iter__(self): - cur = 0 - while cur < len(self): - yield self[cur] - cur += 1 - - def getSingularValues(self): - """ @rtype: DoubleVector """ - return self._get_singular_values().setParent(self) - - def free(self): - self._free() - - def __repr__(self): - nm = self.name() - cc = len(self) - rc = self.realizationCount() - ad = self._ad_str() - fmt = 'PcaPlotData(name = %s, components = %d, realizations = %d) %s' - return fmt % (nm, cc, rc, ad) diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot_data/pca_plot_vector.py b/ThirdParty/Ert/python/python/ert/enkf/plot_data/pca_plot_vector.py deleted file mode 100644 index 3db1936c22..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot_data/pca_plot_vector.py +++ /dev/null @@ -1,64 +0,0 @@ -from cwrap import BaseCClass - -from ert.enkf import EnkfPrototype -from ert.util import Matrix - - -class PcaPlotVector(BaseCClass): - TYPE_NAME = "pca_plot_vector" - - _alloc = EnkfPrototype("void* pca_plot_vector_alloc(int, matrix, matrix)", bind = False) - _size = EnkfPrototype("int pca_plot_vector_get_size(pca_plot_vector)") - _get = EnkfPrototype("double pca_plot_vector_iget_sim_value(pca_plot_vector, int)") - _get_obs = EnkfPrototype("double pca_plot_vector_get_obs_value(pca_plot_vector)") - _get_singular_value = EnkfPrototype("double pca_plot_vector_get_singular_value(pca_plot_vector)") - _free = EnkfPrototype("void pca_plot_vector_free(pca_plot_vector)") - - - def __init__(self, component, principal_component_matrix, observation_principal_component_matrix): - assert isinstance(component, int) - assert isinstance(principal_component_matrix, Matrix) - assert isinstance(observation_principal_component_matrix, Matrix) - - c_pointer = self._alloc(component, principal_component_matrix, observation_principal_component_matrix) - super(PcaPlotVector, self).__init__(c_pointer) - - - def __len__(self): - """ @rtype: int """ - return self._size() - - - def __getitem__(self, index): - """ - @type index: int - @rtype: float - """ - assert isinstance(index, int) - return self._get(index) - - def __iter__(self): - cur = 0 - while cur < len(self): - yield self[cur] - cur += 1 - - def getObservation(self): - """ @rtype: float """ - return self._get_obs() - - def getSingularValue(self): - """ @rtype: float """ - return self._get_singular_value() - - - def free(self): - self._free() - - def __repr__(self): - si = len(self) - ob = self.getObservation() - sv = self.getSingularValue() - ad = self._ad_str() - fmt = 'PcaPlotVector(size = %d, observation = %f, singular = %f) %s' - return fmt % (si, ob, sv, ad) diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot_data/plot_block_data.py b/ThirdParty/Ert/python/python/ert/enkf/plot_data/plot_block_data.py deleted file mode 100644 index 1e270aa954..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot_data/plot_block_data.py +++ /dev/null @@ -1,44 +0,0 @@ -from ert.enkf.plot_data import PlotBlockVector -from ert.util import DoubleVector - - -class PlotBlockData(object): - - def __init__(self, depth_vector): - """ - @type depth_vector: DoubleVector - """ - assert isinstance(depth_vector, DoubleVector) - self.__depth_vector = depth_vector - self.__plot_block_vectors = {} - - - def __len__(self): - """ @rtype: int """ - return len(self.__plot_block_vectors) - - - def __getitem__(self, index): - """ - @type index: int - @rtype: PlotBlockVector - """ - return self.__plot_block_vectors[index] - - def __iter__(self): - cur = 0 - keys = sorted(self.__plot_block_vectors.keys()) - while cur < len(keys): - yield self[keys[cur]] - cur += 1 - - def getDepth(self): - """ @rtype: DoubleVector """ - return self.__depth_vector - - - def addPlotBlockVector(self, vector): - """ - @type vector: PlotBlockVector - """ - self.__plot_block_vectors[vector.getRealizationNumber()] = vector diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot_data/plot_block_data_loader.py b/ThirdParty/Ert/python/python/ert/enkf/plot_data/plot_block_data_loader.py deleted file mode 100644 index d59f2aee65..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot_data/plot_block_data_loader.py +++ /dev/null @@ -1,98 +0,0 @@ -from ert.enkf import RealizationStateEnum, EnkfNode, ErtImplType, NodeId -from ert.enkf.plot_data import PlotBlockData, PlotBlockVector -from ert.util import DoubleVector, BoolVector, ThreadPool - - -class PlotBlockDataLoader(object): - - def __init__(self, obs_vector): - """ - @type obs_vector: ObsVector - """ - if obs_vector is None: - raise ArgumentError('Cannot construct PlotBlockDataLoader without obs_vector. Was None.') - super(PlotBlockDataLoader, self).__init__() - self.__obs_vector = obs_vector - self.__permutation_vector = None - - - def getBlockObservation(self, report_step): - """ @rtype: BlockObservation """ - return self.__obs_vector.getNode(report_step) - - - def getDepthValues(self, report_step): - """ @rtype: DoubleVector """ - block_obs = self.getBlockObservation(report_step) - - depth = DoubleVector() - for index in block_obs: - value = block_obs.getDepth(index) - depth.append(value) - - return depth - - - def load(self, fs, report_step, input_mask=None): - """ - @type fs: EnkfFs - @type report_step: int - @type input_mask: BoolVector - @rtype: PlotBlockData - """ - - state_map = fs.getStateMap() - ensemble_size = len(state_map) - - if not input_mask is None: - mask = BoolVector.copy(input_mask) - else: - mask = BoolVector(False, ensemble_size) - - state_map.selectMatching(mask, RealizationStateEnum.STATE_HAS_DATA) - - depth = self.getDepthValues(report_step) - - self.__permutation_vector = depth.permutationSort() - depth.permute(self.__permutation_vector) - - plot_block_data = PlotBlockData(depth) - - thread_pool = ThreadPool() - for index in range(ensemble_size): - if mask[index]: - thread_pool.addTask(self.loadVector, plot_block_data, fs, report_step, index) - - thread_pool.nonBlockingStart() - thread_pool.join() - - return plot_block_data - - - def loadVector(self, plot_block_data, fs, report_step, realization_number): - """ - @type plot_block_data: PlotBlockData - @type fs: EnkfFs - @type report_step: int - @type realization_number: int - @rtype PlotBlockVector - """ - config_node = self.__obs_vector.getConfigNode() - - is_private_container = config_node.getImplementationType() == ErtImplType.CONTAINER - data_node = EnkfNode(config_node, private=is_private_container) - - node_id = NodeId(report_step, realization_number) - - if data_node.tryLoad(fs, node_id): - block_obs = self.getBlockObservation(report_step) - - data = DoubleVector() - for index in range(len(block_obs)): - value = block_obs.getData(data_node.valuePointer(), index, node_id) - data.append(value) - data.permute(self.__permutation_vector) - - plot_block_vector = PlotBlockVector(realization_number, data) - plot_block_data.addPlotBlockVector(plot_block_vector) - diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot_data/plot_block_vector.py b/ThirdParty/Ert/python/python/ert/enkf/plot_data/plot_block_vector.py deleted file mode 100644 index 855bdbb8a1..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot_data/plot_block_vector.py +++ /dev/null @@ -1,39 +0,0 @@ -from ert.util import DoubleVector - - -class PlotBlockVector(object): - def __init__(self, realization_number, data): - """ - @type realization_number: int - @type data: DoubleVector - """ - super(PlotBlockVector, self).__init__() - - assert isinstance(data, DoubleVector) - - self.__realization_number = realization_number - self.__data = data - - def __len__(self): - """ @rtype: int """ - return len(self.__data) - - - def __getitem__(self, index): - """ @rtype: float """ - assert isinstance(index, int) - return self.__data[index] - - - def __iter__(self): - """ @rtype: float """ - cur = 0 - while cur < len(self): - yield self[cur] - cur += 1 - - - def getRealizationNumber(self): - """ @rtype: int """ - return self.__realization_number - diff --git a/ThirdParty/Ert/python/python/ert/enkf/plot_settings.py b/ThirdParty/Ert/python/python/ert/enkf/plot_settings.py deleted file mode 100644 index b9c7600590..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/plot_settings.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'plot_config.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass -from ert.config import ConfigSettings -from ert.enkf import EnkfPrototype - -class PlotSettings(ConfigSettings): - TYPE_NAME = "plot_settings" - _init = EnkfPrototype("void plot_settings_init(plot_settings)") - - def __init__(self): - super(PlotSettings, self).__init__("PLOT_SETTING") - self._init( ) - - def getPath(self): - """ @rtype: str """ - return self["PATH"] - - def setPath(self, path): - self["PATH"] = path - - diff --git a/ThirdParty/Ert/python/python/ert/enkf/run_arg.py b/ThirdParty/Ert/python/python/ert/enkf/run_arg.py deleted file mode 100644 index 26fe077fa4..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/run_arg.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (C) 2014 Statoil ASA, Norway. -# -# The file 'run_arg.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype - -class RunArg(BaseCClass): - TYPE_NAME = "run_arg" - - _alloc_ENSEMBLE_EXPERIMENT = EnkfPrototype("run_arg_obj run_arg_alloc_ENSEMBLE_EXPERIMENT(enkf_fs , int, int, char*)", bind = False) - _free = EnkfPrototype("void run_arg_free(run_arg)") - _get_queue_index = EnkfPrototype("int run_arg_get_queue_index(run_arg)") - _is_submitted = EnkfPrototype("bool run_arg_is_submitted(run_arg)") - - def __init__(self): - raise NotImplementedError("Cannot instantiat RunArg directly!") - - @classmethod - def createEnsembleExperimentRunArg(cls, fs, iens, runpath, iter=0): - return cls._alloc_ENSEMBLE_EXPERIMENT(fs, iens, iter, runpath) - - def free(self): - self._free() - - def getQueueIndex(self): - return self._get_queue_index() - - def isSubmitted(self): - return self._is_submitted() - - def __repr__(self): - su = 'submitted' if self.isSubmitted() else 'not submitted' - qi = self.getQueueIndex() - return 'RunArg(queue_index = %d, %s) %s' % (qi, su, self._ad_str()) diff --git a/ThirdParty/Ert/python/python/ert/enkf/runpath_list.py b/ThirdParty/Ert/python/python/ert/enkf/runpath_list.py deleted file mode 100644 index af370d5df4..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/runpath_list.py +++ /dev/null @@ -1,86 +0,0 @@ -from collections import namedtuple -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype - -RunpathNode = namedtuple("RunpathNode", ["realization", "iteration", "runpath", "basename"]) - -class RunpathList(BaseCClass): - TYPE_NAME = "runpath_list" - _alloc = EnkfPrototype("void* runpath_list_alloc(char*)" , bind = False) - _free = EnkfPrototype("void runpath_list_free(runpath_list)") - _add = EnkfPrototype("void runpath_list_add(runpath_list, int, int, char*, char*)") - _clear = EnkfPrototype("void runpath_list_clear(runpath_list)") - _size = EnkfPrototype("int runpath_list_size(runpath_list)") - _iens = EnkfPrototype("int runpath_list_iget_iens(runpath_list, int)") - _iteration = EnkfPrototype("int runpath_list_iget_iter(runpath_list, int)") - _runpath = EnkfPrototype("char* runpath_list_iget_runpath(runpath_list, int)") - _basename = EnkfPrototype("char* runpath_list_iget_basename(runpath_list, int)") - _export = EnkfPrototype("void runpath_list_fprintf(runpath_list)") - - _get_export_file = EnkfPrototype("char* runpath_list_get_export_file(runpath_list)") - _set_export_file = EnkfPrototype("void runpath_list_set_export_file(runpath_list, char*)") - - def __init__(self, export_file): - c_ptr = self._alloc( export_file ) - if c_ptr: - super(RunpathList , self).__init__(c_ptr) - else: - raise ValueError('Could not construct RunpathList with export_file "%s".' % export_file) - - def __len__(self): - return self._size( ) - - def __getitem__(self, index): - """ @rtype: RunpathNode """ - ls = len(self) - if isinstance(index, int): - idx = index - if idx < 0: - idx += ls - if not 0 <= idx < ls: - raise IndexError("Index not in range: 0 <= %d < %d" % (index, ls)) - realization = self._iens(idx) - iteration = self._iteration(idx) - runpath = self._runpath(idx) - basename = self._basename(idx) - return RunpathNode(realization, iteration, runpath, basename) - elif isinstance(index, slice): - return [self[i] for i in range(*index.indices(ls))] - raise TypeError('List indices must be integers, not %s.' % str(type(index))) - - - def __iter__(self): - index = 0 - while index < len(self): - yield self[index] - index += 1 - - def getExportFile(self): - return self._get_export_file( ) - - - def setExportFile(self , export_file): - self._set_export_file( export_file ) - - - def add(self, realization_number, iteration_number, runpath, basename): - """ - @type realization_number: int - @type iteration_number: int - @type runpath: int - @type basename: int - """ - self._add(realization_number, iteration_number, runpath, basename) - - def clear(self): - self._clear( ) - - - def free(self): - self._free( ) - - def __repr__(self): - return 'RunpathList(size = %d) %s' % (len(self), self._ad_str()) - - def export(self): - self._export( ) diff --git a/ThirdParty/Ert/python/python/ert/enkf/site_config.py b/ThirdParty/Ert/python/python/ert/enkf/site_config.py deleted file mode 100644 index 5d28e2d192..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/site_config.py +++ /dev/null @@ -1,196 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'site_config.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.job_queue import JobQueue, ExtJoblist -from ert.util import StringList, Hash - - -class SiteConfig(BaseCClass): - TYPE_NAME = "site_config" - - _free = EnkfPrototype("void site_config_free( site_config )") - _get_queue_name = EnkfPrototype("char* site_config_get_queue_name(site_config)") - _get_lsf_queue = EnkfPrototype("char* site_config_get_lsf_queue(site_config)") - _set_lsf_queue = EnkfPrototype("void site_config_set_lsf_queue(site_config, char*)") - _get_max_running_lsf = EnkfPrototype("int site_config_get_max_running_lsf(site_config)") - _set_max_running_lsf = EnkfPrototype("void site_config_set_max_running_lsf(site_config, int)") - _get_lsf_request = EnkfPrototype("char* site_config_get_lsf_request(site_config)") - _set_lsf_request = EnkfPrototype("void site_config_set_lsf_request(site_config, char*)") - _get_rsh_command = EnkfPrototype("char* site_config_get_rsh_command(site_config)") - _set_rsh_command = EnkfPrototype("void site_config_set_rsh_command(site_config, char*)") - _get_max_running_rsh = EnkfPrototype("int site_config_get_max_running_rsh(site_config)") - _set_max_running_rsh = EnkfPrototype("void site_config_set_max_running_rsh(site_config, int)") - _get_rsh_host_list = EnkfPrototype("integer_hash_ref site_config_get_rsh_host_list(site_config)") - _clear_rsh_host_list = EnkfPrototype("void site_config_clear_rsh_host_list(site_config)") - _add_rsh_host = EnkfPrototype("void site_config_add_rsh_host(site_config, char*, int)") - _get_max_running_local = EnkfPrototype("int site_config_get_max_running_local(site_config)") - _set_max_running_local = EnkfPrototype("void site_config_set_max_running_local(site_config, int)") - _get_installed_jobs = EnkfPrototype("ext_joblist_ref site_config_get_installed_jobs(site_config)") - _get_max_submit = EnkfPrototype("int site_config_get_max_submit(site_config)") - _set_max_submit = EnkfPrototype("void site_config_set_max_submit(site_config, int)") - _get_license_root_path = EnkfPrototype("char* site_config_get_license_root_path(site_config)") - _set_license_root_path = EnkfPrototype("void site_config_set_license_root_path(site_config, char*)") - _get_job_script = EnkfPrototype("char* site_config_get_job_script(site_config)") - _set_job_script = EnkfPrototype("void site_config_set_job_script(site_config, char*)") - _get_env_hash = EnkfPrototype("string_hash_ref site_config_get_env_hash(site_config)") - _clear_env = EnkfPrototype("void site_config_clear_env(site_config)") - _setenv = EnkfPrototype("void site_config_setenv(site_config, char*, char*)") - _get_path_variables = EnkfPrototype("stringlist_ref site_config_get_path_variables(site_config)") - _get_path_values = EnkfPrototype("stringlist_ref site_config_get_path_values(site_config)") - _clear_pathvar = EnkfPrototype("void site_config_clear_pathvar(site_config)") - _update_pathvar = EnkfPrototype("void site_config_update_pathvar(site_config, char*, char*)") - _get_job_queue = EnkfPrototype("job_queue_ref site_config_get_job_queue(site_config)") - _queue_is_running = EnkfPrototype("bool site_config_queue_is_running(site_config)") - _get_location = EnkfPrototype("char* site_config_get_location(site_config)") - _has_driver = EnkfPrototype("bool site_config_has_queue_driver(site_config, char*)") - - - - def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") - - def getQueueName(self): - """ @rtype: str """ - return self._get_queue_name( ) - - def setJobQueue(self, queue): - raise Exception("The function setJobQueue() is not properly implemented") - - - def hasDriver(self, driver_name): - return self._has_driver( driver_name ) - - - def getLsfQueue(self): - """ @rtype: str """ - return self._get_lsf_queue( ) - - def setLsfQueue(self, queue): - self._set_lsf_queue( queue) - - def getMaxRunningLsf(self): - """ @rtype: int """ - return self._get_max_running_lsf( ) - - def setMaxRunningLsf(self, max_running): - self._set_max_running_lsf( max_running) - - def getLsfRequest(self): - """ @rtype: str """ - return self._get_lsf_request( ) - - def setLsfRequest(self, lsf_request): - self._set_lsf_request( lsf_request) - - def clearRshHostList(self): - self._clear_rsh_host_list( ) - - def getRshCommand(self): - """ @rtype: str """ - return self._get_rsh_command( ) - - def set_rsh_command(self, rsh_command): - self._set_rsh_command( rsh_command) - - def getMaxRunningRsh(self): - """ @rtype: int """ - return self._get_max_running_rsh( ) - - def setMaxRunningRsh(self, max_running): - self._set_max_running_rsh( max_running) - - def getMaxRunningLocal(self): - """ @rtype: int """ - return self._get_max_running_local( ) - - def setMaxRunningLocal(self, max_running): - self._set_max_running_local( max_running) - - def get_job_script(self): - """ @rtype: str """ - return self._get_job_script( ) - - def set_job_script(self, job_script): - self._set_job_script( job_script) - - def get_env_hash(self): - """ @rtype: StringHash """ - return self._get_env_hash( ) - - def setenv(self, var, value): - self._setenv( var, value) - - def clear_env(self): - self._clear_env( ) - - def get_path_variables(self): - """ @rtype: StringList """ - return self._get_path_variables().setParent(self) - - def get_path_values(self): - """ @rtype: StringList """ - return self._get_path_values().setParent(self) - - def clear_pathvar(self): - self._clear_pathvar( ) - - def update_pathvar(self, pathvar, value): - self._update_pathvar( pathvar, value) - - def get_installed_jobs(self): - """ @rtype: ExtJoblist """ - return self._get_installed_jobs().setParent(self) - - def get_max_submit(self): - """ @rtype: int """ - return self._get_max_submit( ) - - def set_max_submit(self, max_value): - self._set_max_submit( max_value) - - def get_license_root_path(self): - """ @rtype: str """ - return self._get_license_root_path( ) - - def set_license_root_pathmax_submit(self, path): - self._set_license_root_path( path) - - def isQueueRunning(self): - """ @rtype: bool """ - return self._queue_is_running( ) - - def getJobQueue(self): - """ @rtype: JobQueue """ - return self._get_job_queue().setParent(self) - - def getRshHostList(self): - """ @rtype: IntegerHash """ - host_list = self._get_rsh_host_list() - return host_list - - def addRshHost(self, host, max_running): - self._add_rsh_host(host, max_running) - - def getLocation(self): - """ @rtype: str """ - return self._get_location() - - - def free(self): - self._free() - - diff --git a/ThirdParty/Ert/python/python/ert/enkf/state_map.py b/ThirdParty/Ert/python/python/ert/enkf/state_map.py deleted file mode 100644 index b6ba3c50d9..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/state_map.py +++ /dev/null @@ -1,143 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'enkf_fs.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.enkf.enums import RealizationStateEnum -from ert.util import BoolVector - - -class StateMap(BaseCClass): - TYPE_NAME = "state_map" - - _alloc = EnkfPrototype("void* state_map_alloc()", bind = False) - _fread = EnkfPrototype("bool state_map_fread(state_map , char*)") - _fwrite = EnkfPrototype("void state_map_fwrite(state_map , char*)") - _equal = EnkfPrototype("bool state_map_equal(state_map , state_map)") - _free = EnkfPrototype("void state_map_free(state_map)") - _size = EnkfPrototype("int state_map_get_size(state_map)") - _iget = EnkfPrototype("realisation_state_enum state_map_iget(state_map, int)") - _iset = EnkfPrototype("void state_map_iset(state_map, int, realisation_state_enum)") - _select_matching = EnkfPrototype("void state_map_select_matching(state_map, bool_vector, realisation_state_enum)") - _is_read_only = EnkfPrototype("bool state_map_is_readonly(state_map)") - _is_legal_transition = EnkfPrototype("bool state_map_legal_transition(realisation_state_enum, realisation_state_enum)", bind = False) - - - - def __init__(self , filename = None): - c_ptr = self._alloc() - super(StateMap, self).__init__(c_ptr) - if filename: - self.load(filename) - - - def __len__(self): - """ @rtype: int """ - return self._size() - - def __iter__(self): - index = 0 - size = len(self) - - while index < size: - yield self[index] - index += 1 - - def __eq__(self , other): - return self._equal(other) - - - def __getitem__(self, index): - """ @rtype: RealizationStateEnum """ - if not isinstance(index, int): - raise TypeError("Expected an integer") - - size = len(self) - if index < 0: - index += size - if 0 <= index < size: - return self._iget(index) - raise IndexError("Invalid index. Valid range: [0, %d)" % size) - - - def __setitem__(self, index, value): - if self.isReadOnly(): - raise UserWarning("This State Map is read only!") - - if not isinstance(index, int): - raise TypeError("Expected an integer") - - if not isinstance(value, RealizationStateEnum): - raise TypeError("Expected a RealizationStateEnum") - - if index < 0: - index += len(self) - if index < 0: - raise IndexError("Index out of range: %d < 0" % index) - - self._iset(index, value) - - @classmethod - def isLegalTransition(cls, realization_state1, realization_state2): - """ @rtype: bool """ - - if not isinstance(realization_state1, RealizationStateEnum) or not isinstance(realization_state2, RealizationStateEnum): - raise TypeError("Expected a RealizationStateEnum") - - return cls._is_legal_transition(realization_state1, realization_state2) - - - def isReadOnly(self): - """ @rtype: bool """ - return self._is_read_only() - - def selectMatching(self, select_target, select_mask): - """ - @type select_target: BoolVector - @type select_mask: RealizationStateEnum - """ - assert isinstance(select_target, BoolVector) - assert isinstance(select_mask, RealizationStateEnum) - - self._select_matching(select_target, select_mask) - - - def realizationList(self , state_value): - """ - Will create a list of all realisations with state equal to state_value. - - @type state_value: RealizationStateEnum - @rtype: ert.util.IntVector - """ - mask = BoolVector(False, len(self)) - self.selectMatching(mask, state_value) - return BoolVector.createActiveList(mask) - - - - def free(self): - self._free() - - def __repr__(self): - ro = 'read only' if self.isReadOnly() else 'read/write' - return 'StateMap(size = %d, %s) %s' % (len(self), ro, self._ad_str()) - - def load(self,filename): - if not self._fread(filename): - raise IOError("Failed to load state map from:%s" % filename) - - - def save(self, filename): - self._fwrite(filename) diff --git a/ThirdParty/Ert/python/python/ert/enkf/summary_key_matcher.py b/ThirdParty/Ert/python/python/ert/enkf/summary_key_matcher.py deleted file mode 100644 index bc030a31d9..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/summary_key_matcher.py +++ /dev/null @@ -1,41 +0,0 @@ -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.util import StringList - - -class SummaryKeyMatcher(BaseCClass): - TYPE_NAME = "summary_key_matcher" - - _alloc = EnkfPrototype("void* summary_key_matcher_alloc()", bind = False) - _free = EnkfPrototype("void summary_key_matcher_free(summary_key_matcher)") - _size = EnkfPrototype("int summary_key_matcher_get_size(summary_key_matcher)") - _add_key = EnkfPrototype("void summary_key_matcher_add_summary_key(summary_key_matcher, char*)") - _match_key = EnkfPrototype("bool summary_key_matcher_match_summary_key(summary_key_matcher, char*)") - _keys = EnkfPrototype("stringlist_obj summary_key_matcher_get_keys(summary_key_matcher)") - _is_required = EnkfPrototype("bool summary_key_matcher_summary_key_is_required(summary_key_matcher, char*)") - - def __init__(self): - c_ptr = self._alloc() - - super(SummaryKeyMatcher, self).__init__(c_ptr) - - def addSummaryKey(self, key): - assert isinstance(key, str) - return self._add_key(key) - - def __len__(self): - return self._size() - - def __contains__(self, key): - return self._match_key(key) - - def isRequired(self, key): - """ @rtype: bool """ - return self._is_required(key) - - def keys(self): - """ @rtype: StringList """ - return self._keys() - - def free(self): - self._free() diff --git a/ThirdParty/Ert/python/python/ert/enkf/summary_key_set.py b/ThirdParty/Ert/python/python/ert/enkf/summary_key_set.py deleted file mode 100644 index 81e294ba5c..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/summary_key_set.py +++ /dev/null @@ -1,51 +0,0 @@ -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.util import StringList - - -class SummaryKeySet(BaseCClass): - TYPE_NAME = "summary_key_set" - - _alloc = EnkfPrototype("void* summary_key_set_alloc()", bind = False) - _alloc_from_file = EnkfPrototype("void* summary_key_set_alloc_from_file(char*, bool)", bind = False) - _free = EnkfPrototype("void summary_key_set_free(summary_key_set)") - _size = EnkfPrototype("int summary_key_set_get_size(summary_key_set)") - _add_key = EnkfPrototype("bool summary_key_set_add_summary_key(summary_key_set, char*)") - _has_key = EnkfPrototype("bool summary_key_set_has_summary_key(summary_key_set, char*)") - _keys = EnkfPrototype("stringlist_obj summary_key_set_alloc_keys(summary_key_set)") - _is_read_only = EnkfPrototype("bool summary_key_set_is_read_only(summary_key_set)") - _fwrite = EnkfPrototype("void summary_key_set_fwrite(summary_key_set, char*)") - - def __init__(self, filename=None, read_only=False): - if filename is None: - c_ptr = self._alloc() - else: - c_ptr = self._alloc_from_file(filename, read_only) - - super(SummaryKeySet, self).__init__(c_ptr) - - def addSummaryKey(self, key): - assert isinstance(key, str) - return self._add_key(key) - - def __len__(self): - return self._size() - - def __contains__(self, key): - return self._has_key(key) - - def keys(self): - """ @rtype: StringList """ - return self._keys() - - def isReadOnly(self): - """ @rtype: bool """ - return self._is_read_only() - - - def writeToFile(self, filename): - assert isinstance(filename, str) - self._fwrite(filename) - - def free(self): - self._free() diff --git a/ThirdParty/Ert/python/python/ert/enkf/util/CMakeLists.txt b/ThirdParty/Ert/python/python/ert/enkf/util/CMakeLists.txt deleted file mode 100644 index 7a0c3e95c6..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/util/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - time_map.py -) - -add_python_package("python.ert.enkf.util" ${PYTHON_INSTALL_PREFIX}/ert/enkf/util "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert/enkf/util/__init__.py b/ThirdParty/Ert/python/python/ert/enkf/util/__init__.py deleted file mode 100644 index c3ce9ffc8a..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/util/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .time_map import TimeMap \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert/enkf/util/time_map.py b/ThirdParty/Ert/python/python/ert/enkf/util/time_map.py deleted file mode 100644 index 0da3a8e530..0000000000 --- a/ThirdParty/Ert/python/python/ert/enkf/util/time_map.py +++ /dev/null @@ -1,209 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'time_map.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -import os -import errno - -from cwrap import BaseCClass -from ert.enkf import EnkfPrototype -from ert.util import CTime - - -class TimeMap(BaseCClass): - TYPE_NAME = "time_map" - - _fread_alloc_readonly = EnkfPrototype("void* time_map_fread_alloc_readonly(char*)", bind = False) - _alloc = EnkfPrototype("void* time_map_alloc()", bind = False) - _load = EnkfPrototype("bool time_map_fread(time_map , char*)") - _save = EnkfPrototype("void time_map_fwrite(time_map , char*)") - _fload = EnkfPrototype("bool time_map_fscanf(time_map , char*)") - _iget_sim_days = EnkfPrototype("double time_map_iget_sim_days(time_map, int)") - _iget = EnkfPrototype("time_t time_map_iget(time_map, int)") - _size = EnkfPrototype("int time_map_get_size(time_map)") - _try_update = EnkfPrototype("bool time_map_try_update(time_map , int , time_t)") - _is_strict = EnkfPrototype("bool time_map_is_strict( time_map )") - _set_strict = EnkfPrototype("void time_map_set_strict( time_map , bool)") - _lookup_time = EnkfPrototype("int time_map_lookup_time( time_map , time_t)") - _lookup_time_with_tolerance = EnkfPrototype("int time_map_lookup_time_with_tolerance( time_map , time_t , int , int)") - _lookup_days = EnkfPrototype("int time_map_lookup_days( time_map , double)") - _last_step = EnkfPrototype("int time_map_get_last_step( time_map )") - _upgrade107 = EnkfPrototype("void time_map_summary_upgrade107( time_map , ecl_sum )") - _free = EnkfPrototype("void time_map_free( time_map )") - - def __init__(self, filename = None): - c_ptr = self._alloc() - super(TimeMap, self).__init__(c_ptr) - if filename: - self.load(filename) - - - def load(self, filename): - if os.path.isfile( filename ): - self._load(filename) - else: - raise IOError(( errno.ENOENT , "File not found: %s" % filename)) - - - def fwrite(self, filename): - self._save(filename) - - - def fload(self , filename): - """ - Will load a timemap as a formatted file consisting of a list of dates: DD/MM/YYYY - """ - if os.path.isfile( filename ): - OK = self._fload(filename) - if not OK: - raise Exception("Error occured when loading timemap from:%s" % filename) - else: - raise IOError(( errno.ENOENT , "File not found: %s" % filename)) - - - - def isStrict(self): - return self._is_strict() - - - def setStrict(self , strict): - return self._set_strict(strict) - - - def getSimulationDays(self, step): - """ @rtype: double """ - if not isinstance(step, int): - raise TypeError("Expected an integer") - - size = len(self) - if step < 0 or step >= size: - raise IndexError("Index out of range: 0 <= %d < %d" % (step, size)) - - return self._iget_sim_days(step) - - - def __getitem__(self, index): - """ @rtype: CTime """ - if not isinstance(index, int): - raise TypeError("Expected an integer") - - size = len(self) - if index < 0 or index >= size: - raise IndexError("Index out of range: 0 <= %d < %d" % (index, size)) - - return self._iget(index) - - def __setitem__(self , index , time): - self.update( index , time ) - - - def update(self , index , time): - if self._try_update(index , CTime(time)): - return True - else: - if self.isStrict(): - raise Exception("Tried to update with inconsistent value") - else: - return False - - - - def __iter__(self): - cur = 0 - - while cur < len(self): - yield self[cur] - cur += 1 - - def __contains__(self , time): - index = self._lookup_time(CTime(time)) - if index >= 0: - return True - else: - return False - - - def lookupTime(self , time , tolerance_seconds_before = 0, tolerance_seconds_after = 0): - """Will look up the report step corresponding to input @time. - - If the tolerance arguments tolerance_seconds_before and - tolerance_seconds_after have the default value zero we require - an exact match between input time argument and the content of - the time map. - - If the tolerance arguments are supplied the function will - search through the time_map for the report step closest to the - time argument, which satisfies the tolerance criteria. - - With the call: - - lookupTime( datetime.date(2010,1,10) , 3600*24 , 3600*7) - - We will find the report step in the date interval 2010,1,9 - - 2010,1,17 which is closest to 2010,1,10. The tolerance limits - are inclusive. - - If no report step satisfying the criteria is found a - ValueError exception will be raised. - - """ - if tolerance_seconds_before == 0 and tolerance_seconds_after == 0: - index = self._lookup_time(CTime(time)) - else: - index = self._lookup_time_with_tolerance(CTime(time) , tolerance_seconds_before , tolerance_seconds_after) - - if index >= 0: - return index - else: - raise ValueError("The time:%s was not found in the time_map instance" % time) - - - def lookupDays(self , days): - index = self._lookup_days(days) - if index >= 0: - return index - else: - raise ValueError("The days: %s was not found in the time_map instance" % days) - - - def __len__(self): - """ @rtype: int """ - return self._size() - - def free(self): - self._free() - - def __repr__(self): - ls = len(self) - la = self.getLastStep() - st = 'strict' if self.isStrict() else 'not strict' - cnt = 'size = %d, last_step = %d, %s' % (ls, la, st) - return self._create_repr(cnt) - - def dump(self): - """ - Will return a list of tuples (step , CTime , days). - """ - step_list = [] - for step,t in enumerate(self): - step_list.append( (step , t , self.getSimulationDays( step )) ) - return step_list - - - def getLastStep(self): - return self._last_step() - - - def upgrade107(self, refcase): - self._upgrade107(refcase) diff --git a/ThirdParty/Ert/python/python/ert/job_queue/CMakeLists.txt b/ThirdParty/Ert/python/python/ert/job_queue/CMakeLists.txt deleted file mode 100644 index 4fd89b4318..0000000000 --- a/ThirdParty/Ert/python/python/ert/job_queue/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - driver.py - ert_plugin.py - ert_script.py - ext_job.py - ext_joblist.py - external_ert_script.py - forward_model.py - function_ert_script.py - job.py - job_status_type_enum.py - queue.py - job_queue_manager.py - workflow.py - workflow_job.py - workflow_joblist.py - workflow_runner.py -) - -add_python_package("python.ert.job_queue" ${PYTHON_INSTALL_PREFIX}/ert/job_queue "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert/job_queue/__init__.py b/ThirdParty/Ert/python/python/ert/job_queue/__init__.py deleted file mode 100644 index 82ab36a03e..0000000000 --- a/ThirdParty/Ert/python/python/ert/job_queue/__init__.py +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file '__init__.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -""" -The job_queue package contains modules and classes for running -external commands. -""" - -# Getting LSF to work properly is quite painful. The situation -# is a mix of build complexity and LSF specific requirements: -# -# 1. The LSF libraries are accessed from the libjob_queue.so -# library, but observe that the dependancy on the liblsf and -# libbat libraries is through dlopen(), i.e. runtime. This module -# will therefor load happily without access to the lsf libraries. -# -# If you at a later stage create a lsf driver the runtime -# environment must be able to locate the liblsf.so, libbat.so and -# libnsl.so shared libraries, either through LD_LIBRARY_PATH or -# other means. -# -# 2. To actually use LSF you need a whole list of environment -# variables to be set: LSF_BINDIR , LSF_LIBDIR , XLDF_UIDDIR , -# LSF_SERVERDIR, LSF_ENVDIR - this is an LSF requirement and not -# related to ERT or the Python bindings. The normal way to -# achieve this is by sourcing a shell script. -# -# If the environment variable LSF_HOME is set we set the -# remaining LSF variables according to: -# -# LSF_BINDIR = $LSF_HOME/bin -# LSF_LIBDIR = $LSF_HOME/lib -# XLSF_UIDDIR = $LSF_HOME/lib/uid -# LSF_SERVERDIR = $LSF_HOME/etc -# LSF_ENVDIR = $LSF_HOME/conf -# PATH = $PATH:$LSF_BINDIR -# -# Observe that none of these variables are modified if they -# already have a value, furthermore it should be observed that -# the use of an LSF_HOME variable is something invented with ERT, -# and not standard LSF approach. - - -import os -import ert -import ert.util -import ert.config -from cwrap import Prototype - -def setenv( var, value): - if not os.getenv(var): - os.environ[var] = value - -# Set up the full LSF environment - based onf LSF_HOME -LSF_HOME = os.getenv("LSF_HOME") -if LSF_HOME: - setenv("LSF_BINDIR", "%s/bin" % LSF_HOME) - setenv("LSF_LIBDIR", "%s/lib" % LSF_HOME) - setenv("XLSF_UIDDIR", "%s/lib/uid" % LSF_HOME) - setenv("LSF_SERVERDIR", "%s/etc" % LSF_HOME) - setenv("LSF_ENVDIR", "%s/conf" % LSF_HOME) # This is wrong: Statoil: /prog/LSF/conf - -JOB_QUEUE_LIB = ert.load("libjob_queue") - -class QueuePrototype(Prototype): - lib = ert.load("libjob_queue") - - def __init__(self, prototype, bind=True): - super(QueuePrototype, self).__init__(QueuePrototype.lib, prototype, bind=bind) - - -#from .job_status_type_enum import JobStatusType -from .job_status_type_enum import JobStatusType -from .job import Job -from .queue import JobQueue -from .job_queue_manager import JobQueueManager -from .driver import QueueDriverEnum, Driver, LSFDriver, RSHDriver, LocalDriver -from .ext_job import ExtJob -from .ext_joblist import ExtJoblist -from .forward_model import ForwardModel - -from .ert_script import ErtScript -from .ert_plugin import ErtPlugin, CancelPluginException -from .function_ert_script import FunctionErtScript -from .external_ert_script import ExternalErtScript - -from .workflow_job import WorkflowJob -from .workflow_joblist import WorkflowJoblist -from .workflow import Workflow -from .workflow_runner import WorkflowRunner diff --git a/ThirdParty/Ert/python/python/ert/job_queue/driver.py b/ThirdParty/Ert/python/python/ert/job_queue/driver.py deleted file mode 100644 index 2f6e58b39a..0000000000 --- a/ThirdParty/Ert/python/python/ert/job_queue/driver.py +++ /dev/null @@ -1,158 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'driver.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - - -import ctypes -from cwrap import BaseCClass, BaseCEnum -from ert.job_queue import JOB_QUEUE_LIB, QueuePrototype -from ert.job_queue import Job - - -class QueueDriverEnum(BaseCEnum): - TYPE_NAME="queue_driver_enum" - NULL_DRIVER = None - LSF_DRIVER = None - LOCAL_DRIVER = None - RSH_DRIVER = None - TORQUE_DRIVER = None - -QueueDriverEnum.addEnum( "NULL_DRIVER" , 0 ) -QueueDriverEnum.addEnum( "LSF_DRIVER" , 1 ) -QueueDriverEnum.addEnum( "LOCAL_DRIVER" , 2 ) -QueueDriverEnum.addEnum( "RSH_DRIVER" , 3 ) -QueueDriverEnum.addEnum( "TORQUE_DRIVER" , 4 ) - - -LSF_DRIVER = QueueDriverEnum.LSF_DRIVER -RSH_DRIVER = QueueDriverEnum.RSH_DRIVER -LOCAL_DRIVER = QueueDriverEnum.LOCAL_DRIVER - - - -class Driver(BaseCClass): - TYPE_NAME = "driver" - _alloc = QueuePrototype("void* queue_driver_alloc( queue_driver_enum )" , bind = False) - _free = QueuePrototype("void queue_driver_free( driver )") - _set_option = QueuePrototype("void queue_driver_set_option( driver , char* , char*)") - _submit = QueuePrototype("void* queue_driver_submit_job( driver , char* , int , char* , char* , int , char**)") - _free_job = QueuePrototype("void queue_driver_free_job( driver , job )") - _get_status = QueuePrototype("int queue_driver_get_status( driver , job)") - _kill_job = QueuePrototype("void queue_driver_kill_job( driver , job )") - _get_max_running = QueuePrototype("int queue_driver_get_max_running( driver )") - _set_max_running = QueuePrototype("void queue_driver_set_max_running( driver , int)") - _get_name = QueuePrototype("char* queue_driver_get_name( driver )") - - def __init__( self, driver_type, max_running=1, options=None): - """ - Creates a new driver instance - """ - c_ptr = self._alloc( driver_type ) - super(Driver , self).__init__(c_ptr) - if options: - for (key, value) in options: - self.set_option(key, value) - self.set_max_running(max_running) - - - def set_option(self, option, value): - """ - Set the driver option @option to @value. - - If the option is succlessfully set the method will return True, - otherwise the method will return False. If the @option is not - recognized the method will return False. The supplied value - should be a string. - """ - return self._set_option(option, str(value)) - - - def is_driver_instance( self ): - return True - - - def submit( self, name, cmd, run_path, argList, num_cpu=1, blocking=False): - argc = len(argList) - argv = (ctypes.c_char_p * argc)() - argv[:] = map(str, argList) - - c_ptr = self._submit(cmd, num_cpu, run_path, name, argc, argv) - job = Job( c_ptr , self ) - if blocking: - job.block() - job = None - return job - - - def free_job( self, job ): - self._free_job(job) - - def get_status( self, job ): - status = self._get_status(job) - return status - - def kill_job( self, job ): - self._kill_job(job) - - def get_max_running( self ): - return self._get_max_running( ) - - def set_max_running( self, max_running ): - self._set_max_running(max_running) - - max_running = property(get_max_running, set_max_running) - - @property - def name(self): - return self._get_name(self) - - def free(self): - self._free( ) - - -class LSFDriver(Driver): - def __init__(self, - max_running, - lsf_server=None, - queue="normal", - resource_request=None): - # The strings should match the available keys given in the - # lsf_driver.h header file. - options = [("LSF_QUEUE", queue), - ("LSF_SERVER", lsf_server), - ("LSF_RESOURCE", resource_request )] - Driver.__init__(self, QueueDriverEnum.LSF_DRIVER, max_running=max_running, options=options) - - -class LocalDriver(Driver): - def __init__( self, max_running ): - Driver.__init__(self, QueueDriverEnum.LOCAL_DRIVER, max_running, options=[]) - - -class RSHDriver(Driver): - # Changing shell to bash can come in conflict with running ssh - # commands. - - def __init__( self, max_running, rsh_host_list, rsh_cmd="/usr/bin/ssh" ): - """ - @rsh_host_list should be a list of tuples like: (hostname , max_running) - """ - - options = [("RSH_CMD", rsh_cmd)] - for (host, host_max) in rsh_host_list: - options.append(("RSH_HOST", "%s:%d" % (host, host_max))) - Driver.__init__(self, QueueDriverEnum.RSH_DRIVER, max_running, options=options) - - diff --git a/ThirdParty/Ert/python/python/ert/job_queue/ert_plugin.py b/ThirdParty/Ert/python/python/ert/job_queue/ert_plugin.py deleted file mode 100644 index b4b48e240c..0000000000 --- a/ThirdParty/Ert/python/python/ert/job_queue/ert_plugin.py +++ /dev/null @@ -1,48 +0,0 @@ -from .ert_script import ErtScript -from threading import Thread -import time - -class CancelPluginException(Exception): - def __init__(self, cancel_message): - super(CancelPluginException, self).__init__(cancel_message) - - -class ErtPlugin(ErtScript): - - def getArguments(self, parent=None): - """ @rtype: list """ - return [] - - def getName(self): - """ @rtype: str """ - return str(self.__class__) - - def getDescription(self): - """ @rtype: str """ - return "No description provided!" - - def checkIfCancelled(self): - if self.isCancelled(): - raise CancelPluginException("Plugin '%s' cancelled by user!" % self.getName()) - - def startCancellableThread(self, runFunction, cancelFunction): - runFunction.return_value = None - - def runFunctionWrapper(): - runFunction.return_value = runFunction() - - thread = Thread() - thread.run = runFunctionWrapper - thread.start() - - while thread.isAlive(): - if self.isCancelled(): - cancelFunction() - - try: - time.sleep(0.1) - except KeyboardInterrupt: - print("Plugin '%s' cancelled (CTRL+C)" % self.getName()) - self.cancel() - - return runFunction.return_value diff --git a/ThirdParty/Ert/python/python/ert/job_queue/ert_script.py b/ThirdParty/Ert/python/python/ert/job_queue/ert_script.py deleted file mode 100644 index ab90c88a95..0000000000 --- a/ThirdParty/Ert/python/python/ert/job_queue/ert_script.py +++ /dev/null @@ -1,116 +0,0 @@ -import inspect -import imp -import sys -import traceback - -class ErtScript(object): - - def __init__(self, ert): - """ - @type ert: EnKFMain - """ - super(ErtScript, self).__init__() - - if not hasattr(self, "run"): - raise UserWarning("ErtScript implementations must provide a method run(self, ert, ...)") - - self.__verbose = False - self.__ert = ert - - self.__is_cancelled = False - self.__failed = False - - def isVerbose(self): - return self.__verbose - - def ert(self): - """ @rtype: ert.enkf.EnKFMain """ - return self.__ert - - def isCancelled(self): - """ @rtype: bool """ - return self.__is_cancelled - - def hasFailed(self): - """ @rtype: bool """ - return self.__failed - - def cancel(self): - self.__is_cancelled = True - - def cleanup(self): - """ - Override to perform cleanup after a run. - """ - pass - - def initializeAndRun(self, argument_types, argument_values, verbose=False): - """ - @type argument_types: list of type - @type argument_values: list of string - @type verbose: bool - @rtype: unknown - """ - self.__verbose = verbose - self.__failed = False - - arguments = [] - for index, arg_value in enumerate(argument_values): - if index < len(argument_types): - arg_type = argument_types[index] - else: - arg_type = str - - if arg_value is not None: - arguments.append(arg_type(arg_value)) - else: - arguments.append(None) - - try: - return self.run(*arguments) - except AttributeError as e: - if not hasattr(self, "run"): - self.__failed = True - return "Script '%s' has not implemented a 'run' function" % self.__class__.__name__ - return self.defaultStackTrace(e) - except KeyboardInterrupt: - return "Script '%s' cancelled (CTRL+C)" % self.__class__.__name__ - except Exception as e: - return self.defaultStackTrace(e) - finally: - self.cleanup() - - - __module_count = 0 # Need to have unique modules in case of identical object naming in scripts - - def defaultStackTrace(self, error): - sys.stderr.write("The script '%s' caused an error while running:\n" % self.__class__.__name__) - self.__failed = True - stack_trace = traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback) - return "".join(stack_trace) - - @staticmethod - def loadScriptFromFile(path): - """ @rtype: type ErtScript """ - try: - m = imp.load_source("ErtScriptModule_%d" % ErtScript.__module_count, path) - ErtScript.__module_count += 1 - return ErtScript.__findErtScriptImplementations(m) - except Exception as e: - sys.stderr.write("The script '%s' caused an error during load:\n" % path) - traceback.print_exception(sys.exc_type, sys.exc_value, None) - return None - - @staticmethod - def __findErtScriptImplementations(module): - """ @rtype: ErtScript """ - result = [] - predicate = lambda member : inspect.isclass(member) and member.__module__ == module.__name__ - for name, member in inspect.getmembers(module, predicate): - if ErtScript in inspect.getmro(member): - result.append(member) - - if len(result) != 1: - raise UserWarning("Must have (only) one implementation of ErtScript in a module!") - - return result[0] \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert/job_queue/ext_job.py b/ThirdParty/Ert/python/python/ert/job_queue/ext_job.py deleted file mode 100644 index 23be5b3cf7..0000000000 --- a/ThirdParty/Ert/python/python/ert/job_queue/ext_job.py +++ /dev/null @@ -1,147 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'ext_job.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -import os.path - -from cwrap import BaseCClass -from ert.job_queue import QueuePrototype - - -class ExtJob(BaseCClass): - TYPE_NAME = "ext_job" - _alloc = QueuePrototype("void* ext_job_alloc(char*, char*, int)", bind = False) - _fscanf_alloc = QueuePrototype("void* ext_job_fscanf_alloc(char*, char*, bool, char* , bool)", bind = False) - _free = QueuePrototype("void ext_job_free( ext_job )") - _get_help_text = QueuePrototype("char* ext_job_get_help_text(ext_job)") - _get_name = QueuePrototype("char* ext_job_get_name(ext_job)") - _get_private_args_as_string = QueuePrototype("char* ext_job_get_private_args_as_string(ext_job)") - _set_private_args_as_string = QueuePrototype("void ext_job_set_private_args_from_string(ext_job, char*)") - _is_private = QueuePrototype("int ext_job_is_private(ext_job)") - _get_config_file = QueuePrototype("char* ext_job_get_config_file(ext_job)") - _set_config_file = QueuePrototype("void ext_job_set_config_file(ext_job, char*)") - _get_stdin_file = QueuePrototype("char* ext_job_get_stdin_file(ext_job)") - _set_stdin_file = QueuePrototype("void ext_job_set_stdin_file(ext_job, char*)") - _get_stdout_file = QueuePrototype("char* ext_job_get_stdout_file(ext_job)") - _set_stdout_file = QueuePrototype("void ext_job_set_stdout_file(ext_job, char*)") - _get_stderr_file = QueuePrototype("char* ext_job_get_stderr_file(ext_job)") - _set_stderr_file = QueuePrototype("void ext_job_set_stderr_file(ext_job, char*)") - _get_target_file = QueuePrototype("char* ext_job_get_target_file(ext_job)") - _set_target_file = QueuePrototype("void ext_job_set_target_file(ext_job, char*)") - _get_executable = QueuePrototype("char* ext_job_get_executable(ext_job)") - _set_executable = QueuePrototype("void ext_job_set_executable(ext_job, char*)") - _get_max_running = QueuePrototype("int ext_job_get_max_running(ext_job)") - _set_max_running = QueuePrototype("void ext_job_set_max_running(ext_job, int)") - _get_max_running_minutes = QueuePrototype("int ext_job_get_max_running_minutes(ext_job)") - _set_max_running_minutes = QueuePrototype("void ext_job_set_max_running_minutes(ext_job, int)") - _get_environment = QueuePrototype("void* ext_job_get_environment(ext_job)") - _set_environment = QueuePrototype("void ext_job_add_environment(ext_job, char*, char*)") - _clear_environment = QueuePrototype("void ext_job_clear_environment(ext_job)") - _save = QueuePrototype("void ext_job_save(ext_job)") - - - def __init__(self, config_file, private, name = None , license_root_path = None , search_PATH = True): - if os.path.isfile( config_file ): - if name is None: - name = os.path.basename( config_file ) - - c_ptr = self._fscanf_alloc(name, license_root_path, private, config_file , search_PATH) - super(ExtJob, self).__init__(c_ptr) - else: - raise IOError("No such file:%s" % config_file) - - def __str__(self): - return "ExtJob(%s, config_file = %s)" % (self.name() , self.get_config_file()) - - - def get_private_args_as_string(self): - return self._get_private_args_as_string( ) - - def set_private_args_as_string(self, args): - self._set_private_args_as_string( args) - - def get_help_text(self): - return self._get_help_text( ) - - def is_private(self): - return self._is_private( ) - - def get_config_file(self): - return self._get_config_file( ) - - def set_config_file(self, config_file): - self._set_config_file( config_file) - - def get_stdin_file(self): - return self._get_stdin_file( ) - - def set_stdin_file(self, filename): - self._set_stdin_file( filename) - - def get_stdout_file(self): - return self._get_stdout_file( ) - - def set_stdout_file(self, filename): - self._set_stdout_file( filename) - - def get_stderr_file(self): - return self._get_stderr_file( ) - - def set_stderr_file(self, filename): - self._set_stderr_file( filename) - - def get_target_file(self): - return self._get_target_file( ) - - def set_target_file(self, filename): - self._set_target_file( filename) - - def get_executable(self): - return self._get_executable( ) - - def set_executable(self, executable): - self._set_executable( executable) - - def get_max_running(self): - return self._get_max_running( ) - - def set_max_running(self, max_running): - self._set_max_running( max_running) - - def get_max_running_minutes(self): - return self._get_max_running_minutes( ) - - def set_max_running_minutes(self, min_value): - self._set_max_running_minutes(min_value) - - def get_environment(self): - return self._get_environment( ) #warn: fix return type - - def set_environment(self, key, value): - self._set_environment( key, value) - - def clear_environment(self): - self._clear_environment( ) - - def save(self): - self._save( ) - - def free(self): - self._free( ) - - def name(self): - return self._get_name( ) - - - diff --git a/ThirdParty/Ert/python/python/ert/job_queue/ext_joblist.py b/ThirdParty/Ert/python/python/ert/job_queue/ext_joblist.py deleted file mode 100644 index 341bcb98ff..0000000000 --- a/ThirdParty/Ert/python/python/ert/job_queue/ext_joblist.py +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'ext_joblist.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass -from ert.job_queue import QueuePrototype, ExtJob -from ert.util import StringList - - -class ExtJoblist(BaseCClass): - TYPE_NAME = "ext_joblist" - _free = QueuePrototype("void ext_joblist_free( ext_joblist )") - _alloc_list = QueuePrototype("stringlist_ref ext_joblist_alloc_list(ext_joblist)") - _get_job = QueuePrototype("ext_job_ref ext_joblist_get_job(ext_joblist, char*)") - _del_job = QueuePrototype("int ext_joblist_del_job(ext_joblist, char*)") - _has_job = QueuePrototype("int ext_joblist_has_job(ext_joblist, char*)") - _add_job = QueuePrototype("void ext_joblist_add_job(ext_joblist, char*, ext_joblist)") - _get_jobs = QueuePrototype("hash_ref ext_joblist_get_jobs(ext_joblist)") - _size = QueuePrototype("int ext_joblist_get_size(ext_joblist)") - - def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") - - def get_jobs(self): - """ @rtype: Hash """ - jobs = self._get_jobs( ) - jobs.setParent(self) - return jobs - - def __len__(self): - return self._size( ) - - def __contains__(self , job): - return self._has_job(job) - - def __iter__(self): - names = self.getAvailableJobNames() - for job in names: - yield self[job] - - - def __getitem__(self, job): - if job in self: - return self._get_job(job).setParent(self) - - - def getAvailableJobNames(self): - """ @rtype: StringList """ - return self._alloc_list( ).setParent(self) - - def del_job(self, job): - return self._del_job(job) - - def has_job(self, job): - return job in self - - def get_job(self, job): - """ @rtype: ExtJob """ - return self[job] - - def add_job(self, job_name, new_job): - self._add_job(job_name, new_job) - - def free(self): - self._free( ) - - diff --git a/ThirdParty/Ert/python/python/ert/job_queue/external_ert_script.py b/ThirdParty/Ert/python/python/ert/job_queue/external_ert_script.py deleted file mode 100644 index 6757115868..0000000000 --- a/ThirdParty/Ert/python/python/ert/job_queue/external_ert_script.py +++ /dev/null @@ -1,25 +0,0 @@ -from subprocess import Popen -from ert.job_queue import ErtScript - - -class ExternalErtScript(ErtScript): - - def __init__(self, ert, executable): - super(ExternalErtScript, self).__init__(ert) - - self.__executable = executable - self.__job = None - - def run(self, *args): - command = [self.__executable] - command.extend([str(arg) for arg in args]) - self.__job = Popen(command) - self.__job.wait() # This should not be here? - return None - - def cancel(self): - super(ExternalErtScript, self).cancel() - if self.__job is not None: - self.__job.terminate() - - self.__job.kill() diff --git a/ThirdParty/Ert/python/python/ert/job_queue/forward_model.py b/ThirdParty/Ert/python/python/ert/job_queue/forward_model.py deleted file mode 100644 index bccf108f97..0000000000 --- a/ThirdParty/Ert/python/python/ert/job_queue/forward_model.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'forward_model.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCClass -from ert.job_queue import ExtJob, QueuePrototype -from ert.util import StringList - - -class ForwardModel(BaseCClass): - TYPE_NAME = "forward_model" - _free = QueuePrototype("void forward_model_free( forward_model )") - _clear = QueuePrototype("void forward_model_clear(forward_model)") - _add_job = QueuePrototype("ext_job_ref forward_model_add_job(forward_model, char*)") - _alloc_joblist = QueuePrototype("stringlist_obj forward_model_alloc_joblist(forward_model)") - _iget_job = QueuePrototype("ext_job_ref forward_model_iget_job( forward_model, int)") - - def __init__(self): - raise NotImplementedError("Class can not be instantiated directly!") - - def joblist(self): - """ @rtype: StringList """ - return self._alloc_joblist( ) - - def iget_job(self, index): - """ @rtype: ExtJob """ - return self._iget_job(index).setParent(self) - - def add_job(self, name): - """ @rtype: ExtJob """ - return self._.add_job(name).setParent(self) - - def clear(self): - self._clear( ) - - def free(self): - self._free( ) - diff --git a/ThirdParty/Ert/python/python/ert/job_queue/function_ert_script.py b/ThirdParty/Ert/python/python/ert/job_queue/function_ert_script.py deleted file mode 100644 index 58028a7dde..0000000000 --- a/ThirdParty/Ert/python/python/ert/job_queue/function_ert_script.py +++ /dev/null @@ -1,64 +0,0 @@ -import ert as ert_module -from cwrap import Prototype - -from ert.job_queue import ErtScript -from ert.util.stringlist import StringList - - -class _NonePrototype(Prototype): - lib = ert_module.load(None) - - def __init__(self, prototype, bind=True): - super(_NonePrototype, self).__init__(_NonePrototype.lib, prototype, bind=bind) - - -class FunctionErtScript(ErtScript): - - def __init__(self, ert, function_name, argument_types, argument_count): - super(FunctionErtScript, self).__init__(ert) - - parsed_argument_types = [] - - if ert is not None: - self.__function = _NonePrototype("void* %s(void*, stringlist)" % function_name) - - else: - for arg in argument_types: - if arg is bool: - parsed_argument_types.append("bool") - elif arg is str: - parsed_argument_types.append("char*") - elif arg is int: - parsed_argument_types.append("int") - elif arg is float: - parsed_argument_types.append("float") - else: - raise TypeError("Unknown type: %s" % arg) - - self.__function = _NonePrototype("void* %s(%s)" % (function_name, ", ".join(parsed_argument_types[:argument_count]))) - - - def run(self, *args): - ert = self.ert() - if ert is None: - # This is usually used for testing purposes without an ert instance - return self.__function(*args) - else: - str_args = StringList() - for arg in args: - str_args.append(arg) - - if hasattr(ert, "from_param"): - pointer = ert.from_param(ert) - else: - pointer = ert # ... - - return self.__function(pointer, str_args) - - def cancel(self): - # job is not cancellable and will just ignore the call - pass - - - - diff --git a/ThirdParty/Ert/python/python/ert/job_queue/job.py b/ThirdParty/Ert/python/python/ert/job_queue/job.py deleted file mode 100644 index 1bf64cf834..0000000000 --- a/ThirdParty/Ert/python/python/ert/job_queue/job.py +++ /dev/null @@ -1,88 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'job.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - - -import time -import datetime -from cwrap import BaseCClass -from ert.job_queue import JobStatusType - -# This class and the interplay between this class and the Driver and -# JobQueue classes is quite fragile; in particular the Job class -# internalizes a void * pointer to the completely driver specific job -# information - this is way too low level. - -class Job(BaseCClass): - TYPE_NAME = "job" - - def __init__(self, c_ptr , driver ): - self.driver = driver - self.submit_time = datetime.datetime.now() - super(Job , self).__init__( c_ptr ) - - - def free(self): - pass - - - def block( self ): - while True: - status = self.status() - if status == JobStatusType.JOB_QUEUE_DONE or status == JobStatusType.JOB_QUEUE_EXIT: - break - else: - time.sleep(1) - - def kill( self ): - self.driver.kill_job(self) - - - @property - def run_time( self ): - td = datetime.datetime.now() - self.submit_time - return td.seconds + td.days * 24 * 3600 - - @property - def status( self ): - st = self.driver.get_status(self) - return st - - @property - def running( self ): - status = self.driver.get_status(self) - if status == JobStatusType.JOB_QUEUE_RUNNING: - return True - else: - return False - - - @property - def pending( self ): - status = self.driver.get_status(self) - if status == JobStatusType.JOB_QUEUE_PENDING: - return True - else: - return False - - @property - def complete( self ): - status = self.driver.get_status(self) - if status == JobStatusType.JOB_QUEUE_DONE or status == JobStatusType.JOB_QUEUE_EXIT: - return True - else: - return False - - diff --git a/ThirdParty/Ert/python/python/ert/job_queue/job_queue_manager.py b/ThirdParty/Ert/python/python/ert/job_queue/job_queue_manager.py deleted file mode 100644 index 5cf6bf0166..0000000000 --- a/ThirdParty/Ert/python/python/ert/job_queue/job_queue_manager.py +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright (C) 2014 Statoil ASA, Norway. -# -# The file 'job_queue_manager.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -""" -Module implementing a queue for managing external jobs. - -""" -from cwrap import BaseCClass -from ert.job_queue import QueuePrototype, Job, JobStatusType - -class JobQueueManager(BaseCClass): - TYPE_NAME = "job_queue_manager" - _alloc = QueuePrototype("void* job_queue_manager_alloc( job_queue)", bind = False) - _free = QueuePrototype("void job_queue_manager_free( job_queue_manager )") - _start_queue = QueuePrototype("void job_queue_manager_start_queue( job_queue_manager , int , bool, bool)") - _get_num_waiting = QueuePrototype("int job_queue_manager_get_num_waiting( job_queue_manager )") - _get_num_running = QueuePrototype("int job_queue_manager_get_num_running( job_queue_manager )") - _get_num_success = QueuePrototype("int job_queue_manager_get_num_success( job_queue_manager )") - _get_num_failed = QueuePrototype("int job_queue_manager_get_num_failed( job_queue_manager )") - _is_running = QueuePrototype("bool job_queue_manager_is_running( job_queue_manager )") - _job_complete = QueuePrototype("bool job_queue_manager_job_complete( job_queue_manager , int)") - _job_running = QueuePrototype("bool job_queue_manager_job_running( job_queue_manager , int)") - - # Note, even if all realizations have finished, they need not all be failed or successes. - # That is how Ert report things. They can be "killed", which is neither success nor failure. - _job_failed = QueuePrototype("bool job_queue_manager_job_failed( job_queue_manager , int)") - _job_waiting = QueuePrototype("bool job_queue_manager_job_waiting( job_queue_manager , int)") - _job_success = QueuePrototype("bool job_queue_manager_job_success( job_queue_manager , int)") - - # The return type of the job_queue_manager_iget_job_status should - # really be the enum job_status_type_enum, but I just did not - # manage to get the prototyping right. Have therefor taken the - # return as an integer and convert it in the getJobStatus() - # method. - _job_status = QueuePrototype("int job_queue_manager_iget_job_status(job_queue_manager, int)") - - def __init__(self, queue): - c_ptr = self._alloc(queue) - super(JobQueueManager, self).__init__(c_ptr) - - - def startQueue(self , total_size , verbose = False , reset_queue = True): - self._start_queue( total_size , verbose , reset_queue) - - def getNumRunning(self): - return self._get_num_running( ) - - def getNumWaiting(self): - return self._get_num_waiting( ) - - def getNumSuccess(self): - return self._get_num_success( ) - - def getNumFailed(self): - return self._get_num_failed( ) - - def isRunning(self): - return self._is_running( ) - - def free(self): - self._free( ) - - def isJobComplete(self, job_index): - return self._job_complete( job_index ) - - def isJobRunning(self, job_index): - return self._job_running( job_index ) - - def isJobWaiting(self, job_index): - return self._job_waiting( job_index ) - - def didJobFail(self, job_index): - return self._job_failed( job_index ) - - def didJobSucceed(self, job_index): - return self._job_success( job_index ) - - def getJobStatus(self, job_index): - # See comment about return type in the prototype section at - # the top of class. - """ @rtype: ert.job_queue.job_status_type_enum.JobStatusType """ - int_status = self._job_status(job_index) - return JobStatusType( int_status ) - diff --git a/ThirdParty/Ert/python/python/ert/job_queue/job_status_type_enum.py b/ThirdParty/Ert/python/python/ert/job_queue/job_status_type_enum.py deleted file mode 100644 index 9744293875..0000000000 --- a/ThirdParty/Ert/python/python/ert/job_queue/job_status_type_enum.py +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'job_status_type_enum.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from cwrap import BaseCEnum -from ert.job_queue import JOB_QUEUE_LIB - - -class JobStatusType(BaseCEnum): - TYPE_NAME = "job_status_type_enum" - JOB_QUEUE_NOT_ACTIVE = None # This value is used in external query routines - for jobs which are (currently) not active. */ - JOB_QUEUE_WAITING = None # A node which is waiting in the internal queue. - JOB_QUEUE_SUBMITTED = None # Internal status: It has has been submitted - the next status update will (should) place it as pending or running. - JOB_QUEUE_PENDING = None # A node which is pending - a status returned by the external system. I.e LSF - JOB_QUEUE_RUNNING = None # The job is running - JOB_QUEUE_DONE = None # The job is done - but we have not yet checked if the target file is produced */ - JOB_QUEUE_EXIT = None # The job has exited - check attempts to determine if we retry or go to complete_fail */ - JOB_QUEUE_IS_KILLED = None # The job has been killed, following a JOB_QUEUE_DO_KILL - can restart. */ - JOB_QUEUE_DO_KILL = None # The the job should be killed, either due to user request, or automated measures - the job can NOT be restarted.. */ - JOB_QUEUE_SUCCESS = None - JOB_QUEUE_RUNNING_CALLBACK = None - JOB_QUEUE_FAILED = None - JOB_QUEUE_DO_KILL_NODE_FAILURE = None - JOB_QUEUE_STATUS_FAILURE = None - - -JobStatusType.addEnum("JOB_QUEUE_NOT_ACTIVE", 1) -JobStatusType.addEnum("JOB_QUEUE_WAITING", 4) -JobStatusType.addEnum("JOB_QUEUE_SUBMITTED", 8) -JobStatusType.addEnum("JOB_QUEUE_PENDING", 16) -JobStatusType.addEnum("JOB_QUEUE_RUNNING", 32) -JobStatusType.addEnum("JOB_QUEUE_DONE", 64) -JobStatusType.addEnum("JOB_QUEUE_EXIT", 128) -JobStatusType.addEnum("JOB_QUEUE_IS_KILLED", 4096) -JobStatusType.addEnum("JOB_QUEUE_DO_KILL", 8192) -JobStatusType.addEnum("JOB_QUEUE_SUCCESS", 16384) -JobStatusType.addEnum("JOB_QUEUE_RUNNING_CALLBACK", 32768) -JobStatusType.addEnum("JOB_QUEUE_FAILED", 65536) -JobStatusType.addEnum("JOB_QUEUE_DO_KILL_NODE_FAILURE", 131072) -JobStatusType.addEnum("JOB_QUEUE_STATUS_FAILURE", 262144) diff --git a/ThirdParty/Ert/python/python/ert/job_queue/queue.py b/ThirdParty/Ert/python/python/ert/job_queue/queue.py deleted file mode 100644 index e6a08747d1..0000000000 --- a/ThirdParty/Ert/python/python/ert/job_queue/queue.py +++ /dev/null @@ -1,260 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'job_queue.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -""" -Module implementing a queue for managing external jobs. - -""" -import sys -from types import StringType, IntType -import time -import ctypes - -from cwrap import BaseCClass,BaseCEnum - -from ert.job_queue import QueuePrototype -from ert.job_queue import Job, JobStatusType - - -class JobQueue(BaseCClass): - # If the queue is created with size == 0 that means that it will - # just grow as needed; for the queue layer to know when to exit - # you must call the function submit_complete() when you have no - # more jobs to submit. - # - # If the number of jobs is known in advance you can create the - # queue with a finite value for size, in that case it is not - # necessary to explitly inform the queue layer when all jobs have - # been submitted. - TYPE_NAME = "job_queue" - _alloc = QueuePrototype("void* job_queue_alloc( int , char* , char* , char* )" , bind = False) - _start_user_exit = QueuePrototype("bool job_queue_start_user_exit( job_queue )") - _get_user_exit = QueuePrototype("bool job_queue_get_user_exit( job_queue )") - _free = QueuePrototype("void job_queue_free( job_queue )") - _set_max_running = QueuePrototype("void job_queue_set_max_running( job_queue , int)") - _get_max_running = QueuePrototype("int job_queue_get_max_running( job_queue )") - _set_max_job_duration = QueuePrototype("void job_queue_set_max_job_duration( job_queue , int)") - _get_max_job_duration = QueuePrototype("int job_queue_get_max_job_duration( job_queue )") - _set_driver = QueuePrototype("void job_queue_set_driver( job_queue , void* )") - _add_job = QueuePrototype("int job_queue_add_job( job_queue , char* , void* , void* , void* , void* , int , char* , char* , int , char**)") - _kill_job = QueuePrototype("bool job_queue_kill_job( job_queue , int )") - _start_queue = QueuePrototype("void job_queue_run_jobs( job_queue , int , bool)") - _run_jobs = QueuePrototype("void job_queue_run_jobs_threaded(job_queue , int , bool)") - _sim_start = QueuePrototype("time_t job_queue_iget_sim_start( job_queue , int)") - _iget_driver_data = QueuePrototype("void* job_queue_iget_driver_data( job_queue , int)") - - _num_running = QueuePrototype("int job_queue_get_num_running( job_queue )") - _num_complete = QueuePrototype("int job_queue_get_num_complete( job_queue )") - _num_waiting = QueuePrototype("int job_queue_get_num_waiting( job_queue )") - _num_pending = QueuePrototype("int job_queue_get_num_pending( job_queue )") - - _is_running = QueuePrototype("bool job_queue_is_running( job_queue )") - _submit_complete = QueuePrototype("void job_queue_submit_complete( job_queue )") - _iget_sim_start = QueuePrototype("time_t job_queue_iget_sim_start( job_queue , int)") - _get_active_size = QueuePrototype("int job_queue_get_active_size( job_queue )") - _get_pause = QueuePrototype("bool job_queue_get_pause(job_queue)") - _set_pause_on = QueuePrototype("void job_queue_set_pause_on(job_queue)") - _set_pause_off = QueuePrototype("void job_queue_set_pause_off(job_queue)") - - # The return type of the job_queue_iget_job_status should really - # be the enum job_status_type_enum, but I just did not manage to - # get the prototyping right. Have therefor taken the return as an - # integer and convert it in the getJobStatus() method. - _get_job_status = QueuePrototype("int job_queue_iget_job_status(job_queue, int)") - - - def __init__(self, driver , max_submit=1, size=0): - """ - Short doc... - - The @size argument is used to say how many jobs the queue will - run, in total. - - size = 0: That means that you do not tell the queue in - advance how many jobs you have. The queue will just run - all the jobs you add, but you have to inform the queue in - some way that all jobs have been submitted. To achieve - this you should call the submit_complete() method when all - jobs have been submitted.# - - size > 0: The queue will know exactly how many jobs to run, - and will continue until this number of jobs have completed - - it is not necessary to call the submit_complete() method - in this case. - """ - - OK_file = None - status_file = None - exit_file = None - - c_ptr = self._alloc(max_submit, OK_file, status_file , exit_file) - super(JobQueue, self).__init__(c_ptr) - self.size = size - - self.driver = driver - self._set_driver(driver.from_param(driver)) - self.start( blocking=False ) - - - def kill_job(self, queue_index): - """ - Will kill job nr @index. - """ - self._kill_job( queue_index ) - - - def start( self, blocking=False): - verbose = False - self._run_jobs(self.size, verbose) - - - def submit( self, cmd, run_path, job_name, argv, num_cpu=1): - c_argv = (ctypes.c_char_p * len(argv))() - c_argv[:] = argv - - done_callback = None - callback_arg = None - retry_callback = None - exit_callback = None - - queue_index = self._add_job(cmd, - done_callback, - retry_callback, - exit_callback, - callback_arg, - num_cpu, - run_path, - job_name, - len(argv), - c_argv) - - return queue_index - - - def clear( self ): - pass - - def block_waiting( self ): - """ - Will block as long as there are waiting jobs. - """ - while self.num_waiting > 0: - time.sleep(1) - - def block(self): - """ - Will block as long as there are running jobs. - """ - while self.isRunning: - time.sleep(1) - - - def submit_complete( self ): - """ - Method to inform the queue that all jobs have been submitted. - - If the queue has been created with size == 0 the queue has no - way of knowing when all jobs have completed; hence in that - case you must call the submit_complete() method when all jobs - have been submitted. - - If you know in advance exactly how many jobs you will run that - should be specified with the size argument when creating the - queue, in that case it is not necessary to call the - submit_complete() method. - """ - self._submit_complete( ) - - - def isRunning(self): - return self._is_running( ) - - def num_running( self ): - return self._num_running( ) - - def num_pending( self ): - return self._.num_pending( ) - - def num_waiting( self ): - return self._num_waiting( ) - - def num_complete( self ): - return self._num_complete( ) - - def exists(self, index): - job = self.__getitem__(index) - if job: - return True - else: - return False - - def get_max_running( self ): - return self.driver.get_max_running() - - def set_max_running( self, max_running ): - self.driver.set_max_running(max_running) - - def get_max_job_duration(self): - return self._get_max_job_duration() - - def set_max_job_duration(self, max_duration): - self._set_max_job_duration(max_duration) - - def killAllJobs(self): - # The queue will not set the user_exit flag before the - # queue is in a running state. If the queue does not - # change to running state within a timeout the C function - # will return False, and that False value is just passed - # along. - user_exit = self._start_user_exit( ) - if user_exit: - while self.isRunning(): - time.sleep(0.1) - return True - else: - return False - - def igetSimStart(self, job_index): - return self._iget_sim_start( self , job_index ) - - - def getUserExit(self): - # Will check if a user_exit has been initated on the job. The - # queue can be queried about this status until a - # job_queue_reset() call is invoked, and that should not be - # done before the queue is recycled to run another batch of - # simulations. - return self._get_user_exit( ) - - def set_pause_on(self): - self._set_pause_on( ) - - def set_pause_off(self): - self._set_pause_off( ) - - def free(self): - self._free( ) - - def __len__(self): - return self._get_active_size( ) - - def getJobStatus(self, job_number): - # See comment about return type in the prototype section at - # the top of class. - """ @rtype: JobStatusType """ - int_status = self._get_job_status(job_number) - return JobStatusType( int_status ) - - diff --git a/ThirdParty/Ert/python/python/ert/job_queue/workflow.py b/ThirdParty/Ert/python/python/ert/job_queue/workflow.py deleted file mode 100644 index c43b667242..0000000000 --- a/ThirdParty/Ert/python/python/ert/job_queue/workflow.py +++ /dev/null @@ -1,105 +0,0 @@ -import time -from ert.config import ConfigError -from cwrap import BaseCClass -from ert.job_queue import QueuePrototype, WorkflowJoblist, WorkflowJob -from ert.util import SubstitutionList - - -class Workflow(BaseCClass): - TYPE_NAME = "workflow" - _alloc = QueuePrototype("void* workflow_alloc(char*, workflow_joblist)" , bind = False) - _free = QueuePrototype("void workflow_free(workflow)") - _count = QueuePrototype("int workflow_size(workflow)") - _iget_job = QueuePrototype("workflow_job_ref workflow_iget_job(workflow, int)") - _iget_args = QueuePrototype("stringlist_ref workflow_iget_arguments(workflow, int)") - - _try_compile = QueuePrototype("bool workflow_try_compile(workflow, subst_list)") - _get_last_error = QueuePrototype("config_error_ref workflow_get_last_error(workflow)") - - def __init__(self, src_file, job_list): - """ - @type src_file: str - @type job_list: WorkflowJoblist - """ - c_ptr = self._alloc(src_file, job_list) - super(Workflow, self).__init__(c_ptr) - - self.__running = False - self.__cancelled = False - self.__current_job = None - - def __len__(self): - return self._count( ) - - def __getitem__(self, index): - """ - @type index: int - @rtype: tuple of (WorkflowJob, arguments) - """ - job = self._iget_job(index) - args = self._iget_args(index) - return job, args - - - def __iter__(self): - for index in range(len(self)): - yield self[index] - - def run(self, ert, verbose=False, context=None): - """ - @type ert: ert.enkf.enkf_main.EnKFMain - @type verbose: bool - @type context: SubstitutionList - @rtype: bool - """ - self.__running = True - success = self._try_compile(context) - - if success: - for job, args in self: - self.__current_job = job - if not self.__cancelled: - return_value = job.run(ert, args, verbose) - - if job.hasFailed(): - print(return_value) - - #todo store results? - - self.__current_job = None - self.__running = False - return success - - - def free(self): - self._free( ) - - def isRunning(self): - return self.__running - - def cancel(self): - if self.__current_job is not None: - self.__current_job.cancel() - - self.__cancelled = True - - def isCancelled(self): - return self.__cancelled - - def wait(self): - while self.isRunning(): - time.sleep(1) - - def getLastError(self): - """ @rtype: ConfigError """ - return self._get_last_error( ) - - @classmethod - def createCReference(cls, c_pointer, parent=None): - workflow = super(Workflow, cls).createCReference(c_pointer, parent) - workflow.__running = False - workflow.__cancelled = False - workflow.__current_job = None - return workflow - - diff --git a/ThirdParty/Ert/python/python/ert/job_queue/workflow_job.py b/ThirdParty/Ert/python/python/ert/job_queue/workflow_job.py deleted file mode 100644 index 2baef729cc..0000000000 --- a/ThirdParty/Ert/python/python/ert/job_queue/workflow_job.py +++ /dev/null @@ -1,181 +0,0 @@ -import os - -from cwrap import BaseCClass -from ert.job_queue import QueuePrototype, ErtScript, FunctionErtScript, ErtPlugin, ExternalErtScript -from ert.config import ContentTypeEnum - - -class WorkflowJob(BaseCClass): - TYPE_NAME = "workflow_job" - _alloc = QueuePrototype("void* workflow_job_alloc(char*, bool)", bind= False) - _alloc_parser = QueuePrototype("config_parser_obj workflow_job_alloc_config( )", bind= False) - _alloc_from_file = QueuePrototype("workflow_job_obj workflow_job_config_alloc( char* , config_parser , char*)", bind= False) - _free = QueuePrototype("void workflow_job_free(workflow_job)") - _name = QueuePrototype("char* workflow_job_get_name(workflow_job)") - _internal = QueuePrototype("bool workflow_job_internal(workflow_job)") - _is_internal_script = QueuePrototype("bool workflow_job_is_internal_script(workflow_job)") - _get_internal_script = QueuePrototype("char* workflow_job_get_internal_script_path(workflow_job)") - _get_function = QueuePrototype("char* workflow_job_get_function(workflow_job)") - _get_module = QueuePrototype("char* workflow_job_get_module(workflow_job)") - _get_executable = QueuePrototype("char* workflow_job_get_executable(workflow_job)") - _min_arg = QueuePrototype("int workflow_job_get_min_arg(workflow_job)") - _max_arg = QueuePrototype("int workflow_job_get_max_arg(workflow_job)") - _arg_type = QueuePrototype("config_content_type_enum workflow_job_iget_argtype(workflow_job, int)") - - - - @classmethod - def configParser(cls): - return cls._alloc_parser( ) - - @classmethod - def fromFile(cls , config_file , name = None , parser = None): - if os.path.isfile( config_file ) and os.access( config_file , os.R_OK): - if parser is None: - parser = cls.configParser( ) - - if name is None: - name = os.path.basename( config_file ) - - # NB: Observe argument reoredring. - return cls._alloc_from_file( name , parser , config_file ) - else: - raise IOError("Could not open config_file:%s" % config_file) - - - def __init__(self, name, internal=True): - c_ptr = self._alloc(name, internal) - super(WorkflowJob, self).__init__(c_ptr) - - self.__script = None - """ :type: ErtScript """ - self.__running = False - - def isInternal(self): - """ @rtype: bool """ - return self._internal( ) - - def name(self): - """ @rtype: str """ - return self._name() - - def minimumArgumentCount(self): - """ @rtype: int """ - return self._min_arg() - - def maximumArgumentCount(self): - """ @rtype: int """ - return self._max_arg( ) - - def functionName(self): - """ @rtype: str """ - return self._get_function( ) - - def module(self): - """ @rtype: str """ - return self._get_module( ) - - def executable(self): - """ @rtype: str """ - return self._get_executable( ) - - def isInternalScript(self): - """ @rtype: bool """ - return self._is_internal_script( ) - - def getInternalScriptPath(self): - """ @rtype: str """ - return self._get_internal_script( ) - - def isPlugin(self): - """ @rtype: bool """ - if self.isInternalScript(): - script_obj = ErtScript.loadScriptFromFile(self.getInternalScriptPath()) - return script_obj is not None and issubclass(script_obj, ErtPlugin) - - return False - - - def argumentTypes(self): - """ @rtype: list of type """ - - result = [] - for index in range(self.maximumArgumentCount()): - t = self._arg_type(index) - if t == ContentTypeEnum.CONFIG_BOOL: - result.append(bool) - elif t == ContentTypeEnum.CONFIG_FLOAT: - result.append(float) - elif t == ContentTypeEnum.CONFIG_INT: - result.append(int) - elif t == ContentTypeEnum.CONFIG_STRING: - result.append(str) - else: - result.append(None) - - return result - - - def run(self, ert, arguments, verbose=False): - """ - @type ert: ert.enkf.enkf_main.EnKFMain - @type arguments: list of str - @type verbose: bool - @rtype: ctypes.c_void_p - """ - self.__running = True - - min_arg = self.minimumArgumentCount() - if min_arg > 0 and len(arguments) < min_arg: - raise UserWarning("The job: %s requires at least %d arguments, %d given." % (self.name(), min_arg, len(arguments))) - - max_arg = self.maximumArgumentCount() - if 0 < max_arg < len(arguments): - raise UserWarning("The job: %s can only have %d arguments, %d given." % (self.name(), max_arg, len(arguments))) - - - if self.isInternalScript(): - script_obj = ErtScript.loadScriptFromFile(self.getInternalScriptPath()) - self.__script = script_obj(ert) - result = self.__script.initializeAndRun(self.argumentTypes(), arguments, verbose=verbose) - - elif self.isInternal() and not self.isInternalScript(): - self.__script = FunctionErtScript(ert, self.functionName(), self.argumentTypes(), argument_count=len(arguments)) - result = self.__script.initializeAndRun(self.argumentTypes(), arguments, verbose=verbose) - - elif not self.isInternal(): - self.__script = ExternalErtScript(ert, self.executable()) - result = self.__script.initializeAndRun(self.argumentTypes(), arguments, verbose=verbose) - - else: - raise UserWarning("Unknown script type!") - - self.__running = False - return result - - def cancel(self): - if self.__script is not None: - self.__script.cancel() - - def isRunning(self): - return self.__running - - def isCancelled(self): - return self.__script.isCancelled() - - def hasFailed(self): - """ @rtype: bool """ - return self.__script.hasFailed() - - def free(self): - self._free( ) - - - @classmethod - def createCReference(cls, c_pointer, parent=None): - workflow = super(WorkflowJob, cls).createCReference(c_pointer, parent) - workflow.__script = None - workflow.__running = False - return workflow - - diff --git a/ThirdParty/Ert/python/python/ert/job_queue/workflow_joblist.py b/ThirdParty/Ert/python/python/ert/job_queue/workflow_joblist.py deleted file mode 100644 index e5001d1b5d..0000000000 --- a/ThirdParty/Ert/python/python/ert/job_queue/workflow_joblist.py +++ /dev/null @@ -1,66 +0,0 @@ -import os -from cwrap import BaseCClass -from ert.job_queue import QueuePrototype, WorkflowJob - - -class WorkflowJoblist(BaseCClass): - TYPE_NAME = "workflow_joblist" - _alloc = QueuePrototype("void* workflow_joblist_alloc()" , bind = False) - _free = QueuePrototype("void workflow_joblist_free(workflow_joblist)") - _add_job = QueuePrototype("void workflow_joblist_add_job(workflow_joblist, workflow_job)") - _add_job_from_file = QueuePrototype("bool workflow_joblist_add_job_from_file(workflow_joblist, char*, char*)") - _has_job = QueuePrototype("bool workflow_joblist_has_job(workflow_joblist, char*)") - _get_job = QueuePrototype("workflow_job_ref workflow_joblist_get_job(workflow_joblist, char*)") - _count = QueuePrototype("workflow_job_ref workflow_joblist_get_job(workflow_joblist, char*)") - - def __init__(self): - c_ptr = self._alloc( ) - super(WorkflowJoblist, self).__init__(c_ptr) - - - def addJob(self, job): - """ @type job: WorkflowJob """ - job.convertToCReference(self) - self._add_job(job) - - - def addJobFromFile(self, name, filepath): - """ - @type name: str - @type filepath: str - @rtype: bool - """ - if not os.path.exists(filepath): - raise UserWarning("Job file '%s' does not exist!" % filepath) - - return self._add_job_from_file(name, filepath) - - - def __contains__(self, item): - """ - @type item: str or WorkflowJob - @rtype: bool - """ - - if isinstance(item, WorkflowJob): - item = item.name() - - return self._has_job(item) - - - def __getitem__(self, item): - """ - @type item: str - @rtype: WorkflowJob - """ - - if not item in self: - return None - - return self._get_job(item) - - - - def free(self): - self._free( ) - diff --git a/ThirdParty/Ert/python/python/ert/job_queue/workflow_runner.py b/ThirdParty/Ert/python/python/ert/job_queue/workflow_runner.py deleted file mode 100644 index a281c0d738..0000000000 --- a/ThirdParty/Ert/python/python/ert/job_queue/workflow_runner.py +++ /dev/null @@ -1,63 +0,0 @@ -from threading import Thread -from ert.job_queue import Workflow -from ert.util.substitution_list import SubstitutionList - - -class WorkflowRunner(object): - def __init__(self, workflow, ert=None, context=None): - """ - @type workflow: Workflow - @type ert: ert.enkf.EnKFMain - @type context: SubstitutionList - """ - super(WorkflowRunner, self).__init__() - - self.__workflow = workflow - self.__ert = ert - - if context is None: - context = SubstitutionList() - - self.__context = context - self.__workflow_result = None - - def run(self): - workflow_thread = Thread(name="ert_gui_workflow_thread") - workflow_thread.setDaemon(True) - workflow_thread.run = self.__runWorkflow - workflow_thread.start() - - def __runWorkflow(self): - self.__workflow_result = self.__workflow.run(self.__ert, context=self.__context) - - def isRunning(self): - """ @rtype: bool """ - return self.__workflow.isRunning() - - def isCancelled(self): - """ @rtype: bool """ - return self.__workflow.isCancelled() - - def cancel(self): - if self.isRunning(): - self.__workflow.cancel() - - def wait(self): - self.__workflow.wait() - - def workflowResult(self): - """ @rtype: bool or None """ - return self.__workflow_result - - def workflowError(self): - """ @rtype: str """ - error = self.__workflow.getLastError() - - error_message = "" - - for error_line in error: - error_message += error_line + "\n" - - return error_message - - diff --git a/ThirdParty/Ert/python/python/ert/rms/CMakeLists.txt b/ThirdParty/Ert/python/python/ert/rms/CMakeLists.txt deleted file mode 100644 index d1aab7db53..0000000000 --- a/ThirdParty/Ert/python/python/ert/rms/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - librms.py - rms.py -) - -add_python_package("python.ert.rms" ${PYTHON_INSTALL_PREFIX}/ert/rms "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert/rms/__init__.py b/ThirdParty/Ert/python/python/ert/rms/__init__.py deleted file mode 100644 index 1178612a7d..0000000000 --- a/ThirdParty/Ert/python/python/ert/rms/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -import ert -import ert.util -import ert.geo -import ert.ecl - -RMS_LIB = ert.load("librms") diff --git a/ThirdParty/Ert/python/python/ert/rms/librms.py b/ThirdParty/Ert/python/python/ert/rms/librms.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/python/python/ert/rms/rms.py b/ThirdParty/Ert/python/python/ert/rms/rms.py deleted file mode 100644 index 6feca3459e..0000000000 --- a/ThirdParty/Ert/python/python/ert/rms/rms.py +++ /dev/null @@ -1 +0,0 @@ -import librms diff --git a/ThirdParty/Ert/python/python/ert/sched/CMakeLists.txt b/ThirdParty/Ert/python/python/ert/sched/CMakeLists.txt deleted file mode 100644 index 57c42355e3..0000000000 --- a/ThirdParty/Ert/python/python/ert/sched/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - history.py - history_source_enum.py - sched_file.py -) - -add_python_package("python.ert.sched" ${PYTHON_INSTALL_PREFIX}/ert/sched "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert/sched/__init__.py b/ThirdParty/Ert/python/python/ert/sched/__init__.py deleted file mode 100644 index 7c48506dc5..0000000000 --- a/ThirdParty/Ert/python/python/ert/sched/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file '__init__.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -import ert -import ert.ecl -import ert.util -import ert.geo - -from cwrap import Prototype - -class SchedulePrototype(Prototype): - lib = ert.load("libsched") - - def __init__(self, prototype, bind=True): - super(SchedulePrototype, self).__init__(SchedulePrototype.lib, prototype, bind=bind) - -SCHED_LIB = ert.load("libsched") - -from .sched_file import SchedFile -from .history_source_enum import HistorySourceEnum -from .history import History diff --git a/ThirdParty/Ert/python/python/ert/sched/history.py b/ThirdParty/Ert/python/python/ert/sched/history.py deleted file mode 100644 index dbd66ab6e4..0000000000 --- a/ThirdParty/Ert/python/python/ert/sched/history.py +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'history.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from cwrap import BaseCClass -from ert.sched import SchedFile, HistorySourceEnum, SchedulePrototype -from ert.ecl import EclSum - -class History(BaseCClass): - TYPE_NAME = "history" - - _alloc_from_refcase = SchedulePrototype("void* history_alloc_from_refcase(ecl_sum, bool)", bind = False) - _alloc_from_sched_file = SchedulePrototype("void* history_alloc_from_sched_file(char*, sched_file)", bind = False) - _get_source_string = SchedulePrototype("char* history_get_source_string(history_source_enum)", bind = False) - _free = SchedulePrototype("void history_free( history )") - # _history_get_source_type = SchedulePrototype("history_source_type_enum history_get_source_type(char*)", bind = False) - - def __init__(self, refcase = None, use_history = False, sched_file = None): - """ - @type refcase: EclSum - @type use_history: bool - @rtype: HistoryType - """ - self._init_from = '' - self._init_val = '' - if sched_file is not None: - self._init_from = 'sched_file' - self._init_val = str(sched_file) - c_ptr = self._alloc_from_sched_file(sched_file, use_history) - else: - self._init_from = 'refcase' - self._init_val = str(refcase) - c_ptr = self._alloc_from_refcase(refcase, use_history) - if c_ptr: - super(History, self).__init__(c_ptr) - else: - if sched_file is None and refcase is None: - raise ArgumentError('Need to specify either sched_file or refcase.') - raise ValueError('Invalid input. Failed to create History.') - - @staticmethod - def get_source_string(history_source_type): - """ - @type history_source_type: HistorySourceEnum - @rtype: str - """ - return self._get_source_string(history_source_type) - - def free(self): - self._free( self ) - - def __repr__(self): - fr = self._init_from - va = self._init_val - ad = self._ad_str() - return 'History(init_from = %s: %s) %s' % (fr,va,ad) diff --git a/ThirdParty/Ert/python/python/ert/sched/history_source_enum.py b/ThirdParty/Ert/python/python/ert/sched/history_source_enum.py deleted file mode 100644 index bc20276aca..0000000000 --- a/ThirdParty/Ert/python/python/ert/sched/history_source_enum.py +++ /dev/null @@ -1,16 +0,0 @@ -from cwrap import BaseCEnum -from ert.sched import SCHED_LIB - - -class HistorySourceEnum(BaseCEnum): - TYPE_NAME = "history_source_enum" - SCHEDULE = None - REFCASE_SIMULATED = None - REFCASE_HISTORY = None - HISTORY_SOURCE_INVALID = None - -HistorySourceEnum.addEnum("SCHEDULE", 0) -HistorySourceEnum.addEnum("REFCASE_SIMULATED", 1) -HistorySourceEnum.addEnum("REFCASE_HISTORY", 2) -HistorySourceEnum.addEnum("HISTORY_SOURCE_INVALID", 10) - diff --git a/ThirdParty/Ert/python/python/ert/sched/sched_file.py b/ThirdParty/Ert/python/python/ert/sched/sched_file.py deleted file mode 100644 index 5948fc2afb..0000000000 --- a/ThirdParty/Ert/python/python/ert/sched/sched_file.py +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'sched_file.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -import os.path - -from cwrap import BaseCClass -from ert.sched import SchedulePrototype -from ert.util import CTime - - -class SchedFile(BaseCClass): - TYPE_NAME = "sched_file" - - _parse = SchedulePrototype("void* sched_file_parse_alloc( char*, time_t )", bind = False) - _write = SchedulePrototype("void sched_file_fprintf_i( sched_file , int , char* , bool)") - _length = SchedulePrototype("int sched_file_get_num_restart_files( sched_file )") - _free = SchedulePrototype("void sched_file_free( sched_file )") - - def __init__(self, filename, start_time): - if os.path.isfile(filename): - c_ptr = self._parse(filename, CTime(start_time)) - super(SchedFile, self).__init__(c_ptr) - if not c_ptr: - err_msg = 'start_time = "%s", filename = "%s"' % (str(start_time), str(filename)) - raise ValueError('Unable to construct SchedFile with %s.' % err_msg) - else: - raise IOError('No such file "%s"' % filename) - - @property - def length(self): - """ @rtype: int """ - return len(self) - - def __len__(self): - return self._length() - - def write(self, filename, num_dates, add_end=True): - self._write( num_dates, filename, add_end ) - - def free(self): - self._free( ) - - def __repr__(self): - return 'SchedFile(len = %d) %s' % (len(self), self._ad_str()) diff --git a/ThirdParty/Ert/python/python/ert/server/CMakeLists.txt b/ThirdParty/Ert/python/python/ert/server/CMakeLists.txt deleted file mode 100644 index 8ea8e29f02..0000000000 --- a/ThirdParty/Ert/python/python/ert/server/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - ertrpcclient.py - ertrpcserver.py - simulation_context.py -) - -add_python_package("python.ert.server" ${PYTHON_INSTALL_PREFIX}/ert/server "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert/server/__init__.py b/ThirdParty/Ert/python/python/ert/server/__init__.py deleted file mode 100644 index 7138833de3..0000000000 --- a/ThirdParty/Ert/python/python/ert/server/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .simulation_context import SimulationContext -from .ertrpcclient import ErtRPCClient -from .ertrpcserver import ErtRPCServer diff --git a/ThirdParty/Ert/python/python/ert/server/ertrpcclient.py b/ThirdParty/Ert/python/python/ert/server/ertrpcclient.py deleted file mode 100644 index 89eea54b53..0000000000 --- a/ThirdParty/Ert/python/python/ert/server/ertrpcclient.py +++ /dev/null @@ -1,228 +0,0 @@ -import socket -from xmlrpclib import ServerProxy, Fault - -FAULT_CODES = {1: UserWarning, - 2: KeyError, - 3: IndexError, - 4: LookupError, - 5: TypeError - } - - -def convertFault(fault): - if fault.faultCode in FAULT_CODES: - fault_type = FAULT_CODES[fault.faultCode] - raise fault_type(fault.faultString) - else: - raise fault - - -class ErtRPCClient(object): - def __init__(self, host, port, verbose=False): - self._server_proxy = ServerProxy("http://%s:%s" % (host, port), allow_none=True, verbose=verbose) - socket.setdefaulttimeout(180) # 3 minutes - - def ertVersion(self): - """ - Returns a version tuple: (major, minor, micro) - @rtype: tuple - """ - return tuple(self._server_proxy.ertVersion()) - - def getTimeMap(self, target_case_name): - """ - Returns a list of datetime objects for the named target case name - @type target_case_name: str - @rtype: list of datetime - """ - return self._server_proxy.getTimeMap(target_case_name) - - - def isRunning(self): - """ - Returns True if a simulation batch has been started and is running. - @rtype: bool - """ - return self._server_proxy.isRunning() - - - def isInitializationCaseAvailable(self): - """ - Returns True if the initialization case is prepared and ready to run simulations. - @rtype: bool - """ - return self._server_proxy.isInitializationCaseAvailable() - - - def startSimulationBatch(self, initialization_case_name, simulation_count): - """ - Start a simulation batch. Will prepare a batch that will run for the specified number of realizations. - Will fail if the server is already running a batch or no initialization case is available. - @param initialization_case_name: The case containing geo realizations - @type initialization_case_name: str - @type simulation_count: int - """ - try: - self._server_proxy.startSimulationBatch(initialization_case_name, simulation_count) - except Fault as f: - raise convertFault(f) - - - def addSimulation(self, target_case_name, geo_id, pert_id, sim_id, keywords): - """ - Start a simulation. - @type target_case_name: str - @type geo_id: int - @type pert_id: - @type sim_id: int - @type keywords: dict[str, list] - @raise UserWarning if the server is not ready to receive simulations - @raise UserWarning if the server is already running a simulation with the same id as sim_id - """ - try: - self._server_proxy.addSimulation(target_case_name, geo_id, pert_id, sim_id, keywords) - except Fault as f: - raise convertFault(f) - - - def isRealizationFinished(self, sim_id): - """ - Returns true if the realization is finished running. - @type sim_id: int - @rtype: bool - """ - return self._server_proxy.isRealizationFinished(sim_id) - - def didRealizationSucceed(self, sim_id): - """ - Check if the realization successfully finished running. - @type sim_id: int - @rtype: bool - """ - return self._server_proxy.didRealizationSucceed(sim_id) - - def didRealizationFail(self, sim_id): - """ - Check if the realization failed while running. - @type sim_id: int - @rtype: bool - """ - return self._server_proxy.didRealizationFail(sim_id) - - def getGenDataResult(self, target_case_name, sim_id, report_step, keyword): - """ - Retrieve a GenData result from a target case - @type target_case_name: str - @type sim_id: int - @type report_step: int - @type keyword: str - @rtype: list[float] - @raise KeyError if the server was unable to recognize the keyword - @raise UserWarning if the server was unable to load the data - @raise UserWarning if the simulation (with sim_id) is still running - @raise UserWarning if the keyword is not of the correct type - """ - try: - return self._server_proxy.getGenDataResult(target_case_name, sim_id, report_step, keyword) - except Fault as f: - raise convertFault(f) - - def getCustomKWResult(self, target_case_name, sim_id, keyword): - """ - Retrieve a CustomKW result from the target case. - @type target_case_name: str - @type sim_id: int - @type keyword: str - @rtype: dict[str, Union[float,str]] - @raise KeyError if the server was unable to recognize the keyword - @raise UserWarning if the server was unable to load the data - @raise UserWarning if the simulation (with sim_id) is still running - @raise UserWarning if the keyword is not of the correct type - """ - try: - return self._server_proxy.getCustomKWResult(target_case_name, sim_id, keyword) - except Fault as f: - raise convertFault(f) - - def isCustomKWKey(self, key): - """ - Check if a key is of CustomKW type - @param key: The key to check - @type key: str - @rtype: bool - """ - return self._server_proxy.isCustomKWKey(key) - - def isGenDataKey(self, key): - """ - Check if a key is of CustomKW type - @param key: The key to check - @type key: str - @rtype: bool - """ - return self._server_proxy.isGenDataKey(key) - - - def prototypeStorage(self, group_name, storage_definition): - """ - Define the CustomKW with group name and fields with types. - @param group_name: The group name for the CustomKW - @type group_name: str - @param storage_definition: A dictionary with field names (keywords) and types (str or float) - @type storage_definition: dict[str, type] - @raise UserWarning if the group name already exists - @raise TypeError if the type of a keyword/field is unsupported - """ - - converted = {} - for key, value in storage_definition.iteritems(): - if value in (float, str): - value_name = value.__name__ - else: - raise TypeError("Unsupported data type for key: '%s', not one of (float, str): '%s'" % (key, value)) - converted[key] = value_name - try: - self._server_proxy.prototypeStorage(group_name, converted) - except Fault as f: - raise convertFault(f) - - - def storeGlobalData(self, target_case_name, group_name, keyword, value): - """ - Store a value as a CustomKW with group name and keyword. The value will - be stored in all simulations that at least has been initialized. - @param target_case_name: Name of target case - @type target_case_name: str - @param group_name: The name of the CustomKW group - @type group_name: str - @param keyword: The name of the CustomKW keyword - @type keyword: str - @param value: The value to store - @type value: float|int|str - @raise UserWarning if there were issues with the storing - """ - try: - self._server_proxy.storeGlobalData(target_case_name, group_name, keyword, value) - except Fault as f: - raise convertFault(f) - - - def storeSimulationData(self, target_case_name, group_name, keyword, value, sim_id): - """ - Store a single value in a single simulation as a CustomKW with groupname and keyword. - @param target_case_name: Name of target case - @type target_case_name: str - @param group_name: The name of the CustomKW group - @type group_name: str - @param keyword: The name of the CustomKW keyword - @type keyword: str - @param value: The value to store - @type value: float|int|str - @param sim_id: The simulation id (index) - @type sim_id: int - """ - try: - self._server_proxy.storeSimulationData(target_case_name, group_name, keyword, value, sim_id) - except Fault as f: - raise convertFault(f) - diff --git a/ThirdParty/Ert/python/python/ert/server/ertrpcserver.py b/ThirdParty/Ert/python/python/ert/server/ertrpcserver.py deleted file mode 100644 index 09422f69e0..0000000000 --- a/ThirdParty/Ert/python/python/ert/server/ertrpcserver.py +++ /dev/null @@ -1,342 +0,0 @@ -import os -from SimpleXMLRPCServer import SimpleXMLRPCServer -from threading import Lock -from xmlrpclib import Fault - -from ert import Version -from ert.enkf import EnKFMain, NodeId -from ert.enkf.config import CustomKWConfig -from ert.enkf.data import EnkfNode, CustomKW -from ert.enkf.enums import RealizationStateEnum, EnkfVarType, ErtImplType -from ert.server import SimulationContext -from ert.server.ertrpcclient import FAULT_CODES - - -def checkRealizationState(state): - return state == RealizationStateEnum.STATE_INITIALIZED or state == RealizationStateEnum.STATE_HAS_DATA - - -class Session: - def __init__(self): - self.init_case_name = None - """ :type: str """ - - self.simulation_context = None - """ :type: SimulationContext """ - - self.batch_number = 0 - self.lock = Lock() - - -INVERSE_FAULT_CODES = {value:key for key, value in FAULT_CODES.iteritems()} - -def createFault(error, message): - error_code = INVERSE_FAULT_CODES[error] - return Fault(error_code, message) - - - -class ErtRPCServer(SimpleXMLRPCServer): - def __init__(self, config, host="localhost", port=0, log_requests=False, verbose_queue=False): - SimpleXMLRPCServer.__init__(self, (host, port), allow_none=True, logRequests=log_requests) - self._host = host - self._verbose_queue = verbose_queue - # https: server.socket = ssl.wrap_socket(srv.socket, ...) - - if isinstance(config, EnKFMain): - self._config = config - self._config_file = config.getUserConfigFile() - else: - if os.path.exists(config): - self._config = EnKFMain(config) - self._config_file = config - else: - raise IOError("The ert config file: %s does not exist" % config) - - self._session = Session() - - self.register_function(self.ertVersion) - self.register_function(self.getTimeMap) - self.register_function(self.isRunning) - self.register_function(self.isInitializationCaseAvailable) - self.register_function(self.startSimulationBatch) - self.register_function(self.addSimulation) - self.register_function(self.isRealizationFinished) - self.register_function(self.didRealizationSucceed) - self.register_function(self.didRealizationFail) - self.register_function(self.getGenDataResult) - self.register_function(self.getCustomKWResult) - self.register_function(self.isCustomKWKey) - self.register_function(self.isGenDataKey) - self.register_function(self.prototypeStorage) - self.register_function(self.storeGlobalData) - self.register_function(self.storeSimulationData) - - @property - def port(self): - return self.server_address[1] - - @property - def host(self): - return self._host - - @property - def ert(self): - return self._config - - def start(self): - self.serve_forever() - - def stop(self): - if self._session.simulation_context is not None: - if self._session.simulation_context.isRunning(): - self.ert.siteConfig().getJobQueue().killAllJobs() - self.shutdown() - self.server_close() - self._config = None - - def ertVersion(self): - return Version.currentVersion().versionTuple() - - def getTimeMap(self, target_case_name): - enkf_fs_manager = self.ert.getEnkfFsManager() - enkf_fs = enkf_fs_manager.getFileSystem(target_case_name) - time_map = enkf_fs.getTimeMap() - return [time_step.datetime() for time_step in time_map] - - def isRunning(self): - if self._session.simulation_context is not None: - return self._session.simulation_context.isRunning() - return False - - def isRealizationFinished(self, iens): - if self._session.simulation_context is None: - raise createFault(UserWarning, "The simulation batch has not been initialized") - - if self._session.simulation_context.isRealizationQueued(iens): - return self._session.simulation_context.isRealizationFinished(iens) - return False - - def didRealizationSucceed(self, iens): - if self._session.simulation_context is not None and self._session.simulation_context.isRealizationQueued(iens): - return self._session.simulation_context.didRealizationSucceed(iens) - return False - - def didRealizationFail(self, iens): - if self._session.simulation_context is not None and self._session.simulation_context.isRealizationQueued(iens): - return self._session.simulation_context.didRealizationFail(iens) - return False - - - def isInitializationCaseAvailable(self): - return self._session.init_case_name is not None - - - def startSimulationBatch(self, initialization_case_name, simulation_count): - with self._session.lock: - if not self.isRunning(): - self._session.simulation_context = None - self._session.init_case_name = initialization_case_name - - self.ert.addDataKW("", str(self._session.batch_number)) - self.ert.addDataKW("", str(self._session.batch_number)) - self._session.batch_number += 1 - self._session.simulation_context = SimulationContext(self.ert, simulation_count, verbose=self._verbose_queue) - - - def _getInitializationCase(self): - return self.ert.getEnkfFsManager().getFileSystem(self._session.init_case_name) - - - def addSimulation(self, target_case_name, geo_id, pert_id, iens, keywords): - if not self.isRunning(): - raise createFault(UserWarning, "The server is not ready to receive simulations. Have you called startSimulationBatch() first?") - - if self._session.simulation_context.isRealizationQueued(iens): - raise createFault(UserWarning, "Simulation with id: '%d' is already running." % iens) - - state = self.ert.getRealisation(iens) - state.addSubstKeyword("GEO_ID", "%d" % geo_id) - target_fs = self.ert.getEnkfFsManager().getFileSystem(target_case_name) - self._initializeRealization(target_fs, geo_id, iens, keywords) - self._session.simulation_context.addSimulation(iens, target_fs) - - if not target_case_name.startswith("."): - self.ert.getEnkfFsManager().switchFileSystem(target_fs) - - - def _initializeRealization(self, target_fs, geo_id, iens, keywords): - ens_config = self.ert.ensembleConfig() - - for kw in ens_config.getKeylistFromVarType(EnkfVarType.PARAMETER): - if not kw in keywords: - config_node = ens_config[kw] - data_node = EnkfNode( config_node ) - init_id = NodeId(0, geo_id) - run_id = NodeId(0, iens) - data_node.load(self._getInitializationCase(), init_id) - data_node.save(target_fs, run_id) - - for key, value in keywords.iteritems(): - config_node = ens_config[kw] - data_node = EnkfNode( config_node ) - - gen_kw = data_node.asGenKw() - gen_kw.setValues(value) - - run_id = NodeId(0, iens) - data_node.save(target_fs, run_id) - - target_fs.fsync() - state_map = target_fs.getStateMap() - state_map[iens] = RealizationStateEnum.STATE_INITIALIZED - - - def getGenDataResult(self, target_case_name, iens, report_step, keyword): - ensemble_config = self.ert.ensembleConfig() - - if not self.isRealizationFinished(iens): - raise createFault(UserWarning, "The simulation with id: %d is still running." % iens) - - if keyword in ensemble_config: - enkf_config_node = self.ert.ensembleConfig().getNode(keyword) - node = EnkfNode(enkf_config_node) - - if not node.getImplType() == ErtImplType.GEN_DATA: - raise createFault(UserWarning, "The keyword is not a GenData keyword.") - - gen_data = node.asGenData() - - fs = self.ert.getEnkfFsManager().getFileSystem(target_case_name) - node_id = NodeId(report_step, iens) - if node.tryLoad(fs, node_id): - data = gen_data.getData() - return data.asList() - else: - raise createFault(UserWarning, "Unable to load data for iens: %d report_step: %d kw: %s for case: %s" % (iens, report_step, keyword, target_case_name)) - else: - raise createFault(KeyError, "The keyword: %s is not recognized" % keyword) - - - def getCustomKWResult(self, target_case_name, iens, keyword): - ensemble_config = self.ert.ensembleConfig() - - if not self.isRealizationFinished(iens): - raise createFault(UserWarning, "The simulation with id: %d is still running." % iens) - - if keyword in ensemble_config: - enkf_config_node = self.ert.ensembleConfig().getNode(keyword) - node = EnkfNode(enkf_config_node) - - if not node.getImplType() == ErtImplType.CUSTOM_KW: - raise createFault(UserWarning, "The keyword is not a CustomKW keyword.") - - custom_kw = node.asCustomKW() - - fs = self.ert.getEnkfFsManager().getFileSystem(target_case_name) - node_id = NodeId(0, iens) - if node.tryLoad(fs, node_id): - config = custom_kw.getConfig() - result = {} - for key in config.getKeys(): - result[key] = custom_kw[key] - return result - else: - raise createFault(UserWarning, "Unable to load data for iens: %d kw: %s for case: %s" % (iens, keyword, target_case_name)) - else: - raise createFault(KeyError, "The keyword: %s is not recognized" % keyword) - - def getFailedCount(self): - if self._session.simulation_context is not None: - return self._session.simulation_context.getNumFailed() - else: - return 0 - - def getRunningCount(self): - if self._session.simulation_context is not None: - return self._session.simulation_context.getNumRunning() - else: - return 0 - - def getSuccessCount(self): - if self._session.simulation_context is not None: - return self._session.simulation_context.getNumSuccess() - else: - return 0 - - def getWaitingCount(self): - if self._session.simulation_context is not None: - return self._session.simulation_context.getNumWaiting() - else: - return 0 - - def getBatchNumber(self): - return self._session.batch_number - - def isCustomKWKey(self, key): - ensemble_config = self.ert.ensembleConfig() - return key in ensemble_config.getKeylistFromImplType(ErtImplType.CUSTOM_KW) - - def isGenDataKey(self, key): - ensemble_config = self.ert.ensembleConfig() - return key in ensemble_config.getKeylistFromImplType(ErtImplType.GEN_DATA) - - - def prototypeStorage(self, group_name, storage_definition): - ensemble_config = self.ert.ensembleConfig() - - if group_name in ensemble_config.getKeylistFromImplType(ErtImplType.CUSTOM_KW): - raise createFault(UserWarning, "The CustomKW with group name: '%s' already exist!" % group_name) - - converted_definition = {} - for key, value in storage_definition.iteritems(): - if value == "str": - converted_definition[key] = str - elif value == "float": - converted_definition[key] = float - else: - raise createFault(TypeError, "Unknown type: '%s' for key '%s'" % (value, key)) - - enkf_config_node = ensemble_config.addDefinedCustomKW(group_name, converted_definition) - self.ert.addNode(enkf_config_node) - - def storeGlobalData(self, target_case_name, group_name, keyword, value): - fs = self.ert.getEnkfFsManager().getFileSystem(target_case_name) - enkf_config_node = self.ert.ensembleConfig().getNode(group_name) - enkf_node = EnkfNode(enkf_config_node) - self._updateCustomKWConfigSet(fs, enkf_config_node) - - realizations = fs.realizationList(RealizationStateEnum.STATE_INITIALIZED | RealizationStateEnum.STATE_HAS_DATA) - - for realization_number in realizations: - self._storeData(enkf_node, fs, group_name, keyword, value, realization_number) - - def storeSimulationData(self, target_case_name, group_name, keyword, value, sim_id): - fs = self.ert.getEnkfFsManager().getFileSystem(target_case_name) - enkf_config_node = self.ert.ensembleConfig().getNode(group_name) - enkf_node = EnkfNode(enkf_config_node) - self._updateCustomKWConfigSet(fs, enkf_config_node) - - self._storeData(enkf_node, fs, group_name, keyword, value, sim_id) - - def _updateCustomKWConfigSet(self, fs, enkf_config_node): - ckwcs = fs.getCustomKWConfigSet() - ckwcs.addConfig(enkf_config_node.getCustomKeywordModelConfig()) - - - def _storeData(self, enkf_node, fs, group_name, keyword, value, realization_number): - node_id = NodeId(0, realization_number) - enkf_node.tryLoad(fs, node_id) # Fetch any data from previous store calls - custom_kw = enkf_node.asCustomKW() - custom_kw[keyword] = value - - if not enkf_node.save(fs, node_id): - raise createFault(UserWarning, "Unable to store data for group: '%s' and key: '%s' into realization: '%d'" % (group_name, keyword, realization_number)) - - - - - - - - diff --git a/ThirdParty/Ert/python/python/ert/server/simulation_context.py b/ThirdParty/Ert/python/python/ert/server/simulation_context.py deleted file mode 100644 index e344c15d17..0000000000 --- a/ThirdParty/Ert/python/python/ert/server/simulation_context.py +++ /dev/null @@ -1,95 +0,0 @@ -from ert.enkf import ENKF_LIB -from ert.enkf.ert_run_context import ErtRunContext -from ert.enkf.run_arg import RunArg -from ert.job_queue import JobQueueManager -from ert.util import ArgPack, CThreadPool - - -class SimulationContext(object): - def __init__(self, ert, size, verbose=False): - self._ert = ert - """ :type: ert.enkf.EnKFMain """ - self._size = size - - max_runtime = ert.analysisConfig().get_max_runtime() - job_queue = ert.siteConfig().getJobQueue() - job_queue.set_max_job_duration(max_runtime) - - self._queue_manager = JobQueueManager(job_queue) - self._queue_manager.startQueue(size, verbose=verbose) - self._run_args = {} - """ :type: dict[int, RunArg] """ - - self._thread_pool = CThreadPool(8) - self._thread_pool.addTaskFunction("submitJob", ENKF_LIB, "enkf_main_isubmit_job__") - - - def addSimulation(self, iens, target_fs): - if iens >= self._size: - raise UserWarning("Realization number out of range: %d >= %d" % (iens, self._size)) - - if iens in self._run_args: - raise UserWarning("Realization number: '%d' already queued" % iens) - - runpath_fmt = self._ert.getModelConfig().getRunpathFormat() - member = self._ert.getRealisation(iens) - runpath = ErtRunContext.createRunpath(iens , runpath_fmt, member.getDataKW( )) - run_arg = RunArg.createEnsembleExperimentRunArg(target_fs, iens, runpath) - - self._ert.createRunPath(run_arg) - - self._run_args[iens] = run_arg - self._thread_pool.submitJob(ArgPack(self._ert, run_arg)) - - - def isRunning(self): - return self._queue_manager.isRunning() - - - def getNumRunning(self): - return self._queue_manager.getNumRunning() - - - def getNumSuccess(self): - return self._queue_manager.getNumSuccess() - - - def getNumFailed(self): - return self._queue_manager.getNumFailed() - - def getNumWaiting(self): - return self._queue_manager.getNumWaiting() - - - def didRealizationSucceed(self, iens): - queue_index = self._run_args[iens].getQueueIndex() - return self._queue_manager.didJobSucceed(queue_index) - - - def didRealizationFail(self, iens): - # For the purposes of this class, a failure should be anything (killed job, etc) that is not an explicit success. - return not self.didRealizationSucceed(iens) - - - def isRealizationQueued(self, iens): - return iens in self._run_args - - - def isRealizationFinished(self, iens): - run_arg = self._run_args[iens] - - if run_arg.isSubmitted(): - queue_index = run_arg.getQueueIndex() - return self._queue_manager.isJobComplete(queue_index) - else: - return False - - def __repr__(self): - running = 'running' if self.isRunning() else 'not running' - numRunn = self.getNumRunning() - numSucc = self.getNumSuccess() - numFail = self.getNumFailed() - numWait = self.getNumWaiting() - fmt = '%s, #running = %d, #success = %d, #failed = %d, #waiting = %d' - fmt = fmt % (running, numRunn, numSucc, numFail, numWait) - return 'SimulationContext(%s)' % fmt diff --git a/ThirdParty/Ert/python/python/ert/test/ecl_mock/CMakeLists.txt b/ThirdParty/Ert/python/python/ert/test/ecl_mock/CMakeLists.txt deleted file mode 100644 index f9c0405c26..0000000000 --- a/ThirdParty/Ert/python/python/ert/test/ecl_mock/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - ecl_sum_mock.py -) - -# The ecl_mock package is not installed. -add_python_package("python.ert.test.ecl_mock" ${PYTHON_INSTALL_PREFIX}/ert/test/ecl_mock "${PYTHON_SOURCES}" False) diff --git a/ThirdParty/Ert/python/python/ert/test/source_enumerator.py b/ThirdParty/Ert/python/python/ert/test/source_enumerator.py deleted file mode 100644 index 7fde930a43..0000000000 --- a/ThirdParty/Ert/python/python/ert/test/source_enumerator.py +++ /dev/null @@ -1,73 +0,0 @@ -import os -import re - -class SourceEnumerator(object): - @classmethod - def findDevRoot(cls, root_directory_name = ".", verbose=False): - dev_root = os.path.dirname(os.path.realpath(__file__)) - while True: - if verbose: - print("Looking at: %s" % dev_root) - - dev_path = os.path.join(dev_root , root_directory_name) - if os.path.exists( os.path.join(dev_path, root_directory_name, "libecl", "include", "ert", "ecl", "ecl_region.h") ): - dev_root = os.path.join(dev_root , root_directory_name) - if verbose: - print("break: %s" % dev_path) - break - - head, tail = os.path.split(dev_root) - dev_root = head - if tail == "": - raise ValueError("Source root: '%s' not found!" % root_directory_name) - - if verbose: - print("Returning: %s " % dev_root) - - return dev_root - - - @classmethod - def findSourceFile(cls, path): - dev_root = SourceEnumerator.findDevRoot() - - source_file = os.path.join(dev_root, path) - - if not os.path.exists(source_file): - raise ValueError("File not found: %s:%s" % (path , source_file)) - - return source_file - - @classmethod - def removeComments(cls, code_string): - code_string = re.sub(re.compile("/\*.*?\*/",re.DOTALL ) ,"" ,code_string) # remove all occurance streamed comments (/*COMMENT */) from string - code_string = re.sub(re.compile("//.*?\n" ) ,"" ,code_string) # remove all occurance singleline comments (//COMMENT\n ) from string - return code_string - - @classmethod - def findEnum(cls, enum_name, full_source_file_path): - with open(full_source_file_path, "r") as f: - text = f.read() - - text = SourceEnumerator.removeComments(text) - - enum_pattern = re.compile("typedef\s+enum\s+\{(.*?)\}\s*(\w+?);", re.DOTALL) - - for enum in enum_pattern.findall(text): - if enum[1] == enum_name: - return enum[0] - - raise ValueError("Enum with name: '%s' not found!" % enum_name) - - - @classmethod - def findEnumerators(cls, enum_name, source_file_path): - enum_text = SourceEnumerator.findEnum(enum_name, SourceEnumerator.findSourceFile(source_file_path)) - - enumerator_pattern = re.compile("(\w+?)\s*?=\s*?(\d+)") - - enumerators = [] - for enumerator in enumerator_pattern.findall(enum_text): - enumerators.append((enumerator[0], int(enumerator[1]))) - - return enumerators diff --git a/ThirdParty/Ert/python/python/ert_gui/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/CMakeLists.txt deleted file mode 100644 index 6aa1647efb..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - about_dialog.py - ert_splash.py - ertnotifier.py - ertplot.py - gert_main.py - main_window.py - newconfig.py -) - -add_python_package("python.ert_gui" ${PYTHON_INSTALL_PREFIX}/ert_gui "${PYTHON_SOURCES}" True) - -add_subdirectory(ertwidgets) -add_subdirectory(ide) -add_subdirectory(plottery) -add_subdirectory(shell) -add_subdirectory(simulation) -add_subdirectory(tools) diff --git a/ThirdParty/Ert/python/python/ert_gui/README.txt b/ThirdParty/Ert/python/python/ert_gui/README.txt deleted file mode 100644 index 8341e4c175..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/README.txt +++ /dev/null @@ -1,43 +0,0 @@ -How to develop/run the GUI: - -You can run the gui in two ways: - -1a There are CMakeLists.txt files all the ways through the gui filesystem, - and if you build the ert distribution you will get file hierarchy - xxxx/build/python/ert_gui beside the xxxx/build/python/ert hierarchy. - - This is the way the gui should be organized when installed, to invoke the - gui this way: - - gert -v xxxx/build - - Observe that the 'xxxx' part must be an ABSOLUTE path, otherwise the - frontend script will search in the default installation directory. - - -1b Alternatively you can use the gert command to invoke the gui in the source - directory: - - gert -v xxxx/python - - Observe only one 'python' above. - - - -2. You can invoke gui as a python module directly from the source, without - going through the gert frontend script. This requires that set several - environment variables: - - ERT_SITE_CONFIG -> /project/res/etc/ERT/site-config - ERT_SHARE_PATH -> xxxx/libenkf/applications/ert_gui/share - LD_LIBRARY_PATH -> xxxx/build/lib64 - - And in addition you must source the local_csh file in - xxxx/python/test to set the PYTHONPATH correctly. - - -About the ERT_SHARE_PATH variable: the correct value for the ERT_SHARE_PATH -variable is currently xxxx/libenkf/applications/ert_gui/share, so if -you are using alternative 2 you get this one correctly, whereas if you use -alternative 1 it will be set to a generally incorrect value by the gert -frontend script. diff --git a/ThirdParty/Ert/python/python/ert_gui/__init__.py b/ThirdParty/Ert/python/python/ert_gui/__init__.py deleted file mode 100644 index 07c404d1fd..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -import sys -import warnings - -REQUIRED_VERSION_HEX = 0x02070000 - - -if sys.hexversion < REQUIRED_VERSION_HEX: - raise Exception("ERT GUI Python requires at least version 2.7 of Python") - -import os -import matplotlib - -def headless(): - return "DISPLAY" not in os.environ - -if headless(): - matplotlib.use("Agg") -else: - matplotlib.use("Qt4Agg") - - -from .ertnotifier import ERT -from .ertnotifier import configureErtNotifier diff --git a/ThirdParty/Ert/python/python/ert_gui/about_dialog.py b/ThirdParty/Ert/python/python/ert_gui/about_dialog.py deleted file mode 100644 index f63e7fc7ab..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/about_dialog.py +++ /dev/null @@ -1,123 +0,0 @@ -# Copyright (C) 2014 Statoil ASA, Norway. -# -# This file is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from PyQt4.QtCore import Qt, QSize -from PyQt4.QtGui import QDialog, QVBoxLayout, QPushButton, QHBoxLayout, QLabel, QFont -from ert.util import Version -from ert_gui.ertwidgets import resourceImage - - -class AboutDialog(QDialog): - - def __init__(self, parent): - QDialog.__init__(self, parent) - - self.setWindowTitle("About") - self.setModal(True) - self.setFixedSize(QSize(600, 480)) - self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint) - self.setWindowFlags(self.windowFlags() & ~Qt.WindowCloseButtonHint) - self.setWindowFlags(self.windowFlags() & ~Qt.WindowCancelButtonHint) - - main_layout = QVBoxLayout() - - main_layout.addLayout(self.createTopLayout()) - main_layout.addLayout(self.createGplLayout()) - main_layout.addLayout(self.createButtonLayout()) - - self.setLayout(main_layout) - - - def createTopLayout(self): - top_layout = QHBoxLayout() - - image_label = QLabel() - image = resourceImage("splash.jpg") - image_label.setPixmap(image.scaled(200, 240, Qt.KeepAspectRatio)) - - top_layout.addWidget(image_label) - - top_layout.addLayout(self.createInfoLayout(), 1) - - return top_layout - - @staticmethod - def createInfoLayout(): - info_layout = QVBoxLayout() - - ert = QLabel() - ert.setAlignment(Qt.AlignHCenter) - - title_font = QFont() - title_font.setPointSize(40) - ert.setFont(title_font) - ert.setText("ERT") - - info_layout.addWidget(ert) - info_layout.addStretch(1) - ert_title = QLabel() - ert_title.setAlignment(Qt.AlignHCenter) - ert_title.setText("Ensemble based Reservoir Tool") - info_layout.addWidget(ert_title) - - version = QLabel() - version.setAlignment(Qt.AlignHCenter) - version.setText("Version: %s" % Version.getVersion()) - info_layout.addWidget(version) - - timestamp = QLabel() - timestamp.setAlignment(Qt.AlignHCenter) - timestamp.setText("Build time: %s" % Version.getBuildTime()) - info_layout.addWidget(timestamp) - - git_commit = QLabel() - git_commit.setAlignment(Qt.AlignHCenter) - git_commit.setText("Git commit hash: %s" % Version.getGitCommit(short=True)) - info_layout.addWidget(git_commit) - - info_layout.addStretch(5) - - return info_layout - - - def createGplLayout(self): - gpl = QLabel() - gpl.setText("ERT 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.

\ - \ - ERT 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 www.gnu.org for more details. ") - gpl.setWordWrap(True) - gpl_layout = QVBoxLayout() - gpl_layout.addWidget(gpl) - return gpl_layout - - def createButtonLayout(self): - button_layout = QHBoxLayout() - - close_button = QPushButton("Close") - close_button.clicked.connect(self.accept) - - button_layout.addStretch() - button_layout.addWidget(close_button) - button_layout.addStretch() - - return button_layout diff --git a/ThirdParty/Ert/python/python/ert_gui/ert_splash.py b/ThirdParty/Ert/python/python/ert_gui/ert_splash.py deleted file mode 100644 index 07dbf7b284..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ert_splash.py +++ /dev/null @@ -1,106 +0,0 @@ -from PyQt4.QtCore import Qt -from PyQt4.QtGui import QSplashScreen, QApplication, QColor, QPen, QFont - -from ert_gui.ertwidgets import resourceImage - - -class ErtSplash(QSplashScreen): - def __init__(self): - QSplashScreen.__init__(self) - self.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.SplashScreen) - - splash_width = 720 - splash_height = 400 - - desktop = QApplication.desktop() - screen = desktop.screenGeometry(desktop.primaryScreen()).size() - - screen_width, screen_height = screen.width(), screen.height() - x = screen_width / 2 - splash_width / 2 - y = screen_height / 2 - splash_height / 2 - self.setGeometry(x, y, splash_width, splash_height) - - - self.splash_image = resourceImage("splash.jpg") - - self.ert = "ERT" - self.ert_title = "Ensemble based Reservoir Tool" - self.version = "Version string" - self.timestamp = "Timestamp string" - self.copyright = u"Copyright \u00A9 2017 Statoil ASA, Norway" - - - def drawContents(self, painter): - """ @type painter: QPainter """ - w = self.width() - h = self.height() - - margin = 10 - - background = QColor(210, 211, 215) - text_color = QColor(0, 0, 0) - foreground = QColor(255, 255, 255) - - painter.setBrush(background) - painter.fillRect(0, 0, w, h, background) - - - pen = QPen() - pen.setWidth(2) - pen.setColor(foreground) - - - painter.setPen(pen) - painter.drawRect(0, 0, w - 1, h - 1) - - image_width = self.splash_image.width() - image_height = self.splash_image.height() - aspect = float(image_width) / float(image_height) - - scaled_height = h - 2 * margin - scaled_width = scaled_height * aspect - - painter.drawRect(margin, margin, scaled_width, scaled_height) - painter.drawPixmap(margin, margin, scaled_width, scaled_height, self.splash_image) - - text_x = scaled_width + 2 * margin - top_offset = margin - text_area_width = w - scaled_width - 2 * margin - - painter.setPen(text_color) - - - text_size = 150 - font = QFont("Serif") - font.setStyleHint(QFont.Serif) - font.setPixelSize(text_size) - painter.setFont(font) - painter.drawText(text_x, margin + top_offset, text_area_width, text_size, Qt.AlignHCenter | Qt.AlignCenter, self.ert) - - top_offset += text_size + 2 * margin - text_size = 25 - font.setPixelSize(text_size) - painter.setFont(font) - painter.drawText(text_x, top_offset, text_area_width, text_size, Qt.AlignHCenter | Qt.AlignCenter, self.ert_title) - - top_offset += text_size + 4 * margin - text_size = 20 - font.setPixelSize(text_size) - painter.setFont(font) - painter.drawText(text_x, top_offset, text_area_width, text_size, Qt.AlignHCenter | Qt.AlignCenter, self.version) - - top_offset += text_size + margin - text_size = 15 - font.setPixelSize(text_size) - painter.setFont(font) - painter.drawText(text_x, top_offset, text_area_width, text_size, Qt.AlignHCenter | Qt.AlignCenter, self.timestamp) - - - text_size = 12 - font.setPixelSize(text_size) - painter.setFont(font) - painter.drawText(text_x, h - text_size - margin - 5, text_area_width, text_size + 5, Qt.AlignHCenter | Qt.AlignCenter, self.copyright) - - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/ertnotifier.py b/ThirdParty/Ert/python/python/ert_gui/ertnotifier.py deleted file mode 100644 index fd80d6de65..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertnotifier.py +++ /dev/null @@ -1,50 +0,0 @@ -from ert.enkf import EnKFMain -from PyQt4.QtCore import QObject, pyqtSignal, pyqtSlot - -class ErtNotifier(QObject): - ertChanged = pyqtSignal() - - def __init__(self, ert, config_file, parent=None): - QObject.__init__(self, parent) - self._ert = ert - self._config_file = config_file - - def _checkErt(self): - if self._ert is None: - raise ValueError("Ert is undefined.") - - @property - def ert(self): - """ @rtype: EnKFMain """ - self._checkErt() - return self._ert - - - @property - def config_file(self): - """ @rtype: str """ - self._checkErt() - return self._config_file - - pyqtSlot() - def emitErtChange(self): - self._checkErt() - self.ertChanged.emit() - - pyqtSignal() - def reloadERT(self, config_file): - import sys - import os - python_executable = sys.executable - ert_gui_main = sys.argv[0] - - self._ert.free() - os.execl(python_executable, python_executable, ert_gui_main, config_file) - - -ERT = ErtNotifier(None, None) -""" @type: ErtNotifier """ - -def configureErtNotifier(ert, config_file): - ERT._ert = ert - ERT._config_file = config_file diff --git a/ThirdParty/Ert/python/python/ert_gui/ertplot.py b/ThirdParty/Ert/python/python/ert_gui/ertplot.py deleted file mode 100644 index cfe0116333..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertplot.py +++ /dev/null @@ -1,87 +0,0 @@ - -import sys -import os -from PyQt4.QtGui import QApplication -import time -from ert.enkf import EnKFMain -from ert.util import Version -from ert_gui.ert_splash import ErtSplash -from ert_gui.ertwidgets import resourceIcon -from ert_gui.tools.plot.plot_window import PlotWindow - - -import ert_gui.ertwidgets - -if os.getenv("ERT_SHARE_PATH"): - ert_share_path = os.getenv("ERT_SHARE_PATH") -else: - # If the ERT_SHARE_PATH variable is not set we try to use the - # source location relative to the location of the current file; - # assuming we are in the source directory. Will not work if we are - # in an arbitrary build directory. - ert_share_path = os.path.realpath( os.path.join( os.path.dirname( os.path.abspath( __file__)) , "../../../share")) - -ert_gui.ertwidgets.img_prefix = ert_share_path + "/gui/img/" - - -def main(argv): - - app = QApplication(argv) #Early so that QT is initialized before other imports - app.setWindowIcon(resourceIcon("application/window_icon_cutout")) - - if len(argv) == 1: - sys.stderr.write("Missing configuration file") - sys.exit(1) - - config_file = argv[1] - strict = True - - if not os.path.exists(config_file): - print("Can not run without a configuration file.") - sys.exit(1) - - if os.path.isdir(config_file): - print("The specified configuration file is a directory!") - sys.exit(1) - - - splash = ErtSplash() - splash.version = "Version %s" % Version.getVersion() - splash.timestamp = Version.getBuildTime() - - splash.show() - splash.repaint() - - now = time.time() - - - ert = EnKFMain(config_file, strict=strict, verbose=False) - ert_gui.configureErtNotifier(ert, config_file) - - window = PlotWindow(ert, None) - - sleep_time = 2 - (time.time() - now) - - if sleep_time > 0: - time.sleep(sleep_time) - - window.show() - splash.finish(window) - window.activateWindow() - window.raise_() - finished_code = app.exec_() - - ert.free() - - sys.exit(finished_code) - - -if __name__ == "__main__": - main(sys.argv) - - - - - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/CMakeLists.txt deleted file mode 100644 index 70bad08451..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - activelabel.py - analysismoduleselector.py - analysismodulevariablespanel.py - caselist.py - caseselector.py - checklist.py - closabledialog.py - customdialog.py - legend.py - listeditbox.py - pathchooser.py - searchbox.py - stringbox.py - summarypanel.py - validateddialog.py - validationsupport.py -) - -add_python_package("python.ert_gui.ertwidgets" ${PYTHON_INSTALL_PREFIX}/ert_gui/ertwidgets "${PYTHON_SOURCES}" True) - -add_subdirectory(models) diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/__init__.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/__init__.py deleted file mode 100644 index 22b33f8907..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/__init__.py +++ /dev/null @@ -1,74 +0,0 @@ -from PyQt4 import QtGui, QtCore - -img_prefix = "" - -def addHelpToWidget(widget, link): - original_enter_event = widget.enterEvent - - def enterEvent(event): - original_enter_event(event) - try: - from ert_gui.tools import HelpCenter - HelpCenter.getHelpCenter("ERT").setHelpMessageLink(link) - except AttributeError: - pass - - widget.enterEvent = enterEvent - - -def showWaitCursorWhileWaiting(func): - """A function decorator to show the wait cursor while the function is working.""" - - def wrapper(*arg): - QtGui.QApplication.setOverrideCursor(QtGui.QCursor(QtCore.Qt.WaitCursor)) - try: - res = func(*arg) - return res - except: - raise - finally: - QtGui.QApplication.restoreOverrideCursor() - - return wrapper - - -def resourceIcon(name): - """Load an image as an icon""" - # print("Icon used: %s" % name) - return QtGui.QIcon(img_prefix + name) - - -def resourceStateIcon(on, off): - """Load two images as an icon with on and off states""" - icon = QtGui.QIcon() - icon.addPixmap(resourceImage(on), state=QtGui.QIcon.On) - icon.addPixmap(resourceImage(off), state=QtGui.QIcon.Off) - return icon - - -def resourceImage(name): - """Load an image as a Pixmap""" - return QtGui.QPixmap(img_prefix + name) - - -def resourceMovie(name): - """ @rtype: QMovie """ - movie = QtGui.QMovie(img_prefix + name) - movie.start() - return movie - - -from .legend import Legend -from .validationsupport import ValidationSupport -from .closabledialog import ClosableDialog -from .analysismoduleselector import AnalysisModuleSelector -from .activelabel import ActiveLabel -from .searchbox import SearchBox -from .caseselector import CaseSelector -from .caselist import CaseList -from .checklist import CheckList -from .stringbox import StringBox -from .listeditbox import ListEditBox -from .customdialog import CustomDialog -from .summarypanel import SummaryPanel -from .pathchooser import PathChooser diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/activelabel.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/activelabel.py deleted file mode 100644 index 10d9532320..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/activelabel.py +++ /dev/null @@ -1,28 +0,0 @@ -from PyQt4.QtGui import QLabel, QFont - -from ert_gui.ertwidgets import addHelpToWidget - - -class ActiveLabel(QLabel): - def __init__(self, model, help_link=""): - QLabel.__init__(self) - - addHelpToWidget(self, help_link) - self._model = model - - font = self.font() - font.setWeight(QFont.Bold) - self.setFont(font) - - self._model.valueChanged.connect(self.updateLabel) - - self.updateLabel() - - - def updateLabel(self): - """Retrieves data from the model and inserts it into the edit line""" - model_value = self._model.getValue() - if model_value is None: - model_value = "" - - self.setText(str(model_value)) diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/analysismoduleselector.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/analysismoduleselector.py deleted file mode 100644 index 94de4b503f..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/analysismoduleselector.py +++ /dev/null @@ -1,71 +0,0 @@ -from PyQt4.QtCore import QMargins, Qt -from PyQt4.QtGui import QWidget, QHBoxLayout, QComboBox, QToolButton - -from ert_gui.ertwidgets import addHelpToWidget, ClosableDialog, resourceIcon -from ert_gui.ertwidgets.models.ertmodel import getCurrentAnalysisModuleName, getAnalysisModuleNames -from ert_gui.ertwidgets.analysismodulevariablespanel import AnalysisModuleVariablesPanel - - -class AnalysisModuleSelector(QWidget): - def __init__(self, iterable=False, load_all = False, help_link=""): - QWidget.__init__(self) - self._iterable = iterable - - addHelpToWidget(self, help_link) - - layout = QHBoxLayout() - - analysis_module_combo = QComboBox() - - self._module_names = getAnalysisModuleNames(self._iterable) - if load_all: - self._module_names += getAnalysisModuleNames(not self._iterable) - - for module_name in self._module_names: - analysis_module_combo.addItem(module_name) - - self._current_module_name = self._getCurrentAnalysisModuleName() - if self._current_module_name is not None: - analysis_module_combo.setCurrentIndex(self._module_names.index(self._current_module_name)) - - analysis_module_combo.currentIndexChanged[int].connect(self.analysisModuleChanged) - - variables_popup_button = QToolButton() - variables_popup_button.setIcon(resourceIcon("ide/small/cog_edit.png")) - variables_popup_button.clicked.connect(self.showVariablesPopup) - variables_popup_button.setMaximumSize(20, 20) - - layout.addWidget(analysis_module_combo, 0, Qt.AlignLeft) - layout.addWidget(variables_popup_button, 0, Qt.AlignLeft) - layout.setContentsMargins(QMargins(0, 0, 0, 0)) - layout.addStretch() - - self.setLayout(layout) - - def analysisModuleChanged(self, index): - self._current_module_name = self._module_names[index] - - def _getCurrentAnalysisModuleName(self): - active_name = getCurrentAnalysisModuleName() - modules = self._module_names - - if active_name in modules: - return active_name - elif "STD_ENKF" in modules and not self._iterable: - return "STD_ENKF" - elif "RML_ENKF" in modules and self._iterable: - return "RML_ENKF" - elif len(modules) > 0: - return modules[0] - - return None - - def getSelectedAnalysisModuleName(self): - return self._current_module_name - - def showVariablesPopup(self): - if self.getSelectedAnalysisModuleName() is not None: - variable_dialog = AnalysisModuleVariablesPanel(self.getSelectedAnalysisModuleName()) - dialog = ClosableDialog("Edit variables", variable_dialog, self.parent()) - - dialog.exec_() diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/analysismodulevariablespanel.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/analysismodulevariablespanel.py deleted file mode 100644 index 30cb70780f..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/analysismodulevariablespanel.py +++ /dev/null @@ -1,142 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'analysismodulevariablespanel.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from functools import partial - -from PyQt4.QtCore import QString -from PyQt4.QtGui import QDoubleSpinBox, QWidget, QFormLayout, QCheckBox, QLineEdit, QHBoxLayout, QSpinBox, QLabel - -from ert_gui.ertwidgets.models.analysismodulevariablesmodel import AnalysisModuleVariablesModel - - -class AnalysisModuleVariablesPanel(QWidget): - def __init__(self, analysis_module_name, parent=None): - QWidget.__init__(self, parent) - - self._analysis_module_name = analysis_module_name - - layout = QFormLayout() - variable_names = AnalysisModuleVariablesModel.getVariableNames(self._analysis_module_name) - - if len(variable_names) == 0: - label = QString("No variables found to edit") - boxlayout = QHBoxLayout() - layout.addRow(label, boxlayout) - - else: - analysis_module_variables_model = AnalysisModuleVariablesModel - self.blockSignals(True) - - variable_names2 = self.sortVariables(variable_names) - for variable_name in variable_names2: - variable_type = analysis_module_variables_model.getVariableType(variable_name) - variable_value = analysis_module_variables_model.getVariableValue(self._analysis_module_name, - variable_name) - - label_name = analysis_module_variables_model.getVariableLabelName(variable_name) - if variable_type == bool: - spinner = self.createCheckBox(variable_name, variable_value, variable_type) - - elif variable_type == float: - spinner = self.createDoubleSpinBox(variable_name, variable_value, variable_type, - analysis_module_variables_model) - - elif variable_type == str: - spinner = self.createLineEdit(variable_name, variable_value, variable_type) - - elif variable_type == int: - spinner = self.createSpinBox(variable_name, variable_value, variable_type, - analysis_module_variables_model) - - layout.addRow(label_name, spinner) - if variable_name == "LAMBDA0": - label = QLabel( - " Initial Lambda of -1.00 signifies that the value will be calculated") - layout.addRow(label, None) - - self.setLayout(layout) - self.blockSignals(False) - - def sortVariables(self, variable_list): - analysis_module_variables_model = AnalysisModuleVariablesModel - sorted_list = ["#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#", "#"] - result = [] - for name in variable_list: - pos = analysis_module_variables_model.getVariablePosition(name) - sorted_list.insert(pos, name) - sorted_list.__delitem__(pos + 1) - - for item in sorted_list: - if item != "#": - result.append(item) - - return result - - def createSpinBox(self, variable_name, variable_value, variable_type, analysis_module_variables_model): - spinner = QSpinBox() - spinner.setMinimumWidth(75) - spinner.setMaximum(analysis_module_variables_model.getVariableMaximumValue(variable_name)) - spinner.setMinimum(analysis_module_variables_model.getVariableMinimumValue(variable_name)) - spinner.setSingleStep(analysis_module_variables_model.getVariableStepValue(variable_name)) - if variable_value is not None: - spinner.setValue(variable_value) - spinner.valueChanged.connect(partial(self.valueChanged, variable_name, variable_type, spinner)) - return spinner - - def createLineEdit(self, variable_name, variable_value, variable_type): - spinner = QLineEdit() - if variable_value == "None": - spinner.setText("") - else: - spinner.setText(variable_value) - spinner.editingFinished.connect(partial(self.valueChanged, variable_name, variable_type, spinner)) - return spinner - - def createCheckBox(self, variable_name, variable_value, variable_type): - spinner = QCheckBox() - spinner.setChecked(variable_value) - spinner.clicked.connect(partial(self.valueChanged, variable_name, variable_type, spinner)) - return spinner - - def createDoubleSpinBox(self, variable_name, variable_value, variable_type, analysis_module_variables_model): - spinner = QDoubleSpinBox() - spinner.setMinimumWidth(75) - spinner.setMaximum(analysis_module_variables_model.getVariableMaximumValue(variable_name)) - spinner.setMinimum(analysis_module_variables_model.getVariableMinimumValue(variable_name)) - spinner.setSingleStep(analysis_module_variables_model.getVariableStepValue(variable_name)) - spinner.setValue(variable_value) - spinner.valueChanged.connect(partial(self.valueChanged, variable_name, variable_type, spinner)) - return spinner; - - def valueChanged(self, variable_name, variable_type, variable_control): - value = None - if variable_type == bool: - assert isinstance(variable_control, QCheckBox) - value = variable_control.isChecked() - elif variable_type == float: - assert isinstance(variable_control, QDoubleSpinBox) - value = variable_control.value() - elif variable_type == str: - assert isinstance(variable_control, QLineEdit) - value = variable_control.text() - value = str(value).strip() - if len(value) == 0: - value = None - elif variable_type == int: - assert isinstance(variable_control, QSpinBox) - value = variable_control.value() - - if value is not None: - AnalysisModuleVariablesModel.setVariableValue(self._analysis_module_name, variable_name, value) diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/caselist.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/caselist.py deleted file mode 100644 index da09206cd7..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/caselist.py +++ /dev/null @@ -1,114 +0,0 @@ -from PyQt4.QtCore import QSize -from PyQt4.QtGui import QListWidget, QMessageBox, QAbstractItemView, QWidget, QVBoxLayout, QLabel -from PyQt4.QtGui import QToolButton, QHBoxLayout - -from ert_gui import ERT -from ert_gui.ertwidgets import addHelpToWidget -from ert_gui.ertwidgets.models.ertmodel import getAllCases, selectOrCreateNewCase -from ert_gui.ertwidgets.validateddialog import ValidatedDialog -from ert_gui.ertwidgets import resourceIcon - - -class AddRemoveWidget(QWidget): - """ - A simple class that provides to vertically positioned buttons for adding and removing something. - The addFunction and removeFunction functions must be provided. - """ - - def __init__(self, addFunction=None, removeFunction=None, horizontal=False): - QWidget.__init__(self) - - self.addButton = QToolButton(self) - self.addButton.setIcon(resourceIcon("add")) - self.addButton.setIconSize(QSize(16, 16)) - self.addButton.clicked.connect(addFunction) - - self.removeButton = QToolButton(self) - self.removeButton.setIcon(resourceIcon("remove")) - self.removeButton.setIconSize(QSize(16, 16)) - self.removeButton.clicked.connect(removeFunction) - - if horizontal: - self.buttonLayout = QHBoxLayout() - else: - self.buttonLayout = QVBoxLayout() - - self.buttonLayout.setMargin(0) - - if horizontal: - self.buttonLayout.addStretch(1) - - self.buttonLayout.addWidget(self.addButton) - self.buttonLayout.addWidget(self.removeButton) - - if not horizontal: - self.buttonLayout.addStretch(1) - else: - self.buttonLayout.addSpacing(2) - - self.setLayout(self.buttonLayout) - - def enableAddButton(self, state): - """Enable or disable the add button""" - self.addButton.setEnabled(state) - - def enableRemoveButton(self, state): - """Enable or disable the remove button""" - self.removeButton.setEnabled(state) - -class CaseList(QWidget): - - def __init__(self): - QWidget.__init__(self) - - addHelpToWidget(self, "init/case_list") - - layout = QVBoxLayout() - - self._list = QListWidget(self) - self._list.setMinimumHeight(100) - self._list.setMaximumHeight(250) - self._default_selection_mode = self._list.selectionMode() - self.setSelectable(False) - - layout.addWidget(QLabel("Available Cases:")) - layout.addWidget(self._list) - - self._addRemoveWidget = AddRemoveWidget(self.addItem, self.removeItem, horizontal=True) - self._addRemoveWidget.enableRemoveButton(False) - layout.addWidget(self._addRemoveWidget) - - self._title = "New keyword" - self._description = "Enter name of keyword:" - - self.setLayout(layout) - - ERT.ertChanged.connect(self.updateList) - self.updateList() - - def setSelectable(self, selectable): - if selectable: - self._list.setSelectionMode(self._default_selection_mode) - else: - self._list.setSelectionMode(QAbstractItemView.NoSelection) - - - def addItem(self): - dialog = ValidatedDialog("New case", "Enter name of new case:", getAllCases()) - new_case_name = dialog.showAndTell() - if not new_case_name == "": - selectOrCreateNewCase(new_case_name) - - def removeItem(self): - message = "Support for removal of items has not been implemented!" - QMessageBox.information(self, "Not implemented!", message) - - - def updateList(self): - """Retrieves data from the model and inserts it into the list""" - case_list = getAllCases() - - self._list.clear() - - for case in case_list: - self._list.addItem(case) diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/caseselector.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/caseselector.py deleted file mode 100644 index f3afd9f529..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/caseselector.py +++ /dev/null @@ -1,55 +0,0 @@ -from PyQt4.QtGui import QComboBox - -from ert_gui import ERT -from ert_gui.ertwidgets import addHelpToWidget -from ert_gui.ertwidgets.models.ertmodel import getAllCases, selectOrCreateNewCase, getCurrentCaseName, getAllInitializedCases - - -class CaseSelector(QComboBox): - def __init__(self, update_ert=True, show_only_initialized=False, ignore_current=False, help_link="init/current_case_selection"): - QComboBox.__init__(self) - self._update_ert = update_ert # If true current case of ert will be change - self._show_only_initialized = show_only_initialized # only show initialized cases - self._ignore_current = ignore_current # ignore the currently selected case if it changes - - - addHelpToWidget(self, help_link) - self.setSizeAdjustPolicy(QComboBox.AdjustToContents) - - self.populate() - - self.currentIndexChanged[int].connect(self.selectionChanged) - ERT.ertChanged.connect(self.populate) - - def _getAllCases(self): - if self._show_only_initialized: - return getAllInitializedCases() - else: - return getAllCases() - - def selectionChanged(self, index): - if self._update_ert: - assert 0 <= index < self.count(), "Should not happen! Index out of range: 0 <= %i < %i" % (index, self.count()) - - item = self._getAllCases()[index] - selectOrCreateNewCase(item) - - def populate(self): - block = self.signalsBlocked() - self.blockSignals(True) - - case_list = self._getAllCases() - self.clear() - - for case in case_list: - self.addItem(case) - - current_index = 0 - current_case = getCurrentCaseName() - if current_case in case_list: - current_index = case_list.index(current_case) - - if current_index != self.currentIndex() and not self._ignore_current: - self.setCurrentIndex(current_index) - - self.blockSignals(block) diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/checklist.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/checklist.py deleted file mode 100644 index 4220e9ac34..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/checklist.py +++ /dev/null @@ -1,174 +0,0 @@ -from PyQt4.QtCore import QSize, Qt -from PyQt4.QtGui import QToolButton, QHBoxLayout, QLabel, QListWidget -from PyQt4.QtGui import QWidget, QVBoxLayout, QListWidgetItem, QMenu, QAbstractItemView - -from ert_gui.ertwidgets import addHelpToWidget, SearchBox, resourceIcon - - -class CheckList(QWidget): - def __init__(self, model, label="", help_link="", custom_filter_button=None): - """ - :param custom_filter_button: if needed, add a button that opens a custom filter menu. Useful when search alone - isn't enough to filter the list. - :type custom_filter_button: QToolButton - """ - QWidget.__init__(self) - - self._model = model - - if help_link != "": - addHelpToWidget(self, help_link) - - layout = QVBoxLayout() - - self._createCheckButtons() - - self._list = QListWidget() - self._list.setContextMenuPolicy(Qt.CustomContextMenu) - self._list.setSelectionMode(QAbstractItemView.ExtendedSelection) - - self._search_box = SearchBox() - - check_button_layout = QHBoxLayout() - - check_button_layout.setMargin(0) - check_button_layout.setSpacing(0) - check_button_layout.addWidget(QLabel(label)) - check_button_layout.addStretch(1) - check_button_layout.addWidget(self._checkAllButton) - check_button_layout.addWidget(self._uncheckAllButton) - - layout.addLayout(check_button_layout) - layout.addWidget(self._list) - - """ - Inserts the custom filter button, if provided. The caller is responsible for all related actions. - """ - if custom_filter_button is not None: - search_bar_layout = QHBoxLayout() - search_bar_layout.addWidget(self._search_box) - search_bar_layout.addWidget(custom_filter_button) - layout.addLayout(search_bar_layout) - else: - layout.addWidget(self._search_box) - - self.setLayout(layout) - - self._checkAllButton.clicked.connect(self.checkAll) - self._uncheckAllButton.clicked.connect(self.uncheckAll) - self._list.itemChanged.connect(self.itemChanged) - self._search_box.filterChanged.connect(self.filterList) - self._list.customContextMenuRequested.connect(self.showContextMenu) - - self._model.selectionChanged.connect(self.modelChanged) - self._model.modelChanged.connect(self.modelChanged) - - self.modelChanged() - - def _createCheckButtons(self): - self._checkAllButton = QToolButton() - self._checkAllButton.setIcon(resourceIcon("checked")) - self._checkAllButton.setIconSize(QSize(16, 16)) - self._checkAllButton.setToolButtonStyle(Qt.ToolButtonIconOnly) - self._checkAllButton.setAutoRaise(True) - self._checkAllButton.setToolTip("Select all") - self._uncheckAllButton = QToolButton() - self._uncheckAllButton.setIcon(resourceIcon("notchecked")) - self._uncheckAllButton.setIconSize(QSize(16, 16)) - self._uncheckAllButton.setToolButtonStyle(Qt.ToolButtonIconOnly) - self._uncheckAllButton.setAutoRaise(True) - self._uncheckAllButton.setToolTip("Unselect all") - - def itemChanged(self, item): - """@type item: QListWidgetItem""" - if item.checkState() == Qt.Checked: - self._model.selectValue(str(item.text())) - elif item.checkState() == Qt.Unchecked: - self._model.unselectValue(str(item.text())) - else: - raise AssertionError("Unhandled checkstate!") - - def modelChanged(self): - self._list.clear() - - items = self._model.getList() - - for item in items: - list_item = QListWidgetItem(item) - list_item.setFlags(list_item.flags() | Qt.ItemIsUserCheckable) - - if self._model.isValueSelected(item): - list_item.setCheckState(Qt.Checked) - else: - list_item.setCheckState(Qt.Unchecked) - - self._list.addItem(list_item) - - self.filterList(self._search_box.filter()) - - def setSelectionEnabled(self, enabled): - self.setEnabled(enabled) - self._checkAllButton.setEnabled(enabled) - self._uncheckAllButton.setEnabled(enabled) - - def filterList(self, filter): - filter = filter.lower() - - for index in range(0, self._list.count()): - item = self._list.item(index) - text = str(item.text()).lower() - - if filter == "": - item.setHidden(False) - elif filter in text: - item.setHidden(False) - else: - item.setHidden(True) - - def checkAll(self): - """ - Checks all visible items in the list. - """ - for index in range(0, self._list.count()): - item = self._list.item(index) - if not item.isHidden(): - self._model.selectValue(str(item.text())) - - def uncheckAll(self): - """ - Unchecks all items in the list, visible or not - """ - self._model.unselectAll() - - def checkSelected(self): - items = [] - for item in self._list.selectedItems(): - items.append(str(item.text())) - - for item in items: - self._model.selectValue(item) - - def uncheckSelected(self): - items = [] - for item in self._list.selectedItems(): - items.append(str(item.text())) - - for item in items: - self._model.unselectValue(item) - - def showContextMenu(self, point): - p = self._list.mapToGlobal(point) - menu = QMenu() - check_selected = menu.addAction("Check selected") - uncheck_selected = menu.addAction("Uncheck selected") - menu.addSeparator() - clear_selection = menu.addAction("Clear selection") - - selected_item = menu.exec_(p) - - if selected_item == check_selected: - self.checkSelected() - elif selected_item == uncheck_selected: - self.uncheckSelected() - elif selected_item == clear_selection: - self._list.clearSelection() diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/closabledialog.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/closabledialog.py deleted file mode 100644 index b5f20599f1..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/closabledialog.py +++ /dev/null @@ -1,73 +0,0 @@ -# Copyright (C) 2016 Statoil ASA, Norway. -# -# The file 'closabledialog.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from PyQt4.QtCore import Qt -from PyQt4.QtGui import QDialog, QVBoxLayout, QLayout, QPushButton, QHBoxLayout - - -class ClosableDialog(QDialog): - - def __init__(self, title, widget, parent=None): - QDialog.__init__(self, parent) - - self.setWindowTitle(title) - self.setModal(True) - self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint) - self.setWindowFlags(self.windowFlags() & ~Qt.WindowCloseButtonHint) - self.setWindowFlags(self.windowFlags() & ~Qt.WindowCancelButtonHint) - - - layout = QVBoxLayout() - layout.setSizeConstraint(QLayout.SetFixedSize) # not resizable!!! - layout.addWidget(widget) - - self.__button_layout = QHBoxLayout() - self.close_button = QPushButton("Close") - self.close_button.setObjectName("CLOSE") - self.close_button.clicked.connect(self.accept) - self.__button_layout.addStretch() - self.__button_layout.addWidget(self.close_button) - - layout.addStretch() - layout.addLayout(self.__button_layout) - - self.setLayout(layout) - - - def disableCloseButton(self): - self.close_button.setEnabled(False) - - def enableCloseButton(self): - self.close_button.setEnabled(True) - - def keyPressEvent(self, q_key_event): - if not self.close_button.isEnabled() and q_key_event.key() == Qt.Key_Escape: - pass - else: - QDialog.keyPressEvent(self, q_key_event) - - def addButton(self, caption, listner): - button = QPushButton(caption) - button.setObjectName(str(caption).capitalize()) - self.__button_layout.insertWidget(1,button) - button.clicked.connect(listner) - - def toggleButton(self, caption, enabled): - button = self.findChild(QPushButton,str(caption).capitalize()) - if button is not None: - button.setEnabled(enabled) - - diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/customdialog.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/customdialog.py deleted file mode 100644 index 1f6e3cffc8..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/customdialog.py +++ /dev/null @@ -1,115 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'customdialog.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from PyQt4.QtCore import Qt, QSize, SIGNAL -from PyQt4.QtGui import QDialog, QColor, QFormLayout, QLabel, QWidget, QDialogButtonBox, QLayout - - -class CustomDialog(QDialog): - INVALID_COLOR = QColor(255, 235, 235) - - def __init__(self, title="Title", description="Description", parent=None): - QDialog.__init__(self, parent) - - self._option_list = [] - """ :type: list of QWidget """ - - self.setModal(True) - self.setWindowTitle(title) - - self.layout = QFormLayout() - self.layout.setFieldGrowthPolicy(QFormLayout.ExpandingFieldsGrow) - self.layout.setSizeConstraint(QLayout.SetFixedSize) - - label = QLabel(description) - label.setAlignment(Qt.AlignHCenter) - - self.layout.addRow(self.createSpace(5)) - self.layout.addRow(label) - self.layout.addRow(self.createSpace(10)) - - self.ok_button = None - - self.setLayout(self.layout) - - def notValid(self, msg): - """Called when the name is not valid.""" - self.ok_button.setEnabled(False) - - def valid(self): - """Called when the name is valid.""" - self.ok_button.setEnabled(True) - - def optionValidationChanged(self): - valid = True - for option in self._option_list: - if hasattr(option, "isValid"): - if not option.isValid(): - valid = False - self.notValid("One or more options are incorrectly set!") - - if valid: - self.valid() - - def showAndTell(self): - """ - Shows the dialog modally and returns the true or false (accept/reject) - @rtype: bool - """ - self.optionValidationChanged() - return self.exec_() - - def createSpace(self, size=5): - """Creates a widget that can be used as spacing on a panel.""" - qw = QWidget() - qw.setMinimumSize(QSize(size, size)) - - return qw - - def addSpace(self, size=10): - """ Add some vertical spacing """ - space_widget = self.createSpace(size) - self.layout.addRow("", space_widget) - - def addLabeledOption(self, label, option_widget): - """ - @type option_widget: QWidget - """ - self._option_list.append(option_widget) - - if hasattr(option_widget, "validationChanged"): - option_widget.validationChanged.connect(self.optionValidationChanged) - - if hasattr(option_widget, "getValidationSupport"): - validation_support = option_widget.getValidationSupport() - validation_support.validationChanged.connect(self.optionValidationChanged) - - self.layout.addRow("%s:" % label, option_widget) - - def addWidget(self, widget, label=""): - if not label.endswith(":"): - label = "%s:" % label - self.layout.addRow(label, widget) - - def addButtons(self): - buttons = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel, Qt.Horizontal, self) - self.ok_button = buttons.button(QDialogButtonBox.Ok) - self.ok_button.setEnabled(False) - - self.layout.addRow(self.createSpace(10)) - self.layout.addRow(buttons) - - self.connect(buttons, SIGNAL('accepted()'), self.accept) - self.connect(buttons, SIGNAL('rejected()'), self.reject) diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/legend.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/legend.py deleted file mode 100644 index c7c7221e7e..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/legend.py +++ /dev/null @@ -1,61 +0,0 @@ -from PyQt4.QtCore import QSize -from PyQt4.QtGui import QWidget, QPainter, QHBoxLayout, QLabel - - -class LegendMarker(QWidget): - """A widget that shows a colored box""" - def __init__(self, color): - QWidget.__init__(self) - - self.setMaximumSize(QSize(12, 12)) - self.setMinimumSize(QSize(12, 12)) - - self.color = color - - def paintEvent(self, paintevent): - """Paints the box""" - painter = QPainter(self) - - rect = self.contentsRect() - rect.setWidth(rect.width() - 1) - rect.setHeight(rect.height() - 1) - painter.drawRect(rect) - - rect.setX(rect.x() + 1) - rect.setY(rect.y() + 1) - painter.fillRect(rect, self.color) - -class Legend(QWidget): - """Combines a LegendMarker with a label""" - def __init__(self, legend, color): - QWidget.__init__(self) - - self.setMinimumWidth(140) - self.setMaximumHeight(25) - - self.legend = legend - - layout = QHBoxLayout() - layout.setMargin(0) - - self.legend_marker = LegendMarker(color) - self.legend_marker.setToolTip(legend) - - layout.addWidget(self.legend_marker) - self.legend_label = QLabel(legend) - layout.addWidget(self.legend_label) - layout.addStretch() - - self.setLayout(layout) - - def setLegend(self, legend): - self.legend_label.setText(legend) - - def updateLegend(self, *args): - legend_text = self.legend % args - self.legend_label.setText(legend_text) - self.legend_marker.setToolTip(legend_text) - - def setColor(self, color): - self.legend_marker.color = color - self.legend_marker.update() \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/listeditbox.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/listeditbox.py deleted file mode 100644 index bfdf415503..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/listeditbox.py +++ /dev/null @@ -1,186 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'pathchooser.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from PyQt4.QtCore import Qt, QSize -from PyQt4.QtGui import QHBoxLayout, QLineEdit, QCompleter, QToolButton, QInputDialog, QMessageBox, QWidget - -from ert_gui.ertwidgets import resourceIcon -from ert_gui.ertwidgets.validationsupport import ValidationSupport - - -class AutoCompleteLineEdit(QLineEdit): - # http://blog.elentok.com/2011/08/autocomplete-textbox-for-multiple.html - def __init__(self, items, parent=None): - super(AutoCompleteLineEdit, self).__init__(parent) - - self._separators = [",", " "] - - self._completer = QCompleter(items, self) - self._completer.setWidget(self) - self._completer.activated[str].connect(self.__insertCompletion) - self._completer.setCaseSensitivity(Qt.CaseInsensitive) - - self.__keysToIgnore = [Qt.Key_Enter, Qt.Key_Return, Qt.Key_Escape, Qt.Key_Tab] - - def __insertCompletion(self, completion): - extra = len(completion) - len(self._completer.completionPrefix()) - extra_text = completion[-extra:] - extra_text += ', ' - self.setText(self.text() + extra_text) - - def textUnderCursor(self): - text = self.text() - text_under_cursor = '' - i = self.cursorPosition() - 1 - while i >= 0 and text[i] not in self._separators: - text_under_cursor = text[i] + text_under_cursor - i -= 1 - return text_under_cursor - - def keyPressEvent(self, event): - if self._completer.popup().isVisible(): - if event.key() in self.__keysToIgnore: - event.ignore() - return - - super(AutoCompleteLineEdit, self).keyPressEvent(event) - - completion_prefix = self.textUnderCursor() - if completion_prefix != self._completer.completionPrefix(): - self.__updateCompleterPopupItems(completion_prefix) - if len(event.text()) > 0 and len(completion_prefix) > 0: - self._completer.complete() - if len(completion_prefix) == 0: - self._completer.popup().hide() - - def __updateCompleterPopupItems(self, completionPrefix): - self._completer.setCompletionPrefix(completionPrefix) - self._completer.popup().setCurrentIndex(self._completer.completionModel().index(0, 0)) - - -class ListEditBox(QWidget): - ITEM_DOES_NOT_EXIST_MSG = "The item: '%s' is not a possible choice." - NO_ITEMS_SPECIFIED_MSG = "The list must contain at least one item or * (for all)." - DEFAULT_MSG = "A list of comma separated case names or * for all." - - def __init__(self, possible_items): - QWidget.__init__(self) - - self._editing = True - self._possible_items = possible_items - - self._list_edit_line = AutoCompleteLineEdit(possible_items, self) - self._list_edit_line.setMinimumWidth(350) - - layout = QHBoxLayout() - layout.setMargin(0) - - layout.addWidget(self._list_edit_line) - - dialog_button = QToolButton(self) - dialog_button.setIcon(resourceIcon("ide/small/add")) - dialog_button.setIconSize(QSize(16, 16)) - dialog_button.clicked.connect(self.addChoice) - - layout.addWidget(dialog_button) - - self.setLayout(layout) - - self._validation_support = ValidationSupport(self) - self._valid_color = self._list_edit_line.palette().color(self._list_edit_line.backgroundRole()) - - self._list_edit_line.setText("") - self._editing = False - - self._list_edit_line.editingFinished.connect(self.validateList) - self._list_edit_line.textChanged.connect(self.validateList) - - self.validateList() - - def getListText(self): - text = str(self._list_edit_line.text()) - text = "".join(text.split()) - return text - - def getItems(self): - text = self.getListText() - items = text.split(",") - - if len(items) == 1 and items[0] == "*": - items = self._possible_items - - return [item for item in items if len(item) > 0] - - def validateList(self): - """Called whenever the list is modified""" - palette = self._list_edit_line.palette() - - items = self.getItems() - - valid = True - message = "" - - if len(items) == 0: - valid = False - message = ListEditBox.NO_ITEMS_SPECIFIED_MSG - else: - for item in items: - if item not in self._possible_items: - valid = False - message = ListEditBox.ITEM_DOES_NOT_EXIST_MSG % item - - validity_type = ValidationSupport.WARNING - - if not valid: - color = ValidationSupport.ERROR_COLOR - else: - color = self._valid_color - - self._validation_support.setValidationMessage(message, validity_type) - self._list_edit_line.setToolTip(message) - palette.setColor(self._list_edit_line.backgroundRole(), color) - - self._list_edit_line.setPalette(palette) - - if valid: - self._list_edit_line.setToolTip(ListEditBox.DEFAULT_MSG) - - def addChoice(self): - if len(self._possible_items) == 0: - QMessageBox.information(self, "No items", "No items available for selection!") - else: - item, ok = QInputDialog.getItem(self, - "Select a case", - "Select a case to add to the case list:", - self._possible_items) - - if ok: - item = str(item).strip() - text = str(self._list_edit_line.text()).rstrip() - - if len(text) == 0: - text = item + ", " - elif text.endswith(","): - text += " " + item - else: - text += ", " + item - - self._list_edit_line.setText(text) - - def getValidationSupport(self): - return self._validation_support - - def isValid(self): - return self._validation_support.isValid() diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/CMakeLists.txt deleted file mode 100644 index 3adbff2348..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - activerealizationsmodel.py - all_cases_model.py - analysismodulevariablesmodel.py - ertmodel.py - ertsummary.py - path_model.py - selectable_list_model.py - targetcasemodel.py - valuemodel.py -) - -add_python_package("python.ert_gui.ertwidgets.models" ${PYTHON_INSTALL_PREFIX}/ert_gui/ertwidgets/models "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/activerealizationsmodel.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/activerealizationsmodel.py deleted file mode 100644 index fe6bf34032..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/activerealizationsmodel.py +++ /dev/null @@ -1,33 +0,0 @@ -from ert.util import BoolVector -from ert_gui.ertwidgets.models.valuemodel import ValueModel -from ert_gui.ertwidgets.models.ertmodel import getRealizationCount - - -class ActiveRealizationsModel(ValueModel): - def __init__(self): - ValueModel.__init__(self, self.getDefaultValue()) - self._custom = False - - def setValue(self, active_realizations): - if active_realizations is None or active_realizations.strip() == "" or active_realizations == self.getDefaultValue(): - self._custom = False - ValueModel.setValue(self, self.getDefaultValue()) - else: - self._custom = True - ValueModel.setValue(self, active_realizations) - - def getDefaultValue(self): - size = getRealizationCount() - return "0-%d" % (size - 1) - - def getActiveRealizationsMask(self): - count = getRealizationCount() - - mask = BoolVector(default_value=False, initial_size = count) - if not mask.updateActiveMask(self.getValue()): - raise ValueError('Error while parsing range string "%s"!' % self.getValue()) - - if len(mask) != count: - raise ValueError("Mask size changed %d != %d!" % (count, len(mask))) - - return mask diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/all_cases_model.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/all_cases_model.py deleted file mode 100644 index f9cb08a395..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/all_cases_model.py +++ /dev/null @@ -1,69 +0,0 @@ -from PyQt4.QtCore import QAbstractItemModel, QModelIndex, Qt, QVariant - -from ert_gui.ertwidgets.models.ertmodel import getAllCases - - -class AllCasesModel(QAbstractItemModel): - - def __init__(self): - QAbstractItemModel.__init__(self) - self.__data = [] - - def index(self, row, column, parent=None, *args, **kwargs): - return self.createIndex(row, column, parent) - - def parent(self, index=None): - return QModelIndex() - - def rowCount(self, parent=None, *args, **kwargs): - items = self.getAllItems() - return len(items) - - def columnCount(self, QModelIndex_parent=None, *args, **kwargs): - return 1 - - - def data(self, index, role=None): - assert isinstance(index, QModelIndex) - - if index.isValid(): - items = self.getAllItems() - row = index.row() - item = items[row] - - if role == Qt.DisplayRole: - return item - - return QVariant() - - def itemAt(self, index): - assert isinstance(index, QModelIndex) - - if index.isValid(): - row = index.row() - return self.getAllItems()[row] - - return None - - - def getAllItems(self): - return getAllCases() - - - def indexOf(self, item): - items = self.getAllItems() - - if item in items: - - return items.index(item) - - return -1 - - - - - - - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/analysismodulevariablesmodel.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/analysismodulevariablesmodel.py deleted file mode 100644 index 98d56c9732..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/analysismodulevariablesmodel.py +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'analysismodulevariablesmodel.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from ert.analysis.analysis_module import AnalysisModule -from ert_gui import ERT -from ert_gui.ertwidgets.models.ertmodel import getRealizationCount - -class AnalysisModuleVariablesModel(object): - - _VARIABLE_NAMES = { - "LAMBDA0": {"type": float, "min": -1, "max": 10000000000000, "step":1.0, "labelname":"Initial Lambda", "pos":0}, - "USE_PRIOR": {"type": bool, "labelname":"Use both Prior and Observation Variability", "pos":1}, - "LAMBDA_REDUCE": {"type": float, "min": 0, "max": 1, "step":0.1, "labelname":"Lambda Reduction Factor", "pos":2}, - "LAMBDA_INCREASE": {"type": float, "min": 1, "max": 10, "step":0.1, "labelname":"Lambda Incremental Factor", "pos":3}, - "LAMBDA_MIN": {"type": float, "min": 0, "max": 10, "step":0.1, "labelname":"Minimum Lambda", "pos":4}, - "LOG_FILE": {"type": str, "labelname":"Log File", "pos":5}, - "CLEAR_LOG": {"type": bool, "labelname":"Clear Existing Log File", "pos":6}, - "LAMBDA_RECALCULATE": {"type": bool, "labelname":"Recalculate Lambda after each Iteration", "pos":7}, - "ENKF_TRUNCATION" :{"type": float, "min": 0, "max": 1, "step":0.1, "labelname":"Singular value truncation", "pos":9}, - "CV_NFOLDS": {"type": int, "min": 2, "max": 9999, "step":1.0, "labelname":"CV_NFOLDS", "pos":11}, - "FWD_STEP_R2_LIMIT":{"type": float, "min": -1, "max": 100, "step":1.0, "labelname":"FWD_STEP_R2_LIMIT", "pos":12}, - "CV_PEN_PRESS": {"type": bool, "labelname":"CV_PEN_PRESS", "pos":13} - } - - @classmethod - def getVariableNames(cls, analysis_module_name): - """ @rtype: list of str """ - analysis_module = ERT.ert.analysisConfig().getModule(analysis_module_name) - assert isinstance(analysis_module, AnalysisModule) - items = [] - for name in cls._VARIABLE_NAMES: - if analysis_module.hasVar(name): - items.append(name) - return items - - @classmethod - def getVariableType(cls, name): - return cls._VARIABLE_NAMES[name]["type"] - - @classmethod - def getVariableMaximumValue(cls, name): - if name == "CV_NFOLDS": - return getRealizationCount() - 1 - - return cls._VARIABLE_NAMES[name]["max"] - - @classmethod - def getVariableMinimumValue(cls, name): - return cls._VARIABLE_NAMES[name]["min"] - - @classmethod - def getVariableStepValue(cls, name): - return cls._VARIABLE_NAMES[name]["step"] - - @classmethod - def getVariableLabelName(cls, name): - return cls._VARIABLE_NAMES[name]["labelname"] - - @classmethod - def getVariablePosition(cls, name): - return cls._VARIABLE_NAMES[name]["pos"] - - @classmethod - def setVariableValue(cls, analysis_module_name, name, value): - analysis_module = ERT.ert.analysisConfig().getModule(analysis_module_name) - result = analysis_module.setVar(name, str(value)) - - @classmethod - def getVariableValue(cls, analysis_module_name, name): - """ @rtype: int or float or bool or str """ - analysis_module = ERT.ert.analysisConfig().getModule(analysis_module_name) - variable_type = cls.getVariableType(name) - if variable_type == float: - return analysis_module.getDouble(name) - elif variable_type == bool: - return analysis_module.getBool(name) - elif variable_type == str: - return analysis_module.getStr(name) - elif variable_type == int: - return analysis_module.getInt(name) diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/ertmodel.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/ertmodel.py deleted file mode 100644 index 2309faff59..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/ertmodel.py +++ /dev/null @@ -1,172 +0,0 @@ -from ert.analysis.analysis_module import AnalysisModule -from ert.analysis.enums.analysis_module_options_enum import AnalysisModuleOptionsEnum -from ert.enkf import RealizationStateEnum, EnkfVarType -from ert.job_queue import WorkflowRunner -from ert.util import BoolVector, StringList -from ert_gui import ERT -from ert_gui.ertwidgets import showWaitCursorWhileWaiting - - -def getRealizationCount(): - return ERT.ert.getEnsembleSize() - - -def getAllCases(): - """ @rtype: list[str] """ - fs = ERT.ert.getEnkfFsManager().getCurrentFileSystem() - case_list = ERT.ert.getEnkfFsManager().getCaseList() - return [str(case) for case in case_list if not ERT.ert.getEnkfFsManager().isCaseHidden(case)] - - -def caseExists(case_name): - """ @rtype: bool """ - return str(case_name) in getAllCases() - - -def caseIsInitialized(case_name): - """ @rtype: bool """ - return ERT.ert.getEnkfFsManager().isCaseInitialized(case_name) - - -def getAllInitializedCases(): - """ @rtype: list[str] """ - return [case for case in getAllCases() if caseIsInitialized(case)] - - -def getCurrentCaseName(): - """ @rtype: str """ - return str(ERT.ert.getEnkfFsManager().getCurrentFileSystem().getCaseName()) - - -def getHistoryLength(): - """ @rtype: int """ - return ERT.ert.getHistoryLength() - - -@showWaitCursorWhileWaiting -def selectOrCreateNewCase(case_name): - if getCurrentCaseName() != case_name: - fs = ERT.ert.getEnkfFsManager().getFileSystem(case_name) - ERT.ert.getEnkfFsManager().switchFileSystem(fs) - ERT.emitErtChange() - - -def caseHasDataAndIsNotRunning(case): - """ @rtype: bool """ - case_has_data = False - state_map = ERT.ert.getEnkfFsManager().getStateMapForCase(case) - - for state in state_map: - if state == RealizationStateEnum.STATE_HAS_DATA: - case_has_data = True - break - - return case_has_data and not caseIsRunning(case) - - -def getAllCasesWithDataAndNotRunning(): - """ @rtype: list[str] """ - return [case for case in getAllCases() if caseHasDataAndIsNotRunning(case)] - - -def caseIsRunning(case): - """ @rtype: bool """ - return ERT.ert.getEnkfFsManager().isCaseRunning(case) - - -def getAllCasesNotRunning(): - """ @rtype: list[str] """ - return [case for case in getAllCases() if not caseIsRunning(case)] - - -def getCaseRealizationStates(case_name): - """ @rtype: list[ert.enkf.enums.RealizationStateEnum] """ - state_map = ERT.ert.getEnkfFsManager().getStateMapForCase(case_name) - return [state for state in state_map] - - -@showWaitCursorWhileWaiting -def initializeCurrentCaseFromScratch(parameters, members): - selected_parameters = StringList(parameters) - for member in members: - member = int(member.strip()) - ERT.ert.getEnkfFsManager().initializeFromScratch(selected_parameters, member, member) - - ERT.emitErtChange() - - -@showWaitCursorWhileWaiting -def initializeCurrentCaseFromExisting(source_case, target_case, source_report_step, parameters, members): - if caseExists(source_case) and caseIsInitialized(source_case) and caseExists(target_case): - total_member_count = getRealizationCount() - - member_mask = BoolVector.createFromList(total_member_count, members) - selected_parameters = StringList(parameters) - - ERT.ert.getEnkfFsManager().customInitializeCurrentFromExistingCase(source_case, source_report_step, member_mask, - selected_parameters) - - ERT.emitErtChange() - - -def getParameterList(): - """ @rtype: list[str] """ - return [str(p) for p in ERT.ert.ensembleConfig().getKeylistFromVarType(EnkfVarType.PARAMETER)] - - -def getRunPath(): - """ @rtype: str """ - return ERT.ert.getModelConfig().getRunpathAsString() - - -def getNumberOfIterations(): - """ @rtype: int """ - return ERT.ert.analysisConfig().getAnalysisIterConfig().getNumIterations() - - -def setNumberOfIterations(iteration_count): - """ @type iteration_count: int """ - if iteration_count != getNumberOfIterations(): - ERT.ert.analysisConfig().getAnalysisIterConfig().setNumIterations(iteration_count) - ERT.emitErtChange() - - -def getWorkflowNames(): - """ @rtype: list[str] """ - return sorted(ERT.ert.getWorkflowList().getWorkflowNames(), key=str.lower) - - -def createWorkflowRunner(workflow_name): - """ @rtype: WorkflowRunner """ - workflow_list = ERT.ert.getWorkflowList() - - workflow = workflow_list[workflow_name] - context = workflow_list.getContext() - return WorkflowRunner(workflow, ERT.ert, context) - - -def getAnalysisModules(iterable=False): - """ @rtype: list[ert.analysis.AnalysisModule]""" - module_names = ERT.ert.analysisConfig().getModuleList() - - modules = [] - for module_name in module_names: - module = ERT.ert.analysisConfig().getModule(module_name) - module_is_iterable = module.checkOption(AnalysisModuleOptionsEnum.ANALYSIS_ITERABLE) - - if iterable == module_is_iterable: - modules.append(module) - - return sorted(modules, key=AnalysisModule.getName) - -def getAnalysisModuleNames(iterable=False): - """ @rtype: list[str] """ - modules = getAnalysisModules(iterable) - return [module.getName() for module in modules] - - -def getCurrentAnalysisModuleName(): - """ @rtype: str """ - return ERT.ert.analysisConfig().activeModuleName() - - diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/ertsummary.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/ertsummary.py deleted file mode 100644 index 5ad142c39b..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/ertsummary.py +++ /dev/null @@ -1,58 +0,0 @@ -from ert.enkf.enums.enkf_obs_impl_type_enum import EnkfObservationImplementationType -from ert.enkf.enums.enkf_var_type_enum import EnkfVarType -from ert_gui import ERT - -class ErtSummary(object): - - def getForwardModels(self): - """ @rtype: list of str """ - forward_model = ERT.ert.getModelConfig().getForwardModel() - return [job for job in forward_model.joblist()] - - def getParameters(self): - """ @rtype: list of str """ - parameters = ERT.ert.ensembleConfig().getKeylistFromVarType(EnkfVarType.PARAMETER) - return sorted([parameter for parameter in parameters], key=lambda k : k.lower()) - - - def getObservations(self): - """ @rtype: list of str """ - gen_obs = ERT.ert.getObservations().getTypedKeylist(EnkfObservationImplementationType.GEN_OBS) - - - summary_obs = ERT.ert.getObservations().getTypedKeylist(EnkfObservationImplementationType.SUMMARY_OBS) - - keys = [] - summary_keys_count = {} - summary_keys = [] - for key in summary_obs: - data_key = ERT.ert.getObservations()[key].getDataKey() - - if not data_key in summary_keys_count: - summary_keys_count[data_key] = 1 - summary_keys.append(data_key) - else: - summary_keys_count[data_key] += 1 - - if key == data_key: - keys.append(key) - else: - keys.append("%s [%s]" % (key, data_key)) - - # keys = [] - # for key in summary_keys: - # count = summary_keys_count[key] - # if count > 1: - # #keys.append("%s (%d)" % (key, count)) - # keys.append("%s" % key) - # else: - # keys.append(key) - - obs_keys = [observation for observation in gen_obs] + summary_keys - return sorted(obs_keys, key=lambda k : k.lower()) - - - - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/path_model.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/path_model.py deleted file mode 100644 index d755aff584..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/path_model.py +++ /dev/null @@ -1,48 +0,0 @@ -from ert_gui.ertwidgets.models.valuemodel import ValueModel - - -class PathModel(ValueModel): - def __init__(self, default_path, is_required=True, must_be_a_directory=False, must_be_a_file=True, - must_exist=False, must_be_absolute=False, must_be_executable=False): - ValueModel.__init__(self, default_path) - - self._path_is_required = is_required - self._path_must_be_a_directory = must_be_a_directory - self._path_must_be_a_file = must_be_a_file - self._path_must_be_executable = must_be_executable - self._path_must_exist = must_exist - self._path_must_be_absolute = must_be_absolute - - def pathIsRequired(self): - """ @rtype: bool """ - return self._path_is_required - - def pathMustBeADirectory(self): - """ @rtype: bool """ - return self._path_must_be_a_directory - - def pathMustBeAFile(self): - """ @rtype: bool """ - return self._path_must_be_a_file - - def pathMustBeExecutable(self): - """ @rtype: bool """ - return self._path_must_be_executable - - def pathMustExist(self): - """ @rtype: bool """ - return self._path_must_exist - - def pathMustBeAbsolute(self): - """ @rtype: bool """ - return self._path_must_be_absolute - - def getPath(self): - """ @rtype: str """ - return self.getValue() - - def setPath(self, value): - """ - @type value: str - """ - self.setValue(value) diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/selectable_list_model.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/selectable_list_model.py deleted file mode 100644 index d386efeca1..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/selectable_list_model.py +++ /dev/null @@ -1,43 +0,0 @@ -from PyQt4.QtCore import QObject, pyqtSignal - - -class SelectableListModel(QObject): - modelChanged = pyqtSignal() - selectionChanged = pyqtSignal() - - def __init__(self, items): - QObject.__init__(self) - self._selection = {} - self._items = items - - def getList(self): - return self._items - - def isValueSelected(self, value): - return self._selection.get(value, True) - - def selectValue(self, value): - self._setSelectState(value, True) - self.selectionChanged.emit() - - def unselectValue(self, value): - self._setSelectState(value, False) - self.selectionChanged.emit() - - def unselectAll(self): - for item in self.getList(): - self._setSelectState(item, False) - - self.selectionChanged.emit() - - def selectAll(self): - for item in self.getList(): - self._setSelectState(item, True) - - self.selectionChanged.emit() - - def getSelectedItems(self): - return [item for item in self.getList() if self.isValueSelected(item)] - - def _setSelectState(self, key, state): - self._selection[key] = state diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/targetcasemodel.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/targetcasemodel.py deleted file mode 100644 index 6e63798bb1..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/targetcasemodel.py +++ /dev/null @@ -1,36 +0,0 @@ -from ert_gui import ERT -from ert_gui.ertwidgets.models.ertmodel import getCurrentCaseName -from ert_gui.ertwidgets.models.valuemodel import ValueModel - - -class TargetCaseModel(ValueModel): - def __init__(self, format_mode=False): - self._format_mode = format_mode - self._custom = False - ValueModel.__init__(self, self.getDefaultValue()) - ERT.ertChanged.connect(self._caseChanged) - - def setValue(self, target_case): - if target_case is None or target_case.strip() == "" or target_case == self.getDefaultValue(): - self._custom = False - ValueModel.setValue(self, self.getDefaultValue()) - else: - self._custom = True - ValueModel.setValue(self, target_case) - - def getDefaultValue(self): - """ @rtype: str """ - if self._format_mode: - if ERT.ert.analysisConfig().getAnalysisIterConfig().caseFormatSet(): - return ERT.ert.analysisConfig().getAnalysisIterConfig().getCaseFormat() - else: - case_name = getCurrentCaseName() - return "%s_%%d" % case_name - else: - case_name = getCurrentCaseName() - return "%s_smoother_update" % case_name - - - def _caseChanged(self): - if not self._custom: - ValueModel.setValue(self, self.getDefaultValue()) diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/valuemodel.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/valuemodel.py deleted file mode 100644 index e968bc1b80..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/valuemodel.py +++ /dev/null @@ -1,20 +0,0 @@ -from PyQt4.QtCore import QObject, pyqtSignal, pyqtSlot - -class ValueModel(QObject): - valueChanged = pyqtSignal(str) - - def __init__(self, value=""): - super(ValueModel, self).__init__() - self._value = value - - def getValue(self): - """ @rtype: str """ - return self._value - - @pyqtSlot(str) - def setValue(self, value): - self._value = value - self.valueChanged.emit(value) - - def __repr__(self): - return 'ValueModel(QObject)(value = "%s")' % self._value diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/pathchooser.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/pathchooser.py deleted file mode 100644 index e8846e0f26..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/pathchooser.py +++ /dev/null @@ -1,207 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'pathchooser.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -import os -import re -from PyQt4.QtCore import QSize -from PyQt4.QtGui import QLineEdit, QToolButton, QFileDialog, QWidget, QHBoxLayout - -from ert_gui.ertwidgets import resourceIcon, addHelpToWidget -from ert_gui.ertwidgets.validationsupport import ValidationSupport - - -class PathChooser(QWidget): - """ - PathChooser: shows, enables choosing of and validates paths. - The data structure expected and sent to the models getValue and setValue is a string. - """ - - PATH_DOES_NOT_EXIST_MSG = "The specified path does not exist." - FILE_IS_NOT_EXECUTABLE_MSG = "The specified file is not an executable." - PATH_IS_NOT_A_FILE_MSG = "The specified path must be a file." - PATH_IS_NOT_ABSOLUTE_MSG = "The specified path must be an absolute path." - PATH_IS_NOT_A_DIRECTORY_MSG = "The specified path must be a directory." - REQUIRED_FIELD_MSG = "A path is required." - -# UNDEFINED = 0 -# REQUIRED = 1 -# FILE = 2 -# DIRECTORY = 4 -# MUST_EXIST = 8 -# EXECUTABLE = 16 - - def __init__(self, model, help_link=""): - """ - :type model: ert_gui.ertwidgets.models.path_model.PathModel - :param help_link: str - """ - QWidget.__init__(self) - addHelpToWidget(self, help_link) - self._validation_support = ValidationSupport(self) - - self._editing = True - - layout = QHBoxLayout() - layout.setMargin(0) - - self._path_line = QLineEdit() - self._path_line.setMinimumWidth(250) - - layout.addWidget(self._path_line) - - dialog_button = QToolButton(self) - dialog_button.setIcon(resourceIcon("ide/small/folder")) - dialog_button.setIconSize(QSize(16, 16)) - dialog_button.clicked.connect(self.selectPath) - layout.addWidget(dialog_button) - - self.valid_color = self._path_line.palette().color(self._path_line.backgroundRole()) - - self._path_line.setText(os.getcwd()) - self._editing = False - - self._model = model - self._model.valueChanged.connect(self.getPathFromModel) - - self._path_line.editingFinished.connect(self.validatePath) - self._path_line.editingFinished.connect(self.contentsChanged) - self._path_line.textChanged.connect(self.validatePath) - - self.setLayout(layout) - self.getPathFromModel() - - - def isPathValid(self, path): - """ @rtype: tuple of (bool, str) """ - path = path.strip() - path_exists = os.path.exists(path) - is_file = os.path.isfile(path) - is_directory = os.path.isdir(path) - is_executable = os.access(path, os.X_OK) - is_absolute = os.path.isabs(path) - - valid = True - message = "" - - if path == "": - if self._model.pathIsRequired(): - valid = False - message = PathChooser.REQUIRED_FIELD_MSG - elif not path_exists: - if self._model.pathMustExist(): - valid = False - message = PathChooser.PATH_DOES_NOT_EXIST_MSG - #todo: check if new (non-existing) file has directory or file format? - elif path_exists: - if self._model.pathMustBeExecutable() and is_file and not is_executable: - valid = False - message = PathChooser.FILE_IS_NOT_EXECUTABLE_MSG - elif self._model.pathMustBeADirectory() and not is_directory: - valid = False - message = PathChooser.PATH_IS_NOT_A_DIRECTORY_MSG - elif self._model.pathMustBeAbsolute() and not is_absolute: - valid = False - message = PathChooser.PATH_IS_NOT_ABSOLUTE_MSG - elif self._model.pathMustBeAFile() and not is_file: - valid = False - message = PathChooser.PATH_IS_NOT_A_FILE_MSG - - return valid, message - - - def validatePath(self): - """Called whenever the path is modified""" - palette = self._path_line.palette() - - valid, message = self.isPathValid(self.getPath()) - - validity_type = ValidationSupport.WARNING - - if not valid: - color = ValidationSupport.ERROR_COLOR - else: - color = self.valid_color - - self._validation_support.setValidationMessage(message, validity_type) - self._path_line.setToolTip(message) - palette.setColor(self._path_line.backgroundRole(), color) - - self._path_line.setPalette(palette) - - - def getPath(self): - """Returns the path""" - return os.path.expanduser(str(self._path_line.text()).strip()) - - def pathExists(self): - """Returns True if the entered path exists""" - return os.path.exists(self.getPath()) - - def selectPath(self): - """Pops up the 'select a file/directory' dialog""" - # todo: This probably needs some reworking to work properly with different scenarios... (file + dir) - self._editing = True - current_directory = self.getPath() - - #if not os.path.exists(currentDirectory): - # currentDirectory = "~" - - if self._model.pathMustBeAFile(): - current_directory = QFileDialog.getOpenFileName(self, "Select a file path", current_directory) - else: - current_directory = QFileDialog.getExistingDirectory(self, "Select a directory", current_directory) - - if not current_directory == "": - if not self._model.pathMustBeAbsolute(): - cwd = os.getcwd() - match = re.match(cwd + "/(.*)", current_directory) - if match: - current_directory = match.group(1) - - self._path_line.setText(current_directory) - self._model.setPath(self.getPath()) - - self._editing = False - - - def contentsChanged(self): - """Called whenever the path is changed.""" - path_is_valid, message = self.isPathValid(self.getPath()) - - if not self._editing and path_is_valid: - self._model.setPath(self.getPath()) - - - def getPathFromModel(self): - """Retrieves data from the model and inserts it into the edit line""" - self._editing = True - - path = self._model.getPath() - if path is None: - path = "" - - self._path_line.setText("%s" % path) - self._editing = False - - - def getValidationSupport(self): - return self._validation_support - - def isValid(self): - return self._validation_support.isValid() - - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/searchbox.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/searchbox.py deleted file mode 100644 index 52b8a76a40..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/searchbox.py +++ /dev/null @@ -1,69 +0,0 @@ -from PyQt4.QtCore import pyqtSignal, Qt -from PyQt4.QtGui import QLineEdit, QColor - - -class SearchBox(QLineEdit): - passive_color = QColor(194, 194, 194) - - filterChanged = pyqtSignal(['PyQt_PyObject']) - - def __init__(self): - QLineEdit.__init__(self) - - self.setToolTip("Type to search!") - self.active_color = self.palette().color(self.foregroundRole()) - self.disable_search = True - self.presentSearch() - self.textChanged.connect(self.__emitFilterChanged) - - def __emitFilterChanged(self, filter): - self.filterChanged.emit(self.filter()) - # self.emit(SIGNAL('filterChanged(PyQt_PyObject)'), self.filter()) - - def filter(self): - if self.disable_search: - return "" - else: - return str(self.text()) - - def presentSearch(self): - """Is called to present the greyed out search""" - self.disable_search = True - self.setText("Search") - palette = self.palette() - palette.setColor(self.foregroundRole(), self.passive_color) - self.setPalette(palette) - - def activateSearch(self): - """Is called to remove the greyed out search""" - self.disable_search = False - self.setText("") - palette = self.palette() - palette.setColor(self.foregroundRole(), self.active_color) - self.setPalette(palette) - - def enterSearch(self): - """Called when the line edit gets the focus""" - if str(self.text()) == "Search": - self.activateSearch() - - def exitSearch(self): - """Called when the line edit looses focus""" - if str(self.text()) == "": - self.presentSearch() - - def focusInEvent(self, focus_event): - QLineEdit.focusInEvent(self, focus_event) - self.enterSearch() - - def focusOutEvent(self, focus_event): - QLineEdit.focusOutEvent(self, focus_event) - self.exitSearch() - - - def keyPressEvent(self, key_event): - if key_event.key() == Qt.Key_Escape: - self.clear() - self.clearFocus() - else: - QLineEdit.keyPressEvent(self, key_event) \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/stringbox.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/stringbox.py deleted file mode 100644 index bdb6c32628..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/stringbox.py +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright (C) 2016 Statoil ASA, Norway. -# -# The file 'stringbox.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - - -from PyQt4.QtGui import QPalette, QLineEdit -from ert_gui.ertwidgets import ValidationSupport, addHelpToWidget -from ert_gui.ertwidgets.models.valuemodel import ValueModel - - -class StringBox(QLineEdit): - """StringBox shows a string. The data structure expected and sent to the getter and setter is a string.""" - - def __init__(self, model, help_link="", default_string="", continuous_update=False): - """ - :type model: ValueModel - :type help_link: str - :type default_string: str - :type continuous_update: bool - """ - QLineEdit.__init__(self) - addHelpToWidget(self, help_link) - self.setMinimumWidth(250) - self._validation = ValidationSupport(self) - self._validator = None - self._model = model - - self.editingFinished.connect(self.stringBoxChanged) - self.editingFinished.connect(self.validateString) - - if continuous_update: - self.textChanged.connect(self.stringBoxChanged) - - self.textChanged.connect(self.validateString) - - self._valid_color = self.palette().color(self.backgroundRole()) - self.setText(default_string) - - self._model.valueChanged.connect(self.modelChanged) - self.modelChanged() - - def validateString(self): - string_to_validate = str(self.text()) - - if self._validator is not None: - status = self._validator.validate(string_to_validate) - - palette = QPalette() - if not status: - palette.setColor(self.backgroundRole(), ValidationSupport.ERROR_COLOR) - self.setPalette(palette) - self._validation.setValidationMessage(str(status), ValidationSupport.EXCLAMATION) - else: - palette.setColor(self.backgroundRole(), self._valid_color) - self.setPalette(palette) - self._validation.setValidationMessage("") - - def emitChange(self, q_string): - self.textChanged.emit(str(q_string)) - - def stringBoxChanged(self): - """Called whenever the contents of the editline changes.""" - text = str(self.text()) - if text == "": - text = None - - self._model.setValue(text) - - def modelChanged(self): - """Retrieves data from the model and inserts it into the edit line""" - text = self._model.getValue() - if text is None: - text = "" - - self.setText(str(text)) - - def setValidator(self, validator): - self._validator = validator - - def setAlignment(self, flag): - self.setAlignment(flag) - - def getValidationSupport(self): - return self._validation - - def isValid(self): - return self._validation.isValid() - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/summarypanel.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/summarypanel.py deleted file mode 100644 index 38946a43a7..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/summarypanel.py +++ /dev/null @@ -1,100 +0,0 @@ -from PyQt4.QtCore import Qt -from PyQt4.QtGui import QFrame, QLabel, QVBoxLayout, QHBoxLayout, QScrollArea, QWidget, QGridLayout - -from ert_gui.ertwidgets.models.ertsummary import ErtSummary - - -class SummaryTemplate(object): - def __init__(self, title): - super(SummaryTemplate, self).__init__() - - self.text = "" - self.__finished = False - self.startGroup(title) - - - def startGroup(self, title): - if not self.__finished: - style = "display: inline-block; width: 150px; vertical-align: top; float: left" - self.text += "
\n" % style - self.addTitle(title) - - def addTitle(self, title): - if not self.__finished: - style = "font-size: 16px; font-weight: bold; font-variant: small-caps;" - self.text += "
%s
" % (style, title) - - def addRow(self, value): - if not self.__finished: - style = "text-indent: 5px;" - self.text += "
%s
" % (style, value) - - def endGroup(self): - if not self.__finished: - self.text += "

\n" - - def getText(self): - if not self.__finished: - self.__finished = True - self.endGroup() - return "%s" % self.text - - -class SummaryPanel(QFrame): - def __init__(self, parent=None): - QFrame.__init__(self, parent) - - self.setMinimumWidth(250) - self.setMinimumHeight(150) - - widget = QWidget() - self.layout = QHBoxLayout() - widget.setLayout(self.layout) - - - scroll = QScrollArea() - scroll.setWidgetResizable(True) - scroll.setWidget(widget) - - layout = QGridLayout() - layout.addWidget(scroll) - - self.setLayout(layout) - self.updateSummary() - - - def updateSummary(self): - summary = ErtSummary() - - text = SummaryTemplate("Forward Model") - - for job in summary.getForwardModels(): - text.addRow(job) - - - self.addColumn(text.getText()) - - text = SummaryTemplate("Parameters") - for parameters in summary.getParameters(): - text.addRow(parameters) - - self.addColumn(text.getText()) - - text = SummaryTemplate("Observations") - for observations in summary.getObservations(): - text.addRow(observations) - - self.addColumn(text.getText()) - - - def addColumn(self, text): - layout = QVBoxLayout() - text_widget = QLabel(text) - text_widget.setWordWrap(True) - text_widget.setTextFormat(Qt.RichText) - layout.addWidget(text_widget) - layout.addStretch(1) - - self.layout.addLayout(layout) - - diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/validateddialog.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/validateddialog.py deleted file mode 100644 index 8f017e06d2..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/validateddialog.py +++ /dev/null @@ -1,131 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'validateddialog.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from PyQt4.QtCore import Qt, QSize, SIGNAL -from PyQt4.QtGui import QDialog, QColor, QFormLayout, QLabel, QWidget, QDialogButtonBox, QLineEdit, QComboBox, QLayout - - -class ValidatedDialog(QDialog): - """ - A dialog for creating a validated new value. Performs validation of name against a provided. - Can be used to select from the list or for creating a new value that is not on the list. - - """ - - INVALID_COLOR = QColor(255, 235, 235) - - def __init__(self, title="Title", description="Description", unique_names=None, choose_from_list=False): - QDialog.__init__(self) - self.setModal(True) - self.setWindowTitle(title) - # self.setMinimumWidth(250) - # self.setMinimumHeight(150) - - if unique_names is None: - unique_names = [] - - self.unique_names = unique_names - self.choose_from_list = choose_from_list - - self.layout = QFormLayout() - self.layout.setSizeConstraint(QLayout.SetFixedSize) - - label = QLabel(description) - label.setAlignment(Qt.AlignHCenter) - - self.layout.addRow(self.createSpace(5)) - self.layout.addRow(label) - self.layout.addRow(self.createSpace(10)) - - buttons = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel, Qt.Horizontal, self) - self.ok_button = buttons.button(QDialogButtonBox.Ok) - self.ok_button.setEnabled(False) - - if choose_from_list: - self.param_name_combo = QComboBox() - self.connect(self.param_name_combo, SIGNAL('currentIndexChanged(QString)'), self.validateChoice) - for item in unique_names: - self.param_name_combo.addItem(item) - self.layout.addRow("Job:", self.param_name_combo) - else: - self.param_name = QLineEdit(self) - self.param_name.setFocus() - self.connect(self.param_name, SIGNAL('textChanged(QString)'), self.validateName) - self.validColor = self.param_name.palette().color(self.param_name.backgroundRole()) - - self.layout.addRow("Name:", self.param_name) - - self.layout.addRow(self.createSpace(10)) - - self.layout.addRow(buttons) - - self.connect(buttons, SIGNAL('accepted()'), self.accept) - self.connect(buttons, SIGNAL('rejected()'), self.reject) - - self.setLayout(self.layout) - - def notValid(self, msg): - """Called when the name is not valid.""" - self.ok_button.setEnabled(False) - palette = self.param_name.palette() - palette.setColor(self.param_name.backgroundRole(), self.INVALID_COLOR) - self.param_name.setToolTip(msg) - self.param_name.setPalette(palette) - - def valid(self): - """Called when the name is valid.""" - self.ok_button.setEnabled(True) - palette = self.param_name.palette() - palette.setColor(self.param_name.backgroundRole(), self.validColor) - self.param_name.setToolTip("") - self.param_name.setPalette(palette) - - def validateName(self, value): - """Called to perform validation of a name. For specific needs override this function and call valid() and notValid(msg).""" - value = str(value) - - if value == "": - self.notValid("Can not be empty!") - elif not value.find(" ") == -1: - self.notValid("No spaces allowed!") - elif value in self.unique_names: - self.notValid("Name must be unique!") - else: - self.valid() - - def validateChoice(self, choice): - """Only called when using selection mode.""" - self.ok_button.setEnabled(not choice == "") - - def getName(self): - """Return the new name chosen by the user""" - if self.choose_from_list: - return str(self.param_name_combo.currentText()) - else: - return str(self.param_name.text()) - - def showAndTell(self): - """Shows the dialog and returns the result""" - if self.exec_(): - return str(self.getName()).strip() - - return "" - - def createSpace(self, size=5): - """Creates a widget that can be used as spacing on a panel.""" - qw = QWidget() - qw.setMinimumSize(QSize(size, size)) - - return qw diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/validationsupport.py b/ThirdParty/Ert/python/python/ert_gui/ertwidgets/validationsupport.py deleted file mode 100644 index dd586a3c75..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/validationsupport.py +++ /dev/null @@ -1,110 +0,0 @@ -from PyQt4.QtCore import Qt, QPoint, QObject, pyqtSignal - -from PyQt4.QtGui import QWidget, QVBoxLayout, QSizePolicy, QFrame, QColor, QLabel - - -class ErrorPopup(QWidget): - error_template = ("" - "" - "" - "%s" - "
Warning:
" - "") - - def __init__(self): - QWidget.__init__(self, None, Qt.ToolTip) - self.resize(300, 50) - - self.setContentsMargins(0, 0, 0, 0) - layout = QVBoxLayout() - layout.setMargin(0) - - self._error_widget = QLabel("") - self._error_widget.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Minimum) - self._error_widget.setFrameStyle(QFrame.Box) - self._error_widget.setWordWrap(True) - self._error_widget.setScaledContents(True) - # self.warning_widget.setAlignment(Qt.AlignHCenter) - self._error_widget.setTextFormat(Qt.RichText) - layout.addWidget(self._error_widget) - - self.setLayout(layout) - - def presentError(self, widget, error): - assert isinstance(widget, QWidget) - - self._error_widget.setText(ErrorPopup.error_template % error) - self.show() - - size_hint = self.sizeHint() - rect = widget.rect() - p = widget.mapToGlobal(QPoint(rect.left(), rect.top())) - - self.setGeometry(p.x(), p.y() - size_hint.height() - 5, size_hint.width(), size_hint.height()) - - self.raise_() - - -class ValidationSupport(QObject): - STRONG_ERROR_COLOR = QColor(255, 215, 215) - ERROR_COLOR = QColor(255, 235, 235) - INVALID_COLOR = QColor(235, 235, 255) - - WARNING = "warning" - EXCLAMATION = "ide/small/exclamation" - - validationChanged = pyqtSignal(bool) - - def __init__(self, validation_target): - """ @type validation_target: QWidget """ - QObject.__init__(self) - - self._validation_target = validation_target - self._validation_message = None - self._validation_type = None - self._error_popup = ErrorPopup() - - self._originalEnterEvent = validation_target.enterEvent - self._originalLeaveEvent = validation_target.leaveEvent - self._originalHideEvent = validation_target.hideEvent - - def enterEvent(event): - self._originalEnterEvent(event) - - if not self.isValid(): - self._error_popup.presentError(self._validation_target, self._validation_message) - - validation_target.enterEvent = enterEvent - - def leaveEvent(event): - self._originalLeaveEvent(event) - - if self._error_popup is not None: - self._error_popup.hide() - - validation_target.leaveEvent = leaveEvent - - def hideEvent(hide_event): - self._error_popup.hide() - self._originalHideEvent(hide_event) - - validation_target.hideEvent = hideEvent - - def setValidationMessage(self, message, validation_type=WARNING): - """Add a warning or information icon to the widget with a tooltip""" - message = message.strip() - if message == "": - self._validation_type = None - self._validation_message = None - self._error_popup.hide() - self.validationChanged.emit(True) - - else: - self._validation_type = validation_type - self._validation_message = message - if self._validation_target.hasFocus() or self._validation_target.underMouse(): - self._error_popup.presentError(self._validation_target, self._validation_message) - self.validationChanged.emit(False) - - def isValid(self): - return self._validation_message is None diff --git a/ThirdParty/Ert/python/python/ert_gui/gert_main.py b/ThirdParty/Ert/python/python/ert_gui/gert_main.py deleted file mode 100644 index d688a8965d..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/gert_main.py +++ /dev/null @@ -1,255 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'gert_main.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -# -------------------------------------------------------------------------------- -# This file is the main script of the ert with graphical UI, e.g. gert or -# ert_gui. To run successfully the ert GUI requires a quite well prepared -# environment. This includes the following: -# -# 1. A Python interpreter with the the ctypes library available. -# -# 2. The program must be able to locate all the required shared libraries with -# no fuss. This includes: -# -# o The ert libraries libecl.so, libenkf.so, libutil.so, librms.so, -# libsched.so, libconfig.so -# -# o The libraries used by the ert libraries, this includes liblapack.so, -# libz.so, libblas.so, libpthread.so and in some cases the libg2c.so -# library. -# -# o The lsf libraries libbat, liblsf and also libnsl. In the current -# implementation the dependance on the lsf libraries is hard, this should -# be relaxed so that the lsf libraries are not linked before an attempt to -# actually use lsf is made. -# When an attempt is actually made to use LSF the additional environment -# variables LSF_LIBDIR, XLSF_UIDDIR, LSF_SERVERDIR, LSF_ENVDIR and -# LSF_BINDIR must also be set. That is an LSF requirement and not -# related to ert as such. These variables can naturally be set from the -# site config file. -# -# -# 3. The program must be able to locate all the necessary Python modules, in -# short this means that the directory containing the ert/ and ert_gui/ -# directories must be on Python path, i.e. the import statements -# -# import ert -# import ert_gui -# -# should just work. -# -# 4. The environment variable GERT_SHARE_PATH should be set to point to the -# /share directory of the current gert installation. The /share directory -# contains html help files and images/icons. -# -# 5. The environment variable ERT_SITE_CONFIG must be set to point to the site -# wide configuration file. -# -# -# Now the important point is that this python script WILL NOT PERFORM ANY -# SPECIAL HOOPS TO TRY TO LOCATE THE REQUIRED FILES, i.e. the environment must -# be fully prepared prior to invoking this script. This will typically involve: -# -# 1. Update the LD_LIBRARY_PATH variable to contain directories with all the -# required shared libraries. -# -# 2. Update the PYTHONPATH variable to contain the directory containg ert/ and -# ert_gui/ directories. -# -# 3. Set the environment variabel GERT_SHARE_PATH to point to the directory -# containg the /share files for the current gert installation. -# -# 4. Set the environment variable ERT_SITE_CONFIG to point to the location of -# the site configuration file. -# -# An example shell script achieving this could look like: -# -# -------------------- -------------------- -# #!/bin/bash -# -# # The LSF libraries are installed in directory /site/LSF/7.0/linux/lib, this -# # directory must be included in the LD_LIBRARY_PATH variable. Furthermore we -# # assume that the ERT libraries like libecl.so and libenkf.so are located in -# # /opt/ert/lib, then LD_LIBRARY_PATH will be updated as: -# -# export LD_LIBRARY_PATH=/site/LSF/7.0/linux/lib:/opt/ert/lib:$LD_LIBRARY_PATH -# -# # The python modules ert and ert_gui are located in /opt/ert/python, so we -# # update PYTHONPATH as: -# -# export PYTHONPATH=/opt/ert/python:$PYTHONPATH -# -# # The shared gert files are installed in /opt/ert/share; this directory can -# # in principle be shared among gert versions built for different operating -# # system versions: -# -# export ERT_SHARE_PATH=/opt/ert/share -# -# # The ERT site configuration file is assumed to be in -# # /opt/ert/etc/site-config, i.e. we set the variable ERT_SITE_CONFIG as: -# -# export ERT_SITE_CONFIG=/opt/ert/etc/site-config -# -# # Now the environment should be fully initialized, and we are ready to invoke -# # the gert_main.py script, i.e. this file: -# -# exec python /opt/ert/python/ert_gui/gert_main.py $@ -# -# -------------------- -------------------- - -import os -import sys -import time - -from PyQt4.QtCore import Qt -from PyQt4.QtGui import QApplication, QFileDialog - -import ert_gui.ertwidgets -from ert.enkf import EnKFMain -from ert.util import Version -from ert_gui.ert_splash import ErtSplash -from ert_gui.ertwidgets import SummaryPanel, resourceIcon -from ert_gui.main_window import GertMainWindow -from ert_gui.simulation.simulation_panel import SimulationPanel -from ert_gui.tools import HelpCenter -from ert_gui.tools.export import ExportTool -from ert_gui.tools.help import HelpTool -from ert_gui.tools.ide import IdeTool -from ert_gui.tools.load_results import LoadResultsTool -from ert_gui.tools.manage_cases import ManageCasesTool -from ert_gui.tools.plot import PlotTool -from ert_gui.tools.plugins import PluginHandler, PluginsTool -from ert_gui.tools.run_analysis import RunAnalysisTool -from ert_gui.tools.workflows import WorkflowsTool - -if os.getenv("ERT_SHARE_PATH"): - ert_share_path = os.getenv("ERT_SHARE_PATH") -else: - # If the ERT_SHARE_PATH variable is not set we try to use the - # source location relative to the location of the current file; - # assuming we are in the source directory. Will not work if we are - # in an arbitrary build directory. - ert_share_path = os.path.realpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../../share")) - -ert_gui.ertwidgets.img_prefix = ert_share_path + "/gui/img/" - -from ert_gui.newconfig import NewConfigurationDialog - - -def main(argv): - app = QApplication(argv) # Early so that QT is initialized before other imports - app.setWindowIcon(resourceIcon("application/window_icon_cutout")) - - if len(argv) == 1: - config_file = QFileDialog.getOpenFileName(None, "Open Configuration File") - - config_file = str(config_file) - - if len(config_file) == 0: - print("-----------------------------------------------------------------") - print("-- You must supply the name of configuration file as the first --") - print("-- commandline argument: --") - print("-- --") - print("-- bash% gert --") - print("-- --") - print("-- If the configuration file does not exist, gert will create --") - print("-- create a new configuration file. --") - print("-----------------------------------------------------------------") - - sys.exit(1) - else: - config_file = argv[1] - - help_center = HelpCenter("ERT") - help_center.setHelpLinkPrefix(os.getenv("ERT_SHARE_PATH") + "/gui/help/") - help_center.setHelpMessageLink("welcome_to_ert") - - strict = True - - verbose = False - verbose_var = os.getenv("ERT_VERBOSE", "False") - lower_verbose_var = verbose_var.lower() - if lower_verbose_var == "true": - verbose = True - - if not os.path.exists(config_file): - print("Trying to start new config") - new_configuration_dialog = NewConfigurationDialog(config_file) - success = new_configuration_dialog.exec_() - if not success: - print("Can not run without a configuration file.") - sys.exit(1) - else: - config_file = new_configuration_dialog.getConfigurationPath() - dbase_type = new_configuration_dialog.getDBaseType() - num_realizations = new_configuration_dialog.getNumberOfRealizations() - storage_path = new_configuration_dialog.getStoragePath() - - EnKFMain.createNewConfig(config_file, storage_path, dbase_type, num_realizations) - strict = False - - if os.path.isdir(config_file): - print("The specified configuration file is a directory!") - sys.exit(1) - - splash = ErtSplash() - splash.version = "Version %s" % Version.getVersion() - splash.timestamp = Version.getBuildTime() - - splash.show() - splash.repaint() - - now = time.time() - - ert = EnKFMain(config_file, strict=strict, verbose=verbose) - ert_gui.configureErtNotifier(ert, config_file) - - window = GertMainWindow() - window.setWidget(SimulationPanel()) - - plugin_handler = PluginHandler(ert, ert.getWorkflowList().getPluginJobs(), window) - - help_tool = HelpTool("ERT", window) - - window.addDock("Configuration Summary", SummaryPanel(), area=Qt.BottomDockWidgetArea) - window.addTool(IdeTool(os.path.basename(config_file), help_tool)) - window.addTool(PlotTool()) - window.addTool(ExportTool()) - window.addTool(WorkflowsTool()) - window.addTool(ManageCasesTool()) - window.addTool(PluginsTool(plugin_handler)) - window.addTool(RunAnalysisTool()) - window.addTool(LoadResultsTool()) - window.addTool(help_tool) - - sleep_time = 2 - (time.time() - now) - - if sleep_time > 0: - time.sleep(sleep_time) - - window.show() - splash.finish(window) - window.activateWindow() - window.raise_() - finished_code = app.exec_() - - ert.free() - - sys.exit(finished_code) - - -if __name__ == "__main__": - main(sys.argv) diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/ide/CMakeLists.txt deleted file mode 100644 index d0813f8eb8..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - highlighter.py - keyword.py - parameter.py -) - -add_python_package("python.ert_gui.ide" ${PYTHON_INSTALL_PREFIX}/ert_gui/ide "${PYTHON_SOURCES}" True) - -add_subdirectory(completers) -add_subdirectory(keywords) -add_subdirectory(wizards) diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/completers/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/ide/completers/CMakeLists.txt deleted file mode 100644 index 5d773c0064..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/completers/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - path_completer.py -) - -add_python_package("python.ert_gui.ide.completers" ${PYTHON_INSTALL_PREFIX}/ert_gui/ide/completers "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/completers/path_completer.py b/ThirdParty/Ert/python/python/ert_gui/ide/completers/path_completer.py deleted file mode 100644 index e38efce4b9..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/completers/path_completer.py +++ /dev/null @@ -1,71 +0,0 @@ -import os - - -class PathItem(object): - def __init__(self, value): - super(PathItem, self).__init__() - #: :type: str - self.value = value - - - def __str__(self): - return self.value - - def __gt__(self, other): - assert isinstance(other, PathItem) - - if self.value.endswith("/") and not other.value.endswith("/"): - return True - elif not self.value.endswith("/") and other.value.endswith("/"): - return False - else: - return self.value.lower() > other.value.lower() - - def __eq__(self, other): - return self.value == other.value - - def __lt__(self, other): - return not (self == other or self > other) - - def __le__(self, other): - return self == other or not self > other - - def __ge__(self, other): - return self == other or self > other - - - -class PathCompleter(object): - def __init__(self): - super(PathCompleter, self).__init__() - - - def completeOptions(self, path_prefix): - - root, entry_prefix = os.path.split(path_prefix) - - if os.path.isdir(root): - if not root.startswith("/"): - root_path = "./%s/" % root - else: - root_path = "%s/" % root - else: - if root == "": - root_path = "./" - else: - root_path = root - - entries = os.listdir(root_path) - - - result = [] - for entry in entries: - if entry.startswith(entry_prefix): - full_path = os.path.join(root, entry) - if os.path.isdir(full_path): - full_path += "/" - result.append(PathItem(full_path)) - - - result = sorted(result) - return [str(item) for item in result] diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/highlighter.py b/ThirdParty/Ert/python/python/ert_gui/ide/highlighter.py deleted file mode 100644 index 24f0064c66..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/highlighter.py +++ /dev/null @@ -1,105 +0,0 @@ -import re -from PyQt4.QtGui import QSyntaxHighlighter, QTextCharFormat, QColor, QTextBlockUserData - -from ert_gui.ide.keywords import ErtKeywords -from ert_gui.ide.keywords.configuration_line_builder import ConfigurationLineBuilder -from ert_gui.ide.keywords.data import Keyword - - -class ConfigurationLineUserData(QTextBlockUserData): - def __init__(self, configuration_line): - QTextBlockUserData.__init__(self) - self.configuration_line = configuration_line - -class KeywordHighlighter(QSyntaxHighlighter): - def __init__(self, document): - QSyntaxHighlighter.__init__(self, document) - - self.clb = ConfigurationLineBuilder(ErtKeywords()) - - - self.comment_format = QTextCharFormat() - self.comment_format.setForeground(QColor(0, 128, 0)) - self.comment_format.setFontItalic(True) - - self.keyword_format = QTextCharFormat() - self.keyword_format.setForeground(QColor(200, 100, 0)) - # self.keyword_format.setFontWeight(QFont.Bold) - - self.error_format = QTextCharFormat() - # self.error_format.setForeground(QColor(255, 0, 0)) - self.error_format.setUnderlineStyle(QTextCharFormat.WaveUnderline) - self.error_format.setUnderlineColor(QColor(255, 0, 0)) - - self.search_format = QTextCharFormat() - self.search_format.setBackground(QColor(220, 220, 220)) - - self.builtin_format = QTextCharFormat() - self.builtin_format.setForeground(QColor(0, 170, 227)) - - self.search_string = "" - - - def formatKeyword(self, keyword, validation_status): - assert isinstance(keyword, Keyword) - if keyword.hasKeywordDefinition(): - keyword_format = QTextCharFormat(self.keyword_format) - - if not validation_status: - keyword_format.merge(self.error_format) - - self.formatToken(keyword, keyword_format) - else: - self.formatToken(keyword, self.error_format) - - - def highlightBlock(self, complete_block): - block = unicode(complete_block) - - self.clb.processLine(block) - - - if self.clb.hasComment(): - self.setFormat(self.clb.commentIndex(), len(block) - self.clb.commentIndex(), self.comment_format) - - if not self.clb.hasConfigurationLine(): - count = len(block) - - if self.clb.hasComment(): - count = self.clb.commentIndex() - - self.setFormat(0, count, self.error_format) - - - if self.clb.hasConfigurationLine(): - cl = self.clb.configurationLine() - self.setCurrentBlockUserData(ConfigurationLineUserData(cl)) - - self.formatKeyword(cl.keyword(), cl.validationStatusForToken(cl.keyword())) - - arguments = cl.arguments() - - for argument in arguments: - if not argument.hasArgumentDefinition(): - pass - - elif argument.argumentDefinition().isBuiltIn(): - self.formatToken(argument, self.builtin_format) - - if not cl.validationStatusForToken(argument): - self.formatToken(argument, self.error_format) - - - if self.search_string != "": - for match in re.finditer("(%s)" % self.search_string, complete_block): - self.setFormat(match.start(1), match.end(1) - match.start(1), self.search_format) - - - def setSearchString(self, string): - if self.search_string != unicode(string): - self.search_string = unicode(string) - self.rehighlight() - - - def formatToken(self, token, highlight_format): - self.setFormat(token.fromIndex(), token.count(), highlight_format) \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keyword.py b/ThirdParty/Ert/python/python/ert_gui/ide/keyword.py deleted file mode 100644 index ec234f2028..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keyword.py +++ /dev/null @@ -1,96 +0,0 @@ -from ert_gui.ide.parameter import Parameter - - -class Keyword(object): - def __init__(self, keyword, start, end): - super(Keyword, self).__init__() - #: :type: str - self.keyword = keyword - #: :type: int - self.start = start - #: :type: int - self.end = end - #: :type: list of Parameter - self.parameter_list = [] - #: :type: bool - self.error = False - #: :type: str - self.error_message = "" - - self.handler = None - - - @property - def length(self): - return self.end - self.start - - def addParameter(self, value, start, end): - self.parameter_list.append(Parameter(value, start, end)) - - def parameterCount(self): - return len(self.parameter_list) - - def parameters(self): - """ @rtype: list of Parameter """ - return self.parameter_list - - def __getitem__(self, item): - """ @rtype: Parameter """ - assert isinstance(item, int) - return self.parameter_list[item] - - def hasError(self): - """ @rtype: bool """ - parameter_error = False - - for param in self.parameter_list: - if param.error: - parameter_error = True - - return self.error or parameter_error - - - - def mergeParameters(self, from_parameter): - parameters = self.parameter_list[from_parameter:] - self.parameter_list = self.parameter_list[0:from_parameter - 1] - - value = " ".join([p.value for p in parameters]) - start = parameters[0].start - end = parameters[len(parameters) - 1].end - - self.parameter_list.append(Parameter(value, start, end)) - - def errorMessage(self): - errors = [] - - if self.error: - errors.append(self.error_message) - - for parameter in self.parameter_list: - if parameter.error: - errors.append(parameter.error_message) - - return "\n".join(errors) - - def parameterIndexForPosition(self, position_in_block): - index = 0 - - if position_in_block <= self.end: - return -1 - - for parameter in self.parameter_list: - if parameter.start <= position_in_block <= parameter.end: - return index - index += 1 - - if self.parameterCount() > 0: - if position_in_block < self.parameter_list[0].start: - return 0 - elif position_in_block > self.parameter_list[self.parameterCount() - 1].end: - return self.parameterCount() - - if self.parameterCount() == 0: - return 0 - - return -1 \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/CMakeLists.txt deleted file mode 100644 index 99afed7609..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - analysis_module_keywords.py - configuration_line_builder.py - configuration_line_parser.py - eclipse_keywords.py - enkf_control_keywords.py - ensemble_keywords.py - ert_keywords.py - parametrization_keywords.py - plot_keywords.py - queue_system_keywords.py - run_keywords.py - simulation_control_keywords.py - workflow_keywords.py - qc_keywords.py - unix_environment_keywords.py - advanced_keywords.py -) - -add_python_package("python.ert_gui.ide.keywords" ${PYTHON_INSTALL_PREFIX}/ert_gui/ide/keywords "${PYTHON_SOURCES}" True) - -add_subdirectory(data) -add_subdirectory(definitions) diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/__init__.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/__init__.py deleted file mode 100644 index c355513387..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .configuration_line_parser import ConfigurationLineParser -from .ert_keywords import ErtKeywords diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/advanced_keywords.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/advanced_keywords.py deleted file mode 100644 index 676ede7415..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/advanced_keywords.py +++ /dev/null @@ -1,56 +0,0 @@ -from ert_gui.ide.keywords.definitions import IntegerArgument, KeywordDefinition, ConfigurationLineDefinition, PathArgument, StringArgument -from ert_gui.ide.keywords.definitions.proper_name_argument import ProperNameArgument - - -class AdvancedKeywords(object): - def __init__(self, ert_keywords): - super(AdvancedKeywords, self).__init__() - self.group = "Advanced" - - ert_keywords.addKeyword(self.addDefine()) - ert_keywords.addKeyword(self.addSchedulePredictionFile()) - ert_keywords.addKeyword(self.addFixedLengthScheduleKw()) - ert_keywords.addKeyword(self.addStaticKw()) - - - - def addFixedLengthScheduleKw(self): - fixed_length_sched_kw = ConfigurationLineDefinition(keyword=KeywordDefinition("ADD_FIXED_LENGTH_SCHEDULE_KW"), - arguments=[StringArgument(), - StringArgument()], - documentation_link="keywords/add_fixed_length_schedule_kw", - required=False, - group=self.group) - return fixed_length_sched_kw - - - def addStaticKw(self): - add_static_kw = ConfigurationLineDefinition(keyword=KeywordDefinition("ADD_STATIC_KW"), - arguments=[StringArgument(), - StringArgument()], - documentation_link="keywords/add_static_kw", - required=False, - group=self.group) - return add_static_kw - - - - def addDefine(self): - define = ConfigurationLineDefinition(keyword=KeywordDefinition("DEFINE"), - arguments=[ProperNameArgument(), - StringArgument(rest_of_line=True,allow_space=True)], - documentation_link="keywords/define", - required=False, - group=self.group) - return define - - - - def addSchedulePredictionFile(self): - schedule_prediction_file = ConfigurationLineDefinition(keyword=KeywordDefinition("SCHEDULE_PREDICTION_FILE"), - arguments=[PathArgument()], - documentation_link="keywords/schedule_prediction_file", - required=False, - group=self.group) - return schedule_prediction_file - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/analysis_module_keywords.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/analysis_module_keywords.py deleted file mode 100644 index 604e59801a..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/analysis_module_keywords.py +++ /dev/null @@ -1,106 +0,0 @@ -from ert_gui.ide.keywords.definitions import IntegerArgument, KeywordDefinition, ConfigurationLineDefinition, PathArgument, StringArgument, FloatArgument, BoolArgument -from ert_gui.ide.keywords.definitions.proper_name_format_argument import ProperNameFormatArgument - - -class AnalysisModuleKeywords(object): - def __init__(self, ert_keywords): - super(AnalysisModuleKeywords, self).__init__() - self.group = "Analysis Module" - - ert_keywords.addKeyword(self.addAnalysisLoad()) - ert_keywords.addKeyword(self.addAnalysisSelect()) - ert_keywords.addKeyword(self.addAnalysisCopy()) - ert_keywords.addKeyword(self.addAnalysisSetVar()) - ert_keywords.addKeyword(self.addIterCase()) - ert_keywords.addKeyword(self.addIterCount()) - ert_keywords.addKeyword(self.addStdCutoff()) - ert_keywords.addKeyword(self.addSingleNodeUpdate()) - ert_keywords.addKeyword(self.addIterRetryCount()) - - - - def addAnalysisLoad(self): - analysis_load = ConfigurationLineDefinition(keyword=KeywordDefinition("ANALYSIS_LOAD"), - arguments=[StringArgument(),StringArgument()], - documentation_link="keywords/analysis_load", - required=False, - group=self.group) - return analysis_load - - - - def addAnalysisSelect(self): - analysis_select = ConfigurationLineDefinition(keyword=KeywordDefinition("ANALYSIS_SELECT"), - arguments=[StringArgument()], - documentation_link="keywords/analysis_select", - required=False, - group=self.group) - return analysis_select - - - def addAnalysisSetVar(self): - analysis_set_var = ConfigurationLineDefinition(keyword=KeywordDefinition("ANALYSIS_SET_VAR"), - arguments=[StringArgument(), - StringArgument(), - StringArgument(rest_of_line=True,allow_space=True)], - documentation_link="keywords/analysis_set_var", - required=False, - group=self.group) - return analysis_set_var - - - - def addAnalysisCopy(self): - analysis_copy = ConfigurationLineDefinition(keyword=KeywordDefinition("ANALYSIS_COPY"), - arguments=[StringArgument(), StringArgument()], - documentation_link="keywords/analysis_copy", - required=False, - group=self.group) - return analysis_copy - - - - - def addIterCase(self): - iter_case = ConfigurationLineDefinition(keyword=KeywordDefinition("ITER_CASE"), - arguments=[ProperNameFormatArgument()], - documentation_link="keywords/iter_case", - required=False, - group=self.group) - return iter_case - - - def addIterCount(self): - iter_count = ConfigurationLineDefinition(keyword=KeywordDefinition("ITER_COUNT"), - arguments=[IntegerArgument()], - documentation_link="keywords/iter_count", - required=False, - group=self.group) - return iter_count - - - def addIterRetryCount(self): - retry_count = ConfigurationLineDefinition(keyword=KeywordDefinition("ITER_RETRY_COUNT"), - arguments=[IntegerArgument()], - documentation_link="keywords/iter_retry_count", - required=False, - group=self.group) - return retry_count - - - def addStdCutoff(self): - std_cutoff = ConfigurationLineDefinition(keyword=KeywordDefinition("STD_CUTOFF"), - arguments=[FloatArgument()], - documentation_link="keywords/std_cutoff", - required=False, - group=self.group) - return std_cutoff - - - def addSingleNodeUpdate(self): - single_node_update = ConfigurationLineDefinition(keyword=KeywordDefinition("SINGLE_NODE_UPDATE"), - arguments=[BoolArgument()], - documentation_link="keywords/single_node_update", - required=False, - group=self.group) - return single_node_update \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/configuration_line_builder.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/configuration_line_builder.py deleted file mode 100644 index cc2766463c..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/configuration_line_builder.py +++ /dev/null @@ -1,110 +0,0 @@ -from ert_gui.ide.keywords import ErtKeywords -from ert_gui.ide.keywords.configuration_line_parser import ConfigurationLineParser -from ert_gui.ide.keywords.data import ConfigurationLine, Argument, Keyword - - -class ConfigurationLineBuilder(object): - DEFAULT_GROUP = "Unknown keyword" - DEFAULT_DOCUMENTATION_LINK = "unknown_keyword" - - def __init__(self, keywords): - super(ConfigurationLineBuilder, self).__init__() - - assert isinstance(keywords, ErtKeywords) - self.__keywords = keywords - self.__configuration_line_parser = ConfigurationLineParser() - self.__configuration_line = None - - - def processLine(self, line): - self.__configuration_line_parser.parseLine(line) - self.__configuration_line = None - - if self.__configuration_line_parser.hasKeyword(): - keyword = self.__configuration_line_parser.keyword() - arguments = self.__configuration_line_parser.arguments() - - documentation_link = ConfigurationLineBuilder.DEFAULT_DOCUMENTATION_LINK - group = ConfigurationLineBuilder.DEFAULT_GROUP - required = False - - if keyword.value() in self.__keywords: - configuration_line_definition = self.__keywords[keyword.value()] - - documentation_link = configuration_line_definition.documentationLink() - group = configuration_line_definition.group() - required = configuration_line_definition.isRequired() - - keyword.setKeywordDefinition(configuration_line_definition.keywordDefinition()) - - arguments = self.__matchArguments(keyword, configuration_line_definition.argumentDefinitions(), arguments) - - - self.__configuration_line = ConfigurationLine(keyword, arguments, documentation_link, group, required) - - def configurationLine(self): - """ @rtype: ConfigurationLine """ - return self.__configuration_line - - def hasConfigurationLine(self): - """ @rtype: bool """ - return self.__configuration_line is not None - - def hasComment(self): - """ @rtype: bool """ - return self.__configuration_line_parser.hasComment() - - def commentIndex(self): - return self.__configuration_line_parser.commentIndex() - - - def __matchArguments(self, keyword, arg_defs, args): - """ - @type keyword: Keyword - @type arg_defs: list of ArgumentDefinition - @type args: list of Argument - @rtype: list of Argument - """ - arg_def_count = len(arg_defs) - arg_count = len(args) - - if arg_count > arg_def_count: - # merge last input arguments - - last_arg_def = arg_defs[len(arg_defs) - 1] - - if last_arg_def.consumeRestOfLine(): - from_arg = args[arg_def_count - 1] - to_arg = args[arg_count - 1] - - last_argument = Argument(from_arg.fromIndex(), to_arg.toIndex(), keyword.line()) - args = args[0:arg_def_count] - args[len(args) - 1] = last_argument - - else: - from_arg = args[arg_def_count] - to_arg = args[arg_count - 1] - - last_argument = Argument(from_arg.fromIndex(), to_arg.toIndex(), keyword.line()) - args = args[0:arg_def_count] - args.append(last_argument) - - if arg_count < arg_def_count: - # pad with empty arguments - line = keyword.line() - - for index in range(arg_def_count - arg_count): - empty_argument = Argument(len(line), len(line), line) - args.append(empty_argument) - - - for index in range(len(args)): - if index < len(arg_defs): - args[index].setArgumentDefinition(arg_defs[index]) - - - return args - - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/configuration_line_parser.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/configuration_line_parser.py deleted file mode 100644 index abcc270e20..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/configuration_line_parser.py +++ /dev/null @@ -1,80 +0,0 @@ -import re -from ert_gui.ide.keywords.data import Argument, Keyword - - -class ConfigurationLineParser(object): - COMMENT_PATTERN = re.compile(".*?(--.*)") - KEYWORD_PATTERN = re.compile("^\s*([A-Z_]+)(\s|--)?") - ARGUMENT_PATTERN = re.compile('\s+?(\S+)\s*?') - - def __init__(self): - super(ConfigurationLineParser, self).__init__() - - self.__comment_index = -1 - self.__keyword = None - self.__text = None - self.__arguments_index = -1 - self.__arguments = [] - - - def parseLine(self, line): - self.__keyword = None - self.__comment_index = -1 - self.__text = line - self.__arguments_index = -1 - self.__arguments = [] - - comment_match = re.match(ConfigurationLineParser.COMMENT_PATTERN, line) - if comment_match is not None: - self.__comment_index = comment_match.start(1) - line = line[0:comment_match.start(1)] - - keyword_match = re.match(ConfigurationLineParser.KEYWORD_PATTERN, line) - if keyword_match is not None: - self.__keyword = Keyword(keyword_match.start(1), keyword_match.end(1), line) - self.__arguments_index = keyword_match.end(1) - - if self.hasKeyword(): - argument_match = ConfigurationLineParser.ARGUMENT_PATTERN.finditer(line) - - for match in argument_match: - self.__arguments.append(Argument(match.start(1), match.end(1), line)) - - - def hasComment(self): - """ @rtype: bool """ - return self.__comment_index >= 0 - - def commentIndex(self): - """ @rtype: str """ - return self.__comment_index - - def hasKeyword(self): - """ @rtype: bool """ - return self.__keyword is not None - - def keyword(self): - """ @rtype: Keyword """ - return self.__keyword - - def text(self): - """ @rtype: str """ - return self.__text - - def uncommentedText(self): - """ @rtype: str """ - if self.hasComment(): - return self.__text[0:self.commentIndex()] - return self.text() - - def argumentsText(self): - """ @rtype: str """ - if self.hasKeyword(): - return self.uncommentedText()[self.__arguments_index:] - return "" - - def arguments(self): - """ @rtype: list of Argument """ - return self.__arguments - - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/data/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/data/CMakeLists.txt deleted file mode 100644 index 2e90451487..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/data/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - argument.py - configuration_line.py - keyword.py - token.py - validation_status.py -) - -add_python_package("python.ert_gui.ide.keywords.data" ${PYTHON_INSTALL_PREFIX}/ert_gui/ide/keywords/data "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/data/__init__.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/data/__init__.py deleted file mode 100644 index 9421556f0a..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/data/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -from .validation_status import ValidationStatus - -from .token import Token -from .argument import Argument -from .keyword import Keyword - -from .configuration_line import ConfigurationLine diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/data/argument.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/data/argument.py deleted file mode 100644 index 74b18a0231..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/data/argument.py +++ /dev/null @@ -1,27 +0,0 @@ -from ert_gui.ide.keywords.data import Token - - -class Argument(Token): - def __init__(self, from_index, to_index, line): - super(Argument, self).__init__(from_index, to_index, line) - self.__argument_definition = None - - - def setArgumentDefinition(self, argument_definition): - self.__argument_definition = argument_definition - - def argumentDefinition(self): - """ @rtype: ArgumentDefinition """ - return self.__argument_definition - - def hasArgumentDefinition(self): - """ @rtype: bool """ - return self.__argument_definition is not None - - - - - - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/data/configuration_line.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/data/configuration_line.py deleted file mode 100644 index bd77df285b..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/data/configuration_line.py +++ /dev/null @@ -1,89 +0,0 @@ -from ert_gui.ide.keywords.data import Argument, Keyword, ValidationStatus -from ert_gui.ide.keywords.definitions import ArgumentDefinition, KeywordDefinition - - -class ConfigurationLine(object): - ARGUMENT_NOT_EXPECTED = "Argument not expected!" - ARGUMENT_ERROR = "Keyword has an argument error!" - UNKNOWN_KEYWORD = "Unknown keyword!" - - def __init__(self, keyword, arguments, documentation_link, group, required=False): - """ - @type keyword: Keyword - @type arguments: list of Argument - @type documentation_link: str - @type group: str - @type required: bool - """ - super(ConfigurationLine, self).__init__() - - self.__keyword = keyword - self.__arguments = arguments - self.__documentation_link = documentation_link - self.__required = required - self.__group = group - self.__validation_status = {} - - self.__validateTokens() - - - def __validateTokens(self): - keyword_validation_status = ValidationStatus() - - if not self.__keyword.hasKeywordDefinition(): - keyword_validation_status.setFailed() - keyword_validation_status.addToMessage(ConfigurationLine.UNKNOWN_KEYWORD) - - self.__validation_status[self.__keyword] = keyword_validation_status - - argument_error = False - for argument in self.__arguments: - argument_validation_status = ValidationStatus() - - if not argument.hasArgumentDefinition(): - argument_validation_status.setFailed() - argument_validation_status.addToMessage(ConfigurationLine.ARGUMENT_NOT_EXPECTED) - - argument_error = True - else: - arg_def = argument.argumentDefinition() - argument_validation_status = arg_def.validate(argument.value()) - - if not argument_validation_status: - argument_error = True - - self.__validation_status[argument] = argument_validation_status - - if argument_error: - keyword_validation_status.setFailed() - keyword_validation_status.addToMessage(ConfigurationLine.ARGUMENT_ERROR) - - for argument in self.__arguments: - argument_validation_status = self.validationStatusForToken(argument) - if not argument_validation_status: - keyword_validation_status.addToMessage(argument_validation_status.message()) - - - def keyword(self): - """ @rtype: Keyword""" - return self.__keyword - - def arguments(self): - """ @rtype: list of Argument """ - return self.__arguments - - def isRequired(self): - """ @rtype: bool """ - return self.__required - - def documentationLink(self): - """ @rtype: str """ - return self.__documentation_link - - def group(self): - """ @rtype: str """ - return self.__group - - def validationStatusForToken(self, token): - """ @rtype: ValidationStatus """ - return self.__validation_status[token] diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/data/keyword.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/data/keyword.py deleted file mode 100644 index 00ff0c79c2..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/data/keyword.py +++ /dev/null @@ -1,19 +0,0 @@ -from ert_gui.ide.keywords.data import Token -from ert_gui.ide.keywords.definitions import KeywordDefinition - - -class Keyword(Token): - def __init__(self, from_index, to_index, line): - super(Keyword, self).__init__(from_index, to_index, line) - - self.__keyword_definition = None - - def keywordDefinition(self): - """ @rtype: KeywordDefinition """ - return self.__keyword_definition - - def setKeywordDefinition(self, keyword_definition): - self.__keyword_definition = keyword_definition - - def hasKeywordDefinition(self): - return self.__keyword_definition is not None \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/data/token.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/data/token.py deleted file mode 100644 index a762100101..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/data/token.py +++ /dev/null @@ -1,36 +0,0 @@ -class Token(object): - - def __init__(self, from_index, to_index, line): - super(Token, self).__init__() - - self.__from_index = from_index - self.__to_index = to_index - self.__line = line - - def value(self): - """ @rtype: str """ - return self.__line[self.__from_index:self.__to_index] - - def fromIndex(self): - """ @rtype: int """ - return self.__from_index - - def toIndex(self): - """ @rtype: int """ - return self.__to_index - - def line(self): - """ @rtype: str """ - return self.__line - - def count(self): - """ @rtype: int """ - return self.toIndex() - self.fromIndex() - - def __contains__(self, item): - assert isinstance(item, int) - - return self.__from_index <= item < self.__to_index - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/data/validation_status.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/data/validation_status.py deleted file mode 100644 index ee949edc56..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/data/validation_status.py +++ /dev/null @@ -1,35 +0,0 @@ -class ValidationStatus(object): - def __init__(self): - super(ValidationStatus, self).__init__() - self.reset() - - def reset(self): - self.__fail = False - self.__message = "" - self.__value = None - - def setFailed(self): - self.__fail = True - - def failed(self): - return self.__fail - - def addToMessage(self, message): - self.__message += message + "\n" - - def message(self): - return self.__message.strip() - - def setValue(self, value): - self.__value = value - - def value(self): - return self.__value - - def __nonzero__(self): - return not self.__fail - - def __str__(self): - return self.__message - - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/CMakeLists.txt deleted file mode 100644 index e95326ab5b..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - argument_definition.py - bool_argument.py - configuration_line_definition.py - float_argument.py - integer_argument.py - keyword_definition.py - number_list_string_argument.py - path_argument.py - percent_argument.py - proper_name_argument.py - proper_name_format_argument.py - proper_name_format_string_argument.py - range_string_argument.py - string_argument.py -) - -add_python_package("python.ert_gui.ide.keywords.definitions" ${PYTHON_INSTALL_PREFIX}/ert_gui/ide/keywords/definitions "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/__init__.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/__init__.py deleted file mode 100644 index aac0683937..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -from .argument_definition import ArgumentDefinition -from .integer_argument import IntegerArgument -from .percent_argument import PercentArgument -from .string_argument import StringArgument -from .bool_argument import BoolArgument -from .float_argument import FloatArgument -from .path_argument import PathArgument -from .proper_name_argument import ProperNameArgument -from .proper_name_format_argument import ProperNameFormatArgument -from .proper_name_format_string_argument import ProperNameFormatStringArgument -from .range_string_argument import RangeStringArgument -from .number_list_string_argument import NumberListStringArgument - -from .argument_definition import ArgumentDefinition -from .keyword_definition import KeywordDefinition -from .configuration_line_definition import ConfigurationLineDefinition diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/argument_definition.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/argument_definition.py deleted file mode 100644 index 6d10bb5a09..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/argument_definition.py +++ /dev/null @@ -1,30 +0,0 @@ -from ert_gui.ide.keywords.data import ValidationStatus - -class ArgumentDefinition(object): - MISSING_ARGUMENT = "Missing argument!" - - def __init__(self, optional=False, built_in=False, rest_of_line=False): - super(ArgumentDefinition, self).__init__() - self.__optional = optional - self.__built_in = built_in - self.__rest_of_line = rest_of_line - - def isOptional(self): - return self.__optional - - def isBuiltIn(self): - return self.__built_in - - def consumeRestOfLine(self): - return self.__rest_of_line - - - def validate(self, token): - vs = ValidationStatus() - - if not self.isOptional() and token.strip() == "": - vs.setFailed() - vs.addToMessage(ArgumentDefinition.MISSING_ARGUMENT) - - return vs - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/bool_argument.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/bool_argument.py deleted file mode 100644 index 85c736295a..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/bool_argument.py +++ /dev/null @@ -1,36 +0,0 @@ - -import re -from ert_gui.ide.keywords.definitions import ArgumentDefinition - - -class BoolArgument(ArgumentDefinition): - - NOT_BOOL = "The argument must be TRUE or FALSE." - - true_pattern = re.compile("^(1|T|[Tt][Rr][Uu][Ee])$") - false_pattern = re.compile("^(0|F|[Ff][Aa][Ll][Ss][Ee])$") - - def __init__(self, **kwargs): - super(BoolArgument, self).__init__(**kwargs) - - - def validate(self, token): - validation_status = super(BoolArgument, self).validate(token) - - true_match = BoolArgument.true_pattern.match(token) - false_match = BoolArgument.false_pattern.match(token) - - if true_match is None and false_match is None: - validation_status.setFailed() - validation_status.addToMessage(BoolArgument.NOT_BOOL) - else: - validation_status.setValue(true_match is not None) - - return validation_status - - - - - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/configuration_line_definition.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/configuration_line_definition.py deleted file mode 100644 index d1837c58e5..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/configuration_line_definition.py +++ /dev/null @@ -1,32 +0,0 @@ -from ert_gui.ide.keywords.definitions import KeywordDefinition, ArgumentDefinition - - -class ConfigurationLineDefinition(object): - def __init__(self, keyword, arguments, documentation_link, group, required=False): - super(ConfigurationLineDefinition, self).__init__() - - self.__keyword_definition = keyword - self.__argument_definitions = arguments - self.__documentation_link = documentation_link - self.__required = required - self.__group = group - - def isRequired(self): - """ @rtype: bool """ - return self.__required - - def keywordDefinition(self): - """ @rtype: KeywordDefinition """ - return self.__keyword_definition - - def argumentDefinitions(self): - """ @rtype: list of ArgumentDefinition """ - return self.__argument_definitions - - def documentationLink(self): - """ @rtype: str """ - return self.__documentation_link - - def group(self): - """ @rtype: str """ - return self.__group \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/float_argument.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/float_argument.py deleted file mode 100644 index d289dbb9c2..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/float_argument.py +++ /dev/null @@ -1,59 +0,0 @@ -import re -from ert_gui.ide.keywords.definitions import ArgumentDefinition - - -class FloatArgument(ArgumentDefinition): - - NOT_FLOAT = "The argument must be a float." - NOT_IN_RANGE = "The argument is not in range: %s" - - pattern = re.compile("^[\S]+$") - - def __init__(self, from_value=None, to_value=None, **kwargs): - super(FloatArgument, self).__init__(**kwargs) - self.from_value = from_value - self.to_value = to_value - - - def validate(self, token): - validation_status = super(FloatArgument, self).validate(token) - - match = FloatArgument.pattern.match(token) - - if match is None: - validation_status.setFailed() - validation_status.addToMessage(FloatArgument.NOT_FLOAT) - else: - try: - value = float(token) - - if self.from_value is not None and self.to_value is not None and not self.from_value <= value <= self.to_value: - validation_status.setFailed() - range_string = "%f <= %f <= %f" % (self.from_value, value, self.to_value) - validation_status.addToMessage(FloatArgument.NOT_IN_RANGE % range_string) - - elif self.from_value is not None and self.from_value > value: - validation_status.setFailed() - range_string = "%f <= %f" % (self.from_value, value) - validation_status.addToMessage(FloatArgument.NOT_IN_RANGE % range_string) - - elif self.to_value is not None and self.to_value < value: - validation_status.setFailed() - range_string = "%f <= %f" % (value, self.to_value) - validation_status.addToMessage(FloatArgument.NOT_IN_RANGE % range_string) - - if not validation_status.failed(): - validation_status.setValue(value) - - except ValueError: - validation_status.setFailed() - validation_status.addToMessage(FloatArgument.NOT_FLOAT) - - return validation_status - - - - - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/integer_argument.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/integer_argument.py deleted file mode 100644 index e6b57531f6..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/integer_argument.py +++ /dev/null @@ -1,56 +0,0 @@ -import re -from ert_gui.ide.keywords.definitions import ArgumentDefinition - - -class IntegerArgument(ArgumentDefinition): - - NOT_INTEGER = "The argument must be an integer." - NOT_IN_RANGE = "The argument is not in range: %s" - - pattern = re.compile("^-?[0-9]+$") - - def __init__(self, from_value=None, to_value=None, **kwargs): - super(IntegerArgument, self).__init__(**kwargs) - self.from_value = from_value - self.to_value = to_value - - - def validate(self, token): - validation_status = super(IntegerArgument, self).validate(token) - - match = IntegerArgument.pattern.match(token) - - if match is None: - validation_status.setFailed() - validation_status.addToMessage(IntegerArgument.NOT_INTEGER) - else: - value = int(token) - - if self.from_value is not None and self.to_value is not None and not self.from_value <= value <= self.to_value: - validation_status.setFailed() - range_string = "%d <= %d <= %d" % (self.from_value, value, self.to_value) - validation_status.addToMessage(IntegerArgument.NOT_IN_RANGE % range_string) - - elif self.from_value is not None and self.from_value > value: - validation_status.setFailed() - range_string = "%d <= %d" % (self.from_value, value) - validation_status.addToMessage(IntegerArgument.NOT_IN_RANGE % range_string) - - elif self.to_value is not None and self.to_value < value: - validation_status.setFailed() - range_string = "%d <= %d" % (value, self.to_value) - validation_status.addToMessage(IntegerArgument.NOT_IN_RANGE % range_string) - - - if not validation_status.failed(): - validation_status.setValue(value) - - - return validation_status - - - - - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/keyword_definition.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/keyword_definition.py deleted file mode 100644 index 24456505e6..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/keyword_definition.py +++ /dev/null @@ -1,9 +0,0 @@ -class KeywordDefinition(object): - - def __init__(self, name): - super(KeywordDefinition, self).__init__() - self.__name = name - - def name(self): - return self.__name - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/number_list_string_argument.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/number_list_string_argument.py deleted file mode 100644 index 6f5d245fda..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/number_list_string_argument.py +++ /dev/null @@ -1,43 +0,0 @@ -import re -from ert_gui.ide.keywords.definitions import ArgumentDefinition - - -class NumberListStringArgument(ArgumentDefinition): - - NOT_A_VALID_NUMBER_LIST_STRING = "The input should be of the type:
\n\t23,5.5,11,1.01,3\n
i.e. numeric values separated by commas." - VALUE_NOT_A_NUMBER = "The value: '%s' is not a number." - - PATTERN = re.compile("^[0-9\.\-+, \t]+$") - - def __init__(self, **kwargs): - super(NumberListStringArgument, self).__init__(**kwargs) - - def validate(self, token): - validation_status = super(NumberListStringArgument, self).validate(token) - - if not validation_status: - return validation_status - else: - match = NumberListStringArgument.PATTERN.match(token) - - if match is None: - validation_status.setFailed() - validation_status.addToMessage(NumberListStringArgument.NOT_A_VALID_NUMBER_LIST_STRING) - else: - - groups = token.split(",") - - for group in groups: - group = group.strip() - - if len(group) > 0: - try: - num = float(group.strip()) - except ValueError: - validation_status.setFailed() - validation_status.addToMessage(NumberListStringArgument.VALUE_NOT_A_NUMBER % group) - - - validation_status.setValue(token) - - return validation_status diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/path_argument.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/path_argument.py deleted file mode 100644 index b604fd42ef..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/path_argument.py +++ /dev/null @@ -1,50 +0,0 @@ -import os -import re -from ert_gui.ide.keywords.definitions import ArgumentDefinition - - -class PathArgument(ArgumentDefinition): - - NOT_A_VALID_PATH = "The argument must be a valid path." - PATH_DOES_NOT_EXIST = "The argument must be a valid path that exists." - - PATTERN = re.compile("^[\S]+$") - PATTERN_WITH_SPACE = re.compile("^[\S| ]+$") - - DEFINES = {} - - def __init__(self, must_exist=True, **kwargs): - super(PathArgument, self).__init__(**kwargs) - self.__must_exist = must_exist - - if not "" in PathArgument.DEFINES: - PathArgument.DEFINES[""] = "." - - - def validate(self, token): - validation_status = super(PathArgument, self).validate(token) - - token = PathArgument.substituteDefines(token) - - if self.__must_exist and not os.path.exists(token): - validation_status.setFailed() - validation_status.addToMessage(PathArgument.PATH_DOES_NOT_EXIST) - - return validation_status - - @staticmethod - def substituteDefines(token): - result = token - for key in PathArgument.DEFINES: - if result.find(key) != -1: - value = PathArgument.DEFINES[key] - result = result.replace(key, value) - return result - - @staticmethod - def addDefine(key, value): - value = PathArgument.substituteDefines(value) - PathArgument.DEFINES[key] = value - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/percent_argument.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/percent_argument.py deleted file mode 100644 index 9f329971cb..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/percent_argument.py +++ /dev/null @@ -1,56 +0,0 @@ -import re -from ert_gui.ide.keywords.definitions import ArgumentDefinition - - -class PercentArgument(ArgumentDefinition): - - NOT_PERCENT = "The argument must be a number followed by % - no space allowed." - NOT_IN_RANGE = "The argument is not in range: %s" - - pattern = re.compile("^-?[0-9]+(\.[0-9]+)?\%$") - - def __init__(self, from_value=None, to_value=None, **kwargs): - super(PercentArgument, self).__init__(**kwargs) - self.from_value = from_value * 0.01 - self.to_value = to_value * 0.01 - - - def validate(self, token): - validation_status = super(PercentArgument, self).validate(token) - - match = PercentArgument.pattern.match(token) - - if match is None: - validation_status.setFailed() - validation_status.addToMessage(PercentArgument.NOT_PERCENT) - else: - value = float(token[:-1]) * 0.01 - - if self.from_value is not None and self.to_value is not None and not self.from_value <= value <= self.to_value: - validation_status.setFailed() - range_string = "%d <= %d <= %d" % (self.from_value, value, self.to_value) - validation_status.addToMessage(IntegerArgument.NOT_IN_RANGE % range_string) - - elif self.from_value is not None and self.from_value > value: - validation_status.setFailed() - range_string = "%d <= %d" % (self.from_value, value) - validation_status.addToMessage(IntegerArgument.NOT_IN_RANGE % range_string) - - elif self.to_value is not None and self.to_value < value: - validation_status.setFailed() - range_string = "%d <= %d" % (value, self.to_value) - validation_status.addToMessage(IntegerArgument.NOT_IN_RANGE % range_string) - - - if not validation_status.failed(): - validation_status.setValue(value) - - - return validation_status - - - - - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/proper_name_argument.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/proper_name_argument.py deleted file mode 100644 index 2eed9cc809..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/proper_name_argument.py +++ /dev/null @@ -1,48 +0,0 @@ -import re -from ert_gui.ide.keywords.definitions import ArgumentDefinition - - -class ProperNameArgument(ArgumentDefinition): - - NOT_A_VALID_NAME = "The argument must be a valid string containing only characters of these types:" \ - "
    " \ - "
  • Letters: A-Z and a-z
  • " \ - "
  • Numbers: 0-9
  • " \ - "
  • Underscore: _
  • " \ - "
  • Dash:
  • " \ - "
  • Period: .
  • " \ - "
  • Brackets: <>
  • " \ - "
" - - - PATTERN = re.compile("^[A-Za-z0-9_\-.<>]+$") - - - def __init__(self, **kwargs): - super(ProperNameArgument, self).__init__(**kwargs) - - - def validate(self, token): - validation_status = super(ProperNameArgument, self).validate(token) - - if not validation_status: - return validation_status - else: - match = ProperNameArgument.PATTERN.match(token) - - if match is None: - validation_status.setFailed() - validation_status.addToMessage(ProperNameArgument.NOT_A_VALID_NAME) - else: - - if not validation_status.failed(): - validation_status.setValue(token) - - return validation_status - - - - - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/proper_name_format_argument.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/proper_name_format_argument.py deleted file mode 100644 index ec5f59b721..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/proper_name_format_argument.py +++ /dev/null @@ -1,48 +0,0 @@ -import re -from ert_gui.ide.keywords.definitions import ArgumentDefinition - - -class ProperNameFormatArgument(ArgumentDefinition): - - NOT_A_VALID_NAME_FORMAT = "The argument must be a valid string containing a %d and only characters of these types:" \ - "
    " \ - "
  • Letters: A-Z and a-z
  • " \ - "
  • Numbers: 0-9
  • " \ - "
  • Underscore: _
  • " \ - "
  • Dash:
  • " \ - "
  • Period: .
  • " \ - "
  • Brackets: <>
  • " \ - "
" - - - PATTERN = re.compile("^[A-Za-z0-9_\-.<>]*(%d)[A-Za-z0-9_\-.<>]*$") - - - def __init__(self, **kwargs): - super(ProperNameFormatArgument, self).__init__(**kwargs) - - - def validate(self, token): - validation_status = super(ProperNameFormatArgument, self).validate(token) - - if not validation_status: - return validation_status - else: - match = ProperNameFormatArgument.PATTERN.match(token) - - if match is None: - validation_status.setFailed() - validation_status.addToMessage(ProperNameFormatArgument.NOT_A_VALID_NAME_FORMAT) - else: - - if not validation_status.failed(): - validation_status.setValue(token) - - return validation_status - - - - - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/proper_name_format_string_argument.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/proper_name_format_string_argument.py deleted file mode 100644 index 4eabbcd971..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/proper_name_format_string_argument.py +++ /dev/null @@ -1,45 +0,0 @@ -import re -from ert_gui.ide.keywords.definitions import ArgumentDefinition - - -''' -Keyword definition for proper names containing a string argument. -''' -class ProperNameFormatStringArgument(ArgumentDefinition): - - NOT_A_VALID_NAME_FORMAT = "The argument must be a valid string containing a %s and only characters of these types:" \ - "
    " \ - "
  • Letters: A-Z and a-z
  • " \ - "
  • Numbers: 0-9
  • " \ - "
  • Underscore: _
  • " \ - "
  • Dash:
  • " \ - "
  • Period: .
  • " \ - "
  • Brackets: <>
  • " \ - "
" - - - PATTERN = re.compile("^[A-Za-z0-9_\-.<>]*(%s)[A-Za-z0-9_\-.<>]*$") - - - def __init__(self, **kwargs): - super(ProperNameFormatStringArgument, self).__init__(**kwargs) - - - def validate(self, token): - validation_status = super(ProperNameFormatStringArgument, self).validate(token) - - if not validation_status: - return validation_status - else: - match = ProperNameFormatStringArgument.PATTERN.match(token) - - if match is None: - validation_status.setFailed() - validation_status.addToMessage(ProperNameFormatStringArgument.NOT_A_VALID_NAME_FORMAT) - else: - - if not validation_status.failed(): - validation_status.setValue(token) - - return validation_status - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/range_string_argument.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/range_string_argument.py deleted file mode 100644 index 8fca2fde08..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/range_string_argument.py +++ /dev/null @@ -1,71 +0,0 @@ -import re -from ert_gui.ide.keywords.definitions import ArgumentDefinition - - -class RangeStringArgument(ArgumentDefinition): - - NOT_A_VALID_RANGE_STRING = "The input should be of the type:
\n\t1,3-5,9,17\n
i.e. integer values separated by commas, and dashes to represent ranges." - VALUE_NOT_IN_RANGE = "A value must be in the range from 0 to %d." - - - PATTERN = re.compile("^[0-9\-, \t]+$") - RANGE_PATTERN = re.compile("^[ \t]*([0-9]+)[ \t]*-[ \t]*([0-9]+)[ \t]*$") - NUMBER_PATTERN = re.compile("^[ \t]*([0-9]+)[ \t]*$") - - - def __init__(self, max_value=None, **kwargs): - super(RangeStringArgument, self).__init__(**kwargs) - self.__max_value = max_value - - def validate(self, token): - validation_status = super(RangeStringArgument, self).validate(token) - - if not validation_status: - return validation_status - else: - match = RangeStringArgument.PATTERN.match(token) - - if match is None: - validation_status.setFailed() - validation_status.addToMessage(RangeStringArgument.NOT_A_VALID_RANGE_STRING) - else: - - groups = token.split(",") - - for group in groups: - range_match = RangeStringArgument.RANGE_PATTERN.match(group) - number_match = RangeStringArgument.NUMBER_PATTERN.match(group) - - - if range_match is None and number_match is None: - validation_status.setFailed() - validation_status.addToMessage(RangeStringArgument.NOT_A_VALID_RANGE_STRING) - break - - if range_match: - num_1 = int(range_match.group(1)) - num_2 = int(range_match.group(2)) - - if not num_2 > num_1: - validation_status.setFailed() - validation_status.addToMessage(RangeStringArgument.NOT_A_VALID_RANGE_STRING) - break - - if self.__max_value is not None and (num_1 >= self.__max_value or num_2 >= self.__max_value): - validation_status.setFailed() - validation_status.addToMessage(RangeStringArgument.VALUE_NOT_IN_RANGE % (self.__max_value - 1)) - break - - if number_match and self.__max_value is not None: - num = int(number_match.group(1)) - - if num >= self.__max_value: - validation_status.setFailed() - validation_status.addToMessage(RangeStringArgument.VALUE_NOT_IN_RANGE % (self.__max_value - 1)) - break - - - - validation_status.setValue(token) - - return validation_status diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/string_argument.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/string_argument.py deleted file mode 100644 index 760d26f018..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/definitions/string_argument.py +++ /dev/null @@ -1,47 +0,0 @@ -import re -from ert_gui.ide.keywords.definitions import ArgumentDefinition - - -class StringArgument(ArgumentDefinition): - - NOT_A_VALID_STRING = "The argument must be a valid string." - - PATTERN = re.compile("^[\S]+$") - PATTERN_WITH_SPACE = re.compile("^[\S| ]+$") - - - def __init__(self, allow_space=False, **kwargs): - super(StringArgument, self).__init__(**kwargs) - self.__allow_space = allow_space - - - def validate(self, token): - validation_status = super(StringArgument, self).validate(token) - - if not validation_status: - return validation_status - elif self.isOptional() and token.strip() == "": - return validation_status - else: - if self.__allow_space: - match = StringArgument.PATTERN_WITH_SPACE.match(token) - else: - match = StringArgument.PATTERN.match(token) - - if match is None: - validation_status.setFailed() - validation_status.addToMessage(StringArgument.NOT_A_VALID_STRING) - else: - - if not validation_status.failed(): - validation_status.setValue(token) - - - return validation_status - - - - - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/eclipse_keywords.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/eclipse_keywords.py deleted file mode 100644 index 2386e78271..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/eclipse_keywords.py +++ /dev/null @@ -1,101 +0,0 @@ -from ert_gui.ide.keywords.definitions import IntegerArgument, KeywordDefinition, ConfigurationLineDefinition, StringArgument, BoolArgument -from ert_gui.ide.keywords.definitions.path_argument import PathArgument - - -class EclipseKeywords(object): - def __init__(self, ert_keywords): - super(EclipseKeywords, self).__init__() - self.group = "Eclipse" - - - ert_keywords.addKeyword(self.addDataFile()) - ert_keywords.addKeyword(self.addEclBase()) - ert_keywords.addKeyword(self.addJobName()) - ert_keywords.addKeyword(self.addGrid()) - ert_keywords.addKeyword(self.addInitSection()) - ert_keywords.addKeyword(self.addScheduleFile()) - ert_keywords.addKeyword(self.addDataKw()) - ert_keywords.addKeyword(self.addEquilInitFile()) - ert_keywords.addKeyword(self.addIgnoreSchedule()) - - - - def addDataFile(self): - data_file = ConfigurationLineDefinition(keyword=KeywordDefinition("DATA_FILE"), - arguments=[PathArgument()], - documentation_link="keywords/data_file", - required=True, - group=self.group) - return data_file - - - def addEquilInitFile(self): - equil_init_file = ConfigurationLineDefinition(keyword=KeywordDefinition("EQUIL_INIT_FILE"), - arguments=[PathArgument()], - documentation_link="keywords/equil_init_file", - group=self.group) - return equil_init_file - - - - def addEclBase(self): - ecl_base = ConfigurationLineDefinition(keyword=KeywordDefinition("ECLBASE"), - arguments=[StringArgument()], - documentation_link="keywords/eclbase", - required=True, - group=self.group) - return ecl_base - - - def addJobName(self): - job_name = ConfigurationLineDefinition(keyword=KeywordDefinition("JOBNAME"), - arguments=[StringArgument()], - documentation_link="keywords/job_name", - required=True, - group=self.group) - return job_name - - - def addGrid(self): - grid = ConfigurationLineDefinition(keyword=KeywordDefinition("GRID"), - arguments=[PathArgument()], - documentation_link="keywords/grid", - required=True, - group=self.group) - return grid - - def addInitSection(self): - init_section = ConfigurationLineDefinition(keyword=KeywordDefinition("INIT_SECTION"), - arguments=[PathArgument()], - documentation_link="keywords/init_section", - required=True, - group=self.group) - return init_section - - - def addScheduleFile(self): - schedule_file = ConfigurationLineDefinition(keyword=KeywordDefinition("SCHEDULE_FILE"), - arguments=[PathArgument()], - documentation_link="keywords/schedule_file", - required=True, - group=self.group) - return schedule_file - - - def addIgnoreSchedule(self): - ignore_schedule = ConfigurationLineDefinition(keyword=KeywordDefinition("IGNORE_SCHEDULE"), - arguments=[BoolArgument()], - documentation_link="keywords/ignore_schedule", - required=False, - group=self.group) - return ignore_schedule - - - def addDataKw(self): - data_kw = ConfigurationLineDefinition(keyword=KeywordDefinition("DATA_KW"), - arguments=[StringArgument(), - StringArgument(rest_of_line=True, allow_space=True)], - documentation_link="keywords/data_kw", - required=False, - group=self.group) - return data_kw \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/enkf_control_keywords.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/enkf_control_keywords.py deleted file mode 100644 index efad1a52e2..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/enkf_control_keywords.py +++ /dev/null @@ -1,240 +0,0 @@ -from ert_gui.ide.keywords.definitions import IntegerArgument, KeywordDefinition, ConfigurationLineDefinition, PathArgument, StringArgument, FloatArgument, BoolArgument - - -class EnkfControlKeywords(object): - def __init__(self, ert_keywords): - super(EnkfControlKeywords, self).__init__() - self.group = "Enkf Control" - - ert_keywords.addKeyword(self.addEnkfAlpha()) - ert_keywords.addKeyword(self.addEnkfBootstrap()) - ert_keywords.addKeyword(self.addEnkfCvFolds()) - ert_keywords.addKeyword(self.addEnkfForceNComp()) - ert_keywords.addKeyword(self.addEnkfLocalCv()) - ert_keywords.addKeyword(self.addEnkfPenPress()) - ert_keywords.addKeyword(self.addEnkfMode()) - ert_keywords.addKeyword(self.addMergeObservations()) - ert_keywords.addKeyword(self.addEnkfNComp()) - ert_keywords.addKeyword(self.addEnkfRerun()) - ert_keywords.addKeyword(self.addEnkfScaling()) - ert_keywords.addKeyword(self.addEnkfTruncation()) - ert_keywords.addKeyword(self.addUpdateLogPath()) - ert_keywords.addKeyword(self.addRerunStart()) - ert_keywords.addKeyword(self.addUpdateResults()) - ert_keywords.addKeyword(self.addEnkfCrossValidation()) - ert_keywords.addKeyword(self.addEnkfKernelRegression()) - ert_keywords.addKeyword(self.addEnkfKernelFunction()) - ert_keywords.addKeyword(self.addEnkfKernelParam()) - ert_keywords.addKeyword(self.addEnkfSchedFile()) - ert_keywords.addKeyword(self.addCaseTable()) - ert_keywords.addKeyword(self.addContainer()) - - - - def addEnkfAlpha(self): - enkf_alpha = ConfigurationLineDefinition(keyword=KeywordDefinition("ENKF_ALPHA"), - arguments=[FloatArgument()], - documentation_link="keywords/enkf_alpha", - required=False, - group=self.group) - return enkf_alpha - - - - def addEnkfBootstrap(self): - enkf_bootstrap = ConfigurationLineDefinition(keyword=KeywordDefinition("ENKF_BOOTSTRAP"), - arguments=[BoolArgument()], - documentation_link="keywords/enkf_bootstrap", - required=False, - group=self.group) - return enkf_bootstrap - - - - def addEnkfCvFolds(self): - enkf_cv_folds = ConfigurationLineDefinition(keyword=KeywordDefinition("ENKF_CV_FOLDS"), - arguments=[IntegerArgument()], - documentation_link="keywords/enkf_cv_folds", - required=False, - group=self.group) - return enkf_cv_folds - - - - def addEnkfForceNComp(self): - enkf_force_ncomp = ConfigurationLineDefinition(keyword=KeywordDefinition("ENKF_FORCE_NCOMP"), - arguments=[BoolArgument()], - documentation_link="keywords/enkf_force_ncomp", - required=False, - group=self.group) - return enkf_force_ncomp - - - def addEnkfLocalCv(self): - enkf_local_cv = ConfigurationLineDefinition(keyword=KeywordDefinition("ENKF_LOCAL_CV"), - arguments=[BoolArgument()], - documentation_link="keywords/enkf_local_cv", - required=False, - group=self.group) - return enkf_local_cv - - - def addEnkfPenPress(self): - enkf_pen_press = ConfigurationLineDefinition(keyword=KeywordDefinition("ENKF_PEN_PRESS"), - arguments=[BoolArgument()], - documentation_link="keywords/enkf_pen_press", - required=False, - group=self.group) - return enkf_pen_press - - - - def addEnkfMode(self): - enkf_mode = ConfigurationLineDefinition(keyword=KeywordDefinition("ENKF_MODE"), - arguments=[StringArgument(built_in=True)], - documentation_link="keywords/enkf_mode", - required=False, - group=self.group) - return enkf_mode - - - - def addMergeObservations(self): - enkf_merge_observations = ConfigurationLineDefinition(keyword=KeywordDefinition("ENKF_MERGE_OBSERVATIONS"), - arguments=[BoolArgument()], - documentation_link="keywords/enkf_merge_observations", - required=False, - group=self.group) - return enkf_merge_observations - - - - def addEnkfNComp(self): - enkf_ncomp = ConfigurationLineDefinition(keyword=KeywordDefinition("ENKF_NCOMP"), - arguments=[IntegerArgument()], - documentation_link="keywords/enkf_ncomp", - required=False, - group=self.group) - return enkf_ncomp - - - def addEnkfRerun(self): - enkf_rerun = ConfigurationLineDefinition(keyword=KeywordDefinition("ENKF_RERUN"), - arguments=[BoolArgument()], - documentation_link="keywords/enkf_rerun", - required=False, - group=self.group) - return enkf_rerun - - - def addRerunStart(self): - rerun_start = ConfigurationLineDefinition(keyword=KeywordDefinition("RERUN_START"), - arguments=[IntegerArgument()], - documentation_link="keywords/rerun_start", - required=False, - group=self.group) - return rerun_start - - - - def addEnkfScaling(self): - enkf_scaling = ConfigurationLineDefinition(keyword=KeywordDefinition("ENKF_SCALING"), - arguments=[BoolArgument()], - documentation_link="keywords/enkf_scaling", - required=False, - group=self.group) - return enkf_scaling - - - - def addEnkfTruncation(self): - enkf_truncation = ConfigurationLineDefinition(keyword=KeywordDefinition("ENKF_TRUNCATION"), - arguments=[FloatArgument()], - documentation_link="keywords/enkf_truncation", - required=False, - group=self.group) - return enkf_truncation - - - - def addUpdateLogPath(self): - update_log_path = ConfigurationLineDefinition(keyword=KeywordDefinition("UPDATE_LOG_PATH"), - arguments=[PathArgument()], - documentation_link="keywords/update_log_path", - required=False, - group=self.group) - return update_log_path - - - def addUpdateResults(self): - update_results = ConfigurationLineDefinition(keyword=KeywordDefinition("UPDATE_RESULTS"), - arguments=[BoolArgument()], - documentation_link="keywords/update_results", - required=False, - group=self.group) - return update_results - - - def addEnkfCrossValidation(self): - cross_validation = ConfigurationLineDefinition(keyword=KeywordDefinition("ENKF_CROSS_VALIDATION"), - arguments=[StringArgument()], - documentation_link="keywords/enkf_cross_validation", - required=False, - group=self.group) - return cross_validation - - - def addEnkfKernelRegression(self): - kernel_regression = ConfigurationLineDefinition(keyword=KeywordDefinition("ENKF_KERNEL_REGRESSION"), - arguments=[StringArgument()], - documentation_link="keywords/enkf_kernel_regression", - required=False, - group=self.group) - return kernel_regression - - - def addEnkfKernelFunction(self): - kernel_function = ConfigurationLineDefinition(keyword=KeywordDefinition("ENKF_KERNEL_FUNCTION"), - arguments=[StringArgument()], - documentation_link="keywords/enkf_kernel_function", - required=False, - group=self.group) - return kernel_function - - - def addEnkfKernelParam(self): - kernel_param = ConfigurationLineDefinition(keyword=KeywordDefinition("ENKF_KERNEL_PARAM"), - arguments=[StringArgument()], - documentation_link="keywords/enkf_kernel_param", - required=False, - group=self.group) - return kernel_param - - - def addEnkfSchedFile(self): - sched_file = ConfigurationLineDefinition(keyword=KeywordDefinition("ENKF_SCHED_FILE"), - arguments=[PathArgument()], - documentation_link="keywords/enkf_sched_file", - required=False, - group=self.group) - return sched_file - - - - def addCaseTable(self): - case_table = ConfigurationLineDefinition(keyword=KeywordDefinition("CASE_TABLE"), - arguments=[StringArgument()], - documentation_link="keywords/case_table", - required=False, - group=self.group) - return case_table - - - def addContainer(self): - container = ConfigurationLineDefinition(keyword=KeywordDefinition("CONTAINER"), - arguments=[StringArgument(rest_of_line=True,allow_space=True)], - documentation_link="keywords/container", - required=False, - group=self.group) - return container - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/ensemble_keywords.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/ensemble_keywords.py deleted file mode 100644 index f85e3dbfa2..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/ensemble_keywords.py +++ /dev/null @@ -1,135 +0,0 @@ -from ert_gui.ide.keywords.definitions import IntegerArgument, KeywordDefinition, ConfigurationLineDefinition, PathArgument, StringArgument - - -class EnsembleKeywords(object): - def __init__(self, ert_keywords): - super(EnsembleKeywords, self).__init__() - self.group = "Ensemble" - - ert_keywords.addKeyword(self.addNumRealizations()) - ert_keywords.addKeyword(self.addEnsPath()) - ert_keywords.addKeyword(self.addSelectCase()) - ert_keywords.addKeyword(self.addEndDate()) - ert_keywords.addKeyword(self.addHistorySource()) - ert_keywords.addKeyword(self.addRefCase()) - ert_keywords.addKeyword(self.addInclude()) - ert_keywords.addKeyword(self.addObsConfig()) - ert_keywords.addKeyword(self.addResultPath()) - ert_keywords.addKeyword(self.addLicensePath()) - ert_keywords.addKeyword(self.addLocalConfig()) - ert_keywords.addKeyword(self.addRefcaseList()) - - - - - - def addNumRealizations(self): - num_realizations = ConfigurationLineDefinition(keyword=KeywordDefinition("NUM_REALIZATIONS"), - arguments=[IntegerArgument(from_value=1)], - documentation_link="keywords/num_realizations", - required=True, - group=self.group) - return num_realizations - - - def addEndDate(self): - end_date = ConfigurationLineDefinition(keyword=KeywordDefinition("END_DATE"), - arguments=[StringArgument()], - documentation_link="keywords/end_date", - required=False, - group=self.group) - return end_date - - - def addEnsPath(self): - ens_path = ConfigurationLineDefinition(keyword=KeywordDefinition("ENSPATH"), - arguments=[PathArgument()], - documentation_link="keywords/enspath", - required=False, - group=self.group) - return ens_path - - - - def addSelectCase(self): - select_case = ConfigurationLineDefinition(keyword=KeywordDefinition("SELECT_CASE"), - arguments=[StringArgument()], - documentation_link="keywords/select_case", - required=False, - group=self.group) - return select_case - - - def addHistorySource(self): - history_source = ConfigurationLineDefinition(keyword=KeywordDefinition("HISTORY_SOURCE"), - arguments=[StringArgument(built_in=True)], - documentation_link="keywords/history_source", - required=False, - group=self.group) - return history_source - - - def addRefCase(self): - refcase = ConfigurationLineDefinition(keyword=KeywordDefinition("REFCASE"), - arguments=[PathArgument()], - documentation_link="keywords/refcase", - required=False, - group=self.group) - return refcase - - - def addRefcaseList(self): - refcase_list = ConfigurationLineDefinition(keyword=KeywordDefinition("REFCASE_LIST"), - arguments=[StringArgument(rest_of_line=True,allow_space=True)], - documentation_link="keywords/refcase_list", - required=False, - group=self.group) - return refcase_list - - - - def addInclude(self): - include = ConfigurationLineDefinition(keyword=KeywordDefinition("INCLUDE"), - arguments=[PathArgument()], - documentation_link="keywords/include", - required=False, - group=self.group) - return include - - - - def addObsConfig(self): - obs_config = ConfigurationLineDefinition(keyword=KeywordDefinition("OBS_CONFIG"), - arguments=[PathArgument()], - documentation_link="keywords/obs_config", - required=False, - group=self.group) - return obs_config - - - def addResultPath(self): - result_path = ConfigurationLineDefinition(keyword=KeywordDefinition("RESULT_PATH"), - arguments=[PathArgument()], - documentation_link="keywords/result_path", - required=False, - group=self.group) - return result_path - - - def addLicensePath(self): - license_path = ConfigurationLineDefinition(keyword=KeywordDefinition("LICENSE_PATH"), - arguments=[PathArgument()], - documentation_link="keywords/license_path", - required=False, - group=self.group) - return license_path - - - def addLocalConfig(self): - local_config = ConfigurationLineDefinition(keyword=KeywordDefinition("LOCAL_CONFIG"), - arguments=[StringArgument(rest_of_line=True,allow_space=True)], - documentation_link="keywords/local_config", - required=False, - group=self.group) - return local_config - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/ert_keywords.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/ert_keywords.py deleted file mode 100644 index 572604add8..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/ert_keywords.py +++ /dev/null @@ -1,73 +0,0 @@ -from ert_gui.ide.keywords.advanced_keywords import AdvancedKeywords -from ert_gui.ide.keywords.analysis_module_keywords import AnalysisModuleKeywords -from ert_gui.ide.keywords.definitions import ConfigurationLineDefinition -from ert_gui.ide.keywords.eclipse_keywords import EclipseKeywords -from ert_gui.ide.keywords.enkf_control_keywords import EnkfControlKeywords -from ert_gui.ide.keywords.ensemble_keywords import EnsembleKeywords -from ert_gui.ide.keywords.parametrization_keywords import ParametrizationKeywords -from ert_gui.ide.keywords.plot_keywords import PlotKeywords -from ert_gui.ide.keywords.qc_keywords import QCKeywords -from ert_gui.ide.keywords.queue_system_keywords import QueueSystemKeywords -from ert_gui.ide.keywords.run_keywords import RunKeywords -from ert_gui.ide.keywords.simulation_control_keywords import SimulationControlKeywords -from ert_gui.ide.keywords.unix_environment_keywords import UnixEnvironmentKeywords -from ert_gui.ide.keywords.workflow_keywords import WorkflowKeywords - - -class ErtKeywords(object): - def __init__(self): - super(ErtKeywords, self).__init__() - - self.keywords = {} - self.groups = {} - - EnsembleKeywords(self) - RunKeywords(self) - EclipseKeywords(self) - QueueSystemKeywords(self) - SimulationControlKeywords(self) - ParametrizationKeywords(self) - EnkfControlKeywords(self) - AnalysisModuleKeywords(self) - PlotKeywords(self) - WorkflowKeywords(self) - AdvancedKeywords(self) - QCKeywords(self) - UnixEnvironmentKeywords(self) - - - # group_names = sorted(self.groups.keys()) - # - # for group in group_names: - # print(group) - # keywords = self.groups[group] - # for keyword in keywords: - # print(" %s" % keyword.keywordDefinition().name()) - - - - - - def addKeyword(self, keyword): - assert isinstance(keyword, ConfigurationLineDefinition) - - name = keyword.keywordDefinition().name() - if name in self.keywords: - raise ValueError("Keyword %s already in Ert keyword list!" % name) - - self.keywords[name] = keyword - - group = keyword.group() - - if not group in self.groups: - self.groups[group] = [] - - self.groups[group].append(keyword) - - def __contains__(self, item): - return item in self.keywords - - def __getitem__(self, item): - """ @rtype: ConfigurationLineDefinition """ - return self.keywords[item] - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/parametrization_keywords.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/parametrization_keywords.py deleted file mode 100644 index baac76ee3c..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/parametrization_keywords.py +++ /dev/null @@ -1,128 +0,0 @@ -from ert_gui.ide.keywords.definitions import IntegerArgument, KeywordDefinition, ConfigurationLineDefinition, PathArgument, StringArgument - - -class ParametrizationKeywords(object): - def __init__(self, ert_keywords): - super(ParametrizationKeywords, self).__init__() - self.group = "Parametrization" - - ert_keywords.addKeyword(self.addField()) - ert_keywords.addKeyword(self.addGenData()) - ert_keywords.addKeyword(self.addGenKw()) - ert_keywords.addKeyword(self.addSummary()) - ert_keywords.addKeyword(self.addGenParam()) - ert_keywords.addKeyword(self.addDBaseType()) - ert_keywords.addKeyword(self.addStoreSeed()) - ert_keywords.addKeyword(self.addLoadSeed()) - ert_keywords.addKeyword(self.addGenKwTagFormat()) - ert_keywords.addKeyword(self.addSurface()) - ert_keywords.addKeyword(self.addGenKwExportFile()) - - - - - def addField(self): - field = ConfigurationLineDefinition(keyword=KeywordDefinition("FIELD"), - arguments=[StringArgument(), - StringArgument(), - StringArgument(rest_of_line=True, allow_space=True)], - documentation_link="keywords/field", - required=False, - group=self.group) - return field - - - - def addGenData(self): - gen_data = ConfigurationLineDefinition(keyword=KeywordDefinition("GEN_DATA"), - arguments=[StringArgument(), - StringArgument(), - StringArgument(rest_of_line=True, allow_space=True)], - documentation_link="keywords/gen_data", - required=False, - group=self.group) - return gen_data - - - def addGenKw(self): - gen_kw = ConfigurationLineDefinition(keyword=KeywordDefinition("GEN_KW"), - arguments=[StringArgument(), - StringArgument(), - StringArgument(rest_of_line=True,allow_space=True)], - documentation_link="keywords/gen_kw", - required=False, - group=self.group) - return gen_kw - - - def addGenKwExportFile(self): - gen_kw_export_file = ConfigurationLineDefinition(keyword=KeywordDefinition("GEN_KW_EXPORT_FILE"), - arguments=[StringArgument()], - documentation_link="keywords/gen_kw_export_file", - required=False, - group=self.group) - return gen_kw_export_file - - - def addGenKwTagFormat(self): - gen_kw_tag_format = ConfigurationLineDefinition(keyword=KeywordDefinition("GEN_KW_TAG_FORMAT"), - arguments=[StringArgument(built_in=True,allow_space=True)], - documentation_link="keywords/gen_kw_tag_format", - required=False, - group=self.group) - return gen_kw_tag_format - - - def addGenParam(self): - gen_param = ConfigurationLineDefinition(keyword=KeywordDefinition("GEN_PARAM"), - arguments=[StringArgument(), - StringArgument(), - StringArgument(built_in=True,allow_space=True)], - documentation_link="keywords/gen_param", - required=False, - group=self.group) - return gen_param - - - def addSummary(self): - summary = ConfigurationLineDefinition(keyword=KeywordDefinition("SUMMARY"), - arguments=[StringArgument(rest_of_line=True,allow_space=True)], - documentation_link="keywords/summary", - required=False, - group=self.group) - return summary - - def addDBaseType(self): - dbase_type = ConfigurationLineDefinition(keyword=KeywordDefinition("DBASE_TYPE"), - arguments=[StringArgument()], - documentation_link="keywords/dbase_type", - required=False, - group=self.group) - return dbase_type - - - def addStoreSeed(self): - store_seed = ConfigurationLineDefinition(keyword=KeywordDefinition("STORE_SEED"), - arguments=[StringArgument(built_in=True)], - documentation_link="keywords/store_seed", - required=False, - group=self.group) - return store_seed - - - def addLoadSeed(self): - load_seed = ConfigurationLineDefinition(keyword=KeywordDefinition("LOAD_SEED"), - arguments=[StringArgument(built_in=True)], - documentation_link="keywords/load_seed", - required=False, - group=self.group) - return load_seed - - - def addSurface(self): - surface = ConfigurationLineDefinition(keyword=KeywordDefinition("SURFACE"), - arguments=[StringArgument(rest_of_line=True,allow_space=True)], - documentation_link="keywords/surface", - required=False, - group=self.group) - return surface \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/plot_keywords.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/plot_keywords.py deleted file mode 100644 index b4a70291db..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/plot_keywords.py +++ /dev/null @@ -1,135 +0,0 @@ -from ert_gui.ide.keywords.definitions import IntegerArgument, KeywordDefinition, ConfigurationLineDefinition, PathArgument, StringArgument, BoolArgument - - -class PlotKeywords(object): - def __init__(self, ert_keywords): - super(PlotKeywords, self).__init__() - self.group = "Plot" - - ert_keywords.addKeyword(self.addImageViewer()) - ert_keywords.addKeyword(self.addImageType()) - ert_keywords.addKeyword(self.addPlotDriver()) - ert_keywords.addKeyword(self.addPlotErrorbar()) - ert_keywords.addKeyword(self.addPlotErrorbarMax()) - ert_keywords.addKeyword(self.addPlotWidth()) - ert_keywords.addKeyword(self.addPlotHeight()) - ert_keywords.addKeyword(self.addPlotRefcase()) - ert_keywords.addKeyword(self.addPlotRefcaseList()) - ert_keywords.addKeyword(self.addPlotPath()) - ert_keywords.addKeyword(self.addRftConfig()) - ert_keywords.addKeyword(self.addRftPath()) - - - - def addImageViewer(self): - image_viewer = ConfigurationLineDefinition(keyword=KeywordDefinition("IMAGE_VIEWER"), - arguments=[PathArgument()], - documentation_link="keywords/image_viewer", - required=False, - group=self.group) - return image_viewer - - - def addImageType(self): - image_type = ConfigurationLineDefinition(keyword=KeywordDefinition("IMAGE_TYPE"), - arguments=[StringArgument(built_in=True)], - documentation_link="keywords/image_type", - required=False, - group=self.group) - return image_type - - - def addPlotDriver(self): - plot_driver = ConfigurationLineDefinition(keyword=KeywordDefinition("PLOT_DRIVER"), - arguments=[StringArgument(built_in=True)], - documentation_link="keywords/plot_driver", - required=False, - group=self.group) - return plot_driver - - - def addPlotErrorbar(self): - plot_errorbar = ConfigurationLineDefinition(keyword=KeywordDefinition("PLOT_ERRORBAR"), - arguments=[BoolArgument()], - documentation_link="keywords/plot_errorbar", - required=False, - group=self.group) - return plot_errorbar - - - - def addPlotErrorbarMax(self): - plot_errorbar_max = ConfigurationLineDefinition(keyword=KeywordDefinition("PLOT_ERRORBAR_MAX"), - arguments=[IntegerArgument()], - documentation_link="keywords/plot_errorbar_max", - required=False, - group=self.group) - return plot_errorbar_max - - - - def addPlotWidth(self): - plot_width = ConfigurationLineDefinition(keyword=KeywordDefinition("PLOT_WIDTH"), - arguments=[IntegerArgument()], - documentation_link="keywords/plot_width", - required=False, - group=self.group) - return plot_width - - - def addPlotHeight(self): - plot_height = ConfigurationLineDefinition(keyword=KeywordDefinition("PLOT_HEIGHT"), - arguments=[IntegerArgument()], - documentation_link="keywords/plot_height", - required=False, - group=self.group) - return plot_height - - - - def addPlotRefcase(self): - plot_refcase = ConfigurationLineDefinition(keyword=KeywordDefinition("PLOT_REFCASE"), - arguments=[BoolArgument()], - documentation_link="keywords/plot_refcase", - required=False, - group=self.group) - return plot_refcase - - - - def addPlotRefcaseList(self): - plot_refcase_list = ConfigurationLineDefinition(keyword=KeywordDefinition("PLOT_REFCASE_LIST"), - arguments=[StringArgument(rest_of_line=True,allow_space=True)], - documentation_link="keywords/plot_refcase_list", - required=False, - group=self.group) - return plot_refcase_list - - - def addPlotPath(self): - plot_path = ConfigurationLineDefinition(keyword=KeywordDefinition("PLOT_PATH"), - arguments=[PathArgument(must_exist=False)], - documentation_link="keywords/plot_path", - required=False, - group=self.group) - return plot_path - - - - def addRftConfig(self): - rft_config = ConfigurationLineDefinition(keyword=KeywordDefinition("RFT_CONFIG"), - arguments=[PathArgument()], - documentation_link="keywords/rft_config", - required=False, - group=self.group) - return rft_config - - - def addRftPath(self): - rft_path = ConfigurationLineDefinition(keyword=KeywordDefinition("RFTPATH"), - arguments=[PathArgument()], - documentation_link="keywords/rftpath", - required=False, - group=self.group) - return rft_path - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/qc_keywords.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/qc_keywords.py deleted file mode 100644 index 8838c35185..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/qc_keywords.py +++ /dev/null @@ -1,31 +0,0 @@ -from ert_gui.ide.keywords.definitions import IntegerArgument, KeywordDefinition, ConfigurationLineDefinition, PathArgument, StringArgument - - -class QCKeywords(object): - def __init__(self, ert_keywords): - super(QCKeywords, self).__init__() - self.group = "Quality Check" - - ert_keywords.addKeyword(self.addQCWorkflow()) - ert_keywords.addKeyword(self.addQCPath()) - - - - - def addQCWorkflow(self): - qc_workflow = ConfigurationLineDefinition(keyword=KeywordDefinition("QC_WORKFLOW"), - arguments=[StringArgument()], - documentation_link="keywords/qc_workflow", - required=False, - group=self.group) - return qc_workflow - - - - def addQCPath(self): - qc_path = ConfigurationLineDefinition(keyword=KeywordDefinition("QC_PATH"), - arguments=[PathArgument()], - documentation_link="keywords/qc_path", - required=False, - group=self.group) - return qc_path \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/queue_system_keywords.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/queue_system_keywords.py deleted file mode 100644 index 7158b12127..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/queue_system_keywords.py +++ /dev/null @@ -1,128 +0,0 @@ -from ert_gui.ide.keywords.definitions import StringArgument, KeywordDefinition, IntegerArgument, PathArgument -from ert_gui.ide.keywords.definitions.configuration_line_definition import ConfigurationLineDefinition - - -class QueueSystemKeywords(object): - - - def __init__(self, ert_keywords): - super(QueueSystemKeywords, self).__init__() - self.group = "Queue System" - - ert_keywords.addKeyword(self.addQueueOption()) - ert_keywords.addKeyword(self.addQueueSystem()) - ert_keywords.addKeyword(self.addLsfServer()) - ert_keywords.addKeyword(self.addLsfQueue()) - ert_keywords.addKeyword(self.addMaxRunningLsf()) - ert_keywords.addKeyword(self.addTorqueQueue()) - ert_keywords.addKeyword(self.addMaxRunningLocal()) - ert_keywords.addKeyword(self.addRshHost()) - ert_keywords.addKeyword(self.addRshCommand()) - ert_keywords.addKeyword(self.addMaxRunningRsh()) - ert_keywords.addKeyword(self.addHostType()) - ert_keywords.addKeyword(self.addLsfResources()) - - - - def addQueueOption(self): - queue_option = ConfigurationLineDefinition(keyword = KeywordDefinition("QUEUE_OPTION"), - arguments=[ - StringArgument(built_in=True), - StringArgument(built_in=True), - StringArgument(allow_space=True, rest_of_line=True) - ], - documentation_link="keywords/queue_option", - group=self.group) - - return queue_option - - - - def addQueueSystem(self): - queue_system = ConfigurationLineDefinition(keyword = KeywordDefinition("QUEUE_SYSTEM"), - arguments=[StringArgument(built_in=True)], - documentation_link="keywords/queue_system", - group=self.group) - return queue_system - - - def addLsfServer(self): - lsf_server = ConfigurationLineDefinition(keyword = KeywordDefinition("LSF_SERVER"), - arguments=[StringArgument(built_in=True)], - documentation_link="keywords/lsf_server", - group=self.group) - return lsf_server - - - - def addLsfQueue(self): - lsf_queue = ConfigurationLineDefinition(keyword = KeywordDefinition("LSF_QUEUE"), - arguments=[StringArgument()], - documentation_link="keywords/lsf_queue", - group=self.group) - return lsf_queue - - - def addMaxRunningLsf(self): - max_running_lsf = ConfigurationLineDefinition(keyword = KeywordDefinition("MAX_RUNNING_LSF"), - arguments=[IntegerArgument(from_value=1)], - documentation_link="keywords/max_running_lsf", - group=self.group) - return max_running_lsf - - - def addLsfResources(self): - lsf_resources = ConfigurationLineDefinition(keyword = KeywordDefinition("LSF_RESOURCES"), - arguments=[StringArgument(rest_of_line=True,allow_space=True)], - documentation_link="keywords/lsf_resources", - group=self.group) - return lsf_resources - - - def addTorqueQueue(self): - torque_queue = ConfigurationLineDefinition(keyword = KeywordDefinition("TORQUE_QUEUE"), - arguments=[StringArgument()], - documentation_link="keywords/torque_queue", - group=self.group) - return torque_queue - - - def addMaxRunningLocal(self): - max_running_local = ConfigurationLineDefinition(keyword = KeywordDefinition("MAX_RUNNING_LOCAL"), - arguments=[IntegerArgument(from_value=1)], - documentation_link="keywords/max_running_local", - group=self.group) - return max_running_local - - - def addRshHost(self): - rsh_host = ConfigurationLineDefinition(keyword = KeywordDefinition("RSH_HOST"), - arguments=[StringArgument(), StringArgument(rest_of_line=True, allow_space=True)], - documentation_link="keywords/rsh_host", - group=self.group) - return rsh_host - - - def addRshCommand(self): - rsh_command = ConfigurationLineDefinition(keyword = KeywordDefinition("RSH_COMMAND"), - arguments=[PathArgument()], - documentation_link="keywords/rsh_command", - group=self.group) - return rsh_command - - - def addMaxRunningRsh(self): - max_running_rsh = ConfigurationLineDefinition(keyword = KeywordDefinition("MAX_RUNNING_RSH"), - arguments=[IntegerArgument()], - documentation_link="keywords/max_running_rsh", - group=self.group) - return max_running_rsh - - - - def addHostType(self): - host_type = ConfigurationLineDefinition(keyword = KeywordDefinition("HOST_TYPE"), - arguments=[StringArgument(rest_of_line=True, allow_space=True)], - documentation_link="keywords/host_type", - group=self.group) - return host_type diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/run_keywords.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/run_keywords.py deleted file mode 100644 index 7043da7eb6..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/run_keywords.py +++ /dev/null @@ -1,144 +0,0 @@ -from ert_gui.ide.keywords.definitions import IntegerArgument, KeywordDefinition, ConfigurationLineDefinition, PathArgument, StringArgument, BoolArgument - - -class RunKeywords(object): - def __init__(self, ert_keywords): - super(RunKeywords, self).__init__() - self.group = "Run" - - ert_keywords.addKeyword(self.addDeleteRunpath()) - ert_keywords.addKeyword(self.addKeepRunpath()) - ert_keywords.addKeyword(self.addInstallJob()) - ert_keywords.addKeyword(self.addRunpath()) - ert_keywords.addKeyword(self.addRunpathFile()) - ert_keywords.addKeyword(self.addForwardModel()) - ert_keywords.addKeyword(self.addJobScript()) - ert_keywords.addKeyword(self.addRunTemplate()) - ert_keywords.addKeyword(self.addLogLevel()) - ert_keywords.addKeyword(self.addLogFile()) - ert_keywords.addKeyword(self.addMaxSubmit()) - ert_keywords.addKeyword(self.addMaxResample()) - ert_keywords.addKeyword(self.addPreClearRunpath()) - - - - - - def addInstallJob(self): - install_job = ConfigurationLineDefinition(keyword=KeywordDefinition("INSTALL_JOB"), - arguments=[StringArgument(),PathArgument()], - documentation_link="keywords/install_job", - required=False, - group=self.group) - return install_job - - - - def addDeleteRunpath(self): - delete_runpath = ConfigurationLineDefinition(keyword=KeywordDefinition("DELETE_RUNPATH"), - arguments=[StringArgument()], - documentation_link="keywords/delete_runpath", - required=False, - group=self.group) - return delete_runpath - - - def addKeepRunpath(self): - keep_runpath = ConfigurationLineDefinition(keyword=KeywordDefinition("KEEP_RUNPATH"), - arguments=[StringArgument()], - documentation_link="keywords/keep_runpath", - required=False, - group=self.group) - return keep_runpath - - - - - - def addRunpath(self): - runpath = ConfigurationLineDefinition(keyword=KeywordDefinition("RUNPATH"), - arguments=[PathArgument(must_exist=False)], - documentation_link="keywords/runpath", - required=False, - group=self.group) - return runpath - - - - def addRunpathFile(self): - runpath_file = ConfigurationLineDefinition(keyword=KeywordDefinition("RUNPATH_FILE"), - arguments=[PathArgument()], - documentation_link="keywords/runpath_file", - required=False, - group=self.group) - return runpath_file - - - def addForwardModel(self): - forward_model = ConfigurationLineDefinition(keyword=KeywordDefinition("FORWARD_MODEL"), - arguments=[StringArgument(rest_of_line=True, allow_space=True)], - documentation_link="keywords/forward_model", - required=False, - group=self.group) - return forward_model - - def addJobScript(self): - job_script = ConfigurationLineDefinition(keyword=KeywordDefinition("JOB_SCRIPT"), - arguments=[PathArgument()], - documentation_link="keywords/job_script", - required=False, - group=self.group) - return job_script - - def addRunTemplate(self): - run_template = ConfigurationLineDefinition(keyword=KeywordDefinition("RUN_TEMPLATE"), - arguments=[PathArgument(),StringArgument()], - documentation_link="keywords/run_template", - required=False, - group=self.group) - return run_template - - - def addLogLevel(self): - log_level = ConfigurationLineDefinition(keyword=KeywordDefinition("LOG_LEVEL"), - arguments=[IntegerArgument()], - documentation_link="keywords/log_level", - required=False, - group=self.group) - return log_level - - - def addLogFile(self): - log_file = ConfigurationLineDefinition(keyword=KeywordDefinition("LOG_FILE"), - arguments=[PathArgument()], - documentation_link="keywords/log_file", - required=False, - group=self.group) - return log_file - - - - def addMaxSubmit(self): - max_submit = ConfigurationLineDefinition(keyword = KeywordDefinition("MAX_SUBMIT"), - arguments=[IntegerArgument()], - documentation_link="keywords/max_submit", - group=self.group) - return max_submit - - - def addMaxResample(self): - max_resample = ConfigurationLineDefinition(keyword=KeywordDefinition("MAX_RESAMPLE"), - arguments=[IntegerArgument()], - documentation_link="keywords/max_resample", - required=False, - group=self.group) - return max_resample - - - def addPreClearRunpath(self): - pre_clear_runpath = ConfigurationLineDefinition(keyword=KeywordDefinition("PRE_CLEAR_RUNPATH"), - arguments=[BoolArgument()], - documentation_link="keywords/pre_clear_runpath", - required=False, - group=self.group) - return pre_clear_runpath \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/simulation_control_keywords.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/simulation_control_keywords.py deleted file mode 100644 index 35fb78a419..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/simulation_control_keywords.py +++ /dev/null @@ -1,43 +0,0 @@ -from ert_gui.ide.keywords.definitions import IntegerArgument, BoolArgument, StringArgument, ConfigurationLineDefinition, KeywordDefinition , PercentArgument - - -class SimulationControlKeywords(object): - def __init__(self, ert_keywords): - super(SimulationControlKeywords, self).__init__() - self.group = "Simulation Control" - - - - ert_keywords.addKeyword(self.addMaxRuntime()) - ert_keywords.addKeyword(self.addMinRealizations()) - ert_keywords.addKeyword(self.addStopLongRunning()) - - - def addMaxRuntime(self): - max_runtime = ConfigurationLineDefinition(keyword=KeywordDefinition("MAX_RUNTIME"), - arguments=[IntegerArgument(from_value=0)], - documentation_link="keywords/max_runtime", - required=False, - group=self.group) - return max_runtime - - - - - def addMinRealizations(self): - min_realizations = ConfigurationLineDefinition(keyword=KeywordDefinition("MIN_REALIZATIONS"), - arguments=[IntegerArgument(from_value = 0) , - PercentArgument(from_value = 0 , to_value = 100)], - documentation_link="keywords/min_realizations", - required=False, - group=self.group) - return min_realizations - - - def addStopLongRunning(self): - stop_long_running = ConfigurationLineDefinition(keyword=KeywordDefinition("STOP_LONG_RUNNING"), - arguments=[BoolArgument()], - documentation_link="keywords/stop_long_running", - required=False, - group=self.group) - return stop_long_running diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/unix_environment_keywords.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/unix_environment_keywords.py deleted file mode 100644 index 835a3b3b55..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/unix_environment_keywords.py +++ /dev/null @@ -1,40 +0,0 @@ -from ert_gui.ide.keywords.definitions import IntegerArgument, KeywordDefinition, ConfigurationLineDefinition, PathArgument, StringArgument, BoolArgument - - -class UnixEnvironmentKeywords(object): - def __init__(self, ert_keywords): - super(UnixEnvironmentKeywords, self).__init__() - self.group = "Unix" - - ert_keywords.addKeyword(self.addSetEnv()) - ert_keywords.addKeyword(self.addUMask()) - ert_keywords.addKeyword(self.addUpdatePath()) - - - - - def addSetEnv(self): - setenv = ConfigurationLineDefinition(keyword=KeywordDefinition("SETENV"), - arguments=[StringArgument(), StringArgument(rest_of_line=True,allow_space=True)], - documentation_link="keywords/setenv", - required=False, - group=self.group) - return setenv - - - def addUMask(self): - umask = ConfigurationLineDefinition(keyword=KeywordDefinition("UMASK"), - arguments=[IntegerArgument()], - documentation_link="keywords/umask", - required=False, - group=self.group) - return umask - - - def addUpdatePath(self): - update_path = ConfigurationLineDefinition(keyword=KeywordDefinition("UPDATE_PATH"), - arguments=[StringArgument(built_in=True), PathArgument()], - documentation_link="keywords/update_path", - required=False, - group=self.group) - return update_path diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/workflow_keywords.py b/ThirdParty/Ert/python/python/ert_gui/ide/keywords/workflow_keywords.py deleted file mode 100644 index 0566d20a5f..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/keywords/workflow_keywords.py +++ /dev/null @@ -1,115 +0,0 @@ -from ert_gui.ide.keywords.definitions import IntegerArgument, KeywordDefinition, ConfigurationLineDefinition, PathArgument, StringArgument, BoolArgument - - -class WorkflowKeywords(object): - def __init__(self, ert_keywords): - super(WorkflowKeywords, self).__init__() - self.group = "Workflow Jobs" - - ert_keywords.addKeyword(self.addLoadWorkflowJob()) - ert_keywords.addKeyword(self.addWorkflowJobDirectory()) - ert_keywords.addKeyword(self.addLoadWorkflow()) - ert_keywords.addKeyword(self.addInternal()) - ert_keywords.addKeyword(self.addFunction()) - ert_keywords.addKeyword(self.addModule()) - ert_keywords.addKeyword(self.addExecutable()) - ert_keywords.addKeyword(self.addMinArg()) - ert_keywords.addKeyword(self.addMaxArg()) - ert_keywords.addKeyword(self.addArgType()) - - - - def addInternal(self): - internal = ConfigurationLineDefinition(keyword=KeywordDefinition("INTERNAL"), - arguments=[BoolArgument()], - documentation_link="keywords/internal", - required=False, - group=self.group) - return internal - - - def addFunction(self): - function = ConfigurationLineDefinition(keyword=KeywordDefinition("FUNCTION"), - arguments=[StringArgument()], - documentation_link="keywords/function", - required=False, - group=self.group) - return function - - - def addModule(self): - module = ConfigurationLineDefinition(keyword=KeywordDefinition("MODULE"), - arguments=[PathArgument()], - documentation_link="keywords/module", - required=False, - group=self.group) - return module - - - def addExecutable(self): - executable = ConfigurationLineDefinition(keyword=KeywordDefinition("EXECUTABLE"), - arguments=[PathArgument()], - documentation_link="keywords/executable", - required=False, - group=self.group) - return executable - - - - - def addMinArg(self): - min_arg = ConfigurationLineDefinition(keyword=KeywordDefinition("MIN_ARG"), - arguments=[IntegerArgument()], - documentation_link="keywords/min_arg", - required=False, - group=self.group) - return min_arg - - - - - def addMaxArg(self): - max_arg = ConfigurationLineDefinition(keyword=KeywordDefinition("MAX_ARG"), - arguments=[IntegerArgument()], - documentation_link="keywords/max_arg", - required=False, - group=self.group) - return max_arg - - - - def addArgType(self): - arg_type = ConfigurationLineDefinition(keyword=KeywordDefinition("ARG_TYPE"), - arguments=[StringArgument(built_in=True)], - documentation_link="keywords/arg_type", - required=False, - group=self.group) - return arg_type - - - def addLoadWorkflowJob(self): - load_workflow_job = ConfigurationLineDefinition(keyword=KeywordDefinition("LOAD_WORKFLOW_JOB"), - arguments=[StringArgument()], - documentation_link="keywords/load_workflow_job", - required=False, - group=self.group) - return load_workflow_job - - - - def addWorkflowJobDirectory(self): - workflow_job_directory = ConfigurationLineDefinition(keyword=KeywordDefinition("WORKFLOW_JOB_DIRECTORY"), - arguments=[PathArgument()], - documentation_link="keywords/workflow_job_directory", - required=False, - group=self.group) - return workflow_job_directory - - - def addLoadWorkflow(self): - load_workflow = ConfigurationLineDefinition(keyword=KeywordDefinition("LOAD_WORKFLOW"), - arguments=[PathArgument(), StringArgument(optional=True)], - documentation_link="keywords/load_workflow", - required=False, - group=self.group) - return load_workflow \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/parameter.py b/ThirdParty/Ert/python/python/ert_gui/ide/parameter.py deleted file mode 100644 index b7a0371ee3..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/parameter.py +++ /dev/null @@ -1,19 +0,0 @@ -class Parameter(object): - def __init__(self, value, start, end): - super(Parameter, self).__init__() - #: :type: str - self.value = value - #: :type: int - self.start = start - #: :type: int - self.end = end - - #: :type: bool - self.error = False - #: :type: str - self.error_message = "" - - @property - def length(self): - """ @rtype: int """ - return self.end - self.start \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/wizards/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/ide/wizards/CMakeLists.txt deleted file mode 100644 index c2450868b9..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/wizards/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - tree_item.py - tree_model.py - wizard_view.py -) - -add_python_package("python.ert_gui.ide.wizards" ${PYTHON_INSTALL_PREFIX}/ert_gui/ide/wizards "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/wizards/__init__.py b/ThirdParty/Ert/python/python/ert_gui/ide/wizards/__init__.py deleted file mode 100644 index e8b9ef3cce..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/wizards/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .tree_item import TreeItem -from .tree_model import TreeModel -from .wizard_view import WizardView \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/wizards/tree_item.py b/ThirdParty/Ert/python/python/ert_gui/ide/wizards/tree_item.py deleted file mode 100644 index e7793dd842..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/wizards/tree_item.py +++ /dev/null @@ -1,38 +0,0 @@ -class TreeItem(object): - def __init__(self, name, data=None): - super(TreeItem, self).__init__() - self.__name = name - self.__parent = None - - self.__children = [] - self.__data = data - - def child(self, row): - return self.__children[row] - - def __len__(self): - return len(self.__children) - - def data(self): - return self.__data - - def name(self): - return self.__name - - def addChild(self, child): - assert isinstance(child, TreeItem) - child.setParent(self) - self.__children.append(child) - return child - - def parent(self): - return self.__parent - - def setParent(self, parent): - self.__parent = parent - - def row(self): - if self.__parent is not None: - return self.__parent.__children.index(self) - - return 0 \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/wizards/tree_model.py b/ThirdParty/Ert/python/python/ert_gui/ide/wizards/tree_model.py deleted file mode 100644 index 1cef6708b7..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/wizards/tree_model.py +++ /dev/null @@ -1,97 +0,0 @@ -from PyQt4.QtCore import QAbstractItemModel, QModelIndex, QVariant, Qt -from ert_gui.ide.wizards import TreeItem - - -class TreeModel(QAbstractItemModel): - - def __init__(self, tree_root, parent=None): - QAbstractItemModel.__init__(self, parent) - - self.__root = tree_root - - def data(self, q_model_index, role=Qt.DisplayRole): - - item = self.item(q_model_index) - - if item is not None: - if role == Qt.DisplayRole: - return item.name() - - return QVariant() - - def item(self, q_model_index): - if not q_model_index.isValid(): - return None - - return q_model_index.internalPointer() - - - def flags(self, q_model_index): - if not q_model_index.isValid(): - return 0 - - item = self.item(q_model_index) - - if item.data() is None: - return Qt.ItemIsEnabled - else: - return Qt.ItemIsEnabled | Qt.ItemIsSelectable - - - def headerData(self, section, orientation, role=Qt.DisplayRole): - if orientation == Qt.Horizontal and role == Qt.DisplayRole: - return self.__root.name() - - return QVariant() - - - def index(self, row, column, parent=None): - if parent is None: - parent = QModelIndex() - - if not self.hasIndex(row, column, parent): - return QModelIndex() - - if not parent.isValid(): - parent_item = self.__root - else: - parent_item = parent.internalPointer() - - child_item = parent_item.child(row) - - return self.createIndex(row, column, child_item) - - - def parent(self, q_model_index): - if not q_model_index.isValid(): - return QModelIndex() - - child_item = q_model_index.internalPointer() - parent_item = child_item.parent() - - if parent_item == self.__root: - return QModelIndex() - - return self.createIndex(parent_item.row(), 0, parent_item) - - def rowCount(self, parent): - if parent is None: - parent = QModelIndex() - - if parent.column() > 0: - return 0 - - if not parent.isValid(): - return len(self.__root) - else: - return len(parent.internalPointer()) - - - - def columnCount(self, parent): - return 1 - - - def emitChange(self): - self.modelReset.emit() - diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/wizards/wizard_view.py b/ThirdParty/Ert/python/python/ert_gui/ide/wizards/wizard_view.py deleted file mode 100644 index b5ce7fe05e..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/ide/wizards/wizard_view.py +++ /dev/null @@ -1,42 +0,0 @@ -from PyQt4.QtGui import QTreeView -from ert_gui.ide.wizards import TreeItem -from ert_gui.ide.wizards.tree_model import TreeModel - - -class WizardView(QTreeView): - def __init__(self, parent=None): - QTreeView.__init__(self, parent) - - self.__root = TreeItem("ERT") - - self.__tree_model = TreeModel(self.__root) - - self.setModel(self.__tree_model) - - #: :type: dict of (str, TreeItem) - self.__groups = {} - - self.header().hide() - - - def addGroup(self, group_name): - if group_name in self.__groups: - raise ValueError("A group with name: %s already exists!" % group_name) - - group = TreeItem(group_name) - - self.__groups[group_name] = group - self.__root.addChild(group) - - self.__tree_model.emitChange() - - - def addItemToGroup(self, group, item): - group_item = self.__groups[group] - - child_item = TreeItem(item) - group_item.addChild(child_item) - - self.__tree_model.emitChange() - - diff --git a/ThirdParty/Ert/python/python/ert_gui/main_window.py b/ThirdParty/Ert/python/python/ert_gui/main_window.py deleted file mode 100644 index ccecd82500..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/main_window.py +++ /dev/null @@ -1,128 +0,0 @@ -from PyQt4.QtCore import QSettings, Qt -from PyQt4.QtGui import QMainWindow, qApp, QWidget, QVBoxLayout, QDockWidget, QAction, QToolButton -from ert_gui.about_dialog import AboutDialog - - -class GertMainWindow(QMainWindow): - def __init__(self): - QMainWindow.__init__(self) - - self.tools = {} - - self.resize(300, 700) - self.setWindowTitle('ERT') - - self.__main_widget = None - - self.central_widget = QWidget() - self.central_layout = QVBoxLayout() - self.central_widget.setLayout(self.central_layout) - - self.setCentralWidget(self.central_widget) - - self.toolbar = self.addToolBar("Tools") - self.toolbar.setObjectName("Toolbar") - self.toolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) - - self.setCorner(Qt.TopLeftCorner, Qt.LeftDockWidgetArea) - self.setCorner(Qt.BottomLeftCorner, Qt.BottomDockWidgetArea) - - self.setCorner(Qt.TopRightCorner, Qt.RightDockWidgetArea) - self.setCorner(Qt.BottomRightCorner, Qt.BottomDockWidgetArea) - self.__view_menu = None - self.__help_menu = None - - self.__createMenu() - self.__fetchSettings() - - def addDock(self, name, widget, area=Qt.RightDockWidgetArea, allowed_areas=Qt.AllDockWidgetAreas): - dock_widget = QDockWidget(name) - dock_widget.setObjectName("%sDock" % name) - dock_widget.setWidget(widget) - dock_widget.setAllowedAreas(allowed_areas) - - self.addDockWidget(area, dock_widget) - - self.__view_menu.addAction(dock_widget.toggleViewAction()) - return dock_widget - - def addTool(self, tool): - tool.setParent(self) - self.tools[tool.getName()] = tool - self.toolbar.addAction(tool.getAction()) - - if tool.isPopupMenu(): - tool_button = self.toolbar.widgetForAction(tool.getAction()) - tool_button.setPopupMode(QToolButton.InstantPopup) - - - def __createMenu(self): - file_menu = self.menuBar().addMenu("&File") - file_menu.addAction("Close", self.__quit) - self.__view_menu = self.menuBar().addMenu("&View") - self.__help_menu = self.menuBar().addMenu("&Help") - """:type: QMenu""" - - """ @rtype: list of QAction """ - advanced_toggle_action = QAction("Show Advanced Options", self) - advanced_toggle_action.setObjectName("AdvancedSimulationOptions") - advanced_toggle_action.setCheckable(True) - advanced_toggle_action.setChecked(False) - advanced_toggle_action.toggled.connect(self.toggleAdvancedMode) - - self.__view_menu.addAction(advanced_toggle_action) - - """ @rtype: list of QAction """ - show_about = self.__help_menu.addAction("About") - show_about.setMenuRole(QAction.ApplicationSpecificRole) - show_about.triggered.connect(self.__showAboutMessage) - - - def __quit(self): - self.__saveSettings() - qApp.quit() - - - def __saveSettings(self): - settings = QSettings("Statoil", "Ert-Gui") - settings.setValue("geometry", self.saveGeometry()) - settings.setValue("windowState", self.saveState()) - - - def closeEvent(self, event): - #Use QT settings saving mechanism - #settings stored in ~/.config/Statoil/ErtGui.conf - self.__saveSettings() - QMainWindow.closeEvent(self, event) - - - def __fetchSettings(self): - settings = QSettings("Statoil", "Ert-Gui") - self.restoreGeometry(settings.value("geometry").toByteArray()) - self.restoreState(settings.value("windowState").toByteArray()) - - def toggleAdvancedMode(self, advanced_mode): - if hasattr(self.__main_widget, "toggleAdvancedMode"): - self.__main_widget.toggleAdvancedMode(advanced_mode) - - for tool in self.tools.values(): - if hasattr(tool, "toggleAdvancedMode"): - tool.toggleAdvancedMode(advanced_mode) - - - def setWidget(self, widget): - self.__main_widget = widget - actions = widget.getActions() - for action in actions: - self.__view_menu.addAction(action) - - self.central_layout.addWidget(widget) - - def __showAboutMessage(self): - diag = AboutDialog(self) - diag.show() - pass - - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/newconfig.py b/ThirdParty/Ert/python/python/ert_gui/newconfig.py deleted file mode 100644 index 419df4f53c..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/newconfig.py +++ /dev/null @@ -1,107 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'newconfig.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - - -import os - -from PyQt4.QtCore import Qt, SIGNAL, QSize -from PyQt4.QtGui import QDialog, QFormLayout, QLabel, QDialogButtonBox, QComboBox, QSpinBox, QLineEdit, QWidget - - -def createSpace(size=5): - """Creates a widget that can be used as spacing on a panel.""" - qw = QWidget() - qw.setMinimumSize(QSize(size, size)) - - return qw - - -class NewConfigurationDialog(QDialog): - """A dialog for selecting defaults for a new configuration.""" - - def __init__(self, configuration_path, parent=None): - QDialog.__init__(self, parent) - - self.setModal(True) - self.setWindowTitle("New configuration file") - self.setMinimumWidth(250) - self.setMinimumHeight(150) - - layout = QFormLayout() - - directory, filename = os.path.split(configuration_path) - - if directory.strip() == "": - directory = os.path.abspath(os.curdir) - self.configuration_path = "%s/%s" % (directory, filename) - else: - self.configuration_path = configuration_path - - configuration_location = QLabel() - configuration_location.setText(directory) - - configuration_name = QLabel() - configuration_name.setText(filename) - - self.db_type = QComboBox() - self.db_type.addItem("BLOCK_FS") - self.db_type.addItem("PLAIN") - - self.num_realizations = QSpinBox() - self.num_realizations.setMinimum(1) - self.num_realizations.setMaximum(1000) - self.num_realizations.setValue(10) - - self.storage_path = QLineEdit() - self.storage_path.setText("Storage") - self.connect(self.storage_path, SIGNAL('textChanged(QString)'), self._validateName) - - layout.addRow(createSpace(10)) - layout.addRow("Configuration name:", configuration_name) - layout.addRow("Configuration location:", configuration_location) - layout.addRow("Path to store DBase:", self.storage_path) - layout.addRow("DBase type:", self.db_type) - layout.addRow("Number of realizations", self.num_realizations) - layout.addRow(createSpace(10)) - - buttons = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel, Qt.Horizontal, self) - self.ok_button = buttons.button(QDialogButtonBox.Ok) - - layout.addRow(buttons) - - self.connect(buttons, SIGNAL('accepted()'), self.accept) - self.connect(buttons, SIGNAL('rejected()'), self.reject) - - self.setLayout(layout) - - def getNumberOfRealizations(self): - return self.num_realizations.value() - - def getConfigurationPath(self): - return self.configuration_path - - def getDBaseType(self): - """Return the DBase type""" - return str(self.db_type.currentText()) - - def getStoragePath(self): - """Return the DBase storage path""" - return str(self.storage_path.text()).strip() - - def _validateName(self, name): - name = str(name) - enabled = len(name) > 0 and name.find(" ") == -1 - self.ok_button.setEnabled(enabled) diff --git a/ThirdParty/Ert/python/python/ert_gui/plottery/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/plottery/CMakeLists.txt deleted file mode 100644 index 4a9f42d59c..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/plottery/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - plot_config.py - plot_config_history.py - plot_config_factory.py - plot_context.py - plot_data_gatherer.py - plot_limits.py - plot_style.py -) - -add_python_package("python.ert_gui.plottery" ${PYTHON_INSTALL_PREFIX}/ert_gui/plottery "${PYTHON_SOURCES}" True) - -add_subdirectory(plots) diff --git a/ThirdParty/Ert/python/python/ert_gui/plottery/__init__.py b/ThirdParty/Ert/python/python/ert_gui/plottery/__init__.py deleted file mode 100644 index 30332e1857..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/plottery/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -from .plot_data_gatherer import PlotDataGatherer -from .plot_style import PlotStyle -from .plot_limits import PlotLimits -from .plot_config import PlotConfig -from .plot_context import PlotContext -from .plot_config_history import PlotConfigHistory -from .plot_config_factory import PlotConfigFactory diff --git a/ThirdParty/Ert/python/python/ert_gui/plottery/plot_config.py b/ThirdParty/Ert/python/python/ert_gui/plottery/plot_config.py deleted file mode 100644 index 0ac1a5cbde..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/plottery/plot_config.py +++ /dev/null @@ -1,305 +0,0 @@ -import itertools -from ert_gui.plottery import PlotStyle, PlotLimits - - -class PlotConfig(object): - - # The plot_settings input argument is an internalisation of the (quite few) plot - # policy settings which can be set in the configuration file. - - def __init__(self, plot_settings, title="Unnamed", x_label=None, y_label=None): - self._title = title - self._plot_settings = plot_settings - if self._plot_settings is None: - raise ValueError('PlotConfig needs a non-None plot settings.') - self._line_color_cycle_colors = ["#000000"] - self._line_color_cycle = itertools.cycle(self._line_color_cycle_colors) #Black - # Blueish, Greenlike, Beigeoid, Pinkness, Orangy-Brown - self.setLineColorCycle(["#386CB0", "#7FC97F", "#FDC086", "#F0027F", "#BF5B17"]) - # alternative color cycle: - # ["#e41a1c", "#377eb8", "#4daf4a", "#984ea3", "#ff7f00", "#ffff33", - # "#a65628", "#f781bf" ,"#386CB0", "#7FC97F", "#FDC086", "#F0027F", "#BF5B17"] - - self._legend_items = [] - self._legend_labels = [] - - self._x_label = x_label - self._y_label = y_label - - self._limits = PlotLimits() - - self._default_style = PlotStyle(name="Default", color=None, alpha=0.8) - - self._refcase_style = PlotStyle(name="Refcase", alpha=0.8, line_style="--", marker="", width=2.0, - enabled=self._plot_settings["SHOW_REFCASE"]) - - self._history_style = PlotStyle(name="History", alpha=0.8, marker=".", width=2.0, - enabled=self._plot_settings["SHOW_HISTORY"]) - - self._observs_style = PlotStyle(name="Observations", line_style="-", alpha=0.8, - marker=".", width=1.0, color="#000000") - - self._histogram_style = PlotStyle(name="Histogram", width=2.0) - self._distribution_style = PlotStyle(name="Distribution", line_style="", marker="o", alpha=0.5, size=10.0) - self._distribution_line_style = PlotStyle(name="Distribution Lines", line_style="-", alpha=0.25, width=1.0) - self._distribution_line_style.setEnabled(False) - self._current_color = None - - self._legend_enabled = True - self._grid_enabled = True - - - self._statistics_style = { - "mean": PlotStyle("Mean", line_style=""), - "p50": PlotStyle("P50", line_style=""), - "min-max": PlotStyle("Min/Max", line_style=""), - "p10-p90": PlotStyle("P10-P90", line_style=""), - "p33-p67": PlotStyle("P33-P67", line_style=""), - "std": PlotStyle("Std dev", line_style="") - } - - self._std_dev_factor = 1 # sigma 1 is default std dev - - def currentColor(self): - if self._current_color is None: - self.nextColor() - - return self._current_color - - def nextColor(self): - self._current_color = self._line_color_cycle.next() - return self._current_color - - def setLineColorCycle(self, color_list): - self._line_color_cycle_colors = color_list - self._line_color_cycle = itertools.cycle(color_list) - - def lineColorCycle(self): - return list(self._line_color_cycle_colors) - - def addLegendItem(self, label, item): - self._legend_items.append(item) - self._legend_labels.append(label) - - def title(self): - """ :rtype: str """ - return self._title if self._title is not None else "Unnamed" - - def setTitle(self, title): - self._title = title - - def isUnnamed(self): - return self._title is None - - def defaultStyle(self): - style = PlotStyle("Default Style") - style.copyStyleFrom(self._default_style) - style.color = self.currentColor() - return style - - def observationsColor(self): - return self._observs_style.color - - def observationsStyle(self): - """ @rtype: PlotStyle """ - style = PlotStyle("Observations Style") - style.copyStyleFrom(self._observs_style) - return style - - def refcaseStyle(self): - """ @rtype: PlotStyle """ - style = PlotStyle("Refcase Style") - style.copyStyleFrom(self._refcase_style) - return style - - def historyStyle(self): - """ @rtype: PlotStyle """ - style = PlotStyle("History Style") - style.copyStyleFrom(self._history_style) - return style - - def histogramStyle(self): - """ @rtype: PlotStyle """ - style = PlotStyle("Histogram Style") - style.copyStyleFrom(self._histogram_style) - style.color = self.currentColor() - return style - - def distributionStyle(self): - """ @rtype: PlotStyle """ - style = PlotStyle("Distribution Style") - style.copyStyleFrom(self._distribution_style) - style.color = self.currentColor() - return style - - def distributionLineStyle(self): - """ @rtype: ert_gui.plottery.PlotStyle """ - style = PlotStyle("Distribution Line Style") - style.copyStyleFrom(self._distribution_line_style) - return style - - def xLabel(self): - return self._x_label - - def yLabel(self): - return self._y_label - - def legendItems(self): - return self._legend_items - - def legendLabels(self): - return self._legend_labels - - def setXLabel(self, label): - self._x_label = label - - def setYLabel(self, label): - self._y_label = label - - def setObservationsEnabled(self, enabled): - self._observs_style.setEnabled(enabled) - - def isObservationsEnabled(self): - return self._observs_style.isEnabled() - - def setRefcaseEnabled(self, enabled): - self._refcase_style.setEnabled(enabled) - - def isRefcaseEnabled(self): - return self._refcase_style.isEnabled() - - def setHistoryEnabled(self, enabled): - self._history_style.setEnabled(enabled) - - def isHistoryEnabled(self): - return self._history_style.isEnabled() - - def isLegendEnabled(self): - return self._legend_enabled - - def isDistributionLineEnabled(self): - return self._distribution_line_style.isEnabled() - - def setDistributionLineEnabled(self, enabled): - self._distribution_line_style.setEnabled(enabled) - - def setStandardDeviationFactor(self, value): - self._std_dev_factor = value - - def getStandardDeviationFactor(self): - return self._std_dev_factor - - def setLegendEnabled(self, enabled): - self._legend_enabled = enabled - - def isGridEnabled(self): - return self._grid_enabled - - def setGridEnabled(self, enabled): - self._grid_enabled = enabled - - def setStatisticsStyle(self, statistic, style): - """ - @type statistic: str - @type style: PlotStyle - """ - - statistics_style = self._statistics_style[statistic] - statistics_style.line_style = style.line_style - statistics_style.marker = style.marker - statistics_style.width = style.width - statistics_style.size = style.size - - def getStatisticsStyle(self, statistic): - style = self._statistics_style[statistic] - copy_style = PlotStyle(style.name) - copy_style.copyStyleFrom(style) - copy_style.color = self.currentColor() - return copy_style - - def setRefcaseStyle(self, style): - """ @type style: PlotStyle """ - self._refcase_style.line_style = style.line_style - self._refcase_style.marker = style.marker - self._refcase_style.width = style.width - self._refcase_style.size = style.size - - def setHistoryStyle(self, style): - """ @type style: PlotStyle """ - self._history_style.line_style = style.line_style - self._history_style.marker = style.marker - self._history_style.width = style.width - self._history_style.size = style.size - - def setObservationsColor(self, color): - self._observs_style.color = color - - def setObservationsStyle(self, style): - """ @type style: PlotStyle """ - self._observs_style.line_style = style.line_style - self._observs_style.marker = style.marker - self._observs_style.width = style.width - self._observs_style.size = style.size - - def setDefaultStyle(self, style): - """ @type style: PlotStyle """ - self._default_style.line_style = style.line_style - self._default_style.marker = style.marker - self._default_style.width = style.width - self._default_style.size = style.size - - - @property - def limits(self): - """ @rtype: PlotLimits """ - limits = PlotLimits() - limits.copyLimitsFrom(self._limits) - return limits - - @limits.setter - def limits(self, value): - """ @type value: PlotLimits """ - self._limits.copyLimitsFrom(value) - - - def copyConfigFrom(self, other): - """ - :type other: PlotConfig - """ - self._default_style.copyStyleFrom(other._default_style, copy_enabled_state=True) - self._refcase_style.copyStyleFrom(other._refcase_style, copy_enabled_state=True) - self._history_style.copyStyleFrom(other._history_style, copy_enabled_state=True) - self._histogram_style.copyStyleFrom(other._histogram_style, copy_enabled_state=True) - self._observs_style.copyStyleFrom(other._observs_style, copy_enabled_state=True) - self._distribution_style.copyStyleFrom(other._distribution_style, copy_enabled_state=True) - self._distribution_line_style.copyStyleFrom(other._distribution_line_style, copy_enabled_state=True) - - self._statistics_style["mean"].copyStyleFrom(other._statistics_style["mean"], copy_enabled_state=True) - self._statistics_style["p50"].copyStyleFrom(other._statistics_style["p50"], copy_enabled_state=True) - self._statistics_style["min-max"].copyStyleFrom(other._statistics_style["min-max"], copy_enabled_state=True) - self._statistics_style["p10-p90"].copyStyleFrom(other._statistics_style["p10-p90"], copy_enabled_state=True) - self._statistics_style["p33-p67"].copyStyleFrom(other._statistics_style["p33-p67"], copy_enabled_state=True) - self._statistics_style["std"].copyStyleFrom(other._statistics_style["std"], copy_enabled_state=True) - - self._std_dev_factor = other._std_dev_factor - self._legend_enabled = other._legend_enabled - self._grid_enabled = other._grid_enabled - - self.setLineColorCycle(other._line_color_cycle_colors) - - self._legend_items = other._legend_items[:] - self._legend_labels = other._legend_labels[:] - - self._x_label = other._x_label - self._y_label = other._y_label - - self._limits.copyLimitsFrom(other._limits) - - if other._title is not None: - self._title = other._title - - @classmethod - def createCopy(cls, other): - copy = PlotConfig(other._plot_settings ) - copy.copyConfigFrom(other) - return copy diff --git a/ThirdParty/Ert/python/python/ert_gui/plottery/plot_config_factory.py b/ThirdParty/Ert/python/python/ert_gui/plottery/plot_config_factory.py deleted file mode 100644 index 793d240407..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/plottery/plot_config_factory.py +++ /dev/null @@ -1,45 +0,0 @@ -from ert_gui.plottery import PlotConfig - - -class PlotConfigFactory(object): - - @classmethod - def createPlotConfigForKey(cls, ert, key): - """ - @type ert: ert.enkf.enkf_main.EnKFMain - @param key: str - @return: PlotConfig - """ - plot_config = PlotConfig(ert.plotConfig() , title = key) - return PlotConfigFactory.updatePlotConfigForKey(ert, key, plot_config) - - - @classmethod - def updatePlotConfigForKey(cls, ert, key, plot_config): - """ - @type ert: ert.enkf.enkf_main.EnKFMain - @param key: str - @return: PlotConfig - """ - key_manager = ert.getKeyManager() - # The styling of statistics changes based on the nature of the data - if key_manager.isSummaryKey(key) or key_manager.isGenDataKey(key): - mean_style = plot_config.getStatisticsStyle("mean") - mean_style.line_style = "-" - plot_config.setStatisticsStyle("mean", mean_style) - - p10p90_style = plot_config.getStatisticsStyle("p10-p90") - p10p90_style.line_style = "--" - plot_config.setStatisticsStyle("p10-p90", p10p90_style) - else: - mean_style = plot_config.getStatisticsStyle("mean") - mean_style.line_style = "-" - mean_style.marker = "o" - plot_config.setStatisticsStyle("mean", mean_style) - - std_style = plot_config.getStatisticsStyle("std") - std_style.line_style = "--" - std_style.marker = "D" - plot_config.setStatisticsStyle("std", std_style) - - return plot_config diff --git a/ThirdParty/Ert/python/python/ert_gui/plottery/plot_config_history.py b/ThirdParty/Ert/python/python/ert_gui/plottery/plot_config_history.py deleted file mode 100644 index b21699267e..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/plottery/plot_config_history.py +++ /dev/null @@ -1,46 +0,0 @@ -from ert_gui.plottery import PlotConfig - - -class PlotConfigHistory(object): - """ A Class for tracking changes to a PlotConfig class (supports undo, redo and reset)""" - - def __init__(self, name, initial): - super(PlotConfigHistory, self).__init__() - self._name = name - self._initial = PlotConfig.createCopy(initial) - self._undo_history = [] - self._redo_history = [] - self._current = PlotConfig.createCopy(self._initial) - - def isUndoPossible(self): - """ @rtype: bool """ - return len(self._undo_history) > 0 - - def isRedoPossible(self): - """ @rtype: bool """ - return len(self._redo_history) > 0 - - def applyChanges(self, plot_config): - """ @type plot_config: PlotConfig """ - self._undo_history.append(self._current) - copy = PlotConfig.createCopy(self._current) - copy.copyConfigFrom(plot_config) - self._current = copy - del self._redo_history[:] - - def resetChanges(self): - self.applyChanges(self._initial) - - def undoChanges(self): - if self.isUndoPossible(): - self._redo_history.append(self._current) - self._current = self._undo_history.pop() - - def redoChanges(self): - if self.isRedoPossible(): - self._undo_history.append(self._current) - self._current = self._redo_history.pop() - - def getPlotConfig(self): - """ @rtype: PlotConfig """ - return PlotConfig.createCopy(self._current) diff --git a/ThirdParty/Ert/python/python/ert_gui/plottery/plot_context.py b/ThirdParty/Ert/python/python/ert_gui/plottery/plot_context.py deleted file mode 100644 index 8afeaf74d4..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/plottery/plot_context.py +++ /dev/null @@ -1,80 +0,0 @@ -from .plot_config import PlotConfig -from .plot_data_gatherer import PlotDataGatherer - -class PlotContext(object): - UNKNOWN_AXIS = None - VALUE_AXIS = "VALUE" - DATE_AXIS = "DATE" - INDEX_AXIS = "INDEX" - COUNT_AXIS = "COUNT" - DENSITY_AXIS = "DENSITY" - DEPTH_AXIS = "DEPTH" - AXIS_TYPES = [UNKNOWN_AXIS, COUNT_AXIS, DATE_AXIS, DENSITY_AXIS, DEPTH_AXIS, INDEX_AXIS, VALUE_AXIS] - - def __init__(self, ert, figure, plot_config, cases, key, data_gatherer): - super(PlotContext, self).__init__() - self._data_gatherer = data_gatherer - self._key = key - self._cases = cases - self._figure = figure - self._ert = ert - self._plot_config = plot_config - - self._date_support_active = True - self._x_axis = None - self._y_axis = None - - def figure(self): - """ :rtype: matplotlib.figure.Figure""" - return self._figure - - def plotConfig(self): - """ :rtype: PlotConfig """ - return self._plot_config - - def ert(self): - """ :rtype: ert.enkf.EnKFMain""" - return self._ert - - def cases(self): - """ :rtype: list of str """ - return self._cases - - def key(self): - """ :rtype: str """ - return self._key - - def dataGatherer(self): - """ :rtype: PlotDataGatherer """ - return self._data_gatherer - - def deactivateDateSupport(self): - self._date_support_active = False - - def isDateSupportActive(self): - """ @rtype: bool """ - return self._date_support_active - - @property - def x_axis(self): - """ @rtype: str """ - return self._x_axis - - @x_axis.setter - def x_axis(self, value): - """ @type value: str """ - if not value in PlotContext.AXIS_TYPES: - raise UserWarning("Axis: '%s' is not one of: %s" % (value, PlotContext.AXIS_TYPES)) - self._x_axis = value - - @property - def y_axis(self): - """ @rtype: str """ - return self._y_axis - - @y_axis.setter - def y_axis(self, value): - """ @type value: str """ - if not value in PlotContext.AXIS_TYPES: - raise UserWarning("Axis: '%s' is not one of: %s" % (value, PlotContext.AXIS_TYPES)) - self._y_axis = value \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/plottery/plot_data_gatherer.py b/ThirdParty/Ert/python/python/ert_gui/plottery/plot_data_gatherer.py deleted file mode 100644 index 11fa2a3c94..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/plottery/plot_data_gatherer.py +++ /dev/null @@ -1,159 +0,0 @@ -from pandas import DataFrame -from ert.enkf.export import GenKwCollector, SummaryCollector, GenDataCollector, SummaryObservationCollector, \ - GenDataObservationCollector, CustomKWCollector - - -class PlotDataGatherer(object): - - def __init__(self, dataGatherFunc, conditionFunc, refcaseGatherFunc=None, observationGatherFunc=None, historyGatherFunc=None): - super(PlotDataGatherer, self).__init__() - - self._dataGatherFunction = dataGatherFunc - self._conditionFunction = conditionFunc - self._refcaseGatherFunction = refcaseGatherFunc - self._observationGatherFunction = observationGatherFunc - self._historyGatherFunc = historyGatherFunc - - def hasHistoryGatherFunction(self): - """ :rtype: bool """ - return self._historyGatherFunc is not None - - def hasRefcaseGatherFunction(self): - """ :rtype: bool """ - return self._refcaseGatherFunction is not None - - def hasObservationGatherFunction(self): - """ :rtype: bool """ - return self._observationGatherFunction is not None - - def canGatherDataForKey(self, key): - """ :rtype: bool """ - return self._conditionFunction(key) - - def gatherData(self, ert, case, key): - """ :rtype: pandas.DataFrame """ - if not self.canGatherDataForKey(key): - raise UserWarning("Unable to gather data for key: %s" % key) - - return self._dataGatherFunction(ert, case, key) - - def gatherRefcaseData(self, ert, key): - """ :rtype: pandas.DataFrame """ - if not self.canGatherDataForKey(key) or not self.hasRefcaseGatherFunction(): - raise UserWarning("Unable to gather refcase data for key: %s" % key) - - return self._refcaseGatherFunction(ert, key) - - def gatherObservationData(self, ert, case, key): - """ :rtype: pandas.DataFrame """ - if not self.canGatherDataForKey(key) or not self.hasObservationGatherFunction(): - raise UserWarning("Unable to gather observation data for key: %s" % key) - - return self._observationGatherFunction(ert, case, key) - - def gatherHistoryData(self, ert, case, key): - """ :rtype: pandas.DataFrame """ - if not self.canGatherDataForKey(key) or not self.hasHistoryGatherFunction(): - raise UserWarning("Unable to gather history data for key: %s" % key) - - return self._historyGatherFunc(ert, case, key) - - - @staticmethod - def gatherGenKwData(ert, case, key): - """ :rtype: pandas.DataFrame """ - data = GenKwCollector.loadAllGenKwData(ert, case, [key]) - return data[key].dropna() - - @staticmethod - def gatherSummaryData(ert, case, key): - """ :rtype: pandas.DataFrame """ - data = SummaryCollector.loadAllSummaryData(ert, case, [key]) - if not data.empty: - data = data.reset_index() - data = data.pivot(index="Date", columns="Realization", values=key) - - return data #.dropna() - - @staticmethod - def gatherSummaryRefcaseData(ert, key): - refcase = ert.eclConfig().getRefcase() - - if refcase is None or not key in refcase: - return DataFrame() - - vector = refcase.get_vector(key, report_only=False) - - rows = [] - for index in range(1, len(vector)): - node = vector[index] - row = { - "Date": node.date, - key: node.value - } - rows.append(row) - - data = DataFrame(rows) - data = data.set_index("Date") - - return data - - @staticmethod - def gatherSummaryHistoryData(ert, case, key): - # create history key - if ":" in key: - head, tail = key.split(":", 2) - key = "%sH:%s" % (head, tail) - else: - key = "%sH" % key - - data = PlotDataGatherer.gatherSummaryRefcaseData(ert, key) - if data.empty and case is not None: - data = PlotDataGatherer.gatherSummaryData(ert, case, key) - - return data - - @staticmethod - def gatherSummaryObservationData(ert, case, key): - if ert.getKeyManager().isKeyWithObservations(key): - return SummaryObservationCollector.loadObservationData(ert, case, [key]).dropna() - else: - return DataFrame() - - - @staticmethod - def gatherGenDataData(ert, case, key): - """ :rtype: pandas.DataFrame """ - key, report_step = key.split("@", 1) - report_step = int(report_step) - try: - data = GenDataCollector.loadGenData(ert, case, key, report_step) - except ValueError: - data = DataFrame() - - return data.dropna() # removes all rows that has a NaN - - - @staticmethod - def gatherGenDataObservationData(ert, case, key_with_report_step): - """ :rtype: pandas.DataFrame """ - key, report_step = key_with_report_step.split("@", 1) - report_step = int(report_step) - - obs_key = GenDataObservationCollector.getObservationKeyForDataKey(ert, key, report_step) - - if obs_key is not None: - obs_data = GenDataObservationCollector.loadGenDataObservations(ert, case, obs_key) - columns = {obs_key: key_with_report_step, "STD_%s" % obs_key: "STD_%s" % key_with_report_step} - obs_data = obs_data.rename(columns=columns) - else: - obs_data = DataFrame() - - return obs_data.dropna() - - @staticmethod - def gatherCustomKwData(ert, case, key): - """ :rtype: pandas.DataFrame """ - data = CustomKWCollector.loadAllCustomKWData(ert, case, [key])[key] - - return data diff --git a/ThirdParty/Ert/python/python/ert_gui/plottery/plot_limits.py b/ThirdParty/Ert/python/python/ert_gui/plottery/plot_limits.py deleted file mode 100644 index bac7f42dd5..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/plottery/plot_limits.py +++ /dev/null @@ -1,105 +0,0 @@ -import datetime - -class limit_property(object): - def __init__(self, attribute_name, types, minimum=None, maximum=None): - super(limit_property, self).__init__() - self._types = types - self._maximum = maximum - self._minimum = minimum - self._attribute_name = attribute_name - - def __get__(self, instance, owner): - if not hasattr(instance, "_%s" % self._attribute_name): - setattr(instance, "_%s" % self._attribute_name, None) - return getattr(instance, "_%s" % self._attribute_name) - - def __set__(self, instance, value): - if value is not None: - if not isinstance(value, self._types): - raise TypeError("Value not (one) of type(s): %s: %s" % (self._types, repr(value))) - if self._minimum is not None and value < self._minimum: - raise ValueError("Value can not be less than %f: %f < %f" % (self._minimum, value, self._minimum)) - if self._maximum is not None and value > self._maximum: - raise ValueError("Value can not be larger than %f: %f > %f" % (self._maximum, value, self._maximum)) - - setattr(instance, "_%s" % self._attribute_name, value) - - -class limits_property(object): - def __init__(self, minimum_attribute_name, maximum_attribute_name): - super(limits_property, self).__init__() - self._minimum_attribute_name = minimum_attribute_name - self._maximum_attribute_name = maximum_attribute_name - - def __get__(self, instance, owner): - return getattr(instance, "%s" % self._minimum_attribute_name), getattr(instance, "%s" % self._maximum_attribute_name) - - def __set__(self, instance, value): - setattr(instance, "_%s" % self._minimum_attribute_name, value[0]) - setattr(instance, "_%s" % self._maximum_attribute_name, value[1]) - - -class PlotLimits(object): - value_minimum = limit_property("value_minimum", (float, int)) - """ :type: float """ - value_maximum = limit_property("value_maximum", (float, int)) - """ :type: float """ - value_limits = limits_property("value_minimum", "value_maximum") - """ :type: (float, float) """ - - index_minimum = limit_property("index_minimum", int, minimum=0) - """ :type: int """ - index_maximum = limit_property("index_maximum", int, minimum=0) - """ :type: int """ - index_limits = limits_property("index_minimum", "index_maximum") - """ :type: (int, int) """ - - count_minimum = limit_property("count_minimum", int, minimum=0) - """ :type: int """ - count_maximum = limit_property("count_maximum", int, minimum=0) - """ :type: int """ - count_limits = limits_property("count_minimum", "count_maximum") - """ :type: (int, int) """ - - density_minimum = limit_property("density_minimum", (float, int), minimum=0.0) - """ :type: float """ - density_maximum = limit_property("density_maximum", (float, int), minimum=0.0) - """ :type: float """ - density_limits = limits_property("density_minimum", "density_maximum") - """ :type: (float, float) """ - - depth_minimum = limit_property("depth_minimum", (float, int), minimum=0.0) - """ :type: float """ - depth_maximum = limit_property("depth_maximum", (float, int), minimum=0.0) - """ :type: float """ - depth_limits = limits_property("depth_minimum", "depth_maximum") - """ :type: tuple[float, float] """ - - date_minimum = limit_property("date_minimum", (datetime.date, datetime.datetime)) - """ :type: datetime.datetime or datetime.date """ - date_maximum = limit_property("date_maximum", (datetime.date, datetime.datetime)) - """ :type: datetime.datetime or datetime.date """ - date_limits = limits_property("date_minimum", "date_maximum") - """ :type: tuple[datetime.datetime|datetime.date, datetime.datetime|datetime.date] """ - - - def __eq__(self, other): - """ @type other: PlotLimits """ - equality = self.value_limits == other.value_limits - equality = equality and self.index_limits == other.index_limits - equality = equality and self.count_limits == other.count_limits - equality = equality and self.depth_limits == other.depth_limits - equality = equality and self.date_limits == other.date_limits - equality = equality and self.density_limits == other.density_limits - - return equality - - - def copyLimitsFrom(self, other): - """ @type other: PlotLimits """ - self.value_limits = other.value_limits - self.density_limits = other.density_limits - self.depth_limits = other.depth_limits - self.index_limits = other.index_limits - self.date_limits = other.date_limits - self.count_limits = other.count_limits \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/plottery/plot_style.py b/ThirdParty/Ert/python/python/ert_gui/plottery/plot_style.py deleted file mode 100644 index a7b1357d9b..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/plottery/plot_style.py +++ /dev/null @@ -1,112 +0,0 @@ -class PlotStyle(object): - def __init__(self, name, color="#000000", alpha=1.0, line_style="-", marker="", width=1.0, size=7.5, enabled = True): - super(PlotStyle, self).__init__() - self.name = name - self.color = color - self.alpha = alpha - self.line_style = line_style - self.marker = marker - self.width = width - self.size = size - self._enabled = enabled - self._is_copy = False - - def copyStyleFrom(self, other, copy_enabled_state=False): - self.color = other.color - self.alpha = other.alpha - self.line_style = other._line_style - self.marker = other._marker - self.width = other.width - self.size = other.size - self._is_copy = True - - if copy_enabled_state: - self.setEnabled(other.isEnabled()) - - def isEnabled(self): - return self._enabled - - def setEnabled(self, enabled): - self._enabled = enabled - - def isVisible(self): - return self.line_style != "" or self.marker != "" - - @property - def name(self): - return self._name - - @name.setter - def name(self, name): - self._name = name - - @property - def color(self): - return self._color - - @color.setter - def color(self, color): - self._color = color - - @property - def alpha(self): - return self._alpha - - @alpha.setter - def alpha(self, alpha): - if alpha > 1.0: - alpha = 1.0 - if alpha < 0.0: - alpha = 0.0 - self._alpha = alpha - - @property - def marker(self): - return self._marker if self._marker is not None else "" - - @marker.setter - def marker(self, marker): - self._marker = marker - - @property - def line_style(self): - return self._line_style if self._line_style is not None else "" - - @line_style.setter - def line_style(self, line_style): - self._line_style = line_style - - @property - def width(self): - return self._width - - @width.setter - def width(self, width): - if width < 0.0: - width = 0.0 - self._width = width - - @property - def size(self): - return self._size - - @size.setter - def size(self, size): - if size < 0.0: - size = 0.0 - self._size = size - - - def __str__(self): - return "%s c:%s a:%f ls:%s m:%s w:%f s:%f enabled:%s copy:%s" % (self.name, self.color, self.alpha, self.line_style, self.marker, self.width, self.size, self.isEnabled(), self._is_copy) - - def __eq__(self, other): - equalness = self.alpha == other.alpha - equalness = equalness and self.marker == other.marker - equalness = equalness and self.line_style == other.line_style - equalness = equalness and self.width == other.width - equalness = equalness and self.color == other.color - equalness = equalness and self.size == other.size - equalness = equalness and self.isEnabled() == other.isEnabled() - - return equalness diff --git a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/plottery/plots/CMakeLists.txt deleted file mode 100644 index 24aa63b774..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - ccsp.py - distribution.py - ensemble.py - gaussian_kde.py - histogram.py - history.py - observations.py - plot_tools.py - refcase.py - statistics.py -) - -add_python_package("python.ert_gui.plottery.plots" ${PYTHON_INSTALL_PREFIX}/ert_gui/plottery/plots "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/__init__.py b/ThirdParty/Ert/python/python/ert_gui/plottery/plots/__init__.py deleted file mode 100644 index 64f84b1e9a..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -import os -import matplotlib - -from .histogram import plotHistogram -from .gaussian_kde import plotGaussianKDE - -from .refcase import plotRefcase -from .history import plotHistory -from .observations import plotObservations - -from .ensemble import plotEnsemble -from .statistics import plotStatistics -from .distribution import plotDistribution -from .ccsp import plotCrossCaseStatistics diff --git a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/ccsp.py b/ThirdParty/Ert/python/python/ert_gui/plottery/plots/ccsp.py deleted file mode 100644 index 52679222d7..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/ccsp.py +++ /dev/null @@ -1,221 +0,0 @@ -from matplotlib.patches import Rectangle -from matplotlib.lines import Line2D -from .plot_tools import PlotTools -import pandas as pd - -def plotCrossCaseStatistics(plot_context): - """ @type plot_context: ert_gui.plottery.PlotContext """ - ert = plot_context.ert() - key = plot_context.key() - config = plot_context.plotConfig() - axes = plot_context.figure().add_subplot(111) - """:type: matplotlib.axes.Axes """ - - plot_context.deactivateDateSupport() - - plot_context.y_axis = plot_context.VALUE_AXIS - - if key.startswith("LOG10_"): - key = key[6:] - axes.set_yscale("log") - - case_list = plot_context.cases() - case_indexes = [] - ccs = { - "index": [], - "mean": {}, - "min": {}, - "max": {}, - "std": {}, - "p10": {}, - "p33": {}, - "p50": {}, - "p67": {}, - "p90": {} - } - for case_index, case in enumerate(case_list): - case_indexes.append(case_index) - data = plot_context.dataGatherer().gatherData(ert, case, key) - std_dev_factor = config.getStandardDeviationFactor() - - if not data.empty: - data = _assertNumeric(data) - if not data is None: - ccs["index"].append(case_index) - ccs["mean"][case_index] = data.mean() - ccs["min"][case_index] = data.min() - ccs["max"][case_index] = data.max() - ccs["std"][case_index] = data.std() * std_dev_factor - ccs["p10"][case_index] = data.quantile(0.1) - ccs["p33"][case_index] = data.quantile(0.33) - ccs["p50"][case_index] = data.quantile(0.5) - ccs["p67"][case_index] = data.quantile(0.67) - ccs["p90"][case_index] = data.quantile(0.9) - - _plotCrossCaseStatistics(axes, config, ccs, case_index) - config.nextColor() - - if config.isDistributionLineEnabled() and len(ccs["index"]) > 1: - _plotConnectionLines(axes, config, ccs) - - _addStatisticsLegends(config) - - axes.set_xticks([-1] + case_indexes + [len(case_indexes)]) - - rotation = 0 - if len(case_list) > 3: - rotation = 30 - - axes.set_xticklabels([""] + case_list + [""], rotation=rotation) - - PlotTools.finalizePlot(plot_context, axes, default_x_label="Case", default_y_label="Value") - - -def _addStatisticsLegends(plot_config): - _addStatisticsLegend(plot_config, "mean") - _addStatisticsLegend(plot_config, "p50") - _addStatisticsLegend(plot_config, "min-max", 0.2) - _addStatisticsLegend(plot_config, "p10-p90", 0.4) - _addStatisticsLegend(plot_config, "std", 0.4) - _addStatisticsLegend(plot_config, "p33-p67", 0.6) - - -def _addStatisticsLegend(plot_config, style_name, alpha_multiplier=1.0): - style = plot_config.getStatisticsStyle(style_name) - if style.isVisible(): - if style.line_style == "#": - rectangle = Rectangle((0, 0), 1, 1, color='black', alpha=style.alpha * alpha_multiplier) # creates rectangle patch for legend use. - plot_config.addLegendItem(style.name, rectangle) - else: - line = Line2D([], [], color='black', marker=style.marker, linestyle=style.line_style, linewidth=style.width, alpha=style.alpha) - plot_config.addLegendItem(style.name, line) - - -def _assertNumeric(data): - if data.dtype == "object": - try: - data = pd.to_numeric(data, errors='coerce') - except AttributeError: - data = data.convert_objects(convert_numeric=True) - - if data.dtype == "object": - data = None - return data - - -def _plotCrossCaseStatistics(axes, plot_config, data, index): - """ - @type axes: matplotlib.axes.Axes - @type plot_config: PlotConfig - @type data: DataFrame - @type index: int - """ - - axes.set_xlabel(plot_config.xLabel()) - axes.set_ylabel(plot_config.yLabel()) - - style = plot_config.getStatisticsStyle("mean") - if style.isVisible(): - axes.plot([index], data["mean"][index], alpha=style.alpha, linestyle="", color=style.color, marker=style.marker, markersize=style.size) - - style = plot_config.getStatisticsStyle("p50") - if style.isVisible(): - axes.plot([index], data["p50"][index], alpha=style.alpha, linestyle="", color=style.color, marker=style.marker, markersize=style.size) - - style = plot_config.getStatisticsStyle("std") - if style.isVisible(): - axes.plot([index], data["mean"][index] + data["std"][index], alpha=style.alpha, linestyle="", color=style.color, marker=style.marker, markersize=style.size) - axes.plot([index], data["mean"][index] - data["std"][index], alpha=style.alpha, linestyle="", color=style.color, marker=style.marker, markersize=style.size) - - style = plot_config.getStatisticsStyle("min-max") - if style.isVisible(): - axes.plot([index], data["min"][index], alpha=style.alpha, linestyle="", color=style.color, marker=style.marker, markersize=style.size) - axes.plot([index], data["max"][index], alpha=style.alpha, linestyle="", color=style.color, marker=style.marker, markersize=style.size) - - style = plot_config.getStatisticsStyle("p10-p90") - if style.isVisible(): - axes.plot([index], data["p10"][index], alpha=style.alpha, linestyle="", color=style.color, marker=style.marker, markersize=style.size) - axes.plot([index], data["p90"][index], alpha=style.alpha, linestyle="", color=style.color, marker=style.marker, markersize=style.size) - - style = plot_config.getStatisticsStyle("p33-p67") - if style.isVisible(): - axes.plot([index], data["p33"][index], alpha=style.alpha, linestyle="", color=style.color, marker=style.marker, markersize=style.size) - axes.plot([index], data["p67"][index], alpha=style.alpha, linestyle="", color=style.color, marker=style.marker, markersize=style.size) - - -def _plotConnectionLines(axes, plot_config, ccs): - """ - @type axes: matplotlib.axes.Axes - @type plot_config: PlotConfig - @type ccs: dict[str, dict[int, float]] - """ - line_style = plot_config.distributionLineStyle() - index_list = ccs["index"] - """ :type: list[int] """ - for index in range(len(index_list) - 1): - from_index = index_list[index] - to_index = index_list[index + 1] - - x = [from_index, to_index] - - style = plot_config.getStatisticsStyle("mean") - if style.isVisible(): - y = [ccs["mean"][from_index], ccs["mean"][to_index]] - axes.plot(x, y, alpha=line_style.alpha, linestyle=style.line_style, color=line_style.color, linewidth=style.width) - - style = plot_config.getStatisticsStyle("p50") - if style.isVisible(): - y = [ccs["p50"][from_index], ccs["p50"][to_index]] - axes.plot(x, y, alpha=line_style.alpha, linestyle=style.line_style, color=line_style.color, linewidth=style.width) - - style = plot_config.getStatisticsStyle("std") - if style.isVisible(): - mean = [ccs["mean"][from_index], ccs["mean"][to_index]] - std = [ccs["std"][from_index], ccs["std"][to_index]] - - y_1 = [mean[0] + std[0], mean[1] + std[1]] - y_2 = [mean[0] - std[0], mean[1] - std[1]] - - linestyle = style.line_style - if linestyle == "#": - linestyle = "" - - axes.plot(x, y_1, alpha=style.alpha, linestyle=linestyle, color=line_style.color, linewidth=style.width) - axes.plot(x, y_2, alpha=style.alpha, linestyle=linestyle, color=line_style.color, linewidth=style.width) - - style = plot_config.getStatisticsStyle("min-max") - if style.isVisible(): - y_1 = [ccs["min"][from_index], ccs["min"][to_index]] - y_2 = [ccs["max"][from_index], ccs["max"][to_index]] - - linestyle = style.line_style - if linestyle == "#": - linestyle = "" - - axes.plot(x, y_1, alpha=style.alpha, linestyle=linestyle, color=line_style.color, linewidth=style.width) - axes.plot(x, y_2, alpha=style.alpha, linestyle=linestyle, color=line_style.color, linewidth=style.width) - - style = plot_config.getStatisticsStyle("p10-p90") - if style.isVisible(): - y_1 = [ccs["p10"][from_index], ccs["p10"][to_index]] - y_2 = [ccs["p90"][from_index], ccs["p90"][to_index]] - - linestyle = style.line_style - if linestyle == "#": - linestyle = "" - - axes.plot(x, y_1, alpha=style.alpha, linestyle=linestyle, color=line_style.color, linewidth=style.width) - axes.plot(x, y_2, alpha=style.alpha, linestyle=linestyle, color=line_style.color, linewidth=style.width) - - style = plot_config.getStatisticsStyle("p33-p67") - if style.isVisible(): - y_1 = [ccs["p33"][from_index], ccs["p33"][to_index]] - y_2 = [ccs["p67"][from_index], ccs["p67"][to_index]] - - linestyle = style.line_style - if linestyle == "#": - linestyle = "" - - axes.plot(x, y_1, alpha=style.alpha, linestyle=linestyle, color=line_style.color, linewidth=style.width) - axes.plot(x, y_2, alpha=style.alpha, linestyle=linestyle, color=line_style.color, linewidth=style.width) - diff --git a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/distribution.py b/ThirdParty/Ert/python/python/ert_gui/plottery/plots/distribution.py deleted file mode 100644 index af0b546a1d..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/distribution.py +++ /dev/null @@ -1,77 +0,0 @@ -from .plot_tools import PlotTools -import pandas as pd - -def plotDistribution(plot_context): - """ @type plot_context: ert_gui.plottery.PlotContext """ - ert = plot_context.ert() - key = plot_context.key() - config = plot_context.plotConfig() - axes = plot_context.figure().add_subplot(111) - """:type: matplotlib.axes.Axes """ - - plot_context.deactivateDateSupport() - - plot_context.y_axis = plot_context.VALUE_AXIS - - if key.startswith("LOG10_"): - key = key[6:] - axes.set_yscale("log") - - case_list = plot_context.cases() - case_indexes = [] - previous_data = None - for case_index, case in enumerate(case_list): - case_indexes.append(case_index) - data = plot_context.dataGatherer().gatherData(ert, case, key) - - if not data.empty: - _plotDistribution(axes, config, data, case, case_index, previous_data) - config.nextColor() - - previous_data = data - - axes.set_xticks([-1] + case_indexes + [len(case_indexes)]) - - rotation = 0 - if len(case_list) > 3: - rotation = 30 - - axes.set_xticklabels([""] + case_list + [""], rotation=rotation) - - config.setLegendEnabled(False) - - PlotTools.finalizePlot(plot_context, axes, default_x_label="Case", default_y_label="Value") - - -def _plotDistribution(axes, plot_config, data, label, index, previous_data): - """ - @type axes: matplotlib.axes.Axes - @type plot_config: PlotConfig - @type data: DataFrame - @type label: Str - """ - - axes.set_xlabel(plot_config.xLabel()) - axes.set_ylabel(plot_config.yLabel()) - - style = plot_config.distributionStyle() - - if data.dtype == "object": - try: - data = pd.to_numeric(data, errors='coerce') - except AttributeError: - data = data.convert_objects(convert_numeric=True) - - if data.dtype == "object": - dots = [] - else: - dots = axes.plot([index] * len(data), data, color=style.color, alpha=style.alpha, marker=style.marker, linestyle=style.line_style, markersize=style.size) - - if plot_config.isDistributionLineEnabled() and previous_data is not None: - line_style = plot_config.distributionLineStyle() - x = [index - 1, index] - y = [previous_data, data] - lines = axes.plot(x, y, color=line_style.color, alpha=line_style.alpha, linestyle=line_style.line_style, linewidth=line_style.width) - - if len(dots) > 0: - plot_config.addLegendItem(label, dots[0]) diff --git a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/ensemble.py b/ThirdParty/Ert/python/python/ert_gui/plottery/plots/ensemble.py deleted file mode 100644 index 333a3a2434..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/ensemble.py +++ /dev/null @@ -1,56 +0,0 @@ -from .refcase import plotRefcase -from .history import plotHistory -from .observations import plotObservations -from .plot_tools import PlotTools - -def plotEnsemble(plot_context): - """ - @type plot_context: ert_gui.plottery.PlotContext - """ - ert = plot_context.ert() - key = plot_context.key() - config = plot_context.plotConfig() - """:type: ert_gui.plottery.PlotConfig """ - axes = plot_context.figure().add_subplot(111) - """:type: matplotlib.axes.Axes """ - - case_list = plot_context.cases() - - plot_context.y_axis = plot_context.VALUE_AXIS - plot_context.x_axis = plot_context.DATE_AXIS - - for case in case_list: - data = plot_context.dataGatherer().gatherData(ert, case, key) - if not data.empty: - if not data.index.is_all_dates: - plot_context.deactivateDateSupport() - plot_context.x_axis = plot_context.INDEX_AXIS - - _plotLines(axes, config, data, case, plot_context.isDateSupportActive()) - config.nextColor() - - plotRefcase(plot_context, axes) - plotObservations(plot_context, axes) - plotHistory(plot_context, axes) - - default_x_label = "Date" if plot_context.isDateSupportActive() else "Index" - PlotTools.finalizePlot(plot_context, axes, default_x_label=default_x_label, default_y_label="Value") - - -def _plotLines(axes, plot_config, data, ensemble_label, is_date_supported): - """ - @type axes: matplotlib.axes.Axes - @type plot_config: ert_gui.plottery.PlotConfig - @type data: pandas.DataFrame - @type ensemble_label: Str - """ - - style = plot_config.defaultStyle() - - if is_date_supported: - lines = axes.plot_date(x=data.index.values, y=data, color=style.color, alpha=style.alpha, marker=style.marker, linestyle=style.line_style, linewidth=style.width, markersize=style.size) - else: - lines = axes.plot(data.index.values, data, color=style.color, alpha=style.alpha, marker=style.marker, linestyle=style.line_style, linewidth=style.width, markersize=style.size) - - if len(lines) > 0: - plot_config.addLegendItem(ensemble_label, lines[0]) diff --git a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/gaussian_kde.py b/ThirdParty/Ert/python/python/ert_gui/plottery/plots/gaussian_kde.py deleted file mode 100644 index 5e6c6b7124..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/gaussian_kde.py +++ /dev/null @@ -1,63 +0,0 @@ -import numpy -from scipy.stats import gaussian_kde -from .plot_tools import PlotTools -import pandas as pd - - -def plotGaussianKDE(plot_context): - """ - @type plot_context: ert_gui.plottery.PlotContext - """ - ert = plot_context.ert() - key = plot_context.key() - config = plot_context.plotConfig() - axes = plot_context.figure().add_subplot(111) - """:type: matplotlib.axes.Axes """ - - plot_context.deactivateDateSupport() - plot_context.x_axis = plot_context.VALUE_AXIS - plot_context.y_axis = plot_context.DENSITY_AXIS - - if key.startswith("LOG10_"): - key = key[6:] - axes.set_xscale("log") - - case_list = plot_context.cases() - for case in case_list: - data = plot_context.dataGatherer().gatherData(ert, case, key) - - if not data.empty and data.nunique() > 1: - _plotGaussianKDE(axes, config, data, case) - config.nextColor() - - PlotTools.finalizePlot(plot_context, axes, default_x_label="Value", default_y_label="Density") - - -def _plotGaussianKDE(axes, plot_config, data, label): - """ - @type axes: matplotlib.axes.Axes - @type plot_config: PlotConfig - @type data: DataFrame - @type label: Str - """ - - style = plot_config.histogramStyle() - - if data.dtype == "object": - try: - data = pd.to_numeric(data, errors='coerce') - except AttributeError: - data = data.convert_objects(convert_numeric=True) - - if data.dtype == "object": - pass - else: - sample_range = data.max() - data.min() - indexes = numpy.linspace(data.min() - 0.5 * sample_range, data.max() + 0.5 * sample_range, 1000) - gkde = gaussian_kde(data.values) - evaluated_gkde = gkde.evaluate(indexes) - - lines = axes.plot(indexes, evaluated_gkde, linewidth=style.width, color=style.color, alpha=style.alpha) - - if len(lines) > 0: - plot_config.addLegendItem(label, lines[0]) \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/histogram.py b/ThirdParty/Ert/python/python/ert_gui/plottery/plots/histogram.py deleted file mode 100644 index eeb308c10a..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/histogram.py +++ /dev/null @@ -1,183 +0,0 @@ -from math import sqrt, ceil, floor, log10 -from matplotlib.patches import Rectangle -import numpy -from .plot_tools import PlotTools -import pandas as pd - -def plotHistogram(plot_context): - """ @type plot_context: ert_gui.plottery.PlotContext """ - ert = plot_context.ert() - key = plot_context.key() - config = plot_context.plotConfig() - - case_list = plot_context.cases() - case_count = len(case_list) - - plot_context.x_axis = plot_context.VALUE_AXIS - plot_context.Y_axis = plot_context.COUNT_AXIS - - if config.xLabel() is None: - config.setXLabel("Value") - - if config.yLabel() is None: - config.setYLabel("Count") - - use_log_scale = False - if key.startswith("LOG10_"): - key = key[6:] - use_log_scale = True - - data = {} - minimum = None - maximum = None - categories = set() - max_element_count = 0 - categorical = False - for case in case_list: - data[case] = plot_context.dataGatherer().gatherData(ert, case, key) - - if data[case].dtype == "object": - try: - data[case] = pd.to_numeric(data[case], errors='ignore') - except AttributeError: - data[case] = data[case].convert_objects(convert_numeric=True) - - if data[case].dtype == "object": - categorical = True - - if categorical: - categories = categories.union(set(data[case].unique())) - else: - if minimum is None: - minimum = data[case].min() - else: - minimum = min(minimum, data[case].min()) - - if maximum is None: - maximum = data[case].max() - else: - maximum = max(maximum, data[case].max()) - - max_element_count = max(max_element_count, len(data[case].index)) - - categories = sorted(categories) - bin_count = int(ceil(sqrt(max_element_count))) - - axes = {} - """:type: dict of (str, matplotlib.axes.Axes) """ - for index, case in enumerate(case_list): - axes[case] = plot_context.figure().add_subplot(case_count, 1, index + 1) - - axes[case].set_title("%s (%s)" % (config.title(), case)) - - if use_log_scale: - axes[case].set_xscale("log") - - if not data[case].empty: - if categorical: - _plotCategoricalHistogram(axes[case], config, data[case], case, categories) - else: - _plotHistogram(axes[case], config, data[case], case, bin_count, use_log_scale, minimum, maximum) - - config.nextColor() - PlotTools.showGrid(axes[case], plot_context) - - min_count = 0 - max_count = max([subplot.get_ylim()[1] for subplot in axes.values()]) - - custom_limits = plot_context.plotConfig().limits - - if custom_limits.count_maximum is not None: - max_count = custom_limits.count_maximum - - if custom_limits.count_minimum is not None: - min_count = custom_limits.count_minimum - - for subplot in axes.values(): - subplot.set_ylim(min_count, max_count) - subplot.set_xlim(custom_limits.value_minimum, custom_limits.value_maximum) - - -def _plotCategoricalHistogram(axes, plot_config, data, label, categories): - """ - @type axes: matplotlib.axes.Axes - @type plot_config: PlotConfig - @type data: DataFrame - @type label: str - @type categories: list of str - """ - - axes.set_xlabel(plot_config.xLabel()) - axes.set_ylabel(plot_config.yLabel()) - - style = plot_config.histogramStyle() - - counts = data.value_counts() - freq = [counts[category] if category in counts else 0 for category in categories] - pos = numpy.arange(len(categories)) - width = 1.0 - axes.set_xticks(pos + (width / 2.0)) - axes.set_xticklabels(categories) - - axes.bar(pos, freq, alpha=style.alpha, color=style.color, width=width) - - rectangle = Rectangle((0, 0), 1, 1, color=style.color) # creates rectangle patch for legend use. - plot_config.addLegendItem(label, rectangle) - - -def _plotHistogram(axes, plot_config, data, label, bin_count, use_log_scale=False, minimum=None, maximum=None): - """ - @type axes: matplotlib.axes.Axes - @type plot_config: PlotConfig - @type data: DataFrame - @type label: str - """ - - axes.set_xlabel(plot_config.xLabel()) - axes.set_ylabel(plot_config.yLabel()) - - style = plot_config.histogramStyle() - - if minimum is not None and maximum is not None: - if use_log_scale: - bins = _histogramLogBins(bin_count, minimum, maximum) - else: - bins = numpy.linspace(minimum, maximum, bin_count) - else: - bins = bin_count - - axes.hist(data.values, alpha=style.alpha, bins=bins, color=style.color) - - if minimum == maximum: - minimum -= 0.5 - maximum += 0.5 - - axes.set_xlim(minimum, maximum) - - rectangle = Rectangle((0, 0), 1, 1, color=style.color) # creates rectangle patch for legend use.' - plot_config.addLegendItem(label, rectangle) - - - -def _histogramLogBins(bin_count, minimum=None, maximum=None): - """ - @type data: pandas.DataFrame - @rtype: int - """ - minimum = log10(float(minimum)) - maximum = log10(float(maximum)) - - min_value = int(floor(minimum)) - max_value = int(ceil(maximum)) - - log_bin_count = max_value - min_value - - if log_bin_count < bin_count: - next_bin_count = log_bin_count * 2 - - if bin_count - log_bin_count > next_bin_count - bin_count: - log_bin_count = next_bin_count - else: - log_bin_count = bin_count - - return 10 ** numpy.linspace(minimum, maximum, log_bin_count) diff --git a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/history.py b/ThirdParty/Ert/python/python/ert_gui/plottery/plots/history.py deleted file mode 100644 index dd1d8d7768..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/history.py +++ /dev/null @@ -1,33 +0,0 @@ -def plotHistory(plot_context, axes): - ert = plot_context.ert() - key = plot_context.key() - - if len(plot_context.cases()) == 0: - case = None - else: - case = plot_context.cases()[0] - - config = plot_context.plotConfig() - data_gatherer = plot_context.dataGatherer() - - if config.isHistoryEnabled() and data_gatherer.hasHistoryGatherFunction(): - history_data = data_gatherer.gatherHistoryData(ert, case, key) - - if not history_data.empty: - _plotHistory(axes, config, history_data) - - -def _plotHistory(axes, plot_config, data): - """ - @type axes: matplotlib.axes.Axes - @type plot_config: PlotConfig - @type data: DataFrame - """ - - style = plot_config.historyStyle() - - lines = axes.plot_date(x=data.index.values, y=data, color=style.color, alpha=style.alpha, marker=style.marker, linestyle=style.line_style, - linewidth=style.width, markersize=style.size) - - if len(lines) > 0 and style.isVisible(): - plot_config.addLegendItem("History", lines[0]) diff --git a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/observations.py b/ThirdParty/Ert/python/python/ert_gui/plottery/plots/observations.py deleted file mode 100644 index 68d050b68a..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/observations.py +++ /dev/null @@ -1,54 +0,0 @@ -import math - -def plotObservations(plot_context, axes): - ert = plot_context.ert() - key = plot_context.key() - config = plot_context.plotConfig() - case_list = plot_context.cases() - data_gatherer = plot_context.dataGatherer() - - if config.isObservationsEnabled() and data_gatherer.hasObservationGatherFunction(): - if len(case_list) > 0: - observation_data = data_gatherer.gatherObservationData(ert, case_list[0], key) - - if not observation_data.empty: - _plotObservations(axes, config, observation_data, value_column=key) - - - -def _plotObservations(axes, plot_config, data, value_column): - """ - Observations are always plotted on top. z-order set to 1000 - - Since it is not possible to apply different linestyles to the errorbar, the line_style / fmt is used to toggle - visibility of the solid errorbar, by using the elinewidth parameter. - - @type axes: matplotlib.axes.Axes - @type plot_config: PlotConfig - @type data: DataFrame - @type value_column: Str - """ - - style = plot_config.observationsStyle() - - # adjusting the top and bottom bar, according to the line width/thickness - def cap_size(line_with): - return 0 if line_with == 0 else math.log(line_with, 1.2)+3 - - # line style set to 'off' toggles errorbar visibility - if style.line_style == '': - style.width = 0 - - errorbars = axes.errorbar(x=data.index.values, y=data[value_column].values, - yerr=data["STD_%s" % value_column].values, - fmt=style.line_style, ecolor=style.color, color=style.color, - capsize=cap_size(style.width), - capthick=style.width, #same as width/thickness on error line - alpha=style.alpha, - linewidth=0, - marker=style.marker, - ms=style.size, - elinewidth=style.width, zorder=1000) - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/plot_tools.py b/ThirdParty/Ert/python/python/ert_gui/plottery/plots/plot_tools.py deleted file mode 100644 index 7e2a3b93a2..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/plot_tools.py +++ /dev/null @@ -1,109 +0,0 @@ -class PlotTools(object): - @staticmethod - def showGrid(axes, plot_context): - config = plot_context.plotConfig() - if config.isGridEnabled(): - axes.grid() - - - @staticmethod - def showLegend(axes, plot_context): - config = plot_context.plotConfig() - if config.isLegendEnabled() and len(config.legendItems()) > 0: - axes.legend(config.legendItems(), config.legendLabels(), numpoints=1) - - - @staticmethod - def _getXAxisLimits(plot_context): - """ @type plot_context: ert_gui.plottery.PlotContext """ - limits = plot_context.plotConfig().limits - axis_name = plot_context.x_axis - - if axis_name == plot_context.VALUE_AXIS: - return limits.value_limits - elif axis_name == plot_context.COUNT_AXIS: - # return limits.count_limits - return None # Histogram takes care of itself - elif axis_name == plot_context.DATE_AXIS: - return limits.date_limits - elif axis_name == plot_context.DENSITY_AXIS: - return limits.density_limits - elif axis_name == plot_context.DEPTH_AXIS: - return limits.depth_limits - elif axis_name == plot_context.INDEX_AXIS: - return limits.index_limits - - return None # No limits set - - @staticmethod - def _getYAxisLimits(plot_context): - """ @type plot_context: ert_gui.plottery.PlotContext """ - limits = plot_context.plotConfig().limits - axis_name = plot_context.y_axis - - if axis_name == plot_context.VALUE_AXIS: - return limits.value_limits - elif axis_name == plot_context.COUNT_AXIS: - # return limits.count_limits - return None # Histogram takes care of itself - elif axis_name == plot_context.DATE_AXIS: - return limits.date_limits - elif axis_name == plot_context.DENSITY_AXIS: - return limits.density_limits - elif axis_name == plot_context.DEPTH_AXIS: - return limits.depth_limits - elif axis_name == plot_context.INDEX_AXIS: - return limits.index_limits - - return None # No limits set - - - - @staticmethod - def finalizePlot(plot_context, axes, default_x_label="Unnamed", default_y_label="Unnamed"): - """ - @type plot_context: ert_gui.plottery.PlotContext - @type axes: - @type default_x_label: - @type default_y_label: - """ - - PlotTools.showLegend(axes, plot_context) - PlotTools.showGrid(axes, plot_context) - - PlotTools.__setupLabels(plot_context, default_x_label, default_y_label) - - plot_config = plot_context.plotConfig() - axes.set_xlabel(plot_config.xLabel()) - axes.set_ylabel(plot_config.yLabel()) - - x_axis_limits = PlotTools._getXAxisLimits(plot_context) - if x_axis_limits is not None: - axes.set_xlim(*x_axis_limits) - - y_axis_limits = PlotTools._getYAxisLimits(plot_context) - if y_axis_limits is not None: - axes.set_ylim(*y_axis_limits) - - axes.set_title(plot_config.title()) - - if plot_context.isDateSupportActive(): - plot_context.figure().autofmt_xdate() - - - @staticmethod - def __setupLabels(plot_context, default_x_label, default_y_label): - ert = plot_context.ert() - key = plot_context.key() - config = plot_context.plotConfig() - - if config.xLabel() is None: - config.setXLabel(default_x_label) - - if config.yLabel() is None: - config.setYLabel(default_y_label) - - if ert.eclConfig().hasRefcase() and key in ert.eclConfig().getRefcase(): - unit = ert.eclConfig().getRefcase().unit(key) - if unit != "": - config.setYLabel(unit) \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/refcase.py b/ThirdParty/Ert/python/python/ert_gui/plottery/plots/refcase.py deleted file mode 100644 index 4a0836bf1b..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/refcase.py +++ /dev/null @@ -1,26 +0,0 @@ -def plotRefcase(plot_context, axes): - ert = plot_context.ert() - key = plot_context.key() - config = plot_context.plotConfig() - data_gatherer = plot_context.dataGatherer() - - if config.isRefcaseEnabled() and data_gatherer.hasRefcaseGatherFunction(): - refcase_data = data_gatherer.gatherRefcaseData(ert, key) - - if not refcase_data.empty: - _plotRefcase(axes, config, refcase_data) - - -def _plotRefcase(axes, plot_config, data): - """ - @type axes: matplotlib.axes.Axes - @type plot_config: PlotConfig - @type data: DataFrame - """ - - style = plot_config.refcaseStyle() - - lines = axes.plot_date(x=data.index.values, y=data, color=style.color, alpha=style.alpha, marker=style.marker, linestyle=style.line_style, linewidth=style.width, markersize=style.size) - - if len(lines) > 0 and style.isVisible(): - plot_config.addLegendItem("Refcase", lines[0]) \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/statistics.py b/ThirdParty/Ert/python/python/ert_gui/plottery/plots/statistics.py deleted file mode 100644 index 79b6f99067..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/plottery/plots/statistics.py +++ /dev/null @@ -1,117 +0,0 @@ -from matplotlib.patches import Rectangle -from matplotlib.lines import Line2D -from pandas import DataFrame -from .refcase import plotRefcase -from .observations import plotObservations -from .plot_tools import PlotTools - - -def plotStatistics(plot_context): - """ @type plot_context: ert_gui.plottery.PlotContext """ - ert = plot_context.ert() - key = plot_context.key() - config = plot_context.plotConfig() - """:type: ert_gui.plotter.PlotConfig """ - axes = plot_context.figure().add_subplot(111) - """:type: matplotlib.axes.Axes """ - - plot_context.y_axis = plot_context.VALUE_AXIS - plot_context.x_axis = plot_context.DATE_AXIS - - case_list = plot_context.cases() - for case in case_list: - data = plot_context.dataGatherer().gatherData(ert, case, key) - - if not data.empty: - if not data.index.is_all_dates: - plot_context.deactivateDateSupport() - plot_context.x_axis = plot_context.INDEX_AXIS - - style = config.getStatisticsStyle("mean") - rectangle = Rectangle((0, 0), 1, 1, color=style.color, alpha=0.8) # creates rectangle patch for legend use. - config.addLegendItem(case, rectangle) - - statistics_data = DataFrame() - std_dev_factor = config.getStandardDeviationFactor() - - statistics_data["Minimum"] = data.min(axis=1) - statistics_data["Maximum"] = data.max(axis=1) - statistics_data["Mean"] = data.mean(axis=1) - statistics_data["p10"] = data.quantile(0.1, axis=1) - statistics_data["p33"] = data.quantile(0.33, axis=1) - statistics_data["p50"] = data.quantile(0.50, axis=1) - statistics_data["p67"] = data.quantile(0.67, axis=1) - statistics_data["p90"] = data.quantile(0.90, axis=1) - std = data.std(axis=1) * std_dev_factor - statistics_data["std+"] = statistics_data["Mean"] + std - statistics_data["std-"] = statistics_data["Mean"] - std - - _plotPercentiles(axes, config, statistics_data, case) - config.nextColor() - - _addStatisticsLegends(plot_config=config) - - plotRefcase(plot_context, axes) - plotObservations(plot_context, axes) - - default_x_label = "Date" if plot_context.isDateSupportActive() else "Index" - PlotTools.finalizePlot(plot_context, axes, default_x_label=default_x_label, default_y_label="Value") - -def _addStatisticsLegends(plot_config): - _addStatisticsLegend(plot_config, "mean") - _addStatisticsLegend(plot_config, "p50") - _addStatisticsLegend(plot_config, "min-max", 0.2) - _addStatisticsLegend(plot_config, "p10-p90", 0.4) - _addStatisticsLegend(plot_config, "std", 0.4) - _addStatisticsLegend(plot_config, "p33-p67", 0.6) - -def _addStatisticsLegend(plot_config, style_name, alpha_multiplier=1.0): - style = plot_config.getStatisticsStyle(style_name) - if style.isVisible(): - if style.line_style == "#": - rectangle = Rectangle((0, 0), 1, 1, color='black', alpha=style.alpha * alpha_multiplier) # creates rectangle patch for legend use. - plot_config.addLegendItem(style.name, rectangle) - else: - line = Line2D([], [], color='black', marker=style.marker, linestyle=style.line_style, linewidth=style.width, alpha=style.alpha, markersize=style.size) - plot_config.addLegendItem(style.name, line) - - -def _plotPercentiles(axes, plot_config, data, ensemble_label): - """ - @type axes: matplotlib.axes.Axes - @type plot_config: ert_gui.plottery.PlotConfig - @type data: DataFrame - @type ensemble_label: Str - """ - style = plot_config.getStatisticsStyle("mean") - if style.isVisible(): - axes.plot(data.index.values, data["Mean"].values, alpha=style.alpha, linestyle=style.line_style, color=style.color, marker=style.marker, linewidth=style.width, markersize=style.size) - - style = plot_config.getStatisticsStyle("p50") - if style.isVisible(): - axes.plot(data.index.values, data["p50"].values, alpha=style.alpha, linestyle=style.line_style, color=style.color, marker=style.marker, linewidth=style.width, markersize=style.size) - - style = plot_config.getStatisticsStyle("std") - _plotPercentile(axes, style, data.index.values, data["std+"].values, data["std-"].values, 0.5) - - style = plot_config.getStatisticsStyle("min-max") - _plotPercentile(axes, style, data.index.values, data["Maximum"].values, data["Minimum"].values, 0.5) - - style = plot_config.getStatisticsStyle("p10-p90") - _plotPercentile(axes, style, data.index.values, data["p90"].values, data["p10"].values, 0.5) - - style = plot_config.getStatisticsStyle("p33-p67") - _plotPercentile(axes, style, data.index.values, data["p67"].values, data["p33"].values, 0.5) - - -def _plotPercentile(axes, style, index_values, top_line_data, bottom_line_data, alpha_multiplier): - alpha = style.alpha - line_style = style.line_style - color = style.color - marker = style.marker - - if line_style == "#": - axes.fill_between(index_values, bottom_line_data, top_line_data, alpha=alpha * alpha_multiplier, color=color) - elif style.isVisible(): - axes.plot(index_values, bottom_line_data, alpha=alpha, linestyle=line_style, color=color, marker=marker, linewidth=style.width, markersize=style.size) - axes.plot(index_values, top_line_data, alpha=alpha, linestyle=line_style, color=color, marker=marker, linewidth=style.width, markersize=style.size) diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/shell/CMakeLists.txt deleted file mode 100644 index c825821338..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - analysis_module.py - cases.py - custom_kw_keys.py - debug.py - export.py - ertshell.py - ert_shell_collection.py - gen_data_keys.py - gen_kw_keys.py - observations.py - plot_settings.py - plugins.py - results.py - ert_shell_context.py - server.py - shell_plot.py - simulations.py - smoother.py - storage.py - summary_keys.py - workflows.py -) - -add_python_package("python.ert_gui.shell" ${PYTHON_INSTALL_PREFIX}/ert_gui/shell "${PYTHON_SOURCES}" True) - -add_subdirectory(libshell) diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/__init__.py b/ThirdParty/Ert/python/python/ert_gui/shell/__init__.py deleted file mode 100644 index 52fb97e60b..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -from .ert_shell_context import ErtShellContext - -def isConfigLoaded(shell_context, verbose=True): - """ @rtype: bool """ - if shell_context.ert() is None: - if verbose: - print("Error: A config file has not been loaded!") - return False - return True - -def assertConfigLoaded(func): - def wrapper(self, *args, **kwargs): - # prefixes should be either do_ or complete_ - if func.__name__.startswith("complete_"): - result = [] - verbose = False - else: - result = False - verbose = True - - if isConfigLoaded(self.shellContext(), verbose=verbose): - result = func(self, *args, **kwargs) - - return result - - wrapper.__doc__ = func.__doc__ - wrapper.__name__ = func.__name__ - - return wrapper - -from .ert_shell_collection import ErtShellCollection -from .plot_settings import PlotSettings -from .shell_plot import ShellPlot -from .ertshell import ErtShell diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/analysis_module.py b/ThirdParty/Ert/python/python/ert_gui/shell/analysis_module.py deleted file mode 100644 index 26b839c28b..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/analysis_module.py +++ /dev/null @@ -1,119 +0,0 @@ -from ert_gui.shell import assertConfigLoaded, ErtShellCollection -from ert_gui.shell.libshell import extractFullArgument, autoCompleteListWithSeparator, matchItems, splitArguments - - -class AnalysisModule(ErtShellCollection): - def __init__(self, parent): - super(AnalysisModule, self).__init__("analysis_module", parent) - - self.addShellProperty(name="active_module", - getter=AnalysisModule.getAnalysisModule, - setter=AnalysisModule.setAnalysisModule, - validator=AnalysisModule.validateAnalysisModule, - completer=AnalysisModule.completeAnalysisModule, - help_arguments="[analysis_module]", - help_message="Show or set the current analysis module.", - pretty_attribute="Active Module") - - self.addShellFunction(name="list", - function=AnalysisModule.list, - help_message="Shows a list of the available analysis modules.") - - self.addShellFunction(name="variables", - function=AnalysisModule.variables, - help_message="Shows a list of the available options for the current analysis module.") - - self.addShellFunction(name="set", - function=AnalysisModule.set, - completer=AnalysisModule.completeSet, - help_arguments=" ", - help_message="Set a variable value.") - - - @assertConfigLoaded - def getAnalysisModule(self): - return self.ert().analysisConfig().activeModuleName() - - - @assertConfigLoaded - def setAnalysisModule(self, analysis_module_name): - self.ert().analysisConfig().selectModule(analysis_module_name) - - - @assertConfigLoaded - def validateAnalysisModule(self, line): - keys = matchItems(line, self.getAnalysisModules()) - - if len(keys) == 0 or len(keys) > 1: - raise ValueError("Must enter a single valid Analysis Module") - - return list(keys)[0] - - - def completeAnalysisModule(self, text, line, begidx, endidx): - key = extractFullArgument(line, endidx) - return autoCompleteListWithSeparator(key, self.getAnalysisModules()) - - - @assertConfigLoaded - def getAnalysisModules(self): - analysis_modules = self.ert().analysisConfig().getModuleList() - items = [analysis_module for analysis_module in analysis_modules] - return items - - - @assertConfigLoaded - def list(self, args): - items = self.getAnalysisModules() - self.columnize(items) - - - @assertConfigLoaded - def variables(self, args): - active_module = self.ert().analysisConfig().getActiveModule() - variables = active_module.getVariableNames() - - format = " %-20s %-6s %-20s %s" - print(format % ("Name", "Type", "Value", "Description")) - - for variable_name in variables: - variable_type = active_module.getVariableType(variable_name).__name__ - variable_value = active_module.getVariableValue(variable_name) - variable_description = active_module.getVariableDescription(variable_name) - print(format % (variable_name, variable_type, variable_value, variable_description)) - - - @assertConfigLoaded - def set(self, line): - arguments = splitArguments(line) - - if len(arguments) > 1: - active_module = self.ert().analysisConfig().getActiveModule() - variables = active_module.getVariableNames() - variable, argument = line.split(" ", 1) - - if not variable in variables: - self.lastCommandFailed("Variable with name: %s, not available in analysis module!" % variable) - else: - variable_type = active_module.getVariableType(variable) - try: - value = variable_type(argument) - active_module.setVar(variable, argument) - except ValueError: - self.lastCommandFailed("Unable to convert '%s' into to a: %s" % (argument, variable_type.__name__)) - - else: - self.lastCommandFailed("This keyword requires a variable name and a value.") - - - - @assertConfigLoaded - def completeSet(self, text, line, begidx, endidx): - arguments = splitArguments(line) - - if len(arguments) > 2 or len(arguments) == 2 and not text: - return [] - - active_module = self.ert().analysisConfig().getActiveModule() - variables = active_module.getVariableNames() - return autoCompleteListWithSeparator(text, variables) \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/cases.py b/ThirdParty/Ert/python/python/ert_gui/shell/cases.py deleted file mode 100644 index 4e334c3ddc..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/cases.py +++ /dev/null @@ -1,174 +0,0 @@ -from ert.enkf import EnkfVarType - -from ert_gui.shell import assertConfigLoaded, ErtShellCollection -from ert_gui.shell.libshell import autoCompleteList, splitArguments -from ert_gui.shell.libshell.shell_tools import boolValidator - - -class Cases(ErtShellCollection): - def __init__(self, parent): - super(Cases, self).__init__("case", parent) - self._show_hidden = False - - self.addShellFunction(name="list", - function=Cases.list, - help_message="Shows a list of all available cases.") - - self.addShellFunction(name="select", - function=Cases.select, - completer=Cases.completeSelect, - help_arguments="", - help_message="Change the current file system to the named case.") - - self.addShellFunction(name="create", - function=Cases.create, - help_arguments="", - help_message="Create a new case with the specified named.") - - self.addShellFunction(name="summary_key_set", - function=Cases.summaryKeySet, - help_message="Shows a list of the stored summary keys.") - - self.addShellFunction(name="state", - function=Cases.state, - completer=Cases.completeFilesystem, - help_arguments="[case_name]", - help_message="Shows a list of the states of the individual realizations. " - "Uses the current case if no case name is provided.") - - self.addShellFunction(name="time_map", - function=Cases.timemap, - completer=Cases.completeFilesystem, - help_arguments="[case_name]", - help_message="Shows a list of the time/report steps of the case. " - "Uses the current case if no case name is provided.") - - self.addShellFunction(name="initialize", - function=Cases.initialize, - completer=Cases.completeFilesystem, - help_arguments="[case_name]", - help_message="Initialize the selected case from scratch. " - "Uses the current if no case name is provided") - - self.addShellProperty(name="show_hidden", - getter=Cases.showHidden, - setter=Cases.setShowHidden, - validator=boolValidator, - completer=["true", "false"], - help_arguments="[true|false]", - help_message="Show or set the visibility of hidden cases", - pretty_attribute="Hidden case visibility") - - - def showHidden(self): - return self._show_hidden - - def setShowHidden(self, show_hidden): - self._show_hidden = show_hidden - - @assertConfigLoaded - def list(self, line): - fs_list = self.getFileSystemNames() - current_fs = self.ert().getEnkfFsManager().getCurrentFileSystem().getCaseName() - max_length = max([len(fs) for fs in fs_list]) - case_format = "%1s %-" + str(max_length) + "s %s" - for fs in fs_list: - current = "" - if fs == current_fs: - current = "*" - - state = "No Data" - if self.ert().getEnkfFsManager().caseHasData(fs): - state = "Data" - - print(case_format % (current, fs, state)) - - def getFileSystemNames(self): - fsm = self.ert().getEnkfFsManager() - if self._show_hidden: - return [case for case in fsm.getCaseList()] - else: - return [case for case in fsm.getCaseList() if not fsm.isCaseHidden(case)] - - @assertConfigLoaded - def select(self, case_name): - case_name = case_name.strip() - if case_name in self.getFileSystemNames(): - fs = self.ert().getEnkfFsManager().getFileSystem(case_name) - self.ert().getEnkfFsManager().switchFileSystem(fs) - else: - self.lastCommandFailed("Unknown case '%s'" % case_name) - - @assertConfigLoaded - def completeSelect(self, text, line, begidx, endidx): - return autoCompleteList(text, self.getFileSystemNames()) - - @assertConfigLoaded - def create(self, line): - arguments = splitArguments(line) - - if len(arguments) == 1: - case_name = arguments[0] - if case_name not in self.getFileSystemNames(): - fs = self.ert().getEnkfFsManager().getFileSystem(case_name) - self.ert().getEnkfFsManager().switchFileSystem(fs) - else: - self.lastCommandFailed("Case '%s' already exists!" % case_name) - else: - self.lastCommandFailed("Expected one argument: received: '%s'" % line) - - @assertConfigLoaded - def summaryKeySet(self, line): - fs = self.ert().getEnkfFsManager().getCurrentFileSystem() - key_set = sorted([key for key in fs.getSummaryKeySet().keys()]) - self.columnize(key_set) - - @assertConfigLoaded - def state(self, case_name): - case_name = case_name.strip() - if not case_name: - case_name = self.ert().getEnkfFsManager().getCurrentFileSystem().getCaseName() - elif not case_name in self.getFileSystemNames(): - self.lastCommandFailed("Unknown case name '%s'" % case_name) - return False - - state_map = self.ert().getEnkfFsManager().getStateMapForCase(case_name) - states = ["%d: %s" % (index, state) for index, state in enumerate(state_map)] - - self.columnize(states) - - @assertConfigLoaded - def completeFilesystem(self, text, line, begidx, endidx): - return autoCompleteList(text, self.getFileSystemNames()) - - @assertConfigLoaded - def timemap(self, case_name): - case_name = case_name.strip() - if not case_name: - case_name = self.ert().getEnkfFsManager().getCurrentFileSystem().getCaseName() - elif not case_name in self.getFileSystemNames(): - self.lastCommandFailed("Unknown case name '%s'" % case_name) - return False - - time_map = self.ert().getEnkfFsManager().getTimeMapForCase(case_name) - report_steps = ["%d: %s" % (index, report_step_time) for index, report_step_time in enumerate(time_map)] - - self.columnize(report_steps) - - - @assertConfigLoaded - def initialize(self, case_name): - case_name = case_name.strip() - if not case_name: - case_name = self.ert().getEnkfFsManager().getCurrentFileSystem().getCaseName() - elif not case_name in self.getFileSystemNames(): - self.lastCommandFailed("Unknown case name '%s'" % case_name) - return False - - ert = self.ert() - fs = ert.getEnkfFsManager().getFileSystem(case_name) - size = self.ert().getEnsembleSize() - parameters = ert.ensembleConfig().getKeylistFromVarType(EnkfVarType.PARAMETER) - ert.getEnkfFsManager().initializeCaseFromScratch(fs , parameters, 0, size - 1) - - print("Case: '%s' initialized") diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/custom_kw_keys.py b/ThirdParty/Ert/python/python/ert_gui/shell/custom_kw_keys.py deleted file mode 100644 index d1360fe27d..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/custom_kw_keys.py +++ /dev/null @@ -1,37 +0,0 @@ -from ert_gui.shell import assertConfigLoaded, ShellPlot, ErtShellCollection -from ert_gui.plottery import PlotDataGatherer as PDG - - -class CustomKWKeys(ErtShellCollection): - def __init__(self, parent): - super(CustomKWKeys, self).__init__("custom_kw", parent) - - self.addShellFunction(**{"name": "list", - "function": CustomKWKeys.list, - "help_message": "List all CustomKW keys."}) - - self.__plot_data_gatherer = None - - ShellPlot.addPrintSupport(self, "CustomKW") - ShellPlot.addHistogramPlotSupport(self, "CustomKW") - ShellPlot.addGaussianKDEPlotSupport(self, "CustomKW") - ShellPlot.addDistributionPlotSupport(self, "CustomKW") - ShellPlot.addCrossCaseStatisticsPlotSupport(self, "CustomKW") - - - def fetchSupportedKeys(self): - return self.ert().getKeyManager().customKwKeys() - - - def plotDataGatherer(self): - if self.__plot_data_gatherer is None: - custom_kw_pdg = PDG.gatherCustomKwData - custom_kw_key_manager = self.ert().getKeyManager().isCustomKwKey - self.__plot_data_gatherer = PDG(custom_kw_pdg, custom_kw_key_manager) - - return self.__plot_data_gatherer - - - @assertConfigLoaded - def list(self, line): - self.columnize(self.fetchSupportedKeys()) diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/debug.py b/ThirdParty/Ert/python/python/ert_gui/shell/debug.py deleted file mode 100644 index bdc8a035e8..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/debug.py +++ /dev/null @@ -1,59 +0,0 @@ -from ert import Version -from ert_gui.shell import assertConfigLoaded, ErtShellCollection - - -class Debug(ErtShellCollection): - def __init__(self, parent): - super(Debug, self).__init__("debug", parent) - - self.addShellFunction(name="site_config", function=Debug.siteConfig, help_message="Show the path to the current site_config") - self.addShellFunction(name="version", function=Debug.version, help_message="Show the internalized ert version number") - self.addShellFunction(name="timestamp", function=Debug.timestamp, help_message="Show the build timestamp") - self.addShellFunction(name="git_commit", function=Debug.gitCommit, help_message="Show the git commit") - self.addShellFunction(name="info", function=Debug.info, help_message="Shows site_config, version, timestamp and Git Commit") - self.addShellFunction(name="last_plugin_result", function=Debug.lastPluginResult, help_message="Shows the last plugin result.") - self.addShellFunction(name="eval", function=Debug.eval, help_arguments="", help_message="Evaluate a Python expression. The last plugin result is defined as: x") - - self.shellContext()["debug"] = self - self.__last_plugin_result = None - self.__local_variables = {} - - def setLastPluginResult(self, result): - self.__last_plugin_result = result - - @assertConfigLoaded - def siteConfig(self, line): - print("Site Config: %s" % self.ert().siteConfig().getLocation()) - - def version(self, line): - print("Version: %s" % Version.getVersion()) - - def timestamp(self, line): - print("Timestamp: %s" % Version.getBuildTime()) - - def gitCommit(self, line): - print("Git Commit: %s" % Version.getGitCommit(True)) - - @assertConfigLoaded - def info(self, line): - print("Site Config: %s" % self.ert().siteConfig().getLocation()) - print("Version: %s" % Version.getVersion()) - print("Timestamp: %s" % Version.getBuildTime()) - print("Git Commit: %s" % Version.getGitCommit(True)) - - def lastPluginResult(self, line): - print("Last plugin result: %s" % self.__last_plugin_result) - - def eval(self, line): - line = line.strip() - - if len(line) > 0: - self.__local_variables["x"] = self.__last_plugin_result - try: - exec(line, self.__local_variables) - except Exception as e: - print("Error: The expression caused an exception!") - print(e) - else: - print("Error: A python expression is required!") - diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/ert_shell_collection.py b/ThirdParty/Ert/python/python/ert_gui/shell/ert_shell_collection.py deleted file mode 100644 index b003be1be6..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/ert_shell_collection.py +++ /dev/null @@ -1,19 +0,0 @@ -from ert_gui.shell import assertConfigLoaded -from ert_gui.shell.libshell import ShellCollection - - -class ErtShellCollection(ShellCollection): - def __init__(self, name, parent=None, description="No description available"): - super(ErtShellCollection, self).__init__(name, parent, description) - - def shellContext(self): - """ @rtype: ert_gui.shell.ErtShellContext """ - return super(ErtShellCollection, self).shellContext() - - @assertConfigLoaded - def ert(self): - """ @rtype: ert.enkf.enkf_main.EnKFMain """ - return self.shellContext().ert() - - def columnize(self, items, displaywidth=80): - self.shellContext().shell().columnize(items, displaywidth=displaywidth) \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/ert_shell_context.py b/ThirdParty/Ert/python/python/ert_gui/shell/ert_shell_context.py deleted file mode 100644 index 2cece5ef68..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/ert_shell_context.py +++ /dev/null @@ -1,20 +0,0 @@ -from ert_gui.shell.libshell import ShellContext - - -class ErtShellContext(ShellContext): - def __init__(self, shell): - super(ErtShellContext, self).__init__(shell) - self.__ert = None - """ :type: EnKFMain """ - - def ert(self): - """ @rtype: ert.enkf.enkf_main.EnKFMain """ - return self.__ert - - def setErt(self, ert): - """ @type ert: ert.enkf.enkf_main.EnKFMain """ - if self.__ert is not None and self.__ert != ert: - self.__ert.free() - self.__ert = None - - self.__ert = ert \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/ertshell.py b/ThirdParty/Ert/python/python/ert_gui/shell/ertshell.py deleted file mode 100644 index b061b86b19..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/ertshell.py +++ /dev/null @@ -1,192 +0,0 @@ -import atexit -from cmd import Cmd -import readline -import os - -from ert.enkf import EnKFMain -import ert_gui -from ert_gui.shell import PlotSettings - -from ert_gui.shell.analysis_module import AnalysisModule -from ert_gui.shell.custom_kw_keys import CustomKWKeys -from ert_gui.shell.debug import Debug -from ert_gui.shell.cases import Cases -from ert_gui.shell.export import Export -from ert_gui.shell.gen_data_keys import GenDataKeys -from ert_gui.shell.gen_kw_keys import GenKWKeys -from ert_gui.shell.results import Results -from ert_gui.shell.plugins import Plugins -from ert_gui.shell.simulations import Simulations -from ert_gui.shell.smoother import Smoother -from ert_gui.shell.storage import Storage -from ert_gui.shell.summary_keys import SummaryKeys -from ert_gui.shell.workflows import Workflows -from ert_gui.shell.observations import Observations -from ert_gui.shell.server import Server -from ert_gui.shell.libshell import extractFullArgument, getPossibleFilenameCompletions -from ert_gui.shell import ErtShellContext - -import matplotlib - -class ErtShell(Cmd): - prompt = "--> " - intro = " :::::::::::::::::::::::::::::::::::::\n" \ - " :: ::\n" \ - " :: ______ ______ _______ ::\n" \ - " :: | ____| | __ \ |__ __| ::\n" \ - " :: | |__ | |__) | | | ::\n" \ - " :: | __| | _ / | | ::\n" \ - " :: | |____ | | \ \ | | ::\n" \ - " :: |______| |_| \_\ |_| ::\n" \ - " :: ::\n" \ - " :: Ensemble based Reservoir Tool ::\n" \ - " :::::::::::::::::::::::::::::::::::::\n" \ - "\n" \ - "Interactive shell for working with ERT.\n" \ - "\n" \ - "-- Type help for a list of supported commands.\n" \ - "-- Type exit or press Ctrl+D to end the shell session.\n" \ - "-- Press Tab for auto completion.\n" \ - "-- Arrow up/down for history.\n" - - - def __init__(self, forget_history=False): - Cmd.__init__(self) - - self._children = [] - - self._shell_context = ErtShellContext(self) - - if not forget_history: - self._history_file = os.path.join(os.path.expanduser("~/.ertshell/ertshell.history")) - self._init_history() - else: - self._history_file = None - - matplotlib.rcParams["interactive"] = True - matplotlib.rcParams["mathtext.default"] = "regular" - matplotlib.rcParams["verbose.level"] = "helpful" - matplotlib.rcParams["verbose.fileo"] = "sys.stderr" - - try: - matplotlib.style.use("ggplot") # available from version 1.4 - except AttributeError: - pass - - Debug(self) - PlotSettings(self) - Cases(self) - Workflows(self) - Plugins(self) - SummaryKeys(self) - GenDataKeys(self) - GenKWKeys(self) - Results(self) - Simulations(self) - CustomKWKeys(self) - AnalysisModule(self) - Smoother(self) - Observations(self) - Export(self) - Storage(self) - Server(self) - - self._last_command_failed = False - - atexit.register(self._cleanup) - - def _init_history(self): - try: - readline.set_history_length(100) - readline.read_history_file(self._history_file) - except IOError: - pass - atexit.register(self._save_history) - - def _save_history(self): - if self._history_file is not None: - if not os.path.exists(os.path.dirname(self._history_file)): - os.makedirs(os.path.dirname(self._history_file)) - - readline.write_history_file(self._history_file) - - def _cleanup(self): - print("Performing cleanup...") - - for child in self._children: - child.cleanup() - - if self.shellContext().ert() is not None: - self.shellContext().setErt(None) - - - def addChild(self, child): - self._children.append(child) - - def emptyline(self): - pass - - def do_load_config(self, config_file): - if os.path.exists(config_file) and os.path.isfile(config_file): - self.shellContext().setErt(EnKFMain(config_file)) - ert_gui.configureErtNotifier(self.shellContext().ert(), config_file) - else: - self.lastCommandFailed("Config file '%s' not found!\n" % config_file) - - def complete_load_config(self, text, line, begidx, endidx): - argument = extractFullArgument(line, endidx) - return getPossibleFilenameCompletions(argument) - - - def help_load_config(self): - print("\n".join(("load_config config_file", - " Loads a config file."))) - - def do_cwd(self, line): - cwd = os.getcwd() - print("Current directory: %s" % cwd) - - def help_cwd(self): - print("Show the current directory.") - - def do_exit(self, line): - return True - - def help_exit(self): - return "\n".join(("exit", - " End the shell session.")), - - do_EOF = do_exit - - def help_EOF(self): - return "\n".join(("EOF", - " The same as exit. (Ctrl+D)")), - - def shellContext(self): - return self._shell_context - - def default(self, line): - Cmd.default(self, line) - self._last_command_failed = True - - def precmd(self, line): - self._last_command_failed = False - return Cmd.precmd(self, line) - - def invokeCommand(self, line): - self._last_command_failed = False - self.onecmd(line) - return not self._last_command_failed - - def lastCommandFailed(self, message): - print("Error: %s" % message) - self._last_command_failed = True - - def get_names(self): - return dir(self) - - - - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/export.py b/ThirdParty/Ert/python/python/ert_gui/shell/export.py deleted file mode 100644 index e08d4915ba..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/export.py +++ /dev/null @@ -1,68 +0,0 @@ -from __future__ import print_function -from ert.util import IntVector -from ert.enkf.enums import ErtImplType -from ert.enkf.data import EnkfNode -from ert_gui.shell import assertConfigLoaded, ErtShellCollection -from ert_gui.shell.libshell import autoCompleteList, splitArguments - - -class Export(ErtShellCollection): - DEFAULT_EXPORT_PATH = "export/%s/%s_%%d" - - def __init__(self, parent): - super(Export, self).__init__("export", parent) - default_path = Export.DEFAULT_EXPORT_PATH % ("{KEY}", "{KEY}") - - self.addShellFunction(name="FIELD", - function=Export.exportFIELD, - completer=Export.completeFIELD, - help_arguments=" [%s] [1,4,7-10]" % default_path, - help_message="Export parameters; path and realisations in [...] are optional.") - - def supportedFIELDKeys(self): - ens_config = self.ert().ensembleConfig() - key_list = ens_config.getKeylistFromImplType(ErtImplType.FIELD) - return key_list - - @assertConfigLoaded - def completeFIELD(self, text, line, begidx, endidx): - arguments = splitArguments(line) - - if len(arguments) > 2 or len(arguments) == 2 and not text: - return [] - - return autoCompleteList(text, self.supportedFIELDKeys()) - - @assertConfigLoaded - def exportFIELD(self, line): - arguments = splitArguments(line) - - if len(arguments) >= 1: - ens_config = self.ert().ensembleConfig() - key = arguments[0] - if key in self.supportedFIELDKeys(): - config_node = ens_config[key] - if len(arguments) >= 2: - path_fmt = arguments[1] - else: - path_fmt = Export.DEFAULT_EXPORT_PATH % (key, key) + ".grdecl" - - if len(arguments) >= 3: - range_string = "".join(arguments[2:]) - iens_list = IntVector.active_list(range_string) - else: - ens_size = self.ert().getEnsembleSize() - iens_list = IntVector.createRange(0, ens_size, 1) - - fs_manager = self.ert().getEnkfFsManager() - fs = fs_manager.getCurrentFileSystem() - mc = self.ert().getModelConfig() - init_file = config_node.getInitFile(mc.getRunpathFormat()) - if init_file: - print('Using init file: %s' % init_file) - - EnkfNode.exportMany(config_node, path_fmt, fs, iens_list, arg=init_file) - else: - self.lastCommandFailed("No such FIELD node: %s" % key) - else: - self.lastCommandFailed("Expected at least one argument: received: '%s'" % line) diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/gen_data_keys.py b/ThirdParty/Ert/python/python/ert_gui/shell/gen_data_keys.py deleted file mode 100644 index cf6f7b67b9..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/gen_data_keys.py +++ /dev/null @@ -1,32 +0,0 @@ -from ert_gui.plottery import PlotDataGatherer as PDG -from ert_gui.shell import ShellPlot, assertConfigLoaded, ErtShellCollection - - -class GenDataKeys(ErtShellCollection): - def __init__(self, parent): - super(GenDataKeys, self).__init__("gen_data", parent) - self.addShellFunction(name="list", function=GenDataKeys.list, help_message="Shows a list of all available GenData keys.") - - self.__plot_data_gatherer = None - - ShellPlot.addPrintSupport(self, "GenData") - ShellPlot.addEnsemblePlotSupport(self, "GenData") - ShellPlot.addQuantilesPlotSupport(self, "GenData") - - - def fetchSupportedKeys(self): - return self.ert().getKeyManager().genDataKeys() - - def plotDataGatherer(self): - if self.__plot_data_gatherer is None: - gen_data_pdg = PDG.gatherGenDataData - gen_data_key_manager = self.ert().getKeyManager().isGenDataKey - gen_data_observation_pdg = PDG.gatherGenDataObservationData - pdg = PDG(gen_data_pdg, gen_data_key_manager, observationGatherFunc=gen_data_observation_pdg) - self.__plot_data_gatherer = pdg - - return self.__plot_data_gatherer - - @assertConfigLoaded - def list(self, line): - self.columnize(self.fetchSupportedKeys()) diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/gen_kw_keys.py b/ThirdParty/Ert/python/python/ert_gui/shell/gen_kw_keys.py deleted file mode 100644 index 104f006185..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/gen_kw_keys.py +++ /dev/null @@ -1,31 +0,0 @@ -from ert_gui.shell import ShellPlot, assertConfigLoaded, ErtShellCollection -from ert_gui.plottery import PlotDataGatherer as PDG - - -class GenKWKeys(ErtShellCollection): - def __init__(self, parent): - super(GenKWKeys, self).__init__("gen_kw", parent) - self.addShellFunction(name="list", function=GenKWKeys.list, help_message="Shows a list of all available GenKW keys.") - - self.__plot_data_gatherer = None - - ShellPlot.addPrintSupport(self, "GenKW") - ShellPlot.addHistogramPlotSupport(self, "GenKW") - ShellPlot.addGaussianKDEPlotSupport(self, "GenKW") - ShellPlot.addDistributionPlotSupport(self, "GenKW") - ShellPlot.addCrossCaseStatisticsPlotSupport(self, "GenKW") - - def fetchSupportedKeys(self): - return self.ert().getKeyManager().genKwKeys() - - def plotDataGatherer(self): - if self.__plot_data_gatherer is None: - gen_kw_pdg = PDG.gatherGenKwData - gen_kw_key_manager = self.ert().getKeyManager().isGenKwKey - self.__plot_data_gatherer = PDG(gen_kw_pdg, gen_kw_key_manager) - - return self.__plot_data_gatherer - - @assertConfigLoaded - def list(self, line): - self.columnize(self.fetchSupportedKeys()) diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/libshell/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/shell/libshell/CMakeLists.txt deleted file mode 100644 index 11b4cb7ad0..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/libshell/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - shell_collection.py - shell_context.py - shell_function.py - shell_path_tools.py - shell_property.py - shell_tools.py -) - -add_python_package("python.ert_gui.shell.libshell" ${PYTHON_INSTALL_PREFIX}/ert_gui/shell/libshell "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/libshell/__init__.py b/ThirdParty/Ert/python/python/ert_gui/shell/libshell/__init__.py deleted file mode 100644 index cf18bdc417..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/libshell/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -from .shell_context import ShellContext -from .shell_tools import autoCompleteList, extractFullArgument, autoCompleteListWithSeparator, matchItems, containsAny, findRightMostSeparator, boolValidator, createListValidator, createFloatValidator, widthAsPercentageOfConsoleWidth, getTerminalSize, splitArguments -from .shell_path_tools import getPossibleFilenameCompletions, pathCompleter, pathify -from .shell_property import ShellProperty -from .shell_function import ShellFunction -from .shell_collection import ShellCollection \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/libshell/shell_collection.py b/ThirdParty/Ert/python/python/ert_gui/shell/libshell/shell_collection.py deleted file mode 100644 index db5a2adc9d..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/libshell/shell_collection.py +++ /dev/null @@ -1,171 +0,0 @@ -import shlex -import textwrap -from ert_gui.shell.libshell import autoCompleteList, ShellFunction, ShellProperty, widthAsPercentageOfConsoleWidth, getTerminalSize - - -class ShellCollection(object): - command_help_message = "The command: '%s' supports the following keywords:" - - def __init__(self, name, parent=None, description="No description available"): - super(ShellCollection, self).__init__() - self.__name = name - self.__parent = None - self.__description = description - - if parent is not None: - self.setParent(parent) - parent.addChild(self) - - self.__collection = {} - self.__model_tracker = {} - self.__children = [] - - def setParent(self, parent): - if not hasattr(parent, "shellContext"): - raise ValueError("Parent is missing function: shellContext()") - - if not hasattr(parent, "lastCommandFailed"): - raise ValueError("Parent is missing function: lastCommandFailed()") - - setattr(parent, "do_%s" % self.name, self.doKeywords) - setattr(parent, "complete_%s" % self.name, self.completeKeywords) - setattr(parent, "help_%s" % self.name, self.helpKeywords) - self.__parent = parent - - - def addChild(self, child): - self.__children.append(child) - - def cleanup(self): - for child in self.__children: - child.cleanup() - - def addCollection(self, collection): - """ - :type collection: ShellCollection - """ - self.__collection[collection.name] = collection - collection.setParent(self) - - - def addProperty(self, property): - """ - :type property: ShellProperty - """ - self.__collection[property.name] = property - property.setParent(self) - - def addFunction(self, function): - """ - :type function: ShellFunction - """ - self.__collection[function.name] = function - function.setParent(self) - - - def addShellProperty(self, name, getter, setter=None, validator=None, completer=None, help_arguments=None, help_message=None, pretty_attribute=None, model=None): - """ @rtype: ShellProperty """ - shell_property = ShellProperty(name, getter, setter, validator, completer, help_arguments, help_message, pretty_attribute) - self.addProperty(shell_property) - - if model is None: - model = self - - self.__model_tracker[name] = model - return shell_property - - - def getModelForProperty(self, property_name): - return self.__model_tracker[property_name] - - - def addShellFunction(self, name, function, completer=None, help_arguments=None, help_message=None, model=None): - """ @rtype: ShellFunction """ - func = ShellFunction(name, function, completer, help_arguments, help_message) - self.addFunction(func) - - if model is None: - model = self - - self.__model_tracker[name] = model - - return func - - - def getModelForFunction(self, name): - return self.__model_tracker[name] - - @property - def name(self): - return self.__name - - def shellContext(self): - """ :rtype: ert_gui.shell.libshell.ShellContext """ - return self.__parent.shellContext() - - def lastCommandFailed(self, message): - self.__parent.lastCommandFailed(message) - - def findKeywords(self): - return self.__collection.keys() - - def completeKeywords(self, text, line, begidx, endidx): - arguments = shlex.split(line) - assert arguments[0] == self.name - - line = line[len(self.name) + 1:] - begidx = begidx - len(self.name) + 1 - endidx = endidx - len(self.name) + 1 - keyword, sep, arguments = line.partition(' ') - - if begidx >= len(keyword) and keyword in self.findKeywords(): - if hasattr(self, "complete_%s" % keyword): - func = getattr(self, "complete_%s" % keyword) - return func(text, line, begidx, endidx) - else: - return [] - else: - return autoCompleteList(text, self.findKeywords()) - - def doKeywords(self, line): - keyword, sep, arguments = line.partition(' ') - - if keyword.strip() == "": - self.printGuidance() - elif keyword in self.__collection: - func = getattr(self, "do_%s" % keyword) - return func(arguments) - else: - self.lastCommandFailed("Unknown keyword: '%s'" % keyword) - self.printGuidance() - - - def printGuidance(self): - print(self.command_help_message % self.name) - self.shellContext().shell().columnize(self.findKeywords(), getTerminalSize()[0]) - - - def helpKeywords(self): - print(self.command_help_message % self.name) - keywords = self.findKeywords() - - keyword_column_width = widthAsPercentageOfConsoleWidth(20) - parameter_column_width = widthAsPercentageOfConsoleWidth(30) - help_column_width = widthAsPercentageOfConsoleWidth(48) - help_format = " %-" + str(keyword_column_width) + "s %-" + str(parameter_column_width) + "s %-" + str(help_column_width) + "s" - - print(help_format % ("Keyword", "Parameter(s)", "Help")) - - for keyword in keywords: - message = "No help available!" - parameters = None - if hasattr(self, "help_tuple_%s" % keyword): - func = getattr(self, "help_tuple_%s" % keyword) - _, parameters, message = func() - - message = textwrap.wrap(message, help_column_width) - print(help_format % (keyword, parameters, message[0])) - - if len(message) > 1: - for line in message[1:]: - print(help_format % ("", "", line)) \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/libshell/shell_context.py b/ThirdParty/Ert/python/python/ert_gui/shell/libshell/shell_context.py deleted file mode 100644 index 7e52e46ed0..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/libshell/shell_context.py +++ /dev/null @@ -1,23 +0,0 @@ - -class ShellContext(object): - def __init__(self, shell): - super(ShellContext, self).__init__() - - self.__shell = shell - """ :type: Cmd """ - - self.__settings = {} - - - def shell(self): - """ @rtype: ert_gui.shell.ErtShell """ - return self.__shell - - def __setitem__(self, key, value): - self.__settings[key] = value - - def __getitem__(self, key): - return self.__settings[key] - - def __contains__(self, key): - return key in self.__settings \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/libshell/shell_function.py b/ThirdParty/Ert/python/python/ert_gui/shell/libshell/shell_function.py deleted file mode 100644 index 48c3b144ed..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/libshell/shell_function.py +++ /dev/null @@ -1,62 +0,0 @@ -from ert_gui.shell.libshell import extractFullArgument, autoCompleteListWithSeparator - - -class ShellFunction(object): - - def __init__(self, name, function, completer=None, help_arguments=None, help_message=None): - super(ShellFunction, self).__init__() - self.__parent = None - self.__name = name - - if function is None: - raise ValueError("Function can not be None for shell function '%s'" % name) - - self.__function = function - self.__completer = completer - - self.__help_arguments = help_arguments - self.__help_message = help_message if help_message is not None else "No help available!" - - - def setParent(self, parent): - if parent is None: - raise ValueError("Function target can not be None for shell function '%s'" % self.name) - - if not hasattr(parent, "getModelForFunction"): - raise ValueError("function target is missing method 'getModelForFunction(name)' for shell function '%s'" % self.name) - - if hasattr(parent, "do_%s" % self.name) or hasattr(parent, "complete_%s" % self.name) or hasattr(parent, "help_%s" % self.name) : - raise ValueError("function with name '%s' already exists for object '%s'" % (self.name, parent)) - - setattr(parent, "do_%s" % self.name, self.doFunction) - setattr(parent, "complete_%s" % self.name, self.completeFunction) - setattr(parent, "help_tuple_%s" % self.name, self.helpFunction) - - self.__parent = parent - - - def doFunction(self, line): - model = self.getModelForFunction() - self.__function(model, line.strip()) - - def completeFunction(self, text, line, begidx, endidx): - if self.__completer is not None: - if callable(self.__completer): - model = self.getModelForFunction() - return self.__completer(model, text, line, begidx, endidx) - else: - key = extractFullArgument(line, endidx) - return autoCompleteListWithSeparator(key, self.__completer) - - return [] - - def helpFunction(self): - return self.name, self.__help_arguments, self.__help_message - - def getModelForFunction(self): - return self.__parent.getModelForFunction(self.name) - - @property - def name(self): - return self.__name - diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/libshell/shell_path_tools.py b/ThirdParty/Ert/python/python/ert_gui/shell/libshell/shell_path_tools.py deleted file mode 100644 index d9322fb8cc..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/libshell/shell_path_tools.py +++ /dev/null @@ -1,26 +0,0 @@ -import os -from ert_gui.shell.libshell import containsAny, extractFullArgument, findRightMostSeparator - - -def pathify(head, tail): - path = os.path.join(head, tail) - if os.path.isdir(path): - return "%s/" % tail - return tail - -def getPossibleFilenameCompletions(text, separators="-"): - head, tail = os.path.split(text.strip()) - if head == "": # no head - head = "." - files = os.listdir(head) - - separator_pos = 0 - if containsAny(tail, separators): - separator_pos = findRightMostSeparator(tail, separators) + 1 - - return [pathify(head, f)[separator_pos:] for f in files if f.startswith(tail)] - - -def pathCompleter(model, text, line, begidx, endidx): - argument = extractFullArgument(line, endidx) - return getPossibleFilenameCompletions(argument) \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/libshell/shell_property.py b/ThirdParty/Ert/python/python/ert_gui/shell/libshell/shell_property.py deleted file mode 100644 index 6a8b8d2e3c..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/libshell/shell_property.py +++ /dev/null @@ -1,90 +0,0 @@ -from ert_gui.shell.libshell import extractFullArgument, autoCompleteListWithSeparator - -class ShellProperty(object): - def __init__(self, name, getter, setter=None, validator=None, completer=None, help_arguments=None, help_message=None, pretty_attribute=None): - super(ShellProperty, self).__init__() - self.__parent = None - - if getter is None: - raise ValueError("Getter function/property can not be None for shell property '%s'" % name) - - self.__setter = setter - self.__getter = getter - - self.__name = name - self.__pretty_attribute = name if pretty_attribute is None else pretty_attribute - - self.__help_arguments = help_arguments - self.__help_message = help_message if help_message is not None else "No help available!" - - self.__completer = completer - self.__validator = validator - - - - def setParent(self, parent): - if parent is None: - raise ValueError("Property target can not be None for shell property '%s'" % self.name) - - if not hasattr(parent, "getModelForProperty"): - raise ValueError("Property target is missing method 'getModelForProperty(name)' for shell property '%s'" % self.name) - - if hasattr(parent, "do_%s" % self.name) or hasattr(parent, "complete_%s" % self.name) or hasattr(parent, "help_%s" % self.name) : - raise ValueError("Property with name '%s' already exists for object '%s'" % (self.name, parent)) - - setattr(parent, "do_%s" % self.name, self.doFunction) - setattr(parent, "complete_%s" % self.name, self.completeFunction) - setattr(parent, "help_tuple_%s" % self.name, self.helpFunction) - - self.__parent = parent - - - def doFunction(self, line): - value = line.strip() - model = self.getModelForProperty() - if value == "": - if isinstance(self.__getter, property): - result = self.__getter.__get__(model) - else: - result = self.__getter(model) - print("%s = %s" % (self.__pretty_attribute, result)) - else: - try: - if self.__validator is not None: - value = self.__validator(model, value) - - if self.__setter is not None: - if isinstance(self.__setter, property): - self.__setter.__set__(model, value) - else: - self.__setter(model, value) - print("%s set to: %s" % (self.__pretty_attribute, value)) - else: - self.lastCommandFailed("Property '%s' is set to read only" % self.__pretty_attribute) - except ValueError as e: - self.lastCommandFailed(e.message) - - - def completeFunction(self, text, line, begidx, endidx): - if self.__completer is not None: - if callable(self.__completer): - model = self.getModelForProperty() - return self.__completer(model, text, line, begidx, endidx) - else: - key = extractFullArgument(line, endidx) - return autoCompleteListWithSeparator(key, self.__completer) - - return [] - - def helpFunction(self): - return self.name, self.__help_arguments, self.__help_message - - def getModelForProperty(self): - return self.__parent.getModelForProperty(self.name) - - def lastCommandFailed(self, message): - self.__parent.lastCommandFailed(message) - - @property - def name(self): - return self.__name diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/libshell/shell_tools.py b/ThirdParty/Ert/python/python/ert_gui/shell/libshell/shell_tools.py deleted file mode 100644 index 800cffc9ee..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/libshell/shell_tools.py +++ /dev/null @@ -1,136 +0,0 @@ -import fnmatch -from math import floor -import shlex - - -def autoCompleteList(text, items): - if not text: - completions = items - else: - completions = [item for item in items if str(item).lower().startswith(text.lower())] - return completions - -def containsAny(string, chars): - return True in [char in string for char in chars] - -def findRightMostSeparator(text, separators): - max_pos = 0 - - for separator in separators: - pos = text.rfind(separator) - max_pos = max(pos, max_pos) - - return max_pos - -def autoCompleteListWithSeparator(text, items, separators=":,@"): - if containsAny(text, separators): - auto_complete_list = autoCompleteList(text, items) - separator_pos = findRightMostSeparator(text, separators) - auto_complete_list = [item[separator_pos + 1:] for item in auto_complete_list] - else: - auto_complete_list = autoCompleteList(text, items) - - return auto_complete_list - - -def extractFullArgument(line, endidx): - last_space_index = line.rfind(" ", 0, endidx) - newstart = 0 if last_space_index == -1 else last_space_index - return line[newstart:endidx].strip() - - -def matchItems(line, items): - patterns = shlex.split(line) - - result_items = set() - - for pattern in patterns: - pattern_matches = set() - for item in items: - if fnmatch.fnmatch(item.lower(), pattern.lower()): # case-insensitive matching - pattern_matches.add(item) - - if len(pattern_matches) == 0: - print("Error: Name/Pattern '%s' does not match anything." % pattern) - else: - result_items = result_items | pattern_matches - - return result_items - - -def boolValidator(model, value): - trueness = value.lower() in ("yes", "true", "t", "1") - falseness = value.lower() in ("no", "false", "f", "0") - - if not (trueness or falseness): - raise ValueError("Unable to convert '%s' into a boolean expression true|false" % value) - - return trueness - - -def createFloatValidator(minimum=None, maximum=None): - def validate(model, value): - value = float(value) - if minimum is not None: - value = max(value, minimum) - - if maximum is not None: - value = min(value, maximum) - - return value - return validate - - -def createListValidator(items): - def validate(model, value): - value = value.lower() - for item in items: - if value == str(item).lower(): - return item - - raise ValueError("Value '%s' not in collection: %s" % (value, items)) - - return validate - -def splitArguments(line): - """ @rtype: list of str """ - return shlex.split(line) - -def widthAsPercentageOfConsoleWidth(percentage): - width, height = getTerminalSize() - if width == 0: - width = 80 - - return int(floor(percentage * width / 100.0)) - - -def getTerminalSize(): - """ - @rtype: tuple of (int,int) - @return: Console dimensions as: width, height - """ - import os - env = os.environ - - def ioctl_GWINSZ(fd): - try: - import fcntl, termios, struct, os - cr = struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234')) - except: - return - return cr - - cr = ioctl_GWINSZ(0) or ioctl_GWINSZ(1) or ioctl_GWINSZ(2) - - if not cr: - try: - fd = os.open(os.ctermid(), os.O_RDONLY) - cr = ioctl_GWINSZ(fd) - os.close(fd) - except: - pass - - if not cr: - cr = (env.get('LINES', 25), env.get('COLUMNS', 80)) - return int(cr[1]), int(cr[0]) - diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/observations.py b/ThirdParty/Ert/python/python/ert_gui/shell/observations.py deleted file mode 100644 index c05a86d3b1..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/observations.py +++ /dev/null @@ -1,67 +0,0 @@ -import os - -from ert_gui.shell import assertConfigLoaded, ErtShellCollection -from ert_gui.shell.libshell import extractFullArgument, getPossibleFilenameCompletions - - -class Observations(ErtShellCollection): - def __init__(self, parent): - super(Observations, self).__init__("observations", parent) - - self.addShellFunction(name="list", - function=Observations.list, - help_message="List all observation keys.") - - self.addShellFunction(name="clear", - function=Observations.clear, - help_message="Remove all observations.") - - self.addShellFunction(name="load", - function=Observations.load, - completer=Observations.completeLoad, - help_arguments="", - help_message="Add observations from the specified file.") - - self.addShellFunction(name="reload", - function=Observations.reload, - completer=Observations.completeReload, - help_arguments="", - help_message="Perform a clear before adding observations from the specified file.") - - - @assertConfigLoaded - def list(self, line): - keys = [obs_vector.getObservationKey() for obs_vector in self.ert().getObservations()] - print("Observation keys:") - self.columnize(keys) - - @assertConfigLoaded - def clear(self, line): - self.ert().getObservations().clear() - - @assertConfigLoaded - def load(self, config_file): - if os.path.exists(config_file) and os.path.isfile(config_file): - # This will append observations; alternatively reload() - # can be used to clear the current observations first. - self.ert().loadObservations( config_file , clear = False ) - else: - self.lastCommandFailed("Observations file '%s' not found!\n" % config_file) - - @assertConfigLoaded - def reload(self, config_file): - if os.path.exists(config_file) and os.path.isfile(config_file): - # If clear is False the new observations will be added to the existing. - self.ert().loadObservations( config_file , clear = True ) - else: - self.lastCommandFailed("Observations file '%s' not found!\n" % config_file) - - @assertConfigLoaded - def completeLoad(self, text, line, begidx, endidx): - argument = extractFullArgument(line, endidx) - return getPossibleFilenameCompletions(argument) - - @assertConfigLoaded - def completeReload(self, text, line, begidx, endidx): - argument = extractFullArgument(line, endidx) - return getPossibleFilenameCompletions(argument) diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/plot_settings.py b/ThirdParty/Ert/python/python/ert_gui/shell/plot_settings.py deleted file mode 100644 index d34c4c6452..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/plot_settings.py +++ /dev/null @@ -1,178 +0,0 @@ -from ert.enkf.enkf_fs_manager import naturalSortKey -from ert.enkf import PlotSettings as ErtPlotSettings -from ert_gui.plottery.plot_config import PlotConfig -from ert_gui.shell import assertConfigLoaded, ErtShellCollection -from ert_gui.shell.libshell import autoCompleteList, boolValidator, pathCompleter, splitArguments -from ert_gui.shell.libshell.shell_tools import matchItems - - -def plotPathValidator(model, line): - arguments = splitArguments(line) - - if len(arguments) == 1: - return arguments[0] # todo: check if exists and is file or directory for example - else: - raise ValueError("Can only set one path. If you require spaces in your path, " - "surround it with quotes: \"path with space\".") - - -class PlotSettings(ErtShellCollection): - def __init__(self, parent): - super(PlotSettings, self).__init__("plot_settings", parent) - - self.__cases = None - if self.ert(): - ert_ps = self.ert().plotConfig( ) - else: - ert_ps = ErtPlotSettings( ) - - self.__plot_config = PlotConfig( ert_ps ) - self.shellContext()["plot_settings"] = self - - self.addShellFunction(name="current", - function=PlotSettings.current, - help_message="Shows the selected plot source case(s).") - - self.addShellFunction(name="reset_title", - function=PlotSettings.resetTitle, - help_message="Reset plot title back to default.") - - self.addShellFunction(name="select", - function=PlotSettings.select, - completer=PlotSettings.completeSelect, - help_arguments="[case_1..case_n]", - help_message="Select one or more cases as default plot sources. Empty resets to current case.") - - self.addShellProperty(name="path", - getter=PlotSettings.getPath, - setter=PlotSettings.setPath, - validator=plotPathValidator, - completer=pathCompleter, - help_arguments="[path]", - help_message="Show or set the plot output path", - pretty_attribute="Plot output path") - - self.addShellProperty(name="title", - getter=PlotConfig.title, - setter=PlotConfig.setTitle, - help_arguments="[new_title]", - help_message="Show or set the title of the plot", - pretty_attribute="Title", - model=self.__plot_config) - - self.addShellProperty(name="x_label", - getter=PlotConfig.xLabel, - setter=PlotConfig.setXLabel, - help_arguments="[new_label]", - help_message="Show or set the X label of the plot", - pretty_attribute="X label", - model=self.__plot_config) - - self.addShellProperty(name="y_label", - getter=PlotConfig.yLabel, - setter=PlotConfig.setYLabel, - help_arguments="[new_label]", - help_message="Show or set the Y label of the plot", - pretty_attribute="Y label", - model=self.__plot_config) - - self.addShellProperty(name="grid", - getter=PlotConfig.isGridEnabled, - setter=PlotConfig.setGridEnabled, - validator=boolValidator, - completer=["true", "false"], - help_arguments="[true|false]", - help_message="Show or set the grid visibility", - pretty_attribute="Grid visibility", - model=self.__plot_config) - - self.addShellProperty(name="legend", - getter=PlotConfig.isLegendEnabled, - setter=PlotConfig.setLegendEnabled, - validator=boolValidator, - completer=["true", "false"], - help_arguments="[true|false]", - help_message="Show or set the legend visibility", - pretty_attribute="Legend visibility", - model=self.__plot_config) - - self.addShellProperty(name="connection_lines", - getter=PlotConfig.isDistributionLineEnabled, - setter=PlotConfig.setDistributionLineEnabled, - validator=boolValidator, - completer=["true", "false"], - help_arguments="[true|false]", - help_message="Show or set the connection lines visibility", - pretty_attribute="Connection Line visibility", - model=self.__plot_config) - - self.addShellProperty(name="refcase", - getter=PlotConfig.isRefcaseEnabled, - setter=PlotConfig.setRefcaseEnabled, - validator=boolValidator, - completer=["true", "false"], - help_arguments="[true|false]", - help_message="Show or set the refcase visibility", - pretty_attribute="Refcase visibility", - model=self.__plot_config) - - self.addShellProperty(name="observations", - getter=PlotConfig.isObservationsEnabled, - setter=PlotConfig.setObservationsEnabled, - validator=boolValidator, - completer=["true", "false"], - help_arguments="[true|false]", - help_message="Show or set the observations visibility", - pretty_attribute="Observations visibility", - model=self.__plot_config) - - - def getCurrentPlotCases(self): - """ @rtype: list of str """ - - if self.__cases is None: - case_name = self.ert().getEnkfFsManager().getCurrentFileSystem().getCaseName() - return [case_name] - - return self.__cases - - def plotConfig(self): - return self.__plot_config - - @assertConfigLoaded - def current(self, line): - keys = self.getCurrentPlotCases() - self.columnize(keys) - - @assertConfigLoaded - def select(self, line): - matched_cases = matchItems(line, self.getAllCaseList()) - - if len(matched_cases) > 0: - self.__cases = sorted(list(matched_cases), key=naturalSortKey) - else: - if len(line) > 0: - self.lastCommandFailed("No valid case names provided: %s" % line) - print("Case reset to default: %s" % self.ert().getEnkfFsManager().getCurrentFileSystem().getCaseName()) - self.__cases = None - - @assertConfigLoaded - def completeSelect(self, text, line, begidx, endidx): - return autoCompleteList(text, self.getAllCaseList()) - - def getAllCaseList(self): - fs_manager = self.ert().getEnkfFsManager() - all_case_list = fs_manager.getCaseList() - all_case_list = [case for case in all_case_list if not case.startswith(".")] - return all_case_list - - @assertConfigLoaded - def getPath(self): - return self.ert().plotConfig().getPath() - - @assertConfigLoaded - def setPath(self, path): - self.ert().plotConfig().setPath(path) - - def resetTitle(self, line): - self.plotConfig().setTitle(None) diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/plugins.py b/ThirdParty/Ert/python/python/ert_gui/shell/plugins.py deleted file mode 100644 index 275eaface6..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/plugins.py +++ /dev/null @@ -1,190 +0,0 @@ -import inspect -import time -from ert.job_queue import ErtScript, CancelPluginException -from ert_gui.shell import assertConfigLoaded, ErtShellCollection -from ert_gui.shell.libshell import splitArguments, autoCompleteList - - -class Plugins(ErtShellCollection): - def __init__(self, parent): - super(Plugins, self).__init__("plugins", parent) - - self.addShellFunction(name="list", - function=Plugins.list, - help_message="Shows a list of all available plugins.") - - self.addShellFunction(name="help", - function=Plugins.help, - completer=Plugins.completeHelp, - help_arguments="", - help_message="Shows help for the specified plugin if available.") - - self.addShellFunction(name="run", - function=Plugins.run, - completer=Plugins.completeRun, - help_arguments=" [args]", - help_message="Run a named plugin with either arguments or default input GUI.") - - self.addShellFunction(name="arguments", - function=Plugins.arguments, - completer=Plugins.completeArguments, - help_arguments="", - help_message="Shows a list of expected arguments for a specified plugin.") - - - @assertConfigLoaded - def list(self, line): - plugins = self.getPluginNames() - if len(plugins) > 0: - self.columnize(plugins) - else: - print("No plugins available.") - - - @assertConfigLoaded - def run(self, line): - arguments = splitArguments(line) - - if len(arguments) < 1: - print("Error: This keyword requires a name of a plugin to run.") - else: - plugin_name = arguments[0] - plugin_job = self.getWorkflowJob(plugin_name) - - if plugin_job is not None: - try: - script = self.getScript(plugin_job) - if len(arguments) > 1: - arguments = arguments[1:] - else: - arguments = script.getArguments(None) - - now = time.time() - result = plugin_job.run(self.ert(), arguments) - - self.shellContext()["debug"].setLastPluginResult(result) - - diff = time.time() - now - print("Plugin running time: %d seconds" % int(diff)) - - print(result) - except CancelPluginException: - print("Plugin cancelled before execution!") - else: - self.lastCommandFailed("Unknown plugin: '%s'" % plugin_name) - - - @assertConfigLoaded - def completeRun(self, text, line, begidx, endidx): - arguments = splitArguments(line) - - if len(arguments) > 2 or len(arguments) == 2 and not text: - return [] - return autoCompleteList(text, self.getPluginNames()) - - - @assertConfigLoaded - def arguments(self, plugin_name): - plugin_job = self.getWorkflowJob(plugin_name) - - if plugin_job is not None: - script, arguments = self.getScriptAndArguments(plugin_job) - - if len(arguments) > 1: - print("The plugin: '%s' takes the following required <...> and/or optional [...] arguments:\n" % plugin_name) - arguments_format = " %-25s %-35s %-20s" - print(arguments_format % ("Arguments", "Default Value", "Type")) - - for argument in arguments: - - if not argument["optional"]: - argument_format = "<%s>" - else: - argument_format = "[%s]" - - print(arguments_format % (argument_format % argument["name"], argument["default"], argument["type"].__name__)) - else: - print("Plugin has no arguments.") - else: - self.lastCommandFailed("Unknown plugin: '%s'" % plugin_name) - - @assertConfigLoaded - def completeArguments(self, text, line, begidx, endidx): - arguments = splitArguments(line) - - if len(arguments) > 2 or len(arguments) == 2 and not text: - return [] - return autoCompleteList(text, self.getPluginNames()) - - - @assertConfigLoaded - def help(self, line): - arguments = splitArguments(line) - - if len(arguments) < 1: - self.lastCommandFailed("This keyword requires a name of a plugin to run.") - else: - plugin_name = arguments[0] - plugin_job = self.getWorkflowJob(plugin_name) - - if plugin_job is not None: - script = self.getScript(plugin_job) - - print(script.__doc__) - else: - self.lastCommandFailed("Unknown plugin: '%s'" % plugin_name) - - - @assertConfigLoaded - def completeHelp(self, text, line, begidx, endidx): - arguments = splitArguments(line) - - if len(arguments) > 2 or len(arguments) == 2 and not text: - return [] - return autoCompleteList(text, self.getPluginNames()) - - def getPluginNames(self): - plugin_jobs = self.ert().getWorkflowList().getPluginJobs() - return [plugin.name() for plugin in plugin_jobs] - - - def getWorkflowJob(self, plugin_name): - """ @rtype: WorkflowJob """ - plugin_name = plugin_name.strip() - plugin_jobs = self.ert().getWorkflowList().getPluginJobs() - plugin_job = next((job for job in plugin_jobs if job.name() == plugin_name), None) - return plugin_job - - - def getScript(self, plugin_job): - script_obj = ErtScript.loadScriptFromFile(plugin_job.getInternalScriptPath()) - script = script_obj(self.ert()) - return script - - def getScriptAndArguments(self, plugin_job): - script = self.getScript(plugin_job) - arg_spec = inspect.getargspec(script.run) - - arguments = [] - - if len(arg_spec.args) > 1: - - for argument_name, argument_type in zip(arg_spec.args[1:], plugin_job.argumentTypes()): - arguments.append({ - "name": argument_name, - "type": argument_type, - "default": "", - "optional": False - }) - - if arg_spec.defaults is not None: - for index, value in enumerate(reversed(arg_spec.defaults)): - arguments[len(arguments) - 1 - index]["default"] = value - - min_arg_count = plugin_job.minimumArgumentCount() - - for index, argument in enumerate(arguments): - if index >= min_arg_count: - argument["optional"] = True - - return script, arguments diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/results.py b/ThirdParty/Ert/python/python/ert_gui/shell/results.py deleted file mode 100644 index 9b6a5c34c7..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/results.py +++ /dev/null @@ -1,50 +0,0 @@ -from ert.util import BoolVector -from ert_gui.shell import assertConfigLoaded, ErtShellCollection -from ert_gui.shell.libshell import splitArguments - - -class Results(ErtShellCollection): - def __init__(self, parent): - super(Results, self).__init__("results", parent) - - self.addShellFunction(name="runpath", function=Results.runpath, help_message="Shows the current runpath.") - self.addShellFunction(name="load", function=Results.load, completer=Results.completeLoad, help_arguments="", help_message="Load results from the specified realizations.") #todo iterations - - @assertConfigLoaded - def runpath(self, args): - runpath = self.ert().getModelConfig().getRunpathAsString() - print("Runpath set to: %s" % runpath) - - - @assertConfigLoaded - def load(self, args): - arguments = splitArguments(args) - - if len(arguments) < 1: - self.lastCommandFailed("Loading requires a realization mask.") - return False - - realization_count = self.ert().getEnsembleSize() - - mask = BoolVector(False, realization_count) - mask_success = mask.updateActiveMask(arguments[0]) - - if not mask_success: - self.lastCommandFailed("The realization mask: '%s' is not valid." % arguments[0]) - return False - - fs = self.ert().getEnkfFsManager().getCurrentFileSystem() - self.ert().loadFromForwardModel(mask, 0, fs) - - - @assertConfigLoaded - def completeLoad(self, text, line, begidx, endidx): - arguments = splitArguments(line) - - if len(arguments) > 2 or len(arguments) == 2 and not text: - return [] - - if not text: - return ["0-%d" % self.ert().getEnsembleSize()] # todo should generate based on realization directories. - - return [] diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/server.py b/ThirdParty/Ert/python/python/ert_gui/shell/server.py deleted file mode 100644 index 693b6271c7..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/server.py +++ /dev/null @@ -1,105 +0,0 @@ -import socket -from threading import Thread - -from ert.server import ErtRPCServer -from ert_gui.shell import assertConfigLoaded, ErtShellCollection - - -class Server(ErtShellCollection): - def __init__(self, parent): - super(Server, self).__init__("server", parent) - self.shellContext()["server_settings"] = self - - self.addShellFunction(name="start", - function=Server.startServer, - help_message="Start the ERT RPC Server") - - self.addShellFunction(name="stop", - function=Server.stopServer, - help_message="Stop the ERT RPC Server") - - self.addShellFunction(name="inspect", - function=Server.inspect, - help_message="Shows information about the current job queue") - - self.addShellProperty(name="hostname", - getter=Server.getHost, - setter=Server.setHost, - help_arguments="[hostname]", - help_message="Show or set the server hostname", - pretty_attribute="Hostname") - - self.addShellProperty(name="port", - getter=Server.getPort, - setter=Server.setPort, - help_arguments="[port]", - help_message="Show or set the server port number (0 = automatic)", - pretty_attribute="Port") - - self._server = None - """ :type: ErtRPCServer """ - - self._hostname = "localhost" - self._port = 0 - - def getHost(self): - return self._hostname - - def setHost(self, hostname): - self._hostname = hostname - - def getPort(self): - return self._port - - def setPort(self, port): - self._port = int(port) - - @assertConfigLoaded - def startServer(self, line): - port = self._port - host = self._hostname - - if self._server is None: - try: - self._server = ErtRPCServer(self.ert(), host=host, port=port) - except socket.error as e: - print("Unable to start the server on port: %d" % port) - else: - thread = Thread(name="Shell Server Thread") - thread.daemon = True - thread.run = self._server.start - thread.start() - print("Server running on host: '%s' and port: %d" % (self._server.host, self._server.port)) - else: - print("A server is already running at host: '%s' and port: %d" % (self._server.host, self._server.port)) - - def _stopServer(self): - if self._server is not None: - self._server.stop() - self._server = None - print("Server stopped") - - def stopServer(self, line): - if self._server is not None: - self._stopServer() - else: - print("No server to stop") - - def cleanup(self): - self._stopServer() - ErtShellCollection.cleanup(self) - - def inspect(self, line): - if self._server is not None: - if self._server.isRunning(): - print("Waiting..: %d" % self._server.getWaitingCount()) - print("Running..: %d" % self._server.getRunningCount()) - print("Failed...: %d" % self._server.getFailedCount()) - print("Succeeded: %d" % self._server.getSuccessCount()) - print("Batch#...: %d" % self._server.getBatchNumber()) - else: - print("Server is not running any simulations") - else: - print("No server is not available") - - diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/shell_plot.py b/ThirdParty/Ert/python/python/ert_gui/shell/shell_plot.py deleted file mode 100644 index 293b9daf3d..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/shell_plot.py +++ /dev/null @@ -1,236 +0,0 @@ -import ert_gui.plottery.plots as plots - -import matplotlib.pyplot as plt - -from ert_gui.plottery.plot_config_factory import PlotConfigFactory -from ert_gui.shell import assertConfigLoaded -from ert_gui.plottery import PlotConfig, PlotContext -from ert_gui.shell.libshell import matchItems, extractFullArgument, autoCompleteListWithSeparator - - -class ShellPlot(object): - @classmethod - def _createPlotContext(cls, shell_context, data_gatherer, key): - """ - :type shell_context: ShellContext - :param data_gatherer: PlotDataGatherer - :param key: str - """ - figure = plt.figure() - figure.set_tight_layout(True) - cases = shell_context["plot_settings"].getCurrentPlotCases() - - plot_config = PlotConfig(key) - #plot settings should keep of track of single attributes and only apply the changed ones... - plot_config.copyConfigFrom(shell_context["plot_settings"].plotConfig()) - - if plot_config.isUnnamed(): - plot_config.setTitle(key) - - #Apply data type specific changes for statistics... - PlotConfigFactory.updatePlotConfigForKey(shell_context.ert(), key, plot_config) - - plot_context = PlotContext(shell_context.ert(), figure, plot_config, cases, key, data_gatherer) - return plot_context - - @classmethod - def plotEnsemble(cls, shell_context, data_gatherer, key): - """ - :type shell_context: ShellContext - :param data_gatherer: PlotDataGatherer - :param key: str - """ - plot_context = cls._createPlotContext(shell_context, data_gatherer, key) - plots.plotEnsemble(plot_context) - - @classmethod - def plotQuantiles(cls, shell_context, data_gatherer, key): - """ - :type shell_context: ShellContext - :param data_gatherer: PlotDataGatherer - :param key: str - """ - plot_context = cls._createPlotContext(shell_context, data_gatherer, key) - plots.plotStatistics(plot_context) - - @classmethod - def plotHistogram(cls, shell_context, data_gatherer, key): - """ - :type shell_context: ShellContext - :param data_gatherer: PlotDataGatherer - :param key: str - """ - plot_context = cls._createPlotContext(shell_context, data_gatherer, key) - plots.plotHistogram(plot_context) - - @classmethod - def plotDistribution(cls, shell_context, data_gatherer, key): - """ - :type shell_context: ShellContext - :param data_gatherer: PlotDataGatherer - :param key: str - """ - plot_context = cls._createPlotContext(shell_context, data_gatherer, key) - plots.plotDistribution(plot_context) - - @classmethod - def plotGaussianKDE(cls, shell_context, data_gatherer, key): - """ - :type shell_context: ShellContext - :param data_gatherer: PlotDataGatherer - :param key: str - """ - plot_context = cls._createPlotContext(shell_context, data_gatherer, key) - plots.plotGaussianKDE(plot_context) - - @classmethod - def plotCrossCaseStatistics(cls, shell_context, data_gatherer, key): - """ - :type shell_context: ShellContext - :param data_gatherer: PlotDataGatherer - :param key: str - """ - plot_context = cls._createPlotContext(shell_context, data_gatherer, key) - plots.plotCrossCaseStatistics(plot_context) - - @classmethod - def _checkForRequiredMethods(cls, instance): - if not hasattr(instance, "fetchSupportedKeys"): - raise NotImplementedError("Class must implement: fetchSupportedKeys()") - - if not hasattr(instance, "plotDataGatherer"): - raise NotImplementedError("Class must implement: plotDataGatherer()") - - @classmethod - def _createDoFunction(cls, plot_function, name): - def do_function(self, line): - keys = matchItems(line, self.fetchSupportedKeys()) - - if len(keys) == 0: - self.lastCommandFailed("Must have at least one %s key" % name) - return False - - for key in keys: - pdg = self.plotDataGatherer() - plot_function(self.shellContext(), pdg, key) - - return assertConfigLoaded(do_function) - - @classmethod - def _createCompleteFunction(cls): - def complete_function(self, text, line, begidx, endidx): - key = extractFullArgument(line, endidx) - return autoCompleteListWithSeparator(key, self.fetchSupportedKeys()) - - complete_function = assertConfigLoaded(complete_function) - return complete_function - - @classmethod - def addHistogramPlotSupport(cls, instance, name): - """ - :type instance: ert_gui.shell.libshell.ShellCollection - """ - cls._checkForRequiredMethods(instance) - - instance.addShellFunction(name="histogram", - function=cls._createDoFunction(ShellPlot.plotHistogram, name), - completer=cls._createCompleteFunction(), - help_arguments=" [key_2..key_n]", - help_message="Plot a histogram for the specified %s key(s)." % name) - - @classmethod - def addGaussianKDEPlotSupport(cls, instance, name): - """ - :type instance: ert_gui.shell.ShellFunction - """ - cls._checkForRequiredMethods(instance) - - instance.addShellFunction(name="density", - function=cls._createDoFunction(ShellPlot.plotGaussianKDE, name), - completer=cls._createCompleteFunction(), - help_arguments=" [key_2..key_n]", - help_message="Plot a GaussianKDE plot for the specified %s key(s)." % name) - - @classmethod - def addEnsemblePlotSupport(cls, instance, name): - """ - :type instance: ert_gui.shell.ShellFunction - """ - cls._checkForRequiredMethods(instance) - - instance.addShellFunction(name="plot", - function=cls._createDoFunction(ShellPlot.plotEnsemble, name), - completer=cls._createCompleteFunction(), - help_arguments=" [key_2..key_n]", - help_message="Plot an ensemble plot for the specified %s key(s)." % name) - - @classmethod - def addQuantilesPlotSupport(cls, instance, name): - """ - :type instance: ert_gui.shell.ShellFunction - """ - cls._checkForRequiredMethods(instance) - - instance.addShellFunction(name="plot_quantile", - function=cls._createDoFunction(ShellPlot.plotQuantiles, name), - completer=cls._createCompleteFunction(), - help_arguments=" [key_2..key_n]", - help_message="Plot a different statistics for the specified %s key(s)." % name) - - @classmethod - def addDistributionPlotSupport(cls, instance, name): - """ - :type instance: ert_gui.shell.ShellFunction - """ - cls._checkForRequiredMethods(instance) - instance.addShellFunction(name="distribution", - function=cls._createDoFunction(ShellPlot.plotDistribution, name), - completer=cls._createCompleteFunction(), - help_arguments=" [key_2..key_n]", - help_message="Plot the distribution plot for the specified %s key(s)." % name) - - @classmethod - def addCrossCaseStatisticsPlotSupport(cls, instance, name): - """ - :type instance: ert_gui.shell.ShellFunction - """ - cls._checkForRequiredMethods(instance) - instance.addShellFunction(name="cross_case_statistics", - function=cls._createDoFunction(ShellPlot.plotCrossCaseStatistics, name), - completer=cls._createCompleteFunction(), - help_arguments=" [key_2..key_n]", - help_message="Plot the cross case statistics plot for the specified %s key(s)." % name) - - @classmethod - def _createDoPrintFunction(cls, name): - def do_function(self, line): - keys = matchItems(line, self.fetchSupportedKeys()) - - if len(keys) == 0: - self.lastCommandFailed("Must have at least one %s key" % name) - return False - - case_name = self.shellContext().ert().getEnkfFsManager().getCurrentFileSystem().getCaseName() - - for key in keys: - pdg = self.plotDataGatherer() - if pdg.canGatherDataForKey(key): - data = pdg.gatherData(self.shellContext().ert(), case_name, key) - print(data) - else: - self.lastCommandFailed("Unable to print data for key: %s" % key) - - return assertConfigLoaded(do_function) - - @classmethod - def addPrintSupport(cls, instance, name): - """ - :type instance: ert_gui.shell.ShellFunction - """ - cls._checkForRequiredMethods(instance) - - instance.addShellFunction(name="print", - function=cls._createDoPrintFunction(name), - completer=cls._createCompleteFunction(), - help_arguments=" [key_2..key_n]", - help_message="Print the values for the specified %s key(s)." % name) diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/simulations.py b/ThirdParty/Ert/python/python/ert_gui/shell/simulations.py deleted file mode 100644 index b8ca252347..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/simulations.py +++ /dev/null @@ -1,58 +0,0 @@ -import time -from datetime import datetime - -from ert.enkf import EnkfSimulationRunner -from ert.enkf.enums import HookRuntime -from ert_gui.shell import assertConfigLoaded, ErtShellCollection - - -class Simulations(ErtShellCollection): - def __init__(self, parent): - super(Simulations, self).__init__("simulations", parent) - self.addShellFunction(name="settings", - function=Simulations.settings, - help_message="Show simulations settings.") - - self.addShellFunction(name="ensemble_experiment", - function=Simulations.ensembleExperiment, - help_message="Run Ensemble Experiment.") - - @assertConfigLoaded - def settings(self, line): - runpath = self.ert().getModelConfig().getRunpathAsString() - - iteration_count = self.ert().analysisConfig().getAnalysisIterConfig().getNumIterations() - realizations = self.ert().getEnsembleSize() - - print("Runpath: %s" % runpath) - print("Iteration count: %d" % iteration_count) - print("Realization count: %d" % realizations) - - @assertConfigLoaded - def ensembleExperiment(self, line): - simulation_runner = EnkfSimulationRunner(self.ert()) - - now = time.time() - print("Ensemble Experiment started at: %s" % datetime.now().isoformat(sep=" ")) - - iteration_count = 0 - active_realization_mask = BoolVector(default_value = True, initial_size = self.ert().getEnsembleSize()) - simulation_runner.createRunPath(active_realization_mask, iteration_count) - - simulation_runner.runWorkflows(HookRuntime.PRE_SIMULATION) - - print("Start simulations!") - num_successful_realizations = simulation_runner.runEnsembleExperiment() - - success = self.ert().analysisConfig().haveEnoughRealisations(num_successful_realizations, self.ert().getEnsembleSize()) - if not success: - print("Error: Number of successful realizations is too low.\nYou can allow more failed realizations by setting / changing the MIN_REALIZATIONS configuration element!") - return - - print("Ensemble Experiment post processing!") - simulation_runner.runWorkflows(HookRuntime.POST_SIMULATION) - - print("Ensemble Experiment completed at: %s" % datetime.now().isoformat(sep=" ")) - - diff = time.time() - now - print("Running time: %d seconds" % int(diff)) diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/smoother.py b/ThirdParty/Ert/python/python/ert_gui/shell/smoother.py deleted file mode 100644 index 72eeb68a90..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/smoother.py +++ /dev/null @@ -1,88 +0,0 @@ -from ert.enkf import ESUpdate -from ert_gui.shell import assertConfigLoaded, ErtShellCollection -from ert_gui.shell.libshell import splitArguments, createFloatValidator -from ert.enkf.enums import HookRuntime - -class Smoother(ErtShellCollection): - def __init__(self, parent): - super(Smoother, self).__init__("smoother", parent) - - self.addShellProperty(name="overlap_alpha", - getter=Smoother.getOverlapAlpha, - setter=Smoother.setOverlapAlpha, - validator=createFloatValidator(), - completer=None, - help_arguments="[alpha_value]", - help_message="Show or set the overlap alpha.", - pretty_attribute="Overlap Alpha") - - self.addShellProperty(name="std_cutoff", - getter=Smoother.getStdCutOff, - setter=Smoother.setStdCutOff, - validator=createFloatValidator(minimum=0), - completer=None, - help_arguments="[cutoff_value]", - help_message="Show or set the standard deviation cutoff value (>0).", - pretty_attribute="Standard Deviation Cutoff") - - self.addShellProperty(name="global_std_scaling", - getter=Smoother.getGlobalStdScaling, - setter=Smoother.setGlobalStdScaling, - validator=createFloatValidator(minimum=0), - completer=None, - help_arguments="[std_scaling]", - help_message="Show or set the global standard deviation scaling value (>0) applied to updates.", - pretty_attribute="Global Standard Deviation Scaling") - - self.addShellFunction(name="update", - function=Smoother.update, - help_arguments=" ", - help_message="Set a variable value.") - - - @assertConfigLoaded - def analysisConfig(self): - """ @rtype: ert.analysis.AnalysisConfig """ - return self.ert().analysisConfig() - - def setOverlapAlpha(self, value): - self.analysisConfig().setEnkfAlpha(value) - - def getOverlapAlpha(self): - return self.analysisConfig().getEnkfAlpha() - - def setStdCutOff(self, value): - self.analysisConfig().setStdCutoff(value) - - def getStdCutOff(self): - return self.analysisConfig().getStdCutoff() - - def setGlobalStdScaling(self, value): - self.analysisConfig().setGlobalStdScaling(value) - - def getGlobalStdScaling(self): - return self.analysisConfig().getGlobalStdScaling() - - @assertConfigLoaded - def update(self, line): - arguments = splitArguments(line) - - if len(arguments) == 1: - case_name = arguments[0] - ert = self.ert() - fs_manager = ert.getEnkfFsManager() - - ert.getEnkfSimulationRunner().runWorkflows(HookRuntime.PRE_UPDATE) - - es_update = ESUpdate( ert ) - target_fs = fs_manager.getFileSystem(case_name) - source_fs = fs_manager.getCurrentFileSystem( ) - success = es_update.smootherUpdate( source_fs , target_fs ) - - if not success: - self.lastCommandFailed("Unable to perform update") - - ert.getEnkfSimulationRunner().runWorkflows(HookRuntime.POST_UPDATE) - - else: - self.lastCommandFailed("Expected one argument: received: '%s'" % line) diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/storage.py b/ThirdParty/Ert/python/python/ert_gui/shell/storage.py deleted file mode 100644 index ef08aeeb32..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/storage.py +++ /dev/null @@ -1,90 +0,0 @@ -import ert -from ert_gui.shell import ErtShellCollection -from ert_gui.shell.libshell import splitArguments, getPossibleFilenameCompletions, extractFullArgument - - -import ctypes -import os - -NO_SORT = 0 -STRING_SORT = 1 -OFFSET_SORT = 2 - -import cwrap.clib as clib -UTIL_LIB = ert.load("libert_util") - -UTIL_LIB.block_fs_is_mount.restype = ctypes.c_bool -UTIL_LIB.block_fs_mount.restype = ctypes.c_void_p -UTIL_LIB.block_fs_alloc_filelist.restype = ctypes.c_void_p -UTIL_LIB.block_fs_close.restype = ctypes.c_void_p - -UTIL_LIB.vector_get_size.restype = ctypes.c_int -UTIL_LIB.vector_iget_const.restype = ctypes.c_void_p -UTIL_LIB.vector_free.restype = ctypes.c_void_p - -UTIL_LIB.user_file_node_get_filename.restype = ctypes.c_char_p -UTIL_LIB.user_file_node_get_data_size.restype = ctypes.c_int -UTIL_LIB.user_file_node_get_node_offset.restype = ctypes.c_long - -class Storage(ErtShellCollection): - def __init__(self, parent): - super(Storage, self).__init__("storage", parent) - - self.addShellFunction(name="ls", - function=Storage.ls, - completer=Storage.completeLs, - help_arguments=" [wildcard_pattern]", - help_message="Will list all elements in 'block_file' matching optional 'wildcard_pattern'") - - def ls(self, line): - arguments = splitArguments(line) - - if len(arguments) == 0: - self.lastCommandFailed("A 'block file' is required.") - else: - block_file = arguments[0] - pattern = None if len(arguments) == 1 else arguments[1] - - if not os.path.isfile(block_file): - self.lastCommandFailed("The path: '%s' is not a file." % block_file) - else: - if not UTIL_LIB.block_fs_is_mount(block_file): - _, filename = os.path.split(block_file) - self.lastCommandFailed("The file: '%s' is not a block mount file." % filename) - else: - block_fs = UTIL_LIB.block_fs_mount(block_file, 1, 0, 1, 0, False, True, False) - files = UTIL_LIB.block_fs_alloc_filelist(block_fs, pattern, OFFSET_SORT, False) - - file_count = UTIL_LIB.vector_get_size(files) - - if file_count > 0: - fmt = " %-40s %10d %10d" - print(" %-40s %10s %10s" % ("Keyword", "Size", "Offset")) - - for index in range(file_count): - node = UTIL_LIB.vector_iget_const(files, index) - node_filename = UTIL_LIB.user_file_node_get_filename(node) - node_size = UTIL_LIB.user_file_node_get_data_size(node) - node_offset = UTIL_LIB.user_file_node_get_node_offset(node) - print(fmt % (node_filename, node_size, node_offset)) - - UTIL_LIB.vector_free(files) - UTIL_LIB.block_fs_close(block_fs) - - - def completeLs(self, text, line, begidx, endidx): - arguments = splitArguments(line) - last_argument = extractFullArgument(line, endidx) - - if len(arguments) == 1 and len(text) == 0: - ert = self.ert() - if ert is not None: - return [ert.getModelConfig().getEnspath() + os.path.sep] - else: - return getPossibleFilenameCompletions("") - elif len(arguments) == 2 and len(last_argument) > 0: - return getPossibleFilenameCompletions(last_argument) - elif len(arguments) == 3 and len(text) > 0: - return [] # pattern completion... - else: - return [] diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/summary_keys.py b/ThirdParty/Ert/python/python/ert_gui/shell/summary_keys.py deleted file mode 100644 index 1d915bd505..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/summary_keys.py +++ /dev/null @@ -1,95 +0,0 @@ -from ert_gui.plottery import PlotDataGatherer as PDG -from ert_gui.shell import assertConfigLoaded, ShellPlot, ErtShellCollection -from ert_gui.shell.libshell import splitArguments - - -class SummaryKeys(ErtShellCollection): - def __init__(self, parent): - super(SummaryKeys, self).__init__("summary", parent) - - self.addShellFunction(name="list", - function=SummaryKeys.list, - help_message="Shows a list of all available Summary keys. (* = with observations)") - - self.addShellFunction(name="observations", - function=SummaryKeys.observations, - help_message= "Shows a list of all available Summary key observations.") - - self.addShellFunction(name="matchers", - function=SummaryKeys.matchers, - help_message="Shows a list of all Summary keys that the ensemble will match " - "against during simulations and manual load.") - - self.addShellFunction(name="add_matcher", - function=SummaryKeys.add_matcher, - help_arguments="", - help_message="Add a matcher to the Summary key matcher set.") - - self.__plot_data_gatherer = None - - ShellPlot.addPrintSupport(self, "Summary") - ShellPlot.addEnsemblePlotSupport(self, "Summary") - ShellPlot.addQuantilesPlotSupport(self, "Summary") - - - @assertConfigLoaded - def list(self, line): - keys = self.summaryKeys() - observation_keys = self.summaryObservationKeys() - - result = ["*%s" % key if key in observation_keys else " %s" % key for key in keys] - - self.columnize(result) - - @assertConfigLoaded - def observations(self, line): - keys = self.summaryKeys() - - observation_keys = [] - for key in keys: - obs_keys = self.ert().ensembleConfig().getNode(key).getObservationKeys() - observation_keys.extend(obs_keys) - - self.columnize(observation_keys) - - @assertConfigLoaded - def matchers(self, line): - ensemble_config = self.ert().ensembleConfig() - summary_key_matcher = ensemble_config.getSummaryKeyMatcher() - keys = sorted(["!%s" % key if summary_key_matcher.isRequired(key) else " %s" % key for key in summary_key_matcher.keys()]) - - self.columnize(keys) - - @assertConfigLoaded - def add_matcher(self, line): - args = splitArguments(line) - - if len(args) < 1: - self.lastCommandFailed("A Summary key is required.") - return False - - self.ert().ensembleConfig().getSummaryKeyMatcher().addSummaryKey(args[0].strip()) - - - def summaryKeys(self): - return self.ert().getKeyManager().summaryKeys() - - - def summaryObservationKeys(self): - return self.ert().getKeyManager().summaryKeysWithObservations() - - - def fetchSupportedKeys(self): - return self.summaryKeys() - - - def plotDataGatherer(self): - if self.__plot_data_gatherer is None: - summary_pdg = PDG.gatherSummaryData - summary_key_manager = self.ert().getKeyManager().isSummaryKey - refcase_pdg = PDG.gatherSummaryRefcaseData - observation_pdg = PDG.gatherSummaryObservationData - pdg = PDG(summary_pdg, summary_key_manager, refcaseGatherFunc=refcase_pdg, observationGatherFunc=observation_pdg) - self.__plot_data_gatherer = pdg - - return self.__plot_data_gatherer diff --git a/ThirdParty/Ert/python/python/ert_gui/shell/workflows.py b/ThirdParty/Ert/python/python/ert_gui/shell/workflows.py deleted file mode 100644 index c2c65c43cb..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/shell/workflows.py +++ /dev/null @@ -1,48 +0,0 @@ -from ert.job_queue import WorkflowRunner -from ert_gui.shell import assertConfigLoaded, ErtShellCollection -from ert_gui.shell.libshell import autoCompleteList - - -class Workflows(ErtShellCollection): - def __init__(self, parent): - super(Workflows, self).__init__("workflows", parent) - - self.addShellFunction(name="list", - function=Workflows.list, - help_message="Shows a list of all available workflows.") - - self.addShellFunction(name="run", - function=Workflows.run, - completer=Workflows.completeRun, - help_arguments="", - help_message="Run a named workflow.") - - def getWorkflowNames(self): - return [workflow for workflow in self.ert().getWorkflowList().getWorkflowNames()] - - @assertConfigLoaded - def list(self, line): - workflows = self.getWorkflowNames() - if len(workflows) > 0: - self.columnize(workflows) - else: - print("No workflows available.") - - @assertConfigLoaded - def run(self, workflow): - workflow = workflow.strip() - if workflow in self.getWorkflowNames(): - workflow_list = self.ert().getWorkflowList() - workflow = workflow_list[workflow] - context = workflow_list.getContext() - - runner = WorkflowRunner(workflow, self.ert(), context) - runner.run() - runner.wait() - else: - self.lastCommandFailed("Unknown workflow: '%s'" % workflow) - - @assertConfigLoaded - def completeRun(self, text, line, begidx, endidx): - return autoCompleteList(text, self.getWorkflowNames()) - diff --git a/ThirdParty/Ert/python/python/ert_gui/simulation/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/simulation/CMakeLists.txt deleted file mode 100644 index 76c0e02957..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/simulation/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - ensemble_experiment_panel.py - ensemble_smoother_panel.py - iterated_ensemble_smoother_panel.py - multiple_data_assimilation_panel.py - progress.py - run_dialog.py - simple_progress.py - simulation_config_panel.py - simulation_panel.py -) - -add_python_package("python.ert_gui.simulation" ${PYTHON_INSTALL_PREFIX}/ert_gui/simulation "${PYTHON_SOURCES}" True) - -add_subdirectory(models) diff --git a/ThirdParty/Ert/python/python/ert_gui/simulation/__init__.py b/ThirdParty/Ert/python/python/ert_gui/simulation/__init__.py deleted file mode 100644 index 4c029f1732..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/simulation/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -from .progress import Progress -from .simple_progress import SimpleProgress -from .run_dialog import RunDialog -from .simulation_config_panel import SimulationConfigPanel -from .ensemble_experiment_panel import EnsembleExperimentPanel -from .ensemble_smoother_panel import EnsembleSmootherPanel -from .iterated_ensemble_smoother_panel import IteratedEnsembleSmootherPanel -from .multiple_data_assimilation_panel import MultipleDataAssimilationPanel - diff --git a/ThirdParty/Ert/python/python/ert_gui/simulation/ensemble_experiment_panel.py b/ThirdParty/Ert/python/python/ert_gui/simulation/ensemble_experiment_panel.py deleted file mode 100644 index ca62e11a36..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/simulation/ensemble_experiment_panel.py +++ /dev/null @@ -1,52 +0,0 @@ -from PyQt4.QtGui import QFormLayout, QLabel - -from ert_gui.ertwidgets import addHelpToWidget -from ert_gui.ertwidgets.caseselector import CaseSelector -from ert_gui.ertwidgets.models.activerealizationsmodel import ActiveRealizationsModel -from ert_gui.ertwidgets.models.ertmodel import getRealizationCount, getRunPath -from ert_gui.ertwidgets.stringbox import StringBox -from ert_gui.ide.keywords.definitions import RangeStringArgument -from ert_gui.simulation.models import EnsembleExperiment -from ert_gui.simulation.simulation_config_panel import SimulationConfigPanel - - -class EnsembleExperimentPanel(SimulationConfigPanel): - - def __init__(self): - SimulationConfigPanel.__init__(self, EnsembleExperiment()) - - layout = QFormLayout() - - case_selector = CaseSelector() - layout.addRow("Current case:", case_selector) - - run_path_label = QLabel("%s" % getRunPath()) - addHelpToWidget(run_path_label, "config/simulation/runpath") - layout.addRow("Runpath:", run_path_label) - - number_of_realizations_label = QLabel("%d" % getRealizationCount()) - addHelpToWidget(number_of_realizations_label, "config/ensemble/num_realizations") - layout.addRow(QLabel("Number of realizations:"), number_of_realizations_label) - - self._active_realizations_model = ActiveRealizationsModel() - self._active_realizations_field = StringBox(self._active_realizations_model, "config/simulation/active_realizations") - self._active_realizations_field.setValidator(RangeStringArgument(getRealizationCount())) - layout.addRow("Active realizations", self._active_realizations_field) - - self._active_realizations_field.getValidationSupport().validationChanged.connect(self.simulationConfigurationChanged) - - self.setLayout(layout) - - - def isConfigurationValid(self): - return self._active_realizations_field.isValid() - - def toggleAdvancedOptions(self, show_advanced): - self._active_realizations_field.setVisible(show_advanced) - self.layout().labelForField(self._active_realizations_field).setVisible(show_advanced) - - def getSimulationArguments(self): - active_realizations_mask = self._active_realizations_model.getActiveRealizationsMask() - return {"active_realizations": active_realizations_mask} - - diff --git a/ThirdParty/Ert/python/python/ert_gui/simulation/ensemble_smoother_panel.py b/ThirdParty/Ert/python/python/ert_gui/simulation/ensemble_smoother_panel.py deleted file mode 100644 index def973caf9..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/simulation/ensemble_smoother_panel.py +++ /dev/null @@ -1,64 +0,0 @@ -from PyQt4.QtGui import QFormLayout, QLabel - -from ert_gui.ertwidgets import addHelpToWidget, AnalysisModuleSelector -from ert_gui.ertwidgets.caseselector import CaseSelector -from ert_gui.ertwidgets.models.activerealizationsmodel import ActiveRealizationsModel -from ert_gui.ertwidgets.models.ertmodel import getRealizationCount, getRunPath -from ert_gui.ertwidgets.models.targetcasemodel import TargetCaseModel -from ert_gui.ertwidgets.stringbox import StringBox -from ert_gui.ide.keywords.definitions import RangeStringArgument, ProperNameArgument -from ert_gui.simulation import SimulationConfigPanel -from ert_gui.simulation.models import EnsembleSmoother - - -class EnsembleSmootherPanel(SimulationConfigPanel): - def __init__(self): - SimulationConfigPanel.__init__(self, EnsembleSmoother()) - - layout = QFormLayout() - - case_selector = CaseSelector() - layout.addRow("Current case:", case_selector) - - run_path_label = QLabel("%s" % getRunPath()) - addHelpToWidget(run_path_label, "config/simulation/runpath") - layout.addRow("Runpath:", run_path_label) - - number_of_realizations_label = QLabel("%d" % getRealizationCount()) - addHelpToWidget(number_of_realizations_label, "config/ensemble/num_realizations") - layout.addRow(QLabel("Number of realizations:"), number_of_realizations_label) - - self._target_case_model = TargetCaseModel() - self._target_case_field = StringBox(self._target_case_model, "config/simulation/target_case") - self._target_case_field.setValidator(ProperNameArgument()) - layout.addRow("Target case:", self._target_case_field) - - self._analysis_module_selector = AnalysisModuleSelector(iterable=False, help_link="config/analysis/analysis_module") - layout.addRow("Analysis Module:", self._analysis_module_selector) - - self._active_realizations_model = ActiveRealizationsModel() - self._active_realizations_field = StringBox(self._active_realizations_model, "config/simulation/active_realizations") - self._active_realizations_field.setValidator(RangeStringArgument(getRealizationCount())) - layout.addRow("Active realizations", self._active_realizations_field) - - self._target_case_field.getValidationSupport().validationChanged.connect(self.simulationConfigurationChanged) - self._active_realizations_field.getValidationSupport().validationChanged.connect(self.simulationConfigurationChanged) - - self.setLayout(layout) - - def isConfigurationValid(self): - return self._target_case_field.isValid() and self._active_realizations_field.isValid() - - def toggleAdvancedOptions(self, show_advanced): - self._active_realizations_field.setVisible(show_advanced) - self.layout().labelForField(self._active_realizations_field).setVisible(show_advanced) - - self._analysis_module_selector.setVisible(show_advanced) - self.layout().labelForField(self._analysis_module_selector).setVisible(show_advanced) - - def getSimulationArguments(self): - arguments = {"active_realizations": self._active_realizations_model.getActiveRealizationsMask(), - "target_case": self._target_case_model.getValue(), - "analysis_module": self._analysis_module_selector.getSelectedAnalysisModuleName() - } - return arguments diff --git a/ThirdParty/Ert/python/python/ert_gui/simulation/iterated_ensemble_smoother_panel.py b/ThirdParty/Ert/python/python/ert_gui/simulation/iterated_ensemble_smoother_panel.py deleted file mode 100644 index ff4bb79457..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/simulation/iterated_ensemble_smoother_panel.py +++ /dev/null @@ -1,78 +0,0 @@ -from PyQt4.QtGui import QFormLayout, QLabel, QSpinBox - -from ert_gui.ertwidgets import addHelpToWidget, AnalysisModuleSelector, CaseSelector -from ert_gui.ertwidgets.models.activerealizationsmodel import ActiveRealizationsModel -from ert_gui.ertwidgets.models.ertmodel import getRealizationCount, getRunPath, setNumberOfIterations, getNumberOfIterations -from ert_gui.ertwidgets.models.targetcasemodel import TargetCaseModel -from ert_gui.ertwidgets.stringbox import StringBox -from ert_gui.ide.keywords.definitions import RangeStringArgument, ProperNameFormatArgument -from ert_gui.simulation import SimulationConfigPanel -from ert_gui.simulation.models import IteratedEnsembleSmoother - - -class IteratedEnsembleSmootherPanel(SimulationConfigPanel): - def __init__(self, advanced_option=False): - SimulationConfigPanel.__init__(self, IteratedEnsembleSmoother(), advanced_option) - - layout = QFormLayout() - - case_selector = CaseSelector() - layout.addRow("Current case:", case_selector) - - run_path_label = QLabel("%s" % getRunPath()) - addHelpToWidget(run_path_label, "config/simulation/runpath") - layout.addRow("Runpath:", run_path_label) - - number_of_realizations_label = QLabel("%d" % getRealizationCount()) - addHelpToWidget(number_of_realizations_label, "config/ensemble/num_realizations") - layout.addRow(QLabel("Number of realizations:"), number_of_realizations_label) - - # The num_iterations_spinner does not track any external changes (will that ever happen?) - num_iterations_spinner = QSpinBox() - num_iterations_spinner.setMinimum(1) - num_iterations_spinner.setMaximum(100) - num_iterations_spinner.setValue(getNumberOfIterations()) - addHelpToWidget(num_iterations_spinner, "config/simulation/number_of_iterations") - num_iterations_spinner.valueChanged[int].connect(setNumberOfIterations) - - layout.addRow("Number of iterations:", num_iterations_spinner) - - self._iterated_target_case_format_model = TargetCaseModel(format_mode=True) - self._iterated_target_case_format_field = StringBox(self._iterated_target_case_format_model, "config/simulation/iterated_target_case_format") - self._iterated_target_case_format_field.setValidator(ProperNameFormatArgument()) - layout.addRow("Target case format:", self._iterated_target_case_format_field) - - - self._analysis_module_selector = AnalysisModuleSelector(iterable=True, help_link="config/analysis/analysis_module") - layout.addRow("Analysis Module:", self._analysis_module_selector) - - self._active_realizations_model = ActiveRealizationsModel() - self._active_realizations_field = StringBox(self._active_realizations_model, "config/simulation/active_realizations") - self._active_realizations_field.setValidator(RangeStringArgument(getRealizationCount())) - layout.addRow("Active realizations", self._active_realizations_field) - - - self._iterated_target_case_format_field.getValidationSupport().validationChanged.connect(self.simulationConfigurationChanged) - self._active_realizations_field.getValidationSupport().validationChanged.connect(self.simulationConfigurationChanged) - - self.setLayout(layout) - - def isConfigurationValid(self): - analysis_module = self._analysis_module_selector.getSelectedAnalysisModuleName() - return self._iterated_target_case_format_field.isValid() and self._active_realizations_field.isValid() and analysis_module is not None - - - def toggleAdvancedOptions(self, show_advanced): - self._active_realizations_field.setVisible(show_advanced) - self.layout().labelForField(self._active_realizations_field).setVisible(show_advanced) - - self._analysis_module_selector.setVisible(show_advanced) - self.layout().labelForField(self._analysis_module_selector).setVisible(show_advanced) - - - def getSimulationArguments(self): - arguments = {"active_realizations": self._active_realizations_model.getActiveRealizationsMask(), - "target_case": self._iterated_target_case_format_model.getValue(), - "analysis_module": self._analysis_module_selector.getSelectedAnalysisModuleName() - } - return arguments diff --git a/ThirdParty/Ert/python/python/ert_gui/simulation/models/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/simulation/models/CMakeLists.txt deleted file mode 100644 index 630b7ae43a..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/simulation/models/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - base_run_model.py - ensemble_experiment.py - ensemble_smoother.py - iterated_ensemble_smoother.py - multiple_data_assimilation.py - simulations_tracker.py -) - -add_python_package("python.ert_gui.simulation.models" ${PYTHON_INSTALL_PREFIX}/ert_gui/simulation/models "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert_gui/simulation/models/__init__.py b/ThirdParty/Ert/python/python/ert_gui/simulation/models/__init__.py deleted file mode 100644 index 8f0b2301a3..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/simulation/models/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -from .base_run_model import BaseRunModel, ErtRunError -from .ensemble_experiment import EnsembleExperiment -from .ensemble_smoother import EnsembleSmoother -from .iterated_ensemble_smoother import IteratedEnsembleSmoother -from .multiple_data_assimilation import MultipleDataAssimilation -from .simulations_tracker import SimulationsTracker \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/simulation/models/base_run_model.py b/ThirdParty/Ert/python/python/ert_gui/simulation/models/base_run_model.py deleted file mode 100644 index 1297174fe6..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/simulation/models/base_run_model.py +++ /dev/null @@ -1,206 +0,0 @@ -import time -from ert.job_queue import JobStatusType -from ert_gui import ERT -from ert.enkf import ErtLog - - -class ErtRunError(Exception): - pass - -class BaseRunModel(object): - - def __init__(self, name, phase_count=1): - super(BaseRunModel, self).__init__() - self._name = name - self._phase = 0 - self._phase_count = phase_count - self._phase_update_count = 0 - self._phase_name = "Not defined" - - self._job_start_time = 0 - self._job_stop_time = 0 - self._indeterminate = False - self._fail_message = "" - self._failed = False - self.reset( ) - - - def ert(self): - """ @rtype: ert.enkf.EnKFMain""" - return ERT.ert - - def reset(self): - self._failed = False - - - def startSimulations(self, run_arguments): - try: - self.runSimulations(run_arguments) - except ErtRunError as e: - self._failed = True - self._fail_message = str(e) - self._simulationEnded() - - - def runSimulations(self, run_arguments): - raise NotImplementedError("Method must be implemented by inheritors!") - - - def killAllSimulations(self): - job_queue = self.ert().siteConfig().getJobQueue() - job_queue.killAllJobs() - - - def userExitCalled(self): - """ @rtype: bool """ - job_queue = self.ert().siteConfig().getJobQueue() - return job_queue.getUserExit( ) - - - def phaseCount(self): - """ @rtype: int """ - return self._phase_count - - - def setPhaseCount(self, phase_count): - self._phase_count = phase_count - self.setPhase(0, "") - - - def currentPhase(self): - """ @rtype: int """ - return self._phase - - - def setPhaseName(self, phase_name, indeterminate=None): - self._phase_name = phase_name - self.setIndeterminate(indeterminate) - - - def getPhaseName(self): - """ @rtype: str """ - return self._phase_name - - - def setIndeterminate(self, indeterminate): - if indeterminate is not None: - self._indeterminate = indeterminate - - - def isFinished(self): - """ @rtype: bool """ - return self._phase == self._phase_count or self.hasRunFailed() - - - def hasRunFailed(self): - """ @rtype: bool """ - return self._failed - - - def getFailMessage(self): - """ @rtype: str """ - return self._fail_message - - - def _simulationEnded(self): - self._job_stop_time = int(time.time()) - - - def setPhase(self, phase, phase_name, indeterminate=None): - self.setPhaseName(phase_name) - if not 0 <= phase <= self._phase_count: - raise ValueError("Phase must be an integer from 0 to less than %d." % self._phase_count) - - self.setIndeterminate(indeterminate) - - if phase == 0: - self._job_start_time = int(time.time()) - - if phase == self._phase_count: - self._simulationEnded() - - self._phase = phase - self._phase_update_count = 0 - - - def getRunningTime(self): - """ @rtype: float """ - if self._job_stop_time < self._job_start_time: - return time.time() - self._job_start_time - else: - return self._job_stop_time - self._job_start_time - - - def getQueueSize(self): - """ @rtype: int """ - queue_size = len(self.ert().siteConfig().getJobQueue()) - - if queue_size == 0: - queue_size = 1 - - return queue_size - - - def getQueueStatus(self): - """ @rtype: dict of (JobStatusType, int) """ - job_queue = self.ert().siteConfig().getJobQueue() - - queue_status = {} - - if job_queue.isRunning(): - for job_number in range(len(job_queue)): - status = job_queue.getJobStatus(job_number) - - if not status in queue_status: - queue_status[status] = 0 - - queue_status[status] += 1 - - return queue_status - - def isQueueRunning(self): - """ @rtype: bool """ - return self.ert().siteConfig().getJobQueue().isRunning() - - - def getProgress(self): - """ @rtype: float """ - if self.isFinished(): - current_progress = 1.0 - elif not self.isQueueRunning() and self._phase_update_count > 0: - current_progress = (self._phase + 1.0) / self._phase_count - else: - self._phase_update_count += 1 - queue_status = self.getQueueStatus() - queue_size = self.getQueueSize() - - done_state = JobStatusType.JOB_QUEUE_SUCCESS | JobStatusType.JOB_QUEUE_DONE - done_count = 0 - - for state in queue_status: - if state in done_state: - done_count += queue_status[state] - - phase_progress = float(done_count) / queue_size - current_progress = (self._phase + phase_progress) / self._phase_count - - return current_progress - - - def isIndeterminate(self): - """ @rtype: bool """ - return not self.isFinished() and self._indeterminate - - - def checkHaveSufficientRealizations(self, num_successful_realizations): - if num_successful_realizations == 0: - raise ErtRunError("Simulation failed! All realizations failed!") - elif not self.ert().analysisConfig().haveEnoughRealisations(num_successful_realizations, self.ert().getEnsembleSize()): - raise ErtRunError("Too many simulations have failed! You can add/adjust MIN_REALIZATIONS to allow failures in your simulations.\n\n" - "Check ERT log file '%s' or simulation folder for details." % ErtLog.getFilename()) - - - def __str__(self): - return self._name - - diff --git a/ThirdParty/Ert/python/python/ert_gui/simulation/models/ensemble_experiment.py b/ThirdParty/Ert/python/python/ert_gui/simulation/models/ensemble_experiment.py deleted file mode 100644 index 26bc7947c9..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/simulation/models/ensemble_experiment.py +++ /dev/null @@ -1,30 +0,0 @@ -from ert.enkf.enums import HookRuntime -from ert_gui.simulation.models import BaseRunModel, ErtRunError - - -class EnsembleExperiment(BaseRunModel): - - def __init__(self): - super(EnsembleExperiment, self).__init__("Ensemble Experiment") - - def runSimulations(self, arguments): - self.setPhase(0, "Running simulations...", indeterminate=False) - active_realization_mask = arguments["active_realizations"] - - self.setPhaseName("Pre processing...", indeterminate=True) - self.ert().getEnkfSimulationRunner().createRunPath(active_realization_mask, 0) - self.ert().getEnkfSimulationRunner().runWorkflows( HookRuntime.PRE_SIMULATION ) - - self.setPhaseName("Running ensemble experiment...", indeterminate=False) - - num_successful_realizations = self.ert().getEnkfSimulationRunner().runEnsembleExperiment(active_realization_mask) - - self.checkHaveSufficientRealizations(num_successful_realizations) - - self.setPhaseName("Post processing...", indeterminate=True) - self.ert().getEnkfSimulationRunner().runWorkflows( HookRuntime.POST_SIMULATION ) - - self.setPhase(1, "Simulations completed.") # done... - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/simulation/models/ensemble_smoother.py b/ThirdParty/Ert/python/python/ert_gui/simulation/models/ensemble_smoother.py deleted file mode 100644 index 0b2d3001b6..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/simulation/models/ensemble_smoother.py +++ /dev/null @@ -1,65 +0,0 @@ -from ert.enkf.enums import EnkfInitModeEnum -from ert.enkf.enums import HookRuntime -from ert_gui.simulation.models import BaseRunModel, ErtRunError - - -class EnsembleSmoother(BaseRunModel): - - def __init__(self): - super(EnsembleSmoother, self).__init__(name="Ensemble Smoother", phase_count=2) - - def setAnalysisModule(self, module_name): - module_load_success = self.ert().analysisConfig().selectModule(module_name) - - if not module_load_success: - raise ErtRunError("Unable to load analysis module '%s'!" % module_name) - - - def runSimulations(self, arguments): - self.setPhase(0, "Running simulations...", indeterminate=False) - - self.setAnalysisModule(arguments["analysis_module"]) - active_realization_mask = arguments["active_realizations"] - - self.setPhaseName("Pre processing...", indeterminate=True) - self.ert().getEnkfSimulationRunner().createRunPath(active_realization_mask, 0) - self.ert().getEnkfSimulationRunner().runWorkflows( HookRuntime.PRE_SIMULATION ) - - self.setPhaseName("Running forecast...", indeterminate=False) - num_successful_realizations = self.ert().getEnkfSimulationRunner().runSimpleStep(active_realization_mask, EnkfInitModeEnum.INIT_CONDITIONAL , 0) - - self.checkHaveSufficientRealizations(num_successful_realizations) - - self.setPhaseName("Post processing...", indeterminate=True) - self.ert().getEnkfSimulationRunner().runWorkflows( HookRuntime.POST_SIMULATION ) - - self.setPhaseName("Analyzing...") - - target_case_name = arguments["target_case"] - target_fs = self.ert().getEnkfFsManager().getFileSystem(target_case_name) - source_fs = self.ert().getEnkfFsManager().getCurrentFileSystem() - - self.ert().getEnkfSimulationRunner().runWorkflows( HookRuntime.PRE_UPDATE ) - es_update = self.ert().getESUpdate( ) - success = es_update.smootherUpdate(source_fs, target_fs) - if not success: - raise ErtRunError("Analysis of simulation failed!") - self.ert().getEnkfSimulationRunner().runWorkflows( HookRuntime.POST_UPDATE ) - - self.setPhase(1, "Running simulations...") - self.ert().getEnkfFsManager().switchFileSystem(target_fs) - - self.setPhaseName("Pre processing...") - self.ert().getEnkfSimulationRunner().createRunPath(active_realization_mask, 1) - self.ert().getEnkfSimulationRunner().runWorkflows( HookRuntime.PRE_SIMULATION ) - - self.setPhaseName("Running forecast...", indeterminate=False) - - num_successful_realizations = self.ert().getEnkfSimulationRunner().runSimpleStep(active_realization_mask, EnkfInitModeEnum.INIT_NONE, 1) - - self.checkHaveSufficientRealizations(num_successful_realizations) - - self.setPhaseName("Post processing...", indeterminate=True) - self.ert().getEnkfSimulationRunner().runWorkflows( HookRuntime.POST_SIMULATION ) - - self.setPhase(2, "Simulations completed.") diff --git a/ThirdParty/Ert/python/python/ert_gui/simulation/models/iterated_ensemble_smoother.py b/ThirdParty/Ert/python/python/ert_gui/simulation/models/iterated_ensemble_smoother.py deleted file mode 100644 index aa7907821d..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/simulation/models/iterated_ensemble_smoother.py +++ /dev/null @@ -1,109 +0,0 @@ -from ert.enkf.enums import EnkfInitModeEnum, HookRuntime -from ert_gui.ertwidgets.models.ertmodel import getNumberOfIterations -from ert_gui.simulation.models import BaseRunModel, ErtRunError - - -class IteratedEnsembleSmoother(BaseRunModel): - - def __init__(self): - super(IteratedEnsembleSmoother, self).__init__(name="Iterated Ensemble Smoother", phase_count=2) - - def setAnalysisModule(self, module_name): - module_load_success = self.ert().analysisConfig().selectModule(module_name) - - if not module_load_success: - raise ErtRunError("Unable to load analysis module '%s'!" % module_name) - - return self.ert().analysisConfig().getModule(module_name) - - - def runAndPostProcess(self, active_realization_mask, phase, phase_count, mode): - self.setPhase(phase, "Running iteration %d of %d simulation iterations..." % (phase, phase_count - 1), indeterminate=False) - - self.setPhaseName("Pre processing...", indeterminate=True) - self.ert().getEnkfSimulationRunner().createRunPath(active_realization_mask, phase) - self.ert().getEnkfSimulationRunner().runWorkflows( HookRuntime.PRE_SIMULATION ) - - self.setPhaseName("Running forecast...", indeterminate=False) - num_successful_realizations = self.ert().getEnkfSimulationRunner().runSimpleStep(active_realization_mask, mode, phase) - - self.checkHaveSufficientRealizations(num_successful_realizations) - - self.setPhaseName("Post processing...", indeterminate=True) - self.ert().getEnkfSimulationRunner().runWorkflows( HookRuntime.POST_SIMULATION ) - - - def createTargetCaseFileSystem(self, phase, target_case_format): - target_fs = self.ert().getEnkfFsManager().getFileSystem(target_case_format % phase) - return target_fs - - - def analyzeStep(self, target_fs): - self.setPhaseName("Analyzing...", indeterminate=True) - source_fs = self.ert().getEnkfFsManager().getCurrentFileSystem() - - self.setPhaseName("Pre processing update...", indeterminate=True) - EnkfSimulationRunner(ert).runWorkflows(HookRuntime.PRE_UPDATE) - es_update = self.ert().getESUpdate() - - success = es_update.smootherUpdate(source_fs, target_fs) - if not success: - raise ErtRunError("Analysis of simulation failed!") - - self.setPhaseName("Post processing update...", indeterminate=True) - EnkfSimulationRunner(ert).runWorkflows(HookRuntime.POST_UPDATE) - - def runSimulations(self, arguments): - phase_count = getNumberOfIterations() + 1 - self.setPhaseCount(phase_count) - - analysis_module = self.setAnalysisModule(arguments["analysis_module"]) - active_realization_mask = arguments["active_realizations"] - target_case_format = arguments["target_case"] - - source_fs = self.ert().getEnkfFsManager().getCurrentFileSystem() - initial_fs = self.createTargetCaseFileSystem(0, target_case_format) - - if not source_fs == initial_fs: - self.ert().getEnkfFsManager().switchFileSystem(initial_fs) - self.ert().getEnkfFsManager().initializeCurrentCaseFromExisting(source_fs, 0) - - self.runAndPostProcess(active_realization_mask, 0, phase_count, EnkfInitModeEnum.INIT_CONDITIONAL) - - self.ert().analysisConfig().getAnalysisIterConfig().setCaseFormat( target_case_format ) - - analysis_config = self.ert().analysisConfig() - analysis_iter_config = analysis_config.getAnalysisIterConfig() - num_retries_per_iteration = analysis_iter_config.getNumRetries() - num_tries = 0 - current_iteration = 1 - - while current_iteration <= getNumberOfIterations() and num_tries < num_retries_per_iteration: - target_fs = self.createTargetCaseFileSystem(current_iteration, target_case_format) - - pre_analysis_iter_num = analysis_module.getInt("ITER") - self.analyzeStep(target_fs) - post_analysis_iter_num = analysis_module.getInt("ITER") - - analysis_success = False - if post_analysis_iter_num > pre_analysis_iter_num: - analysis_success = True - - if analysis_success: - self.ert().getEnkfFsManager().switchFileSystem(target_fs) - self.runAndPostProcess(active_realization_mask, current_iteration, phase_count, EnkfInitModeEnum.INIT_NONE) - num_tries = 0 - current_iteration += 1 - else: - self.ert().getEnkfFsManager().initializeCurrentCaseFromExisting(target_fs, 0) - self.runAndPostProcess(active_realization_mask, current_iteration - 1 , phase_count, EnkfInitModeEnum.INIT_NONE) - num_tries += 1 - - - - if current_iteration == phase_count: - self.setPhase(phase_count, "Simulations completed.") - else: - raise ErtRunError("Iterated Ensemble Smoother stopped: maximum number of iteration retries (%d retries) reached for iteration %d" % (num_retries_per_iteration, current_iteration)) - - diff --git a/ThirdParty/Ert/python/python/ert_gui/simulation/models/multiple_data_assimilation.py b/ThirdParty/Ert/python/python/ert_gui/simulation/models/multiple_data_assimilation.py deleted file mode 100644 index 8dac4bb2d1..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/simulation/models/multiple_data_assimilation.py +++ /dev/null @@ -1,174 +0,0 @@ -# Copyright (C) 2016 Statoil ASA, Norway. -# -# This file is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from ert.enkf.enums import EnkfInitModeEnum -from ert.enkf.enums import HookRuntime - -from ert_gui.simulation.models import BaseRunModel, ErtRunError - - -class MultipleDataAssimilation(BaseRunModel): - """ - Run Multiple Data Assimilation (MDA) Ensemble Smoother with custom weights. - """ - - def __init__(self): - super(MultipleDataAssimilation, self).__init__(name="Multiple Data Assimilation (ES MDA)", phase_count=2) - self.weights = "3, 2, 1" # default value - - def getWeights(self): - return self.weights - - def setWeights(self, weights): - str_weights = str(weights) - print("Weights changed: %s" % str_weights) - self.weights = str_weights - - def setAnalysisModule(self, module_name): - module_load_success = self.ert().analysisConfig().selectModule(module_name) - - if not module_load_success: - raise ErtRunError("Unable to load analysis module '%s'!" % module_name) - - - def runSimulations(self, arguments): - weights = self.parseWeights(self.weights) - iteration_count = len(weights) - - self.setAnalysisModule(arguments["analysis_module"]) - - print("Running MDA ES for %s iterations\t%s" % (iteration_count, ", ".join(str(weight) for weight in weights))) - weights = self.normalizeWeights(weights) - - weight_string = ", ".join(str(round(weight,3)) for weight in weights) - print("Running MDA ES on (weights normalized)\t%s" % weight_string) - - - self.setPhaseCount(iteration_count+2) # pre + post + weights - - target_case_format = arguments["target_case"] - - source_fs = self.ert().getEnkfFsManager().getCurrentFileSystem() - target_case_name = target_case_format % 0 - target_fs = self.ert().getEnkfFsManager().getFileSystem(target_case_name) - - if not source_fs == target_fs: - self.ert().getEnkfFsManager().switchFileSystem(target_fs) - self.ert().getEnkfFsManager().initializeCurrentCaseFromExisting(source_fs, 0) - - active_realization_mask = arguments["active_realizations"] - - - phase_string = "Running MDA ES %d iteration%s." % (iteration_count, ('s' if (iteration_count != 1) else '')) - self.setPhaseName(phase_string, indeterminate=True) - - self.ert().getEnkfSimulationRunner().createRunPath(active_realization_mask, 1) - self.ert().getEnkfSimulationRunner().runWorkflows( HookRuntime.PRE_SIMULATION ) - - - for iteration, weight in enumerate(weights): - num_successful_realizations = self.simulateAndPostProcess(target_case_format, active_realization_mask, iteration) - - # We exit because the user has pressed 'Kill all simulations'. - if self.userExitCalled( ): - self.setPhase(iteration_count + 2, "Simulations stopped") - return - - # We exit if there are too few realisations left for updating. - self.checkHaveSufficientRealizations(num_successful_realizations) - - self.ert().getEnkfSimulationRunner().runWorkflows( HookRuntime.PRE_UPDATE ) - self.update(target_case_format, iteration, weights[iteration]) - self.ert().getEnkfSimulationRunner().runWorkflows( HookRuntime.POST_UPDATE ) - - self.setPhaseName("Post processing...", indeterminate=True) - self.simulateAndPostProcess(target_case_format, active_realization_mask, iteration_count) - - self.setPhase(iteration_count + 2, "Simulations completed.") - - - def update(self, target_case_format, iteration, weight): - source_fs = self.ert().getEnkfFsManager().getCurrentFileSystem() - next_iteration = (iteration + 1) - next_target_case_name = target_case_format % next_iteration - target_fs = self.ert().getEnkfFsManager().getFileSystem(next_target_case_name) - - phase_string = "Analyzing iteration: %d with weight %f" % (next_iteration, weight) - self.setPhase(self.currentPhase() + 1, phase_string, indeterminate=True) - - es_update = self.ert().getESUpdate( ) - es_update.setGlobalStdScaling(weight) - success = es_update.smootherUpdate(source_fs, target_fs) - - if not success: - raise UserWarning("Analysis of simulation failed for iteration: %d!" % next_iteration) - - - def simulateAndPostProcess(self, target_case_format, active_realization_mask, iteration): - target_case_name = target_case_format % iteration - - target_fs = self.ert().getEnkfFsManager().getFileSystem(target_case_name) - self.ert().getEnkfFsManager().switchFileSystem(target_fs) - - phase_string = "Running simulation for iteration: %d" % iteration - self.setPhaseName(phase_string, indeterminate=True) - self.ert().getEnkfSimulationRunner().createRunPath(active_realization_mask, iteration) - - phase_string = "Pre processing for iteration: %d" % iteration - self.setPhaseName(phase_string) - self.ert().getEnkfSimulationRunner().runWorkflows( HookRuntime.PRE_SIMULATION ) - - phase_string = "Running forecast for iteration: %d" % iteration - self.setPhaseName(phase_string, indeterminate=False) - num_successful_realizations = self.ert().getEnkfSimulationRunner().runSimpleStep(active_realization_mask, EnkfInitModeEnum.INIT_CONDITIONAL, iteration) - - phase_string = "Post processing for iteration: %d" % iteration - self.setPhaseName(phase_string, indeterminate=True) - self.ert().getEnkfSimulationRunner().runWorkflows(HookRuntime.POST_SIMULATION) - - return num_successful_realizations - - - @staticmethod - def normalizeWeights(weights): - """ :rtype: list of float """ - if not weights: - return [] - weights = [weight for weight in weights if abs(weight) != 0.0] - from math import sqrt - length = sqrt(sum((1.0 / x) * (1.0 / x) for x in weights)) - return [x * length for x in weights] - - - @staticmethod - def parseWeights(weights): - if not weights: - return [] - - elements = weights.split(",") - elements = [element.strip() for element in elements if not element.strip() == ""] - - result = [] - for element in elements: - try: - f = float(element) - if f == 0: - print('Warning: 0 weight, will ignore') - else: - result.append(f) - except ValueError: - raise ValueError('Warning: cannot parse weight %s' % element) - - return result diff --git a/ThirdParty/Ert/python/python/ert_gui/simulation/models/simulations_tracker.py b/ThirdParty/Ert/python/python/ert_gui/simulation/models/simulations_tracker.py deleted file mode 100644 index 0e684bb112..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/simulation/models/simulations_tracker.py +++ /dev/null @@ -1,87 +0,0 @@ -from ert.job_queue import JobStatusType - -class SimulationStateStatus(object): - COLOR_WAITING = (164, 164, 255) - COLOR_PENDING = (164, 200, 255) - COLOR_RUNNING = (200, 255, 200) - COLOR_FAILED = (255, 200, 200) - - COLOR_FINISHED = (200, 200, 200) - COLOR_NOT_ACTIVE = (255, 255, 255) - - def __init__(self, name, state, color): - self.__name = name - self.__state = state - self.__color = color - - self.__count = 0 - self.__total_count = 1 - - @property - def name(self): - return self.__name - - @property - def state(self): - return self.__state - - @property - def color(self): - return self.__color - - @property - def count(self): - return self.__count - - @count.setter - def count(self, value): - self.__count = value - - @property - def total_count(self): - return self.__total_count - - @total_count.setter - def total_count(self, value): - self.__total_count = value - - -class SimulationsTracker(object): - def __init__(self): - super(SimulationsTracker, self).__init__() - - waiting_flag = JobStatusType.JOB_QUEUE_NOT_ACTIVE | JobStatusType.JOB_QUEUE_WAITING | JobStatusType.JOB_QUEUE_SUBMITTED - waiting_state = SimulationStateStatus("Waiting", waiting_flag, SimulationStateStatus.COLOR_WAITING) - - pending_flag = JobStatusType.JOB_QUEUE_PENDING - pending_state = SimulationStateStatus("Pending", pending_flag, SimulationStateStatus.COLOR_PENDING) - - running_flag = JobStatusType.JOB_QUEUE_RUNNING | JobStatusType.JOB_QUEUE_EXIT | JobStatusType.JOB_QUEUE_RUNNING_CALLBACK - running_state = SimulationStateStatus("Running", running_flag, SimulationStateStatus.COLOR_RUNNING) - - # Failed also includes simulations which have been killed by the MAX_RUNTIME system. - failed_flag = JobStatusType.JOB_QUEUE_IS_KILLED | JobStatusType.JOB_QUEUE_DO_KILL - failed_flag |= JobStatusType.JOB_QUEUE_FAILED | JobStatusType.JOB_QUEUE_DO_KILL_NODE_FAILURE - failed_state = SimulationStateStatus("Failed", failed_flag, SimulationStateStatus.COLOR_FAILED) - - done_flag = JobStatusType.JOB_QUEUE_DONE | JobStatusType.JOB_QUEUE_SUCCESS - done_state = SimulationStateStatus("Finished", done_flag, SimulationStateStatus.COLOR_FINISHED) - - self.states = [waiting_state, pending_state, running_state, failed_state, done_state] - self.custom_states = [waiting_state, pending_state, running_state, failed_state, done_state] - - self.__checkForUnusedEnums() - - def getStates(self): - """ @rtype: list[SimulationStateStatus] """ - return list(self.custom_states) - - def __checkForUnusedEnums(self): - for enum in JobStatusType.enums(): - used = False - for state in self.states: - if enum in state.state: - used = True - - if not used: - raise AssertionError("Enum identifier '%s' not used!" % enum) diff --git a/ThirdParty/Ert/python/python/ert_gui/simulation/multiple_data_assimilation_panel.py b/ThirdParty/Ert/python/python/ert_gui/simulation/multiple_data_assimilation_panel.py deleted file mode 100644 index 724160656e..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/simulation/multiple_data_assimilation_panel.py +++ /dev/null @@ -1,110 +0,0 @@ -# Copyright (C) 2016 Statoil ASA, Norway. -# -# This file is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from PyQt4.QtGui import QFormLayout, QLabel - -from ert_gui.ertwidgets import addHelpToWidget, CaseSelector, ActiveLabel, AnalysisModuleSelector -from ert_gui.ertwidgets.models.activerealizationsmodel import ActiveRealizationsModel -from ert_gui.ertwidgets.models.ertmodel import getRealizationCount, getRunPath -from ert_gui.ertwidgets.models.targetcasemodel import TargetCaseModel -from ert_gui.ertwidgets.models.valuemodel import ValueModel -from ert_gui.ertwidgets.stringbox import StringBox -from ert_gui.ide.keywords.definitions import NumberListStringArgument, RangeStringArgument, ProperNameFormatArgument -from ert_gui.simulation import SimulationConfigPanel -from ert_gui.simulation.models import MultipleDataAssimilation - - -class MultipleDataAssimilationPanel(SimulationConfigPanel): - def __init__(self): - SimulationConfigPanel.__init__(self, MultipleDataAssimilation()) - - layout = QFormLayout() - - case_selector = CaseSelector() - layout.addRow("Current case:", case_selector) - - run_path_label = QLabel("%s" % getRunPath()) - addHelpToWidget(run_path_label, "config/simulation/runpath") - layout.addRow("Runpath:", run_path_label) - - number_of_realizations_label = QLabel("%d" % getRealizationCount()) - addHelpToWidget(number_of_realizations_label, "config/ensemble/num_realizations") - layout.addRow(QLabel("Number of realizations:"), number_of_realizations_label) - - self._target_case_format_model = TargetCaseModel(format_mode=True) - self._target_case_format_field = StringBox(self._target_case_format_model, "config/simulation/target_case_format") - self._target_case_format_field.setValidator(ProperNameFormatArgument()) - layout.addRow("Target case format:", self._target_case_format_field) - - self._createInputForWeights(layout) - - self._analysis_module_selector = AnalysisModuleSelector(iterable=False, help_link="config/analysis/analysis_module") - layout.addRow("Analysis Module:", self._analysis_module_selector) - - - self._active_realizations_model = ActiveRealizationsModel() - self._active_realizations_field = StringBox(self._active_realizations_model, "config/simulation/active_realizations") - self._active_realizations_field.setValidator(RangeStringArgument(getRealizationCount())) - layout.addRow("Active realizations", self._active_realizations_field) - - - self._target_case_format_field.getValidationSupport().validationChanged.connect(self.simulationConfigurationChanged) - self._active_realizations_field.getValidationSupport().validationChanged.connect(self.simulationConfigurationChanged) - self._relative_iteration_weights_box.getValidationSupport().validationChanged.connect(self.simulationConfigurationChanged) - - self.setLayout(layout) - - def _createInputForWeights(self, layout): - relative_iteration_weights_model = ValueModel(self.getSimulationModel().getWeights()) - self._relative_iteration_weights_box = StringBox(relative_iteration_weights_model, help_link="config/simulation/iteration_weights", continuous_update=True) - self._relative_iteration_weights_box.setValidator(NumberListStringArgument()) - layout.addRow("Relative Weights:", self._relative_iteration_weights_box) - - relative_iteration_weights_model.valueChanged.connect(self.getSimulationModel().setWeights) - - normalized_weights_model = ValueModel() - normalized_weights_widget = ActiveLabel(normalized_weights_model, help_link="config/simulation/iteration_weights") - layout.addRow('Normalized weights:', normalized_weights_widget) - - def updateVisualizationOfNormalizedWeights(): - if self._relative_iteration_weights_box.isValid(): - weights = MultipleDataAssimilation.parseWeights(relative_iteration_weights_model.getValue()) - normalized_weights = MultipleDataAssimilation.normalizeWeights(weights) - normalized_weights_model.setValue(", ".join("%.2f" % x for x in normalized_weights)) - else: - normalized_weights_model.setValue("The weights are invalid!") - - self._relative_iteration_weights_box.getValidationSupport().validationChanged.connect(updateVisualizationOfNormalizedWeights) - - updateVisualizationOfNormalizedWeights() # To normalize the default weights - - def isConfigurationValid(self): - return self._target_case_format_field.isValid() and self._active_realizations_field.isValid() and self._relative_iteration_weights_box.isValid() - - def toggleAdvancedOptions(self, show_advanced): - self._active_realizations_field.setVisible(show_advanced) - self.layout().labelForField(self._active_realizations_field).setVisible(show_advanced) - - self._analysis_module_selector.setVisible(show_advanced) - self.layout().labelForField(self._analysis_module_selector).setVisible(show_advanced) - - def getSimulationArguments(self): - arguments = {"active_realizations": self._active_realizations_model.getActiveRealizationsMask(), - "target_case": self._target_case_format_model.getValue(), - "analysis_module": self._analysis_module_selector.getSelectedAnalysisModuleName() - } - return arguments - diff --git a/ThirdParty/Ert/python/python/ert_gui/simulation/progress.py b/ThirdParty/Ert/python/python/ert_gui/simulation/progress.py deleted file mode 100644 index a6fb3aed16..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/simulation/progress.py +++ /dev/null @@ -1,123 +0,0 @@ -from math import floor -from PyQt4.QtCore import QTimer -from PyQt4.QtGui import QWidget, QPainter, QColor, QFrame, QLinearGradient - - -class StateTracker(object): - def __init__(self, state_reference, color, progress=0.0): - super(StateTracker, self).__init__() - self.name = state_reference - self.color = color - self.progress = progress - - def setProgress(self, progress): - self.progress = progress - - -class Progress(QFrame): - def __init__(self): - QFrame.__init__(self) - self.setLineWidth(1) - self.setFrameStyle(QFrame.Panel | QFrame.Plain) - - self.__color = QColor(255, 255, 255) - - self.setMinimumHeight(30) - self.__state_order = [] - """@type: list of State""" - - self.__states = {} - """@type: dict of (object, State)""" - - self.__shiny = False - self.__count = 0 - - self.__indeterminate = False - self.__indeterminate_color = QColor(128, 128, 128) - self.__indeterminate_state = 0.5 - self.__indeterminate_step_size = 0.05 - self.__timer = QTimer(self) - self.__timer.setInterval(100) - self.__timer.timeout.connect(self.update) - - def addState(self, state, state_color, progress=0.0): - state_tracker = StateTracker(state, state_color, progress) - self.__state_order.append(state_tracker) - self.__states[state] = state_tracker - - - def updateState(self, state, progress): - self.__count += 1 - self.__states[state].setProgress(progress) - self.update() - - - def setIndeterminate(self, indeterminate): - self.__indeterminate = indeterminate - if indeterminate: - self.__timer.start() - else: - self.__timer.stop() - - def setIndeterminateColor(self, color): - self.__indeterminate_color = color - - - def paintEvent(self, paint_event): - QFrame.paintEvent(self, paint_event) - painter = QPainter(self) - painter.setRenderHint(QPainter.Antialiasing, True) - painter.setRenderHint(QPainter.SmoothPixmapTransform, True) - - rect = self.contentsRect() - """@type: QRect""" - - painter.fillRect(rect, self.__color) - - x = rect.x() - y = rect.y() - width = rect.width() - height = rect.height() - - if not self.__indeterminate: - count = len(self.__state_order) - for index in range(count): - state = self.__state_order[index] - state_width = floor(width * (state.progress / 100.0)) - - if index == count - 1: - state_width = width - x + 1 - - painter.fillRect(x, y, state_width, height, state.color) - - x += state_width - else: - painter.fillRect(rect, self.__indeterminate_color) - - p = self.__indeterminate_state - s = self.__indeterminate_step_size - - gradient = QLinearGradient(0, rect.height() / 2, rect.width(), rect.height() / 2) - gradient.setColorAt(p - s, QColor(255, 255, 255, 0)) - gradient.setColorAt(p, QColor(255, 255, 255, 200)) - gradient.setColorAt(p + s, QColor(255, 255, 255, 0)) - painter.fillRect(rect, gradient) - - self.__indeterminate_state += s - - if self.__indeterminate_state + s >= 1.0 or self.__indeterminate_state + s <= 0.0: - self.__indeterminate_step_size *= -1 - self.__indeterminate_state = round(self.__indeterminate_state) + self.__indeterminate_step_size - - - - if self.__shiny: - #Shiny overlay! - gradient = QLinearGradient(rect.width() / 2, 0, rect.width() / 2, rect.height()) - gradient.setColorAt(0, QColor(255, 255, 255, 0)) - gradient.setColorAt(0.2, QColor(255, 255, 255, 200)) - gradient.setColorAt(0.4, QColor(255, 255, 255, 0)) - gradient.setColorAt(0.85, QColor(255, 255, 255, 0)) - gradient.setColorAt(0.85, QColor(0, 0, 0, 0)) - gradient.setColorAt(1, QColor(0, 0, 0, 127)) - painter.fillRect(rect, gradient) diff --git a/ThirdParty/Ert/python/python/ert_gui/simulation/run_dialog.py b/ThirdParty/Ert/python/python/ert_gui/simulation/run_dialog.py deleted file mode 100644 index e6ef13e211..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/simulation/run_dialog.py +++ /dev/null @@ -1,208 +0,0 @@ -from threading import Thread - -from PyQt4.QtCore import Qt, QTimer, QSize -from PyQt4.QtGui import QDialog, QVBoxLayout, QLayout, QMessageBox, QPushButton, QHBoxLayout, QColor, QLabel - -from ert_gui.ertwidgets import resourceMovie, Legend -from ert_gui.simulation import Progress, SimpleProgress -from ert_gui.simulation.models import BaseRunModel, SimulationsTracker -from ert_gui.tools.plot.plot_tool import PlotTool - - -class RunDialog(QDialog): - - def __init__(self, run_model, run_arguments, parent): - QDialog.__init__(self, parent) - self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint) - self.setWindowFlags(self.windowFlags() & ~Qt.WindowCloseButtonHint) - self.setModal(True) - self.setWindowModality(Qt.WindowModal) - self.setWindowTitle("Simulations") - - assert isinstance(run_model, BaseRunModel) - self._run_model = run_model - self._run_arguments = run_arguments - - layout = QVBoxLayout() - layout.setSizeConstraint(QLayout.SetFixedSize) - - self.simulations_tracker = SimulationsTracker() - states = self.simulations_tracker.getStates() - - self.total_progress = SimpleProgress() - layout.addWidget(self.total_progress) - - - status_layout = QHBoxLayout() - status_layout.addStretch() - self.__status_label = QLabel() - status_layout.addWidget(self.__status_label) - status_layout.addStretch() - layout.addLayout(status_layout) - - self.progress = Progress() - self.progress.setIndeterminateColor(self.total_progress.color) - for state in states: - self.progress.addState(state.state, QColor(*state.color), 100.0 * state.count / state.total_count) - - layout.addWidget(self.progress) - - legend_layout = QHBoxLayout() - self.legends = {} - for state in states: - self.legends[state] = Legend("%s (%d/%d)", QColor(*state.color)) - self.legends[state].updateLegend(state.name, 0, 0) - legend_layout.addWidget(self.legends[state]) - - layout.addLayout(legend_layout) - - self.running_time = QLabel("") - - ert = None - if isinstance(run_model, BaseRunModel): - ert = run_model.ert() - - self.plot_tool = PlotTool() - self.plot_tool.setParent(None) - self.plot_button = QPushButton(self.plot_tool.getName()) - self.plot_button.clicked.connect(self.plot_tool.trigger) - self.plot_button.setEnabled(ert is not None) - - self.kill_button = QPushButton("Kill simulations") - self.done_button = QPushButton("Done") - self.done_button.setHidden(True) - - button_layout = QHBoxLayout() - - size = 20 - spin_movie = resourceMovie("ide/loading.gif") - spin_movie.setSpeed(60) - spin_movie.setScaledSize(QSize(size, size)) - spin_movie.start() - - self.processing_animation = QLabel() - self.processing_animation.setMaximumSize(QSize(size, size)) - self.processing_animation.setMinimumSize(QSize(size, size)) - self.processing_animation.setMovie(spin_movie) - - button_layout.addWidget(self.processing_animation) - button_layout.addWidget(self.running_time) - button_layout.addStretch() - button_layout.addWidget(self.plot_button) - button_layout.addWidget(self.kill_button) - button_layout.addWidget(self.done_button) - - layout.addStretch() - layout.addLayout(button_layout) - - self.setLayout(layout) - - self.kill_button.clicked.connect(self.killJobs) - self.done_button.clicked.connect(self.accept) - - self.__updating = False - self.__update_queued = False - self.__simulation_started = False - - self.__update_timer = QTimer(self) - self.__update_timer.setInterval(500) - self.__update_timer.timeout.connect(self.updateRunStatus) - - - def startSimulation(self): - self._run_model.reset() - - def run(): - self._run_model.startSimulations(self._run_arguments) - - simulation_thread = Thread(name="ert_gui_simulation_thread") - simulation_thread.setDaemon(True) - simulation_thread.run = run - simulation_thread.start() - - self.__update_timer.start() - - - def checkIfRunFinished(self): - if self._run_model.isFinished(): - self.hideKillAndShowDone() - - if self._run_model.hasRunFailed(): - error = self._run_model.getFailMessage() - QMessageBox.critical(self, "Simulations failed!", "The simulation failed with the following error:\n\n%s" % error) - self.reject() - - - def updateRunStatus(self): - self.checkIfRunFinished() - - self.total_progress.setProgress(self._run_model.getProgress()) - - self.__status_label.setText(self._run_model.getPhaseName()) - - states = self.simulations_tracker.getStates() - - if self._run_model.isIndeterminate(): - self.progress.setIndeterminate(True) - - for state in states: - self.legends[state].updateLegend(state.name, 0, 0) - - else: - self.progress.setIndeterminate(False) - total_count = self._run_model.getQueueSize() - queue_status = self._run_model.getQueueStatus() - - for state in states: - state.count = 0 - state.total_count = total_count - - for state in states: - for queue_state in queue_status: - if queue_state in state.state: - state.count += queue_status[queue_state] - - self.progress.updateState(state.state, 100.0 * state.count / state.total_count) - self.legends[state].updateLegend(state.name, state.count, state.total_count) - - self.setRunningTime() - - - def setRunningTime(self): - days = 0 - hours = 0 - minutes = 0 - seconds = self._run_model.getRunningTime() - - if seconds >= 60: - minutes, seconds = divmod(seconds, 60) - - if minutes >= 60: - hours, minutes = divmod(minutes, 60) - - if hours >= 24: - days, hours = divmod(hours, 24) - - if days > 0: - self.running_time.setText("Running time: %d days %d hours %d minutes %d seconds" % (days, hours, minutes, seconds)) - elif hours > 0: - self.running_time.setText("Running time: %d hours %d minutes %d seconds" % (hours, minutes, seconds)) - elif minutes > 0: - self.running_time.setText("Running time: %d minutes %d seconds" % (minutes, seconds)) - else: - self.running_time.setText("Running time: %d seconds" % seconds) - - - def killJobs(self): - kill_job = QMessageBox.question(self, "Kill simulations?", "Are you sure you want to kill the currently running simulations?", QMessageBox.Yes | QMessageBox.No ) - - if kill_job == QMessageBox.Yes: - if self._run_model.killAllSimulations(): - self.reject() - - - def hideKillAndShowDone(self): - self.__update_timer.stop() - self.processing_animation.hide() - self.kill_button.setHidden(True) - self.done_button.setHidden(False) diff --git a/ThirdParty/Ert/python/python/ert_gui/simulation/simple_progress.py b/ThirdParty/Ert/python/python/ert_gui/simulation/simple_progress.py deleted file mode 100644 index c8b2afaa99..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/simulation/simple_progress.py +++ /dev/null @@ -1,55 +0,0 @@ -from math import floor -from PyQt4.QtGui import QPainter, QColor, QFrame, QLinearGradient - - -class SimpleProgress(QFrame): - def __init__(self): - QFrame.__init__(self) - self.setLineWidth(1) - self.setFrameStyle(QFrame.Panel | QFrame.Plain) - - self.background_color = QColor(255, 255, 255) - # self.color = QColor(0, 128, 255) - self.color = QColor(255, 200, 128) - - self.setMinimumHeight(15) - self.setMaximumHeight(15) - - self.__progress = 0 - - self.__shiny = False - - def setProgress(self, progress): - self.__progress = progress - self.update() - - def paintEvent(self, paint_event): - QFrame.paintEvent(self, paint_event) - painter = QPainter(self) - painter.setRenderHint(QPainter.Antialiasing, True) - painter.setRenderHint(QPainter.SmoothPixmapTransform, True) - - rect = self.contentsRect() - """@type: QRect""" - - painter.fillRect(rect, self.background_color) - - x = rect.x() - y = rect.y() - height = rect.height() - width = floor(rect.width() * self.__progress) - - painter.fillRect(x, y, width, height, self.color) - - if self.__shiny: - #Shiny overlay! - gradient = QLinearGradient(rect.width() / 2, 0, rect.width() / 2, rect.height()) - gradient.setColorAt(0, QColor(255, 255, 255, 0)) - gradient.setColorAt(0.2, QColor(255, 255, 255, 200)) - gradient.setColorAt(0.4, QColor(255, 255, 255, 0)) - gradient.setColorAt(0.85, QColor(255, 255, 255, 0)) - gradient.setColorAt(0.85, QColor(0, 0, 0, 0)) - gradient.setColorAt(1, QColor(0, 0, 0, 127)) - painter.fillRect(rect, gradient) - - diff --git a/ThirdParty/Ert/python/python/ert_gui/simulation/simulation_config_panel.py b/ThirdParty/Ert/python/python/ert_gui/simulation/simulation_config_panel.py deleted file mode 100644 index 9a946f336a..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/simulation/simulation_config_panel.py +++ /dev/null @@ -1,30 +0,0 @@ -from PyQt4.QtCore import pyqtSignal -from PyQt4.QtGui import QWidget - - -class SimulationConfigPanel(QWidget): - - simulationConfigurationChanged = pyqtSignal() - - def __init__(self, simulation_model, advanced_option=False): - QWidget.__init__(self) - self.setContentsMargins(10, 10, 10, 10) - self.__simulation_model = simulation_model - self._advanced_option = advanced_option - - @property - def is_advanced_option(self): - return self._advanced_option - - def getSimulationModel(self): - return self.__simulation_model - - def isConfigurationValid(self): - return True - - def toggleAdvancedOptions(self, show_advanced): - raise NotImplementedError("toggleAdvancedOptions must be implemented!") - - def getSimulationArguments(self): - """" @rtype: dict[str, object]""" - return {} diff --git a/ThirdParty/Ert/python/python/ert_gui/simulation/simulation_panel.py b/ThirdParty/Ert/python/python/ert_gui/simulation/simulation_panel.py deleted file mode 100644 index 070cf11b2a..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/simulation/simulation_panel.py +++ /dev/null @@ -1,135 +0,0 @@ -from PyQt4.QtCore import Qt, QSize -from PyQt4.QtGui import QWidget, QVBoxLayout, QHBoxLayout, QLabel, QStackedWidget, QFrame, QToolButton, QMessageBox, QComboBox - -from ert_gui import ERT -from ert_gui.ertwidgets import addHelpToWidget, resourceIcon -from ert_gui.ertwidgets.models.ertmodel import getCurrentCaseName -from ert_gui.simulation import EnsembleExperimentPanel, EnsembleSmootherPanel -from ert_gui.simulation import IteratedEnsembleSmootherPanel, MultipleDataAssimilationPanel, SimulationConfigPanel -from ert_gui.simulation import RunDialog -from collections import OrderedDict - -class SimulationPanel(QWidget): - - def __init__(self): - QWidget.__init__(self) - - layout = QVBoxLayout() - - self._simulation_mode_combo = QComboBox() - addHelpToWidget(self._simulation_mode_combo, "run/simulation_mode") - - self._simulation_mode_combo.currentIndexChanged.connect(self.toggleSimulationMode) - - simulation_mode_layout = QHBoxLayout() - simulation_mode_layout.addSpacing(10) - simulation_mode_layout.addWidget(QLabel("Simulation mode:"), 0, Qt.AlignVCenter) - simulation_mode_layout.addWidget(self._simulation_mode_combo, 0, Qt.AlignVCenter) - - simulation_mode_layout.addSpacing(20) - - self.run_button = QToolButton() - self.run_button.setIconSize(QSize(32, 32)) - self.run_button.setText("Start Simulation") - self.run_button.setIcon(resourceIcon("ide/gear_in_play")) - self.run_button.clicked.connect(self.runSimulation) - self.run_button.setToolButtonStyle(Qt.ToolButtonTextBesideIcon) - addHelpToWidget(self.run_button, "run/start_simulation") - - simulation_mode_layout.addWidget(self.run_button) - simulation_mode_layout.addStretch(1) - - layout.addSpacing(5) - layout.addLayout(simulation_mode_layout) - layout.addSpacing(10) - - self._simulation_stack = QStackedWidget() - self._simulation_stack.setLineWidth(1) - self._simulation_stack.setFrameStyle(QFrame.StyledPanel) - - layout.addWidget(self._simulation_stack) - - self._simulation_widgets = OrderedDict() - """ :type: OrderedDict[BaseRunModel,SimulationConfigPanel]""" - - self.addSimulationConfigPanel(EnsembleExperimentPanel()) - self.addSimulationConfigPanel(EnsembleSmootherPanel()) - self.addSimulationConfigPanel(IteratedEnsembleSmootherPanel(advanced_option=True)) - self.addSimulationConfigPanel(MultipleDataAssimilationPanel()) - - self.setLayout(layout) - - - def addSimulationConfigPanel(self, panel): - assert isinstance(panel, SimulationConfigPanel) - - panel.toggleAdvancedOptions(False) - self._simulation_stack.addWidget(panel) - - simulation_model = panel.getSimulationModel() - - self._simulation_widgets[simulation_model] = panel - - if not panel.is_advanced_option: - self._simulation_mode_combo.addItem(str(simulation_model), simulation_model) - - panel.simulationConfigurationChanged.connect(self.validationStatusChanged) - - - def getActions(self): - return [] - - def toggleAdvancedOptions(self, show_advanced): - current_model = self.getCurrentSimulationModel() - - self._simulation_mode_combo.clear() - - for model, panel in self._simulation_widgets.iteritems(): - if show_advanced or not panel.is_advanced_option: - self._simulation_mode_combo.addItem(str(model), model) - - old_index = self._simulation_mode_combo.findText(str(current_model)) - self._simulation_mode_combo.setCurrentIndex(old_index if old_index > -1 else 0) - - def toggleAdvancedMode(self, show_advanced): - for panel in self._simulation_widgets.values(): - panel.toggleAdvancedOptions(show_advanced) - - self.toggleAdvancedOptions(show_advanced) - - def getCurrentSimulationModel(self): - data = self._simulation_mode_combo.itemData(self._simulation_mode_combo.currentIndex(), Qt.UserRole) - return data.toPyObject() - - def getSimulationArguments(self): - """ @rtype: dict[str,object]""" - simulation_widget = self._simulation_widgets[self.getCurrentSimulationModel()] - return simulation_widget.getSimulationArguments() - - - def runSimulation(self): - case_name = getCurrentCaseName() - message = "Are you sure you want to use case '%s' for initialization of the initial ensemble when running the simulations?" % case_name - start_simulations = QMessageBox.question(self, "Start simulations?", message, QMessageBox.Yes | QMessageBox.No ) - - if start_simulations == QMessageBox.Yes: - run_model = self.getCurrentSimulationModel() - arguments = self.getSimulationArguments() - dialog = RunDialog(run_model, arguments, self) - dialog.startSimulation() - dialog.exec_() - - ERT.emitErtChange() # simulations may have added new cases. - - - def toggleSimulationMode(self): - current_model = self.getCurrentSimulationModel() - if current_model is not None: - widget = self._simulation_widgets[self.getCurrentSimulationModel()] - self._simulation_stack.setCurrentWidget(widget) - self.validationStatusChanged() - - - def validationStatusChanged(self): - widget = self._simulation_widgets[self.getCurrentSimulationModel()] - self.run_button.setEnabled(widget.isConfigurationValid()) diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/tools/CMakeLists.txt deleted file mode 100644 index 7e3ebd3e78..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - help_center.py - tool.py -) - -add_python_package("python.ert_gui.tools" ${PYTHON_INSTALL_PREFIX}/ert_gui/tools "${PYTHON_SOURCES}" True) - -add_subdirectory(export) -add_subdirectory(help) -add_subdirectory(ide) -add_subdirectory(load_results) -add_subdirectory(manage_cases) -add_subdirectory(plot) -add_subdirectory(plugins) -add_subdirectory(run_analysis) -add_subdirectory(workflows) diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/__init__.py b/ThirdParty/Ert/python/python/ert_gui/tools/__init__.py deleted file mode 100644 index 17af514901..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .help_center import HelpCenter -from .tool import Tool \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/export/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/tools/export/CMakeLists.txt deleted file mode 100644 index 3ff565a6d8..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/export/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - export_panel.py - export_tool.py - exporter.py - export_keyword_model.py - export_model.py -) - -add_python_package("python.ert_gui.tools.export" ${PYTHON_INSTALL_PREFIX}/ert_gui/tools/export "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/export/__init__.py b/ThirdParty/Ert/python/python/ert_gui/tools/export/__init__.py deleted file mode 100644 index 4a34ca171a..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/export/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from .export_model import ExportModel -from .export_keyword_model import ExportKeywordModel -from .export_panel import ExportPanel -from .exporter import Exporter -from .export_tool import ExportTool diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/export/export_keyword_model.py b/ThirdParty/Ert/python/python/ert_gui/tools/export/export_keyword_model.py deleted file mode 100644 index 66ca48f76b..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/export/export_keyword_model.py +++ /dev/null @@ -1,113 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'export_keyword_model.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from ert.enkf import EnkfVarType, ErtImplType -from ert_gui import ERT - - -class ExportKeywordModel(object): - def __init__(self): - super(ExportKeywordModel, self).__init__() - self.__gen_kw = None - self.__field_kw = None - self.__gen_data = None - self.__gen_param = None - - def getKeylistFromImplType(self, ert_impl_type): - return sorted(ERT.ert.ensembleConfig().getKeylistFromImplType(ert_impl_type)) - - def isDynamicPlot(self, key): - vtype = self.getVarType(key) - return vtype in [EnkfVarType.DYNAMIC_STATE, EnkfVarType.DYNAMIC_RESULT] - - def isDynamicField(self, key): - return self.getVarType(key) == EnkfVarType.DYNAMIC_STATE - - def getVarType(self, key): - config_node = ERT.ert.ensembleConfig().getNode(key) - variable_type = config_node.getVariableType() - return variable_type - - def getImplementationType(self, key): - config_node = ERT.ert.ensembleConfig().getNode(key) - return config_node.getImplementationType() - - def getGenKwKeyWords(self): - if self.__gen_kw is None: - self.__gen_kw = [key for key in ERT.ert.ensembleConfig().getKeylistFromImplType(ErtImplType.GEN_KW)] - - return self.__gen_kw - - def getGenDataKeyWords(self): - if self.__gen_data is None: - gen_data_list = [] - gen_param_list = [] - for key in ERT.ert.ensembleConfig().getKeylistFromImplType(ErtImplType.GEN_DATA): - if self.getVarType(key) == EnkfVarType.PARAMETER: - gen_param_list.append(key) - continue - if ERT.ert.ensembleConfig().getNode(key).getDataModelConfig().getOutputFormat() is not None: - gen_data_list.append(key) - elif ERT.ert.ensembleConfig().getNode(key).getDataModelConfig().getInputFormat() is not None: - gen_data_list.append(key) - self.__gen_data = gen_data_list - self.__gen_param = gen_param_list - return self.__gen_data + self.__gen_param - - def getFieldKeyWords(self): - if self.__field_kw is None: - self.__field_kw = self.getKeylistFromImplType(ErtImplType.FIELD) - - return self.__field_kw - - def getKeyWords(self): - return sorted(self.getFieldKeyWords() + self.getGenKwKeyWords() + self.getGenDataKeyWords()) - - def hasKeywords(self): - return self.getKeyWords().count > 0 - - def isGenKw(self, key): - if self.__gen_kw is None: - self.getGenKwKeyWords() - - return key in self.__gen_kw - - def isFieldKw(self, key): - if self.__field_kw is None: - self.getFieldKeyWords() - - return key in self.__field_kw - - def isGenDataKw(self, key): - if self.__gen_data is None: - self.getGenDataKeyWords() - - return key in self.__gen_data - - def isGenParamKw(self, key): - if self.__gen_param is None: - self.getGenDataKeyWords() - - return key in self.__gen_param - - def getGenDataReportSteps(self, key): - gen_data_list = [] - obs_keys = ERT.ert.ensembleConfig().getNode(key).getObservationKeys() - for obs_key in obs_keys: - obs_vector = ERT.ert.getObservations()[obs_key] - for report_step in obs_vector.getStepList(): - gen_data_list.append(str(report_step)) - - return gen_data_list diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/export/export_model.py b/ThirdParty/Ert/python/python/ert_gui/tools/export/export_model.py deleted file mode 100644 index 59f466d82a..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/export/export_model.py +++ /dev/null @@ -1,107 +0,0 @@ -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'export_model.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from __future__ import print_function -import os.path -from ert.enkf import EnkfConfigNode, EnkfNode, EnkfFieldFileFormatEnum, ErtImplType -from ert.enkf import GenKw, GenDataFileType, GenData, NodeId -from ert_gui import ERT - - -class ExportModel(object): - def __init__(self): - super(ExportModel, self).__init__() - - def exportField(self, keyword, path, iactive, file_type, report_step, selected_case): - """ - @type keyword: str - @type path: str - @type iactive: BoolVector - @type file_type: EnkfFieldFileFormatEnum - @type report_step: int - @type selected_case: str - """ - - fs = ERT.ert.getEnkfFsManager().getFileSystem(selected_case) - if file_type == EnkfFieldFileFormatEnum.ECL_GRDECL_FILE: - extension = ".grdecl" - elif file_type == EnkfFieldFileFormatEnum.RMS_ROFF_FILE: - extension = ".roff" - - iens_list = iactive.createActiveList() - path_fmt = os.path.join(path, keyword + "_%d" + extension) - config_node = ERT.ert.ensembleConfig()[keyword] - mc = ERT.ert.getModelConfig() - init_file = config_node.getInitFile(mc.getRunpathFormat()) - if init_file: - print('Using init file:%s' % init_file) - EnkfNode.exportMany(config_node, path_fmt, fs, iens_list, file_type=file_type, arg=init_file) - return True - - def exportGenKw(self, keyword, path, iactive, file_type, report_step, selected_case): - """ - @type keyword: str - @type path: str - @type iactive: BoolVector - @type file_type: EnkfFieldFileFormatEnum - @type report_step: int - @type selected_case: str - """ - enkf_config_node = ERT.ert.ensembleConfig().getNode(keyword) - assert isinstance(enkf_config_node, EnkfConfigNode) - node = EnkfNode(enkf_config_node) - fs = ERT.ert.getEnkfFsManager().getFileSystem(selected_case) - - for index, value in enumerate(iactive): - if value: - if node.tryLoad(fs, NodeId(report_step, index)): - gen_kw = GenKw.createCReference(node.valuePointer()) - filename = str(path + "/" + keyword + "_{0}").format(index) - if file_type == "Parameter list": - filename += ".txt" - gen_kw.exportParameters(filename) - else: - filename += ".inc" - gen_kw.exportTemplate(filename) - - def exportGenData(self, keyword, path, iactive, file_type, report_step, selected_case): - """ - @type keyword: str - @type path: str - @type iactive: BoolVector - @type file_type: EnkfFieldFileFormatEnum - @type report_step: int - @type selected_case: str - """ - fs = ERT.ert.getEnkfFsManager().getFileSystem(selected_case) - config_node = ERT.ert.ensembleConfig().getNode(keyword) - gen_data_config_node = config_node.getDataModelConfig() - - export_type = gen_data_config_node.getOutputFormat() - if export_type == GenDataFileType.GEN_DATA_UNDEFINED: - export_type = gen_data_config_node.getInputFormat() - - node = EnkfNode(config_node) - - for index, active in enumerate(iactive): - if active: - node_id = NodeId(int(report_step), index) - - if node.tryLoad(fs, node_id): - gen_data = node.asGenData() - - filename = str(path + "/" + keyword + "_{0}").format(index) + ".txt" - gen_data.export(filename, export_type, None) diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/export/export_panel.py b/ThirdParty/Ert/python/python/ert_gui/tools/export/export_panel.py deleted file mode 100644 index 81c600f3e7..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/export/export_panel.py +++ /dev/null @@ -1,186 +0,0 @@ -# Copyright (C) 2014 Statoil ASA, Norway. -# -# The file 'export_panel.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from PyQt4.QtCore import QDir, pyqtSignal -from PyQt4.QtGui import QFormLayout, QWidget, QLineEdit, QToolButton, QHBoxLayout, QFileDialog, QComboBox - -from ert_gui.ertwidgets.models.activerealizationsmodel import ActiveRealizationsModel -from ert_gui.ertwidgets.models.all_cases_model import AllCasesModel -from ert_gui.ertwidgets.models.ertmodel import getCurrentCaseName -from ert_gui.ertwidgets.stringbox import StringBox -from ert_gui.ide.keywords.definitions import RangeStringArgument -from ert_gui.tools.export import ExportKeywordModel - - -class ExportPanel(QWidget): - updateExportButton = pyqtSignal(str, bool) - runExport = pyqtSignal(dict) - - def __init__(self, parent=None): - QWidget.__init__(self, parent) - self.setMinimumWidth(500) - self.setMinimumHeight(200) - self._dynamic = False - - self.setWindowTitle("Export data") - self.activateWindow() - - layout = QFormLayout() - current_case = getCurrentCaseName() - - self._case_model = AllCasesModel() - self._case_combo = QComboBox() - self._case_combo.setSizeAdjustPolicy(QComboBox.AdjustToMinimumContentsLength) - self._case_combo.setMinimumContentsLength(20) - self._case_combo.setModel(self._case_model) - self._case_combo.setCurrentIndex(self._case_model.indexOf(current_case)) - layout.addRow("Select case:", self._case_combo) - - self._export_keyword_model = ExportKeywordModel() - - self._kw_model = self._export_keyword_model.getKeyWords() - self._keywords = QComboBox() - self._keywords.addItems(self._kw_model) - layout.addRow("Select keyword:", self._keywords) - - self._active_realizations_model = ActiveRealizationsModel() - self._active_realizations_field = StringBox(self._active_realizations_model, "config/simulation/active_realizations") - self._active_realizations_field.setValidator(RangeStringArgument()) - self._active_realizations_field.getValidationSupport().validationChanged.connect(self.validateExportDialog) - layout.addRow("Active realizations:", self._active_realizations_field) - - file_name_button = QToolButton() - file_name_button.setText("Browse") - file_name_button.clicked.connect(self.selectFileDirectory) - - self._defaultPath = QDir.currentPath() + "/export" - self._file_name = QLineEdit() - self._file_name.setEnabled(False) - self._file_name.setText(self._defaultPath) - self._file_name.textChanged.connect(self.validateExportDialog) - self._file_name.setMinimumWidth(250) - - file_name_layout = QHBoxLayout() - file_name_layout.addWidget(self._file_name) - file_name_layout.addWidget(file_name_button) - layout.addRow("Select directory to save files to:", file_name_layout) - - self._gen_kw_file_types = ["Parameter list", "Template based"] - self._field_kw_file_types = ["Eclipse GRDECL", "RMS roff"] - self._gen_data_file_types = ["Gen data"] - - self._file_type_model = self._field_kw_file_types - self._file_type_combo = QComboBox() - self._file_type_combo.setSizeAdjustPolicy(QComboBox.AdjustToContents) - self._file_type_combo.addItems(self._file_type_model) - layout.addRow("Select file format:", self._file_type_combo) - - self._report_step = QLineEdit() - layout.addRow("Report step:", self._report_step) - - self._gen_data_report_step_model = [] - self._gen_data_report_step = QComboBox() - layout.addRow("Report step:", self._gen_data_report_step) - - self.setLayout(layout) - self._keywords.currentIndexChanged.connect(self.keywordSelected) - self.keywordSelected() - - def selectFileDirectory(self): - directory = QFileDialog().getExistingDirectory(self, "Directory", self._file_name.text(), QFileDialog.ShowDirsOnly) - if str(directory).__len__() > 0: - self._file_name.setText(str(directory)) - - def updateFileExportType(self, keyword): - self._file_type_combo.clear() - if self._export_keyword_model.isGenKw(keyword): - self._file_type_model = self._gen_kw_file_types - elif self._export_keyword_model.isGenParamKw(keyword): - self._file_type_model = self._gen_data_file_types - elif self._export_keyword_model.isGenDataKw(keyword): - self._file_type_model = self._gen_data_file_types - else: - self._file_type_model = self._field_kw_file_types - - self._file_type_combo.addItems(self._file_type_model) - - def export(self): - keyword = self._kw_model[self._keywords.currentIndex()] - report_step = self.getReportStep(keyword) - all_cases = self._case_model.getAllItems() - selected_case = all_cases[self._case_combo.currentIndex()] - path = self._file_name.text() - iactive = self._active_realizations_model.getActiveRealizationsMask() - file_type_key = self._file_type_model[self._file_type_combo.currentIndex()] - values = {"keyword": keyword, - "report_step": report_step, - "iactive": iactive, - "file_type_key": file_type_key, - "path": path, - "selected_case": selected_case} - self.runExport.emit(values) - - def getReportStep(self, key): - report_step = 0 - if self._dynamic: - report_step = self._report_step.text() - - if self._export_keyword_model.isGenParamKw(key): - return report_step - - if self._export_keyword_model.isGenDataKw(key): - lst = self._gen_data_report_step_model - idx = self._gen_data_report_step.currentIndex() - if lst and len(lst) > idx: - report_step = lst[idx] - else: - raise IndexError('No such model step: %d. Valid range: [0, %d)' % (idx, len(lst))) - - return report_step - - def keywordSelected(self): - key = self._kw_model[self._keywords.currentIndex()] - self.updateFileExportType(key) - self._dynamic = False - if self._export_keyword_model.isFieldKw(key): - self._dynamic = self._export_keyword_model.isDynamicField(key) - - self._report_step.setVisible(self._dynamic) - self.layout().labelForField(self._report_step).setVisible(self._dynamic) - - self._gen_data_report_step.setVisible(self._export_keyword_model.isGenDataKw(key)) - self.layout().labelForField(self._gen_data_report_step).setVisible(self._export_keyword_model.isGenDataKw(key)) - - if self._export_keyword_model.isGenDataKw(key): - data = self._export_keyword_model.getGenDataReportSteps(key) - self._gen_data_report_step_model = data - self._gen_data_report_step.clear() - self._gen_data_report_step.addItems(self._gen_data_report_step_model) - - def setSelectedCase(self, selected_case): - self._case_combo.setCurrentIndex(self._case_model.indexOf(selected_case)) - - def validateExportDialog(self): - validRealizations = False - if self._active_realizations_field.isValid(): - validRealizations = True - - path = str(self._file_name.text()) - validPath = len(path) > 0 - - if validRealizations and validPath: - self.updateExportButton.emit("export", True) - else: - self.updateExportButton.emit("export", False) diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/export/export_tool.py b/ThirdParty/Ert/python/python/ert_gui/tools/export/export_tool.py deleted file mode 100644 index ffecb55406..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/export/export_tool.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (C) 2014 Statoil ASA, Norway. -# -# The file 'export_tool.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from weakref import ref - -from ert_gui.ertwidgets import resourceIcon -from ert_gui.ertwidgets.closabledialog import ClosableDialog -from ert_gui.ertwidgets.models.ertmodel import getCurrentCaseName -from ert_gui.tools import Tool -from ert_gui.tools.export import ExportPanel, Exporter, ExportKeywordModel - - -class ExportTool(Tool): - def __init__(self): - super(ExportTool, self).__init__("Export Data", "tools/export", resourceIcon("ide/table_export")) - self.__export_widget = None - self.__dialog = None - self.__exporter = None - self.setEnabled(ExportKeywordModel().hasKeywords()) - - def trigger(self): - if self.__export_widget is None: - self.__export_widget = ref(ExportPanel(self.parent())) - self.__exporter = Exporter() - self.__export_widget().runExport.connect(self.__exporter.runExport) - - self.__export_widget().setSelectedCase(getCurrentCaseName()) - self.__dialog = ref(ClosableDialog("Export", self.__export_widget(), self.parent())) - self.__export_widget().updateExportButton.connect(self.__dialog().toggleButton) - self.__dialog().addButton("Export", self.export) - self.__dialog().show() - - def export(self): - self.__export_widget().export() - self.__dialog().accept() diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/export/exporter.py b/ThirdParty/Ert/python/python/ert_gui/tools/export/exporter.py deleted file mode 100644 index 9a1225f3e2..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/export/exporter.py +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright (C) 2014 Statoil ASA, Norway. -# -# The file 'export_tool.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -import os -import sys -from PyQt4.QtCore import QDir -from PyQt4.QtGui import QMessageBox -from ert.enkf import EnkfFieldFileFormatEnum -from ert_gui.tools.export import ExportModel, ExportKeywordModel - - -class Exporter(): - def __init__(self): - self.__export_keyword_model = ExportKeywordModel() - - def runExport(self, values): - keyword = values["keyword"] - file_name = self.createExportFileNameMask(keyword, values["selected_case"], values["report_step"], values["path"]) - - if self.__export_keyword_model.isFieldKw(keyword): - self.exportField(keyword, file_name, values["iactive"], values["file_type_key"], values["report_step"], values["selected_case"]) - elif self.__export_keyword_model.isGenKw(keyword): - self.exportGenKw(keyword, file_name, values["iactive"], values["file_type_key"], values["report_step"], values["selected_case"]) - elif self.__export_keyword_model.isGenParamKw(keyword) or self.__export_keyword_model.isGenDataKw(keyword): - self.exportGenData(keyword, file_name, values["iactive"], values["file_type_key"], values["report_step"], values["selected_case"]) - else: - sys.stderr.write('** WARNING: Cannot export unknown keyword type "%s".\n' % keyword) - - def exportField(self, keyword, file_name, iactive, file_type_key, report_step, selected_case): - if file_type_key == "Eclipse GRDECL": - file_type = EnkfFieldFileFormatEnum.ECL_GRDECL_FILE - else: - file_type = EnkfFieldFileFormatEnum.RMS_ROFF_FILE - - result = ExportModel().exportField(keyword, file_name, iactive, file_type, report_step, selected_case) - if not result: - QMessageBox.warning(self, "Warning", '''Something did not work!''', QMessageBox.Ok) - - def exportGenData(self, keyword, file_name, iactive, file_type_key, report_step, selected_case): - ExportModel().exportGenData(keyword, file_name, iactive, file_type_key, report_step, selected_case) - - def exportGenKw(self, keyword, file_name, iactive, file_type_key, report_step, selected_case): - ExportModel().exportGenKw(keyword, file_name, iactive, file_type_key, report_step, selected_case) - - def createExportFileNameMask(self, keyword, current_case, report_step, path): - impl_type = None - - if self.__export_keyword_model.isFieldKw(keyword): - impl_type = self.__export_keyword_model.getImplementationType(keyword) - elif self.__export_keyword_model.isGenDataKw(keyword): - impl_type = "Gen_Data" - elif self.__export_keyword_model.isGenKw(keyword): - impl_type = "Gen_Kw" - elif self.__export_keyword_model.isGenParamKw(keyword): - impl_type = "Gen_Param" - - path = os.path.join(str(path), str(current_case), str(impl_type), str(keyword)) - - if self.__export_keyword_model.isGenDataKw(keyword): - path = path + "_" + str(report_step) - - if not QDir(path).exists(): - os.makedirs(path) - - return path diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/help/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/tools/help/CMakeLists.txt deleted file mode 100644 index d8698f25ce..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/help/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - help_tool.py - help_window.py -) - -add_python_package("python.ert_gui.tools.help" ${PYTHON_INSTALL_PREFIX}/ert_gui/tools/help "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/help/__init__.py b/ThirdParty/Ert/python/python/ert_gui/tools/help/__init__.py deleted file mode 100644 index bf58faee13..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/help/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .help_window import HelpWindow -from .help_tool import HelpTool diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/help/help_tool.py b/ThirdParty/Ert/python/python/ert_gui/tools/help/help_tool.py deleted file mode 100644 index 165cd42704..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/help/help_tool.py +++ /dev/null @@ -1,26 +0,0 @@ -from ert_gui.ertwidgets import resourceIcon -from ert_gui.tools import Tool -from ert_gui.tools.help import HelpWindow - - -class HelpTool(Tool): - __help_window_instance = None - - def __init__(self, help_center_name, parent): - super(HelpTool, self).__init__("Help", "tools/help", resourceIcon("ide/help"), enabled=True, checkable=True) - self.setParent(parent) - - self.help_center_name = help_center_name - - if HelpTool.__help_window_instance is None: - HelpTool.__help_window_instance = HelpWindow(self.help_center_name, parent=self.parent()) - self.__help_window_instance.visibilityChanged.connect(self.getAction().setChecked) - - - def trigger(self): - checked = self.getAction().isChecked() - if checked: - HelpTool.__help_window_instance.show() - else: - HelpTool.__help_window_instance.hide() - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/help/help_window.py b/ThirdParty/Ert/python/python/ert_gui/tools/help/help_window.py deleted file mode 100644 index 3d4b27cdcf..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/help/help_window.py +++ /dev/null @@ -1,86 +0,0 @@ -from PyQt4.QtCore import Qt, QUrl, pyqtSignal, QSettings -from PyQt4.QtGui import QLabel, QVBoxLayout, QColor, QDesktopServices, QDialog, QMainWindow, QWidget - -from ert_gui.tools import HelpCenter - - -class HelpWindow(QMainWindow): - help_prefix = None - default_help_string = "No help available!" - validation_template = ("" - "" - "" - "" - "
Notice:
%s
" - "") - - visibilityChanged = pyqtSignal(bool) - - def __init__(self, help_center_name, parent=None): - QMainWindow.__init__(self, parent, Qt.WindowStaysOnTopHint) - palette = self.palette() - palette.setColor(self.backgroundRole(), QColor(255, 255, 224)) - self.setPalette(palette) - self.setAutoFillBackground(True) - self.setMinimumWidth(300) - self.setMinimumHeight(250) - self.setWindowTitle("Help") - self.setObjectName("ert-gui-help") - - central_widget = QWidget() - - layout = QVBoxLayout() - central_widget.setLayout(layout) - - self.link_widget = QLabel() - self.link_widget.setStyleSheet("font-weight: bold") - self.link_widget.setMinimumHeight(20) - - self.help_widget = QLabel(HelpWindow.default_help_string) - self.help_widget.setWordWrap(True) - self.help_widget.setTextFormat(Qt.RichText) - self.help_widget.linkActivated.connect(self.openHelpURL) - - layout.addWidget(self.link_widget) - layout.addWidget(self.help_widget) - layout.addStretch(1) - - HelpCenter.getHelpCenter(help_center_name).addListener(self) - - self.__position = None - self.__geometry = None - self.setCentralWidget(central_widget) - - # settings = QSettings("Statoil", "Ert-Gui") - # self.restoreGeometry(settings.value("ert-gui-help/geometry").toByteArray()) - - - def openHelpURL(self, q_string): - url = QUrl(q_string) - QDesktopServices.openUrl(url) - - - def setHelpMessage(self, help_link, message): - self.link_widget.setText(help_link) - self.help_widget.setText(message) - - def showEvent(self, q_show_event): - if self.__geometry is not None and self.__position is not None: - self.setGeometry(self.__geometry) - self.move(self.__position) - self.visibilityChanged.emit(True) - - def hideEvent(self, q_hide_event): - self.__position = self.pos() - self.__geometry = self.geometry() - self.visibilityChanged.emit(False) - - - def keyPressEvent(self, event): - if event.key() != Qt.Key_Escape: - QMainWindow.keyPressEvent(self, event) - - def closeEvent(self, event): - self.hide() - event.ignore() - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/help_center.py b/ThirdParty/Ert/python/python/ert_gui/tools/help_center.py deleted file mode 100644 index 0be497a559..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/help_center.py +++ /dev/null @@ -1,107 +0,0 @@ -import os - - -class HelpCenter(object): - __default_help_string = "No help available!" - __help_centers = {} - - def __init__(self, name): - if name in HelpCenter.__help_centers: - raise UserWarning("HelpCenter '%s' already exists!") - - super(HelpCenter, self).__init__() - self.__name = name - self.__listeners = [] - self.__help_prefix = "" - self.__current_help_link = "" - self.__help_messages = {} - - HelpCenter.__help_centers[name] = self - - - def setHelpMessageLink(self, help_link): - self.__current_help_link = help_link - - help_message = self.resolveHelpLink(help_link) - - if help_message is not None: - self.__help_messages[help_link] = help_message - else: - self.__help_messages[help_link] = self.__default_help_string - - # if not help_link in self.__help_messages: - # help_message = self.resolveHelpLink(help_link) - # if help_message is not None: - # self.__help_messages[help_link] = help_message - # else: - # self.__help_messages[help_link] = self.__default_help_string - - for listener in self.__listeners: - listener.setHelpMessage(help_link, self.__help_messages[help_link]) - - def addListener(self, listener): - self.__listeners.append(listener) - help_link = self.__current_help_link - listener.setHelpMessage(help_link, self.__help_messages[help_link]) - - - # The setHelpLinkPrefix should be set to point to a directory - # containing (directories) with html help files. In the current - # implementation this variable is set from the gert_main.py script. - def setHelpLinkPrefix(self, prefix): - self.__help_prefix = prefix - - def getTemplate(self): - path = self.__help_prefix + "template.html" - if os.path.exists(path) and os.path.isfile(path): - f = open(path, 'r') - template = f.read() - f.close() - return template - else: - return "%s" - - def resolveHelpLink(self, help_link): - """ - Reads a HTML file from the help directory. - The HTML must follow the specification allowed by QT here: http://doc.trolltech.com/4.6/richtext-html-subset.html - """ - - # This code can be used to find widgets with empty help labels - # if label.strip() == "": - # raise AssertionError("NOOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!!!") - - path = self.__help_prefix + help_link + ".html" - if os.path.exists(path) and os.path.isfile(path): - f = open(path, 'r') - help = f.read() - f.close() - return self.getTemplate() % help - else: - # This code automatically creates empty help files - # sys.stderr.write("Missing help file: '%s'\n" % label) - # if not label == "" and not label.find("/") == -1: - # sys.stderr.write("Creating help file: '%s'\n" % label) - # directory, filename = os.path.split(path) - # - # if not os.path.exists(directory): - # os.makedirs(directory) - # - # file_object = open(path, "w") - # file_object.write(label) - # file_object.close() - return None - - - @classmethod - def getHelpCenter(cls, name): - """ @rtype: HelpCenter """ - return HelpCenter.__help_centers.get(name) - - - @staticmethod - def addHelpToAction(action, link, help_center_name="ERT"): - def showHelp(): - HelpCenter.getHelpCenter(help_center_name).setHelpMessageLink(link) - - action.hovered.connect(showHelp) \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/ide/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/tools/ide/CMakeLists.txt deleted file mode 100644 index 83e6cfc49b..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/ide/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - configuration_panel.py - ide_panel.py - ide_tool.py - ide_window.py -) - -add_python_package("python.ert_gui.tools.ide" ${PYTHON_INSTALL_PREFIX}/ert_gui/tools/ide "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/ide/__init__.py b/ThirdParty/Ert/python/python/ert_gui/tools/ide/__init__.py deleted file mode 100644 index b76ae2cfc5..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/ide/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from .ide_panel import IdePanel -from .configuration_panel import ConfigurationPanel -from .ide_window import IdeWindow -from .ide_tool import IdeTool diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/ide/configuration_panel.py b/ThirdParty/Ert/python/python/ert_gui/tools/ide/configuration_panel.py deleted file mode 100644 index 64c87e844b..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/ide/configuration_panel.py +++ /dev/null @@ -1,124 +0,0 @@ -import re -import shutil - -from PyQt4.QtCore import pyqtSignal -from PyQt4.QtGui import QWidget, QVBoxLayout, QToolBar, QMessageBox, QSizePolicy, QFileDialog - -from ert_gui.ertwidgets import SearchBox, resourceIcon -from ert_gui.ide.highlighter import KeywordHighlighter -from ert_gui.ide.keywords.definitions.path_argument import PathArgument -from ert_gui.tools.ide import IdePanel - - -class ConfigurationPanel(QWidget): - - reloadApplication = pyqtSignal(str) - - def __init__(self, config_file_path, help_tool): - QWidget.__init__(self) - - layout = QVBoxLayout() - - toolbar = QToolBar("toolbar") - - - save_action = toolbar.addAction(resourceIcon("ide/disk"), "Save") - save_action.triggered.connect(self.save) - - save_as_action = toolbar.addAction(resourceIcon("ide/save_as"), "Save As") - save_as_action.triggered.connect(self.saveAs) - - # reload_icon = toolbar.style().standardIcon(QStyle.SP_BrowserReload) - # reload_action = toolbar.addAction(reload_icon, "Reload") - # reload_action.triggered.connect(self.reload) - - toolbar.addSeparator() - - toolbar.addAction(help_tool.getAction()) - - - stretchy_separator = QWidget() - stretchy_separator.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) - toolbar.addWidget(stretchy_separator) - - - search = SearchBox() - search.setMaximumWidth(200) - search.setContentsMargins(5, 2, 5, 2) - - toolbar.addWidget(search) - - layout.addWidget(toolbar) - - self.ide_panel = IdePanel() - layout.addWidget(self.ide_panel, 1) - - self.config_file_path = config_file_path - - with open(config_file_path) as f: - config_file_text = f.read() - - self.highlighter = KeywordHighlighter(self.ide_panel.document()) - - search.filterChanged.connect(self.highlighter.setSearchString) - - self.parseDefines(config_file_text) - self.ide_panel.document().setPlainText(config_file_text) - - cursor = self.ide_panel.textCursor() - cursor.setPosition(0) - self.ide_panel.setTextCursor(cursor) - self.ide_panel.setFocus() - - - self.setLayout(layout) - - - - def getName(self): - return "Configuration" - - - def save(self): - backup_path = "%s.backup" % self.config_file_path - shutil.copyfile(self.config_file_path, backup_path) - - with open(self.config_file_path, "w") as f: - f.write(self.ide_panel.getText()) - - message = "To make your changes current, a reload of the configuration file is required. Would you like to reload now?" - result = QMessageBox.information(self, "Reload required!", message, QMessageBox.Yes | QMessageBox.No) - - if result == QMessageBox.Yes: - self.reload(self.config_file_path) - - - def saveAs(self): - config_file = QFileDialog.getSaveFileName(self, "Save Configuration File As") - - config_file = str(config_file) - - if len(config_file) > 0: - with open(config_file, "w") as f: - f.write(self.ide_panel.getText()) - - message = "The current configuration file has been saved to a new file. Do you want to restart Ert using the new configuration file?" - result = QMessageBox.information(self, "Restart Ert?", message, QMessageBox.Yes | QMessageBox.No) - - if result == QMessageBox.Yes: - self.reload(config_file) - - - def reload(self, path): - self.reloadApplication.emit(path) - - def start(self): - print("Start!") - - def parseDefines(self, text): - pattern = re.compile("[ \t]*DEFINE[ \t]*(\S+)[ \t]*(\S+)") - - match = re.findall(pattern, text) - - for m in match: - PathArgument.addDefine(m[0], m[1]) diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/ide/ide_panel.py b/ThirdParty/Ert/python/python/ert_gui/tools/ide/ide_panel.py deleted file mode 100644 index 280dde1774..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/ide/ide_panel.py +++ /dev/null @@ -1,211 +0,0 @@ -import re -from PyQt4.QtCore import Qt, QEvent, QDir, QRegExp, QChar -from PyQt4.QtGui import QPlainTextEdit, QTextOption, QCompleter, QStringListModel, QFont, QColor, QShortcut, QKeySequence, QTextCursor, QFileSystemModel, QTextDocument -from ert_gui.tools import HelpCenter - - -class IdePanel(QPlainTextEdit): - def __init__(self): - QPlainTextEdit.__init__(self) - self.setWordWrapMode(QTextOption.NoWrap) - self.setFont(QFont("monospace", 10)) - self.setCursorWidth(2) - self.installEventFilter(self) - - self.cursorPositionChanged.connect(self.showHelp) - - self.completer = QCompleter(self) - self.completer.setWidget(self) - self.completer.setCaseSensitivity(Qt.CaseInsensitive) - self.completer.activated.connect(self.insertCompletion) - - - auto_complete = QShortcut(QKeySequence("Ctrl+Space"), self) - auto_complete.activated.connect(self.activateCompleter) - - copy_line = QShortcut(QKeySequence("Ctrl+D"), self) - copy_line.activated.connect(self.duplicateLine) - - select_fragment = QShortcut(QKeySequence("Ctrl+J"), self) - select_fragment.activated.connect(self.selectFragment) - - def showHelp(self): - text_cursor = self.textCursor() - user_data = text_cursor.block().userData() - - if user_data is not None: - configuration_line = user_data.configuration_line - - if configuration_line.keyword().hasKeywordDefinition(): - HelpCenter.getHelpCenter("ERT").setHelpMessageLink("config/" + configuration_line.documentationLink()) - - - def getText(self): - return self.document().toPlainText() - - - def eventFilter(self, qobject, qevent): - if qobject == self and qevent.type() == QEvent.ToolTip: - text_cursor = self.cursorForPosition(qevent.pos()) - pos = text_cursor.positionInBlock() - - user_data = text_cursor.block().userData() - if user_data is not None: - #: :type: ConfigurationLine - configuration_line = user_data.configuration_line - # if configuration_line.keyword().hasKeywordDefinition(): - # print(configuration_line.keyword().keywordDefinition().documentation) - - if pos in configuration_line.keyword(): - self.setToolTip(configuration_line.validationStatusForToken(configuration_line.keyword()).message()) - else: - for argument in configuration_line.arguments(): - if pos in argument: - self.setToolTip(configuration_line.validationStatusForToken(argument).message()) - - else: - self.setToolTip("") - - - return QPlainTextEdit.eventFilter(self, qobject, qevent) - - - def activateCompleter(self): - text_cursor = self.textCursor() - block = self.document().findBlock(text_cursor.position()) - position_in_block = text_cursor.positionInBlock() - - - - self.selectWordUnderCursor(text_cursor) - word = unicode(text_cursor.selectedText()) - - user_data = block.userData() - - self.completer.setCompletionPrefix(word) - - show_completer = False - if user_data is None: - self.completer.setModel(QStringListModel(self.handler_names)) - show_completer = True - - else: - keyword = user_data.keyword - options = keyword.handler.parameterOptions(keyword, word, position_in_block) - - if len(options) == 1: - self.insertCompletion(options[0]) - elif len(options) > 1: - self.completer.setModel(QStringListModel(options)) - if self.completer.completionCount() == 1: - self.insertCompletion(self.completer.currentCompletion()) - else: - show_completer = True - - - if show_completer: - rect = self.cursorRect(text_cursor) - rect.setWidth(self.completer.popup().sizeHintForColumn(0) + self.completer.popup().verticalScrollBar().sizeHint().width()) - self.completer.complete(rect) - - def keyPressEvent(self, qkeyevent): - if self.completer.popup().isVisible(): - dead_keys = [Qt.Key_Enter, Qt.Key_Return, Qt.Key_Escape, Qt.Key_Tab, Qt.Key_Backtab] - if qkeyevent.key() in dead_keys: - qkeyevent.ignore() - return - - if qkeyevent.modifiers() == Qt.ShiftModifier: - if qkeyevent.key() & Qt.Key_Delete == Qt.Key_Delete: - self.deleteLine() - - QPlainTextEdit.keyPressEvent(self, qkeyevent) - - - def insertCompletion(self, string): - text_cursor = self.textCursor() - self.selectWordUnderCursor(text_cursor) - text_cursor.insertText(string) - - def isCursorInSpace(self): - text_cursor = self.textCursor() - if text_cursor.positionInBlock() > 0: - text_cursor.movePosition(QTextCursor.Left, QTextCursor.MoveAnchor) - text_cursor.movePosition(QTextCursor.Right, QTextCursor.KeepAnchor) - - if text_cursor.positionInBlock() < text_cursor.block().length() - 1: - text_cursor.movePosition(QTextCursor.Right, QTextCursor.KeepAnchor) - - if unicode(text_cursor.selectedText()).strip() == "": - return True - - return False - - def selectWordUnderCursor(self, text_cursor): - if not self.isCursorInSpace(): - # text_cursor.select(QTextCursor.WordUnderCursor) - - # pattern = "[\s|\v|\f|\n|\r|\t|\xe2\x80\xa8|\xe2\x80\xa9]" - # pattern = "[\\s|\\xe2\\x80\\xa9|\\xe2\\x80\\xa8]" - - block_start = 0 - block_end = text_cursor.block().length() - - cursor_pos = text_cursor.positionInBlock() - pos = cursor_pos - pattern = u"[\s\u2029\u2028]" - while pos >= block_start: - text_cursor.movePosition(QTextCursor.Left, QTextCursor.KeepAnchor) - text = text_cursor.selectedText() - if re.search(pattern, text): - break - pos -= 1 - - text_cursor.movePosition(QTextCursor.Right, QTextCursor.MoveAnchor) - - while pos < block_end: - text_cursor.movePosition(QTextCursor.Right, QTextCursor.KeepAnchor) - text = text_cursor.selectedText() - if re.search(pattern, text): - break - pos += 1 - - text_cursor.movePosition(QTextCursor.Left, QTextCursor.KeepAnchor) - - # pattern = "[\\s]" - # start = self.document().find(QRegExp(pattern), text_cursor, QTextDocument.FindBackward | QTextDocument.FindCaseSensitively) - # end = self.document().find(QRegExp(pattern), text_cursor, QTextDocument.FindCaseSensitively) - # block_end_pos = text_cursor.block().position() + text_cursor.block().length() - # - # text_cursor.setPosition(start.position(), QTextCursor.MoveAnchor) - # # text_cursor.setPosition(min(block_end_pos, end.position() - 1), QTextCursor.KeepAnchor) - # text_cursor.setPosition(end.position() - 1, QTextCursor.KeepAnchor) - - - def deleteLine(self): - text_cursor = self.textCursor() - text_cursor.beginEditBlock() - text_cursor.select(QTextCursor.LineUnderCursor) - text_cursor.removeSelectedText() - text_cursor.deletePreviousChar() - - text_cursor.movePosition(QTextCursor.NextBlock) - text_cursor.movePosition(QTextCursor.StartOfLine) - self.setTextCursor(text_cursor) - text_cursor.endEditBlock() - - def duplicateLine(self): - text_cursor = self.textCursor() - text_cursor.beginEditBlock() - text_cursor.select(QTextCursor.LineUnderCursor) - text = text_cursor.selectedText() - text_cursor.movePosition(QTextCursor.EndOfLine) - text_cursor.insertBlock() - text_cursor.insertText(text) - text_cursor.endEditBlock() - - - def selectFragment(self): - text_cursor = self.textCursor() - self.selectWordUnderCursor(text_cursor) - self.setTextCursor(text_cursor) diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/ide/ide_tool.py b/ThirdParty/Ert/python/python/ert_gui/tools/ide/ide_tool.py deleted file mode 100644 index 9c9ca5b4c7..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/ide/ide_tool.py +++ /dev/null @@ -1,24 +0,0 @@ -from weakref import ref - -from ert_gui import ERT -from ert_gui.ertwidgets import resourceIcon -from ert_gui.tools import Tool -from ert_gui.tools.ide import IdeWindow - - -class IdeTool(Tool): - def __init__(self, path, help_tool): - super(IdeTool, self).__init__("Configure", "tools/ide", resourceIcon("ide/widgets")) - - self.ide_window = None - self.path = path - self.help_tool = help_tool - - def trigger(self): - if self.ide_window is None: - self.ide_window = ref(IdeWindow(self.path, self.parent(), self.help_tool)) - self.ide_window().reloadTriggered.connect(ERT.reloadERT) - - self.ide_window().show() - self.ide_window().raise_() - self.ide_window().activateWindow() \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/ide/ide_window.py b/ThirdParty/Ert/python/python/ert_gui/tools/ide/ide_window.py deleted file mode 100644 index b123c7171b..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/ide/ide_window.py +++ /dev/null @@ -1,59 +0,0 @@ -from PyQt4.QtCore import pyqtSignal -from PyQt4.QtGui import QMainWindow - -from ert_gui.tools.ide.configuration_panel import ConfigurationPanel - - -class IdeWindow(QMainWindow): - reloadTriggered = pyqtSignal(str) - - def __init__(self, path, parent, help_tool): - QMainWindow.__init__(self, parent) - - self.resize(900, 900) - - self.__position = None - self.__geometry = None - - self.__configuration_panel = ConfigurationPanel(path, help_tool) - self.__configuration_panel.reloadApplication.connect(self.reloadTriggered) - self.setCentralWidget(self.__configuration_panel) - self.setWindowTitle("Configuration") - self.activateWindow() - - - # wizard_panel = WizardView() - # wizard_panel.addGroup("Parameters") - # wizard_panel.addItemToGroup("Parameters", "Add Summary key") - # wizard_panel.addItemToGroup("Parameters", "Add Field parameter") - # wizard_panel.addItemToGroup("Parameters", "Add Data Keyword") - # wizard_panel.addGroup("Eclipse") - # wizard_panel.addItemToGroup("Eclipse", "Setup Eclipse parameters") - # wizard_panel.addGroup("Observations") - # wizard_panel.addItemToGroup("Observations", "Add Observations") - # wizard_panel.expandAll() - # self.addDock("Wizards", wizard_panel) - - - def closeEvent(self, q_close_event): - self.__position = self.pos() - self.__geometry = self.geometry() - self.hide() - q_close_event.ignore() - - def show(self): - if self.__geometry is not None and self.__position is not None: - self.setGeometry(self.__geometry) - self.move(self.__position) - QMainWindow.show(self) - - # def addDock(self, name, widget, area=Qt.RightDockWidgetArea, allowed_areas=Qt.AllDockWidgetAreas): - # dock_widget = QDockWidget(name) - # dock_widget.setObjectName("%sDock" % name) - # dock_widget.setWidget(widget) - # dock_widget.setAllowedAreas(allowed_areas) - # - # self.addDockWidget(area, dock_widget) - # - # self.__view_menu.addAction(dock_widget.toggleViewAction()) - # return dock_widget diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/load_results/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/tools/load_results/CMakeLists.txt deleted file mode 100644 index ea92b4461c..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/load_results/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - load_results_panel.py - load_results_tool.py - load_results_model.py - -) - -add_python_package("python.ert_gui.tools.load_results" ${PYTHON_INSTALL_PREFIX}/ert_gui/tools/load_results "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/load_results/__init__.py b/ThirdParty/Ert/python/python/ert_gui/tools/load_results/__init__.py deleted file mode 100644 index 783c414edc..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/load_results/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .load_results_model import LoadResultsModel -from .load_results_panel import LoadResultsPanel -from .load_results_tool import LoadResultsTool diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/load_results/load_results_model.py b/ThirdParty/Ert/python/python/ert_gui/tools/load_results/load_results_model.py deleted file mode 100644 index f60bc6d991..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/load_results/load_results_model.py +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright (C) 2014 Statoil ASA, Norway. -# -# The file 'load_results_model.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -import os - -from ert_gui import ERT - - -class LoadResultsModel(object): - - @staticmethod - def loadResults(selected_case, realisations, iteration): - """ - @type selected_case: str - @type realisations: BoolVector - @type iteration: int - @rtype int: number of loaded realisations - """ - fs = ERT.ert.getEnkfFsManager().getFileSystem(selected_case) - return ERT.ert.loadFromForwardModel(realisations, iteration, fs) - - @staticmethod - def isValidRunPath(): - """ @rtype: bool """ - run_path = ERT.ert.getModelConfig().getRunpathAsString() - try: - result = run_path % (0, 0) - return True - except TypeError: - pass - - try: - result = run_path % 0 - return True - except TypeError: - pass - - return False - - @staticmethod - def getCurrentRunPath(): - """ @rtype: str """ - return ERT.ert.getModelConfig().getRunpathAsString() - - - @staticmethod - def getIterationCount(): - """ @rtype: int """ - run_path = ERT.ert.getModelConfig().getRunpathAsString() - try: - results = run_path % (0, 0) - except TypeError: - return 0 - - iteration = 0 - valid_directory = True - while valid_directory: - formatted = run_path % (0, iteration) - valid_directory = os.path.exists(formatted) - if valid_directory: - iteration += 1 - - return iteration - - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/load_results/load_results_panel.py b/ThirdParty/Ert/python/python/ert_gui/tools/load_results/load_results_panel.py deleted file mode 100644 index 3b7bff6013..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/load_results/load_results_panel.py +++ /dev/null @@ -1,101 +0,0 @@ -# Copyright (C) 2014 Statoil ASA, Norway. -# -# The file 'load_results_panel.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from PyQt4.QtGui import QWidget, QFormLayout, QComboBox, QTextEdit - -from ert_gui.ertwidgets.models.activerealizationsmodel import ActiveRealizationsModel -from ert_gui.ertwidgets.models.all_cases_model import AllCasesModel -from ert_gui.ertwidgets.models.ertmodel import getCurrentCaseName -from ert_gui.ertwidgets.models.valuemodel import ValueModel -from ert_gui.ertwidgets.stringbox import StringBox -from ert_gui.ide.keywords.definitions import RangeStringArgument, IntegerArgument -from ert_gui.tools.load_results import LoadResultsModel - - -class LoadResultsPanel(QWidget): - - def __init__(self): - QWidget.__init__(self) - - self.setMinimumWidth(500) - self.setMinimumHeight(200) - self._dynamic = False - - self.setWindowTitle("Load results manually") - self.activateWindow() - - layout = QFormLayout() - current_case = getCurrentCaseName() - - run_path_text = QTextEdit() - run_path_text.setText(self.readCurrentRunPath()) - run_path_text.setDisabled(True) - run_path_text.setFixedHeight(80) - - layout.addRow("Load data from current run path: ",run_path_text) - - self._case_model = AllCasesModel() - self._case_combo = QComboBox() - self._case_combo.setSizeAdjustPolicy(QComboBox.AdjustToMinimumContentsLength) - self._case_combo.setMinimumContentsLength(20) - self._case_combo.setModel(self._case_model) - self._case_combo.setCurrentIndex(self._case_model.indexOf(current_case)) - layout.addRow("Load into case:", self._case_combo) - - - self._active_realizations_model = ActiveRealizationsModel() - self._active_realizations_field = StringBox(self._active_realizations_model, "load_results_manually/Realizations") - self._active_realizations_field.setValidator(RangeStringArgument()) - layout.addRow("Realizations to load:", self._active_realizations_field) - - iterations_count = LoadResultsModel.getIterationCount() - - self._iterations_model = ValueModel(iterations_count) - self._iterations_field = StringBox(self._iterations_model, "load_results_manually/iterations") - self._iterations_field.setValidator(IntegerArgument()) - layout.addRow("Iteration to load:", self._iterations_field) - - self.setLayout(layout) - - def readCurrentRunPath(self): - current_case = getCurrentCaseName() - run_path = LoadResultsModel.getCurrentRunPath() - run_path = run_path.replace("",current_case) - run_path = run_path.replace("",current_case) - return run_path - - - def load(self): - all_cases = self._case_model.getAllItems() - selected_case = all_cases[self._case_combo.currentIndex()] - realizations = self._active_realizations_model.getActiveRealizationsMask() - iteration = self._iterations_model.getValue() - try: - if iteration is None: - iteration = '' - iteration = int(iteration) - except ValueError as e: - print('Expected a (whole) number in iteration field, got "%s". Error message: %s.' % (iteration, e)) - return False - loaded = LoadResultsModel.loadResults(selected_case, realizations, iteration) - if loaded > 0: - print('Successfully loaded %d realisations.' % loaded) - else: - print('No realisations loaded.') - return loaded - - def setCurrectCase(self): - current_case = getCurrentCaseName() - self._case_combo.setCurrentIndex(self._case_model.indexOf(current_case)) \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/load_results/load_results_tool.py b/ThirdParty/Ert/python/python/ert_gui/tools/load_results/load_results_tool.py deleted file mode 100644 index 88825bb0dc..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/load_results/load_results_tool.py +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (C) 2014 Statoil ASA, Norway. -# -# The file 'load_results_tool.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from ert_gui.ertwidgets import resourceIcon -from ert_gui.ertwidgets.closabledialog import ClosableDialog -from ert_gui.tools import Tool -from ert_gui.tools.load_results import LoadResultsModel -from ert_gui.tools.load_results import LoadResultsPanel - - -class LoadResultsTool(Tool): - def __init__(self): - super(LoadResultsTool, self).__init__("Load results manually", "tools/load_manually", resourceIcon("ide/table_import")) - self.__import_widget = None - self.__dialog = None - self.setVisible(False) - - - - - def trigger(self): - if self.__import_widget is None: - self.__import_widget = LoadResultsPanel() - self.__dialog = ClosableDialog("Load results manually", self.__import_widget, self.parent()) - self.__import_widget.setCurrectCase() - self.__dialog.addButton("Load", self.load) - self.__dialog.exec_() - - def load(self): - self.__import_widget.load() - self.__dialog.accept() - - def toggleAdvancedMode(self, advanced_mode): - self.setVisible(advanced_mode) - if not LoadResultsModel.isValidRunPath(): - self.setEnabled(False) - - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/manage_cases/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/tools/manage_cases/CMakeLists.txt deleted file mode 100644 index 3f599f743f..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/manage_cases/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - case_init_configuration.py - manage_cases_tool.py -) - -add_python_package("python.ert_gui.tools.manage_cases" ${PYTHON_INSTALL_PREFIX}/ert_gui/tools/manage_cases "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/manage_cases/__init__.py b/ThirdParty/Ert/python/python/ert_gui/tools/manage_cases/__init__.py deleted file mode 100644 index 29c33e538e..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/manage_cases/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .manage_cases_tool import ManageCasesTool diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/manage_cases/case_init_configuration.py b/ThirdParty/Ert/python/python/ert_gui/tools/manage_cases/case_init_configuration.py deleted file mode 100644 index c2173dc3fd..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/manage_cases/case_init_configuration.py +++ /dev/null @@ -1,206 +0,0 @@ -from PyQt4.QtGui import QToolButton, QTextEdit, QTabWidget, QWidget, QVBoxLayout, QHBoxLayout, QLabel, QPushButton, QSpinBox -from PyQt4.QtCore import Qt - -from ert_gui import ERT -from ert_gui.ertwidgets import addHelpToWidget, showWaitCursorWhileWaiting -from ert_gui.ertwidgets.caselist import CaseList -from ert_gui.ertwidgets.caseselector import CaseSelector -from ert_gui.ertwidgets.checklist import CheckList -from ert_gui.ertwidgets.models.ertmodel import getRealizationCount, initializeCurrentCaseFromScratch, getCaseRealizationStates, getParameterList, getHistoryLength, \ - initializeCurrentCaseFromExisting, getCurrentCaseName -from ert_gui.ertwidgets.models.selectable_list_model import SelectableListModel - - -def createCheckLists(): - parameter_model = SelectableListModel([]) - - parameter_model.getList = getParameterList - parameter_check_list = CheckList(parameter_model, "Parameters", "init/select_parameters") - parameter_check_list.setMaximumWidth(300) - - members_model = SelectableListModel([]) - - def getMemberList(): - return [str(member) for member in range(getRealizationCount())] - - members_model.getList = getMemberList - member_check_list = CheckList(members_model, "Members", "init/select_members") - member_check_list.setMaximumWidth(150) - return createRow(parameter_check_list, member_check_list), parameter_model, members_model - - -def createRow(*widgets): - row = QHBoxLayout() - - for widget in widgets: - row.addWidget(widget) - - row.addStretch() - return row - - -class CaseInitializationConfigurationPanel(QTabWidget): - @showWaitCursorWhileWaiting - def __init__(self): - QTabWidget.__init__(self) - self.setWindowTitle("Case Management") - self.setMinimumWidth(600) - - self.addCreateNewCaseTab() - self.addInitializeFromScratchTab() - self.addInitializeFromExistingTab() - self.addShowCaseInfo() - - def addCreateNewCaseTab(self): - panel = QWidget() - layout = QVBoxLayout() - case_list = CaseList() - case_list.setMaximumWidth(250) - - layout.addWidget(case_list) - layout.addStretch() - - panel.setLayout(layout) - - self.addTab(panel, "Create new case") - - def addInitializeFromScratchTab(self): - panel = QWidget() - layout = QVBoxLayout() - - row1 = createRow(QLabel("Target case:"), CaseSelector()) - layout.addLayout(row1) - - check_list_layout, parameter_model, members_model = createCheckLists() - layout.addLayout(check_list_layout) - - layout.addSpacing(10) - - initialize_button = QPushButton("Initialize") - addHelpToWidget(initialize_button, "init/initialize_from_scratch") - initialize_button.setMinimumWidth(75) - initialize_button.setMaximumWidth(150) - - def initializeFromScratch(): - parameters = parameter_model.getSelectedItems() - members = members_model.getSelectedItems() - initializeCurrentCaseFromScratch(parameters, members) - - initialize_button.clicked.connect(initializeFromScratch) - layout.addWidget(initialize_button, 0, Qt.AlignCenter) - - layout.addSpacing(10) - - panel.setLayout(layout) - self.addTab(panel, "Initialize from scratch") - - def addInitializeFromExistingTab(self): - widget = QWidget() - layout = QVBoxLayout() - - target_case = CaseSelector() - row = createRow(QLabel("Target case:"), target_case) - layout.addLayout(row) - - source_case = CaseSelector(update_ert=False, show_only_initialized=True, ignore_current=True) - row = createRow(QLabel("Source case:"), source_case) - layout.addLayout(row) - - row, history_length_spinner = self.createTimeStepRow() - layout.addLayout(row) - - layout.addSpacing(10) - check_list_layout, parameter_model, members_model = createCheckLists() - layout.addLayout(check_list_layout) - layout.addSpacing(10) - - initialize_button = QPushButton("Initialize") - addHelpToWidget(initialize_button, "init/initialize_from_existing") - initialize_button.setMinimumWidth(75) - initialize_button.setMaximumWidth(150) - - def initializeFromExisting(): - source_case_name = str(source_case.currentText()) - target_case_name = str(target_case.currentText()) - report_step = history_length_spinner.value() - parameters = parameter_model.getSelectedItems() - members = members_model.getSelectedItems() - initializeCurrentCaseFromExisting(source_case_name, target_case_name, report_step, parameters, members) - - initialize_button.clicked.connect(initializeFromExisting) - layout.addWidget(initialize_button, 0, Qt.AlignCenter) - - - layout.addSpacing(10) - - layout.addStretch() - widget.setLayout(layout) - self.addTab(widget, "Initialize from existing") - - def createTimeStepRow(self): - history_length_spinner = QSpinBox() - addHelpToWidget(history_length_spinner, "config/init/history_length") - history_length_spinner.setMinimum(0) - history_length_spinner.setMaximum(getHistoryLength()) - - initial = QToolButton() - initial.setText("Initial") - addHelpToWidget(initial, "config/init/history_length") - - def setToMin(): - history_length_spinner.setValue(0) - - initial.clicked.connect(setToMin) - - end_of_time = QToolButton() - end_of_time.setText("End of time") - addHelpToWidget(end_of_time, "config/init/history_length") - - def setToMax(): - history_length_spinner.setValue(getHistoryLength()) - - end_of_time.clicked.connect(setToMax) - - row = createRow(QLabel("Timestep:"), history_length_spinner, initial, end_of_time) - - return row, history_length_spinner - - def addShowCaseInfo(self): - case_widget = QWidget() - layout = QVBoxLayout() - - case_selector = CaseSelector(update_ert=False, help_link="init/selected_case_info") - row1 = createRow(QLabel("Select case:"), case_selector) - - layout.addLayout(row1) - - self._case_info_area = QTextEdit() - self._case_info_area.setReadOnly(True) - self._case_info_area.setMinimumHeight(300) - - row2 = createRow(QLabel("Case info:"), self._case_info_area) - - layout.addLayout(row2) - - case_widget.setLayout(layout) - - case_selector.currentIndexChanged[str].connect(self._showInfoForCase) - ERT.ertChanged.connect(self._showInfoForCase) - - self.addTab(case_widget, "Case Info") - - self._showInfoForCase() - - def _showInfoForCase(self, case_name=None): - if case_name is None: - case_name = getCurrentCaseName() - - states = getCaseRealizationStates(str(case_name)) - - html = "" - for index in range(len(states)): - html += "" % (index, str(states[index])) - - html += "
%d.%s
" - - self._case_info_area.setHtml(html) diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/manage_cases/manage_cases_tool.py b/ThirdParty/Ert/python/python/ert_gui/tools/manage_cases/manage_cases_tool.py deleted file mode 100644 index d593a138a4..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/manage_cases/manage_cases_tool.py +++ /dev/null @@ -1,20 +0,0 @@ -from ert_gui.ertwidgets import resourceIcon -from ert_gui.ertwidgets.closabledialog import ClosableDialog -from ert_gui.tools import Tool -from ert_gui.tools.manage_cases.case_init_configuration import CaseInitializationConfigurationPanel - - -class ManageCasesTool(Tool): - def __init__(self): - super(ManageCasesTool, self).__init__("Manage Cases", "tools/manage_cases", resourceIcon("ide/database_gear")) - - - def trigger(self): - case_management_widget = CaseInitializationConfigurationPanel() - - dialog = ClosableDialog("Manage Cases", case_management_widget, self.parent()) - dialog.exec_() - - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/tools/plot/CMakeLists.txt deleted file mode 100644 index d42c0775fd..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - color_chooser.py - data_type_keys_list_model.py - data_type_keys_widget.py - data_type_proxy_model.py - filter_popup.py - plot_case_model.py - plot_case_selection_widget.py - plot_tool.py - plot_widget.py - plot_window.py - style_chooser.py - filterable_kw_list_model.py -) - -add_python_package("python.ert_gui.tools.plot" ${PYTHON_INSTALL_PREFIX}/ert_gui/tools/plot "${PYTHON_SOURCES}" True) - -add_subdirectory(customize) -add_subdirectory(widgets) diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/__init__.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/__init__.py deleted file mode 100644 index 533609e104..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -from .plot_widget import PlotWidget - -from .filter_popup import FilterPopup - -from .filterable_kw_list_model import FilterableKwListModel -from .data_type_keys_list_model import DataTypeKeysListModel -from .data_type_proxy_model import DataTypeProxyModel -from .data_type_keys_widget import DataTypeKeysWidget - -from .plot_case_model import PlotCaseModel -from .plot_case_selection_widget import CaseSelectionWidget - -from .color_chooser import ColorBox -from .style_chooser import StyleChooser - -from .plot_window import PlotWindow -from .plot_tool import PlotTool - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/color_chooser.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/color_chooser.py deleted file mode 100644 index 834389736f..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/color_chooser.py +++ /dev/null @@ -1,54 +0,0 @@ -from PyQt4.QtCore import QSize, QRect, pyqtSignal -from PyQt4.QtGui import QWidget, QPainter, QHBoxLayout, QLabel, QFrame, QColor, QColorDialog - - -class ColorBox(QFrame): - colorChanged = pyqtSignal(QColor) - - """A widget that shows a colored box""" - def __init__(self, color, size=15): - QFrame.__init__(self) - self.setFrameStyle(QFrame.Panel | QFrame.Sunken) - self.setMaximumSize(QSize(size, size)) - self.setMinimumSize(QSize(size, size)) - - self._tile_colors = [QColor(255, 255, 255), QColor(200, 200, 255)] - self._color = color - - def paintEvent(self, paint_event): - """Paints the box""" - painter = QPainter(self) - rect = self.contentsRect() - tile_count = 3 - tile_size = rect.width() / tile_count - painter.save() - painter.translate(rect.x(), rect.y()) - - for y in range(tile_count): - for x in range(tile_count): - color_index = (y * tile_count + x) % 2 - tile_rect = QRect(x * tile_size, y * tile_size, tile_size, tile_size) - painter.fillRect(tile_rect, self._tile_colors[color_index]) - - painter.restore() - painter.fillRect(rect, self._color) - - QFrame.paintEvent(self, paint_event) - - def mouseReleaseEvent(self, QMouseEvent): - color = QColorDialog.getColor(self._color, self, "Select color", QColorDialog.ShowAlphaChannel) - - if color.isValid(): - self._color = color - self.update() - self.colorChanged.emit(self._color) - - @property - def color(self): - """ @rtype: QColor """ - return self._color - - @color.setter - def color(self, color): - self._color = QColor(color) - self.update() diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/CMakeLists.txt deleted file mode 100644 index 291759bac9..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - customization_view.py - customize_plot_dialog.py - default_customization_view.py - limits_customization_view.py - statistics_customization_view.py - style_customization_view.py -) - -add_python_package("python.ert_gui.tools.plot.customize" ${PYTHON_INSTALL_PREFIX}/ert_gui/tools/plot/customize "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/__init__.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/__init__.py deleted file mode 100644 index 99e83000c2..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -from ert_gui.tools.plot.customize.customization_view import CustomizationView, WidgetProperty -from ert_gui.tools.plot.customize.default_customization_view import DefaultCustomizationView -from ert_gui.tools.plot.customize.style_customization_view import StyleCustomizationView -from ert_gui.tools.plot.customize.limits_customization_view import LimitsCustomizationView -from ert_gui.tools.plot.customize.statistics_customization_view import StatisticsCustomizationView -from ert_gui.tools.plot.customize.customize_plot_dialog import PlotCustomizer diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/customization_view.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/customization_view.py deleted file mode 100644 index 53eb78f1b5..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/customization_view.py +++ /dev/null @@ -1,144 +0,0 @@ -from PyQt4.QtGui import QWidget, QFormLayout, QSpacerItem, QCheckBox, QHBoxLayout, QSpinBox - -from ert_gui.plottery import PlotConfig -from ert_gui.tools.plot import StyleChooser -from ert_gui.tools.plot.widgets.clearable_line_edit import ClearableLineEdit - -from ert_gui.tools.plot import style_chooser as sc - -class CustomizationView(QWidget): - def __init__(self): - QWidget.__init__(self) - - self._layout = QFormLayout() - self.setLayout(self._layout) - self._widgets = {} - - - def addRow(self, title, widget): - self._layout.addRow(title, widget) - - def addLineEdit(self, attribute_name, title, tool_tip=None, placeholder=""): - self[attribute_name] = ClearableLineEdit(placeholder=placeholder) - self.addRow(title, self[attribute_name]) - - if tool_tip is not None: - self[attribute_name].setToolTip(tool_tip) - - def getter(self): - value = str(self[attribute_name].text()) - if value == "": - value = None - return value - - def setter(self, value): - if value is None: - value = "" - self[attribute_name].setText(str(value)) - - self.updateProperty(attribute_name, getter, setter) - - def addCheckBox(self, attribute_name, title, tool_tip=None): - self[attribute_name] = QCheckBox() - self.addRow(title, self[attribute_name]) - - if tool_tip is not None: - self[attribute_name].setToolTip(tool_tip) - - def getter(self): - return self[attribute_name].isChecked() - - def setter(self, value): - self[attribute_name].setChecked(value) - - self.updateProperty(attribute_name, getter, setter) - - def addSpinBox(self, attribute_name, title, tool_tip=None, min_value=1, max_value=10, single_step=1): - sb = QSpinBox() - self[attribute_name] = sb - sb.setMaximumHeight(25) - sb_layout = QHBoxLayout() - sb_layout.addWidget(sb) - sb_layout.addStretch() - self.addRow(title, sb_layout) - - if tool_tip is not None: - sb.setToolTip(tool_tip) - - sb.setMinimum(min_value) - sb.setMaximum(max_value) - sb.setSingleStep(single_step) - - def getter(self): - return self[attribute_name].value() - - def setter(self, value): - self[attribute_name].setValue(value) - - self.updateProperty(attribute_name, getter, setter) - return sb - - def addStyleChooser(self, attribute_name, title, tool_tip=None, line_style_set=sc.STYLESET_DEFAULT): - style_chooser = StyleChooser(line_style_set=line_style_set) - self[attribute_name] = style_chooser - self.addRow(title, self[attribute_name]) - - if tool_tip is not None: - self[attribute_name].setToolTip(tool_tip) - - def getter(self): - return self[attribute_name].getStyle() - - def setter(self, style): - self[attribute_name].setStyle(style) - - self.updateProperty(attribute_name, getter, setter) - - def updateProperty(self, attribute_name, getter, setter): - setattr(self.__class__, attribute_name, property(getter, setter)) - - def setWidgetEnabled(self, attribute_name, enabled): - widget = self[attribute_name] - widget.setEnabled(enabled) - widget.setHidden(enabled) - label = self._layout.labelForField(widget) - label.setEnabled(enabled) - label.setHidden(enabled) - - def addSpacing(self, pixels=10): - self._layout.addItem(QSpacerItem(1, pixels)) - - def addHeading(self, title): - self.addSpacing(10) - self._layout.addRow(title, None) - self.addSpacing(1) - - def __getitem__(self, item): - """ - @rtype: QWidget - """ - return self._widgets[item] - - def __setitem__(self, key, value): - self._widgets[key] = value - - def applyCustomization(self, plot_config): - """ - @type plot_config: PlotConfig - """ - raise NotImplementedError("Class '%s' has not implemented the applyCustomization() function!" % self.__class__.__name__) - - def revertCustomization(self, plot_config): - """ - @type plot_config: PlotConfig - """ - raise NotImplementedError("Class '%s' has not implemented the revertCustomization() function!" % self.__class__.__name__) - - - -class WidgetProperty(object): - def __get__(self, instance, owner): - raise UserWarning("Property is invalid!") - - def __set__(self, instance, value): - raise UserWarning("Property is invalid!") diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/customize_plot_dialog.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/customize_plot_dialog.py deleted file mode 100644 index 8b92559fbc..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/customize_plot_dialog.py +++ /dev/null @@ -1,292 +0,0 @@ -from PyQt4.QtCore import Qt, pyqtSignal, QObject -from PyQt4.QtGui import QDialog, QVBoxLayout, QLayout, QTabWidget, QHBoxLayout, QPushButton, QToolButton, QMenu, \ - QWidgetAction, QListWidget - -from ert_gui import ERT -from ert_gui.tools.plot.widgets import CopyStyleToDialog -from ert_gui.ertwidgets import resourceIcon -from ert_gui.plottery import PlotConfig, PlotConfigHistory -from ert_gui.tools.plot.customize import DefaultCustomizationView, StyleCustomizationView, \ - StatisticsCustomizationView, LimitsCustomizationView - - -class PlotCustomizer(QObject): - - settingsChanged = pyqtSignal() - - def __init__(self, parent, default_plot_settings): - super(PlotCustomizer, self).__init__() - - self._plot_config_key = None - self._previous_key = None - self.default_plot_settings = default_plot_settings - self._plot_configs = {None: PlotConfigHistory("No_Key_Selected", PlotConfig(default_plot_settings, title=None))} - - self._plotConfigCreator = self._defaultPlotConfigCreator - - self._customization_dialog = CustomizePlotDialog("Customize", parent, key=self._plot_config_key) - - self._customization_dialog.addTab("general", "General", DefaultCustomizationView()) - self._customization_dialog.addTab("style", "Style", StyleCustomizationView()) - self._customization_dialog.addTab("statistics", "Statistics", StatisticsCustomizationView()) - - self._customize_limits = LimitsCustomizationView() - self._customization_dialog.addTab("limits", "Limits", self._customize_limits) - - self._customization_dialog.applySettings.connect(self.applyCustomization) - self._customization_dialog.undoSettings.connect(self.undoCustomization) - self._customization_dialog.redoSettings.connect(self.redoCustomization) - self._customization_dialog.resetSettings.connect(self.resetCustomization) - self._customization_dialog.copySettings.connect(self.copyCustomization) - self._customization_dialog.copySettingsToOthers.connect(self.copyCustomizationTo) - self._revertCustomization(self.getPlotConfig()) - - - def _getPlotConfigHistory(self): - """ @rtype: PlotConfigHistory """ - return self._plot_configs[self._plot_config_key] - - def undoCustomization(self): - history = self._getPlotConfigHistory() - history.undoChanges() - self._revertCustomization(history.getPlotConfig()) - - def redoCustomization(self): - history = self._getPlotConfigHistory() - history.redoChanges() - self._revertCustomization(history.getPlotConfig()) - - def resetCustomization(self): - history = self._getPlotConfigHistory() - history.resetChanges() - self._revertCustomization(history.getPlotConfig()) - - - def applyCustomization(self): - history = self._getPlotConfigHistory() - plot_config = history.getPlotConfig() - if self._customization_dialog is not None: - for customization_view in self._customization_dialog: - customization_view.applyCustomization(plot_config) - - history.applyChanges(plot_config) - - self._emitChangedSignal() - - - def _revertCustomization(self, plot_config, emit=True): - if self._customization_dialog is not None: - for customization_view in self._customization_dialog: - customization_view.revertCustomization(plot_config) - - self._emitChangedSignal(emit) - - def _emitChangedSignal(self, emit=True): - history = self._getPlotConfigHistory() - self._customization_dialog.setUndoRedoCopyState(history.isUndoPossible(), history.isRedoPossible(), self.isCopyPossible()) - - if emit: - self.settingsChanged.emit() - - def isCopyPossible(self): - """ @rtype: bool """ - return len(self._plot_configs) > 2 - - def copyCustomizationTo(self, keys): - """ copies the plotconfig of the current key, to a set of other keys""" - history = self._getPlotConfigHistory() - - for key in keys: - if key not in self._plot_configs: - self._plot_configs[key] = PlotConfigHistory("No_Key_Selected", - PlotConfig(self.default_plot_settings, title=None)) - source_config = history.getPlotConfig() - source_config.setTitle(key) - - self._plot_configs[key].applyChanges(source_config) - - self._customization_dialog.addCopyableKey(key) - - self._emitChangedSignal(emit=True) - - - def copyCustomization(self, key): - key = str(key) - if self.isCopyPossible(): - source_config = self._plot_configs[key].getPlotConfig() - source_config.setTitle(None) - - history = self._getPlotConfigHistory() - history.applyChanges(source_config) - - self._revertCustomization(history.getPlotConfig()) - - def toggleCustomizationDialog(self): - if self._customization_dialog.isVisible(): - self._customization_dialog.hide() - else: - self._customization_dialog.show() - - def _defaultPlotConfigCreator(self, title): - return PlotConfig(title) - - def _selectiveCopyOfCurrentPlotConfig(self, title): - return self._plotConfigCreator(title) - - def switchPlotConfigHistory(self, key): - if key != self._plot_config_key: - if not key in self._plot_configs: - self._plot_configs[key] = PlotConfigHistory(key, self._selectiveCopyOfCurrentPlotConfig(key)) - self._customization_dialog.addCopyableKey(key) - self._customization_dialog.currentPlotKeyChanged(key) - self._previous_key = self._plot_config_key - self._plot_config_key = key - self._revertCustomization(self.getPlotConfig(), emit=False) - - def getPlotConfig(self): - """ @rtype: PlotConfig """ - return self._getPlotConfigHistory().getPlotConfig() - - def setAxisTypes(self, x_axis_type, y_axis_type): - self._customize_limits.setAxisTypes(x_axis_type, y_axis_type) - - def setPlotConfigCreator(self, func): - self._plotConfigCreator = func - - -class CustomizePlotDialog(QDialog): - applySettings = pyqtSignal() - undoSettings = pyqtSignal() - redoSettings = pyqtSignal() - resetSettings = pyqtSignal() - copySettings = pyqtSignal(str) - copySettingsToOthers = pyqtSignal(list) - - def __init__(self, title, parent=None, key=''): - QDialog.__init__(self, parent) - self.setWindowTitle(title) - - self._ert = ERT.ert - - """:type: ert.enkf.enkf_main.EnKFMain""" - - self.key_manager = self._ert.getKeyManager() - """:type: ert.enkf.key_manager.KeyManager """ - - self.current_key = key - - self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint) - self.setWindowFlags(self.windowFlags() & ~Qt.WindowCloseButtonHint) - self.setWindowFlags(self.windowFlags() & ~Qt.WindowCancelButtonHint) - - self._tab_map = {} - self._tab_order = [] - - layout = QVBoxLayout() - - self._tabs = QTabWidget() - layout.addWidget(self._tabs) - layout.setSizeConstraint(QLayout.SetFixedSize) # not resizable!!! - - self._button_layout = QHBoxLayout() - - self._reset_button = QToolButton() - self._reset_button.setIcon(resourceIcon("update.png")) - self._reset_button.setToolTip("Reset all settings back to default") - self._reset_button.clicked.connect(self.resetSettings) - - self._undo_button = QToolButton() - self._undo_button.setIcon(resourceIcon("undo.png")) - self._undo_button.setToolTip("Undo") - self._undo_button.clicked.connect(self.undoSettings) - - self._redo_button = QToolButton() - self._redo_button.setIcon(resourceIcon("redo.png")) - self._redo_button.setToolTip("Redo") - self._redo_button.clicked.connect(self.redoSettings) - self._redo_button.setEnabled(False) - - self._copy_from_button = QToolButton() - self._copy_from_button.setIcon(resourceIcon("copy_from.png")) - self._copy_from_button.setToolTip("Copy settings from another key") - self._copy_from_button.setPopupMode(QToolButton.InstantPopup) - self._copy_from_button.setEnabled(False) - - self._copy_to_button = QToolButton() - self._copy_to_button.setIcon(resourceIcon("copy_to.png")) - self._copy_to_button.setToolTip("Copy current plot settings to other keys") - self._copy_to_button.setPopupMode(QToolButton.InstantPopup) - self._copy_to_button.clicked.connect(self.initiateCopyStyleToDialog) - self._copy_to_button.setEnabled(True) - - tool_menu = QMenu(self._copy_from_button) - self._popup_list = QListWidget(tool_menu) - self._popup_list.setSortingEnabled(True) - self._popup_list.itemClicked.connect(self.keySelected) - action = QWidgetAction(tool_menu) - action.setDefaultWidget(self._popup_list) - tool_menu.addAction(action) - self._copy_from_button.setMenu(tool_menu) - - self._apply_button = QPushButton("Apply") - self._apply_button.setToolTip("Apply the new settings") - self._apply_button.clicked.connect(self.applySettings) - self._apply_button.setDefault(True) - - self._close_button = QPushButton("Close") - self._close_button.setToolTip("Hide this dialog") - self._close_button.clicked.connect(self.hide) - - self._button_layout.addWidget(self._reset_button) - self._button_layout.addStretch() - self._button_layout.addWidget(self._undo_button) - self._button_layout.addWidget(self._redo_button) - self._button_layout.addWidget(self._copy_from_button) - self._button_layout.addWidget(self._copy_to_button) - self._button_layout.addStretch() - self._button_layout.addWidget(self._apply_button) - self._button_layout.addWidget(self._close_button) - - layout.addStretch() - layout.addLayout(self._button_layout) - - self.setLayout(layout) - - def initiateCopyStyleToDialog(self): - all_other_keys = [k for k in self.key_manager.allDataTypeKeys() if k != self.current_key] - dialog = CopyStyleToDialog(self, self.current_key, all_other_keys) - if dialog.exec_(): - self.copySettingsToOthers.emit(dialog.getSelectedKeys()) - - def addCopyableKey(self, key): - self._popup_list.addItem(key) - - def keySelected(self, list_widget_item): - self.copySettings.emit(str(list_widget_item.text())) - - def currentPlotKeyChanged(self, new_key): - self.current_key = new_key - - def keyPressEvent(self, q_key_event): - if q_key_event.key() == Qt.Key_Escape: - self.hide() - else: - QDialog.keyPressEvent(self, q_key_event) - - def addTab(self, attribute_name, title, widget): - self._tabs.addTab(widget, title) - self._tab_map[attribute_name] = widget - self._tab_order.append(attribute_name) - - def __getitem__(self, item): - """ @rtype: ert_gui.tools.plot.customize.customization_view.CustomizationView """ - return self._tab_map[item] - - def __iter__(self): - for attribute_name in self._tab_order: - yield self._tab_map[attribute_name] - - def setUndoRedoCopyState(self, undo, redo, copy=False): - self._undo_button.setEnabled(undo) - self._redo_button.setEnabled(redo) - self._copy_from_button.setEnabled(copy) diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/default_customization_view.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/default_customization_view.py deleted file mode 100644 index 5cd8e1f764..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/default_customization_view.py +++ /dev/null @@ -1,69 +0,0 @@ -from ert_gui.tools.plot.customize import CustomizationView, WidgetProperty - - -class DefaultCustomizationView(CustomizationView): - - title = WidgetProperty() - x_label = WidgetProperty() - y_label = WidgetProperty() - legend = WidgetProperty() - grid = WidgetProperty() - refcase = WidgetProperty() - history = WidgetProperty() - observations = WidgetProperty() - - - def __init__(self): - CustomizationView.__init__(self) - label_msg = "Set to empty to use the default %s.\n" \ - "It is also possible to use LaTeX. Enclose expression with $...$ for example: \n" \ - "$\\alpha > \\beta$\n" \ - "$r^3$\n" \ - "$\\frac{1}{x}$\n" \ - "$\\sqrt{2}$" - - self.addLineEdit("title", "Title", "The title of the plot. %s" % (label_msg % "title"), placeholder="Title") - self.addSpacing() - self.addLineEdit("x_label", "X Label", "The label of the X axis. %s" % (label_msg % "label"), placeholder="X Label") - self.addLineEdit("y_label", "Y Label", "The label of the Y axis. %s" % (label_msg % "label"), placeholder="Y Label") - self.addSpacing() - self.addCheckBox("legend", "Legend", "Toggle Legend visibility.") - self.addCheckBox("grid", "Grid", "Toggle Grid visibility.") - self.addCheckBox("refcase", "Refcase", "Toggle Refcase visibility.") - self.addCheckBox("history", "History", "Toggle History visibility.") - self.addCheckBox("observations", "Observations", "Toggle Observations visibility.") - - - def applyCustomization(self, plot_config): - """ - @type plot_config: ert_gui.plottery.PlotConfig - """ - plot_config.setTitle(self.title) - - plot_config.setXLabel(self.x_label) - plot_config.setYLabel(self.y_label) - - plot_config.setLegendEnabled(self.legend) - plot_config.setGridEnabled(self.grid) - plot_config.setRefcaseEnabled(self.refcase) - plot_config.setHistoryEnabled(self.history) - plot_config.setObservationsEnabled(self.observations) - - - def revertCustomization(self, plot_config): - """ - @type plot_config: ert_gui.plottery.PlotConfig - """ - if not plot_config.isUnnamed(): - self.title = plot_config.title() - else: - self.title = "" - - self.x_label = plot_config.xLabel() - self.y_label = plot_config.yLabel() - - self.legend = plot_config.isLegendEnabled() - self.grid = plot_config.isGridEnabled() - self.refcase = plot_config.isRefcaseEnabled() - self.history = plot_config.isHistoryEnabled() - self.observations = plot_config.isObservationsEnabled() diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/limits_customization_view.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/limits_customization_view.py deleted file mode 100644 index 90b4dadfb7..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/limits_customization_view.py +++ /dev/null @@ -1,251 +0,0 @@ -from PyQt4.QtGui import QDoubleValidator, QStackedWidget, QIntValidator, QLabel -from ert_gui.tools.plot.widgets.custom_date_edit import CustomDateEdit - -from ert_gui.plottery import PlotContext -from ert_gui.plottery.plot_limits import PlotLimits -from ert_gui.tools.plot.customize import CustomizationView -from ert_gui.tools.plot.widgets.clearable_line_edit import ClearableLineEdit - - -class StackedInput(QStackedWidget): - def __init__(self): - QStackedWidget.__init__(self) - self._inputs = {} - self._index_map = {} - self.addInput(PlotContext.UNKNOWN_AXIS, QLabel("Fixed")) - self._current_name = PlotContext.UNKNOWN_AXIS - - def addInput(self, name, widget): - index = self.addWidget(widget) - self._inputs[name] = widget - self._index_map[name] = index - - def switchToInput(self, name): - index_for_name = self._index_map[name] - self.setCurrentIndex(index_for_name) - self._current_name = name - - def getCurrentInputName(self): - return self._current_name - - -class LimitsStack(StackedInput): - FLOAT_AXIS = [PlotContext.VALUE_AXIS, PlotContext.DENSITY_AXIS, PlotContext.DEPTH_AXIS] - INT_AXIS = [PlotContext.INDEX_AXIS, PlotContext.COUNT_AXIS] - NUMBER_AXIS = FLOAT_AXIS + INT_AXIS - - def __init__(self): - StackedInput.__init__(self) - self.addInput(PlotContext.COUNT_AXIS, self.createIntegerLineEdit(minimum=0, placeholder="Default value")) - self.addInput(PlotContext.DATE_AXIS, CustomDateEdit()) - self.addInput(PlotContext.DENSITY_AXIS, self.createDoubleLineEdit(minimum=0, placeholder="Default value")) - self.addInput(PlotContext.DEPTH_AXIS, self.createDoubleLineEdit(minimum=0, placeholder="Default value")) - self.addInput(PlotContext.INDEX_AXIS, self.createIntegerLineEdit(minimum=0, placeholder="Default value")) - self.addInput(PlotContext.VALUE_AXIS, self.createDoubleLineEdit(placeholder="Default value")) - - def createDoubleLineEdit(self, minimum=None, maximum=None, placeholder=""): - line_edit = ClearableLineEdit(placeholder=placeholder) - validator = QDoubleValidator() - - if minimum is not None: - validator.setBottom(minimum) - - if maximum is not None: - validator.setTop(maximum) - - line_edit.setValidator(validator) - return line_edit - - def createIntegerLineEdit(self, minimum=None, maximum=None, placeholder=""): - line_edit = ClearableLineEdit(placeholder=placeholder) - validator = QIntValidator() - - if minimum is not None: - validator.setBottom(minimum) - - if maximum is not None: - validator.setTop(maximum) - - line_edit.setValidator(validator) - return line_edit - - def setValue(self, axis_name, value): - input = self._inputs[axis_name] - - if axis_name in LimitsStack.NUMBER_AXIS: - if value is None: - input.setText("") - else: - input.setText(str(value)) - elif axis_name == PlotContext.DATE_AXIS: - input.setDate(value) - - def getValue(self, axis_name): - input = self._inputs[axis_name] - result = None - if axis_name in LimitsStack.FLOAT_AXIS: - try: - result = float(input.text()) - except ValueError: - result = None - elif axis_name in LimitsStack.INT_AXIS: - try: - result = int(input.text()) - except ValueError: - result = None - elif axis_name == PlotContext.DATE_AXIS: - result = input.date() - - return result - - -class LimitsWidget(object): - def __init__(self): - self._limits = PlotLimits() - self._x_minimum_stack = LimitsStack() - self._x_maximum_stack = LimitsStack() - self._x_current_input_name = PlotContext.UNKNOWN_AXIS - - self._y_minimum_stack = LimitsStack() - self._y_maximum_stack = LimitsStack() - self._y_current_input_name = PlotContext.UNKNOWN_AXIS - - - @property - def x_minimum_stack(self): - """ @rtype: LimitsStack """ - return self._x_minimum_stack - - @property - def x_maximum_stack(self): - """ @rtype: LimitsStack """ - return self._x_maximum_stack - - @property - def y_minimum_stack(self): - """ @rtype: LimitsStack """ - return self._y_minimum_stack - - @property - def y_maximum_stack(self): - """ @rtype: LimitsStack """ - return self._y_maximum_stack - - @property - def limits(self): - """ @rtype: PlotLimits """ - self._updateLimits() - limits = PlotLimits() - limits.copyLimitsFrom(self._limits) - return limits - - @limits.setter - def limits(self, value): - """ @type value: PlotLimits """ - self._limits.copyLimitsFrom(value) - self._updateWidgets() - - def _updateWidgets(self): - limits = self._limits - self._x_minimum_stack.setValue(PlotContext.DATE_AXIS, limits.date_minimum) - self._x_maximum_stack.setValue(PlotContext.DATE_AXIS, limits.date_maximum) - self._y_minimum_stack.setValue(PlotContext.DATE_AXIS, limits.date_minimum) - self._y_maximum_stack.setValue(PlotContext.DATE_AXIS, limits.date_maximum) - - self._x_minimum_stack.setValue(PlotContext.DEPTH_AXIS, limits.depth_minimum) - self._x_maximum_stack.setValue(PlotContext.DEPTH_AXIS, limits.depth_maximum) - self._y_minimum_stack.setValue(PlotContext.DEPTH_AXIS, limits.depth_minimum) - self._y_maximum_stack.setValue(PlotContext.DEPTH_AXIS, limits.depth_maximum) - - self._x_minimum_stack.setValue(PlotContext.DENSITY_AXIS, limits.density_minimum) - self._x_maximum_stack.setValue(PlotContext.DENSITY_AXIS, limits.density_maximum) - self._y_minimum_stack.setValue(PlotContext.DENSITY_AXIS, limits.density_minimum) - self._y_maximum_stack.setValue(PlotContext.DENSITY_AXIS, limits.density_maximum) - - self._x_minimum_stack.setValue(PlotContext.COUNT_AXIS, limits.count_minimum) - self._x_maximum_stack.setValue(PlotContext.COUNT_AXIS, limits.count_maximum) - self._y_minimum_stack.setValue(PlotContext.COUNT_AXIS, limits.count_minimum) - self._y_maximum_stack.setValue(PlotContext.COUNT_AXIS, limits.count_maximum) - - self._x_minimum_stack.setValue(PlotContext.INDEX_AXIS, limits.index_minimum) - self._x_maximum_stack.setValue(PlotContext.INDEX_AXIS, limits.index_maximum) - self._y_minimum_stack.setValue(PlotContext.INDEX_AXIS, limits.index_minimum) - self._y_maximum_stack.setValue(PlotContext.INDEX_AXIS, limits.index_maximum) - - self._x_minimum_stack.setValue(PlotContext.VALUE_AXIS, limits.value_minimum) - self._x_maximum_stack.setValue(PlotContext.VALUE_AXIS, limits.value_maximum) - self._y_minimum_stack.setValue(PlotContext.VALUE_AXIS, limits.value_minimum) - self._y_maximum_stack.setValue(PlotContext.VALUE_AXIS, limits.value_maximum) - - - def _updateLimits(self): - if self._x_current_input_name is not PlotContext.UNKNOWN_AXIS: - minimum = self._x_minimum_stack.getValue(self._x_current_input_name) - maximum = self._x_maximum_stack.getValue(self._x_current_input_name) - self._updateLimit(self._x_current_input_name, minimum, maximum) - - if self._y_current_input_name is not PlotContext.UNKNOWN_AXIS: - minimum = self._y_minimum_stack.getValue(self._y_current_input_name) - maximum = self._y_maximum_stack.getValue(self._y_current_input_name) - self._updateLimit(self._y_current_input_name, minimum, maximum) - - - def _updateLimit(self, axis_name, minimum, maximum): - if axis_name == PlotContext.COUNT_AXIS: - self._limits.count_limits = minimum, maximum - elif axis_name == PlotContext.DENSITY_AXIS: - self._limits.density_limits = minimum, maximum - elif axis_name == PlotContext.DEPTH_AXIS: - self._limits.depth_limits = minimum, maximum - elif axis_name == PlotContext.DATE_AXIS: - self._limits.date_limits = minimum, maximum - elif axis_name == PlotContext.INDEX_AXIS: - self._limits.index_limits = minimum, maximum - elif axis_name == PlotContext.VALUE_AXIS: - self._limits.value_limits = minimum, maximum - - - def switchInputOnX(self, axis_type): - self._x_current_input_name = axis_type - self._updateWidgets() - self._x_minimum_stack.switchToInput(axis_type) - self._x_maximum_stack.switchToInput(axis_type) - - - def switchInputOnY(self, axis_type): - self._y_current_input_name = axis_type - self._updateWidgets() - self._y_minimum_stack.switchToInput(axis_type) - self._y_maximum_stack.switchToInput(axis_type) - - - -class LimitsCustomizationView(CustomizationView): - - def __init__(self): - CustomizationView.__init__(self) - - limits_widget = LimitsWidget() - self._limits_widget = limits_widget - - self.addHeading("X Axis") - self.addRow("Minimum", limits_widget.x_minimum_stack) - self.addRow("Maximum", limits_widget.x_maximum_stack) - - self.addHeading("Y Axis") - self.addRow("Minimum", limits_widget.y_minimum_stack) - self.addRow("Maximum", limits_widget.y_maximum_stack) - - - def setAxisTypes(self, x_axis_type, y_axis_type): - self._limits_widget.switchInputOnX(x_axis_type) - self._limits_widget.switchInputOnY(y_axis_type) - - def revertCustomization(self, plot_config): - """ @type plot_config: ert_gui.plottery.PlotConfig """ - self._limits_widget.limits = plot_config.limits - - - def applyCustomization(self, plot_config): - """ @type plot_config: ert_gui.plottery.PlotConfig """ - plot_config.limits = self._limits_widget.limits diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/statistics_customization_view.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/statistics_customization_view.py deleted file mode 100644 index 8ce2f0d9cc..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/statistics_customization_view.py +++ /dev/null @@ -1,125 +0,0 @@ -from PyQt4.QtGui import QHBoxLayout, QLabel, QComboBox - -from ert_gui.tools.plot.customize import CustomizationView, WidgetProperty -from ert_gui.tools.plot import style_chooser as sc - -class StatisticsCustomizationView(CustomizationView): - mean_style = WidgetProperty() - p50_style = WidgetProperty() - std_style = WidgetProperty() - min_max_style = WidgetProperty() - p10_p90_style = WidgetProperty() - p33_p67_style = WidgetProperty() - std_dev_factor = WidgetProperty() - distribution_lines = WidgetProperty() - - - def __init__(self): - CustomizationView.__init__(self) - - self._presets = ["Statistics Default", "Cross Case Statistics Default", "Overview", "All statistics"] - - self.addRow("Presets", self.createPresets()) - self.addSpacing(10) - layout = QHBoxLayout() - self.addRow("", layout) - self.addStyleChooser("mean_style", "Mean", "Line and marker style for the mean line.") - self.addStyleChooser("p50_style", "P50", "Line and marker style for the P50 line.") - self.addStyleChooser("std_style", "Std dev", - "Line and marker style for the unbiased standard deviation lines.", - line_style_set=sc.STYLESET_AREA) - self.addStyleChooser("min_max_style", "Min/Max", - "Line and marker style for the min/max lines.", - line_style_set=sc.STYLESET_AREA) - self.addStyleChooser("p10_p90_style", "P10-P90", - "Line and marker style for the P10-P90 lines.", - line_style_set=sc.STYLESET_AREA) - self.addStyleChooser("p33_p67_style", "P33-P67", - "Line and marker style for the P33-P67 lines.", - line_style_set=sc.STYLESET_AREA) - self.addSpacing() - - std_box = self.addSpinBox("std_dev_factor", "Std dev multiplier", - "Choose which standard deviation to plot", max_value=3) - - self.addCheckBox("distribution_lines", "Connection Lines", "Toggle distribution connection lines visibility.") - - self["mean_style"].createLabelLayout(layout) - - - - def createPresets(self): - preset_combo = QComboBox() - for preset in self._presets: - preset_combo.addItem(preset) - - preset_combo.currentIndexChanged.connect(self.presetSelected) - return preset_combo - - - def presetSelected(self, index): - if index == 0: # Default - self.updateStyle("mean_style", "-", None) - self.updateStyle("p50_style", None, None) - self.updateStyle("std_style", None, None) - self.updateStyle("min_max_style", None, None) - self.updateStyle("p10_p90_style", "--", None) - self.updateStyle("p33_p67_style", None, None) - elif index == 1: # CCS Default - self.updateStyle("mean_style", "-", "o") - self.updateStyle("p50_style", None, None) - self.updateStyle("std_style", "--", "D") - self.updateStyle("min_max_style", None, None) - self.updateStyle("p10_p90_style", None, None) - self.updateStyle("p33_p67_style", None, None) - elif index == 2: # Overview - self.updateStyle("mean_style", None, None) - self.updateStyle("p50_style", None, None) - self.updateStyle("std_style", None, None) - self.updateStyle("min_max_style", "#", None) - self.updateStyle("p10_p90_style", None, None) - self.updateStyle("p33_p67_style", None, None) - elif index == 3: # All statistics - self.updateStyle("mean_style", "-", None) - self.updateStyle("p50_style", "--", "x") - self.updateStyle("std_style", ":", None) - self.updateStyle("min_max_style", "--", None) - self.updateStyle("p10_p90_style", "#", None) - self.updateStyle("p33_p67_style", "#", None) - - - def updateStyle(self, attribute_name, line_style, marker_style): - style = getattr(self, attribute_name) - style.line_style = line_style - style.marker = marker_style - setattr(self, attribute_name, style) - - - def applyCustomization(self, plot_config): - """ - @type plot_config: ert_gui.plottery.PlotConfig - """ - plot_config.setStatisticsStyle("mean", self.mean_style) - plot_config.setStatisticsStyle("p50", self.p50_style) - plot_config.setStatisticsStyle("std", self.std_style) - plot_config.setStatisticsStyle("min-max", self.min_max_style) - plot_config.setStatisticsStyle("p10-p90", self.p10_p90_style) - plot_config.setStatisticsStyle("p33-p67", self.p33_p67_style) - - plot_config.setStandardDeviationFactor(self.std_dev_factor) - plot_config.setDistributionLineEnabled(self.distribution_lines) - - - def revertCustomization(self, plot_config): - """ - @type plot_config: ert_gui.plottery.PlotConfig - """ - self.mean_style = plot_config.getStatisticsStyle("mean") - self.p50_style = plot_config.getStatisticsStyle("p50") - self.std_style = plot_config.getStatisticsStyle("std") - self.min_max_style = plot_config.getStatisticsStyle("min-max") - self.p10_p90_style = plot_config.getStatisticsStyle("p10-p90") - self.p33_p67_style = plot_config.getStatisticsStyle("p33-p67") - - self.std_dev_factor = plot_config.getStandardDeviationFactor() - self.distribution_lines = plot_config.isDistributionLineEnabled() diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/style_customization_view.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/style_customization_view.py deleted file mode 100644 index 96b2eb25ef..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/customize/style_customization_view.py +++ /dev/null @@ -1,94 +0,0 @@ -from PyQt4.QtGui import QHBoxLayout, QLabel, QColor - -from ert_gui.tools.plot import ColorBox -from ert_gui.tools.plot.customize import CustomizationView, WidgetProperty - -from ert_gui.tools.plot import style_chooser as sc - -class StyleCustomizationView(CustomizationView): - default_style = WidgetProperty() - refcase_style = WidgetProperty() - history_style = WidgetProperty() - observs_style = WidgetProperty() - color_cycle = WidgetProperty() - observs_color = WidgetProperty() - - def __init__(self): - CustomizationView.__init__(self) - - layout = QHBoxLayout() - - self.addRow("", layout) - self.addStyleChooser("default_style", "Default", "Line and marker style for default lines.") - self.addStyleChooser("refcase_style", "Refcase", "Line and marker style for the refcase line.") - self.addStyleChooser("history_style", "History", "Line and marker style for the history line.") - self.addStyleChooser("observs_style", "Observation", "Line and marker style for the observation line.", - line_style_set=sc.STYLESET_TOGGLE) - - self["default_style"].createLabelLayout(layout) - - self.addSpacing(10) - - color_layout = QHBoxLayout() - - self._color_boxes = [] - for name in ["#1", "#2", "#3", "#4", "#5"]: - color_box = self.createColorBox(name) - self._color_boxes.append(color_box) - color_layout.addWidget(color_box) - - self.addRow("Color Cycle", color_layout) - self.updateProperty("color_cycle", StyleCustomizationView.getColorCycle, StyleCustomizationView.setColorCycle) - - self._observs_color_box = self.createColorBox("observations_color") - self.addRow('Observations Color', self._observs_color_box) - self.updateProperty("observs_color", - StyleCustomizationView.getObservationsColor, - StyleCustomizationView.setObservationsColor) - - def getObservationsColor(self): - return str(self._observs_color_box.color.name()) - - def setObservationsColor(self, name): - self._observs_color_box.color = name - - def createColorBox(self, name): - color_box = ColorBox(QColor(255, 255, 255), 20) - color_box.setToolTip(name) - return color_box - - def getColorCycle(self): - colors = [] - for color_box in self._color_boxes: - colors.append(str(color_box.color.name())) - - return colors - - def setColorCycle(self, color_cycle): - for index, color in enumerate(color_cycle): - if 0 <= index < len(self._color_boxes): - color_box = self._color_boxes[index] - color_box.color = color - - def applyCustomization(self, plot_config): - """ - @type plot_config: ert_gui.plottery.PlotConfig - """ - plot_config.setDefaultStyle(self.default_style) - plot_config.setRefcaseStyle(self.refcase_style) - plot_config.setHistoryStyle(self.history_style) - plot_config.setObservationsStyle(self.observs_style) - plot_config.setObservationsColor(self.observs_color) - plot_config.setLineColorCycle(self.color_cycle) - - def revertCustomization(self, plot_config): - """ - @type plot_config: ert_gui.plottery.PlotConfig - """ - self.default_style = plot_config.defaultStyle() - self.refcase_style = plot_config.refcaseStyle() - self.history_style = plot_config.historyStyle() - self.observs_style = plot_config.observationsStyle() - self.observs_color = plot_config.observationsColor() - self.color_cycle = plot_config.lineColorCycle() - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/data_type_keys_list_model.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/data_type_keys_list_model.py deleted file mode 100644 index 4c4a509ba6..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/data_type_keys_list_model.py +++ /dev/null @@ -1,77 +0,0 @@ -from PyQt4.QtCore import QAbstractItemModel, QModelIndex, Qt, QVariant -from PyQt4.QtGui import QColor - -from ert_gui.ertwidgets import resourceIcon - - -class DataTypeKeysListModel(QAbstractItemModel): - DEFAULT_DATA_TYPE = QColor(255, 255, 255) - HAS_OBSERVATIONS = QColor(237, 218, 116) - GROUP_ITEM = QColor(64, 64, 64) - - def __init__(self, ert): - """ - @type ert: ert.enkf.EnKFMain - """ - QAbstractItemModel.__init__(self) - self.__ert = ert - self.__icon = resourceIcon("ide/small/bullet_star") - - def keyManager(self): - return self.__ert.getKeyManager() - - def index(self, row, column, parent=None, *args, **kwargs): - return self.createIndex(row, column, parent) - - def parent(self, index=None): - return QModelIndex() - - def rowCount(self, parent=None, *args, **kwargs): - return len(self.keyManager().allDataTypeKeys()) - - def columnCount(self, QModelIndex_parent=None, *args, **kwargs): - return 1 - - def data(self, index, role=None): - assert isinstance(index, QModelIndex) - - if index.isValid(): - items = self.keyManager().allDataTypeKeys() - row = index.row() - item = items[row] - - if role == Qt.DisplayRole: - return item - elif role == Qt.BackgroundRole: - if self.keyManager().isKeyWithObservations(item): - return self.HAS_OBSERVATIONS - - return QVariant() - - def itemAt(self, index): - assert isinstance(index, QModelIndex) - - if index.isValid(): - row = index.row() - return self.keyManager().allDataTypeKeys()[row] - - return None - - - def isSummaryKey(self, key): - return self.keyManager().isSummaryKey(key) - - def isBlockKey(self, key): - return False - - def isGenKWKey(self, key): - return self.keyManager().isGenKwKey(key) - - def isGenDataKey(self, key): - return self.keyManager().isGenDataKey(key) - - def isCustomKwKey(self, key): - return self.keyManager().isCustomKwKey(key) - - def isCustomPcaKey(self, key): - return False diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/data_type_keys_widget.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/data_type_keys_widget.py deleted file mode 100644 index 13914f2744..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/data_type_keys_widget.py +++ /dev/null @@ -1,78 +0,0 @@ -from PyQt4.QtCore import pyqtSignal -from PyQt4.QtGui import QWidget, QVBoxLayout, QListView, QHBoxLayout, QToolButton - -from ert_gui.ertwidgets import SearchBox, resourceIcon, Legend -from ert_gui.tools.plot import DataTypeKeysListModel, DataTypeProxyModel, FilterPopup - - -class DataTypeKeysWidget(QWidget): - dataTypeKeySelected = pyqtSignal() - - def __init__(self, model): - QWidget.__init__(self) - - self.__filter_popup = FilterPopup(self) - self.__filter_popup.filterSettingsChanged.connect(self.onItemChanged) - - layout = QVBoxLayout() - - self.model = model - self.filter_model = DataTypeProxyModel(self.model) - - filter_layout = QHBoxLayout() - - self.search_box = SearchBox() - self.search_box.filterChanged.connect(self.setSearchString) - filter_layout.addWidget(self.search_box) - - filter_popup_button = QToolButton() - filter_popup_button.setIcon(resourceIcon("ide/cog_edit.png")) - filter_popup_button.clicked.connect(self.showFilterPopup) - filter_layout.addWidget(filter_popup_button) - layout.addLayout(filter_layout) - - self.data_type_keys_widget = QListView() - self.data_type_keys_widget.setModel(self.filter_model) - self.data_type_keys_widget.selectionModel().selectionChanged.connect(self.itemSelected) - - layout.addSpacing(15) - layout.addWidget(self.data_type_keys_widget, 2) - layout.addStretch() - - # layout.addWidget(Legend("Default types", DataTypeKeysListModel.DEFAULT_DATA_TYPE)) - layout.addWidget(Legend("Observations available", DataTypeKeysListModel.HAS_OBSERVATIONS)) - - self.setLayout(layout) - - def onItemChanged(self, item): - # self.filter_model.setShowBlockKeys(item["block"]) - self.filter_model.setShowSummaryKeys(item["summary"]) - self.filter_model.setShowGenKWKeys(item["gen_kw"]) - self.filter_model.setShowGenDataKeys(item["gen_data"]) - self.filter_model.setShowCustomKwKeys(item["custom_kw"]) - # self.filter_model.setShowCustomPcaKeys(item["custom_pca"]) - - - def itemSelected(self): - selected_item = self.getSelectedItem() - if selected_item is not None: - self.dataTypeKeySelected.emit() - - - def getSelectedItem(self): - """ @rtype: str """ - index = self.data_type_keys_widget.currentIndex() - source_index = self.filter_model.mapToSource(index) - item = self.model.itemAt(source_index) - return item - - def selectDefault(self): - self.data_type_keys_widget.setCurrentIndex(self.filter_model.index(0, 0)) - - - def setSearchString(self, filter): - self.filter_model.setFilterFixedString(filter) - - def showFilterPopup(self): - self.__filter_popup.show() - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/data_type_proxy_model.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/data_type_proxy_model.py deleted file mode 100644 index 059762f9ef..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/data_type_proxy_model.py +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright (C) 2014 Statoil ASA, Norway. -# -# The file 'data_type_proxy_model.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from PyQt4.QtCore import Qt -from PyQt4.QtGui import QSortFilterProxyModel -from ert_gui.tools.plot import DataTypeKeysListModel - - -class DataTypeProxyModel(QSortFilterProxyModel): - - def __init__(self, model , parent=None): - QSortFilterProxyModel.__init__(self, parent) - self.__show_summary_keys = True - self.__show_block_keys = True - self.__show_gen_kw_keys = True - self.__show_gen_data_keys = True - self.__show_custom_kw_keys = True - self.__show_custom_pca_keys = True - - self.setFilterCaseSensitivity(Qt.CaseInsensitive) - self.setSourceModel(model) - - def filterAcceptsRow(self, index, q_model_index): - show = QSortFilterProxyModel.filterAcceptsRow(self, index, q_model_index) - - if show: - source_model = self.sourceModel() - source_index = source_model.index(index, 0, q_model_index) - key = source_model.itemAt(source_index) - - if not self.__show_summary_keys and source_model.isSummaryKey(key): - show = False - - elif not self.__show_block_keys and source_model.isBlockKey(key): - show = False - - elif not self.__show_gen_kw_keys and source_model.isGenKWKey(key): - show = False - - elif not self.__show_gen_data_keys and source_model.isGenDataKey(key): - show = False - - elif not self.__show_custom_kw_keys and source_model.isCustomKwKey(key): - show = False - - elif not self.__show_custom_pca_keys and source_model.isCustomPcaKey(key): - show = False - - - return show - - def sourceModel(self): - """ @rtype: DataTypeKeysListModel """ - return QSortFilterProxyModel.sourceModel(self) - - def setShowSummaryKeys(self, visible): - self.__show_summary_keys = visible - self.invalidateFilter() - - def setShowBlockKeys(self, visible): - self.__show_block_keys = visible - self.invalidateFilter() - - def setShowGenKWKeys(self, visible): - self.__show_gen_kw_keys = visible - self.invalidateFilter() - - def setShowGenDataKeys(self, visible): - self.__show_gen_data_keys = visible - self.invalidateFilter() - - def setShowCustomKwKeys(self, visible): - self.__show_custom_kw_keys = visible - self.invalidateFilter() - - def setShowCustomPcaKeys(self, visible): - self.__show_custom_pca_keys = visible - self.invalidateFilter() - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/filter_popup.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/filter_popup.py deleted file mode 100644 index cfb286533a..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/filter_popup.py +++ /dev/null @@ -1,58 +0,0 @@ -from PyQt4.QtCore import Qt, pyqtSignal -from PyQt4.QtGui import QWidget, QFrame, QDialog, QVBoxLayout, QCheckBox, QLabel, QLayout, QCursor - - -class FilterPopup(QDialog): - filterSettingsChanged = pyqtSignal(dict) - - def __init__(self, parent=None): - QDialog.__init__(self, parent, Qt.WindowStaysOnTopHint | Qt.X11BypassWindowManagerHint | Qt.FramelessWindowHint) - self.setVisible(False) - - self.filter_items = {} - - layout = QVBoxLayout() - layout.setMargin(0) - frame = QFrame() - frame.setFrameStyle(QFrame.StyledPanel | QFrame.Raised) - layout.addWidget(frame) - - self.__layout = QVBoxLayout() - self.__layout.setSizeConstraint(QLayout.SetFixedSize) - self.__layout.addWidget(QLabel("Filter by data type:")) - - self.addFilterItem("Summary", "summary") - # self.addFilterItem("Block", "block") - self.addFilterItem("Gen KW", "gen_kw") - self.addFilterItem("Gen Data", "gen_data") - self.addFilterItem("Custom KW", "custom_kw") - # self.addFilterItem("Custom PCA", "custom_pca") - - frame.setLayout(self.__layout) - - self.setLayout(layout) - self.adjustSize() - - - def addFilterItem(self, name, id, value=True): - self.filter_items[id] = value - - check_box = QCheckBox(name) - check_box.setChecked(value) - - def toggleItem(checked): - self.filter_items[id] = checked - self.filterSettingsChanged.emit(self.filter_items) - - check_box.toggled.connect(toggleItem) - - self.__layout.addWidget(check_box) - - def leaveEvent(self, QEvent): - QWidget.leaveEvent(self, QEvent) - self.hide() - - def show(self): - QWidget.show(self) - p = QCursor().pos() - self.move(p.x(), p.y()) diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/filterable_kw_list_model.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/filterable_kw_list_model.py deleted file mode 100644 index 0d0f83f3ab..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/filterable_kw_list_model.py +++ /dev/null @@ -1,55 +0,0 @@ -from ert_gui.ertwidgets.models.selectable_list_model import SelectableListModel - - -class FilterableKwListModel(SelectableListModel): - """ - Adds ERT - plotting keyword specific filtering functionality to the general SelectableListModel - """ - def __init__(self, ert, selectable_keys): - SelectableListModel.__init__(self, selectable_keys) - self._ert = ert - self._show_summary_keys = True - self._show_gen_kw_keys = True - self._show_gen_data_keys = True - self._show_custom_kw_keys = True - - def getList(self): - filtered_list = [] - for item in self._items: - if self._show_summary_keys and self.isSummaryKey(item): - filtered_list.append(item) - elif self._show_gen_kw_keys and self.isGenKWKey(item): - filtered_list.append(item) - elif self._show_gen_data_keys and self.isGenDataKey(item): - filtered_list.append(item) - elif self._show_custom_kw_keys and self.isCustomKwKey(item): - filtered_list.append(item) - - return filtered_list - - def keyManager(self): - return self._ert.getKeyManager() - - def isSummaryKey(self, key): - return self.keyManager().isSummaryKey(key) - - def isGenKWKey(self, key): - return self.keyManager().isGenKwKey(key) - - def isGenDataKey(self, key): - return self.keyManager().isGenDataKey(key) - - def isCustomKwKey(self, key): - return self.keyManager().isCustomKwKey(key) - - def setShowSummaryKeys(self, visible): - self._show_summary_keys = visible - - def setShowGenKWKeys(self, visible): - self._show_gen_kw_keys = visible - - def setShowGenDataKeys(self, visible): - self._show_gen_data_keys = visible - - def setShowCustomKwKeys(self, visible): - self._show_custom_kw_keys = visible diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/plot_case_model.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/plot_case_model.py deleted file mode 100644 index bc1029cfc1..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/plot_case_model.py +++ /dev/null @@ -1,69 +0,0 @@ -from PyQt4.QtCore import QAbstractItemModel, QModelIndex, Qt, QVariant - -from ert_gui.ertwidgets.models.ertmodel import getAllCasesNotRunning - - -class PlotCaseModel(QAbstractItemModel): - - def __init__(self): - QAbstractItemModel.__init__(self) - self.__data = None - - def index(self, row, column, parent=None, *args, **kwargs): - return self.createIndex(row, column, parent) - - def parent(self, index=None): - return QModelIndex() - - def rowCount(self, parent=None, *args, **kwargs): - items = self.getAllItems() - return len(items) - - def columnCount(self, QModelIndex_parent=None, *args, **kwargs): - return 1 - - - def data(self, index, role=None): - assert isinstance(index, QModelIndex) - - if index.isValid(): - items = self.getAllItems() - row = index.row() - item = items[row] - - if role == Qt.DisplayRole: - return item - - return QVariant() - - def itemAt(self, index): - assert isinstance(index, QModelIndex) - - if index.isValid(): - row = index.row() - return self.getAllItems()[row] - - return None - - - def getAllItems(self): - if self.__data is None: - self.__data = getAllCasesNotRunning() - - return self.__data - - def __iter__(self): - cur = 0 - while cur < self.rowCount(): - yield self.itemAt(self.index(cur, 0)) - cur += 1 - - - - - - - - - - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/plot_case_selection_widget.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/plot_case_selection_widget.py deleted file mode 100644 index 6942795949..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/plot_case_selection_widget.py +++ /dev/null @@ -1,119 +0,0 @@ -from PyQt4.QtCore import pyqtSignal, QSignalMapper, Qt -from PyQt4.QtGui import QWidget, QVBoxLayout, QHBoxLayout, QToolButton, QComboBox - -from ert_gui.ertwidgets import resourceIcon -from ert_gui.tools.plot import PlotCaseModel - - -class CaseSelectionWidget(QWidget): - - caseSelectionChanged = pyqtSignal() - - def __init__(self, current_case): - QWidget.__init__(self) - - self.__model = PlotCaseModel() - - self.__signal_mapper = QSignalMapper(self) - self.__case_selectors = {} - self.__case_selectors_order = [] - - layout = QVBoxLayout() - - add_button_layout = QHBoxLayout() - self.__add_case_button = QToolButton() - self.__add_case_button.setToolButtonStyle(Qt.ToolButtonTextBesideIcon) - self.__add_case_button.setText("Add case to plot") - self.__add_case_button.setIcon(resourceIcon("ide/small/add")) - self.__add_case_button.clicked.connect(self.addCaseSelector) - - add_button_layout.addStretch() - add_button_layout.addWidget(self.__add_case_button) - add_button_layout.addStretch() - - layout.addLayout(add_button_layout) - - self.__case_layout = QVBoxLayout() - self.__case_layout.setMargin(0) - layout.addLayout(self.__case_layout) - - self.addCaseSelector(disabled=True, current_case=current_case) - layout.addStretch() - - self.setLayout(layout) - - self.__signal_mapper.mapped[QWidget].connect(self.removeWidget) - - - def __caseName(self, widget): - """ @rtype: str """ - return str(self.__case_selectors[widget].currentText()) - - def getPlotCaseNames(self): - if self.__model.rowCount() == 0: - return [] - - return [self.__caseName(widget) for widget in self.__case_selectors_order] - - def checkCaseCount(self): - state = True - if len(self.__case_selectors_order) == 5: - state = False - - self.__add_case_button.setEnabled(state) - - - def addCaseSelector(self, disabled=False, current_case=None): - widget = QWidget() - - layout = QHBoxLayout() - layout.setMargin(0) - widget.setLayout(layout) - - combo = QComboBox() - combo.setSizeAdjustPolicy(QComboBox.AdjustToMinimumContentsLengthWithIcon) - combo.setMinimumContentsLength(20) - combo.setModel(self.__model) - - if current_case is not None: - index = 0 - for item in self.__model: - if item == current_case: - combo.setCurrentIndex(index) - break - index += 1 - - combo.currentIndexChanged.connect(self.caseSelectionChanged.emit) - - - - layout.addWidget(combo, 1) - - button = QToolButton() - button.setAutoRaise(True) - button.setDisabled(disabled) - button.setIcon(resourceIcon("ide/small/delete")) - button.clicked.connect(self.__signal_mapper.map) - - layout.addWidget(button) - - self.__case_selectors[widget] = combo - self.__case_selectors_order.append(widget) - self.__signal_mapper.setMapping(button, widget) - - self.__case_layout.addWidget(widget) - - self.checkCaseCount() - self.caseSelectionChanged.emit() - - - - def removeWidget(self, widget): - self.__case_layout.removeWidget(widget) - del self.__case_selectors[widget] - self.__case_selectors_order.remove(widget) - widget.setParent(None) - self.caseSelectionChanged.emit() - - self.checkCaseCount() - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/plot_tool.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/plot_tool.py deleted file mode 100644 index 6433919831..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/plot_tool.py +++ /dev/null @@ -1,14 +0,0 @@ -from ert_gui.ertwidgets import resourceIcon -from ert_gui.tools import Tool -from ert_gui.tools.plot import PlotWindow - - -class PlotTool(Tool): - def __init__(self): - super(PlotTool, self).__init__("Create Plot", "tools/plot", resourceIcon("ide/chart_curve_add")) - - def trigger(self): - plot_window = PlotWindow(self.parent()) - plot_window.show() - - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/plot_widget.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/plot_widget.py deleted file mode 100644 index b250eed2a0..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/plot_widget.py +++ /dev/null @@ -1,112 +0,0 @@ -import sys -import traceback - -from PyQt4.QtCore import Qt, pyqtSignal -from PyQt4.QtGui import QWidget, QVBoxLayout, QAction - -from matplotlib.figure import Figure -from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas, NavigationToolbar2QT - -from ert_gui.ertwidgets import resourceIcon - - -class CustomNavigationToolbar(NavigationToolbar2QT): - customizationTriggered = pyqtSignal() - - def __init__(self, canvas, parent, coordinates=True): - super(CustomNavigationToolbar, self).__init__(canvas, parent, coordinates) - - gear = resourceIcon("ide/cog_edit.png") - customize_action = QAction(gear, "Customize", self) - customize_action.setToolTip("Customize plot settings") - customize_action.triggered.connect(self.customizationTriggered) - - for action in self.actions(): - if str(action.text()).lower() == "subplots": - self.removeAction(action) - - if str(action.text()).lower() == "customize": - self.insertAction(action, customize_action) - self.removeAction(action) - break - - - -class PlotWidget(QWidget): - customizationTriggered = pyqtSignal() - - def __init__(self, name, plotFunction, plot_condition_function_list, plotContextFunction, parent=None): - QWidget.__init__(self, parent) - - self._name = name - self._plotFunction = plotFunction - self._plotContextFunction = plotContextFunction - self._plot_conditions = plot_condition_function_list - """:type: list of functions """ - - self._figure = Figure() - self._figure.set_tight_layout(True) - self._canvas = FigureCanvas(self._figure) - self._canvas.setParent(self) - self._canvas.setFocusPolicy(Qt.StrongFocus) - self._canvas.setFocus() - - vbox = QVBoxLayout() - vbox.addWidget(self._canvas) - self._toolbar = CustomNavigationToolbar(self._canvas, self) - self._toolbar.customizationTriggered.connect(self.customizationTriggered) - vbox.addWidget(self._toolbar) - self.setLayout(vbox) - - self._dirty = True - self._active = False - self.resetPlot() - - - def getFigure(self): - """ :rtype: matplotlib.figure.Figure""" - return self._figure - - - def resetPlot(self): - self._figure.clear() - - @property - def name(self): - """ @rtype: str """ - return self._name - - def updatePlot(self): - if self.isDirty() and self.isActive(): - # print("Drawing: %s" % self._name) - self.resetPlot() - plot_context = self._plotContextFunction(self.getFigure()) - try: - self._plotFunction(plot_context) - self._canvas.draw() - except StandardError as e: - exc_type, exc_value, exc_tb = sys.exc_info() - sys.stderr.write("%s\n" % ("-" * 80)) - traceback.print_tb(exc_tb) - sys.stderr.write("Exception type: %s\n" % exc_type.__name__) - sys.stderr.write("%s\n" % e.message) - sys.stderr.write("%s\n" % ("-" * 80)) - sys.stderr.write("An error occurred during plotting. This stack trace is helpful for diagnosing the problem.") - - self.setDirty(False) - - - def setDirty(self, dirty=True): - self._dirty = dirty - - def isDirty(self): - return self._dirty - - def setActive(self, active=True): - self._active = active - - def isActive(self): - return self._active - - def canPlotKey(self, key): - return any([plotConditionFunction(key) for plotConditionFunction in self._plot_conditions]) diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/plot_window.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/plot_window.py deleted file mode 100644 index 66a4da77a1..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/plot_window.py +++ /dev/null @@ -1,199 +0,0 @@ -from PyQt4.QtCore import Qt -from PyQt4.QtGui import QMainWindow, QDockWidget, QTabWidget, QWidget, QVBoxLayout - -from ert_gui import ERT -from ert_gui.ertwidgets import showWaitCursorWhileWaiting -from ert_gui.ertwidgets.models.ertmodel import getCurrentCaseName -from ert_gui.plottery import PlotContext, PlotDataGatherer as PDG, PlotConfig, plots, PlotConfigFactory - -from ert_gui.tools.plot import DataTypeKeysWidget, CaseSelectionWidget, PlotWidget, DataTypeKeysListModel -from ert_gui.tools.plot.customize import PlotCustomizer - -CROSS_CASE_STATISTICS = "Cross Case Statistics" -DISTRIBUTION = "Distribution" -GAUSSIAN_KDE = "Gaussian KDE" -ENSEMBLE = "Ensemble" -HISTOGRAM = "Histogram" -STATISTICS = "Statistics" - -class PlotWindow(QMainWindow): - - - def __init__(self, parent): - QMainWindow.__init__(self, parent) - - self._ert = ERT.ert - """:type: ert.enkf.enkf_main.EnKFMain""" - - key_manager = self._ert.getKeyManager() - """:type: ert.enkf.key_manager.KeyManager """ - - self.setMinimumWidth(850) - self.setMinimumHeight(650) - - self.setWindowTitle("Plotting") - self.activateWindow() - - self._plot_customizer = PlotCustomizer(self, self._ert.plotConfig()) - - def plotConfigCreator(key): - return PlotConfigFactory.createPlotConfigForKey(self._ert, key) - - self._plot_customizer.setPlotConfigCreator(plotConfigCreator) - self._plot_customizer.settingsChanged.connect(self.keySelected) - - self._central_tab = QTabWidget() - self._central_tab.currentChanged.connect(self.currentPlotChanged) - - central_widget = QWidget() - central_layout = QVBoxLayout() - central_layout.setContentsMargins(0, 0, 0, 0) - central_widget.setLayout(central_layout) - - central_layout.addWidget(self._central_tab) - - self.setCentralWidget(central_widget) - - self._plot_widgets = [] - """:type: list of PlotWidget""" - - self._data_gatherers = [] - """:type: list of PlotDataGatherer """ - - summary_gatherer = self.createDataGatherer(PDG.gatherSummaryData, key_manager.isSummaryKey, refcaseGatherFunc=PDG.gatherSummaryRefcaseData, observationGatherFunc=PDG.gatherSummaryObservationData, historyGatherFunc=PDG.gatherSummaryHistoryData) - gen_data_gatherer = self.createDataGatherer(PDG.gatherGenDataData, key_manager.isGenDataKey, observationGatherFunc=PDG.gatherGenDataObservationData) - gen_kw_gatherer = self.createDataGatherer(PDG.gatherGenKwData, key_manager.isGenKwKey) - custom_kw_gatherer = self.createDataGatherer(PDG.gatherCustomKwData, key_manager.isCustomKwKey) - - - self.addPlotWidget(ENSEMBLE, plots.plotEnsemble, [summary_gatherer, gen_data_gatherer]) - self.addPlotWidget(STATISTICS, plots.plotStatistics, [summary_gatherer, gen_data_gatherer]) - self.addPlotWidget(HISTOGRAM, plots.plotHistogram, [gen_kw_gatherer, custom_kw_gatherer]) - self.addPlotWidget(GAUSSIAN_KDE, plots.plotGaussianKDE, [gen_kw_gatherer, custom_kw_gatherer]) - self.addPlotWidget(DISTRIBUTION, plots.plotDistribution, [gen_kw_gatherer, custom_kw_gatherer]) - self.addPlotWidget(CROSS_CASE_STATISTICS, plots.plotCrossCaseStatistics, [gen_kw_gatherer, custom_kw_gatherer]) - - - data_types_key_model = DataTypeKeysListModel(self._ert) - - self._data_type_keys_widget = DataTypeKeysWidget(data_types_key_model) - self._data_type_keys_widget.dataTypeKeySelected.connect(self.keySelected) - self.addDock("Data types", self._data_type_keys_widget) - - current_case = getCurrentCaseName() - self._case_selection_widget = CaseSelectionWidget(current_case) - self._case_selection_widget.caseSelectionChanged.connect(self.keySelected) - self.addDock("Plot case", self._case_selection_widget) - - current_plot_widget = self._plot_widgets[self._central_tab.currentIndex()] - current_plot_widget.setActive() - self._data_type_keys_widget.selectDefault() - self._updateCustomizer(current_plot_widget) - - - - - def createDataGatherer(self, dataGatherFunc, gatherConditionFunc, refcaseGatherFunc=None, observationGatherFunc=None, historyGatherFunc=None): - data_gatherer = PDG(dataGatherFunc, gatherConditionFunc, refcaseGatherFunc=refcaseGatherFunc, observationGatherFunc=observationGatherFunc, historyGatherFunc=historyGatherFunc) - self._data_gatherers.append(data_gatherer) - return data_gatherer - - - def currentPlotChanged(self): - for plot_widget in self._plot_widgets: - plot_widget.setActive(False) - index = self._central_tab.indexOf(plot_widget) - - if index == self._central_tab.currentIndex() and plot_widget.canPlotKey(self.getSelectedKey()): - plot_widget.setActive() - self._updateCustomizer(plot_widget) - plot_widget.updatePlot() - - def _updateCustomizer(self, plot_widget): - """ @type plot_widget: PlotWidget """ - key = self.getSelectedKey() - key_manager = self._ert.getKeyManager() - - index_type = PlotContext.UNKNOWN_AXIS - - if key_manager.isGenDataKey(key): - index_type = PlotContext.INDEX_AXIS - elif key_manager.isSummaryKey(key): - index_type = PlotContext.DATE_AXIS - - x_axis_type = PlotContext.UNKNOWN_AXIS - y_axis_type = PlotContext.UNKNOWN_AXIS - - if plot_widget.name == ENSEMBLE: - x_axis_type = index_type - y_axis_type = PlotContext.VALUE_AXIS - elif plot_widget.name == STATISTICS: - x_axis_type = index_type - y_axis_type = PlotContext.VALUE_AXIS - elif plot_widget.name == DISTRIBUTION: - y_axis_type = PlotContext.VALUE_AXIS - elif plot_widget.name == CROSS_CASE_STATISTICS: - y_axis_type = PlotContext.VALUE_AXIS - elif plot_widget.name == HISTOGRAM: - x_axis_type = PlotContext.VALUE_AXIS - y_axis_type = PlotContext.COUNT_AXIS - elif plot_widget.name == GAUSSIAN_KDE: - x_axis_type = PlotContext.VALUE_AXIS - y_axis_type = PlotContext.DENSITY_AXIS - - self._plot_customizer.setAxisTypes(x_axis_type, y_axis_type) - - - def createPlotContext(self, figure): - key = self.getSelectedKey() - cases = self._case_selection_widget.getPlotCaseNames() - data_gatherer = self.getDataGathererForKey(key) - plot_config = PlotConfig.createCopy(self._plot_customizer.getPlotConfig()) - plot_config.setTitle(key) - return PlotContext(self._ert, figure, plot_config, cases, key, data_gatherer) - - def getDataGathererForKey(self, key): - """ @rtype: PlotDataGatherer """ - return next((data_gatherer for data_gatherer in self._data_gatherers if data_gatherer.canGatherDataForKey(key)), None) - - def getSelectedKey(self): - return str(self._data_type_keys_widget.getSelectedItem()) - - def addPlotWidget(self, name, plotFunction, data_gatherers, enabled=True): - plot_condition_function_list = [data_gatherer.canGatherDataForKey for data_gatherer in data_gatherers] - plot_widget = PlotWidget(name, plotFunction, plot_condition_function_list, self.createPlotContext) - plot_widget.customizationTriggered.connect(self.toggleCustomizeDialog) - - index = self._central_tab.addTab(plot_widget, name) - self._plot_widgets.append(plot_widget) - self._central_tab.setTabEnabled(index, enabled) - - - def addDock(self, name, widget, area=Qt.LeftDockWidgetArea, allowed_areas=Qt.AllDockWidgetAreas): - dock_widget = QDockWidget(name) - dock_widget.setObjectName("%sDock" % name) - dock_widget.setWidget(widget) - dock_widget.setAllowedAreas(allowed_areas) - dock_widget.setFeatures(QDockWidget.DockWidgetFloatable | QDockWidget.DockWidgetMovable) - - self.addDockWidget(area, dock_widget) - return dock_widget - - - @showWaitCursorWhileWaiting - def keySelected(self): - key = self.getSelectedKey() - self._plot_customizer.switchPlotConfigHistory(key) - - for plot_widget in self._plot_widgets: - plot_widget.setDirty() - index = self._central_tab.indexOf(plot_widget) - self._central_tab.setTabEnabled(index, plot_widget.canPlotKey(key)) - - for plot_widget in self._plot_widgets: - if plot_widget.canPlotKey(key): - plot_widget.updatePlot() - - - def toggleCustomizeDialog(self): - self._plot_customizer.toggleCustomizationDialog() diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/style_chooser.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/style_chooser.py deleted file mode 100644 index ae8743cbfa..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/style_chooser.py +++ /dev/null @@ -1,161 +0,0 @@ -from PyQt4.QtGui import QWidget, QHBoxLayout, QComboBox, QDoubleSpinBox, QLabel, QHBoxLayout - -from ert_gui.plottery import PlotStyle - - -STYLE_OFF = ("Off", None) -STYLE_AREA = ("Area", "#") -STYLE_SOLID = ("Solid", "-") -STYLE_DASHED = ("Dashed", "--") -STYLE_DOTTED = ("Dotted", ":") -STYLE_DASH_DOTTED = ("Dash Dotted", "-.") - -STYLESET_DEFAULT = 'default' -STYLESET_AREA = 'area' -STYLESET_TOGGLE = 'toggle_only' - -STYLES = { - STYLESET_DEFAULT: [STYLE_OFF, STYLE_SOLID, STYLE_DASHED, STYLE_DOTTED, STYLE_DASH_DOTTED], - STYLESET_AREA: [STYLE_OFF, STYLE_AREA, STYLE_SOLID, STYLE_DASHED, STYLE_DOTTED, STYLE_DASH_DOTTED], - STYLESET_TOGGLE: [STYLE_OFF, STYLE_SOLID] -} - -MARKER_OFF = ("Off", None) -MARKER_X = ("X", "x") -MARKER_CIRCLE = ("Circle", "o") -MARKER_POINT = ("Point", ".") -MARKER_PIXEL = ("Pixel", ",") -MARKER_PLUS = ("Plus", "+") -MARKER_STAR = ("Star", "*") -MARKER_DIAMOND = ("Diamond", "D") -MARKER_PENTAGON = ("Pentagon", "p") -MARKER_SQUARE = ("Square", "s") -MARKER_HLINE = ("H Line", "_") -MARKER_VLINE = ("V Line", "|") -MARKER_OCTAGON = ("Octagon", "8") -MARKER_HEXAGON1 = ("Hexagon 1", "h") -MARKER_HEXAGON2 = ("Hexagon 2", "H") - -MARKERS = [MARKER_OFF, MARKER_X, MARKER_CIRCLE, MARKER_POINT, MARKER_STAR, MARKER_DIAMOND, MARKER_PLUS, MARKER_PENTAGON, MARKER_SQUARE, MARKER_OCTAGON, MARKER_HEXAGON1, MARKER_HEXAGON2] - - -class StyleChooser(QWidget): - - def __init__(self, line_style_set=STYLESET_DEFAULT): - QWidget.__init__(self) - self._style = PlotStyle("StyleChooser Internal Style") - - self._styles = STYLES['default'] if not line_style_set in STYLES else STYLES[line_style_set] - - self.setMinimumWidth(140) - self.setMaximumHeight(25) - - layout = QHBoxLayout() - layout.setMargin(0) - layout.setSpacing(2) - - self.line_chooser = QComboBox() - self.line_chooser.setToolTip("Select line style.") - for style in self._styles: - self.line_chooser.addItem(*style) - - self.marker_chooser = QComboBox() - self.marker_chooser.setToolTip("Select marker style.") - for marker in MARKERS: - self.marker_chooser.addItem(*marker) - - self.thickness_spinner = QDoubleSpinBox() - self.thickness_spinner.setToolTip("Line thickness") - self.thickness_spinner.setMinimum(0.1) - self.thickness_spinner.setDecimals(1) - self.thickness_spinner.setSingleStep(0.1) - - self.size_spinner = QDoubleSpinBox() - self.size_spinner.setToolTip("Marker Size") - self.size_spinner.setMinimum(0.1) - self.size_spinner.setDecimals(1) - self.size_spinner.setSingleStep(0.1) - - # the text content of the spinner varies, but shouldn't push the control out of boundaries - self.line_chooser.setMinimumWidth(110) - layout.addWidget(self.line_chooser) - layout.addWidget(self.thickness_spinner) - layout.addWidget(self.marker_chooser) - layout.addWidget(self.size_spinner) - - self.setLayout(layout) - - self.line_chooser.currentIndexChanged.connect(self._updateStyle) - self.marker_chooser.currentIndexChanged.connect(self._updateStyle) - self.thickness_spinner.valueChanged.connect(self._updateStyle) - self.size_spinner.valueChanged.connect(self._updateStyle) - - self._updateLineStyleAndMarker(self._style.line_style, self._style.marker, self._style.width, self._style.size) - self._layout = layout - - def getItemSizes(self): - line_style_combo_width = self._layout.itemAt(0).sizeHint().width() - thickness_spinner_width = self._layout.itemAt(1).sizeHint().width() - marker_combo_width = self._layout.itemAt(2).sizeHint().width() - size_spinner_width = self._layout.itemAt(3).sizeHint().width() - return line_style_combo_width, thickness_spinner_width, marker_combo_width, size_spinner_width - - def _findLineStyleIndex(self, line_style): - for index, style in enumerate(self._styles): - if style[1] == line_style: - return index - elif style[1] is None and line_style == "": - return index - return -1 - - def _findMarkerStyleIndex(self, marker): - for index, style in enumerate(MARKERS): - if style[1] == marker: - return index - elif style[1] is None and marker == "": - return index - return -1 - - def _updateLineStyleAndMarker(self, line_style, marker, thickness, size): - self.line_chooser.setCurrentIndex(self._findLineStyleIndex(line_style)) - self.marker_chooser.setCurrentIndex(self._findMarkerStyleIndex(marker)) - self.thickness_spinner.setValue(thickness) - self.size_spinner.setValue(size) - - def _updateStyle(self): - self.marker_chooser.setEnabled(self.line_chooser.currentText() != "Area") - - line_style = self.line_chooser.itemData(self.line_chooser.currentIndex()) - marker_style = self.marker_chooser.itemData(self.marker_chooser.currentIndex()) - thickness = float(self.thickness_spinner.value()) - size = float(self.size_spinner.value()) - - self._style.line_style = str(line_style.toString()) - self._style.marker = str(marker_style.toString()) - self._style.width = thickness - self._style.size = size - - def setStyle(self, style): - """ @type style: PlotStyle """ - self._style.copyStyleFrom(style) - self._updateLineStyleAndMarker(style.line_style, style.marker, style.width, style.size) - - def getStyle(self): - """ @rtype: PlotStyle """ - style = PlotStyle("Generated Style from StyleChooser") - style.copyStyleFrom(self._style) - return style - - def createLabelLayout(self, layout=None): - if layout is None: - layout = QHBoxLayout() - - titles = ["Line Style", "Width", "Marker Style", "Size"] - sizes = self.getItemSizes() - for title, size in zip(titles, sizes): - label = QLabel(title) - label.setFixedWidth(size) - layout.addWidget(label) - - return layout - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/widgets/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/tools/plot/widgets/CMakeLists.txt deleted file mode 100644 index 7f823aff44..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/widgets/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - clearable_line_edit.py - custom_date_edit.py - copy_style_to_dialog.py -) - -add_python_package("python.ert_gui.tools.plot.widgets" ${PYTHON_INSTALL_PREFIX}/ert_gui/tools/plot/widgets "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/widgets/__init__.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/widgets/__init__.py deleted file mode 100644 index e00b98554a..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/widgets/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from ert_gui.tools.plot.widgets.copy_style_to_dialog import CopyStyleToDialog diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/widgets/clearable_line_edit.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/widgets/clearable_line_edit.py deleted file mode 100644 index 81d24eec9b..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/widgets/clearable_line_edit.py +++ /dev/null @@ -1,97 +0,0 @@ -from PyQt4.QtCore import QString, QSize, Qt -from PyQt4.QtGui import QPushButton, QColor, QLineEdit, QStyle - -from ert_gui.ertwidgets import resourceIcon - - -class ClearableLineEdit(QLineEdit): - passive_color = QColor(194, 194, 194) - - def __init__(self, placeholder="yyyy-mm-dd"): - QLineEdit.__init__(self) - - self._placeholder_text = placeholder - self._active_color = self.palette().color(self.foregroundRole()) - self._placeholder_active = False - - self._clear_button = QPushButton(self) - self._clear_button.setIcon(resourceIcon("remove_favorite.png")) - self._clear_button.setFlat(True) - self._clear_button.setFocusPolicy(Qt.NoFocus) - self._clear_button.setFixedSize(17, 17) - self._clear_button.setCursor(Qt.ArrowCursor) - - self._clear_button.clicked.connect(self.clearButtonClicked) - self._clear_button.setVisible(False) - - self.textChanged.connect(self.toggleClearButtonVisibility) - - self.showPlaceholder() - - - def toggleClearButtonVisibility(self): - self._clear_button.setVisible(len(str(self.text())) > 0 and not self._placeholder_active) - - def sizeHint(self): - size = QLineEdit.sizeHint(self) - return QSize(size.width() + self._clear_button.width() + 3, size.height()) - - def minimumSizeHint(self): - size = QLineEdit.minimumSizeHint(self) - return QSize(size.width() + self._clear_button.width() + 3, size.height()) - - def resizeEvent(self, event): - right = self.rect().right() - frame_width = self.style().pixelMetric(QStyle.PM_DefaultFrameWidth) - self._clear_button.move(right - frame_width - self._clear_button.width(), (self.height() - self._clear_button.height()) / 2) - QLineEdit.resizeEvent(self, event) - - def clearButtonClicked(self): - self.setText("") - - def showPlaceholder(self): - if not self._placeholder_active: - self._placeholder_active = True - QLineEdit.setText(self, self._placeholder_text) - palette = self.palette() - palette.setColor(self.foregroundRole(), self.passive_color) - self.setPalette(palette) - - def hidePlaceHolder(self): - if self._placeholder_active: - self._placeholder_active = False - QLineEdit.setText(self, "") - palette = self.palette() - palette.setColor(self.foregroundRole(), self._active_color) - self.setPalette(palette) - - def focusInEvent(self, focus_event): - QLineEdit.focusInEvent(self, focus_event) - self.hidePlaceHolder() - - def focusOutEvent(self, focus_event): - QLineEdit.focusOutEvent(self, focus_event) - if str(QLineEdit.text(self)) == "": - self.showPlaceholder() - - def keyPressEvent(self, key_event): - if key_event.key() == Qt.Key_Escape: - self.clear() - self.clearFocus() - key_event.accept() - - QLineEdit.keyPressEvent(self, key_event) - - def setText(self, string): - self.hidePlaceHolder() - - QLineEdit.setText(self, string) - - if len(str(string)) == 0 and not self.hasFocus(): - self.showPlaceholder() - - def text(self): - if self._placeholder_active: - return QString("") - else: - return QLineEdit.text(self) diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/widgets/copy_style_to_dialog.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/widgets/copy_style_to_dialog.py deleted file mode 100644 index 5a37c53a33..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/widgets/copy_style_to_dialog.py +++ /dev/null @@ -1,62 +0,0 @@ -from PyQt4.QtGui import QFormLayout, QWidget, QDialog, QPushButton, QHBoxLayout, QToolButton -from ert_gui.ertwidgets import CheckList, resourceIcon -from ert_gui.tools.plot import FilterPopup, FilterableKwListModel -from ert_gui import ERT - - -class CopyStyleToDialog(QDialog): - - def __init__(self, parent=None, current_key='', selectable_keys=[]): - QWidget.__init__(self, parent) - self.setMinimumWidth(450) - self.setMinimumHeight(200) - self._dynamic = False - self.setWindowTitle("Copy the style of {0} to other keys".format(current_key)) - self.activateWindow() - - layout = QFormLayout(self) - - self._ert = ERT.ert - """:type: ert.enkf.enkf_main.EnKFMain""" - - self.model = self._ert - - self._filter_popup = FilterPopup(self) - self._filter_popup.filterSettingsChanged.connect(self.filterSettingsChanged) - - filter_popup_button = QToolButton() - filter_popup_button.setIcon(resourceIcon("ide/cog_edit.png")) - filter_popup_button.clicked.connect(self._filter_popup.show) - - self._list_model = FilterableKwListModel(self._ert, selectable_keys) - self._list_model.unselectAll() - - self._cl = CheckList(self._list_model, custom_filter_button=filter_popup_button) - - layout.addWidget(self._cl) - - apply_button = QPushButton("Apply") - apply_button.clicked.connect(self.accept) - apply_button.setDefault(True) - - close_button = QPushButton("Close") - close_button.setToolTip("Hide this dialog") - close_button.clicked.connect(self.reject) - - button_layout = QHBoxLayout() - button_layout.addStretch() - button_layout.addWidget(apply_button) - button_layout.addWidget(close_button) - - layout.addRow(button_layout) - - - def getSelectedKeys(self): - return self._list_model.getSelectedItems() - - def filterSettingsChanged(self, item): - self._list_model.setShowSummaryKeys(item["summary"]) - self._list_model.setShowGenKWKeys(item["gen_kw"]) - self._list_model.setShowGenDataKeys(item["gen_data"]) - self._list_model.setShowCustomKwKeys(item["custom_kw"]) - self._cl.modelChanged() diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plot/widgets/custom_date_edit.py b/ThirdParty/Ert/python/python/ert_gui/tools/plot/widgets/custom_date_edit.py deleted file mode 100644 index 882a97ee36..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plot/widgets/custom_date_edit.py +++ /dev/null @@ -1,53 +0,0 @@ -import datetime - -from PyQt4.QtCore import QDate -from PyQt4.QtGui import QWidget, QHBoxLayout, QCalendarWidget, QToolButton, QMenu, QWidgetAction - -from ert_gui.ertwidgets import resourceIcon -from ert_gui.tools.plot.widgets.clearable_line_edit import ClearableLineEdit - -class CustomDateEdit(QWidget): - def __init__(self): - QWidget.__init__(self) - self._line_edit = ClearableLineEdit() - - self._calendar_button = QToolButton() - self._calendar_button.setPopupMode(QToolButton.InstantPopup) - self._calendar_button.setFixedSize(26, 26) - self._calendar_button.setAutoRaise(True) - self._calendar_button.setIcon(resourceIcon("calendar.png")) - self._calendar_button.setStyleSheet("QToolButton::menu-indicator { image: none; }") - - tool_menu = QMenu(self._calendar_button) - self._calendar_widget = QCalendarWidget(tool_menu) - action = QWidgetAction(tool_menu) - action.setDefaultWidget(self._calendar_widget) - tool_menu.addAction(action) - self._calendar_button.setMenu(tool_menu) - - layout = QHBoxLayout() - layout.setMargin(0) - layout.addWidget(self._line_edit) - layout.addWidget(self._calendar_button) - self.setLayout(layout) - - self._calendar_widget.activated.connect(self.setDate) - - def setDate(self, date): - if isinstance(date, datetime.date): - date = QDate(date.year, date.month, date.day) - - if date is not None and date.isValid(): - self._line_edit.setText(str(date.toString("yyyy-MM-dd"))) - else: - self._line_edit.setText("") - - - def date(self): - date_string = self._line_edit.text() - if len(str(date_string).strip()) > 0: - date = QDate.fromString(date_string, "yyyy-MM-dd") - if date.isValid(): - return datetime.date(date.year(), date.month(), date.day()) - - return None diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plugins/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/tools/plugins/CMakeLists.txt deleted file mode 100644 index 26ba15fee6..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plugins/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - plugin.py - plugin_handler.py - plugin_runner.py - plugins_tool.py - process_job_dialog.py -) - -add_python_package("python.ert_gui.tools.plugins" ${PYTHON_INSTALL_PREFIX}/ert_gui/tools/plugins "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plugins/__init__.py b/ThirdParty/Ert/python/python/ert_gui/tools/plugins/__init__.py deleted file mode 100644 index d3509c4f5d..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plugins/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from .process_job_dialog import ProcessJobDialog -from .plugin import Plugin -from .plugin_runner import PluginRunner -from .plugin_handler import PluginHandler -from .plugins_tool import PluginsTool diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plugins/plugin.py b/ThirdParty/Ert/python/python/ert_gui/tools/plugins/plugin.py deleted file mode 100644 index 1a4ee460b3..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plugins/plugin.py +++ /dev/null @@ -1,54 +0,0 @@ -from ert.job_queue import ErtScript, ErtPlugin, WorkflowJob - -class Plugin(object): - def __init__(self, ert, workflow_job): - """ - @type ert: ert.enkf.EnKFMain - @type workflow_job: WorkflowJob - """ - self.__ert = ert - self.__workflow_job = workflow_job - self.__parent_window = None - - script = self.__loadPlugin() - self.__name = script.getName() - self.__description = script.getDescription() - - - def __loadPlugin(self): - """ @rtype: ErtPlugin """ - script_obj = ErtScript.loadScriptFromFile(self.__workflow_job.getInternalScriptPath()) - script = script_obj(self.__ert) - return script - - def getName(self): - """ @rtype: str """ - return self.__name - - def getDescription(self): - """ @rtype: str """ - return self.__description - - def getArguments(self): - """ - Returns a list of arguments. Either from GUI or from arbitrary code. - If the user for example cancels in the GUI a CancelPluginException is raised. - @rtype: list """ - script = self.__loadPlugin() - return script.getArguments(self.__parent_window) - - - def setParentWindow(self, parent_window): - self.__parent_window = parent_window - - def getParentWindow(self): - """ @rtype: QWidget """ - return self.__parent_window - - def ert(self): - """ @rtype: ert.enkf.enkf_main.EnKFMain """ - return self.__ert - - def getWorkflowJob(self): - """ @rtype: WorkflowJob """ - return self.__workflow_job diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plugins/plugin_handler.py b/ThirdParty/Ert/python/python/ert_gui/tools/plugins/plugin_handler.py deleted file mode 100644 index 6622bfc79e..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plugins/plugin_handler.py +++ /dev/null @@ -1,37 +0,0 @@ -from ert.job_queue import WorkflowJob -from .plugin import Plugin - - -class PluginHandler(object): - - def __init__(self, ert, plugin_jobs, parent_window): - """ @type plugin_jobs: list of WorkflowJob """ - self.__ert = ert - self.__plugins = [] - - for job in plugin_jobs: - plugin = Plugin(self.__ert, job) - self.__plugins.append(plugin) - plugin.setParentWindow(parent_window) - - self.__plugins = sorted(self.__plugins, key=Plugin.getName) - - - def ert(self): - """ @rtype: ert.enkf.enkf_main.EnKFMain """ - return self.__ert - - def __iter__(self): - """ @rtype: Plugin """ - index = 0 - while index < len(self.__plugins): - yield self.__plugins[index] - index += 1 - - def __getitem__(self, index): - """ @rtype: Plugin """ - return self.__plugins[index] - - - def __len__(self): - return len(self.__plugins) diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plugins/plugin_runner.py b/ThirdParty/Ert/python/python/ert_gui/tools/plugins/plugin_runner.py deleted file mode 100644 index 44978a8999..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plugins/plugin_runner.py +++ /dev/null @@ -1,91 +0,0 @@ -from functools import partial -from threading import Thread -import time -from ert.job_queue.ert_plugin import CancelPluginException -from ert_gui.tools.plugins import Plugin, ProcessJobDialog -from ert.job_queue import WorkflowJob - -class PluginRunner(object): - def __init__(self, plugin): - """ - @type plugin: Plugin - """ - super(PluginRunner, self).__init__() - - self.__plugin = plugin - - self.__plugin_finished_callback = lambda : None - - self.__result = None - - def run(self): - try: - plugin = self.__plugin - - arguments = plugin.getArguments() - dialog = ProcessJobDialog(plugin.getName(), plugin.getParentWindow()) - - dialog.cancelConfirmed.connect(self.cancel) - - run_function = partial(self.__runWorkflowJob, plugin, arguments) - - workflow_job_thread = Thread(name="ert_gui_workflow_job_thread") - workflow_job_thread.setDaemon(True) - workflow_job_thread.run = run_function - workflow_job_thread.start() - - - poll_function = partial(self.__pollRunner, plugin, dialog) - - poll_thread = Thread(name="ert_gui_workflow_job_poll_thread") - poll_thread.setDaemon(True) - poll_thread.run = poll_function - poll_thread.start() - - dialog.show() - except CancelPluginException: - print("Plugin cancelled before execution!") - - def __runWorkflowJob(self, plugin, arguments): - workflow_job = plugin.getWorkflowJob() - self.__result = workflow_job.run(plugin.ert(), arguments) - - - def __pollRunner(self, plugin, dialog): - self.wait() - - details = "" - if self.__result is not None: - details = str(self.__result) - - if plugin.getWorkflowJob().hasFailed(): - dialog.presentError.emit("Job Failed!", "The job '%s' has failed while running!" % plugin.getName(), details) - dialog.disposeDialog.emit() - elif plugin.getWorkflowJob().isCancelled(): - dialog.presentInformation.emit("Job Cancelled!", "The job '%s' was cancelled successfully!" % plugin.getName(), details) - dialog.disposeDialog.emit() - else: - dialog.presentInformation.emit("Job Completed!", "The job '%s' was completed successfully!" % plugin.getName(), details) - dialog.disposeDialog.emit() - - self.__plugin_finished_callback() - - - def isRunning(self): - """ @rtype: bool """ - return self.__plugin.getWorkflowJob().isRunning() - - def isCancelled(self): - """ @rtype: bool """ - return self.__plugin.getWorkflowJob().isCancelled() - - def cancel(self): - if self.isRunning(): - self.__plugin.getWorkflowJob().cancel() - - def wait(self): - while self.isRunning(): - time.sleep(1) - - def setPluginFinishedCallback(self, callback): - self.__plugin_finished_callback = callback \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plugins/plugins_tool.py b/ThirdParty/Ert/python/python/ert_gui/tools/plugins/plugins_tool.py deleted file mode 100644 index 6f8ba2fa1d..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plugins/plugins_tool.py +++ /dev/null @@ -1,34 +0,0 @@ -from PyQt4.QtGui import QMenu - -from ert_gui import ERT -from ert_gui.ertwidgets import resourceIcon -from ert_gui.tools import Tool -from ert_gui.tools.plugins import PluginHandler, PluginRunner - - -class PluginsTool(Tool): - def __init__(self, plugin_handler): - """ - @type plugin_handler: PluginHandler - """ - enabled = len(plugin_handler) > 0 - super(PluginsTool, self).__init__("Plugins", "tools/plugins", resourceIcon("ide/plugin"), enabled, popup_menu=True) - - self.__plugins = {} - - menu = QMenu() - for plugin in plugin_handler: - plugin_runner = PluginRunner(plugin) - plugin_runner.setPluginFinishedCallback(self.trigger) - - self.__plugins[plugin] = plugin_runner - plugin_action = menu.addAction(plugin.getName()) - plugin_action.setToolTip(plugin.getDescription()) - plugin_action.triggered.connect(plugin_runner.run) - - self.getAction().setMenu(menu) - - - def trigger(self): - ERT.emitErtChange() # plugin may have added new cases. - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/plugins/process_job_dialog.py b/ThirdParty/Ert/python/python/ert_gui/tools/plugins/process_job_dialog.py deleted file mode 100644 index 1a80bdc62a..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/plugins/process_job_dialog.py +++ /dev/null @@ -1,121 +0,0 @@ -from PyQt4.QtCore import Qt, pyqtSignal, QSize -from PyQt4.QtGui import QDialog, QVBoxLayout, QLayout, QPushButton, QHBoxLayout, QWidget, QLabel, QMessageBox, QSizePolicy, QSpacerItem - -from ert_gui.ertwidgets import resourceMovie - - -class ProcessJobDialog(QDialog): - - disposeDialog = pyqtSignal() - presentInformation = pyqtSignal(str, str, str) - presentError = pyqtSignal(str, str, str) - - closeButtonPressed = pyqtSignal() - cancelConfirmed = pyqtSignal() - - def __init__(self, title, parent=None): - QDialog.__init__(self, parent) - - self.__parent = parent - self.setWindowTitle(title) - self.setModal(True) - self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint) - self.setWindowFlags(self.windowFlags() & ~Qt.WindowCloseButtonHint) - self.setWindowFlags(self.windowFlags() & ~Qt.WindowCancelButtonHint) - - layout = QVBoxLayout() - layout.setSizeConstraint(QLayout.SetFixedSize) - - widget = QWidget() - widget_layout = QHBoxLayout() - - size = 64 - spin_movie = resourceMovie("ide/loading.gif") - spin_movie.setSpeed(60) - spin_movie.setScaledSize(QSize(size, size)) - spin_movie.start() - - processing_animation = QLabel() - processing_animation.setMaximumSize(QSize(size, size)) - processing_animation.setMinimumSize(QSize(size, size)) - processing_animation.setMovie(spin_movie) - widget_layout.addWidget(processing_animation) - - self.processing_label = QLabel("Processing job: '%s'" % title) - widget_layout.addWidget(self.processing_label, Qt.AlignBottom) - - widget.setLayout(widget_layout) - - layout.addWidget(widget) - - button_layout = QHBoxLayout() - self.close_button = QPushButton("Close") - self.close_button.clicked.connect(self.closeButtonPressed.emit) - button_layout.addStretch() - button_layout.addWidget(self.close_button) - - layout.addStretch() - layout.addLayout(button_layout) - - self.setLayout(layout) - - self.disposeDialog.connect(self.reject) - self.presentInformation.connect(self.__presentInformation) - self.presentError.connect(self.__presentError) - self.closeButtonPressed.connect(self.__confirmCancel) - - - def disableCloseButton(self): - self.close_button.setEnabled(False) - - def enableCloseButton(self): - self.close_button.setEnabled(True) - - def keyPressEvent(self, q_key_event): - if not self.close_button.isEnabled() and q_key_event.key() == Qt.Key_Escape: - pass - else: - QDialog.keyPressEvent(self, q_key_event) - - def closeEvent(self, close_event): - close_event.ignore() - self.closeButtonPressed.emit() - - def __createMsgBox(self, title, message, details): - msg_box = QMessageBox(self.parent()) - msg_box.setText(title) - msg_box.setInformativeText(message) - - if len(details) > 0: - msg_box.setDetailedText(details) - - horizontal_spacer = QSpacerItem(500, 0, QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) - layout = msg_box.layout() - layout.addItem(horizontal_spacer, layout.rowCount(), 0, 1, layout.columnCount()) - - return msg_box - - - def __presentInformation(self, title, message, details): - msg_box = self.__createMsgBox(title, message, details) - msg_box.setIcon(QMessageBox.Information) - - msg_box.exec_() - - def __presentError(self, title, message, details): - msg_box = self.__createMsgBox(title, message, details) - msg_box.setIcon(QMessageBox.Critical) - - msg_box.exec_() - - - def __confirmCancel(self): - cancel_box = self.__createMsgBox("Confirm Cancel", "Are you sure you want to cancel the running job?", "") - cancel_box.setIcon(QMessageBox.Question) - cancel_box.setStandardButtons(QMessageBox.Yes | QMessageBox.No) - cancel_box.exec_() - - cancel = cancel_box.result() - - if cancel == QMessageBox.Yes: - self.cancelConfirmed.emit() diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/run_analysis/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/tools/run_analysis/CMakeLists.txt deleted file mode 100644 index d1472f71cf..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/run_analysis/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - run_analysis_panel.py - run_analysis_tool.py -) - -add_python_package("python.ert_gui.tools.run_analysis" ${PYTHON_INSTALL_PREFIX}/ert_gui/tools/run_analysis "${PYTHON_SOURCES}" True) diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/run_analysis/__init__.py b/ThirdParty/Ert/python/python/ert_gui/tools/run_analysis/__init__.py deleted file mode 100644 index c4c65f4e2b..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/run_analysis/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .run_analysis_panel import RunAnalysisPanel -from .run_analysis_tool import RunAnalysisTool diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/run_analysis/run_analysis_panel.py b/ThirdParty/Ert/python/python/ert_gui/tools/run_analysis/run_analysis_panel.py deleted file mode 100644 index d4adc7f990..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/run_analysis/run_analysis_panel.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (C) 2016 Statoil ASA, Norway. -# -# The file 'run_analysis_panel.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from PyQt4.QtGui import QWidget, QFormLayout, QLineEdit - -from ert_gui.ertwidgets.analysismoduleselector import AnalysisModuleSelector -from ert_gui.ertwidgets.caseselector import CaseSelector - - -class RunAnalysisPanel(QWidget): - - def __init__(self): - QWidget.__init__(self) - - self.setWindowTitle("Run Analysis") - self.activateWindow() - - self.analysis_module = AnalysisModuleSelector(load_all = True, help_link = "config/analysis/analysis_module") - self.target_case_text = QLineEdit() - self.source_case_selector = CaseSelector(update_ert = False) - - layout = QFormLayout() - layout.addRow("Analysis", self.analysis_module) - layout.addRow("Target case", self.target_case_text) - layout.addRow("Source case", self.source_case_selector) - self.setLayout(layout) - - def target_case(self): - return str(self.target_case_text.text()) - - def source_case(self): - return str(self.source_case_selector.currentText()) - - def module(self): - return self.analysis_module.getSelectedAnalysisModuleName() diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/run_analysis/run_analysis_tool.py b/ThirdParty/Ert/python/python/ert_gui/tools/run_analysis/run_analysis_tool.py deleted file mode 100644 index 52c89c0f5b..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/run_analysis/run_analysis_tool.py +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright (C) 2016 Statoil ASA, Norway. -# -# The file 'run_analysis_tool.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from PyQt4.QtGui import QMessageBox - -from ert_gui import ERT -from ert.enkf import ESUpdate -from ert_gui.ertwidgets import resourceIcon -from ert_gui.ertwidgets.closabledialog import ClosableDialog -from ert_gui.tools import Tool -from ert_gui.tools.run_analysis import RunAnalysisPanel - - -class RunAnalysisTool(Tool): - def __init__(self): - super(RunAnalysisTool, self).__init__("Run Analysis", "tools/run_analysis", resourceIcon("ide/table_import")) - self._run_widget = None - self._dialog = None - self._selected_case_name = None - self.setVisible(False) - - - def trigger(self): - if self._run_widget is None: - self._run_widget = RunAnalysisPanel() - self._dialog = ClosableDialog("Run Analysis", self._run_widget, self.parent()) - self._dialog.addButton("Run", self.run) - self._dialog.exec_() - - def run(self): - target = self._run_widget.target_case() - source = self._run_widget.source_case() - - ert = ERT.ert - fs_manager = ert.getEnkfFsManager() - es_update = ESUpdate(ert) - - target_fs = fs_manager.getFileSystem(target) - source_fs = fs_manager.getFileSystem(source) - success = es_update.smootherUpdate( source_fs , target_fs ) - - if not success: - msg = QMessageBox() - msg.setIcon(QMessageBox.Warning) - msg.setWindowTitle("Run Analysis") - msg.setText("Unable to run analysis for case '%s'." % source) - msg.setStandardButtons(QMessageBox.Ok) - msg.exec_() - return - - ERT.ertChanged.emit() - self._dialog.accept() - - def toggleAdvancedMode(self, advanced_mode): - self.setVisible(advanced_mode) diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/tool.py b/ThirdParty/Ert/python/python/ert_gui/tools/tool.py deleted file mode 100644 index 67034a0efb..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/tool.py +++ /dev/null @@ -1,57 +0,0 @@ -from PyQt4.QtGui import QAction -from ert_gui.tools import HelpCenter - - -class Tool(object): - def __init__(self, name, help_link="", icon=None, enabled=True, checkable=False, popup_menu=False): - super(Tool, self).__init__() - self.__icon = icon - self.__name = name - self.__parent = None - self.__enabled = enabled - self.__checkable = checkable - self.__help_link = help_link - self.__is_popup_menu = popup_menu - - self.__action = QAction(self.getIcon(), self.getName(), None) - self.__action.setIconText(self.getName()) - self.__action.setEnabled(self.isEnabled()) - self.__action.setCheckable(checkable) - self.__action.triggered.connect(self.trigger) - - HelpCenter.addHelpToAction(self.__action, self.getHelpLink()) - - def getIcon(self): - return self.__icon - - def getName(self): - return self.__name - - def trigger(self): - raise NotImplementedError() - - def setParent(self, parent): - self.__parent = parent - self.__action.setParent(parent) - - def parent(self): - return self.__parent - - def isEnabled(self): - return self.__enabled - - def getHelpLink(self): - return self.__help_link - - - def getAction(self): - return self.__action - - def setVisible(self, visible): - self.__action.setVisible(visible) - - def setEnabled(self, enabled): - self.__action.setEnabled(enabled) - - def isPopupMenu(self): - return self.__is_popup_menu diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/workflows/CMakeLists.txt b/ThirdParty/Ert/python/python/ert_gui/tools/workflows/CMakeLists.txt deleted file mode 100644 index a042788db3..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/workflows/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - run_workflow_widget.py - workflow_dialog.py - workflows_tool.py -) - -add_python_package("python.ert_gui.tools.workflows" ${PYTHON_INSTALL_PREFIX}/ert_gui/tools/workflows "${PYTHON_SOURCES}" True) - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/workflows/__init__.py b/ThirdParty/Ert/python/python/ert_gui/tools/workflows/__init__.py deleted file mode 100644 index 5dd024d585..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/workflows/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .run_workflow_widget import RunWorkflowWidget -from .workflows_tool import WorkflowsTool \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/workflows/run_workflow_widget.py b/ThirdParty/Ert/python/python/ert_gui/tools/workflows/run_workflow_widget.py deleted file mode 100644 index 05f81ddccf..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/workflows/run_workflow_widget.py +++ /dev/null @@ -1,146 +0,0 @@ -import time -from threading import Thread - -from PyQt4.QtCore import QSize, Qt, pyqtSignal -from PyQt4.QtGui import QWidget, QHBoxLayout, QLabel, QToolButton, QMessageBox, QComboBox - -from ert_gui.ertwidgets import addHelpToWidget, resourceMovie, resourceIcon -from ert_gui.ertwidgets.models.ertmodel import getWorkflowNames, createWorkflowRunner -from ert_gui.tools.workflows.workflow_dialog import WorkflowDialog - - -class RunWorkflowWidget(QWidget): - - workflowSucceeded = pyqtSignal() - workflowFailed = pyqtSignal() - workflowKilled = pyqtSignal() - - def __init__(self): - QWidget.__init__(self) - - layout = QHBoxLayout() - layout.addSpacing(10) - - - self._workflow_combo = QComboBox() - addHelpToWidget(self._workflow_combo, "run/workflow") - - self._workflow_combo.addItems(getWorkflowNames()) - - layout.addWidget(QLabel("Select Workflow:"), 0, Qt.AlignVCenter) - layout.addWidget(self._workflow_combo, 0, Qt.AlignVCenter) - - # simulation_mode_layout.addStretch() - layout.addSpacing(20) - - self.run_button = QToolButton() - self.run_button.setIconSize(QSize(32, 32)) - self.run_button.setText("Start Workflow") - self.run_button.setIcon(resourceIcon("ide/gear_in_play")) - self.run_button.clicked.connect(self.startWorkflow) - self.run_button.setToolButtonStyle(Qt.ToolButtonTextBesideIcon) - - layout.addWidget(self.run_button) - layout.addStretch(1) - - self.setLayout(layout) - - self._running_workflow_dialog = None - - self.workflowSucceeded.connect(self.workflowFinished) - self.workflowFailed.connect(self.workflowFinishedWithFail) - self.workflowKilled.connect(self.workflowStoppedByUser) - - self._workflow_runner = None - """:type: WorkflowRunner""" - - - def createSpinWidget(self): - widget = QWidget() - layout = QHBoxLayout() - - size = 64 - spin_movie = resourceMovie("ide/loading.gif") - spin_movie.setSpeed(60) - spin_movie.setScaledSize(QSize(size, size)) - spin_movie.start() - - processing_animation = QLabel() - processing_animation.setMaximumSize(QSize(size, size)) - processing_animation.setMinimumSize(QSize(size, size)) - processing_animation.setMovie(spin_movie) - layout.addWidget(processing_animation) - - processing_label = QLabel("Processing workflow '%s'" % self.getCurrentWorkflowName()) - layout.addWidget(processing_label, Qt.AlignBottom) - - widget.setLayout(layout) - - return widget - - - def cancelWorkflow(self): - if self._workflow_runner.isRunning(): - cancel = QMessageBox.question(self, "Confirm Cancel", "Are you sure you want to cancel the running workflow?", QMessageBox.Yes | QMessageBox.No) - - if cancel == QMessageBox.Yes: - self._workflow_runner.cancel() - self._running_workflow_dialog.disableCloseButton() - - def getCurrentWorkflowName(self): - index = self._workflow_combo.currentIndex() - return getWorkflowNames()[index] - - - def startWorkflow(self): - self._running_workflow_dialog = WorkflowDialog("Running Workflow", self.createSpinWidget(), self) - self._running_workflow_dialog.closeButtonPressed.connect(self.cancelWorkflow) - - workflow_thread = Thread(name="ert_gui_workflow_thread") - workflow_thread.setDaemon(True) - workflow_thread.run = self.runWorkflow - - self._workflow_runner = createWorkflowRunner(self.getCurrentWorkflowName()) - self._workflow_runner.run() - - workflow_thread.start() - - self._running_workflow_dialog.show() - - def runWorkflow(self): - while self._workflow_runner.isRunning(): - time.sleep(2) - - cancelled = self._workflow_runner.isCancelled() - - if cancelled: - self.workflowKilled.emit() - else: - success = self._workflow_runner.workflowResult() - - if not success: - self.workflowFailed.emit() - else: - self.workflowSucceeded.emit() - - def workflowFinished(self): - workflow_name = self.getCurrentWorkflowName() - QMessageBox.information(self, "Workflow completed!", "The workflow '%s' completed successfully!" % workflow_name) - self._running_workflow_dialog.accept() - self._running_workflow_dialog = None - - def workflowFinishedWithFail(self): - workflow_name = self.getCurrentWorkflowName() - - error = self._workflow_runner.workflowError() - - QMessageBox.critical(self, "Workflow failed!", "The workflow '%s' failed!\n\n%s" % (workflow_name, error)) - self._running_workflow_dialog.reject() - self._running_workflow_dialog = None - - def workflowStoppedByUser(self): - workflow_name = self.getCurrentWorkflowName() - QMessageBox.information(self, "Workflow killed!", "The workflow '%s' was killed successfully!" % workflow_name) - self._running_workflow_dialog.reject() - self._running_workflow_dialog = None - \ No newline at end of file diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/workflows/workflow_dialog.py b/ThirdParty/Ert/python/python/ert_gui/tools/workflows/workflow_dialog.py deleted file mode 100644 index 320eb8a9be..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/workflows/workflow_dialog.py +++ /dev/null @@ -1,46 +0,0 @@ -from PyQt4.QtCore import Qt, pyqtSignal -from PyQt4.QtGui import QDialog, QVBoxLayout, QLayout, QPushButton, QHBoxLayout - - -class WorkflowDialog(QDialog): - - closeButtonPressed = pyqtSignal() - - def __init__(self, title, widget, parent=None): - QDialog.__init__(self, parent) - - self.setWindowTitle(title) - self.setModal(True) - self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint) - self.setWindowFlags(self.windowFlags() & ~Qt.WindowCloseButtonHint) - self.setWindowFlags(self.windowFlags() & ~Qt.WindowCancelButtonHint) - - - layout = QVBoxLayout() - layout.setSizeConstraint(QLayout.SetFixedSize) # not resizable!!! - layout.addWidget(widget) - - button_layout = QHBoxLayout() - self.close_button = QPushButton("Close") - self.close_button.clicked.connect(self.closeButtonPressed.emit) - button_layout.addStretch() - button_layout.addWidget(self.close_button) - - layout.addStretch() - layout.addLayout(button_layout) - - self.setLayout(layout) - - - def disableCloseButton(self): - self.close_button.setEnabled(False) - - def enableCloseButton(self): - self.close_button.setEnabled(True) - - def keyPressEvent(self, q_key_event): - if not self.close_button.isEnabled() and q_key_event.key() == Qt.Key_Escape: - pass - else: - QDialog.keyPressEvent(self, q_key_event) - diff --git a/ThirdParty/Ert/python/python/ert_gui/tools/workflows/workflows_tool.py b/ThirdParty/Ert/python/python/ert_gui/tools/workflows/workflows_tool.py deleted file mode 100644 index 223d52584d..0000000000 --- a/ThirdParty/Ert/python/python/ert_gui/tools/workflows/workflows_tool.py +++ /dev/null @@ -1,20 +0,0 @@ -from ert_gui import ERT -from ert_gui.ertwidgets import resourceIcon -from ert_gui.ertwidgets.closabledialog import ClosableDialog -from ert_gui.ertwidgets.models.ertmodel import getWorkflowNames -from ert_gui.tools import Tool -from ert_gui.tools.workflows import RunWorkflowWidget - - -class WorkflowsTool(Tool): - def __init__(self): - enabled = len(getWorkflowNames()) > 0 - super(WorkflowsTool, self).__init__("Run Workflow", "tools/workflows", resourceIcon("ide/to_do_list_checked_1"), enabled) - - - def trigger(self): - run_workflow_widget = RunWorkflowWidget() - dialog = ClosableDialog("Run workflow", run_workflow_widget, self.parent()) - dialog.exec_() - ERT.emitErtChange() # workflow may have added new cases. - diff --git a/ThirdParty/Ert/python/python/test_env.py.in b/ThirdParty/Ert/python/python/test_env.py.in new file mode 100644 index 0000000000..9fd11ea156 --- /dev/null +++ b/ThirdParty/Ert/python/python/test_env.py.in @@ -0,0 +1,6 @@ +import os + +TESTDATA_ROOT = os.getenv("ERT_TEST_ROOT_PATH") or "${PROJECT_SOURCE_DIR}/test-data" +SOURCE_ROOT = "${PROJECT_SOURCE_DIR}" +BUILD_ROOT = "${PROJECT_BINARY_DIR}" + diff --git a/ThirdParty/Ert/python/tests/CMakeLists.txt b/ThirdParty/Ert/python/tests/CMakeLists.txt index c2e0f176a7..985fe07610 100644 --- a/ThirdParty/Ert/python/tests/CMakeLists.txt +++ b/ThirdParty/Ert/python/tests/CMakeLists.txt @@ -1,55 +1,16 @@ set(TEST_SOURCES __init__.py - ctest_import.py - ctest_run.py - import_tester.py ) -set(TEST_ROOT ${CMAKE_CURRENT_SOURCE_DIR}) -set(INSTALL_DIRECTORY ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX}) - add_python_package("python.tests" "${PYTHON_INSTALL_PREFIX}/tests" "${TEST_SOURCES}" False) +set(CTEST_PYTHONPATH ${PROJECT_BINARY_DIR}/${PYTHON_INSTALL_PREFIX}) -function (addPythonTest TEST_NAME TEST_CLASS) - set(oneValueArgs LABELS) - set(multiValueArgs ARGUMENTS ENVIRONMENT) - cmake_parse_arguments(TEST_OPTIONS "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - - add_test(NAME python.tests.${TEST_NAME} - WORKING_DIRECTORY ${INSTALL_DIRECTORY} - COMMAND tests/ctest_run.py ${INSTALL_DIRECTORY} ${TEST_CLASS} ${TEST_OPTIONS_ARGUMENTS}) - - if(TEST_OPTIONS_LABELS) - set_property(TEST python.tests.${TEST_NAME} PROPERTY LABELS "Python:${TEST_OPTIONS_LABELS}") - else() - set_property(TEST python.tests.${TEST_NAME} PROPERTY LABELS "Python") - endif() - - if(TEST_OPTIONS_ENVIRONMENT) - set_property(TEST python.tests.${TEST_NAME} PROPERTY ENVIRONMENT ${TEST_OPTIONS_ENVIRONMENT}) - endif() -endfunction(addPythonTest) - - -add_subdirectory(core) +add_subdirectory(geometry) +add_subdirectory(util) +add_subdirectory(ecl) +add_subdirectory(well) add_subdirectory(cwrap) -add_subdirectory(share) - -if(BUILD_ERT) - add_subdirectory(ert) - - add_test( NAME python.tests.ert.import - WORKING_DIRECTORY ${INSTALL_DIRECTORY} - COMMAND tests/ctest_import.py ${INSTALL_DIRECTORY} "ert") - - if (ERT_BUILD_GUI) - add_subdirectory(gui) - - add_test( NAME python.tests.ert_gui.import - WORKING_DIRECTORY ${INSTALL_DIRECTORY} - COMMAND tests/ctest_import.py ${INSTALL_DIRECTORY} "ert_gui") - endif() +add_subdirectory(global) -endif() diff --git a/ThirdParty/Ert/python/tests/core/CMakeLists.txt b/ThirdParty/Ert/python/tests/core/CMakeLists.txt deleted file mode 100644 index 79d2b16ce6..0000000000 --- a/ThirdParty/Ert/python/tests/core/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -set(TEST_SOURCES - __init__.py -) - -add_python_package("python.tests.core" ${PYTHON_INSTALL_PREFIX}/tests/core "${TEST_SOURCES}" False) - -add_subdirectory(geometry) -add_subdirectory(util) -add_subdirectory(ecl) -add_subdirectory(well) diff --git a/ThirdParty/Ert/python/tests/core/ecl/CMakeLists.txt b/ThirdParty/Ert/python/tests/core/ecl/CMakeLists.txt deleted file mode 100644 index 3067197906..0000000000 --- a/ThirdParty/Ert/python/tests/core/ecl/CMakeLists.txt +++ /dev/null @@ -1,85 +0,0 @@ -set(NFS_RUNPATH "" CACHE STRING "Disk area which is shared among cluster nodes and can be used as CWD for LSF/RSH jobs.") -set(RSH_SERVERS "" CACHE STRING "List of nodes which will be used to test the RSH driver") - -set(TEST_SOURCES - __init__.py - test_deprecation.py - test_removed.py - test_ecl_3dkw.py - test_ecl_file_statoil.py - test_ecl_file.py - test_ecl_init_file.py - test_ecl_restart_file.py - test_ecl_sum.py - test_ecl_sum_vector.py - test_fault_blocks.py - test_fault_blocks_statoil.py - test_faults.py - test_fortio.py - test_grdecl.py - test_grid.py - test_grid_statoil.py - test_indexed_read.py - test_ecl_kw_statoil.py - test_ecl_kw.py - test_kw_function.py - test_layer.py - test_legacy_ecl.py - test_npv.py - test_region.py - test_restart.py - test_rft.py - test_rft_statoil.py - test_rft_cell.py - test_statoil_faults.py - test_sum_statoil.py - test_ecl_util.py - test_ecl_cmp.py - test_sum.py - test_grav.py - test_geertsma.py -) - -add_python_package("python.tests.ecl" ${PYTHON_INSTALL_PREFIX}/tests/ecl "${TEST_SOURCES}" False) - -addPythonTest(ecl.ecl_grid ecl.test_grid.GridTest ) -addPythonTest(ecl.ecl_kw ecl.test_ecl_kw.KWTest) -addPythonTest(ecl.ecl_kw_function ecl.test_kw_function.KWFunctionTest) -addPythonTest(ecl.ecl_3dkw ecl.test_ecl_3dkw.Ecl3DKWTest ) -addPythonTest(ecl.legacy_ecl ecl.test_legacy_ecl.LegacyEclTest) -addPythonTest(ecl.ecl_rft ecl.test_rft.RFTTest) -addPythonTest(ecl.ecl_rft_cell ecl.test_rft_cell.RFTCellTest) -addPythonTest(ecl.ecl_sum2 ecl.test_sum.SumTest) -addPythonTest(ecl.layer ecl.test_layer.LayerTest ) -addPythonTest(ecl.faults ecl.test_faults.FaultTest ) -addPythonTest(ecl.fault_blocks ecl.test_fault_blocks.FaultBlockTest ) -addPythonTest(ecl.ecl_deprecation1.9 ecl.test_deprecation.Deprecation_1_9_Test ) -addPythonTest(ecl.ecl_deprecation2.0 ecl.test_deprecation.Deprecation_2_0_Test ) -addPythonTest(ecl.ecl_deprecation2.1 ecl.test_deprecation.Deprecation_2_1_Test ) -addPythonTest(ecl.ecl_removed2.1 ecl.test_removed.Removed_2_1_Test ) -addPythonTest(ecl.ecl_util ecl.test_ecl_util.EclUtilTest ) -addPythonTest(ecl.fortio ecl.test_fortio.FortIOTest) -addPythonTest(ecl.ecl_file ecl.test_ecl_file.EclFileTest) -addPythonTest(ecl.ecl_grav ecl.test_grav.EclGravTest) -addPythonTest(ecl.ecl_geertsma ecl.test_geertsma.GeertsmaTest) - - -if (STATOIL_TESTDATA_ROOT) - addPythonTest(ecl.ecl_file_statoil ecl.test_ecl_file_statoil.EclFileStatoilTest LABELS StatoilData) - addPythonTest(ecl.ecl_grdecl ecl.test_grdecl.GRDECLTest LABELS StatoilData) - addPythonTest(ecl.ecl_grid_statoil ecl.test_grid_statoil.GridTest LABELS StatoilData:Slow) - addPythonTest(ecl.ecl_kw_statoil ecl.test_ecl_kw_statoil.KWTest LABELS StatoilData) - addPythonTest(ecl.ecl_init_file ecl.test_ecl_init_file.InitFileTest LABELS StatoilData) - addPythonTest(ecl.ecl_restart_file ecl.test_ecl_restart_file.RestartFileTest LABELS StatoilData) - addPythonTest(ecl.ecl_restart ecl.test_restart.RestartTest LABELS StatoilData ) - addPythonTest(ecl.ecl_region ecl.test_region.RegionTest LABELS StatoilData) - addPythonTest(ecl.ecl_rft_statoil ecl.test_rft_statoil.RFTTest LABELS StatoilData) - addPythonTest(ecl.ecl_sum1 ecl.test_sum_statoil.SumTest LABELS StatoilData) - addPythonTest(ecl.ecl_sum_vector ecl.test_ecl_sum_vector.EclSumVectorTest LABELS StatoilData) - addPythonTest(ecl.ecl_sum_time_range ecl.test_ecl_sum.EclSumTest LABELS StatoilData) - addPythonTest(ecl.statoil_faults ecl.test_statoil_faults.StatoilFaultTest LABELS StatoilData) - addPythonTest(ecl.fault_blocks_statoil ecl.test_fault_blocks_statoil.FaultBlockTest LABELS StatoilData) - addPythonTest(ecl.ecl_npv ecl.test_npv.NPVTest LABELS StatoilData) - addPythonTest(ecl.indexed_read ecl.test_indexed_read.EclIndexedReadTest LABELS StatoilData) - addPythonTest(ecl.ecl_cmp ecl.test_ecl_cmp.EclCmpTest LABELS StatoilData) -endif() diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_deprecation.py b/ThirdParty/Ert/python/tests/core/ecl/test_deprecation.py deleted file mode 100644 index 712eab67be..0000000000 --- a/ThirdParty/Ert/python/tests/core/ecl/test_deprecation.py +++ /dev/null @@ -1,258 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'test_deprecation.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -import warnings -import time -import datetime - -from ert.test import ExtendedTestCase, TestAreaContext -from ert.ecl import EclFile,EclGrid,EclKW,EclTypeEnum,EclGrid,EclRegion,FortIO, openFortIO,EclRFT -from ert.ecl.ecl_case import EclCase -from ert.test.ecl_mock import createEclSum -from ert.util import BoolVector - -# The class Deprecation_1_9_Test contains methods which will be marked -# as deprecated in the 1.9.x versions. - -warnings.simplefilter("error" , DeprecationWarning) - - -class Deprecation_2_1_Test(ExtendedTestCase): - def test_ecl_kw_classprop(self): - with self.assertRaises(DeprecationWarning): - int_kw = EclKW.int_kw - - def test_ecl_kw_numpy_property(self): - kw = EclKW("TEST" , 10 , EclTypeEnum.ECL_INT_TYPE) - with self.assertRaises(DeprecationWarning): - n = kw.numpy_array - - def test_smspec_node_properties(self): - case = createEclSum("CSV" , [("FOPT", None , 0) , ("FOPR" , None , 0)]) - node = case.smspec_node( "FOPT" ) - - with self.assertRaises(DeprecationWarning): - node.is_total - - with self.assertRaises(DeprecationWarning): - node.is_rate - - with self.assertRaises(DeprecationWarning): - node.is_historical - - - -class Deprecation_2_0_Test(ExtendedTestCase): - def test_EclGrid_dims_property(self): - with self.assertRaises(DeprecationWarning): - grid = EclGrid.create_rectangular( (10,20,30) , (1,1,1) ) - - def test_EclFile_name_property(self): - with TestAreaContext("name") as t: - kw = EclKW("TEST", 3, EclTypeEnum.ECL_INT_TYPE) - with openFortIO("TEST" , mode = FortIO.WRITE_MODE) as f: - kw.fwrite( f ) - - t.sync() - - f = EclFile( "TEST" ) - with self.assertRaises(DeprecationWarning): - name = f.name - - def test_EclGrid_get_corner_xyz(self): - grid = EclGrid.createRectangular( (10,20,30) , (1,1,1) ) - with self.assertRaises(DeprecationWarning): - grid.get_corner_xyz(0 , global_index = 10) - - - def test_ecl_ecl_ecl(self): - with self.assertRaises(DeprecationWarning): - import ert.ecl.ecl as ecl - - - def test_ecl_kw_fortio_size_property(self): - kw = EclKW("KW" , 1000 , EclTypeEnum.ECL_INT_TYPE) - with self.assertRaises(DeprecationWarning): - kw.fortio_size - - - def test_ecl_kw_size_property(self): - kw = EclKW("KW" , 1000 , EclTypeEnum.ECL_INT_TYPE) - with self.assertRaises(DeprecationWarning): - kw.size - - - def test_ecl_kw_set_name(self): - kw = EclKW("KW" , 1000 , EclTypeEnum.ECL_INT_TYPE) - with self.assertRaises(DeprecationWarning): - kw.set_name("HEI") - - def test_ecl_kw_get_name(self): - kw = EclKW("KW" , 1000 , EclTypeEnum.ECL_INT_TYPE) - with self.assertRaises(DeprecationWarning): - kw.get_name( ) - - - def test_ecl_kw_create(self): - with self.assertRaises(DeprecationWarning): - kw = EclKW.create("KW" , 1000 , EclTypeEnum.ECL_INT_TYPE) - - - def test_ecl_kw_iget(self): - kw = EclKW("PORO" , 1000 , EclTypeEnum.ECL_FLOAT_TYPE) - with self.assertRaises(DeprecationWarning): - value = kw.iget( 100 ) - - - def test_ecl_kw_numeric_property(self): - kw = EclKW("PORO" , 1000 , EclTypeEnum.ECL_FLOAT_TYPE) - with self.assertRaises(DeprecationWarning): - kw.numeric - - - def test_ecl_kw_grdecl_load(self): - with TestAreaContext("ecl_kw/deprecate/grdecl_load"): - kw = EclKW("PORO" , 1000 , EclTypeEnum.ECL_FLOAT_TYPE) - with open("PORO.grdecl" , "w") as poro_file: - kw.write_grdecl( poro_file ) - - with open("PORO.grdecl") as poro_file: - with self.assertRaises(DeprecationWarning): - kw = EclKW.grdecl_load( poro_file , "PORO") - - - def test_ecl_grid_dual_property(self): - grid = EclGrid.createRectangular((10,20,30) , (1,1,1) ) - with self.assertRaises(DeprecationWarning): - grid.dual_grid - - - def test_ecl_grid_name(self): - grid = EclGrid.createRectangular((10,20,30) , (1,1,1) ) - with self.assertRaises(DeprecationWarning): - grid.name - - - def test_ecl_grid_dims_property(self): - grid = EclGrid.createRectangular((10,20,30) , (1,1,1) ) - with self.assertRaises(DeprecationWarning): - grid.nx - - with self.assertRaises(DeprecationWarning): - grid.ny - - with self.assertRaises(DeprecationWarning): - grid.nz - - with self.assertRaises(DeprecationWarning): - grid.size - - with self.assertRaises(DeprecationWarning): - grid.nactive - - def test_ecl_grid_num_lgr(self): - grid = EclGrid.createRectangular((10,20,30) , (1,1,1) ) - with self.assertRaises(DeprecationWarning): - grid.num_lgr - - - - def test_ecl_region_name(self): - grid = EclGrid.createRectangular((10,20,30) , (1,1,1) ) - region = EclRegion( grid , False ) - - with self.assertRaises(DeprecationWarning): - region.name = "NAME" - - with self.assertRaises(DeprecationWarning): - region.get_name( ) - - - def test_ecl_case( self ): - with self.assertRaises(DeprecationWarning): - case = EclCase( "CASE" ) - - - def test_rft(self): - rft = EclRFT("WELL" , "RFT" , datetime.date.today() , 100 ) - - # Property: type - with self.assertRaises(DeprecationWarning): - t = rft.type - - # Property: date - with self.assertRaises(DeprecationWarning): - d = rft.date - - # Property: well - with self.assertRaises(DeprecationWarning): - d = rft.date - - # Property: size - with self.assertRaises(DeprecationWarning): - d = rft.size - - def test_rft_file(self): - # These deprecations are not tested - but just recorded here. - # Property: num_wells - # Property: headers - pass - - - - -class Deprecation_1_9_Test(ExtendedTestCase): - - def test_EclGrid_dims_property(self): - grid = EclGrid.createRectangular( (10,20,30) , (1,1,1) ) - with self.assertRaises(DeprecationWarning): - d = grid.dims - - - def test_EclKW_min_max(self): - kw = EclKW("TEST", 3, EclTypeEnum.ECL_INT_TYPE) - with self.assertRaises(DeprecationWarning): - kw.min - - with self.assertRaises(DeprecationWarning): - kw.max - - with self.assertRaises(DeprecationWarning): - kw.min_max - - def test_EclRegion_properties(self): - grid = EclGrid.createRectangular( (10,10,10) , (1,1,1)) - region = EclRegion( grid , False ) - - with self.assertRaises(DeprecationWarning): - region.active_size - - with self.assertRaises(DeprecationWarning): - region.global_size - - with self.assertRaises(DeprecationWarning): - region.global_list - - with self.assertRaises(DeprecationWarning): - region.active_list - - - def test_BoolVector_active_mask(self): - with self.assertRaises(DeprecationWarning): - active_vector = BoolVector.active_mask("1,1,1,1,1,1") - - - diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_file_statoil.py b/ThirdParty/Ert/python/tests/core/ecl/test_ecl_file_statoil.py deleted file mode 100644 index 49d426f173..0000000000 --- a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_file_statoil.py +++ /dev/null @@ -1,155 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'sum_test.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -import datetime -import os.path -from unittest import skipIf - -from ert.ecl import EclFile, FortIO, EclKW , openFortIO , openEclFile -from ert.ecl import EclFileFlagEnum, EclTypeEnum, EclFileEnum - -from ert.test import ExtendedTestCase , TestAreaContext - - - - -class EclFileStatoilTest(ExtendedTestCase): - def setUp(self): - self.test_file = self.createTestPath("Statoil/ECLIPSE/Gurbat/ECLIPSE.UNRST") - self.test_fmt_file = self.createTestPath("Statoil/ECLIPSE/Gurbat/ECLIPSE.FUNRST") - - def assertFileType(self , filename , expected): - file_type , step , fmt_file = EclFile.getFileType(filename) - self.assertEqual( file_type , expected[0] ) - self.assertEqual( fmt_file , expected[1] ) - self.assertEqual( step , expected[2] ) - - - - def test_restart_days(self): - rst_file = EclFile( self.test_file ) - self.assertAlmostEqual( 0.0 , rst_file.iget_restart_sim_days(0) ) - self.assertAlmostEqual( 31.0 , rst_file.iget_restart_sim_days(1) ) - self.assertAlmostEqual( 274.0 , rst_file.iget_restart_sim_days(10) ) - - with self.assertRaises(KeyError): - rst_file.restart_get_kw("Missing" , dtime = datetime.date( 2004,1,1)) - - with self.assertRaises(IndexError): - rst_file.restart_get_kw("SWAT" , dtime = datetime.date( 1985 , 1 , 1)) - - - - def test_iget_named(self): - f = EclFile(self.test_file) - N = f.num_named_kw( "SWAT" ) - with self.assertRaises(IndexError): - s = f.iget_named_kw( "SWAT" , N + 1) - - - - def test_fwrite( self ): - #work_area = TestArea("python/ecl_file/fwrite") - with TestAreaContext("python/ecl_file/fwrite"): - rst_file = EclFile(self.test_file) - fortio = FortIO("ECLIPSE.UNRST", FortIO.WRITE_MODE) - rst_file.fwrite(fortio) - fortio.close() - rst_file.close() - self.assertFilesAreEqual("ECLIPSE.UNRST", self.test_file) - - - - - @skipIf(ExtendedTestCase.slowTestShouldNotRun(), "Slow file test skipped!") - def test_save(self): - #work_area = TestArea("python/ecl_file/save") - with TestAreaContext("python/ecl_file/save", store_area=False) as work_area: - work_area.copy_file(self.test_file) - rst_file = EclFile("ECLIPSE.UNRST", flags=EclFileFlagEnum.ECL_FILE_WRITABLE) - swat0 = rst_file["SWAT"][0] - swat0.assign(0.75) - rst_file.save_kw(swat0) - rst_file.close() - self.assertFilesAreNotEqual("ECLIPSE.UNRST",self.test_file) - - rst_file1 = EclFile(self.test_file) - rst_file2 = EclFile("ECLIPSE.UNRST", flags=EclFileFlagEnum.ECL_FILE_WRITABLE) - - swat1 = rst_file1["SWAT"][0] - swat2 = rst_file2["SWAT"][0] - swat2.assign(swat1) - - rst_file2.save_kw(swat2) - self.assertTrue(swat1.equal(swat2)) - rst_file1.close() - rst_file2.close() - - # Random failure .... - self.assertFilesAreEqual("ECLIPSE.UNRST", self.test_file) - - - - @skipIf(ExtendedTestCase.slowTestShouldNotRun(), "Slow file test skipped!") - def test_save_fmt(self): - #work_area = TestArea("python/ecl_file/save_fmt") - with TestAreaContext("python/ecl_file/save_fmt") as work_area: - work_area.copy_file(self.test_fmt_file) - rst_file = EclFile("ECLIPSE.FUNRST", flags=EclFileFlagEnum.ECL_FILE_WRITABLE) - swat0 = rst_file["SWAT"][0] - swat0.assign(0.75) - rst_file.save_kw(swat0) - rst_file.close() - self.assertFilesAreNotEqual("ECLIPSE.FUNRST", self.test_fmt_file) - - rst_file1 = EclFile(self.test_fmt_file) - rst_file2 = EclFile("ECLIPSE.FUNRST", flags=EclFileFlagEnum.ECL_FILE_WRITABLE) - - swat1 = rst_file1["SWAT"][0] - swat2 = rst_file2["SWAT"][0] - - swat2.assign(swat1) - rst_file2.save_kw(swat2) - self.assertTrue(swat1.equal(swat2)) - rst_file1.close() - rst_file2.close() - - # Random failure .... - self.assertFilesAreEqual("ECLIPSE.FUNRST", self.test_fmt_file) - - - def test_truncated(self): - with TestAreaContext("python/ecl_file/truncated") as work_area: - work_area.copy_file(self.test_file) - size = os.path.getsize("ECLIPSE.UNRST") - with open("ECLIPSE.UNRST" , "r+") as f: - f.truncate( size / 2 ) - - with self.assertRaises(IOError): - rst_file = EclFile("ECLIPSE.UNRST") - - with self.assertRaises(IOError): - rst_file = EclFile("ECLIPSE.UNRST", flags=EclFileFlagEnum.ECL_FILE_WRITABLE) - - def test_restart_view(self): - f = EclFile( self.test_file ) - with self.assertRaises(ValueError): - v = f.restartView( ) - - v = f.restartView( sim_days = 274 ) - v = f.restartView( sim_time = datetime.date( 2004,1,1) ) - v = f.restartView( report_step = 30 ) - v = f.restartView( seqnum_index = 30 ) diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_grid.py b/ThirdParty/Ert/python/tests/core/ecl/test_grid.py deleted file mode 100644 index d41c1bbaa1..0000000000 --- a/ThirdParty/Ert/python/tests/core/ecl/test_grid.py +++ /dev/null @@ -1,245 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2014 Statoil ASA, Norway. -# -# The file 'test_grid.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -import os.path -from unittest import skipIf -import time - -from ert.util import IntVector -from ert.ecl import EclGrid,EclKW,EclTypeEnum, EclUnitTypeEnum, EclFile -from ert.ecl.faults import Layer , FaultCollection -from ert.test import ExtendedTestCase , TestAreaContext - - -# This test class should only have test cases which do not require -# external test data. Tests involving Statoil test data are in the -# test_grid_statoil module. - -class GridTest(ExtendedTestCase): - - def test_oom_grid(self): - nx = 2000 - ny = 2000 - nz = 2000 - - with self.assertRaises(MemoryError): - grid = EclGrid.createRectangular( (nx,ny,nz), (1,1,1)) - - - - def test_posXYEdge(self): - nx = 10 - ny = 11 - grid = EclGrid.createRectangular( (nx,ny,1) , (1,1,1) ) - self.assertEqual( grid.findCellCornerXY(0,0,0) , 0 ) - self.assertEqual( grid.findCellCornerXY(nx,0,0) , nx) - self.assertEqual( grid.findCellCornerXY(0 , ny , 0) , (nx + 1 ) * ny ) - self.assertEqual( grid.findCellCornerXY(nx,ny,0) , (nx + 1 ) * (ny + 1) - 1) - - self.assertEqual( grid.findCellCornerXY(0.25,0,0) , 0 ) - self.assertEqual( grid.findCellCornerXY(0,0.25,0) , 0 ) - - self.assertEqual( grid.findCellCornerXY(nx - 0.25,0,0) , nx ) - self.assertEqual( grid.findCellCornerXY(nx , 0.25,0) , nx ) - - self.assertEqual( grid.findCellCornerXY(0 , ny - 0.25, 0) , (nx + 1 ) * ny ) - self.assertEqual( grid.findCellCornerXY(0.25 , ny , 0) , (nx + 1 ) * ny ) - - self.assertEqual( grid.findCellCornerXY(nx -0.25 ,ny,0) , (nx + 1 ) * (ny + 1) - 1) - self.assertEqual( grid.findCellCornerXY(nx , ny - 0.25,0) , (nx + 1 ) * (ny + 1) - 1) - - - def test_dims(self): - grid = EclGrid.createRectangular( (10,20,30) , (1,1,1) ) - self.assertEqual( grid.getNX() , 10 ) - self.assertEqual( grid.getNY() , 20 ) - self.assertEqual( grid.getNZ() , 30 ) - self.assertEqual( grid.getGlobalSize() , 30*10*20 ) - - self.assertEqual( grid.getDims() , (10,20,30,6000) ) - - - - def test_create(self): - with self.assertRaises(ValueError): - grid = EclGrid.createRectangular( (10,20,30) , (1,1,1) , actnum = [0,1,1,2]) - - with self.assertRaises(ValueError): - grid = EclGrid.createRectangular( (10,20,30) , (1,1,1) , actnum = IntVector(initial_size = 10)) - - actnum = IntVector(default_value = 1 , initial_size = 6000) - actnum[0] = 0 - actnum[1] = 0 - grid = EclGrid.createRectangular( (10,20,30) , (1,1,1) , actnum = actnum) - self.assertEqual( grid.getNumActive( ) , 30*20*10 - 2) - - - - - def test_node_pos(self): - grid = EclGrid.createRectangular( (10,20,30) , (1,1,1) ) - with self.assertRaises(IndexError): - grid.getNodePos(-1,0,0) - - with self.assertRaises(IndexError): - grid.getNodePos(11,0,0) - - p0 = grid.getNodePos(0,0,0) - self.assertEqual( p0 , (0,0,0)) - - p7 = grid.getNodePos(10,20,30) - self.assertEqual( p7 , (10,20,30)) - - - def test_truncated_file(self): - grid = EclGrid.createRectangular( (10,20,30) , (1,1,1) ) - with TestAreaContext("python/ecl_grid/truncated"): - grid.save_EGRID( "TEST.EGRID") - - size = os.path.getsize( "TEST.EGRID") - with open("TEST.EGRID" , "r+") as f: - f.truncate( size / 2 ) - - with self.assertRaises(IOError): - EclGrid("TEST.EGRID") - - def test_posXY1(self): - nx = 4 - ny = 1 - nz = 1 - grid = EclGrid.createRectangular( (nx,ny,nz) , (1,1,1) ) - (i,j) = grid.findCellXY( 0.5 , 0.5, 0 ) - self.assertEqual(i , 0) - self.assertEqual(j , 0) - - (i,j) = grid.findCellXY( 3.5 , 0.5, 0 ) - self.assertEqual(i , 3) - self.assertEqual(j , 0) - - - def test_init_ACTNUM(self): - nx = 10 - ny = 23 - nz = 7 - grid = EclGrid.createRectangular( (nx,ny,nz) , (1,1,1) ) - actnum = grid.exportACTNUM() - - self.assertEqual( len(actnum) , nx*ny*nz ) - self.assertEqual( actnum[0] , 1 ) - self.assertEqual( actnum[nx*ny*nz - 1] , 1 ) - - actnum_kw = grid.exportACTNUMKw( ) - self.assertEqual(len(actnum_kw) , len(actnum)) - for a1,a2 in zip(actnum, actnum_kw): - self.assertEqual(a1, a2) - - - def test_posXY(self): - nx = 10 - ny = 23 - nz = 7 - grid = EclGrid.createRectangular( (nx,ny,nz) , (1,1,1) ) - with self.assertRaises(IndexError): - grid.findCellXY( 1 , 1, -1 ) - - with self.assertRaises(IndexError): - grid.findCellXY( 1 , 1, nz + 1 ) - - with self.assertRaises(ValueError): - grid.findCellXY(15 , 78 , 2) - - - i,j = grid.findCellXY( 1.5 , 1.5 , 2 ) - self.assertEqual(i , 1) - self.assertEqual(j , 1) - - - for i in range(nx): - for j in range(ny): - p = grid.findCellXY(i + 0.5 , j+ 0.5 , 0) - self.assertEqual( p[0] , i ) - self.assertEqual( p[1] , j ) - - c = grid.findCellCornerXY( 0.10 , 0.10 , 0 ) - self.assertEqual(c , 0) - - c = grid.findCellCornerXY( 0.90 , 0.90 , 0 ) - self.assertEqual( c , (nx + 1) + 1 ) - - c = grid.findCellCornerXY( 0.10 , 0.90 , 0 ) - self.assertEqual( c , (nx + 1) ) - - c = grid.findCellCornerXY( 0.90 , 0.90 , 0 ) - self.assertEqual( c , (nx + 1) + 1 ) - - c = grid.findCellCornerXY( 0.90 , 0.10 , 0 ) - self.assertEqual( c , 1 ) - - def test_compressed_copy(self): - nx = 10 - ny = 10 - nz = 10 - grid = EclGrid.createRectangular( (nx,ny,nz) , (1,1,1) ) - kw1 = EclKW.create("KW" , 1001 , EclTypeEnum.ECL_INT_TYPE ) - with self.assertRaises(ValueError): - cp = grid.compressedKWCopy( kw1 ) - - - def test_dxdydz(self): - nx = 10 - ny = 10 - nz = 10 - grid = EclGrid.createRectangular( (nx,ny,nz) , (2,3,4) ) - - (dx,dy,dz) = grid.getCellDims( active_index = 0 ) - self.assertEqual( dx , 2 ) - self.assertEqual( dy , 3 ) - self.assertEqual( dz , 4 ) - - def test_numpy3D(self): - nx = 10 - ny = 7 - nz = 5 - grid = EclGrid.createRectangular((nx,ny,nz) , (1,1,1)) - kw = EclKW( "SWAT" , nx*ny*nz , EclTypeEnum.ECL_FLOAT_TYPE ) - numpy_3d = grid.create3D( kw ) - - - def test_output_units(self): - n = 10 - a = 1 - grid = EclGrid.createRectangular( (n,n,n), (a,a,a)) - - with TestAreaContext("python/ecl_grid/units"): - grid.save_EGRID( "CASE.EGRID" , output_unit = EclUnitTypeEnum.ECL_FIELD_UNITS ) - f = EclFile("CASE.EGRID") - g = f["GRIDUNIT"][0] - self.assertEqual( g[0].strip( ) , "FEET" ) - g2 = EclGrid("CASE.EGRID") - self.assertFloatEqual( g2.cell_volume( global_index = 0 ) , 3.28084*3.28084*3.28084) - - - grid.save_EGRID( "CASE.EGRID" ) - f = EclFile("CASE.EGRID") - g = f["GRIDUNIT"][0] - self.assertEqual( g[0].strip( ) , "METRES" ) - - grid.save_EGRID( "CASE.EGRID" , output_unit = EclUnitTypeEnum.ECL_LAB_UNITS) - f = EclFile("CASE.EGRID") - g = f["GRIDUNIT"][0] - self.assertEqual( g[0].strip() , "CM" ) - g2 = EclGrid("CASE.EGRID") - self.assertFloatEqual( g2.cell_volume( global_index = 0 ) , 100*100*100 ) diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_legacy_ecl.py b/ThirdParty/Ert/python/tests/core/ecl/test_legacy_ecl.py deleted file mode 100644 index 1c9ffd6b8f..0000000000 --- a/ThirdParty/Ert/python/tests/core/ecl/test_legacy_ecl.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2013 Statoil ASA, Norway. -# -# This file is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -try: - from unittest2 import TestCase -except ImportError: - from unittest import TestCase - -from ert.ecl import EclTypeEnum, EclFileFlagEnum, EclPhaseEnum - -import ert.ecl.ecl as ecl -import ert.ecl as new_ecl - -class LegacyEclTest(TestCase): - - def test_classes(self): - self.assertEqual(ecl.EclSum, new_ecl.EclSum) - - self.assertEqual(ecl.EclRFTFile, new_ecl.EclRFTFile) - self.assertEqual(ecl.EclRFTCell, new_ecl.EclRFTCell) - self.assertEqual(ecl.EclPLTCell, new_ecl.EclPLTCell) - - self.assertEqual(ecl.EclKW, new_ecl.EclKW) - self.assertEqual(ecl.EclFile, new_ecl.EclFile) - - self.assertEqual(ecl.FortIO, new_ecl.FortIO) - - self.assertEqual(ecl.EclGrid, new_ecl.EclGrid) - - self.assertEqual(ecl.EclRegion, new_ecl.EclRegion) diff --git a/ThirdParty/Ert/python/tests/core/geometry/CMakeLists.txt b/ThirdParty/Ert/python/tests/core/geometry/CMakeLists.txt deleted file mode 100644 index 6fc11295d9..0000000000 --- a/ThirdParty/Ert/python/tests/core/geometry/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -set(TEST_SOURCES - __init__.py - test_convex_hull.py - test_cpolyline.py - test_cpolyline_collection.py - test_geometry_tools.py - test_intersection.py - test_point_in_polygon.py - test_polygon_slicing.py - test_polyline.py - test_surface.py -) - -add_python_package("python.tests.core.geometry" ${PYTHON_INSTALL_PREFIX}/tests/core/geometry "${TEST_SOURCES}" False) - -addPythonTest(core.geometry.surface tests.core.geometry.test_surface.SurfaceTest) -addPythonTest(core.geometry.polyline tests.core.geometry.test_polyline.PolylineTest) -addPythonTest(core.geometry.intersection tests.core.geometry.test_intersection.IntersectionTest) -addPythonTest(core.geometry.convex_hull tests.core.geometry.test_convex_hull.ConvexHullTest) -addPythonTest(core.geometry.point_in_polygon tests.core.geometry.test_point_in_polygon.PointInPolygonTest) -addPythonTest(core.geometry.polygon_slicing tests.core.geometry.test_polygon_slicing.PolygonSlicingTest) -addPythonTest(core.geometry.cpolyline tests.core.geometry.test_cpolyline.CPolylineTest) -addPythonTest(core.geometry.cpolyline_collection tests.core.geometry.test_cpolyline_collection.CPolylineCollectionTest) -addPythonTest(core.geometry.geometry_tools tests.core.geometry.test_geometry_tools.GeometryToolsTest ) diff --git a/ThirdParty/Ert/python/tests/core/geometry/__init__.py b/ThirdParty/Ert/python/tests/core/geometry/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/python/tests/core/util/CMakeLists.txt b/ThirdParty/Ert/python/tests/core/util/CMakeLists.txt deleted file mode 100644 index e90b279076..0000000000 --- a/ThirdParty/Ert/python/tests/core/util/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -set(TEST_SOURCES - __init__.py - test_ctime.py - test_cstring.py - test_hash.py - test_lookup_table.py - test_matrix.py - test_rng.py - test_stat.py - test_string_list.py - test_substitution_list.py - test_thread_pool.py - test_cthread_pool.py - test_ui_return.py - test_vectors.py - test_version.py - test_work_area.py - test_path_context.py - test_arg_pack.py - test_spawn.py -) - -add_python_package("python.tests.core.util" ${PYTHON_INSTALL_PREFIX}/tests/core/util "${TEST_SOURCES}" False) - -addPythonTest(core.util.ctime core.util.test_ctime.CTimeTest) -addPythonTest(core.util.cstring core.util.test_cstring.CStringTest) -addPythonTest(core.util.hash core.util.test_hash.HashTest) -addPythonTest(core.util.lookup_table core.util.test_lookup_table.LookupTableTest ) -addPythonTest(core.util.matrix core.util.test_matrix.MatrixTest ) -addPythonTest(core.util.rng core.util.test_rng.RngTest ) -addPythonTest(core.util.stat core.util.test_stat.StatTest ) -addPythonTest(core.util.stringlist core.util.test_string_list.StringListTest) -addPythonTest(core.util.tvector core.util.test_vectors.UtilTest) -addPythonTest(core.util.ui_return core.util.test_ui_return.UIReturnTest) -addPythonTest(core.util.work_area core.util.test_work_area.WorkAreaTest) -addPythonTest(core.util.version core.util.test_version.VersionTest) -addPythonTest(core.util.path_context core.util.test_path_context.PathContextTest) -addPythonTest(core.util.thread_pool core.util.test_thread_pool.ThreadPoolTest) -addPythonTest(core.util.cthread_pool core.util.test_cthread_pool.CThreadPoolTest) -addPythonTest(core.util.arg_pack core.util.test_arg_pack.ArgPackTest) -addPythonTest(core.util.spawn core.util.test_spawn.SpawnTest) diff --git a/ThirdParty/Ert/python/tests/core/util/__init__.py b/ThirdParty/Ert/python/tests/core/util/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/python/tests/core/well/CMakeLists.txt b/ThirdParty/Ert/python/tests/core/well/CMakeLists.txt deleted file mode 100644 index 381665920d..0000000000 --- a/ThirdParty/Ert/python/tests/core/well/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -set(TEST_SOURCES - __init__.py - test_ecl_well.py - test_ecl_well2.py - test_ecl_well3.py -) - -add_python_package("python.tests.core.well" ${PYTHON_INSTALL_PREFIX}/tests/core/well "${TEST_SOURCES}" False) - -if (STATOIL_TESTDATA_ROOT) - addPythonTest(core.well.ecl_well core.well.test_ecl_well.EclWellTest LABELS StatoilData) - addPythonTest(core.well.ecl_well2 core.well.test_ecl_well2.EclWellTest2 LABELS StatoilData) - addPythonTest(core.well.ecl_well3 core.well.test_ecl_well3.EclWellTest3 LABELS StatoilData) -endif() diff --git a/ThirdParty/Ert/python/tests/core/well/__init__.py b/ThirdParty/Ert/python/tests/core/well/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/python/tests/ctest_import.py b/ThirdParty/Ert/python/tests/ctest_import.py deleted file mode 100644 index c7892a0ec3..0000000000 --- a/ThirdParty/Ert/python/tests/ctest_import.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -PYTHONPATH = sys.argv[1] -sys.path.insert(0, PYTHONPATH) - -from import_tester import ImportTester - -package_name = sys.argv[2] -package_path = os.path.join(PYTHONPATH, package_name) - -if ImportTester.importRecursively(package_path, package_name): - sys.exit(0) -else: - sys.exit(1) diff --git a/ThirdParty/Ert/python/tests/ctest_run.py b/ThirdParty/Ert/python/tests/ctest_run.py deleted file mode 100644 index 1ab2bb37a6..0000000000 --- a/ThirdParty/Ert/python/tests/ctest_run.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -try: - from unittest2 import TextTestRunner -except ImportError: - from unittest import TextTestRunner - - -def runTestCase(tests, verbosity=0): - test_result = TextTestRunner(verbosity=verbosity).run(tests) - - if len(test_result.errors) or len(test_result.failures): - test_result.printErrors() - return False - else: - return True - - -if __name__ == '__main__': - TEST_PYTHONPATH = sys.argv[1] - os.environ["PYTHONPATH"] = TEST_PYTHONPATH + os.pathsep + os.getenv("PYTHONPATH", "") - for path_element in reversed(TEST_PYTHONPATH.split(os.pathsep)): - sys.path.insert(0, path_element) - - test_class_path = sys.argv[2] - argv = [] - - try: - argv = sys.argv[3:] - except IndexError: - pass - - from ert.test import ErtTestRunner - - tests = ErtTestRunner.getTestsFromTestClass(test_class_path, argv) - - # Set verbosity to 2 to see which test method in a class that fails. - if runTestCase(tests, verbosity=0): - sys.exit(0) - else: - sys.exit(1) diff --git a/ThirdParty/Ert/python/tests/cwrap/CMakeLists.txt b/ThirdParty/Ert/python/tests/cwrap/CMakeLists.txt index 0f9355a5c4..56200ef2d9 100644 --- a/ThirdParty/Ert/python/tests/cwrap/CMakeLists.txt +++ b/ThirdParty/Ert/python/tests/cwrap/CMakeLists.txt @@ -7,11 +7,11 @@ set(TEST_SOURCES test_cfile.py ) -add_python_package("python.tests.core.cwrap" ${PYTHON_INSTALL_PREFIX}/tests/core/cwrap "${TEST_SOURCES}" False) +add_python_package("python.tests.cwrap" ${PYTHON_INSTALL_PREFIX}/tests/cwrap "${TEST_SOURCES}" False) -addPythonTest(core.cwrap.basecclass tests.core.cwrap.test_basecclass.BaseCClassTest) -addPythonTest(core.cwrap.basecenum tests.core.cwrap.test_basecenum.BaseCEnumTest) -addPythonTest(core.cwrap.basecvalue tests.core.cwrap.test_basecvalue.BaseCValueTest) -addPythonTest(core.cwrap.metacwrap tests.core.cwrap.test_metawrap.MetaWrapTest) -addPythonTest(core.cwrap.cfile tests.core.cwrap.test_cfile.CFILETest) +addPythonTest(tests.cwrap.test_basecclass.BaseCClassTest) +addPythonTest(tests.cwrap.test_basecenum.BaseCEnumTest) +addPythonTest(tests.cwrap.test_basecvalue.BaseCValueTest) +addPythonTest(tests.cwrap.test_metawrap.MetaWrapTest) +addPythonTest(tests.cwrap.test_cfile.CFILETest) diff --git a/ThirdParty/Ert/python/tests/cwrap/test_basecclass.py b/ThirdParty/Ert/python/tests/cwrap/test_basecclass.py index 7670b41b0a..f2925d67b6 100644 --- a/ThirdParty/Ert/python/tests/cwrap/test_basecclass.py +++ b/ThirdParty/Ert/python/tests/cwrap/test_basecclass.py @@ -1,5 +1,5 @@ from cwrap import BaseCClass -from ert.test import ExtendedTestCase +from ecl.test import ExtendedTestCase class BaseCClassTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/cwrap/test_basecenum.py b/ThirdParty/Ert/python/tests/cwrap/test_basecenum.py index 9018be265b..b5f44efa95 100644 --- a/ThirdParty/Ert/python/tests/cwrap/test_basecenum.py +++ b/ThirdParty/Ert/python/tests/cwrap/test_basecenum.py @@ -1,5 +1,5 @@ from cwrap import BaseCEnum -from ert.test import ExtendedTestCase +from ecl.test import ExtendedTestCase diff --git a/ThirdParty/Ert/python/tests/cwrap/test_basecvalue.py b/ThirdParty/Ert/python/tests/cwrap/test_basecvalue.py index f0096c1a9f..6f2bb647d6 100644 --- a/ThirdParty/Ert/python/tests/cwrap/test_basecvalue.py +++ b/ThirdParty/Ert/python/tests/cwrap/test_basecvalue.py @@ -1,10 +1,10 @@ -import ert +import ecl from ctypes import c_ubyte, c_double from cwrap import BaseCValue, Prototype -from ert.test import ExtendedTestCase +from ecl.test import ExtendedTestCase class TestPrototype(Prototype): - lib = ert.load("libert_util") + lib = ecl.load("libert_util") def __init__(self, prototype): super(TestPrototype, self).__init__(self.lib, prototype) diff --git a/ThirdParty/Ert/python/tests/cwrap/test_cfile.py b/ThirdParty/Ert/python/tests/cwrap/test_cfile.py index e790cbb7f1..3fb5093a55 100644 --- a/ThirdParty/Ert/python/tests/cwrap/test_cfile.py +++ b/ThirdParty/Ert/python/tests/cwrap/test_cfile.py @@ -1,12 +1,12 @@ -import ert +import ecl from cwrap import Prototype, CFILE -from ert.test.extended_testcase import ExtendedTestCase -from ert.test.test_area import TestAreaContext +from ecl.test.extended_testcase import ExtendedTestCase +from ecl.test.test_area import TestAreaContext # Local copies so that the real ones don't get changed class TestUtilPrototype(Prototype): - lib = ert.load("libert_util") + lib = ecl.load("libert_util") def __init__(self, prototype, bind=False): super(TestUtilPrototype, self).__init__(TestUtilPrototype.lib, prototype, bind=bind) diff --git a/ThirdParty/Ert/python/tests/cwrap/test_metawrap.py b/ThirdParty/Ert/python/tests/cwrap/test_metawrap.py index d58f5a4a7e..2f9c5c2b90 100644 --- a/ThirdParty/Ert/python/tests/cwrap/test_metawrap.py +++ b/ThirdParty/Ert/python/tests/cwrap/test_metawrap.py @@ -1,14 +1,15 @@ +from __future__ import absolute_import, division, print_function, unicode_literals +from six import string_types import ctypes -from types import StringType, IntType -import ert +import ecl from cwrap import BaseCClass, Prototype, PrototypeError -from ert.test import ExtendedTestCase +from ecl.test import ExtendedTestCase # Local copies so that the real ones don't get changed class TestUtilPrototype(Prototype): - lib = ert.load("libert_util") + lib = ecl.load("libert_util") def __init__(self, prototype, bind=False): super(TestUtilPrototype, self).__init__(TestUtilPrototype.lib, prototype, bind=bind) @@ -33,13 +34,15 @@ class StringList(BaseCClass): if initial: for s in initial: - if isinstance(s, StringType): + if isinstance(s, bytes): + s.decode('ascii') + if isinstance(s, string_types): self.append(s) else: raise TypeError("Item: %s not a string" % s) def __getitem__(self, index): - if isinstance(index, IntType): + if isinstance(index, int): length = len(self) if index < 0: index += length @@ -51,7 +54,9 @@ class StringList(BaseCClass): raise TypeError("Index should be integer type") def append(self, string): - if isinstance(string, StringType): + if isinstance(string, bytes): + s.decode('ascii') + if isinstance(string, string_types): self._append(self, string) else: self._append(self, str(string)) @@ -109,10 +114,10 @@ class MetaWrapTest(ExtendedTestCase): char_ptr = ctypes.c_char_p(c_ptr) python_string = char_ptr.value TestUtilPrototype.lib.free(c_ptr) - return python_string + return python_string.decode('ascii') Prototype.registerType("string_obj", stringObj) dateStamp = TestUtilPrototype("string_obj util_alloc_date_stamp_utc()") date_stamp = dateStamp() - self.assertIsInstance(date_stamp, str) + self.assertIsInstance(date_stamp, string_types) diff --git a/ThirdParty/Ert/python/tests/ecl/CMakeLists.txt b/ThirdParty/Ert/python/tests/ecl/CMakeLists.txt new file mode 100644 index 0000000000..85a308d90e --- /dev/null +++ b/ThirdParty/Ert/python/tests/ecl/CMakeLists.txt @@ -0,0 +1,89 @@ +set(NFS_RUNPATH "" CACHE STRING "Disk area which is shared among cluster nodes and can be used as CWD for LSF/RSH jobs.") +set(RSH_SERVERS "" CACHE STRING "List of nodes which will be used to test the RSH driver") + +set(TEST_SOURCES + __init__.py + test_deprecation.py + test_removed.py + test_ecl_3dkw.py + test_ecl_file_statoil.py + test_ecl_file.py + test_ecl_init_file.py + test_ecl_restart_file.py + test_ecl_sum.py + test_ecl_sum_vector.py + test_fault_blocks.py + test_fault_blocks_statoil.py + test_faults.py + test_fortio.py + test_grdecl.py + test_grid.py + test_grid_statoil.py + test_indexed_read.py + test_ecl_kw_statoil.py + test_ecl_kw.py + test_kw_function.py + test_layer.py + test_npv.py + test_region.py + test_region_statoil.py + test_restart.py + test_rft.py + test_rft_statoil.py + test_rft_cell.py + test_statoil_faults.py + test_sum_statoil.py + test_ecl_util.py + test_ecl_cmp.py + test_sum.py + test_grav.py + test_geertsma.py + test_ecl_type.py + test_restart_head.py +) + +add_python_package("python.tests.ecl" ${PYTHON_INSTALL_PREFIX}/tests/ecl "${TEST_SOURCES}" False) + +addPythonTest(tests.ecl.test_grid.GridTest ) +addPythonTest(tests.ecl.test_ecl_kw.KWTest) +addPythonTest(tests.ecl.test_kw_function.KWFunctionTest) +addPythonTest(tests.ecl.test_ecl_3dkw.Ecl3DKWTest ) +addPythonTest(tests.ecl.test_rft.RFTTest) +addPythonTest(tests.ecl.test_rft_cell.RFTCellTest) +addPythonTest(tests.ecl.test_sum.SumTest) +addPythonTest(tests.ecl.test_layer.LayerTest ) +addPythonTest(tests.ecl.test_faults.FaultTest ) +addPythonTest(tests.ecl.test_fault_blocks.FaultBlockTest ) +addPythonTest(tests.ecl.test_deprecation.Deprecation_1_9_Test ) +addPythonTest(tests.ecl.test_deprecation.Deprecation_2_0_Test ) +addPythonTest(tests.ecl.test_deprecation.Deprecation_2_1_Test ) +addPythonTest(tests.ecl.test_removed.Removed_2_1_Test ) +addPythonTest(tests.ecl.test_ecl_util.EclUtilTest ) +addPythonTest(tests.ecl.test_fortio.FortIOTest) +addPythonTest(tests.ecl.test_ecl_file.EclFileTest) +addPythonTest(tests.ecl.test_grav.EclGravTest) +addPythonTest(tests.ecl.test_geertsma.GeertsmaTest) +addPythonTest(tests.ecl.test_ecl_type.EclDataTypeTest) +addPythonTest(tests.ecl.test_region.RegionTest) + + +if (STATOIL_TESTDATA_ROOT) + addPythonTest(tests.ecl.test_ecl_file_statoil.EclFileStatoilTest LABELS StatoilData) + addPythonTest(tests.ecl.test_grdecl.GRDECLTest LABELS StatoilData) + addPythonTest(tests.ecl.test_grid_statoil.GridTest LABELS StatoilData:Slow) + addPythonTest(tests.ecl.test_ecl_kw_statoil.KWTest LABELS StatoilData) + addPythonTest(tests.ecl.test_ecl_init_file.InitFileTest LABELS StatoilData) + addPythonTest(tests.ecl.test_ecl_restart_file.RestartFileTest LABELS StatoilData) + addPythonTest(tests.ecl.test_restart.RestartTest LABELS StatoilData ) + addPythonTest(tests.ecl.test_region_statoil.RegionTest LABELS StatoilData) + addPythonTest(tests.ecl.test_rft_statoil.RFTTest LABELS StatoilData) + addPythonTest(tests.ecl.test_sum_statoil.SumTest LABELS StatoilData) + addPythonTest(tests.ecl.test_ecl_sum_vector.EclSumVectorTest LABELS StatoilData) + addPythonTest(tests.ecl.test_ecl_sum.EclSumTest LABELS StatoilData) + addPythonTest(tests.ecl.test_statoil_faults.StatoilFaultTest LABELS StatoilData) + addPythonTest(tests.ecl.test_fault_blocks_statoil.FaultBlockTest LABELS StatoilData) + addPythonTest(tests.ecl.test_npv.NPVTest LABELS StatoilData) + addPythonTest(tests.ecl.test_indexed_read.EclIndexedReadTest LABELS StatoilData) + addPythonTest(tests.ecl.test_ecl_cmp.EclCmpTest LABELS StatoilData) + addPythonTest(tests.ecl.test_restart_head.RestartHeadTest LABELS StatoilData) +endif() diff --git a/ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/__init__.py b/ThirdParty/Ert/python/tests/ecl/__init__.py similarity index 100% rename from ThirdParty/Ert/python/python/ert_gui/ertwidgets/models/__init__.py rename to ThirdParty/Ert/python/tests/ecl/__init__.py diff --git a/ThirdParty/Ert/python/tests/ecl/test_deprecation.py b/ThirdParty/Ert/python/tests/ecl/test_deprecation.py new file mode 100644 index 0000000000..cd818abc5e --- /dev/null +++ b/ThirdParty/Ert/python/tests/ecl/test_deprecation.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python +# Copyright (C) 2011 Statoil ASA, Norway. +# +# The file 'test_deprecation.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT 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. +# +# ERT 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 +# for more details. +import warnings +import time +import datetime + +from ecl.test import ExtendedTestCase, TestAreaContext +from ecl.ecl import EclFile, EclGrid, EclKW, EclDataType, EclGrid, EclRegion +from ecl.ecl import FortIO, openFortIO, EclRFT, EclGridGenerator +from ecl.test.ecl_mock import createEclSum +from ecl.util import BoolVector + +# The class Deprecation_1_9_Test contains methods which will be marked +# as deprecated in the 1.9.x versions. + +warnings.simplefilter("error" , DeprecationWarning) + +class Deprecation_2_1_Test(ExtendedTestCase): + pass + +class Deprecation_2_0_Test(ExtendedTestCase): + + def test_EclFile_name_property(self): + with TestAreaContext("name") as t: + kw = EclKW("TEST", 3, EclDataType.ECL_INT) + with openFortIO("TEST" , mode = FortIO.WRITE_MODE) as f: + kw.fwrite( f ) + + t.sync() + f = EclFile( "TEST" ) + +class Deprecation_1_9_Test(ExtendedTestCase): + + def test_EclRegion_properties(self): + grid = EclGridGenerator.createRectangular( (10,10,10) , (1,1,1)) + region = EclRegion( grid , False ) diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_3dkw.py b/ThirdParty/Ert/python/tests/ecl/test_ecl_3dkw.py similarity index 82% rename from ThirdParty/Ert/python/tests/core/ecl/test_ecl_3dkw.py rename to ThirdParty/Ert/python/tests/ecl/test_ecl_3dkw.py index 5135dc5315..f6bdabb0c3 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_3dkw.py +++ b/ThirdParty/Ert/python/tests/ecl/test_ecl_3dkw.py @@ -17,9 +17,9 @@ import os import random -from ert.util import IntVector -from ert.ecl import Ecl3DKW , EclKW, EclTypeEnum, EclFile, FortIO, EclFileFlagEnum , EclGrid -from ert.test import ExtendedTestCase , TestAreaContext +from ecl.util import IntVector +from ecl.ecl import Ecl3DKW , EclKW, EclDataType, EclFile, FortIO, EclFileFlagEnum , EclGrid +from ecl.test import ExtendedTestCase , TestAreaContext @@ -31,7 +31,7 @@ class Ecl3DKWTest(ExtendedTestCase): actnum[i] = 0 grid = EclGrid.createRectangular( (10,10,10) , (1,1,1) , actnum = actnum) - kw = Ecl3DKW.create( "KW" , grid , EclTypeEnum.ECL_FLOAT_TYPE ) + kw = Ecl3DKW( "KW" , grid , EclDataType.ECL_FLOAT ) self.assertEqual( len(kw) , grid.getNumActive()) self.assertEqual( (10,10,10) , kw.dims() ) @@ -43,7 +43,7 @@ class Ecl3DKWTest(ExtendedTestCase): actnum[i] = 0 grid = EclGrid.createRectangular( (10,10,10) , (1,1,1) , actnum = actnum) - kw = Ecl3DKW.create( "KW" , grid , EclTypeEnum.ECL_FLOAT_TYPE , global_active = True) + kw = Ecl3DKW( "KW" , grid , EclDataType.ECL_FLOAT , global_active = True) self.assertEqual( len(kw) , grid.getGlobalSize()) kw.assign(50) @@ -58,7 +58,7 @@ class Ecl3DKWTest(ExtendedTestCase): ny = 11 nz = 12 grid = EclGrid.createRectangular( (nx,ny,nz) , (1,1,1) ) - kw = Ecl3DKW.create("REGIONS" , grid , EclTypeEnum.ECL_INT_TYPE , global_active = True) + kw = Ecl3DKW("REGIONS" , grid , EclDataType.ECL_INT , global_active = True) kw.assign(3) self.assertEqual( 3 * nx*ny*nz , sum(kw)) @@ -78,7 +78,7 @@ class Ecl3DKWTest(ExtendedTestCase): actnum[i] = 0 grid = EclGrid.createRectangular( (10,10,10) , (1,1,1) , actnum = actnum) - kw = Ecl3DKW.create( "KW" , grid , EclTypeEnum.ECL_FLOAT_TYPE , default_value = 77) + kw = Ecl3DKW( "KW" , grid , EclDataType.ECL_FLOAT , default_value = 77) with self.assertRaises(IndexError): kw[1000] @@ -105,7 +105,7 @@ class Ecl3DKWTest(ExtendedTestCase): actnum[i] = 0 grid = EclGrid.createRectangular( (10,10,10) , (1,1,1) , actnum = actnum) - kw = Ecl3DKW.create( "KW" , grid , EclTypeEnum.ECL_FLOAT_TYPE , default_value = 77) + kw = Ecl3DKW( "KW" , grid , EclDataType.ECL_FLOAT , default_value = 77) with self.assertRaises(IndexError): kw[1000] @@ -138,9 +138,9 @@ class Ecl3DKWTest(ExtendedTestCase): actnum[i] = 0 grid = EclGrid.createRectangular( (10,10,10) , (1,1,1) , actnum = actnum) - kw_wrong_size = EclKW.create( "KW" , 27 , EclTypeEnum.ECL_FLOAT_TYPE ) - kw_global_size = EclKW.create( "KW" , grid.getGlobalSize() , EclTypeEnum.ECL_FLOAT_TYPE ) - kw_active_size = EclKW.create( "KW" , grid.getNumActive() , EclTypeEnum.ECL_FLOAT_TYPE ) + kw_wrong_size = EclKW( "KW" , 27 , EclDataType.ECL_FLOAT ) + kw_global_size = EclKW( "KW" , grid.getGlobalSize() , EclDataType.ECL_FLOAT ) + kw_active_size = EclKW( "KW" , grid.getNumActive() , EclDataType.ECL_FLOAT ) with self.assertRaises(ValueError): Ecl3DKW.castFromKW(kw_wrong_size , grid) @@ -158,7 +158,7 @@ class Ecl3DKWTest(ExtendedTestCase): def test_default(self): grid = EclGrid.createRectangular( (10,10,10) , (1,1,1)) - kw = Ecl3DKW.create( "KW" , grid , EclTypeEnum.ECL_FLOAT_TYPE ) + kw = Ecl3DKW( "KW" , grid , EclDataType.ECL_FLOAT ) kw.setDefault(55) self.assertTrue( 55 , kw.getDefault()) @@ -169,7 +169,7 @@ class Ecl3DKWTest(ExtendedTestCase): actnum[2*i + 1] = 0 grid = EclGrid.createRectangular( (10,10,10) , (1,1,1) , actnum = actnum) - kw = Ecl3DKW.create( "KW" , grid , EclTypeEnum.ECL_INT_TYPE , global_active = True) + kw = Ecl3DKW( "KW" , grid , EclDataType.ECL_INT , global_active = True) for i in range(len(kw)): kw[i] = i @@ -188,7 +188,7 @@ class Ecl3DKWTest(ExtendedTestCase): actnum[2*i + 1] = 0 grid = EclGrid.createRectangular( (10,10,10) , (1,1,1) , actnum = actnum) - kw = Ecl3DKW.create( "KW" , grid , EclTypeEnum.ECL_INT_TYPE , global_active = False) + kw = Ecl3DKW( "KW" , grid , EclDataType.ECL_INT , global_active = False) for i in range(len(kw)): kw[i] = i diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_cmp.py b/ThirdParty/Ert/python/tests/ecl/test_ecl_cmp.py similarity index 94% rename from ThirdParty/Ert/python/tests/core/ecl/test_ecl_cmp.py rename to ThirdParty/Ert/python/tests/ecl/test_ecl_cmp.py index 0c2782f3d3..807c0b9ab0 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_cmp.py +++ b/ThirdParty/Ert/python/tests/ecl/test_ecl_cmp.py @@ -14,9 +14,9 @@ # See the GNU General Public License at # for more details. -from ert.test import ExtendedTestCase , TestAreaContext -from ert.test.ecl_mock import createEclSum -from ert.ecl import EclCmp +from ecl.test import ExtendedTestCase , TestAreaContext +from ecl.test.ecl_mock import createEclSum +from ecl.ecl import EclCmp class EclCmpTest(ExtendedTestCase): def setUp(self): diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_file.py b/ThirdParty/Ert/python/tests/ecl/test_ecl_file.py similarity index 77% rename from ThirdParty/Ert/python/tests/core/ecl/test_ecl_file.py rename to ThirdParty/Ert/python/tests/ecl/test_ecl_file.py index 2872cd52d1..66a70196eb 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_file.py +++ b/ThirdParty/Ert/python/tests/ecl/test_ecl_file.py @@ -1,18 +1,18 @@ #!/usr/bin/env python -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'sum_test.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 +# Copyright (C) 2011 Statoil ASA, Norway. +# +# The file 'sum_test.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT 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. +# +# ERT 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 # for more details. import datetime import os.path @@ -20,10 +20,10 @@ import gc from unittest import skipIf -from ert.ecl import EclFile, FortIO, EclKW , openFortIO , openEclFile -from ert.ecl import EclFileFlagEnum, EclTypeEnum, EclFileEnum +from ecl.ecl import EclFile, FortIO, EclKW , openFortIO , openEclFile +from ecl.ecl import EclFileFlagEnum, EclDataType, EclFileEnum -from ert.test import ExtendedTestCase , TestAreaContext +from ecl.test import ExtendedTestCase , TestAreaContext def createFile( name , kw_list ): with openFortIO(name , mode = FortIO.WRITE_MODE) as f: @@ -40,7 +40,7 @@ def loadKeywords( name ): return kw_list - + class EclFileTest(ExtendedTestCase): @@ -50,7 +50,7 @@ class EclFileTest(ExtendedTestCase): self.assertEqual( fmt_file , expected[1] ) self.assertEqual( step , expected[2] ) - + def test_file_type(self): self.assertFileType( "ECLIPSE.UNRST" , (EclFileEnum.ECL_UNIFIED_RESTART_FILE , False , None)) self.assertFileType( "ECLIPSE.X0030" , (EclFileEnum.ECL_RESTART_FILE , False , 30 )) @@ -59,7 +59,7 @@ class EclFileTest(ExtendedTestCase): self.assertFileType( "ECLIPSE.A0010" , (EclFileEnum.ECL_SUMMARY_FILE , True , 10 )) self.assertFileType( "ECLIPSE.EGRID" , (EclFileEnum.ECL_EGRID_FILE , False , None )) - + def test_IOError(self): with self.assertRaises(IOError): EclFile("No/Does/not/exist") @@ -67,8 +67,8 @@ class EclFileTest(ExtendedTestCase): def test_context( self ): with TestAreaContext("python/ecl_file/context"): - kw1 = EclKW.create( "KW1" , 100 , EclTypeEnum.ECL_INT_TYPE) - kw2 = EclKW.create( "KW2" , 100 , EclTypeEnum.ECL_INT_TYPE) + kw1 = EclKW( "KW1" , 100 , EclDataType.ECL_INT) + kw2 = EclKW( "KW2" , 100 , EclDataType.ECL_INT) with openFortIO("TEST" , mode = FortIO.WRITE_MODE) as f: kw1.fwrite( f ) kw2.fwrite( f ) @@ -77,13 +77,14 @@ class EclFileTest(ExtendedTestCase): self.assertEqual( len(ecl_file) , 2 ) self.assertTrue( ecl_file.has_kw("KW1")) self.assertTrue( ecl_file.has_kw("KW2")) + self.assertEqual(ecl_file[1], ecl_file[-1]) + + - - def test_gc(self): - kw1 = EclKW("KW1" , 100 , EclTypeEnum.ECL_INT_TYPE) - kw2 = EclKW("KW2" , 100 , EclTypeEnum.ECL_INT_TYPE) - kw3 = EclKW("KW3" , 100 , EclTypeEnum.ECL_INT_TYPE) + kw1 = EclKW("KW1" , 100 , EclDataType.ECL_INT) + kw2 = EclKW("KW2" , 100 , EclDataType.ECL_INT) + kw3 = EclKW("KW3" , 100 , EclDataType.ECL_INT) for i in range(len(kw1)): kw1[i] = i @@ -91,50 +92,58 @@ class EclFileTest(ExtendedTestCase): kw3[i] = 3*i kw_list = [kw1 , kw2 , kw2] - + with TestAreaContext("context") as ta: createFile("TEST" , kw_list ) - gc.collect() + gc.collect() kw_list2 = loadKeywords( "TEST" ) for kw1,kw2 in zip(kw_list,kw_list2): self.assertEqual( kw1, kw2 ) - + def test_block_view(self): with TestAreaContext("python/ecl_file/view"): with openFortIO("TEST" , mode = FortIO.WRITE_MODE) as f: for i in range(5): - header = EclKW("HEADER" , 1 , EclTypeEnum.ECL_INT_TYPE ) + header = EclKW("HEADER" , 1 , EclDataType.ECL_INT ) header[0] = i - - data1 = EclKW("DATA1" , 100 , EclTypeEnum.ECL_INT_TYPE ) + + data1 = EclKW("DATA1" , 100 , EclDataType.ECL_INT ) data1.assign( i ) - data2 = EclKW("DATA2" , 100 , EclTypeEnum.ECL_INT_TYPE ) + data2 = EclKW("DATA2" , 100 , EclDataType.ECL_INT ) data2.assign( i*10 ) header.fwrite( f ) data1.fwrite( f ) data2.fwrite( f ) - + ecl_file = EclFile("TEST") + pfx = 'EclFile(' + self.assertEqual(pfx, repr(ecl_file)[:len(pfx)]) with self.assertRaises(KeyError): ecl_file.blockView("NO" , 1) with self.assertRaises(IndexError): ecl_file.blockView("HEADER" , 100) + with self.assertRaises(IndexError): + ecl_file.blockView("HEADER" , 1000) + + bv = ecl_file.blockView("HEADER" , -1) + + for i in range(5): view = ecl_file.blockView("HEADER" , i) self.assertEqual( len(view) , 3) header = view["HEADER"][0] data1 = view["DATA1"][0] data2 = view["DATA2"][0] - + self.assertEqual( header[0] , i ) self.assertEqual( data1[99] , i ) self.assertEqual( data2[99] , i*10 ) @@ -145,7 +154,7 @@ class EclFileTest(ExtendedTestCase): self.assertEqual( len(view) , 2) header = view["HEADER"][0] data1 = view["DATA1"][0] - + self.assertEqual( header[0] , i ) self.assertEqual( data1[99] , i ) @@ -159,4 +168,3 @@ class EclFileTest(ExtendedTestCase): #self.assertTrue( "HEADER" in view ) #self.assertTrue( "DATA1" in view ) #self.assertFalse( "DATA2" in view ) - diff --git a/ThirdParty/Ert/python/tests/ecl/test_ecl_file_statoil.py b/ThirdParty/Ert/python/tests/ecl/test_ecl_file_statoil.py new file mode 100644 index 0000000000..5d13e0f913 --- /dev/null +++ b/ThirdParty/Ert/python/tests/ecl/test_ecl_file_statoil.py @@ -0,0 +1,258 @@ +#!/usr/bin/env python +# Copyright (C) 2011 Statoil ASA, Norway. +# +# The file 'sum_test.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT 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. +# +# ERT 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 +# for more details. +import datetime +import os.path +from unittest import skipIf + +from ecl.ecl import EclFile, FortIO, EclKW , openFortIO , openEclFile +from ecl.ecl import EclFileFlagEnum, EclFileEnum + +from ecl.test import ExtendedTestCase , TestAreaContext + + + + +class EclFileStatoilTest(ExtendedTestCase): + def setUp(self): + self.test_file = self.createTestPath("Statoil/ECLIPSE/Gurbat/ECLIPSE.UNRST") + self.test_fmt_file = self.createTestPath("Statoil/ECLIPSE/Gurbat/ECLIPSE.FUNRST") + + def assertFileType(self , filename , expected): + file_type , step , fmt_file = EclFile.getFileType(filename) + self.assertEqual( file_type , expected[0] ) + self.assertEqual( fmt_file , expected[1] ) + self.assertEqual( step , expected[2] ) + + + + def test_restart_days(self): + rst_file = EclFile( self.test_file ) + self.assertAlmostEqual( 0.0 , rst_file.iget_restart_sim_days(0) ) + self.assertAlmostEqual( 31.0 , rst_file.iget_restart_sim_days(1) ) + self.assertAlmostEqual( 274.0 , rst_file.iget_restart_sim_days(10) ) + + with self.assertRaises(KeyError): + rst_file.restart_get_kw("Missing" , dtime = datetime.date( 2004,1,1)) + + with self.assertRaises(IndexError): + rst_file.restart_get_kw("SWAT" , dtime = datetime.date( 1985 , 1 , 1)) + + + + def test_iget_named(self): + f = EclFile(self.test_file) + N = f.num_named_kw( "SWAT" ) + with self.assertRaises(IndexError): + s = f.iget_named_kw( "SWAT" , N + 1) + + + + def test_fwrite( self ): + #work_area = TestArea("python/ecl_file/fwrite") + with TestAreaContext("python/ecl_file/fwrite"): + rst_file = EclFile(self.test_file) + fortio = FortIO("ECLIPSE.UNRST", FortIO.WRITE_MODE) + rst_file.fwrite(fortio) + fortio.close() + rst_file.close() + self.assertFilesAreEqual("ECLIPSE.UNRST", self.test_file) + + + + + @skipIf(ExtendedTestCase.slowTestShouldNotRun(), "Slow file test skipped!") + def test_save(self): + #work_area = TestArea("python/ecl_file/save") + with TestAreaContext("python/ecl_file/save", store_area=False) as work_area: + work_area.copy_file(self.test_file) + rst_file = EclFile("ECLIPSE.UNRST", flags=EclFileFlagEnum.ECL_FILE_WRITABLE) + swat0 = rst_file["SWAT"][0] + swat0.assign(0.75) + rst_file.save_kw(swat0) + rst_file.close() + self.assertFilesAreNotEqual("ECLIPSE.UNRST",self.test_file) + + rst_file1 = EclFile(self.test_file) + rst_file2 = EclFile("ECLIPSE.UNRST", flags=EclFileFlagEnum.ECL_FILE_WRITABLE) + + swat1 = rst_file1["SWAT"][0] + swat2 = rst_file2["SWAT"][0] + swat2.assign(swat1) + + rst_file2.save_kw(swat2) + self.assertTrue(swat1.equal(swat2)) + rst_file1.close() + rst_file2.close() + + # Random failure .... + self.assertFilesAreEqual("ECLIPSE.UNRST", self.test_file) + + + + @skipIf(ExtendedTestCase.slowTestShouldNotRun(), "Slow file test skipped!") + def test_save_fmt(self): + #work_area = TestArea("python/ecl_file/save_fmt") + with TestAreaContext("python/ecl_file/save_fmt") as work_area: + work_area.copy_file(self.test_fmt_file) + rst_file = EclFile("ECLIPSE.FUNRST", flags=EclFileFlagEnum.ECL_FILE_WRITABLE) + swat0 = rst_file["SWAT"][0] + swat0.assign(0.75) + rst_file.save_kw(swat0) + rst_file.close() + self.assertFilesAreNotEqual("ECLIPSE.FUNRST", self.test_fmt_file) + + rst_file1 = EclFile(self.test_fmt_file) + rst_file2 = EclFile("ECLIPSE.FUNRST", flags=EclFileFlagEnum.ECL_FILE_WRITABLE) + + swat1 = rst_file1["SWAT"][0] + swat2 = rst_file2["SWAT"][0] + + swat2.assign(swat1) + rst_file2.save_kw(swat2) + self.assertTrue(swat1.equal(swat2)) + rst_file1.close() + rst_file2.close() + + # Random failure .... + self.assertFilesAreEqual("ECLIPSE.FUNRST", self.test_fmt_file) + + + def test_truncated(self): + with TestAreaContext("python/ecl_file/truncated") as work_area: + work_area.copy_file(self.test_file) + size = os.path.getsize("ECLIPSE.UNRST") + with open("ECLIPSE.UNRST" , "r+") as f: + f.truncate( size / 2 ) + + with self.assertRaises(IOError): + rst_file = EclFile("ECLIPSE.UNRST") + + with self.assertRaises(IOError): + rst_file = EclFile("ECLIPSE.UNRST", flags=EclFileFlagEnum.ECL_FILE_WRITABLE) + + def test_restart_view(self): + f = EclFile( self.test_file ) + with self.assertRaises(ValueError): + v = f.restartView( ) + + v = f.restartView( sim_days = 274 ) + v = f.restartView( sim_time = datetime.date( 2004,1,1) ) + v = f.restartView( report_step = 30 ) + v = f.restartView( seqnum_index = 30 ) + + def test_ix_case(self): + f = EclFile( self.createTestPath( "Statoil/ECLIPSE/ix/summary/Create_Region_Around_Well.SMSPEC")) + + # Keywords + self.assertTrue( "KEYWORDS" in f ) + keywords_loaded = list(f["KEYWORDS"][0]) + keywords_from_file = [ + 'TIME', 'YEARS', 'AAQR', 'AAQT', 'AAQP', 'AAQR', 'AAQT', + 'AAQP', 'AAQR', 'AAQT', 'AAQP', 'FPPW', 'FPPO', 'FPPG', 'FNQT', + 'FNQR', 'FEIP', 'FWPT', 'FWIT', 'FWIP', 'FWGR', 'FVPT', 'FVPR', + 'FVIT', 'FVIR', 'FPR', 'FOPT', 'FOIT', 'FOIR', 'FOIPL', + 'FOIPG', 'FOIP', 'FGPT', 'FGIT', 'FGIPL', 'FGIPG', 'FGIP', + 'FAQT', 'FAQR', 'FGOR', 'FWCT', 'FGSR', 'FGIR', 'FGPR', 'FWIR', + 'FWPR', 'FOPR', 'MEMORYTS', 'NAIMFRAC', 'TCPUDAY', 'TCPUTS', + 'NBAKFL', 'NNUMST', 'NNUMFL', 'NEWTFL', 'MSUMNEWT', 'MSUMLINS', + 'MLINEARS', 'NLINEARS', 'NEWTON', 'ELAPSED', 'TCPU', + 'TIMESTEP', 'GOPR', 'GOPR', 'GOPR', 'GWPR', 'GWPR', 'GWPR', + 'GWIR', 'GWIR', 'GWIR', 'GGPR', 'GGPR', 'GGPR', 'GWCT', 'GWCT', + 'GWCT', 'GGOR', 'GGOR', 'GGOR', 'GGIR', 'GGIR', 'GGIR', 'GGIT', + 'GGIT', 'GGIT', 'GGPT', 'GGPT', 'GGPT', 'GOIR', 'GOIR', 'GOIR', + 'GOIT', 'GOIT', 'GOIT', 'GOPT', 'GOPT', 'GOPT', 'GVIR', 'GVIR', + 'GVIR', 'GVIT', 'GVIT', 'GVIT', 'GVPR', 'GVPR', 'GVPR', 'GVPT', + 'GVPT', 'GVPT', 'GWGR', 'GWGR', 'GWGR', 'GWIT', 'GWIT', 'GWIT', + 'GWPT', 'GWPT', 'GWPT', 'WOPR', 'WOPR', 'WOPR', 'WOPR', 'WOPR', + 'WOPR', 'WWPR', 'WWPR', 'WWPR', 'WWPR', 'WWPR', 'WWPR', 'WWIR', + 'WWIR', 'WWIR', 'WWIR', 'WWIR', 'WWIR', 'WGPR', 'WGPR', 'WGPR', + 'WGPR', 'WGPR', 'WGPR', 'WWCT', 'WWCT', 'WWCT', 'WWCT', 'WWCT', + 'WWCT', 'WMCTL', 'WMCTL', 'WMCTL', 'WMCTL', 'WMCTL', 'WMCTL', + 'WGOR', 'WGOR', 'WGOR', 'WGOR', 'WGOR', 'WGOR', 'WAPI', 'WAPI', + 'WAPI', 'WAPI', 'WAPI', 'WAPI', 'WBHP', 'WBHP', 'WBHP', 'WBHP', + 'WBHP', 'WBHP', 'WGIR', 'WGIR', 'WGIR', 'WGIR', 'WGIR', 'WGIR', + 'WGIT', 'WGIT', 'WGIT', 'WGIT', 'WGIT', 'WGIT', 'WGPT', 'WGPT', + 'WGPT', 'WGPT', 'WGPT', 'WGPT', 'WOIR', 'WOIR', 'WOIR', 'WOIR', + 'WOIR', 'WOIR', 'WOIT', 'WOIT', 'WOIT', 'WOIT', 'WOIT', 'WOIT', + 'WOPT', 'WOPT', 'WOPT', 'WOPT', 'WOPT', 'WOPT', 'WPIG', 'WPIG', + 'WPIG', 'WPIG', 'WPIG', 'WPIG', 'WPIO', 'WPIO', 'WPIO', 'WPIO', + 'WPIO', 'WPIO', 'WPIW', 'WPIW', 'WPIW', 'WPIW', 'WPIW', 'WPIW', + 'WTHP', 'WTHP', 'WTHP', 'WTHP', 'WTHP', 'WTHP', 'WVIR', 'WVIR', + 'WVIR', 'WVIR', 'WVIR', 'WVIR', 'WVIT', 'WVIT', 'WVIT', 'WVIT', + 'WVIT', 'WVIT', 'WVPR', 'WVPR', 'WVPR', 'WVPR', 'WVPR', 'WVPR', + 'WVPT', 'WVPT', 'WVPT', 'WVPT', 'WVPT', 'WVPT', 'WWGR', 'WWGR', + 'WWGR', 'WWGR', 'WWGR', 'WWGR', 'WWIT', 'WWIT', 'WWIT', 'WWIT', + 'WWIT', 'WWIT', 'WWPT', 'WWPT', 'WWPT', 'WWPT', 'WWPT', 'WWPT', + 'WBHT', 'WBHT', 'WBHT', 'WBHT', 'WBHT', 'WBHT', 'WBP', 'WBP', + 'WBP', 'WBP', 'WBP', 'WBP', 'WWCT', 'WWCT', 'WWCT', 'WWCT', + 'WWCT', 'WWCT', 'WWCT', 'WWCT', 'WWCT', 'WWCT', 'WWCT', 'WWCT', + 'WWCT', 'WWCT', 'WWCT', 'WWCT', 'WWCT', 'WWCT', 'WWCT', 'WWCT', + 'WWCT', 'WWCT', 'WWCT', 'WWCT', 'WWCT', 'WWCT', 'WWCT', 'WWCT' + ] + + padd = lambda str_len : (lambda s : s + (" " * (max(0, str_len-len(s))))) + self.assertEqual(map(padd(8), keywords_from_file), keywords_loaded) + + # Names + self.assertTrue( "NAMES" in f ) + names_loaded = list(f["NAMES"][0]) + names_from_file = [ + '', '', 'AQFR_1', 'AQFR_1', 'AQFR_1', 'AQFR_2', 'AQFR_2', + 'AQFR_2', 'AQFR_3', 'AQFR_3', 'AQFR_3', 'FIELD', 'FIELD', + 'FIELD', 'FIELD', 'FIELD', 'FIELD', 'FIELD', 'FIELD', 'FIELD', + 'FIELD', 'FIELD', 'FIELD', 'FIELD', 'FIELD', 'FIELD', 'FIELD', + 'FIELD', 'FIELD', 'FIELD', 'FIELD', 'FIELD', 'FIELD', 'FIELD', + 'FIELD', 'FIELD', 'FIELD', 'FIELD', 'FIELD', 'FIELD', 'FIELD', + 'FIELD', 'FIELD', 'FIELD', 'FIELD', 'FIELD', 'FIELD', 'FIELD', + 'FIELD', 'FIELD', 'FIELD', 'FIELD', 'FIELD', 'FIELD', 'FIELD', + 'FIELD', 'FIELD', 'FIELD', 'FIELD', 'FIELD', 'FIELD', 'FIELD', + 'FIELD', 'ONE', 'TWO', 'FIELD', 'ONE', 'TWO', 'FIELD', 'ONE', + 'TWO', 'FIELD', 'ONE', 'TWO', 'FIELD', 'ONE', 'TWO', 'FIELD', + 'ONE', 'TWO', 'FIELD', 'ONE', 'TWO', 'FIELD', 'ONE', 'TWO', + 'FIELD', 'ONE', 'TWO', 'FIELD', 'ONE', 'TWO', 'FIELD', 'ONE', + 'TWO', 'FIELD', 'ONE', 'TWO', 'FIELD', 'ONE', 'TWO', 'FIELD', + 'ONE', 'TWO', 'FIELD', 'ONE', 'TWO', 'FIELD', 'ONE', 'TWO', + 'FIELD', 'ONE', 'TWO', 'FIELD', 'ONE', 'TWO', 'FIELD', 'ONE', + 'TWO', 'FIELD', 'HWELL_PROD', 'GI', 'I2', 'I4', 'I6', 'I8', + 'HWELL_PROD', 'GI', 'I2', 'I4', 'I6', 'I8', 'HWELL_PROD', 'GI', + 'I2', 'I4', 'I6', 'I8', 'HWELL_PROD', 'GI', 'I2', 'I4', 'I6', + 'I8', 'HWELL_PROD', 'GI', 'I2', 'I4', 'I6', 'I8', 'HWELL_PROD', + 'GI', 'I2', 'I4', 'I6', 'I8', 'HWELL_PROD', 'GI', 'I2', 'I4', + 'I6', 'I8', 'HWELL_PROD', 'GI', 'I2', 'I4', 'I6', 'I8', + 'HWELL_PROD', 'GI', 'I2', 'I4', 'I6', 'I8', 'HWELL_PROD', 'GI', + 'I2', 'I4', 'I6', 'I8', 'HWELL_PROD', 'GI', 'I2', 'I4', 'I6', + 'I8', 'HWELL_PROD', 'GI', 'I2', 'I4', 'I6', 'I8', 'HWELL_PROD', + 'GI', 'I2', 'I4', 'I6', 'I8', 'HWELL_PROD', 'GI', 'I2', 'I4', + 'I6', 'I8', 'HWELL_PROD', 'GI', 'I2', 'I4', 'I6', 'I8', + 'HWELL_PROD', 'GI', 'I2', 'I4', 'I6', 'I8', 'HWELL_PROD', 'GI', + 'I2', 'I4', 'I6', 'I8', 'HWELL_PROD', 'GI', 'I2', 'I4', 'I6', + 'I8', 'HWELL_PROD', 'GI', 'I2', 'I4', 'I6', 'I8', 'HWELL_PROD', + 'GI', 'I2', 'I4', 'I6', 'I8', 'HWELL_PROD', 'GI', 'I2', 'I4', + 'I6', 'I8', 'HWELL_PROD', 'GI', 'I2', 'I4', 'I6', 'I8', + 'HWELL_PROD', 'GI', 'I2', 'I4', 'I6', 'I8', 'HWELL_PROD', 'GI', + 'I2', 'I4', 'I6', 'I8', 'HWELL_PROD', 'GI', 'I2', 'I4', 'I6', + 'I8', 'HWELL_PROD', 'GI', 'I2', 'I4', 'I6', 'I8', 'HWELL_PROD', + 'GI', 'I2', 'I4', 'I6', 'I8', 'HWELL_PROD', 'GI', 'I2', 'I4', + 'I6', 'I8', ':+:+:+:+', ':+:+:+:+', ':+:+:+:+', ':+:+:+:+', + ':+:+:+:+', ':+:+:+:+', ':+:+:+:+', ':+:+:+:+', ':+:+:+:+', + ':+:+:+:+', ':+:+:+:+', ':+:+:+:+', ':+:+:+:+', ':+:+:+:+', + ':+:+:+:+', ':+:+:+:+', ':+:+:+:+', ':+:+:+:+', ':+:+:+:+', + ':+:+:+:+', ':+:+:+:+', ':+:+:+:+', ':+:+:+:+', ':+:+:+:+', + ':+:+:+:+', ':+:+:+:+', ':+:+:+:+', ':+:+:+:+' + ] + + self.assertEqual(map(padd(10), names_from_file), names_loaded) diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_init_file.py b/ThirdParty/Ert/python/tests/ecl/test_ecl_init_file.py similarity index 91% rename from ThirdParty/Ert/python/tests/core/ecl/test_ecl_init_file.py rename to ThirdParty/Ert/python/tests/ecl/test_ecl_init_file.py index 0e34c180a7..703be6be23 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_init_file.py +++ b/ThirdParty/Ert/python/tests/ecl/test_ecl_init_file.py @@ -15,8 +15,8 @@ # for more details. -from ert.test import ExtendedTestCase -from ert.ecl import Ecl3DKW , EclKW, EclTypeEnum, EclInitFile , EclFile, FortIO, EclFileFlagEnum , EclGrid +from ecl.test import ExtendedTestCase +from ecl.ecl import Ecl3DKW , EclKW, EclInitFile , EclFile, FortIO, EclFileFlagEnum , EclGrid class InitFileTest(ExtendedTestCase): def setUp(self): diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_kw.py b/ThirdParty/Ert/python/tests/ecl/test_ecl_kw.py similarity index 60% rename from ThirdParty/Ert/python/tests/core/ecl/test_ecl_kw.py rename to ThirdParty/Ert/python/tests/ecl/test_ecl_kw.py index 3841ca3822..5079b06dbe 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_kw.py +++ b/ThirdParty/Ert/python/tests/ecl/test_ecl_kw.py @@ -17,25 +17,27 @@ import os import random import numpy -from ert.ecl import EclKW, EclTypeEnum, EclFile, FortIO, EclFileFlagEnum , openFortIO +import warnings -from ert.test import ExtendedTestCase , TestAreaContext +from ecl.ecl import EclKW, EclDataType, EclTypeEnum, EclFile, FortIO, EclFileFlagEnum , openFortIO + +from ecl.test import ExtendedTestCase , TestAreaContext def copy_long(): - src = EclKW.create("NAME", 100, EclTypeEnum.ECL_FLOAT_TYPE) + src = EclKW("NAME", 100, EclDataType.ECL_FLOAT) copy = src.sub_copy(0, 2000) def copy_offset(): - src = EclKW.create("NAME", 100, EclTypeEnum.ECL_FLOAT_TYPE) + src = EclKW("NAME", 100, EclDataType.ECL_FLOAT) copy = src.sub_copy(200, 100) class KWTest(ExtendedTestCase): def test_min_max(self): - kw = EclKW("TEST", 3, EclTypeEnum.ECL_INT_TYPE) + kw = EclKW("TEST", 3, EclDataType.ECL_INT) kw[0] = 10 kw[1] = 5 kw[2] = 0 @@ -45,8 +47,22 @@ class KWTest(ExtendedTestCase): self.assertEqual( (0,10) , kw.getMinMax()) + def test_deprecated_datatypes(self): + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter("always") + kw = EclKW("Test", 10, EclTypeEnum.ECL_INT_TYPE) + self.assertTrue(len(w) > 0) + self.assertTrue(issubclass(w[-1].category, DeprecationWarning)) + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter("always") + kw = EclKW("Test", 10, EclDataType.ECL_INT) + self.assertTrue(len(w) == 0) + self.assertEqual(EclTypeEnum.ECL_INT_TYPE, kw.type) + + self.assertTrue(len(w) > 0) + self.assertTrue(issubclass(w[-1].category, DeprecationWarning)) def kw_test( self, data_type, data, fmt ): name1 = "file1.txt" @@ -66,42 +82,40 @@ class KWTest(ExtendedTestCase): file2.write(fmt % d) file2.close() self.assertFilesAreEqual(name1, name2) - self.assertEqual( kw.getEclType() , data_type ) + self.assertEqual( kw.data_type , data_type ) def test_create(self): with self.assertRaises(ValueError): - EclKW.create( "ToGodDamnLong" , 100 , EclTypeEnum.ECL_CHAR_TYPE ) - - + EclKW( "ToGodDamnLong" , 100 , EclDataType.ECL_CHAR ) def test_sum( self ): - kw_string = EclKW.create( "STRING" , 100 , EclTypeEnum.ECL_CHAR_TYPE ) - with self.assertRaises(ValueError): - kw_string.sum() + for ecl_type in [EclDataType.ECL_CHAR, EclDataType.ECL_STRING(42)]: + kw_string = EclKW("STRING", 100, ecl_type) + with self.assertRaises(ValueError): + kw_string.sum() - - kw_int = EclKW.create( "INT" , 4 , EclTypeEnum.ECL_INT_TYPE ) + kw_int = EclKW( "INT" , 4 , EclDataType.ECL_INT ) kw_int[0] = 1 kw_int[1] = 2 kw_int[2] = 3 kw_int[3] = 4 self.assertEqual( kw_int.sum() , 10 ) - kw_d = EclKW.create( "D" , 4 , EclTypeEnum.ECL_DOUBLE_TYPE ) + kw_d = EclKW( "D" , 4 , EclDataType.ECL_DOUBLE ) kw_d[0] = 1 kw_d[1] = 2 kw_d[2] = 3 kw_d[3] = 4 self.assertEqual( kw_d.sum() , 10 ) - kw_f = EclKW.create( "F" , 4 , EclTypeEnum.ECL_FLOAT_TYPE ) + kw_f = EclKW( "F" , 4 , EclDataType.ECL_FLOAT ) kw_f[0] = 1 kw_f[1] = 2 kw_f[2] = 3 kw_f[3] = 4 self.assertEqual( kw_f.sum() , 10 ) - kw_b = EclKW.create( "F" , 4 , EclTypeEnum.ECL_BOOL_TYPE ) + kw_b = EclKW( "F" , 4 , EclDataType.ECL_BOOL ) kw_b[0] = False kw_b[1] = True kw_b[2] = False @@ -112,23 +126,29 @@ class KWTest(ExtendedTestCase): def test_fprintf( self ): with TestAreaContext("python.ecl_kw"): - self.kw_test(EclTypeEnum.ECL_INT_TYPE, [0, 1, 2, 3, 4, 5], "%4d\n") - self.kw_test(EclTypeEnum.ECL_FLOAT_TYPE, [0.0, 1.1, 2.2, 3.3, 4.4, 5.5], "%12.6f\n") - self.kw_test(EclTypeEnum.ECL_DOUBLE_TYPE, [0.0, 1.1, 2.2, 3.3, 4.4, 5.5], "%12.6f\n") - self.kw_test(EclTypeEnum.ECL_BOOL_TYPE, [True, True, True, False, True], "%4d\n") - self.kw_test(EclTypeEnum.ECL_CHAR_TYPE, ["1", "22", "4444", "666666", "88888888"], "%-8s\n") + self.kw_test(EclDataType.ECL_INT, [0, 1, 2, 3, 4, 5], "%4d\n") + self.kw_test(EclDataType.ECL_FLOAT, [0.0, 1.1, 2.2, 3.3, 4.4, 5.5], "%12.6f\n") + self.kw_test(EclDataType.ECL_DOUBLE, [0.0, 1.1, 2.2, 3.3, 4.4, 5.5], "%12.6f\n") + self.kw_test(EclDataType.ECL_BOOL, [True, True, True, False, True], "%4d\n") + self.kw_test(EclDataType.ECL_CHAR, ["1", "22", "4444", "666666", "88888888"], "%-8s\n") + + for str_len in range(1000): + self.kw_test(EclDataType.ECL_STRING(str_len), [str(i)*str_len for i in range(10)], "%s\n") def test_kw_write(self): with TestAreaContext("python/ecl_kw/writing"): data = [random.random() for i in range(10000)] - kw = EclKW("TEST", len(data), EclTypeEnum.ECL_DOUBLE_TYPE) + kw = EclKW("TEST", len(data), EclDataType.ECL_DOUBLE) i = 0 for d in data: kw[i] = d i += 1 + pfx = 'EclKW(' + self.assertEqual(pfx, repr(kw)[:len(pfx)]) + fortio = FortIO("ECL_KW_TEST", FortIO.WRITE_MODE) kw.fwrite(fortio) fortio.close() @@ -160,7 +180,7 @@ class KWTest(ExtendedTestCase): def test_fprintf_data(self): with TestAreaContext("kw_no_header"): - kw = EclKW.create("REGIONS" , 10 , EclTypeEnum.ECL_INT_TYPE) + kw = EclKW("REGIONS" , 10 , EclDataType.ECL_INT) for i in range(len(kw)): kw[i] = i @@ -180,7 +200,7 @@ class KWTest(ExtendedTestCase): def test_sliced_set(self): - kw = EclKW.create("REGIONS" , 10 , EclTypeEnum.ECL_INT_TYPE) + kw = EclKW("REGIONS" , 10 , EclDataType.ECL_INT) kw.assign(99) kw[0:5] = 66 self.assertEqual(kw[0] , 66) @@ -190,23 +210,24 @@ class KWTest(ExtendedTestCase): def test_long_name(self): with self.assertRaises(ValueError): - EclKW.create("LONGLONGNAME" , 10 , EclTypeEnum.ECL_INT_TYPE) + EclKW("LONGLONGNAME" , 10 , EclDataType.ECL_INT) - kw = EclKW.create("REGIONS" , 10 , EclTypeEnum.ECL_INT_TYPE) + kw = EclKW("REGIONS" , 10 , EclDataType.ECL_INT) with self.assertRaises(ValueError): - kw.set_name("LONGLONGNAME") + kw.setName("LONGLONGNAME") def test_abs(self): - kw = EclKW("NAME" , 10 , EclTypeEnum.ECL_CHAR_TYPE) - with self.assertRaises(TypeError): - abs_kw = abs(kw) + for ecl_type in [ + EclDataType.ECL_CHAR, + EclDataType.ECL_BOOL, + EclDataType.ECL_STRING(32) + ]: + kw = EclKW("NAME" , 10 , ecl_type) + with self.assertRaises(TypeError): + abs_kw = abs(kw) - kw = EclKW("NAME" , 10 , EclTypeEnum.ECL_BOOL_TYPE) - with self.assertRaises(TypeError): - abs_kw = abs(kw) - - kw = EclKW("NAME" , 10 , EclTypeEnum.ECL_INT_TYPE) + kw = EclKW("NAME" , 10 , EclDataType.ECL_INT) for i in range(len(kw)): kw[i] = -i @@ -217,8 +238,8 @@ class KWTest(ExtendedTestCase): def test_fmt(self): - kw1 = EclKW( "NAME1" , 100 , EclTypeEnum.ECL_INT_TYPE) - kw2 = EclKW( "NAME2" , 100 , EclTypeEnum.ECL_INT_TYPE) + kw1 = EclKW( "NAME1" , 100 , EclDataType.ECL_INT) + kw2 = EclKW( "NAME2" , 100 , EclDataType.ECL_INT) for i in range(len(kw1)): kw1[i] = i + 1 @@ -242,11 +263,11 @@ class KWTest(ExtendedTestCase): def test_first_different(self): - kw1 = EclKW( "NAME1" , 100 , EclTypeEnum.ECL_INT_TYPE) - kw2 = EclKW( "NAME2" , 100 , EclTypeEnum.ECL_INT_TYPE) - kw3 = EclKW( "NAME2" , 200 , EclTypeEnum.ECL_INT_TYPE) - kw4 = EclKW( "NAME2" , 100 , EclTypeEnum.ECL_FLOAT_TYPE) - kw5 = EclKW( "NAME2" , 100 , EclTypeEnum.ECL_FLOAT_TYPE) + kw1 = EclKW( "NAME1" , 100 , EclDataType.ECL_INT) + kw2 = EclKW( "NAME2" , 100 , EclDataType.ECL_INT) + kw3 = EclKW( "NAME2" , 200 , EclDataType.ECL_INT) + kw4 = EclKW( "NAME2" , 100 , EclDataType.ECL_FLOAT) + kw5 = EclKW( "NAME2" , 100 , EclDataType.ECL_FLOAT) with self.assertRaises( IndexError ): @@ -293,8 +314,8 @@ class KWTest(ExtendedTestCase): def test_numeric_equal(self): - kw1 = EclKW("Name1" , 10 , EclTypeEnum.ECL_DOUBLE_TYPE ) - kw2 = EclKW("Name1" , 10 , EclTypeEnum.ECL_DOUBLE_TYPE ) + kw1 = EclKW("Name1" , 10 , EclDataType.ECL_DOUBLE ) + kw2 = EclKW("Name1" , 10 , EclDataType.ECL_DOUBLE ) shift = 0.0001 @@ -313,10 +334,10 @@ class KWTest(ExtendedTestCase): self.assertTrue( kw1.equal_numeric( kw2 , abs_epsilon = abs_diff * 1.1 , rel_epsilon = 0)) def test_mul(self): - kw1 = EclKW("Name1" , 10 , EclTypeEnum.ECL_INT_TYPE ) + kw1 = EclKW("Name1" , 10 , EclDataType.ECL_INT ) kw1.assign( 10 ) - kw2 = EclKW("Name1" , 10 , EclTypeEnum.ECL_INT_TYPE ) + kw2 = EclKW("Name1" , 10 , EclDataType.ECL_INT ) kw2.assign( 2 ) kw3 = kw1 * kw2 @@ -331,7 +352,7 @@ class KWTest(ExtendedTestCase): def test_numpy(self): - kw1 = EclKW("DOUBLE", 10, EclTypeEnum.ECL_DOUBLE_TYPE ) + kw1 = EclKW("DOUBLE", 10, EclDataType.ECL_DOUBLE ) view = kw1.numpyView( ) copy = kw1.numpyCopy( ) @@ -343,18 +364,17 @@ class KWTest(ExtendedTestCase): self.assertTrue( view[ 0 ] == kw1[ 0 ] ) self.assertTrue( copy[ 0 ] == kw1[ 0 ] - 1) - - kw2 = EclKW("CHAR", 10, EclTypeEnum.ECL_CHAR_TYPE ) - with self.assertRaises(ValueError): - kw2.numpyView( ) - - kw3 = EclKW("BOOL", 10, EclTypeEnum.ECL_BOOL_TYPE ) - with self.assertRaises(ValueError): - kw3.numpyView( ) + for ecl_type in [ + EclDataType.ECL_CHAR, + EclDataType.ECL_BOOL, + EclDataType.ECL_STRING(19)]: + kw2 = EclKW("TEST_KW", 10, ecl_type) + with self.assertRaises(ValueError): + kw2.numpyView() def test_slice(self): N = 100 - kw = EclKW("KW" , N , EclTypeEnum.ECL_INT_TYPE) + kw = EclKW("KW" , N , EclDataType.ECL_INT) for i in range(len(kw)): kw[i] = i @@ -371,7 +391,7 @@ class KWTest(ExtendedTestCase): def test_resize(self): N = 4 - kw = EclKW("KW" , N , EclTypeEnum.ECL_INT_TYPE) + kw = EclKW("KW" , N , EclDataType.ECL_INT) for i in range(N): kw[i] = i @@ -385,3 +405,52 @@ class KWTest(ExtendedTestCase): for i in range(N/2): self.assertEqual( kw[i] , i ) + + def test_typename(self): + kw = EclKW("KW" , 100 , EclDataType.ECL_INT) + + self.assertEqual( kw.typeName( ) , "INTE") + + def test_string_alloc(self): + kw = EclKW("KW" , 10, EclDataType.ECL_STRING(30)) + + for i in range(10): + kw[i] = str(i)*30 + + for i in range(10): + self.assertEqual(str(i)*30, kw[i]) + + def test_string_write_read_unformatted(self): + for str_len in range(1000): + with TestAreaContext("my_space"): + + kw = EclKW("TEST_KW" , 10, EclDataType.ECL_STRING(str_len)) + for i in range(10): + kw[i] = str(i)*str_len + + file_name = "ecl_kw_test" + + with openFortIO(file_name, mode=FortIO.WRITE_MODE) as fortio: + kw.fwrite(fortio) + + with openFortIO(file_name) as fortio: + loaded_kw = EclKW.fread(fortio) + + self.assertEqual(kw, loaded_kw) + + def test_string_write_read_formatted(self): + for str_len in range(1000): + with TestAreaContext("my_space"): + + kw = EclKW("TEST_KW" , 10, EclDataType.ECL_STRING(str_len)) + for i in range(10): + kw[i] = str(i)*str_len + + file_name = "ecl_kw_test" + with openFortIO(file_name, mode=FortIO.WRITE_MODE, fmt_file=True) as fortio: + kw.fwrite(fortio) + + with openFortIO(file_name, fmt_file=True) as fortio: + loaded_kw = EclKW.fread(fortio) + + self.assertEqual(kw, loaded_kw) diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_kw_statoil.py b/ThirdParty/Ert/python/tests/ecl/test_ecl_kw_statoil.py similarity index 83% rename from ThirdParty/Ert/python/tests/core/ecl/test_ecl_kw_statoil.py rename to ThirdParty/Ert/python/tests/ecl/test_ecl_kw_statoil.py index 2ddb0f600c..21d6b63c40 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_kw_statoil.py +++ b/ThirdParty/Ert/python/tests/ecl/test_ecl_kw_statoil.py @@ -16,18 +16,18 @@ # for more details. import os import random -from ert.ecl import EclKW, EclTypeEnum, EclFile, FortIO, EclFileFlagEnum +from ecl.ecl import EclKW, EclDataType, EclFile, FortIO, EclFileFlagEnum -from ert.test import ExtendedTestCase , TestAreaContext +from ecl.test import ExtendedTestCase , TestAreaContext def copy_long(): - src = EclKW.create("NAME", 100, EclTypeEnum.ECL_FLOAT_TYPE) + src = EclKW("NAME", 100, EclDataType.ECL_FLOAT) copy = src.sub_copy(0, 2000) def copy_offset(): - src = EclKW.create("NAME", 100, EclTypeEnum.ECL_FLOAT_TYPE) + src = EclKW("NAME", 100, EclDataType.ECL_FLOAT) copy = src.sub_copy(200, 100) @@ -37,7 +37,7 @@ class KWTest(ExtendedTestCase): unrst_file = EclFile(unrst_file_path) size = 0 for kw in unrst_file: - size += kw.fortio_size + size += kw.fortIOSize() stat = os.stat(unrst_file_path) self.assertTrue(size == stat.st_size) @@ -51,16 +51,16 @@ class KWTest(ExtendedTestCase): swat = unrst_file["SWAT"][0] swat1 = swat.sub_copy(0, -1) - swat2 = swat.sub_copy(0, swat.size) + swat2 = swat.sub_copy(0, len(swat)) self.assertTrue(swat.equal(swat1)) self.assertTrue(swat.equal(swat2)) swat3 = swat.sub_copy(20000, 100, new_header="swat") - self.assertTrue(swat3.name == "swat") - self.assertTrue(swat3.size == 100) + self.assertTrue(swat3.getName() == "swat") + self.assertTrue(len(swat3) == 100) equal = True - for i in range(swat3.size): + for i in range(len(swat3)): if swat3[i] != swat[i + 20000]: equal = False self.assertTrue(equal) @@ -70,12 +70,12 @@ class KWTest(ExtendedTestCase): def test_equal(self): - kw1 = EclKW("TEST", 3, EclTypeEnum.ECL_CHAR_TYPE) + kw1 = EclKW("TEST", 3, EclDataType.ECL_CHAR) kw1[0] = "Test1" kw1[1] = "Test13" kw1[2] = "Test15" - kw2 = EclKW("TEST", 3, EclTypeEnum.ECL_CHAR_TYPE) + kw2 = EclKW("TEST", 3, EclDataType.ECL_CHAR) kw2[0] = "Test1" kw2[1] = "Test13" kw2[2] = "Test15" diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_restart_file.py b/ThirdParty/Ert/python/tests/ecl/test_ecl_restart_file.py similarity index 94% rename from ThirdParty/Ert/python/tests/core/ecl/test_ecl_restart_file.py rename to ThirdParty/Ert/python/tests/ecl/test_ecl_restart_file.py index 18095d2535..e2779e6d5e 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_restart_file.py +++ b/ThirdParty/Ert/python/tests/ecl/test_ecl_restart_file.py @@ -15,8 +15,8 @@ # for more details. import datetime -from ert.test import ExtendedTestCase -from ert.ecl import Ecl3DKW , EclKW, EclTypeEnum, EclRestartFile , EclFile, FortIO, EclFileFlagEnum , EclGrid +from ecl.test import ExtendedTestCase +from ecl.ecl import Ecl3DKW , EclKW, EclRestartFile , EclFile, FortIO, EclFileFlagEnum , EclGrid class RestartFileTest(ExtendedTestCase): def setUp(self): diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_sum.py b/ThirdParty/Ert/python/tests/ecl/test_ecl_sum.py similarity index 97% rename from ThirdParty/Ert/python/tests/core/ecl/test_ecl_sum.py rename to ThirdParty/Ert/python/tests/ecl/test_ecl_sum.py index 8e9baf2c76..7e81dd49dc 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_sum.py +++ b/ThirdParty/Ert/python/tests/ecl/test_ecl_sum.py @@ -17,8 +17,8 @@ import datetime import os.path from cwrap import CFILE -from ert.ecl import EclSum, EclSumKeyWordVector, EclFile,FortIO, openFortIO,openEclFile,EclKW -from ert.test import ExtendedTestCase , TestAreaContext +from ecl.ecl import EclSum, EclSumKeyWordVector, EclFile,FortIO, openFortIO,openEclFile,EclKW +from ecl.test import ExtendedTestCase , TestAreaContext class EclSumTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_sum_tstep.py b/ThirdParty/Ert/python/tests/ecl/test_ecl_sum_tstep.py similarity index 94% rename from ThirdParty/Ert/python/tests/core/ecl/test_ecl_sum_tstep.py rename to ThirdParty/Ert/python/tests/ecl/test_ecl_sum_tstep.py index ddcdcaa609..8a15241a09 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_sum_tstep.py +++ b/ThirdParty/Ert/python/tests/ecl/test_ecl_sum_tstep.py @@ -1,7 +1,7 @@ from datetime import datetime import random -from ert.ecl import EclSumTStep, EclSum -from ert.test import ExtendedTestCase +from ecl.ecl import EclSumTStep, EclSum +from ecl.test import ExtendedTestCase class EclSumTStepTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_sum_vector.py b/ThirdParty/Ert/python/tests/ecl/test_ecl_sum_vector.py similarity index 95% rename from ThirdParty/Ert/python/tests/core/ecl/test_ecl_sum_vector.py rename to ThirdParty/Ert/python/tests/ecl/test_ecl_sum_vector.py index aa9612e4e9..09bc438ea8 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_sum_vector.py +++ b/ThirdParty/Ert/python/tests/ecl/test_ecl_sum_vector.py @@ -22,8 +22,8 @@ except ImportError: import warnings -from ert.ecl import EclSumVector, EclSum -from ert.test import ExtendedTestCase +from ecl.ecl import EclSumVector, EclSum +from ecl.test import ExtendedTestCase class EclSumVectorTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/ecl/test_ecl_type.py b/ThirdParty/Ert/python/tests/ecl/test_ecl_type.py new file mode 100644 index 0000000000..48da066718 --- /dev/null +++ b/ThirdParty/Ert/python/tests/ecl/test_ecl_type.py @@ -0,0 +1,139 @@ +from ecl.test import TestAreaContext, ExtendedTestCase + +from ecl.ecl import EclDataType, EclTypeEnum + +def get_const_size_types(): + return EclTypeEnum.enums()[:-1:] + +class EclDataTypeTest(ExtendedTestCase): + + # All of the below should list their elements in the same order as + # EclTypeEnum! + # [char, float, double, int, bool, mess] + + CONST_SIZES = [8, 4, 8, 4, 4, 0] + + CONST_VERIFIERS = [ + EclDataType.is_char, + EclDataType.is_float, + EclDataType.is_double, + EclDataType.is_int, + EclDataType.is_bool, + EclDataType.is_mess + ] + + CONST_NAMES = ["CHAR", "REAL", "DOUB", "INTE", "LOGI", "MESS"] + + STRING_NAMES = ["C000", "C010", "C020", "C042", "C999"] + + STRING_SIZES = [0, 10, 20, 42, 999] + + TYPES = (get_const_size_types() + + len(STRING_SIZES) * [EclTypeEnum.ECL_STRING_TYPE]) + + SIZES = CONST_SIZES + STRING_SIZES + + NAMES = CONST_NAMES + STRING_NAMES + + + def test_alloc_from_type(self): + types, sizes = get_const_size_types(), self.CONST_SIZES + for (ecl_type, element_size) in zip(types, sizes): + data_type = EclDataType(ecl_type) + self.assertEqual(ecl_type, data_type.type) + self.assertEqual(element_size, data_type.element_size) + + def test_invalid_string_alloc(self): + with self.assertRaises(ValueError): + data_type = EclDataType(EclTypeEnum.ECL_STRING_TYPE) + + with self.assertRaises(ValueError): + data_type = EclDataType(EclTypeEnum.ECL_STRING_TYPE, -1) + + with self.assertRaises(ValueError): + data_type = EclDataType(EclTypeEnum.ECL_STRING_TYPE, 1000) + + def test_alloc(self): + for (ecl_type, element_size) in zip(self.TYPES, self.SIZES): + data_type = EclDataType(ecl_type, element_size) + self.assertEqual(ecl_type, data_type.type) + self.assertEqual(element_size, data_type.element_size) + + def test_type_verifiers(self): + test_base = zip(self.TYPES, self.SIZES, self.CONST_VERIFIERS) + for (ecl_type, elem_size, verifier) in test_base: + data_type = EclDataType(ecl_type, elem_size) + self.assertTrue(verifier(data_type)) + + def test_get_type_name(self): + test_base = zip(self.TYPES, self.SIZES, self.NAMES) + for (ecl_type, elem_size, type_name) in test_base: + data_type = EclDataType(ecl_type, elem_size) + self.assertEqual(type_name, data_type.type_name) + + def test_initialization_validation(self): + invalid_args = [ + (None, 0, self.CONST_NAMES[0]), + (1, None, self.CONST_NAMES[0]), + (1, 0, self.CONST_NAMES[0]), + (None, None, None), + (None, 12, None) + ] + + for inv_arg in invalid_args: + with self.assertRaises(ValueError): + EclDataType(inv_arg[0], inv_arg[1], inv_arg[2]) + + def test_create_from_type_name(self): + test_base = zip(self.TYPES, self.SIZES, self.NAMES) + for (ecl_type, elem_size, type_name) in test_base: + data_type = EclDataType.create_from_type_name(type_name) + self.assertEqual(ecl_type, data_type.type) + self.assertEqual(elem_size, data_type.element_size) + self.assertEqual(type_name, data_type.type_name) + + def test_is_numeric(self): + numeric_types = [ + EclTypeEnum.ECL_INT_TYPE, + EclTypeEnum.ECL_FLOAT_TYPE, + EclTypeEnum.ECL_DOUBLE_TYPE + ] + + for ecl_type in numeric_types: + self.assertTrue(EclDataType(ecl_type).is_numeric()) + + for ecl_type in set(get_const_size_types())-set(numeric_types): + self.assertFalse(EclDataType(ecl_type).is_numeric()) + + for elem_size in self.STRING_SIZES: + data_type = EclDataType(EclTypeEnum.ECL_STRING_TYPE, elem_size) + self.assertFalse(data_type.is_numeric()) + + def test_equals(self): + test_base = zip(self.TYPES, self.SIZES) + for ecl_type, elem_size in test_base: + a = EclDataType(ecl_type, elem_size) + b = EclDataType(ecl_type, elem_size) + + self.assertTrue(a.is_equal(b)) + self.assertEqual(a, b) + + for otype, osize in set(test_base)-set([(ecl_type, elem_size)]): + self.assertFalse(a.is_equal(EclDataType(otype, osize))) + self.assertNotEqual(a, EclDataType(otype, osize)) + + def test_hash(self): + all_types = set() + test_base = zip(self.TYPES, self.SIZES) + + for index, (ecl_type, elem_size) in enumerate(test_base): + all_types.add(EclDataType(ecl_type, elem_size)) + self.assertEqual(index+1, len(all_types)) + + for index, (ecl_type, elem_size) in enumerate(test_base): + all_types.add(EclDataType(ecl_type, elem_size)) + + for index, ecl_type in enumerate(get_const_size_types()): + all_types.add(EclDataType(ecl_type)) + + self.assertEqual(len(test_base), len(all_types)) diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_util.py b/ThirdParty/Ert/python/tests/ecl/test_ecl_util.py similarity index 59% rename from ThirdParty/Ert/python/tests/core/ecl/test_ecl_util.py rename to ThirdParty/Ert/python/tests/ecl/test_ecl_util.py index 539e7f79b3..0704b17cf1 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_ecl_util.py +++ b/ThirdParty/Ert/python/tests/ecl/test_ecl_util.py @@ -14,8 +14,8 @@ # See the GNU General Public License at # for more details. -from ert.ecl import EclGrid , EclUtil, EclTypeEnum , EclFileEnum, EclPhaseEnum, EclUnitTypeEnum -from ert.test import ExtendedTestCase +from ecl.ecl import EclGrid , EclUtil, EclTypeEnum , EclFileEnum, EclPhaseEnum, EclUnitTypeEnum +from ecl.test import ExtendedTestCase class EclUtilTest(ExtendedTestCase): @@ -26,25 +26,8 @@ class EclUtilTest(ExtendedTestCase): self.assertEnumIsFullyDefined(EclPhaseEnum, "ecl_phase_enum", source_file_path) self.assertEnumIsFullyDefined(EclUnitTypeEnum, "ert_ecl_unit_enum", source_file_path) - # The ecl_type_enum has an extra type ECL_C010_TYPE defined in - # C, the implementation/behavior of that type is based on - # guessing and might very well be wrong, it is therefor not - # exposed in Python. For this reason we have commented out the - # default enum test, and instead test the element manually. - # - # self.assertEnumIsFullyDefined(EclTypeEnum, "ecl_type_enum", source_file_path) - - enum_elements = [ EclTypeEnum.ECL_CHAR_TYPE, - EclTypeEnum.ECL_FLOAT_TYPE, - EclTypeEnum.ECL_DOUBLE_TYPE, - EclTypeEnum.ECL_INT_TYPE, - EclTypeEnum.ECL_BOOL_TYPE, - EclTypeEnum.ECL_MESS_TYPE ] - - for (value , enum_elm) in zip( [0,1,2,3,4,5] , enum_elements): - self.assertEqual( value , enum_elm.value ) - - + source_file_path = "libecl/include/ert/ecl/ecl_type.h" + self.assertEnumIsFullyDefined(EclTypeEnum, "ecl_type_enum", source_file_path) def test_file_type(self): file_type , fmt , report = EclUtil.inspectExtension("CASE.X0078") diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_fault_blocks.py b/ThirdParty/Ert/python/tests/ecl/test_fault_blocks.py similarity index 90% rename from ThirdParty/Ert/python/tests/core/ecl/test_fault_blocks.py rename to ThirdParty/Ert/python/tests/ecl/test_fault_blocks.py index 192369f6b0..9275c9a5dc 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_fault_blocks.py +++ b/ThirdParty/Ert/python/tests/ecl/test_fault_blocks.py @@ -16,17 +16,18 @@ # for more details. from __future__ import print_function from unittest import skipIf +import warnings -from ert.ecl import EclGrid, EclTypeEnum , EclKW , EclRegion -from ert.ecl.faults import FaultBlock, FaultBlockLayer, FaultBlockCell,FaultCollection -from ert.geo import Polyline , CPolylineCollection -from ert.test import ExtendedTestCase , TestAreaContext +from ecl.ecl import EclGrid, EclKW , EclRegion, EclDataType +from ecl.ecl.faults import FaultBlock, FaultBlockLayer, FaultBlockCell,FaultCollection +from ecl.geo import Polyline , CPolylineCollection +from ecl.test import ExtendedTestCase , TestAreaContext class FaultBlockTest(ExtendedTestCase): def setUp(self): - self.grid = EclGrid.create_rectangular( (10,10,10) , (1,1,1) ) - self.kw = EclKW.create( "FAULTBLK" , self.grid.size , EclTypeEnum.ECL_INT_TYPE ) + self.grid = EclGrid.createRectangular( (10,10,10) , (1,1,1) ) + self.kw = EclKW( "FAULTBLK" , self.grid.getGlobalSize() , EclDataType.ECL_INT ) self.kw.assign( 1 ) reg = EclRegion( self.grid , False ) @@ -40,8 +41,8 @@ class FaultBlockTest(ExtendedTestCase): def test_fault_block(self): - grid = EclGrid.create_rectangular( (5,5,1) , (1,1,1) ) - kw = EclKW.create( "FAULTBLK" , grid.size , EclTypeEnum.ECL_INT_TYPE ) + grid = EclGrid.createRectangular( (5,5,1) , (1,1,1) ) + kw = EclKW( "FAULTBLK" , grid.getGlobalSize() , EclDataType.ECL_INT ) kw.assign( 0 ) for j in range(1,4): for i in range(1,4): @@ -56,7 +57,6 @@ class FaultBlockTest(ExtendedTestCase): self.assertEqual( len(block) , 9) self.assertEqual( layer , block.getParentLayer() ) - def test_get_ijk(self): with TestAreaContext("python/fault_block_layer/neighbour") as work_area: with open("kw.grdecl","w") as fileH: @@ -68,9 +68,9 @@ class FaultBlockTest(ExtendedTestCase): fileH.write("4 4 4 0 5\n") fileH.write("/\n") - kw = EclKW.read_grdecl(open("kw.grdecl") , "FAULTBLK" , ecl_type = EclTypeEnum.ECL_INT_TYPE) + kw = EclKW.read_grdecl(open("kw.grdecl") , "FAULTBLK" , ecl_type = EclDataType.ECL_INT) - grid = EclGrid.create_rectangular( (5,5,1) , (1,1,1) ) + grid = EclGrid.createRectangular( (5,5,1) , (1,1,1) ) layer = FaultBlockLayer( grid , 0 ) layer.loadKeyword( kw ) @@ -100,9 +100,9 @@ class FaultBlockTest(ExtendedTestCase): fileH.write("4 4 4 0 5\n") fileH.write("/\n") - kw = EclKW.read_grdecl(open("kw.grdecl") , "FAULTBLK" , ecl_type = EclTypeEnum.ECL_INT_TYPE) + kw = EclKW.read_grdecl(open("kw.grdecl") , "FAULTBLK" , ecl_type = EclDataType.ECL_INT) - grid = EclGrid.create_rectangular( (5,5,1) , (1,1,1) ) + grid = EclGrid.createRectangular( (5,5,1) , (1,1,1) ) layer = FaultBlockLayer( grid , 0 ) layer.loadKeyword( kw ) @@ -160,7 +160,7 @@ class FaultBlockTest(ExtendedTestCase): fileH.write("3 3 3 3 2 2 2 2 \n") fileH.write("/\n") - kw = EclKW.read_grdecl(open("faultblock.grdecl") , "FAULTBLK" , ecl_type = EclTypeEnum.ECL_INT_TYPE) + kw = EclKW.read_grdecl(open("faultblock.grdecl") , "FAULTBLK" , ecl_type = EclDataType.ECL_INT) with open("faults.grdecl" , "w") as f: f.write("FAULTS\n") f.write("\'FY\' 1 4 4 4 1 1 'Y' /\n") @@ -226,7 +226,7 @@ class FaultBlockTest(ExtendedTestCase): fileH.write("1 1 1 1 1 2 2 2 \n") fileH.write("/\n") - kw = EclKW.read_grdecl(open("faultblock.grdecl") , "FAULTBLK" , ecl_type = EclTypeEnum.ECL_INT_TYPE) + kw = EclKW.read_grdecl(open("faultblock.grdecl") , "FAULTBLK" , ecl_type = EclDataType.ECL_INT) with open("faults.grdecl" , "w") as f: f.write("FAULTS\n") f.write("\'FX\' 4 4 1 4 1 1 'X' /\n") @@ -252,8 +252,8 @@ class FaultBlockTest(ExtendedTestCase): def test_fault_block_edge(self): - grid = EclGrid.create_rectangular( (5,5,1) , (1,1,1) ) - kw = EclKW.create( "FAULTBLK" , grid.size , EclTypeEnum.ECL_INT_TYPE ) + grid = EclGrid.createRectangular( (5,5,1) , (1,1,1) ) + kw = EclKW( "FAULTBLK" , grid.getGlobalSize() , EclDataType.ECL_INT ) kw.assign( 0 ) for j in range(1,4): for i in range(1,4): @@ -271,12 +271,12 @@ class FaultBlockTest(ExtendedTestCase): layer = FaultBlockLayer( self.grid , -1 ) with self.assertRaises(ValueError): - layer = FaultBlockLayer( self.grid , self.grid.size ) + layer = FaultBlockLayer( self.grid , self.grid.getGlobalSize() ) layer = FaultBlockLayer( self.grid , 1 ) self.assertEqual( 1 , layer.getK() ) - kw = EclKW.create( "FAULTBLK" , self.grid.size , EclTypeEnum.ECL_FLOAT_TYPE ) + kw = EclKW( "FAULTBLK" , self.grid.getGlobalSize() , EclDataType.ECL_FLOAT ) with self.assertRaises(ValueError): layer.scanKeyword( kw ) @@ -358,7 +358,7 @@ class FaultBlockTest(ExtendedTestCase): def test_add_polyline_barrier1(self): - grid = EclGrid.create_rectangular( (4,1,1) , (1,1,1) ) + grid = EclGrid.createRectangular( (4,1,1) , (1,1,1) ) layer = FaultBlockLayer( self.grid , 0 ) polyline = Polyline( init_points = [ (1.99 , 0.001) , (2.01 , 0.99)]) @@ -376,7 +376,7 @@ class FaultBlockTest(ExtendedTestCase): def test_add_polyline_barrier2(self): - grid = EclGrid.create_rectangular( (10,10,1) , (1,1,1) ) + grid = EclGrid.createRectangular( (10,10,1) , (1,1,1) ) layer = FaultBlockLayer( self.grid , 0 ) polyline = Polyline( init_points = [ (0.1 , 0.9) , (8.9,0.9) , (8.9,8.9) ]) @@ -407,11 +407,11 @@ class FaultBlockTest(ExtendedTestCase): def test_fault_block_layer_export(self): layer = FaultBlockLayer( self.grid , 1 ) - kw1 = EclKW.create( "FAULTBLK" , self.grid.size + 1 , EclTypeEnum.ECL_INT_TYPE ) + kw1 = EclKW( "FAULTBLK" , self.grid.getGlobalSize() + 1 , EclDataType.ECL_INT ) with self.assertRaises(ValueError): layer.exportKeyword( kw1 ) - kw2 = EclKW.create( "FAULTBLK" , self.grid.size , EclTypeEnum.ECL_FLOAT_TYPE ) + kw2 = EclKW( "FAULTBLK" , self.grid.getGlobalSize() , EclDataType.ECL_FLOAT ) with self.assertRaises(TypeError): layer.exportKeyword(kw2) @@ -436,7 +436,7 @@ class FaultBlockTest(ExtendedTestCase): fileH.write("/\n") - kw = EclKW.read_grdecl(open("faultblock.grdecl") , "FAULTBLK" , ecl_type = EclTypeEnum.ECL_INT_TYPE) + kw = EclKW.read_grdecl(open("faultblock.grdecl") , "FAULTBLK" , ecl_type = EclDataType.ECL_INT) with open("faults.grdecl" , "w") as f: f.write("FAULTS\n") f.write("\'FX\' 4 4 1 4 1 1 'X' /\n") diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_fault_blocks_statoil.py b/ThirdParty/Ert/python/tests/ecl/test_fault_blocks_statoil.py similarity index 88% rename from ThirdParty/Ert/python/tests/core/ecl/test_fault_blocks_statoil.py rename to ThirdParty/Ert/python/tests/ecl/test_fault_blocks_statoil.py index 0225105108..8be7f2fc0a 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_fault_blocks_statoil.py +++ b/ThirdParty/Ert/python/tests/ecl/test_fault_blocks_statoil.py @@ -19,15 +19,15 @@ try: except ImportError: from unittest import skipIf -from ert.ecl import EclGrid, EclTypeEnum , EclKW -from ert.test import ExtendedTestCase -from ert.ecl.faults import FaultBlock, FaultBlockLayer +from ecl.ecl import EclGrid, EclDataType , EclKW +from ecl.test import ExtendedTestCase +from ecl.ecl.faults import FaultBlock, FaultBlockLayer class FaultBlockTest(ExtendedTestCase): def setUp(self): self.grid = EclGrid( self.createTestPath("Statoil/ECLIPSE/Mariner/MARINER.EGRID")) fileH = open( self.createTestPath("Statoil/ECLIPSE/Mariner/faultblock.grdecl") ) - self.kw = EclKW.read_grdecl( fileH , "FAULTBLK" , ecl_type = EclTypeEnum.ECL_INT_TYPE ) + self.kw = EclKW.read_grdecl( fileH , "FAULTBLK" , ecl_type = EclDataType.ECL_INT ) diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_faults.py b/ThirdParty/Ert/python/tests/ecl/test_faults.py similarity index 95% rename from ThirdParty/Ert/python/tests/core/ecl/test_faults.py rename to ThirdParty/Ert/python/tests/ecl/test_faults.py index 0407f4a65b..aa73ceae9f 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_faults.py +++ b/ThirdParty/Ert/python/tests/ecl/test_faults.py @@ -17,19 +17,19 @@ from unittest import skipIf import time -from ert import util +from ecl import util -from ert.ecl.faults import FaultCollection, Fault, FaultLine, FaultSegment,FaultBlockLayer -from ert.ecl import EclGrid, EclKW, EclTypeEnum -from ert.test import ExtendedTestCase, TestAreaContext -from ert.geo import Polyline , CPolyline +from ecl.ecl.faults import FaultCollection, Fault, FaultLine, FaultSegment,FaultBlockLayer +from ecl.ecl import EclGrid, EclKW, EclDataType +from ecl.test import ExtendedTestCase, TestAreaContext +from ecl.geo import Polyline , CPolyline class FaultTest(ExtendedTestCase): @classmethod def setUpClass(cls): - cls.grid = EclGrid.create_rectangular( (151,100,50) , (1,1,1)) - + cls.grid = EclGrid.createRectangular( (151,100,50) , (1,1,1)) + def setUp(self): self.faults1 = self.createTestPath("local/ECLIPSE/FAULTS/fault1.grdecl") self.faults2 = self.createTestPath("local/ECLIPSE/FAULTS/fault2.grdecl") @@ -39,7 +39,7 @@ class FaultTest(ExtendedTestCase): nx = 10 ny = 10 nz = 10 - grid = EclGrid.create_rectangular( (nx,ny,nz) , (0.1,0.1,0.1)) + grid = EclGrid.createRectangular( (nx,ny,nz) , (0.1,0.1,0.1)) f = Fault(grid , "F") f.addRecord(0 , 1 , 0 , 0 , 0,0 , "Y-") f.addRecord(2 , 2 , 0 , 1 , 0,0 , "X-") @@ -119,7 +119,7 @@ class FaultTest(ExtendedTestCase): nx = 10 ny = 10 nz = 2 - grid = EclGrid.create_rectangular( (nx,ny,nz) , (0.1,0.1,0.1)) + grid = EclGrid.createRectangular( (nx,ny,nz) , (0.1,0.1,0.1)) fl = FaultLine(grid , 0) C1 = (nx + 1) * 5 + 3 C2 = C1 + 2 @@ -204,7 +204,7 @@ class FaultTest(ExtendedTestCase): def test_connect_faults(self): - grid = EclGrid.create_rectangular( (100,100,10) , (1,1,1)) + grid = EclGrid.createRectangular( (100,100,10) , (1,1,1)) # Fault1 Fault4 # | | @@ -359,7 +359,7 @@ class FaultTest(ExtendedTestCase): def test_join_faults(self): - grid = EclGrid.create_rectangular( (100,100,10) , (1,1,1)) + grid = EclGrid.createRectangular( (100,100,10) , (1,1,1)) # Fault1 Fault4 # | | @@ -391,7 +391,7 @@ class FaultTest(ExtendedTestCase): def test_contact(self): - grid = EclGrid.create_rectangular( (100,100,10) , (1,1,1)) + grid = EclGrid.createRectangular( (100,100,10) , (1,1,1)) # Fault1 Fault4 # | | @@ -500,7 +500,7 @@ class FaultTest(ExtendedTestCase): nx = 120 ny = 60 nz = 43 - grid = EclGrid.create_rectangular( (nx , ny , nz) , (1,1,1) ) + grid = EclGrid.createRectangular( (nx , ny , nz) , (1,1,1) ) with TestAreaContext("python/faults/line_order"): with open("faults.grdecl" , "w") as f: f.write("""FAULTS @@ -540,7 +540,7 @@ class FaultTest(ExtendedTestCase): nx = 10 ny = 8 nz = 7 - grid = EclGrid.create_rectangular( (nx , ny , nz) , (1,1,1) ) + grid = EclGrid.createRectangular( (nx , ny , nz) , (1,1,1) ) faults_file = self.createTestPath("local/ECLIPSE/FAULTS/faults_nb.grdecl") faults = FaultCollection( grid , faults_file ) @@ -601,7 +601,7 @@ class FaultTest(ExtendedTestCase): def test_polyline_intersection(self): - grid = EclGrid.create_rectangular( (100,100,10) , (0.25 , 0.25 , 1)) + grid = EclGrid.createRectangular( (100,100,10) , (0.25 , 0.25 , 1)) # Fault1 Fault4 # | | @@ -642,7 +642,7 @@ class FaultTest(ExtendedTestCase): nx = 10 ny = 10 nz = 1 - grid = EclGrid.create_rectangular( (nx , ny , nz) , (1,1,1) ) + grid = EclGrid.createRectangular( (nx , ny , nz) , (1,1,1) ) with TestAreaContext("python/faults/line_order"): with open("faults.grdecl" , "w") as f: f.write("""FAULTS @@ -660,7 +660,7 @@ class FaultTest(ExtendedTestCase): def test_extend_to_polyline(self): - grid = EclGrid.create_rectangular( (3,3,1) , (1 , 1 , 1)) + grid = EclGrid.createRectangular( (3,3,1) , (1 , 1 , 1)) # o o o o # @@ -688,7 +688,7 @@ class FaultTest(ExtendedTestCase): def test_extend_polyline_on(self): - grid = EclGrid.create_rectangular( (3,3,1) , (1 , 1 , 1)) + grid = EclGrid.createRectangular( (3,3,1) , (1 , 1 , 1)) # o o o o # @@ -720,13 +720,13 @@ class FaultTest(ExtendedTestCase): def test_stepped(self): - grid = EclGrid.create_rectangular( (6,1,4) , (1,1,1)) + grid = EclGrid.createRectangular( (6,1,4) , (1,1,1)) f = Fault(grid , "F") f.addRecord(4,4,0,0,0,1,"X") f.addRecord(2,2,0,0,1,1,"Z") f.addRecord(1,1,0,0,2,3,"X") - block_kw = EclKW.create("FAULTBLK" , grid.getGlobalSize() , EclTypeEnum.ECL_INT_TYPE) + block_kw = EclKW("FAULTBLK" , grid.getGlobalSize() , EclDataType.ECL_INT) block_kw.assign(1) block_kw[5] = 2 block_kw[11] = 2 @@ -761,7 +761,7 @@ class FaultTest(ExtendedTestCase): def test_connectWithPolyline(self): - grid = EclGrid.create_rectangular( (4,4,1) , (1 , 1 , 1)) + grid = EclGrid.createRectangular( (4,4,1) , (1 , 1 , 1)) # o o o o o diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_fortio.py b/ThirdParty/Ert/python/tests/ecl/test_fortio.py similarity index 87% rename from ThirdParty/Ert/python/tests/core/ecl/test_fortio.py rename to ThirdParty/Ert/python/tests/ecl/test_fortio.py index 36a635e8fb..01e51ff3d3 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_fortio.py +++ b/ThirdParty/Ert/python/tests/ecl/test_fortio.py @@ -16,8 +16,8 @@ # for more details. import os from random import randint -from ert.ecl import FortIO, EclTypeEnum, EclKW , openFortIO, EclFile -from ert.test import ExtendedTestCase, TestAreaContext +from ecl.ecl import FortIO, EclDataType, EclKW , openFortIO, EclFile +from ecl.test import ExtendedTestCase, TestAreaContext @@ -37,8 +37,8 @@ class FortIOTest(ExtendedTestCase): f = FortIO("odes_not_exist", FortIO.READ_MODE) def test_kw(self): - kw1 = EclKW.create("KW1", 2, EclTypeEnum.ECL_INT_TYPE) - kw2 = EclKW.create("KW2", 2, EclTypeEnum.ECL_INT_TYPE) + kw1 = EclKW("KW1", 2, EclDataType.ECL_INT) + kw2 = EclKW("KW2", 2, EclDataType.ECL_INT) kw1[0] = 99 kw1[1] = 77 @@ -61,8 +61,8 @@ class FortIOTest(ExtendedTestCase): def test_truncate(self): - kw1 = EclKW.create("KW1", 2, EclTypeEnum.ECL_INT_TYPE) - kw2 = EclKW.create("KW2", 2, EclTypeEnum.ECL_INT_TYPE) + kw1 = EclKW("KW1", 2, EclDataType.ECL_INT) + kw2 = EclKW("KW2", 2, EclDataType.ECL_INT) kw1[0] = 99 kw1[1] = 77 @@ -110,7 +110,7 @@ class FortIOTest(ExtendedTestCase): def test_context(self): with TestAreaContext("python/fortio/context") as t: - kw1 = EclKW.create("KW" , 2456 , EclTypeEnum.ECL_FLOAT_TYPE) + kw1 = EclKW("KW" , 2456 , EclDataType.ECL_FLOAT) for i in range(len(kw1)): kw1[i] = randint(0,1000) @@ -128,7 +128,7 @@ class FortIOTest(ExtendedTestCase): def test_is_fortran_file(self): with TestAreaContext("python/fortio/guess"): - kw1 = EclKW.create("KW" , 12345 , EclTypeEnum.ECL_FLOAT_TYPE) + kw1 = EclKW("KW" , 12345 , EclDataType.ECL_FLOAT) with openFortIO("fortran_file" , mode = FortIO.WRITE_MODE) as f: kw1.fwrite( f ) diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_geertsma.py b/ThirdParty/Ert/python/tests/ecl/test_geertsma.py similarity index 82% rename from ThirdParty/Ert/python/tests/core/ecl/test_geertsma.py rename to ThirdParty/Ert/python/tests/ecl/test_geertsma.py index f7665196e9..5ff2850716 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_geertsma.py +++ b/ThirdParty/Ert/python/tests/ecl/test_geertsma.py @@ -1,13 +1,13 @@ import datetime -from ert.ecl import EclGrid, EclKW, EclTypeEnum, openFortIO, FortIO, EclFile, EclSubsidence +from ecl.ecl import EclGrid, EclKW, EclDataType, openFortIO, FortIO, EclFile, EclSubsidence -from ert.test import ExtendedTestCase , TestAreaContext +from ecl.test import ExtendedTestCase , TestAreaContext import numpy as np def create_init(grid, case): - poro = EclKW("PORO", grid.getNumActive(), EclTypeEnum.ECL_FLOAT_TYPE) + poro = EclKW("PORO", grid.getNumActive(), EclDataType.ECL_FLOAT) porv = poro.copy() porv.setName("PORV") for g in range(grid.getGlobalSize()): @@ -20,13 +20,13 @@ def create_init(grid, case): def create_restart(grid, case, p1, p2=None): with openFortIO("%s.UNRST" % case, mode=FortIO.WRITE_MODE) as f: - seq_hdr = EclKW("SEQNUM", 1, EclTypeEnum.ECL_FLOAT_TYPE) + seq_hdr = EclKW("SEQNUM", 1, EclDataType.ECL_FLOAT) seq_hdr[0] = 10 - p = EclKW("PRESSURE", grid.getNumActive(), EclTypeEnum.ECL_FLOAT_TYPE) + p = EclKW("PRESSURE", grid.getNumActive(), EclDataType.ECL_FLOAT) for i in range(len(p1)): p[i] = p1[i] - header = EclKW("INTEHEAD", 67, EclTypeEnum.ECL_INT_TYPE) + header = EclKW("INTEHEAD", 67, EclDataType.ECL_INT) header[64] = 1 header[65] = 1 header[66] = 2000 @@ -72,12 +72,12 @@ class GeertsmaTest(ExtendedTestCase): receiver = (1000, 1000, 0) dz = subsidence.evalGeertsma("S1", None, receiver, youngs_modulus, poisson_ratio, seabed) - np.testing.assert_almost_equal(dz, -3.944214576168326e-09) + np.testing.assert_almost_equal(dz, 3.944214576168326e-09) receiver = (1000, 1000, topres - seabed - above) dz = subsidence.evalGeertsma("S1", None, receiver, youngs_modulus, poisson_ratio, seabed) - np.testing.assert_almost_equal(dz, -5.8160298201497136e-08) + np.testing.assert_almost_equal(dz, 5.8160298201497136e-08) @staticmethod def test_geertsma_kernel_2_source_points_2_vintages(): @@ -105,15 +105,15 @@ class GeertsmaTest(ExtendedTestCase): receiver = (1000, 1000, 0) dz1 = subsidence.evalGeertsma("S1", None, receiver, youngs_modulus, poisson_ratio, seabed) - np.testing.assert_almost_equal(dz1, -8.65322541521704e-07) + np.testing.assert_almost_equal(dz1, 8.65322541521704e-07) dz2 = subsidence.evalGeertsma("S2", None, receiver, youngs_modulus, poisson_ratio, seabed) - np.testing.assert_almost_equal(dz2, -2.275556615015282e-06) + np.testing.assert_almost_equal(dz2, 2.275556615015282e-06) - np.testing.assert_almost_equal(dz2-dz1, -1.4102340734935779e-06) + np.testing.assert_almost_equal(dz1-dz2, -1.4102340734935779e-06) dz = subsidence.evalGeertsma("S1", "S2", receiver, youngs_modulus, poisson_ratio, seabed) - np.testing.assert_almost_equal(dz, -1.4102340734935779e-06) + np.testing.assert_almost_equal(dz, dz1-dz2) @staticmethod def test_geertsma_kernel_seabed(): @@ -139,6 +139,6 @@ class GeertsmaTest(ExtendedTestCase): receiver = (1000, 1000, topres - seabed - above) dz = subsidence.evalGeertsma("S1", None, receiver, youngs_modulus, poisson_ratio, seabed) - np.testing.assert_almost_equal(dz, -5.819790154474284e-08) + np.testing.assert_almost_equal(dz, 5.819790154474284e-08) diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_grav.py b/ThirdParty/Ert/python/tests/ecl/test_grav.py similarity index 73% rename from ThirdParty/Ert/python/tests/core/ecl/test_grav.py rename to ThirdParty/Ert/python/tests/ecl/test_grav.py index 816b059cfc..3772db8448 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_grav.py +++ b/ThirdParty/Ert/python/tests/ecl/test_grav.py @@ -1,6 +1,6 @@ import time -from ert.ecl import EclGrav, EclKW, EclGrid, EclFile, EclTypeEnum, openFortIO, FortIO -from ert.test import ExtendedTestCase , TestAreaContext +from ecl.ecl import EclGrav, EclKW, EclGrid, EclFile, EclDataType, openFortIO, FortIO +from ecl.test import ExtendedTestCase , TestAreaContext class EclGravTest(ExtendedTestCase): @@ -14,7 +14,7 @@ class EclGravTest(ExtendedTestCase): # The init file created here only contains a PORO field. More # properties must be added to this before it can be used for # any usefull gravity calculations. - poro = EclKW( "PORO" , self.grid.getGlobalSize() , EclTypeEnum.ECL_FLOAT_TYPE ) + poro = EclKW( "PORO" , self.grid.getGlobalSize() , EclDataType.ECL_FLOAT ) with TestAreaContext("grav_init"): with openFortIO( "TEST.INIT" , mode = FortIO.WRITE_MODE ) as f: poro.fwrite( f ) diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_grdecl.py b/ThirdParty/Ert/python/tests/ecl/test_grdecl.py similarity index 98% rename from ThirdParty/Ert/python/tests/core/ecl/test_grdecl.py rename to ThirdParty/Ert/python/tests/ecl/test_grdecl.py index 3ff4f63b01..7c6b1b05c6 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_grdecl.py +++ b/ThirdParty/Ert/python/tests/ecl/test_grdecl.py @@ -16,8 +16,8 @@ # for more details. import os -from ert.ecl import EclKW,EclGrid,Ecl3DKW -from ert.test import ExtendedTestCase +from ecl.ecl import EclKW,EclGrid,Ecl3DKW +from ecl.test import ExtendedTestCase diff --git a/ThirdParty/Ert/python/tests/ecl/test_grid.py b/ThirdParty/Ert/python/tests/ecl/test_grid.py new file mode 100644 index 0000000000..08dded9868 --- /dev/null +++ b/ThirdParty/Ert/python/tests/ecl/test_grid.py @@ -0,0 +1,553 @@ +#!/usr/bin/env python +# Copyright (C) 2014 Statoil ASA, Norway. +# +# The file 'test_grid.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT 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. +# +# ERT 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 +# for more details. +import os.path +from unittest import skipIf +import time +import itertools +from numpy import linspace + +from ecl.util import IntVector +from ecl.ecl import EclGrid, EclKW, EclDataType, EclUnitTypeEnum, EclFile +from ecl.ecl import EclGridGenerator as GridGen +from ecl.ecl.faults import Layer , FaultCollection +from ecl.test import ExtendedTestCase , TestAreaContext + +# This dict is used to verify that corners are mapped to the correct +# cell with respect to containment. +CORNER_HOME = { + (0, 0, 0) : 0, (0, 0, 1) : 9, (0, 0, 2) : 18, (0, 0, 3) : 18, + (0, 1, 0) : 3, (0, 1, 1) : 12, (0, 1, 2) : 21, (0, 1, 3) : 21, + (0, 2, 0) : 6, (0, 2, 1) : 15, (0, 2, 2) : 24, (0, 2, 3) : 24, + (0, 3, 0) : 6, (0, 3, 1) : 15, (0, 3, 2) : 24, (0, 3, 3) : 24, + (1, 0, 0) : 1, (1, 0, 1) : 10, (1, 0, 2) : 19, (1, 0, 3) : 19, + (1, 1, 0) : 4, (1, 1, 1) : 13, (1, 1, 2) : 22, (1, 1, 3) : 22, + (1, 2, 0) : 7, (1, 2, 1) : 16, (1, 2, 2) : 25, (1, 2, 3) : 25, + (1, 3, 0) : 7, (1, 3, 1) : 16, (1, 3, 2) : 25, (1, 3, 3) : 25, + (2, 0, 0) : 2, (2, 0, 1) : 11, (2, 0, 2) : 20, (2, 0, 3) : 20, + (2, 1, 0) : 5, (2, 1, 1) : 14, (2, 1, 2) : 23, (2, 1, 3) : 23, + (2, 2, 0) : 8, (2, 2, 1) : 17, (2, 2, 2) : 26, (2, 2, 3) : 26, + (2, 3, 0) : 8, (2, 3, 1) : 17, (2, 3, 2) : 26, (2, 3, 3) : 26, + (3, 0, 0) : 2, (3, 0, 1) : 11, (3, 0, 2) : 20, (3, 0, 3) : 20, + (3, 1, 0) : 5, (3, 1, 1) : 14, (3, 1, 2) : 23, (3, 1, 3) : 23, + (3, 2, 0) : 8, (3, 2, 1) : 17, (3, 2, 2) : 26, (3, 2, 3) : 26, + (3, 3, 0) : 8, (3, 3, 1) : 17, (3, 3, 2) : 26, (3, 3, 3) : 26 +} + +def createVolumeTestGridBase(dim, dV, offset=1): + return [ + GridGen.createGrid(dim, dV, offset=0), + GridGen.createGrid(dim, dV, offset=offset), + GridGen.createGrid(dim, dV, offset=offset, irregular_offset=True), + GridGen.createGrid(dim, dV, offset=offset, concave=True), + GridGen.createGrid(dim, dV, offset=offset, irregular=True), + GridGen.createGrid(dim, dV, offset=offset, concave=True, irregular=True), + GridGen.createGrid(dim, dV, offset=offset, irregular_offset=True, concave=True), + GridGen.createGrid(dim, dV, offset=0, faults=True), + GridGen.createGrid(dim, dV, offset=offset, faults=True), + GridGen.createGrid(dim, dV, escape_origo_shift=(100, 100, 0), scale=2), + GridGen.createGrid(dim, dV, escape_origo_shift=(100, 100, 0), scale=0.5), + GridGen.createGrid(dim, dV, escape_origo_shift=(100, 100, 0), translation=(50,50,0)), + GridGen.createGrid(dim, dV, escape_origo_shift=(100, 100, 0), rotate=True), + GridGen.createGrid(dim, dV, escape_origo_shift=(100, 100, 0), misalign=True), + GridGen.createGrid(dim, dV, offset=offset, escape_origo_shift=(100, 100, 0), + irregular_offset=True, concave=True, irregular=True, + scale=1.5, translation=(5,5,0), rotate=True, + misalign=True) + ] + +def createContainmentTestBase(): + return [ + (3, GridGen.createGrid((6,6,6), (1,1,1), offset=1)), + (10, GridGen.createGrid((3,3,3), (1,1,1), offset=1, concave=True)), + (4, GridGen.createGrid((10,10,1), (1,1,1), offset=0., misalign=True)), + (3, + GridGen.createGrid((6,6,6), (1,1,1), offset=0., + escape_origo_shift=(100, 100, 0), + irregular_offset=True, concave=True, irregular=True, + scale=1.5, translation=(5,5,0), + misalign=True + ) + ) + ] + +def getMinMaxValue(grid): + corners = [ + grid.getCellCorner(i, cell) + for i in range(8) + for cell in range(grid.getGlobalSize()) + ] + + return [(min(values), max(values)) for values in zip(*corners)] + +def createWrapperGrid(grid): + """ + Creates a grid that occupies the same space as the given grid, + but that consists of a single cell. + """ + + x, y, z = grid.getNX()-1, grid.getNY()-1, grid.getNZ()-1 + corner_pos = [ + (0, 0, 0), (x, 0, 0), (0, y, 0), (x, y, 0), + (0, 0, z), (x, 0, z), (0, y, z), (x, y, z) + ] + + corners = [ + grid.getCellCorner(i, ijk=pos) + for i, pos in enumerate(corner_pos) + ] + + return GridGen.createSingleCellGrid(corners) + +def average(points): + p = reduce(lambda a,b: (a[0]+b[0], a[1]+b[1], a[2]+b[2]), points) + return [elem/float(len(points)) for elem in p] + +# This test class should only have test cases which do not require +# external test data. Tests involving Statoil test data are in the +# test_grid_statoil module. +class GridTest(ExtendedTestCase): + + def test_oom_grid(self): + nx = 2000 + ny = 2000 + nz = 2000 + + with self.assertRaises(MemoryError): + grid = GridGen.createRectangular( (nx,ny,nz), (1,1,1)) + + + + def test_posXYEdge(self): + nx = 10 + ny = 11 + grid = GridGen.createRectangular( (nx,ny,1) , (1,1,1) ) + self.assertEqual( grid.findCellCornerXY(0,0,0) , 0 ) + self.assertEqual( grid.findCellCornerXY(nx,0,0) , nx) + self.assertEqual( grid.findCellCornerXY(0 , ny , 0) , (nx + 1 ) * ny ) + self.assertEqual( grid.findCellCornerXY(nx,ny,0) , (nx + 1 ) * (ny + 1) - 1) + + self.assertEqual( grid.findCellCornerXY(0.25,0,0) , 0 ) + self.assertEqual( grid.findCellCornerXY(0,0.25,0) , 0 ) + + self.assertEqual( grid.findCellCornerXY(nx - 0.25,0,0) , nx ) + self.assertEqual( grid.findCellCornerXY(nx , 0.25,0) , nx ) + + self.assertEqual( grid.findCellCornerXY(0 , ny - 0.25, 0) , (nx + 1 ) * ny ) + self.assertEqual( grid.findCellCornerXY(0.25 , ny , 0) , (nx + 1 ) * ny ) + + self.assertEqual( grid.findCellCornerXY(nx -0.25 ,ny,0) , (nx + 1 ) * (ny + 1) - 1) + self.assertEqual( grid.findCellCornerXY(nx , ny - 0.25,0) , (nx + 1 ) * (ny + 1) - 1) + + + def test_dims(self): + grid = GridGen.createRectangular( (10,20,30) , (1,1,1) ) + self.assertEqual( grid.getNX() , 10 ) + self.assertEqual( grid.getNY() , 20 ) + self.assertEqual( grid.getNZ() , 30 ) + self.assertEqual( grid.getGlobalSize() , 30*10*20 ) + + self.assertEqual( grid.getDims() , (10,20,30,6000) ) + + + + def test_create(self): + with self.assertRaises(ValueError): + grid = GridGen.createRectangular( (10,20,30) , (1,1,1) , actnum = [0,1,1,2]) + + with self.assertRaises(ValueError): + grid = GridGen.createRectangular( (10,20,30) , (1,1,1) , actnum = IntVector(initial_size = 10)) + + actnum = IntVector(default_value = 1 , initial_size = 6000) + actnum[0] = 0 + actnum[1] = 0 + grid = GridGen.createRectangular( (10,20,30) , (1,1,1) , actnum = actnum) + self.assertEqual( grid.getNumActive( ) , 30*20*10 - 2) + + def test_repr_and_name(self): + grid = GridGen.createRectangular((2,2,2), (10,10,10), actnum=[0,0,0,0,1,1,1,1]) + pfx = 'EclGrid(' + rep = repr(grid) + self.assertEqual(pfx, rep[:len(pfx)]) + self.assertEqual(type(rep), type('')) + self.assertEqual(type(grid.getName()), type('')) + with TestAreaContext("python/ecl_grid/repr"): + grid.save_EGRID("CASE.EGRID") + g2 = EclGrid("CASE.EGRID") + r2 = repr(g2) + self.assertEqual(pfx, r2[:len(pfx)]) + self.assertEqual(type(r2), type('')) + self.assertEqual(type(g2.getName()), type('')) + + def test_node_pos(self): + grid = GridGen.createRectangular( (10,20,30) , (1,1,1) ) + with self.assertRaises(IndexError): + grid.getNodePos(-1,0,0) + + with self.assertRaises(IndexError): + grid.getNodePos(11,0,0) + + p0 = grid.getNodePos(0,0,0) + self.assertEqual( p0 , (0,0,0)) + + p7 = grid.getNodePos(10,20,30) + self.assertEqual( p7 , (10,20,30)) + + + def test_truncated_file(self): + grid = GridGen.createRectangular( (10,20,30) , (1,1,1) ) + with TestAreaContext("python/ecl_grid/truncated"): + grid.save_EGRID( "TEST.EGRID") + + size = os.path.getsize( "TEST.EGRID") + with open("TEST.EGRID" , "r+") as f: + f.truncate( size / 2 ) + + with self.assertRaises(IOError): + EclGrid("TEST.EGRID") + + def test_posXY1(self): + nx = 4 + ny = 1 + nz = 1 + grid = GridGen.createRectangular( (nx,ny,nz) , (1,1,1) ) + (i,j) = grid.findCellXY( 0.5 , 0.5, 0 ) + self.assertEqual(i , 0) + self.assertEqual(j , 0) + + (i,j) = grid.findCellXY( 3.5 , 0.5, 0 ) + self.assertEqual(i , 3) + self.assertEqual(j , 0) + + + def test_init_ACTNUM(self): + nx = 10 + ny = 23 + nz = 7 + grid = GridGen.createRectangular( (nx,ny,nz) , (1,1,1) ) + actnum = grid.exportACTNUM() + + self.assertEqual( len(actnum) , nx*ny*nz ) + self.assertEqual( actnum[0] , 1 ) + self.assertEqual( actnum[nx*ny*nz - 1] , 1 ) + + actnum_kw = grid.exportACTNUMKw( ) + self.assertEqual(len(actnum_kw) , len(actnum)) + for a1,a2 in zip(actnum, actnum_kw): + self.assertEqual(a1, a2) + + + def test_posXY(self): + nx = 10 + ny = 23 + nz = 7 + grid = GridGen.createRectangular( (nx,ny,nz) , (1,1,1) ) + with self.assertRaises(IndexError): + grid.findCellXY( 1 , 1, -1 ) + + with self.assertRaises(IndexError): + grid.findCellXY( 1 , 1, nz + 1 ) + + with self.assertRaises(ValueError): + grid.findCellXY(15 , 78 , 2) + + + i,j = grid.findCellXY( 1.5 , 1.5 , 2 ) + self.assertEqual(i , 1) + self.assertEqual(j , 1) + + + for i in range(nx): + for j in range(ny): + p = grid.findCellXY(i + 0.5 , j+ 0.5 , 0) + self.assertEqual( p[0] , i ) + self.assertEqual( p[1] , j ) + + c = grid.findCellCornerXY( 0.10 , 0.10 , 0 ) + self.assertEqual(c , 0) + + c = grid.findCellCornerXY( 0.90 , 0.90 , 0 ) + self.assertEqual( c , (nx + 1) + 1 ) + + c = grid.findCellCornerXY( 0.10 , 0.90 , 0 ) + self.assertEqual( c , (nx + 1) ) + + c = grid.findCellCornerXY( 0.90 , 0.90 , 0 ) + self.assertEqual( c , (nx + 1) + 1 ) + + c = grid.findCellCornerXY( 0.90 , 0.10 , 0 ) + self.assertEqual( c , 1 ) + + def test_compressed_copy(self): + nx = 10 + ny = 10 + nz = 10 + grid = GridGen.createRectangular( (nx,ny,nz) , (1,1,1) ) + kw1 = EclKW("KW" , 1001 , EclDataType.ECL_INT ) + with self.assertRaises(ValueError): + cp = grid.compressedKWCopy( kw1 ) + + + def test_dxdydz(self): + nx = 10 + ny = 10 + nz = 10 + grid = GridGen.createRectangular( (nx,ny,nz) , (2,3,4) ) + + (dx,dy,dz) = grid.getCellDims( active_index = 0 ) + self.assertEqual( dx , 2 ) + self.assertEqual( dy , 3 ) + self.assertEqual( dz , 4 ) + + def test_numpy3D(self): + nx = 10 + ny = 7 + nz = 5 + grid = GridGen.createRectangular((nx,ny,nz) , (1,1,1)) + kw = EclKW( "SWAT" , nx*ny*nz , EclDataType.ECL_FLOAT ) + numpy_3d = grid.create3D( kw ) + + def test_len(self): + nx = 10 + ny = 11 + nz = 12 + actnum = EclKW( "ACTNUM" , nx*ny*nz , EclDataType.ECL_INT ) + actnum[0] = 1 + actnum[1] = 1 + actnum[2] = 1 + actnum[3] = 1 + + grid = GridGen.createRectangular( (nx,ny,nz) , (1,1,1), actnum = actnum) + self.assertEqual( len(grid) , nx*ny*nz ) + self.assertEqual( grid.getNumActive( ) , 4 ) + + + def test_output_units(self): + n = 10 + a = 1 + grid = GridGen.createRectangular( (n,n,n), (a,a,a)) + + with TestAreaContext("python/ecl_grid/units"): + grid.save_EGRID( "CASE.EGRID" , output_unit = EclUnitTypeEnum.ECL_FIELD_UNITS ) + f = EclFile("CASE.EGRID") + g = f["GRIDUNIT"][0] + self.assertEqual( g[0].strip( ) , "FEET" ) + g2 = EclGrid("CASE.EGRID") + self.assertFloatEqual( g2.cell_volume( global_index = 0 ) , 3.28084*3.28084*3.28084) + + + grid.save_EGRID( "CASE.EGRID" ) + f = EclFile("CASE.EGRID") + g = f["GRIDUNIT"][0] + self.assertEqual( g[0].strip( ) , "METRES" ) + + grid.save_EGRID( "CASE.EGRID" , output_unit = EclUnitTypeEnum.ECL_LAB_UNITS) + f = EclFile("CASE.EGRID") + g = f["GRIDUNIT"][0] + self.assertEqual( g[0].strip() , "CM" ) + g2 = EclGrid("CASE.EGRID") + self.assertFloatEqual( g2.cell_volume( global_index = 0 ) , 100*100*100 ) + + def test_volume(self): + dim = (10,10,10) + dV = (2,2,2) + + grids = createVolumeTestGridBase(dim, dV) + for grid in grids: + tot_vol = createWrapperGrid(grid).cell_volume(0) + cell_volumes = [grid.cell_volume(i) for i in range(grid.getGlobalSize())] + self.assertTrue(min(cell_volumes) >= 0) + self.assertFloatEqual(sum(cell_volumes), tot_vol) + + def test_unique_containment(self): + test_base = createContainmentTestBase() + + for steps_per_unit, grid in test_base: + wgrid = createWrapperGrid(grid) + + (xmin, xmax), (ymin, ymax), (zmin, zmax) = getMinMaxValue(wgrid) + x_space = linspace(xmin-1, xmax+1, (xmax-xmin+2)*steps_per_unit+1) + y_space = linspace(ymin-1, ymax+1, (ymax-ymin+2)*steps_per_unit+1) + z_space = linspace(zmin-1, zmax+1, (zmax-zmin+2)*steps_per_unit+1) + + for x, y, z in itertools.product(x_space, y_space, z_space): + hits = [ + grid.cell_contains(x, y, z, i) + for i in range(grid.getGlobalSize()) + ].count(True) + + self.assertTrue(hits in [0, 1]) + + self.assertEqual( + 1 if wgrid.cell_contains(x, y, z, 0) else 0, + hits + ) + + def test_cell_corner_containment(self): + n = 4 + d = 10 + grid = GridGen.createRectangular( (n, n, n), (d, d, d)) + + for x, y, z in itertools.product(range(0, n*d+1, d), repeat=3): + self.assertEqual( + 1, + [grid.cell_contains(x, y, z, i) for i in range(n**3)].count(True) + ) + + def test_cell_corner_containment_compatability(self): + grid = GridGen.createRectangular( (3,3,3), (1,1,1) ) + + for x, y, z in itertools.product(range(4), repeat=3): + for i in range(27): + if grid.cell_contains(x, y, z, i): + self.assertEqual( + CORNER_HOME[(x,y,z)], + i + ) + + def test_cell_face_containment(self): + n = 4 + d = 10 + grid = GridGen.createRectangular( (n, n, n), (d, d, d)) + + for x, y, z in itertools.product(range(d/2, n*d, d), repeat=3): + for axis, direction in itertools.product(range(3), [-1, 1]): + p = [x, y, z] + p[axis] = p[axis] + direction*d/2 + self.assertEqual( + 1, + [grid.cell_contains(p[0], p[1], p[2], i) for i in range(n**3)].count(True) + ) + + # This test generates a cell that is concave on ALL 6 sides + def test_concave_cell_containment(self): + points = [ + (5, 5, 5), + (20, 10, 10), + (10, 20, 10), + (25, 25, 5), + (10, 10, 20), + (25, 5, 25), + (5, 25, 25), + (20, 20, 20) + ] + + grid = GridGen.createSingleCellGrid(points) + + assertPoint = lambda p : self.assertTrue( + grid.cell_contains(p[0], p[1], p[2], 0) + ) + + assertNotPoint = lambda p : self.assertFalse( + grid.cell_contains(p[0], p[1], p[2], 0) + ) + + # Cell center + assertPoint(average(points)); + + # "Side" center + assertNotPoint(average(points[0:4:])) + assertNotPoint(average(points[4:8:])) + assertNotPoint(average(points[1:8:2])) + assertNotPoint(average(points[0:8:2])) + assertNotPoint(average(points[0:8:4] + points[1:8:4])) + assertNotPoint(average(points[2:8:4] + points[3:8:4])) + + # Corners + for p in points: + assertPoint(p) + + # Edges + edges = ([(i, i+1) for i in range(0, 8, 2)] + + [(i, i+2) for i in [0, 1, 4, 5]] + + [(i, i+4) for i in range(4)] + + [(1,2), (2,7), (1,7), (4,7), (2,4), (4,1)]) + for a,b in edges: + assertPoint(average([points[a], points[b]])) + + # Epsilon inside from corners + middle_point = average(points) + for p in points: + assertPoint(average(20*[p] + [middle_point])) + + # Espilon outside + middle_point[2] = 0 + for p in points[0:4:]: + assertNotPoint(average(20*[p] + [middle_point])) + + middle_point[2] = 30 + for p in points[4:8:]: + assertNotPoint(average(20*[p] + [middle_point])) + + # This test generates a cell that is strictly convex on ALL 6 sides + def test_concvex_cell_containment(self): + points = [ + (10, 10, 10), + (25, 5, 5), + (5, 25, 5), + (20, 20, 10), + (5, 5, 25), + (20, 10, 20), + (10, 20, 20), + (25, 25, 25) + ] + + grid = GridGen.createSingleCellGrid(points) + + assertPoint = lambda p : self.assertTrue( + grid.cell_contains(p[0], p[1], p[2], 0) + ) + + assertNotPoint = lambda p : self.assertFalse( + grid.cell_contains(p[0], p[1], p[2], 0) + ) + + # Cell center + assertPoint(average(points)); + + # "Side" center + assertPoint(average(points[0:4:])) + assertPoint(average(points[4:8:])) + assertPoint(average(points[1:8:2])) + assertPoint(average(points[0:8:2])) + assertPoint(average(points[0:8:4] + points[1:8:4])) + assertPoint(average(points[2:8:4] + points[3:8:4])) + + # Corners + for p in points: + assertPoint(p) + + # Edges + edges = ([(i, i+1) for i in range(0, 8, 2)] + + [(i, i+2) for i in [0, 1, 4, 5]] + + [(i, i+4) for i in range(4)] + + [(1,2), (2,7), (1,7), (4,7), (2,4), (4,1)]) + for a,b in edges: + assertPoint(average([points[a], points[b]])) + + # Epsilon inside from corners + middle_point = average(points) + for p in points: + assertPoint(average(20*[p] + [middle_point])) + + # Espilon outside + middle_point[2] = 0 + for p in points[0:4:]: + assertNotPoint(average(20*[p] + [middle_point])) + + middle_point[2] = 30 + for p in points[4:8:]: + assertNotPoint(average(20*[p] + [middle_point])) diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_grid_statoil.py b/ThirdParty/Ert/python/tests/ecl/test_grid_statoil.py similarity index 92% rename from ThirdParty/Ert/python/tests/core/ecl/test_grid_statoil.py rename to ThirdParty/Ert/python/tests/ecl/test_grid_statoil.py index 96f4a2c011..db64e14680 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_grid_statoil.py +++ b/ThirdParty/Ert/python/tests/ecl/test_grid_statoil.py @@ -22,9 +22,9 @@ except ImportError: from unittest import skipIf import time -from ert.ecl import EclTypeEnum, EclKW, EclGrid, EclFile, openEclFile -from ert.util import DoubleVector, IntVector -from ert.test import ExtendedTestCase , TestAreaContext +from ecl.ecl import EclDataType, EclKW, EclGrid, EclFile, openEclFile +from ecl.util import DoubleVector, IntVector +from ecl.test import ExtendedTestCase , TestAreaContext class GridTest(ExtendedTestCase): @@ -107,7 +107,7 @@ class GridTest(ExtendedTestCase): def test_EGRID( self ): grid = EclGrid(self.egrid_file()) self.assertTrue(grid) - dims = grid.dims + dims = grid.getDims() self.assertEqual(dims[0] , grid.getNX()) self.assertEqual(dims[1] , grid.getNY()) self.assertEqual(dims[2] , grid.getNZ()) @@ -116,11 +116,11 @@ class GridTest(ExtendedTestCase): def create(self, filename, load_actnum=True): fileH = open(filename, "r") - specgrid = EclKW.read_grdecl(fileH, "SPECGRID", ecl_type=EclTypeEnum.ECL_INT_TYPE, strict=False) + specgrid = EclKW.read_grdecl(fileH, "SPECGRID", ecl_type=EclDataType.ECL_INT, strict=False) zcorn = EclKW.read_grdecl(fileH, "ZCORN") coord = EclKW.read_grdecl(fileH, "COORD") if load_actnum: - actnum = EclKW.read_grdecl(fileH, "ACTNUM", ecl_type=EclTypeEnum.ECL_INT_TYPE) + actnum = EclKW.read_grdecl(fileH, "ACTNUM", ecl_type=EclDataType.ECL_INT) else: actnum = None @@ -291,20 +291,20 @@ class GridTest(ExtendedTestCase): def test_dual(self): with TestAreaContext("python/grid-test/testDual"): grid = EclGrid(self.egrid_file()) - self.assertFalse(grid.dual_grid) - self.assertTrue(grid.nactive_fracture == 0) + self.assertFalse(grid.dualGrid()) + self.assertTrue(grid.getNumActiveFracture() == 0) grid2 = EclGrid(self.grid_file()) - self.assertFalse(grid.dual_grid) - self.assertTrue(grid.nactive_fracture == 0) + self.assertFalse(grid.dualGrid()) + self.assertTrue(grid.getNumActiveFracture() == 0) dgrid = EclGrid(self.createTestPath("Statoil/ECLIPSE/DualPoro/DUALPOR_MSW.EGRID")) - self.assertTrue(dgrid.nactive == dgrid.nactive_fracture) - self.assertTrue(dgrid.nactive == 46118) + self.assertTrue(dgrid.getNumActive() == dgrid.getNumActiveFracture()) + self.assertTrue(dgrid.getNumActive() == 46118) dgrid2 = EclGrid(self.createTestPath("Statoil/ECLIPSE/DualPoro/DUALPOR_MSW.GRID")) - self.assertTrue(dgrid.nactive == dgrid.nactive_fracture) - self.assertTrue(dgrid.nactive == 46118) + self.assertTrue(dgrid.getNumActive() == dgrid.getNumActiveFracture()) + self.assertTrue(dgrid.getNumActive() == 46118) self.assertTrue(dgrid.equal(dgrid2)) @@ -312,8 +312,8 @@ class GridTest(ExtendedTestCase): # situation where some cells are only matrix active, and some # cells are only fracture active. dgrid = EclGrid(self.createTestPath("Statoil/ECLIPSE/DualPoro/DUAL_DIFF.EGRID")) - self.assertTrue(dgrid.nactive == 106) - self.assertTrue(dgrid.nactive_fracture == 105) + self.assertTrue(dgrid.getNumActive() == 106) + self.assertTrue(dgrid.getNumActiveFracture() == 105) self.assertTrue(dgrid.get_active_fracture_index(global_index=0) == -1) self.assertTrue(dgrid.get_active_fracture_index(global_index=2) == -1) @@ -330,8 +330,8 @@ class GridTest(ExtendedTestCase): self.assertTrue(dgrid.equal(dgrid2 , verbose = True)) - @skipIf(ExtendedTestCase.slowTestShouldNotRun(), "Slow test of nactive large memory skipped!") - def test_nactive_large_memory(self): + @skipIf(ExtendedTestCase.slowTestShouldNotRun(), "Slow test of numActive large memory skipped!") + def test_num_active_large_memory(self): case = self.createTestPath("Statoil/ECLIPSE/Gurbat/ECLIPSE") vecList = [] for i in range(12500): @@ -341,8 +341,8 @@ class GridTest(ExtendedTestCase): grid1 = EclGrid(case) grid2 = EclGrid(case) - self.assertEqual(grid1.nactive, grid2.nactive) - self.assertEqual(grid1.nactive, 34770) + self.assertEqual(grid1.getNumActive(), grid2.getNumActive()) + self.assertEqual(grid1.getNumActive(), 34770) def test_no_mapaxes_check_for_nan(self): diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_indexed_read.py b/ThirdParty/Ert/python/tests/ecl/test_indexed_read.py similarity index 84% rename from ThirdParty/Ert/python/tests/core/ecl/test_indexed_read.py rename to ThirdParty/Ert/python/tests/ecl/test_indexed_read.py index edbb7221fb..8de919409a 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_indexed_read.py +++ b/ThirdParty/Ert/python/tests/ecl/test_indexed_read.py @@ -1,13 +1,13 @@ import ctypes -import ert +import ecl -from ert.ecl import EclPrototype -from ert.ecl import EclKW, EclFile, EclTypeEnum, FortIO -from ert.test import ExtendedTestCase, TestAreaContext -from ert.util import IntVector +from ecl.ecl import EclPrototype +from ecl.ecl import EclKW, EclFile, EclDataType, FortIO +from ecl.test import ExtendedTestCase, TestAreaContext +from ecl.util import IntVector class EclIndexedReadTest(ExtendedTestCase): - _freadIndexedData = EclPrototype("void ecl_kw_fread_indexed_data(fortio, int, int, int, int_vector, char*)", bind = False) # fortio, offset, type, count, index_map, buffer + _freadIndexedData = EclPrototype("void ecl_kw_fread_indexed_data_python(fortio, int, ecl_data_type, int, int_vector, char*)", bind = False) # fortio, offset, type, count, index_map, buffer _eclFileIndexedRead = EclPrototype("void ecl_file_indexed_read(ecl_file, char*, int, int_vector, char*)", bind = False) # ecl_file, kw, index, index_map, buffer def test_ecl_kw_indexed_read(self): @@ -15,7 +15,7 @@ class EclIndexedReadTest(ExtendedTestCase): fortio = FortIO("index_test", mode=FortIO.WRITE_MODE) element_count = 100000 - ecl_kw = EclKW.create("TEST", element_count, EclTypeEnum.ECL_INT_TYPE) + ecl_kw = EclKW("TEST", element_count, EclDataType.ECL_INT) for index in range(element_count): ecl_kw[index] = index @@ -54,7 +54,7 @@ class EclIndexedReadTest(ExtendedTestCase): char_buffer = ctypes.create_string_buffer(len(index_map) * ctypes.sizeof(ctypes.c_int)) - self._freadIndexedData(fortio, 24, EclTypeEnum.ECL_INT_TYPE, element_count, index_map, char_buffer) + self._freadIndexedData(fortio, 24, EclDataType.ECL_INT, element_count, index_map, char_buffer) int_buffer = ctypes.cast(char_buffer, ctypes.POINTER(ctypes.c_int)) @@ -68,8 +68,8 @@ class EclIndexedReadTest(ExtendedTestCase): fortio = FortIO("ecl_file_index_test", mode=FortIO.WRITE_MODE) element_count = 100000 - ecl_kw_1 = EclKW.create("TEST1", element_count, EclTypeEnum.ECL_INT_TYPE) - ecl_kw_2 = EclKW.create("TEST2", element_count, EclTypeEnum.ECL_INT_TYPE) + ecl_kw_1 = EclKW("TEST1", element_count, EclDataType.ECL_INT) + ecl_kw_2 = EclKW("TEST2", element_count, EclDataType.ECL_INT) for index in range(element_count): ecl_kw_1[index] = index diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_kw_function.py b/ThirdParty/Ert/python/tests/ecl/test_kw_function.py similarity index 88% rename from ThirdParty/Ert/python/tests/core/ecl/test_kw_function.py rename to ThirdParty/Ert/python/tests/ecl/test_kw_function.py index cd60c14f60..4f45f2f313 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_kw_function.py +++ b/ThirdParty/Ert/python/tests/ecl/test_kw_function.py @@ -16,9 +16,9 @@ # for more details. import os import random -from ert.ecl import EclKW, EclTypeEnum, EclGrid , Ecl3DKW -from ert.util import IntVector -from ert.test import ExtendedTestCase +from ecl.ecl import EclKW, EclDataType, EclGrid , Ecl3DKW +from ecl.util import IntVector +from ecl.test import ExtendedTestCase class KWFunctionTest(ExtendedTestCase): @@ -32,7 +32,7 @@ class KWFunctionTest(ExtendedTestCase): grid = EclGrid.createRectangular( (nx,ny,nz) , (1,1,1) , actnum = actnum) self.assertEqual( grid.getNumActive() , nx*ny*nz - 1 ) - kw = Ecl3DKW.create( "REGIONS" , grid , EclTypeEnum.ECL_INT_TYPE , global_active = True ) + kw = Ecl3DKW.create( "REGIONS" , grid , EclDataType.ECL_INT , global_active = True ) kw.assign( 0 ) kw[0:nx*ny/2] = 1 kw[5,2,0] = 0 diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_layer.py b/ThirdParty/Ert/python/tests/ecl/test_layer.py similarity index 97% rename from ThirdParty/Ert/python/tests/core/ecl/test_layer.py rename to ThirdParty/Ert/python/tests/ecl/test_layer.py index 26a176288f..370eb6ae8e 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_layer.py +++ b/ThirdParty/Ert/python/tests/ecl/test_layer.py @@ -18,11 +18,11 @@ from unittest import skipIf import time -from ert.util import IntVector -from ert.ecl import EclGrid -from ert.geo import CPolyline -from ert.ecl.faults import Layer , FaultCollection -from ert.test import ExtendedTestCase , TestAreaContext +from ecl.util import IntVector +from ecl.ecl import EclGrid +from ecl.geo import CPolyline +from ecl.ecl.faults import Layer , FaultCollection +from ecl.test import ExtendedTestCase , TestAreaContext class LayerTest(ExtendedTestCase): @@ -112,7 +112,7 @@ class LayerTest(ExtendedTestCase): nx = 120 ny = 60 nz = 43 - grid = EclGrid.create_rectangular( (nx , ny , nz) , (1,1,1) ) + grid = EclGrid.createRectangular( (nx , ny , nz) , (1,1,1) ) with TestAreaContext("python/faults/line_order"): with open("faults.grdecl" , "w") as f: f.write("""FAULTS diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_npv.py b/ThirdParty/Ert/python/tests/ecl/test_npv.py similarity index 97% rename from ThirdParty/Ert/python/tests/core/ecl/test_npv.py rename to ThirdParty/Ert/python/tests/ecl/test_npv.py index ac31d398ef..dceda077c1 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_npv.py +++ b/ThirdParty/Ert/python/tests/ecl/test_npv.py @@ -24,11 +24,11 @@ try: except ImportError: from unittest import skipIf, skipUnless, skipIf -from ert.ecl import EclSum -from ert.ecl import EclNPV , NPVPriceVector +from ecl.ecl import EclSum +from ecl.ecl import EclNPV , NPVPriceVector -from ert.util import StringList, TimeVector, DoubleVector , CTime -from ert.test import ExtendedTestCase , TestAreaContext +from ecl.util import StringList, TimeVector, DoubleVector , CTime +from ecl.test import ExtendedTestCase , TestAreaContext base = "ECLIPSE" diff --git a/ThirdParty/Ert/python/tests/ecl/test_region.py b/ThirdParty/Ert/python/tests/ecl/test_region.py new file mode 100644 index 0000000000..5e3cef90d8 --- /dev/null +++ b/ThirdParty/Ert/python/tests/ecl/test_region.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# Copyright (C) 2017 Statoil ASA, Norway. +# +# The file 'test_region.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT 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. +# +# ERT 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 +# for more details. +from ecl.ecl import EclGrid, EclKW, EclRegion, EclDataType +from ecl.ecl.faults import Layer +from ecl.test import ExtendedTestCase + + +class RegionTest(ExtendedTestCase): + + def test_equal(self): + grid = EclGrid.createRectangular( (10,10,1) , (1,1,1)) + kw_int = EclKW( "INT" , grid.getGlobalSize( ) , EclDataType.ECL_INT ) + kw_float = EclKW( "FLOAT" , grid.getGlobalSize( ) , EclDataType.ECL_FLOAT ) + + kw_int[0:49] = 1 + region = EclRegion(grid, False) + region.select_equal( kw_int , 1 ) + glist = region.getGlobalList() + for g in glist: + self.assertEqual( kw_int[g] , 1 ) + + with self.assertRaises(ValueError): + region.select_equal( kw_float , 1 ) diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_region.py b/ThirdParty/Ert/python/tests/ecl/test_region_statoil.py similarity index 90% rename from ThirdParty/Ert/python/tests/core/ecl/test_region.py rename to ThirdParty/Ert/python/tests/ecl/test_region_statoil.py index caf9616b6e..fbe0c8035c 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_region.py +++ b/ThirdParty/Ert/python/tests/ecl/test_region_statoil.py @@ -14,9 +14,9 @@ # # See the GNU General Public License at # for more details. -from ert.ecl import EclFile, EclGrid, EclRegion -from ert.ecl.faults import Layer -from ert.test import ExtendedTestCase +from ecl.ecl import EclFile, EclGrid, EclRegion +from ecl.ecl.faults import Layer +from ecl.test import ExtendedTestCase class RegionTest(ExtendedTestCase): @@ -103,7 +103,7 @@ class RegionTest(ExtendedTestCase): reg.select_islice(0, 5) OK = True - global_list = reg.global_list + global_list = reg.getGlobalList() self.assertEqual(global_list.parent(), reg) for gi in global_list: @@ -111,11 +111,11 @@ class RegionTest(ExtendedTestCase): if i > 5: OK = False self.assertTrue(OK) - self.assertTrue(self.grid.ny * self.grid.nz * 6 == len(reg.global_list)) + self.assertTrue(self.grid.getNY() * self.grid.getNZ() * 6 == len(reg.getGlobalList())) reg.select_jslice(7, 8, intersect=True) OK = True - for gi in reg.global_list: + for gi in reg.getGlobalList(): (i, j, k) = self.grid.get_ijk(global_index=gi) if i > 5: OK = False @@ -124,13 +124,13 @@ class RegionTest(ExtendedTestCase): OK = False self.assertTrue(OK) - self.assertTrue(2 * self.grid.nz * 6 == len(reg.global_list)) + self.assertTrue(2 * self.grid.getNZ() * 6 == len(reg.getGlobalList())) reg2 = EclRegion(self.grid, False) reg2.select_kslice(3, 5) reg &= reg2 OK = True - for gi in reg.global_list: + for gi in reg.getGlobalList(): (i, j, k) = self.grid.get_ijk(global_index=gi) if i > 5: OK = False @@ -149,8 +149,8 @@ class RegionTest(ExtendedTestCase): def test_index_list(self): reg = EclRegion(self.grid, False) reg.select_islice(0, 5) - active_list = reg.active_list - global_list = reg.global_list + active_list = reg.getActiveList() + global_list = reg.getGlobalList() @@ -160,7 +160,7 @@ class RegionTest(ExtendedTestCase): dx = 0.1 dy = 0.1 reg.select_inside_polygon( [(x-dx,y-dy) , (x-dx,y+dy) , (x+dx,y+dy) , (x+dx,y-dy)] ) - self.assertTrue( self.grid.nz == len(reg.getGlobalList())) + self.assertTrue( self.grid.getNZ() == len(reg.getGlobalList())) def test_heidrun(self): @@ -176,7 +176,7 @@ class RegionTest(ExtendedTestCase): reg = EclRegion( grid , False ) reg.select_inside_polygon( polygon ) - self.assertEqual( 0 , len(reg.global_list) % grid.nz) + self.assertEqual( 0 , len(reg.getGlobalList()) % grid.getNZ()) def test_layer(self): diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_removed.py b/ThirdParty/Ert/python/tests/ecl/test_removed.py similarity index 82% rename from ThirdParty/Ert/python/tests/core/ecl/test_removed.py rename to ThirdParty/Ert/python/tests/ecl/test_removed.py index 54f26f45a8..fd41e1e434 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_removed.py +++ b/ThirdParty/Ert/python/tests/ecl/test_removed.py @@ -1,9 +1,8 @@ -import warnings import time import datetime -from ert.test import ExtendedTestCase, TestAreaContext -from ert.ecl import EclFile,EclKW,EclTypeEnum,openFortIO, FortIO +from ecl.test import ExtendedTestCase, TestAreaContext +from ecl.ecl import EclFile,EclKW,EclDataType,openFortIO, FortIO @@ -11,7 +10,7 @@ class Removed_2_1_Test(ExtendedTestCase): def test_ecl_file_block(self): with TestAreaContext("name") as t: - kw = EclKW("TEST", 3, EclTypeEnum.ECL_INT_TYPE) + kw = EclKW("TEST", 3, EclDataType.ECL_INT) with openFortIO("TEST" , mode = FortIO.WRITE_MODE) as f: kw.fwrite( f ) diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_restart.py b/ThirdParty/Ert/python/tests/ecl/test_restart.py similarity index 96% rename from ThirdParty/Ert/python/tests/core/ecl/test_restart.py rename to ThirdParty/Ert/python/tests/ecl/test_restart.py index 391b07ba20..c9e91be399 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_restart.py +++ b/ThirdParty/Ert/python/tests/ecl/test_restart.py @@ -17,8 +17,8 @@ from _ctypes import ArgumentError import os import datetime -from ert.ecl import EclFile -from ert.test import ExtendedTestCase +from ecl.ecl import EclFile +from ecl.test import ExtendedTestCase @@ -109,10 +109,10 @@ class RestartTest(ExtendedTestCase): def test_name(self): f = EclFile(self.u_file) - self.assertTrue(f.name == self.u_file) + self.assertTrue(f.getFilename() == self.u_file) f = EclFile(self.xfile0) - self.assertTrue(f.name == self.xfile0) + self.assertTrue(f.getFilename() == self.xfile0) def test_kw( self ): diff --git a/ThirdParty/Ert/python/tests/ecl/test_restart_head.py b/ThirdParty/Ert/python/tests/ecl/test_restart_head.py new file mode 100644 index 0000000000..bd1468a73e --- /dev/null +++ b/ThirdParty/Ert/python/tests/ecl/test_restart_head.py @@ -0,0 +1,41 @@ +# Copyright (C) 2015 Statoil ASA, Norway. +# +# The file 'test_ecl_init_file.py' is part of ERT - Ensemble based Reservoir Tool. +# +# ERT 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. +# +# ERT 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 +# for more details. +import datetime + +from ecl.test import ExtendedTestCase +from ecl.ecl import Ecl3DKW , EclKW, EclRestartFile , EclFile, FortIO, EclFileFlagEnum , EclGrid + +class RestartHeadTest(ExtendedTestCase): + def setUp(self): + self.grid_file = self.createTestPath("Statoil/ECLIPSE/Gurbat/ECLIPSE.EGRID") + self.unrst_file = self.createTestPath("Statoil/ECLIPSE/Gurbat/ECLIPSE.UNRST") + self.xrst_file0 = self.createTestPath("Statoil/ECLIPSE/Gurbat/ECLIPSE.X0000") + + def test_headers(self): + g = EclGrid( self.grid_file ) + f = EclRestartFile( g , self.unrst_file ) + + headers = f.headers( ) + self.assertEqual( len(headers) , 63 ) + + with self.assertRaises(IndexError): + f.get_header(1000) + + header = f.get_header( 10 ) + details = header.well_details( ) + self.assertTrue( "NXCONZ" in details ) + self.assertTrue( "NCWMAX" in details ) + diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_rft.py b/ThirdParty/Ert/python/tests/ecl/test_rft.py similarity index 70% rename from ThirdParty/Ert/python/tests/core/ecl/test_rft.py rename to ThirdParty/Ert/python/tests/ecl/test_rft.py index fe0215facf..3ff440b42c 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_rft.py +++ b/ThirdParty/Ert/python/tests/ecl/test_rft.py @@ -17,11 +17,11 @@ import datetime -from ert.util import CTime -from ert.ecl import EclRFTFile, EclRFTCell, EclPLTCell -from ert.ecl.rft import WellTrajectory -from ert.test import ExtendedTestCase -from ert.ecl import EclRFT +from ecl.util import CTime +from ecl.ecl import EclRFTFile, EclRFTCell, EclPLTCell +from ecl.ecl.rft import WellTrajectory +from ecl.test import ExtendedTestCase +from ecl.ecl import EclRFT class RFTTest(ExtendedTestCase): @@ -31,6 +31,8 @@ class RFTTest(ExtendedTestCase): with self.assertRaises(IndexError): cell = rft[5] - - + def test_repr(self): + rft = EclRFT( "WELL" , "RFT" , datetime.date(2015 , 10 , 1 ) , 100 ) + pfx = 'EclRFT(completed_cells = 0, date = 2015-10-01, RFT, MSW)' + self.assertEqual(pfx, repr(rft)[:len(pfx)]) diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_rft_cell.py b/ThirdParty/Ert/python/tests/ecl/test_rft_cell.py similarity index 89% rename from ThirdParty/Ert/python/tests/core/ecl/test_rft_cell.py rename to ThirdParty/Ert/python/tests/ecl/test_rft_cell.py index 11f720c85b..87276f6ad3 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_rft_cell.py +++ b/ThirdParty/Ert/python/tests/ecl/test_rft_cell.py @@ -16,9 +16,8 @@ # for more details. -import warnings -from ert.ecl import EclRFTCell, EclPLTCell -from ert.test import ExtendedTestCase +from ecl.ecl import EclRFTCell, EclPLTCell +from ecl.test import ExtendedTestCase # def out_of_range(): @@ -76,12 +75,6 @@ class RFTCellTest(ExtendedTestCase): self.assertEqual(j, cell.get_j()) self.assertEqual(k, cell.get_k()) - with warnings.catch_warnings(): - warnings.simplefilter("ignore") - self.assertTrue(cell.get_i() + 1 == cell.i) - self.assertTrue(cell.get_j() + 1 == cell.j) - self.assertTrue(cell.get_k() + 1 == cell.k) - self.assertFloatEqual(pressure, cell.pressure) self.assertFloatEqual(depth, cell.depth) self.assertFloatEqual(orat, cell.orat) diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_rft_statoil.py b/ThirdParty/Ert/python/tests/ecl/test_rft_statoil.py similarity index 96% rename from ThirdParty/Ert/python/tests/core/ecl/test_rft_statoil.py rename to ThirdParty/Ert/python/tests/ecl/test_rft_statoil.py index 147ee80cbb..be3329e230 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_rft_statoil.py +++ b/ThirdParty/Ert/python/tests/ecl/test_rft_statoil.py @@ -17,9 +17,9 @@ from __future__ import print_function import datetime -from ert.ecl import EclRFTFile, EclRFTCell, EclPLTCell -from ert.ecl.rft import WellTrajectory -from ert.test import ExtendedTestCase +from ecl.ecl import EclRFTFile, EclRFTCell, EclPLTCell +from ecl.ecl.rft import WellTrajectory +from ecl.test import ExtendedTestCase class RFTTest(ExtendedTestCase): @@ -57,7 +57,7 @@ class RFTTest(ExtendedTestCase): self.assertIsInstance(cell, EclRFTCell) rft.sort() - for h in rftFile.headers: + for h in rftFile.getHeaders(): print(h) self.assertIsInstance( h[1] , datetime.date ) diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_statoil_faults.py b/ThirdParty/Ert/python/tests/ecl/test_statoil_faults.py similarity index 96% rename from ThirdParty/Ert/python/tests/core/ecl/test_statoil_faults.py rename to ThirdParty/Ert/python/tests/ecl/test_statoil_faults.py index e436985e18..2d362b8713 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_statoil_faults.py +++ b/ThirdParty/Ert/python/tests/ecl/test_statoil_faults.py @@ -20,9 +20,9 @@ except ImportError: from unittest import skipIf import time -from ert.ecl.faults import FaultCollection, Fault, FaultLine, FaultSegment -from ert.ecl import EclGrid,EclKW,EclTypeEnum -from ert.test import ExtendedTestCase +from ecl.ecl.faults import FaultCollection, Fault, FaultLine, FaultSegment +from ecl.ecl import EclGrid, EclKW, EclDataType +from ecl.test import ExtendedTestCase @@ -30,10 +30,10 @@ class StatoilFaultTest(ExtendedTestCase): def loadGrid(self): grid_file = self.createTestPath("Statoil/ECLIPSE/Faults/grid.grdecl") fileH = open(grid_file, "r") - specgrid = EclKW.read_grdecl(fileH, "SPECGRID", ecl_type=EclTypeEnum.ECL_INT_TYPE, strict=False) + specgrid = EclKW.read_grdecl(fileH, "SPECGRID", ecl_type=EclDataType.ECL_INT, strict=False) zcorn = EclKW.read_grdecl(fileH, "ZCORN") coord = EclKW.read_grdecl(fileH, "COORD") - actnum = EclKW.read_grdecl(fileH, "ACTNUM", ecl_type=EclTypeEnum.ECL_INT_TYPE) + actnum = EclKW.read_grdecl(fileH, "ACTNUM", ecl_type=EclDataType.ECL_INT) return EclGrid.create(specgrid, zcorn, coord, actnum) diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_sum.py b/ThirdParty/Ert/python/tests/ecl/test_sum.py similarity index 98% rename from ThirdParty/Ert/python/tests/core/ecl/test_sum.py rename to ThirdParty/Ert/python/tests/ecl/test_sum.py index c7965a9ea3..c41d1da0a9 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_sum.py +++ b/ThirdParty/Ert/python/tests/ecl/test_sum.py @@ -20,9 +20,9 @@ import datetime import csv from unittest import skipIf, skipUnless, skipIf -from ert.ecl import EclSum, EclSumVarType -from ert.test import ExtendedTestCase, TestAreaContext -from ert.test.ecl_mock import createEclSum +from ecl.ecl import EclSum, EclSumVarType +from ecl.test import ExtendedTestCase, TestAreaContext +from ecl.test.ecl_mock import createEclSum def fopr(days): return days diff --git a/ThirdParty/Ert/python/tests/core/ecl/test_sum_statoil.py b/ThirdParty/Ert/python/tests/ecl/test_sum_statoil.py similarity index 84% rename from ThirdParty/Ert/python/tests/core/ecl/test_sum_statoil.py rename to ThirdParty/Ert/python/tests/ecl/test_sum_statoil.py index 37f4781473..650aff9987 100644 --- a/ThirdParty/Ert/python/tests/core/ecl/test_sum_statoil.py +++ b/ThirdParty/Ert/python/tests/ecl/test_sum_statoil.py @@ -20,11 +20,11 @@ import datetime from unittest import skipIf, skipUnless, skipIf -from ert.ecl import EclSum, EclFile +from ecl.ecl import EclSum, EclFile -from ert.util import StringList, TimeVector, DoubleVector +from ecl.util import StringList, TimeVector, DoubleVector -from ert.test import ExtendedTestCase , TestAreaContext +from ecl.test import ExtendedTestCase , TestAreaContext import csv base = "ECLIPSE" @@ -248,28 +248,28 @@ class SumTest(ExtendedTestCase): self.assertRaises(KeyError, sum.smspec_node, "BJARNE") node = sum.smspec_node("FOPT") - self.assertTrue(node.is_total) - self.assertFalse(node.is_historical) + self.assertTrue(node.isTotal()) + self.assertFalse(node.isHistorical()) node = sum.smspec_node("FOPR") - self.assertFalse(node.is_total) - self.assertFalse(node.is_historical) + self.assertFalse(node.isTotal()) + self.assertFalse(node.isHistorical()) self.assertTrue(node.keyword == "FOPR") node = sum.smspec_node("FOPRH") - self.assertFalse(node.is_total) - self.assertTrue(node.is_historical) - self.assertTrue(node.is_rate) + self.assertFalse(node.isTotal()) + self.assertTrue(node.isHistorical()) + self.assertTrue(node.isRate()) self.assertTrue(node.keyword == "FOPRH") node = sum.smspec_node("WOPR:OP_1") - self.assertFalse(node.is_total) - self.assertTrue(node.is_rate) + self.assertFalse(node.isTotal()) + self.assertTrue(node.isRate()) self.assertTrue(node.keyword == "WOPR") node = sum.smspec_node("WOPT:OP_1") - self.assertTrue(node.is_total) - self.assertFalse(node.is_rate) + self.assertTrue(node.isTotal()) + self.assertFalse(node.isRate()) self.assertTrue(node.unit == "SM3") self.assertTrue(node.wgname == "OP_1") self.assertTrue(node.keyword == "WOPT") @@ -277,8 +277,8 @@ class SumTest(ExtendedTestCase): self.assertTrue(sum.unit("FOPR") == "SM3/DAY") node = sum.smspec_node("FOPTH") - self.assertTrue(node.is_total) - self.assertFalse(node.is_rate) + self.assertTrue(node.isTotal()) + self.assertFalse(node.isRate()) self.assertIsNone(node.wgname) node = sum.smspec_node("FOPTH") @@ -450,13 +450,55 @@ class SumTest(ExtendedTestCase): self.assertEqual( total.iget( "WGPR:NOT_21_D", 5) , 0) # Default value + def test_write(self): + with TestAreaContext("my_space") as area: + intersect_summary = EclSum( self.createTestPath( "Statoil/ECLIPSE/SummaryRestart/iter-1/NOR-2013A_R007-0") ) + self.assertIsNotNone(intersect_summary) + + write_location = os.path.join(os.getcwd(), "CASE") + intersect_summary.fwrite(ecl_case=write_location) + + reloaded_summary = EclSum(write_location) + self.assertEqual(intersect_summary.keys(), reloaded_summary.keys()) def test_ix_case(self): - # This should ideally load OK; the current assertRaises() test - # is just to ensure that it does not go *completely* up in flames. - with self.assertRaises(IOError): - EclSum( self.createTestPath( "Statoil/ECLIPSE/ix/summary/Create_Region_Around_Well")) + intersect_summary = EclSum(self.createTestPath("Statoil/ECLIPSE/ix/summary/Create_Region_Around_Well")) + self.assertIsNotNone(intersect_summary) - f = EclFile( self.createTestPath( "Statoil/ECLIPSE/ix/summary/Create_Region_Around_Well.SMSPEC")) - self.assertTrue( "KEYWORDS" in f ) - self.assertFalse( "NAMES" in f ) + self.assertTrue( + "HWELL_PROD" in + [intersect_summary.smspec_node(key).wgname for key in intersect_summary.keys()] + ) + + eclipse_summary = EclSum(self.createTestPath("Statoil/ECLIPSE/ix/summary/ECL100/E100_CREATE_REGION_AROUND_WELL")) + self.assertIsNotNone(eclipse_summary) + + hwell_padder = lambda key : key if key.split(":")[-1] != "HWELL_PR" else key + "OD" + self.assertEqual( + intersect_summary.keys("WWCT*"), + map(hwell_padder, eclipse_summary.keys("WWCT*")) + ) + + def test_ix_write(self): + for data_set in [ + "Statoil/ECLIPSE/ix/summary/Create_Region_Around_Well", + "Statoil/ECLIPSE/ix/troll/IX_NOPH3_R04_75X75X1_grid2.SMSPEC" + ]: + + with TestAreaContext("my_space" + data_set.split("/")[-1]) as area: + intersect_summary = EclSum(self.createTestPath(data_set)) + self.assertIsNotNone(intersect_summary) + + write_location = os.path.join(os.getcwd(), "CASE") + intersect_summary.fwrite(ecl_case=write_location) + + reloaded_summary = EclSum(write_location) + self.assertEqual( + list(intersect_summary.keys()), + list(reloaded_summary.keys()) + ) + + def test_ix_caseII(self): + troll_summary = EclSum( self.createTestPath("Statoil/ECLIPSE/ix/troll/IX_NOPH3_R04_75X75X1_grid2.SMSPEC")) + self.assertIsNotNone(troll_summary) + self.assertTrue("WMCTL:Q21BH1" in list(troll_summary.keys())) diff --git a/ThirdParty/Ert/python/tests/ert/CMakeLists.txt b/ThirdParty/Ert/python/tests/ert/CMakeLists.txt deleted file mode 100644 index 892b16a645..0000000000 --- a/ThirdParty/Ert/python/tests/ert/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -set(TEST_SOURCES - __init__.py -) - -add_python_package("python.tests.ert" ${PYTHON_INSTALL_PREFIX}/tests/ert "${TEST_SOURCES}" False) - -add_subdirectory(analysis) -add_subdirectory(config) -add_subdirectory(enkf) -add_subdirectory(job_queue) -add_subdirectory(run) -add_subdirectory(sched) -add_subdirectory(server) -add_subdirectory(testcase) diff --git a/ThirdParty/Ert/python/tests/ert/__init__.py b/ThirdParty/Ert/python/tests/ert/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/python/tests/ert/analysis/CMakeLists.txt b/ThirdParty/Ert/python/tests/ert/analysis/CMakeLists.txt deleted file mode 100644 index 64512c7ede..0000000000 --- a/ThirdParty/Ert/python/tests/ert/analysis/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -set(TEST_SOURCES - __init__.py - test_analysis_module.py - test_linalg.py - test_options_enum.py - test_rml.py - test_std_enkf.py - test_std_enkf_debug.py -) - -add_python_package("python.tests.ert.analysis" ${PYTHON_INSTALL_PREFIX}/tests/ert/analysis "${TEST_SOURCES}" False) - -addPythonTest(ert.analysis.analysis_module tests.ert.analysis.test_analysis_module.AnalysisModuleTest) -addPythonTest(ert.analysis.enums tests.ert.analysis.test_options_enum.AnalysisOptionsEnumTest) -addPythonTest(ert.analysis.linalg tests.ert.analysis.test_linalg.LinalgTest) -addPythonTest(ert.analysis.rml tests.ert.analysis.test_rml.RMLTest) -addPythonTest(ert.analysis.std_enkf tests.ert.analysis.test_std_enkf.StdEnKFTest) -addPythonTest(ert.analysis.std_enkf_debug tests.ert.analysis.test_std_enkf_debug.StdEnKFDebugTest) - diff --git a/ThirdParty/Ert/python/tests/ert/analysis/__init__.py b/ThirdParty/Ert/python/tests/ert/analysis/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/python/tests/ert/analysis/test_analysis_module.py b/ThirdParty/Ert/python/tests/ert/analysis/test_analysis_module.py deleted file mode 100644 index 6190619276..0000000000 --- a/ThirdParty/Ert/python/tests/ert/analysis/test_analysis_module.py +++ /dev/null @@ -1,153 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'test_analysis_module.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -import ert -from ert.test import ExtendedTestCase -from ert.analysis import AnalysisModule, AnalysisModuleLoadStatusEnum, AnalysisModuleOptionsEnum - -from ert.util.enums import RngAlgTypeEnum, RngInitModeEnum -from ert.util.rng import RandomNumberGenerator - -from ert.util import Matrix - -class AnalysisModuleTest(ExtendedTestCase): - def setUp(self): - self.libname = ert.ert_lib_path + "/rml_enkf.so" - self.rng = RandomNumberGenerator(RngAlgTypeEnum.MZRAN, RngInitModeEnum.INIT_DEFAULT) - - def createAnalysisModule(self): - return AnalysisModule(self.rng, lib_name = self.libname) - - def test_load_status_enum(self): - source_file_path = "libanalysis/include/ert/analysis/analysis_module.h" - self.assertEnumIsFullyDefined(AnalysisModuleLoadStatusEnum, "analysis_module_load_status_enum", source_file_path) - - def test_analysis_module(self): - am = self.createAnalysisModule() - - self.assertEqual(am.getLibName(), self.libname) - - self.assertFalse(am.getInternal()) - - self.assertTrue(am.setVar("ITER", "1")) - - self.assertEqual(am.getTableName(), "analysis_table") - - self.assertTrue(am.checkOption(AnalysisModuleOptionsEnum.ANALYSIS_ITERABLE)) - - self.assertTrue(am.hasVar("ITER")) - - self.assertIsInstance(am.getDouble("ENKF_TRUNCATION"), float) - - self.assertIsInstance(am.getInt("ITER"), int) - - def test_set_get_var(self): - mod = AnalysisModule( self.rng , name = "STD_ENKF" ) - with self.assertRaises(KeyError): - mod.setVar("NO-NOT_THIS_KEY" , 100) - - - with self.assertRaises(KeyError): - mod.getInt("NO-NOT_THIS_KEY") - - - - - - def test_create_internal(self): - with self.assertRaises( KeyError ): - mod = AnalysisModule( self.rng , name = "STD_ENKFXXX" ) - - mod = AnalysisModule( self.rng , name = "STD_ENKF" ) - - - def test_initX_enkf_linalg_lowrankCinv(self): - """Test AnalysisModule.initX with EE=False and GE=False""" - mod = AnalysisModule( self.rng , name = "STD_ENKF" ) - A, S, R, dObs, E, D = self._n_identity_mcs() - self.assertFalse(mod.getBool('USE_EE')) - self.assertFalse(mod.getBool('USE_GE')) - - elt_a, elt_b = 1.222, -0.111 - vals = (elt_a, elt_b, elt_b, - elt_b, elt_a, elt_b, - elt_b, elt_b, elt_a) - expected = self.construct_matrix(3, vals) - - X = mod.initX(A, S, R, dObs, E, D) - self._matrix_close(X, expected) - - def test_initX_enkf_linalg_lowrank_EE(self): - """Test AnalysisModule.initX with EE=True and GE=False""" - mod = AnalysisModule( self.rng , name = "STD_ENKF" ) - A, S, R, dObs, E, D = self._n_identity_mcs() - mod.setVar('USE_EE', True) - self.assertTrue(mod.getBool('USE_EE')) - self.assertFalse(mod.getBool('USE_GE')) - - elt_a, elt_b = 1.33, -0.167 - vals = (elt_a, elt_b, elt_b, - elt_b, elt_a, elt_b, - elt_b, elt_b, elt_a) - expected = self.construct_matrix(3, vals) - X = mod.initX(A, S, R, dObs, E, D) - self._matrix_close(X, expected) - - def test_initX_subspace_inversion_algorithm(self): - """Test AnalysisModule.initX with EE=True and GE=True, the subspace inversion algorithm""" - mod = AnalysisModule( self.rng , name = "STD_ENKF" ) - A, S, R, dObs, E, D = self._n_identity_mcs() - - mod.setVar('USE_EE', True) - mod.setVar('USE_GE', True) - self.assertTrue(mod.getBool('USE_EE')) - self.assertTrue(mod.getBool('USE_GE')) - - vals = ( 1.39, -0.111, -0.278, - -0.111, 1.39, -0.278, - -0.278, -0.278, 1.56 ) - expected = self.construct_matrix(3, vals) - X = mod.initX(A, S, R, dObs, E, D) - self._matrix_close(X, expected) - - def construct_matrix(self, n, vals): - """Constructs n*n matrix with vals as entries""" - self.assertEqual(n*n, len(vals)) - m = Matrix(n,n) - idx = 0 - for i in range(n): - for j in range(n): - m[(i,j)] = vals[idx] - idx += 1 - return m - - def _n_identity_mcs(self, n=6,s=3): - """return n copies of the identity matrix on s*s elts""" - return tuple([Matrix.identity(s) for i in range(n)]) - - def _matrix_close(self, m1, m2, epsilon=0.01): - """Check that matrices m1 and m2 are of same dimension and that they are - pointwise within epsilon difference.""" - - c = m1.columns() - r = m1.rows() - self.assertEqual(c, m2.columns(), 'Number of columns for m1 differ from m2') - self.assertEqual(r, m2.rows(), 'Number of rows for m1 differ from m2') - for i in range(0, c): - for j in range(0,r): - pos = (i,j) - diff = abs(m1[pos] - m2[pos]) - self.assertTrue(diff <= epsilon, 'Matrices differ at (i,j) = (%d,%d). %f != %f' % (i, j, m1[pos], m2[pos])) diff --git a/ThirdParty/Ert/python/tests/ert/analysis/test_linalg.py b/ThirdParty/Ert/python/tests/ert/analysis/test_linalg.py deleted file mode 100644 index 8ccef6e91c..0000000000 --- a/ThirdParty/Ert/python/tests/ert/analysis/test_linalg.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2015 Statoil ASA, Norway. -# -# The file 'test_labscale.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - - -from ert.enkf import ObsVector -from ert.util import Matrix -from ert.analysis import Linalg -from ert.test import ExtendedTestCase - -class LinalgTest(ExtendedTestCase): - - def test_num_PC(self): - S = Matrix(3,3) - S[0,0] = 1 - S[1,1] = 1 - S[2,2] = 1 - - with self.assertRaises(ValueError): - num_pc = Linalg.numPC( S , 0 ) - - with self.assertRaises(ValueError): - num_pc = Linalg.numPC( S , 1.5 ) - - num_pc = Linalg.numPC( S , 0.20 ) - self.assertEqual( num_pc , 1 ) - - num_pc = Linalg.numPC( S , 0.50 ) - self.assertEqual( num_pc , 2 ) - - num_pc = Linalg.numPC( S , 0.80 ) - self.assertEqual( num_pc , 3 ) - - diff --git a/ThirdParty/Ert/python/tests/ert/analysis/test_options_enum.py b/ThirdParty/Ert/python/tests/ert/analysis/test_options_enum.py deleted file mode 100644 index 9013f1954e..0000000000 --- a/ThirdParty/Ert/python/tests/ert/analysis/test_options_enum.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'test_options_enum.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from ert.test import ExtendedTestCase -from ert.analysis import AnalysisModuleOptionsEnum - - -class AnalysisOptionsEnumTest(ExtendedTestCase): - def test_items(self): - source_file_path = "libanalysis/include/ert/analysis/analysis_module.h" - self.assertEnumIsFullyDefined(AnalysisModuleOptionsEnum, "analysis_module_flag_enum", source_file_path) diff --git a/ThirdParty/Ert/python/tests/ert/analysis/test_rml.py b/ThirdParty/Ert/python/tests/ert/analysis/test_rml.py deleted file mode 100644 index 1440f73596..0000000000 --- a/ThirdParty/Ert/python/tests/ert/analysis/test_rml.py +++ /dev/null @@ -1,129 +0,0 @@ -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'test_analysis_module.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -import random - -from ert.test import ExtendedTestCase -from ert.util.enums import RngAlgTypeEnum, RngInitModeEnum -from ert.util import Matrix, BoolVector , RandomNumberGenerator -from ert.analysis import AnalysisModule, AnalysisModuleLoadStatusEnum, AnalysisModuleOptionsEnum -from ert.enkf import MeasData , ObsData - -import ert - - -def forward_model(params , model_error = False): - # Y = A*p[0] + B*p[1] - A = 2 - B = -1 - C = 1 - D = 0.1 - state = [A*params[0] + B*params[1] , C*params[0] - D*params[1]*params[0]] - return state - - -def measure(state): - return 0.25*state[0] - 0.1*state[1]*state[1] - - -def init_matrices(ens , mask , obs , rng): - state_size = 2 - report_step = 5 - meas_data = MeasData( mask ) - meas_block = meas_data.addBlock("OBS" , report_step , len(obs) ) - - A = Matrix( state_size , mask.countEqual( True )) - active_iens = 0 - for iens,params in enumerate( ens ): - if mask[iens]: - state = forward_model( params ) - meas_block[0,iens] = measure( state ) - - A[0 , active_iens] = params[0] - A[1 , active_iens] = params[1] - - active_iens += 1 - - - S = meas_data.createS() - - obs_data = ObsData() - obs_block = obs_data.addBlock("OBS" , 1) - for iobs,obs_value in enumerate(obs): - obs_block[iobs] = obs_value - - - R = obs_data.createR() - dObs = obs_data.createDObs() - E = obs_data.createE( rng , meas_data.getActiveEnsSize() ) - D = obs_data.createD(E , S) - - obs_data.scale(S , E = E , D = D , R = R , D_obs = dObs) - return (A , S , E , D , R , dObs) - - - -class RMLTest(ExtendedTestCase): - def setUp(self): - self.libname = ert.ert_lib_path + "/rml_enkf.so" - self.user = "TEST" - - def createAnalysisModule(self): - rng = RandomNumberGenerator(RngAlgTypeEnum.MZRAN, RngInitModeEnum.INIT_DEFAULT) - return AnalysisModule(rng, lib_name = self.libname) - - def test_load_status_enum(self): - source_file_path = "libanalysis/include/ert/analysis/analysis_module.h" - self.assertEnumIsFullyDefined(AnalysisModuleLoadStatusEnum, "analysis_module_load_status_enum", source_file_path) - - - - - def test_analysis_module(self): - rng = RandomNumberGenerator( ) - module = self.createAnalysisModule() - ens_size = 12 - obs_size = 1 - state_size = 2 - - true_params = [1.25 , 0.75] - true_state = forward_model( true_params ) - obs = [(measure( true_state ) , 0.75)] - A = Matrix( state_size , ens_size ) - - ens = [] - for iens in range(ens_size): - param = [ random.gauss( 1.00 , 1.00 ) , random.gauss(1.00 , 1.00)] - ens.append( param ) - - mask = BoolVector(default_value = True , initial_size = ens_size) - mask[2] = False - (A , S , E , D , R , dObs) = init_matrices( ens , mask , obs , rng ) - - module.initUpdate( mask , S , R , dObs , E , D ) - module.updateA( A , S , R , dObs , E , D ) - - - mask[10] = False - mask[5] = False - (A , S , E , D , R , dObs) = init_matrices( ens , mask , obs , rng ) - self.assertEqual( S.dims() , (obs_size , mask.countEqual( True ))) - self.assertEqual( E.dims() , (obs_size , mask.countEqual( True ))) - self.assertEqual( D.dims() , (obs_size , mask.countEqual( True ))) - - module.initUpdate( mask , S , R , dObs , E , D ) - module.updateA( A , S , R , dObs , E , D ) - diff --git a/ThirdParty/Ert/python/tests/ert/analysis/test_std_enkf.py b/ThirdParty/Ert/python/tests/ert/analysis/test_std_enkf.py deleted file mode 100644 index cf62215da9..0000000000 --- a/ThirdParty/Ert/python/tests/ert/analysis/test_std_enkf.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (C) 2016 Statoil ASA, Norway. -# -# The file 'test_analysis_module.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from ert.test import ExtendedTestCase -from ert.analysis import AnalysisModule, AnalysisModuleLoadStatusEnum, AnalysisModuleOptionsEnum - -from ert.util.enums import RngAlgTypeEnum, RngInitModeEnum -from ert.util.rng import RandomNumberGenerator - - -class StdEnKFTest(ExtendedTestCase): - - def setUp(self): - self.rng = RandomNumberGenerator(RngAlgTypeEnum.MZRAN, RngInitModeEnum.INIT_DEFAULT) - self.module = AnalysisModule( self.rng , name = "STD_ENKF" ) - - def toggleKey(self, key): - self.assertTrue( self.module.hasVar( key )) - - # check it is true - self.assertTrue( self.module.setVar( key , True ) ) - self.assertTrue( self.module.getBool(key) ) - - # set it to false - self.assertTrue( self.module.setVar( key , False ) ) - self.assertFalse( self.module.getBool(key) ) - - def test_EE_option(self): - self.toggleKey( 'USE_EE' ) - - def test_GE_option(self): - self.toggleKey( 'USE_GE' ) - - - def test_scaledata_option(self): - self.toggleKey( 'ANALYSIS_SCALE_DATA' ) - - - diff --git a/ThirdParty/Ert/python/tests/ert/analysis/test_std_enkf_debug.py b/ThirdParty/Ert/python/tests/ert/analysis/test_std_enkf_debug.py deleted file mode 100644 index 80637c9cab..0000000000 --- a/ThirdParty/Ert/python/tests/ert/analysis/test_std_enkf_debug.py +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright (C) 2016 Statoil ASA, Norway. -# -# The file 'test_analysis_module.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -import ert -from ert.test import ExtendedTestCase -from ert.analysis import AnalysisModule, AnalysisModuleLoadStatusEnum, AnalysisModuleOptionsEnum -from ert.analysis import AnalysisPrototype -from ert.util.enums import RngAlgTypeEnum, RngInitModeEnum -from ert.util.rng import RandomNumberGenerator - - -class StdEnKFDebugTest(ExtendedTestCase): - - def setUp(self): - self.rng = RandomNumberGenerator(RngAlgTypeEnum.MZRAN, RngInitModeEnum.INIT_DEFAULT) - self.libname = ert.ert_lib_path + "/std_enkf_debug.so" - self.module = AnalysisModule( self.rng , lib_name = self.libname ) - - - def toggleKey(self, key): - self.assertTrue( self.module.hasVar( key )) - - # check it is true - self.assertTrue( self.module.setVar( key , True ) ) - self.assertTrue( self.module.getBool(key) ) - - # set it to false - self.assertTrue( self.module.setVar( key , False ) ) - self.assertFalse( self.module.getBool(key) ) - - def test_EE_option(self): - self.toggleKey( 'USE_EE' ) - - - def test_scaledata_option(self): - self.toggleKey( 'ANALYSIS_SCALE_DATA' ) - - def test_prefix(self): - self.assertTrue( self.module.hasVar("PREFIX")) - self.assertTrue( self.module.setVar( "PREFIX" , "Path") ) diff --git a/ThirdParty/Ert/python/tests/ert/config/CMakeLists.txt b/ThirdParty/Ert/python/tests/ert/config/CMakeLists.txt deleted file mode 100644 index 06443963eb..0000000000 --- a/ThirdParty/Ert/python/tests/ert/config/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -set(TEST_SOURCES - __init__.py - test_config.py -) - -add_python_package("python.tests.ert.config" ${PYTHON_INSTALL_PREFIX}/tests/ert/config "${TEST_SOURCES}" True) - -addPythonTest(ert.config tests.ert.config.test_config.ConfigTest) \ No newline at end of file diff --git a/ThirdParty/Ert/python/tests/ert/config/__init__.py b/ThirdParty/Ert/python/tests/ert/config/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/python/tests/ert/config/test_config.py b/ThirdParty/Ert/python/tests/ert/config/test_config.py deleted file mode 100644 index a58507cd34..0000000000 --- a/ThirdParty/Ert/python/tests/ert/config/test_config.py +++ /dev/null @@ -1,366 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'test_config.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -import os - -import ert -from ert.config import ContentTypeEnum, UnrecognizedEnum, SchemaItem, ContentItem, ContentNode, ConfigParser, ConfigContent,ConfigSettings -from cwrap import Prototype, clib -from ert.test import ExtendedTestCase, TestAreaContext - - -class TestConfigPrototype(Prototype): - lib = ert.load("libconfig") - - def __init__(self, prototype, bind=False): - super(TestConfigPrototype, self).__init__(TestConfigPrototype.lib, prototype, bind=bind) - -# Adding extra functions to the ConfigContent object for the ability -# to test low level C functions which are not exposed in Python. -_safe_iget = TestConfigPrototype("char* config_content_safe_iget( config_content , char* , int , int)") -_iget = TestConfigPrototype("char* config_content_iget( config_content , char* , int , int)") -_iget_as_int = TestConfigPrototype("int config_content_iget_as_int( config_content , char* , int , int)") -_iget_as_bool = TestConfigPrototype("bool config_content_iget_as_bool( config_content , char* , int , int)") -_iget_as_double = TestConfigPrototype("double config_content_iget_as_double( config_content , char* , int , int)") -_get_occurences = TestConfigPrototype("int config_content_get_occurences( config_content , char* )") - - -class ConfigTest(ExtendedTestCase): - def setUp( self ): - self.file_list = [] - - - def test_enums(self): - source_file_path = "libconfig/include/ert/config/config_schema_item.h" - self.assertEnumIsFullyDefined(ContentTypeEnum, "config_item_types", source_file_path) - self.assertEnumIsFullyDefined(UnrecognizedEnum, "config_schema_unrecognized_enum", source_file_path) - - - def test_item_types(self): - with TestAreaContext("config/types") as test_area: - with open("config" , "w") as f: - f.write("TYPE_ITEM 10 3.14 TruE String file\n") - - conf = ConfigParser() - schema_item = conf.add("TYPE_ITEM", False) - schema_item.iset_type(0 , ContentTypeEnum.CONFIG_INT ) - schema_item.iset_type(1 , ContentTypeEnum.CONFIG_FLOAT ) - schema_item.iset_type(2 , ContentTypeEnum.CONFIG_BOOL ) - schema_item.iset_type(3 , ContentTypeEnum.CONFIG_STRING ) - schema_item.iset_type(4 , ContentTypeEnum.CONFIG_PATH ) - self.assertFalse( "TYPE_XX" in conf ) - self.assertTrue( "TYPE_ITEM" in conf ) - - content = conf.parse("config") - type_item = content["TYPE_ITEM"][0] - int_value = type_item[0] - self.assertEqual( int_value , 10 ) - self.assertEqual( type_item.igetString(0) , "10") - - float_value = type_item[1] - self.assertEqual( float_value , 3.14 ) - self.assertEqual( type_item.igetString(1) , "3.14") - - bool_value = type_item[2] - self.assertEqual( bool_value , True) - self.assertEqual( type_item.igetString(2) , "TruE") - - string_value = type_item[3] - self.assertEqual( string_value , "String") - self.assertEqual( type_item.igetString(3) , "String") - - path_value = type_item[4] - self.assertEqual( path_value , "file") - self.assertEqual( type_item.igetString(4) , "file") - - - - - - def test_parse(self): - conf = ConfigParser() - conf.add("FIELD", False) - schema_item = conf.add("RSH_HOST", False) - self.assertIsInstance(schema_item, SchemaItem) - test_path = self.createTestPath("local/config/simple_config") - content = conf.parse(test_path, unrecognized=UnrecognizedEnum.CONFIG_UNRECOGNIZED_IGNORE) - self.assertTrue( content.isValid() ) - - - content_item = content["RSH_HOST"] - self.assertIsInstance(content_item, ContentItem) - self.assertEqual(len(content_item), 1) - with self.assertRaises(TypeError): - content_item["BJARNE"] - - with self.assertRaises(IndexError): - content_item[10] - - content_node = content_item[0] - self.assertIsInstance(content_node, ContentNode) - self.assertEqual(len(content_node), 2) - self.assertEqual(content_node[1], "be-lx633214:2") - self.assertEqual(content_node.content(sep=","), "be-lx655082:2,be-lx633214:2") - self.assertEqual(content_node.content(), "be-lx655082:2 be-lx633214:2") - - - content_item = content["FIELD"] - self.assertEqual(len(content_item), 5) - with self.assertRaises(IOError): - conf.parse("DoesNotExits") - - - def test_parse_invalid(self): - conf = ConfigParser() - conf.add("INT", value_type = ContentTypeEnum.CONFIG_INT ) - with TestAreaContext("config/parse2"): - with open("config","w") as fileH: - fileH.write("INT xx\n") - - with self.assertRaises(ValueError): - conf.parse("config") - - content = conf.parse("config" , validate = False ) - self.assertFalse( content.isValid() ) - self.assertEqual( len(content.getErrors()) , 1 ) - - - def test_parse_deprecated(self): - conf = ConfigParser() - item = conf.add("INT", value_type = ContentTypeEnum.CONFIG_INT ) - msg = "ITEM INT IS DEPRECATED" - item.setDeprecated( msg ) - with TestAreaContext("config/parse2"): - with open("config","w") as fileH: - fileH.write("INT 100\n") - - content = conf.parse("config" ) - self.assertTrue( content.isValid() ) - - warnings = content.getWarnings() - self.assertEqual( len(warnings) , 1 ) - self.assertEqual( warnings[0] , msg ) - - - def test_parse_dotdot_relative(self): - conf = ConfigParser() - schema_item = conf.add("EXECUTABLE", False) - schema_item.iset_type(0 , ContentTypeEnum.CONFIG_PATH ) - - - with TestAreaContext("config/parse_dotdot"): - os.makedirs("cwd/jobs") - os.makedirs("eclipse/bin") - script_path = os.path.join( os.getcwd() , "eclipse/bin/script.sh") - with open(script_path,"w") as f: - f.write("This is a test script") - - with open("cwd/jobs/JOB","w") as fileH: - fileH.write("EXECUTABLE ../../eclipse/bin/script.sh\n") - - os.makedirs("cwd/ert") - os.chdir("cwd/ert") - content = conf.parse("../jobs/JOB") - item = content["EXECUTABLE"] - node = item[0] - self.assertEqual( script_path , node.getPath( )) - - - - - - def test_parser_content(self): - conf = ConfigParser() - conf.add("KEY2", False) - schema_item = conf.add("KEY", False) - schema_item.iset_type(2 , ContentTypeEnum.CONFIG_INT ) - schema_item.iset_type(3 , ContentTypeEnum.CONFIG_BOOL ) - schema_item.iset_type(4 , ContentTypeEnum.CONFIG_FLOAT ) - schema_item.iset_type(5 , ContentTypeEnum.CONFIG_PATH ) - schema_item = conf.add("NOT_IN_CONTENT", False) - - - with TestAreaContext("config/parse2"): - with open("config","w") as fileH: - fileH.write("KEY VALUE1 VALUE2 100 True 3.14 path/file.txt\n") - - cwd0 = os.getcwd( ) - os.makedirs("tmp") - os.chdir("tmp") - content = conf.parse("../config") - self.assertTrue( content.isValid() ) - self.assertTrue( "KEY" in content ) - self.assertFalse( "NOKEY" in content ) - - self.assertFalse( "NOT_IN_CONTENT" in content ) - item = content["NOT_IN_CONTENT"] - self.assertEqual( len(item) , 0 ) - - with self.assertRaises(KeyError): - content["Nokey"] - - item = content["KEY"] - self.assertEqual(len(item) , 1) - - line = item[0] - with self.assertRaises(TypeError): - line.getPath(4) - - with self.assertRaises(TypeError): - line.getPath() - - - rel_path = line.getPath(index = 5, absolute = False) - self.assertEqual( rel_path , "../path/file.txt" ) - get = line[5] - self.assertEqual( get , "../path/file.txt") - abs_path = line.getPath(index = 5) - self.assertEqual( abs_path , os.path.join(cwd0 , "path/file.txt")) - - rel_path = line.getPath(index = 5, absolute = False , relative_start = "../") - self.assertEqual( rel_path , "path/file.txt" ) - - - with self.assertRaises(IndexError): - item[10] - - node = item[0] - self.assertEqual(len(node) , 6) - with self.assertRaises(IndexError): - node[6] - - self.assertEqual( node[0] , "VALUE1" ) - self.assertEqual( node[1] , "VALUE2" ) - self.assertEqual( node[2] , 100 ) - self.assertEqual( node[3] , True ) - self.assertEqual( node[4] , 3.14) - - self.assertEqual( content.getValue( "KEY" , 0 , 1 ) , "VALUE2" ) - self.assertEqual( _iget( content , "KEY" , 0 , 1) , "VALUE2") - - self.assertEqual( content.getValue( "KEY" , 0 , 2 ) , 100 ) - self.assertEqual( _iget_as_int( content , "KEY" , 0 , 2) , 100) - - self.assertEqual( content.getValue( "KEY" , 0 , 3 ) , True ) - self.assertEqual( _iget_as_bool( content , "KEY" , 0 , 3) , True) - - self.assertEqual( content.getValue( "KEY" , 0 , 4 ) , 3.14 ) - self.assertEqual( _iget_as_double( content , "KEY" , 0 , 4) , 3.14) - - self.assertIsNone( _safe_iget( content , "KEY2" , 0 , 0)) - - self.assertEqual( _get_occurences( content , "KEY2" ) , 0) - self.assertEqual( _get_occurences( content , "KEY" ) , 1) - self.assertEqual( _get_occurences( content , "MISSING-KEY" ) , 0) - - - - def test_schema(self): - schema_item = SchemaItem("TestItem") - self.assertIsInstance(schema_item, SchemaItem) - self.assertEqual(schema_item.iget_type(6), ContentTypeEnum.CONFIG_STRING) - schema_item.iset_type(0, ContentTypeEnum.CONFIG_INT) - self.assertEqual(schema_item.iget_type(0), ContentTypeEnum.CONFIG_INT) - schema_item.set_argc_minmax(3, 6) - - self.assertTrue( SchemaItem.validString( ContentTypeEnum.CONFIG_INT , "100") ) - self.assertFalse( SchemaItem.validString( ContentTypeEnum.CONFIG_INT , "100.99") ) - self.assertTrue( SchemaItem.validString( ContentTypeEnum.CONFIG_FLOAT , "100.99") ) - self.assertFalse( SchemaItem.validString( ContentTypeEnum.CONFIG_FLOAT , "100.99X") ) - self.assertTrue( SchemaItem.validString( ContentTypeEnum.CONFIG_STRING , "100.99XX") ) - self.assertTrue( SchemaItem.validString( ContentTypeEnum.CONFIG_PATH , "100.99XX") ) - - - del schema_item - - - - - def test_settings(self): - cs = ConfigSettings("SETTINGS") - - with self.assertRaises(TypeError): - cs.addSetting("SETTING1" , ContentTypeEnum.CONFIG_INT , 100.67) - - self.assertFalse( "SETTING1" in cs ) - cs.addSetting("SETTING2" , ContentTypeEnum.CONFIG_INT , 100) - self.assertTrue( "SETTING2" in cs ) - - with self.assertRaises(KeyError): - value = cs["NO_SUCH_KEY"] - - self.assertEqual( cs["SETTING2"] , 100 ) - - with self.assertRaises(KeyError): - cs["NO_SUCH_KEY"] = 100 - - - parser = ConfigParser() - cs = ConfigSettings("SETTINGS") - cs.addSetting("A" , ContentTypeEnum.CONFIG_INT , 1) - cs.addSetting("B" , ContentTypeEnum.CONFIG_INT , 1) - cs.addSetting("C" , ContentTypeEnum.CONFIG_INT , 1) - cs.initParser( parser ) - - - with TestAreaContext("config/parse3"): - with open("config","w") as fileH: - fileH.write("SETTINGS A 100\n") - fileH.write("SETTINGS B 200\n") - fileH.write("SETTINGS C 300\n") - - content = parser.parse( "config" ) - cs.apply( content ) - self.assertEqual( cs["A"] , 100) - self.assertEqual( cs["B"] , 200) - self.assertEqual( cs["C"] , 300) - - keys = cs.keys() - self.assertTrue("A" in keys ) - self.assertTrue("B" in keys ) - self.assertTrue("C" in keys ) - self.assertEqual( len(keys) , 3 ) - - cs = ConfigSettings("SETTINGS") - cs.addDoubleSetting("A" , 1.0) - self.assertEqual( ContentTypeEnum.CONFIG_FLOAT , cs.getType("A")) - - cs = ConfigSettings("SETTINGS") - cs.addDoubleSetting("A" , 1.0) - cs.addIntSetting("B" , 1) - cs.addStringSetting("C" , "1") - cs.addBoolSetting("D" , True) - cs.initParser( parser ) - - with TestAreaContext("config/parse4"): - with open("config","w") as fileH: - fileH.write("SETTINGS A 100.1\n") - fileH.write("SETTINGS B 200\n") - fileH.write("SETTINGS C 300\n") - fileH.write("SETTINGS D False\n") - - content = parser.parse( "config" ) - - cs.apply( content ) - self.assertEqual( cs["A"] , 100.1) - self.assertEqual( cs["B"] , 200) - self.assertEqual( cs["C"] , "300") - self.assertEqual( cs["D"] , False) - - with self.assertRaises(Exception): - cs["A"] = "Hei" - - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/CMakeLists.txt b/ThirdParty/Ert/python/tests/ert/enkf/CMakeLists.txt deleted file mode 100644 index 4b3640bff4..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/CMakeLists.txt +++ /dev/null @@ -1,87 +0,0 @@ -set(TEST_SOURCES - __init__.py - test_active_list.py - test_analysis_config.py - test_analysis_iter_config.py - test_block_obs.py - test_custom_kw_config_set.py - test_ecl_config.py - test_es_update.py - test_enkf.py - test_enkf_fs.py - test_enkf_fs_manager1.py - test_enkf_fs_manager2.py - test_enkf_library.py - test_enkf_load_results_manually.py - test_enkf_obs.py - test_ert_context.py - test_ert_log.py - test_gen_obs.py - test_labscale.py - test_linalg.py - test_local_obsdata_node.py - test_local_config.py - test_meas_block.py - test_meas_data.py - test_obs_block.py - test_obs_data.py - test_state_map.py - test_summary_key_matcher.py - test_summary_key_set.py - test_summary_obs.py - test_time_map.py - test_update.py - test_ensemble_config.py - test_deprecation.py - test_field_config.py - test_field_export.py - test_hook_workflow.py - test_forward_load_context.py - test_runpath_list.py -) - -add_python_package("python.tests.ert.enkf" ${PYTHON_INSTALL_PREFIX}/tests/ert/enkf "${TEST_SOURCES}" False) -addPythonTest(ert.enkf.es_update tests.ert.enkf.test_es_update.ESUpdateTest) -addPythonTest(ert.enkf.forward_load_context tests.ert.enkf.test_forward_load_context.ForwardLoadContextTest) -addPythonTest(ert.enkf.deprecation tests.ert.enkf.test_deprecation.DeprecationTest) -addPythonTest(ert.enkf.meas_block tests.ert.enkf.test_meas_block.MeasBlockTest) -addPythonTest(ert.enkf.meas_data tests.ert.enkf.test_meas_data.MeasDataTest) -addPythonTest(ert.enkf.obs_data tests.ert.enkf.test_obs_data.ObsDataTest) -addPythonTest(ert.enkf.gen_obs tests.ert.enkf.test_gen_obs.GenObsTest) -addPythonTest(ert.enkf.summary_obs tests.ert.enkf.test_summary_obs.SummaryObsTest) -addPythonTest(ert.enkf.block_obs tests.ert.enkf.test_block_obs.BlockObsTest) -addPythonTest(ert.enkf.obs_block tests.ert.enkf.test_obs_block.ObsBlockTest) -addPythonTest(ert.enkf.ert_log tests.ert.enkf.test_ert_log.ErtLogTest) -addPythonTest(ert.enkf.analysis_config tests.ert.enkf.test_analysis_config.AnalysisConfigTest) -addPythonTest(ert.enkf.analysis_iter_config tests.ert.enkf.test_analysis_iter_config.AnalysisIterConfigTest) -addPythonTest(ert.enkf.state_map tests.ert.enkf.test_state_map.StateMapTest) -addPythonTest(ert.enkf.custom_kw_config_set tests.ert.enkf.test_custom_kw_config_set.CustomKWConfigSetTest) -addPythonTest(ert.enkf.summary_key_matcher tests.ert.enkf.test_summary_key_matcher.SummaryKeyMatcherTest) -addPythonTest(ert.enkf.time_map tests.ert.enkf.test_time_map.TimeMapTest) -addPythonTest(ert.enkf.active_list tests.ert.enkf.test_active_list.ActiveListTest) -addPythonTest(ert.enkf.local_obsdata_node tests.ert.enkf.test_local_obsdata_node.LocalObsdataNodeTest) -addPythonTest(ert.enkf.local_config tests.ert.enkf.test_local_config.LocalConfigTest) -addPythonTest(ert.enkf.ensemble_config tests.ert.enkf.test_ensemble_config.EnsembleConfigTest) -addPythonTest(ert.enkf.hook_workflow tests.ert.enkf.test_hook_workflow.HookWorkFlowTest) -addPythonTest(ert.enkf.runpath_list tests.ert.enkf.test_runpath_list.RunpathListTest) -addPythonTest(ert.enkf.field_config tests.ert.enkf.test_field_config.FieldConfigTest) - -if (STATOIL_TESTDATA_ROOT) - addPythonTest(ert.enkf.enkf tests.ert.enkf.test_enkf.EnKFTest LABELS StatoilData) - addPythonTest(ert.enkf.enkf_obs tests.ert.enkf.test_enkf_obs.EnKFObsTest LABELS StatoilData) - addPythonTest(ert.enkf.enkf_load_results_manually tests.ert.enkf.test_enkf_load_results_manually.LoadResultsManuallyTest LABELS StatoilData) - addPythonTest(ert.enkf.enkf_fs tests.ert.enkf.test_enkf_fs.EnKFFSTest LABELS StatoilData) - addPythonTest(ert.enkf.enkf_fs_manager1 tests.ert.enkf.test_enkf_fs_manager1.EnKFFSManagerTest1 LABELS StatoilData) - addPythonTest(ert.enkf.enkf_fs_manager2 tests.ert.enkf.test_enkf_fs_manager2.EnKFFSManagerTest2 LABELS StatoilData) - addPythonTest(ert.enkf.enkf_library tests.ert.enkf.test_enkf_library.EnKFLibraryTest) - addPythonTest(ert.enkf.summary_key_set tests.ert.enkf.test_summary_key_set.SummaryKeySetTest LABELS StatoilData) - addPythonTest(ert.enkf.ecl_config tests.ert.enkf.test_ecl_config.EclConfigTest LABELS StatoilData) - addPythonTest(ert.enkf.ert_test_context tests.ert.enkf.test_ert_context.ErtTestContextTest LABELS StatoilData) - addPythonTest(ert.enkf.update tests.ert.enkf.test_update.UpdateTest LABELS StatoilData) - addPythonTest(ert.enkf.labscale tests.ert.enkf.test_labscale.LabScaleTest LABELS StatoilData) - addPythonTest(ert.enkf.field_export tests.ert.enkf.test_field_export.FieldExportTest LABELS StatoilData) -endif() - -add_subdirectory(data) -add_subdirectory(export) -add_subdirectory(plot) diff --git a/ThirdParty/Ert/python/tests/ert/enkf/__init__.py b/ThirdParty/Ert/python/tests/ert/enkf/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/python/tests/ert/enkf/data/CMakeLists.txt b/ThirdParty/Ert/python/tests/ert/enkf/data/CMakeLists.txt deleted file mode 100644 index 2f2d27be53..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/data/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -set(TEST_SOURCES - __init__.py - test_custom_kw.py - test_custom_kw_config.py - test_field_config.py - test_gen_data.py - test_gen_data_config.py - test_gen_kw.py - test_gen_kw_config.py -) - -add_python_package("python.tests.ert.enkf.data" ${PYTHON_INSTALL_PREFIX}/tests/ert/enkf/data "${TEST_SOURCES}" False) - -addPythonTest(ert.enkf.data.custom_kw tests.ert.enkf.data.test_custom_kw.CustomKWTest) -addPythonTest(ert.enkf.data.gen_kw tests.ert.enkf.data.test_gen_kw.GenKwTest) - -if (STATOIL_TESTDATA_ROOT) - addPythonTest(ert.enkf.data.gen_kw_config tests.ert.enkf.data.test_gen_kw_config.GenKwConfigTest LABELS StatoilData) - addPythonTest(ert.enkf.data.gen_data tests.ert.enkf.data.test_gen_data.GenDataTest LABELS StatoilData) - addPythonTest(ert.enkf.data.gen_data_config tests.ert.enkf.data.test_gen_data_config.GenDataConfigTest LABELS StatoilData) -endif() diff --git a/ThirdParty/Ert/python/tests/ert/enkf/data/__init__.py b/ThirdParty/Ert/python/tests/ert/enkf/data/__init__.py deleted file mode 100644 index 8b13789179..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/data/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/data/test_custom_kw.py b/ThirdParty/Ert/python/tests/ert/enkf/data/test_custom_kw.py deleted file mode 100644 index 804127472b..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/data/test_custom_kw.py +++ /dev/null @@ -1,123 +0,0 @@ -import os -from ert.enkf.config import CustomKWConfig -from ert.enkf.data import CustomKW -from ert.enkf.enkf_simulation_runner import EnkfSimulationRunner -from ert.enkf.export import custom_kw_collector -from ert.enkf.export.custom_kw_collector import CustomKWCollector -from ert.test.ert_test_context import ErtTestContext -from ert.test.extended_testcase import ExtendedTestCase -from ert.test.test_area import TestAreaContext -from ert.util import StringList - - -class CustomKWTest(ExtendedTestCase): - - def createResultFile(self, filename, data): - with open(filename, "w") as output_file: - for key in data: - output_file.write("%s %s\n" % (key, data[key])) - - def test_custom_kw_creation(self): - data = {"VALUE_1": 2345.234, - "VALUE_2": 0.001234, - "VALUE_3": "string_1", - "VALUE_4": "string_2"} - - with TestAreaContext("python/enkf/data/custom_kw_creation") as test_area: - - self.createResultFile("result_file", data) - - custom_kw_config = CustomKWConfig("CUSTOM_KW", "result_file") - - self.assertEqual(len(custom_kw_config), 0) - - custom_kw = CustomKW(custom_kw_config) - - custom_kw.fload("result_file") - - self.assertEqual(len(custom_kw_config), 4) - - for key in data: - index = custom_kw_config.indexOfKey(key) - self.assertEqual(data[key], custom_kw[key]) - - with self.assertRaises(KeyError): - value = custom_kw["VALUE_5"] - - - - def test_custom_kw_config_data_is_null(self): - data_1 = {"VALUE_1": 123453.3, - "VALUE_2": 0.234234} - - data_2 = {"VALUE_1": 965689, - "VALUE_3": 1.1222} - - with TestAreaContext("python/enkf/data/custom_kw_null_element") as test_area: - - self.createResultFile("result_file_1", data_1) - self.createResultFile("result_file_2", data_2) - - custom_kw_config = CustomKWConfig("CUSTOM_KW", "result_file") - - custom_kw_1 = CustomKW(custom_kw_config) - custom_kw_1.fload("result_file_1") - - custom_kw_2 = CustomKW(custom_kw_config) - custom_kw_2.fload("result_file_2") - - index_1 = custom_kw_config.indexOfKey("VALUE_1") - index_2 = custom_kw_config.indexOfKey("VALUE_2") - - self.assertEqual(custom_kw_1["VALUE_1"], data_1["VALUE_1"]) - self.assertEqual(custom_kw_2["VALUE_1"], data_2["VALUE_1"]) - - self.assertIsNone(custom_kw_2["VALUE_2"]) - self.assertFalse( "VALUE_3" in custom_kw_config ) - - - - def test_simulated_custom_kw(self): - config = self.createTestPath("local/custom_kw/mini_config") - with ErtTestContext("python/enkf/data/custom_kw_simulated", config) as context: - ert = context.getErt() - - ensemble_config = ert.ensembleConfig() - self.assertTrue("AGGREGATED" in ensemble_config) - - config = ensemble_config.getNode("AGGREGATED").getCustomKeywordModelConfig() - - self.assertEqual(len(config.getKeys()), 0) - - simulation_runner = EnkfSimulationRunner(ert) - simulation_runner.runEnsembleExperiment() - - config = ensemble_config.getNode("AGGREGATED").getCustomKeywordModelConfig() - - self.assertEqual(len(config.getKeys()), 4) - self.assertItemsEqual(config.getKeys(), ["PERLIN_1", "PERLIN_2", "PERLIN_3", "STATE"]) - - - def test_custom_kw_set_values(self): - definition = { - "STRING": str, - "FLOAT": float, - "INT": float - } - - ckwc = CustomKWConfig("Test", None, definition=definition) - - ckw = CustomKW(ckwc) - with self.assertRaises(KeyError): - ckw["ANOTHER_STRING"] = "another string" - - ckw["STRING"] = "string" - ckw["FLOAT"] = 3.1415 - ckw["INT"] = 1 - - self.assertEqual(ckw["STRING"], "string") - self.assertEqual(ckw["FLOAT"], 3.1415) - self.assertEqual(ckw["INT"], 1) - - - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/data/test_custom_kw_config.py b/ThirdParty/Ert/python/tests/ert/enkf/data/test_custom_kw_config.py deleted file mode 100644 index a57b4dc9e8..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/data/test_custom_kw_config.py +++ /dev/null @@ -1,130 +0,0 @@ -from ert.enkf.config.custom_kw_config import CustomKWConfig -from ert.test.extended_testcase import ExtendedTestCase -from ert.test.test_area import TestAreaContext -from ert.util import StringList - - -class CustomKWConfigTest(ExtendedTestCase): - - def createResultFile(self, filename, data): - with open(filename, "w") as output_file: - for key in data: - output_file.write("%s %s\n" % (key, data[key])) - - def test_custom_kw_config_creation(self): - data = {"VALUE_1": 2345.234, - "VALUE_2": 0.001234, - "VALUE_3": "string_1", - "VALUE_4": "string_2"} - - with TestAreaContext("python/enkf/data/custom_kw_config") as test_area: - - self.createResultFile("result_file", data) - - custom_kw_config = CustomKWConfig("CUSTOM_KW", "result_file", "output_file") - - self.assertEqual(custom_kw_config.getName(), "CUSTOM_KW") - self.assertEqual(custom_kw_config.getResultFile(), "result_file") - self.assertEqual(custom_kw_config.getOutputFile(), "output_file") - - self.assertEqual(len(custom_kw_config), 0) - - result = StringList() - success = custom_kw_config.parseResultFile("result_file", result) - self.assertTrue(success) - - self.assertEqual(len(custom_kw_config), 4) - - for index, key in enumerate(data): - self.assertTrue(key in custom_kw_config) - - key_is_string = isinstance(data[key], str) - self.assertTrue(custom_kw_config.keyIsDouble(key) != key_is_string) - self.assertEqual(index, custom_kw_config.indexOfKey(key)) - - self.assertEqual(result[index], str(data[key])) - - self.assertTrue(len(custom_kw_config.getKeys()) == 4) - - for key in custom_kw_config: - self.assertTrue(key in data) - - - def test_custom_kw_config_multiple_identical_keys(self): - data = {"VALUE_1": 2345.234, - "VALUE_2": 0.001234, - "VALUE_3": "string_1", - "VALUE_4": "string_2 VALUE_4 repeat_of_value_4"} - - with TestAreaContext("python/enkf/data/custom_kw_config_multiple_identical_keys") as test_area: - - self.createResultFile("result_file", data) - - custom_kw_config = CustomKWConfig("CUSTOM_KW", "result_file") - - result = StringList() - success = custom_kw_config.parseResultFile("result_file", result) - self.assertTrue(success) - - index_of_value_4 = custom_kw_config.indexOfKey("VALUE_4") - self.assertEqual(result[index_of_value_4], "repeat_of_value_4") - - - - def test_custom_kw_config_define_and_read(self): - data_1 = {"VALUE_1": 123453.3, - "VALUE_2": 0.234234} - - data_2 = {"VALUE_1": 965689, - "VALUE_3": 1.1222} - - with TestAreaContext("python/enkf/data/custom_kw_config") as test_area: - - self.createResultFile("result_file_1", data_1) - self.createResultFile("result_file_2", data_2) - - custom_kw_config = CustomKWConfig("CUSTOM_KW", "result_file") - - result_1 = StringList() - success = custom_kw_config.parseResultFile("result_file_1", result_1) - self.assertTrue(success) - - result_2 = StringList() - success = custom_kw_config.parseResultFile("result_file_2", result_2) - self.assertFalse(success) - - for key in custom_kw_config: - self.assertTrue(key in data_1) - - self.assertFalse("VALUE_3" in custom_kw_config) - - - - - def test_custom_kw_config_parse_fail(self): - data = {"KEY_1": "Value Key_2"} - - with TestAreaContext("python/enkf/data/custom_kw_config_fail") as test_area: - - self.createResultFile("result_file", data) - - custom_kw_config = CustomKWConfig("CUSTOM_KW_FAIL", "result_file") - self.assertIsNone(custom_kw_config.getOutputFile()) - - self.assertFalse(custom_kw_config.parseResultFile("result_file", StringList())) - - - def test_custom_kw_config_construction_with_definition(self): - definition = { - "VALUE_1": float, - "VALUE_2": str - } - custom_kw_config = CustomKWConfig("TEST", None, definition=definition) - self.assertEqual(len(custom_kw_config.getKeys()), 2) - - self.assertTrue(custom_kw_config.keyIsDouble("VALUE_1")) - self.assertFalse(custom_kw_config.keyIsDouble("VALUE_2")) - - self.assertIn("VALUE_1", custom_kw_config) - self.assertIn("VALUE_2", custom_kw_config) - self.assertNotIn("VALUE_3", custom_kw_config) \ No newline at end of file diff --git a/ThirdParty/Ert/python/tests/ert/enkf/data/test_field_config.py b/ThirdParty/Ert/python/tests/ert/enkf/data/test_field_config.py deleted file mode 100644 index 04ba9303c9..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/data/test_field_config.py +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (C) 2015 Statoil ASA, Norway. -# -# The file 'test_field_config.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -import os - -from ert.enkf import FieldConfig -from ert.enkf import ActiveList -from ert.test import ExtendedTestCase -from ert.ecl import EclGrid - -class FieldConfigTest(ExtendedTestCase): - - def test_create(self): - grid = EclGrid.createRectangular( (10,10,5) , (1,1,1) ) - field_config = FieldConfig("SWAT" , grid) - - - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/data/test_gen_data.py b/ThirdParty/Ert/python/tests/ert/enkf/data/test_gen_data.py deleted file mode 100644 index 2d4f80b617..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/data/test_gen_data.py +++ /dev/null @@ -1,30 +0,0 @@ -import ert - -from ert.enkf.data.enkf_node import EnkfNode -from ert.enkf.node_id import NodeId -from ert.test import ErtTestContext -from ert.test.extended_testcase import ExtendedTestCase -from ert.util import BoolVector - - -class GenDataTest(ExtendedTestCase): - def setUp(self): - self.config_file = self.createTestPath("Statoil/config/with_GEN_DATA/config") - - - def test_create(self): - with ErtTestContext("gen_data_test", self.config_file) as test_context: - ert = test_context.getErt() - fs1 = ert.getEnkfFsManager().getCurrentFileSystem() - config_node = ert.ensembleConfig().getNode("TIMESHIFT") - - data_node = EnkfNode(config_node) - data_node.tryLoad(fs1, NodeId(60, 0)) - - gen_data = data_node.asGenData() - data = gen_data.getData() - - self.assertEqual(len(data) , 2560) - - - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/data/test_gen_data_config.py b/ThirdParty/Ert/python/tests/ert/enkf/data/test_gen_data_config.py deleted file mode 100644 index 9f06a307bd..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/data/test_gen_data_config.py +++ /dev/null @@ -1,74 +0,0 @@ -import ert - -from ert.enkf.data import EnkfNode -from ert.enkf.config import GenDataConfig -from ert.enkf import EnkfPrototype -from ert.enkf import NodeId -from ert.enkf import ForwardLoadContext -from ert.test import ErtTestContext, ExtendedTestCase -from ert.util import BoolVector - -class GenDataConfigTest(ExtendedTestCase): - _get_active_mask = EnkfPrototype("bool_vector_ref gen_data_config_get_active_mask( gen_data_config )", bind = False) - _update_active_mask = EnkfPrototype("void gen_data_config_update_active( gen_data_config, forward_load_context , bool_vector)", bind = False) - _alloc_run_arg = EnkfPrototype("run_arg_obj run_arg_alloc_ENSEMBLE_EXPERIMENT( enkf_fs , int , int , char*) ", bind = False) - - def setUp(self): - self.config_file = self.createTestPath("Statoil/config/with_GEN_DATA/config") - - def load_active_masks(self, case1, case2 ): - with ErtTestContext("gen_data_config_test", self.config_file) as test_context: - ert = test_context.getErt() - - fs1 = ert.getEnkfFsManager().getFileSystem(case1) - config_node = ert.ensembleConfig().getNode("TIMESHIFT") - data_node = EnkfNode(config_node) - data_node.tryLoad(fs1, NodeId(60, 0)) - - active_mask = self._get_active_mask( config_node.getDataModelConfig() ) - first_active_mask_length = len(active_mask) - self.assertEqual(first_active_mask_length, 2560) - - fs2 = ert.getEnkfFsManager().getFileSystem(case2) - data_node = EnkfNode(config_node) - data_node.tryLoad(fs2, NodeId(60, 0)) - - active_mask = self._get_active_mask( config_node.getDataModelConfig() ) - second_active_mask_len = len(active_mask) - self.assertEqual(second_active_mask_len, 2560) - self.assertEqual(first_active_mask_length, second_active_mask_len) - - # Setting one element to False, load different case, check, reload, and check. - self.assertTrue(active_mask[10]) - active_mask_modified = active_mask.copy() - active_mask_modified[10] = False - - self.updateMask(config_node.getDataModelConfig(), 60, fs2 , active_mask_modified) - active_mask = self._get_active_mask( config_node.getDataModelConfig() ) - self.assertFalse(active_mask[10]) - - #Load first - check element is true - data_node = EnkfNode(config_node) - data_node.tryLoad(fs1, NodeId(60, 0)) - active_mask = self._get_active_mask( config_node.getDataModelConfig() ) - self.assertTrue(active_mask[10]) - - # Reload second again, should now be false at 10, due to the update further up - data_node = EnkfNode(config_node) - data_node.tryLoad(fs2, NodeId(60, 0)) - active_mask = self._get_active_mask( config_node.getDataModelConfig() ) - self.assertFalse(active_mask[10]) - - - def test_loading_two_cases_with_and_without_active_file(self): - self.load_active_masks("missing-active", "default") - - - - def test_create(self): - conf = GenDataConfig("KEY") - - def updateMask(self, gen_data_config , report_step , fs, active_mask): - run_arg = self._alloc_run_arg( fs , 0 , 0 , "Path") - load_context = ForwardLoadContext( run_arg = run_arg , report_step = report_step ) - self._update_active_mask( gen_data_config , load_context , active_mask ) diff --git a/ThirdParty/Ert/python/tests/ert/enkf/data/test_gen_kw.py b/ThirdParty/Ert/python/tests/ert/enkf/data/test_gen_kw.py deleted file mode 100644 index 63716dfffc..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/data/test_gen_kw.py +++ /dev/null @@ -1,134 +0,0 @@ -import os.path -from ert.enkf.data import GenKw -from ert.enkf.config import GenKwConfig -from ert.test import TestAreaContext, ExtendedTestCase - - -def create_gen_kw(): - parameter_file ="MULTFLT.txt" - template_file ="MULTFLT.tmpl" - with open(parameter_file, "w") as f: - f.write("MULTFLT1 NORMAL 0 1\n") - f.write("MULTFLT2 RAW \n") - f.write("MULTFLT3 NORMAL 0 1\n") - - with open(template_file, "w") as f: - f.write(" \n") - f.write("/\n") - - - gen_kw_config = GenKwConfig("MULTFLT", template_file , parameter_file) - gen_kw = GenKw( gen_kw_config ) - - return (gen_kw_config , gen_kw) - - - -class GenKwTest(ExtendedTestCase): - - def test_gen_kw_get_set(self): - with TestAreaContext("enkf/data/gen_kwt"): - - (gen_kw_config , gen_kw) = create_gen_kw() - self.assertIsInstance(gen_kw, GenKw) - - gen_kw[0] = 3.0 - self.assertEqual(gen_kw[0], 3.0) - - gen_kw["MULTFLT1"] = 4.0 - self.assertEqual(gen_kw["MULTFLT1"], 4.0) - self.assertEqual(gen_kw[0], 4.0) - - gen_kw["MULTFLT2"] = 8.0 - self.assertEqual(gen_kw["MULTFLT2"], 8.0) - self.assertEqual(gen_kw[1], 8.0) - - gen_kw["MULTFLT3"] = 12.0 - self.assertEqual(gen_kw["MULTFLT3"], 12.0) - self.assertEqual(gen_kw[2], 12.0) - - self.assertEqual(len(gen_kw), 3) - - with self.assertRaises(IndexError): - gen_kw[4] - - with self.assertRaises(TypeError): - gen_kw[1.5] - - with self.assertRaises(KeyError): - gen_kw["MULTFLT_2"] - - self.assertTrue("MULTFLT1" in gen_kw ) - - items = gen_kw.items() - self.assertEqual( len(items) , 3 ) - self.assertEqual( items[0][0] , "MULTFLT1" ) - self.assertEqual( items[1][0] , "MULTFLT2" ) - self.assertEqual( items[2][0] , "MULTFLT3" ) - - self.assertEqual( items[0][1] , 4) - self.assertEqual( items[1][1] , 8) - self.assertEqual( items[2][1] , 12) - - - - def test_gen_kw_get_set_vector(self): - with TestAreaContext("enkf/data/gen_kwt"): - - (gen_kw_config , gen_kw) = create_gen_kw() - with self.assertRaises(ValueError): - gen_kw.setValues([0]) - - with self.assertRaises(TypeError): - gen_kw.setValues(["A","B","C"]) - - gen_kw.setValues([0,1,2]) - self.assertEqual(gen_kw[0], 0) - self.assertEqual(gen_kw[1], 1) - self.assertEqual(gen_kw[2], 2) - - self.assertEqual(gen_kw["MULTFLT1"] , 0) - self.assertEqual(gen_kw["MULTFLT2"] , 1) - self.assertEqual(gen_kw["MULTFLT3"] , 2) - - - - - - def test_gen_kw_ecl_write(self): - with TestAreaContext("enkf/data/gen_kwt"): - (gen_kw_config , gen_kw) = create_gen_kw() - - with self.assertRaises(IOError): - gen_kw.eclWrite( "tmp" , "file.txt") - - gen_kw.eclWrite( None , "file.txt") - self.assertTrue( os.path.isfile( "file.txt" )) - - os.mkdir("tmp") - gen_kw.eclWrite( "tmp" , "file.txt") - self.assertTrue( os.path.isfile( "tmp/file.txt" )) - - gen_kw.eclWrite( "tmp" , "file.txt" , "tmp/export.txt") - self.assertTrue( os.path.isfile( "tmp/export.txt" )) - - - - - - - - - - - - - - - - - - - - - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/data/test_gen_kw_config.py b/ThirdParty/Ert/python/tests/ert/enkf/data/test_gen_kw_config.py deleted file mode 100644 index f32ad7a1e2..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/data/test_gen_kw_config.py +++ /dev/null @@ -1,55 +0,0 @@ -from ert.enkf import ErtImplType, GenKwConfig -from ert.test import ErtTestContext, ExtendedTestCase - -class GenKwConfigTest(ExtendedTestCase): - - def setUp(self): - self.config = self.createTestPath("Statoil/config/with_data/config") - - - def test_gen_kw_config(self): - - with ErtTestContext("python/enkf/data/gen_kw_config", self.config) as context: - - ert = context.getErt() - - gen_kw_keys = ert.ensembleConfig().getKeylistFromImplType(ErtImplType.GEN_KW) - - self.assertEqual(gen_kw_keys[0], "GRID_PARAMS") - - node = ert.ensembleConfig().getNode(gen_kw_keys[0]) - gen_kw_config = node.getModelConfig() - self.assertIsInstance(gen_kw_config, GenKwConfig) - - self.assertEqual(gen_kw_config.getKey(), "GRID_PARAMS") - self.assertEqual(len(gen_kw_config), 2) - - self.assertEqual(gen_kw_config[0], "MULTPV2") - self.assertEqual(gen_kw_config[1], "MULTPV3") - - self.assertFalse(gen_kw_config.shouldUseLogScale(0)) - self.assertFalse(gen_kw_config.shouldUseLogScale(1)) - - - node = ert.ensembleConfig().getNode(gen_kw_keys[1]) - gen_kw_config = node.getModelConfig() - self.assertIsInstance(gen_kw_config, GenKwConfig) - - self.assertEqual(gen_kw_config.getKey(), "MULTFLT") - - self.assertTrue(gen_kw_config.shouldUseLogScale(0)) - - - node = ert.ensembleConfig().getNode(gen_kw_keys[2]) - gen_kw_config = node.getModelConfig() - self.assertIsInstance(gen_kw_config, GenKwConfig) - - self.assertEqual(gen_kw_config.getKey(), "FLUID_PARAMS") - - self.assertFalse(gen_kw_config.shouldUseLogScale(0)) - self.assertFalse(gen_kw_config.shouldUseLogScale(1)) - - expected = ["SWCR", "SGCR"] - - for index, keyword in enumerate(gen_kw_config): - self.assertEqual(keyword, expected[index]) \ No newline at end of file diff --git a/ThirdParty/Ert/python/tests/ert/enkf/export/CMakeLists.txt b/ThirdParty/Ert/python/tests/ert/enkf/export/CMakeLists.txt deleted file mode 100644 index d59e1c5044..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/export/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -set(TEST_SOURCES - __init__.py - test_arg_loader.py - test_custom_kw_collector.py - test_design_matrix.py - test_export_join.py - test_gen_data_collector.py - test_gen_data_observation_collector.py - test_gen_kw_collector.py - test_misfit_collector.py - test_numpy_and_pandas.py - test_summary_collector.py - test_summary_observation_collector.py -) - -add_python_package("python.tests.ert.enkf.export" ${PYTHON_INSTALL_PREFIX}/tests/ert/enkf/export "${TEST_SOURCES}" False) - -addPythonTest(ert.enkf.export.custom_kw_collector tests.ert.enkf.export.test_custom_kw_collector.CustomKwCollectorTest) -addPythonTest(ert.enkf.export.design_matrix tests.ert.enkf.export.test_design_matrix.DesignMatrixTest) -addPythonTest(ert.enkf.export.export_join tests.ert.enkf.export.test_export_join.ExportJoinTest) -addPythonTest(ert.enkf.export.gen_data_collector tests.ert.enkf.export.test_gen_data_collector.GenDataCollectorTest) -addPythonTest(ert.enkf.export.gen_data_observation_collector tests.ert.enkf.export.test_gen_data_observation_collector.GenDataObservationCollectorTest) -addPythonTest(ert.enkf.export.gen_kw_collector tests.ert.enkf.export.test_gen_kw_collector.GenKwCollectorTest) -addPythonTest(ert.enkf.export.numpy_and_pandas tests.ert.enkf.export.test_numpy_and_pandas.NumpyAndPandasTest) -addPythonTest(ert.enkf.export.misfit_collector tests.ert.enkf.export.test_misfit_collector.MisfitCollectorTest) -addPythonTest(ert.enkf.export.summary_collector tests.ert.enkf.export.test_summary_collector.SummaryCollectorTest) -addPythonTest(ert.enkf.export.summary_observation_collector tests.ert.enkf.export.test_summary_observation_collector.SummaryObservationCollectorTest) - -if (STATOIL_TESTDATA_ROOT) - addPythonTest(ert.enkf.export.arg_loader tests.ert.enkf.export.test_arg_loader.ArgLoaderTest LABELS StatoilData) -endif() \ No newline at end of file diff --git a/ThirdParty/Ert/python/tests/ert/enkf/export/__init__.py b/ThirdParty/Ert/python/tests/ert/enkf/export/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/python/tests/ert/enkf/export/test_arg_loader.py b/ThirdParty/Ert/python/tests/ert/enkf/export/test_arg_loader.py deleted file mode 100644 index 58e510271c..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/export/test_arg_loader.py +++ /dev/null @@ -1,24 +0,0 @@ -import math - -from ert.enkf.export import ArgLoader -from ert.test import ErtTestContext, ExtendedTestCase - -class ArgLoaderTest(ExtendedTestCase): - - - def test_arg_loader(self): - - with self.assertRaises(IOError): - arg = ArgLoader.load("arg1X") - - arg_file = self.createTestPath("Statoil/config/with_GEN_DATA_RFT/wellpath/WI_1.txt") - - with self.assertRaises(ValueError): - arg = ArgLoader.load(arg_file , column_names = ["Col1" , "Col2" , "Col3" ,"COl5" , "Col6"]) - - arg = ArgLoader.load(arg_file , column_names = ["utm_x" , "utm_y" , "md" , "tvd"]) - self.assertFloatEqual( arg["utm_x"][0] , 461317.620646) - - - - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/export/test_custom_kw_collector.py b/ThirdParty/Ert/python/tests/ert/enkf/export/test_custom_kw_collector.py deleted file mode 100644 index dba81ea80b..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/export/test_custom_kw_collector.py +++ /dev/null @@ -1,40 +0,0 @@ -from ert.enkf.export import CustomKWCollector -from ert.test import ErtTestContext, ExtendedTestCase - -class CustomKwCollectorTest(ExtendedTestCase): - - def test_custom_kw_collector_non_current_fs(self): - config = self.createTestPath("local/custom_kw/mini_config") - - with ErtTestContext("python/enkf/export/custom_kw_collector_from_fs", config) as context: - ert = context.getErt() - - data = CustomKWCollector.loadAllCustomKWData(ert, "test_run") - - self.assertTrue(len(data.columns) == 0) - - - def test_custom_kw_collector_current_fs(self): - config = self.createTestPath("local/custom_kw/mini_config") - - with ErtTestContext("python/enkf/export/custom_kw_collector_from_current_fs", config) as context: - ert = context.getErt() - fs = ert.getEnkfFsManager().getFileSystem("test_run") - ert.getEnkfFsManager().switchFileSystem(fs) - data = CustomKWCollector.loadAllCustomKWData(ert, "test_run") - - self.assertFloatEqual(data["AGGREGATED:PERLIN_1"][0], -0.167794) - self.assertFloatEqual(data["AGGREGATED:PERLIN_1"][8], -1.276058) - self.assertFloatEqual(data["AGGREGATED:PERLIN_1"][9], -0.137903) - - self.assertFloatEqual(data["AGGREGATED:PERLIN_2"][0], 1.00263) - self.assertFloatEqual(data["AGGREGATED:PERLIN_2"][8], -0.105634) - self.assertFloatEqual(data["AGGREGATED:PERLIN_2"][9], 1.032522) - - self.assertFloatEqual(data["AGGREGATED:PERLIN_3"][0], 0.190479) - self.assertFloatEqual(data["AGGREGATED:PERLIN_3"][8], -0.917785) - self.assertFloatEqual(data["AGGREGATED:PERLIN_3"][9], 0.220371) - - self.assertEqual(data["AGGREGATED:STATE"][0], "Positive") - self.assertEqual(data["AGGREGATED:STATE"][8], "Negative") - self.assertEqual(data["AGGREGATED:STATE"][9], "Positive") diff --git a/ThirdParty/Ert/python/tests/ert/enkf/export/test_design_matrix.py b/ThirdParty/Ert/python/tests/ert/enkf/export/test_design_matrix.py deleted file mode 100644 index 8c513a63fa..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/export/test_design_matrix.py +++ /dev/null @@ -1,94 +0,0 @@ -from ert.enkf.export import DesignMatrixReader -from ert.test import ExtendedTestCase -from ert.test.test_area import TestAreaContext - -def dumpDesignMatrix1(path): - with open(path, "w") as dm: - dm.write("Case CORR_SEIS_HEIMDAL VOL_FRAC_HEIMDAL AZIM_IND_HEIMDAL VARIO_PARAL_HEIMDAL VARIO_NORM_HEIMDAL VARIO_VERT_HEIMDAL SEIS_COND_HEIMDAL\n") - dm.write("0 0.8 0.08 125 1000 500 25 ON\n") - dm.write("1 0.8 0.15 125 2000 1000 25 ON\n") - dm.write("2 0.8 0.20 125 4000 2000 25 ON\n") - - -def dumpDesignMatrix2(path): - with open(path, "w") as dm: - dm.write("Case CORR_SEIS_HEIMDAL VOL_FRAC_HEIMDAL AZIM_IND_HEIMDAL VARIO_PARAL_HEIMDAL VARIO_NORM_HEIMDAL VARIO_VERT_HEIMDAL SEIS_COND_HEIMDAL\n") - dm.write("0 0.8 0.08 125 1000 500 25 ON\n") - dm.write("1 0.8 0.15 125 2000 1000 25 ON\n") - dm.write("2 0.8 0.20 125 4000 2000 25 ON\n") - dm.write("4 0.8 0.30 125 16000 8000 25 ON\n") - - - -class DesignMatrixTest(ExtendedTestCase): - - def test_read_design_matrix(self): - with TestAreaContext("python/enkf/export/design_matrix"): - dumpDesignMatrix1("DesignMatrix.txt") - dm = DesignMatrixReader.loadDesignMatrix("DesignMatrix.txt") - - self.assertEqual(dm["CORR_SEIS_HEIMDAL"][0], 0.8) - self.assertEqual(dm["VOL_FRAC_HEIMDAL"][0], 0.08) - self.assertEqual(dm["AZIM_IND_HEIMDAL"][0], 125) - self.assertEqual(dm["VARIO_PARAL_HEIMDAL"][0], 1000) - self.assertEqual(dm["VARIO_NORM_HEIMDAL"][0], 500) - self.assertEqual(dm["VARIO_VERT_HEIMDAL"][0], 25) - self.assertEqual(dm["SEIS_COND_HEIMDAL"][0], "ON") - - self.assertEqual(dm["CORR_SEIS_HEIMDAL"][1], 0.8) - self.assertEqual(dm["VOL_FRAC_HEIMDAL"][1], 0.15) - self.assertEqual(dm["AZIM_IND_HEIMDAL"][1], 125) - self.assertEqual(dm["VARIO_PARAL_HEIMDAL"][1], 2000) - self.assertEqual(dm["VARIO_NORM_HEIMDAL"][1], 1000) - self.assertEqual(dm["VARIO_VERT_HEIMDAL"][1], 25) - self.assertEqual(dm["SEIS_COND_HEIMDAL"][1], "ON") - - self.assertEqual(dm["CORR_SEIS_HEIMDAL"][2], 0.8) - self.assertEqual(dm["VOL_FRAC_HEIMDAL"][2], 0.20) - self.assertEqual(dm["AZIM_IND_HEIMDAL"][2], 125) - self.assertEqual(dm["VARIO_PARAL_HEIMDAL"][2], 4000) - self.assertEqual(dm["VARIO_NORM_HEIMDAL"][2], 2000) - self.assertEqual(dm["VARIO_VERT_HEIMDAL"][2], 25) - self.assertEqual(dm["SEIS_COND_HEIMDAL"][2], "ON") - - - def test_read_design_matrix_2(self): - with TestAreaContext("python/enkf/export/design_matrix_2"): - dumpDesignMatrix2("DesignMatrix2.txt") - dm = DesignMatrixReader.loadDesignMatrix("DesignMatrix2.txt") - - self.assertEqual(dm["CORR_SEIS_HEIMDAL"][0], 0.8) - self.assertEqual(dm["VOL_FRAC_HEIMDAL"][0], 0.08) - self.assertEqual(dm["AZIM_IND_HEIMDAL"][0], 125) - self.assertEqual(dm["VARIO_PARAL_HEIMDAL"][0], 1000) - self.assertEqual(dm["VARIO_NORM_HEIMDAL"][0], 500) - self.assertEqual(dm["VARIO_VERT_HEIMDAL"][0], 25) - self.assertEqual(dm["SEIS_COND_HEIMDAL"][0], "ON") - - self.assertEqual(dm["CORR_SEIS_HEIMDAL"][1], 0.8) - self.assertEqual(dm["VOL_FRAC_HEIMDAL"][1], 0.15) - self.assertEqual(dm["AZIM_IND_HEIMDAL"][1], 125) - self.assertEqual(dm["VARIO_PARAL_HEIMDAL"][1], 2000) - self.assertEqual(dm["VARIO_NORM_HEIMDAL"][1], 1000) - self.assertEqual(dm["VARIO_VERT_HEIMDAL"][1], 25) - self.assertEqual(dm["SEIS_COND_HEIMDAL"][1], "ON") - - self.assertEqual(dm["CORR_SEIS_HEIMDAL"][2], 0.8) - self.assertEqual(dm["VOL_FRAC_HEIMDAL"][2], 0.20) - self.assertEqual(dm["AZIM_IND_HEIMDAL"][2], 125) - self.assertEqual(dm["VARIO_PARAL_HEIMDAL"][2], 4000) - self.assertEqual(dm["VARIO_NORM_HEIMDAL"][2], 2000) - self.assertEqual(dm["VARIO_VERT_HEIMDAL"][2], 25) - self.assertEqual(dm["SEIS_COND_HEIMDAL"][2], "ON") - - - with self.assertRaises(KeyError): - self.assertEqual(dm["CORR_SEIS_HEIMDAL"][3], 0.8) - - self.assertEqual(dm["CORR_SEIS_HEIMDAL"][4], 0.8) - self.assertEqual(dm["VOL_FRAC_HEIMDAL"][4], 0.30) - self.assertEqual(dm["AZIM_IND_HEIMDAL"][4], 125) - self.assertEqual(dm["VARIO_PARAL_HEIMDAL"][4], 16000) - self.assertEqual(dm["VARIO_NORM_HEIMDAL"][4], 8000) - self.assertEqual(dm["VARIO_VERT_HEIMDAL"][4], 25) - self.assertEqual(dm["SEIS_COND_HEIMDAL"][4], "ON") diff --git a/ThirdParty/Ert/python/tests/ert/enkf/export/test_export_join.py b/ThirdParty/Ert/python/tests/ert/enkf/export/test_export_join.py deleted file mode 100644 index a46d5e9728..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/export/test_export_join.py +++ /dev/null @@ -1,90 +0,0 @@ -from ert.enkf.export import DesignMatrixReader, SummaryCollector, GenKwCollector, MisfitCollector -from ert.test import ExtendedTestCase, ErtTestContext -import pandas -import numpy -import os - -def dumpDesignMatrix(path): - with open(path, "w") as dm: - dm.write("REALIZATION EXTRA_FLOAT_COLUMN EXTRA_INT_COLUMN EXTRA_STRING_COLUMN\n") - dm.write("0 0.08 125 ON\n") - dm.write("1 0.07 225 OFF\n") - dm.write("2 0.08 325 ON\n") - dm.write("3 0.06 425 ON\n") - dm.write("4 0.08 525 OFF\n") - dm.write("5 0.08 625 ON\n") - dm.write("6 0.09 725 ON\n") - dm.write("7 0.08 825 OFF\n") - dm.write("8 0.02 925 ON\n") - dm.write("9 0.08 125 ON\n") - dm.write("10 0.08 225 ON\n") - dm.write("11 0.05 325 OFF\n") - dm.write("12 0.08 425 ON\n") - dm.write("13 0.07 525 ON\n") - dm.write("14 0.08 625 UNKNOWN\n") - dm.write("15 0.08 725 ON\n") - dm.write("16 0.08 825 ON\n") - dm.write("17 0.08 925 OFF\n") - dm.write("18 0.09 125 ON\n") - dm.write("19 0.08 225 ON\n") - dm.write("20 0.06 325 OFF\n") - dm.write("21 0.08 425 ON\n") - dm.write("22 0.07 525 ON\n") - dm.write("23 0.08 625 OFF\n") - dm.write("24 0.08 725 ON\n") - -class ExportJoinTest(ExtendedTestCase): - - def setUp(self): - os.environ["TZ"] = "CET" # The ert_statoil case was generated in CET - self.config = self.createTestPath("local/snake_oil/snake_oil.ert") - - def test_join(self): - - with ErtTestContext("python/enkf/export/export_join", self.config) as context: - dumpDesignMatrix("DesignMatrix.txt") - ert = context.getErt() - - summary_data = SummaryCollector.loadAllSummaryData(ert, "default_1") - gen_kw_data = GenKwCollector.loadAllGenKwData(ert, "default_1") - misfit = MisfitCollector.loadAllMisfitData(ert, "default_1") - dm = DesignMatrixReader.loadDesignMatrix("DesignMatrix.txt") - - result = summary_data.join(gen_kw_data, how='inner') - result = result.join(misfit, how='inner') - result = result.join(dm, how='inner') - - first_date = "2010-01-10" - last_date = "2015-06-23" - - self.assertFloatEqual(result["SNAKE_OIL_PARAM:OP1_OCTAVES"][0][first_date], 3.947766) - self.assertFloatEqual(result["SNAKE_OIL_PARAM:OP1_OCTAVES"][24][first_date], 4.206698) - self.assertFloatEqual(result["SNAKE_OIL_PARAM:OP1_OCTAVES"][24][last_date], 4.206698) - - self.assertFloatEqual(result["EXTRA_FLOAT_COLUMN"][0][first_date], 0.08) - self.assertEqual(result["EXTRA_INT_COLUMN"][0][first_date], 125) - self.assertEqual(result["EXTRA_STRING_COLUMN"][0][first_date], "ON") - - self.assertFloatEqual(result["EXTRA_FLOAT_COLUMN"][0][last_date], 0.08) - self.assertEqual(result["EXTRA_INT_COLUMN"][0][last_date], 125) - self.assertEqual(result["EXTRA_STRING_COLUMN"][0][last_date], "ON") - - self.assertFloatEqual(result["EXTRA_FLOAT_COLUMN"][1][last_date], 0.07) - self.assertEqual(result["EXTRA_INT_COLUMN"][1][last_date], 225) - self.assertEqual(result["EXTRA_STRING_COLUMN"][1][last_date], "OFF") - - self.assertFloatEqual(result["MISFIT:FOPR"][0][last_date], 489.191069) - self.assertFloatEqual(result["MISFIT:FOPR"][24][last_date], 1841.906872) - - self.assertFloatEqual(result["MISFIT:TOTAL"][0][first_date], 500.170035) - self.assertFloatEqual(result["MISFIT:TOTAL"][0][last_date], 500.170035) - self.assertFloatEqual(result["MISFIT:TOTAL"][24][last_date], 1925.793865) - - - with self.assertRaises(KeyError): - realization_13 = result.loc[60] - - column_count = len(result.columns) - self.assertEqual(result.dtypes[0], numpy.float64) - self.assertEqual(result.dtypes[column_count - 1], numpy.object) - self.assertEqual(result.dtypes[column_count - 2], numpy.int64) diff --git a/ThirdParty/Ert/python/tests/ert/enkf/export/test_gen_data_collector.py b/ThirdParty/Ert/python/tests/ert/enkf/export/test_gen_data_collector.py deleted file mode 100644 index 12fe99c7ca..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/export/test_gen_data_collector.py +++ /dev/null @@ -1,21 +0,0 @@ -from ert.enkf.export import GenDataCollector -from ert.test import ErtTestContext, ExtendedTestCase - - -class GenDataCollectorTest(ExtendedTestCase): - def test_gen_data_collector(self): - config = self.createTestPath("local/snake_oil/snake_oil.ert") - with ErtTestContext("python/enkf/export/gen_data_collector", config) as context: - ert = context.getErt() - - with self.assertRaises(KeyError): - data = GenDataCollector.loadGenData(ert, "default_0", "RFT_XX", 199) - - with self.assertRaises(ValueError): - data = GenDataCollector.loadGenData(ert, "default_0", "SNAKE_OIL_OPR_DIFF", 198) - - data1 = GenDataCollector.loadGenData(ert, "default_0", "SNAKE_OIL_OPR_DIFF", 199) - - self.assertFloatEqual(data1[0][0], -0.008206) - self.assertFloatEqual(data1[24][1], -0.119255) - self.assertFloatEqual(data1[24][1000], -0.258516) diff --git a/ThirdParty/Ert/python/tests/ert/enkf/export/test_gen_data_observation_collector.py b/ThirdParty/Ert/python/tests/ert/enkf/export/test_gen_data_observation_collector.py deleted file mode 100644 index 58357f2ab5..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/export/test_gen_data_observation_collector.py +++ /dev/null @@ -1,33 +0,0 @@ -from ert.enkf.export import GenDataObservationCollector -from ert.test import ErtTestContext, ExtendedTestCase - - -class GenDataObservationCollectorTest(ExtendedTestCase): - - def test_gen_data_collector(self): - config = self.createTestPath("local/custom_kw/mini_config") - with ErtTestContext("python/enkf/export/gen_data_observation_collector", config) as context: - ert = context.getErt() - - obs_key = GenDataObservationCollector.getObservationKeyForDataKey(ert, "PERLIN", 1) - self.assertEqual(obs_key, "GEN_PERLIN_1") - - obs_key = GenDataObservationCollector.getObservationKeyForDataKey(ert, "PERLIN", 2) - self.assertEqual(obs_key, "GEN_PERLIN_2") - - obs_key = GenDataObservationCollector.getObservationKeyForDataKey(ert, "PERLIN", 3) - self.assertEqual(obs_key, "GEN_PERLIN_3") - - obs_key = GenDataObservationCollector.getObservationKeyForDataKey(ert, "PERLIN", 4) - self.assertIsNone(obs_key) - - obs_key = GenDataObservationCollector.getObservationKeyForDataKey(ert, "PERLINk", 1) - self.assertIsNone(obs_key) - - data = GenDataObservationCollector.loadGenDataObservations(ert, "default", "GEN_PERLIN_1") - - self.assertFloatEqual(data["GEN_PERLIN_1"][0], -0.616789) - self.assertFloatEqual(data["STD_GEN_PERLIN_1"][0], 0.2) - - with self.assertRaises(KeyError): - GenDataObservationCollector.loadGenDataObservations(ert, "default", "GEN_PERLIN_4") \ No newline at end of file diff --git a/ThirdParty/Ert/python/tests/ert/enkf/export/test_gen_kw_collector.py b/ThirdParty/Ert/python/tests/ert/enkf/export/test_gen_kw_collector.py deleted file mode 100644 index fd57b7664e..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/export/test_gen_kw_collector.py +++ /dev/null @@ -1,32 +0,0 @@ -from ert.enkf.export import GenKwCollector -from ert.test import ErtTestContext, ExtendedTestCase - - -class GenKwCollectorTest(ExtendedTestCase): - def setUp(self): - self.config = self.createTestPath("local/snake_oil/snake_oil.ert") - - def test_gen_kw_collector(self): - with ErtTestContext("python/enkf/export/gen_kw_collector", self.config) as context: - ert = context.getErt() - - data = GenKwCollector.loadAllGenKwData(ert, "default_0") - - self.assertFloatEqual(data["SNAKE_OIL_PARAM:OP1_PERSISTENCE"][0], 0.047517) - self.assertFloatEqual(data["SNAKE_OIL_PARAM:OP1_PERSISTENCE"][24], 0.160907) - - self.assertFloatEqual(data["SNAKE_OIL_PARAM:OP1_OFFSET"][0], 0.054539) - self.assertFloatEqual(data["SNAKE_OIL_PARAM:OP1_OFFSET"][12], 0.057807) - - realization_20 = data.loc[20] - - with self.assertRaises(KeyError): - realization_60 = data.loc[60] - - data = GenKwCollector.loadAllGenKwData(ert, "default_0", ["SNAKE_OIL_PARAM:OP1_PERSISTENCE", "SNAKE_OIL_PARAM:OP1_OFFSET"]) - - self.assertFloatEqual(data["SNAKE_OIL_PARAM:OP1_PERSISTENCE"][0], 0.047517) - self.assertFloatEqual(data["SNAKE_OIL_PARAM:OP1_OFFSET"][0], 0.054539) - - with self.assertRaises(KeyError): - data["SNAKE_OIL_PARAM:OP1_DIVERGENCE_SCALE"] diff --git a/ThirdParty/Ert/python/tests/ert/enkf/export/test_misfit_collector.py b/ThirdParty/Ert/python/tests/ert/enkf/export/test_misfit_collector.py deleted file mode 100644 index 057b571dea..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/export/test_misfit_collector.py +++ /dev/null @@ -1,23 +0,0 @@ -from ert.enkf.export import MisfitCollector -from ert.test import ErtTestContext, ExtendedTestCase - - -class MisfitCollectorTest(ExtendedTestCase): - def setUp(self): - self.config = self.createTestPath("local/snake_oil/snake_oil.ert") - - def test_misfit_collector(self): - with ErtTestContext("python/enkf/export/misfit_collector", self.config) as context: - ert = context.getErt() - data = MisfitCollector.loadAllMisfitData(ert, "default_0") - - self.assertFloatEqual(data["MISFIT:FOPR"][0], 798.378619) - self.assertFloatEqual(data["MISFIT:FOPR"][24], 1332.219633) - - self.assertFloatEqual(data["MISFIT:TOTAL"][0], 826.651491) - self.assertFloatEqual(data["MISFIT:TOTAL"][24], 1431.305646) - - realization_20 = data.loc[20] - - with self.assertRaises(KeyError): - realization_60 = data.loc[60] diff --git a/ThirdParty/Ert/python/tests/ert/enkf/export/test_numpy_and_pandas.py b/ThirdParty/Ert/python/tests/ert/enkf/export/test_numpy_and_pandas.py deleted file mode 100644 index e3763467ff..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/export/test_numpy_and_pandas.py +++ /dev/null @@ -1,82 +0,0 @@ -import numpy -from pandas import MultiIndex, DataFrame -import pandas as pandas -from ert.test import ExtendedTestCase - - -class NumpyAndPandasTest(ExtendedTestCase): - - def test_numpy(self): - data = numpy.empty(shape=(10, 10), dtype=numpy.float64) - data.fill(numpy.nan) - - self.assertTrue(numpy.isnan(data[0][0])) - self.assertTrue(numpy.isnan(data[9][9])) - - with self.assertRaises(IndexError): - v = data[10][9] - - data[5][5] = 1.0 - - self.assertEqual(data[5][5], 1.0) - - data[0] = 5.0 - - test_data = numpy.empty(shape=10) - test_data.fill(5.0) - - self.assertTrue(numpy.array_equal(data[0], test_data)) - - data = numpy.transpose(data) - - self.assertTrue(numpy.array_equal(data[:,0], test_data)) - - row = data[0] - row[5] = 11 - self.assertEqual(data[0][5], 11) - - - def test_pandas_join(self): - - multi_index = MultiIndex.from_product([[1, 2], ["A", "B", "C"]], names=["REALIZATION", "LABEL"]) - - data = DataFrame(data=[[1, 2, 3], [2, 4, 6], [4, 8, 12]] * 2, index=multi_index, columns=["C1", "C2", "C3"]) - - new_column = DataFrame(data=[4.0, 4.4, 4.8], index=[1, 2, 3], columns=["C4"]) - new_column.index.name = "REALIZATION" - - result = data.join(new_column, how='inner') - - self.assertFloatEqual(result["C4"][1]["A"], 4.0) - self.assertFloatEqual(result["C4"][1]["B"], 4.0) - self.assertFloatEqual(result["C4"][1]["C"], 4.0) - - self.assertFloatEqual(result["C4"][2]["A"], 4.4) - self.assertFloatEqual(result["C4"][2]["B"], 4.4) - self.assertFloatEqual(result["C4"][2]["C"], 4.4) - - - - def test_pandas_concatenate(self): - - d1 = DataFrame(data=[2, 4, 6, 8], columns=["A"], index=[1, 2, 3, 4]) - d2 = DataFrame(data=[[1, 1.1], [3, 3.3], [5, 5.5], [7, 7.7], [9, 9.9]], columns=["A", "B"], index=[1, 2, 3, 4, 5]) - - result = pandas.concat([d1, d2], keys=[1, 2]) - - self.assertEqual(result["A"][1][2], 4) - self.assertEqual(result["A"][2][2], 3) - self.assertTrue(numpy.isnan(result["B"][1][1])) - self.assertFloatEqual(result["B"][2][4], 7.7) - - - def test_pandas_extend_index(self): - d1 = DataFrame(data=[2, 4, 6, 8], columns=["A"], index=[1, 2, 3, 4]) - d1.index.name = "first" - - d1["second"] = "default" - d1.set_index(["second"], append=True, inplace=True) - self.assertEqual(d1.index.names, ["first", "second"]) - - d1 = d1.reorder_levels(["second", "first"]) - self.assertEqual(d1.index.names, ["second", "first"]) diff --git a/ThirdParty/Ert/python/tests/ert/enkf/export/test_summary_collector.py b/ThirdParty/Ert/python/tests/ert/enkf/export/test_summary_collector.py deleted file mode 100644 index fea0d22776..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/export/test_summary_collector.py +++ /dev/null @@ -1,34 +0,0 @@ -from ert.enkf.export import SummaryCollector -from ert.test import ErtTestContext, ExtendedTestCase -import os - - -class SummaryCollectorTest(ExtendedTestCase): - def setUp(self): - os.environ["TZ"] = "CET" # The ert_statoil case was generated in CET - self.config = self.createTestPath("local/snake_oil/snake_oil.ert") - - def test_summary_collector(self): - with ErtTestContext("python/enkf/export/summary_collector", self.config) as context: - ert = context.getErt() - - data = SummaryCollector.loadAllSummaryData(ert, "default_0") - - self.assertFloatEqual(data["WWCT:OP2"][0]["2010-01-10"], 0.385549) - self.assertFloatEqual(data["WWCT:OP2"][24]["2010-01-10"], 0.498331) - - self.assertFloatEqual(data["FOPR"][0]["2010-01-10"], 0.118963) - self.assertFloatEqual(data["FOPR"][0]["2015-06-23"], 0.133601) - - realization_20 = data.loc[20] - - with self.assertRaises(KeyError): - realization_60 = data.loc[60] - - data = SummaryCollector.loadAllSummaryData(ert, "default_0", ["WWCT:OP1", "WWCT:OP2"]) - - self.assertFloatEqual(data["WWCT:OP1"][0]["2010-01-10"], 0.352953) - self.assertFloatEqual(data["WWCT:OP2"][0]["2010-01-10"], 0.385549) - - with self.assertRaises(KeyError): - data["FOPR"] diff --git a/ThirdParty/Ert/python/tests/ert/enkf/export/test_summary_observation_collector.py b/ThirdParty/Ert/python/tests/ert/enkf/export/test_summary_observation_collector.py deleted file mode 100644 index 92a3baf55f..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/export/test_summary_observation_collector.py +++ /dev/null @@ -1,45 +0,0 @@ -from ert.enkf.export import SummaryObservationCollector -from ert.test import ErtTestContext, ExtendedTestCase -import os - -class SummaryObservationCollectorTest(ExtendedTestCase): - - def setUp(self): - os.environ["TZ"] = "CET" # The ert_statoil case was generated in CET - self.config = self.createTestPath("local/snake_oil/snake_oil.ert") - - - def test_summary_observation_collector(self): - - with ErtTestContext("python/enkf/export/summary_observation_collector", self.config) as context: - - ert = context.getErt() - - self.assertTrue(SummaryObservationCollector.summaryKeyHasObservations(ert, "FOPR")) - self.assertFalse(SummaryObservationCollector.summaryKeyHasObservations(ert, "FOPT")) - - keys = SummaryObservationCollector.getAllObservationKeys(ert) - self.assertTrue("FOPR" in keys) - self.assertTrue("WOPR:OP1" in keys) - self.assertFalse("WOPR:OP2" in keys) - - data = SummaryObservationCollector.loadObservationData(ert, "default_0") - - self.assertFloatEqual(data["FOPR"]["2010-01-10"], 0.001696887) - self.assertFloatEqual(data["STD_FOPR"]["2010-01-10"], 0.1) - - self.assertFloatEqual(data["WOPR:OP1"]["2010-03-31"], 0.1) - self.assertFloatEqual(data["STD_WOPR:OP1"]["2010-03-31"], 0.05) - - - with self.assertRaises(KeyError): - fgir = data["FGIR"] - - - data = SummaryObservationCollector.loadObservationData(ert, "default_0", ["WOPR:OP1"]) - - self.assertFloatEqual(data["WOPR:OP1"]["2010-03-31"], 0.1) - self.assertFloatEqual(data["STD_WOPR:OP1"]["2010-03-31"], 0.05) - - with self.assertRaises(KeyError): - data["FOPR"] diff --git a/ThirdParty/Ert/python/tests/ert/enkf/plot/CMakeLists.txt b/ThirdParty/Ert/python/tests/ert/enkf/plot/CMakeLists.txt deleted file mode 100644 index 47f6f3dab5..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/plot/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -set(TEST_SOURCES - __init__.py - test_plot_data.py - test_plot_settings.py -) - -add_python_package("python.tests.ert.enkf.plot" ${PYTHON_INSTALL_PREFIX}/tests/ert/enkf/plot "${TEST_SOURCES}" False) - -addPythonTest(ert.enkf.plot.plot_settings tests.ert.enkf.plot.test_plot_settings.PlotSettingsTest) -if (STATOIL_TESTDATA_ROOT) - addPythonTest(ert.enkf.plot.plot_block_data tests.ert.enkf.plot.test_plot_data.PlotDataTest LABELS StatoilData) -endif() diff --git a/ThirdParty/Ert/python/tests/ert/enkf/plot/__init__.py b/ThirdParty/Ert/python/tests/ert/enkf/plot/__init__.py deleted file mode 100644 index 284bf2e772..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/plot/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__author__ = 'jpb' diff --git a/ThirdParty/Ert/python/tests/ert/enkf/plot/test_plot_data.py b/ThirdParty/Ert/python/tests/ert/enkf/plot/test_plot_data.py deleted file mode 100644 index 41c27231a3..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/plot/test_plot_data.py +++ /dev/null @@ -1,101 +0,0 @@ -from ert.enkf.plot_data import PlotBlockData, PlotBlockDataLoader, PlotBlockVector -from ert.util import DoubleVector -from ert.test import ExtendedTestCase, ErtTestContext - - -class PlotDataTest(ExtendedTestCase): - - def setUp(self): - self.config_file = self.createTestPath("Statoil/config/with_RFT/config") - - def test_plot_block_vector(self): - vector = DoubleVector() - vector.append(1.5) - vector.append(2.5) - vector.append(3.5) - plot_block_vector = PlotBlockVector(1, vector) - - self.assertEqual(plot_block_vector.getRealizationNumber(), 1) - self.assertEqual(plot_block_vector[0], 1.5) - self.assertEqual(plot_block_vector[2], 3.5) - - self.assertEqual(len(plot_block_vector), len(vector)) - - - def test_plot_block_data(self): - depth = DoubleVector() - depth.append(2.5) - depth.append(3.5) - - data = PlotBlockData(depth) - - self.assertEqual(data.getDepth(), depth) - - vector = PlotBlockVector(1, DoubleVector()) - data.addPlotBlockVector(vector) - data.addPlotBlockVector(PlotBlockVector(2, DoubleVector())) - - self.assertEqual(len(data), 2) - - self.assertEqual(vector, data[1]) - - - def compareLists(self, source, target): - self.assertEqual(len(source), len(target)) - for index, value in enumerate(source): - self.assertEqual(value, target[index]) - - - def checkBlockData(self, ert, obs_key, report_step): - """ - @type ert: EnKFMain - @type obs_key: str - @type report_step: int - """ - enkf_obs = ert.getObservations() - obs_vector = enkf_obs[obs_key] - loader = PlotBlockDataLoader(obs_vector) - - fs = ert.getEnkfFsManager().getCurrentFileSystem() - plot_block_data = loader.load(fs, report_step) - - self.assertEqual(ert.getEnsembleSize(), len(plot_block_data)) - - depth = plot_block_data.getDepth() - - depth_test_values = [1752.24998474, 1757.88926697, 1760.70924377] - if report_step == 56: - depth_test_values.append(1763.52885437) - - self.assertAlmostEqualList(depth_test_values, depth) - - block_obs = len(obs_vector.getNode(report_step)) - self.assertEqual(block_obs, len(plot_block_data[0])) - self.assertEqual(block_obs, len(plot_block_data[9])) - - - if report_step == 50: - rft_values = [244.681655884, 245.217041016, 245.48500061] - else: - rft_values = [239.7550354, 240.290313721, 240.558197021, 240.825881958] - - self.assertAlmostEqualList(rft_values, plot_block_data[0]) - - - if report_step == 50: - rft_values = [238.702560425, 239.237838745, 239.505737305] - else: - rft_values = [234.41583252, 234.95098877, 235.218841553, 235.486480713] - - self.assertAlmostEqualList(rft_values, plot_block_data[9]) - - - - - def test_plot_block_data_fs(self): - with ErtTestContext("plot_block_data_test", self.config_file) as test_context: - ert = test_context.getErt() - - self.checkBlockData(ert, "RFT2", 50) - self.checkBlockData(ert, "RFT5", 56) - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/plot/test_plot_settings.py b/ThirdParty/Ert/python/tests/ert/enkf/plot/test_plot_settings.py deleted file mode 100644 index e426123989..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/plot/test_plot_settings.py +++ /dev/null @@ -1,56 +0,0 @@ -from ert.test import ExtendedTestCase, ErtTestContext,TestAreaContext -from ert.config import * -from ert.enkf import PlotSettings -from ert.enkf import EnkfPrototype - -#_plot_settings_init = EnkfPrototype("void plot_settings_init( plot_settings, config_content)", bind = False) -_plot_settings_config = EnkfPrototype("void plot_settings_add_config_items( config_parser)", bind = False) - - - - -class PlotSettingsTest(ExtendedTestCase): - - - def test_create(self): - ps = PlotSettings( ) - - - def test_keys(self): - ps = PlotSettings( ) - keys = ps.keys( ) - self.assertFalse( "XXX" in keys ) - self.assertTrue( "PATH" in keys ) - self.assertTrue( "SHOW_REFCASE" in keys ) - - - def test_set_get(self): - ps = PlotSettings( ) - with self.assertRaises(KeyError): - ps["UNKNOWN_KEY"] = 1000 - - with self.assertRaises(TypeError): - ps["SHOW_REFCASE"] = "Don-know" - - ps["SHOW_REFCASE"] = False - self.assertEqual( ps["SHOW_REFCASE"] , False ) - - ps["SHOW_REFCASE"] = True - self.assertEqual( ps["SHOW_REFCASE"] , True ) - - - - def test_config(self): - parser = ConfigParser( ) - ps = PlotSettings( ) - - with TestAreaContext("plot_config"): - with open("config_file" , "w") as f: - f.write("PLOT_SETTING PATH abc\n"); - f.write("PLOT_SETTING SHOW_REFCASE False\n") - f.write("PLOT_SETTING UnknownKey Value\n") - - #_plot_settings_config( parser ) - content = parser.parse( "config_file" ) - ps.apply( content ) - #_plot_settings_init( ps , content ) diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_active_list.py b/ThirdParty/Ert/python/tests/ert/enkf/test_active_list.py deleted file mode 100644 index 38d4fa8f0b..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_active_list.py +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright (C) 2015 Statoil ASA, Norway. -# -# The file 'test_active_list.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -from ert.enkf import ActiveList -from ert.enkf import ActiveMode -from ert.test import ExtendedTestCase - - - -class ActiveListTest(ExtendedTestCase): - - def test_active_mode_enum(self): - self.assertEqual(ActiveMode.ALL_ACTIVE, 1) - self.assertEqual(ActiveMode.INACTIVE, 2) - self.assertEqual(ActiveMode.PARTLY_ACTIVE, 3) - self.assertEqual(ActiveMode(1).name, 'ALL_ACTIVE') - self.assertEqual(ActiveMode(2).name, 'INACTIVE') - self.assertEqual(ActiveMode(3).name, 'PARTLY_ACTIVE') - - def test_active_size(self): - al = ActiveList() - self.assertEqual(None, al.getActiveSize(None)) - self.assertEqual(7, al.getActiveSize(7)) - self.assertEqual(-1, al.getActiveSize(-1)) - - al.addActiveIndex( 10 ) - self.assertEqual(1, al.getActiveSize(7)) - al.addActiveIndex( 10 ) - self.assertEqual(1, al.getActiveSize(7)) - al.addActiveIndex( 100 ) - self.assertEqual(2, al.getActiveSize(7)) - - def test_create(self): - active_list = ActiveList() - self.assertEqual( active_list.getMode() , ActiveMode.ALL_ACTIVE ) - active_list.addActiveIndex( 10 ) - self.assertEqual( active_list.getMode() , ActiveMode.PARTLY_ACTIVE ) - - def test_repr(self): - al = ActiveList() - rep = repr(al) - self.assertFalse('PARTLY_ACTIVE' in rep) - self.assertFalse('INACTIVE' in rep) - self.assertTrue('ALL_ACTIVE' in rep) - pfx = 'ActiveList(' - self.assertEqual(pfx, rep[:len(pfx)]) - for i in range(150): - al.addActiveIndex( 3*i ) - rep = repr(al) - self.assertTrue('150' in rep) - self.assertTrue('PARTLY_ACTIVE' in rep) - self.assertFalse('INACTIVE' in rep) - self.assertFalse('ALL_ACTIVE' in rep) diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_analysis_config.py b/ThirdParty/Ert/python/tests/ert/enkf/test_analysis_config.py deleted file mode 100644 index 630d7a0db2..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_analysis_config.py +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2013 Statoil ASA, Norway. -# -# The file 'test_analysis_config.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -import os -from ert.enkf import AnalysisConfig -from ert.test import ExtendedTestCase - - -class AnalysisConfigTest(ExtendedTestCase): - - def test_keywords_for_monitoring_simulation_runtime(self): - ac = AnalysisConfig() - - # Unless the MIN_REALIZATIONS is set in config, one is required to have "all" realizations. - self.assertFalse(ac.haveEnoughRealisations(5, 10)) - self.assertTrue(ac.haveEnoughRealisations(10, 10)) - - ac.set_max_runtime( 50 ) - self.assertEqual( 50 , ac.get_max_runtime() ) - - ac.set_stop_long_running( True ) - self.assertTrue( ac.get_stop_long_running() ) - - - def test_analysis_modules(self): - ac = AnalysisConfig() - self.assertIsNone( ac.activeModuleName() ) - self.assertIsNotNone( ac.getModuleList() ) - - def test_analysis_config_global_std_scaling(self): - ac = AnalysisConfig() - self.assertFloatEqual(ac.getGlobalStdScaling(), 1.0) - ac.setGlobalStdScaling(0.77) - self.assertFloatEqual(ac.getGlobalStdScaling(), 0.77) diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_analysis_iter_config.py b/ThirdParty/Ert/python/tests/ert/enkf/test_analysis_iter_config.py deleted file mode 100644 index dfe7f9d13e..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_analysis_iter_config.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2014 Statoil ASA, Norway. -# -# The file 'test_analysis_iter_config.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -import os -from ert.enkf import AnalysisIterConfig -from ert.test import ExtendedTestCase - - -class AnalysisIterConfigTest(ExtendedTestCase): - - def test_set(self): - c = AnalysisIterConfig() - - self.assertFalse( c.caseFormatSet() ) - c.setCaseFormat("case%d") - self.assertTrue( c.caseFormatSet() ) - - self.assertFalse( c.numIterationsSet() ) - c.setNumIterations(1) - self.assertTrue( c.numIterationsSet() ) - - - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_block_obs.py b/ThirdParty/Ert/python/tests/ert/enkf/test_block_obs.py deleted file mode 100644 index 9363c204fe..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_block_obs.py +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright (C) 2015 Statoil ASA, Norway. -# -# The file 'test_block_obs.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -import os - -from ert.enkf import BlockObservation -from ert.enkf import ActiveList, FieldConfig -from ert.test import ExtendedTestCase -from ert.ecl import EclGrid - - -class BlockObsTest(ExtendedTestCase): - - def test_create(self): - grid = EclGrid.createRectangular( (10,20,5) , (1,1,1) ) - field_config = FieldConfig("PRESSURE" , grid) - block_obs = BlockObservation("P-CONFIG" , field_config , grid) - - self.assertEqual( len(block_obs) , 0 ) - - block_obs.addPoint(1,2,3,100,25) - self.assertEqual( len(block_obs) , 1 ) - self.assertEqual( block_obs.getValue(0) , 100 ) - self.assertEqual( block_obs.getStd(0) , 25 ) - self.assertEqual( block_obs.getStdScaling(0) , 1 ) - - block_obs.addPoint(1,2,4,200,50) - self.assertEqual( len(block_obs) , 2 ) - self.assertEqual( block_obs.getValue(1) , 200 ) - self.assertEqual( block_obs.getStd(1) , 50 ) - self.assertEqual( block_obs.getStdScaling(1) , 1 ) - - active_list = ActiveList( ) - block_obs.updateStdScaling( 0.50 , active_list ) - self.assertEqual( block_obs.getStdScaling(0) , 0.50 ) - self.assertEqual( block_obs.getStdScaling(1) , 0.50 ) - - active_list.addActiveIndex( 1 ) - block_obs.updateStdScaling( 2.00 , active_list ) - self.assertEqual( block_obs.getStdScaling(0) , 0.50 ) - self.assertEqual( block_obs.getStdScaling(1) , 2.00 ) - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_custom_kw_config_set.py b/ThirdParty/Ert/python/tests/ert/enkf/test_custom_kw_config_set.py deleted file mode 100644 index 7bbc4b27fa..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_custom_kw_config_set.py +++ /dev/null @@ -1,80 +0,0 @@ -import os -from ert.enkf import CustomKWConfigSet -from ert.enkf.config import CustomKWConfig -from ert.enkf.enkf_fs import EnkfFs -from ert.enkf.enkf_main import EnKFMain -from ert.test import ExtendedTestCase -from ert.test.ert_test_context import ErtTestContext -from ert.test.test_area import TestAreaContext -from ert.util.stringlist import StringList - - -class CustomKWConfigSetTest(ExtendedTestCase): - - def createCustomKWConfig(self, name, data): - with TestAreaContext("python/enkf/custom_kw_config_set_config") as test_area: - self.createResultFile("result_file", data) - - config = CustomKWConfig(name, "") - config.parseResultFile("result_file", StringList()) - - return config - - def createResultFile(self, filename, data): - with open(filename, "w") as output_file: - for key in data: - output_file.write("%s %s\n" % (key, data[key])) - - - def test_creation(self): - config_set = CustomKWConfigSet() - - config = self.createCustomKWConfig("TEST", {"VALUE_1": 0.5, "VALUE_2": 5, "VALUE_3": "string", "VALUE_4": "true"}) - self.assertItemsEqual(config.getKeys(), ["VALUE_1", "VALUE_2", "VALUE_3", "VALUE_4"]) - - config_set.addConfig(config) - keys = config_set.getStoredConfigKeys() - self.assertItemsEqual(keys, ["TEST"]) - - config_set.reset() - self.assertTrue(len(config_set.getStoredConfigKeys()) == 0) - - - def test_fwrite_and_fread(self): - with TestAreaContext("python/enkf/custom_kw_config_set_fwrite") as test_area: - trees_config = self.createCustomKWConfig("TREES", {"OAK": 0.1, "SPRUCE": 5, "FIR": "pines", "PALM": "coconut"}) - insects_config = self.createCustomKWConfig("INSECTS", {"MOSQUITO": "annoying", "FLY": 3.14, "BEETLE": 0.5}) - - config_set = CustomKWConfigSet() - config_set.addConfig(trees_config) - config_set.addConfig(insects_config) - - self.assertItemsEqual(config_set.getStoredConfigKeys(), ["TREES", "INSECTS"]) - - config_set.fwrite("config_set") - - self.assertTrue(os.path.exists("config_set")) - - config_set = CustomKWConfigSet("config_set") - - self.assertItemsEqual(config_set.getStoredConfigKeys(), ["TREES", "INSECTS"]) - - trees_config_from_file = CustomKWConfig("TREES", None) - config_set.updateConfig(trees_config_from_file) - - for key in ["OAK", "SPRUCE", "FIR", "PALM"]: - self.assertEqual(trees_config_from_file.indexOfKey(key), trees_config.indexOfKey(key)) - self.assertTrue(trees_config_from_file.keyIsDouble(key) == trees_config.keyIsDouble(key)) - - - insects_config_from_file = CustomKWConfig("INSECTS", None) - config_set.updateConfig(insects_config_from_file) - - for key in ["MOSQUITO", "FLY", "BEETLE"]: - self.assertEqual(insects_config_from_file.indexOfKey(key), insects_config.indexOfKey(key)) - self.assertTrue(insects_config_from_file.keyIsDouble(key) == insects_config.keyIsDouble(key)) - - - - - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_deprecation.py b/ThirdParty/Ert/python/tests/ert/enkf/test_deprecation.py deleted file mode 100644 index 3a09b9f5e5..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_deprecation.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2011 Statoil ASA, Norway. -# -# The file 'test_deprecation.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -import warnings - -from ert.test import ErtTestContext, ExtendedTestCase - - -class DeprecationTest(ExtendedTestCase): - def setUp(self): - self.config_file = self.createTestPath("local/simple_config/minimum_config") - self.obs_file = self.createTestPath("local/simple_config/minimum_config") - - - # Added in 1.10 development - def test(self): - with ErtTestContext("enkf_deprecation", self.config_file) as test_context: - ert = test_context.getErt() - - ecl_config = ert.eclConfig() - with warnings.catch_warnings(): - ecl_config.get_grid( ) - - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_ecl_config.py b/ThirdParty/Ert/python/tests/ert/enkf/test_ecl_config.py deleted file mode 100644 index 563d69e9cd..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_ecl_config.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2013 Statoil ASA, Norway. -# -# This file is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -import os.path -from ert.enkf import EclConfig -from ert.test import ExtendedTestCase -from ert.util import UIReturn -from ert.ecl import EclSum - -EGRID_file = "Statoil/ECLIPSE/Gurbat/ECLIPSE.EGRID" -SMSPEC_file = "Statoil/ECLIPSE/Gurbat/ECLIPSE.SMSPEC" -DATA_file = "Statoil/ECLIPSE/Gurbat/ECLIPSE.DATA" -INIT_file = "Statoil/ECLIPSE/Gurbat/EQUIL.INC" -DATA_INIT_file= "Statoil/ECLIPSE/Gurbat/ECLIPSE_INIT.DATA" -SCHEDULE_file = "Statoil/ECLIPSE/Gurbat/target.SCH" - - -class EclConfigTest(ExtendedTestCase): - - - def test_grid(self): - grid_file = self.createTestPath( EGRID_file ) - smspec_file = self.createTestPath( SMSPEC_file ) - ec = EclConfig() - ui = ec.validateGridFile( grid_file ) - self.assertTrue( ui ) - self.assertTrue( isinstance(ui , UIReturn )) - - ui = ec.validateGridFile( "Does/Not/Exist" ) - self.assertFalse( ui ) - - self.assertTrue( os.path.exists( smspec_file )) - ui = ec.validateGridFile( smspec_file ) - self.assertFalse( ui ) - - - - def test_eclbase(self): - ec = EclConfig() - ui = ec.validateEclBase( "MixedCase%d" ) - self.assertFalse( ui ) - - ui = ec.validateEclBase( "CASE%s" ) - self.assertFalse( ui ) - - ui = ec.validateEclBase( "CASE%d" ) - self.assertTrue( ui ) - ec.setEclBase("CASE%d") - self.assertEqual( "CASE%d" , ec.getEclBase()) - - - - def test_datafile(self): - ec = EclConfig() - ui = ec.validateDataFile( "DoesNotExist" ) - self.assertFalse( ui ) - - dfile = self.createTestPath( DATA_file ) - ui = ec.validateDataFile( dfile ) - self.assertTrue( ui ) - ec.setDataFile( dfile ) - self.assertEqual( dfile , ec.getDataFile() ) - - - def test_schedule_file(self): - ec = EclConfig() - ui = ec.validateScheduleFile( "DoesNotExist" ) - self.assertFalse( ui ) - - dfile = self.createTestPath( DATA_file ) - sfile = self.createTestPath( SCHEDULE_file ) - - # Setting the schedule file should fail before the datafile - # (i.e. startdate) has been set. - ui = ec.validateScheduleFile( sfile ) - self.assertFalse( ui ) - - ec.setDataFile( dfile ) - ui = ec.validateScheduleFile( sfile ) - self.assertTrue( ui ) - - ec.setScheduleFile( sfile ) - self.assertEqual( sfile , ec.getScheduleFile() ) - - - def test_init_section(self): - ec = EclConfig() - dfile = self.createTestPath( DATA_file ) - difile = self.createTestPath( DATA_INIT_file ) - ifile = self.createTestPath( INIT_file ) - - ui = ec.validateInitSection( ifile ) - self.assertFalse( ui ) - - ec.setDataFile( dfile ) - ui = ec.validateInitSection( ifile ) - self.assertFalse( ui ) - - ec.setDataFile( difile ) - ui = ec.validateInitSection( ifile ) - self.assertTrue( ui ) - ec.setInitSection( ifile ) - self.assertTrue( ifile , ec.getInitSection() ) - - - def test_refcase( self ): - ec = EclConfig() - dfile = self.createTestPath( DATA_file ) - - ui = ec.validateRefcase( "Does/not/exist" ) - self.assertFalse( ui ) - - ui = ec.validateRefcase( dfile ) - self.assertTrue( ui ) - ec.loadRefcase( dfile ) - refcase = ec.getRefcase() - self.assertTrue( isinstance( refcase , EclSum )) - refcaseName = ec.getRefcaseName() + ".DATA" - self.assertEqual( dfile , refcaseName ) - - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_enkf.py b/ThirdParty/Ert/python/tests/ert/enkf/test_enkf.py deleted file mode 100644 index 887e379a50..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_enkf.py +++ /dev/null @@ -1,189 +0,0 @@ -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'test_enkf.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -import os - -from ert.util import BoolVector - -from ert.enkf import EnsembleConfig, AnalysisConfig, ModelConfig, SiteConfig, EclConfig, PlotSettings, EnkfObs, ErtTemplates, EnkfFs, EnKFState, EnkfVarType, ObsVector , RunArg -from ert.enkf.config import EnkfConfigNode -from ert.enkf.enkf_main import EnKFMain -from ert.enkf.enums import EnkfObservationImplementationType, LoadFailTypeEnum, EnkfInitModeEnum, ErtImplType, RealizationStateEnum , EnkfRunType, EnkfFieldFileFormatEnum, EnkfTruncationType, ActiveMode -from ert.enkf.observations.summary_observation import SummaryObservation -from ert.test import ExtendedTestCase , TestAreaContext - - - -class EnKFTest(ExtendedTestCase): - def setUp(self): - self.case_directory = self.createTestPath("local/simple_config/") - - - def test_repr( self ): - with TestAreaContext("enkf_test", store_area=True) as work_area: - work_area.copy_directory(self.case_directory) - main = EnKFMain("simple_config/minimum_config") - pfx = 'EnKFMain(ensemble_size' - self.assertEqual(pfx, repr(main)[:len(pfx)]) - main.free() - - def test_bootstrap( self ): - with TestAreaContext("enkf_test", store_area=True) as work_area: - work_area.copy_directory(self.case_directory) - main = EnKFMain("simple_config/minimum_config") - self.assertTrue(main, "Load failed") - main.free() - - - def test_site_bootstrap( self ): - with TestAreaContext("enkf_test", store_area=True) as work_area: - EnKFMain.loadSiteConfig() - - - def test_enum(self): - self.assertEnumIsFullyDefined(EnkfVarType, "enkf_var_type", "libenkf/include/ert/enkf/enkf_types.h") - self.assertEnumIsFullyDefined(ErtImplType, "ert_impl_type", "libenkf/include/ert/enkf/enkf_types.h") - self.assertEnumIsFullyDefined(EnkfInitModeEnum, "init_mode_type", "libenkf/include/ert/enkf/enkf_types.h") - self.assertEnumIsFullyDefined(RealizationStateEnum, "realisation_state_enum", "libenkf/include/ert/enkf/enkf_types.h") - self.assertEnumIsFullyDefined(EnkfTruncationType, "truncation_type", "libenkf/include/ert/enkf/enkf_types.h") - self.assertEnumIsFullyDefined(EnkfRunType, "run_mode_type" , "libenkf/include/ert/enkf/enkf_types.h") - - self.assertEnumIsFullyDefined(EnkfObservationImplementationType, "obs_impl_type", "libenkf/include/ert/enkf/obs_vector.h") - self.assertEnumIsFullyDefined(LoadFailTypeEnum, "load_fail_type", "libenkf/include/ert/enkf/summary_config.h") - self.assertEnumIsFullyDefined(EnkfFieldFileFormatEnum, "field_file_format_type", "libenkf/include/ert/enkf/field_config.h" ) - self.assertEnumIsFullyDefined(ActiveMode , "active_mode_type" , "libenkf/include/ert/enkf/enkf_types.h") - - - def test_observations(self): - with TestAreaContext("enkf_test") as work_area: - work_area.copy_directory(self.case_directory) - - main = EnKFMain("simple_config/minimum_config") - - count = 10 - summary_key = "test_key" - observation_key = "test_obs_key" - summary_observation_node = EnkfConfigNode.createSummaryConfigNode(summary_key, LoadFailTypeEnum.LOAD_FAIL_EXIT) - observation_vector = ObsVector(EnkfObservationImplementationType.SUMMARY_OBS, observation_key, summary_observation_node, count) - - main.getObservations().addObservationVector(observation_vector) - - values = [] - for index in range(0, count): - value = index * 10.5 - std = index / 10.0 - summary_observation_node = SummaryObservation(summary_key, observation_key, value, std) - observation_vector.installNode(index, summary_observation_node) - self.assertEqual(observation_vector.getNode(index), summary_observation_node) - self.assertEqual(value, summary_observation_node.getValue()) - values.append((index, value, std)) - - - - observations = main.getObservations() - test_vector = observations[observation_key] - index = 0 - for node in test_vector: - self.assertTrue( isinstance( node , SummaryObservation )) - self.assertEqual( node.getValue( ) , index * 10.5 ) - index += 1 - - - self.assertEqual(observation_vector, test_vector) - for index, value, std in values: - self.assertTrue(test_vector.isActive(index)) - - summary_observation_node = test_vector.getNode(index) - """@type: SummaryObservation""" - - self.assertEqual(value, summary_observation_node.getValue()) - self.assertEqual(std, summary_observation_node.getStandardDeviation()) - self.assertEqual(summary_key, summary_observation_node.getSummaryKey()) - - - main.free() - - - - def test_config( self ): - with TestAreaContext("enkf_test") as work_area: - work_area.copy_directory(self.case_directory) - - main = EnKFMain("simple_config/minimum_config") - - self.assertIsInstance(main.ensembleConfig(), EnsembleConfig) - self.assertIsInstance(main.analysisConfig(), AnalysisConfig) - self.assertIsInstance(main.getModelConfig(), ModelConfig) - #self.assertIsInstance(main.local_config(), LocalConfig) #warn: Should this be None? - self.assertIsInstance(main.siteConfig(), SiteConfig) - self.assertIsInstance(main.eclConfig(), EclConfig) - self.assertIsInstance(main.plotConfig(), PlotSettings) - - # self.main.load_obs(obs_config_file) - self.assertIsInstance(main.getObservations(), EnkfObs) - self.assertIsInstance(main.get_templates(), ErtTemplates) - self.assertIsInstance(main.getEnkfFsManager().getCurrentFileSystem(), EnkfFs) - # self.assertIsInstance(main.iget_member_config(0), MemberConfig) - self.assertIsInstance(main.getMemberRunningState(0), EnKFState) - - self.assertEqual( "Ensemble" , main.getMountPoint()) - - main.free() - - def test_enkf_create_config_file(self): - config_file = "test_new_config" - dbase_type = "BLOCK_FS" - num_realizations = 42 - - with TestAreaContext("python/ens_condif/create_config" , store_area = True) as ta: - EnKFMain.createNewConfig(config_file, "storage" , dbase_type, num_realizations) - main = EnKFMain(config_file) - self.assertEqual(main.getEnsembleSize(), num_realizations) - - - def test_run_context(self): - with TestAreaContext("enkf_test") as work_area: - work_area.copy_directory(self.case_directory) - main = EnKFMain("simple_config/minimum_config") - fs_manager = main.getEnkfFsManager() - fs = fs_manager.getCurrentFileSystem( ) - iactive = BoolVector(initial_size = 10 , default_value = True) - iactive[0] = False - iactive[1] = False - run_context = main.getRunContextENSEMPLE_EXPERIMENT( fs , iactive ) - - self.assertEqual( len(run_context) , 8 ) - - with self.assertRaises(IndexError): - run_context[8] - - with self.assertRaises(TypeError): - run_context["String"] - - run_arg = run_context[0] - self.assertTrue( isinstance( run_arg , RunArg )) - - with self.assertRaises(ValueError): - run_context.iensGet(0) - - - with self.assertRaises(ValueError): - run_context.iensGet(1) - - arg0 = run_context[0] - arg2 = run_context.iensGet( 2 ) - #self.assertEqual( arg0 , arg2 ) - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_enkf_fs.py b/ThirdParty/Ert/python/tests/ert/enkf/test_enkf_fs.py deleted file mode 100644 index 93de431075..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_enkf_fs.py +++ /dev/null @@ -1,67 +0,0 @@ -import os -from ert.enkf import EnkfFs -from ert.enkf import EnKFMain -from ert.enkf.enums import EnKFFSType -from ert.test import ExtendedTestCase , TestAreaContext -from ert.test import ErtTestContext - - -class EnKFFSTest(ExtendedTestCase): - def setUp(self): - self.mount_point = "storage/default" - self.config_file = self.createTestPath("Statoil/config/with_data/config") - - - def test_id_enum(self): - self.assertEnumIsFullyDefined(EnKFFSType, "fs_driver_impl", "libenkf/include/ert/enkf/fs_types.h") - - - def test_create(self): - with TestAreaContext("create_fs") as work_area: - work_area.copy_parent_content(self.config_file) - - self.assertTrue(EnkfFs.exists(self.mount_point)) - fs = EnkfFs(self.mount_point) - self.assertEqual(1, fs.refCount()) - fs.umount() - - self.assertFalse(EnkfFs.exists("newFS")) - arg = None - fs = EnkfFs.createFileSystem("newFS", EnKFFSType.BLOCK_FS_DRIVER_ID, arg) - self.assertTrue(EnkfFs.exists("newFS")) - self.assertTrue( fs is None ) - - with self.assertRaises(IOError): - version = EnkfFs.diskVersion("does/not/exist") - - version = EnkfFs.diskVersion("newFS") - self.assertTrue( version >= 106 ) - - - def test_create2(self): - with TestAreaContext("create_fs2") as work_area: - work_area.copy_parent_content(self.config_file) - - new_fs = EnkfFs.createFileSystem("newFS", EnKFFSType.BLOCK_FS_DRIVER_ID, mount = True) - self.assertTrue( isinstance( new_fs , EnkfFs )) - - - - def test_throws(self): - with self.assertRaises(Exception): - fs = EnkfFs("/does/not/exist") - - - def test_refcount(self): - with ErtTestContext("TEST", self.config_file) as testContext: - ert = testContext.getErt() - self.assertTrue(isinstance(ert, EnKFMain)) - - fsm = ert.getEnkfFsManager() - fs = fsm.getCurrentFileSystem() - self.assertEqual(2, fs.refCount()) - - fs.umount() - - with self.assertRaises(AssertionError): - fs.refCount() diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_enkf_fs_manager1.py b/ThirdParty/Ert/python/tests/ert/enkf/test_enkf_fs_manager1.py deleted file mode 100644 index 03c8ca6b12..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_enkf_fs_manager1.py +++ /dev/null @@ -1,45 +0,0 @@ -import os -from ert.enkf import EnkfFs -from ert.enkf import EnKFMain -from ert.enkf import EnkfFsManager -from ert.test import ErtTestContext -from ert.test import ExtendedTestCase - - -class EnKFFSManagerTest1(ExtendedTestCase): - def setUp(self): - self.config_file = self.createTestPath("Statoil/config/with_data/config") - - - def test_create(self): - # We are indirectly testing the create through the create - # already in the enkf_main object. In principle we could - # create a separate manager instance from the ground up, but - # then the reference count will be weird. - with ErtTestContext("enkf_fs_manager_create_test", self.config_file) as testContext: - ert = testContext.getErt() - fsm = ert.getEnkfFsManager() - - self.assertTrue(fsm.isCaseMounted("default")) - self.assertTrue(fsm.caseExists("default")) - self.assertTrue(fsm.caseHasData("default")) - self.assertFalse(fsm.isCaseRunning("default")) - - fs = fsm.getCurrentFileSystem() - self.assertEqual(2, fs.refCount()) - self.assertEqual(1, fsm.getFileSystemCount()) - - self.assertFalse(fsm.isCaseMounted("newFS")) - self.assertFalse(fsm.caseExists("newFS")) - self.assertFalse(fsm.caseHasData("newFS")) - self.assertFalse(fsm.isCaseRunning("newFS")) - - fs2 = fsm.getFileSystem("newFS") - self.assertEqual(2, fsm.getFileSystemCount()) - self.assertEqual(1, fs2.refCount()) - - self.assertTrue(fsm.isCaseMounted("newFS")) - self.assertTrue(fsm.caseExists("newFS")) - self.assertFalse(fsm.caseHasData("newFS")) - self.assertFalse(fsm.isCaseRunning("newFS")) - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_enkf_fs_manager2.py b/ThirdParty/Ert/python/tests/ert/enkf/test_enkf_fs_manager2.py deleted file mode 100644 index 1441407ddd..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_enkf_fs_manager2.py +++ /dev/null @@ -1,37 +0,0 @@ -import os -from ert.enkf import EnkfFs -from ert.enkf import EnKFMain -from ert.enkf import EnkfFsManager -from ert.test import ErtTestContext -from ert.test import ExtendedTestCase - - -class EnKFFSManagerTest2(ExtendedTestCase): - def setUp(self): - self.config_file = self.createTestPath("Statoil/config/with_data/config") - - - def test_rotate(self): - - # We are indirectly testing the create through the create - # already in the enkf_main object. In principle we could - # create a separate manager instance from the ground up, but - # then the reference count will be weird. - with ErtTestContext("enkf_fs_manager_rotate_test", self.config_file) as testContext: - ert = testContext.getErt() - fsm = ert.getEnkfFsManager() - self.assertEqual(1, fsm.getFileSystemCount()) - - fs_list = [] - for index in range(EnkfFsManager.DEFAULT_CAPACITY): - fs_list.append(fsm.getFileSystem("fs_fill_%d" % index)) - - self.assertEqual(EnkfFsManager.DEFAULT_CAPACITY, fsm.getFileSystemCount()) - - for i in range(10): - fs = "fs_test_%d" % i - print("Mounting: %s" % fs) - fs_list.append(fsm.getFileSystem(fs)) - self.assertEqual(EnkfFsManager.DEFAULT_CAPACITY, fsm.getFileSystemCount()) - - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_enkf_library.py b/ThirdParty/Ert/python/tests/ert/enkf/test_enkf_library.py deleted file mode 100644 index 3ed1dbaa42..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_enkf_library.py +++ /dev/null @@ -1,56 +0,0 @@ -import os -from ert.ecl import EclSum -from ert.enkf import AnalysisConfig, EclConfig, GenKwConfig, EnkfConfigNode, SiteConfig, ObsVector -from ert.enkf import GenDataConfig, FieldConfig, EnkfFs, EnkfObs, EnKFState, EnsembleConfig -from ert.enkf import ErtTemplate, ErtTemplates, LocalConfig, ModelConfig -from ert.enkf.enkf_main import EnKFMain - -from ert.enkf.util import TimeMap -from ert.test import ExtendedTestCase , TestAreaContext - - -class EnKFLibraryTest(ExtendedTestCase): - def setUp(self): - self.case_directory = self.createTestPath("local/simple_config/") - - def test_failed_class_creation(self): - classes = [EnkfConfigNode, EnKFState, - ErtTemplate, ErtTemplates, LocalConfig, ModelConfig, SiteConfig] - - for cls in classes: - with self.assertRaises(NotImplementedError): - temp = cls() - - - def test_ecl_config_creation(self): - with TestAreaContext("enkf_library_test") as work_area: - work_area.copy_directory(self.case_directory) - - main = EnKFMain("simple_config/minimum_config") - - self.assertIsInstance(main.analysisConfig(), AnalysisConfig) - self.assertIsInstance(main.eclConfig(), EclConfig) - - with self.assertRaises(AssertionError): # Null pointer! - self.assertIsInstance(main.eclConfig().getRefcase(), EclSum) - - file_system = main.getEnkfFsManager().getCurrentFileSystem() - self.assertEqual(file_system.getCaseName(), "default") - time_map = file_system.getTimeMap() - self.assertIsInstance(time_map, TimeMap) - - main.free() - - - def test_enkf_state(self): - with TestAreaContext("enkf_library_test") as work_area: - work_area.copy_directory(self.case_directory) - - main = EnKFMain("simple_config/minimum_config") - state = main.getRealisation( 0 ) - - with self.assertRaises(TypeError): - state.addSubstKeyword( "GEO_ID" , 45) - - state.addSubstKeyword("GEO_ID" , "45") - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_enkf_load_results_manually.py b/ThirdParty/Ert/python/tests/ert/enkf/test_enkf_load_results_manually.py deleted file mode 100644 index 03120b6d26..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_enkf_load_results_manually.py +++ /dev/null @@ -1,36 +0,0 @@ -from ert.enkf.enums.realization_state_enum import RealizationStateEnum -from ert.test import ErtTestContext, ExtendedTestCase -from ert.util import BoolVector - - -class LoadResultsManuallyTest(ExtendedTestCase): - def setUp(self): - self.config_file = self.createTestPath("Statoil/config/with_data/config") - - def test_load_results_manually(self): - with ErtTestContext("manual_load_test", self.config_file) as test_context: - ert = test_context.getErt() - load_into_case = "A1" - load_from_case = "default" - - load_into = ert.getEnkfFsManager().getFileSystem(load_into_case) - load_from = ert.getEnkfFsManager().getFileSystem(load_from_case) - - ert.getEnkfFsManager().switchFileSystem(load_from) - realisations = BoolVector(default_value=True,initial_size=25) - realisations[7] = False - iteration = 0 - - loaded = ert.loadFromForwardModel(realisations, iteration, load_into) - - load_into_case_state_map = load_into.getStateMap() - - load_into_states = [state for state in load_into_case_state_map] - - expected = [RealizationStateEnum.STATE_HAS_DATA] * 25 - expected[7] = RealizationStateEnum.STATE_UNDEFINED - - self.assertListEqual(load_into_states, expected) - self.assertEqual(24, loaded) - self.assertEqual(25, len(expected)) - self.assertEqual(25, len(realisations)) diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_enkf_obs.py b/ThirdParty/Ert/python/tests/ert/enkf/test_enkf_obs.py deleted file mode 100644 index daac7e062d..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_enkf_obs.py +++ /dev/null @@ -1,258 +0,0 @@ -from ert.test import ErtTestContext -from ert.test import ExtendedTestCase - -from ert.ecl import EclGrid, EclSum -from ert.sched import History - -from ert.util import BoolVector,IntVector -from ert.enkf import ActiveMode, EnsembleConfig -from ert.enkf import ObsVector , LocalObsdata, EnkfObs, TimeMap, LocalObsdataNode , ObsData , MeasData, ActiveList - - -class EnKFObsTest(ExtendedTestCase): - def setUp(self): - self.config_file = self.createTestPath("Statoil/config/obs_testing/config") - self.obs_config = self.createTestPath("Statoil/config/obs_testing/observations") - self.obs_config2 = self.createTestPath("Statoil/config/obs_testing/observations2") - self.refcase = self.createTestPath("Statoil/config/obs_testing/EXAMPLE_01_BASE") - self.grid = self.createTestPath("Statoil/config/obs_testing/EXAMPLE_01_BASE.EGRID") - - - def test_scale_obs(self): - with ErtTestContext("obs_test", self.config_file) as test_context: - ert = test_context.getErt() - obs = ert.getObservations() - - obs1 = obs["WWCT:OP_1"].getNode( 50 ) - obs2 = obs["WWCT:OP_1_50"].getNode( 50 ) - - self.assertEqual( obs1.getStandardDeviation( ) , obs2.getStandardDeviation( )) - std0 = obs1.getStandardDeviation( ) - - local_obsdata = LocalObsdata("obs" , obs) - node1 = local_obsdata.addNode( "WWCT:OP_1" ) - node2 = local_obsdata.addNode( "WWCT:OP_1_50" ) - node1.addTimeStep( 50 ) - node2.addTimeStep( 50 ) - - mask = BoolVector( default_value = True ) - mask[2] = True - meas_data = MeasData(mask) - obs_data = ObsData( ) - fs = ert.getEnkfFsManager().getCurrentFileSystem() - active_list = IntVector() - active_list.initRange(0,2,1) - obs.getObservationAndMeasureData( fs , local_obsdata , active_list , meas_data , obs_data ) - self.assertEqual( 2 , len(obs_data) ) - - v1 = obs_data[0] - v2 = obs_data[1] - - self.assertEqual( v1[1] , std0 ) - self.assertEqual( v2[1] , std0 ) - - meas_data = MeasData(mask) - obs_data = ObsData( 10 ) - obs.getObservationAndMeasureData( fs , local_obsdata , active_list , meas_data , obs_data ) - self.assertEqual( 2 , len(obs_data) ) - - v1 = obs_data[0] - v2 = obs_data[1] - - self.assertEqual( v1[1] , std0*10) - self.assertEqual( v2[1] , std0*10 ) - - actl = ActiveList() - obs1.updateStdScaling( 10 , actl) - obs2.updateStdScaling( 20 , actl) - meas_data = MeasData(mask) - obs_data = ObsData( ) - obs.getObservationAndMeasureData( fs , local_obsdata , active_list , meas_data , obs_data ) - self.assertEqual( 2 , len(obs_data) ) - - v1 = obs_data[0] - v2 = obs_data[1] - - self.assertEqual( v1[1] , std0*10) - self.assertEqual( v2[1] , std0*20) - - - - - - - def testObs(self): - with ErtTestContext("obs_test", self.config_file) as test_context: - ert = test_context.getErt() - obs = ert.getObservations() - - self.assertEqual(32, len(obs)) - for v in obs: - self.assertTrue(isinstance(v, ObsVector)) - - self.assertEqual(obs[-1].getKey(), 'RFT_TEST') - self.assertEqual(obs[-1].getDataKey(),'4289383' ) - self.assertEqual(obs[-1].getObsKey(), 'RFT_TEST') - - with self.assertRaises(IndexError): - v = obs[-40] - with self.assertRaises(IndexError): - v = obs[40] - - with self.assertRaises(KeyError): - v = obs["No-this-does-not-exist"] - - v1 = obs["WWCT:OP_3"] - v2 = obs["GOPT:OP"] - mask = BoolVector(True, ert.getEnsembleSize()) - current_fs = ert.getEnkfFsManager().getCurrentFileSystem() - - self.assertTrue(v1.hasData(mask, current_fs)) - self.assertFalse(v2.hasData(mask, current_fs)) - - local_node = v1.createLocalObs( ) - for t in v1.getStepList(): - self.assertTrue( local_node.tstepActive( t )) - - - - def test_obs_block_scale_std(self): - with ErtTestContext("obs_test_scale", self.config_file) as test_context: - ert = test_context.getErt() - fs = ert.getEnkfFsManager().getCurrentFileSystem() - active_list = IntVector( ) - active_list.initRange(0 , ert.getEnsembleSize() , 1 ) - - obs = ert.getObservations() - obs_data = LocalObsdata( "OBSxx" , obs ) - obs_vector = obs["WWCT:OP_1"] - obs_data.addObsVector( obs_vector ) - scale_factor = obs.scaleCorrelatedStd( fs , obs_data , active_list ) - - for obs_node in obs_vector: - for index in range(len(obs_node)): - self.assertEqual( scale_factor , obs_node.getStdScaling( index )) - - - - - def test_obs_block_all_active_local(self): - with ErtTestContext("obs_test_all_active", self.config_file) as test_context: - ert = test_context.getErt() - obs = ert.getObservations() - obs_data = obs.getAllActiveLocalObsdata( ) - - self.assertEqual( len(obs_data) , len(obs) ) - for obs_vector in obs: - self.assertTrue( obs_vector.getObservationKey() in obs_data ) - - tstep_list1 = obs_vector.getStepList() - local_node = obs_data[ obs_vector.getObservationKey() ] - for t in tstep_list1: - self.assertTrue( local_node.tstepActive( t )) - - active_list = local_node.getActiveList() - self.assertEqual( active_list.getMode() , ActiveMode.ALL_ACTIVE ) - - - - def test_create(self): - ensemble_config = EnsembleConfig() - obs = EnkfObs(ensemble_config) - self.assertEqual( len(obs) , 0 ) - self.assertFalse( obs.load(self.obs_config) ) - self.assertEqual( len(obs) , 0 ) - - - time_map = TimeMap() - obs = EnkfObs(ensemble_config , external_time_map = time_map) - self.assertEqual( len(obs) , 0 ) - - grid = EclGrid(self.grid) - refcase = EclSum(self.refcase) - - history = History( refcase , False ) - obs = EnkfObs( ensemble_config , grid = grid , history = history ) - with self.assertRaises(IOError): - obs.load("/does/not/exist") - - self.assertTrue( obs.load(self.obs_config) ) - self.assertEqual( len(obs) , 33 ) - obs.clear() - self.assertEqual( len(obs) , 0 ) - - obs.load(self.obs_config) - self.assertEqual( len(obs) , 33 ) - self.assertFalse( "RFT2" in obs ) - obs.load(self.obs_config2) - self.assertEqual( len(obs) , 35 ) - self.assertTrue( "RFT2" in obs ) - - def test_hookmanager_runpathlist(self): - with ErtTestContext("obs_test", self.config_file) as test_context: - ert = test_context.getErt() - hm = ert.getHookManager() - pfx = 'HookManager(size = ' - self.assertEqual(repr(hm)[:len(pfx)], pfx) - - rpl = hm.getRunpathList() - pfx = 'RunpathList(size = ' - self.assertEqual(repr(rpl)[:len(pfx)], pfx) - - ef = rpl.getExportFile() - self.assertTrue('.ert_runpath_list' in ef) - nf = 'myExportCamel' - rpl.setExportFile('myExportCamel') - ef = rpl.getExportFile() - self.assertTrue(nf in ef) - - - - def test_ert_obs_reload(self): - with ErtTestContext("obs_test_reload", self.config_file) as test_context: - ert = test_context.getErt() - local_config = ert.getLocalConfig( ) - update_step = local_config.getUpdatestep( ) - mini_step = update_step[0] - local_obs = mini_step.getLocalObsData( ) - self.assertTrue( "WGOR:OP_5" in local_obs ) - self.assertTrue( "RPR2_1" in local_obs ) - - - ens_config = ert.ensembleConfig( ) - wwct_op1 = ens_config["WWCT:OP_1"] - wopr_op5 = ens_config["WOPR:OP_5"] - - obs = ert.getObservations() - self.assertEqual( len(obs) , 32 ) - - keys = wwct_op1.getObservationKeys() - self.assertEqual( len(keys) , 2 ) - self.assertTrue( "WWCT:OP_1" in keys ) - self.assertTrue( "WWCT:OP_1_50" in keys ) - - self.assertEqual( wopr_op5.getObservationKeys() , [] ) - - ert.loadObservations("observations2") - self.assertEqual( len(obs) , 2 ) - self.assertEqual( wwct_op1.getObservationKeys() , [] ) - self.assertEqual( wopr_op5.getObservationKeys() , ["WOPR:OP_5"] ) - - local_config = ert.getLocalConfig( ) - update_step = local_config.getUpdatestep( ) - mini_step = update_step[0] - local_obs = mini_step.getLocalObsData( ) - self.assertTrue( "WOPR:OP_5" in local_obs ) - self.assertTrue( "RFT2" in local_obs ) - self.assertFalse( "WGOR:OP_5" in local_obs ) - self.assertFalse( "RPR2_1" in local_obs ) - - - ert.loadObservations("observations" , clear = False) - self.assertEqual( len(obs) , 34 ) - keys = wwct_op1.getObservationKeys() - self.assertEqual( len(keys) , 2 ) - self.assertTrue( "WWCT:OP_1" in keys ) - self.assertTrue( "WWCT:OP_1_50" in keys ) - - self.assertEqual( wopr_op5.getObservationKeys() , ["WOPR:OP_5"] ) diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_ensemble_config.py b/ThirdParty/Ert/python/tests/ert/enkf/test_ensemble_config.py deleted file mode 100644 index e5f64250e2..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_ensemble_config.py +++ /dev/null @@ -1,17 +0,0 @@ -from ert.test import ErtTestContext -from ert.test import ExtendedTestCase - -from ert.util import BoolVector,IntVector -from ert.enkf import ActiveMode, EnsembleConfig -from ert.enkf import ObsVector , LocalObsdata - - -class EnsembleConfigTest(ExtendedTestCase): - - def test_create(self): - conf = EnsembleConfig( ) - self.assertEqual( len(conf) , 0 ) - self.assertFalse( "XYZ" in conf ) - - with self.assertRaises(KeyError): - node = conf["KEY"] diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_ert_context.py b/ThirdParty/Ert/python/tests/ert/enkf/test_ert_context.py deleted file mode 100644 index 6356f653d2..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_ert_context.py +++ /dev/null @@ -1,95 +0,0 @@ -from ert.test import ErtTestContext, ExtendedTestCase - - -class ErtTestContextTest(ExtendedTestCase): - def setUp(self): - self.config = self.createTestPath("Statoil/config/with_data/config") - - def test_raises(self): - with self.assertRaises(IOError): - testContext = ErtTestContext("ExistTest" , "Does/not/exist") - - - def initFromCaseTest(self, context, root_path): - ert = context.getErt() - - init_case_job = self.createSharePath("%s/INIT_CASE_FROM_EXISTING" % root_path) - self.assertTrue(context.installWorkflowJob("INIT_CASE_JOB", init_case_job)) - self.assertTrue(context.runWorkflowJob("INIT_CASE_JOB", "default", "new_not_current_case")) - - default_fs = ert.getEnkfFsManager().getFileSystem("default") - new_fs = ert.getEnkfFsManager().getFileSystem("new_not_current_case") - - self.assertIsNotNone(default_fs) - self.assertIsNotNone(new_fs) - - self.assertTrue(len(default_fs.getStateMap()) > 0) - self.assertEqual(len(default_fs.getStateMap()), len(new_fs.getStateMap())) - - - def createCaseTest(self, context, root_path): - create_case_job = self.createSharePath("%s/CREATE_CASE" % root_path) - self.assertTrue(context.installWorkflowJob("CREATE_CASE_JOB", create_case_job)) - self.assertTrue(context.runWorkflowJob("CREATE_CASE_JOB", "newly_created_case")) - self.assertDirectoryExists("storage/newly_created_case") - - - def selectCaseTest(self, context, root_path): - ert = context.getErt() - select_case_job = self.createSharePath("%s/SELECT_CASE" % root_path) - - default_fs = ert.getEnkfFsManager().getCurrentFileSystem() - - custom_fs = ert.getEnkfFsManager().getFileSystem("CustomCase") - - self.assertEqual(ert.getEnkfFsManager().getCurrentFileSystem(), default_fs) - - self.assertTrue(context.installWorkflowJob("SELECT_CASE_JOB", select_case_job)) - self.assertTrue(context.runWorkflowJob("SELECT_CASE_JOB", "CustomCase")) - - self.assertEqual(ert.getEnkfFsManager().getCurrentFileSystem(), custom_fs) - - - def loadResultsTest(self, context): - load_results_job = self.createSharePath("workflows/jobs/internal/config/LOAD_RESULTS") - self.assertTrue(context.installWorkflowJob("LOAD_RESULTS_JOB", load_results_job)) - self.assertTrue(context.runWorkflowJob("LOAD_RESULTS_JOB", 0, 1)) - - - def rankRealizationsOnObservationsTest(self, context): - rank_job = self.createSharePath("workflows/jobs/internal/config/OBSERVATION_RANKING") - - self.assertTrue(context.installWorkflowJob("OBS_RANK_JOB", rank_job)) - - self.assertTrue(context.runWorkflowJob("OBS_RANK_JOB", "NameOfObsRanking1", "|", "WOPR:*")) - self.assertTrue(context.runWorkflowJob("OBS_RANK_JOB", "NameOfObsRanking2", "1-5", "55", "|", "WWCT:*", "WOPR:*")) - self.assertTrue(context.runWorkflowJob("OBS_RANK_JOB", "NameOfObsRanking3", "5", "55", "|")) - self.assertTrue(context.runWorkflowJob("OBS_RANK_JOB", "NameOfObsRanking4", "1,3,5-10", "55")) - self.assertTrue(context.runWorkflowJob("OBS_RANK_JOB", "NameOfObsRanking5")) - self.assertTrue(context.runWorkflowJob("OBS_RANK_JOB", "NameOfObsRanking6", "|", "UnrecognizableObservation")) - - - def test_workflow_function_jobs(self): - - with ErtTestContext("python/enkf/ert_test_context_workflow_function_job", self.config) as context: - internal_config = "workflows/jobs/internal-tui/config" - self.createCaseTest(context, root_path=internal_config) - self.selectCaseTest(context, root_path=internal_config) - - # Due to EnKFFs caching and unmonitored C functions this will fail - #self.initFromCaseTest(context, root_path=internal_config) - - self.loadResultsTest(context) - self.rankRealizationsOnObservationsTest(context) - - - - def test_workflow_ert_script_jobs(self): - - with ErtTestContext("python/enkf/ert_test_context_workflow_ert_script_job", self.config) as context: - ert_scripts_config = "workflows/jobs/internal-gui/config" - self.createCaseTest(context, root_path=ert_scripts_config) - self.selectCaseTest(context, root_path=ert_scripts_config) - self.initFromCaseTest(context, root_path=ert_scripts_config) - - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_ert_log.py b/ThirdParty/Ert/python/tests/ert/enkf/test_ert_log.py deleted file mode 100644 index f98551f566..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_ert_log.py +++ /dev/null @@ -1,31 +0,0 @@ -import os -from ert.enkf import ErtLog -from ert.test import ExtendedTestCase, TestAreaContext - - -class ErtLogTest(ExtendedTestCase): - - def test_log(self): - with TestAreaContext("python/ert_log/log") as work_area: - test_log_filename = "test_log" - ErtLog.init(1, test_log_filename, True) - message = "This is fun" - ErtLog.log(1, message) - - self.assertTrue(os.path.isfile(test_log_filename)) - - with open(test_log_filename, "r") as f: - text = f.readlines() - self.assertTrue(len(text) > 0) - self.assertTrue(message in text[-1]) - - - def test_getFilename(self): - with TestAreaContext("python/ert_log/log") as work_area: - test_log_filename = "log_test_file.txt" - ErtLog.init(1, test_log_filename, True) - message = "This is fun" - ErtLog.log(1, message) - - self.assertEqual(ErtLog.getFilename(), test_log_filename) - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_es_update.py b/ThirdParty/Ert/python/tests/ert/enkf/test_es_update.py deleted file mode 100644 index 09b7202b97..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_es_update.py +++ /dev/null @@ -1,19 +0,0 @@ -from ert.test import ExtendedTestCase, ErtTestContext -from ert.enkf import ESUpdate - - -class ESUpdateTest(ExtendedTestCase): - - def test_create(self): - config = self.createTestPath("local/custom_kw/mini_config") - with ErtTestContext("python/enkf/data/custom_kw_simulated", config) as context: - ert = context.getErt() - es_update = ESUpdate( ert ) - - self.assertFalse( es_update.hasModule( "NO_NOT_THIS_MODULE" )) - with self.assertRaises(KeyError): - m = es_update.getModule( "STD_ENKF_XXX" ) - - module = es_update.getModule( "STD_ENKF" ) - - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_field_config.py b/ThirdParty/Ert/python/tests/ert/enkf/test_field_config.py deleted file mode 100644 index eb5e8062d7..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_field_config.py +++ /dev/null @@ -1,73 +0,0 @@ -# Copyright (C) 2017 Statoil ASA, Norway. -# -# This file is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -from os.path import abspath - -from ert.ecl import EclGrid -from ert.enkf.config import FieldTypeEnum, FieldConfig -from ert.enkf.enums import EnkfFieldFileFormatEnum -from ert.test import ExtendedTestCase, TestAreaContext - -class FieldConfigTest(ExtendedTestCase): - - def test_field_guess_filetype(self): - with TestAreaContext('field_config') as test_context: - fname = abspath('test.kw.grdecl') - print(fname) - with open(fname, 'w') as f: - f.write("-- my comment\n") - f.write("-- more comments\n") - f.write("SOWCR\n") - for i in range(256//8): # technicalities demand file has >= 256B - f.write("0 0 0 0\n") - - ft = FieldConfig.guessFiletype(fname) - grdecl_type = EnkfFieldFileFormatEnum(5) - self.assertEqual('ECL_GRDECL_FILE', grdecl_type.name) - self.assertEqual(grdecl_type, ft) - - def test_field_type_enum(self): - self.assertEqual(FieldTypeEnum(2), FieldTypeEnum.ECLIPSE_PARAMETER) - gen = FieldTypeEnum.GENERAL - self.assertEqual('GENERAL', str(gen)) - gen = FieldTypeEnum(3) - self.assertEqual('GENERAL', str(gen)) - - def test_export_format(self): - self.assertEqual(FieldConfig.exportFormat("file.grdecl"), EnkfFieldFileFormatEnum.ECL_GRDECL_FILE) - self.assertEqual(FieldConfig.exportFormat("file.xyz.grdecl"), EnkfFieldFileFormatEnum.ECL_GRDECL_FILE) - self.assertEqual(FieldConfig.exportFormat("file.roFF"), EnkfFieldFileFormatEnum.RMS_ROFF_FILE) - self.assertEqual(FieldConfig.exportFormat("file.xyz.roFF"), EnkfFieldFileFormatEnum.RMS_ROFF_FILE) - - with self.assertRaises(ValueError): - FieldConfig.exportFormat("file.xyz") - - with self.assertRaises(ValueError): - FieldConfig.exportFormat("file.xyz") - - def test_basics(self): - grid = EclGrid.createRectangular((17,13,11),(1,1,1)) - fc = FieldConfig('PORO',grid) - print(fc) - print(str(fc)) - print(repr(fc)) - pfx = 'FieldConfig(type' - rep = repr(fc) - self.assertEqual(pfx, rep[:len(pfx)]) - fc_xyz = fc.get_nx(),fc.get_ny(),fc.get_nz() - ex_xyz = 17,13,11 - self.assertEqual(ex_xyz, fc_xyz) - self.assertEqual(0, fc.get_truncation_mode()) - self.assertEqual(ex_xyz, (grid.getNX(), grid.getNY(), grid.getNZ())) diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_field_export.py b/ThirdParty/Ert/python/tests/ert/enkf/test_field_export.py deleted file mode 100644 index 1f5b7b280b..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_field_export.py +++ /dev/null @@ -1,81 +0,0 @@ -import os - -from ert.util import IntVector - -from ert.ecl import EclGrid - -from ert.enkf.config import FieldTypeEnum, FieldConfig -from ert.enkf.data import EnkfNode -from ert.enkf.enums import EnkfFieldFileFormatEnum -from ert.enkf import NodeId - -from ert.test import ExtendedTestCase -from ert.test import ErtTestContext - - -class FieldExportTest(ExtendedTestCase): - def setUp(self): - self.config_file = self.createTestPath("Statoil/config/obs_testing/config") - - def test_field_type_enum(self): - with ErtTestContext("export_test", self.config_file) as test_context: - ert = test_context.getErt() - ens_config = ert.ensembleConfig() - fc = ens_config["PERMX"].getFieldModelConfig() - self.assertEqual(FieldTypeEnum.ECLIPSE_PARAMETER, fc.get_type()) - - def test_field_basics(self): - with ErtTestContext("export_test", self.config_file) as test_context: - ert = test_context.getErt() - ens_config = ert.ensembleConfig() - fc = ens_config["PERMX"].getFieldModelConfig() - pfx = 'FieldConfig(type' - rep = repr(fc) - self.assertEqual(pfx, rep[:len(pfx)]) - fc_xyz = fc.get_nx(),fc.get_ny(),fc.get_nz() - ex_xyz = 40,64,14 - self.assertEqual(ex_xyz, fc_xyz) - self.assertEqual(1, fc.get_truncation_mode()) - self.assertEqual(0.001, fc.get_truncation_min()) - self.assertEqual(-1.0, fc.get_truncation_max()) - self.assertEqual('LOG', fc.get_init_transform_name()) - self.assertEqual(None, fc.get_output_transform_name()) - grid = fc.get_grid() - self.assertEqual(ex_xyz, (grid.getNX(), grid.getNY(), grid.getNZ())) - - def test_field_export(self): - with ErtTestContext("export_test", self.config_file) as test_context: - ert = test_context.getErt() - fs_manager = ert.getEnkfFsManager( ) - ens_config = ert.ensembleConfig() - config_node = ens_config["PERMX"] - data_node = EnkfNode( config_node ) - node_id = NodeId( 0 , 0 ) - fs = fs_manager.getCurrentFileSystem( ) - data_node.tryLoad( fs , node_id ) - - data_node.export("export/with/path/PERMX.grdecl") - self.assertTrue( os.path.isfile("export/with/path/PERMX.grdecl") ) - - - def test_field_export_many(self): - with ErtTestContext("export_test", self.config_file) as test_context: - ert = test_context.getErt() - fs_manager = ert.getEnkfFsManager( ) - ens_config = ert.ensembleConfig() - config_node = ens_config["PERMX"] - iens_list = IntVector( ) - iens_list.append(0) - iens_list.append(2) - iens_list.append(4) - - fs = fs_manager.getCurrentFileSystem( ) - - # Filename without embedded %d - TypeError - with self.assertRaises(TypeError): - EnkfNode.exportMany( config_node , "export/with/path/PERMX.grdecl" , fs , iens_list ) - - EnkfNode.exportMany( config_node , "export/with/path/PERMX_%d.grdecl" , fs , iens_list ) - self.assertTrue( os.path.isfile("export/with/path/PERMX_0.grdecl") ) - self.assertTrue( os.path.isfile("export/with/path/PERMX_2.grdecl") ) - self.assertTrue( os.path.isfile("export/with/path/PERMX_4.grdecl") ) diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_forward_load_context.py b/ThirdParty/Ert/python/tests/ert/enkf/test_forward_load_context.py deleted file mode 100644 index 82970a06aa..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_forward_load_context.py +++ /dev/null @@ -1,9 +0,0 @@ -from ert.test import ExtendedTestCase -from ert.enkf import ForwardLoadContext - -class ForwardLoadContextTest(ExtendedTestCase): - - def test_create(self): - ctx = ForwardLoadContext( report_step = 1 ) - self.assertEqual( 1 , ctx.getLoadStep( ) ) - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_gen_obs.py b/ThirdParty/Ert/python/tests/ert/enkf/test_gen_obs.py deleted file mode 100644 index 429a3852cc..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_gen_obs.py +++ /dev/null @@ -1,52 +0,0 @@ -import os.path - -from ert.test import ExtendedTestCase, TestAreaContext - -from ert.enkf import GenObservation,GenDataConfig,ActiveList - - - - -class GenObsTest(ExtendedTestCase): - def setUp(self): - pass - - - def test_create(self): - data_config = GenDataConfig("KEY") - with self.assertRaises(ValueError): - gen_obs = GenObservation("KEY" , data_config ) - - with TestAreaContext("gen_obs/create"): - with open("obs1.txt","w") as f: - f.write("10 5 12 6\n") - - with self.assertRaises(ValueError): - gen_obs = GenObservation("KEY" , data_config , scalar_value = (1,2) , obs_file = "obs1.txt") - - with self.assertRaises(TypeError): - gen_obs = GenObservation("KEY" , data_config , scalar_value = 1 ) - - with self.assertRaises(IOError): - gen_obs = GenObservation("KEY" , data_config , obs_file = "does/not/exist" ) - - gen_obs = GenObservation("KEY" , data_config , obs_file = "obs1.txt" , data_index = "10,20") - self.assertEqual( len(gen_obs) , 2 ) - self.assertEqual( gen_obs[0] , (10,5) ) - self.assertEqual( gen_obs[1] , (12,6) ) - - self.assertEqual( gen_obs.getValue(0) , 10 ) - self.assertEqual( gen_obs.getDataIndex(1) , 20 ) - self.assertEqual( gen_obs.getStdScaling(0) , 1 ) - self.assertEqual( gen_obs.getStdScaling(1) , 1 ) - - active_list = ActiveList( ) - gen_obs.updateStdScaling( 0.25 , active_list ) - self.assertEqual( gen_obs.getStdScaling(0) , 0.25 ) - self.assertEqual( gen_obs.getStdScaling(1) , 0.25 ) - - active_list.addActiveIndex( 1 ) - gen_obs.updateStdScaling( 2.00 , active_list ) - self.assertEqual( gen_obs.getStdScaling(0) , 0.25 ) - self.assertEqual( gen_obs.getStdScaling(1) , 2.00 ) - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_hook_workflow.py b/ThirdParty/Ert/python/tests/ert/enkf/test_hook_workflow.py deleted file mode 100644 index c5a105576c..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_hook_workflow.py +++ /dev/null @@ -1,9 +0,0 @@ -from ert.enkf.enums import HookRuntime -from ert.test import ExtendedTestCase - - -class HookWorkFlowTest(ExtendedTestCase): - - def test_enum(self): - self.assertEnumIsFullyDefined(HookRuntime, "hook_run_mode_enum" , "libenkf/include/ert/enkf/hook_workflow.h", verbose=True) - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_labscale.py b/ThirdParty/Ert/python/tests/ert/enkf/test_labscale.py deleted file mode 100644 index 38db80bce9..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_labscale.py +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2015 Statoil ASA, Norway. -# -# The file 'test_labscale.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - - -from ert.enkf import ObsVector -from ert.test import ExtendedTestCase , ErtTestContext - - - -class LabScaleTest(ExtendedTestCase): - - - def testObs(self): - config_file = self.createTestPath("Statoil/config/labscale/config") - with ErtTestContext("labscale", config_file) as test_context: - ert = test_context.getErt() - obs = ert.getObservations() - - self.assertEqual(4, len(obs)) - for v in obs: - self.assertTrue(isinstance(v, ObsVector)) - - v1 = obs["WWCT_1"] - self.assertEqual( v1.activeStep() , 5 ) - node = v1.getNode( 5 ) - self.assertFloatEqual( node.getValue() , 0.00) - - v2 = obs["WWCT_2"] - self.assertEqual( v2.activeStep() , 31 ) - node = v2.getNode( 31 ) - self.assertFloatEqual( node.getValue() , 0.575828) - - v3 = obs["WWCT_3"] - self.assertEqual( v3.activeStep() , 73 ) - node = v3.getNode( 73 ) - self.assertFloatEqual( node.getValue() , 1.00) - - - bpr = obs["BPR"] - self.assertEqual( bpr.activeStep() , 31 ) - node = bpr.getNode( 31 ) - self.assertFloatEqual( node.getValue(0) , 10.284) - - - - def testObs_beijing(self): - config_file = self.createTestPath("Statoil/config/lab-beijing/labunits/config") - with ErtTestContext("labscale-beijing", config_file) as test_context: - ert = test_context.getErt() - obs = ert.getObservations() - - - v0 = obs["WCT0"] - self.assertEqual( v0.activeStep() , 18 ) - node = v0.getNode( 18 ) - self.assertEqual( node.getValue() , 0.12345 ) - - - v1 = obs["WCT1"] - self.assertEqual( v1.activeStep() , 18 ) - node = v1.getNode( 18 ) - self.assertEqual( node.getValue() , 0.12345 ) diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_linalg.py b/ThirdParty/Ert/python/tests/ert/enkf/test_linalg.py deleted file mode 100644 index 0106b60c6e..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_linalg.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (C) 2015 Statoil ASA, Norway. -# -# The file 'test_labscale.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - - -from ert.enkf import ObsVector -from ert.util import Matrix -from ert.enkf.linalg import * - - -class LinalgTest(ExtendedTestCase): - - def test_num_PC(self): - S = Matrix(3,3) - s[0,0] = 1 - s[1,1] = 0.25 - s[2,2] = 0.125 - - with self.assertRaises(ValueError): - num_pc = numPC( S , -1 ) - - - with self.assertRaises(ValueError): - num_pc = numPC( S , 1.5 ) - - num_pc = numPC( S , 0.80 ) - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_local_config.py b/ThirdParty/Ert/python/tests/ert/enkf/test_local_config.py deleted file mode 100644 index 0154d45b8b..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_local_config.py +++ /dev/null @@ -1,187 +0,0 @@ -import os.path -from ert.ecl import EclGrid - -from ert.test import ExtendedTestCase -from ert.test import ErtTestContext -from ert.enkf.local_ministep import LocalMinistep -from ert.enkf.active_list import ActiveList -from ert.enkf.local_obsdata import LocalObsdata -from ert.enkf.local_updatestep import LocalUpdateStep -from ert.enkf.local_obsdata_node import LocalObsdataNode -from ert.enkf import local_config -from ert.enkf.local_dataset import LocalDataset - -class LocalConfigTest(ExtendedTestCase): - - def setUp(self): - - self.config = self.createTestPath("local/custom_kw/mini_config") - - def testLocalConfig(self): - - with ErtTestContext("python/enkf/data/local_config", self.config) as test_context: - - main = test_context.getErt() - self.assertTrue(main, "Load failed") - - local_config = main.getLocalConfig() - analysis_module = main.analysisConfig().getModule("STD_ENKF") - - self.AllActive(local_config) - - local_config.clear() - - self.MiniStep(local_config, analysis_module) - - self.AttachMinistep(local_config) - - self.LocalDataset(local_config) - - self.LocalObsdata(local_config) - - local_config_file_summary = "local_config_summary.txt" - local_config.writeSummaryFile( local_config_file_summary ) - self.assertTrue( os.path.isfile( local_config_file_summary )) - - self.clear(local_config) - - grid = local_config.getGrid() - self.assertTrue( isinstance( grid , EclGrid )) - - def clear(self, local_config): - local_config.clear() - updateStep = local_config.getUpdatestep( ) - self.assertEqual( len(updateStep) , 0 ) - - - - def AllActive(self , local_config): - updateStep = local_config.getUpdatestep( ) - ministep = updateStep[0] - self.assertEqual( 1 , len(ministep) ) - dataset = ministep["ALL_DATA"] - - self.assertTrue( "PERLIN_PARAM" in dataset ) - - obsdata = ministep.getLocalObsData() - self.assertEqual( len(obsdata) , 3 ) - - - def MiniStep( self, local_config, analysis_module ): - - # Ministep - ministep = local_config.createMinistep("MINISTEP", analysis_module) - self.assertTrue(isinstance(ministep, LocalMinistep)) - - self.assertFalse( "DATA" in ministep ) - with self.assertRaises(KeyError): - ministep["DATA"] - - - def AttachMinistep( self, local_config): - - # Update step - updatestep = local_config.getUpdatestep( ) - self.assertTrue(isinstance(updatestep, LocalUpdateStep)) - n1 = len(updatestep) - - # Ministep - ministep = local_config.createMinistep("MINISTEP") - self.assertTrue(isinstance(ministep, LocalMinistep)) - - # Attach - updatestep.attachMinistep(ministep) - self.assertTrue(isinstance(updatestep[0], LocalMinistep)) - - self.assertEqual( len(updatestep) , n1 + 1 ) - - - def LocalDataset( self, local_config ): - - # Creating dataset - data_scale = local_config.createDataset("DATA_SCALE") - self.assertTrue(isinstance(data_scale, LocalDataset)) - - # Try to add existing dataset - with self.assertRaises(ValueError): - local_config.createDataset("DATA_SCALE") - - with self.assertRaises(KeyError): - data_scale.addNode("MISSING") - - data_scale.addNode("PERLIN_PARAM") - active_list = data_scale.getActiveList("PERLIN_PARAM") - self.assertTrue(isinstance(active_list, ActiveList)) - active_list.addActiveIndex(0) - - self.assertTrue("PERLIN_PARAM" in data_scale) - self.assertFalse("MISSING" in data_scale) - - ministep = local_config.createMinistep("MINISTEP") - ministep.attachDataset( data_scale ) - self.assertTrue( "DATA_SCALE" in ministep ) - data_scale_get = ministep["DATA_SCALE"] - self.assertTrue( "PERLIN_PARAM" in data_scale_get ) - - # Error when adding existing data node - with self.assertRaises(KeyError): - data_scale.addNode("PERLIN_PARAM") - - - - def LocalObsdata( self, local_config ): - - # Creating obsdata - local_obs_data_1 = local_config.createObsdata("OBSSET_1") - self.assertTrue(isinstance(local_obs_data_1, LocalObsdata)) - - # Try to add existing obsdata - with self.assertRaises(ValueError): - local_config.createObsdata("OBSSET_1") - - # Add node with range - with self.assertRaises(KeyError): - local_obs_data_1.addNodeAndRange("MISSING_KEY" , 0 , 1 ) - - local_obs_data_1.addNodeAndRange("GEN_PERLIN_1", 0, 1) - local_obs_data_1.addNodeAndRange("GEN_PERLIN_2", 0, 1) - - self.assertEqual( len(local_obs_data_1) , 2 ) - - # Delete node - del local_obs_data_1["GEN_PERLIN_1"] - self.assertEqual( len(local_obs_data_1) , 1 ) - - # Get node - node = local_obs_data_1["GEN_PERLIN_2"] - self.assertTrue(isinstance(node, LocalObsdataNode)) - - # Add node again with no range and check return type - node_again = local_obs_data_1.addNode("GEN_PERLIN_1") - self.assertTrue(isinstance(node_again, LocalObsdataNode)) - - # Error when adding existing obs node - with self.assertRaises(KeyError): - local_obs_data_1.addNode("GEN_PERLIN_1") - - - def AttachObsData( self , local_config): - - local_obs_data_2 = local_config.createObsdata("OBSSET_2") - self.assertTrue(isinstance(local_obs_data_2, LocalObsdata)) - - # Obsdata - local_obs_data_2.addNodeAndRange("GEN_PERLIN_1", 0, 1) - local_obs_data_2.addNodeAndRange("GEN_PERLIN_2", 0, 1) - - # Ministep - ministep = local_config.createMinistep("MINISTEP") - self.assertTrue(isinstance(ministep, LocalMinistep)) - - # Attach obsset - ministep.attachObsset(local_obs_data_2) - - # Retrieve attached obsset - local_obs_data_new = ministep.getLocalObsData() - self.assertEqual( len(local_obs_data_new) , 2 ) - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_local_obsdata_node.py b/ThirdParty/Ert/python/tests/ert/enkf/test_local_obsdata_node.py deleted file mode 100644 index 903df7f61a..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_local_obsdata_node.py +++ /dev/null @@ -1,22 +0,0 @@ -from ert.enkf import LocalObsdataNode -from ert.test import ExtendedTestCase - - -class LocalObsdataNodeTest(ExtendedTestCase): - def setUp(self): - pass - - def test_tstep(self): - node = LocalObsdataNode("KEY") - self.assertTrue( node.allTimeStepActive() ) - self.assertTrue( node.tstepActive( 10 )) - self.assertTrue( node.tstepActive( 0 )) - - node.addTimeStep(10) - self.assertFalse( node.allTimeStepActive() ) - - self.assertTrue( node.tstepActive( 10 )) - self.assertFalse( node.tstepActive( 0 )) - - - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_meas_block.py b/ThirdParty/Ert/python/tests/ert/enkf/test_meas_block.py deleted file mode 100644 index cff889fdab..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_meas_block.py +++ /dev/null @@ -1,103 +0,0 @@ -import datetime - -from ert.test import TestAreaContext -from ert.test import ExtendedTestCase -from ert.util import BoolVector -from ert.enkf import MeasBlock - - - -class MeasBlockTest(ExtendedTestCase): - - - def test_create(self): - key = "OBS" - ens_size = 100 - obs_size = 77 - ens_mask = BoolVector( default_value = True , initial_size = ens_size ) - - ens_mask[67] = False - block = MeasBlock( key , obs_size , ens_mask) - self.assertEqual( block.getObsSize() , obs_size ) - self.assertEqual( block.getActiveEnsSize() , ens_size - 1) - self.assertEqual( block.getTotalEnsSize() , ens_size ) - - self.assertTrue( block.iensActive( 66 ) ) - self.assertFalse( block.iensActive( 67 ) ) - - - - - def test_update(self): - key = "OBS" - obs_size = 4 - ens_size = 10 - ens_mask = BoolVector( default_value = True , initial_size = ens_size ) - block = MeasBlock( key , obs_size , ens_mask) - - with self.assertRaises(TypeError): - block["String"] = 10 - - with self.assertRaises(TypeError): - block[10] = 10 - - with self.assertRaises(IndexError): - block[obs_size,0] = 10 - - with self.assertRaises(IndexError): - block[0,ens_size] = 10 - - #----------------------------------------------------------------- - - with self.assertRaises(TypeError): - a = block["String"] - - with self.assertRaises(TypeError): - a = block[10] - - with self.assertRaises(IndexError): - val = block[obs_size,0] - - with self.assertRaises(IndexError): - val = block[0,ens_size] - - block[1,2] = 3 - self.assertEqual( 3 , block[1,2] ) - - - - def test_inactive(self): - key = "OBS" - obs_size = 2 - ens_size = 10 - ens_mask = BoolVector( default_value = True , initial_size = ens_size ) - ens_mask[5] = False - block = MeasBlock( key , obs_size , ens_mask) - - self.assertFalse( block.iensActive( 5 )) - - with self.assertRaises(ValueError): - block[0,5] = 10 - - - - - def test_stat(self): - key = "OBS" - obs_size = 2 - ens_size = 10 - ens_mask = BoolVector( default_value = True , initial_size = ens_size ) - block = MeasBlock( key , obs_size , ens_mask) - - for iens in range(ens_size): - block[0,iens] = iens - block[1,iens] = iens + 1 - - self.assertEqual( 4.5 , block.igetMean( 0 )) - self.assertEqual( 5.5 , block.igetMean( 1 )) - - self.assertFloatEqual( 2.872281 , block.igetStd( 0 )) - self.assertFloatEqual( 2.872281 , block.igetStd( 1 )) - - - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_meas_data.py b/ThirdParty/Ert/python/tests/ert/enkf/test_meas_data.py deleted file mode 100644 index eb0d85e3ef..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_meas_data.py +++ /dev/null @@ -1,75 +0,0 @@ -import datetime - -from ert.util import BoolVector -from ert.test import TestAreaContext -from ert.test import ExtendedTestCase -from ert.enkf import MeasBlock,MeasData - - - -class MeasDataTest(ExtendedTestCase): - - - def test_create(self): - ens_size = 10 - ens_mask = BoolVector( default_value = True , initial_size = ens_size ) - data = MeasData( ens_mask ) - self.assertEqual( len(data) , 0) - self.assertTrue( isinstance( data , MeasData )) - - block1 = data.addBlock( "OBS1" , 10 , 5 ) - block2 = data.addBlock( "OBS2" , 27 , 10 ) - - with self.assertRaises(TypeError): - data[1.782] - - with self.assertRaises(KeyError): - data["NO-this-does-not-exist"] - - with self.assertRaises(IndexError): - data[2] - - last0 = data[-1] - last1 = data[1] - self.assertEqual( last0 , last1 ) - - self.assertTrue( "OBS1-10" in data ) - self.assertTrue( "OBS2-27" in data ) - self.assertEqual( len(data) , 2) - - self.assertTrue( isinstance( block1 , MeasBlock )) - self.assertTrue( isinstance( block2 , MeasBlock )) - - self.assertEqual( block1.getObsSize() , 5 ) - self.assertEqual( block2.getObsSize() , 10 ) - - l = [] - for b in data: - l.append(b) - - self.assertEqual(len(l) , 2) - self.assertEqual(l[0] , block1) - self.assertEqual(l[1] , block2) - - - with self.assertRaises(ValueError): - S = data.createS() - - for iens in range(ens_size): - block1[0,iens] = 5 - block2[0,iens] = 10 - block2[1,iens] = 15 - - self.assertEqual( 3 , data.activeObsSize() ) - S = data.createS() - - self.assertEqual( S.dims() , (3 , ens_size) ) - - for iens in range(ens_size): - self.assertEqual( S[0,iens] , 5 ) - self.assertEqual( S[1,iens] , 10 ) - self.assertEqual( S[2,iens] , 15 ) - - - - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_obs_block.py b/ThirdParty/Ert/python/tests/ert/enkf/test_obs_block.py deleted file mode 100644 index 9862b9d8cd..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_obs_block.py +++ /dev/null @@ -1,51 +0,0 @@ -import datetime - -from ert.util import BoolVector -from ert.test import TestAreaContext -from ert.test import ExtendedTestCase -from ert.enkf import ObsBlock - - - -class ObsBlockTest(ExtendedTestCase): - - - def test_create(self): - block = ObsBlock("OBS" , 1000) - self.assertTrue( isinstance( block , ObsBlock )) - self.assertEqual( 1000 , block.totalSize()) - self.assertEqual( 0 , block.activeSize()) - - - - def test_access(self): - obs_size = 10 - block = ObsBlock("OBS" , obs_size) - - with self.assertRaises(IndexError): - block[100] = (1,1) - - with self.assertRaises(IndexError): - block[-100] = (1,1) - - with self.assertRaises(TypeError): - block[4] = 10 - - with self.assertRaises(TypeError): - block[4] = (1,1,9) - - #------ - - with self.assertRaises(IndexError): - v = block[100] - - with self.assertRaises(IndexError): - v = block[-100] - - block[0] = (10,1) - v = block[0] - self.assertEqual( v , (10,1)) - self.assertEqual( 1 , block.activeSize()) - - block[-1] = (17,19) - self.assertEqual( block[-1], (17,19)) diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_obs_data.py b/ThirdParty/Ert/python/tests/ert/enkf/test_obs_data.py deleted file mode 100644 index def60a480f..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_obs_data.py +++ /dev/null @@ -1,53 +0,0 @@ -import datetime - -from ert.util import BoolVector , Matrix -from ert.test import TestAreaContext -from ert.test import ExtendedTestCase -from ert.enkf import ObsData , ObsBlock - - - - -class ObsDataTest(ExtendedTestCase): - - - def test_create(self): - obs_data = ObsData() - obs_size = 10 - block = obs_data.addBlock("OBS" , obs_size) - self.assertTrue( isinstance( block , ObsBlock )) - - block[0] = (100,10) - block[1] = (120,12) - D = obs_data.createDObs() - self.assertTrue( isinstance(D , Matrix )) - self.assertEqual( D.dims() , (2,2)) - - self.assertEqual( D[0,0] , 100 ) - self.assertEqual( D[1,0] , 120 ) - self.assertEqual( D[0,1] , 10 ) - self.assertEqual( D[1,1] , 12 ) - - obs_data.scaleMatrix( D ) - self.assertEqual( D[0,0] , 10 ) - self.assertEqual( D[1,0] , 10 ) - self.assertEqual( D[0,1] , 1 ) - self.assertEqual( D[1,1] , 1 ) - - R = obs_data.createR() - self.assertEqual( (2,2) , R.dims() ) - - with self.assertRaises(IndexError): - obs_data[10] - - v,s = obs_data[0] - self.assertEqual( v , 100 ) - self.assertEqual( s , 10 ) - - - v,s = obs_data[1] - self.assertEqual( v , 120 ) - self.assertEqual( s , 12 ) - - - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_runpath_list.py b/ThirdParty/Ert/python/tests/ert/enkf/test_runpath_list.py deleted file mode 100644 index 82bf08f609..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_runpath_list.py +++ /dev/null @@ -1,155 +0,0 @@ -from os import path, symlink, remove - -import ert - -from ert.test import ExtendedTestCase, TestAreaContext,ErtTestContext -from ert.enkf import RunpathList, RunpathNode -from ert.util import BoolVector - -class RunpathListTest(ExtendedTestCase): - - def test_runpath_list(self): - runpath_list = RunpathList('') - - self.assertEqual(len(runpath_list), 0) - - test_runpath_nodes = [RunpathNode(0, 0, "runpath0", "basename0"), RunpathNode(1, 0, "runpath1", "basename0")] - - runpath_node = test_runpath_nodes[0] - runpath_list.add(runpath_node.realization, runpath_node.iteration, runpath_node.runpath, runpath_node.basename) - - self.assertEqual(len(runpath_list), 1) - self.assertEqual(runpath_list[0], test_runpath_nodes[0]) - - runpath_node = test_runpath_nodes[1] - runpath_list.add(runpath_node.realization, runpath_node.iteration, runpath_node.runpath, runpath_node.basename) - - self.assertEqual(len(runpath_list), 2) - self.assertEqual(runpath_list[1], test_runpath_nodes[1]) - - for index, runpath_node in enumerate(runpath_list): - self.assertEqual(runpath_node, test_runpath_nodes[index]) - - - runpath_list.clear() - - self.assertEqual(len(runpath_list), 0) - - - def test_collection(self): - """Testing len, adding, getting (idx and slice), printing, clearing.""" - def path(idx): - return 'path_%d' % idx - def base(idx): - return 'base_%d' % idx - with TestAreaContext("runpath_list"): - runpath_list = RunpathList("EXPORT.txt") - runpath_list.add( 3 , 1 , path(3) , base(3) ) - runpath_list.add( 1 , 1 , path(1) , base(1) ) - runpath_list.add( 2 , 1 , path(2) , base(2) ) - runpath_list.add( 0 , 0 , path(0) , base(0) ) - runpath_list.add( 3 , 0 , path(3) , base(3) ) - runpath_list.add( 1 , 0 , path(1) , base(1) ) - runpath_list.add( 2 , 0 , path(2) , base(2) ) - runpath_list.add( 0 , 1 , path(0) , base(0) ) - - self.assertEqual(8, len(runpath_list)) - pfx = 'RunpathList(size' # the __repr__ function - self.assertEqual(pfx, repr(runpath_list)[:len(pfx)]) - node2 = RunpathNode(2, 1 , path(2), base(2)) - self.assertEqual(node2, runpath_list[2]) - - node3 = RunpathNode(0,0,path(0),base(0)) - node4 = RunpathNode(3,0,path(3),base(3)) - node5 = RunpathNode(1,0,path(1),base(1)) - node6 = RunpathNode(2,0,path(2),base(2)) - nodeslice = [node3, node4, node5, node6] - self.assertEqual(nodeslice, runpath_list[3:7]) - self.assertEqual(node6, runpath_list[-2]) - with self.assertRaises(TypeError): - runpath_list["key"] - with self.assertRaises(IndexError): - runpath_list[12] - - runpath_list.clear() - self.assertEqual(0, len(runpath_list)) - with self.assertRaises(IndexError): - runpath_list[0] - self.assertEqual('EXPORT.txt', runpath_list.getExportFile()) - - - def test_sorted_export(self): - with TestAreaContext("runpath_list"): - runpath_list = RunpathList("EXPORT.txt") - runpath_list.add( 3 , 1 , "path" , "base" ) - runpath_list.add( 1 , 1 , "path" , "base" ) - runpath_list.add( 2 , 1 , "path" , "base" ) - runpath_list.add( 0 , 0 , "path" , "base" ) - - runpath_list.add( 3 , 0 , "path" , "base" ) - runpath_list.add( 1 , 0 , "path" , "base" ) - runpath_list.add( 2 , 0 , "path" , "base" ) - runpath_list.add( 0 , 1 , "path" , "base" ) - - runpath_list.export( ) - - path_list = [] - with open("EXPORT.txt") as f: - for line in f.readlines(): - tmp = line.split() - iens = int(tmp[0]) - iteration = int(tmp[3]) - - path_list.append( (iens , iteration) ) - - for iens in range(4): - t0 = path_list[iens] - t4 = path_list[iens + 4] - self.assertEqual( t0[0] , iens ) - self.assertEqual( t4[0] , iens ) - - self.assertEqual( t0[1] , 0 ) - self.assertEqual( t4[1] , 1 ) - - - def test_assert_export(self): - with ErtTestContext("create_runpath1" , self.createTestPath("local/snake_oil_no_data/snake_oil.ert")) as tc: - ert = tc.getErt( ) - runpath_list = ert.getRunpathList( ) - self.assertFalse( path.isfile( runpath_list.getExportFile( ) )) - - ens_size = ert.getEnsembleSize( ) - runner = ert.getEnkfSimulationRunner( ) - mask = BoolVector( initial_size = ens_size , default_value = True ) - runner.createRunPath( mask , 0 ) - - self.assertTrue( path.isfile( runpath_list.getExportFile( ) )) - self.assertEqual( "test_runpath_list.txt" , path.basename( runpath_list.getExportFile( ) )) - - - - def test_assert_symlink_deleted(self): - with ErtTestContext("create_runpath2" , self.createTestPath("local/snake_oil_field/snake_oil.ert")) as tc: - ert = tc.getErt( ) - runpath_list = ert.getRunpathList( ) - - ens_size = ert.getEnsembleSize( ) - runner = ert.getEnkfSimulationRunner( ) - mask = BoolVector( initial_size = ens_size , default_value = True ) - - # create directory structure - runner.createRunPath( mask , 0 ) - - # replace field file with symlink - linkpath = '%s/permx.grdcel' % str(runpath_list[0].runpath) - targetpath = '%s/permx.grdcel.target' % str(runpath_list[0].runpath) - open(targetpath, 'a').close() - remove(linkpath) - symlink(targetpath, linkpath) - - # recreate directory structure - runner.createRunPath( mask , 0 ) - - # ensure field symlink is replaced by file - self.assertFalse( path.islink(linkpath) ) - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_state_map.py b/ThirdParty/Ert/python/tests/ert/enkf/test_state_map.py deleted file mode 100644 index e6d5c1cc5c..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_state_map.py +++ /dev/null @@ -1,105 +0,0 @@ -from ert.enkf.enums.realization_state_enum import RealizationStateEnum -from ert.enkf.state_map import StateMap -from ert.test import TestAreaContext -from ert.test import ExtendedTestCase - - -class StateMapTest(ExtendedTestCase): - - def test_state_map(self): - state_map = StateMap() - - self.assertEqual(len(state_map), 0) - - with self.assertRaises(TypeError): - r = state_map["r"] - - with self.assertRaises(IOError): - s2 = StateMap("DoesNotExist") - - with self.assertRaises(IOError): - state_map.load("/file/does/not/exist") - - with self.assertRaises(IndexError): - v = state_map[0] - - with self.assertRaises(TypeError): - state_map["r"] = RealizationStateEnum.STATE_INITIALIZED - - with self.assertRaises(TypeError): - state_map[0] = "INITIALIZED" - - with self.assertRaises(IndexError): - state_map[-1] = RealizationStateEnum.STATE_INITIALIZED - - - state_map[0] = RealizationStateEnum.STATE_INITIALIZED - - self.assertEqual(len(state_map), 1) - - state_map[1] = RealizationStateEnum.STATE_INITIALIZED - state_map[1] = RealizationStateEnum.STATE_HAS_DATA - - self.assertEqual(len(state_map), 2) - - index = 0 - for state in state_map: - self.assertEqual(state, state_map[index]) - index += 1 - - states = [state for state in state_map] - - self.assertEqual(states, [RealizationStateEnum.STATE_INITIALIZED, RealizationStateEnum.STATE_HAS_DATA]) - - - state_map[5] = RealizationStateEnum.STATE_INITIALIZED - self.assertEqual(len(state_map), 6) - - self.assertEqual(state_map[2], RealizationStateEnum.STATE_UNDEFINED) - self.assertEqual(state_map[3], RealizationStateEnum.STATE_UNDEFINED) - self.assertEqual(state_map[4], RealizationStateEnum.STATE_UNDEFINED) - self.assertEqual(state_map[5], RealizationStateEnum.STATE_INITIALIZED) - - self.assertFalse(state_map.isReadOnly()) - - with TestAreaContext("python/state-map/fwrite") as work_area: - state_map.save("MAP") - s2 = StateMap("MAP") - self.assertTrue( state_map == s2 ) - - - - def test_state_map_transitions(self): - self.assertTrue(StateMap.isLegalTransition(RealizationStateEnum.STATE_UNDEFINED, RealizationStateEnum.STATE_INITIALIZED)) - self.assertTrue(StateMap.isLegalTransition(RealizationStateEnum.STATE_INITIALIZED, RealizationStateEnum.STATE_HAS_DATA)) - self.assertTrue(StateMap.isLegalTransition(RealizationStateEnum.STATE_INITIALIZED, RealizationStateEnum.STATE_LOAD_FAILURE)) - self.assertTrue(StateMap.isLegalTransition(RealizationStateEnum.STATE_INITIALIZED, RealizationStateEnum.STATE_PARENT_FAILURE)) - self.assertTrue(StateMap.isLegalTransition(RealizationStateEnum.STATE_HAS_DATA, RealizationStateEnum.STATE_PARENT_FAILURE)) - - self.assertFalse(StateMap.isLegalTransition(RealizationStateEnum.STATE_UNDEFINED, RealizationStateEnum.STATE_LOAD_FAILURE)) - self.assertFalse(StateMap.isLegalTransition(RealizationStateEnum.STATE_UNDEFINED, RealizationStateEnum.STATE_HAS_DATA)) - - with self.assertRaises(TypeError): - StateMap.isLegalTransition("error", RealizationStateEnum.STATE_UNDEFINED) - - with self.assertRaises(TypeError): - StateMap.isLegalTransition(RealizationStateEnum.STATE_UNDEFINED, "error") - - with self.assertRaises(TypeError): - StateMap.isLegalTransition("error", "exception") - - - def test_active_list(self): - state_map = StateMap() - state_map[0] = RealizationStateEnum.STATE_INITIALIZED - state_map[2] = RealizationStateEnum.STATE_INITIALIZED - state_map[2] = RealizationStateEnum.STATE_HAS_DATA - - initialized = state_map.realizationList( RealizationStateEnum.STATE_INITIALIZED ) - self.assertEqual( len(initialized) , 1 ) - self.assertEqual( initialized[0] , 0 ) - - has_data = state_map.realizationList( RealizationStateEnum.STATE_HAS_DATA ) - self.assertEqual( len(has_data) , 1 ) - self.assertEqual( has_data[0] , 2) - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_summary_key_matcher.py b/ThirdParty/Ert/python/tests/ert/enkf/test_summary_key_matcher.py deleted file mode 100644 index fcd783fdc3..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_summary_key_matcher.py +++ /dev/null @@ -1,28 +0,0 @@ -from ert.enkf import SummaryKeyMatcher -from ert.test import ExtendedTestCase - -class SummaryKeyMatcherTest(ExtendedTestCase): - - def test_creation(self): - matcher = SummaryKeyMatcher() - - self.assertTrue(len(matcher) == 0) - - matcher.addSummaryKey("F*") - self.assertTrue(len(matcher) == 1) - - matcher.addSummaryKey("F*") - self.assertTrue(len(matcher) == 1) - - matcher.addSummaryKey("FOPT") - self.assertTrue(len(matcher) == 2) - - self.assertItemsEqual(["F*", "FOPT"], matcher.keys()) - - self.assertTrue("FGIR" in matcher) - self.assertTrue("FOPT" in matcher) - self.assertFalse("TCPU" in matcher) - - self.assertTrue(matcher.isRequired("FOPT")) - self.assertFalse(matcher.isRequired("FGIR")) - self.assertFalse(matcher.isRequired("TCPU")) \ No newline at end of file diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_summary_key_set.py b/ThirdParty/Ert/python/tests/ert/enkf/test_summary_key_set.py deleted file mode 100644 index 4c3a44e9ee..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_summary_key_set.py +++ /dev/null @@ -1,99 +0,0 @@ -import os -from ert.enkf import SummaryKeySet -from ert.enkf.enkf_fs import EnkfFs -from ert.enkf.enkf_main import EnKFMain -from ert.test import ExtendedTestCase -from ert.test.ert_test_context import ErtTestContext -from ert.test.test_area import TestAreaContext - - -class SummaryKeySetTest(ExtendedTestCase): - - def test_creation(self): - - keys = SummaryKeySet() - - self.assertEqual(len(keys), 0) - - self.assertTrue(keys.addSummaryKey("FOPT")) - - self.assertEqual(len(keys), 1) - - self.assertTrue("FOPT" in keys) - - self.assertItemsEqual(["FOPT"], keys.keys()) - - self.assertTrue(keys.addSummaryKey("WWCT")) - - self.assertEqual(len(keys), 2) - - self.assertTrue("WWCT" in keys) - - self.assertItemsEqual(["WWCT", "FOPT"], keys.keys()) - - - - def test_read_only_creation(self): - with TestAreaContext("enkf/summary_key_set/read_only_write_test"): - keys = SummaryKeySet() - - keys.addSummaryKey("FOPT") - keys.addSummaryKey("WWCT") - - filename = "test.txt" - keys.writeToFile(filename) - - keys_from_file = SummaryKeySet(filename, read_only=True) - self.assertItemsEqual(keys.keys(), keys_from_file.keys()) - - self.assertTrue(keys_from_file.isReadOnly()) - self.assertFalse(keys_from_file.addSummaryKey("WOPR")) - - - def test_write_to_and_read_from_file(self): - with TestAreaContext("enkf/summary_key_set/write_test"): - keys = SummaryKeySet() - - keys.addSummaryKey("FOPT") - keys.addSummaryKey("WWCT") - - filename = "test.txt" - - self.assertFalse(os.path.exists(filename)) - - keys.writeToFile(filename) - - self.assertTrue(os.path.exists(filename)) - - keys_from_file = SummaryKeySet(filename) - self.assertItemsEqual(keys.keys(), keys_from_file.keys()) - - - def test_with_enkf_fs(self): - config_file = self.createTestPath("Statoil/config/with_data/config") - - with TestAreaContext("enkf/summary_key_set/enkf_fs", store_area=True) as context: - context.copy_parent_content(config_file) - - fs = EnkfFs("storage/default") - summary_key_set = fs.getSummaryKeySet() - summary_key_set.addSummaryKey("FOPT") - summary_key_set.addSummaryKey("WWCT") - summary_key_set.addSummaryKey("WOPR") - fs.umount() - - ert = EnKFMain("config") - fs = ert.getEnkfFsManager().getCurrentFileSystem() - summary_key_set = fs.getSummaryKeySet() - self.assertTrue("FOPT" in summary_key_set) - self.assertTrue("WWCT" in summary_key_set) - self.assertTrue("WOPR" in summary_key_set) - - ensemble_config = ert.ensembleConfig() - - self.assertTrue("FOPT" in ensemble_config) - self.assertTrue("WWCT" in ensemble_config) - self.assertTrue("WOPR" in ensemble_config) - self.assertFalse("TCPU" in ensemble_config) - - diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_summary_obs.py b/ThirdParty/Ert/python/tests/ert/enkf/test_summary_obs.py deleted file mode 100644 index 981ce73f91..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_summary_obs.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (C) 2015 Statoil ASA, Norway. -# -# The file 'test_summary_obs.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -import os - -from ert.enkf import SummaryObservation -from ert.enkf import ActiveList -from ert.test import ExtendedTestCase - - - -class SummaryObsTest(ExtendedTestCase): - - def test_create(self): - sum_obs = SummaryObservation("WWCT:OP_X" , "WWCT:OP_X" , 0.25 , 0.12) - - self.assertEqual( sum_obs.getValue() , 0.25 ) - self.assertEqual( sum_obs.getStandardDeviation() , 0.12 ) - self.assertEqual( sum_obs.getStdScaling() , 1.0 ) - - - def test_std_scaling(self): - sum_obs = SummaryObservation("WWCT:OP_X" , "WWCT:OP_X" , 0.25 , 0.12) - - active_list = ActiveList() - sum_obs.updateStdScaling(0.50 , active_list) - sum_obs.updateStdScaling(0.125 , active_list) - self.assertEqual( sum_obs.getStdScaling() , 0.125 ) diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_time_map.py b/ThirdParty/Ert/python/tests/ert/enkf/test_time_map.py deleted file mode 100644 index 12706efc99..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_time_map.py +++ /dev/null @@ -1,184 +0,0 @@ -import datetime - -from ert.enkf.enums.realization_state_enum import RealizationStateEnum -from ert.enkf import TimeMap -from ert.test import TestAreaContext -from ert.test import ExtendedTestCase - - -class TimeMapTest(ExtendedTestCase): - - def test_time_map(self): - with self.assertRaises(IOError): - TimeMap("Does/not/exist") - - - tm = TimeMap() - with self.assertRaises(IndexError): - t = tm[10] - - pfx = 'TimeMap(' - rep = repr(tm) - print('repr(time_map) = "%s"' % repr(tm)) - self.assertEqual(pfx, rep[:len(pfx)]) - - self.assertTrue( tm.update(0 , datetime.date(2000 , 1, 1))) - self.assertEqual( tm[0] , datetime.date(2000 , 1, 1)) - - self.assertTrue( tm.isStrict() ) - with self.assertRaises(Exception): - tm.update(tm.update(0 , datetime.date(2000 , 1, 2))) - - tm.setStrict( False ) - self.assertFalse(tm.update(0 , datetime.date(2000 , 1, 2))) - - tm.setStrict( True ) - self.assertTrue( tm.update( 1 , datetime.date(2000 , 1, 2))) - d = tm.dump() - self.assertEqual( d , [(0 , datetime.date(2000,1,1) , 0), - (1 , datetime.date(2000,1,2) , 1)]) - - - def test_fscanf(self): - tm = TimeMap() - - with self.assertRaises(IOError): - tm.fload( "Does/not/exist" ) - - with TestAreaContext("timemap/fload1") as work_area: - with open("map.txt","w") as fileH: - fileH.write("10/10/2000\n") - fileH.write("12/10/2000\n") - fileH.write("14/10/2000\n") - fileH.write("16/10/2000\n") - - tm.fload("map.txt") - self.assertEqual( 4 , len(tm) ) - self.assertEqual( datetime.date(2000,10,10) , tm[0]) - self.assertEqual( datetime.date(2000,10,16) , tm[3]) - - with TestAreaContext("timemap/fload2") as work_area: - with open("map.txt","w") as fileH: - fileH.write("10/10/200X\n") - - with self.assertRaises(Exception): - tm.fload("map.txt") - - self.assertEqual( 4 , len(tm) ) - self.assertEqual( datetime.date(2000,10,10) , tm[0]) - self.assertEqual( datetime.date(2000,10,16) , tm[3]) - - - with TestAreaContext("timemap/fload2") as work_area: - with open("map.txt","w") as fileH: - fileH.write("12/10/2000\n") - fileH.write("10/10/2000\n") - - with self.assertRaises(Exception): - tm.fload("map.txt") - - self.assertEqual( 4 , len(tm) ) - self.assertEqual( datetime.date(2000,10,10) , tm[0]) - self.assertEqual( datetime.date(2000,10,16) , tm[3]) - - - def test_setitem(self): - tm = TimeMap() - tm[0] = datetime.date(2000,1,1) - tm[1] = datetime.date(2000,1,2) - self.assertEqual(2 , len(tm)) - - self.assertEqual( tm[0] , datetime.date(2000,1,1) ) - self.assertEqual( tm[1] , datetime.date(2000,1,2) ) - - - def test_in(self): - tm = TimeMap() - tm[0] = datetime.date(2000,1,1) - tm[1] = datetime.date(2000,1,2) - tm[2] = datetime.date(2000,1,3) - - self.assertTrue( datetime.date(2000,1,1) in tm ) - self.assertTrue( datetime.date(2000,1,2) in tm ) - self.assertTrue( datetime.date(2000,1,3) in tm ) - - self.assertFalse( datetime.date(2001,1,3) in tm ) - self.assertFalse( datetime.date(1999,1,3) in tm ) - - - def test_lookupDate(self): - tm = TimeMap() - tm[0] = datetime.date(2000,1,1) - tm[1] = datetime.date(2000,1,2) - tm[2] = datetime.date(2000,1,3) - - self.assertEqual( 0 , tm.lookupTime( datetime.date(2000,1,1))) - self.assertEqual( 0 , tm.lookupTime( datetime.datetime(2000,1,1,0,0,0))) - - self.assertEqual( 2 , tm.lookupTime( datetime.date(2000,1,3))) - self.assertEqual( 2 , tm.lookupTime( datetime.datetime(2000,1,3,0,0,0))) - - with self.assertRaises(ValueError): - tm.lookupTime( datetime.date(1999,10,10)) - - - - def test_lookupDays(self): - tm = TimeMap() - - with self.assertRaises(ValueError): - tm.lookupDays( 0 ) - - tm[0] = datetime.date(2000,1,1) - tm[1] = datetime.date(2000,1,2) - tm[2] = datetime.date(2000,1,3) - - self.assertEqual( 0 , tm.lookupDays( 0 )) - self.assertEqual( 1 , tm.lookupDays( 1 )) - self.assertEqual( 2 , tm.lookupDays( 2 )) - - with self.assertRaises(ValueError): - tm.lookupDays( -1 ) - - with self.assertRaises(ValueError): - tm.lookupDays( 0.50 ) - - with self.assertRaises(ValueError): - tm.lookupDays( 3 ) - - - - def test_nearest_date_lookup(self): - tm = TimeMap() - with self.assertRaises(ValueError): - tm.lookupTime(datetime.date( 1999 , 1 , 1)) - - with self.assertRaises(ValueError): - tm.lookupTime(datetime.date( 1999 , 1 , 1) , tolerance_seconds_before = 10 , tolerance_seconds_after = 10) - - tm[0] = datetime.date(2000,1,1) - tm[1] = datetime.date(2000,2,1) - tm[2] = datetime.date(2000,3,1) - - # Outside of total range will raise an exception, irrespective of - # the tolerances used. - with self.assertRaises(ValueError): - tm.lookupTime(datetime.date( 1999 , 1 , 1) , tolerance_seconds_before = -1 , tolerance_seconds_after = -1) - - with self.assertRaises(ValueError): - tm.lookupTime(datetime.date( 2001 , 1 , 1) , tolerance_seconds_before = -1 , tolerance_seconds_after = -1) - - self.assertEqual(0 , tm.lookupTime( datetime.datetime(2000 , 1 , 1 , 0 , 0 , 10) , tolerance_seconds_after = 15)) - self.assertEqual(1 , tm.lookupTime( datetime.datetime(2000 , 1 , 1 , 0 , 0 , 10) , tolerance_seconds_before = 3600*24*40)) - - self.assertEqual(0 , tm.lookupTime( datetime.date( 2000 , 1 , 10) , tolerance_seconds_before = -1 , tolerance_seconds_after = -1)) - self.assertEqual(1 , tm.lookupTime( datetime.date( 2000 , 1 , 20) , tolerance_seconds_before = -1 , tolerance_seconds_after = -1)) - - with self.assertRaises(ValueError): - tm.lookupTime(datetime.date( 2001 , 10 , 1) , tolerance_seconds_before = 10 , tolerance_seconds_after = 10) - - - def test_empty(self): - tm = TimeMap() - last_step = tm.getLastStep( ) - self.assertEqual( last_step , -1 ) diff --git a/ThirdParty/Ert/python/tests/ert/enkf/test_update.py b/ThirdParty/Ert/python/tests/ert/enkf/test_update.py deleted file mode 100644 index 757084be40..0000000000 --- a/ThirdParty/Ert/python/tests/ert/enkf/test_update.py +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright (C) 2015 Statoil ASA, Norway. -# -# The file 'test_update.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -import random - -import ert -from ert.test import ExtendedTestCase, ErtTestContext -from ert.util.enums import RngAlgTypeEnum, RngInitModeEnum -from ert.util import Matrix, BoolVector , RandomNumberGenerator -from ert.analysis import AnalysisModule, AnalysisModuleLoadStatusEnum, AnalysisModuleOptionsEnum -from ert.enkf import MeasData , ObsData , LocalObsdata - - - - -def update(rng , mask , module , ert , meas_data , obs_data , state_size): - S = meas_data.createS() - R = obs_data.createR() - dObs = obs_data.createDObs() - E = obs_data.createE( rng , meas_data.getActiveEnsSize() ) - D = obs_data.createD(E , S) - obs_data.scale(S , E = E , D = D , R = R , D_obs = dObs) - - A = Matrix(state_size , meas_data.getActiveEnsSize()) - A.randomInit( rng ) - - module.initUpdate( mask , S , R , dObs , E , D ) - module.updateA( A , S , R , dObs , E , D ) - - - - -class UpdateTest(ExtendedTestCase): - def setUp(self): - self.libname = ert.ert_lib_path + "/rml_enkf.so" - self.config_file = self.createTestPath("Statoil/config/obs_testing2/config") - self.rng = RandomNumberGenerator(RngAlgTypeEnum.MZRAN, RngInitModeEnum.INIT_DEFAULT) - - - def createAnalysisModule(self): - return AnalysisModule(self.rng, lib_name = self.libname) - - - def test_it(self): - state_size = 10 - with ErtTestContext("update" , self.config_file) as tc: - analysis = self.createAnalysisModule() - ert = tc.getErt() - obs = ert.getObservations() - local_obsdata = obs.getAllActiveLocalObsdata( ) - - fs = ert.getEnkfFsManager().getCurrentFileSystem() - - - mask = BoolVector( initial_size = ert.getEnsembleSize() , default_value = True) - meas_data = MeasData(mask) - obs_data = ObsData() - obs.getObservationAndMeasureData( fs , local_obsdata , mask.createActiveList() , meas_data , obs_data ) - update( self.rng , mask , analysis , ert , meas_data , obs_data , state_size) - - - mask[0] = False - mask[4] = False - meas_data = MeasData(mask) - obs_data = ObsData() - obs.getObservationAndMeasureData( fs , local_obsdata , mask.createActiveList() , meas_data , obs_data ) - update( self.rng , mask , analysis , ert , meas_data , obs_data , state_size) - - diff --git a/ThirdParty/Ert/python/tests/ert/job_queue/CMakeLists.txt b/ThirdParty/Ert/python/tests/ert/job_queue/CMakeLists.txt deleted file mode 100644 index d7dcab80dc..0000000000 --- a/ThirdParty/Ert/python/tests/ert/job_queue/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -set(TEST_SOURCES - __init__.py - test_ert_plugin.py - test_ert_script.py - test_ext_job.py - test_function_ert_script.py - test_job_queue.py - test_workflow.py - test_workflow_job.py - test_workflow_joblist.py - test_workflow_runner.py - workflow_common.py -) - -add_python_package("python.tests.ert.job_queue" ${PYTHON_INSTALL_PREFIX}/tests/ert/job_queue "${TEST_SOURCES}" False) - -addPythonTest(ert.job_queue.job_status_type_enum tests.ert.job_queue.test_job_queue.JobQueueTest) -addPythonTest(ert.job_queue.workflow_job tests.ert.job_queue.test_workflow_job.WorkflowJobTest) -addPythonTest(ert.job_queue.workflow tests.ert.job_queue.test_workflow.WorkflowTest) -addPythonTest(ert.job_queue.workflow_joblist tests.ert.job_queue.test_workflow_joblist.WorkflowJoblistTest) -addPythonTest(ert.job_queue.ert_plugin tests.ert.job_queue.test_ert_plugin.ErtPluginTest) -addPythonTest(ert.job_queue.ert_script tests.ert.job_queue.test_ert_script.ErtScriptTest) -addPythonTest(ert.job_queue.function_ert_script tests.ert.job_queue.test_function_ert_script.FunctionErtScriptTest) -addPythonTest(ert.job_queue.workflow_runner tests.ert.job_queue.test_workflow_runner.WorkflowRunnerTest) -addPythonTest(ert.job_queue.ext_job tests.ert.job_queue.test_ext_job.ExtJobTest) \ No newline at end of file diff --git a/ThirdParty/Ert/python/tests/ert/job_queue/__init__.py b/ThirdParty/Ert/python/tests/ert/job_queue/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/python/tests/ert/job_queue/test_ert_plugin.py b/ThirdParty/Ert/python/tests/ert/job_queue/test_ert_plugin.py deleted file mode 100644 index 96fbef4fd7..0000000000 --- a/ThirdParty/Ert/python/tests/ert/job_queue/test_ert_plugin.py +++ /dev/null @@ -1,86 +0,0 @@ -from ert.enkf import ErtPlugin, CancelPluginException -from ert.test.extended_testcase import ExtendedTestCase - - -class SimplePlugin(ErtPlugin): - def run(self, parameter1, parameter2): - assert parameter1 == "one" - assert parameter2 == 2 - - def getArguments(self, parent=None): - return ["one", 2] - - -class FullPlugin(ErtPlugin): - def getName(self): - return "FullPlugin" - - def getDescription(self): - return "Fully described!" - - def run(self, arg1, arg2, arg3=None): - assert arg1 == 5 - assert arg2 == "No" - assert arg3 is None - - def getArguments(self, parent=None): - return [5, "No"] - - -class CanceledPlugin(ErtPlugin): - def run(self, arg1): - pass - - def getArguments(self, parent=None): - raise CancelPluginException("Cancel test!") - -# class GUIPlugin(ErtPlugin): -# def getArguments(self, parent=None): -# value1 = QInputDialog.getInt(parent, "Enter a number!", "Enter a nice number (nothing else than 5):", value=0, min=0, max=10) -# value2 = QInputDialog.getInt(parent, "Enter a number!", "Enter a nice number (nothing else than 6):", value=0, min=0, max=10) -# print(value1, value2) -# return [value1[0], value2[0]] -# -# def run(self, arg1, arg2, arg3=None): -# assert arg1 == 5 -# assert arg2 == 6 - - -class ErtPluginTest(ExtendedTestCase): - - def test_simple_ert_plugin(self): - - simple_plugin = SimplePlugin("ert") - - arguments = simple_plugin.getArguments() - - self.assertTrue("SimplePlugin" in simple_plugin.getName()) - self.assertEqual("No description provided!", simple_plugin.getDescription()) - - simple_plugin.initializeAndRun([str, int], arguments) - - - def test_full_ert_plugin(self): - plugin = FullPlugin("ert") - - self.assertEqual(plugin.getName(), "FullPlugin") - self.assertEqual(plugin.getDescription(), "Fully described!") - - arguments = plugin.getArguments() - - plugin.initializeAndRun([int, str, float], arguments) - - - def test_cancel_plugin(self): - plugin = CanceledPlugin("ert") - - with self.assertRaises(CancelPluginException): - plugin.getArguments() - - # def test_gui_ert_plugin(self): - # app = QApplication([]) - # plugin = GUIPlugin("ert") - # - # arguments = plugin.getArguments() - # plugin.initializeAndRun([int, int], arguments) - diff --git a/ThirdParty/Ert/python/tests/ert/job_queue/test_ert_script.py b/ThirdParty/Ert/python/tests/ert/job_queue/test_ert_script.py deleted file mode 100644 index 5b99e414df..0000000000 --- a/ThirdParty/Ert/python/tests/ert/job_queue/test_ert_script.py +++ /dev/null @@ -1,82 +0,0 @@ -from ert.job_queue import ErtScript -from ert.test import TestAreaContext, ExtendedTestCase -from .workflow_common import WorkflowCommon - - -class ReturnErtScript(ErtScript): - def run(self): - return self.ert() - -class AddScript(ErtScript): - def run(self, arg1, arg2): - return arg1 + arg2 - -class FailScript(ErtScript): - def rum(self): - pass - -class NoneScript(ErtScript): - def run(self, arg): - assert arg is None - - -class ErtScriptTest(ExtendedTestCase): - - @staticmethod - def createScripts(): - WorkflowCommon.createErtScriptsJob() - - with open("syntax_error_script.py", "w") as f: - f.write("from ert.enkf not_legal_syntax ErtScript\n") - - with open("import_error_script.py", "w") as f: - f.write("from ert.enkf import DoesNotExist\n") - - with open("empty_script.py", "w") as f: - f.write("from ert.enkf import ErtScript\n") - - - def test_ert_script_return_ert(self): - script = ReturnErtScript("ert") - result = script.initializeAndRun([], []) - self.assertEqual(result, "ert") - - - def test_ert_script_add(self): - script = AddScript("ert") - - result = script.initializeAndRun([int, int], ["5", "4"]) - - self.assertEqual(result, 9) - - with self.assertRaises(ValueError): - result = script.initializeAndRun([int, int], ["5", "4.6"]) - - - def test_ert_script_failed_implementation(self): - with self.assertRaises(UserWarning): - script = FailScript("ert") - - - def test_ert_script_from_file(self): - with TestAreaContext("python/job_queue/ert_script") as work_area: - ErtScriptTest.createScripts() - - script_object = ErtScript.loadScriptFromFile("subtract_script.py") - - script = script_object("ert") - result = script.initializeAndRun([int, int], ["1", "2"]) - self.assertEqual(result, -1) - - - # with self.assertRaises(ErtScriptError): - self.assertIsNone(ErtScript.loadScriptFromFile("syntax_error_script.py")) - self.assertIsNone(ErtScript.loadScriptFromFile("import_error_script.py")) - self.assertIsNone(ErtScript.loadScriptFromFile("empty_script.py")) - - - def test_none_ert_script(self): - #Check if None is not converted to string "None" - script = NoneScript("ert") - - script.initializeAndRun([str], [None]) diff --git a/ThirdParty/Ert/python/tests/ert/job_queue/test_ext_job.py b/ThirdParty/Ert/python/tests/ert/job_queue/test_ext_job.py deleted file mode 100644 index d6932d3316..0000000000 --- a/ThirdParty/Ert/python/tests/ert/job_queue/test_ext_job.py +++ /dev/null @@ -1,77 +0,0 @@ -import os.path - -from ert.test import TestAreaContext, ExtendedTestCase -from ert.job_queue.ext_job import ExtJob - - -def create_valid_config( config_file ): - with open(config_file , "w") as f: - f.write("EXECUTABLE script.sh\n") - - with open("script.sh" , "w") as f: - f.write("This is a script") - - -def create_config_missing_executable( config_file ): - with open(config_file , "w") as f: - f.write("EXECUTABLE missing_script.sh\n") - - -def create_config_missing_EXECUTABLE( config_file ): - with open(config_file , "w") as f: - f.write("EXECU missing_script.sh\n") - - -def create_config_executable_directory( config_file ): - with open(config_file , "w") as f: - f.write("EXECUTABLE /tmp\n") - - -def create_config_foreign_file( config_file ): - with open(config_file , "w") as f: - f.write("EXECUTABLE /etc/passwd\n") - - - - -class ExtJobTest(ExtendedTestCase): - def test_load_forward_model(self): - with self.assertRaises(IOError): - job = ExtJob("CONFIG_FILE" , True) - - with TestAreaContext("python/job_queue/forward_model1"): - create_valid_config("CONFIG") - job = ExtJob("CONFIG" , True) - self.assertEqual( job.name() , "CONFIG") - - self.assertEqual( job.get_executable() , os.path.join( os.getcwd() , "script.sh")) - self.assertTrue( os.access( job.get_executable() , os.X_OK )) - - - job = ExtJob("CONFIG" , True , name = "Job") - self.assertEqual( job.name() , "Job") - - - with TestAreaContext("python/job_queue/forward_model2"): - create_config_missing_executable( "CONFIG" ) - with self.assertRaises(ValueError): - job = ExtJob("CONFIG" , True) - - - with TestAreaContext("python/job_queue/forward_model3"): - create_config_missing_EXECUTABLE( "CONFIG" ) - with self.assertRaises(ValueError): - job = ExtJob("CONFIG" , True) - - - with TestAreaContext("python/job_queue/forward_model4"): - create_config_executable_directory( "CONFIG" ) - with self.assertRaises(ValueError): - job = ExtJob("CONFIG" , True) - - - with TestAreaContext("python/job_queue/forward_model5"): - create_config_foreign_file( "CONFIG" ) - with self.assertRaises(ValueError): - job = ExtJob("CONFIG" , True) - diff --git a/ThirdParty/Ert/python/tests/ert/job_queue/test_function_ert_script.py b/ThirdParty/Ert/python/tests/ert/job_queue/test_function_ert_script.py deleted file mode 100644 index 4098c99487..0000000000 --- a/ThirdParty/Ert/python/tests/ert/job_queue/test_function_ert_script.py +++ /dev/null @@ -1,27 +0,0 @@ -from cwrap import clib -from ert.test import ExtendedTestCase, TestAreaContext -from ert.job_queue import WorkflowJob -from .workflow_common import WorkflowCommon - -class FunctionErtScriptTest(ExtendedTestCase): - - def test_compare(self): - with TestAreaContext("python/job_queue/workflow_job") as work_area: - WorkflowCommon.createInternalFunctionJob() - - parser = WorkflowJob.configParser( ) - with self.assertRaises(IOError): - workflow_job = WorkflowJob.fromFile("no/such/file") - - workflow_job = WorkflowJob.fromFile("compare_job", name = "COMPARE", parser = parser) - self.assertEqual( workflow_job.name() , "COMPARE") - - result = workflow_job.run(None , ["String", "string"]) - self.assertNotEqual(result, 0) - - result = workflow_job.run(None, ["String", "String"]) - # result is returned as c_void_p -> automatic conversion to None if value is 0 - self.assertIsNone(result) - - workflow_job = WorkflowJob.fromFile("compare_job") - self.assertEqual( workflow_job.name() , "compare_job") diff --git a/ThirdParty/Ert/python/tests/ert/job_queue/test_job_queue.py b/ThirdParty/Ert/python/tests/ert/job_queue/test_job_queue.py deleted file mode 100644 index 6cacb1bf61..0000000000 --- a/ThirdParty/Ert/python/tests/ert/job_queue/test_job_queue.py +++ /dev/null @@ -1,11 +0,0 @@ -from ert.job_queue import JobStatusType -from ert.test import ExtendedTestCase - - -class JobQueueTest(ExtendedTestCase): - - def testStatusEnum(self): - source_path = "libjob_queue/include/ert/job_queue/queue_driver.h" - self.assertEnumIsFullyDefined(JobStatusType, "job_status_type", source_path) - - diff --git a/ThirdParty/Ert/python/tests/ert/job_queue/test_workflow.py b/ThirdParty/Ert/python/tests/ert/job_queue/test_workflow.py deleted file mode 100644 index a21228fc30..0000000000 --- a/ThirdParty/Ert/python/tests/ert/job_queue/test_workflow.py +++ /dev/null @@ -1,56 +0,0 @@ -from ert.job_queue import Workflow, WorkflowJoblist -from ert.test import ExtendedTestCase, TestAreaContext -from ert.util import SubstitutionList -from .workflow_common import WorkflowCommon - - -class WorkflowTest(ExtendedTestCase): - - def test_workflow(self): - with TestAreaContext("python/job_queue/workflow") as work_area: - WorkflowCommon.createExternalDumpJob() - - joblist = WorkflowJoblist() - self.assertTrue(joblist.addJobFromFile("DUMP", "dump_job")) - - with self.assertRaises(UserWarning): - joblist.addJobFromFile("KNOCK", "knock_job") - - self.assertTrue("DUMP" in joblist) - - - workflow = Workflow("dump_workflow", joblist) - - self.assertEqual(len(workflow), 2) - - job, args = workflow[0] - self.assertEqual(job, joblist["DUMP"]) - self.assertEqual(args[0], "dump1") - self.assertEqual(args[1], "dump_text_1") - - job, args = workflow[1] - self.assertEqual(job, joblist["DUMP"]) - - - def test_workflow_run(self): - with TestAreaContext("python/job_queue/workflow") as work_area: - WorkflowCommon.createExternalDumpJob() - - joblist = WorkflowJoblist() - self.assertTrue(joblist.addJobFromFile("DUMP", "dump_job")) - self.assertTrue("DUMP" in joblist) - - workflow = Workflow("dump_workflow", joblist) - - self.assertTrue(len(workflow), 2) - - context = SubstitutionList() - context.addItem("", "text") - - self.assertTrue(workflow.run(None, verbose=True, context=context)) - - with open("dump1", "r") as f: - self.assertEqual(f.read(), "dump_text_1") - - with open("dump2", "r") as f: - self.assertEqual(f.read(), "dump_text_2") diff --git a/ThirdParty/Ert/python/tests/ert/job_queue/test_workflow_job.py b/ThirdParty/Ert/python/tests/ert/job_queue/test_workflow_job.py deleted file mode 100644 index de2cbe6ea3..0000000000 --- a/ThirdParty/Ert/python/tests/ert/job_queue/test_workflow_job.py +++ /dev/null @@ -1,101 +0,0 @@ -import ert - -from ert.job_queue import WorkflowJob -from ert.test import TestAreaContext, ExtendedTestCase -from .workflow_common import WorkflowCommon - -from cwrap import Prototype - -class _TestWorkflowJobPrototype(Prototype): - lib = ert.load('libjob_queue') - - def __init__(self, prototype, bind=True): - super(_TestWorkflowJobPrototype, self).__init__(_TestWorkflowJobPrototype.lib, prototype, bind=bind) - -class WorkflowJobTest(ExtendedTestCase): - _alloc_config = _TestWorkflowJobPrototype("void* workflow_job_alloc_config()", bind = False) - _alloc_from_file = _TestWorkflowJobPrototype("workflow_job_obj workflow_job_config_alloc(char*, void*, char*)", bind = False) - - - def test_workflow_job_creation(self): - workflow_job = WorkflowJob("Test") - - self.assertTrue(workflow_job.isInternal()) - self.assertEqual(workflow_job.name(), "Test") - - - def test_read_internal_function(self): - with TestAreaContext("python/job_queue/workflow_job") as work_area: - WorkflowCommon.createInternalFunctionJob() - WorkflowCommon.createErtScriptsJob() - - config = self._alloc_config() - workflow_job = self._alloc_from_file("SELECT_CASE", config, "select_case_job") - - self.assertEqual(workflow_job.name(), "SELECT_CASE") - self.assertTrue(workflow_job.isInternal()) - self.assertEqual(workflow_job.functionName(), "enkf_main_select_case_JOB") - - self.assertFalse(workflow_job.isInternalScript()) - self.assertIsNone(workflow_job.getInternalScriptPath()) - - - workflow_job = self._alloc_from_file("SUBTRACT", config, "subtract_script_job") - self.assertEqual(workflow_job.name(), "SUBTRACT") - self.assertTrue(workflow_job.isInternal()) - self.assertIsNone(workflow_job.functionName()) - - self.assertTrue(workflow_job.isInternalScript()) - self.assertTrue(workflow_job.getInternalScriptPath().endswith("subtract_script.py")) - - - - def test_arguments(self): - with TestAreaContext("python/job_queue/workflow_job") as work_area: - WorkflowCommon.createInternalFunctionJob() - - config = self._alloc_config() - job = self._alloc_from_file("PRINTF", config, "printf_job") - - self.assertEqual(job.minimumArgumentCount(), 4) - self.assertEqual(job.maximumArgumentCount(), 5) - self.assertEqual(job.argumentTypes(), [str, int, float, bool, str]) - - self.assertTrue(job.run(None, ["x %d %f %d", 1, 2.5, True])) - self.assertTrue(job.run(None, ["x %d %f %d %s", 1, 2.5, True, "y"])) - - with self.assertRaises(UserWarning): # Too few arguments - job.run(None, ["x %d %f", 1, 2.5]) - - with self.assertRaises(UserWarning): # Too many arguments - job.run(None, ["x %d %f %d %s", 1, 2.5, True, "y", "nada"]) - - - def test_run_external_job(self): - - with TestAreaContext("python/job_queue/workflow_job") as work_area: - WorkflowCommon.createExternalDumpJob() - - config = self._alloc_config() - job = self._alloc_from_file("DUMP", config, "dump_job") - - self.assertFalse(job.isInternal()) - argTypes = job.argumentTypes() - self.assertEqual( argTypes , [str , str] ) - self.assertIsNone(job.run(None, ["test", "text"])) - - with open("test", "r") as f: - self.assertEqual(f.read(), "text") - - - def test_run_internal_script(self): - with TestAreaContext("python/job_queue/workflow_job") as work_area: - WorkflowCommon.createErtScriptsJob() - - config = self._alloc_config() - job = self._alloc_from_file("SUBTRACT", config, "subtract_script_job") - - result = job.run(None, ["1", "2"]) - - self.assertEqual(result, -1) - diff --git a/ThirdParty/Ert/python/tests/ert/job_queue/test_workflow_joblist.py b/ThirdParty/Ert/python/tests/ert/job_queue/test_workflow_joblist.py deleted file mode 100644 index a8a8a83db1..0000000000 --- a/ThirdParty/Ert/python/tests/ert/job_queue/test_workflow_joblist.py +++ /dev/null @@ -1,42 +0,0 @@ -from ert.job_queue import WorkflowJoblist, WorkflowJob -from ert.test import ExtendedTestCase, TestAreaContext -from .workflow_common import WorkflowCommon - - -class WorkflowJoblistTest(ExtendedTestCase): - - def test_workflow_joblist_creation(self): - joblist = WorkflowJoblist() - - job = WorkflowJob("JOB1") - - joblist.addJob(job) - - self.assertTrue(job in joblist) - self.assertTrue("JOB1" in joblist) - - job_ref = joblist["JOB1"] - - self.assertEqual(job.name(), job_ref.name()) - - - - def test_workflow_joblist_with_files(self): - with TestAreaContext("python/job_queue/workflow_joblist") as work_area: - WorkflowCommon.createErtScriptsJob() - WorkflowCommon.createExternalDumpJob() - WorkflowCommon.createInternalFunctionJob() - - joblist = WorkflowJoblist() - - joblist.addJobFromFile("DUMP_JOB", "dump_job") - joblist.addJobFromFile("SELECT_CASE_JOB", "select_case_job") - joblist.addJobFromFile("SUBTRACT_SCRIPT_JOB", "subtract_script_job") - - self.assertTrue("DUMP_JOB" in joblist) - self.assertTrue("SELECT_CASE_JOB" in joblist) - self.assertTrue("SUBTRACT_SCRIPT_JOB" in joblist) - - self.assertFalse((joblist["DUMP_JOB"]).isInternal()) - self.assertTrue((joblist["SELECT_CASE_JOB"]).isInternal()) - self.assertTrue((joblist["SUBTRACT_SCRIPT_JOB"]).isInternal()) diff --git a/ThirdParty/Ert/python/tests/ert/job_queue/test_workflow_runner.py b/ThirdParty/Ert/python/tests/ert/job_queue/test_workflow_runner.py deleted file mode 100644 index e45a084ed1..0000000000 --- a/ThirdParty/Ert/python/tests/ert/job_queue/test_workflow_runner.py +++ /dev/null @@ -1,128 +0,0 @@ -import os -import time -from ert.job_queue import WorkflowJoblist, Workflow, WorkflowRunner -from ert.test import TestAreaContext, ExtendedTestCase -from ert.util.substitution_list import SubstitutionList -from .workflow_common import WorkflowCommon - - -class WorkflowRunnerTest(ExtendedTestCase): - - def test_workflow_thread_cancel_ert_script(self): - with TestAreaContext("python/job_queue/workflow_runner_ert_script") as work_area: - WorkflowCommon.createWaitJob() - - joblist = WorkflowJoblist() - self.assertTrue(joblist.addJobFromFile("WAIT", "wait_job")) - self.assertTrue("WAIT" in joblist) - - workflow = Workflow("wait_workflow", joblist) - - self.assertEqual(len(workflow), 3) - - - workflow_runner = WorkflowRunner(workflow) - - self.assertFalse(workflow_runner.isRunning()) - - workflow_runner.run() - - self.assertIsNone(workflow_runner.workflowResult()) - - time.sleep(1) # wait for workflow to start - self.assertTrue(workflow_runner.isRunning()) - self.assertFileExists("wait_started_0") - - time.sleep(1) # wait for first job to finish - - workflow_runner.cancel() - time.sleep(1) # wait for cancel to take effect - self.assertFileExists("wait_finished_0") - - - self.assertFileExists("wait_started_1") - self.assertFileExists("wait_cancelled_1") - self.assertFileDoesNotExist("wait_finished_1") - - self.assertTrue(workflow_runner.isCancelled()) - - workflow_runner.wait() # wait for runner to complete - - self.assertFileDoesNotExist("wait_started_2") - self.assertFileDoesNotExist("wait_cancelled_2") - self.assertFileDoesNotExist("wait_finished_2") - - - - - def test_workflow_thread_cancel_external(self): - with TestAreaContext("python/job_queue/workflow_runner_external") as work_area: - WorkflowCommon.createWaitJob() - - joblist = WorkflowJoblist() - self.assertTrue(joblist.addJobFromFile("WAIT", "external_wait_job")) - self.assertTrue("WAIT" in joblist) - - workflow = Workflow("wait_workflow", joblist) - - self.assertEqual(len(workflow), 3) - - - workflow_runner = WorkflowRunner(workflow, ert=None, context=SubstitutionList()) - - self.assertFalse(workflow_runner.isRunning()) - - workflow_runner.run() - - time.sleep(1) # wait for workflow to start - self.assertTrue(workflow_runner.isRunning()) - self.assertFileExists("wait_started_0") - - time.sleep(1) # wait for first job to finish - - workflow_runner.cancel() - time.sleep(1) # wait for cancel to take effect - self.assertFileExists("wait_finished_0") - - self.assertFileExists("wait_started_1") - self.assertFileDoesNotExist("wait_finished_1") - - self.assertTrue(workflow_runner.isCancelled()) - - workflow_runner.wait() # wait for runner to complete - - self.assertFileDoesNotExist("wait_started_2") - self.assertFileDoesNotExist("wait_cancelled_2") - self.assertFileDoesNotExist("wait_finished_2") - - - def test_workflow_success(self): - with TestAreaContext("python/job_queue/workflow_runner_fast") as work_area: - WorkflowCommon.createWaitJob() - - joblist = WorkflowJoblist() - self.assertTrue(joblist.addJobFromFile("WAIT", "wait_job")) - self.assertTrue(joblist.addJobFromFile("EXTERNAL_WAIT", "external_wait_job")) - - workflow = Workflow("fast_wait_workflow", joblist) - - self.assertEqual(len(workflow), 2) - - - workflow_runner = WorkflowRunner(workflow, ert=None, context=SubstitutionList()) - - self.assertFalse(workflow_runner.isRunning()) - - workflow_runner.run() - time.sleep(1) # wait for workflow to start - workflow_runner.wait() - - self.assertFileExists("wait_started_0") - self.assertFileDoesNotExist("wait_cancelled_0") - self.assertFileExists("wait_finished_0") - - self.assertFileExists("wait_started_1") - self.assertFileDoesNotExist("wait_cancelled_1") - self.assertFileExists("wait_finished_1") - - self.assertTrue(workflow_runner.workflowResult()) diff --git a/ThirdParty/Ert/python/tests/ert/job_queue/workflow_common.py b/ThirdParty/Ert/python/tests/ert/job_queue/workflow_common.py deleted file mode 100644 index 564c934ebc..0000000000 --- a/ThirdParty/Ert/python/tests/ert/job_queue/workflow_common.py +++ /dev/null @@ -1,140 +0,0 @@ -import os -import stat - -class WorkflowCommon(object): - - @staticmethod - def createExternalDumpJob(): - with open("dump_job", "w") as f: - f.write("INTERNAL FALSE\n") - f.write("EXECUTABLE dump.py\n") - f.write("MIN_ARG 2\n") - f.write("MAX_ARG 2\n") - f.write("ARG_TYPE 0 STRING\n") - - - with open("dump.py", "w") as f: - f.write("#!/usr/bin/env python\n") - f.write("import sys\n") - f.write("f = open('%s' % sys.argv[1], 'w')\n") - f.write("f.write('%s' % sys.argv[2])\n") - f.write("f.close()\n") - - st = os.stat("dump.py") - os.chmod("dump.py", st.st_mode | stat.S_IEXEC) # | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH - - with open("dump_workflow", "w") as f: - f.write("DUMP dump1 dump_text_1\n") - f.write("DUMP dump2 dump__2\n") - - - @staticmethod - def createInternalFunctionJob(): - with open("select_case_job", "w") as f: - f.write("INTERNAL True\n") - f.write("FUNCTION enkf_main_select_case_JOB\n") - f.write("MIN_ARG 1\n") - f.write("MAX_ARG 1\n") - f.write("ARG_TYPE 0 STRING\n") - - with open("printf_job", "w") as f: - f.write("INTERNAL True\n") - f.write("FUNCTION printf\n") - f.write("MIN_ARG 4\n") - f.write("MAX_ARG 5\n") - f.write("ARG_TYPE 0 STRING\n") - f.write("ARG_TYPE 1 INT\n") - f.write("ARG_TYPE 2 FLOAT\n") - f.write("ARG_TYPE 3 BOOL\n") - f.write("ARG_TYPE 4 STRING\n") - - - with open("compare_job", "w") as f: - f.write("INTERNAL True\n") - f.write("FUNCTION strcmp\n") - f.write("MIN_ARG 2\n") - f.write("MAX_ARG 2\n") - f.write("ARG_TYPE 0 STRING\n") - f.write("ARG_TYPE 1 STRING\n") - - - @staticmethod - def createErtScriptsJob(): - with open("subtract_script.py", "w") as f: - f.write("from ert.job_queue import ErtScript\n") - f.write("\n") - f.write("class SubtractScript(ErtScript):\n") - f.write(" def run(self, arg1, arg2):\n") - f.write(" return arg1 - arg2\n") - - - with open("subtract_script_job", "w") as f: - f.write("INTERNAL True\n") - f.write("SCRIPT subtract_script.py\n") - f.write("MIN_ARG 2\n") - f.write("MAX_ARG 2\n") - f.write("ARG_TYPE 0 FLOAT\n") - f.write("ARG_TYPE 1 FLOAT\n") - - - @staticmethod - def createWaitJob(): - with open("wait_job.py", "w") as f: - f.write("from ert.job_queue import ErtScript\n") - f.write("import time\n") - f.write("\n") - f.write("class WaitScript(ErtScript):\n") - f.write(" def dump(self, filename, content):\n") - f.write(" with open(filename, 'w') as f:\n") - f.write(" f.write(content)\n") - f.write("\n") - f.write(" def run(self, number, wait_time):\n") - f.write(" self.dump('wait_started_%d' % number, 'text')\n") - f.write(" start = time.time()\n") - f.write(" diff = 0\n") - f.write(" while not self.isCancelled() and diff < wait_time: \n") - f.write(" time.sleep(0.2)\n") - f.write(" diff = time.time() - start\n") - f.write("\n") - f.write(" if self.isCancelled():\n") - f.write(" self.dump('wait_cancelled_%d' % number, 'text')\n") - f.write(" else:\n") - f.write(" self.dump('wait_finished_%d' % number, 'text')\n") - f.write("\n") - f.write(" return None\n") - - - with open("external_wait_job.sh", "w") as f: - f.write("#!/usr/bin/env bash\n") - f.write("echo \"text\" > wait_started_$1\n") - f.write("sleep $2\n") - f.write("echo \"text\" > wait_finished_$1\n") - - st = os.stat("external_wait_job.sh") - os.chmod("external_wait_job.sh", st.st_mode | stat.S_IEXEC) # | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH - - with open("wait_job", "w") as f: - f.write("INTERNAL True\n") - f.write("SCRIPT wait_job.py\n") - f.write("MIN_ARG 2\n") - f.write("MAX_ARG 2\n") - f.write("ARG_TYPE 0 INT\n") - f.write("ARG_TYPE 1 INT\n") - - with open("external_wait_job", "w") as f: - f.write("INTERNAL False\n") - f.write("EXECUTABLE external_wait_job.sh\n") - f.write("MIN_ARG 2\n") - f.write("MAX_ARG 2\n") - f.write("ARG_TYPE 0 INT\n") - f.write("ARG_TYPE 1 INT\n") - - - with open("wait_workflow", "w") as f: - f.write("WAIT 0 1\n") - f.write("WAIT 1 10\n") - f.write("WAIT 2 1\n") - - with open("fast_wait_workflow", "w") as f: - f.write("WAIT 0 1\n") - f.write("EXTERNAL_WAIT 1 1\n") diff --git a/ThirdParty/Ert/python/tests/ert/run/CMakeLists.txt b/ThirdParty/Ert/python/tests/ert/run/CMakeLists.txt deleted file mode 100644 index 01114973d2..0000000000 --- a/ThirdParty/Ert/python/tests/ert/run/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -set(TEST_SOURCES - __init__.py - test_run.py -) - -add_python_package("python.tests.ert.run" ${PYTHON_INSTALL_PREFIX}/tests/ert/run "${TEST_SOURCES}" False) - -addPythonTest(ert.test_run tests.ert.run.test_run.RunTest ) \ No newline at end of file diff --git a/ThirdParty/Ert/python/tests/ert/run/__init__.py b/ThirdParty/Ert/python/tests/ert/run/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/python/tests/ert/run/test_run.py b/ThirdParty/Ert/python/tests/ert/run/test_run.py deleted file mode 100644 index c5c76ea85d..0000000000 --- a/ThirdParty/Ert/python/tests/ert/run/test_run.py +++ /dev/null @@ -1,67 +0,0 @@ -from ert.test import TestRun , path_exists , ExtendedTestCase - - - -class RunTest(ExtendedTestCase): - def setUp(self): - self.testConfig = self.createTestPath("local/run/config.txt") - - def test_init(self): - with self.assertRaises(IOError): - TestRun("Does/notExist") - - tr = TestRun(self.testConfig) - self.assertEqual( tr.config_file , "config.txt") - self.assertEqual(tr.ert_version , "stable") - - - def test_args(self): - tr = TestRun(self.testConfig , args=["-v" , "latest"]) - self.assertEqual(tr.ert_version , "latest") - - - def test_cmd(self): - tr = TestRun(self.testConfig) - self.assertEqual( tr.ert_cmd , TestRun.default_ert_cmd ) - - tr.ert_cmd = "/tmp/test" - self.assertEqual( "/tmp/test" , tr.ert_cmd ) - - - def test_args2(self): - tr = TestRun(self.testConfig , args = ["arg1","arg2","-v","latest"]) - self.assertEqual( tr.get_args() , ["arg1","arg2"]) - self.assertEqual(tr.ert_version , "latest") - - - def test_workflows(self): - tr = TestRun(self.testConfig) - self.assertEqual( tr.get_workflows() , []) - - tr.add_workflow( "wf1" ) - tr.add_workflow( "wf2" ) - self.assertEqual( tr.get_workflows() , ["wf1" , "wf2"]) - - - def test_run_no_workflow(self): - tr = TestRun(self.testConfig) - with self.assertRaises(Exception): - tr.run() - - - - - def test_runpath(self): - tr = TestRun(self.testConfig , "Name") - self.assertEqual( TestRun.default_path_prefix , tr.path_prefix ) - - - def test_check(self): - tr = TestRun(self.testConfig , "Name") - tr.add_check( path_exists , "some/file" ) - - with self.assertRaises(Exception): - tr.add_check( 25 , "arg") - - with self.assertRaises(Exception): - tr.add_check( func_does_not_exist , "arg") diff --git a/ThirdParty/Ert/python/tests/ert/sched/CMakeLists.txt b/ThirdParty/Ert/python/tests/ert/sched/CMakeLists.txt deleted file mode 100644 index 3a0156b288..0000000000 --- a/ThirdParty/Ert/python/tests/ert/sched/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -set(TEST_SOURCES - __init__.py - test_sched.py -) - -add_python_package("python.tests.ert.sched" ${PYTHON_INSTALL_PREFIX}/tests/ert/sched "${TEST_SOURCES}" False) - -if (STATOIL_TESTDATA_ROOT) - addPythonTest(ert.sched.sched tests.ert.sched.test_sched.SchedFileTest LABELS StatoilData) -endif() \ No newline at end of file diff --git a/ThirdParty/Ert/python/tests/ert/sched/__init__.py b/ThirdParty/Ert/python/tests/ert/sched/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/python/tests/ert/sched/test_sched.py b/ThirdParty/Ert/python/tests/ert/sched/test_sched.py deleted file mode 100644 index 9e803d1073..0000000000 --- a/ThirdParty/Ert/python/tests/ert/sched/test_sched.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2012 Statoil ASA, Norway. -# -# The file 'test_sched.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. -import datetime -import os -from ert.sched import SchedFile -from ert.test import ExtendedTestCase - - - - -class SchedFileTest(ExtendedTestCase): - def setUp(self): - src_file = self.createTestPath("Statoil/ECLIPSE/Gurbat/target.SCH") - self.start_time = datetime.date(2000, 1, 1) - - self.sched_file = SchedFile(src_file, self.start_time) - self.file_list = [] - - def test_missing(self): - with self.assertRaises(IOError): - SchedFile("/does/not/exist", datetime.date(2000 , 1 , 1)) - - - def addFile( self, filename ): - self.file_list.append(filename) - - def tearDown(self): - for f in self.file_list: - if os.path.exists(f): - os.unlink(f) - - def test_load(self): - self.assertTrue(self.sched_file, "Load failed") - - - def test_length(self): - self.assertEqual(self.sched_file.length, 63) - - - def test_write_loop(self): - self.sched_file.write("/tmp/schedule1", 62) - sched_file2 = SchedFile("/tmp/schedule1", self.start_time) - sched_file2.write("/tmp/schedule2", 62) - self.assertFilesAreEqual("/tmp/schedule1", "/tmp/schedule2") - - self.addFile("/tmp/schedule1") - self.addFile("/tmp/schedule2") diff --git a/ThirdParty/Ert/python/tests/ert/server/CMakeLists.txt b/ThirdParty/Ert/python/tests/ert/server/CMakeLists.txt deleted file mode 100644 index d34a452814..0000000000 --- a/ThirdParty/Ert/python/tests/ert/server/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -set(TEST_SOURCES - __init__.py - test_simulation_context.py - test_rpc_service.py - test_rpc_storage.py -) - -add_python_package("python.tests.ert.server" ${PYTHON_INSTALL_PREFIX}/tests/ert/server "${TEST_SOURCES}" False) - -addPythonTest(ert.server.simulation_context tests.ert.server.test_simulation_context.SimulationContextTest) -addPythonTest(ert.server.rpc_service tests.ert.server.test_rpc_service.RPCServiceTest) -addPythonTest(ert.server.rpc_storage tests.ert.server.test_rpc_storage.RPCStorageTest) \ No newline at end of file diff --git a/ThirdParty/Ert/python/tests/ert/server/__init__.py b/ThirdParty/Ert/python/tests/ert/server/__init__.py deleted file mode 100644 index 9171f9677e..0000000000 --- a/ThirdParty/Ert/python/tests/ert/server/__init__.py +++ /dev/null @@ -1,43 +0,0 @@ -from threading import Thread - -from ert.enkf import EnkfFsManager, EnkfFs, EnkfVarType -from ert.server import ErtRPCServer -from ert.test import ErtTest - - -def initializeCase(ert, name, size): - """ - @type ert: ert.enkf.enkf_main.EnKFMain - @type name: str - @type size: int - @rtype: - """ - current_fs = ert.getEnkfFsManager().getCurrentFileSystem() - fs = ert.getEnkfFsManager().getFileSystem(name) - ert.getEnkfFsManager().switchFileSystem(fs) - parameters = ert.ensembleConfig().getKeylistFromVarType(EnkfVarType.PARAMETER) - ert.getEnkfFsManager().initializeFromScratch(parameters, 0, size - 1) - - ert.getEnkfFsManager().switchFileSystem(current_fs) - return fs - - - -class RPCServiceContext(object): - def __init__(self, test_name, model_config, store_area=False): - self._test_context = ErtTest(test_name, model_config, store_area=store_area) - self._server = ErtRPCServer(self._test_context.getErt()) - - def __enter__(self): - """ @rtype: ErtRPCServer""" - thread = Thread(name="ErtRPCServerTest") - thread.run = self._server.start - thread.start() - - return self._server - - def __exit__(self, exc_type, exc_val, exc_tb): - self._server.stop() - del self._server - del self._test_context - return False \ No newline at end of file diff --git a/ThirdParty/Ert/python/tests/ert/server/test_rpc_service.py b/ThirdParty/Ert/python/tests/ert/server/test_rpc_service.py deleted file mode 100644 index 58d8283caf..0000000000 --- a/ThirdParty/Ert/python/tests/ert/server/test_rpc_service.py +++ /dev/null @@ -1,186 +0,0 @@ -import datetime -import os -import time -from threading import Thread - -from ert import Version -from ert.enkf import EnKFMain -from ert.enkf.enums import RealizationStateEnum -from ert.server import ErtRPCServer, ErtRPCClient -from ert.test import ErtTestContext, ExtendedTestCase, ErtTest -from tests.ert.server import RPCServiceContext - - -def realizationIsInitialized(ert, case_name, realization_number): - assert isinstance(ert, EnKFMain) - fs = ert.getEnkfFsManager().getFileSystem(case_name) - state_map = fs.getStateMap() - state = state_map[realization_number] - return state == RealizationStateEnum.STATE_INITIALIZED or state == RealizationStateEnum.STATE_HAS_DATA - - -class RPCServiceTest(ExtendedTestCase): - def setUp(self): - self.config = self.createTestPath("local/snake_oil_no_data/snake_oil.ert") - - def test_server_creation(self): - with ErtTestContext("ert/server/rpc/server", self.config) as test_context: - ert = test_context.getErt() - server = ErtRPCServer(ert) - - self.assertIsNotNone(server.port) - self.assertEqual(ert, server._config) - self.assertEqual(os.path.basename(self.config), server._config_file) - - thread = Thread(name="ErtRPCServerTest") - thread.run = server.start - thread.start() - - server.stop() - - def test_client_interaction(self): - target_case_names = ["batch_1", ".batch_1", "batch_1", ".batch_1"] - kw = [ - {"SNAKE_OIL_PARAM": [0.50, 6, 1.750, 0.250, 0.990, 2, 1.770, 0.330, 0.550, 0.770]}, - {"SNAKE_OIL_PARAM": [0.51, 7, 1.751, 0.251, 0.991, 3, 1.771, 0.331, 0.551, 0.771]}, - {"SNAKE_OIL_PARAM": [0.52, 8, 1.752, 0.252, 0.992, 4, 1.772, 0.332, 0.552, 0.772]}, - {"SNAKE_OIL_PARAM": [0.53, 9, 1.753, 0.253, 0.993, 5, 1.773, 0.333, 0.553, 0.773]} - ] - - expected_state_map = { - "batch_1": [RealizationStateEnum.STATE_HAS_DATA, - RealizationStateEnum.STATE_UNDEFINED, - RealizationStateEnum.STATE_HAS_DATA - ], - - ".batch_1": [RealizationStateEnum.STATE_UNDEFINED, - RealizationStateEnum.STATE_HAS_DATA, - RealizationStateEnum.STATE_UNDEFINED, - RealizationStateEnum.STATE_HAS_DATA - ] - } - - expected_custom_kw = [ - {'RATING': 'EXCELLENT', 'NPV': 125692.534209}, - {'RATING': 'AVERAGE', 'NPV': 87423.5773042}, - {'RATING': 'GOOD', 'NPV': 113243.319848}, - {'RATING': 'AVERAGE', 'NPV': 91781.8557083} - ] - - with RPCServiceContext("ert/server/rpc/client", self.config) as server: - client = ErtRPCClient("localhost", server.port) - self.assertEqual(Version.currentVersion().versionTuple(), client.ertVersion()) - realization_count = len(target_case_names) - - client.startSimulationBatch("default", realization_count) - - self.assertTrue(server.isInitializationCaseAvailable()) - self.assertTrue(server.isRunning()) - - - for iens in range(realization_count): - client.addSimulation(target_case_names[iens], geo_id=0, pert_id=0, sim_id=iens, keywords=kw[iens]) - self.assertTrue(realizationIsInitialized(server.ert, target_case_names[iens], iens)) - - while client.isRunning(): - time.sleep(1) - - for case in expected_state_map: - fs = server.ert.getEnkfFsManager().getFileSystem(case) - state_map = fs.getStateMap() - states = expected_state_map[case] - - for index, state in enumerate(states): - self.assertEqual(state, state_map[index]) - - time_map = client.getTimeMap("batch_1") - self.assertEqual(datetime.datetime(2010, 1, 1), time_map[0]) - self.assertEqual(datetime.datetime(2015, 6, 13), time_map[199]) - - with self.assertRaises(KeyError): - client.getGenDataResult(target_case_names[0], 0, 199, "UNKNOWN_KEYWORD") - - for iens, case in enumerate(target_case_names): - self.assertTrue(client.isRealizationFinished(iens)) - self.assertTrue(client.didRealizationSucceed(iens)) - self.assertFalse(client.didRealizationFail(iens)) - - self.assertTrue(client.isCustomKWKey("SNAKE_OIL_NPV")) - self.assertFalse(client.isGenDataKey("SNAKE_OIL_NPV")) - self.assertTrue(client.isGenDataKey("SNAKE_OIL_OPR_DIFF")) - - result = client.getGenDataResult(case, iens, 199, "SNAKE_OIL_OPR_DIFF") - self.assertEqual(len(result), 2000) - - result = client.getCustomKWResult(case, iens, "SNAKE_OIL_NPV") - self.assertTrue("NPV" in result) - self.assertTrue("RATING" in result) - self.assertEqual(expected_custom_kw[iens]["RATING"], result["RATING"]) - self.assertAlmostEqual(expected_custom_kw[iens]["NPV"], result["NPV"]) - - - def test_multiple_threads(self): - expected_ckw = { - 0:{'RATING': 'EXCELLENT', 'NPV': 125692.534209}, - 1:{'RATING': 'AVERAGE', 'NPV': 87384.4316741}, - 2:{'RATING': 'GOOD', 'NPV': 113181.024141}, - 3:{'RATING': 'AVERAGE', 'NPV': 91659.8650599}, - 4:{'RATING': 'EXCELLENT', 'NPV': 134891.570703}, - 5:{'RATING': 'GOOD', 'NPV': 117270.977546}, - 6:{'RATING': 'GOOD', 'NPV': 106838.28455}, - 7:{'RATING': 'EXCELLENT', 'NPV': 144001.339}, - 8:{'RATING': 'AVERAGE', 'NPV': 95423.9155004}, - 9:{'RATING': 'AVERAGE', 'NPV': 96123.0227439} - } - - with RPCServiceContext("ert/server/rpc/multi_client", self.config, store_area=True) as server: - client_count = len(expected_ckw) - - # initializeCase(server.ert, "default", 1) - thread_success_state = {} - - def createClientInteractor(target_case_name, iens): - def clientInteraction(): - thread_success_state[iens] = False - keywords = {"SNAKE_OIL_PARAM": [0.50, iens + 2, 1.750, 0.250, 0.990, 2 + client_count - iens, 1.770, 0.330, 0.550, 0.770]} - client = ErtRPCClient("localhost", server.port) - client.startSimulationBatch("default", client_count) - - self.assertTrue(client.isRunning()) - self.assertTrue(client.isInitializationCaseAvailable()) - - client.addSimulation(target_case_name, 0, 0, iens, keywords) - self.assertTrue(realizationIsInitialized(server.ert, target_case_name, iens)) - - while not client.isRealizationFinished(iens): - time.sleep(0.5) - - self.assertTrue(client.didRealizationSucceed(iens)) - - result = client.getCustomKWResult(target_case_name, iens, "SNAKE_OIL_NPV") - self.assertTrue("NPV" in result) - self.assertTrue("RATING" in result) - self.assertEqual(expected_ckw[iens]["RATING"], result["RATING"]) - self.assertAlmostEqual(expected_ckw[iens]["NPV"], result["NPV"]) - - thread_success_state[iens] = True - - return clientInteraction - - threads = [] - for iens in range(client_count): - thread = Thread(name="client_%d" % iens) - target_case_name = "target" if iens % 2 == 0 else ".target" - thread.run = createClientInteractor(target_case_name, iens) - threads.append(thread) - - for thread in threads: - thread.start() - - while server.isRunning(): - time.sleep(0.1) - - for thread in threads: - thread.join() - - self.assertTrue(all(success for success in thread_success_state.values())) diff --git a/ThirdParty/Ert/python/tests/ert/server/test_rpc_storage.py b/ThirdParty/Ert/python/tests/ert/server/test_rpc_storage.py deleted file mode 100644 index f15ce7845c..0000000000 --- a/ThirdParty/Ert/python/tests/ert/server/test_rpc_storage.py +++ /dev/null @@ -1,124 +0,0 @@ -from itertools import product -from random import random - -import time - -from ert.enkf.enums import ErtImplType -from ert.enkf.export.custom_kw_collector import CustomKWCollector -from ert.server import ErtRPCClient -from ert.test import ExtendedTestCase -from tests.ert.server import RPCServiceContext, initializeCase - - -class RPCStorageTest(ExtendedTestCase): - def test_rpc_storage(self): - config = self.createTestPath("local/snake_oil_no_data/snake_oil.ert") - - with RPCServiceContext("ert/server/rpc_storage/storage", config) as server: - client = ErtRPCClient("localhost", server.port) - - group_name = "Test" - storage_definition = { - "PI": float, - "DakotaVersion": str, - "Gradient": float, - "GradientDirection": str - } - client.prototypeStorage(group_name, storage_definition) - - with self.assertRaises(UserWarning): - client.prototypeStorage(group_name, {"value": float}) - - with self.assertRaises(TypeError): - client.prototypeStorage(group_name, {"value": bool}) - - - ensemble_config = server.ert.ensembleConfig() - - self.assertIn(group_name, ensemble_config.getKeylistFromImplType(ErtImplType.CUSTOM_KW)) - - custom_kw_config = ensemble_config.getNode(group_name).getCustomKeywordModelConfig() - - self.assertIn("PI", custom_kw_config) - self.assertTrue(custom_kw_config.keyIsDouble("PI")) - - self.assertIn("DakotaVersion", custom_kw_config) - self.assertFalse(custom_kw_config.keyIsDouble("DakotaVersion")) - - self.assertIn("Gradient", custom_kw_config) - self.assertTrue(custom_kw_config.keyIsDouble("Gradient")) - - self.assertIn("GradientDirection", custom_kw_config) - self.assertFalse(custom_kw_config.keyIsDouble("GradientDirection")) - - - simulation_count = 10 - initializeCase(server.ert, "default", simulation_count) - - client.storeGlobalData("default", group_name, "PI", 3.1415) - client.storeGlobalData("default", group_name, "DakotaVersion", "DAKOTA 6.2.0") - - gradients = [random() * 20.0 - 10.0 for _ in range(simulation_count)] - gradient_directions = [("POSITIVE" if gradient >= 0.0 else "NEGATIVE") for gradient in gradients] - for sim_id in range(simulation_count): - gradient = gradients[sim_id] - gradient_direction = gradient_directions[sim_id] - client.storeSimulationData("default", group_name, "Gradient", gradient, sim_id) - client.storeSimulationData("default", group_name, "GradientDirection", gradient_direction, sim_id) - - - data = CustomKWCollector.loadAllCustomKWData(server.ert, "default") - for sim_id in range(simulation_count): - self.assertEqual(data["Test:PI"][sim_id], 3.1415) - self.assertEqual(data["Test:DakotaVersion"][sim_id], "DAKOTA 6.2.0") - self.assertEqual(data["Test:Gradient"][sim_id], gradients[sim_id]) - self.assertEqual(data["Test:GradientDirection"][sim_id], gradient_directions[sim_id]) - - - def test_rpc_storage_with_simulation(self): - config = self.createTestPath("local/snake_oil_no_data/snake_oil.ert") - - with RPCServiceContext("ert/server/rpc_storage/simulation_and_storage", config, store_area=True) as server: - client = ErtRPCClient("localhost", server.port) - realization_count = 2 - - client.prototypeStorage("SNAKEX", {"SNAKE_ID": float, "SNAKE_RUN": str}) - - batch_names = ["test_run_0", "test_run_1"] - - for batch_id, batch_name in enumerate(batch_names): - self.runSimulation(client, realization_count, batch_id, batch_name) - - for (batch_id, batch_name), iens in product(enumerate(batch_names), range(realization_count)): - result = client.getCustomKWResult(batch_name, iens, "SNAKEX") - self.assertEqual(result["SNAKE_RUN"], "batch_%d" % batch_id) - snake_id = realization_count * batch_id + iens - self.assertEqual(result["SNAKE_ID"], snake_id) - - - - def runSimulation(self, client, realization_count, batch_id, batch_name): - client.startSimulationBatch("default", 2) - kw = {"SNAKE_OIL_PARAM": [0.50, 6, 1.750, 0.250, 0.990, 2, 1.770, 0.330, 0.550, 0.770]} # identical runs - - for iens in range(realization_count): - client.addSimulation(batch_name, geo_id=0, pert_id=0, sim_id=iens, keywords=kw) - - while client.isRunning(): - time.sleep(0.2) - - for iens in range(realization_count): - self.assertTrue(client.didRealizationSucceed(iens)) - - - client.storeGlobalData(batch_name, "SNAKEX", "SNAKE_RUN", "batch_%d" % batch_id) - - for iens in range(realization_count): - client.storeSimulationData(batch_name, "SNAKEX", "SNAKE_ID", realization_count * batch_id + iens, iens) - - - - - - - diff --git a/ThirdParty/Ert/python/tests/ert/server/test_simulation_context.py b/ThirdParty/Ert/python/tests/ert/server/test_simulation_context.py deleted file mode 100644 index 33a4347331..0000000000 --- a/ThirdParty/Ert/python/tests/ert/server/test_simulation_context.py +++ /dev/null @@ -1,97 +0,0 @@ -import time -import os.path -import sys - -from ert.enkf import EnkfVarType -from ert.enkf.enums import RealizationStateEnum -from ert.server import SimulationContext -from ert.test import ErtTestContext, ExtendedTestCase -from tests.ert.server import initializeCase - - -class SimulationContextTest(ExtendedTestCase): - - def setUp(self): - self.config1 = self.createTestPath("local/snake_oil_no_data/snake_oil.ert") - self.config2 = self.createTestPath("local/snake_oil_no_data/snake_oil_GEO_ID.ert") - - - def test_simulation_context(self): - with ErtTestContext("ert/server/rpc/simulation_context", self.config1) as test_context: - ert = test_context.getErt() - - size = 4 - first_half = initializeCase(ert, "first_half", size) - other_half = initializeCase(ert, "other_half", size) - - simulation_context = SimulationContext(ert, size) - - for iens in range(size): - if iens % 2 == 0: - simulation_context.addSimulation(iens, first_half) - else: - simulation_context.addSimulation(iens, other_half) - self.assertFalse(simulation_context.isRealizationFinished(iens)) - - with self.assertRaises(UserWarning): - simulation_context.addSimulation(size, first_half) - - with self.assertRaises(UserWarning): - simulation_context.addSimulation(0, first_half) - - while simulation_context.isRunning(): - time.sleep(1.0) - - self.assertEqual(simulation_context.getNumFailed(), 0) - self.assertEqual(simulation_context.getNumRunning(), 0) - self.assertEqual(simulation_context.getNumSuccess(), size) - - first_half_state_map = first_half.getStateMap() - other_half_state_map = other_half.getStateMap() - - for iens in range(size): - self.assertTrue(simulation_context.didRealizationSucceed(iens)) - self.assertFalse(simulation_context.didRealizationFail(iens)) - self.assertTrue(simulation_context.isRealizationFinished(iens)) - if iens % 2 == 0: - self.assertEqual(first_half_state_map[iens], RealizationStateEnum.STATE_HAS_DATA) - self.assertEqual(other_half_state_map[iens], RealizationStateEnum.STATE_INITIALIZED) - else: - self.assertEqual(first_half_state_map[iens], RealizationStateEnum.STATE_INITIALIZED) - self.assertEqual(other_half_state_map[iens], RealizationStateEnum.STATE_HAS_DATA) - - pfx = 'SimulationContext(' - self.assertEqual(pfx, repr(simulation_context)[:len(pfx)]) - - def test_runpath(self): - with ErtTestContext("ert/server/rpc/simulation_context_runpath", self.config2) as test_context: - ert = test_context.getErt() - sys.stderr.write("cwd: %s \n" % os.getcwd()) - size = 10 - - fs = ert.getEnkfFsManager().getCurrentFileSystem() - parameters = ert.ensembleConfig().getKeylistFromVarType(EnkfVarType.PARAMETER) - ert.getEnkfFsManager().initializeFromScratch(parameters, 0, size - 1) - simulation_context = SimulationContext(ert, size) - - for iens in range(size): - state = ert.getRealisation(iens) - if iens % 2 == 0: - state.addSubstKeyword("GEO_ID", "EVEN") - else: - state.addSubstKeyword("GEO_ID", "ODD") - simulation_context.addSimulation(iens , fs) - - while simulation_context.isRunning(): - time.sleep(1.0) - - for iens in range(size): - if iens % 2 == 0: - path = "simulations/EVEN/realisation-%d/iter-%d" % (iens , 0) - self.assertTrue( os.path.isdir(path) ) - else: - path = "simulations/ODD/realisation-%d/iter-%d" % (iens , 0) - self.assertTrue( os.path.isdir(path) ) - - pfx = 'SimulationContext(' - self.assertEqual(pfx, repr(simulation_context)[:len(pfx)]) diff --git a/ThirdParty/Ert/python/tests/ert/testcase/CMakeLists.txt b/ThirdParty/Ert/python/tests/ert/testcase/CMakeLists.txt deleted file mode 100644 index 328614835f..0000000000 --- a/ThirdParty/Ert/python/tests/ert/testcase/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -set(TEST_SOURCES - __init__.py - test_testcase.py - test_mini_config.py -) - -add_python_package("python.tests.ert.testcase" ${PYTHON_INSTALL_PREFIX}/tests/ert/testcase "${TEST_SOURCES}" False) - -addPythonTest(ert.testcase.testcase tests.ert.testcase.test_testcase.TestTestCase) -addPythonTest(ert.testcase.mini_config tests.ert.testcase.test_mini_config.MiniConfigTest) \ No newline at end of file diff --git a/ThirdParty/Ert/python/tests/ert/testcase/__init__.py b/ThirdParty/Ert/python/tests/ert/testcase/__init__.py deleted file mode 100644 index 5e08e797f5..0000000000 --- a/ThirdParty/Ert/python/tests/ert/testcase/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ThirdParty/Ert/python/tests/ert/testcase/test_mini_config.py b/ThirdParty/Ert/python/tests/ert/testcase/test_mini_config.py deleted file mode 100644 index 33f388578b..0000000000 --- a/ThirdParty/Ert/python/tests/ert/testcase/test_mini_config.py +++ /dev/null @@ -1,49 +0,0 @@ -from ert.enkf.enums.realization_state_enum import RealizationStateEnum -from ert.test import ErtTestContext -from ert.test.extended_testcase import ExtendedTestCase - - -class MiniConfigTest(ExtendedTestCase): - - def test_failed_realizations(self): - - # mini_fail_config has the following realization success/failures: - # - # 0 OK - # 1 GenData report step 1 missing - # 2 GenData report step 2 missing, Forward Model Component Target File not found. - # 3 GenData report step 3 missing, Forward Model Component Target File not found. - # 4 GenData report step 1 missing - # 5 GenData report step 2 missing, Forward Model Component Target File not found. - # 6 GenData report step 3 missing - # 7 Forward Model Target File not found. - # 8 OK - # 9 OK - - - config = self.createTestPath("local/custom_kw/mini_fail_config") - with ErtTestContext("python/enkf/data/custom_kw_simulated", config) as context: - ert = context.getErt() - - fs = ert.getEnkfFsManager().getCurrentFileSystem() - - realizations_list = fs.realizationList(RealizationStateEnum.STATE_HAS_DATA) - self.assertTrue(0 in realizations_list) - self.assertTrue(8 in realizations_list) - self.assertTrue(9 in realizations_list) - - realizations_list = fs.realizationList(RealizationStateEnum.STATE_LOAD_FAILURE) - self.assertTrue(1 in realizations_list) - self.assertTrue(2 in realizations_list) - self.assertTrue(3 in realizations_list) - self.assertTrue(4 in realizations_list) - self.assertTrue(5 in realizations_list) - self.assertTrue(6 in realizations_list) - self.assertTrue(7 in realizations_list) - - - - - - - diff --git a/ThirdParty/Ert/python/tests/ert/testcase/test_testcase.py b/ThirdParty/Ert/python/tests/ert/testcase/test_testcase.py deleted file mode 100644 index 6308d54264..0000000000 --- a/ThirdParty/Ert/python/tests/ert/testcase/test_testcase.py +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (C) 2015 Statoil ASA, Norway. -# -# The file 'test_testcase.py' is part of ERT - Ensemble based Reservoir Tool. -# -# ERT 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. -# -# ERT 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 -# for more details. - -import functools -import math -from ert.test import ExtendedTestCase - -class TestTestCase(ExtendedTestCase): - - def test_not_raises(self): - call_sin = functools.partial( math.sin , 0.5*math.pi ) - self.assertNotRaises( call_sin ) - diff --git a/ThirdParty/Ert/python/tests/geometry/CMakeLists.txt b/ThirdParty/Ert/python/tests/geometry/CMakeLists.txt new file mode 100644 index 0000000000..1795decd10 --- /dev/null +++ b/ThirdParty/Ert/python/tests/geometry/CMakeLists.txt @@ -0,0 +1,28 @@ +set(TEST_SOURCES + __init__.py + test_convex_hull.py + test_cpolyline.py + test_cpolyline_collection.py + test_geometry_tools.py + test_intersection.py + test_point_in_polygon.py + test_polygon_slicing.py + test_polyline.py + test_surface.py + test_geo_pointset.py + test_geo_region.py +) + +add_python_package("python.tests.geometry" ${PYTHON_INSTALL_PREFIX}/tests/geometry "${TEST_SOURCES}" False) + +addPythonTest(tests.geometry.test_geo_pointset.GeoPointsetTest) +addPythonTest(tests.geometry.test_geo_region.GeoRegionTest) +addPythonTest(tests.geometry.test_surface.SurfaceTest) +addPythonTest(tests.geometry.test_polyline.PolylineTest) +addPythonTest(tests.geometry.test_intersection.IntersectionTest) +addPythonTest(tests.geometry.test_convex_hull.ConvexHullTest) +addPythonTest(tests.geometry.test_point_in_polygon.PointInPolygonTest) +addPythonTest(tests.geometry.test_polygon_slicing.PolygonSlicingTest) +addPythonTest(tests.geometry.test_cpolyline.CPolylineTest) +addPythonTest(tests.geometry.test_cpolyline_collection.CPolylineCollectionTest) +addPythonTest(tests.geometry.test_geometry_tools.GeometryToolsTest ) diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/__init__.py b/ThirdParty/Ert/python/tests/geometry/__init__.py similarity index 100% rename from ThirdParty/Ert/python/python/ert_gui/ide/__init__.py rename to ThirdParty/Ert/python/tests/geometry/__init__.py diff --git a/ThirdParty/Ert/python/tests/core/geometry/test_convex_hull.py b/ThirdParty/Ert/python/tests/geometry/test_convex_hull.py similarity index 86% rename from ThirdParty/Ert/python/tests/core/geometry/test_convex_hull.py rename to ThirdParty/Ert/python/tests/geometry/test_convex_hull.py index 395fbe5fec..e0c27305f6 100644 --- a/ThirdParty/Ert/python/tests/core/geometry/test_convex_hull.py +++ b/ThirdParty/Ert/python/tests/geometry/test_convex_hull.py @@ -1,5 +1,5 @@ -from ert.geo.geometry_tools import GeometryTools -from ert.test.extended_testcase import ExtendedTestCase +from ecl.geo.geometry_tools import GeometryTools +from ecl.test.extended_testcase import ExtendedTestCase class ConvexHullTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/core/geometry/test_cpolyline.py b/ThirdParty/Ert/python/tests/geometry/test_cpolyline.py similarity index 97% rename from ThirdParty/Ert/python/tests/core/geometry/test_cpolyline.py rename to ThirdParty/Ert/python/tests/geometry/test_cpolyline.py index cb517af936..6439f15923 100644 --- a/ThirdParty/Ert/python/tests/core/geometry/test_cpolyline.py +++ b/ThirdParty/Ert/python/tests/geometry/test_cpolyline.py @@ -1,8 +1,8 @@ import math -from ert.geo import CPolyline , Polyline -from ert.geo.xyz_io import XYZIo -from ert.test import ExtendedTestCase , TestAreaContext +from ecl.geo import CPolyline , Polyline +from ecl.geo.xyz_io import XYZIo +from ecl.test import ExtendedTestCase , TestAreaContext class CPolylineTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/core/geometry/test_cpolyline_collection.py b/ThirdParty/Ert/python/tests/geometry/test_cpolyline_collection.py similarity index 95% rename from ThirdParty/Ert/python/tests/core/geometry/test_cpolyline_collection.py rename to ThirdParty/Ert/python/tests/geometry/test_cpolyline_collection.py index 08fc345bce..11ab6a63cd 100644 --- a/ThirdParty/Ert/python/tests/core/geometry/test_cpolyline_collection.py +++ b/ThirdParty/Ert/python/tests/geometry/test_cpolyline_collection.py @@ -1,9 +1,9 @@ import gc -from ert.geo import CPolylineCollection , CPolyline -from ert.geo.xyz_io import XYZIo -from ert.test import ExtendedTestCase , TestAreaContext -from ert.util import DoubleVector +from ecl.geo import CPolylineCollection , CPolyline +from ecl.geo.xyz_io import XYZIo +from ecl.test import ExtendedTestCase , TestAreaContext +from ecl.util import DoubleVector class CPolylineCollectionTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/geometry/test_geo_pointset.py b/ThirdParty/Ert/python/tests/geometry/test_geo_pointset.py new file mode 100644 index 0000000000..1d1c423f17 --- /dev/null +++ b/ThirdParty/Ert/python/tests/geometry/test_geo_pointset.py @@ -0,0 +1,27 @@ +from ecl.geo import GeoPointset, Surface +from ecl.test import ExtendedTestCase, TestAreaContext + + +class GeoPointsetTest(ExtendedTestCase): + + def test_init(self): + gp = GeoPointset() + self.assertEqual(0, len(gp)) + + def test_repr(self): + gp = GeoPointset() + self.assertTrue(repr(gp).startswith('GeoPointset')) + + def test_from_surface(self): + srf_path = self.createTestPath("local/geometry/surface/valid_ascii.irap") + srf = Surface(srf_path) + gp = GeoPointset.fromSurface(srf) + self.assertEqual(3871, len(srf)) + self.assertEqual(len(srf), len(gp)) + + def test_getitem(self): + srf_path = self.createTestPath("local/geometry/surface/valid_ascii.irap") + srf = Surface(srf_path) + gp = GeoPointset.fromSurface(srf) + for i in (561, 1105, 1729, 2465, 2821): + self.assertEqual(gp[i], srf[i]) diff --git a/ThirdParty/Ert/python/tests/geometry/test_geo_region.py b/ThirdParty/Ert/python/tests/geometry/test_geo_region.py new file mode 100644 index 0000000000..949ced3128 --- /dev/null +++ b/ThirdParty/Ert/python/tests/geometry/test_geo_region.py @@ -0,0 +1,88 @@ +from ecl.geo import GeoRegion, GeoPointset, CPolyline, Surface +from ecl.test import ExtendedTestCase, TestAreaContext + + +class GeoRegionTest(ExtendedTestCase): + + def test_init(self): + pointset = GeoPointset() + georegion = GeoRegion(pointset) + self.assertEqual(0, len(georegion)) + + def test_repr(self): + pointset = GeoPointset() + georegion = GeoRegion(pointset) + self.assertTrue(repr(georegion).startswith('GeoRegion')) + + @staticmethod + def small_surface(): + ny,nx = 12,12 + xinc,yinc = 1, 1 + xstart,ystart = -1, -1 + angle = 0.0 + s_args = (None, nx, ny, xinc, yinc, xstart, ystart, angle) + return Surface(*s_args) + + def test_select_polygon(self): + surface = self.small_surface() + pointset = GeoPointset.fromSurface(surface) + georegion = GeoRegion(pointset) + self.assertEqual(0, len(georegion)) + points = [(-0.1,2.0), (1.9,8.1), (6.1,8.1), (9.1,5), (7.1,0.9)] + polygon = CPolyline(name='test_polygon', init_points=points) + picked = 52 # https://www.futilitycloset.com/2013/04/24/picks-theorem/ + georegion.select_inside(polygon) + self.assertEqual(picked, len(georegion)) + georegion.deselect_inside(polygon) + self.assertEqual(0, len(georegion)) + georegion.select_outside(polygon) + self.assertEqual(len(surface) - picked, len(georegion)) + georegion.deselect_outside(polygon) + self.assertEqual(0, len(georegion)) + + georegion.select_inside(polygon) + georegion.select_outside(polygon) + self.assertEqual(len(surface), len(georegion)) + georegion.deselect_inside(polygon) + georegion.deselect_outside(polygon) + self.assertEqual(0, len(georegion)) + + georegion.select_inside(polygon) + self.assertEqual(picked, len(georegion)) + internal_square = [(2.5,2.5), (2.5,6.5), (6.5,6.5), (6.5,2.5)] + georegion.deselect_inside(CPolyline(init_points=internal_square)) + self.assertEqual(picked - 4*4, len(georegion)) # internal square is 4x4 + + + def test_select_halfspace(self): + surface = self.small_surface() + pointset = GeoPointset.fromSurface(surface) + georegion = GeoRegion(pointset) + self.assertEqual(0, len(georegion)) + line = [(-0.1,2.0), (1.9,8.1)] + picked = 118 + georegion.select_above(line) + self.assertEqual(picked, len(georegion)) + georegion.deselect_above(line) + self.assertEqual(0, len(georegion)) + georegion.select_below(line) + self.assertEqual(len(surface) - picked, len(georegion)) + georegion.deselect_below(line) + self.assertEqual(0, len(georegion)) + + georegion.select_above(line) + georegion.select_below(line) + self.assertEqual(len(surface), len(georegion)) + georegion.deselect_above(line) + georegion.deselect_below(line) + self.assertEqual(0, len(georegion)) + + + def test_raises(self): + surface = self.small_surface() + pointset = GeoPointset.fromSurface(surface) + georegion = GeoRegion(pointset) + with self.assertRaises(ValueError): + georegion.select_above(((2,), (1, 3))) + with self.assertRaises(ValueError): + georegion.select_above((('not-a-number', 2), (1, 3))) diff --git a/ThirdParty/Ert/python/tests/core/geometry/test_geometry_tools.py b/ThirdParty/Ert/python/tests/geometry/test_geometry_tools.py similarity index 94% rename from ThirdParty/Ert/python/tests/core/geometry/test_geometry_tools.py rename to ThirdParty/Ert/python/tests/geometry/test_geometry_tools.py index 80f0eb8489..0656677ad6 100644 --- a/ThirdParty/Ert/python/tests/core/geometry/test_geometry_tools.py +++ b/ThirdParty/Ert/python/tests/geometry/test_geometry_tools.py @@ -1,8 +1,8 @@ import math -from ert.geo import Polyline, GeometryTools , CPolyline -from ert.geo.xyz_io import XYZIo -from ert.test import ExtendedTestCase , TestAreaContext +from ecl.geo import Polyline, GeometryTools , CPolyline +from ecl.geo.xyz_io import XYZIo +from ecl.test import ExtendedTestCase , TestAreaContext class GeometryToolsTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/core/geometry/test_intersection.py b/ThirdParty/Ert/python/tests/geometry/test_intersection.py similarity index 92% rename from ThirdParty/Ert/python/tests/core/geometry/test_intersection.py rename to ThirdParty/Ert/python/tests/geometry/test_intersection.py index 2e36c59aaf..af78512e84 100644 --- a/ThirdParty/Ert/python/tests/core/geometry/test_intersection.py +++ b/ThirdParty/Ert/python/tests/geometry/test_intersection.py @@ -1,5 +1,5 @@ -from ert.geo import GeometryTools -from ert.test.extended_testcase import ExtendedTestCase +from ecl.geo import GeometryTools +from ecl.test.extended_testcase import ExtendedTestCase class IntersectionTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/core/geometry/test_point_in_polygon.py b/ThirdParty/Ert/python/tests/geometry/test_point_in_polygon.py similarity index 89% rename from ThirdParty/Ert/python/tests/core/geometry/test_point_in_polygon.py rename to ThirdParty/Ert/python/tests/geometry/test_point_in_polygon.py index ad2e87c31b..8faeb9ca5f 100644 --- a/ThirdParty/Ert/python/tests/core/geometry/test_point_in_polygon.py +++ b/ThirdParty/Ert/python/tests/geometry/test_point_in_polygon.py @@ -1,6 +1,6 @@ -from ert.geo.geometry_tools import GeometryTools -from ert.geo.polyline import Polyline -from ert.test.extended_testcase import ExtendedTestCase +from ecl.geo.geometry_tools import GeometryTools +from ecl.geo.polyline import Polyline +from ecl.test.extended_testcase import ExtendedTestCase class PointInPolygonTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/core/geometry/test_polygon_slicing.py b/ThirdParty/Ert/python/tests/geometry/test_polygon_slicing.py similarity index 97% rename from ThirdParty/Ert/python/tests/core/geometry/test_polygon_slicing.py rename to ThirdParty/Ert/python/tests/geometry/test_polygon_slicing.py index ad7c1780ac..e2493e6822 100644 --- a/ThirdParty/Ert/python/tests/core/geometry/test_polygon_slicing.py +++ b/ThirdParty/Ert/python/tests/geometry/test_polygon_slicing.py @@ -1,6 +1,6 @@ from math import sqrt -from ert.geo.geometry_tools import GeometryTools -from ert.test import ExtendedTestCase +from ecl.geo.geometry_tools import GeometryTools +from ecl.test import ExtendedTestCase class PolygonSlicingTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/core/geometry/test_polyline.py b/ThirdParty/Ert/python/tests/geometry/test_polyline.py similarity index 97% rename from ThirdParty/Ert/python/tests/core/geometry/test_polyline.py rename to ThirdParty/Ert/python/tests/geometry/test_polyline.py index 8674e75460..bd9e262cff 100644 --- a/ThirdParty/Ert/python/tests/core/geometry/test_polyline.py +++ b/ThirdParty/Ert/python/tests/geometry/test_polyline.py @@ -1,7 +1,7 @@ -from ert.geo import Polyline, GeometryTools -from ert.geo.xyz_io import XYZIo -from ert.test import ExtendedTestCase , TestAreaContext +from ecl.geo import Polyline, GeometryTools +from ecl.geo.xyz_io import XYZIo +from ecl.test import ExtendedTestCase , TestAreaContext class PolylineTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/core/geometry/test_surface.py b/ThirdParty/Ert/python/tests/geometry/test_surface.py similarity index 91% rename from ThirdParty/Ert/python/tests/core/geometry/test_surface.py rename to ThirdParty/Ert/python/tests/geometry/test_surface.py index 997f1c745f..995c34bcdb 100644 --- a/ThirdParty/Ert/python/tests/core/geometry/test_surface.py +++ b/ThirdParty/Ert/python/tests/geometry/test_surface.py @@ -1,6 +1,6 @@ import random -from ert.geo import Surface -from ert.test import ExtendedTestCase , TestAreaContext +from ecl.geo import Surface +from ecl.test import ExtendedTestCase , TestAreaContext class SurfaceTest(ExtendedTestCase): @@ -11,6 +11,16 @@ class SurfaceTest(ExtendedTestCase): self.surface_valid2 = self.createTestPath("local/geometry/surface/valid2_ascii.irap") self.surface_small = self.createTestPath("local/geometry/surface/valid_small_ascii.irap") + def test_xyz(self): + s = Surface(self.surface_valid2) + self.assertEqual(s.getXYZ(i=5,j=13), s.getXYZ(idx=642)) + x,y,z = s.getXYZ(i=5,j=13) + self.assertFloatEqual(464041.44804, x) + self.assertFloatEqual(7336966.309535, y) + self.assertFloatEqual(0.0051, z) + self.assertAlmostEqualList(s.getXYZ(i=6,j=13), s.getXYZ(idx=643)) + self.assertFloatEqual(-0.0006, s.getXYZ(i=6,j=13)[2]) # z value + def test_create_new(self): with self.assertRaises(ValueError): s = Surface(None, 1, 1, 1) diff --git a/ThirdParty/Ert/python/tests/global/CMakeLists.txt b/ThirdParty/Ert/python/tests/global/CMakeLists.txt new file mode 100644 index 0000000000..957c12c570 --- /dev/null +++ b/ThirdParty/Ert/python/tests/global/CMakeLists.txt @@ -0,0 +1,12 @@ +set(TEST_SOURCES + __init__.py + test_import.py + test_pylint.py +) + +add_python_package("python.tests.global" "${PYTHON_INSTALL_PREFIX}/tests/global" "${TEST_SOURCES}" False) + +addPythonTest(tests.global.test_import.ImportEcl) +addPythonTest(tests.global.test_pylint.LintErt) + + diff --git a/ThirdParty/Ert/python/python/ert_gui/ide/completers/__init__.py b/ThirdParty/Ert/python/tests/global/__init__.py similarity index 100% rename from ThirdParty/Ert/python/python/ert_gui/ide/completers/__init__.py rename to ThirdParty/Ert/python/tests/global/__init__.py diff --git a/ThirdParty/Ert/python/python/ert/enkf/enums/active_mode_enum.py b/ThirdParty/Ert/python/tests/global/test_import.py similarity index 57% rename from ThirdParty/Ert/python/python/ert/enkf/enums/active_mode_enum.py rename to ThirdParty/Ert/python/tests/global/test_import.py index ec426fce66..fe0835809a 100644 --- a/ThirdParty/Ert/python/python/ert/enkf/enums/active_mode_enum.py +++ b/ThirdParty/Ert/python/tests/global/test_import.py @@ -1,6 +1,6 @@ -# Copyright (C) 2013 Statoil ASA, Norway. +# Copyright (C) 2017 Statoil ASA, Norway. # -# The file 'content_type_enum.py' is part of ERT - Ensemble based Reservoir Tool. +# This file is part of ERT - Ensemble based Reservoir Tool. # # ERT is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -13,15 +13,14 @@ # # See the GNU General Public License at # for more details. -from cwrap import BaseCEnum -class ActiveMode(BaseCEnum): - TYPE_NAME = "active_mode_enum" - ALL_ACTIVE = None - INACTIVE = None - PARTLY_ACTIVE = None +import os +import sys -ActiveMode.addEnum("ALL_ACTIVE", 1) -ActiveMode.addEnum("INACTIVE", 2) -ActiveMode.addEnum("PARTLY_ACTIVE", 3) +from ecl.test import ImportTestCase + +class ImportEcl(ImportTestCase): + + def test_import_ecl(self): + self.assertTrue( self.import_package( "ecl" )) diff --git a/ThirdParty/Ert/python/python/ert/enkf/config/field_type_enum.py b/ThirdParty/Ert/python/tests/global/test_pylint.py similarity index 51% rename from ThirdParty/Ert/python/python/ert/enkf/config/field_type_enum.py rename to ThirdParty/Ert/python/tests/global/test_pylint.py index 901a019060..20206294f1 100644 --- a/ThirdParty/Ert/python/python/ert/enkf/config/field_type_enum.py +++ b/ThirdParty/Ert/python/tests/global/test_pylint.py @@ -1,4 +1,4 @@ -# Copyright (C) 2016 Statoil ASA, Norway. +# Copyright (C) 2017 Statoil ASA, Norway. # # This file is part of ERT - Ensemble based Reservoir Tool. # @@ -14,16 +14,20 @@ # See the GNU General Public License at # for more details. -from cwrap import BaseCEnum +from ecl.test import LintTestCase -class FieldTypeEnum(BaseCEnum): - TYPE_NAME = "field_type_enum" - ECLIPSE_RESTART = None - ECLIPSE_PARAMETER = None - GENERAL = None - UNKNOWN_FIELD_TYPE = None +class LintErt(LintTestCase): + """Tests that no file in ert needs linting""" -FieldTypeEnum.addEnum('ECLIPSE_RESTART', 1) -FieldTypeEnum.addEnum('ECLIPSE_PARAMETER', 2) -FieldTypeEnum.addEnum('GENERAL', 3) -FieldTypeEnum.addEnum('UNKNOWN_FIELD_TYPE', 4) + def test_lint_ecl(self): + white = ['ecl_kw.py', 'ecl_type.py', 'ecl_sum.py', 'ecl_grid.py', 'ecl_npv.py'] # TODO fix issues and remove + self.assertLinted('ecl/ecl', whitelist=white) + + def test_lint_geo(self): + self.assertLinted('ecl/geo') + + def test_lint_util(self): + self.assertLinted('ecl/util') + + def test_lint_well(self): + self.assertLinted('ecl/well') diff --git a/ThirdParty/Ert/python/tests/gui/CMakeLists.txt b/ThirdParty/Ert/python/tests/gui/CMakeLists.txt deleted file mode 100644 index 26d2b0e202..0000000000 --- a/ThirdParty/Ert/python/tests/gui/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -set(TEST_SOURCES - __init__.py - test_multiple_data_assimilation.py -) - -add_python_package("python.tests.gui" ${PYTHON_INSTALL_PREFIX}/tests/gui "${TEST_SOURCES}" False) - -addPythonTest(gui.mda_weights tests.gui.test_multiple_data_assimilation.MDAWeightsTest) - -add_subdirectory(ertshell) -add_subdirectory(ide) -add_subdirectory(plottery) diff --git a/ThirdParty/Ert/python/tests/gui/__init__.py b/ThirdParty/Ert/python/tests/gui/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/python/tests/gui/ertshell/CMakeLists.txt b/ThirdParty/Ert/python/tests/gui/ertshell/CMakeLists.txt deleted file mode 100644 index d402395a86..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ertshell/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -set(TEST_SOURCES - __init__.py - ert_shell_test_context.py - test_ertshell_analysis.py - test_ertshell_context.py - test_ertshell_observations.py - test_ertshell_plot_settings.py - test_ertshell_smoother.py - test_ertshell_server.py - - test_shell_function.py - test_shell_property.py - test_shell_collection.py -) - -add_python_package("python.tests.gui.ertshell" ${PYTHON_INSTALL_PREFIX}/tests/gui/ertshell "${TEST_SOURCES}" False) - -addPythonTest(gui.ertshell.analysis gui.ertshell.test_ertshell_analysis.ErtShellAnalysisModuleTest) -addPythonTest(gui.ertshell.context gui.ertshell.test_ertshell_context.ErtShellContextTest) -addPythonTest(gui.ertshell.observations gui.ertshell.test_ertshell_observations.ErtShellObservationsTest) -addPythonTest(gui.ertshell.plot_settings gui.ertshell.test_ertshell_plot_settings.ErtShellPlotSettingsTest) -addPythonTest(gui.ertshell.smoother gui.ertshell.test_ertshell_smoother.ErtShellSmootherTest) -addPythonTest(gui.ertshell.server gui.ertshell.test_ertshell_server.ErtShellServerTest) - -addPythonTest(gui.ertshell.shell_function gui.ertshell.test_shell_function.ShellFunctionTest) -addPythonTest(gui.ertshell.shell_property gui.ertshell.test_shell_property.ShellPropertyTest) -addPythonTest(gui.ertshell.shell_collection gui.ertshell.test_shell_collection.ShellCollectionTest) \ No newline at end of file diff --git a/ThirdParty/Ert/python/tests/gui/ertshell/__init__.py b/ThirdParty/Ert/python/tests/gui/ertshell/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/python/tests/gui/ertshell/ert_shell_test_context.py b/ThirdParty/Ert/python/tests/gui/ertshell/ert_shell_test_context.py deleted file mode 100644 index b5f025e32d..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ertshell/ert_shell_test_context.py +++ /dev/null @@ -1,56 +0,0 @@ -from StringIO import StringIO -import os -import sys -from ert.test import TestAreaContext -from ert_gui.shell import ErtShell - -class ShellCapturing(list): - - def __init__(self, shell): - self.shell = shell - - def __enter__(self): - self._stdout = sys.stdout - self._shell_stdout = self.shell.stdout - sys.stdout = self.shell.stdout = self._stringio = StringIO() - return self - - def __exit__(self, *args): - self.extend(self._stringio.getvalue().splitlines()) - sys.stdout = self._stdout - self.shell.stdout = self._shell_stdout - - - -class ErtShellTestContext(object): - - def __init__(self, test_name, config_file, load_config=True, prefix=None, store_area=False): - self.config_file = config_file - self.load_config = load_config - self.test_area_context = TestAreaContext(test_name, prefix=prefix, store_area=store_area) - - - def __enter__(self): - """ :rtype: ErtShell """ - test_area = self.test_area_context.__enter__() - - if os.path.exists(self.config_file): - test_area.copy_parent_content(self.config_file) - elif self.config_file is not None: - raise IOError("The config file: '%s' does not exist!" % self.config_file) - - self.shell = ErtShell(forget_history=True) - - config_file = os.path.basename(self.config_file) - - if self.load_config: - self.shell.onecmd("load_config %s" % config_file) - - return self.shell - - - def __exit__(self, exc_type, exc_val, exc_tb): - self.shell.do_exit("") - self.shell._cleanup() - self.test_area_context.__exit__(exc_type, exc_val, exc_tb) - return False \ No newline at end of file diff --git a/ThirdParty/Ert/python/tests/gui/ertshell/test_ertshell_analysis.py b/ThirdParty/Ert/python/tests/gui/ertshell/test_ertshell_analysis.py deleted file mode 100644 index f974b17124..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ertshell/test_ertshell_analysis.py +++ /dev/null @@ -1,46 +0,0 @@ -from ert.test.extended_testcase import ExtendedTestCase -from tests.gui.ertshell.ert_shell_test_context import ErtShellTestContext - - -class ErtShellAnalysisModuleTest(ExtendedTestCase): - - def test_analysis_module(self): - test_config = self.createTestPath("local/custom_kw/mini_config") - - with ErtShellTestContext("python/ertshell/analysis_module", test_config) as shell: - - self.assertTrue(shell.invokeCommand("analysis_module active_module")) - self.assertTrue(shell.invokeCommand("analysis_module list")) - - modules = shell.shellContext().ert().analysisConfig().getModuleList() - - for analysis_module in modules: - self.assertTrue(shell.invokeCommand("analysis_module active_module %s" % analysis_module)) - active_module_name = shell.shellContext().ert().analysisConfig().activeModuleName() - self.assertEqual(analysis_module, active_module_name) - - self.assertTrue(shell.invokeCommand("analysis_module variables")) - - analysis_module = shell.shellContext().ert().analysisConfig().getActiveModule() - variable_names = analysis_module.getVariableNames() - - for variable_name in variable_names: - value = analysis_module.getVariableValue(variable_name) - - variable_type = analysis_module.getVariableType(variable_name) - - if variable_type is float: - new_value = value + 0.5 - elif variable_type is int: - new_value = value + 2 - elif variable_type is str: - new_value = "New String Value" - else: - new_value = not value - - self.assertTrue(shell.invokeCommand("analysis_module set %s %s" % (variable_name, new_value))) - - updated_value = analysis_module.getVariableValue(variable_name) - - self.assertEqual(new_value, updated_value) - diff --git a/ThirdParty/Ert/python/tests/gui/ertshell/test_ertshell_context.py b/ThirdParty/Ert/python/tests/gui/ertshell/test_ertshell_context.py deleted file mode 100644 index a83d860d7a..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ertshell/test_ertshell_context.py +++ /dev/null @@ -1,31 +0,0 @@ -import os -from ert.test import ExtendedTestCase -from tests.gui.ertshell.ert_shell_test_context import ErtShellTestContext, ShellCapturing - - -class ErtShellContextTest(ExtendedTestCase): - - def test_ertshell_context(self): - test_config = self.createTestPath("local/custom_kw/mini_config") - - with ErtShellTestContext("python/ertshell/ert_shell_context", config_file=test_config, load_config=False) as shell: - self.assertIsNone(shell.shellContext().ert()) - self.assertTrue(shell.invokeCommand("load_config mini_config")) - self.assertIsNotNone(shell.shellContext().ert()) - - - def test_std_out_capture(self): - - test_config = self.createTestPath("local/custom_kw/mini_config") - - with ErtShellTestContext("python/ertshell/ert_shell_context", config_file=test_config, load_config=False) as shell: - - with ShellCapturing(shell) as out: - shell.onecmd("cwd") - - cwd = out[0] - prefix = "Current directory: " - self.assertTrue(cwd.startswith(prefix)) - - self.assertEqual(os.getcwd(), cwd[len(prefix):]) - diff --git a/ThirdParty/Ert/python/tests/gui/ertshell/test_ertshell_observations.py b/ThirdParty/Ert/python/tests/gui/ertshell/test_ertshell_observations.py deleted file mode 100644 index 391f2516c0..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ertshell/test_ertshell_observations.py +++ /dev/null @@ -1,28 +0,0 @@ -from ert.test import ExtendedTestCase -from tests.gui.ertshell.ert_shell_test_context import ErtShellTestContext - -class ErtShellObservationsTest(ExtendedTestCase): - - def test_load_observations(self): - test_config = self.createTestPath("local/custom_kw/mini_config") - - with ErtShellTestContext("python/ertshell/observations", test_config) as shell: - ert = shell.shellContext().ert() - original_observation_count = len(ert.getObservations()) - - self.assertTrue(shell.invokeCommand("observations list")) - - self.assertTrue(shell.invokeCommand("observations clear")) - self.assertEqual(0, len(ert.getObservations())) - - self.assertTrue(shell.invokeCommand("observations load Observations/observation_1")) - self.assertEqual(1, len(ert.getObservations())) - - self.assertTrue(shell.invokeCommand("observations load Observations/observation_2")) - self.assertEqual(2, len(ert.getObservations())) - - self.assertTrue(shell.invokeCommand("observations load Observations/observation_3")) - self.assertEqual(original_observation_count, len(ert.getObservations())) - - self.assertTrue(shell.invokeCommand("observations reload Observations/observation_1")) - self.assertEqual(1, len(ert.getObservations())) diff --git a/ThirdParty/Ert/python/tests/gui/ertshell/test_ertshell_plot_settings.py b/ThirdParty/Ert/python/tests/gui/ertshell/test_ertshell_plot_settings.py deleted file mode 100644 index c5ba0793e7..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ertshell/test_ertshell_plot_settings.py +++ /dev/null @@ -1,60 +0,0 @@ -from ert.test import ExtendedTestCase -from tests.gui.ertshell.ert_shell_test_context import ErtShellTestContext - - -class ErtShellPlotSettingsTest(ExtendedTestCase): - def checkStringProperties(self, shell, command, testFunction, allow_multiple_arguments=True): - self.assertTrue(shell.invokeCommand(command)) - - spacey_string = "new value with spaces" - if allow_multiple_arguments: - self.assertTrue(shell.invokeCommand("%s %s" % (command, spacey_string))) - self.assertEqual(testFunction(), spacey_string) - else: - self.assertFalse(shell.invokeCommand("%s %s" % (command, spacey_string))) - self.assertNotEqual(testFunction(), spacey_string) - - no_spacey_string = "new_value_without_spaces" - self.assertTrue(shell.invokeCommand("%s %s" % (command, no_spacey_string))) - self.assertEqual(testFunction(), no_spacey_string) - - - def checkBoolProperties(self, shell, command, testFunction): - start_value = testFunction() - self.assertTrue(shell.invokeCommand(command)) - self.assertTrue(shell.invokeCommand("%s %s" % (command, str(not start_value)))) - self.assertNotEqual(start_value, testFunction()) - self.assertFalse(shell.invokeCommand("%s not_a_bool" % command)) - - - def test_style_setting(self): - test_config = self.createTestPath("local/custom_kw/mini_config") - with ErtShellTestContext("python/ertshell/plot_settings", test_config, load_config=True) as shell: - plot_config = shell.shellContext()["plot_settings"].plotConfig() - - self.assertTrue(shell.invokeCommand("help plot_settings")) - - self.checkStringProperties(shell, "plot_settings title", plot_config.title) - self.checkStringProperties(shell, "plot_settings x_label", plot_config.xLabel) - self.checkStringProperties(shell, "plot_settings y_label", plot_config.yLabel) - - self.checkBoolProperties(shell, "plot_settings grid", plot_config.isGridEnabled) - self.checkBoolProperties(shell, "plot_settings legend", plot_config.isLegendEnabled) - self.checkBoolProperties(shell, "plot_settings refcase", plot_config.isRefcaseEnabled) - self.checkBoolProperties(shell, "plot_settings observations", plot_config.isObservationsEnabled) - - self.checkStringProperties(shell, "plot_settings path", shell.shellContext()["plot_settings"].getPath, allow_multiple_arguments=False) - - default_plot_cases = shell.shellContext()["plot_settings"].getCurrentPlotCases() - self.assertTrue(shell.invokeCommand("plot_settings current")) - self.assertTrue(shell.invokeCommand("plot_settings select test_run default")) - - plot_cases = shell.shellContext()["plot_settings"].getCurrentPlotCases() - self.assertSetEqual(set(plot_cases), {"test_run", "default"}) - - self.assertTrue(shell.invokeCommand("plot_settings select")) - plot_cases = shell.shellContext()["plot_settings"].getCurrentPlotCases() - self.assertListEqual(plot_cases, default_plot_cases) - - self.assertFalse(shell.invokeCommand("plot_settings select unknown")) - self.assertFalse(shell.invokeCommand("plot_settings select unknown1 unknown2")) diff --git a/ThirdParty/Ert/python/tests/gui/ertshell/test_ertshell_server.py b/ThirdParty/Ert/python/tests/gui/ertshell/test_ertshell_server.py deleted file mode 100644 index 6aea6ce930..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ertshell/test_ertshell_server.py +++ /dev/null @@ -1,23 +0,0 @@ -from ert.test import ExtendedTestCase -from tests.gui.ertshell.ert_shell_test_context import ErtShellTestContext - - -class ErtShellServerTest(ExtendedTestCase): - - def test_server(self): - config = self.createTestPath("local/snake_oil_no_data/snake_oil.ert") - with ErtShellTestContext("python/ertshell/server", config, load_config=False) as shell: - server_settings = shell.shellContext()["server_settings"] - self.assertTrue(shell.invokeCommand("help server")) - - self.assertTrue(shell.invokeCommand("server hostname")) - self.assertEqual(server_settings._hostname, "localhost") - - self.assertTrue(shell.invokeCommand("server hostname new.hostname.no")) - self.assertEqual(server_settings._hostname, "new.hostname.no") - - self.assertTrue(shell.invokeCommand("server port")) - self.assertEqual(server_settings._port, 0) - - self.assertTrue(shell.invokeCommand("server port 99")) - self.assertEqual(server_settings._port, 99) diff --git a/ThirdParty/Ert/python/tests/gui/ertshell/test_ertshell_smoother.py b/ThirdParty/Ert/python/tests/gui/ertshell/test_ertshell_smoother.py deleted file mode 100644 index 3646b6d0ca..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ertshell/test_ertshell_smoother.py +++ /dev/null @@ -1,53 +0,0 @@ -from __future__ import print_function -import os -from ert.enkf.export import GenKwCollector -from ert.test.extended_testcase import ExtendedTestCase -from tests.gui.ertshell.ert_shell_test_context import ErtShellTestContext - -class ErtShellSmootherTest(ExtendedTestCase): - - def test_smoother(self): - test_config = self.createTestPath("local/custom_kw/mini_config") - - with ErtShellTestContext("python/ertshell/smoother", test_config) as shell: - print(os.getcwd()) - shell.invokeCommand("case select test_run") - - self.assertTrue(shell.invokeCommand("smoother update test_run_update")) - - shell.invokeCommand("case select test_run_update") - - ert = shell.shellContext().ert() - data = GenKwCollector.loadAllGenKwData(ert, "test_run", keys=["PERLIN_PARAM:SCALE"]) - update_data = GenKwCollector.loadAllGenKwData(ert, "test_run_update", keys=["PERLIN_PARAM:SCALE"]) - - self.assertTrue(data["PERLIN_PARAM:SCALE"].std() > update_data["PERLIN_PARAM:SCALE"].std()) - - - def test_config(self): - test_config = self.createTestPath("local/custom_kw/mini_config") - - with ErtShellTestContext("python/ertshell/smoother_config", test_config) as shell: - - analysis_config = shell.shellContext().ert().analysisConfig() - - self.assertTrue(shell.invokeCommand("smoother overlap_alpha")) - self.assertTrue(shell.invokeCommand("smoother overlap_alpha 3.1415")) - self.assertAlmostEqual(3.1415, analysis_config.getEnkfAlpha()) - self.assertFalse(shell.invokeCommand("smoother overlap_alpha threepointfourteen")) - - self.assertTrue(shell.invokeCommand("smoother std_cutoff")) - self.assertTrue(shell.invokeCommand("smoother std_cutoff 0.1")) - self.assertAlmostEqual(0.1, analysis_config.getStdCutoff()) - self.assertTrue(shell.invokeCommand("smoother std_cutoff -0.1")) - self.assertAlmostEqual(0.0, analysis_config.getStdCutoff()) - self.assertFalse(shell.invokeCommand("smoother std_cutoff zeropointthreefourteen")) - - - self.assertTrue(shell.invokeCommand("smoother global_std_scaling")) - self.assertTrue(shell.invokeCommand("smoother global_std_scaling 0.5")) - self.assertAlmostEqual(0.5, analysis_config.getGlobalStdScaling()) - self.assertTrue(shell.invokeCommand("smoother global_std_scaling -0.5")) - self.assertAlmostEqual(0.0, analysis_config.getGlobalStdScaling()) - self.assertFalse(shell.invokeCommand("smoother global_std_scaling zeropointfour")) - diff --git a/ThirdParty/Ert/python/tests/gui/ertshell/test_shell_collection.py b/ThirdParty/Ert/python/tests/gui/ertshell/test_shell_collection.py deleted file mode 100644 index 763d9f1799..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ertshell/test_shell_collection.py +++ /dev/null @@ -1,97 +0,0 @@ -from ert.test import ExtendedTestCase -from ert_gui.shell.libshell import ShellCollection - - -class MockParent(object): - def __init__(self, name="DefaultMockParent"): - self.__name = name - self.__failed = False - - def shellContext(self): - return self - - def shell(self): - return self - - def columnize(self, items, size): - print(items) - - def lastCommandFailed(self, message): - print("[%s] Error: %s" % (self.__name, message)) - self.__failed = True - - def didLastCommandFail(self): - failed = self.__failed - self.__failed = False - return failed - - -def completeMock(line): - last_space_index = line.rfind(" ") - begin_index = 0 if last_space_index == -1 else last_space_index + 1 - end_index = len(line) - text = line[begin_index:end_index] - - return text, line, begin_index, end_index - - -class ShellCollectionTest(ExtendedTestCase): - - def test_creation(self): - name = "test" - shell_collection = ShellCollection(name) - - parent = MockParent() - shell_collection.setParent(parent) - - self.assertEqual(shell_collection.name, name) - - self.assertTrue(hasattr(parent, "do_%s" % name)) - self.assertTrue(hasattr(parent, "complete_%s" % name)) - self.assertTrue(hasattr(parent, "help_%s" % name)) - - - def test_sub_collection(self): - l1 = "level_1" - l2 = "level_2" - l3 = "level_3" - - root = MockParent() - level_1 = ShellCollection(l1) - level_1.setParent(root) - level_2 = ShellCollection(l2) - level_1.addCollection(level_2) - level_3 = ShellCollection(l3) - level_2.addCollection(level_3) - - tests = [(root, l1), (level_1, l2), (level_2, l3)] - - for parent, name in tests: - self.assertTrue(hasattr(parent, "do_%s" % name)) - self.assertTrue(hasattr(parent, "complete_%s" % name)) - self.assertTrue(hasattr(parent, "help_%s" % name)) - - root.do_level_1("level_2 ") - self.assertFalse(root.didLastCommandFail()) - - root.do_level_1("r ") - self.assertTrue(root.didLastCommandFail()) - - root.do_level_1(" level_2 level_3") - self.assertFalse(root.didLastCommandFail()) - - root.do_level_1("level_2 level_3 p") - self.assertTrue(root.didLastCommandFail()) - - result = root.complete_level_1(*completeMock("level_1 ")) - self.assertListEqual(result, [l2]) - - result = root.complete_level_1(*completeMock("level_1 lev")) - self.assertListEqual(result, [l2]) - - result = root.complete_level_1(*completeMock("level_1 level_2 ")) - self.assertListEqual(result, [l3]) - - root.help_level_1() - level_1.help_level_2() - level_2.help_level_3() diff --git a/ThirdParty/Ert/python/tests/gui/ertshell/test_shell_function.py b/ThirdParty/Ert/python/tests/gui/ertshell/test_shell_function.py deleted file mode 100644 index 9b76956a2b..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ertshell/test_shell_function.py +++ /dev/null @@ -1,148 +0,0 @@ -from ert.test import ExtendedTestCase -from ert_gui.shell.libshell import ShellFunction - - -class TestTarget(object): - def __init__(self, name="DefaultTestTarget"): - self.__name = name - self.__failed = False - - def lastCommandFailed(self, message): - print("[%s] Error: %s" % (self.__name, message)) - self.__failed = True - - def didLastCommandFail(self): - return self.__failed - - def resetFailedFlag(self): - self.__failed = False - - def getModelForFunction(self, function_name): - if function_name == "test_function": - return self - else: - return {"key": "value"} - - -def dummyFunction(model, line): - print("[Dummy] Received line: %s" % line) - - -def completeMock(line): - last_space_index = line.rfind(" ") - begin_index = 0 if last_space_index == -1 else last_space_index + 1 - end_index = len(line) - text = line[begin_index:end_index] - - return text, line, begin_index, end_index - - -class ShellFunctionTest(ExtendedTestCase): - - def test_creation(self): - target = TestTarget() - name = "test_function" - shell_function = ShellFunction(name, dummyFunction, None) - shell_function.setParent(target) - - self.assertTrue(hasattr(target, "do_%s" % name)) - self.assertTrue(hasattr(target, "complete_%s" % name)) - self.assertTrue(hasattr(target, "help_tuple_%s" % name)) - - def test_no_parent(self): - target = TestTarget() - name = "test_function" - shell_function = ShellFunction(name, dummyFunction, None) - - self.assertFalse(hasattr(target, "do_%s" % name)) - self.assertFalse(hasattr(target, "complete_%s" % name)) - self.assertFalse(hasattr(target, "help_tuple_%s" % name)) - - with self.assertRaises(AttributeError): - shell_function.doFunction("nonsense") - - - def test_failed_creation(self): - shell_function = ShellFunction("test_function", dummyFunction) - with self.assertRaises(ValueError): - shell_function.setParent(None) - - with self.assertRaises(ValueError): - ShellFunction("test_function", None) - - - def test_duplicate_function(self): - target = TestTarget() - shell_function = ShellFunction("duplicate", dummyFunction) - shell_function.setParent(target) - - with self.assertRaises(ValueError): - duplicate = ShellFunction("duplicate", dummyFunction) - duplicate.setParent(target) - - def test_addition_of_help(self): - target = TestTarget() - - name = "test_function" - help_arguments = "%s args" % name - help_message = "%s msg" % name - shell_function = ShellFunction(name, str, None, help_arguments=help_arguments, help_message=help_message) - shell_function.setParent(target) - - help_function = getattr(target, "help_tuple_%s" % name) - - cmd_name, args, msg = help_function() - self.assertEqual(cmd_name, name) - self.assertEqual(args, help_arguments) - self.assertEqual(msg, help_message) - self.assertFalse(target.didLastCommandFail()) - - def test_function_with_target_as_model(self): - target = TestTarget() - - def checkModel(model, line): - self.assertIsInstance(model, TestTarget) - self.assertEqual(line, "some text to parse") - - shell_function = ShellFunction("test_function", checkModel) - shell_function.setParent(target) - target.do_test_function("some text to parse") - - def test_function_with_custom_model(self): - target = TestTarget() - - def checkModel(model, line): - self.assertIsInstance(model, dict) - self.assertTrue("key" in model) - self.assertEqual(line, "some other text to parse") - - shell_function = ShellFunction("other_test_function", checkModel) - shell_function.setParent(target) - target.do_other_test_function("some other text to parse") - - def test_completion(self): - target = TestTarget() - - def completer(model, text, line, begidx, endidx): - text = text.strip().lower() - - if text == "s": - return ["Large"] - elif text == "l": - return ["Small"] - elif text == "m": - return ["Medium"] - else: - return [] - - shell_function = ShellFunction("test_function", dummyFunction, completer) - shell_function.setParent(target) - - result = target.complete_test_function(*completeMock("s")) - self.assertEqual(result, ["Large"]) - - result = target.complete_test_function(*completeMock("l")) - self.assertEqual(result, ["Small"]) - - result = target.complete_test_function(*completeMock("")) - self.assertEqual(result, []) diff --git a/ThirdParty/Ert/python/tests/gui/ertshell/test_shell_property.py b/ThirdParty/Ert/python/tests/gui/ertshell/test_shell_property.py deleted file mode 100644 index 1925f424b3..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ertshell/test_shell_property.py +++ /dev/null @@ -1,317 +0,0 @@ -from ert.test.extended_testcase import ExtendedTestCase -from ert_gui.shell.libshell import ShellProperty, boolValidator, createListValidator, createFloatValidator - - -class TestModel(object): - STATUSES = ["OK", "Error", "Unknown"] - - def __init__(self, name="TestModel"): - self.__enabled = True - self.__status = "OK" - self.__name = name - self.__description = None - self.__threshold = 0.5 - self.__priority = 1 - - def setEnabled(self, enabled): - self.__enabled = enabled - - def isEnabled(self): - return self.__enabled - - def setStatus(self, status): - self.__status = status - - def status(self): - return self.__status - - def statusCompleter(self, text, line, begidx, endidx): - def test(status, text): - status = status.lower() - text = text.lower() - return status != self.status().lower() and status.startswith(text) - return [status for status in TestModel.STATUSES if test(status, text)] - - def statusValidator(self, value): - if value.lower() == self.status().lower(): - raise ValueError("Value can not be set to current value!") - - for status in TestModel.STATUSES: - if value.lower() == str(status).lower(): - return status - - raise ValueError("Unknown value") - - - def name(self): - return self.__name - - def setDescription(self, description): - self.__description = description - - def description(self): - return self.__description - - @property - def threshold(self): - return self.__threshold - - @threshold.setter - def threshold(self, threshold): - self.__threshold = max(0.0, min(threshold, 1.0)) - - @property - def priority(self): - return self.__priority - - @priority.setter - def priority(self, priority): - try: - priority = int(priority) - self.__priority = priority - except ValueError as error: - self.__priority = 0 - - -class TestTarget(object): - def __init__(self, model, name="DefaultTestTarget"): - self.__model = model - self.__name = name - self.__failed = False - - def lastCommandFailed(self, message): - print("[%s] Error: %s" % (self.__name, message)) - self.__failed = True - - def didLastCommandFail(self): - return self.__failed - - def resetFailedFlag(self): - self.__failed = False - - def getModelForProperty(self, property_name): - return self.__model - - -def completeMock(line): - last_space_index = line.rfind(" ") - begin_index = 0 if last_space_index == -1 else last_space_index + 1 - end_index = len(line) - text = line[begin_index:end_index] - - return text, line, begin_index, end_index - - -class ShellPropertyTest(ExtendedTestCase): - def setUp(self): - self.properties = { - "enabled": ("enabled", TestModel.isEnabled, TestModel.setEnabled), - "status": ("status", TestModel.status, TestModel.setStatus), - "priority": ("priority", TestModel.priority, TestModel.priority), - "name": ("name", TestModel.name, None), - "description": ("description", TestModel.description, TestModel.setDescription), - "threshold": ("threshold", TestModel.threshold, TestModel.threshold) - } - - self.completers = { - "enabled": ["true", "false"], - "status": TestModel.statusCompleter, - "threshold": None, - "priority": [1, 2, 3, 4, 5], - "name": None, - "description": None - } - - self.validators = { - "enabled": boolValidator, - "status": TestModel.statusValidator, - "threshold": createFloatValidator(0.0, 1.0), - "priority": createListValidator(self.completers["priority"]), - "name": None, - "description": None - } - - def test_creation_and_check_existence_of_do_complete_help(self): - target = TestTarget(TestModel()) - for key, (name, getter, setter) in self.properties.items(): - shell_property = ShellProperty(name, getter, setter) - shell_property.setParent(target) - - self.assertTrue(hasattr(target, "do_%s" % name)) - self.assertTrue(hasattr(target, "complete_%s" % name)) - self.assertTrue(hasattr(target, "help_tuple_%s" % name)) - - - def test_addition_of_help(self): - target = TestTarget(TestModel()) - - for key, (name, getter, setter) in self.properties.items(): - help_arguments = "%s args" % name - help_message = "%s msg" % name - shell_property = ShellProperty(name, getter, setter, help_arguments=help_arguments, help_message=help_message) - shell_property.setParent(target) - - help_function = getattr(target, "help_tuple_%s" % name) - - cmd_name, args, msg = help_function() - self.assertEqual(cmd_name, name) - self.assertEqual(args, help_arguments) - self.assertEqual(msg, help_message) - self.assertFalse(target.didLastCommandFail()) - - - def test_no_parent(self): - target = TestTarget(TestModel()) - for key, (name, getter, setter) in self.properties.items(): - shell_property = ShellProperty(name, getter, setter) - - self.assertFalse(hasattr(target, "do_%s" % name)) - self.assertFalse(hasattr(target, "complete_%s" % name)) - self.assertFalse(hasattr(target, "help_tuple_%s" % name)) - - with self.assertRaises(AttributeError): - shell_property.doFunction("") - - def test_duplicate_properties(self): - target = TestTarget(TestModel()) - shell_property = ShellProperty("test", str, None) - shell_property.setParent(target) - - with self.assertRaises(ValueError): - shell_property = ShellProperty("test", str, None) - shell_property.setParent(target) - - - - def test_read_only_property(self): - property_name = "name" - tests = [ - ("", "TestModel", False), - ("new_name", "TestModel", True), - ] - - completions = [ - ("", []), - ] - - self.runPropertyTests(property_name, tests, completions) - - - def test_bool_property(self): - property_name = "enabled" - tests = [ - ("", True, False), - ("False", False, False), - ("g", False, True), - ("yes", True, False), - ] - - completions = [ - ("", self.completers[property_name]), - ("f", ["false"]), - ("t", ["true"]), - ("q", []) - ] - - self.runPropertyTests(property_name, tests, completions) - - def test_string_property(self): - property_name = "description" - tests = [ - ("", None, False), - ("a description", "a description", False), - ("1234", "1234", False), - ] - - completions = [ - ("", []), - ("q", []), - ] - - self.runPropertyTests(property_name, tests, completions) - - - def test_choice_property(self): - property_name = "status" - tests = [ - ("", "OK", False), - ("ERROR", "Error", False), - ("DING", "Error", True), - ] - - completions = [ - ("", ["OK", "Unknown"]), - ("e", []), - ("u", ["Unknown"]), - ("q", []) - ] - - self.runPropertyTests(property_name, tests, completions) - - - def test_float_property(self): - property_name = "threshold" - tests = [ - ("", 0.5, False), - ("0.7", 0.7, False), - ("1.1", 1.0, False), - ("0", 0.0, False), - ("zero", 0.0, True) - ] - - completions = [ - ("", []), - ("1", []), - ("e", []) - ] - - self.runPropertyTests(property_name, tests, completions) - - - def test_int_list_property(self): - property_name = "priority" - tests = [ - ("", 1, False), - ("2", 2, False), - ("6", 2, True), - ] - - completions = [ - ("", self.completers[property_name]), - ("5", [5]), - ("e", []) - ] - - self.runPropertyTests(property_name, tests, completions) - - - def runPropertyTests(self, property_name, tests, completions): - model = TestModel() - target = TestTarget(model) - - name, getter, setter = self.properties[property_name] - shell_property = ShellProperty(name, getter, setter, self.validators[property_name], self.completers[property_name]) - shell_property.setParent(target) - - doFunc = getattr(target, "do_%s" % property_name) - for do_input, expected_value, fail in tests: - doFunc(do_input) - - if isinstance(getter, property): - model_value = getter.__get__(model) - else: - model_value = getter(model) - - self.assertEqual(expected_value, model_value) - - if fail: - self.assertTrue(target.didLastCommandFail()) - else: - self.assertFalse(target.didLastCommandFail()) - - target.resetFailedFlag() - - completeFunc = getattr(target, "complete_%s" % property_name) - for complete_input, expected_value in completions: - choices = completeFunc(*completeMock(complete_input)) - self.assertListEqual(choices, expected_value) \ No newline at end of file diff --git a/ThirdParty/Ert/python/tests/gui/ide/CMakeLists.txt b/ThirdParty/Ert/python/tests/gui/ide/CMakeLists.txt deleted file mode 100644 index 64135b2519..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ide/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -set(PYTHON_SOURCES - __init__.py - test_bool_argument.py - test_configuration_line.py - test_configuration_line_builder.py - test_configuration_line_definition.py - test_configuration_line_parser.py - test_ert_keywords.py - test_float_argument.py - test_integer_argument.py - test_path_argument.py - test_percent_argument.py - test_proper_name_argument.py - test_proper_name_format_argument.py - test_proper_name_format_string_argument.py - test_range_string_argument.py - test_tokens.py -) - -add_python_package("python.tests.gui.ide" ${PYTHON_INSTALL_PREFIX}/tests/gui/ide "${PYTHON_SOURCES}" True) - -addPythonTest(gui.ide.bool_argument tests.gui.ide.test_bool_argument.BoolArgumentTest) -addPythonTest(gui.ide.integer_argument tests.gui.ide.test_integer_argument.IntegerArgumentTest) -addPythonTest(gui.ide.float_argument tests.gui.ide.test_float_argument.FloatArgumentTest) -addPythonTest(gui.ide.path_argument tests.gui.ide.test_path_argument.PathArgumentTest) -addPythonTest(gui.ide.proper_name_argument tests.gui.ide.test_proper_name_argument.ProperNameArgumentTest) -addPythonTest(gui.ide.proper_name_format_argument tests.gui.ide.test_proper_name_format_argument.ProperNameFormatArgumentTest) -addPythonTest(gui.ide.proper_name_format_string_argument tests.gui.ide.test_proper_name_format_string_argument.ProperNameFormatStringArgumentTest) -addPythonTest(gui.ide.range_string_argument tests.gui.ide.test_range_string_argument.RangeStringArgumentTest) -addPythonTest(gui.ide.test_configuration_line tests.gui.ide.test_configuration_line.ConfigurationLineTest) -addPythonTest(gui.ide.test_configuration_line_builder tests.gui.ide.test_configuration_line_builder.ConfigurationLineBuilderTest) -addPythonTest(gui.ide.test_configuration_line_definition tests.gui.ide.test_configuration_line_definition.ConfigurationLineDefinitionTest) -addPythonTest(gui.ide.test_configuration_line_parser tests.gui.ide.test_configuration_line_parser.ConfigurationLineParserTest) -addPythonTest(gui.ide.ert_keywords tests.gui.ide.test_ert_keywords.ErtKeywordTest) -addPythonTest(gui.ide.tokens tests.gui.ide.test_tokens.TokenTest) - -add_subdirectory(wizards) diff --git a/ThirdParty/Ert/python/tests/gui/ide/__init__.py b/ThirdParty/Ert/python/tests/gui/ide/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/python/tests/gui/ide/test_bool_argument.py b/ThirdParty/Ert/python/tests/gui/ide/test_bool_argument.py deleted file mode 100644 index 5f9cdeea62..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ide/test_bool_argument.py +++ /dev/null @@ -1,53 +0,0 @@ -from ert_gui.ide.keywords.definitions import BoolArgument -from ert.test import ExtendedTestCase - - -class BoolArgumentTest(ExtendedTestCase): - - - - def test_bool_argument(self): - bool_arg = BoolArgument() - - validation_status = bool_arg.validate("TRUE") - self.assertTrue(validation_status) - self.assertTrue(validation_status.value()) - self.assertEqual(validation_status.message(), "") - - validation_status = bool_arg.validate("FALSE") - self.assertTrue(validation_status) - self.assertFalse(validation_status.value()) - self.assertEqual(validation_status.message(), "") - - validation_status = bool_arg.validate("True") - self.assertTrue(validation_status) - - validation_status = bool_arg.validate("False") - self.assertTrue(validation_status) - - validation_status = bool_arg.validate(" FALSE") - self.assertFalse(validation_status) - self.assertEqual(validation_status.message(), bool_arg.NOT_BOOL) - - self.assertTrue(bool_arg.validate("T")) - self.assertTrue(bool_arg.validate("F")) - self.assertTrue(bool_arg.validate("0")) - self.assertTrue(bool_arg.validate("1")) - self.assertTrue(bool_arg.validate("TrUe")) - self.assertTrue(bool_arg.validate("FaLsE")) - - self.assertFalse(bool_arg.validate("t")) - self.assertFalse(bool_arg.validate("f")) - self.assertFalse(bool_arg.validate("Tr")) - - self.assertTrue(bool_arg.validate("T").value()) - self.assertFalse(bool_arg.validate("F").value()) - - - - - - - - - diff --git a/ThirdParty/Ert/python/tests/gui/ide/test_configuration_line.py b/ThirdParty/Ert/python/tests/gui/ide/test_configuration_line.py deleted file mode 100644 index 8961cb3268..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ide/test_configuration_line.py +++ /dev/null @@ -1,72 +0,0 @@ -from ert_gui.ide.keywords.data import ConfigurationLine, Keyword, Argument -from ert_gui.ide.keywords.definitions import StringArgument -from ert_gui.ide.keywords.definitions.keyword_definition import KeywordDefinition -from ert.test import ExtendedTestCase - - -class ConfigurationLineTest(ExtendedTestCase): - - def test_configuration_line_creation(self): - line = "KEYWORD arg1" - keyword = Keyword(0, 7, line) - argument = Argument(8, 12, line) - cl = ConfigurationLine(keyword=keyword, - arguments=[argument], - documentation_link="help/link", - group="group", - required=True) - - self.assertEqual(cl.keyword(), keyword) - self.assertEqual(cl.arguments()[0], argument) - - self.assertEqual(cl.documentationLink(), "help/link") - self.assertEqual(cl.group(), "group") - self.assertTrue(cl.isRequired()) - - self.assertFalse(cl.validationStatusForToken(keyword)) - self.assertFalse(cl.validationStatusForToken(argument)) - - - - def test_configuration_line(self): - - keyword_def = KeywordDefinition("KEYWORD") - arg1_def = StringArgument() - - line = "KEYWORD string 2" - keyword = Keyword(0, 7, line) - self.assertEqual(keyword.value(), "KEYWORD") - - keyword.setKeywordDefinition(keyword_def) - - arg1 = Argument(8, 14, line) - self.assertEqual(arg1.value(), "string") - arg1.setArgumentDefinition(arg1_def) - - arg2 = Argument(15, 16, line) - self.assertEqual(arg2.value(), "2") - - - cl = ConfigurationLine(keyword=keyword, - arguments=[arg1, arg2], - documentation_link="help", - group="test_group", - required=True) - - self.assertTrue(cl.keyword().hasKeywordDefinition()) - self.assertEqual(cl.keyword().keywordDefinition(), keyword_def) - - self.assertEqual(len(cl.arguments()), 2) - - self.assertEqual(cl.arguments()[0], arg1) - self.assertTrue(cl.arguments()[0].hasArgumentDefinition()) - self.assertEqual(cl.arguments()[0].argumentDefinition(), arg1_def) - - self.assertEqual(cl.arguments()[1], arg2) - self.assertFalse(cl.arguments()[1].hasArgumentDefinition()) - self.assertIsNone(cl.arguments()[1].argumentDefinition()) - - self.assertFalse(cl.validationStatusForToken(keyword)) - self.assertTrue(cl.validationStatusForToken(arg1)) - self.assertFalse(cl.validationStatusForToken(arg2)) - diff --git a/ThirdParty/Ert/python/tests/gui/ide/test_configuration_line_builder.py b/ThirdParty/Ert/python/tests/gui/ide/test_configuration_line_builder.py deleted file mode 100644 index bf052ea79d..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ide/test_configuration_line_builder.py +++ /dev/null @@ -1,130 +0,0 @@ -from ert_gui.ide.keywords import ErtKeywords -from ert_gui.ide.keywords.configuration_line_builder import ConfigurationLineBuilder -from ert_gui.ide.keywords.definitions import ArgumentDefinition -from ert_gui.ide.keywords.data.configuration_line import ConfigurationLine -from ert.test import ExtendedTestCase - - -class ConfigurationLineBuilderTest(ExtendedTestCase): - - - - def test_num_realizations(self): - keywords = ErtKeywords() - clb = ConfigurationLineBuilder(keywords) - - test_line = "NUM_REALIZATIONS 25" - - clb.processLine(test_line) - - self.assertTrue(clb.hasConfigurationLine()) - self.assertFalse(clb.hasComment()) - self.assertEqual(clb.commentIndex(), -1) - - config_line = clb.configurationLine() - - self.assertEqual(config_line.keyword().value(), "NUM_REALIZATIONS") - self.assertEqual(config_line.keyword().keywordDefinition(), keywords["NUM_REALIZATIONS"].keywordDefinition()) - self.assertEqual(config_line.arguments()[0].value(), "25") - - def test_num_realizations_no_argument(self): - keywords = ErtKeywords() - clb = ConfigurationLineBuilder(keywords) - - test_line = "NUM_REALIZATIONS" - - clb.processLine(test_line) - - self.assertTrue(clb.hasConfigurationLine()) - - config_line = clb.configurationLine() - - self.assertEqual(config_line.keyword().value(), "NUM_REALIZATIONS") - self.assertEqual(config_line.keyword().keywordDefinition(), keywords["NUM_REALIZATIONS"].keywordDefinition()) - - arguments = config_line.arguments() - self.assertEqual(len(arguments), 1) - - self.assertFalse(config_line.validationStatusForToken(config_line.keyword())) - self.assertFalse(config_line.validationStatusForToken(arguments[0])) - - - def test_unknown_keyword_with_comment(self): - keywords = ErtKeywords() - clb = ConfigurationLineBuilder(keywords) - - test_line = "KEYWORD nothing --comment" - - clb.processLine(test_line) - - self.assertTrue(clb.hasConfigurationLine()) - - config_line = clb.configurationLine() - keyword = config_line.keyword() - self.assertFalse(config_line.validationStatusForToken(keyword)) - message = ConfigurationLine.UNKNOWN_KEYWORD + '\n' + ConfigurationLine.ARGUMENT_ERROR + '\n' + ConfigurationLine.ARGUMENT_NOT_EXPECTED - self.assertEqual(config_line.validationStatusForToken(keyword).message(), message) - - self.assertEqual(keyword.value(), "KEYWORD") - arguments = config_line.arguments() - - self.assertEqual(arguments[0].value(), "nothing") - self.assertIsNone(keyword.keywordDefinition()) - - self.assertTrue(clb.hasComment()) - self.assertEqual(clb.commentIndex(), 16) - - self.assertFalse(config_line.validationStatusForToken(arguments[0])) - self.assertEqual(config_line.validationStatusForToken(arguments[0]).message(), ConfigurationLine.ARGUMENT_NOT_EXPECTED) - - - def test_queue_option_keyword(self): - keywords = ErtKeywords() - clb = ConfigurationLineBuilder(keywords) - - test_line = "QUEUE_OPTION LSF LSF_BJOBS_CMD STRING AND STRING" - - clb.processLine(test_line) - config_line = clb.configurationLine() - - arguments = config_line.arguments() - - self.assertEqual(len(arguments), 3) - self.assertEqual(arguments[0].value(), "LSF") - self.assertEqual(arguments[1].value(), "LSF_BJOBS_CMD") - self.assertEqual(arguments[2].value(), "STRING AND STRING") - - print(config_line.validationStatusForToken(config_line.keyword())) - - self.assertTrue(config_line.validationStatusForToken(arguments[0])) - self.assertTrue(config_line.validationStatusForToken(arguments[1])) - self.assertTrue(config_line.validationStatusForToken(arguments[2])) - - - def test_queue_option_keyword_too_few_arguments(self): - keywords = ErtKeywords() - clb = ConfigurationLineBuilder(keywords) - - test_line = "QUEUE_OPTION LSF LSF_BJOBS_CMD" - - clb.processLine(test_line) - config_line = clb.configurationLine() - - arguments = config_line.arguments() - - self.assertEqual(len(arguments), 3) - - self.assertEqual(arguments[0].value(), "LSF") - self.assertEqual(arguments[1].value(), "LSF_BJOBS_CMD") - self.assertEqual(arguments[2].value(), "") - - self.assertFalse(config_line.validationStatusForToken(config_line.keyword())) - - self.assertTrue(config_line.validationStatusForToken(arguments[0])) - self.assertTrue(config_line.validationStatusForToken(arguments[1])) - self.assertFalse(config_line.validationStatusForToken(arguments[2])) - - self.assertEqual(config_line.validationStatusForToken(arguments[2]).message(), ArgumentDefinition.MISSING_ARGUMENT) - - - diff --git a/ThirdParty/Ert/python/tests/gui/ide/test_configuration_line_definition.py b/ThirdParty/Ert/python/tests/gui/ide/test_configuration_line_definition.py deleted file mode 100644 index bcccb60472..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ide/test_configuration_line_definition.py +++ /dev/null @@ -1,45 +0,0 @@ -from ert_gui.ide.keywords.definitions import ArgumentDefinition, KeywordDefinition, ConfigurationLineDefinition, IntegerArgument -from ert.test import ExtendedTestCase - - - - - -class ConfigurationLineDefinitionTest(ExtendedTestCase): - - def test_keyword_definition(self): - keyword = KeywordDefinition("KEYWORD") - self.assertEqual(keyword.name(), "KEYWORD") - - - def test_argument_definition(self): - arg_def = ArgumentDefinition(optional=True, built_in=True, rest_of_line=True) - - self.assertTrue(arg_def.isBuiltIn()) - self.assertTrue(arg_def.isOptional()) - self.assertTrue(arg_def.consumeRestOfLine()) - - - def test_configuration_line_definition(self): - - cld = ConfigurationLineDefinition(keyword=KeywordDefinition("KEYWORD"), - arguments=[IntegerArgument(from_value=1)], - documentation_link="help/path", - required=True, - group="Group") - - self.assertTrue(cld.isRequired()) - self.assertEqual(cld.documentationLink(), "help/path") - - keyword_definition = cld.keywordDefinition() - self.assertIsInstance(keyword_definition, KeywordDefinition) - self.assertEqual(keyword_definition.name(), "KEYWORD") - - argument_definitions = cld.argumentDefinitions() - self.assertIsInstance(argument_definitions, list) - self.assertEqual(len(argument_definitions), 1) - self.assertIsInstance(argument_definitions[0], IntegerArgument) - - - self.assertEqual(cld.group(), "Group") - diff --git a/ThirdParty/Ert/python/tests/gui/ide/test_configuration_line_parser.py b/ThirdParty/Ert/python/tests/gui/ide/test_configuration_line_parser.py deleted file mode 100644 index e02d154cd6..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ide/test_configuration_line_parser.py +++ /dev/null @@ -1,98 +0,0 @@ -from ert_gui.ide.keywords import ConfigurationLineParser -from ert_gui.ide.keywords.data import Argument -from ert.test import ExtendedTestCase - - -class ConfigurationLineParserTest(ExtendedTestCase): - - - def test_comments(self): - keyword_parser = ConfigurationLineParser() - - test_line = "-- comment" - keyword_parser.parseLine(test_line) - - self.assertTrue(keyword_parser.hasComment()) - self.assertEqual(keyword_parser.commentIndex(), 0) - self.assertFalse(keyword_parser.hasKeyword()) - self.assertIsNone(keyword_parser.keyword()) - self.assertEqual(keyword_parser.uncommentedText(), "") - - - test_line = " -- comment" - keyword_parser.parseLine(test_line) - - self.assertTrue(keyword_parser.hasComment()) - self.assertEqual(keyword_parser.commentIndex(), 5) - self.assertFalse(keyword_parser.hasKeyword()) - self.assertIsNone(keyword_parser.keyword()) - self.assertEqual(keyword_parser.uncommentedText(), " ") - - test_line = "NUM_REALIZATIONS-- comment" - keyword_parser.parseLine(test_line) - - self.assertTrue(keyword_parser.hasComment()) - self.assertEqual(keyword_parser.commentIndex(), 16) - self.assertTrue(keyword_parser.hasKeyword()) - self.assertEqual(keyword_parser.keyword().value(), "NUM_REALIZATIONS") - self.assertEqual(keyword_parser.uncommentedText(), "NUM_REALIZATIONS") - - test_line = "NUM_REALIZATIONS -- comment" - keyword_parser.parseLine(test_line) - - self.assertTrue(keyword_parser.hasComment()) - self.assertEqual(keyword_parser.commentIndex(), 17) - self.assertTrue(keyword_parser.hasKeyword()) - self.assertEqual(keyword_parser.keyword().value(), "NUM_REALIZATIONS") - self.assertEqual(keyword_parser.uncommentedText(), "NUM_REALIZATIONS ") - - - def test_argument_text(self): - keyword_parser = ConfigurationLineParser() - - test_line = "NUM_REALIZATIONS 25" - keyword_parser.parseLine(test_line) - - self.assertFalse(keyword_parser.hasComment()) - self.assertEqual(keyword_parser.commentIndex(), -1) - self.assertTrue(keyword_parser.hasKeyword()) - self.assertEqual(keyword_parser.keyword().value(), "NUM_REALIZATIONS") - self.assertEqual(keyword_parser.uncommentedText(), "NUM_REALIZATIONS 25") - self.assertEqual(keyword_parser.argumentsText(), " 25") - - - test_line = "NUM_REALIZATIONS 25--comment" - keyword_parser.parseLine(test_line) - - self.assertTrue(keyword_parser.hasComment()) - self.assertEqual(keyword_parser.commentIndex(), 19) - self.assertTrue(keyword_parser.hasKeyword()) - self.assertEqual(keyword_parser.keyword().value(), "NUM_REALIZATIONS") - self.assertEqual(keyword_parser.uncommentedText(), "NUM_REALIZATIONS 25") - self.assertEqual(keyword_parser.argumentsText(), " 25") - - test_line = "NUM_REALIZATIONS 25 something_else" - keyword_parser.parseLine(test_line) - - self.assertTrue(keyword_parser.hasKeyword()) - self.assertEqual(keyword_parser.keyword().value(), "NUM_REALIZATIONS") - self.assertEqual(keyword_parser.uncommentedText(), "NUM_REALIZATIONS 25 something_else") - self.assertEqual(keyword_parser.argumentsText(), " 25 something_else") - - - - - def test_argument_list(self): - keyword_parser = ConfigurationLineParser() - - test_line = "KEYWORD arg1 arg2" - keyword_parser.parseLine(test_line) - - keyword = keyword_parser.keyword() - self.assertEqual(keyword.value(), "KEYWORD") - - arguments = keyword_parser.arguments() - self.assertEqual(arguments[0].value(), "arg1") - self.assertEqual(arguments[1].value(), "arg2") - - diff --git a/ThirdParty/Ert/python/tests/gui/ide/test_ert_keywords.py b/ThirdParty/Ert/python/tests/gui/ide/test_ert_keywords.py deleted file mode 100644 index fc1b93588a..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ide/test_ert_keywords.py +++ /dev/null @@ -1,186 +0,0 @@ -from ert_gui.ide.keywords.definitions import IntegerArgument, StringArgument, BoolArgument, PathArgument, FloatArgument , PercentArgument -from ert_gui.ide.keywords import ErtKeywords -from ert_gui.ide.keywords.definitions.proper_name_argument import ProperNameArgument -from ert_gui.ide.keywords.definitions.proper_name_format_argument import ProperNameFormatArgument -from ert.test import ExtendedTestCase - - -class ErtKeywordTest(ExtendedTestCase): - - def setUp(self): - self.keywords = ErtKeywords() - - def keywordTest(self, name, argument_types, documentation_link, group, required=False): - self.assertTrue(name in self.keywords) - - cld = self.keywords[name] - - self.assertEqual(cld.keywordDefinition().name(), name) - self.assertEqual(cld.group(), group) - self.assertEqual(cld.documentationLink(), documentation_link) - self.assertEqual(cld.isRequired(), required) - - arguments = cld.argumentDefinitions() - - self.assertEqual(len(arguments), len(argument_types)) - - for index in range(len(arguments)): - self.assertIsInstance(arguments[index], argument_types[index]) - - - def test_eclipse_keywords(self): - self.keywordTest("DATA_FILE", [PathArgument], "keywords/data_file", "Eclipse", True) - self.keywordTest("EQUIL_INIT_FILE", [PathArgument], "keywords/equil_init_file", "Eclipse") - self.keywordTest("ECLBASE", [StringArgument], "keywords/eclbase", "Eclipse", True) - self.keywordTest("JOBNAME", [StringArgument], "keywords/job_name", "Eclipse", True) - self.keywordTest("GRID", [PathArgument], "keywords/grid", "Eclipse", True) - self.keywordTest("INIT_SECTION", [PathArgument], "keywords/init_section", "Eclipse", True) - self.keywordTest("SCHEDULE_FILE", [PathArgument], "keywords/schedule_file", "Eclipse", True) - self.keywordTest("DATA_KW", [StringArgument, StringArgument], "keywords/data_kw", "Eclipse") - self.keywordTest("IGNORE_SCHEDULE", [BoolArgument], "keywords/ignore_schedule", "Eclipse") - - - def test_ensemble_keywords(self): - self.keywordTest("NUM_REALIZATIONS", [IntegerArgument], "keywords/num_realizations", "Ensemble", True) - self.keywordTest("END_DATE", [StringArgument], "keywords/end_date", "Ensemble") - self.keywordTest("ENSPATH", [PathArgument], "keywords/enspath", "Ensemble") - self.keywordTest("SELECT_CASE", [StringArgument], "keywords/select_case", "Ensemble") - self.keywordTest("HISTORY_SOURCE", [StringArgument], "keywords/history_source", "Ensemble") - self.keywordTest("REFCASE", [PathArgument], "keywords/refcase", "Ensemble") - self.keywordTest("REFCASE_LIST", [StringArgument], "keywords/refcase_list", "Ensemble") - self.keywordTest("INCLUDE", [PathArgument], "keywords/include", "Ensemble") - self.keywordTest("OBS_CONFIG", [PathArgument], "keywords/obs_config", "Ensemble") - self.keywordTest("RESULT_PATH", [PathArgument], "keywords/result_path", "Ensemble") - self.keywordTest("LICENSE_PATH", [PathArgument], "keywords/license_path", "Ensemble") - self.keywordTest("LOCAL_CONFIG", [StringArgument], "keywords/local_config", "Ensemble") - - def test_run_keywords(self): - self.keywordTest("INSTALL_JOB", [StringArgument, PathArgument], "keywords/install_job", "Run") - self.keywordTest("DELETE_RUNPATH", [StringArgument], "keywords/delete_runpath", "Run") - self.keywordTest("KEEP_RUNPATH", [StringArgument], "keywords/keep_runpath", "Run") - self.keywordTest("RUNPATH", [PathArgument], "keywords/runpath", "Run") - self.keywordTest("RUNPATH_FILE", [PathArgument], "keywords/runpath_file", "Run") - self.keywordTest("FORWARD_MODEL", [StringArgument], "keywords/forward_model", "Run") - self.keywordTest("JOB_SCRIPT", [PathArgument], "keywords/job_script", "Run") - self.keywordTest("RUN_TEMPLATE", [PathArgument, StringArgument], "keywords/run_template", "Run") - self.keywordTest("LOG_LEVEL", [IntegerArgument], "keywords/log_level", "Run") - self.keywordTest("LOG_FILE", [PathArgument], "keywords/log_file", "Run") - self.keywordTest("MAX_SUBMIT", [IntegerArgument], "keywords/max_submit", "Run") - self.keywordTest("MAX_RESAMPLE", [IntegerArgument], "keywords/max_resample", "Run") - self.keywordTest("PRE_CLEAR_RUNPATH", [BoolArgument], "keywords/pre_clear_runpath", "Run") - - - - def test_control_simulations_keywords(self): - self.keywordTest("MAX_RUNTIME", [IntegerArgument], "keywords/max_runtime", "Simulation Control") - self.keywordTest("MIN_REALIZATIONS", [IntegerArgument,PercentArgument], "keywords/min_realizations", "Simulation Control") - self.keywordTest("STOP_LONG_RUNNING", [BoolArgument], "keywords/stop_long_running", "Simulation Control") - - def test_parametrization_keywords(self): - self.keywordTest("FIELD", [StringArgument,StringArgument,StringArgument], "keywords/field", "Parametrization") - self.keywordTest("GEN_DATA", [StringArgument,StringArgument,StringArgument], "keywords/gen_data", "Parametrization") - self.keywordTest("GEN_KW", [StringArgument,StringArgument,StringArgument], "keywords/gen_kw", "Parametrization") - self.keywordTest("GEN_KW_TAG_FORMAT", [StringArgument], "keywords/gen_kw_tag_format", "Parametrization") - self.keywordTest("GEN_PARAM", [StringArgument,StringArgument,StringArgument], "keywords/gen_param", "Parametrization") - self.keywordTest("SUMMARY", [StringArgument], "keywords/summary", "Parametrization") - self.keywordTest("DBASE_TYPE", [StringArgument], "keywords/dbase_type", "Parametrization") - self.keywordTest("STORE_SEED", [StringArgument], "keywords/store_seed", "Parametrization") - self.keywordTest("LOAD_SEED", [StringArgument], "keywords/load_seed", "Parametrization") - self.keywordTest("SURFACE", [StringArgument], "keywords/surface", "Parametrization") - - - def test_enkf_control_keywords(self): - self.keywordTest("ENKF_ALPHA", [FloatArgument], "keywords/enkf_alpha", "Enkf Control") - self.keywordTest("ENKF_BOOTSTRAP", [BoolArgument], "keywords/enkf_bootstrap", "Enkf Control") - self.keywordTest("ENKF_CV_FOLDS", [IntegerArgument], "keywords/enkf_cv_folds", "Enkf Control") - self.keywordTest("ENKF_FORCE_NCOMP", [BoolArgument], "keywords/enkf_force_ncomp", "Enkf Control") - self.keywordTest("ENKF_LOCAL_CV", [BoolArgument], "keywords/enkf_local_cv", "Enkf Control") - self.keywordTest("ENKF_PEN_PRESS", [BoolArgument], "keywords/enkf_pen_press", "Enkf Control") - self.keywordTest("ENKF_MODE", [StringArgument], "keywords/enkf_mode", "Enkf Control") - self.keywordTest("ENKF_MERGE_OBSERVATIONS", [BoolArgument], "keywords/enkf_merge_observations", "Enkf Control") - self.keywordTest("ENKF_NCOMP", [IntegerArgument], "keywords/enkf_ncomp", "Enkf Control") - self.keywordTest("ENKF_RERUN", [BoolArgument], "keywords/enkf_rerun", "Enkf Control") - self.keywordTest("RERUN_START", [IntegerArgument], "keywords/rerun_start", "Enkf Control") - self.keywordTest("ENKF_SCALING", [BoolArgument], "keywords/enkf_scaling", "Enkf Control") - self.keywordTest("ENKF_TRUNCATION", [FloatArgument], "keywords/enkf_truncation", "Enkf Control") - self.keywordTest("UPDATE_LOG_PATH", [PathArgument], "keywords/update_log_path", "Enkf Control") - self.keywordTest("UPDATE_RESULTS", [BoolArgument], "keywords/update_results", "Enkf Control") - self.keywordTest("ENKF_CROSS_VALIDATION", [StringArgument], "keywords/enkf_cross_validation", "Enkf Control") - self.keywordTest("ENKF_KERNEL_REGRESSION", [StringArgument], "keywords/enkf_kernel_regression", "Enkf Control") - self.keywordTest("ENKF_KERNEL_FUNCTION", [StringArgument], "keywords/enkf_kernel_function", "Enkf Control") - self.keywordTest("ENKF_KERNEL_PARAM", [StringArgument], "keywords/enkf_kernel_param", "Enkf Control") - self.keywordTest("ENKF_SCHED_FILE", [PathArgument], "keywords/enkf_sched_file", "Enkf Control") - self.keywordTest("CASE_TABLE", [StringArgument], "keywords/case_table", "Enkf Control") - self.keywordTest("CONTAINER", [StringArgument], "keywords/container", "Enkf Control") - - - - def test_analysis_module_keywords(self): - self.keywordTest("ANALYSIS_LOAD", [StringArgument,StringArgument], "keywords/analysis_load", "Analysis Module") - self.keywordTest("ANALYSIS_SELECT", [StringArgument], "keywords/analysis_select", "Analysis Module") - self.keywordTest("ANALYSIS_SET_VAR", [StringArgument, StringArgument, StringArgument], "keywords/analysis_set_var", "Analysis Module") - self.keywordTest("ANALYSIS_COPY", [StringArgument, StringArgument], "keywords/analysis_copy", "Analysis Module") - self.keywordTest("ITER_CASE", [ProperNameFormatArgument], "keywords/iter_case", "Analysis Module") - self.keywordTest("ITER_COUNT", [IntegerArgument], "keywords/iter_count", "Analysis Module") - self.keywordTest("STD_CUTOFF", [FloatArgument], "keywords/std_cutoff", "Analysis Module") - self.keywordTest("SINGLE_NODE_UPDATE", [BoolArgument], "keywords/single_node_update", "Analysis Module") - - - def test_advanced_keywords(self): - self.keywordTest("ADD_FIXED_LENGTH_SCHEDULE_KW", [StringArgument, StringArgument], "keywords/add_fixed_length_schedule_kw", "Advanced") - self.keywordTest("ADD_STATIC_KW", [StringArgument, StringArgument], "keywords/add_static_kw", "Advanced") - self.keywordTest("DEFINE", [ProperNameArgument, StringArgument], "keywords/define", "Advanced") - self.keywordTest("SCHEDULE_PREDICTION_FILE", [PathArgument], "keywords/schedule_prediction_file", "Advanced") - - def test_queue_system_keywords(self): - self.keywordTest("QUEUE_SYSTEM", [StringArgument], "keywords/queue_system", "Queue System") - self.keywordTest("QUEUE_OPTION", [StringArgument, StringArgument, StringArgument], "keywords/queue_option", "Queue System") - self.keywordTest("LSF_SERVER", [StringArgument], "keywords/lsf_server", "Queue System") - self.keywordTest("LSF_QUEUE", [StringArgument], "keywords/lsf_queue", "Queue System") - self.keywordTest("LSF_RESOURCES", [StringArgument], "keywords/lsf_resources", "Queue System") - self.keywordTest("MAX_RUNNING_LSF", [IntegerArgument], "keywords/max_running_lsf", "Queue System") - self.keywordTest("TORQUE_QUEUE", [StringArgument], "keywords/torque_queue", "Queue System") - self.keywordTest("MAX_RUNNING_LOCAL", [IntegerArgument], "keywords/max_running_local", "Queue System") - self.keywordTest("RSH_HOST", [StringArgument, StringArgument], "keywords/rsh_host", "Queue System") - self.keywordTest("RSH_COMMAND", [PathArgument], "keywords/rsh_command", "Queue System") - self.keywordTest("MAX_RUNNING_RSH", [IntegerArgument], "keywords/max_running_rsh", "Queue System") - self.keywordTest("HOST_TYPE", [StringArgument], "keywords/host_type", "Queue System") - - - def test_plot_keywords(self): - self.keywordTest("IMAGE_VIEWER", [PathArgument], "keywords/image_viewer", "Plot") - self.keywordTest("IMAGE_TYPE", [StringArgument], "keywords/image_type", "Plot") - self.keywordTest("PLOT_DRIVER", [StringArgument], "keywords/plot_driver", "Plot") - self.keywordTest("PLOT_ERRORBAR", [BoolArgument], "keywords/plot_errorbar", "Plot") - self.keywordTest("PLOT_ERRORBAR_MAX", [IntegerArgument], "keywords/plot_errorbar_max", "Plot") - self.keywordTest("PLOT_WIDTH", [IntegerArgument], "keywords/plot_width", "Plot") - self.keywordTest("PLOT_HEIGHT", [IntegerArgument], "keywords/plot_height", "Plot") - self.keywordTest("PLOT_REFCASE", [BoolArgument], "keywords/plot_refcase", "Plot") - self.keywordTest("PLOT_REFCASE_LIST", [StringArgument], "keywords/plot_refcase_list", "Plot") - self.keywordTest("PLOT_PATH", [PathArgument], "keywords/plot_path", "Plot") - self.keywordTest("RFT_CONFIG", [PathArgument], "keywords/rft_config", "Plot") - self.keywordTest("RFTPATH", [PathArgument], "keywords/rftpath", "Plot") - - def test_workflow_keywords(self): - self.keywordTest("INTERNAL", [BoolArgument], "keywords/internal", "Workflow Jobs") - self.keywordTest("FUNCTION", [StringArgument], "keywords/function", "Workflow Jobs") - self.keywordTest("MODULE", [PathArgument], "keywords/module", "Workflow Jobs") - self.keywordTest("EXECUTABLE", [PathArgument], "keywords/executable", "Workflow Jobs") - self.keywordTest("MIN_ARG", [IntegerArgument], "keywords/min_arg", "Workflow Jobs") - self.keywordTest("MAX_ARG", [IntegerArgument], "keywords/max_arg", "Workflow Jobs") - self.keywordTest("ARG_TYPE", [StringArgument], "keywords/arg_type", "Workflow Jobs") - self.keywordTest("LOAD_WORKFLOW_JOB", [StringArgument], "keywords/load_workflow_job", "Workflow Jobs") - self.keywordTest("WORKFLOW_JOB_DIRECTORY", [PathArgument], "keywords/workflow_job_directory", "Workflow Jobs") - self.keywordTest("LOAD_WORKFLOW", [PathArgument, StringArgument], "keywords/load_workflow", "Workflow Jobs") - - def test_qc_keywords(self): - self.keywordTest("QC_WORKFLOW", [StringArgument], "keywords/qc_workflow", "Quality Check") - self.keywordTest("QC_PATH", [PathArgument], "keywords/qc_path", "Quality Check") - - def test_unix_environment_keywords(self): - self.keywordTest("SETENV", [StringArgument, StringArgument], "keywords/setenv", "Unix") - self.keywordTest("UMASK", [IntegerArgument], "keywords/umask", "Unix") - self.keywordTest("UPDATE_PATH", [StringArgument,PathArgument], "keywords/update_path", "Unix") - - - diff --git a/ThirdParty/Ert/python/tests/gui/ide/test_float_argument.py b/ThirdParty/Ert/python/tests/gui/ide/test_float_argument.py deleted file mode 100644 index 376ea3e87d..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ide/test_float_argument.py +++ /dev/null @@ -1,99 +0,0 @@ -from ert_gui.ide.keywords.definitions import FloatArgument -from ert.test import ExtendedTestCase - - -class FloatArgumentTest(ExtendedTestCase): - - def test_default_float_argument(self): - f = FloatArgument() - - validation_status = f.validate("45.0") - - self.assertTrue(validation_status) - self.assertEqual(validation_status.value(), 45.0) - self.assertEqual(validation_status.message(), "") - - - validation_status = f.validate("-45.0") - - self.assertTrue(validation_status) - self.assertEqual(validation_status.value(), -45) - - - validation_status = f.validate("45.0 ") - - self.assertFalse(validation_status) - self.assertNotEqual(validation_status.message(), "") - self.assertIsNone(validation_status.value()) - - validation_status = f.validate("gx") - - self.assertFalse(validation_status) - self.assertNotEqual(validation_status.message(), "") - - - def test_float_range_argument_from(self): - from_value = 9.9 - f = FloatArgument(from_value=from_value) - - validation_status = f.validate("%f" % from_value) - self.assertTrue(validation_status) - - value = 9.85 - validation_status = f.validate("%f" % value) - self.assertFalse(validation_status) - - range_string = "%f <= %f" % (from_value, value) - self.assertEqual(validation_status.message(), FloatArgument.NOT_IN_RANGE % range_string) - - - def test_float_range_argument_to(self): - to_value = 9.9 - f = FloatArgument(to_value=to_value) - - validation_status = f.validate("%f" % to_value) - self.assertTrue(validation_status) - - value = 9.91 - validation_status = f.validate("%f" % value) - self.assertFalse(validation_status) - - range_string = "%f <= %f" % (value, to_value) - self.assertEqual(validation_status.message(), FloatArgument.NOT_IN_RANGE % range_string) - - - def test_float_range_argument(self): - from_value = 1.0 - to_value = 1.1 - f = FloatArgument(from_value=from_value, to_value=to_value) - - validation_status = f.validate("%f" % to_value) - self.assertTrue(validation_status) - - validation_status = f.validate("%f" % from_value) - self.assertTrue(validation_status) - - validation_status = f.validate("%f" % 1.05) - self.assertTrue(validation_status) - - value = 0.9 - validation_status = f.validate("%f" % value) - self.assertFalse(validation_status) - - range_string = "%f <= %f <= %f" % (from_value, value, to_value) - self.assertEqual(validation_status.message(), FloatArgument.NOT_IN_RANGE % range_string) - - value = 1.15 - validation_status = f.validate("%f" % value) - self.assertFalse(validation_status) - - range_string = "%f <= %f <= %f" % (from_value, value, to_value) - self.assertEqual(validation_status.message(), FloatArgument.NOT_IN_RANGE % range_string) - - - - - - - - diff --git a/ThirdParty/Ert/python/tests/gui/ide/test_integer_argument.py b/ThirdParty/Ert/python/tests/gui/ide/test_integer_argument.py deleted file mode 100644 index e40597416c..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ide/test_integer_argument.py +++ /dev/null @@ -1,99 +0,0 @@ -from ert_gui.ide.keywords.definitions import IntegerArgument -from ert.test import ExtendedTestCase - - -class IntegerArgumentTest(ExtendedTestCase): - - def test_default_integer_argument(self): - integer = IntegerArgument() - - validation_status = integer.validate("45") - - self.assertTrue(validation_status) - self.assertEqual(validation_status.value(), 45) - self.assertEqual(validation_status.message(), "") - - - validation_status = integer.validate("-45") - - self.assertTrue(validation_status) - self.assertEqual(validation_status.value(), -45) - - - validation_status = integer.validate("45 ") - - self.assertFalse(validation_status) - self.assertNotEqual(validation_status.message(), "") - self.assertIsNone(validation_status.value()) - - validation_status = integer.validate("gx") - - self.assertFalse(validation_status) - self.assertNotEqual(validation_status.message(), "") - - - def test_integer_range_argument_from(self): - from_value = 99 - integer = IntegerArgument(from_value=from_value) - - validation_status = integer.validate("%d" % from_value) - self.assertTrue(validation_status) - - value = 98 - validation_status = integer.validate("%d" % value) - self.assertFalse(validation_status) - - range_string = "%d <= %d" % (from_value, value) - self.assertEqual(validation_status.message(), IntegerArgument.NOT_IN_RANGE % range_string) - - - def test_integer_range_argument_to(self): - to_value = 99 - integer = IntegerArgument(to_value=to_value) - - validation_status = integer.validate("%d" % to_value) - self.assertTrue(validation_status) - - value = 100 - validation_status = integer.validate("%d" % value) - self.assertFalse(validation_status) - - range_string = "%d <= %d" % (value, to_value) - self.assertEqual(validation_status.message(), IntegerArgument.NOT_IN_RANGE % range_string) - - - def test_integer_range_argument(self): - from_value = 10 - to_value = 20 - integer = IntegerArgument(from_value=from_value, to_value=to_value) - - validation_status = integer.validate("%d" % to_value) - self.assertTrue(validation_status) - - validation_status = integer.validate("%d" % from_value) - self.assertTrue(validation_status) - - validation_status = integer.validate("%d" % 15) - self.assertTrue(validation_status) - - value = 9 - validation_status = integer.validate("%d" % value) - self.assertFalse(validation_status) - - range_string = "%d <= %d <= %d" % (from_value, value, to_value) - self.assertEqual(validation_status.message(), IntegerArgument.NOT_IN_RANGE % range_string) - - value = 21 - validation_status = integer.validate("%d" % value) - self.assertFalse(validation_status) - - range_string = "%d <= %d <= %d" % (from_value, value, to_value) - self.assertEqual(validation_status.message(), IntegerArgument.NOT_IN_RANGE % range_string) - - - - - - - - diff --git a/ThirdParty/Ert/python/tests/gui/ide/test_path_argument.py b/ThirdParty/Ert/python/tests/gui/ide/test_path_argument.py deleted file mode 100644 index 1bac902d4e..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ide/test_path_argument.py +++ /dev/null @@ -1,15 +0,0 @@ -from ert_gui.ide.keywords.definitions import PathArgument -from ert.test import ExtendedTestCase - - -class PathArgumentTest(ExtendedTestCase): - - def test_path_argument(self): - - path_arg = PathArgument() - - validation_status = path_arg.validate("/non_existing_file") - self.assertFalse(validation_status) - - validation_status = path_arg.validate(__file__) - self.assertTrue(validation_status) diff --git a/ThirdParty/Ert/python/tests/gui/ide/test_percent_argument.py b/ThirdParty/Ert/python/tests/gui/ide/test_percent_argument.py deleted file mode 100644 index d7afffc7c0..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ide/test_percent_argument.py +++ /dev/null @@ -1,99 +0,0 @@ -from ert_gui.ide.keywords.definitions import PercentArgument -from ert.test import ExtendedTestCase - - -class PercentArgumentTest(ExtendedTestCase): - - def test_default_percent_argument(self): - percent = PercentArgument() - - validation_status = percent.validate("45%") - - self.assertTrue(validation_status) - self.assertEqual(validation_status.value(), 0.45) - self.assertEqual(validation_status.message(), "") - - - validation_status = percent.validate("-45%") - - self.assertTrue(validation_status) - self.assertEqual(validation_status.value(), -0.45) - - - validation_status = percent.validate("45") - - self.assertFalse(validation_status) - self.assertNotEqual(validation_status.message(), "") - self.assertIsNone(validation_status.value()) - - validation_status = percent.validate("gx") - - self.assertFalse(validation_status) - self.assertNotEqual(validation_status.message(), "") - - - def test_percent_range_argument_from(self): - from_value = 99 - percent = PercentArgument(from_value=from_value) - - validation_status = percent.validate("%d%%" % from_value) - self.assertTrue(validation_status) - - value = 98 - validation_status = percent.validate("%d%%" % value) - self.assertFalse(validation_status) - - range_string = "%g %% <= %g %%" % (from_value, value) - self.assertEqual(validation_status.message(), PercentArgument.NOT_IN_RANGE % range_string) - - - def test_percent_range_argument_to(self): - to_value = 99 - percent = PercentArgument(to_value=to_value) - - validation_status = percent.validate("%d%%" % to_value) - self.assertTrue(validation_status) - - value = 100 - validation_status = percent.validate("%d%%" % value) - self.assertFalse(validation_status) - - range_string = "%g%% <= %g%%" % (value, to_value) - self.assertEqual(validation_status.message(), PercentArgument.NOT_IN_RANGE % range_string) - - - def test_percent_range_argument(self): - from_value = 10 - to_value = 20 - percent = PercentArgument(from_value=from_value, to_value=to_value) - - validation_status = percent.validate("%d%%" % to_value) - self.assertTrue(validation_status) - - validation_status = percent.validate("%d%%" % from_value) - self.assertTrue(validation_status) - - validation_status = percent.validate("%d%%" % 15) - self.assertTrue(validation_status) - - value = 9 - validation_status = percent.validate("%d%%" % value) - self.assertFalse(validation_status) - - range_string = "%g%% <= %g%% <= %g%%" % (from_value, value, to_value) - self.assertEqual(validation_status.message(), PercentArgument.NOT_IN_RANGE % range_string) - - value = 21 - validation_status = percent.validate("%d%%" % value) - self.assertFalse(validation_status) - - range_string = "%g%% <= %g%% <= %g%%" % (from_value, value, to_value) - self.assertEqual(validation_status.message(), PercentArgument.NOT_IN_RANGE % range_string) - - - - - - - - diff --git a/ThirdParty/Ert/python/tests/gui/ide/test_proper_name_argument.py b/ThirdParty/Ert/python/tests/gui/ide/test_proper_name_argument.py deleted file mode 100644 index 1d754feef1..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ide/test_proper_name_argument.py +++ /dev/null @@ -1,18 +0,0 @@ -from ert_gui.ide.keywords.definitions import ProperNameArgument -from ert.test import ExtendedTestCase - - -class ProperNameArgumentTest(ExtendedTestCase): - - def test_proper_name_argument(self): - - argument = ProperNameArgument() - - self.assertTrue(argument.validate("NAME")) - self.assertTrue(argument.validate("__NAME__")) - self.assertTrue(argument.validate("")) - self.assertTrue(argument.validate("-NAME-")) - - self.assertFalse(argument.validate("-NA ME-")) - self.assertFalse(argument.validate("NAME*")) - diff --git a/ThirdParty/Ert/python/tests/gui/ide/test_proper_name_format_argument.py b/ThirdParty/Ert/python/tests/gui/ide/test_proper_name_format_argument.py deleted file mode 100644 index f6f1ccb180..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ide/test_proper_name_format_argument.py +++ /dev/null @@ -1,18 +0,0 @@ -from ert_gui.ide.keywords.definitions import ProperNameFormatArgument -from ert.test import ExtendedTestCase - - -class ProperNameFormatArgumentTest(ExtendedTestCase): - - def test_proper_name_format_argument(self): - - argument = ProperNameFormatArgument() - - self.assertTrue(argument.validate("NAME%d")) - self.assertTrue(argument.validate("__NA%dME__")) - self.assertTrue(argument.validate("%d")) - self.assertTrue(argument.validate("%d-NAME-")) - - self.assertFalse(argument.validate("-%dNA ME-")) - self.assertFalse(argument.validate("NAME*%d")) - diff --git a/ThirdParty/Ert/python/tests/gui/ide/test_proper_name_format_string_argument.py b/ThirdParty/Ert/python/tests/gui/ide/test_proper_name_format_string_argument.py deleted file mode 100644 index 8fa3ecd2ef..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ide/test_proper_name_format_string_argument.py +++ /dev/null @@ -1,21 +0,0 @@ -from ert_gui.ide.keywords.definitions import ProperNameFormatStringArgument -from ert.test import ExtendedTestCase - - -class ProperNameFormatStringArgumentTest(ExtendedTestCase): - - def test_proper_name_format_string_argument(self): - - argument = ProperNameFormatStringArgument() - - self.assertTrue(argument.validate("NAME%s")) - self.assertTrue(argument.validate("__NA%sME__")) - self.assertTrue(argument.validate("%s")) - self.assertTrue(argument.validate("%s-NAME-")) - self.assertTrue(argument.validate("%s")) - self.assertTrue(argument.validate(".NA.ME%s.")) - - self.assertFalse(argument.validate("-%sNA ME-")) - self.assertFalse(argument.validate("NAME*%s")) - self.assertFalse(argument.validate("")) - diff --git a/ThirdParty/Ert/python/tests/gui/ide/test_range_string_argument.py b/ThirdParty/Ert/python/tests/gui/ide/test_range_string_argument.py deleted file mode 100644 index a3612cec84..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ide/test_range_string_argument.py +++ /dev/null @@ -1,28 +0,0 @@ -from ert_gui.ide.keywords.definitions.range_string_argument import RangeStringArgument -from ert.test import ExtendedTestCase - - -class RangeStringArgumentTest(ExtendedTestCase): - - def test_proper_name_argument(self): - - argument = RangeStringArgument() - - self.assertTrue(argument.validate("1")) - self.assertTrue(argument.validate("1-10")) - self.assertTrue(argument.validate("1-10,11-20")) - self.assertTrue(argument.validate("1-10,11,12,13,14,15,16-20")) - - self.assertFalse(argument.validate("s5")) - self.assertFalse(argument.validate("1-10,5-4*")) - - - self.assertTrue(argument.validate("1 - 5, 2,3 ,4")) - self.assertTrue(argument.validate("1 - 5, 2 ,3 ,4")) - - - argument = RangeStringArgument(max_value=10) - - self.assertTrue(argument.validate("1-5, 9")) - self.assertFalse(argument.validate("10")) - diff --git a/ThirdParty/Ert/python/tests/gui/ide/test_tokens.py b/ThirdParty/Ert/python/tests/gui/ide/test_tokens.py deleted file mode 100644 index 60285f0dc5..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ide/test_tokens.py +++ /dev/null @@ -1,60 +0,0 @@ -from ert_gui.ide.keywords.data import Keyword, Argument, Token -from ert_gui.ide.keywords.definitions import KeywordDefinition, StringArgument -from ert.test import ExtendedTestCase - - -class TokenTest(ExtendedTestCase): - def test_token(self): - line = "some words in a line" - token = Token(5, 10, line) - - self.assertEqual(token.value(), "words") - self.assertEqual(token.fromIndex(), 5) - self.assertEqual(token.toIndex(), 10) - self.assertEqual(token.count(), 5) - self.assertTrue(5 in token) - self.assertTrue(9 in token) - self.assertTrue(not 10 in token) - - - def test_empty_token(self): - token = Token(4, 4, "text") - - self.assertEqual(token.value(), "") - - def test_keyword(self): - num_realizations = "NUM_REALIZATIONS" - - keyword_def = KeywordDefinition(num_realizations) - - keyword = Keyword(0, 16, num_realizations) - keyword.setKeywordDefinition(keyword_def) - - self.assertEqual(keyword.value(), num_realizations) - self.assertEqual(keyword_def, keyword.keywordDefinition()) - self.assertTrue(keyword.hasKeywordDefinition()) - - - def test_argument(self): - text = "KEYWORD arg1 arg2" - - arg1 = Argument(8, 12, text) - arg1.setArgumentDefinition(StringArgument()) - - arg2 = Argument(13, 17, text) - - self.assertEqual(arg1.value(), "arg1") - self.assertEqual(arg2.value(), "arg2") - - self.assertEqual(arg2.line(), text) - - self.assertTrue(arg1.hasArgumentDefinition()) - self.assertIsInstance(arg1.argumentDefinition(), StringArgument) - - self.assertFalse(arg2.hasArgumentDefinition()) - self.assertIsNone(arg2.argumentDefinition()) - - - - - diff --git a/ThirdParty/Ert/python/tests/gui/ide/wizards/CMakeLists.txt b/ThirdParty/Ert/python/tests/gui/ide/wizards/CMakeLists.txt deleted file mode 100644 index 3125ba406f..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ide/wizards/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -set(TEST_SOURCES - __init__.py - test_tree_structure.py -) - -add_python_package("python.tests.gui.ide.wizards" ${PYTHON_INSTALL_PREFIX}/tests/gui/ide/wizards "${TEST_SOURCES}" False) - -addPythonTest(gui.ide.wizards.tree_structure tests.gui.ide.wizards.test_tree_structure.TreeStructureTest) \ No newline at end of file diff --git a/ThirdParty/Ert/python/tests/gui/ide/wizards/__init__.py b/ThirdParty/Ert/python/tests/gui/ide/wizards/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/python/tests/gui/ide/wizards/test_tree_structure.py b/ThirdParty/Ert/python/tests/gui/ide/wizards/test_tree_structure.py deleted file mode 100644 index 402a7346fd..0000000000 --- a/ThirdParty/Ert/python/tests/gui/ide/wizards/test_tree_structure.py +++ /dev/null @@ -1,65 +0,0 @@ -from PyQt4.QtCore import Qt -from ert_gui.ide.wizards import TreeItem, TreeModel -from ert.test import ExtendedTestCase - - -class TreeStructureTest(ExtendedTestCase): - - def test_tree_item(self): - - root = TreeItem("Root") - - self.assertIsNone(root.parent()) - self.assertEqual(root.name(), "Root") - self.assertEqual(len(root), 0) - - with self.assertRaises(IndexError): - root.child(0) - - self.assertIsNone(root.data()) - - child_1 = TreeItem("Child1") - - child = root.addChild(child_1) - - self.assertEqual(child, child_1) - self.assertEqual(len(root), 1) - self.assertEqual(root.child(0), child_1) - self.assertEqual(child_1.parent(), root) - - def test_tree_model(self): - root = TreeItem("Wizards") - - root.addChild(TreeItem("One")) - - child = root.addChild(TreeItem("Two")) - child.addChild(TreeItem("SubOne")) - child.addChild(TreeItem("SubTwo")) - - child_item = root.addChild(TreeItem("Three")) - - tree = TreeModel(root) - - self.assertEqual(tree.headerData(0, Qt.Horizontal), root.name()) - - name1 = tree.data(tree.index(0, 0)) - self.assertEqual(name1, "One") - - name2_index = tree.index(1, 0) - sub_name2_index = tree.index(1, 0, name2_index) - - self.assertEqual(tree.data(sub_name2_index), "SubTwo") - - - tree_item = tree.item(tree.index(2, 0)) - - self.assertEqual(child_item, tree_item) - - self.assertTrue(tree.data(tree.index(3, 0)).isNull()) - - - - - - - diff --git a/ThirdParty/Ert/python/tests/gui/plottery/CMakeLists.txt b/ThirdParty/Ert/python/tests/gui/plottery/CMakeLists.txt deleted file mode 100644 index 3dd35e54c7..0000000000 --- a/ThirdParty/Ert/python/tests/gui/plottery/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -set(TEST_SOURCES - __init__.py - test_plot_style.py - test_plot_config_history.py - test_plot_limits.py -) - -add_python_package("python.tests.gui.plottery" ${PYTHON_INSTALL_PREFIX}/tests/gui/plottery "${TEST_SOURCES}" False) - -addPythonTest(gui.plottery.plot_style gui.plottery.test_plot_style.PlotStyleTest) -addPythonTest(gui.plottery.plot_config_history gui.plottery.test_plot_config_history.PlotConfigHistoryTest) -addPythonTest(gui.plottery.plot_limits gui.plottery.test_plot_limits.PlotLimitsTest) \ No newline at end of file diff --git a/ThirdParty/Ert/python/tests/gui/plottery/__init__.py b/ThirdParty/Ert/python/tests/gui/plottery/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/python/tests/gui/plottery/test_plot_config_history.py b/ThirdParty/Ert/python/tests/gui/plottery/test_plot_config_history.py deleted file mode 100644 index 4a3a2a053e..0000000000 --- a/ThirdParty/Ert/python/tests/gui/plottery/test_plot_config_history.py +++ /dev/null @@ -1,46 +0,0 @@ -from ert.test import ExtendedTestCase -from ert.enkf import PlotSettings -from ert_gui.plottery import PlotConfig, PlotConfigHistory - - -class PlotConfigHistoryTest(ExtendedTestCase): - - def test_plot_config_history(self): - ps = PlotSettings( ) - test_pc = PlotConfig(ps , title = "test_1") - history = PlotConfigHistory("test", test_pc) - - self.assertEqual(history.getPlotConfig().title(), test_pc.title()) - self.assertNotEqual(history.getPlotConfig(), test_pc) - - self.assertFalse(history.isUndoPossible()) - self.assertFalse(history.isRedoPossible()) - - history.applyChanges(PlotConfig(ps, title = "test_2")) - self.assertTrue(history.isUndoPossible()) - self.assertFalse(history.isRedoPossible()) - self.assertEqual(history.getPlotConfig().title(), "test_2") - - history.undoChanges() - self.assertFalse(history.isUndoPossible()) - self.assertTrue(history.isRedoPossible()) - self.assertEqual(history.getPlotConfig().title(), "test_1") - - history.redoChanges() - self.assertTrue(history.isUndoPossible()) - self.assertFalse(history.isRedoPossible()) - self.assertEqual(history.getPlotConfig().title(), "test_2") - - history.resetChanges() - self.assertTrue(history.isUndoPossible()) - self.assertFalse(history.isRedoPossible()) - self.assertEqual(history.getPlotConfig().title(), "test_1") - - history.undoChanges() - self.assertTrue(history.isUndoPossible()) - self.assertTrue(history.isRedoPossible()) - self.assertEqual(history.getPlotConfig().title(), "test_2") - - - - diff --git a/ThirdParty/Ert/python/tests/gui/plottery/test_plot_limits.py b/ThirdParty/Ert/python/tests/gui/plottery/test_plot_limits.py deleted file mode 100644 index f85140916c..0000000000 --- a/ThirdParty/Ert/python/tests/gui/plottery/test_plot_limits.py +++ /dev/null @@ -1,124 +0,0 @@ -import datetime - -from ert.test import ExtendedTestCase -from ert_gui.plottery import PlotLimits - - -class PlotLimitsTest(ExtendedTestCase): - - def test_plot_limits_construction(self): - plot_limits = PlotLimits() - self.assertEqual(plot_limits.value_minimum, None) - self.assertEqual(plot_limits.value_maximum, None) - self.assertEqual(plot_limits.value_limits, (None, None)) - - self.assertEqual(plot_limits.index_minimum, None) - self.assertEqual(plot_limits.index_maximum, None) - self.assertEqual(plot_limits.index_limits, (None, None)) - - self.assertEqual(plot_limits.count_minimum, None) - self.assertEqual(plot_limits.count_maximum, None) - self.assertEqual(plot_limits.count_limits, (None, None)) - - self.assertEqual(plot_limits.density_minimum, None) - self.assertEqual(plot_limits.density_maximum, None) - self.assertEqual(plot_limits.density_limits, (None, None)) - - self.assertEqual(plot_limits.depth_minimum, None) - self.assertEqual(plot_limits.depth_maximum, None) - self.assertEqual(plot_limits.depth_limits, (None, None)) - - self.assertEqual(plot_limits.date_minimum, None) - self.assertEqual(plot_limits.date_maximum, None) - self.assertEqual(plot_limits.date_limits, (None, None)) - - - def test_plot_limits(self): - plot_limits = PlotLimits() - limit_names = ["value", "index", "count", "density", "depth", "date"] - - non_numbers = ["string", datetime.date(2001, 1, 1), "3.0", "1e-5", "-5.5", "-.5"] - - positive_floats = [1.0, 1.5, 3.1415, 1e10, 5.2e-7] - negative_floats = [-1.0, -1.5, -3.1415, -1e10, -5.2e-7] - positive_ints = [1, 5, 1000] - negative_ints = [-1, -5, -1000] - - non_dates = ["string", "3.4", "2001-01-01", datetime.time()] - dates = [datetime.date(2001, 1, 1), datetime.datetime(2010, 3, 3)] - - setter_should_fail_values = { - "value": non_numbers + dates, - "index": non_numbers + positive_floats + negative_floats + dates, - "depth": non_numbers + negative_floats + negative_ints + negative_ints, - "count": non_numbers + negative_ints + negative_floats + positive_floats, - "density": non_numbers + negative_floats + negative_ints, - "date": non_dates - } - - setter_should_succeed_values = { - "value": positive_floats + negative_floats + positive_ints + negative_ints, - "index": positive_ints, - "depth": positive_floats + positive_ints, - "count": positive_ints, - "density": positive_floats + positive_ints, - "date": dates - } - - for attribute_name in limit_names: - self.assertIsNone(getattr(plot_limits, "%s_minimum" % attribute_name)) - self.assertIsNone(getattr(plot_limits, "%s_maximum" % attribute_name)) - self.assertTupleEqual(getattr(plot_limits, "%s_limits" % attribute_name), (None, None)) - - with self.assertNotRaises(): - setattr(plot_limits, "%s_minimum" % attribute_name, None) - setattr(plot_limits, "%s_maximum" % attribute_name, None) - setattr(plot_limits, "%s_limits" % attribute_name, (None, None)) - - with self.assertRaises(TypeError): - setattr(plot_limits, "%s_limits" % attribute_name, None) - - for value in setter_should_fail_values[attribute_name]: - with self.assertRaises((TypeError, ValueError)): - setattr(plot_limits, "%s_minimum" % attribute_name, value) - - with self.assertRaises((TypeError, ValueError)): - setattr(plot_limits, "%s_maximum" % attribute_name, value) - - self.assertTupleEqual(getattr(plot_limits, "%s_limits" % attribute_name), (None, None)) - - for value in setter_should_succeed_values[attribute_name]: - with self.assertNotRaises(): - setattr(plot_limits, "%s_minimum" % attribute_name, value) - setattr(plot_limits, "%s_maximum" % attribute_name, value) - - minimum = getattr(plot_limits, "%s_minimum" % attribute_name) - maximum = getattr(plot_limits, "%s_maximum" % attribute_name) - - self.assertEqual(minimum, value) - self.assertEqual(maximum, value) - - self.assertTupleEqual(getattr(plot_limits, "%s_limits" % attribute_name), (minimum, maximum)) - - - def test_copy_plot_limits(self): - plot_limits = PlotLimits() - plot_limits.value_limits = 1, 2 - plot_limits.index_limits = 3, 4 - plot_limits.count_limits = 5, 6 - plot_limits.depth_limits = 7, 8 - plot_limits.density_limits = 9, 10 - plot_limits.date_limits = datetime.date(1999, 1, 1), datetime.date(1999, 12, 31) - - copy_of_plot_limits = PlotLimits() - - copy_of_plot_limits.copyLimitsFrom(plot_limits) - - self.assertEqual(copy_of_plot_limits, plot_limits) - - self.assertEqual(copy_of_plot_limits.value_limits, (1, 2)) - self.assertEqual(copy_of_plot_limits.index_limits, (3, 4)) - self.assertEqual(copy_of_plot_limits.count_limits, (5, 6)) - self.assertEqual(copy_of_plot_limits.depth_limits, (7, 8)) - self.assertEqual(copy_of_plot_limits.density_limits, (9, 10)) - self.assertEqual(copy_of_plot_limits.date_limits, (datetime.date(1999, 1, 1), datetime.date(1999, 12, 31))) diff --git a/ThirdParty/Ert/python/tests/gui/plottery/test_plot_style.py b/ThirdParty/Ert/python/tests/gui/plottery/test_plot_style.py deleted file mode 100644 index 2fdd098281..0000000000 --- a/ThirdParty/Ert/python/tests/gui/plottery/test_plot_style.py +++ /dev/null @@ -1,164 +0,0 @@ -import datetime - -from ert.test import ExtendedTestCase -from ert.enkf import PlotSettings -from ert_gui.plottery import PlotStyle, PlotConfig, PlotLimits - - -class PlotStyleTest(ExtendedTestCase): - - def test_plot_style_test_defaults(self): - style = PlotStyle("Test") - - self.assertEqual(style.name, "Test") - self.assertEqual(style.color, "#000000") - self.assertEqual(style.line_style, "-") - self.assertEqual(style.alpha, 1.0) - self.assertEqual(style.marker, "") - self.assertEqual(style.width, 1.0) - self.assertEqual(style.size, 7.5) - self.assertTrue(style.isEnabled()) - - style.line_style = None - style.marker = None - - self.assertEqual(style.line_style, "") - self.assertEqual(style.marker, "") - - - def test_plot_style_builtin_checks(self): - style = PlotStyle("Test") - - style.name = None - self.assertIsNone(style.name) - - style.color = "notacolor" - self.assertEqual(style.color, "notacolor") # maybe make this a proper check in future ? - - style.line_style = None - self.assertEqual(style.line_style, "") - - style.marker = None - self.assertEqual(style.marker, "") - - style.width = -1 - self.assertEqual(style.width, 0.0) - - style.size = -1 - self.assertEqual(style.size, 0.0) - - style.alpha = 1.1 - self.assertEqual(style.alpha, 1.0) - - style.alpha = -0.1 - self.assertEqual(style.alpha, 0.0) - - style.setEnabled(False) - self.assertFalse(style.isEnabled()) - - - def test_plot_style_copy_style(self): - style = PlotStyle("Test", "red", 0.5, ".", "o", 2.5) - style.setEnabled(False) - - copy_style = PlotStyle("Copy") - - copy_style.copyStyleFrom(style) - - self.assertNotEqual(style.name, copy_style.name) - self.assertEqual(style.color, copy_style.color) - self.assertEqual(style.alpha, copy_style.alpha) - self.assertEqual(style.line_style, copy_style.line_style) - self.assertEqual(style.marker, copy_style.marker) - self.assertEqual(style.width, copy_style.width) - self.assertEqual(style.size, copy_style.size) - self.assertNotEqual(style.isEnabled(), copy_style.isEnabled()) - - another_copy_style = PlotStyle("Another Copy") - another_copy_style.copyStyleFrom(style, copy_enabled_state=True) - self.assertEqual(style.isEnabled(), another_copy_style.isEnabled()) - - - def test_plot_config(self): - ps = PlotSettings( ) - plot_config = PlotConfig(ps , "Golden Sample", x_label="x", y_label="y") - - limits = PlotLimits() - limits.count_limits = 1, 2 - limits.depth_limits = 3, 4 - limits.density_limits = 5, 6 - limits.date_limits = datetime.date(2005, 2, 5), datetime.date(2006, 2, 6) - limits.index_limits = 7, 8 - limits.value_limits = 9.0, 10.0 - - plot_config.limits = limits - self.assertEqual(plot_config.limits, limits) - - plot_config.setDistributionLineEnabled(True) - plot_config.setLegendEnabled(False) - plot_config.setGridEnabled(False) - plot_config.setRefcaseEnabled(False) - plot_config.setObservationsEnabled(False) - - style = PlotStyle("test_style", line_style=".", marker="g", width=2.5, size=7.5) - - plot_config.setDefaultStyle(style) - plot_config.setRefcaseStyle(style) - plot_config.setStatisticsStyle("mean", style) - plot_config.setStatisticsStyle("min-max", style) - plot_config.setStatisticsStyle("p50", style) - plot_config.setStatisticsStyle("p10-p90", style) - plot_config.setStatisticsStyle("p33-p67", style) - plot_config.setStatisticsStyle("std", style) - - copy_of_plot_config = PlotConfig(ps , "Copy of Golden Sample") - copy_of_plot_config.copyConfigFrom(plot_config) - - self.assertEqual(plot_config.isLegendEnabled(), copy_of_plot_config.isLegendEnabled()) - self.assertEqual(plot_config.isGridEnabled(), copy_of_plot_config.isGridEnabled()) - self.assertEqual(plot_config.isObservationsEnabled(), copy_of_plot_config.isObservationsEnabled()) - self.assertEqual(plot_config.isDistributionLineEnabled(), copy_of_plot_config.isDistributionLineEnabled()) - - self.assertEqual(plot_config.refcaseStyle(), copy_of_plot_config.refcaseStyle()) - self.assertEqual(plot_config.observationsStyle(), copy_of_plot_config.observationsStyle()) - - self.assertEqual(plot_config.histogramStyle(), copy_of_plot_config.histogramStyle()) - self.assertEqual(plot_config.defaultStyle(), copy_of_plot_config.defaultStyle()) - self.assertEqual(plot_config.currentColor(), copy_of_plot_config.currentColor()) - - self.assertEqual(plot_config.getStatisticsStyle("mean"), copy_of_plot_config.getStatisticsStyle("mean")) - self.assertEqual(plot_config.getStatisticsStyle("min-max"), copy_of_plot_config.getStatisticsStyle("min-max")) - self.assertEqual(plot_config.getStatisticsStyle("p50"), copy_of_plot_config.getStatisticsStyle("p50")) - self.assertEqual(plot_config.getStatisticsStyle("p10-p90"), copy_of_plot_config.getStatisticsStyle("p10-p90")) - self.assertEqual(plot_config.getStatisticsStyle("p33-p67"), copy_of_plot_config.getStatisticsStyle("p33-p67")) - self.assertEqual(plot_config.getStatisticsStyle("std"), copy_of_plot_config.getStatisticsStyle("std")) - - self.assertEqual(plot_config.title(), copy_of_plot_config.title()) - - self.assertEqual(plot_config.limits, copy_of_plot_config.limits) - - - plot_config.currentColor() # cycle state will not be copied - plot_config.nextColor() - - copy_of_plot_config = PlotConfig(ps, "Another Copy of Golden Sample") - copy_of_plot_config.copyConfigFrom(plot_config) - - self.assertEqual(plot_config.refcaseStyle(), copy_of_plot_config.refcaseStyle()) - self.assertEqual(plot_config.observationsStyle(), copy_of_plot_config.observationsStyle()) - - self.assertNotEqual(plot_config.histogramStyle(), copy_of_plot_config.histogramStyle()) - self.assertNotEqual(plot_config.defaultStyle(), copy_of_plot_config.defaultStyle()) - self.assertNotEqual(plot_config.currentColor(), copy_of_plot_config.currentColor()) - - self.assertNotEqual(plot_config.getStatisticsStyle("mean"), copy_of_plot_config.getStatisticsStyle("mean")) - self.assertNotEqual(plot_config.getStatisticsStyle("min-max"), copy_of_plot_config.getStatisticsStyle("min-max")) - self.assertNotEqual(plot_config.getStatisticsStyle("p50"), copy_of_plot_config.getStatisticsStyle("p50")) - self.assertNotEqual(plot_config.getStatisticsStyle("p10-p90"), copy_of_plot_config.getStatisticsStyle("p10-p90")) - self.assertNotEqual(plot_config.getStatisticsStyle("p33-p67"), copy_of_plot_config.getStatisticsStyle("p33-p67")) - self.assertNotEqual(plot_config.getStatisticsStyle("std"), copy_of_plot_config.getStatisticsStyle("std")) - - - - - diff --git a/ThirdParty/Ert/python/tests/gui/test_multiple_data_assimilation.py b/ThirdParty/Ert/python/tests/gui/test_multiple_data_assimilation.py deleted file mode 100644 index 8b8cd8ed54..0000000000 --- a/ThirdParty/Ert/python/tests/gui/test_multiple_data_assimilation.py +++ /dev/null @@ -1,44 +0,0 @@ -from ert.test import ExtendedTestCase -from ert_gui.simulation.models import MultipleDataAssimilation as mda - - -class MDAWeightsTest(ExtendedTestCase): - - def test_weights(self): - - weights = mda.parseWeights("2, 2, 2, 2") - print(weights) - self.assertAlmostEqualList([2, 2, 2, 2], weights) - - weights = mda.parseWeights("1, 2, 3, ") - self.assertAlmostEqualList([1, 2, 3], weights) - - weights = mda.parseWeights("1, 0, 1") - self.assertAlmostEqualList([1, 1], weights) - - weights = mda.parseWeights("1.414213562373095, 1.414213562373095") - self.assertAlmostEqualList([1.414213562373095, 1.414213562373095], weights) - - with self.assertRaises(ValueError): - mda.parseWeights("2, error, 2, 2") - - - def test_normalized_weights(self): - - weights = mda.normalizeWeights([1]) - self.assertAlmostEqualList([1.0], weights) - - weights = mda.normalizeWeights([1, 1]) - self.assertAlmostEqualList([1.414214, 1.414214], weights) - - weights = mda.normalizeWeights([1, 0, 1]) - self.assertAlmostEqualList([1.414214, 1.414214], weights) - - weights = mda.normalizeWeights([1, 1, 1]) - self.assertAlmostEqualList([1.732051, 1.732051, 1.732051], weights) - - weights = mda.normalizeWeights([8, 4, 2, 1]) - self.assertAlmostEqualList([9.219544457292887, 4.6097722286464435, 2.3048861143232218, 1.1524430571616109], weights) - - weights = mda.normalizeWeights([9.219544457292887, 4.6097722286464435, 2.3048861143232218, 1.1524430571616109]) - self.assertAlmostEqualList([9.219544457292887, 4.6097722286464435, 2.3048861143232218, 1.1524430571616109], weights) diff --git a/ThirdParty/Ert/python/tests/import_tester.py b/ThirdParty/Ert/python/tests/import_tester.py deleted file mode 100644 index b268c77e6b..0000000000 --- a/ThirdParty/Ert/python/tests/import_tester.py +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env python -import os -import sys -import traceback - -class ImportTester(object): - @staticmethod - def testImport(module): - try: - if '__pycache__' in str(module): - # python 3 hack - return True - else: - print('Importing module %s.' % str(module)) - __import__(module) - return True - except ImportError: - tb = traceback.format_exc() - sys.stderr.write("Error importing module %s!\n\n" % module) - sys.stderr.write(str(tb)) - sys.stderr.write("\n") - except Exception: - tb = traceback.format_exc() - sys.stderr.write("Import of module %s caused errors!\n\n" % module) - sys.stderr.write(str(tb)) - sys.stderr.write("\n") - - return False - - - @staticmethod - def importRecursively(path, package_name): - entries = os.listdir(path) - - result = True - - for entry in sorted(entries): - import_success = True - - entry_path = os.path.join(path, entry) - if os.path.isdir(entry_path): - package = "%s.%s" % (package_name, entry) - import_success = ImportTester.testImport(package) - new_path = os.path.join(path, entry) - import_success = import_success and ImportTester.importRecursively(new_path, package) - elif os.path.isfile(entry_path): - if not entry.startswith("__init__") and entry.endswith(".py"): - module = entry[0:len(entry) - 3] - import_success = ImportTester.testImport("%s.%s" % (package_name, module)) - else: - # skip other files - pass - # print("Skipped entry: %s" % entry) - - if not import_success: - result = False - - return result - - -if __name__ == '__main__': - PYTHONPATH = sys.argv[1] - package_name = sys.argv[2] - - sys.path.insert(0, PYTHONPATH) - - package_path = os.path.join(PYTHONPATH, package_name) - - if ImportTester.importRecursively(package_path, package_name): - sys.exit(0) - else: - sys.exit(1) diff --git a/ThirdParty/Ert/python/tests/share/CMakeLists.txt b/ThirdParty/Ert/python/tests/share/CMakeLists.txt index 572d5d0c4e..ef80c2d77d 100644 --- a/ThirdParty/Ert/python/tests/share/CMakeLists.txt +++ b/ThirdParty/Ert/python/tests/share/CMakeLists.txt @@ -5,4 +5,4 @@ set(TEST_SOURCES add_python_package("python.tests.share" ${PYTHON_INSTALL_PREFIX}/tests/share "${TEST_SOURCES}" False) -addPythonTest(share.synthesizer share.test_synthesizer.SynthesizerTest) \ No newline at end of file +addPythonTest(share.test_synthesizer.SynthesizerTest) diff --git a/ThirdParty/Ert/python/tests/share/test_synthesizer.py b/ThirdParty/Ert/python/tests/share/test_synthesizer.py index 0efb611bf2..f5863f5e91 100644 --- a/ThirdParty/Ert/python/tests/share/test_synthesizer.py +++ b/ThirdParty/Ert/python/tests/share/test_synthesizer.py @@ -1,11 +1,11 @@ import sys import os -from ert.test import ExtendedTestCase +from ecl.test import ExtendedTestCase try: from synthesizer import OilSimulator except ImportError as e: - share_lib_path = os.path.join(ExtendedTestCase.findShareRoot(), "lib") + share_lib_path = os.path.join(ExtendedTestCase.createSharePath("lib")) sys.path.insert(0, share_lib_path) synthesizer_module = __import__("synthesizer") diff --git a/ThirdParty/Ert/python/tests/test_pylint.py b/ThirdParty/Ert/python/tests/test_pylint.py new file mode 100644 index 0000000000..20206294f1 --- /dev/null +++ b/ThirdParty/Ert/python/tests/test_pylint.py @@ -0,0 +1,33 @@ +# Copyright (C) 2017 Statoil ASA, Norway. +# +# This file is part of ERT - Ensemble based Reservoir Tool. +# +# ERT 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. +# +# ERT 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 +# for more details. + +from ecl.test import LintTestCase + +class LintErt(LintTestCase): + """Tests that no file in ert needs linting""" + + def test_lint_ecl(self): + white = ['ecl_kw.py', 'ecl_type.py', 'ecl_sum.py', 'ecl_grid.py', 'ecl_npv.py'] # TODO fix issues and remove + self.assertLinted('ecl/ecl', whitelist=white) + + def test_lint_geo(self): + self.assertLinted('ecl/geo') + + def test_lint_util(self): + self.assertLinted('ecl/util') + + def test_lint_well(self): + self.assertLinted('ecl/well') diff --git a/ThirdParty/Ert/python/tests/util/CMakeLists.txt b/ThirdParty/Ert/python/tests/util/CMakeLists.txt new file mode 100644 index 0000000000..fdac8c12eb --- /dev/null +++ b/ThirdParty/Ert/python/tests/util/CMakeLists.txt @@ -0,0 +1,41 @@ +set(TEST_SOURCES + __init__.py + test_ctime.py + test_cstring.py + test_hash.py + test_lookup_table.py + test_matrix.py + test_rng.py + test_stat.py + test_string_list.py + test_substitution_list.py + test_thread_pool.py + test_cthread_pool.py + test_ui_return.py + test_vectors.py + test_version.py + test_work_area.py + test_path_context.py + test_arg_pack.py + test_spawn.py +) + +add_python_package("python.tests.util" ${PYTHON_INSTALL_PREFIX}/tests/util "${TEST_SOURCES}" False) + +addPythonTest(tests.util.test_ctime.CTimeTest) +addPythonTest(tests.util.test_cstring.CStringTest) +addPythonTest(tests.util.test_hash.HashTest) +addPythonTest(tests.util.test_lookup_table.LookupTableTest ) +addPythonTest(tests.util.test_matrix.MatrixTest ) +addPythonTest(tests.util.test_rng.RngTest ) +addPythonTest(tests.util.test_stat.StatTest ) +addPythonTest(tests.util.test_string_list.StringListTest) +addPythonTest(tests.util.test_vectors.UtilTest) +addPythonTest(tests.util.test_ui_return.UIReturnTest) +addPythonTest(tests.util.test_work_area.WorkAreaTest) +addPythonTest(tests.util.test_version.VersionTest) +addPythonTest(tests.util.test_path_context.PathContextTest) +addPythonTest(tests.util.test_thread_pool.ThreadPoolTest) +addPythonTest(tests.util.test_cthread_pool.CThreadPoolTest) +addPythonTest(tests.util.test_arg_pack.ArgPackTest) +addPythonTest(tests.util.test_spawn.SpawnTest) diff --git a/ThirdParty/Ert/python/tests/core/__init__.py b/ThirdParty/Ert/python/tests/util/__init__.py similarity index 100% rename from ThirdParty/Ert/python/tests/core/__init__.py rename to ThirdParty/Ert/python/tests/util/__init__.py diff --git a/ThirdParty/Ert/python/tests/core/util/test_arg_pack.py b/ThirdParty/Ert/python/tests/util/test_arg_pack.py similarity index 84% rename from ThirdParty/Ert/python/tests/core/util/test_arg_pack.py rename to ThirdParty/Ert/python/tests/util/test_arg_pack.py index a433f44fc0..0ecbe23c05 100644 --- a/ThirdParty/Ert/python/tests/core/util/test_arg_pack.py +++ b/ThirdParty/Ert/python/tests/util/test_arg_pack.py @@ -1,8 +1,8 @@ -import ert -from ert.test import ExtendedTestCase -from ert.util import ArgPack, StringList +import ecl +from ecl.test import ExtendedTestCase +from ecl.util import ArgPack, StringList -TEST_LIB = ert.load("libtest_util") +TEST_LIB = ecl.load("libert_util") class ArgPackTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/core/util/test_cstring.py b/ThirdParty/Ert/python/tests/util/test_cstring.py similarity index 87% rename from ThirdParty/Ert/python/tests/core/util/test_cstring.py rename to ThirdParty/Ert/python/tests/util/test_cstring.py index 4e533f9e11..fe82c5a6fe 100644 --- a/ThirdParty/Ert/python/tests/core/util/test_cstring.py +++ b/ThirdParty/Ert/python/tests/util/test_cstring.py @@ -1,10 +1,10 @@ -import ert +import ecl from cwrap import Prototype -from ert.test.extended_testcase import ExtendedTestCase +from ecl.test.extended_testcase import ExtendedTestCase # Local copies so that the real ones don't get changed class TestUtilPrototype(Prototype): - lib = ert.load("libert_util") + lib = ecl.load("libert_util") def __init__(self, prototype, bind=False): super(TestUtilPrototype, self).__init__(TestUtilPrototype.lib, prototype, bind=bind) diff --git a/ThirdParty/Ert/python/tests/core/util/test_cthread_pool.py b/ThirdParty/Ert/python/tests/util/test_cthread_pool.py similarity index 90% rename from ThirdParty/Ert/python/tests/core/util/test_cthread_pool.py rename to ThirdParty/Ert/python/tests/util/test_cthread_pool.py index 698fdc80ec..ee55aa9ce6 100644 --- a/ThirdParty/Ert/python/tests/core/util/test_cthread_pool.py +++ b/ThirdParty/Ert/python/tests/util/test_cthread_pool.py @@ -1,9 +1,9 @@ import ctypes -import ert -from ert.test import ExtendedTestCase -from ert.util import CThreadPool, startCThreadPool +import ecl +from ecl.test import ExtendedTestCase +from ecl.util import CThreadPool, startCThreadPool -TEST_LIB = ert.load("libtest_util") +TEST_LIB = ecl.load("libert_util") class CThreadPoolTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/core/util/test_ctime.py b/ThirdParty/Ert/python/tests/util/test_ctime.py similarity index 99% rename from ThirdParty/Ert/python/tests/core/util/test_ctime.py rename to ThirdParty/Ert/python/tests/util/test_ctime.py index 8a74c2c51e..292a13153a 100644 --- a/ThirdParty/Ert/python/tests/core/util/test_ctime.py +++ b/ThirdParty/Ert/python/tests/util/test_ctime.py @@ -1,7 +1,7 @@ import time from datetime import datetime, date -from ert.util import CTime +from ecl.util import CTime try: diff --git a/ThirdParty/Ert/python/tests/core/util/test_hash.py b/ThirdParty/Ert/python/tests/util/test_hash.py similarity index 93% rename from ThirdParty/Ert/python/tests/core/util/test_hash.py rename to ThirdParty/Ert/python/tests/util/test_hash.py index 1279794b08..528d123ee4 100644 --- a/ThirdParty/Ert/python/tests/core/util/test_hash.py +++ b/ThirdParty/Ert/python/tests/util/test_hash.py @@ -1,7 +1,7 @@ from ctypes import c_void_p -from ert.test import ExtendedTestCase -from ert.util import Hash, StringHash, DoubleHash, IntegerHash +from ecl.test import ExtendedTestCase +from ecl.util import Hash, StringHash, DoubleHash, IntegerHash class HashTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/core/util/test_lookup_table.py b/ThirdParty/Ert/python/tests/util/test_lookup_table.py similarity index 98% rename from ThirdParty/Ert/python/tests/core/util/test_lookup_table.py rename to ThirdParty/Ert/python/tests/util/test_lookup_table.py index de4fef4241..9a0fdccdfe 100644 --- a/ThirdParty/Ert/python/tests/core/util/test_lookup_table.py +++ b/ThirdParty/Ert/python/tests/util/test_lookup_table.py @@ -3,7 +3,7 @@ try: except ImportError: from unittest import TestCase -from ert.util import LookupTable +from ecl.util import LookupTable class LookupTableTest(TestCase): diff --git a/ThirdParty/Ert/python/tests/core/util/test_matrix.py b/ThirdParty/Ert/python/tests/util/test_matrix.py similarity index 97% rename from ThirdParty/Ert/python/tests/core/util/test_matrix.py rename to ThirdParty/Ert/python/tests/util/test_matrix.py index d5b6a626d1..d5d5205890 100644 --- a/ThirdParty/Ert/python/tests/core/util/test_matrix.py +++ b/ThirdParty/Ert/python/tests/util/test_matrix.py @@ -1,6 +1,6 @@ -from ert.util import Matrix , RandomNumberGenerator -from ert.util.enums import RngAlgTypeEnum, RngInitModeEnum -from ert.test import ExtendedTestCase, TestAreaContext +from ecl.util import Matrix , RandomNumberGenerator +from ecl.util.enums import RngAlgTypeEnum, RngInitModeEnum +from ecl.test import ExtendedTestCase, TestAreaContext class MatrixTest(ExtendedTestCase): def test_matrix(self): diff --git a/ThirdParty/Ert/python/tests/core/util/test_path_context.py b/ThirdParty/Ert/python/tests/util/test_path_context.py similarity index 94% rename from ThirdParty/Ert/python/tests/core/util/test_path_context.py rename to ThirdParty/Ert/python/tests/util/test_path_context.py index 06cb537574..51587a5827 100644 --- a/ThirdParty/Ert/python/tests/core/util/test_path_context.py +++ b/ThirdParty/Ert/python/tests/util/test_path_context.py @@ -1,5 +1,5 @@ import os -from ert.test import ExtendedTestCase, PathContext,TestAreaContext +from ecl.test import ExtendedTestCase, PathContext,TestAreaContext class PathContextTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/core/util/test_rng.py b/ThirdParty/Ert/python/tests/util/test_rng.py similarity index 89% rename from ThirdParty/Ert/python/tests/core/util/test_rng.py rename to ThirdParty/Ert/python/tests/util/test_rng.py index 21eea2177b..dc4b03f7ca 100644 --- a/ThirdParty/Ert/python/tests/core/util/test_rng.py +++ b/ThirdParty/Ert/python/tests/util/test_rng.py @@ -1,6 +1,6 @@ -from ert.util.enums import RngAlgTypeEnum, RngInitModeEnum -from ert.util.rng import RandomNumberGenerator -from ert.test import ExtendedTestCase,TestAreaContext +from ecl.util.enums import RngAlgTypeEnum, RngInitModeEnum +from ecl.util.rng import RandomNumberGenerator +from ecl.test import ExtendedTestCase,TestAreaContext class RngTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/core/util/test_spawn.py b/ThirdParty/Ert/python/tests/util/test_spawn.py similarity index 93% rename from ThirdParty/Ert/python/tests/core/util/test_spawn.py rename to ThirdParty/Ert/python/tests/util/test_spawn.py index 2ef47ad027..a867da3336 100644 --- a/ThirdParty/Ert/python/tests/core/util/test_spawn.py +++ b/ThirdParty/Ert/python/tests/util/test_spawn.py @@ -2,14 +2,14 @@ import os import stat import sys -import ert -from ert.test.extended_testcase import ExtendedTestCase -from ert.test.test_area import TestAreaContext +import ecl +from ecl.test.extended_testcase import ExtendedTestCase +from ecl.test.test_area import TestAreaContext from cwrap import Prototype class _TestSpawnPrototype(Prototype): - lib = ert.load('libert_util') + lib = ecl.load('libert_util') def __init__(self, prototype, bind=True): super(_TestSpawnPrototype, self).__init__(_TestSpawnPrototype.lib, prototype, bind=bind) diff --git a/ThirdParty/Ert/python/tests/core/util/test_stat.py b/ThirdParty/Ert/python/tests/util/test_stat.py similarity index 88% rename from ThirdParty/Ert/python/tests/core/util/test_stat.py rename to ThirdParty/Ert/python/tests/util/test_stat.py index e2a73bbf45..f1a79e9701 100644 --- a/ThirdParty/Ert/python/tests/core/util/test_stat.py +++ b/ThirdParty/Ert/python/tests/util/test_stat.py @@ -1,6 +1,6 @@ -from ert.test import ExtendedTestCase -from ert.util import DoubleVector, quantile, quantile_sorted, polyfit -from ert.util.rng import RandomNumberGenerator +from ecl.test import ExtendedTestCase +from ecl.util import DoubleVector, quantile, quantile_sorted, polyfit +from ecl.util.rng import RandomNumberGenerator class StatTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/core/util/test_string_list.py b/ThirdParty/Ert/python/tests/util/test_string_list.py similarity index 94% rename from ThirdParty/Ert/python/tests/core/util/test_string_list.py rename to ThirdParty/Ert/python/tests/util/test_string_list.py index c965ec5c42..a4076fe2c8 100644 --- a/ThirdParty/Ert/python/tests/core/util/test_string_list.py +++ b/ThirdParty/Ert/python/tests/util/test_string_list.py @@ -1,9 +1,11 @@ +from __future__ import absolute_import, division, print_function, unicode_literals + try: from unittest2 import TestCase except ImportError: from unittest import TestCase -from ert.util import StringList +from ecl.util import StringList class StringListTest(TestCase): @@ -83,7 +85,9 @@ class StringListTest(TestCase): self.assertFalse(s1 == ["A","B","D"]) self.assertFalse(s1 == ["A","B","C" , "D"]) - + pfx = 'StringList(size' # __repr__ + self.assertEqual(pfx, repr(s2)[:len(pfx)]) + def test_append_not_string(self): s = StringList() s.append(10) diff --git a/ThirdParty/Ert/python/tests/core/util/test_substitution_list.py b/ThirdParty/Ert/python/tests/util/test_substitution_list.py similarity index 90% rename from ThirdParty/Ert/python/tests/core/util/test_substitution_list.py rename to ThirdParty/Ert/python/tests/util/test_substitution_list.py index 0d60268ca9..8541b76044 100644 --- a/ThirdParty/Ert/python/tests/core/util/test_substitution_list.py +++ b/ThirdParty/Ert/python/tests/util/test_substitution_list.py @@ -1,5 +1,5 @@ -from ert.test import ExtendedTestCase -from ert.util import SubstitutionList +from ecl.test import ExtendedTestCase +from ecl.util import SubstitutionList class SubstitutionListTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/core/util/test_thread_pool.py b/ThirdParty/Ert/python/tests/util/test_thread_pool.py similarity index 95% rename from ThirdParty/Ert/python/tests/core/util/test_thread_pool.py rename to ThirdParty/Ert/python/tests/util/test_thread_pool.py index 3c772ec633..ffe620dcd6 100644 --- a/ThirdParty/Ert/python/tests/core/util/test_thread_pool.py +++ b/ThirdParty/Ert/python/tests/util/test_thread_pool.py @@ -1,7 +1,7 @@ import time -from ert.util import ThreadPool -from ert.util.thread_pool import Task -from ert.test import ExtendedTestCase +from ecl.util import ThreadPool +from ecl.util.thread_pool import Task +from ecl.test import ExtendedTestCase class ThreadPoolTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/core/util/test_ui_return.py b/ThirdParty/Ert/python/tests/util/test_ui_return.py similarity index 95% rename from ThirdParty/Ert/python/tests/core/util/test_ui_return.py rename to ThirdParty/Ert/python/tests/util/test_ui_return.py index b3dd1d5b6a..2e7dfe9e75 100644 --- a/ThirdParty/Ert/python/tests/core/util/test_ui_return.py +++ b/ThirdParty/Ert/python/tests/util/test_ui_return.py @@ -1,6 +1,6 @@ -from ert.test import ExtendedTestCase -from ert.util import UIReturn -from ert.util.enums import UIReturnStatusEnum +from ecl.test import ExtendedTestCase +from ecl.util import UIReturn +from ecl.util.enums import UIReturnStatusEnum class UIReturnTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/core/util/test_vectors.py b/ThirdParty/Ert/python/tests/util/test_vectors.py similarity index 99% rename from ThirdParty/Ert/python/tests/core/util/test_vectors.py rename to ThirdParty/Ert/python/tests/util/test_vectors.py index 99b7fe7885..9b710567eb 100644 --- a/ThirdParty/Ert/python/tests/core/util/test_vectors.py +++ b/ThirdParty/Ert/python/tests/util/test_vectors.py @@ -24,7 +24,7 @@ try: except ImportError: from unittest import TestCase -from ert.util import DoubleVector, IntVector, BoolVector, TimeVector, CTime, PermutationVector +from ecl.util import DoubleVector, IntVector, BoolVector, TimeVector, CTime, PermutationVector class UtilTest(TestCase): def setUp(self): diff --git a/ThirdParty/Ert/python/tests/core/util/test_version.py b/ThirdParty/Ert/python/tests/util/test_version.py similarity index 75% rename from ThirdParty/Ert/python/tests/core/util/test_version.py rename to ThirdParty/Ert/python/tests/util/test_version.py index 5e4e729a46..cb27655c8e 100644 --- a/ThirdParty/Ert/python/tests/core/util/test_version.py +++ b/ThirdParty/Ert/python/tests/util/test_version.py @@ -15,9 +15,9 @@ # for more details. import os.path -import ert -from ert.test import ExtendedTestCase -from ert.util import Version +import ecl +from ecl.test import ExtendedTestCase +from ecl.util import Version class VersionTest(ExtendedTestCase): @@ -39,6 +39,9 @@ class VersionTest(ExtendedTestCase): v2 = Version(1, 2, 3) self.assertTrue(v1 == v2) + self.assertEqual(v1, v2) + self.assertEqual(str(v1), str(v2)) + self.assertEqual(repr(v1), repr(v2)) self.assertFalse(v1 != v2) v1 = Version(1, 2, "X") @@ -66,6 +69,9 @@ class VersionTest(ExtendedTestCase): v2 = Version(1, 2, 3) v3 = (1, 2, 2) + self.assertEqual(str(v1), str(v2)) + self.assertEqual(repr(v1), repr(v2)) + self.assertTrue(v1 >= v2) self.assertFalse(v1 < v2) @@ -82,23 +88,32 @@ class VersionTest(ExtendedTestCase): v2 = Version(1, 2, 0) self.assertFalse(v1 >= v2) + self.assertNotEqual(str(v1), str(v2)) + self.assertNotEqual(repr(v1), repr(v2)) + + def test_current(self): current = Version.currentVersion() self.assertTrue(current > (0, 0, 0)) + pfx = 'Version(major=' + self.assertEqual(pfx, repr(current)[:len(pfx)]) def test_import(self): - from ert import Version as globalVersion + from ecl import Version as globalVersion v1 = globalVersion(1, 1, 2) v2 = Version(1, 1, 2) self.assertTrue(v1 == v2) + self.assertEqual(v1, v2) + self.assertEqual(repr(v1), repr(v2)) + def test_root_version(self): cv = Version.currentVersion( ) - self.assertEqual( ert.__version__ , cv.versionString() ) + self.assertEqual( ecl.__version__ , cv.versionString() ) def test_root_path(self): - self.assertTrue( os.path.isdir( os.path.join( ert.root() , "ert"))) - self.assertTrue( os.path.isfile( os.path.join( ert.root() , "ert", "__init__.py"))) + self.assertTrue( os.path.isdir( os.path.join( ecl.root() , "ecl"))) + self.assertTrue( os.path.isfile( os.path.join( ecl.root() , "ecl", "__init__.py"))) diff --git a/ThirdParty/Ert/python/tests/core/util/test_work_area.py b/ThirdParty/Ert/python/tests/util/test_work_area.py similarity index 98% rename from ThirdParty/Ert/python/tests/core/util/test_work_area.py rename to ThirdParty/Ert/python/tests/util/test_work_area.py index 5123c827e6..51403f817d 100644 --- a/ThirdParty/Ert/python/tests/core/util/test_work_area.py +++ b/ThirdParty/Ert/python/tests/util/test_work_area.py @@ -23,7 +23,7 @@ try: except ImportError: from unittest import skipIf -from ert.test import ExtendedTestCase , TestAreaContext, TempAreaContext +from ecl.test import ExtendedTestCase , TestAreaContext, TempAreaContext class WorkAreaTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/well/CMakeLists.txt b/ThirdParty/Ert/python/tests/well/CMakeLists.txt new file mode 100644 index 0000000000..e5853b33f6 --- /dev/null +++ b/ThirdParty/Ert/python/tests/well/CMakeLists.txt @@ -0,0 +1,14 @@ +set(TEST_SOURCES + __init__.py + test_ecl_well.py + test_ecl_well2.py + test_ecl_well3.py +) + +add_python_package("python.tests.well" ${PYTHON_INSTALL_PREFIX}/tests/well "${TEST_SOURCES}" False) + +if (STATOIL_TESTDATA_ROOT) + addPythonTest(well.test_ecl_well.EclWellTest LABELS StatoilData) + addPythonTest(well.test_ecl_well2.EclWellTest2 LABELS StatoilData) + addPythonTest(well.test_ecl_well3.EclWellTest3 LABELS StatoilData) +endif() diff --git a/ThirdParty/Ert/python/tests/core/ecl/__init__.py b/ThirdParty/Ert/python/tests/well/__init__.py similarity index 100% rename from ThirdParty/Ert/python/tests/core/ecl/__init__.py rename to ThirdParty/Ert/python/tests/well/__init__.py diff --git a/ThirdParty/Ert/python/tests/core/well/test_ecl_well.py b/ThirdParty/Ert/python/tests/well/test_ecl_well.py similarity index 99% rename from ThirdParty/Ert/python/tests/core/well/test_ecl_well.py rename to ThirdParty/Ert/python/tests/well/test_ecl_well.py index 7c5fcaad69..bcbf872d17 100644 --- a/ThirdParty/Ert/python/tests/core/well/test_ecl_well.py +++ b/ThirdParty/Ert/python/tests/well/test_ecl_well.py @@ -1,8 +1,8 @@ import datetime -from ert.ecl import EclGrid, EclFile, EclFileFlagEnum -from ert.test import ExtendedTestCase -from ert.util.ctime import CTime -from ert.well import WellInfo, WellConnection, WellTypeEnum, WellConnectionDirectionEnum, WellSegment +from ecl.ecl import EclGrid, EclFile, EclFileFlagEnum +from ecl.test import ExtendedTestCase +from ecl.util.ctime import CTime +from ecl.well import WellInfo, WellConnection, WellTypeEnum, WellConnectionDirectionEnum, WellSegment class EclWellTest(ExtendedTestCase): diff --git a/ThirdParty/Ert/python/tests/core/well/test_ecl_well2.py b/ThirdParty/Ert/python/tests/well/test_ecl_well2.py similarity index 87% rename from ThirdParty/Ert/python/tests/core/well/test_ecl_well2.py rename to ThirdParty/Ert/python/tests/well/test_ecl_well2.py index 07a78629f7..52797e2bfa 100644 --- a/ThirdParty/Ert/python/tests/core/well/test_ecl_well2.py +++ b/ThirdParty/Ert/python/tests/well/test_ecl_well2.py @@ -1,10 +1,10 @@ import datetime import os.path -from ert.ecl import EclGrid, EclFile, EclFileFlagEnum -from ert.test import ExtendedTestCase -from ert.util.ctime import CTime -from ert.well import WellInfo, WellConnection, WellTypeEnum, WellConnectionDirectionEnum, WellSegment +from ecl.ecl import EclGrid, EclFile, EclFileFlagEnum +from ecl.test import ExtendedTestCase +from ecl.util.ctime import CTime +from ecl.well import WellInfo, WellConnection, WellTypeEnum, WellConnectionDirectionEnum, WellSegment diff --git a/ThirdParty/Ert/python/tests/core/well/test_ecl_well3.py b/ThirdParty/Ert/python/tests/well/test_ecl_well3.py similarity index 93% rename from ThirdParty/Ert/python/tests/core/well/test_ecl_well3.py rename to ThirdParty/Ert/python/tests/well/test_ecl_well3.py index 9ce0796177..66283d261e 100644 --- a/ThirdParty/Ert/python/tests/core/well/test_ecl_well3.py +++ b/ThirdParty/Ert/python/tests/well/test_ecl_well3.py @@ -1,10 +1,10 @@ import datetime import os.path -from ert.ecl import EclGrid, EclFile, EclSum -from ert.test import ExtendedTestCase -from ert.util.ctime import CTime -from ert.well import WellInfo, WellConnection, WellTypeEnum, WellConnectionDirectionEnum, WellSegment +from ecl.ecl import EclGrid, EclFile, EclSum +from ecl.test import ExtendedTestCase +from ecl.util.ctime import CTime +from ecl.well import WellInfo, WellConnection, WellTypeEnum, WellConnectionDirectionEnum, WellSegment class EclWellTest3(ExtendedTestCase): diff --git a/ThirdParty/Ert/release-notes.txt b/ThirdParty/Ert/release-notes.txt index d2a844df15..193ab6d37f 100644 --- a/ThirdParty/Ert/release-notes.txt +++ b/ThirdParty/Ert/release-notes.txt @@ -1,39 +1,142 @@ -Versjon 2.1.0, October 2016 +Version 2.1.0 February 2017 PR: 1150 - 1415 +Open PR: 1352, 1358, 1362 -* Made ecl_file_view 1st class citizen, exposed to API -* Added EXCLUDE_HOSTS to LSF driver with dynamic blacklisting -* Fixed MAX_RUNTIME is respected by WPRO -* Added functionality to open restart files in RW mode with seek -* Improved date handling (all is UTC now) -* As a result of this the filesystem version has been upgraded to 107, to use an old case you must upgrade it: "ert_upgradefs_107 config_file". -* Bug fixes (EclKW and EclGrid) -* Improved jobs and plugin loading -* The entire source tree was changed with the removal of devel -* ecl_sum can load aquifer variables. +Queue system/workflows: + + - Functionality to blacklist nodes from LSF [1240, 1256, 1258, 1274, 1412, 1415]. + - Use bhist command to check lsf job status if job has expired from bjobs [1301]. + - Debug output from torque goes to stdout [1151]. + - Torque driver will not abort if qstat returns invalid status [1411]. + - Simulation status USER_EXIT - count as failed [1166]. + - Added Enum identifier 'JOB_QUEUE_DO_KILL_NODE_FAILURE [1268]. + - Have deprecated the ability to set queue options directly on the drivers [1288]. + - Added system for version specific loading for workflow job model + description files [1177]. + - Job loader should not try to load from directory [1187]. + - Refactoring of max runtime - initiated from WPRO [1237]. + - Determine which nodes are running a job [1251]. + +Build updates: + + - Check if python modules are present in the required version [1150]. + - Do not build ERT_GUI if PyQt4 is not found [1150, 1230]. + - Do not fail build numpy is not found [1153]. + - Allow for user provided CMAKE_C_FLAGS on linux [1300]. + - Require exactly version 2.7 of Python [1307]. + - Travis testing improvements [1363]. + - Removed devel/ directory from source [1196]. + - Setting correct working directory, and build target dependency + for sphinx-apidoc / html generation [1385]. + +Eclipse library: + + - C++ move constructor and operator= for smspec_node [1155, 1200]. + - fortio_ftruncate( ) [1161]. + - INIT writer will write keywords DEPTH, DX, DY, DZ [1164, 1172, 1311, 1388]. + - Grid writer will take unit system enum argument [1164]. + - New function ecl_kw_first_different( ) [1165]. + - Completion variables can be treated as totals [1167]. + - Fixed bug in ecl_kw_compare_numeric( ) [1168]. + - Refactored / inlined volume calculations in ecl_grid [1173, 1184]. + - Made function ecl_kw_size_and_type_equal() public [1192]. + - Fixed bug in ecl_grid_cell_contains() [1402, 1404, 1195, 1419]. + - OOM bug in ecl_kw_grdecl loader for large files [1207]. + - Cache cell volumes in ecl_grid [1228]. + - Geertsma / gravity functionality [1227, 1284, 1289, 1292, 1364, 1408]. + - Summary + restart - will allow some keyword differences [1296]. + - Implemented ecl_rst_file_open_write_seek( ) [1236]. + - Optionally apply mapaxes [1242, 1281]. + - Expose and use ecl_file_view datastructere - stop using 'blocks' in ecl_file objects [1250]. + - ecl_sum will internalize Aquifer variables [1275]. + - Make sure region properties RxxT are marked as total + depreecated some properties [1285]. + - ecl_kw_resize() + C++ operator[] [1316] + - Added small C++ utility to create eclipse filenames[1396]. + - Make sure restart and INIT files are written with correct unit ID [1399, 1407]. + - Skip keyword data type: 'C010' without failing [1406, 1410]. + - Adding parsing of the last (optional) config token for the SLAVES kwd [1409]. + - Add nnc index to the information exported by ecl_nnc_export() [1204]. + - Marked solvent related total keywords ?NIT and ?NPT.* as totals [1241]. + - Top active cell in grid [1322]. + - Added absolute epsilon to ecl_kw comparsion [1345,1351]. + +Smoother, updates and 'running': + + - Fixed bug with local updates of GEN_DATA [1291]. + - Changed default MDA weights and removed file input [1156, 1190, 1191]. + - Bug in handling of failed realisations [1163]. + - Fix bug missing assignment of analysis module in ES-MDA [1179]. + - OpenMP implementation of fwd_step [1185, 1324,1342]. + - Removes the ability to update dynamic variables [1189]. + - Allow max CV FOLD to be the number of ensembles [1205, 1208]. + - Fix for min_realizations logic [1206]. + - Can assign a specific analyis module for one local update [1224]. + - Handle updates when some summary relaisations are "too short" [1400, 1405]. + - Extending hook manager to support PRE_UPDATE and POST_UPDATE hooks [1340,1360]. + - RML logging is on by default [1318]. + - Changed default ENKF_ALPHA value to 3.0 [??] + - Implemented subsspacce inversion algorithm [1334, 1344]. + +libgeometry: + + - Added function to create new geo_surface (i.e. IRAP) object [1308]. + - Get (x, y) pos from surface [1395]. + +Python code: + + - cwrap has been moved out to stand-alone module, out of ert + package [1159, 1320, 1325, 1326, 1328, 1332, 1338, 1341, 1343, 1347, 1350, 1353] + - Simplified loading of shared libraries [1234]. + - Python3 preparations [1231, 1347]. + - Added __repr__ methods: [1266, 1327, 1329, 1331, 1348, 1373, 1375, 1377, 1384, 1387]. + - Implement __getitem__( ) for gen_data [1331]. + - Removed cstring_obj Python class [1387]. + - EclKW.numpy_array returns shared buffer ndarray [1180]. + - Minor bug in ecl_kw.py [1171]. + - Added EclKW.numpyView( ) and EclKW.numpyCopy( ) [1188]. + - Bug in EclKW slice access [1203]. + - Expose active_list better in Python [1392]. + - @TYPE@_vector suppports negative indices in __getitem__ and + __setitem__; added repr method [1378]. + - added root() methdo ert/__init__.py [1293]. + +GUI / Configuration / Documentation + + - Bug when viewing plots while simulating [1157.] + - Bug when plotting short vectors [1303]. + - Completely refactored the ERT Gui event system [1158, 1162]. + - Marked keywords INIT_SECTION and SCHEDULE_FILE as deprecated [1181]. + - Removed outdated keywords from documentation [1390]. + - Documented UMASK keyword [1186]. + - ConfigParser: Can turn off validation + warnings [1233, 1249, 1287]. + - Make ies advanced option only [1401]. + - Removing MAX_RUNNING_LOCAL and MAX_RUNNING_LSF from user doc [1398]. + - Apply plot style to other plots [1397]. + - Fig bug in initialization when out of range [1394]. + - Added new object for generic config settings [1391]. + - Changes to plot settings [11359,376,1380,1382,1386]. + - Fix bug in load case manually [1368]. + - Documentation of plugins [1194]. + - Changed all time handling to UTC. This will affect loading old cases [1229, 1257]. + - Removed keyword QC_PATH + updated GRID [1263]. + - Making sure the ertshell is creating the run path [1280]. + - Create Doxygen [1277,1278,1294,1309,1317]. + - Ability to run analysis from GUI [1314]. + - Improved documentation of priors [1319]. + - Bug in config parsing with relative paths [1333]. + - Field documentation updates [1337]. -Version 2.0.5, August 2016 -* rel_eps & abs_eps +libwecl_well: -Version 2.0, July 2016 -* functions to write keywords DEPTH, DX, DY and DZ keyword to the INIT file. -* failed realizations are correctly propagated back to the main running scope -* MDA is made first-class citizen and no longer a plugin + - Internalize rates for wells and connections in the well library + [1403]. + - New function well_ts_get_name() [1393]. -Version 1.10, November 2011 -* Set the the verbose flag from the environment variable ERT_VERBOSE. -* Abort if field transformation does not exist among the supported - transformations. -* Added small class EclCmp for comparing Eclipse simulation cases. -* Added function ecl_grid_cell_invalid / EclGrid.validCellGeometry( ). Typically - interesting for GRID files where not necessarily all cells are entered. -* Added function util_update_signalse() which will install util_abort_signal() - signal handler for all fatal signals in default state; using new function from - python ert/__init__py. -* Removed reference to undefined EnkFMain.__len__() method. +libutil: + + - Functions for parsing and outputting dates in ISO format[1248]. + - stringlist_join - like Python str.join [1243]. + - bug in matrix_dgemm [1286]. + - Resurrected block_fs utilities from the past [1297]. + - Slicing for runpath_list [1356]. -Version 1 -* Fixed crash when stopping running simulations from gui. -* Ertshell refactored. Implementing shell functionality has been simplified. -* Ertshell. Added dumping of entries in block mount files. -* Removed LaTeX reporting diff --git a/ThirdParty/Ert/script/download-pr b/ThirdParty/Ert/script/download-pr new file mode 100644 index 0000000000..6c20e4c4ca --- /dev/null +++ b/ThirdParty/Ert/script/download-pr @@ -0,0 +1,78 @@ +#!/usr/bin/env python +import requests +import json +import os +import sys + +closed_pr = set( [1197 , 1201, 1235, 1244, 1245, 1252, 1261, 1262, 1366, + 1357, 1282, 1279, 1267, 1273, 1305, 1312, 1313, 1339 , 1346, + 1354, 1370,1371, 1381]) + +def getPRList( api_token, first_pr ): + pr = first_pr + pr_list = [] + prev_len = 0 + sys.stderr.write("Downloading PR: ") + while True: + if pr in closed_pr: + pr += 1 + else: + url = "https://api.github.com/repos/Ensembles/ert/pulls/%d" % pr + response = requests.get( url , {"access_token" : api_token}) + for i in range(prev_len): + sys.stdout.write("\b") + + sys.stdout.write("%d" % pr ) + sys.stdout.flush() + prev_len = len("%s" % pr) + + if response.status_code == 200: + pr_list.append( json.loads( response.content ) ) + pr += 1 + else: + break + + + + return pr_list + + +def printPRList( pr_list , fileH): + for pr in pr_list: + title = pr["title"] + body = pr["body"] + nr = pr["number"] + + try: + fileH.write( "[%d] *%s*\n\n" % (nr , title)) + except UnicodeEncodeError: + fileH.write(" [%d] : UnicodeError") + + try: + fileH.write( "%s\n\n\n" % body ) + except UnicodeEncodeError: + fileH.write("UnicodeError") + + +def main(): + if "GITHUB_API_TOKEN" in os.environ: + github_api_token = os.getenv("GITHUB_API_TOKEN") + else: + sys.exit("You must create a github access token and set the environment variable 'GITHUB_API_TOKEN' to proceed") + + pr1 = int(sys.argv[1]) + pr_list = getPRList( github_api_token, pr1) + pr2 = pr_list[-1]["number"] + + filename = "/tmp/relnotes-%d-%d" % (pr1 , pr2) + printPRList( pr_list , open(filename , "w")) + + print "Have created file: %s which can be a starting point for release notes" % filename + + + + +if __name__ == "__main__": + main( ) + + diff --git a/ThirdParty/Ert/script/job_dispatch.py b/ThirdParty/Ert/script/job_dispatch.py deleted file mode 100644 index 5c0ada4de2..0000000000 --- a/ThirdParty/Ert/script/job_dispatch.py +++ /dev/null @@ -1,354 +0,0 @@ -#!/usr/bin/env python -from __future__ import print_function -import sys -import os -import os.path -import socket -import time -import random -import subprocess - - -OK_file = "OK" -EXIT_file = "EXIT" -STATUS_file = "STATUS" -run_path = sys.argv[1] -sleep_time = 10 # Time to sleep before exiting the script - to let the disks sync up. -short_sleep = 2 - -################################################################# - -def redirect(file , fd , open_mode): - new_fd = os.open(file , open_mode , 0644) - os.dup2(new_fd , fd) - os.close(new_fd) - - -def cond_symlink(target , src): - if not os.path.exists(src): - os.symlink( target , src ) - - -def cond_unlink(file): - if os.path.exists(file): - os.unlink(file) - - - -def exec_job(job , executable): - if job.get("stdin"): - redirect(job["stdin"] , 0 , os.O_RDONLY) - - if job.get("stdout"): - redirect(job["stdout"] , 1 , os.O_WRONLY | os.O_TRUNC | os.O_CREAT ) - - if job.get("stderr"): - redirect(job["stderr"] , 2 , os.O_WRONLY | os.O_TRUNC | os.O_CREAT ) - - if job.get("environment"): - env = job["environment"] - for key in env.keys(): - os.putenv(key , env[key]) - argList = [ executable ] - if job.get("argList"): - argList += job["argList"] - os.execvp(executable , argList ) - - -def job_process(job , executable): - import subprocess - argList = [ executable ] - if job.get("argList"): - argList += job["argList"] - - P = subprocess.Popen( argList , - stdin = job.get("stdin"), - stdout = job.get("stdout"), - stderr = job.get("stderr"), - env = job.get("environment") ) - return P - - -def kill_process( job , P ): - fileH = open( EXIT_file , "a") - fileH.write("Job:%s has been running for more than %d minutes - explicitly killed.\n" % (job["name"] , job["max_running_minutes"])) - fileH.close() - - try: - P.kill() # P.kill became available in Python2.6 - except AttributeError: - os.system("kill -9 %s" % P.pid) - - -def unlink_empty(file): - if os.path.exists(file): - st = os.stat( file ) - if st.st_size == 0: - os.unlink( file ) - - - -def cleanup( job ): - if job.get("stdout"): - unlink_empty( job["stdout"] ) - if job.get("stderr"): - unlink_empty( job["stderr"] ) - if job.get("license_link"): - os.unlink(job["license_link"]) - - - -# This function implements a simple "personal license" system limiting -# how many instances of this job can run concurrently. Observe that the -# limiting is based on pr. invocation of the queue system (i.e. ERT -# binary) and pr user. The system works as follows: -# -# 1. The job is initilized with a license_path and a max_running -# variable. -# -# 2. In the licens_path directory a license file is made. -# -# 3. For each instance a random hard-link is created to the license -# file - this is how the number of concurrent uses is counted. -# -# 4. When the external program is finished the hard link is removed. - - -def license_check( job ): - job["license_link"] = None - if job.has_key("max_running"): - if job["max_running"]: - job["license_file"] = "%s/%s" % (job["license_path"] , job["name"]) - max_running = job["max_running"] - license_file = job["license_file"] - while True: - job["license_link"] = "%s/%d" % (job["license_path"] , random.randint(100000,999999)) - if not os.path.exists(job["license_link"]): - break - - - if not os.path.exists(license_file): - fileH = open(license_file , "w") - fileH.write("This is a license file for job:%s" % job["name"]) - fileH.close() - - - stat_info = os.stat(license_file) - currently_running = stat_info[3] - 1 - - while True: - stat_info = os.stat(license_file) - currently_running = stat_info[3] - 1 - if currently_running < max_running: - break - else: - time.sleep(5) - - os.link(license_file , job["license_link"]) - - while True: - stat_info = os.stat(license_file) - currently_running = stat_info[3] - 1 - if currently_running <= max_running: - break # OK - now we can leave the building - and let the job start - else: - time.sleep(5) - - -# Compatibility mode which must be retained until all ert prior to -# svn 2709 has been removed. - -def get_executable( job ): - executable = job.get("executable") - if not executable: - executable = job.get("portable_exe") - if not executable: - cpu = os.uname()[4] - if job["platform_exe"].has_key(cpu): - executable = job["platform_exe"][cpu] - else: - return (False, 0 , "%s : did not recognize platform:%s" % (job["name"] , cpu)) - - return executable - - - -def run_one(job): - license_check( job ) - if job.get("stdin"): - if not os.path.exists(job["stdin"]): - return (False , 0 , "Could not locate stdin file: %s" % job["stdin"]) - - if job.get("start_file"): - if not os.path.exists(job["start_file"]): - return (False , -1 , "Could not locate start_file:%s" % job["start_file"]) - - if job.get("error_file"): - if os.path.exists( job.get("error_file")): - os.unlink( job.get("error_file") ) - - - executable = get_executable( job ) - start_time = time.time() - - if job.get("max_running_minutes"): - P = job_process( job , executable) - while True: - time.sleep( short_sleep ) - run_time = time.time() - start_time - poll = P.poll() - if poll is None: - # Still running - if run_time > job["max_running_minutes"] * 60: - # Have been running to long - kill it - kill_process( job , P ) - break - else: - # Have completed within the time limits - break - exit_status = 0 # NOOOT properly used - else: - pid = os.fork() - if pid == 0: - exec_job(job , executable) - else: - (return_pid , exit_status) = os.waitpid(pid , 0) - - - # Check success of job; look for both target_file and - # error_file. Both can be used to signal failure - # independently. - - if job.get("target_file"): - if os.path.exists(job["target_file"]): - stat = os.stat(job["target_file"]) - if stat.st_ctime > start_time: - status = (True , 0 , "") - else: - status = (True , 0 , "Hmmm - seems the target file has not been updated - let the job suceed anyway...??") - else: - status = (False , exit_status , "%s : could not find target_file:%s" % (job["name"] , job["target_file"])) - else: - status = (True , exit_status , "Target file not specified") # Do not really look at exit status yet... - - if status[0]: - if job.get("error_file"): - if os.path.exists( job.get("error_file") ): - status = (False , -1 , "Found the error file:%s - job failed" % job.get("error_file")) - - return status - - - - - -################################################################# - -################################################################# - -os.nice(19) -if not os.path.exists( run_path ): - sys.stderr.write("*****************************************************************\n"); - sys.stderr.write("** FATAL Error: Could not find directory: %s \n" % run_path) - sys.stderr.write("** CWD: %s\n" % os.getcwd()) - sys.stderr.write("*****************************************************************\n"); - - fileH = open(EXIT_file , "w") - fileH.write("Could not locate:%s " % run_path) - fileH.write("CWD: %s" % os.getcwd()) - fileH.close() - sys.exit(-1) - - -################################################################# -# 1. Change current directory to the runpath. -# 2. Modify the sys.path variable to include the runpath -# 3. Import the jobs module. -################################################################# -os.chdir( run_path ) -sys.path.append( os.getcwd() ) -import jobs - -# The jobs module can optionally have a dictionary 'options', which can be -# used to modify some of the global run time properties of the script. -if hasattr(jobs , "options"): - options = getattr( jobs , "options") - OK_file = options.get("OK_file" , OK_file ) - EXIT_file = options.get("EXIT_file" , EXIT_file ) - STATUS_file = options.get("STATUS_file" , STATUS_file ) - sleep_time = options.get("sleep_time" , sleep_time ) - -cond_unlink(EXIT_file) -cond_unlink(STATUS_file) -cond_unlink(OK_file) -fileH = open(STATUS_file , "a") -fileH.write("%-32s: %s/%s\n" % ("Current host" , socket.gethostname() , os.uname()[4])) -fileH.close() - - -random.seed() - -for job in jobs.jobList: - # To ensure compatibility with old versions. - if not job.has_key("max_running_minutes"): - job["max_running_minutes"] = None - -if len(sys.argv) == 2: - # Normal batch run. - for job in jobs.jobList: - fileH = open(STATUS_file , "a") - now = time.localtime() - fileH.write("%-32s: %02d:%02d:%02d .... " % (job["name"] , now.tm_hour , now.tm_min , now.tm_sec)) - fileH.close() - (OK , exit_status, error_msg) = run_one(job) - now = time.localtime() - if OK: - fileH = open(STATUS_file , "a") - fileH.write("%02d:%02d:%02d \n" % (now.tm_hour , now.tm_min , now.tm_sec)) - fileH.close() - else: - fileH = open(EXIT_file , "a") - fileH.write("%02d:%02d:%02d \n" % (now.tm_hour , now.tm_min , now.tm_sec)) - fileH.write("%s : failed\n" % job["name"]) - fileH.write("%s\n" % error_msg) - fileH.close() - sys.exit(exit_status) - - - if OK: - fileH = open("OK" , "w") - fileH.write("All jobs complete") - fileH.close() - time.sleep( sleep_time ) # Let the disks sync up -else: - #Interactive run - jobHash = {} - for job in jobs.jobList: - jobHash[job["name"]] = job - - for job_name in sys.argv[2:]: - # This is totally unpredictable if there more jobs with - # the same name. - if jobHash.has_key( job_name ): - job = jobHash[job_name] - print('Running job: %s ... ' % job_name, end='') - sys.stdout.flush() - (OK , exit_status, error_msg) = run_one( job ) - if OK: - print('OK') - else: - print('failed ...') - print('-----------------------------------------------------------------') - if job.get("stderr"): - print('Error:%s ' % error_msg) - if os.path.exists(job["stderr"]): - fileH = open(job["stderr"],"r") - for line in fileH.readlines(): - print(line, end='') - fileH.close() - print('-----------------------------------------------------------------') - sys.exit() - else: - print('Job: %s does not exist. Available jobs:' % job_name) - for j in jobs.jobList: - print(' %s' % j['name']) diff --git a/ThirdParty/Ert/share/gui/doc/documentation.txt b/ThirdParty/Ert/share/gui/doc/documentation.txt deleted file mode 100644 index 7a25a71ffc..0000000000 --- a/ThirdParty/Ert/share/gui/doc/documentation.txt +++ /dev/null @@ -1,70 +0,0 @@ -ERTGUI core documentation - - Codebase in C Codebase in Python - -+--------------------+ +-------------------------+ -| ERT |/------------\| ErtWrapper | -| shared C library |\------------/| ctypes wrapper | -+--------------------+ | (C <-> Python comm.) | - +-------------------------+ - /\ - || - || - \/ - +-------------------------+ - | ContentModel | - | Class for fetching and | - | updating data in ERT | - +-------------------------+ - /\ - || - || - \/ - +-------------------------+ - | Widgets | - | GUI components that | - | enables presentation | - | and modification of | - | data in ERT | - +-------------------------+ - - -ERT: - the base software which the GUI controls. - -ErtWrapper: - this class simplifies the link between Python code and the exposed - functions of the shared library of ERT. - All communication between ERT and the GUI is performed through this - class and type safety of the functions in the shared library are - provided through a prototyping functionality. - -ContentModel: - This class is a base class for all widgets and algorithms that need - to communicate with ERT. Several abstract functions are defined that - must/can be implemented: - * initialize(model): typically used for prototyping of functions - * getter(model): used to fetch data from ERT - * setter(model, value): used for updating data values - * insert(model, value): used for adding data values - * remove(model, value): used for removing data values - - The program should never call these functions directly but use: - * getFromModel(): which will call the getter automatically - * updateContent(value, operation = UPDATE|INSERT|REMOVE): - which will call setter/insert/remove respectively automatically. - - A final function that must be implemented is fetchContent(). This function - will automatically be called when the model (ERT) is ready or has been - changed. This is also safe to be called by the program. Typical use of this - function is to call getFromModel() which returns the data generated by the - implemented getter function and then populate the widgets with the data. - - Whenever changes are made to the GUI ERT should be updated by calls - to updateContent(). - -Widgets: - Several widgets have been implemented. Most of these subclass HelpedWidget - which subclass ContentModel and provide built-in help functionality. - - diff --git a/ThirdParty/Ert/share/gui/doc/info.txt b/ThirdParty/Ert/share/gui/doc/info.txt deleted file mode 100644 index 09b28d82a0..0000000000 --- a/ThirdParty/Ert/share/gui/doc/info.txt +++ /dev/null @@ -1,244 +0,0 @@ -forward_model: --------------- - -get: ----- -model_config = enkf_main_get_model_config( enkf_main ) -forward_model = model_config_get_forward_model( model_config ) -names = forward_model_alloc_joblist( forward_model ) <- Allokerer en stringlist() med navnene på jobbene. - - - -set ---- -forward_model_clear( forward_model ) - -forward_model_add_job( forward_model , job_name ); -forward_model_iset_job_arg( forward_model , job_nr , key , value); <- Set argument - observe that the jobs are identified with the index in - the forward model, and not by name. - -more ----- -s = enkf_main_get_site_config( enkf_main ) -joblist = site_config_get_installed_jobs( s ); -job_names = ext_joblist_alloc_list( joblist ); <- Stringlist - - - -forward_model_get_job( forward_model , ?NAME?) -ext_joblist_get_job( joblist , ?NAME?) - -ext_job = forward_model_iget_job( forward_model , job_nr ) -arg_string = ext_job_get_private_args_as_string( ext_job ); -ext_job_set_private_args_from_string( ext_job , "KEY1=Value1 , Key2=value2" ) - - -ext_job_get_help_text( job ); - - --------------------------------------- - - -LOG: - -Get ---- -log_file = enkf_main_get_log_file( enkf_main ) -log_level = enkf_main_get_log_level( enkf_main ) - - -Set ---- -enkf_main_set_log_file( enkf_main , "log_file" ) -enkf_main_set_log_level( enkf_main , log_level ) - - -analysis_config = enkf_main_get_analysis_config( enkf_main ) -log_path = analysis_config_get_log_path( analysis_config ); -analysis_config_set_log_path( analysis_config , log_path ); - - - - -INITIALIZED ------------ - -enkf_main_is_initialized(enkf_main , active_mask); - -active_mask er nå en vector av typen: bool_vector som er implementert i -libutil. Dersom alle elemementene er aktive kan du sende inn None / -NULL, ellers må allokere og initialisere en active_mask instans: - -mask = bool_vector_alloc(0 , false) -for index in selectedMembers: - bool_vector_iset( mask , index , true ) - -enkf_main_is_initialized( enkf_main , mask ) -bool_vector_free( mask ) - - - - -TEMPLATES: ----------- -Get: ----- -templates = enkf_main_get_templates( enkf_main ); -s = ert_templates_alloc_list( templates ); <- Returnerer en stringlist med navn -template = ert_templates_get_template( templates , "Navn") -template_file = ert_template_get_template_file( template ); -target_file = ert_template_get_target_file( template ); -arg_string = ert_template_get_args_as_string( template ) - - -Set: (kan enten gjøres med manuelle add / del eller ved hjelp av clear og add). ----- -templates = enkf_main_get_templates( enkf_main ); -ert_templates_clear( templates ); -ert_templates_del_template( templates , "Key"); -template = ert_templates_add_template( templates , "Key", "Template_file" , "target_file" , arg_string /* Can be None / NULL */); - -template = ert_templates_get_template( templates , Key) -ert_template_set_target_file(template , target_file ); -ert_template_set_template_file(template , template_file ); -ert_template_set_args_as_string(template , arg_string); - - - - - -INITIALIZATION --------------- - -enkf_main_initialize_from_existing__( enkf_main , source_case , source_step , source_state , - iens_mask , ranking_key /* Will be NULL*/ , - node_list); - - - -node_list ~ stringlist med de valgt nodene. - -iens_mask = bool_vector_alloc(0 , false); <- Allokereres med false som default. -iens_mask ~ bool_vector hvor alle de aktive indeksene er satt til true - - - -SCHEDULE_PREDICTION_FILE ------------------------- -Get: enkf_main_get_schedule_prediction_file( enkf_main ) -Set: enkf_main_set_schedule_prediction_file( enkf_main , filename ) - - -REFCASE -------- -Get: -ecle_config = enkf_main_get_ecl_config( enkf_main ); -refacse = ecl_config_get_refcase_name( ecl_config ) - -Set: -enkf_main_set_refcase( enkf_main , refcase ) ???????????????????? Ikkje load? - - - -HISTORY_SOURCE --------------- -Get: -m = enkf_main_get_model_config( enkf_main ) -history_source = model_config_get_history_source( m ) <- History_source ~ enum history_source_type fra libsched/src/history.y - - -Set: -m = enkf_main_get_model_config( enkf_main ) -model_config_get_history_source( m , source) <- NB Hvis source har en av verdiene REFCASE_HISTORY / REFCASE_SMULATED du maa satt ett REFACSE forst. - - - -PRE_CLEAR_RUNPATH: ------------------ -Get: enkf_main_get_pre_clear_runpath( enkf_main ) <- Return value: true | false -Set: enkf_main_set_pre_clear_runpath( enkf_main , true | false ) - - - - -CASE_TABLE ----------- -model_config = enkf_main_get_model_config( enkf_main ); - -get: model_config_get_case_table_file( model_config ) -set: enkf_main_set_case_table( model_config , filename ); <- File must exist - - - -REFCASE - Plotting: ------------------- -Get: - -ecl_config = enkf_main_get_ecl_config( enkf_main ) -ecl_sum = ecl_config_get_refcase( ecl_config ) - -Plotting: - - 1. Sjekk om refcase har variabel: - - ecl_sum_has_general_var( ecl_sum , key) - - hvor 'key' er en summary key, som for eksempel "WWCT:OP_1". Dersom denne funksjonen returnerer true, maa du - sporre ecl_sum som en "oversettelse" fra key til en integer index, og siden bruke den indeksen: - - key_index = ecl_sum_get_general_var_index( ecl_sum , key ); - - - 2. Alloker en tidsakse: - - time_vector = ecl_sum_alloc_time_vector( ecl_sum , true /* Report_only kan vre true */); - - Denne kan selvflgelig gjenbrukes mellom flere summary plott. - - 3. Alloker datavektor - - data_vektor1 = ecl_sum_alloc_data_vector( ecl_sum , key_index1 , true ); - - - Da har du x og y i en hhv time_t_vector og double_vector - en av joakims hjemmelade datastrukturer: - - size: xxx_vector_get_size( ) - get1: xxx_vector_iget( ) - get2: xxx_vector_get_ptr() <- Returnerer en peker til underliggende data. - - - 4. xxx_vector_free () naar du er ferdi. - - -5. (Ekstraoppgave:) en ecl_sum instans kan også loades fra filsystemet (helt utenfor ERT sin database) med - - ecl_sum = ecl_sum_fread_alloc_case( "Navn på en ECLIPSE.DATA fil" ) - ---------------------- - -Gen_data: -size: ------ -ensemble_config = enkf_main_get_ensemble_config( enkf_main ) -config_node = ensemble_config_get_node( ensemble_config , "KEY") -gen_data_config = enkf_config_node_get_ref( config_node ) - -size = gen_date_config_get_initial_size( gen_data_config ) - -Value: ------ -value = enkf_node_user_get( enkf_node , "KEY:tall" , &valid) <----- NB Det er helt avgjørende å sjekke at valid returnerer true, - gen_data typen er (altfor) fleksibel, og kan endre størrelse runtime. - At du har sjekket initiell størrelse er derfor desverre ikke tilstrekkelig - til å validere input. - - ----------------- -Saving: - -1. Sette config file: enkf_main_set_user_config_file( enkf_main , "config_file" ) [Denne trengs for "Save AS"] -2. enkf_main_fprintf_config( enkf_main ); - - - - \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/doc/initializers b/ThirdParty/Ert/share/gui/doc/initializers deleted file mode 100644 index 26ec3d9224..0000000000 --- a/ThirdParty/Ert/share/gui/doc/initializers +++ /dev/null @@ -1,201 +0,0 @@ - -mask = util.bool_vector_alloc(ens_size , false) -# Første arg: størrelse -# Andre arg: init verdi. - -util.bool_vector_iset( mask , 67 , true ) -# bool_ptr = util.bool_vector_get_ptr( mask ) -# Send inn int_ptr -.... -#util.bool_vector_free( mask ) - - - - - - - -#Missing initializer: job_script -# s = enkf_main_get_site_config( enkf_main ) -# site_config_get_job_script( s ); -# site_config_set_job_script( s , EXECUTABLE_FILE ); - - - - -Missing initializer: install_job - s = enkf_main_get_site_config( enkf_main ); - site_config_install_job( s , JOB_KEY , EXISTING_FILE ); <- Should have a GUI option for creating the - config file EXISTING_FILE - -INSTALL_JOB: ------------ -1. Denne bør endre navn til "Private jobs" - -2. Her blir get/set ganske komplisert - det er to grunner til det: - - a) Listen over installerte jobber inneholder både globale jobber, - som brukeren ikke har anledning til å manipulere, og "Private" - jobber som brukeren har installert og således må få lov til å - manipulere. - - b) Foreløpig er det bare basert en config_file, men når vi først - lager GUI ville det være veldig naturlig å lage mulighet for å - konfigurere en jobb via GUI. - -3. Det opprinnelige GUI panelet består av to felt. Kutt ut det ene - feltet, men la det sprette opp ett vindu når man legger til en - jobb. - - -Get: -s = enkf_main_get_site_config( enkf_main ) -jl = site_config_get_installed_jobs( s ) -h = ext_joblist_get_jobs( jl ) <- Nå er h en hash tabell. - -#Itererer over hash_tabellen: -python_joblist = [] -job = hash_get( h , job_name ); -if ext_job_is_private( job ): <- Denne funksjonen er i libjob_queue - python_joblist.append( job_name ) - -OK : python_joblist skal inneholde de job_navnene som skal - vises i GUI. - - - -Set: Her tror jeg det er enklest å respondere eksplisitt på add_job og - del_job events, istedet for å ta en batch prosess til slutt - -add_job: --------- -job = ext_job_fscanf_alloc( job_name , site_config_get_license_root_path__( s ) , job_config_file ) # job_name and job_config_file from GUI. -ext_joblist_add_job( jl , job ) - - -del_job -------- -ext_joblist_del_job( jl , job_name ) - - - - - - -#Missing initializer: num_realizations -# enkf_main_get_ensemble_size( enkf_main ); -# enkf_main_resize_ensemble( enkf_main ); <- Denne kan potensielt ta en del tid, og - bør være beskyttet av en APPLY knapp. - - -Missing initializer: parameters -Missing initializer: param_type -Missing initializer: param_min -Missing initializer: param_max -Missing initializer: param_init -Missing initializer: param_output -Missing initializer: param_init_files -Missing initializer: param_file_generated_by_enkf -Missing initializer: param_file_loaded_by_enkf -Missing initializer: history_source -Missing initializer: obs_config - - - -#Missing initializer: max_submit -# s = enkf_main_get_site_config( enkf_main ); -# site_config_get_max_submit( s ); -# site_config_set_max_submit( s , max_submit ); - - - - -#Missing initializer: max_resample -# m = enkf_main_get_model_config( enkf_main ); -# model_config_get_max_resample( m ); -# model_config_set_max_resample( m , max_resample ); - - - -Missing initializer: forward_model -Missing initializer: case_table -Missing initializer: license_path - -Missing initializer: runpath -# m = enkf_main_get_model_config( enkf_main ) -# model_config_get_runpath_fmt( m ) -# model_config_set_runpath_fmt( m , "/path/to/run%d" ) - - - -Missing initializer: pre_clear_runpath -Missing initializer: delete_runpath -Missing initializer: keep_runpath -Missing initializer: run_template -Missing initializer: dbase_type -Missing initializer: enspath -Missing initializer: select_case - - -#Missing initializer: log_file -#Missing initializer: log_level -# lg = enkf_main_get_logh( enkf_main ); -# log_reset_filename( lg , "/some/path/to/FILENAME" ); -# log_get_filename( lg ); -# -# log_get_level( lg ); -# log_set_level( lg , LOG_LEVEL) - - - -Missing initializer: update_log_path - - - - -#Get: s = enkf_main_get_data_kw( enkf_main ) -# subst_list_get_size( s ) -# subst_list_iget_key( s ) -# subst_list_iget_value( s ) -#Set: enkf_main_clear_data_kw( enkf_main ) -# enkf_main_add_data_kw( enkf_main , key , value ) - -#Get: m = enkf_main_get_model_config( enkf_main ) -# model_config_get_enkf_sched_file( m ) -#Set: model_config_set_enkf_sched_file( m , "FILENAME" ) - -#Get l = enkf_main_get_local_config( enkf_main ); -# s = local_config_get_config_files( l ) # Stringlist -#Set local_config_clear_config_files( l ) -# local_config_add_config_file(l , "FILENAME") - -#Get s = enkf_main_get_site_config( enkf_main ) -# site_config_get_max_running_(lsf|rsh|local)( s ) -#Set site_config_get_max_running_(lsf|rsh|local)( s , value ) - -#Get s = enkf_main_get_site_config( enkf_main ) -# h = site_config_get_rsh_host_list( s ) -# Iterer over hash - men bruk hash_get_int() for aa faa antall jobber en host kan ta. -#Set site_config_clear_rsh_host_list( s ) -# site_config_add_rsh_host( s , host_name , max_running ) - -#Get s = enkf_main_get_site_config( enkf_main ) -# queue_name = site_config_get_lsf_queue( s ) -#Set site_config_set_lsf_queue( s , "NORMAL" ) - -# site_config_set_job_queue( s , "LOCAL|LSF|RSH" ); -# site_config_get_job_queue_name( s ); - -#self.job_script = "..." -#self.setenv = [["LSF_BINDIR", "/prog/LSF/7.0/linux2.6-glibc2.3-x86_64/bin"], ["LSF_LIBDIR", "/prog/LSF/7.0/linux2.6-glibc2.3-x86_64/lib"]] -#Get: s = enkf_main_get_site_config( enkf_main ) -# h = site_config_get_env_hash( s ) -#Set site_config_clear_env( s ) -# site_config_setenv( s , var , value ) - -#self.update_path = [["PATH", "/prog/LSF/7.0/linux2.6-glibc2.3-x86_64/bin"], ["LD_LIBRARY_PATH", "/prog/LSF/7.0/linux2.6-glibc2.3-x86_64/lib"]] -#Get: s = enkf_main_get_site_config( enkf_main ) -# pathlist = site_config_get_path_variables( s ) -# valuelist = site_config_get_path_values( s ) -#Set: site_config_clear_pathvar( s ) -# site_config_update_pathvar( s , path , value ); diff --git a/ThirdParty/Ert/share/gui/doc/run_info b/ThirdParty/Ert/share/gui/doc/run_info deleted file mode 100644 index 3c7280a722..0000000000 --- a/ThirdParty/Ert/share/gui/doc/run_info +++ /dev/null @@ -1,36 +0,0 @@ -state = enkf_main_iget_state( enkf_main , iens ); -status = enkf_state_get_run_status( state ); -sim_start = enkf_state_get_start_time( state ); -submit_time = enkf_state_get_submit_time( state ); - - -Queue running: -------------- -s = enkf_main_get_site_config( enkf_main ) -site_config_queue_is_running( s ) - - -Kill simulation ---------------- -enkf_state_kill_simulation( state ) - - -Restart simulation ------------------- -enkf_state_restart_simulation( state , resample ) /* Resample er en bool - True: Kjør ny initialisering */ - - - - -Main queue pausing: -------------------- -job_queue_get_pause( jq ) - -job_queue_set_pause_on( jq ) - -job_queue_set_pause_off( jp ) - - - - - diff --git a/ThirdParty/Ert/share/gui/doc/tmp_info.txt b/ThirdParty/Ert/share/gui/doc/tmp_info.txt deleted file mode 100644 index bc63f69f66..0000000000 --- a/ThirdParty/Ert/share/gui/doc/tmp_info.txt +++ /dev/null @@ -1,69 +0,0 @@ -GEN_DATA (Det er ikke skille p GEN_DATA og GEN_PARAM - alt er GEN_DATA) --------- - -1. Opprette en ny: ensemble_config_add_gen_data( ensemble_config , new_key ); - - -2 Get: - - gen_data_config = enkf_config_node_get_ref( config_node ); - - output_format = gen_data_config_get_output_format( gen_data_config ); <- Returverdien her er en enum: gen_data_file_format_type, - input_format = gen_data_config_get_input_format( gen_data_config ); definert i gen_data_config.h - template_file = gen_data_config_get_template_file( gen_data_config ); - template_key = gen_data_config_get_template_key( gen_data_config ); - init_file_fmt = gen_data_config_get_init_file_fmt( gen_data_config ); - ..... - enkf_config_node_get_enkf_outfile( config_node ) -> Include file (parameter/general) - enkf_config_node_get_min_std_file( config_node ) -> Min. std. (parameter/general) - enkf_config_node_get_enkf_infile( config_node ) -> File loaded by EnKF (general) - - - -3. Update: - - enkf_config_node_update_gen_data( config_node , input_format , output_format , /* Enum: gen_data_file_format_type */ - init_file_format , - template_file , - template_key , - enkf_outfile_fmt , - enkf_infile_fmt , - min_std_file ); - - Legg merke til at det er ganske MAANGE innbyrdes krav mellom de - forskjellige variablene som maa vaere tilfredsstilt; dette er - "dokumentert" i funksjonene enkf_config_node_update_gen_data() og - gen_data_config_update(). - - - - - -OBS_CONFIG: ----------- - -Get: ----- -obs = enkf_main_get_obs( enkf_main ); -enkf_obs_get_config_file( obs ); - - -Set: -enkf_main_load_obs( enkf_main , obs_config_file ); - - - - - -KEEP_RUNPATH / DELETE_RUNPATH ------------------------------ - -Denne variabelen er definert som en streng i tui - jeg foreslaar at du -heller bruker en tilsvarende tilnaerming som naar vi skal velge hvilke -realisasjoner som skal simuleres paa, hver av de smaa boksene skal ha -tre mulige verdier, tilsvarende enum keep_runpath_type i enkf_types.h. - -Deretter: - -enkf_main_iget_keep_runpath( enkf_main , index ); -enkf_main_iset_keep_runpath( enkf_main , index , enum_value ); diff --git a/ThirdParty/Ert/share/gui/help/config/analysis/analysis_module.html b/ThirdParty/Ert/share/gui/help/config/analysis/analysis_module.html deleted file mode 100644 index f0b8207c57..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/analysis/analysis_module.html +++ /dev/null @@ -1 +0,0 @@ -Select which type of ensemble smoother to use for perform updates \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/analysis/iterated_analysis_module.html b/ThirdParty/Ert/share/gui/help/config/analysis/iterated_analysis_module.html deleted file mode 100644 index adea08022e..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/analysis/iterated_analysis_module.html +++ /dev/null @@ -1 +0,0 @@ -Select which type of iterated ensemble smoother to use for perform updates \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/init/history_length.html b/ThirdParty/Ert/share/gui/help/config/init/history_length.html deleted file mode 100644 index df8285cb42..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/init/history_length.html +++ /dev/null @@ -1 +0,0 @@ -The timestep of the source case from which the initial values are copied \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/add_fixed_length_schedule_kw.html b/ThirdParty/Ert/share/gui/help/config/keywords/add_fixed_length_schedule_kw.html deleted file mode 100644 index 7fd6807ce1..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/add_fixed_length_schedule_kw.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/add_static_kw.html b/ThirdParty/Ert/share/gui/help/config/keywords/add_static_kw.html deleted file mode 100644 index c78e0cbbc3..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/add_static_kw.html +++ /dev/null @@ -1,15 +0,0 @@ -The restart files from ECLIPSE are organized by keywords, which are of three different types: -
    -
  1. Keywords containing the dynamic solution, e.g. pressure and saturations.
  2. -
  3. Keywords containing various types of header information which is needed for a restart.
  4. -
  5. Keywords containing various types of diagnostic information which is not needed for a restart.
  6. -
- -Keywords in category 2 and 3 are referred to as static keywords. To be able to restart ECLIPSE, the ERT application has to store the keywords in category 2, whereas keywords in category 3 can safely be dropped. To determine whether a particular keyword is in category 2 or 3 ERT considers an internal list of keywords. The current list contains the keywords: - -
INTEHEAD LOGIHEAD DOUBHEAD IGRP SGRP XGRP ZGRP IWEL SWEL XWEL ZWEL
- ICON SCON XCON HIDDEN STARTSOL PRESSURE SWAT SGAS RS RV ENDSOL ICAQNUM ICAQ IAAQ
- SCAQNUM SCAQ SAAQ ACAQNUM ACAQ XAAQ
- ISEG ILBS ILBR RSEG ISTHW ISTHG
-
-Here you can dynamically add to this list. The magic string __ALL__ will add all static keywords, but use of this option is strongly discouraged, as it wastes a lot of disk space. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/analysis_copy.html b/ThirdParty/Ert/share/gui/help/config/keywords/analysis_copy.html deleted file mode 100644 index bb65f45d44..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/analysis_copy.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/analysis_enkf_update.html b/ThirdParty/Ert/share/gui/help/config/keywords/analysis_enkf_update.html deleted file mode 100644 index ba92057398..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/analysis_enkf_update.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/analysis_load.html b/ThirdParty/Ert/share/gui/help/config/keywords/analysis_load.html deleted file mode 100644 index 0439e95c26..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/analysis_load.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/analysis_select.html b/ThirdParty/Ert/share/gui/help/config/keywords/analysis_select.html deleted file mode 100644 index 5be06c89cb..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/analysis_select.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/analysis_set_var.html b/ThirdParty/Ert/share/gui/help/config/keywords/analysis_set_var.html deleted file mode 100644 index 7513aae255..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/analysis_set_var.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/analysis_update.html b/ThirdParty/Ert/share/gui/help/config/keywords/analysis_update.html deleted file mode 100644 index be8ec82a19..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/analysis_update.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/case_table.html b/ThirdParty/Ert/share/gui/help/config/keywords/case_table.html deleted file mode 100644 index a0597c4844..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/case_table.html +++ /dev/null @@ -1 +0,0 @@ -For running sensitivies you can give the cases descriptive names. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/config_help.py b/ThirdParty/Ert/share/gui/help/config/keywords/config_help.py deleted file mode 100644 index 079efe92f3..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/config_help.py +++ /dev/null @@ -1,12 +0,0 @@ -#!/prog/sdpsoft/python2.6.7/bin/python - - -f= open('keywords.txt', "r") -for line in f: - tokens=line.split() - fname = tokens[0]+".html" - href = "Click here to view help on the wiki page." - file= open(fname, "w") - file.write (href) - file.close() -f.close() \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/create_case.html b/ThirdParty/Ert/share/gui/help/config/keywords/create_case.html deleted file mode 100644 index 7a634a6b3a..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/create_case.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/data_file.html b/ThirdParty/Ert/share/gui/help/config/keywords/data_file.html deleted file mode 100644 index 280a668f08..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/data_file.html +++ /dev/null @@ -1 +0,0 @@ -The ECLIPSE data file used to control the simulations. The standard ECLIPSE data file needs to be modified in some ways in order to work with ERT. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/data_kw.html b/ThirdParty/Ert/share/gui/help/config/keywords/data_kw.html deleted file mode 100644 index 50e7d08a0d..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/data_kw.html +++ /dev/null @@ -1 +0,0 @@ -Using Data keywords you can assign arbitrary (Keyword , Value) pairs where all occurences of <Keyword> in the ECLIPSE Data file will be replaced by Value. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/data_ranking.html b/ThirdParty/Ert/share/gui/help/config/keywords/data_ranking.html deleted file mode 100644 index 9336015252..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/data_ranking.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/define.html b/ThirdParty/Ert/share/gui/help/config/keywords/define.html deleted file mode 100644 index b1f1a19e61..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/define.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/delete_runpath.html b/ThirdParty/Ert/share/gui/help/config/keywords/delete_runpath.html deleted file mode 100644 index 397ba46143..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/delete_runpath.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/eclbase.html b/ThirdParty/Ert/share/gui/help/config/keywords/eclbase.html deleted file mode 100644 index e4ba02e992..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/eclbase.html +++ /dev/null @@ -1,5 +0,0 @@ -The basename used for the ECLIPSE simulations. The name should contain a %d-specifier, which will be replazed by the realization number when running ECLIPSE.
- -Example: BASE_%04d will be replaced by BASE_0007 for realization number 7.
- -Note that due to limitations in ECLIPSE, the basename must be in strictly upper or lower case. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/end_date.html b/ThirdParty/Ert/share/gui/help/config/keywords/end_date.html deleted file mode 100644 index 13ea1a5f5b..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/end_date.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_alpha.html b/ThirdParty/Ert/share/gui/help/config/keywords/enkf_alpha.html deleted file mode 100644 index 5534d25dc1..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_alpha.html +++ /dev/null @@ -1 +0,0 @@ -A parameter controlling outlier behaviour in the EnKF algorithm. The default value is 1.50. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_bootstrap.html b/ThirdParty/Ert/share/gui/help/config/keywords/enkf_bootstrap.html deleted file mode 100644 index 62c4d5e1e0..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_bootstrap.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_cv_folds.html b/ThirdParty/Ert/share/gui/help/config/keywords/enkf_cv_folds.html deleted file mode 100644 index 8d32df09a6..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_cv_folds.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_force_ncomp.html b/ThirdParty/Ert/share/gui/help/config/keywords/enkf_force_ncomp.html deleted file mode 100644 index bff2df9366..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_force_ncomp.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_local_cv.html b/ThirdParty/Ert/share/gui/help/config/keywords/enkf_local_cv.html deleted file mode 100644 index 7ea90f84f9..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_local_cv.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_merge_observations.html b/ThirdParty/Ert/share/gui/help/config/keywords/enkf_merge_observations.html deleted file mode 100644 index 274c5023ea..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_merge_observations.html +++ /dev/null @@ -1 +0,0 @@ -If you use the ENKF schedule file option to jump over several dates at a time you can choose whether you want to use all the observations in between, or just the final. Select Perform merge if you want all observations to be used, unselect to use only the final observation. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_mode.html b/ThirdParty/Ert/share/gui/help/config/keywords/enkf_mode.html deleted file mode 100644 index 3a31f07936..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_mode.html +++ /dev/null @@ -1 +0,0 @@ -Here you select which EnKF algorithm to use. Use ENKF_STANDARD for the original EnKF algorithm, or ENKF_SQRT for the square root scheme. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_ncomp.html b/ThirdParty/Ert/share/gui/help/config/keywords/enkf_ncomp.html deleted file mode 100644 index 438e8b761d..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_ncomp.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_pen_press.html b/ThirdParty/Ert/share/gui/help/config/keywords/enkf_pen_press.html deleted file mode 100644 index 7385cf5292..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_pen_press.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_rerun.html b/ThirdParty/Ert/share/gui/help/config/keywords/enkf_rerun.html deleted file mode 100644 index 3f7b3ec169..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_rerun.html +++ /dev/null @@ -1 +0,0 @@ -Select if the simulation should be started from time zero after each update. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_scaling.html b/ThirdParty/Ert/share/gui/help/config/keywords/enkf_scaling.html deleted file mode 100644 index 26f232374d..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_scaling.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_truncation.html b/ThirdParty/Ert/share/gui/help/config/keywords/enkf_truncation.html deleted file mode 100644 index cc87ad385f..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/enkf_truncation.html +++ /dev/null @@ -1 +0,0 @@ -Cutoff used on singular value spectrum. Default value: 0.99. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/ensemble_run.html b/ThirdParty/Ert/share/gui/help/config/keywords/ensemble_run.html deleted file mode 100644 index d0c173a933..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/ensemble_run.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/enspath.html b/ThirdParty/Ert/share/gui/help/config/keywords/enspath.html deleted file mode 100644 index cc2d44680e..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/enspath.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/export_field.html b/ThirdParty/Ert/share/gui/help/config/keywords/export_field.html deleted file mode 100644 index e1cf6dddec..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/export_field.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/export_field_ecl_grdecl.html b/ThirdParty/Ert/share/gui/help/config/keywords/export_field_ecl_grdecl.html deleted file mode 100644 index 256e994c04..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/export_field_ecl_grdecl.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/export_field_rms_roff.html b/ThirdParty/Ert/share/gui/help/config/keywords/export_field_rms_roff.html deleted file mode 100644 index 69b24e56a4..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/export_field_rms_roff.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/export_ranking.html b/ThirdParty/Ert/share/gui/help/config/keywords/export_ranking.html deleted file mode 100644 index 82e3807b97..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/export_ranking.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/field.html b/ThirdParty/Ert/share/gui/help/config/keywords/field.html deleted file mode 100644 index 7002f52e4e..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/field.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/forward_model.html b/ThirdParty/Ert/share/gui/help/config/keywords/forward_model.html deleted file mode 100644 index ef7799a67b..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/forward_model.html +++ /dev/null @@ -1 +0,0 @@ -The Forward model defines how the simulations are executed. E.g., which version of ECLIPSE to use, which rel.perm script to run, which rock physics model to use etc. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/gen_data.html b/ThirdParty/Ert/share/gui/help/config/keywords/gen_data.html deleted file mode 100644 index 4225d803d4..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/gen_data.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/gen_kw.html b/ThirdParty/Ert/share/gui/help/config/keywords/gen_kw.html deleted file mode 100644 index 92666c8c31..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/gen_kw.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/gen_param.html b/ThirdParty/Ert/share/gui/help/config/keywords/gen_param.html deleted file mode 100644 index d8ac1acef5..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/gen_param.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/grid.html b/ThirdParty/Ert/share/gui/help/config/keywords/grid.html deleted file mode 100644 index 163472e188..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/grid.html +++ /dev/null @@ -1 +0,0 @@ -This should point to an existing GRID/EGRID-file belonging to your ECLIPSE-model. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/history_source.html b/ThirdParty/Ert/share/gui/help/config/keywords/history_source.html deleted file mode 100644 index eddb472db1..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/history_source.html +++ /dev/null @@ -1,9 +0,0 @@ -ERT will read the historic rates from the Schedule file, but it is also possible to use historic data from another ECLIPSE run (e.g if historic data do not exist in the Schedule file). -
-
SCHEDULE -
ERT will use the historic data provided in the Schedule file. -
REFCASE_SIMULATED -
ERT will use simulated values from another ECLIPSE run (a Reference case) as historic data. -
REFCASE_HISTORY -
ERT will use historic data from a reference case. -
diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/image_type.html b/ThirdParty/Ert/share/gui/help/config/keywords/image_type.html deleted file mode 100644 index 012875d225..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/image_type.html +++ /dev/null @@ -1 +0,0 @@ -In which format should the plots created by PLPLOT be saved (default: png). diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/image_viewer.html b/ThirdParty/Ert/share/gui/help/config/keywords/image_viewer.html deleted file mode 100644 index 422c6d7417..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/image_viewer.html +++ /dev/null @@ -1,5 +0,0 @@ -Here you may decide which application to use to view the plots. The default is a program called /usr/bin/display. -
-
-In order to avoid the plots from flashing in your face as they are created, set Image viewer to /d/proj/bg/enkf/bin/noplot.sh -. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/init_case_from_existing.html b/ThirdParty/Ert/share/gui/help/config/keywords/init_case_from_existing.html deleted file mode 100644 index ba679851bf..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/init_case_from_existing.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/init_misfit_table.html b/ThirdParty/Ert/share/gui/help/config/keywords/init_misfit_table.html deleted file mode 100644 index a242e1e5ce..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/init_misfit_table.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/init_section.html b/ThirdParty/Ert/share/gui/help/config/keywords/init_section.html deleted file mode 100644 index cd2dacddcc..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/init_section.html +++ /dev/null @@ -1,6 +0,0 @@ -The Init section is used to handle initialization of the ECLIPSE run. -This can be used in two different ways: -
    -
  • If it is set to the name of an existing file, the contents of this file will be used for the initialization. -
  • If it is set to the name of a non-existing file, it will be assumed that a file with this name in the simulation folder will be generated when simulations are submitted, either by the ERT application itself, or by some job installed by the user. This generated file will then be used by ECLIPSE for initialization. -
diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/install_job.html b/ThirdParty/Ert/share/gui/help/config/keywords/install_job.html deleted file mode 100644 index 8c97722da7..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/install_job.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/job_script.html b/ThirdParty/Ert/share/gui/help/config/keywords/job_script.html deleted file mode 100644 index bb05afd9a4..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/job_script.html +++ /dev/null @@ -1,7 +0,0 @@ -Running the forward model from enkf is a multi-level process which can be summarized as follows: -
    -
  1. A Python module called jobs.py is written and stored in the directory where the forward simulation is run. This module contains a list of job-elements, where each element is a Python representation of the code entered when installing the job.
  2. -
  3. The ERT application submits a Python script to the EnKF queue system, this script then loads the jobs.py module to find out which programs to run, and how to run them.
  4. -
  5. The Job script starts and monitors the individual jobs in the jobs.py module.
  6. -
-Job script should point at the Python script which is managing the forward model. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/jobname.html b/ThirdParty/Ert/share/gui/help/config/keywords/jobname.html deleted file mode 100644 index c1b4e7290e..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/jobname.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/keywords.txt b/ThirdParty/Ert/share/gui/help/config/keywords/keywords.txt deleted file mode 100644 index ed221111e0..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/keywords.txt +++ /dev/null @@ -1,94 +0,0 @@ -data_file http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#DATA_FILE -eclbase http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ECLBASE -jobname http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#JOBNAME -grid http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#GRID -init_section http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#INIT_SECTION -num_realizations http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#NUM_REALIZATIONS -schedule_file http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#SCHEDULE_FILE -data_kw http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#DATA_KW -delete_runpath http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#DELETE_RUNPATH -enkf_sched_file http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ENKF_SCHED_FILE -end_date http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#END_DATE -enspath http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ENSPATH -select_case http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#SELECT_CASE -history_source http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#HISTORY_SOURCE -refcase http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#REFCASE -install_job http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#INSTALL_JOB -keep_runpath http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#KEEP_RUNPATH -obs_config http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#OBS_CONFIG -result_path http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#RESULT_PATH -runpath http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#RUNPATH -runpath_file http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#RUNPATH_FILE -min_realizations http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#MIN_REALIZATIONS -stop_long_running http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#STOP_LONG_RUNNING -max_runtime http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#MAX_RUNTIME -field http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#FIELD -gen_data http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#GEN_DATA -gen_kw http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#GEN_KW -gen_param http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#GEN_PARAM -surface http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#SURFACE -summary http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#SUMMARY -enkf_alpha http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ENKF_ALPHA -enkf_bootstrap http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ENKF_BOOTSTRAP -enkf_cv_folds http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ENKF_CV_FOLDS -enkf_force_ncomp http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ENKF_FORCE_NCOMP -enkf_local_cv http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ENKF_LOCAL_CV -enkf_pen_press http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ENKF_PEN_PRESS -enkf_mode http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ENKF_MODE -enkf_merge_observations http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ENKF_MERGE_OBSERVATIONS -enkf_ncomp http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ENKF_NCOMP -enkf_rerun http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ENKF_RERUN -enkf_scaling http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ENKF_SCALING -enkf_truncation http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ENKF_TRUNCATION -update_log_path http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#UPDATE_LOG_PATH -analysis_load http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ANALYSIS_LOAD -analysis_select http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ANALYSIS_SELECT -analysis_set_var http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ANALYSIS_SET_VAR -analysis_copy http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ANALYSIS_COPY -add_fixed_length_schedule_kw http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ADD_FIXED_LENGTH_SCHEDULE_KW -add_static_kw http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ADD_STATIC_KW -define http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#DEFINE -schedule_prediction_file http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#SCHEDULE_PREDICTION_FILE -forward_model http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#FORWARD_MODEL -job_script http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#JOB_SCRIPT -queue_system http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#QUEUE_SYSTEM -lsf_server http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#LSF_SERVER -lsf_queue http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#LSF_QUEUE -max_running_lsf http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#MAX_RUNNING_LSF -max_running_local http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#MAX_RUNNING_LOCAL -rsh_host http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#RSH_HOST -rsh_command http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#RSH_COMMAND -max_running_rsh http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#MAX_RUNNING_RSH -image_viewer http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#IMAGE_VIEWER -image_type http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#IMAGE_TYPE -plot_driver http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#PLOT_DRIVER -plot_errorbar http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#PLOT_ERRORBAR -plot_errorbar_max http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#PLOT_ERRORBAR_MAX -plot_height http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#PLOT_HEIGHT -plot_refcase http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#PLOT_REFCASE -refcase_list http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#REFCASE_LIST -plot_path http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#PLOT_PATH -plot_width http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#PLOT_WIDTH -rft_config http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#RFT_CONFIG -rftpath http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#RFTPATH -select_case http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#SELECT_CASE -create_case http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#CREATE_CASE -init_case_from_existing http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#INIT_CASE_FROM_EXISTING -export_field http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#EXPORT_FIELD -export_field_rms_roff http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#EXPORT_FIELD_RMS_ROFF -export_field_ecl_grdecl http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#EXPORT_FIELD_ECL_GRDECL -analysis_update http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ANALYSIS_UPDATE -analysis_enkf_update http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ANALYSIS_ENKF_UPDATE -run_smoother http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#RUN_SMOOTHER -run_smoother_with_iter http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#RUN_SMOOTHER_WITH_ITER -ensemble_run http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#ENSEMBLE_RUN -load_results http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#LOAD_RESULTS -load_results_iter http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#LOAD_RESULTS_ITER -observation_ranking http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#OBSERVATION_RANKING -data_ranking http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#DATA_RANKING -export_ranking http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#EXPORT_RANKING -init_misfit_table http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#INIT_MISFIT_TABLE -qc_workflow http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#QC_WORKFLOW -qc_path http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#QC_PATH -setenv http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#SETENV -update_path http://ert.nr.no/ert/index.php/Creating_a_configuration_file_for_ERT#UPDATE_PATH \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/license_path.html b/ThirdParty/Ert/share/gui/help/config/keywords/license_path.html deleted file mode 100644 index cd8d4a08f3..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/license_path.html +++ /dev/null @@ -1 +0,0 @@ -The path where the ERT-licenses for the different programs (such as RMS) are stored. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/load_results.html b/ThirdParty/Ert/share/gui/help/config/keywords/load_results.html deleted file mode 100644 index 2def17d6d9..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/load_results.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/load_results_iter.html b/ThirdParty/Ert/share/gui/help/config/keywords/load_results_iter.html deleted file mode 100644 index 11a79d6e59..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/load_results_iter.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/local_config.html b/ThirdParty/Ert/share/gui/help/config/keywords/local_config.html deleted file mode 100644 index cfa726e6db..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/local_config.html +++ /dev/null @@ -1 +0,0 @@ -This can point to a file with configuration information for local analysis. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/log_file.html b/ThirdParty/Ert/share/gui/help/config/keywords/log_file.html deleted file mode 100644 index 2e2eb3503b..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/log_file.html +++ /dev/null @@ -1 +0,0 @@ -The name of the log file. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/log_level.html b/ThirdParty/Ert/share/gui/help/config/keywords/log_level.html deleted file mode 100644 index dd3c264cbc..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/log_level.html +++ /dev/null @@ -1 +0,0 @@ -The amount of logging. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/lsf_queue.html b/ThirdParty/Ert/share/gui/help/config/keywords/lsf_queue.html deleted file mode 100644 index 7007bb48e0..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/lsf_queue.html +++ /dev/null @@ -1,2 +0,0 @@ -Select which LSF queue to use. - diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/lsf_resources.html b/ThirdParty/Ert/share/gui/help/config/keywords/lsf_resources.html deleted file mode 100644 index 266ae8a750..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/lsf_resources.html +++ /dev/null @@ -1 +0,0 @@ -Specify special LSF requirements here. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/lsf_server.html b/ThirdParty/Ert/share/gui/help/config/keywords/lsf_server.html deleted file mode 100644 index fd9aac3cc2..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/lsf_server.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/max_resample.html b/ThirdParty/Ert/share/gui/help/config/keywords/max_resample.html deleted file mode 100644 index 0e22f3505e..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/max_resample.html +++ /dev/null @@ -1 +0,0 @@ -How many times ERT should resample & retry a simulation. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/max_running_local.html b/ThirdParty/Ert/share/gui/help/config/keywords/max_running_local.html deleted file mode 100644 index 2fe1a41c97..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/max_running_local.html +++ /dev/null @@ -1 +0,0 @@ -Controls the maximum number of simultaneous jobs running when using the LOCAL option. It is strongly recommended to not let this number exceed the number of processors on the workstation used. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/max_running_lsf.html b/ThirdParty/Ert/share/gui/help/config/keywords/max_running_lsf.html deleted file mode 100644 index 607149cd96..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/max_running_lsf.html +++ /dev/null @@ -1 +0,0 @@ -Controls the maximum number of simultaneous jobs submitted to the LSF queue when using the LSF option. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/max_running_rsh.html b/ThirdParty/Ert/share/gui/help/config/keywords/max_running_rsh.html deleted file mode 100644 index a7d64dcd5c..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/max_running_rsh.html +++ /dev/null @@ -1 +0,0 @@ -Controls the maximum number of simultaneous jobs running when using the RSH option. If this number exceeds the total capacity defined in the RSH Host List, it will automatically be truncated to that capacity. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/max_runtime.html b/ThirdParty/Ert/share/gui/help/config/keywords/max_runtime.html deleted file mode 100644 index 3e1de4739b..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/max_runtime.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/max_submit.html b/ThirdParty/Ert/share/gui/help/config/keywords/max_submit.html deleted file mode 100644 index 3fcc40c76c..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/max_submit.html +++ /dev/null @@ -1 +0,0 @@ -How many times the queue system should retry a simulation. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/min_realizations.html b/ThirdParty/Ert/share/gui/help/config/keywords/min_realizations.html deleted file mode 100644 index 4f54035717..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/min_realizations.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/num_realizations.html b/ThirdParty/Ert/share/gui/help/config/keywords/num_realizations.html deleted file mode 100644 index 2b94172324..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/num_realizations.html +++ /dev/null @@ -1 +0,0 @@ -The number of members/realizations in your ensemble, i.e the ensemble size. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/obs_config.html b/ThirdParty/Ert/share/gui/help/config/keywords/obs_config.html deleted file mode 100644 index 267ab3e64b..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/obs_config.html +++ /dev/null @@ -1 +0,0 @@ -This should point to an observation file, a file defining observations and associated uncertainties. It is optional, but strongly recommended to provide an observation file. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/observation_ranking.html b/ThirdParty/Ert/share/gui/help/config/keywords/observation_ranking.html deleted file mode 100644 index be2ff2fe01..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/observation_ranking.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/plot_driver.html b/ThirdParty/Ert/share/gui/help/config/keywords/plot_driver.html deleted file mode 100644 index 249a95f9e0..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/plot_driver.html +++ /dev/null @@ -1,7 +0,0 @@ -The Plot Driver is the sub system used for creating plots. -
-
PLPLOT: -
This is the default system. All the other options regarding plotting are sub options which are only relevant when you are using this. -
TEXT: -
This will not produce any plots, just textfiles which can be used for plotting with your favorite plotting program. This is particularly relevant if you have some special requirements to the plots. -
diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/plot_errorbar.html b/ThirdParty/Ert/share/gui/help/config/keywords/plot_errorbar.html deleted file mode 100644 index 0568bb659d..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/plot_errorbar.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/plot_errorbar_max.html b/ThirdParty/Ert/share/gui/help/config/keywords/plot_errorbar_max.html deleted file mode 100644 index 011fec7881..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/plot_errorbar_max.html +++ /dev/null @@ -1,5 +0,0 @@ -When plotting summary vectors for which observations have been 'installed' with the Observation config, ERT will plot the observed values. If the number of observations is less than Errorbar max, ERT will use errorbars to show the observed values, otherwise it will use two dashed lines indicating +/- one standard deviation. -
-To ensure that you always get errorbars you can set Errorbar max to a very large value. On the other hand, setting Errorbar max to zero will ensure that ERT always plots observation uncertainty using dashed lines of +/- one standard deviation. -
-The setting here will also affect the output when you are using the TEXT driver to plot. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/plot_height.html b/ThirdParty/Ert/share/gui/help/config/keywords/plot_height.html deleted file mode 100644 index e33e7dfe74..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/plot_height.html +++ /dev/null @@ -1,2 +0,0 @@ -When the PLPLOT driver creates a plot file, it will have the height (in pixels) given by the PLOT_HEIGHT keyword. -The default value for PLOT_HEIGHT is 1024 pixels. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/plot_path.html b/ThirdParty/Ert/share/gui/help/config/keywords/plot_path.html deleted file mode 100644 index f40b2a22c5..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/plot_path.html +++ /dev/null @@ -1,3 +0,0 @@ -The plotting engine creates files with plots, they are stored in a directory. -You can tell what that directory should be. -Observe that the current casename automatically will be appended to the plot path. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/plot_refcase.html b/ThirdParty/Ert/share/gui/help/config/keywords/plot_refcase.html deleted file mode 100644 index a7d3d67fb9..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/plot_refcase.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/plot_width.html b/ThirdParty/Ert/share/gui/help/config/keywords/plot_width.html deleted file mode 100644 index 281295d50b..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/plot_width.html +++ /dev/null @@ -1,2 +0,0 @@ -When the PLPLOT driver creates a plot file, it will have the width (in pixels) given by the PLOT_WIDTH keyword. -The default value for PLOT_WIDTH is 1024 pixels. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/pre_clear_runpath.html b/ThirdParty/Ert/share/gui/help/config/keywords/pre_clear_runpath.html deleted file mode 100644 index a67c334861..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/pre_clear_runpath.html +++ /dev/null @@ -1 +0,0 @@ -Select Perform pre clear if you would like the runpath to be cleared before initilaizing. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/qc_path.html b/ThirdParty/Ert/share/gui/help/config/keywords/qc_path.html deleted file mode 100644 index 26029f50f1..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/qc_path.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/qc_workflow.html b/ThirdParty/Ert/share/gui/help/config/keywords/qc_workflow.html deleted file mode 100644 index 61ebf75d26..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/qc_workflow.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/queue_system.html b/ThirdParty/Ert/share/gui/help/config/keywords/queue_system.html deleted file mode 100644 index d23625073f..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/queue_system.html +++ /dev/null @@ -1,8 +0,0 @@ -Controls where the simulation jobs are executed. -
-
LSF: Submits the jobs to the LSF cluster at your location. -
RSH: Submits the jobs to a defined set of workstations. -
LOCAL: Submits the jobs to your local workstation. -
-
-More information in the wiki. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/refcase.html b/ThirdParty/Ert/share/gui/help/config/keywords/refcase.html deleted file mode 100644 index 519d42c654..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/refcase.html +++ /dev/null @@ -1 +0,0 @@ -Here you may supply ERT with a reference case, i.e an existing ECLIPSE data file, which can be used as observations. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/refcase_list.html b/ThirdParty/Ert/share/gui/help/config/keywords/refcase_list.html deleted file mode 100644 index 9fa95da112..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/refcase_list.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/rerun_start.html b/ThirdParty/Ert/share/gui/help/config/keywords/rerun_start.html deleted file mode 100644 index db11b245c1..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/rerun_start.html +++ /dev/null @@ -1 +0,0 @@ -If using EnKF rerun, select here which time step to start from after each update. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/result_path.html b/ThirdParty/Ert/share/gui/help/config/keywords/result_path.html deleted file mode 100644 index 5ca7fa5241..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/result_path.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/rft_config.html b/ThirdParty/Ert/share/gui/help/config/keywords/rft_config.html deleted file mode 100644 index fa68edbb47..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/rft_config.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/rftpath.html b/ThirdParty/Ert/share/gui/help/config/keywords/rftpath.html deleted file mode 100644 index ca1df0aa92..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/rftpath.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/rsh_command.html b/ThirdParty/Ert/share/gui/help/config/keywords/rsh_command.html deleted file mode 100644 index e0e268f88c..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/rsh_command.html +++ /dev/null @@ -1 +0,0 @@ -The name of the executable used to invoke remote shell operations. Will typically be either rsh or ssh. The command given to RSH Command must either be in PATH or an absolute path. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/rsh_host.html b/ThirdParty/Ert/share/gui/help/config/keywords/rsh_host.html deleted file mode 100644 index c8413d6180..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/rsh_host.html +++ /dev/null @@ -1,6 +0,0 @@ -To use the RSH queue system you must first set a list of computers which ERT can use for running jobs. The first column takes the computer names, the second takes the number of jobs for each computer.
- -When using the RSH option, note the following:
    -
  1. You must have passwordless login to the computers listed in the Host List.
  2. -
  3. ERT will not consider the total load on the various computers; if having said a computer can take two jobs, it will get two jobs, irrespective of the existing load.
  4. -
diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/run_smoother.html b/ThirdParty/Ert/share/gui/help/config/keywords/run_smoother.html deleted file mode 100644 index 5d61059e82..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/run_smoother.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/run_smoother_with_iter.html b/ThirdParty/Ert/share/gui/help/config/keywords/run_smoother_with_iter.html deleted file mode 100644 index f71187c49e..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/run_smoother_with_iter.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/run_template.html b/ThirdParty/Ert/share/gui/help/config/keywords/run_template.html deleted file mode 100644 index 113f283454..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/run_template.html +++ /dev/null @@ -1 +0,0 @@ -You may use this option to install arbitrary files in the runpath directory. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/runpath.html b/ThirdParty/Ert/share/gui/help/config/keywords/runpath.html deleted file mode 100644 index 7f30da7d36..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/runpath.html +++ /dev/null @@ -1,12 +0,0 @@ -The Runpath should give the name of the folders where the -ECLIPSE simulations are to be executed. It should contain at least one -%d-specifier, which will be replaced by the realization number when -ERT creates the folders.

- -Optionally, the Runpath can contain two more %d specifers, which will -be replaced by the first and last report step of the simulation. By -default, Runpath is set to "simulations/realization%d".

- -When running with LSF it is essential that the Runpath points -to a network disk which is accessible with the same path from all the -nodes in the cluster. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/runpath_file.html b/ThirdParty/Ert/share/gui/help/config/keywords/runpath_file.html deleted file mode 100644 index e5839c9695..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/runpath_file.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/schedule_file.html b/ThirdParty/Ert/share/gui/help/config/keywords/schedule_file.html deleted file mode 100644 index 2ea01382cd..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/schedule_file.html +++ /dev/null @@ -1 +0,0 @@ -A text file containing the SCHEDULE section of the ECLIPSE data file. The Schedule file is used to control the ECLIPSE simulations. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/schedule_prediction_file.html b/ThirdParty/Ert/share/gui/help/config/keywords/schedule_prediction_file.html deleted file mode 100644 index 9d9ee7bb4b..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/schedule_prediction_file.html +++ /dev/null @@ -1 +0,0 @@ -This is the name of a schedule prediction file. It may contain a %d-specifier to get different files for different members. Observe that the ECLIPSE datafile should include only one schedule file, even if you are doing predictions. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/select_case.html b/ThirdParty/Ert/share/gui/help/config/keywords/select_case.html deleted file mode 100644 index 68f628f3c3..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/select_case.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/setenv.html b/ThirdParty/Ert/share/gui/help/config/keywords/setenv.html deleted file mode 100644 index b22ce6a2d0..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/setenv.html +++ /dev/null @@ -1,4 +0,0 @@ -You can use setenv to alter the unix environment ERT is running -in. This is probably most relevant for setting up the environment for -the external jobs invoked by ERT. It is possible to use $VAR to refer -to an existing environment variable. diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/stop_long_running.html b/ThirdParty/Ert/share/gui/help/config/keywords/stop_long_running.html deleted file mode 100644 index 0abd696273..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/stop_long_running.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/summary.html b/ThirdParty/Ert/share/gui/help/config/keywords/summary.html deleted file mode 100644 index 8083f8729b..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/summary.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/surface.html b/ThirdParty/Ert/share/gui/help/config/keywords/surface.html deleted file mode 100644 index c26f69080a..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/surface.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/update_log_path.html b/ThirdParty/Ert/share/gui/help/config/keywords/update_log_path.html deleted file mode 100644 index c321b261c8..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/update_log_path.html +++ /dev/null @@ -1 +0,0 @@ -Click here to view help on the wiki page. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/keywords/update_path.html b/ThirdParty/Ert/share/gui/help/config/keywords/update_path.html deleted file mode 100644 index 99db43fb90..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/keywords/update_path.html +++ /dev/null @@ -1 +0,0 @@ -The Update path option will prepend a new element to an existing PATH variable. diff --git a/ThirdParty/Ert/share/gui/help/config/run/runpath.html b/ThirdParty/Ert/share/gui/help/config/run/runpath.html deleted file mode 100644 index 36685bc466..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/run/runpath.html +++ /dev/null @@ -1,3 +0,0 @@ -basic runpath info - -Click here diff --git a/ThirdParty/Ert/share/gui/help/config/simulation/active_realizations.html b/ThirdParty/Ert/share/gui/help/config/simulation/active_realizations.html deleted file mode 100644 index adff4f4ce7..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/simulation/active_realizations.html +++ /dev/null @@ -1 +0,0 @@ -These are the realizations that will be used to perform simulations. For example, if "Number of realizations:50 and Active realizations is 0-9", then only realizations 0,1,2,3,...,9 will be used to perform simulations while realizations 10,11, 12,...,49 will be excluded. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/simulation/analysis_module.html b/ThirdParty/Ert/share/gui/help/config/simulation/analysis_module.html deleted file mode 100644 index a0597c4844..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/simulation/analysis_module.html +++ /dev/null @@ -1 +0,0 @@ -For running sensitivies you can give the cases descriptive names. diff --git a/ThirdParty/Ert/share/gui/help/config/simulation/iterated_target_case_format.html b/ThirdParty/Ert/share/gui/help/config/simulation/iterated_target_case_format.html deleted file mode 100644 index de622b8418..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/simulation/iterated_target_case_format.html +++ /dev/null @@ -1 +0,0 @@ -The "Iterated Ensemble Smoother" creates multiple cases for the different iterations. The case names will follow the specified format. For example, "Target case format: iter_%d" will generate cases with the names iter_0, iter_1, iter_2, iter_3, .... \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/simulation/iteration_weights.html b/ThirdParty/Ert/share/gui/help/config/simulation/iteration_weights.html deleted file mode 100644 index 7e6a9edf4f..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/simulation/iteration_weights.html +++ /dev/null @@ -1,7 +0,0 @@ -

- The normalized weights are the actual α values used in the scaling of the standard deviation. -

-

- Example Custom Relative Weights: '8,4,2,1'. This means Multiple Data Assimilation Ensemble Smoother will half the - weight applied to the Observation Errors from one iteration to the next across 4 iterations. -

diff --git a/ThirdParty/Ert/share/gui/help/config/simulation/number_of_iterations.html b/ThirdParty/Ert/share/gui/help/config/simulation/number_of_iterations.html deleted file mode 100644 index 5d649052ff..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/simulation/number_of_iterations.html +++ /dev/null @@ -1 +0,0 @@ -Specify the number of times to perform updates/iterations. In general, the more updates the better, however, this could be time consuming. The default value is 4. \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/config/simulation/sensitivity_parameter_constant_value.html b/ThirdParty/Ert/share/gui/help/config/simulation/sensitivity_parameter_constant_value.html deleted file mode 100644 index 792bce12bb..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/simulation/sensitivity_parameter_constant_value.html +++ /dev/null @@ -1 +0,0 @@ -Constant value used when the parameter is kept constant in the sensitivity study. diff --git a/ThirdParty/Ert/share/gui/help/config/simulation/sensitivity_parameter_is_included.html b/ThirdParty/Ert/share/gui/help/config/simulation/sensitivity_parameter_is_included.html deleted file mode 100644 index 549294c6e8..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/simulation/sensitivity_parameter_is_included.html +++ /dev/null @@ -1 +0,0 @@ -Check this box if you want the parameter to be included in the sensitivity study. diff --git a/ThirdParty/Ert/share/gui/help/config/simulation/sensitivity_target_case_format.html b/ThirdParty/Ert/share/gui/help/config/simulation/sensitivity_target_case_format.html deleted file mode 100644 index b602cba8dd..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/simulation/sensitivity_target_case_format.html +++ /dev/null @@ -1 +0,0 @@ -The "Sensitivity Study" creates a case for each parameter that is tested. The case names will follow the specified format. For example, "Target case format: iter_%s" and parameter name trans_mult will generate cases with the names iter_trans_mult. diff --git a/ThirdParty/Ert/share/gui/help/config/simulation/target_case.html b/ThirdParty/Ert/share/gui/help/config/simulation/target_case.html deleted file mode 100644 index b3f6cb2063..0000000000 --- a/ThirdParty/Ert/share/gui/help/config/simulation/target_case.html +++ /dev/null @@ -1 +0,0 @@ -This is the name of the case where the results for the updated parameters will be stored \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/init/case_list.html b/ThirdParty/Ert/share/gui/help/init/case_list.html deleted file mode 100644 index 21d1bbc77b..0000000000 --- a/ThirdParty/Ert/share/gui/help/init/case_list.html +++ /dev/null @@ -1 +0,0 @@ -List of available cases. diff --git a/ThirdParty/Ert/share/gui/help/init/current_case_selection.html b/ThirdParty/Ert/share/gui/help/init/current_case_selection.html deleted file mode 100644 index fbcc72af96..0000000000 --- a/ThirdParty/Ert/share/gui/help/init/current_case_selection.html +++ /dev/null @@ -1 +0,0 @@ -The case to initialize and use for simulation. diff --git a/ThirdParty/Ert/share/gui/help/init/initialize_from_existing.html b/ThirdParty/Ert/share/gui/help/init/initialize_from_existing.html deleted file mode 100644 index c05dccad1b..0000000000 --- a/ThirdParty/Ert/share/gui/help/init/initialize_from_existing.html +++ /dev/null @@ -1 +0,0 @@ -Click on this button to perform the initialization process \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/init/initialize_from_scratch.html b/ThirdParty/Ert/share/gui/help/init/initialize_from_scratch.html deleted file mode 100644 index c05dccad1b..0000000000 --- a/ThirdParty/Ert/share/gui/help/init/initialize_from_scratch.html +++ /dev/null @@ -1 +0,0 @@ -Click on this button to perform the initialization process \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/init/select_case_for_info.html b/ThirdParty/Ert/share/gui/help/init/select_case_for_info.html deleted file mode 100644 index f27d05c573..0000000000 --- a/ThirdParty/Ert/share/gui/help/init/select_case_for_info.html +++ /dev/null @@ -1 +0,0 @@ -The case you want to view information on \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/init/select_members.html b/ThirdParty/Ert/share/gui/help/init/select_members.html deleted file mode 100644 index 616ac700be..0000000000 --- a/ThirdParty/Ert/share/gui/help/init/select_members.html +++ /dev/null @@ -1 +0,0 @@ -Select which members of realizations to initialize \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/init/select_parameters.html b/ThirdParty/Ert/share/gui/help/init/select_parameters.html deleted file mode 100644 index ddb2f22741..0000000000 --- a/ThirdParty/Ert/share/gui/help/init/select_parameters.html +++ /dev/null @@ -1 +0,0 @@ -Select which parameters you want to initialize \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/init/selected_case_info.html b/ThirdParty/Ert/share/gui/help/init/selected_case_info.html deleted file mode 100644 index ba7763102b..0000000000 --- a/ThirdParty/Ert/share/gui/help/init/selected_case_info.html +++ /dev/null @@ -1 +0,0 @@ -Information for the selected case \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/init/source_case.html b/ThirdParty/Ert/share/gui/help/init/source_case.html deleted file mode 100644 index 5eec505e79..0000000000 --- a/ThirdParty/Ert/share/gui/help/init/source_case.html +++ /dev/null @@ -1 +0,0 @@ -The case from which the initial values are copied \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/run/simulation_mode.html b/ThirdParty/Ert/share/gui/help/run/simulation_mode.html deleted file mode 100644 index 3be738a9b6..0000000000 --- a/ThirdParty/Ert/share/gui/help/run/simulation_mode.html +++ /dev/null @@ -1,4 +0,0 @@ -Here you can select which type of simulation to run.
-1. Ensemble Experiment: this will run simulations without performing any updates on the parameters.
-2. Ensemble Smoother: this will run simulations while performing one update on the parameters by using the ensemble smoother algorithm.
-3. Iterated Ensemble Smoother: this will run simulations while performing multiple updates on the parameters by using the iterated ensemble smoother algorithm. diff --git a/ThirdParty/Ert/share/gui/help/run/start_simulation.html b/ThirdParty/Ert/share/gui/help/run/start_simulation.html deleted file mode 100644 index cd0892535e..0000000000 --- a/ThirdParty/Ert/share/gui/help/run/start_simulation.html +++ /dev/null @@ -1 +0,0 @@ -Click on this button to start running simulations diff --git a/ThirdParty/Ert/share/gui/help/run/workflow.html b/ThirdParty/Ert/share/gui/help/run/workflow.html deleted file mode 100644 index 986b0130b1..0000000000 --- a/ThirdParty/Ert/share/gui/help/run/workflow.html +++ /dev/null @@ -1 +0,0 @@ -Select the workflow to run diff --git a/ThirdParty/Ert/share/gui/help/template.html b/ThirdParty/Ert/share/gui/help/template.html deleted file mode 100644 index d11776e51a..0000000000 --- a/ThirdParty/Ert/share/gui/help/template.html +++ /dev/null @@ -1 +0,0 @@ -%s \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/help/tools/export.html b/ThirdParty/Ert/share/gui/help/tools/export.html deleted file mode 100644 index 5a3f2061d7..0000000000 --- a/ThirdParty/Ert/share/gui/help/tools/export.html +++ /dev/null @@ -1 +0,0 @@ -This will open the "Export Data to Other Formats" dialog window where you can export data stored in ERT to formats usable by other applications diff --git a/ThirdParty/Ert/share/gui/help/tools/help.html b/ThirdParty/Ert/share/gui/help/tools/help.html deleted file mode 100644 index ecbb174173..0000000000 --- a/ThirdParty/Ert/share/gui/help/tools/help.html +++ /dev/null @@ -1 +0,0 @@ -This will open the "Help" window where help information are displayed for various functionality diff --git a/ThirdParty/Ert/share/gui/help/tools/ide.html b/ThirdParty/Ert/share/gui/help/tools/ide.html deleted file mode 100644 index c04f7eca8b..0000000000 --- a/ThirdParty/Ert/share/gui/help/tools/ide.html +++ /dev/null @@ -1 +0,0 @@ -This will open the "Configuration" dialog window where you can set the values for various keywords and parameters in ERT diff --git a/ThirdParty/Ert/share/gui/help/tools/manage_cases.html b/ThirdParty/Ert/share/gui/help/tools/manage_cases.html deleted file mode 100644 index 6420f762a1..0000000000 --- a/ThirdParty/Ert/share/gui/help/tools/manage_cases.html +++ /dev/null @@ -1 +0,0 @@ -This will open the "Manage Cases" dialog window where you can create, delete, and initialize cases diff --git a/ThirdParty/Ert/share/gui/help/tools/plot.html b/ThirdParty/Ert/share/gui/help/tools/plot.html deleted file mode 100644 index 5110a84c4d..0000000000 --- a/ThirdParty/Ert/share/gui/help/tools/plot.html +++ /dev/null @@ -1 +0,0 @@ -This will open the "Plotting" page where you can view the plot profiles for various data types diff --git a/ThirdParty/Ert/share/gui/help/tools/workflows.html b/ThirdParty/Ert/share/gui/help/tools/workflows.html deleted file mode 100644 index dcf597397b..0000000000 --- a/ThirdParty/Ert/share/gui/help/tools/workflows.html +++ /dev/null @@ -1 +0,0 @@ -This will open the "Workflow" dialog window where you can select and run workflows which you have configured in ERT diff --git a/ThirdParty/Ert/share/gui/help/welcome_to_ert.html b/ThirdParty/Ert/share/gui/help/welcome_to_ert.html deleted file mode 100644 index 8d6993316d..0000000000 --- a/ThirdParty/Ert/share/gui/help/welcome_to_ert.html +++ /dev/null @@ -1,17 +0,0 @@ -
- _________________________________
-/                                 \
-|    ______   ______   _______    |
-|   |  ____| |  __  \ |__   __|   |
-|   | |__    | |__) |    | |      |
-|   |  __|   |  _  /     | |      |
-|   | |____  | | \ \     | |      |
-|   |______| |_|  \_\    |_|      |
-|                                 |
-|  Ensemble based Reservoir Tool  |
-\_________________________________/
-
-
-

-Welcome to ERT -

diff --git a/ThirdParty/Ert/share/gui/img/add.png b/ThirdParty/Ert/share/gui/img/add.png deleted file mode 100644 index 4aadc248db..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/add.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/application/window_icon.png b/ThirdParty/Ert/share/gui/img/application/window_icon.png deleted file mode 100644 index 94e19b30d5..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/application/window_icon.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/application/window_icon_cutout.png b/ThirdParty/Ert/share/gui/img/application/window_icon_cutout.png deleted file mode 100644 index e902e02c61..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/application/window_icon_cutout.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/calendar.png b/ThirdParty/Ert/share/gui/img/calendar.png deleted file mode 100644 index f404e21eb8..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/calendar.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/checked.png b/ThirdParty/Ert/share/gui/img/checked.png deleted file mode 100644 index 8ca5395d72..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/checked.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/copy_from.png b/ThirdParty/Ert/share/gui/img/copy_from.png deleted file mode 100644 index df05318c94..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/copy_from.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/copy_to.png b/ThirdParty/Ert/share/gui/img/copy_to.png deleted file mode 100644 index 4af7902c39..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/copy_to.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/ide/chart_curve_add.png b/ThirdParty/Ert/share/gui/img/ide/chart_curve_add.png deleted file mode 100644 index 45b61c5656..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/ide/chart_curve_add.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/ide/cog.png b/ThirdParty/Ert/share/gui/img/ide/cog.png deleted file mode 100644 index d53ebf1c3d..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/ide/cog.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/ide/cog_edit.png b/ThirdParty/Ert/share/gui/img/ide/cog_edit.png deleted file mode 100644 index 7b7cb83683..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/ide/cog_edit.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/ide/control_play_blue.png b/ThirdParty/Ert/share/gui/img/ide/control_play_blue.png deleted file mode 100644 index a1f7345f37..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/ide/control_play_blue.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/ide/database_gear.png b/ThirdParty/Ert/share/gui/img/ide/database_gear.png deleted file mode 100644 index 373a0adb0c..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/ide/database_gear.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/ide/disk.png b/ThirdParty/Ert/share/gui/img/ide/disk.png deleted file mode 100644 index 3a9dcf37ec..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/ide/disk.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/ide/gear_in_play.png b/ThirdParty/Ert/share/gui/img/ide/gear_in_play.png deleted file mode 100644 index 6f73cbb4d9..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/ide/gear_in_play.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/ide/help.png b/ThirdParty/Ert/share/gui/img/ide/help.png deleted file mode 100644 index 68f51bac41..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/ide/help.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/ide/loading.gif b/ThirdParty/Ert/share/gui/img/ide/loading.gif deleted file mode 100644 index 90f28cbdbb..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/ide/loading.gif and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/ide/plugin.png b/ThirdParty/Ert/share/gui/img/ide/plugin.png deleted file mode 100644 index c1ee68def0..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/ide/plugin.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/ide/readme-fatcow.txt b/ThirdParty/Ert/share/gui/img/ide/readme-fatcow.txt deleted file mode 100644 index 1f3e716286..0000000000 --- a/ThirdParty/Ert/share/gui/img/ide/readme-fatcow.txt +++ /dev/null @@ -1,21 +0,0 @@ -FatCow Farm Fresh Icons - -03/29/2013, v3.5.0, 9.12 Mb - -© Copyright 2013 FatCow Web Hosting. All rights reserved. - -These icons are licensed under a Creative Commons -Attribution 3.0 License. -http://creativecommons.org/licenses/by/3.0/us/ - -We are unavailable for custom icon design work. But we -plan to draw 500 more metaphors and suggestions are welcome. -https://twitter.com/FatCow http://www.facebook.com/FatCow -or Google+ https://plus.google.com/101826539018374982925 - ------------------------------------------------------------- - -All other trademarks and copyrights -are property of their respective owners. - ------------------------------------------------------------- \ No newline at end of file diff --git a/ThirdParty/Ert/share/gui/img/ide/save_as.png b/ThirdParty/Ert/share/gui/img/ide/save_as.png deleted file mode 100644 index 915e280c54..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/ide/save_as.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/ide/small/add.png b/ThirdParty/Ert/share/gui/img/ide/small/add.png deleted file mode 100644 index 0ea124a744..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/ide/small/add.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/ide/small/chart_curve_go.png b/ThirdParty/Ert/share/gui/img/ide/small/chart_curve_go.png deleted file mode 100644 index aa7dc60db9..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/ide/small/chart_curve_go.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/ide/small/cog_edit.png b/ThirdParty/Ert/share/gui/img/ide/small/cog_edit.png deleted file mode 100644 index dc0a35ee5e..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/ide/small/cog_edit.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/ide/small/delete.png b/ThirdParty/Ert/share/gui/img/ide/small/delete.png deleted file mode 100644 index ace289edd9..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/ide/small/delete.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/ide/small/folder.png b/ThirdParty/Ert/share/gui/img/ide/small/folder.png deleted file mode 100644 index f1ed9abe03..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/ide/small/folder.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/ide/table_export.png b/ThirdParty/Ert/share/gui/img/ide/table_export.png deleted file mode 100644 index a96837ed1e..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/ide/table_export.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/ide/table_import.png b/ThirdParty/Ert/share/gui/img/ide/table_import.png deleted file mode 100644 index 5c25faddac..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/ide/table_import.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/ide/to_do_list_checked_1.png b/ThirdParty/Ert/share/gui/img/ide/to_do_list_checked_1.png deleted file mode 100644 index e0d6504752..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/ide/to_do_list_checked_1.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/ide/transform_scale.png b/ThirdParty/Ert/share/gui/img/ide/transform_scale.png deleted file mode 100644 index a5956ba7a3..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/ide/transform_scale.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/ide/widgets.png b/ThirdParty/Ert/share/gui/img/ide/widgets.png deleted file mode 100644 index 73e67cf938..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/ide/widgets.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/notchecked.png b/ThirdParty/Ert/share/gui/img/notchecked.png deleted file mode 100644 index 11765214ba..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/notchecked.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/page_copy.png b/ThirdParty/Ert/share/gui/img/page_copy.png deleted file mode 100644 index a61ec13432..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/page_copy.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/redo.png b/ThirdParty/Ert/share/gui/img/redo.png deleted file mode 100644 index bb7673c827..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/redo.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/remove.png b/ThirdParty/Ert/share/gui/img/remove.png deleted file mode 100644 index 5be9040ec9..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/remove.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/remove_favorite.png b/ThirdParty/Ert/share/gui/img/remove_favorite.png deleted file mode 100644 index e716db68ca..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/remove_favorite.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/splash.jpg b/ThirdParty/Ert/share/gui/img/splash.jpg deleted file mode 100644 index 0ea9457f3f..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/splash.jpg and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/undo.png b/ThirdParty/Ert/share/gui/img/undo.png deleted file mode 100644 index 0c196ec096..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/undo.png and /dev/null differ diff --git a/ThirdParty/Ert/share/gui/img/update.png b/ThirdParty/Ert/share/gui/img/update.png deleted file mode 100644 index b7639f1558..0000000000 Binary files a/ThirdParty/Ert/share/gui/img/update.png and /dev/null differ diff --git a/ThirdParty/Ert/share/lib/synthesizer/__init__.py b/ThirdParty/Ert/share/lib/synthesizer/__init__.py deleted file mode 100644 index 0bc890b220..0000000000 --- a/ThirdParty/Ert/share/lib/synthesizer/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from .prime_generator import PrimeGenerator -from .perlin import PerlinNoise -from .shaped_perlin import ShapedNoise, ShapeFunction, ShapeCreator -from .oil_simulator import OilSimulator \ No newline at end of file diff --git a/ThirdParty/Ert/share/lib/synthesizer/oil_simulator.py b/ThirdParty/Ert/share/lib/synthesizer/oil_simulator.py deleted file mode 100644 index 8c74cd120c..0000000000 --- a/ThirdParty/Ert/share/lib/synthesizer/oil_simulator.py +++ /dev/null @@ -1,168 +0,0 @@ -from . import ShapeFunction, ShapeCreator - -class OilSimulator(object): - OPR_SHAPE = ShapeFunction([0.0, 0.2, 0.5, 0.7, 1.0], [0.0, 0.7, 0.2, 0.1, 0.01]) - GPR_SHAPE = ShapeFunction([0.0, 0.2, 0.5, 0.7, 1.0], [0.0, 0.5, 0.7, 0.7, 0.3]) - WPR_SHAPE = ShapeFunction([0.0, 0.2, 0.5, 0.7, 1.0], [0.0, 0.01, 0.3, 0.7, 1]) - BPR_SHAPE= ShapeFunction([0.0, 0.2, 0.5, 0.7, 1.0], [1.0, 0.7, 0.5, 0.3, 0.1]) - - O_DIVERGENCE = ShapeFunction([0.0, 0.5, 0.7, 0.9, 1.0], [0.0, 0.5, 0.3, 0.1, 0.01]) - G_DIVERGENCE = ShapeFunction([0.0, 0.5, 0.7, 0.9, 1.0], [0.0, 0.1, 0.3, 0.2, 0.1]) - W_DIVERGENCE = ShapeFunction([0.0, 0.5, 0.7, 0.9, 1.0], [0.0, 0.1, 0.3, 0.2, 0.01]) - B_DIVERGENCE = ShapeFunction([0.0, 0.5, 0.7, 0.9, 1.0], [0.0, 0.1, 0.2, 0.3, 0.5]) - - def __init__(self, ooip=2000, goip=2500, woip=2250): - self._foip = self.ooip = ooip - self._fgip = self.goip = goip - self._fwip = self.woip = woip - - self._oprFunc = {} - self._gprFunc = {} - self._wprFunc = {} - self._bprFunc = {} - self._current_step = 0 - - self._fopt = 0.0 - self._fopr = 0.0 - self._fgpt = 0.0 - self._fgpr = 0.0 - self._fwpt = 0.0 - self._fwpr = 0.0 - - self._fgor = 0.0 - self._fwct = 0.0 - - - self._wells = {} - self._bpr = {} - - def addWell(self, name, seed, persistence=0.2, octaves=8, divergence_scale=1.0, offset=0.0): - oil_div = OilSimulator.O_DIVERGENCE.scaledCopy(divergence_scale) - gas_div = OilSimulator.G_DIVERGENCE.scaledCopy(divergence_scale) - water_div = OilSimulator.W_DIVERGENCE.scaledCopy(divergence_scale) - self._oprFunc[name] = ShapeCreator.createNoiseFunction(OilSimulator.OPR_SHAPE, oil_div, seed, persistence=persistence, octaves=octaves, cutoff=0.0, offset=offset) - self._gprFunc[name] = ShapeCreator.createNoiseFunction(OilSimulator.GPR_SHAPE, gas_div, seed * 7, persistence=persistence * 3.5, octaves=octaves / 2, cutoff=0.0, offset=offset) - self._wprFunc[name] = ShapeCreator.createNoiseFunction(OilSimulator.WPR_SHAPE, water_div, seed * 11, persistence=persistence, octaves=octaves, cutoff=0.0, offset=offset) - - self._wells[name] = {"opr": 0.0, "opt": 0.0, "gpr": 0.0, "gpt": 0.0, "wpr": 0.0, "wpt": 0.0} - - def addBlock(self, name, seed, persistence=0.2): - self._bprFunc[name] = ShapeCreator.createNoiseFunction(OilSimulator.BPR_SHAPE, OilSimulator.B_DIVERGENCE, seed, persistence=persistence, cutoff=0.0) - self._bpr[name] = 0.0 - - def step(self, scale=1.0): - self._fopr = 0.0 - self._fgpr = 0.0 - self._fwpr = 0.0 - self._fgor = 0.0 - self._fwct = 0.0 - for key in self._wells: - oprFunction = self._oprFunc[key] - gprFunction = self._gprFunc[key] - wprFunction = self._wprFunc[key] - opr_value = oprFunction(self._current_step, scale) - gpr_value = gprFunction(self._current_step, scale) - wpr_value = wprFunction(self._current_step, scale) - - well = self._wells[key] - if self._foip > 0.0: - well["opr"] = opr_value - well["opt"] += opr_value - self._fopr += opr_value - - if self._fgip > 0.0: - well["gpr"] = gpr_value - well["gpt"] += gpr_value - self._fgpr += gpr_value - - if self._fwip > 0.0: - well["wpr"] = wpr_value - well["wpt"] += wpr_value - self._fwpr += wpr_value - - self._fgor += self.gor(key) - self._fwct += self.wct(key) - - self._foip -= self._fopr - self._fgip -= self._fgpr - self._fwip -= self._fwpr - - if self._foip < 0.0: - self._foip = 0.0 # This may lead to the total (FOPT) larger than OOIP - - if self._fgip < 0.0: - self._fgip = 0.0 - - if self._fwip < 0.0: - self._fwip = 0.0 - - self._fopt += self._fopr - self._fgpt += self._fgpr - self._fwpt += self._fwpr - - self._fgor /= len(self._wells) - self._fwct /= len(self._wells) - - for key in self._bpr: - bprFunction = self._bprFunc[key] - self._bpr[key] = bprFunction(self._current_step, scale) - - self._current_step += 1 - - def fopt(self): - return self._fopt - - def fopr(self): - return self._fopr - - def fgpt(self): - return self._fgpt - - def fgpr(self): - return self._fgpr - - def fwpt(self): - return self._fwpt - - def fwpr(self): - return self._fwpr - - def fgor(self): - return self._fgor - - def fwct(self): - return self._fwct - - def foip(self): - return self._foip - - def fgip(self): - return self._fgip - - def fwip(self): - return self._fwip - - def opr(self, well_name): - return self._wells[well_name]["opr"] - - def gpr(self, well_name): - return self._wells[well_name]["gpr"] - - def wpr(self, well_name): - return self._wells[well_name]["wpr"] - - def wct(self, well_name): - opr = self.opr(well_name) - wpr = self.wpr(well_name) - opr = max(opr, 0.1) - return wpr / (wpr + opr) if (wpr + opr) > 0.0 else 0.0 - - def gor(self, well_name): - opr = self.opr(well_name) - gpr = self.gpr(well_name) - opr = max(opr, 0.1) - gpr = max(gpr, 0.1) - return gpr / opr - - def bpr(self, block_name): - return self._bpr[block_name] diff --git a/ThirdParty/Ert/share/lib/synthesizer/perlin.py b/ThirdParty/Ert/share/lib/synthesizer/perlin.py deleted file mode 100644 index b3da8ae7e1..0000000000 --- a/ThirdParty/Ert/share/lib/synthesizer/perlin.py +++ /dev/null @@ -1,57 +0,0 @@ -import math - -from .prime_generator import PrimeGenerator - - -class PerlinNoise(object): - def __init__(self, persistence=0.5, number_of_octaves=4, prime_generator=None): - self.persistence = persistence - self.number_of_octaves = number_of_octaves - - self.octave_primes = prime_generator if prime_generator is not None else PrimeGenerator() - - def cosineInterpolation(self, a, b, x): - ft = x * 3.1415927 - f = (1.0 - math.cos(ft)) * 0.5 - return a * (1 - f) + b * f - - MAX_INT = (1 << 31) - 1 - - def noise(self, x, perturbation): - x += perturbation - x = ((x << 13) & PerlinNoise.MAX_INT) ^ x - x = (x * (x * x * 15731 + 789221) + 1376312589) & PerlinNoise.MAX_INT - return 1.0 - x / 1073741824.0 - - def smoothedNoise(self, x, perturbation): - return self.noise(x, perturbation) / 2.0 + self.noise(x - 1, perturbation) / 4.0 + self.noise(x + 1, perturbation) / 4.0 - - def interpolatedNoise(self, x, octave_number): - int_x = int(x) - frac_x = x - int_x - - perturbation = self.octave_primes[octave_number] - - v1 = self.smoothedNoise(int_x, perturbation) - v2 = self.smoothedNoise(int_x + 1, perturbation) - - return self.cosineInterpolation(v1, v2, frac_x) - - def perlinNoise1D(self, x): - total = 0.0 - - for octave in range(self.number_of_octaves - 1): - frequency = math.pow(2, octave) - amplitude = math.pow(self.persistence, octave) - - total += self.interpolatedNoise(x * frequency, octave_number=octave) * amplitude - - return total - - def __getitem__(self, x): - """ :rtype: float """ - return self.perlinNoise1D(x * 10.0) - - def __call__(self, x): - """ :rtype: float """ - return self[x] diff --git a/ThirdParty/Ert/share/lib/synthesizer/prime_generator.py b/ThirdParty/Ert/share/lib/synthesizer/prime_generator.py deleted file mode 100644 index d7c35107b4..0000000000 --- a/ThirdParty/Ert/share/lib/synthesizer/prime_generator.py +++ /dev/null @@ -1,40 +0,0 @@ -import random - -def rwh_primes2(n): - # http://stackoverflow.com/questions/2068372/fastest-way-to-list-all-primes-below-n-in-python/3035188#3035188 - """ Input n>=6, Returns a list of primes, 2 <= p < n """ - correction = (n % 6 > 1) - n = {0: n, 1: n - 1, 2: n + 4, 3: n + 3, 4: n + 2, 5: n + 1}[n % 6] - sieve = [True] * (n / 3) - sieve[0] = False - for i in xrange(int(n ** 0.5) / 3 + 1): - if sieve[i]: - k = 3 * i + 1 | 1 - sieve[((k * k) / 3)::2 * k] = [False] * ((n / 6 - (k * k) / 6 - 1) / k + 1) - sieve[(k * k + 4 * k - 2 * k * (i & 1)) / 3::2 * k] = [False] * ( - (n / 6 - (k * k + 4 * k - 2 * k * (i & 1)) / 6 - 1) / k + 1) - return [2, 3] + [3 * i + 1 | 1 for i in xrange(1, n / 3 - correction) if sieve[i]] - - - -class PrimeGenerator(object): - LIST_OF_PRIMES = rwh_primes2(10000) - - def __init__(self, seed=None): - self.__primes = {} - self.__random = random.Random(seed) - random.seed(seed) - - def __getitem__(self, index): - if not isinstance(index, (int, long)) or index < 0: - raise IndexError("Index must be a positive integer: %d" % index) - - if not index in self.__primes: - p1 = self.randomPrime() - self.__primes[index] = p1 - - return self.__primes[index] - - def randomPrime(self): - random_index = self.__random.randint(0, len(PrimeGenerator.LIST_OF_PRIMES) - 1) - return PrimeGenerator.LIST_OF_PRIMES[random_index] diff --git a/ThirdParty/Ert/share/lib/synthesizer/shaped_perlin.py b/ThirdParty/Ert/share/lib/synthesizer/shaped_perlin.py deleted file mode 100644 index 65b63a1f02..0000000000 --- a/ThirdParty/Ert/share/lib/synthesizer/shaped_perlin.py +++ /dev/null @@ -1,106 +0,0 @@ -import math -from . import PrimeGenerator, PerlinNoise - - -class Interpolator(object): - def __init__(self, x, y): - self.x = x - self.y = y - - assert len(x) == len(y) - - def __call__(self, x): - if x <= self.x[0]: - y = self.y[0] - elif x >= self.x[len(self.x) - 1]: - y = self.y[len(self.x) - 1] - else: - y = None - for i in range(len(self.x) - 1): - if self.x[i] <= x < self.x[i + 1]: - x_diff = self.x[i + 1] - self.x[i] - frac_x = (x - self.x[i]) / x_diff - y = self.cosineInterpolation(self.y[i], self.y[i + 1], frac_x) - break - - return y - - def cosineInterpolation(self, a, b, x): - ft = x * 3.1415927 - f = (1.0 - math.cos(ft)) * 0.5 - return a * (1 - f) + b * f - - -class ShapeFunction(object): - def __init__(self, x, y, scale=1.0): - self.scale = scale - self.interpolator = Interpolator(x, y) - - def __call__(self, x): - return self.interpolator(x) * self.scale - - def scaledCopy(self, scale=1.0): - return ShapeFunction(self.interpolator.x, self.interpolator.y, scale) - - -class ConstantShapeFunction(ShapeFunction): - def __init__(self, value): - super(ConstantShapeFunction, self).__init__([0.0], [value]) - - - -class ShapedNoise(object): - - def __init__(self, noiseFunction, shapeFunction, divergenceFunction, offset=0.0, cutoff=None): - self.shapeFunction = shapeFunction - self.divergenceFunction = divergenceFunction - self.noiseFunction = noiseFunction - self.offset = offset - self.cutoff = cutoff - - def __call__(self, x, scale=1.0): - scaled_x = x * scale - result = self.shapeFunction(scaled_x) + self.noiseFunction(scaled_x) * self.divergenceFunction(scaled_x) - result += self.offset - if self.cutoff is not None: - result = max(result, self.cutoff) - return result - - -class ShapeCreator(object): - - @staticmethod - def createShapeFunction(count=1000, persistence=0.2, octaves=8, seed=1): - """ @rtype: ShapeFunction """ - prime_generator = PrimeGenerator(seed=seed) - perlininator = PerlinNoise(persistence=persistence, number_of_octaves=octaves, prime_generator=prime_generator) - - x_values = [x / float(count) for x in range(count)] - y_values = [perlininator(x) for x in x_values] - - return ShapeFunction(x_values, y_values) - - @staticmethod - def createShapedPerlinFunction(divergence_x, divergence_y, shape_seed=None, perlin_seed=None, count=1000, persistence=0.2, octaves=8, offset=0.0, cutoff=None): - """ @rtype: ShapedNoise """ - shapeFunction = ShapeCreator.createShapeFunction(count, persistence, octaves, shape_seed) - divergenceFunction = ShapeFunction(divergence_x, divergence_y) - prime_generator = PrimeGenerator(perlin_seed) - perlin_noise = PerlinNoise(persistence, octaves, prime_generator) - - return ShapedNoise(perlin_noise, shapeFunction, divergenceFunction, offset=offset, cutoff=cutoff) - - @staticmethod - def createNoiseFunction(shapeFunction=None, divergenceFunction=None, seed=None, persistence=0.2, octaves=8, offset=0.0, cutoff=None): - """ @rtype: ShapedNoise """ - if shapeFunction is None: - shapeFunction = ConstantShapeFunction(0.0) - - if divergenceFunction is None: - divergenceFunction = ConstantShapeFunction(1.0) - - prime_generator = PrimeGenerator(seed) - perlin_noise = PerlinNoise(persistence, octaves, prime_generator) - - noise = ShapedNoise(perlin_noise, shapeFunction, divergenceFunction, offset=offset, cutoff=cutoff) - return noise diff --git a/ThirdParty/Ert/share/site-config b/ThirdParty/Ert/share/site-config deleted file mode 100644 index c751e4e9ba..0000000000 --- a/ThirdParty/Ert/share/site-config +++ /dev/null @@ -1,7 +0,0 @@ --- This is a very basic site config file, mainly used for testing. - -WORKFLOW_JOB_DIRECTORY workflows/jobs/internal/config -WORKFLOW_JOB_DIRECTORY workflows/jobs/internal-gui/config -JOB_SCRIPT bin/job_dispatch.py -QUEUE_OPTION LOCAL MAX_RUNNING 1 - diff --git a/ThirdParty/Ert/share/viewer/shaders/default.fp b/ThirdParty/Ert/share/viewer/shaders/default.fp deleted file mode 100644 index bd6ba38d8e..0000000000 --- a/ThirdParty/Ert/share/viewer/shaders/default.fp +++ /dev/null @@ -1,4 +0,0 @@ -void main() { - gl_FragColor.rgb = gl_TexCoord[0].zyx; - gl_FragColor.a = 1.0; -} \ No newline at end of file diff --git a/ThirdParty/Ert/share/viewer/shaders/default.vp b/ThirdParty/Ert/share/viewer/shaders/default.vp deleted file mode 100644 index 9ead80e635..0000000000 --- a/ThirdParty/Ert/share/viewer/shaders/default.vp +++ /dev/null @@ -1,33 +0,0 @@ -#version 120 -uniform sampler3D grid; -uniform ivec3 grid_size; - -vec4 DELTA = vec4(1.0 / grid_size.x, 1.0 / grid_size.y, 1.0 / grid_size.z, 0.0); - -varying vec3 normal; - -vec4 fetchTexel(sampler3D sampler, vec3 p, vec3 offset) { - return texture3D(sampler, p + offset); -} - -void main() { - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - - vec3 xyz = texture3D(grid, gl_TexCoord[0].xyz).rgb; - vec4 p = vec4(gl_Vertex); - p.xyz = xyz; - //p.z = 1800.0; - - float s01 = fetchTexel(grid, gl_TexCoord[0].xyz, DELTA.xww).z; - float s21 = fetchTexel(grid, gl_TexCoord[0].xyz, -DELTA.xww).z; - float s10 = fetchTexel(grid, gl_TexCoord[0].xyz, DELTA.wyw).z; - float s12 = fetchTexel(grid, gl_TexCoord[0].xyz, -DELTA.wyw).z; - - vec3 va = normalize(vec3(2.0, 0.0, s21 - s01)); - vec3 vb = normalize(vec3(0.0, 2.0, s12 - s10)); - normal = normalize(cross(va, vb)); - - //normal = (gl_ModelViewMatrix * vec4(normal, 0.0)).xyz; - - gl_Position = gl_ModelViewProjectionMatrix * p; -} \ No newline at end of file diff --git a/ThirdParty/Ert/share/viewer/shaders/texturing.fp b/ThirdParty/Ert/share/viewer/shaders/texturing.fp deleted file mode 100644 index 298cff2c63..0000000000 --- a/ThirdParty/Ert/share/viewer/shaders/texturing.fp +++ /dev/null @@ -1,49 +0,0 @@ -#version 120 -uniform sampler3D grid; -uniform sampler3D grid_data; -uniform sampler1D color_scale; - -uniform bool hide_inactive_cells; -uniform bool lighting; -uniform bool region_scaling; -uniform float data_range; - -// From python code: self.__shader.setUniformi("grid_size", texture.getWidth(), texture.getHeight(), texture.getDepth()) - - -varying vec3 normal; - - -void main() { - vec4 cell = texture3D(grid, gl_TexCoord[0].xyz); - - if(hide_inactive_cells && cell.w < 0.5) { - discard; - } - - float color_pos = texture3D(grid_data, gl_TexCoord[0].xyz).a; - - if (color_pos < 0.001) { - discard; - } - - if(region_scaling) { - // data_range + 1 because [0-9] count = 10 - color_pos = color_pos * (data_range + 1) / 16.0; - } - - vec3 color = texture1D(color_scale, color_pos).rgb; - - //color = gl_TexCoord[0].yxz; - - if(lighting) { - float d = dot(normalize(normal), normalize(vec3(0.0, 0.0, 0.5))); - //d = clamp(d, 0.0, 1.0); - color = color + ((0.5 * color * d) - 0.25); - } - - - - gl_FragColor.rgb = color; - gl_FragColor.a = 1.0; -} diff --git a/ThirdParty/Ert/share/workflows/jobs/internal-gui/config/CREATE_CASE b/ThirdParty/Ert/share/workflows/jobs/internal-gui/config/CREATE_CASE deleted file mode 100644 index 6875fee2d0..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal-gui/config/CREATE_CASE +++ /dev/null @@ -1,6 +0,0 @@ -INTERNAL True -SCRIPT ../scripts/create_case.py -MIN_ARG 1 -MAX_ARG 1 -ARG_TYPE 0 STRING - diff --git a/ThirdParty/Ert/share/workflows/jobs/internal-gui/config/CSV_EXPORT b/ThirdParty/Ert/share/workflows/jobs/internal-gui/config/CSV_EXPORT deleted file mode 100644 index abef52b476..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal-gui/config/CSV_EXPORT +++ /dev/null @@ -1,9 +0,0 @@ -INTERNAL True -SCRIPT ../scripts/csv_export.py -MIN_ARG 1 -MAX_ARG 4 -ARG_TYPE 0 STRING -ARG_TYPE 1 STRING -ARG_TYPE 2 STRING -ARG_TYPE 3 BOOL - diff --git a/ThirdParty/Ert/share/workflows/jobs/internal-gui/config/EXPORT_MISFIT_DATA b/ThirdParty/Ert/share/workflows/jobs/internal-gui/config/EXPORT_MISFIT_DATA deleted file mode 100644 index c4aac369aa..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal-gui/config/EXPORT_MISFIT_DATA +++ /dev/null @@ -1,6 +0,0 @@ -INTERNAL True -SCRIPT ../scripts/export_misfit_data.py -MIN_ARG 0 -MAX_ARG 1 -ARG_TYPE 0 STRING - diff --git a/ThirdParty/Ert/share/workflows/jobs/internal-gui/config/GEN_DATA_RFT_CSV_EXPORT b/ThirdParty/Ert/share/workflows/jobs/internal-gui/config/GEN_DATA_RFT_CSV_EXPORT deleted file mode 100644 index e6ca1dcc58..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal-gui/config/GEN_DATA_RFT_CSV_EXPORT +++ /dev/null @@ -1,8 +0,0 @@ -INTERNAL True -SCRIPT ../scripts/gen_data_rft_export.py -MIN_ARG 2 -MAX_ARG 4 -ARG_TYPE 0 STRING -ARG_TYPE 1 STRING -ARG_TYPE 2 STRING -ARG_TYPE 3 BOOL diff --git a/ThirdParty/Ert/share/workflows/jobs/internal-gui/config/INIT_CASE_FROM_EXISTING b/ThirdParty/Ert/share/workflows/jobs/internal-gui/config/INIT_CASE_FROM_EXISTING deleted file mode 100644 index 4c37a13fca..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal-gui/config/INIT_CASE_FROM_EXISTING +++ /dev/null @@ -1,7 +0,0 @@ -INTERNAL True -SCRIPT ../scripts/init_case_from_existing.py -MIN_ARG 1 -MAX_ARG 2 -ARG_TYPE 0 STRING -ARG_TYPE 1 STRING - diff --git a/ThirdParty/Ert/share/workflows/jobs/internal-gui/config/SELECT_CASE b/ThirdParty/Ert/share/workflows/jobs/internal-gui/config/SELECT_CASE deleted file mode 100644 index bdd49d8888..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal-gui/config/SELECT_CASE +++ /dev/null @@ -1,6 +0,0 @@ -INTERNAL True -SCRIPT ../scripts/select_case.py -MIN_ARG 1 -MAX_ARG 1 -ARG_TYPE 0 STRING - diff --git a/ThirdParty/Ert/share/workflows/jobs/internal-gui/config/UPDATE_RUNPATH_LIST b/ThirdParty/Ert/share/workflows/jobs/internal-gui/config/UPDATE_RUNPATH_LIST deleted file mode 100644 index dbaa256d05..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal-gui/config/UPDATE_RUNPATH_LIST +++ /dev/null @@ -1,6 +0,0 @@ -INTERNAL True -SCRIPT ../scripts/update_runpath_list.py -MIN_ARG 0 -MAX_ARG 1 -ARG_TYPE 0 STRING - diff --git a/ThirdParty/Ert/share/workflows/jobs/internal-gui/scripts/create_case.py b/ThirdParty/Ert/share/workflows/jobs/internal-gui/scripts/create_case.py deleted file mode 100644 index 74c6380f1b..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal-gui/scripts/create_case.py +++ /dev/null @@ -1,7 +0,0 @@ -from ert.enkf import ErtScript - -class CreateCaseJob(ErtScript): - - def run(self, case_name): - ert = self.ert() - fs = ert.getEnkfFsManager().getFileSystem(case_name) diff --git a/ThirdParty/Ert/share/workflows/jobs/internal-gui/scripts/csv_export.py b/ThirdParty/Ert/share/workflows/jobs/internal-gui/scripts/csv_export.py deleted file mode 100644 index 4c0a93b08b..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal-gui/scripts/csv_export.py +++ /dev/null @@ -1,189 +0,0 @@ -import os -import re - -import pandas -from PyQt4.QtGui import QCheckBox - -from ert.enkf import ErtPlugin, CancelPluginException -from ert.enkf.export import SummaryCollector, GenKwCollector, MisfitCollector, DesignMatrixReader, CustomKWCollector -from ert_gui.ertwidgets.customdialog import CustomDialog -from ert_gui.ertwidgets.listeditbox import ListEditBox -from ert_gui.ertwidgets.models.path_model import PathModel -from ert_gui.ertwidgets.pathchooser import PathChooser - - -class CSVExportJob(ErtPlugin): - """ - Export of summary, custom_kw, misfit, design matrix data and gen kw into a single CSV file. - - The script expects a single argument: - - output_file: this is the path to the file to output the CSV data to - - Optional arguments: - - case_list: a comma separated list of cases to export (no spaces allowed) - if no list is provided the current case is exported - a single * can be used to export all cases - - design_matrix: a path to a file containing the design matrix - - infer_iteration: If True the script will try to infer the iteration number by looking at the suffix of the case name - (i.e. default_2 = iteration 2) - If False the script will use the ordering of the case list: the first item will be iteration 0, - the second item will be iteration 1... - - The script also looks for default values for output path and design matrix path to present in the GUI. These can - be specified with DATA_KW keyword in the config file: - DATA_KW CSV_OUTPUT_PATH - DATA_KW DESIGN_MATRIX_PATH - """ - - INFER_HELP = ("" - "If this is checked the iteration number will be inferred from the name i.e.:" - "
    " - "
  • case_name -> iteration: 0
  • " - "
  • case_name_0 -> iteration: 0
  • " - "
  • case_name_2 -> iteration: 2
  • " - "
  • case_0, case_2, case_5 -> iterations: 0, 2, 5
  • " - "
" - "Leave this unchecked to set iteration number to the order of the listed cases:" - "
  • case_0, case_2, case_5 -> iterations: 0, 1, 2
" - "
" - "") - - def getName(self): - return "CSV Export" - - def getDescription(self): - return "Export GenKW, CustomKW, design matrix, misfit data and summary data into a single CSV file." - - def inferIterationNumber(self, case_name): - pattern = re.compile("_([0-9]+$)") - match = pattern.search(case_name) - - if match is not None: - return int(match.group(1)) - return 0 - - - def run(self, output_file, case_list=None, design_matrix_path=None, infer_iteration=True): - cases = [] - - if case_list is not None: - if case_list.strip() == "*": - cases = self.getAllCaseList() - else: - cases = case_list.split(",") - - if case_list is None or len(cases) == 0: - cases = [self.ert().getEnkfFsManager().getCurrentFileSystem().getCaseName()] - - if design_matrix_path is not None: - if not os.path.exists(design_matrix_path): - raise UserWarning("The design matrix file does not exists!") - - if not os.path.isfile(design_matrix_path): - raise UserWarning("The design matrix is not a file!") - - data = pandas.DataFrame() - - for index, case in enumerate(cases): - case = case.strip() - - if not self.ert().getEnkfFsManager().caseExists(case): - raise UserWarning("The case '%s' does not exist!" % case) - - if not self.ert().getEnkfFsManager().caseHasData(case): - raise UserWarning("The case '%s' does not have any data!" % case) - - if infer_iteration: - iteration_number = self.inferIterationNumber(case) - else: - iteration_number = index - - case_data = GenKwCollector.loadAllGenKwData(self.ert(), case) - - custom_kw_data = CustomKWCollector.loadAllCustomKWData(self.ert(), case) - if not custom_kw_data.empty: - case_data = case_data.join(custom_kw_data, how='outer') - - if design_matrix_path is not None: - design_matrix_data = DesignMatrixReader.loadDesignMatrix(design_matrix_path) - if not design_matrix_data.empty: - case_data = case_data.join(design_matrix_data, how='outer') - - misfit_data = MisfitCollector.loadAllMisfitData(self.ert(), case) - if not misfit_data.empty: - case_data = case_data.join(misfit_data, how='outer') - - summary_data = SummaryCollector.loadAllSummaryData(self.ert(), case) - if not summary_data.empty: - case_data = case_data.join(summary_data, how='outer') - else: - case_data["Date"] = None - case_data.set_index(["Date"], append=True, inplace=True) - - case_data["Iteration"] = iteration_number - case_data["Case"] = case - case_data.set_index(["Case", "Iteration"], append=True, inplace=True) - - data = pandas.concat([data, case_data]) - - data = data.reorder_levels(["Realization", "Iteration", "Date", "Case"]) - data.to_csv(output_file) - - export_info = "Exported %d rows and %d columns to %s." % (len(data.index), len(data.columns), output_file) - return export_info - - - def getArguments(self, parent=None): - description = "The CSV export requires some information before it starts:" - dialog = CustomDialog("CSV Export", description, parent) - - default_csv_output_path = self.getDataKWValue("CSV_OUTPUT_PATH", default="output.csv") - output_path_model = PathModel(default_csv_output_path) - output_path_chooser = PathChooser(output_path_model) - - design_matrix_default = self.getDataKWValue("DESIGN_MATRIX_PATH", default="") - design_matrix_path_model = PathModel(design_matrix_default, is_required=False, must_exist=True) - design_matrix_path_chooser = PathChooser(design_matrix_path_model) - - list_edit = ListEditBox(self.getAllCaseList()) - - infer_iteration_check = QCheckBox() - infer_iteration_check.setChecked(True) - infer_iteration_check.setToolTip(CSVExportJob.INFER_HELP) - - dialog.addLabeledOption("Output file path", output_path_chooser) - dialog.addLabeledOption("Design Matrix path", design_matrix_path_chooser) - dialog.addLabeledOption("List of cases to export", list_edit) - dialog.addLabeledOption("Infer iteration number", infer_iteration_check) - - dialog.addButtons() - - success = dialog.showAndTell() - - if success: - design_matrix_path = design_matrix_path_model.getPath() - if design_matrix_path.strip() == "": - design_matrix_path = None - - case_list = ",".join(list_edit.getItems()) - - return [output_path_model.getPath(), case_list, design_matrix_path, infer_iteration_check.isChecked()] - - raise CancelPluginException("User cancelled!") - - - def getDataKWValue(self, name, default): - data_kw = self.ert().getDataKW() - if name in data_kw: - return data_kw[data_kw.indexForKey(name)][1] - return default - - def getAllCaseList(self): - fs_manager = self.ert().getEnkfFsManager() - all_case_list = fs_manager.getCaseList() - all_case_list = [case for case in all_case_list if fs_manager.caseHasData(case)] - return all_case_list \ No newline at end of file diff --git a/ThirdParty/Ert/share/workflows/jobs/internal-gui/scripts/export_misfit_data.py b/ThirdParty/Ert/share/workflows/jobs/internal-gui/scripts/export_misfit_data.py deleted file mode 100644 index 0cda52f916..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal-gui/scripts/export_misfit_data.py +++ /dev/null @@ -1,78 +0,0 @@ -from collections import OrderedDict -import os -from ert.enkf import ErtScript, RealizationStateEnum -from ert.util import BoolVector - -""" -This job exports misfit data into a chosen file or to the default gen_kw export file (parameters.txt) -""" - -class ExportMisfitDataJob(ErtScript): - - def run(self, target_file=None): - ert = self.ert() - fs = ert.getEnkfFsManager().getCurrentFileSystem() - - if target_file is None: - target_file = ert.getModelConfig().getGenKWExportFile() - - runpath_list = ert.getHookManager().getRunpathList() - - active_list = self.createActiveList(fs) - - for runpath_node in runpath_list: - if runpath_node.realization in active_list: - - if not os.path.exists(runpath_node.runpath): - os.makedirs(runpath_node.runpath) - - target_path = os.path.join(runpath_node.runpath, target_file) - - parameters = self.parseTargetFile(target_path) - - misfit_sum = 0.0 - for obs_vector in ert.getObservations(): - misfit = obs_vector.getTotalChi2(fs, runpath_node.realization ) - - key = "MISFIT:%s" % obs_vector.getObservationKey() - parameters[key] = misfit - - misfit_sum += misfit - - parameters["MISFIT:TOTAL"] = misfit_sum - - self.dumpParametersToTargetFile(parameters, target_path) - - - - def parseTargetFile(self, target_path): - parameters = OrderedDict() - - if os.path.exists(target_path) and os.path.isfile(target_path): - with open(target_path, "r") as input_file: - lines = input_file.readlines() - - for line in lines: - tokens = line.split() - - if len(tokens) == 2: - parameters[tokens[0]] = tokens[1] - else: - raise UserWarning("The file '%s' contains errors. Expected format for each line: KEY VALUE" % target_path) - - return parameters - - - def dumpParametersToTargetFile(self, parameters, target_path): - with open(target_path, "w") as output: - for key in parameters: - output.write("%s %s\n" % (key, parameters[key])) - - - def createActiveList(self, fs): - state_map = fs.getStateMap() - ens_mask = BoolVector(False, self.ert().getEnsembleSize()) - state_map.selectMatching(ens_mask, RealizationStateEnum.STATE_HAS_DATA) - active_list = BoolVector.createActiveList(ens_mask) - - return active_list diff --git a/ThirdParty/Ert/share/workflows/jobs/internal-gui/scripts/gen_data_rft_export.py b/ThirdParty/Ert/share/workflows/jobs/internal-gui/scripts/gen_data_rft_export.py deleted file mode 100644 index 0cac7e970f..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal-gui/scripts/gen_data_rft_export.py +++ /dev/null @@ -1,199 +0,0 @@ -import os -import re - -import numpy -import pandas -from PyQt4.QtGui import QCheckBox - -from ert.ecl.rft import WellTrajectory -from ert.enkf import ErtPlugin, CancelPluginException -from ert.enkf import RealizationStateEnum -from ert.enkf.enums import EnkfObservationImplementationType -from ert.enkf.export import GenDataCollector, ArgLoader -from ert_gui.ertwidgets.customdialog import CustomDialog -from ert_gui.ertwidgets.listeditbox import ListEditBox -from ert_gui.ertwidgets.models.path_model import PathModel -from ert_gui.ertwidgets.pathchooser import PathChooser - - -class GenDataRFTCSVExportJob(ErtPlugin): - """Export of GEN_DATA based rfts to a CSV file. The csv file will in - addition contain the depth as duplicated seperate row. - - The script expects four arguments: - - output_file: this is the path to the file to output the CSV data to - - key: this is the ert GEN_DATA key used for this particular RFT. - - report_step: This is the report step configured in the ert - configuration file for this RFT. - - trajectory_file: This is the the file containing the - - Optional arguments: - - case_list: a comma separated list of cases to export (no spaces allowed) - if no list is provided the current case is exported - - infer_iteration: If True the script will try to infer the iteration number by looking at the suffix of the case name - (i.e. default_2 = iteration 2) - If False the script will use the ordering of the case list: the first item will be iteration 0, - the second item will be iteration 1... - """ - - INFER_HELP = ("" - "If this is checked the iteration number will be inferred from the name i.e.:" - "
    " - "
  • case_name -> iteration: 0
  • " - "
  • case_name_0 -> iteration: 0
  • " - "
  • case_name_2 -> iteration: 2
  • " - "
  • case_0, case_2, case_5 -> iterations: 0, 2, 5
  • " - "
" - "Leave this unchecked to set iteration number to the order of the listed cases:" - "
  • case_0, case_2, case_5 -> iterations: 0, 1, 2
" - "
" - "") - - def getName(self): - return "GEN_DATA RFT CSV Export" - - def getDescription(self): - return "Export gen_data RFT results into a single CSV file." - - def inferIterationNumber(self, case_name): - pattern = re.compile("_([0-9]+$)") - match = pattern.search(case_name) - - if match is not None: - return int(match.group(1)) - return 0 - - def run(self, output_file, trajectory_path, case_list=None, infer_iteration=True): - """The run method will export the RFT's for all wells and all cases. - - The successfull operation of this method hinges on two naming - conventions: - - 1. All the GEN_DATA RFT observations have key RFT_$WELL - 2. The trajectory files are in $trajectory_path/$WELL.txt or $trajectory_path/$WELL_R.txt - - """ - - wells = set() - obs_pattern = "RFT_*" - enkf_obs = self.ert().getObservations() - obs_keys = enkf_obs.getMatchingKeys(obs_pattern, obs_type=EnkfObservationImplementationType.GEN_OBS) - - cases = [] - if case_list is not None: - cases = case_list.split(",") - - if case_list is None or len(cases) == 0: - cases = [self.ert().getEnkfFsManager().getCurrentFileSystem().getCaseName()] - - data_frame = pandas.DataFrame() - for index, case in enumerate(cases): - case = case.strip() - case_frame = pandas.DataFrame() - - if not self.ert().getEnkfFsManager().caseExists(case): - raise UserWarning("The case '%s' does not exist!" % case) - - if not self.ert().getEnkfFsManager().caseHasData(case): - raise UserWarning("The case '%s' does not have any data!" % case) - - if infer_iteration: - iteration_number = self.inferIterationNumber(case) - else: - iteration_number = index - - for obs_key in obs_keys: - well = obs_key.replace("RFT_", "") - wells.add(well) - obs_vector = enkf_obs[obs_key] - data_key = obs_vector.getDataKey() - report_step = obs_vector.activeStep() - obs_node = obs_vector.getNode(report_step) - - rft_data = GenDataCollector.loadGenData(self.ert(), case, data_key, report_step) - fs = self.ert().getEnkfFsManager().getFileSystem(case) - realizations = fs.realizationList(RealizationStateEnum.STATE_HAS_DATA) - - # Trajectory - trajectory_file = os.path.join(trajectory_path, "%s.txt" % well) - if not os.path.isfile(trajectory_file): - trajectory_file = os.path.join(trajectory_path, "%s_R.txt" % well) - - trajectory = WellTrajectory(trajectory_file) - arg = ArgLoader.load(trajectory_file, column_names=["utm_x", "utm_y", "md", "tvd"]) - tvd_arg = arg["tvd"] - data_size = len(tvd_arg) - - # Observations - obs = numpy.empty(shape=(data_size, 2), dtype=numpy.float64) - obs.fill(numpy.nan) - for obs_index in range(len(obs_node)): - data_index = obs_node.getDataIndex(obs_index) - value = obs_node.getValue(obs_index) - std = obs_node.getStandardDeviation(obs_index) - obs[data_index, 0] = value - obs[data_index, 1] = std - - for iens in realizations: - realization_frame = pandas.DataFrame(data={"TVD": tvd_arg, - "Pressure": rft_data[iens], - "ObsValue": obs[:, 0], - "ObsStd": obs[:, 1]}, - columns=["TVD", "Pressure", "ObsValue", "ObsStd"]) - - realization_frame["Realization"] = iens - realization_frame["Well"] = well - realization_frame["Case"] = case - realization_frame["Iteration"] = iteration_number - - case_frame = case_frame.append(realization_frame) - - data_frame = data_frame.append(case_frame) - - data_frame.set_index(["Realization", "Well", "Case", "Iteration"], inplace=True) - data_frame.to_csv(output_file) - export_info = "Exported RFT information for wells: %s to: %s " % (", ".join(list(wells)), output_file) - return export_info - - def getArguments(self, parent=None): - description = "The GEN_DATA RFT CSV export requires some information before it starts:" - dialog = CustomDialog("Robust CSV Export", description, parent) - - output_path_model = PathModel("output.csv") - output_path_chooser = PathChooser(output_path_model) - - trajectory_model = PathModel("wellpath", must_be_a_directory=True, must_be_a_file=False, must_exist=True) - trajectory_chooser = PathChooser(trajectory_model) - - fs_manager = self.ert().getEnkfFsManager() - all_case_list = fs_manager.getCaseList() - all_case_list = [case for case in all_case_list if fs_manager.caseHasData(case)] - list_edit = ListEditBox(all_case_list) - - infer_iteration_check = QCheckBox() - infer_iteration_check.setChecked(True) - infer_iteration_check.setToolTip(GenDataRFTCSVExportJob.INFER_HELP) - - dialog.addLabeledOption("Output file path", output_path_chooser) - dialog.addLabeledOption("Trajectory file", trajectory_chooser) - dialog.addLabeledOption("List of cases to export", list_edit) - dialog.addLabeledOption("Infer iteration number", infer_iteration_check) - - dialog.addButtons() - - success = dialog.showAndTell() - - if success: - case_list = ",".join(list_edit.getItems()) - try: - return [output_path_model.getPath(), trajectory_model.getPath(), case_list, infer_iteration_check.isChecked()] - except ValueError: - pass - - raise CancelPluginException("User cancelled!") diff --git a/ThirdParty/Ert/share/workflows/jobs/internal-gui/scripts/init_case_from_existing.py b/ThirdParty/Ert/share/workflows/jobs/internal-gui/scripts/init_case_from_existing.py deleted file mode 100644 index abb028820c..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal-gui/scripts/init_case_from_existing.py +++ /dev/null @@ -1,16 +0,0 @@ -from ert.enkf import ErtScript - - -class InitCaseFromExistingJob(ErtScript): - - def run(self, source_case, target_case=None): - ert = self.ert() - source_fs = ert.getEnkfFsManager().getFileSystem(source_case) - - if target_case is None: - target_fs = ert.getEnkfFsManager().getCurrentFileSystem() - - else: - target_fs = ert.getEnkfFsManager().getFileSystem(target_case) - - ert.getEnkfFsManager().initializeCaseFromExisting(source_fs, 0 , target_fs) diff --git a/ThirdParty/Ert/share/workflows/jobs/internal-gui/scripts/select_case.py b/ThirdParty/Ert/share/workflows/jobs/internal-gui/scripts/select_case.py deleted file mode 100644 index 63f4456f9d..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal-gui/scripts/select_case.py +++ /dev/null @@ -1,9 +0,0 @@ -from ert.enkf import ErtScript - -class SelectCaseJob(ErtScript): - - def run(self, case_name): - ert = self.ert() - fs = ert.getEnkfFsManager().getFileSystem(case_name) - ert.getEnkfFsManager().switchFileSystem(fs) - diff --git a/ThirdParty/Ert/share/workflows/jobs/internal-gui/scripts/update_runpath_list.py b/ThirdParty/Ert/share/workflows/jobs/internal-gui/scripts/update_runpath_list.py deleted file mode 100644 index 4a4300fb6c..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal-gui/scripts/update_runpath_list.py +++ /dev/null @@ -1,37 +0,0 @@ -from ert.enkf import ErtScript - -""" -This job is useful if you are running a workflow that requires the hook_manager runpath_list -to be populated but your are not running any simulations. -""" - -class UpdateRunpathListJob(ErtScript): - def run(self): - ert = self.ert() - - realization_count = ert.getEnsembleSize() - iteration = 0 - - ecl_config = ert.eclConfig() - model_config = ert.getModelConfig() - basename_fmt = ecl_config.getEclBase() - runpath_fmt = model_config.getRunpathAsString() - hook_manager = ert.getHookManager() - - runpath_list = hook_manager.getRunpathList() - - runpath_list.clear() - - for realization_number in range(realization_count): - - if basename_fmt is not None: - basename = basename_fmt % realization_number - else: - raise UserWarning("EclBase not set!") - - if model_config.runpathRequiresIterations(): - runpath = runpath_fmt % (realization_number, iteration) - else: - runpath = runpath_fmt % realization_number - - runpath_list.add(realization_number, iteration, runpath, basename) diff --git a/ThirdParty/Ert/share/workflows/jobs/internal-tui/config/CREATE_CASE b/ThirdParty/Ert/share/workflows/jobs/internal-tui/config/CREATE_CASE deleted file mode 100644 index e59df565d8..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal-tui/config/CREATE_CASE +++ /dev/null @@ -1,6 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_create_case_JOB -MIN_ARG 1 -MAX_ARG 1 -ARG_TYPE 0 STRING - diff --git a/ThirdParty/Ert/share/workflows/jobs/internal-tui/config/INIT_CASE_FROM_EXISTING b/ThirdParty/Ert/share/workflows/jobs/internal-tui/config/INIT_CASE_FROM_EXISTING deleted file mode 100644 index f9a1ba7a5e..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal-tui/config/INIT_CASE_FROM_EXISTING +++ /dev/null @@ -1,7 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_init_case_from_existing_JOB -MIN_ARG 1 -MAX_ARG 2 -ARG_TYPE 0 STRING -ARG_TYPE 1 STRING - diff --git a/ThirdParty/Ert/share/workflows/jobs/internal-tui/config/PLOT_ALL_SUMMARY b/ThirdParty/Ert/share/workflows/jobs/internal-tui/config/PLOT_ALL_SUMMARY deleted file mode 100644 index 76ce548a86..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal-tui/config/PLOT_ALL_SUMMARY +++ /dev/null @@ -1,5 +0,0 @@ -INTERNAL True -FUNCTION enkf_tui_plot_all_summary_JOB -MIN_ARG 0 - - diff --git a/ThirdParty/Ert/share/workflows/jobs/internal-tui/config/SELECT_CASE b/ThirdParty/Ert/share/workflows/jobs/internal-tui/config/SELECT_CASE deleted file mode 100644 index 3d77f14369..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal-tui/config/SELECT_CASE +++ /dev/null @@ -1,6 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_select_case_JOB -MIN_ARG 1 -MAX_ARG 1 -ARG_TYPE 0 STRING - diff --git a/ThirdParty/Ert/share/workflows/jobs/internal/config/ANALYSIS_SELECT_MODULE b/ThirdParty/Ert/share/workflows/jobs/internal/config/ANALYSIS_SELECT_MODULE deleted file mode 100644 index 7e12173079..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal/config/ANALYSIS_SELECT_MODULE +++ /dev/null @@ -1,5 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_select_module_JOB -MIN_ARG 1 -MAX_ARG 1 -ARG_TYPE 0 STRING \ No newline at end of file diff --git a/ThirdParty/Ert/share/workflows/jobs/internal/config/ANALYSIS_UPDATE b/ThirdParty/Ert/share/workflows/jobs/internal/config/ANALYSIS_UPDATE deleted file mode 100644 index 186f1d7122..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal/config/ANALYSIS_UPDATE +++ /dev/null @@ -1,6 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_analysis_update_JOB -MIN_ARG 2 -MAX_ARG 2 -ARG_TYPE 0 STRING -ARG_TYPE 1 STRING diff --git a/ThirdParty/Ert/share/workflows/jobs/internal/config/DATA_RANKING b/ThirdParty/Ert/share/workflows/jobs/internal/config/DATA_RANKING deleted file mode 100644 index 514aac9c2e..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal/config/DATA_RANKING +++ /dev/null @@ -1,8 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_rank_on_data_JOB -MIN_ARG 3 -MAX_ARG 4 -ARG_TYPE 0 STRING -ARG_TYPE 1 STRING -ARG_TYPE 2 BOOL -ARG_TYPE 3 INT diff --git a/ThirdParty/Ert/share/workflows/jobs/internal/config/ENSEMBLE_RUN b/ThirdParty/Ert/share/workflows/jobs/internal/config/ENSEMBLE_RUN deleted file mode 100644 index 8bdc4b1da2..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal/config/ENSEMBLE_RUN +++ /dev/null @@ -1,6 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_ensemble_run_JOB -MIN_ARG 0 -ARG_TYPE 0 STRING - - diff --git a/ThirdParty/Ert/share/workflows/jobs/internal/config/EXIT_ERT b/ThirdParty/Ert/share/workflows/jobs/internal/config/EXIT_ERT deleted file mode 100644 index ef2e4b9d1e..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal/config/EXIT_ERT +++ /dev/null @@ -1,4 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_exit_JOB -MIN_ARG 0 -MAX_ARG 0 diff --git a/ThirdParty/Ert/share/workflows/jobs/internal/config/EXPORT_FIELD b/ThirdParty/Ert/share/workflows/jobs/internal/config/EXPORT_FIELD deleted file mode 100644 index ca01bc461a..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal/config/EXPORT_FIELD +++ /dev/null @@ -1,7 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_export_field_JOB -MIN_ARG 3 -ARG_TYPE 0 STRING -ARG_TYPE 1 STRING -ARG_TYPE 2 INT -ARG_TYPE 3 STRING diff --git a/ThirdParty/Ert/share/workflows/jobs/internal/config/EXPORT_FIELD_ECL_GRDECL b/ThirdParty/Ert/share/workflows/jobs/internal/config/EXPORT_FIELD_ECL_GRDECL deleted file mode 100644 index 75e0020f1e..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal/config/EXPORT_FIELD_ECL_GRDECL +++ /dev/null @@ -1,7 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_export_field_to_ECL_JOB -MIN_ARG 3 -ARG_TYPE 0 STRING -ARG_TYPE 1 STRING -ARG_TYPE 2 INT -ARG_TYPE 3 STRING diff --git a/ThirdParty/Ert/share/workflows/jobs/internal/config/EXPORT_FIELD_RMS_ROFF b/ThirdParty/Ert/share/workflows/jobs/internal/config/EXPORT_FIELD_RMS_ROFF deleted file mode 100644 index cfc6a2f4f5..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal/config/EXPORT_FIELD_RMS_ROFF +++ /dev/null @@ -1,7 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_export_field_to_RMS_JOB -MIN_ARG 3 -ARG_TYPE 0 STRING -ARG_TYPE 1 STRING -ARG_TYPE 2 INT -ARG_TYPE 3 STRING diff --git a/ThirdParty/Ert/share/workflows/jobs/internal/config/EXPORT_RANKING b/ThirdParty/Ert/share/workflows/jobs/internal/config/EXPORT_RANKING deleted file mode 100644 index 0ef0614609..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal/config/EXPORT_RANKING +++ /dev/null @@ -1,7 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_export_ranking_JOB -MIN_ARG 2 -MAX_ARG 2 -ARG_TYPE 0 STRING -ARG_TYPE 1 STRING - diff --git a/ThirdParty/Ert/share/workflows/jobs/internal/config/EXPORT_RUNPATH b/ThirdParty/Ert/share/workflows/jobs/internal/config/EXPORT_RUNPATH deleted file mode 100644 index 753f9e9c9f..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal/config/EXPORT_RUNPATH +++ /dev/null @@ -1,3 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_export_runpath_file_JOB - diff --git a/ThirdParty/Ert/share/workflows/jobs/internal/config/INIT_MISFIT_TABLE b/ThirdParty/Ert/share/workflows/jobs/internal/config/INIT_MISFIT_TABLE deleted file mode 100644 index a798874f59..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal/config/INIT_MISFIT_TABLE +++ /dev/null @@ -1,4 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_init_misfit_table_JOB -MIN_ARG 0 - diff --git a/ThirdParty/Ert/share/workflows/jobs/internal/config/LOAD_RESULTS b/ThirdParty/Ert/share/workflows/jobs/internal/config/LOAD_RESULTS deleted file mode 100644 index 8be9a06ecd..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal/config/LOAD_RESULTS +++ /dev/null @@ -1,3 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_load_results_JOB - diff --git a/ThirdParty/Ert/share/workflows/jobs/internal/config/LOAD_RESULTS_ITER b/ThirdParty/Ert/share/workflows/jobs/internal/config/LOAD_RESULTS_ITER deleted file mode 100644 index e81802426e..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal/config/LOAD_RESULTS_ITER +++ /dev/null @@ -1,5 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_load_results_iter_JOB -MIN_ARG 1 -ARG_TYPE 0 INT - diff --git a/ThirdParty/Ert/share/workflows/jobs/internal/config/OBSERVATION_RANKING b/ThirdParty/Ert/share/workflows/jobs/internal/config/OBSERVATION_RANKING deleted file mode 100644 index 23b8402bb6..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal/config/OBSERVATION_RANKING +++ /dev/null @@ -1,4 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_rank_on_observations_JOB -MIN_ARG 1 -ARG_TYPE 0 STRING diff --git a/ThirdParty/Ert/share/workflows/jobs/internal/config/RUN_ITERATED_SMOOTHER b/ThirdParty/Ert/share/workflows/jobs/internal/config/RUN_ITERATED_SMOOTHER deleted file mode 100644 index ed425d5f97..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal/config/RUN_ITERATED_SMOOTHER +++ /dev/null @@ -1,4 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_iterated_smoother_JOB -MIN_ARG 0 -MAX_ARG 0 diff --git a/ThirdParty/Ert/share/workflows/jobs/internal/config/RUN_SMOOTHER b/ThirdParty/Ert/share/workflows/jobs/internal/config/RUN_SMOOTHER deleted file mode 100644 index 44e1bf217b..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal/config/RUN_SMOOTHER +++ /dev/null @@ -1,7 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_smoother_JOB -MIN_ARG 1 -MAX_ARG 2 -ARG_TYPE 0 STRING -ARG_TYPE 1 BOOL - diff --git a/ThirdParty/Ert/share/workflows/jobs/internal/config/RUN_SMOOTHER_WITH_ITER b/ThirdParty/Ert/share/workflows/jobs/internal/config/RUN_SMOOTHER_WITH_ITER deleted file mode 100644 index 15ab1a9dcf..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal/config/RUN_SMOOTHER_WITH_ITER +++ /dev/null @@ -1,8 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_smoother_with_iter_JOB -MIN_ARG 1 -MAX_ARG 3 -ARG_TYPE 0 INT -ARG_TYPE 1 STRING -ARG_TYPE 2 BOOL - diff --git a/ThirdParty/Ert/share/workflows/jobs/internal/config/SCALE_STD b/ThirdParty/Ert/share/workflows/jobs/internal/config/SCALE_STD deleted file mode 100644 index 26ebee4fc8..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal/config/SCALE_STD +++ /dev/null @@ -1,5 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_scale_obs_std_JOB -MIN_ARG 1 -MAX_ARG 1 -ARG_TYPE 0 FLOAT diff --git a/ThirdParty/Ert/share/workflows/jobs/internal/config/STD_SCALE_CORRELATED_OBS b/ThirdParty/Ert/share/workflows/jobs/internal/config/STD_SCALE_CORRELATED_OBS deleted file mode 100644 index 10baf75313..0000000000 --- a/ThirdParty/Ert/share/workflows/jobs/internal/config/STD_SCALE_CORRELATED_OBS +++ /dev/null @@ -1,3 +0,0 @@ -INTERNAL True -FUNCTION enkf_main_std_scale_correlated_obs_JOB - diff --git a/ThirdParty/Ert/test-data/local/config/gen_data/REFCASE.SMSPEC b/ThirdParty/Ert/test-data/local/config/gen_data/REFCASE.SMSPEC deleted file mode 100644 index 04373c55f9..0000000000 Binary files a/ThirdParty/Ert/test-data/local/config/gen_data/REFCASE.SMSPEC and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/config/gen_data/REFCASE.UNSMRY b/ThirdParty/Ert/test-data/local/config/gen_data/REFCASE.UNSMRY deleted file mode 100644 index 426c9beb6c..0000000000 Binary files a/ThirdParty/Ert/test-data/local/config/gen_data/REFCASE.UNSMRY and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/config/gen_data/config b/ThirdParty/Ert/test-data/local/config/gen_data/config deleted file mode 100644 index 64f533aca1..0000000000 --- a/ThirdParty/Ert/test-data/local/config/gen_data/config +++ /dev/null @@ -1,8 +0,0 @@ -JOBNAME Job%d -RUNPATH /tmp/simulations/run%d -NUM_REALIZATIONS 1 - -GEN_DATA DATA INPUT_FORMAT:ASCII RESULT_FILE:Result%d REPORT_STEPS:10,20 - -OBS_CONFIG observations -REFCASE REFCASE \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/config/gen_data/gen_obs_data b/ThirdParty/Ert/test-data/local/config/gen_data/gen_obs_data deleted file mode 100644 index 94ebaf9001..0000000000 --- a/ThirdParty/Ert/test-data/local/config/gen_data/gen_obs_data +++ /dev/null @@ -1,4 +0,0 @@ -1 -2 -3 -4 diff --git a/ThirdParty/Ert/test-data/local/config/gen_data/observations b/ThirdParty/Ert/test-data/local/config/gen_data/observations deleted file mode 100644 index 28b4e99cd2..0000000000 --- a/ThirdParty/Ert/test-data/local/config/gen_data/observations +++ /dev/null @@ -1,19 +0,0 @@ -GENERAL_OBSERVATION GEN_OBS10 { - DATA = DATA; - RESTART = 10; - OBS_FILE = "gen_obs_data"; -}; - - -GENERAL_OBSERVATION GEN_OBS20 { - DATA = DATA; - RESTART = 20; - OBS_FILE = "gen_obs_data"; -}; - - -GENERAL_OBSERVATION GEN_OBS30 { - DATA = DATA; - RESTART = 30; - OBS_FILE = "gen_obs_data"; -}; diff --git a/ThirdParty/Ert/test-data/local/config/simple_config b/ThirdParty/Ert/test-data/local/config/simple_config deleted file mode 100644 index 8d4b1b0f93..0000000000 --- a/ThirdParty/Ert/test-data/local/config/simple_config +++ /dev/null @@ -1,214 +0,0 @@ -QUEUE_OPTION LSF LSF_LOGIN_SHELL /bin/csh - -DEFINE __NAME__ EXAMPLE_01_BASE -DEFINE __INCLUDE_PATH__ /private/joaho/ERT/git/ert/Gurbat -DEFINE __GRID__ __NAME__.EGRID -DEFINE MULTIR_FILE MULTIR.INC - -JOB_SCRIPT /private/joaho/ERT/Statoil/etc/ERT/Scripts/job_dispatch.py - - --- The ECLIPSE data files which are used as init. - -GRID __GRID__ -SCHEDULE_FILE target.SCH - - ---SCHEDULE_PREDICTION_FILE prediction.sch - -INSTALL_JOB RMS_BATCH /private/joaho/ERT/Statoil/etc/ERT/Config/jobs/resmod/RMS_BATCH_TEST -INSTALL_JOB ECLIPSE_TEST ECLIPSE_TEST -INSTALL_JOB AVGP jobs/AVGP ---INSTALL_JOB RMS_TEST /private/joaho/ERT/Statoil/etc/ERT/Config/jobs/resmod/RMS_BATCH -SETENV MANY_PATH $PATH:$LD_LIBRARY_PATH:$MANPATH:/lib - - ---SCHEDULE_PREDICTION_FILE prediction2.schi - -DATA_FILE Example_01_base.data - - -INIT_SECTION __INCLUDE_PATH__/EQUIL.INC -LICENSE_PATH /tmp/BJARNE_PATH - ---SETENV ERT_LINK_LSF True ---LSF_SERVER be-grid01 - ---CASE_TABLE CaseNames - - ---PRE_CLEAR_RUNPATH TRUE - --- Where do you want to store things - - -RUNPATH /scratch/ert/joaho/Run1/Xrun%d -RERUN_PATH /scratch/ert/joaho/Rerun/Xrun%d - - - - - -ENSPATH /tmp/Gurbat/104BlockFS -ECLBASE ECL_%04d - -QC_PATH /tmp/QC - --- How to simulate - - -INSTALL_JOB PVT jobs/PVT -INSTALL_JOB NULL jobs/NULL - -INSTALL_JOB RMS_TEST /private/joaho/ERT/Statoil/etc/ERT/Config/jobs/resmod/RUN_RMS_20XX -INSTALL_JOB PRESSURE33 jobs/Pressure33 - ---FORWARD_MODEL RMS_BATCH(=2012.0.1, =/rms/rms_project_2012 , =MAIN_WORKFLOW) -FORWARD_MODEL ECLIPSE100_2009.1 ---FORWARD_MODEL PRESSURE33 ---FORWARD_MODEL RMS_TEST( = , = , = 2011.0.2, =/rms/rms_project_2012 , =/d/proj/bg/ior_fsenter/GRM_TDP/Gimle/work/tfen/r0004/models/eclipse/refcase/, =Forward_Seismic,=SEISMIC_FORWARD_TARGET.INC) - ---FORWARD_MODEL AVGP ---FORWARD_MODEL NULL - - -UMASK 0 -MAX_SUBMIT 10 -MAX_RESAMPLE 1 - - -ADD_FIXED_LENGTH_SCHEDULE_KW Jalla 7 -ADD_FIXED_LENGTH_SCHEDULE_KW Jalla2 70 - - - -DBASE_TYPE BLOCK_FS - --- The ensemble -NUM_REALIZATIONS 25 - -IMAGE_TYPE png -PLOT_DRIVER PLPLOT - -RUN_TEMPLATE Template1 File1 File:1 -RUN_TEMPLATE Template1 File2 File:2 - - -INSTALL_JOB PRESSURE100 PRESSURE100 - - -GEN_KW MULTFLT FAULT_TEMPLATE MULTFLT.INC Config/MULTFLT.txt -GEN_KW GRID_PARAMS GRID_PARAM_TEMPLATE GRID_PARAMS.INC Config/GRID_PARAMS.txt --MIN_STD:Config/GRID_PARAMS.min_std -GEN_KW FLUID_PARAMS FLUID_PARAM_TEMPLATE FLUID_PARAMS.INC Config/FLUID_PARAMS.txt --MIN_STD:Config/FLUID_PARAMS.min_std - -GEN_PARAM GP GP.txt INIT_FILES:GP/GP.txt INPUT_FORMAT:ASCII OUTPUT_FORMAT:ASCII - - - - -UPDATE_RESULTS TRUE -ENKF_RERUN FALSE -RERUN_START 0 - -INSTALL_JOB SGOF_TAB jobs/SGOF_TAB - - - -ENKF_MERGE_OBSERVATIONS TRUE ---ENKF_SCHED_FILE sched_config - - ---ADD_STATIC_KW __ALL__ -ADD_STATIC_KW BJARNE KW2 - -ENKF_ALPHA 1.50 ------------------------------------------------------------------ -IMAGE_VIEWER /tmp/echo.sh -IMAGE_VIEWER /usr/bin/display - - -QUEUE_SYSTEM LSF -QUEUE_SYSTEM LOCAL -QUEUE_SYSTEM RSH - -MAX_RUNNING_LOCAL 3 -MAX_RUNNING_LSF 100 -MAX_RUNNING_RSH 6 ---LSF_QUEUE SUPERKO - -RSH_HOST be-lx655082:2 be-lx633214:2 - - - -LOG_LEVEL 3 -LOG_FILE /tmp/log/log.txt -UPDATE_LOG_PATH /tmp/UP - -KEEP_RUNPATH 0 - 9 -DATA_KW __INCLUDE_PATH__ -DATA_KW WhatEver SomeThing - - - - --- Quantities to estimate on - -HISTORY_SOURCE REFCASE_HISTORY -REFCASE __NAME__.DATA - - -STORE_SEED RandomSeed -LOAD_SEED RandomSeed - - ---EQUIL EQUIL EQUIL.INC equil_config - -RUN_TEMPLATE GEN_DATA_TEMPLATE GEN_DATA_FILE ---GEN_DATA PRESSURE100 INPUT_FORMAT:ASCII RESULT_FILE:PRESSURE%04d - - - ---ANALYSIS_LOAD RML_ENKF /project/res/x86_64_RH_5/lib/rml_enkf.so ---ANALYSIS_LOAD RML_ENKF rml_enkf.so -ANALYSIS_LOAD RML_ENKF /private/joaho/ERT/NR/libanalysis/src/rml_enkf.so - ---ANALYSIS_LOAD FWD_ENKF /private/joaho/ERT/NR/tmp-build/libanalysis/src/sqrt_enkf.so ---ANALYSIS_LOAD SFWD_ENKF /private/joaho/ERT/NR/tmp-build/libanalysis/src/std_enkf.so -ANALYSIS_SET_VAR STD_ENKF ENKF_TRUNCATION 0.95 ---ANALYSIS_SET_VAR SQRT_ENKF ENKF_TRUNCATION 0.99 -ANALYSIS_SET_VAR STD_ENKF ENKF_NCOMP 2 -ANALYSIS_SET_VAR STD_ENKF ENKF_TRUNCATION 0.98 -ANALYSIS_SELECT STD_ENKF - -ANALYSIS_LOAD TEST_ENKF /private/joaho/ERT/NR/libanalysis/src/test_enkf.so - - -QUEUE_OPTION LSF LSF_LOGIN_SHELL /bin/csh - - -FIELD PRESSURE DYNAMIC -FIELD SWAT DYNAMIC MIN:0 MAX:1 -FIELD SGAS DYNAMIC MIN:0 MAX:1 -FIELD RS DYNAMIC MIN:0 -FIELD RV DYNAMIC MIN:0.0034 - ---CONTAINER CXX PRESSURE SWAT - - ---SURFACE TOP OUTPUT_FILE:surf.irap INIT_FILES:Surfaces/d_BCU_%d.irap BASE_SURFACE:Surfaces/d_BCU_0.irap - --- Observations -OBS_CONFIG observations - - ---SUMMARY F* RPR:* - -PLOT_PATH plots - - -IMAGE_VIEWER /tmp/noplot.sh - ------------------------------------------------------------------ - -WORKFLOW_JOB_DIRECTORY WorkflowJobs -LOAD_WORKFLOW Workflows/PLOT_AND_EXIT diff --git a/ThirdParty/Ert/test-data/local/custom_kw/Observations/observation_1 b/ThirdParty/Ert/test-data/local/custom_kw/Observations/observation_1 deleted file mode 100644 index 9468fb3092..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/Observations/observation_1 +++ /dev/null @@ -1,5 +0,0 @@ -GENERAL_OBSERVATION GEN_PERLIN_1 { - DATA = PERLIN; - RESTART = 1; - OBS_FILE = Observations/perlin_obs_1.txt; -}; diff --git a/ThirdParty/Ert/test-data/local/custom_kw/Observations/observation_2 b/ThirdParty/Ert/test-data/local/custom_kw/Observations/observation_2 deleted file mode 100644 index a52d2ddb9c..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/Observations/observation_2 +++ /dev/null @@ -1,5 +0,0 @@ -GENERAL_OBSERVATION GEN_PERLIN_2 { - DATA = PERLIN; - RESTART = 2; - OBS_FILE = Observations/perlin_obs_2.txt; -}; diff --git a/ThirdParty/Ert/test-data/local/custom_kw/Observations/observation_3 b/ThirdParty/Ert/test-data/local/custom_kw/Observations/observation_3 deleted file mode 100644 index 7465c4c124..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/Observations/observation_3 +++ /dev/null @@ -1,5 +0,0 @@ -GENERAL_OBSERVATION GEN_PERLIN_3 { - DATA = PERLIN; - RESTART = 3; - OBS_FILE = Observations/perlin_obs_3.txt; -}; \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/Observations/observations b/ThirdParty/Ert/test-data/local/custom_kw/Observations/observations deleted file mode 100644 index bff0c5823b..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/Observations/observations +++ /dev/null @@ -1,17 +0,0 @@ -GENERAL_OBSERVATION GEN_PERLIN_1 { - DATA = PERLIN; - RESTART = 1; - OBS_FILE = Observations/perlin_obs_1.txt; -}; - -GENERAL_OBSERVATION GEN_PERLIN_2 { - DATA = PERLIN; - RESTART = 2; - OBS_FILE = Observations/perlin_obs_2.txt; -}; - -GENERAL_OBSERVATION GEN_PERLIN_3 { - DATA = PERLIN; - RESTART = 3; - OBS_FILE = Observations/perlin_obs_3.txt; -}; \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/Observations/perlin_obs_1.txt b/ThirdParty/Ert/test-data/local/custom_kw/Observations/perlin_obs_1.txt deleted file mode 100644 index fbfbf08d9e..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/Observations/perlin_obs_1.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.616789 0.200000 --0.626286 0.200000 --0.642772 0.200000 --0.623396 0.200000 --0.601028 0.200000 --0.587671 0.200000 --0.545803 0.200000 --0.548698 0.200000 --0.576106 0.200000 --0.547830 0.200000 --0.499566 0.200000 --0.390302 0.200000 --0.274769 0.200000 --0.218078 0.200000 --0.206531 0.200000 --0.256190 0.200000 --0.286962 0.200000 --0.290826 0.200000 --0.279457 0.200000 --0.220628 0.200000 --0.175666 0.200000 --0.134717 0.200000 --0.041140 0.200000 -0.004634 0.200000 --0.003586 0.200000 --0.044667 0.200000 --0.084128 0.200000 --0.096405 0.200000 --0.146272 0.200000 --0.192659 0.200000 --0.240387 0.200000 --0.315781 0.200000 --0.353862 0.200000 --0.373289 0.200000 --0.395017 0.200000 --0.362747 0.200000 --0.314473 0.200000 --0.207889 0.200000 --0.078605 0.200000 --0.003939 0.200000 -0.034326 0.200000 -0.005587 0.200000 -0.013544 0.200000 -0.095579 0.200000 -0.191848 0.200000 -0.291420 0.200000 -0.337769 0.200000 -0.309285 0.200000 -0.283094 0.200000 -0.246823 0.200000 -0.190450 0.200000 -0.194585 0.200000 -0.244807 0.200000 -0.290661 0.200000 -0.329075 0.200000 -0.306089 0.200000 -0.264557 0.200000 -0.288901 0.200000 -0.331039 0.200000 -0.413380 0.200000 -0.466520 0.200000 -0.460285 0.200000 -0.444206 0.200000 -0.386893 0.200000 -0.350833 0.200000 -0.314020 0.200000 -0.255650 0.200000 -0.237356 0.200000 -0.229103 0.200000 -0.216303 0.200000 -0.232054 0.200000 -0.206562 0.200000 -0.164036 0.200000 -0.215742 0.200000 -0.336400 0.200000 -0.517183 0.200000 -0.654671 0.200000 -0.732607 0.200000 -0.814735 0.200000 -0.835433 0.200000 -0.826283 0.200000 -0.770065 0.200000 -0.673958 0.200000 -0.624376 0.200000 -0.615341 0.200000 -0.601582 0.200000 -0.585811 0.200000 -0.522072 0.200000 -0.459689 0.200000 -0.462806 0.200000 -0.463663 0.200000 -0.490711 0.200000 -0.483229 0.200000 -0.416017 0.200000 -0.344176 0.200000 -0.307064 0.200000 -0.311372 0.200000 -0.314551 0.200000 -0.275854 0.200000 -0.138191 0.200000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/Observations/perlin_obs_2.txt b/ThirdParty/Ert/test-data/local/custom_kw/Observations/perlin_obs_2.txt deleted file mode 100644 index 1c0ee7d131..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/Observations/perlin_obs_2.txt +++ /dev/null @@ -1,100 +0,0 @@ -0.553636 0.200000 -0.562210 0.200000 -0.577093 0.200000 -0.516574 0.200000 -0.453354 0.200000 -0.438536 0.200000 -0.362335 0.200000 -0.299754 0.200000 -0.294947 0.200000 -0.258916 0.200000 -0.199226 0.200000 -0.154968 0.200000 -0.076430 0.200000 -0.038162 0.200000 -0.047076 0.200000 -0.040351 0.200000 -0.044383 0.200000 --0.022339 0.200000 --0.098926 0.200000 --0.182296 0.200000 --0.239174 0.200000 --0.175066 0.200000 --0.098687 0.200000 -0.046630 0.200000 -0.163052 0.200000 -0.239754 0.200000 -0.379917 0.200000 -0.457436 0.200000 -0.500511 0.200000 -0.547066 0.200000 -0.589134 0.200000 -0.630865 0.200000 -0.648067 0.200000 -0.546752 0.200000 -0.382873 0.200000 -0.254339 0.200000 -0.167602 0.200000 -0.165063 0.200000 -0.107654 0.200000 -0.014283 0.200000 --0.003453 0.200000 --0.014968 0.200000 -0.001727 0.200000 -0.011346 0.200000 -0.009215 0.200000 -0.083611 0.200000 -0.234321 0.200000 -0.391352 0.200000 -0.455607 0.200000 -0.429702 0.200000 -0.462148 0.200000 -0.563361 0.200000 -0.647466 0.200000 -0.778980 0.200000 -0.862696 0.200000 -0.876752 0.200000 -0.897362 0.200000 -0.858848 0.200000 -0.813029 0.200000 -0.815672 0.200000 -0.829471 0.200000 -0.883008 0.200000 -0.938118 0.200000 -0.943737 0.200000 -0.943930 0.200000 -0.887728 0.200000 -0.749709 0.200000 -0.570611 0.200000 -0.427346 0.200000 -0.279535 0.200000 -0.134481 0.200000 -0.091839 0.200000 -0.092425 0.200000 -0.142324 0.200000 -0.217527 0.200000 -0.182289 0.200000 -0.063206 0.200000 --0.052929 0.200000 --0.124322 0.200000 --0.149079 0.200000 --0.160036 0.200000 --0.180000 0.200000 --0.213176 0.200000 --0.191568 0.200000 --0.140832 0.200000 --0.131431 0.200000 --0.164401 0.200000 --0.253597 0.200000 --0.316338 0.200000 --0.275519 0.200000 --0.191733 0.200000 --0.019671 0.200000 -0.187348 0.200000 -0.371249 0.200000 -0.532809 0.200000 -0.604516 0.200000 -0.620637 0.200000 -0.517488 0.200000 -0.382527 0.200000 -0.308772 0.200000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/Observations/perlin_obs_3.txt b/ThirdParty/Ert/test-data/local/custom_kw/Observations/perlin_obs_3.txt deleted file mode 100644 index f2cad960e0..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/Observations/perlin_obs_3.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.258515 0.200000 --0.356107 0.200000 --0.525515 0.200000 --0.663313 0.200000 --0.770373 0.200000 --0.752177 0.200000 --0.720117 0.200000 --0.712752 0.200000 --0.678174 0.200000 --0.634873 0.200000 --0.510858 0.200000 --0.401601 0.200000 --0.371298 0.200000 --0.399836 0.200000 --0.388296 0.200000 --0.362204 0.200000 --0.377951 0.200000 --0.339453 0.200000 --0.258223 0.200000 --0.088966 0.200000 -0.113885 0.200000 -0.276111 0.200000 -0.391728 0.200000 -0.418974 0.200000 -0.416504 0.200000 -0.381174 0.200000 -0.323184 0.200000 -0.270447 0.200000 -0.279357 0.200000 -0.328360 0.200000 -0.328559 0.200000 -0.323026 0.200000 -0.327307 0.200000 -0.348794 0.200000 -0.376927 0.200000 -0.383302 0.200000 -0.372235 0.200000 -0.356978 0.200000 -0.397867 0.200000 -0.522396 0.200000 -0.601574 0.200000 -0.657218 0.200000 -0.723345 0.200000 -0.698378 0.200000 -0.639636 0.200000 -0.584196 0.200000 -0.523544 0.200000 -0.490729 0.200000 -0.486421 0.200000 -0.409534 0.200000 -0.286329 0.200000 -0.120963 0.200000 --0.046326 0.200000 --0.129596 0.200000 --0.224071 0.200000 --0.277277 0.200000 --0.271037 0.200000 --0.304891 0.200000 --0.363780 0.200000 --0.395722 0.200000 --0.438535 0.200000 --0.504110 0.200000 --0.546085 0.200000 --0.616035 0.200000 --0.673682 0.200000 --0.650552 0.200000 --0.604866 0.200000 --0.567949 0.200000 --0.539873 0.200000 --0.552954 0.200000 --0.570381 0.200000 --0.517706 0.200000 --0.474400 0.200000 --0.373474 0.200000 --0.263037 0.200000 --0.203820 0.200000 --0.103226 0.200000 --0.051460 0.200000 -0.023379 0.200000 -0.085632 0.200000 -0.073926 0.200000 -0.114264 0.200000 -0.210600 0.200000 -0.367117 0.200000 -0.493523 0.200000 -0.541983 0.200000 -0.555534 0.200000 -0.507462 0.200000 -0.468411 0.200000 -0.494860 0.200000 -0.511384 0.200000 -0.505254 0.200000 -0.497490 0.200000 -0.404108 0.200000 -0.324978 0.200000 -0.329421 0.200000 -0.331172 0.200000 -0.357684 0.200000 -0.334654 0.200000 -0.226313 0.200000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/Parameters/PERLIN_PARAMS.txt b/ThirdParty/Ert/test-data/local/custom_kw/Parameters/PERLIN_PARAMS.txt deleted file mode 100644 index 24926666bb..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/Parameters/PERLIN_PARAMS.txt +++ /dev/null @@ -1,7 +0,0 @@ -SCALE UNIFORM 0.1 1 -OFFSET UNIFORM -1 1 -PERSISTENCE UNIFORM 0.01 1 -OCTAVES UNIFORM 1 64 -PRIME_1 UNIFORM 0 127 -PRIME_2 UNIFORM 0 127 -PRIME_3 UNIFORM 0 127 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/RandomSeed b/ThirdParty/Ert/test-data/local/custom_kw/RandomSeed deleted file mode 100644 index a4571d8b82..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/RandomSeed +++ /dev/null @@ -1 +0,0 @@ -103 95 15 -86 -95 -5 16 -18 24 -60 -89 101 70 22 -104 -41 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/Refcase/CASE.EGRID b/ThirdParty/Ert/test-data/local/custom_kw/Refcase/CASE.EGRID deleted file mode 100644 index 33da9f7a70..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/Refcase/CASE.EGRID and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/Template/PERLIN_TEMPLATE b/ThirdParty/Ert/test-data/local/custom_kw/Template/PERLIN_TEMPLATE deleted file mode 100644 index 527a92907c..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/Template/PERLIN_TEMPLATE +++ /dev/null @@ -1,7 +0,0 @@ -SCALE: -OFFSET: -PERSISTENCE: -OCTAVES: -PRIME_1: -PRIME_2: -PRIME_3: \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/OK b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/OK deleted file mode 100644 index 9590cb949c..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/OK +++ /dev/null @@ -1 +0,0 @@ -All jobs complete \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/aggregated.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/aggregated.txt deleted file mode 100644 index de8aedc562..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/aggregated.txt +++ /dev/null @@ -1,4 +0,0 @@ -PERLIN_3 0.190479 -PERLIN_2 1.002630 -PERLIN_1 -0.167794 -STATE Positive \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/aggregator.stderr b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/aggregator.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/aggregator.stdout b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/aggregator.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/parameters.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/parameters.txt deleted file mode 100644 index 142dbecaab..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/parameters.txt +++ /dev/null @@ -1,7 +0,0 @@ -PERLIN_PARAM:SCALE 0.249225 -PERLIN_PARAM:OFFSET 0.185709 -PERLIN_PARAM:PERSISTENCE 0.936132 -PERLIN_PARAM:OCTAVES 22.4008 -PERLIN_PARAM:PRIME_1 70.2373 -PERLIN_PARAM:PRIME_2 73.2881 -PERLIN_PARAM:PRIME_3 73.2557 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/perlin.stderr b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/perlin.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/perlin.stdout b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/perlin.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/perlin_1.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/perlin_1.txt deleted file mode 100644 index fec0fd107e..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/perlin_1.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.167794 --0.533157 --0.582564 --0.581187 --0.544394 --0.617389 --0.471483 --0.570636 --0.513164 --0.094431 --0.489078 --0.363713 --0.116233 -0.104267 --0.185805 --0.200709 --0.150918 --0.384297 -0.293484 -0.122875 --0.157933 -0.066183 -0.043334 -0.083941 -0.237257 -0.510188 -0.247252 -0.238908 --0.087547 --0.330292 --0.126747 --0.035823 --0.234230 -0.031125 --0.470002 -0.277528 -0.333005 -0.208194 -0.329248 -0.183316 -0.030305 -0.292607 -0.207885 --0.055542 -0.267287 -0.489294 -0.351695 -0.473816 -0.486845 -0.161185 -0.750709 -0.334430 -0.487895 --0.083531 -0.631333 -0.189402 -0.293179 -0.416287 -0.071861 -0.343657 -0.530727 -0.295893 -0.707495 -0.705177 -0.364062 --0.028729 -0.627459 -0.665644 -0.110239 -0.074890 -0.898952 -0.507702 -0.793900 -0.376955 -0.740932 -0.768612 -1.072116 -0.641052 -0.951385 -1.114482 -0.779685 -1.030575 -0.960609 -0.819774 -0.728183 -0.880717 -0.390042 -0.616292 -0.534190 -0.332035 -0.597337 -0.310784 -0.480825 -0.510514 -0.527712 -0.106739 -0.459289 -0.091994 -0.167754 -0.291767 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/perlin_2.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/perlin_2.txt deleted file mode 100644 index a4c8ae2281..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/perlin_2.txt +++ /dev/null @@ -1,100 +0,0 @@ -1.002630 -0.655338 -0.637300 -0.558783 -0.509989 -0.408818 -0.436655 -0.277816 -0.357889 -0.712315 -0.209713 -0.181557 -0.234966 -0.360507 -0.067803 -0.095832 -0.180428 --0.115810 -0.474014 -0.161206 --0.221441 -0.025834 --0.014213 -0.125937 -0.403895 -0.794609 -0.711298 -0.792749 -0.559236 -0.409434 -0.702774 -0.910823 -0.767699 -0.951166 -0.307889 -0.894615 -0.815080 -0.581146 -0.515508 -0.201538 --0.007474 -0.272051 -0.196068 --0.139775 -0.084654 -0.281485 -0.248246 -0.555883 -0.659358 -0.344063 -1.022407 -0.703206 -0.890554 -0.404788 -1.164953 -0.760065 -0.925984 -0.986234 -0.553851 -0.745948 -0.893678 -0.718616 -1.201408 -1.262021 -0.957160 -0.544980 -1.121517 -0.998898 -0.308482 -0.138122 -0.801380 -0.392979 -0.722289 -0.303537 -0.622059 -0.433718 -0.480651 --0.144483 -0.012328 -0.129970 --0.206634 -0.080509 -0.073475 -0.003830 --0.027990 -0.147703 --0.360170 --0.159376 --0.241837 --0.406290 --0.058059 --0.199599 -0.184944 -0.465746 -0.716346 -0.404191 -0.768554 -0.294930 -0.274427 -0.462347 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/perlin_3.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/perlin_3.txt deleted file mode 100644 index 13a10a9e5d..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/perlin_3.txt +++ /dev/null @@ -1,100 +0,0 @@ -0.190479 --0.262978 --0.465308 --0.621105 --0.713738 --0.781896 --0.645797 --0.734690 --0.615233 --0.181474 --0.500371 --0.375013 --0.212762 --0.077491 --0.367569 --0.306723 --0.241907 --0.432924 -0.314717 -0.254536 -0.131618 -0.477011 -0.476202 -0.498281 -0.657347 -0.936028 -0.654565 -0.605760 -0.338082 -0.190727 -0.442199 -0.602984 -0.446939 -0.753207 -0.301943 -1.023577 -1.019714 -0.773061 -0.805721 -0.709651 -0.597553 -0.944238 -0.917685 -0.547257 -0.715075 -0.782070 -0.537469 -0.655260 -0.690172 -0.323895 -0.846589 -0.260808 -0.196762 --0.503788 -0.078186 --0.393964 --0.242415 --0.177505 --0.622958 --0.465445 --0.374328 --0.668502 --0.282796 --0.297752 --0.660453 --0.993300 --0.233057 --0.139662 --0.658737 --0.694367 -0.096517 --0.216566 -0.155464 --0.212261 -0.141495 -0.047609 -0.314219 --0.143014 -0.160029 -0.364682 -0.027328 -0.374773 -0.497251 -0.562515 -0.606365 -0.821117 -0.359765 -0.601682 -0.542912 -0.364089 -0.645058 -0.325327 -0.495087 -0.498606 -0.508514 -0.129097 -0.479090 -0.135126 -0.226554 -0.379889 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/perlin_fail.status b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/perlin_fail.status deleted file mode 100644 index 6ac0122a28..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/perlin_fail.status +++ /dev/null @@ -1 +0,0 @@ -Did nothing! \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/perlin_params.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/perlin_params.txt deleted file mode 100644 index 99b2ec3ff6..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/perlin_params.txt +++ /dev/null @@ -1,7 +0,0 @@ -SCALE:0.249225 -OFFSET:0.185709 -PERSISTENCE:0.936132 -OCTAVES:22.4008 -PRIME_1:70.2373 -PRIME_2:73.2881 -PRIME_3:73.2557 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/realization.ok b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/realization.ok deleted file mode 100644 index a0aba9318a..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-0/iter-0/realization.ok +++ /dev/null @@ -1 +0,0 @@ -OK \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/OK b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/OK deleted file mode 100644 index 9590cb949c..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/OK +++ /dev/null @@ -1 +0,0 @@ -All jobs complete \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/aggregated.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/aggregated.txt deleted file mode 100644 index c42ebc2573..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/aggregated.txt +++ /dev/null @@ -1,4 +0,0 @@ -PERLIN_3 -0.584204 -PERLIN_2 0.227947 -PERLIN_1 -0.942477 -STATE Negative \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/aggregator.stderr b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/aggregator.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/aggregator.stdout b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/aggregator.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/parameters.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/parameters.txt deleted file mode 100644 index d931876083..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/parameters.txt +++ /dev/null @@ -1,7 +0,0 @@ -PERLIN_PARAM:SCALE 0.24275 -PERLIN_PARAM:OFFSET -0.29096 -PERLIN_PARAM:PERSISTENCE 0.860518 -PERLIN_PARAM:OCTAVES 14.7858 -PERLIN_PARAM:PRIME_1 11.8217 -PERLIN_PARAM:PRIME_2 48.9187 -PERLIN_PARAM:PRIME_3 89.5122 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/perlin.stderr b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/perlin.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/perlin.stdout b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/perlin.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/perlin_2.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/perlin_2.txt deleted file mode 100644 index 296be5b8cd..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/perlin_2.txt +++ /dev/null @@ -1,100 +0,0 @@ -0.227947 -0.461424 -0.496254 -0.385250 -0.382965 -0.294599 -0.215538 -0.354808 -0.194641 -0.061050 -0.006348 --0.033658 --0.137511 --0.052176 -0.054974 -0.004020 --0.119814 --0.186461 --0.385196 --0.286967 --0.540945 --0.434223 --0.424480 --0.139600 --0.216224 -0.069846 -0.120217 -0.327327 -0.326008 -0.431300 -0.341933 -0.550826 -0.259922 -0.392107 -0.003858 -0.014051 --0.354946 --0.083760 --0.201720 --0.372664 --0.515754 --0.416670 --0.452153 --0.378276 --0.502741 --0.226850 --0.117039 --0.170353 --0.103309 -0.018785 -0.134857 -0.299396 -0.256928 -0.466775 -0.638846 -0.679726 -0.643554 -0.744558 -0.717986 -0.632070 -0.597780 -0.726447 -0.907347 -0.748545 -0.576996 -0.711178 -0.663988 -0.233265 -0.069050 --0.047240 --0.055375 --0.163060 --0.421085 --0.171631 -0.043688 --0.021042 --0.190991 --0.247524 --0.463284 --0.413005 --0.644291 --0.650833 --0.570592 --0.466943 --0.568175 --0.409936 --0.512981 --0.655652 --0.830461 --0.878072 --0.495081 --0.517236 --0.159439 -0.026080 --0.084928 -0.074934 -0.020797 -0.156703 --0.069071 -0.019410 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/perlin_3.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/perlin_3.txt deleted file mode 100644 index d43e140291..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/perlin_3.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.584204 --0.456892 --0.606354 --0.794637 --0.840762 --0.896115 --0.866915 --0.657698 --0.778480 --0.832740 --0.703736 --0.590227 --0.585239 --0.490175 --0.380398 --0.398535 --0.542149 --0.503575 --0.544492 --0.193638 --0.187886 -0.016954 -0.065935 -0.232744 -0.037229 -0.211265 -0.063484 -0.140338 -0.104854 -0.212594 -0.081358 -0.242987 --0.060839 -0.194148 --0.002088 -0.143014 --0.150313 -0.108155 -0.088492 -0.135449 -0.089272 -0.255517 -0.269465 -0.308757 -0.127679 -0.273734 -0.172184 --0.070976 --0.072495 --0.001383 --0.040962 --0.143002 --0.436864 --0.441800 --0.447921 --0.474303 --0.524845 --0.419181 --0.458823 --0.579324 --0.670226 --0.660671 --0.576856 --0.811227 --1.040616 --0.827102 --0.690587 --0.905295 --0.898169 --0.879729 --0.760237 --0.772606 --0.987910 --0.687429 --0.436876 --0.407151 --0.357423 --0.246055 --0.315583 --0.178294 --0.410329 --0.356569 --0.146816 -0.091742 -0.066180 -0.263478 -0.206954 -0.105406 --0.045712 --0.107693 -0.208035 -0.007690 -0.150704 -0.058939 --0.292759 --0.200161 --0.268667 --0.003101 --0.116944 --0.063049 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/perlin_fail.status b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/perlin_fail.status deleted file mode 100644 index 46a71f4e16..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/perlin_fail.status +++ /dev/null @@ -1 +0,0 @@ -Deleted report step: 1 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/perlin_params.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/perlin_params.txt deleted file mode 100644 index fb78e8c3e9..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/perlin_params.txt +++ /dev/null @@ -1,7 +0,0 @@ -SCALE:0.24275 -OFFSET:-0.29096 -PERSISTENCE:0.860518 -OCTAVES:14.7858 -PRIME_1:11.8217 -PRIME_2:48.9187 -PRIME_3:89.5122 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/realization.ok b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/realization.ok deleted file mode 100644 index a0aba9318a..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-1/iter-0/realization.ok +++ /dev/null @@ -1 +0,0 @@ -OK \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/ERROR b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/ERROR deleted file mode 100644 index f5c9d83c76..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/ERROR +++ /dev/null @@ -1,8 +0,0 @@ - - - REALIZATION_FAIL - Could not find target_file:realization.ok - - - - diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/EXIT b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/EXIT deleted file mode 100644 index f5c9d83c76..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/EXIT +++ /dev/null @@ -1,8 +0,0 @@ - - - REALIZATION_FAIL - Could not find target_file:realization.ok - - - - diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/aggregated.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/aggregated.txt deleted file mode 100644 index 39c71d12aa..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/aggregated.txt +++ /dev/null @@ -1,4 +0,0 @@ -PERLIN_3 -0.294383 -PERLIN_2 0.517768 -PERLIN_1 -0.652656 -STATE Negative \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/aggregator.stderr b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/aggregator.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/aggregator.stdout b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/aggregator.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/parameters.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/parameters.txt deleted file mode 100644 index 0850de9c61..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/parameters.txt +++ /dev/null @@ -1,7 +0,0 @@ -PERLIN_PARAM:SCALE 0.187883 -PERLIN_PARAM:OFFSET -0.512383 -PERLIN_PARAM:PERSISTENCE 0.850056 -PERLIN_PARAM:OCTAVES 39.9199 -PERLIN_PARAM:PRIME_1 76.7337 -PERLIN_PARAM:PRIME_2 54.1086 -PERLIN_PARAM:PRIME_3 16.0042 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/perlin.stderr b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/perlin.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/perlin.stdout b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/perlin.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/perlin_1.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/perlin_1.txt deleted file mode 100644 index 122d4089ea..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/perlin_1.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.652656 --0.856575 --0.907574 --0.921559 --0.907052 --0.798535 --0.892001 --0.898300 --0.932647 --0.887530 --0.745258 --0.774438 --0.680597 --0.707552 --0.616984 --0.784930 --0.705796 --0.672207 --0.677662 --0.517634 --0.460960 --0.512998 --0.485822 --0.377630 --0.469687 --0.463782 --0.644529 --0.631042 --0.610238 --0.645129 --0.841183 --0.813056 --0.824549 --0.985474 --0.818724 --1.021755 --0.749654 --0.643111 --0.382287 --0.319701 --0.240893 --0.293783 --0.356379 --0.315861 --0.243741 --0.061641 --0.016073 --0.078540 --0.166452 --0.204278 --0.206156 --0.339674 --0.324650 --0.218586 --0.220018 --0.365619 --0.213129 --0.161173 --0.144854 --0.088350 --0.193806 --0.111286 --0.100984 --0.235155 --0.165413 --0.278588 --0.429381 --0.254946 --0.240835 --0.227267 --0.524615 --0.423858 --0.341032 --0.369948 --0.180422 -0.176827 -0.282667 -0.455645 -0.421888 -0.461117 -0.478802 -0.408361 -0.301001 -0.266791 -0.167743 -0.066362 -0.101881 -0.183729 --0.037895 -0.191528 -0.077918 -0.193353 -0.109073 -0.001759 --0.061599 --0.001108 --0.164077 --0.253534 --0.200586 --0.275259 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/perlin_3.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/perlin_3.txt deleted file mode 100644 index 1e03faf793..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/perlin_3.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.294383 --0.586396 --0.790317 --0.961476 --1.076396 --0.963042 --1.066316 --1.062354 --1.034715 --0.974573 --0.756551 --0.785737 --0.777126 --0.889310 --0.798749 --0.890944 --0.796785 --0.720834 --0.656429 --0.385973 --0.171410 --0.102170 --0.052955 -0.036709 --0.049597 --0.037941 --0.237216 --0.264190 --0.184608 --0.124110 --0.272236 --0.174249 --0.143380 --0.263391 --0.046779 --0.275706 --0.062945 --0.078243 -0.094185 -0.206634 -0.326354 -0.357848 -0.353421 -0.286938 -0.204047 -0.231135 -0.169701 -0.102903 -0.036875 --0.041568 --0.110276 --0.413296 --0.615784 --0.638843 --0.773164 --0.948985 --0.748723 --0.754966 --0.839672 --0.897452 --1.098861 --1.075682 --1.091275 --1.238084 --1.189928 --1.243159 --1.289897 --1.060251 --1.009811 --0.996525 --1.327050 --1.148126 --0.979468 --0.959163 --0.779859 --0.544176 --0.475229 --0.328422 --0.369468 --0.288684 --0.273556 --0.247441 --0.162358 -0.009532 -0.045926 -0.006763 -0.071604 -0.169119 --0.029173 -0.223582 -0.125639 -0.207896 -0.123334 --0.010150 --0.080797 -0.021249 --0.144276 --0.210401 --0.141786 --0.187137 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/perlin_fail.status b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/perlin_fail.status deleted file mode 100644 index 2494f445e5..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/perlin_fail.status +++ /dev/null @@ -1 +0,0 @@ -Deleted report step: 2 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/perlin_params.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/perlin_params.txt deleted file mode 100644 index a069d36ab8..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-2/iter-0/perlin_params.txt +++ /dev/null @@ -1,7 +0,0 @@ -SCALE:0.187883 -OFFSET:-0.512383 -PERSISTENCE:0.850056 -OCTAVES:39.9199 -PRIME_1:76.7337 -PRIME_2:54.1086 -PRIME_3:16.0042 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/ERROR b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/ERROR deleted file mode 100644 index f5c9d83c76..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/ERROR +++ /dev/null @@ -1,8 +0,0 @@ - - - REALIZATION_FAIL - Could not find target_file:realization.ok - - - - diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/EXIT b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/EXIT deleted file mode 100644 index f5c9d83c76..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/EXIT +++ /dev/null @@ -1,8 +0,0 @@ - - - REALIZATION_FAIL - Could not find target_file:realization.ok - - - - diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/aggregated.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/aggregated.txt deleted file mode 100644 index b986f1b481..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/aggregated.txt +++ /dev/null @@ -1,4 +0,0 @@ -PERLIN_3 -0.871387 -PERLIN_2 -0.059236 -PERLIN_1 -1.229660 -STATE Negative \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/aggregator.stderr b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/aggregator.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/aggregator.stdout b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/aggregator.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/parameters.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/parameters.txt deleted file mode 100644 index a7472afccf..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/parameters.txt +++ /dev/null @@ -1,7 +0,0 @@ -PERLIN_PARAM:SCALE 0.542054 -PERLIN_PARAM:OFFSET -0.936072 -PERLIN_PARAM:PERSISTENCE 0.66513 -PERLIN_PARAM:OCTAVES 59.6891 -PERLIN_PARAM:PRIME_1 58.3958 -PERLIN_PARAM:PRIME_2 51.6271 -PERLIN_PARAM:PRIME_3 37.3286 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/perlin.stderr b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/perlin.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/perlin.stdout b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/perlin.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/perlin_1.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/perlin_1.txt deleted file mode 100644 index 1f0aabd193..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/perlin_1.txt +++ /dev/null @@ -1,100 +0,0 @@ --1.229660 --1.403213 --1.494882 --1.481222 --1.545058 --1.605346 --1.466829 --1.460689 --1.589462 --1.462504 --1.586371 --1.419953 --1.184666 --1.064367 --1.081730 --1.130531 --1.307146 --1.330892 --1.147255 --1.230522 --1.290812 --1.243312 --1.053225 --0.837831 --0.815416 --0.794856 --0.780118 --0.867346 --0.868595 --0.844661 --0.949974 --1.135521 --1.278698 --1.237066 --1.353473 --1.274754 --1.024540 --1.062374 --1.018191 --0.989482 --1.082235 --1.083477 --1.111900 --0.884140 --0.804378 --0.649785 --0.414051 --0.453314 --0.426393 --0.376335 --0.433952 --0.369796 --0.319725 --0.318209 --0.380495 --0.274543 --0.410077 --0.265464 --0.276032 --0.293185 --0.259478 --0.307654 --0.469020 --0.606702 --0.727993 --0.657698 --0.738949 --0.779068 --0.929409 --0.925120 --0.888902 --0.818882 --0.691387 --0.806321 --0.774223 --0.725947 --0.616177 --0.575377 --0.546778 --0.619225 --0.739783 --0.805058 --0.854443 --1.003113 --0.978222 --0.724971 --0.804323 --0.920953 --0.973738 --0.936418 --0.905518 --0.717744 --0.616881 --0.785126 --0.782606 --0.680625 --0.739233 --0.708171 --0.640854 --0.813288 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/perlin_2.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/perlin_2.txt deleted file mode 100644 index 58ac16bef2..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/perlin_2.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.059236 --0.214718 --0.275017 --0.341253 --0.490676 --0.579139 --0.558691 --0.612236 --0.718408 --0.655757 --0.887580 --0.874683 --0.833466 --0.808127 --0.828123 --0.833990 --0.975800 --1.062405 --0.966725 --1.192190 --1.354320 --1.283661 --1.110772 --0.795835 --0.648779 --0.510435 --0.316072 --0.313505 --0.221812 --0.104936 --0.120453 --0.188875 --0.276769 --0.317026 --0.575582 --0.657667 --0.542465 --0.689421 --0.831931 --0.971260 --1.120014 --1.104033 --1.123718 --0.968373 --0.987011 --0.857594 --0.517499 --0.371248 --0.253880 --0.193457 --0.162254 --0.001019 -0.082934 -0.170110 -0.153126 -0.296120 -0.222728 -0.304483 -0.205958 -0.109107 -0.103474 -0.115069 -0.024892 --0.049858 --0.134896 --0.083989 --0.244890 --0.445814 --0.731166 --0.861888 --0.986474 --0.933604 --0.762998 --0.879739 --0.893096 --1.060842 --1.207642 --1.360912 --1.485835 --1.603737 --1.726102 --1.755124 --1.741578 --1.819057 --1.734395 --1.457985 --1.554534 --1.696621 --1.749765 --1.674743 --1.560913 --1.228126 --0.912762 --0.829894 --0.593973 --0.383174 --0.429968 --0.505235 --0.534181 --0.642708 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/perlin_fail.status b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/perlin_fail.status deleted file mode 100644 index 6842226365..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/perlin_fail.status +++ /dev/null @@ -1 +0,0 @@ -Deleted report step: 3 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/perlin_params.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/perlin_params.txt deleted file mode 100644 index f51328cc14..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-3/iter-0/perlin_params.txt +++ /dev/null @@ -1,7 +0,0 @@ -SCALE:0.542054 -OFFSET:-0.936072 -PERSISTENCE:0.66513 -OCTAVES:59.6891 -PRIME_1:58.3958 -PRIME_2:51.6271 -PRIME_3:37.3286 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/OK b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/OK deleted file mode 100644 index 9590cb949c..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/OK +++ /dev/null @@ -1 +0,0 @@ -All jobs complete \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/aggregated.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/aggregated.txt deleted file mode 100644 index 35536135e9..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/aggregated.txt +++ /dev/null @@ -1,4 +0,0 @@ -PERLIN_3 0.585905 -PERLIN_2 1.398056 -PERLIN_1 0.227632 -STATE Positive \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/aggregator.stderr b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/aggregator.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/aggregator.stdout b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/aggregator.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/parameters.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/parameters.txt deleted file mode 100644 index 43486a893a..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/parameters.txt +++ /dev/null @@ -1,7 +0,0 @@ -PERLIN_PARAM:SCALE 0.434448 -PERLIN_PARAM:OFFSET 0.831105 -PERLIN_PARAM:PERSISTENCE 0.630867 -PERLIN_PARAM:OCTAVES 8.00407 -PERLIN_PARAM:PRIME_1 85.4235 -PERLIN_PARAM:PRIME_2 21.3039 -PERLIN_PARAM:PRIME_3 104.858 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/perlin.stderr b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/perlin.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/perlin.stdout b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/perlin.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/perlin_2.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/perlin_2.txt deleted file mode 100644 index b747326d4e..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/perlin_2.txt +++ /dev/null @@ -1,100 +0,0 @@ -1.398056 -1.370914 -1.363998 -1.279446 -1.232190 -1.280908 -1.103097 -1.044700 -1.071948 -1.061684 -1.094715 -0.964632 -0.831411 -0.781949 -0.814620 -0.849516 -0.851001 -0.765851 -0.758157 -0.773463 -0.753641 -0.789955 -0.752934 -0.828227 -0.915443 -0.973537 -1.081467 -1.241200 -1.241392 -1.257672 -1.377862 -1.470086 -1.421784 -1.325527 -1.150346 -1.051501 -1.044802 -1.106502 -1.157155 -1.178239 -1.131983 -1.091121 -1.099748 -1.022758 -0.922794 -1.005841 -1.071597 -1.179689 -1.248927 -1.203617 -1.238719 -1.303884 -1.370907 -1.578622 -1.711466 -1.711839 -1.668280 -1.577131 -1.546602 -1.622520 -1.688682 -1.788272 -1.882089 -1.796176 -1.789849 -1.824672 -1.596314 -1.354986 -1.209724 -1.109246 -0.923528 -0.922481 -0.911951 -0.973918 -1.090397 -1.192352 -1.060059 -0.993187 -1.014380 -0.913349 -0.932815 -0.882706 -0.835195 -0.874574 -0.888107 -0.876224 -0.749712 -0.614713 -0.449095 -0.520278 -0.614327 -0.737773 -0.860582 -0.969577 -1.155922 -1.219523 -1.274034 -1.070757 -0.993013 -0.832009 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/perlin_3.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/perlin_3.txt deleted file mode 100644 index c5dd1d518a..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/perlin_3.txt +++ /dev/null @@ -1,100 +0,0 @@ -0.585905 -0.452598 -0.261390 -0.099559 -0.008463 -0.090195 -0.020645 -0.032193 -0.098826 -0.167894 -0.384631 -0.408063 -0.383683 -0.343951 -0.379248 -0.446961 -0.428666 -0.448737 -0.598860 -0.866793 -1.106700 -1.241132 -1.243349 -1.200570 -1.168896 -1.114956 -1.024733 -1.054210 -1.020238 -1.038965 -1.117287 -1.162247 -1.101024 -1.127568 -1.144400 -1.180464 -1.249435 -1.298417 -1.447368 -1.686352 -1.737009 -1.763308 -1.821366 -1.709790 -1.553214 -1.506426 -1.360820 -1.279066 -1.279741 -1.183449 -1.062901 -0.861486 -0.677115 -0.670046 -0.624699 -0.557809 -0.499881 -0.413392 -0.369794 -0.411126 -0.420676 -0.401154 -0.397886 -0.236404 -0.172236 -0.286392 -0.241739 -0.216426 -0.242506 -0.276757 -0.218665 -0.312935 -0.345126 -0.458120 -0.609833 -0.806243 -0.893627 -0.994656 -1.162081 -1.148060 -1.166777 -1.176970 -1.258971 -1.433259 -1.522462 -1.549638 -1.469646 -1.375772 -1.233844 -1.290657 -1.317444 -1.262699 -1.170724 -1.002436 -0.948090 -0.944428 -0.984570 -0.910954 -0.945140 -0.749551 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/perlin_fail.status b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/perlin_fail.status deleted file mode 100644 index 46a71f4e16..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/perlin_fail.status +++ /dev/null @@ -1 +0,0 @@ -Deleted report step: 1 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/perlin_params.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/perlin_params.txt deleted file mode 100644 index 324cbda2ee..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/perlin_params.txt +++ /dev/null @@ -1,7 +0,0 @@ -SCALE:0.434448 -OFFSET:0.831105 -PERSISTENCE:0.630867 -OCTAVES:8.00407 -PRIME_1:85.4235 -PRIME_2:21.3039 -PRIME_3:104.858 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/realization.ok b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/realization.ok deleted file mode 100644 index a0aba9318a..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-4/iter-0/realization.ok +++ /dev/null @@ -1 +0,0 @@ -OK \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/ERROR b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/ERROR deleted file mode 100644 index 48bc5b6354..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/ERROR +++ /dev/null @@ -1,8 +0,0 @@ - - - REALIZATION_FAIL - Could not find target_file:realization.ok - - - - diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/EXIT b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/EXIT deleted file mode 100644 index 48bc5b6354..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/EXIT +++ /dev/null @@ -1,8 +0,0 @@ - - - REALIZATION_FAIL - Could not find target_file:realization.ok - - - - diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/aggregated.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/aggregated.txt deleted file mode 100644 index 72e58cbf64..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/aggregated.txt +++ /dev/null @@ -1,4 +0,0 @@ -PERLIN_3 0.638889 -PERLIN_2 1.451039 -PERLIN_1 0.280615 -STATE Positive \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/aggregator.stderr b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/aggregator.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/aggregator.stdout b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/aggregator.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/parameters.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/parameters.txt deleted file mode 100644 index 463f5c41d8..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/parameters.txt +++ /dev/null @@ -1,7 +0,0 @@ -PERLIN_PARAM:SCALE 0.72828 -PERLIN_PARAM:OFFSET 0.48251 -PERLIN_PARAM:PERSISTENCE 0.878696 -PERLIN_PARAM:OCTAVES 62.5026 -PERLIN_PARAM:PRIME_1 10.3564 -PERLIN_PARAM:PRIME_2 34.9666 -PERLIN_PARAM:PRIME_3 46.2883 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/perlin.stderr b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/perlin.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/perlin.stdout b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/perlin.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/perlin_1.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/perlin_1.txt deleted file mode 100644 index 11da497a09..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/perlin_1.txt +++ /dev/null @@ -1,100 +0,0 @@ -0.280615 -0.140016 -0.101814 --0.129046 -0.108540 -0.255758 --0.136433 -0.402995 -0.060006 -0.243033 -0.270699 -1.032076 --0.013904 --0.123877 -0.661223 -0.260982 -0.218027 -1.382060 -0.399264 -0.483361 -0.472825 --0.400746 -1.339330 -0.692467 -0.043042 -0.542935 --0.239154 -0.322095 -0.568886 --0.253825 -0.069002 -0.151587 --0.060719 -0.071557 -1.232762 -0.806173 -0.197592 -0.775339 -0.485706 --0.340968 -0.563185 --0.301442 --0.470657 -0.391865 -1.604934 -1.366571 -0.978296 -0.533236 -0.199409 -0.640021 -0.724001 -0.620437 --0.062286 -0.448127 -0.681424 -0.211811 -0.962468 -0.569284 -0.153403 -0.463251 -0.717336 -1.047732 -0.879313 -0.557671 -0.589243 -0.475895 -0.668305 -1.261389 -1.992548 -0.514705 -1.480108 -0.964709 -0.672593 -0.541782 -1.389203 -0.533862 -1.237538 -0.892042 -0.376384 -0.676731 -1.374955 -1.291646 -0.276911 -0.706050 -0.032507 -1.074094 -0.914922 -1.747032 -2.087744 -1.287205 -1.735100 -1.305039 -1.283753 -0.989592 -0.686460 -0.373096 -0.309114 -0.349820 -0.814016 -0.915557 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/perlin_3.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/perlin_3.txt deleted file mode 100644 index 4b5a132c2c..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/perlin_3.txt +++ /dev/null @@ -1,100 +0,0 @@ -0.638889 -0.410195 -0.219070 --0.168964 --0.060804 -0.091251 --0.310748 -0.238941 --0.042062 -0.155990 -0.259406 -1.020776 --0.110433 --0.305635 -0.479458 -0.154968 -0.127038 -1.333433 -0.420498 -0.615022 -0.762375 -0.010082 -1.772197 -1.106807 -0.463132 -0.968775 -0.168158 -0.688947 -0.994515 -0.267193 -0.637949 -0.790394 -0.620450 -0.793639 -2.004706 -1.552222 -0.884301 -1.340207 -0.962178 -0.185367 -1.130433 -0.350189 -0.239143 -0.994664 -2.052722 -1.659346 -1.164070 -0.714679 -0.402736 -0.802732 -0.819881 -0.546816 --0.353419 -0.027870 -0.128278 --0.371555 -0.426874 --0.024508 --0.541415 --0.345851 --0.187719 -0.083337 --0.110978 --0.445258 --0.435272 --0.488676 --0.192211 -0.456083 -1.223572 --0.254552 -0.677673 -0.240441 -0.034157 --0.047433 -0.789765 --0.187141 -0.479641 -0.107975 --0.414972 --0.073069 -0.622598 -0.635844 --0.186447 -0.448791 --0.089311 -1.014494 -0.884645 -1.732422 -2.096466 -1.319259 -1.782821 -1.319583 -1.298015 -0.977683 -0.667262 -0.395453 -0.328915 -0.392952 -0.872816 -1.003679 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/perlin_fail.status b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/perlin_fail.status deleted file mode 100644 index 2494f445e5..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/perlin_fail.status +++ /dev/null @@ -1 +0,0 @@ -Deleted report step: 2 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/perlin_params.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/perlin_params.txt deleted file mode 100644 index 6ffe51857b..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-5/iter-0/perlin_params.txt +++ /dev/null @@ -1,7 +0,0 @@ -SCALE:0.72828 -OFFSET:0.48251 -PERSISTENCE:0.878696 -OCTAVES:62.5026 -PRIME_1:10.3564 -PRIME_2:34.9666 -PRIME_3:46.2883 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/OK b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/OK deleted file mode 100644 index 9590cb949c..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/OK +++ /dev/null @@ -1 +0,0 @@ -All jobs complete \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/aggregated.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/aggregated.txt deleted file mode 100644 index 07f12f2a08..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/aggregated.txt +++ /dev/null @@ -1,4 +0,0 @@ -PERLIN_3 0.870550 -PERLIN_2 1.682701 -PERLIN_1 0.512277 -STATE Positive \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/aggregator.stderr b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/aggregator.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/aggregator.stdout b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/aggregator.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/parameters.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/parameters.txt deleted file mode 100644 index 04dc1adb80..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/parameters.txt +++ /dev/null @@ -1,7 +0,0 @@ -PERLIN_PARAM:SCALE 0.105108 -PERLIN_PARAM:OFFSET 0.913379 -PERLIN_PARAM:PERSISTENCE 0.962764 -PERLIN_PARAM:OCTAVES 54.2875 -PERLIN_PARAM:PRIME_1 12.1353 -PERLIN_PARAM:PRIME_2 108.225 -PERLIN_PARAM:PRIME_3 58.2668 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/perlin.stderr b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/perlin.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/perlin.stdout b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/perlin.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/perlin_1.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/perlin_1.txt deleted file mode 100644 index 309c31a80b..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/perlin_1.txt +++ /dev/null @@ -1,100 +0,0 @@ -0.512277 -0.536404 -0.520619 -0.520234 -0.561383 -0.536841 -0.593527 -0.431159 -0.579716 -0.595432 -0.613877 -0.832759 -0.851509 -0.830369 -0.752398 -0.701988 -0.854139 -0.813144 -0.848016 -0.675839 -0.919173 -1.078956 -1.165071 -1.045397 -1.099168 -1.049976 -0.934854 -0.813458 -0.777245 -0.747191 -0.680688 -0.492784 -0.756629 -0.639112 -0.677362 -0.560299 -0.783620 -0.757035 -0.781494 -1.092201 -1.102767 -1.052654 -1.207713 -1.115009 -1.380213 -1.620005 -1.355587 -1.358326 -1.365758 -1.049275 -1.264629 -1.182026 -1.240226 -1.329804 -1.210895 -1.340758 -1.160254 -1.099240 -1.243394 -1.267952 -1.359115 -1.457122 -1.219766 -1.225781 -1.439935 -1.367284 -1.242810 -1.155161 -1.278395 -1.180081 -1.125988 -1.131542 -1.239492 -1.086901 -1.273243 -1.532824 -1.482385 -1.810195 -1.887451 -1.774089 -1.870171 -1.843973 -1.696110 -1.740468 -1.791604 -1.614504 -1.582554 -1.758357 -1.634232 -1.684106 -1.786180 -1.619646 -1.484936 -1.430948 -1.379634 -1.352505 -1.382218 -1.487943 -1.057155 -0.971585 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/perlin_2.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/perlin_2.txt deleted file mode 100644 index 463edcab27..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/perlin_2.txt +++ /dev/null @@ -1,100 +0,0 @@ -1.682701 -1.724900 -1.740484 -1.660204 -1.615765 -1.563048 -1.501665 -1.279611 -1.450770 -1.402179 -1.312668 -1.378029 -1.202709 -1.086610 -1.006006 -0.998528 -1.185484 -1.081631 -1.028546 -0.714171 -0.855664 -1.038607 -1.107524 -1.087393 -1.265806 -1.334397 -1.398900 -1.367299 -1.424028 -1.486916 -1.510209 -1.439430 -1.758558 -1.559152 -1.455253 -1.177386 -1.265695 -1.129987 -0.967754 -1.110422 -1.064988 -1.032099 -1.195895 -1.030776 -1.197580 -1.412196 -1.252139 -1.440393 -1.538272 -1.232153 -1.536327 -1.550802 -1.642885 -1.818122 -1.744516 -1.911422 -1.793059 -1.669187 -1.725384 -1.670243 -1.722066 -1.879845 -1.713679 -1.782625 -2.033032 -1.940992 -1.736869 -1.488416 -1.476638 -1.243313 -1.028416 -1.016820 -1.167881 -1.013483 -1.154370 -1.197929 -0.890921 -1.024660 -0.948394 -0.789577 -0.883852 -0.893907 -0.808975 -0.924524 -1.035431 -0.881490 -0.832342 -0.982689 -0.858205 -0.945780 -1.130784 -1.109264 -1.189055 -1.386180 -1.568267 -1.649957 -1.691483 -1.690880 -1.163828 -1.142166 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/perlin_fail.status b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/perlin_fail.status deleted file mode 100644 index 6842226365..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/perlin_fail.status +++ /dev/null @@ -1 +0,0 @@ -Deleted report step: 3 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/perlin_params.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/perlin_params.txt deleted file mode 100644 index 29d18ec899..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/perlin_params.txt +++ /dev/null @@ -1,7 +0,0 @@ -SCALE:0.105108 -OFFSET:0.913379 -PERSISTENCE:0.962764 -OCTAVES:54.2875 -PRIME_1:12.1353 -PRIME_2:108.225 -PRIME_3:58.2668 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/realization.ok b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/realization.ok deleted file mode 100644 index a0aba9318a..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-6/iter-0/realization.ok +++ /dev/null @@ -1 +0,0 @@ -OK \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/ERROR b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/ERROR deleted file mode 100644 index 1eb5bf0114..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/ERROR +++ /dev/null @@ -1,8 +0,0 @@ - - - REALIZATION_FAIL - Could not find target_file:realization.ok - - - - diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/EXIT b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/EXIT deleted file mode 100644 index 1eb5bf0114..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/EXIT +++ /dev/null @@ -1,8 +0,0 @@ - - - REALIZATION_FAIL - Could not find target_file:realization.ok - - - - diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/aggregated.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/aggregated.txt deleted file mode 100644 index 6b3b4204d7..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/aggregated.txt +++ /dev/null @@ -1,4 +0,0 @@ -PERLIN_3 -0.223092 -PERLIN_2 0.589059 -PERLIN_1 -0.581365 -STATE Negative \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/aggregator.stderr b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/aggregator.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/aggregator.stdout b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/aggregator.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/parameters.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/parameters.txt deleted file mode 100644 index 0fec4832fd..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/parameters.txt +++ /dev/null @@ -1,7 +0,0 @@ -PERLIN_PARAM:SCALE 0.100905 -PERLIN_PARAM:OFFSET 0.749785 -PERLIN_PARAM:PERSISTENCE 0.960394 -PERLIN_PARAM:OCTAVES 27.0099 -PERLIN_PARAM:PRIME_1 40.6138 -PERLIN_PARAM:PRIME_2 61.0175 -PERLIN_PARAM:PRIME_3 87.8034 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/perlin.stderr b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/perlin.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/perlin.stdout b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/perlin.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/perlin_1.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/perlin_1.txt deleted file mode 100644 index f4ab414309..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/perlin_1.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.581365 -0.196529 -0.251092 -0.129792 -0.331063 -0.243506 -0.276892 -0.080451 -0.396119 -0.359775 -0.367571 -0.375403 -0.583877 -0.600213 -0.433206 -0.667000 -0.730207 -0.597004 -0.652034 -0.663611 -0.746119 -0.692967 -0.730701 -0.876335 -0.892405 -0.727578 -0.723739 -0.564331 -0.468088 -0.488808 -0.664805 -0.660028 -0.630792 -0.524399 -0.474312 -0.443139 -0.580488 -0.481039 -0.800572 -1.001564 -0.911524 -0.901357 -0.788429 -0.858484 -0.905262 -1.091118 -1.153703 -1.092191 -1.125297 -0.931559 -0.887913 -0.949225 -1.000548 -1.157858 -0.916321 -0.916039 -0.825100 -0.963569 -0.946300 -1.325529 -1.317807 -1.051895 -1.371837 -1.120878 -1.290153 -1.132642 -1.106899 -0.951717 -1.053646 -1.097485 -0.993622 -1.071263 -1.003207 -1.060272 -0.945896 -1.081059 -1.483716 -1.639907 -1.778137 -1.743444 -1.658571 -1.670091 -1.528567 -1.360096 -1.348333 -1.247859 -1.311556 -1.223970 -1.139654 -1.236625 -1.220851 -1.388255 -1.244178 -1.146154 -1.093360 -0.984612 -1.125281 -1.104519 -0.927790 -0.740832 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/perlin_2.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/perlin_2.txt deleted file mode 100644 index 3b2079e9c1..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/perlin_2.txt +++ /dev/null @@ -1,100 +0,0 @@ -0.589059 -1.385024 -1.470957 -1.269762 -1.385446 -1.269712 -1.185030 -0.928904 -1.267172 -1.166521 -1.066362 -0.920673 -0.935076 -0.856454 -0.686814 -0.963540 -1.061552 -0.865491 -0.832564 -0.701943 -0.682610 -0.652618 -0.673153 -0.918331 -1.059042 -1.011999 -1.187784 -1.118172 -1.114871 -1.228534 -1.494326 -1.606674 -1.632721 -1.444440 -1.252203 -1.060226 -1.062564 -0.853991 -0.986832 -1.019786 -0.873746 -0.880802 -0.776611 -0.774251 -0.722629 -0.883309 -1.050254 -1.174258 -1.297810 -1.114437 -1.159611 -1.318001 -1.403207 -1.646177 -1.449942 -1.486702 -1.457905 -1.533516 -1.428289 -1.727821 -1.680758 -1.474617 -1.865750 -1.677722 -1.883250 -1.706351 -1.600958 -1.284972 -1.251889 -1.160717 -0.896049 -0.956541 -0.931596 -0.986854 -0.827023 -0.746164 -0.892252 -0.854372 -0.839080 -0.758932 -0.672252 -0.720025 -0.641433 -0.544152 -0.592160 -0.514846 -0.561344 -0.448302 -0.363627 -0.498299 -0.565455 -0.877873 -0.948297 -1.101386 -1.281993 -1.282064 -1.434546 -1.307456 -1.034463 -0.911412 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/perlin_3.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/perlin_3.txt deleted file mode 100644 index 520a51e79f..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/perlin_3.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.223092 -0.466707 -0.368349 -0.089874 -0.161719 -0.078999 -0.102578 --0.083603 -0.294051 -0.272732 -0.356278 -0.364104 -0.487348 -0.418455 -0.251441 -0.560986 -0.639218 -0.548377 -0.673267 -0.795272 -1.035669 -1.103795 -1.163568 -1.290674 -1.312494 -1.153418 -1.131051 -0.931183 -0.893717 -1.009827 -1.233752 -1.298835 -1.311961 -1.246482 -1.246256 -1.189188 -1.267197 -1.045907 -1.277045 -1.527899 -1.478772 -1.552988 -1.498229 -1.461283 -1.353050 -1.383894 -1.339477 -1.273635 -1.328624 -1.094269 -0.983792 -0.875603 -0.709414 -0.737601 -0.363175 -0.332673 -0.289505 -0.369777 -0.251481 -0.516427 -0.412752 -0.087499 -0.381547 -0.117950 -0.265638 -0.168071 -0.246383 -0.146412 -0.284670 -0.328228 -0.191186 -0.346995 -0.364771 -0.471056 -0.346459 -0.360055 -0.725820 -0.855841 -0.986781 -0.993643 -0.906214 -1.014289 -1.065209 -1.102837 -1.226516 -1.188260 -1.281279 -1.209360 -1.148376 -1.268678 -1.268572 -1.402798 -1.258439 -1.134246 -1.074161 -1.006970 -1.145082 -1.147652 -0.986590 -0.828954 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/perlin_fail.status b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/perlin_fail.status deleted file mode 100644 index 6ac0122a28..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/perlin_fail.status +++ /dev/null @@ -1 +0,0 @@ -Did nothing! \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/perlin_params.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/perlin_params.txt deleted file mode 100644 index 4455122772..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-7/iter-0/perlin_params.txt +++ /dev/null @@ -1,7 +0,0 @@ -SCALE:0.100905 -OFFSET:0.749785 -PERSISTENCE:0.960394 -OCTAVES:27.0099 -PRIME_1:40.6138 -PRIME_2:61.0175 -PRIME_3:87.8034 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/OK b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/OK deleted file mode 100644 index 9590cb949c..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/OK +++ /dev/null @@ -1 +0,0 @@ -All jobs complete \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/aggregated.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/aggregated.txt deleted file mode 100644 index 244709c651..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/aggregated.txt +++ /dev/null @@ -1,4 +0,0 @@ -PERLIN_3 -0.917785 -PERLIN_2 -0.105634 -PERLIN_1 -1.276058 -STATE Negative \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/aggregator.stderr b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/aggregator.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/aggregator.stdout b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/aggregator.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/parameters.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/parameters.txt deleted file mode 100644 index 59ba741905..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/parameters.txt +++ /dev/null @@ -1,7 +0,0 @@ -PERLIN_PARAM:SCALE 0.494279 -PERLIN_PARAM:OFFSET -0.526799 -PERLIN_PARAM:PERSISTENCE 0.0911083 -PERLIN_PARAM:OCTAVES 43.0492 -PERLIN_PARAM:PRIME_1 123.299 -PERLIN_PARAM:PRIME_2 42.4258 -PERLIN_PARAM:PRIME_3 14.0702 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/perlin.stderr b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/perlin.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/perlin.stdout b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/perlin.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/perlin_1.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/perlin_1.txt deleted file mode 100644 index 6aa944dccf..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/perlin_1.txt +++ /dev/null @@ -1,100 +0,0 @@ --1.276058 --1.289017 --1.314341 --1.306601 --1.296437 --1.293440 --1.259407 --1.266510 --1.294486 --1.261902 --1.202479 --1.080475 --0.954164 --0.885534 --0.858941 --0.894787 --0.919912 --0.916939 --0.886507 --0.799550 --0.721154 --0.650200 --0.537956 --0.483812 --0.489635 --0.525394 --0.546662 --0.527208 --0.534832 --0.533549 --0.538252 --0.584050 --0.611137 --0.630059 --0.650202 --0.616093 --0.568181 --0.463276 --0.334508 --0.259597 --0.221372 --0.259230 --0.279580 --0.244302 --0.207325 --0.170186 --0.177288 --0.240439 --0.278604 --0.325685 --0.411518 --0.447688 --0.438482 --0.430901 --0.426508 --0.473419 --0.523455 --0.492174 --0.429854 --0.320462 --0.242691 --0.226471 --0.221185 --0.262628 --0.292571 --0.326766 --0.377534 --0.383441 --0.373359 --0.364832 --0.330290 --0.341756 --0.378785 --0.325450 --0.201339 --0.014930 -0.131198 -0.218084 -0.307262 -0.331535 -0.323047 -0.275638 -0.204499 -0.189781 -0.216423 -0.234694 -0.244237 -0.196780 -0.140343 -0.139795 -0.132064 -0.149348 -0.135500 -0.067575 --0.002818 --0.038351 --0.033175 --0.039802 --0.104931 --0.282153 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/perlin_2.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/perlin_2.txt deleted file mode 100644 index 9527f5ea7a..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/perlin_2.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.105634 --0.100522 --0.094477 --0.166631 --0.242055 --0.267233 --0.351269 --0.418058 --0.423433 --0.455156 --0.503687 --0.535205 --0.602964 --0.629293 --0.605334 --0.598246 --0.588567 --0.648452 --0.705977 --0.761218 --0.784663 --0.690549 --0.595504 --0.441816 --0.322998 --0.240974 --0.082616 -0.026633 -0.111952 -0.206176 -0.291269 -0.362596 -0.390792 -0.289982 -0.127689 -0.000994 --0.086106 --0.090324 --0.148248 --0.241375 --0.259151 --0.279786 --0.291397 --0.328535 --0.389958 --0.377995 --0.280737 --0.158372 --0.106091 --0.142807 --0.139820 --0.078912 --0.035823 -0.057418 -0.107112 -0.097244 -0.109350 -0.077772 -0.052136 -0.081830 -0.120261 -0.196251 -0.272728 -0.294216 -0.300526 -0.246943 -0.116525 --0.050187 --0.175115 --0.301600 --0.427862 --0.456478 --0.450396 --0.398868 --0.320212 --0.349825 --0.460267 --0.567451 --0.631795 --0.652977 --0.663271 --0.674428 --0.682635 --0.626163 --0.539750 --0.498320 --0.505975 --0.578888 --0.635684 --0.598530 --0.523332 --0.361034 --0.160381 -0.022807 -0.185816 -0.259100 -0.276090 -0.163135 -0.001742 --0.111572 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/perlin_3.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/perlin_3.txt deleted file mode 100644 index cd80bec7c2..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/perlin_3.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.917785 --1.018838 --1.197085 --1.346518 --1.465782 --1.457947 --1.433721 --1.430564 --1.396554 --1.348945 --1.213771 --1.091774 --1.050692 --1.067291 --1.040706 --1.000801 --1.010901 --0.965566 --0.865274 --0.667889 --0.431604 --0.239372 --0.105089 --0.069473 --0.069545 --0.099554 --0.139350 --0.160356 --0.109202 --0.012531 -0.030695 -0.054757 -0.070031 -0.092023 -0.121743 -0.129957 -0.118527 -0.101591 -0.141964 -0.266738 -0.345876 -0.392401 -0.430221 -0.358497 -0.240463 -0.122590 -0.008486 --0.058995 --0.075277 --0.162975 --0.315639 --0.521310 --0.729615 --0.851158 --0.979655 --1.056785 --1.059049 --1.085967 --1.124672 --1.129564 --1.147745 --1.190867 --1.211475 --1.265556 --1.317086 --1.291337 --1.238050 --1.188747 --1.142334 --1.134089 --1.132725 --1.066024 --1.017221 --0.914666 --0.800777 --0.735933 --0.626698 --0.565983 --0.484094 --0.418266 --0.429310 --0.380164 --0.258859 --0.067478 -0.094606 -0.175094 -0.213959 -0.182170 -0.149065 -0.171849 -0.179785 -0.163891 -0.149761 -0.055666 --0.022016 --0.015994 --0.013374 -0.003331 --0.046131 --0.194030 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/perlin_fail.status b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/perlin_fail.status deleted file mode 100644 index 6ac0122a28..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/perlin_fail.status +++ /dev/null @@ -1 +0,0 @@ -Did nothing! \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/perlin_params.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/perlin_params.txt deleted file mode 100644 index 219b62155c..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/perlin_params.txt +++ /dev/null @@ -1,7 +0,0 @@ -SCALE:0.494279 -OFFSET:-0.526799 -PERSISTENCE:0.0911083 -OCTAVES:43.0492 -PRIME_1:123.299 -PRIME_2:42.4258 -PRIME_3:14.0702 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/realization.ok b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/realization.ok deleted file mode 100644 index a0aba9318a..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-8/iter-0/realization.ok +++ /dev/null @@ -1 +0,0 @@ -OK \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/OK b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/OK deleted file mode 100644 index 9590cb949c..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/OK +++ /dev/null @@ -1 +0,0 @@ -All jobs complete \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/aggregated.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/aggregated.txt deleted file mode 100644 index 48b8531624..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/aggregated.txt +++ /dev/null @@ -1,4 +0,0 @@ -PERLIN_3 0.220371 -PERLIN_2 1.032522 -PERLIN_1 -0.137903 -STATE Positive \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/aggregator.stderr b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/aggregator.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/aggregator.stdout b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/aggregator.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/parameters.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/parameters.txt deleted file mode 100644 index 2e4f0f7b04..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/parameters.txt +++ /dev/null @@ -1,7 +0,0 @@ -PERLIN_PARAM:SCALE 0.971949 -PERLIN_PARAM:OFFSET 0.568165 -PERLIN_PARAM:PERSISTENCE 0.332226 -PERLIN_PARAM:OCTAVES 8.48231 -PERLIN_PARAM:PRIME_1 106.04 -PERLIN_PARAM:PRIME_2 17.4819 -PERLIN_PARAM:PRIME_3 56.9629 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/perlin.stderr b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/perlin.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/perlin.stdout b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/perlin.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/perlin_1.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/perlin_1.txt deleted file mode 100644 index 36798a3f53..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/perlin_1.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.137903 --0.157851 --0.192276 --0.201670 --0.192839 --0.193214 --0.209423 --0.243628 --0.261796 --0.213269 --0.207591 --0.203993 --0.142490 --0.122206 --0.157129 --0.193732 --0.206432 --0.177612 --0.114381 --0.050740 --0.070342 --0.154469 --0.151716 --0.137877 --0.155888 --0.199095 --0.226091 --0.254674 --0.326284 --0.337833 --0.312344 --0.317023 --0.346853 --0.332528 --0.238504 --0.042655 -0.146262 -0.376535 -0.617211 -0.752626 -0.797129 -0.714055 -0.660213 -0.707589 -0.786058 -0.902157 -0.982988 -0.972517 -0.950945 -0.917937 -0.833802 -0.834170 -0.874761 -0.874663 -0.835114 -0.714452 -0.615202 -0.641686 -0.698232 -0.833272 -0.978281 -1.070483 -1.118218 -1.061277 -1.031902 -0.998036 -0.965574 -1.010296 -1.079127 -1.148032 -1.260956 -1.285149 -1.247059 -1.290888 -1.424147 -1.629905 -1.764537 -1.819917 -1.898802 -1.893787 -1.855403 -1.728917 -1.536779 -1.375375 -1.281240 -1.209446 -1.131790 -1.009449 -0.933443 -0.938227 -0.970148 -1.049769 -1.076923 -1.035402 -0.981504 -0.949433 -0.958861 -0.977078 -0.958006 -0.802606 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/perlin_2.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/perlin_2.txt deleted file mode 100644 index ba557199f4..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/perlin_2.txt +++ /dev/null @@ -1,100 +0,0 @@ -1.032522 -1.030645 -1.027589 -0.938300 -0.861544 -0.832993 -0.698715 -0.604825 -0.609257 -0.593477 -0.491201 -0.341277 -0.208709 -0.134035 -0.096478 -0.102808 -0.124913 -0.090875 -0.066149 --0.012408 --0.133850 --0.194818 --0.209263 --0.095881 -0.010749 -0.085326 -0.237955 -0.299167 -0.320499 -0.401893 -0.517178 -0.629623 -0.655076 -0.587512 -0.539387 -0.574432 -0.628337 -0.749487 -0.803470 -0.770847 -0.759350 -0.693500 -0.648396 -0.623356 -0.603426 -0.694348 -0.879540 -1.054584 -1.123458 -1.100816 -1.105500 -1.202947 -1.277420 -1.362982 -1.368734 -1.285116 -1.248007 -1.211633 -1.180222 -1.235564 -1.341232 -1.493206 -1.612131 -1.618121 -1.625000 -1.571745 -1.459633 -1.343551 -1.277370 -1.211264 -1.163383 -1.170426 -1.175448 -1.217470 -1.305274 -1.295011 -1.173072 -1.034382 -0.959745 -0.909275 -0.869084 -0.778851 -0.649645 -0.559430 -0.525067 -0.476432 -0.381578 -0.233781 -0.157416 -0.199901 -0.314752 -0.539386 -0.781042 -0.990634 -1.170137 -1.246885 -1.268126 -1.180015 -1.064679 -0.973186 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/perlin_3.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/perlin_3.txt deleted file mode 100644 index 2bb0cef781..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/perlin_3.txt +++ /dev/null @@ -1,100 +0,0 @@ -0.220371 -0.112328 --0.075019 --0.241588 --0.362184 --0.357721 --0.383737 --0.407682 --0.363864 --0.300312 --0.218883 --0.215292 --0.239019 --0.303964 --0.338894 --0.299746 --0.297421 --0.226239 --0.093147 -0.080922 -0.219209 -0.256359 -0.281152 -0.276463 -0.264202 -0.226745 -0.181221 -0.112178 -0.099345 -0.183186 -0.256603 -0.321784 -0.334316 -0.389554 -0.533441 -0.703395 -0.832970 -0.941402 -1.093683 -1.278960 -1.364377 -1.365686 -1.370013 -1.310389 -1.233846 -1.194933 -1.168762 -1.153961 -1.154271 -1.080648 -0.929681 -0.760549 -0.583628 -0.454406 -0.281967 -0.131086 -0.079608 -0.047894 -0.003413 -0.024170 -0.073226 -0.106088 -0.127928 -0.058349 -0.007387 -0.033465 -0.105058 -0.204991 -0.310151 -0.378775 -0.458521 -0.560881 -0.608623 -0.701672 -0.824709 -0.908902 -1.006640 -1.035850 -1.107446 -1.143986 -1.103046 -1.073115 -1.073421 -1.118115 -1.159422 -1.149846 -1.101513 -0.994839 -0.942165 -0.970280 -1.017869 -1.064312 -1.091185 -1.023493 -0.962306 -0.971791 -0.978662 -1.020211 -1.016806 -0.890728 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/perlin_fail.status b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/perlin_fail.status deleted file mode 100644 index 6ac0122a28..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/perlin_fail.status +++ /dev/null @@ -1 +0,0 @@ -Did nothing! \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/perlin_params.txt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/perlin_params.txt deleted file mode 100644 index c3e63c5f53..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/perlin_params.txt +++ /dev/null @@ -1,7 +0,0 @@ -SCALE:0.971949 -OFFSET:0.568165 -PERSISTENCE:0.332226 -OCTAVES:8.48231 -PRIME_1:106.04 -PRIME_2:17.4819 -PRIME_3:56.9629 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/realization.ok b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/realization.ok deleted file mode 100644 index a0aba9318a..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/Run/realisation-9/iter-0/realization.ok +++ /dev/null @@ -1 +0,0 @@ -OK \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/current_case b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/current_case deleted file mode 100644 index 331d858ce9..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/current_case +++ /dev/null @@ -1 +0,0 @@ -default \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/0001/files/PERLIN_active b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/0001/files/PERLIN_active deleted file mode 100644 index c72400474a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/0001/files/PERLIN_active and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/0002/files/PERLIN_active b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/0002/files/PERLIN_active deleted file mode 100644 index c72400474a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/0002/files/PERLIN_active and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/0003/files/PERLIN_active b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/0003/files/PERLIN_active deleted file mode 100644 index c72400474a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/0003/files/PERLIN_active and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/FORECAST.data_0 deleted file mode 100644 index efbe7f58b3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/FORECAST.index deleted file mode 100644 index b0e9ebe688..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/PARAMETER.data_0 deleted file mode 100644 index a9c2968ca3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/PARAMETER.index deleted file mode 100644 index d16822022a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_0/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/FORECAST.data_0 deleted file mode 100644 index de1d02fa33..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/FORECAST.index deleted file mode 100644 index fb519c3d53..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/PARAMETER.data_0 deleted file mode 100644 index 5e8b2f1b17..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/PARAMETER.index deleted file mode 100644 index 34f7beab32..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_1/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/PARAMETER.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_10/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/PARAMETER.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_11/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/PARAMETER.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_12/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/PARAMETER.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_13/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/PARAMETER.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_14/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/PARAMETER.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_15/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/PARAMETER.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_16/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/PARAMETER.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_17/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/PARAMETER.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_18/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/PARAMETER.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_19/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/PARAMETER.data_0 deleted file mode 100644 index b7b2db9ef2..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/PARAMETER.index deleted file mode 100644 index 6453ec00ca..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_2/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/PARAMETER.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_20/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/PARAMETER.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_21/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/PARAMETER.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_22/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/PARAMETER.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_23/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/PARAMETER.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_24/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/PARAMETER.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_25/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/PARAMETER.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_26/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/PARAMETER.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_27/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/PARAMETER.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_28/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/PARAMETER.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_29/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/PARAMETER.data_0 deleted file mode 100644 index 199393d8ef..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/PARAMETER.index deleted file mode 100644 index cd8301dcf3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_3/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/PARAMETER.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_30/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/PARAMETER.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_31/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/FORECAST.data_0 deleted file mode 100644 index 8b3a153a8a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/FORECAST.index deleted file mode 100644 index b5a589b271..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/PARAMETER.data_0 deleted file mode 100644 index f02909a32a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/PARAMETER.index deleted file mode 100644 index 8ebbf01df8..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_4/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/PARAMETER.data_0 deleted file mode 100644 index b5cb1eae3a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/PARAMETER.index deleted file mode 100644 index 46988dc345..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_5/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/FORECAST.data_0 deleted file mode 100644 index 80f2a9aafd..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/FORECAST.index deleted file mode 100644 index 10ceee2c80..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/PARAMETER.data_0 deleted file mode 100644 index d6b1ac3e58..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/PARAMETER.index deleted file mode 100644 index a3ec21810e..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_6/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/FORECAST.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/PARAMETER.data_0 deleted file mode 100644 index 57a1b2511a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/PARAMETER.index deleted file mode 100644 index 51cada30a8..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_7/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/FORECAST.data_0 deleted file mode 100644 index 24edf52b05..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/FORECAST.index deleted file mode 100644 index bf076ad1aa..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/PARAMETER.data_0 deleted file mode 100644 index 703bfe7edb..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/PARAMETER.index deleted file mode 100644 index 21f092b0c6..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_8/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/ANALYZED.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/FORECAST.data_0 deleted file mode 100644 index 83c5711b3d..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/FORECAST.index deleted file mode 100644 index fd35646b63..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/PARAMETER.data_0 deleted file mode 100644 index c78a769777..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/PARAMETER.index deleted file mode 100644 index a8013e439c..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/STATIC.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Ensemble/mod_9/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Index/INDEX.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Index/INDEX.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Index/INDEX.index b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Index/INDEX.index deleted file mode 100644 index 05ba4b90c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Index/INDEX.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Index/INDEX.mnt b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Index/INDEX.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/Index/INDEX.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/ert_fstab b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/ert_fstab deleted file mode 100644 index a5d67ad3a3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/ert_fstab and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/files/case_config b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/files/case_config deleted file mode 100644 index 593f4708db..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/files/case_config and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/files/custom_kw_config_set b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/files/custom_kw_config_set deleted file mode 100644 index b51c81a5bb..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/files/custom_kw_config_set and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/files/state-map b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/files/state-map deleted file mode 100644 index c37c4be56f..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/files/state-map and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/files/summary-key-set b/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/files/summary-key-set deleted file mode 100644 index 593f4708db..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/fail_storage/ertensemble/default/files/summary-key-set and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/jobs/AGGREGATOR b/ThirdParty/Ert/test-data/local/custom_kw/jobs/AGGREGATOR deleted file mode 100644 index f9571d60f9..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/jobs/AGGREGATOR +++ /dev/null @@ -1,4 +0,0 @@ -STDOUT aggregator.stdout -STDERR aggregator.stderr - -EXECUTABLE aggregator.py \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/jobs/PERLIN b/ThirdParty/Ert/test-data/local/custom_kw/jobs/PERLIN deleted file mode 100644 index fbf5c2ac87..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/jobs/PERLIN +++ /dev/null @@ -1,4 +0,0 @@ -STDOUT perlin.stdout -STDERR perlin.stderr - -EXECUTABLE perlin.py \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/jobs/PERLIN_FAIL b/ThirdParty/Ert/test-data/local/custom_kw/jobs/PERLIN_FAIL deleted file mode 100644 index f6da4542e8..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/jobs/PERLIN_FAIL +++ /dev/null @@ -1,3 +0,0 @@ -EXECUTABLE perlin_fail.py -TARGET_FILE perlin_fail.status -ARGLIST \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/jobs/REALIZATION_FAIL b/ThirdParty/Ert/test-data/local/custom_kw/jobs/REALIZATION_FAIL deleted file mode 100644 index 533677cf99..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/jobs/REALIZATION_FAIL +++ /dev/null @@ -1,3 +0,0 @@ -EXECUTABLE realization_fail.py -TARGET_FILE realization.ok -ARGLIST \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/jobs/aggregator.py b/ThirdParty/Ert/test-data/local/custom_kw/jobs/aggregator.py deleted file mode 100644 index 72561296f9..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/jobs/aggregator.py +++ /dev/null @@ -1,26 +0,0 @@ -#! /usr/bin/env python - -if __name__ == "__main__": - files = {"PERLIN_1": "perlin_1.txt", - "PERLIN_2": "perlin_2.txt", - "PERLIN_3": "perlin_3.txt"} - - with open("aggregated.txt", "w") as output_file: - sum_of_sum = 0.0 - for key in files: - sum = 0.0 - with open(files[key], "r") as input_file: - sum += float(input_file.readline()) - sum_of_sum += sum - output_file.write("%s %f\n" % (key, sum)) - - if sum_of_sum < 0: - state = "Negative" - elif abs(sum_of_sum) < 0.00000001: - state = "Zero" - else: - state = "Positive" - - output_file.write("STATE %s" % state) - - diff --git a/ThirdParty/Ert/test-data/local/custom_kw/jobs/perlin.py b/ThirdParty/Ert/test-data/local/custom_kw/jobs/perlin.py deleted file mode 100644 index 7cccc0d1f6..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/jobs/perlin.py +++ /dev/null @@ -1,176 +0,0 @@ -#! /usr/bin/env python -import math -import random - -PRIME_INDEX_1 = [49193,11887,23819,93983,28283,87179,74933,82561,29741,98453,72719,48193,66883,95071,12841,89603, - 49261,52529,57697,70321,54617,49363,41233,39883,35393,33149,37493,42989,58073,62507,99829,41999, - 44087,31907,10627,29231,57559,36809,17123,50593,38449,71317,38149,60637,10607,48677,23189,83701, - 78853,35617,28477,86117,46901,80819,89491,36097,54881,94781,20707,20011,69457,14593,49253,35257, - 14753,44851,10289,36097,62017,82723,10037,77551,89513,70429,30269,30703,77711,69313,20021,31657, - 33851,27749,85667,42793,47599,92789,97771,84551,61637,68659,93263,62201,42131,78823,17747,31183, - 89611,91009,76673,47051,94099,96757,90977,65141,46051,11093,19073,44633,27967,25171,41221,96223, - 88997,74941,49559,11909,11593,97369,55733,35869,55849,87931,81131,99023,76561,78977,48857,74717] - -PRIME_INDEX_2 = [7360349,1287757,3764759,5276833,2735671,7351777,7705903,2034551, - 2427493,3883639,4260859,6814097,3226933,2648249,4458793,8015303, - 2323733,7991233,5560879,9826913,3634811,3746299,1051543,2954789, - 7874983,9380681,4577789,4306829,6714599,8395733,2718493,1429867, - 5675147,6104573,3118727,2657243,9750043,1853377,9441353,7247969, - 7669553,5334157,9376649,9518137,9368297,3912679,3230237,7291939, - 1361677,1034167,4998089,1178239,5160677,6130199,8056553,8527361, - 4261093,8640553,5553391,6024797,7275019,7245019,7661483,5120033, - 4388117,5941147,7682189,9303467,7165777,1509163,5223929,9696487, - 8012383,6254273,1400731,9958177,7733573,1498993,1553467,4791257, - 4524521,7048633,3630821,7931179,2341457,6432269,9597703,4338011, - 6665059,7911653,8384317,2230531,7904621,1633559,9096533,6873301, - 2717821,5897977,3608543,2248243,3174599,8634233,4028963,6435001, - 6611399,3250469,4046353,1429943,8552111,1970261,1045043,9552523, - 6993799,6141467,5723479,9578867,9233299,7224641,3165023,4583899, - 3905861,1633993,5013137,5092613,2197163,7732213,6559019,2538499] - -PRIME_INDEX_3 = [1368916889,3054015583,6066123341,8673964289,9002483141,7187080993,5319345529,6961795349, - 1653814157,3416288497,6454122317,2480898239,3878100221,5956454227,9767569853,5981528503, - 4962084931,4489312199,3013312061,9818685161,4061204663,1816202221,7567463471,9839749459, - 3993070667,5872839331,9256050443,4854483611,4876755749,3823459247,6244209637,4199084081, - 6053970359,1093521049,7385602219,7289318273,9333908789,9701161343,8139801689,5013046681, - 4094649187,2372669671,9010267157,4298511787,7575340187,9252205969,5923706413,7112626819, - 6531270523,8379490583,4521945149,6804302789,6984132251,9173492033,1657527653,1532523367, - 3132088123,5910371431,7551540169,1643193353,6127000571,2637510193,7904761379,2954227033, - 7344843263,8077648457,9397237879,6775740173,1950824101,1152859999,2990299673,8197021109, - 2184824123,4309539167,1742841137,9113517421,4752058561,5594292329,9565022153,8519292151, - 6553311239,5204301593,8405487593,1987918357,3175759277,5659428917,6611421781,8765753053, - 3781235599,5651365571,8399394649,3867050417,3258145379,9836441977,2499690049,2742615479, - 7720787857,6135275183,9580731373,1860360379,2879750459,4302251633,8019104719,3889658671, - 7242891343,2516043583,8081336113,7718332591,4940550151,2216825899,7387662781,5562762407, - 2486416781,9111045257,1197705721,6649659239,6110149477,4548595937,3169540631,8993669479, - 6444114251,3098519969,1609592407,5803463207,8385117647,3056488453,1046337653,8165632597] - -class PerlinNoise(object): - - def __init__(self, persistence=0.5, number_of_octaves=4, prime_1=15731, prime_2=789221, prime_3=1376312589): - self.persistence = persistence - self.number_of_octaves = number_of_octaves - self.prime_1 = prime_1 - self.prime_2 = prime_2 - self.prime_3 = prime_3 - - - def cosineInterpolation(self, a, b, x): - ft = x * 3.1415927 - f = (1.0 - math.cos(ft)) * 0.5 - return a * (1 - f) + b * f - - - def noise(self, x): - x = (x << 13) ^ x - return 1.0 - ((x * (x * x + self.prime_1 + self.prime_2) + self.prime_3) & 0x7fffffff) / 1073741824.0 - - - def smoothedNoise(self, x): - return self.noise(x) / 2.0 + self.noise(x - 1) / 4.0 + self.noise(x + 1) / 4.0 - - - def interpolatedNoise(self, x): - int_x = int(x) - frac_x = x - int_x - - v1 = self.smoothedNoise(int_x) - v2 = self.smoothedNoise(int_x + 1) - - return self.cosineInterpolation(v1, v2, frac_x) - - - def perlinNoise1D(self, x): - total = 0.0 - - for octave in range(self.number_of_octaves - 1): - frequency = math.pow(2, octave) - amplitude = math.pow(self.persistence, octave) - - total += self.interpolatedNoise(x * frequency) * amplitude - - return total - - - @staticmethod - def isPrime(num): - for j in range(2, int(math.sqrt(num) + 1)): - if (num % j) == 0: - return False - return True - - @staticmethod - def createPrime(digits=10): - done = False - low = int("1" + "0" * (digits - 1)) - high = int("9" * digits) - - if low == 1: - low = 2 - - while not done: - num = random.randint(low, high) - if PerlinNoise.isPrime(num): - return num - - -def createObservationFile(report_step, observation, count, std=0.2): - with open("perlin_obs_%d.txt" % report_step, "w") as f: - - for index in range(count): - x = index / 8.0 - f.write("%f %f\n" % (observation.perlinNoise1D(x), std)) - - - -def readParameters(filename): - params = {} - with open(filename, "r") as f: - for line in f: - key, value = line.split(":", 1) - params[key] = float(value) - - return params - - -if __name__ == "__main__": - count = 100 - - # primes = [] - # for p in range(128): - # primes.append(str(PerlinNoise.createPrime(7))) - # - # print(",".join(primes)) - - observations = {1: PerlinNoise(prime_1=15731, prime_2=789221, prime_3=1376312589), - 2: PerlinNoise(prime_1=8831, prime_2=1300237, prime_3=32416187567), - 3: PerlinNoise(prime_1=10657, prime_2=105767, prime_3=2902956923)} - - for report_step in observations: - observation = observations[report_step] - # createObservationFile(report_step, observation, count) - - params = readParameters("perlin_params.txt") - - scale = params["SCALE"] - offset = params["OFFSET"] - octaves = int(round(params["OCTAVES"])) - persistence = params["PERSISTENCE"] - p1_index = int(round(params["PRIME_1"])) - p2_index = int(round(params["PRIME_2"])) - p3_index = int(round(params["PRIME_3"])) - - with open("perlin_%d.txt" % report_step, "w") as f: - P1 = PRIME_INDEX_1[p1_index] - P2 = PRIME_INDEX_2[p2_index] - P3 = PRIME_INDEX_3[p3_index] - # P1 = PerlinNoise.createPrime() - # P2 = PerlinNoise.createPrime() - # P3 = PerlinNoise.createPrime() - report_step_noise = PerlinNoise(persistence=persistence, number_of_octaves=octaves, prime_1=P1, prime_2=P2, prime_3=P3) - - for i in range(count): - x = i / 8.0 - obs = observation.perlinNoise1D(x) - noise = report_step_noise.perlinNoise1D(x) - f.write("%f\n" % (obs + offset + noise * scale)) diff --git a/ThirdParty/Ert/test-data/local/custom_kw/jobs/perlin_fail.py b/ThirdParty/Ert/test-data/local/custom_kw/jobs/perlin_fail.py deleted file mode 100644 index fed238f4b2..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/jobs/perlin_fail.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -iens = None -if len(sys.argv) > 1: - iens = int(sys.argv[1]) - -numbers = [1, 2, 3, 4, 5, 6] -if iens in numbers: - random_report_step = (numbers.index(iens) % 3) + 1 - os.remove("perlin_%d.txt" % random_report_step) - - with open("perlin_fail.status", "w") as f: - f.write("Deleted report step: %d" % random_report_step) - -else: - with open("perlin_fail.status", "w") as f: - f.write("Did nothing!") - - diff --git a/ThirdParty/Ert/test-data/local/custom_kw/jobs/realization_fail.py b/ThirdParty/Ert/test-data/local/custom_kw/jobs/realization_fail.py deleted file mode 100644 index 33a16ae523..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/jobs/realization_fail.py +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env python -import sys - -iens = None -if len(sys.argv) > 1: - iens = int(sys.argv[1]) - -if iens is None or not iens in [2, 3, 5, 7]: - with open("realization.ok", "w") as f: - f.write("OK") - diff --git a/ThirdParty/Ert/test-data/local/custom_kw/mini_config b/ThirdParty/Ert/test-data/local/custom_kw/mini_config deleted file mode 100644 index 630ad828c4..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/mini_config +++ /dev/null @@ -1,40 +0,0 @@ -QUEUE_SYSTEM LOCAL -DBASE_TYPE BLOCK_FS - -JOBNAME MINI_%d - -DEFINE storage - -NUM_REALIZATIONS 10 - -STORE_SEED RandomSeed -LOAD_SEED RandomSeed - -RUNPATH /Run/realisation-%d/iter-%d -ENSPATH /ertensemble - -INSTALL_JOB AGGREGATOR jobs/AGGREGATOR -INSTALL_JOB PERLIN jobs/PERLIN - -FORWARD_MODEL PERLIN -FORWARD_MODEL AGGREGATOR - -TIME_MAP time_map -GEN_KW PERLIN_PARAM Template/PERLIN_TEMPLATE perlin_params.txt Parameters/PERLIN_PARAMS.txt -GEN_DATA PERLIN INPUT_FORMAT:ASCII RESULT_FILE:perlin_%d.txt REPORT_STEPS:1,2,3 - -UPDATE_RESULTS TRUE - -ENKF_MERGE_OBSERVATIONS TRUE - -LOG_LEVEL 3 -LOG_FILE log/log.txt -UPDATE_LOG_PATH log/UP - -DATA_KW CSV_OUTPUT_PATH custom_output.csv - -OBS_CONFIG Observations/observations - -CUSTOM_KW AGGREGATED aggregated.txt aggregated_out.txt - -GRID Refcase/CASE.EGRID \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/mini_fail_config b/ThirdParty/Ert/test-data/local/custom_kw/mini_fail_config deleted file mode 100644 index 2c45bc5eed..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/mini_fail_config +++ /dev/null @@ -1,43 +0,0 @@ -QUEUE_SYSTEM LOCAL -DBASE_TYPE BLOCK_FS - -JOBNAME MINI_FAIL_%d - -DEFINE fail_storage - -NUM_REALIZATIONS 10 -MAX_SUBMIT 1 - -STORE_SEED RandomSeed -LOAD_SEED RandomSeed - -RUNPATH /Run/realisation-%d/iter-%d -ENSPATH /ertensemble - -INSTALL_JOB AGGREGATOR jobs/AGGREGATOR -INSTALL_JOB PERLIN jobs/PERLIN -INSTALL_JOB PERLIN_FAIL jobs/PERLIN_FAIL -INSTALL_JOB REALIZATION_FAIL jobs/REALIZATION_FAIL - -FORWARD_MODEL PERLIN -FORWARD_MODEL AGGREGATOR -FORWARD_MODEL PERLIN_FAIL -FORWARD_MODEL REALIZATION_FAIL - -TIME_MAP time_map -GEN_KW PERLIN_PARAM Template/PERLIN_TEMPLATE perlin_params.txt Parameters/PERLIN_PARAMS.txt -GEN_DATA PERLIN INPUT_FORMAT:ASCII RESULT_FILE:perlin_%d.txt REPORT_STEPS:1,2,3 - -UPDATE_RESULTS TRUE - -ENKF_MERGE_OBSERVATIONS TRUE - -LOG_LEVEL 3 -LOG_FILE log/fail_log.txt -UPDATE_LOG_PATH log/UP - -DATA_KW CSV_OUTPUT_PATH custom_output.csv - -OBS_CONFIG Observations/observations - -CUSTOM_KW AGGREGATED aggregated.txt aggregated_out.txt diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/OK b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/OK deleted file mode 100644 index 9590cb949c..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/OK +++ /dev/null @@ -1 +0,0 @@ -All jobs complete \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/aggregated.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/aggregated.txt deleted file mode 100644 index de8aedc562..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/aggregated.txt +++ /dev/null @@ -1,4 +0,0 @@ -PERLIN_3 0.190479 -PERLIN_2 1.002630 -PERLIN_1 -0.167794 -STATE Positive \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/aggregator.stderr b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/aggregator.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/aggregator.stdout b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/aggregator.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/parameters.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/parameters.txt deleted file mode 100644 index 142dbecaab..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/parameters.txt +++ /dev/null @@ -1,7 +0,0 @@ -PERLIN_PARAM:SCALE 0.249225 -PERLIN_PARAM:OFFSET 0.185709 -PERLIN_PARAM:PERSISTENCE 0.936132 -PERLIN_PARAM:OCTAVES 22.4008 -PERLIN_PARAM:PRIME_1 70.2373 -PERLIN_PARAM:PRIME_2 73.2881 -PERLIN_PARAM:PRIME_3 73.2557 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/perlin.stderr b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/perlin.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/perlin.stdout b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/perlin.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/perlin_1.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/perlin_1.txt deleted file mode 100644 index fec0fd107e..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/perlin_1.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.167794 --0.533157 --0.582564 --0.581187 --0.544394 --0.617389 --0.471483 --0.570636 --0.513164 --0.094431 --0.489078 --0.363713 --0.116233 -0.104267 --0.185805 --0.200709 --0.150918 --0.384297 -0.293484 -0.122875 --0.157933 -0.066183 -0.043334 -0.083941 -0.237257 -0.510188 -0.247252 -0.238908 --0.087547 --0.330292 --0.126747 --0.035823 --0.234230 -0.031125 --0.470002 -0.277528 -0.333005 -0.208194 -0.329248 -0.183316 -0.030305 -0.292607 -0.207885 --0.055542 -0.267287 -0.489294 -0.351695 -0.473816 -0.486845 -0.161185 -0.750709 -0.334430 -0.487895 --0.083531 -0.631333 -0.189402 -0.293179 -0.416287 -0.071861 -0.343657 -0.530727 -0.295893 -0.707495 -0.705177 -0.364062 --0.028729 -0.627459 -0.665644 -0.110239 -0.074890 -0.898952 -0.507702 -0.793900 -0.376955 -0.740932 -0.768612 -1.072116 -0.641052 -0.951385 -1.114482 -0.779685 -1.030575 -0.960609 -0.819774 -0.728183 -0.880717 -0.390042 -0.616292 -0.534190 -0.332035 -0.597337 -0.310784 -0.480825 -0.510514 -0.527712 -0.106739 -0.459289 -0.091994 -0.167754 -0.291767 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/perlin_2.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/perlin_2.txt deleted file mode 100644 index a4c8ae2281..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/perlin_2.txt +++ /dev/null @@ -1,100 +0,0 @@ -1.002630 -0.655338 -0.637300 -0.558783 -0.509989 -0.408818 -0.436655 -0.277816 -0.357889 -0.712315 -0.209713 -0.181557 -0.234966 -0.360507 -0.067803 -0.095832 -0.180428 --0.115810 -0.474014 -0.161206 --0.221441 -0.025834 --0.014213 -0.125937 -0.403895 -0.794609 -0.711298 -0.792749 -0.559236 -0.409434 -0.702774 -0.910823 -0.767699 -0.951166 -0.307889 -0.894615 -0.815080 -0.581146 -0.515508 -0.201538 --0.007474 -0.272051 -0.196068 --0.139775 -0.084654 -0.281485 -0.248246 -0.555883 -0.659358 -0.344063 -1.022407 -0.703206 -0.890554 -0.404788 -1.164953 -0.760065 -0.925984 -0.986234 -0.553851 -0.745948 -0.893678 -0.718616 -1.201408 -1.262021 -0.957160 -0.544980 -1.121517 -0.998898 -0.308482 -0.138122 -0.801380 -0.392979 -0.722289 -0.303537 -0.622059 -0.433718 -0.480651 --0.144483 -0.012328 -0.129970 --0.206634 -0.080509 -0.073475 -0.003830 --0.027990 -0.147703 --0.360170 --0.159376 --0.241837 --0.406290 --0.058059 --0.199599 -0.184944 -0.465746 -0.716346 -0.404191 -0.768554 -0.294930 -0.274427 -0.462347 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/perlin_3.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/perlin_3.txt deleted file mode 100644 index 13a10a9e5d..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/perlin_3.txt +++ /dev/null @@ -1,100 +0,0 @@ -0.190479 --0.262978 --0.465308 --0.621105 --0.713738 --0.781896 --0.645797 --0.734690 --0.615233 --0.181474 --0.500371 --0.375013 --0.212762 --0.077491 --0.367569 --0.306723 --0.241907 --0.432924 -0.314717 -0.254536 -0.131618 -0.477011 -0.476202 -0.498281 -0.657347 -0.936028 -0.654565 -0.605760 -0.338082 -0.190727 -0.442199 -0.602984 -0.446939 -0.753207 -0.301943 -1.023577 -1.019714 -0.773061 -0.805721 -0.709651 -0.597553 -0.944238 -0.917685 -0.547257 -0.715075 -0.782070 -0.537469 -0.655260 -0.690172 -0.323895 -0.846589 -0.260808 -0.196762 --0.503788 -0.078186 --0.393964 --0.242415 --0.177505 --0.622958 --0.465445 --0.374328 --0.668502 --0.282796 --0.297752 --0.660453 --0.993300 --0.233057 --0.139662 --0.658737 --0.694367 -0.096517 --0.216566 -0.155464 --0.212261 -0.141495 -0.047609 -0.314219 --0.143014 -0.160029 -0.364682 -0.027328 -0.374773 -0.497251 -0.562515 -0.606365 -0.821117 -0.359765 -0.601682 -0.542912 -0.364089 -0.645058 -0.325327 -0.495087 -0.498606 -0.508514 -0.129097 -0.479090 -0.135126 -0.226554 -0.379889 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/perlin_params.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/perlin_params.txt deleted file mode 100644 index 99b2ec3ff6..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-0/iter-0/perlin_params.txt +++ /dev/null @@ -1,7 +0,0 @@ -SCALE:0.249225 -OFFSET:0.185709 -PERSISTENCE:0.936132 -OCTAVES:22.4008 -PRIME_1:70.2373 -PRIME_2:73.2881 -PRIME_3:73.2557 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/OK b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/OK deleted file mode 100644 index 9590cb949c..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/OK +++ /dev/null @@ -1 +0,0 @@ -All jobs complete \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/aggregated.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/aggregated.txt deleted file mode 100644 index c42ebc2573..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/aggregated.txt +++ /dev/null @@ -1,4 +0,0 @@ -PERLIN_3 -0.584204 -PERLIN_2 0.227947 -PERLIN_1 -0.942477 -STATE Negative \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/aggregator.stderr b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/aggregator.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/aggregator.stdout b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/aggregator.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/parameters.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/parameters.txt deleted file mode 100644 index d931876083..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/parameters.txt +++ /dev/null @@ -1,7 +0,0 @@ -PERLIN_PARAM:SCALE 0.24275 -PERLIN_PARAM:OFFSET -0.29096 -PERLIN_PARAM:PERSISTENCE 0.860518 -PERLIN_PARAM:OCTAVES 14.7858 -PERLIN_PARAM:PRIME_1 11.8217 -PERLIN_PARAM:PRIME_2 48.9187 -PERLIN_PARAM:PRIME_3 89.5122 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/perlin.stderr b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/perlin.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/perlin.stdout b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/perlin.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/perlin_1.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/perlin_1.txt deleted file mode 100644 index 20e4b55793..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/perlin_1.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.942477 --0.727071 --0.723611 --0.754719 --0.671417 --0.731608 --0.692600 --0.493644 --0.676412 --0.745697 --0.692443 --0.578927 --0.488710 --0.308417 --0.198633 --0.292521 --0.451160 --0.454948 --0.565726 --0.325299 --0.477437 --0.393874 --0.366932 --0.181596 --0.382861 --0.214575 --0.343829 --0.226514 --0.320776 --0.308425 --0.487588 --0.395820 --0.742008 --0.527934 --0.774032 --0.603036 --0.837021 --0.456712 --0.387980 --0.390885 --0.477976 --0.396114 --0.440335 --0.294043 --0.320108 --0.019041 --0.013591 --0.252420 --0.275822 --0.164093 --0.136841 --0.069380 --0.145731 --0.021543 -0.105226 -0.109063 -0.010749 -0.174611 -0.235996 -0.229778 -0.234829 -0.303725 -0.413435 -0.191701 --0.016101 -0.137470 -0.169930 --0.099989 --0.129193 --0.110471 -0.042198 --0.048338 --0.349474 --0.098213 -0.162561 -0.313852 -0.400474 -0.538012 -0.475773 -0.571507 -0.342028 -0.299233 -0.316542 -0.349001 -0.187998 -0.323078 -0.237231 -0.120016 --0.054434 --0.139747 -0.160315 --0.006853 -0.136442 -0.070848 --0.273561 --0.222518 --0.288468 --0.046234 --0.175744 --0.151171 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/perlin_2.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/perlin_2.txt deleted file mode 100644 index 296be5b8cd..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/perlin_2.txt +++ /dev/null @@ -1,100 +0,0 @@ -0.227947 -0.461424 -0.496254 -0.385250 -0.382965 -0.294599 -0.215538 -0.354808 -0.194641 -0.061050 -0.006348 --0.033658 --0.137511 --0.052176 -0.054974 -0.004020 --0.119814 --0.186461 --0.385196 --0.286967 --0.540945 --0.434223 --0.424480 --0.139600 --0.216224 -0.069846 -0.120217 -0.327327 -0.326008 -0.431300 -0.341933 -0.550826 -0.259922 -0.392107 -0.003858 -0.014051 --0.354946 --0.083760 --0.201720 --0.372664 --0.515754 --0.416670 --0.452153 --0.378276 --0.502741 --0.226850 --0.117039 --0.170353 --0.103309 -0.018785 -0.134857 -0.299396 -0.256928 -0.466775 -0.638846 -0.679726 -0.643554 -0.744558 -0.717986 -0.632070 -0.597780 -0.726447 -0.907347 -0.748545 -0.576996 -0.711178 -0.663988 -0.233265 -0.069050 --0.047240 --0.055375 --0.163060 --0.421085 --0.171631 -0.043688 --0.021042 --0.190991 --0.247524 --0.463284 --0.413005 --0.644291 --0.650833 --0.570592 --0.466943 --0.568175 --0.409936 --0.512981 --0.655652 --0.830461 --0.878072 --0.495081 --0.517236 --0.159439 -0.026080 --0.084928 -0.074934 -0.020797 -0.156703 --0.069071 -0.019410 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/perlin_3.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/perlin_3.txt deleted file mode 100644 index d43e140291..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/perlin_3.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.584204 --0.456892 --0.606354 --0.794637 --0.840762 --0.896115 --0.866915 --0.657698 --0.778480 --0.832740 --0.703736 --0.590227 --0.585239 --0.490175 --0.380398 --0.398535 --0.542149 --0.503575 --0.544492 --0.193638 --0.187886 -0.016954 -0.065935 -0.232744 -0.037229 -0.211265 -0.063484 -0.140338 -0.104854 -0.212594 -0.081358 -0.242987 --0.060839 -0.194148 --0.002088 -0.143014 --0.150313 -0.108155 -0.088492 -0.135449 -0.089272 -0.255517 -0.269465 -0.308757 -0.127679 -0.273734 -0.172184 --0.070976 --0.072495 --0.001383 --0.040962 --0.143002 --0.436864 --0.441800 --0.447921 --0.474303 --0.524845 --0.419181 --0.458823 --0.579324 --0.670226 --0.660671 --0.576856 --0.811227 --1.040616 --0.827102 --0.690587 --0.905295 --0.898169 --0.879729 --0.760237 --0.772606 --0.987910 --0.687429 --0.436876 --0.407151 --0.357423 --0.246055 --0.315583 --0.178294 --0.410329 --0.356569 --0.146816 -0.091742 -0.066180 -0.263478 -0.206954 -0.105406 --0.045712 --0.107693 -0.208035 -0.007690 -0.150704 -0.058939 --0.292759 --0.200161 --0.268667 --0.003101 --0.116944 --0.063049 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/perlin_params.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/perlin_params.txt deleted file mode 100644 index fb78e8c3e9..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-1/iter-0/perlin_params.txt +++ /dev/null @@ -1,7 +0,0 @@ -SCALE:0.24275 -OFFSET:-0.29096 -PERSISTENCE:0.860518 -OCTAVES:14.7858 -PRIME_1:11.8217 -PRIME_2:48.9187 -PRIME_3:89.5122 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/OK b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/OK deleted file mode 100644 index 9590cb949c..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/OK +++ /dev/null @@ -1 +0,0 @@ -All jobs complete \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/aggregated.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/aggregated.txt deleted file mode 100644 index 39c71d12aa..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/aggregated.txt +++ /dev/null @@ -1,4 +0,0 @@ -PERLIN_3 -0.294383 -PERLIN_2 0.517768 -PERLIN_1 -0.652656 -STATE Negative \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/aggregator.stderr b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/aggregator.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/aggregator.stdout b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/aggregator.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/parameters.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/parameters.txt deleted file mode 100644 index 0850de9c61..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/parameters.txt +++ /dev/null @@ -1,7 +0,0 @@ -PERLIN_PARAM:SCALE 0.187883 -PERLIN_PARAM:OFFSET -0.512383 -PERLIN_PARAM:PERSISTENCE 0.850056 -PERLIN_PARAM:OCTAVES 39.9199 -PERLIN_PARAM:PRIME_1 76.7337 -PERLIN_PARAM:PRIME_2 54.1086 -PERLIN_PARAM:PRIME_3 16.0042 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/perlin.stderr b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/perlin.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/perlin.stdout b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/perlin.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/perlin_1.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/perlin_1.txt deleted file mode 100644 index 122d4089ea..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/perlin_1.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.652656 --0.856575 --0.907574 --0.921559 --0.907052 --0.798535 --0.892001 --0.898300 --0.932647 --0.887530 --0.745258 --0.774438 --0.680597 --0.707552 --0.616984 --0.784930 --0.705796 --0.672207 --0.677662 --0.517634 --0.460960 --0.512998 --0.485822 --0.377630 --0.469687 --0.463782 --0.644529 --0.631042 --0.610238 --0.645129 --0.841183 --0.813056 --0.824549 --0.985474 --0.818724 --1.021755 --0.749654 --0.643111 --0.382287 --0.319701 --0.240893 --0.293783 --0.356379 --0.315861 --0.243741 --0.061641 --0.016073 --0.078540 --0.166452 --0.204278 --0.206156 --0.339674 --0.324650 --0.218586 --0.220018 --0.365619 --0.213129 --0.161173 --0.144854 --0.088350 --0.193806 --0.111286 --0.100984 --0.235155 --0.165413 --0.278588 --0.429381 --0.254946 --0.240835 --0.227267 --0.524615 --0.423858 --0.341032 --0.369948 --0.180422 -0.176827 -0.282667 -0.455645 -0.421888 -0.461117 -0.478802 -0.408361 -0.301001 -0.266791 -0.167743 -0.066362 -0.101881 -0.183729 --0.037895 -0.191528 -0.077918 -0.193353 -0.109073 -0.001759 --0.061599 --0.001108 --0.164077 --0.253534 --0.200586 --0.275259 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/perlin_2.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/perlin_2.txt deleted file mode 100644 index 6e35f0db00..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/perlin_2.txt +++ /dev/null @@ -1,100 +0,0 @@ -0.517768 -0.331920 -0.312291 -0.218411 -0.147331 -0.227672 -0.016137 --0.049848 --0.061594 --0.080783 --0.046467 --0.229168 --0.329398 --0.451311 --0.363377 --0.488389 --0.374451 --0.403720 --0.497132 --0.479302 --0.524469 --0.553347 --0.543370 --0.335634 --0.303049 --0.179361 --0.180483 --0.077200 -0.036546 -0.094596 --0.011662 -0.133590 -0.177380 --0.065433 --0.040833 --0.404669 --0.267578 --0.270158 --0.196027 --0.301479 --0.278672 --0.314339 --0.368196 --0.400094 --0.426374 --0.269450 --0.119522 -0.003527 -0.006061 --0.021400 -0.065542 -0.029102 -0.078009 -0.269733 -0.313603 -0.205045 -0.419677 -0.408773 -0.337136 -0.313942 -0.169145 -0.311436 -0.392928 -0.321689 -0.427685 -0.295121 -0.064678 -0.078309 --0.042592 --0.164036 --0.622187 --0.538581 --0.412642 --0.443366 --0.299295 --0.158067 --0.308798 --0.329891 --0.517169 --0.523395 --0.507517 --0.541705 --0.586134 --0.549153 --0.588430 --0.666651 --0.648330 --0.591939 --0.813922 --0.546797 --0.577477 --0.317029 --0.186808 --0.043009 -0.127034 -0.296344 -0.145188 --0.050597 --0.093913 --0.104679 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/perlin_3.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/perlin_3.txt deleted file mode 100644 index 1e03faf793..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/perlin_3.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.294383 --0.586396 --0.790317 --0.961476 --1.076396 --0.963042 --1.066316 --1.062354 --1.034715 --0.974573 --0.756551 --0.785737 --0.777126 --0.889310 --0.798749 --0.890944 --0.796785 --0.720834 --0.656429 --0.385973 --0.171410 --0.102170 --0.052955 -0.036709 --0.049597 --0.037941 --0.237216 --0.264190 --0.184608 --0.124110 --0.272236 --0.174249 --0.143380 --0.263391 --0.046779 --0.275706 --0.062945 --0.078243 -0.094185 -0.206634 -0.326354 -0.357848 -0.353421 -0.286938 -0.204047 -0.231135 -0.169701 -0.102903 -0.036875 --0.041568 --0.110276 --0.413296 --0.615784 --0.638843 --0.773164 --0.948985 --0.748723 --0.754966 --0.839672 --0.897452 --1.098861 --1.075682 --1.091275 --1.238084 --1.189928 --1.243159 --1.289897 --1.060251 --1.009811 --0.996525 --1.327050 --1.148126 --0.979468 --0.959163 --0.779859 --0.544176 --0.475229 --0.328422 --0.369468 --0.288684 --0.273556 --0.247441 --0.162358 -0.009532 -0.045926 -0.006763 -0.071604 -0.169119 --0.029173 -0.223582 -0.125639 -0.207896 -0.123334 --0.010150 --0.080797 -0.021249 --0.144276 --0.210401 --0.141786 --0.187137 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/perlin_params.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/perlin_params.txt deleted file mode 100644 index a069d36ab8..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-2/iter-0/perlin_params.txt +++ /dev/null @@ -1,7 +0,0 @@ -SCALE:0.187883 -OFFSET:-0.512383 -PERSISTENCE:0.850056 -OCTAVES:39.9199 -PRIME_1:76.7337 -PRIME_2:54.1086 -PRIME_3:16.0042 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/OK b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/OK deleted file mode 100644 index 9590cb949c..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/OK +++ /dev/null @@ -1 +0,0 @@ -All jobs complete \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/aggregated.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/aggregated.txt deleted file mode 100644 index b986f1b481..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/aggregated.txt +++ /dev/null @@ -1,4 +0,0 @@ -PERLIN_3 -0.871387 -PERLIN_2 -0.059236 -PERLIN_1 -1.229660 -STATE Negative \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/aggregator.stderr b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/aggregator.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/aggregator.stdout b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/aggregator.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/parameters.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/parameters.txt deleted file mode 100644 index a7472afccf..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/parameters.txt +++ /dev/null @@ -1,7 +0,0 @@ -PERLIN_PARAM:SCALE 0.542054 -PERLIN_PARAM:OFFSET -0.936072 -PERLIN_PARAM:PERSISTENCE 0.66513 -PERLIN_PARAM:OCTAVES 59.6891 -PERLIN_PARAM:PRIME_1 58.3958 -PERLIN_PARAM:PRIME_2 51.6271 -PERLIN_PARAM:PRIME_3 37.3286 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/perlin.stderr b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/perlin.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/perlin.stdout b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/perlin.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/perlin_1.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/perlin_1.txt deleted file mode 100644 index 1f0aabd193..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/perlin_1.txt +++ /dev/null @@ -1,100 +0,0 @@ --1.229660 --1.403213 --1.494882 --1.481222 --1.545058 --1.605346 --1.466829 --1.460689 --1.589462 --1.462504 --1.586371 --1.419953 --1.184666 --1.064367 --1.081730 --1.130531 --1.307146 --1.330892 --1.147255 --1.230522 --1.290812 --1.243312 --1.053225 --0.837831 --0.815416 --0.794856 --0.780118 --0.867346 --0.868595 --0.844661 --0.949974 --1.135521 --1.278698 --1.237066 --1.353473 --1.274754 --1.024540 --1.062374 --1.018191 --0.989482 --1.082235 --1.083477 --1.111900 --0.884140 --0.804378 --0.649785 --0.414051 --0.453314 --0.426393 --0.376335 --0.433952 --0.369796 --0.319725 --0.318209 --0.380495 --0.274543 --0.410077 --0.265464 --0.276032 --0.293185 --0.259478 --0.307654 --0.469020 --0.606702 --0.727993 --0.657698 --0.738949 --0.779068 --0.929409 --0.925120 --0.888902 --0.818882 --0.691387 --0.806321 --0.774223 --0.725947 --0.616177 --0.575377 --0.546778 --0.619225 --0.739783 --0.805058 --0.854443 --1.003113 --0.978222 --0.724971 --0.804323 --0.920953 --0.973738 --0.936418 --0.905518 --0.717744 --0.616881 --0.785126 --0.782606 --0.680625 --0.739233 --0.708171 --0.640854 --0.813288 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/perlin_2.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/perlin_2.txt deleted file mode 100644 index 58ac16bef2..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/perlin_2.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.059236 --0.214718 --0.275017 --0.341253 --0.490676 --0.579139 --0.558691 --0.612236 --0.718408 --0.655757 --0.887580 --0.874683 --0.833466 --0.808127 --0.828123 --0.833990 --0.975800 --1.062405 --0.966725 --1.192190 --1.354320 --1.283661 --1.110772 --0.795835 --0.648779 --0.510435 --0.316072 --0.313505 --0.221812 --0.104936 --0.120453 --0.188875 --0.276769 --0.317026 --0.575582 --0.657667 --0.542465 --0.689421 --0.831931 --0.971260 --1.120014 --1.104033 --1.123718 --0.968373 --0.987011 --0.857594 --0.517499 --0.371248 --0.253880 --0.193457 --0.162254 --0.001019 -0.082934 -0.170110 -0.153126 -0.296120 -0.222728 -0.304483 -0.205958 -0.109107 -0.103474 -0.115069 -0.024892 --0.049858 --0.134896 --0.083989 --0.244890 --0.445814 --0.731166 --0.861888 --0.986474 --0.933604 --0.762998 --0.879739 --0.893096 --1.060842 --1.207642 --1.360912 --1.485835 --1.603737 --1.726102 --1.755124 --1.741578 --1.819057 --1.734395 --1.457985 --1.554534 --1.696621 --1.749765 --1.674743 --1.560913 --1.228126 --0.912762 --0.829894 --0.593973 --0.383174 --0.429968 --0.505235 --0.534181 --0.642708 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/perlin_3.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/perlin_3.txt deleted file mode 100644 index 3e28703234..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/perlin_3.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.871387 --1.133034 --1.377625 --1.521140 --1.714403 --1.769853 --1.641143 --1.624743 --1.691530 --1.549547 --1.597664 --1.431252 --1.281194 --1.246125 --1.263495 --1.236545 --1.398135 --1.379519 --1.126021 --1.098861 --1.001261 --0.832484 --0.620357 --0.423492 --0.395326 --0.369015 --0.372806 --0.500494 --0.442966 --0.323643 --0.381027 --0.496714 --0.597530 --0.514984 --0.581528 --0.528705 --0.337832 --0.497506 --0.541718 --0.463147 --0.514987 --0.431846 --0.402100 --0.281341 --0.356591 --0.357009 --0.228277 --0.271871 --0.223066 --0.213625 --0.338073 --0.443417 --0.610858 --0.738466 --0.933641 --0.857909 --0.945672 --0.859256 --0.970850 --1.102287 --1.164532 --1.272049 --1.459311 --1.609631 --1.752508 --1.622269 --1.599465 --1.584374 --1.698385 --1.694377 --1.691337 --1.543150 --1.329823 --1.395537 --1.373660 --1.446951 --1.374073 --1.359444 --1.338134 --1.369026 --1.492140 --1.460860 --1.317801 --1.260372 --1.100040 --0.784571 --0.834600 --0.935563 --0.965016 --0.904364 --0.857797 --0.703201 --0.602620 --0.797035 --0.801804 --0.658268 --0.719432 --0.665039 --0.582054 --0.725166 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/perlin_params.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/perlin_params.txt deleted file mode 100644 index f51328cc14..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-3/iter-0/perlin_params.txt +++ /dev/null @@ -1,7 +0,0 @@ -SCALE:0.542054 -OFFSET:-0.936072 -PERSISTENCE:0.66513 -OCTAVES:59.6891 -PRIME_1:58.3958 -PRIME_2:51.6271 -PRIME_3:37.3286 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/OK b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/OK deleted file mode 100644 index 9590cb949c..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/OK +++ /dev/null @@ -1 +0,0 @@ -All jobs complete \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/aggregated.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/aggregated.txt deleted file mode 100644 index 35536135e9..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/aggregated.txt +++ /dev/null @@ -1,4 +0,0 @@ -PERLIN_3 0.585905 -PERLIN_2 1.398056 -PERLIN_1 0.227632 -STATE Positive \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/aggregator.stderr b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/aggregator.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/aggregator.stdout b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/aggregator.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/parameters.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/parameters.txt deleted file mode 100644 index 43486a893a..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/parameters.txt +++ /dev/null @@ -1,7 +0,0 @@ -PERLIN_PARAM:SCALE 0.434448 -PERLIN_PARAM:OFFSET 0.831105 -PERLIN_PARAM:PERSISTENCE 0.630867 -PERLIN_PARAM:OCTAVES 8.00407 -PERLIN_PARAM:PRIME_1 85.4235 -PERLIN_PARAM:PRIME_2 21.3039 -PERLIN_PARAM:PRIME_3 104.858 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/perlin.stderr b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/perlin.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/perlin.stdout b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/perlin.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/perlin_1.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/perlin_1.txt deleted file mode 100644 index 7ea431597a..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/perlin_1.txt +++ /dev/null @@ -1,100 +0,0 @@ -0.227632 -0.182419 -0.144134 -0.139476 -0.177808 -0.254702 -0.194959 -0.196247 -0.200894 -0.254938 -0.395923 -0.419362 -0.480212 -0.525709 -0.561013 -0.552975 -0.519655 -0.497365 -0.577627 -0.735132 -0.817150 -0.830304 -0.810482 -0.786231 -0.748806 -0.689116 -0.617421 -0.687358 -0.594608 -0.517947 -0.548341 -0.523440 -0.419855 -0.405486 -0.372455 -0.434415 -0.562727 -0.733549 -0.970895 -1.160018 -1.169762 -1.111676 -1.111566 -1.106991 -1.105426 -1.213650 -1.175046 -1.097622 -1.076414 -1.020738 -0.967021 -0.935108 -0.968248 -1.090303 -1.177846 -1.141175 -1.035475 -1.007184 -1.064612 -1.220228 -1.325731 -1.365550 -1.388177 -1.239332 -1.196752 -1.250964 -1.102255 -1.021732 -1.011481 -1.046014 -1.021100 -1.037203 -0.983562 -1.047336 -1.209270 -1.527246 -1.651524 -1.778722 -1.953437 -1.897861 -1.919134 -1.832772 -1.722330 -1.690519 -1.644280 -1.609237 -1.499923 -1.390382 -1.225122 -1.258604 -1.269723 -1.248156 -1.156463 -1.014345 -0.967288 -0.922071 -0.964769 -0.867821 -0.886340 -0.661428 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/perlin_2.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/perlin_2.txt deleted file mode 100644 index b747326d4e..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/perlin_2.txt +++ /dev/null @@ -1,100 +0,0 @@ -1.398056 -1.370914 -1.363998 -1.279446 -1.232190 -1.280908 -1.103097 -1.044700 -1.071948 -1.061684 -1.094715 -0.964632 -0.831411 -0.781949 -0.814620 -0.849516 -0.851001 -0.765851 -0.758157 -0.773463 -0.753641 -0.789955 -0.752934 -0.828227 -0.915443 -0.973537 -1.081467 -1.241200 -1.241392 -1.257672 -1.377862 -1.470086 -1.421784 -1.325527 -1.150346 -1.051501 -1.044802 -1.106502 -1.157155 -1.178239 -1.131983 -1.091121 -1.099748 -1.022758 -0.922794 -1.005841 -1.071597 -1.179689 -1.248927 -1.203617 -1.238719 -1.303884 -1.370907 -1.578622 -1.711466 -1.711839 -1.668280 -1.577131 -1.546602 -1.622520 -1.688682 -1.788272 -1.882089 -1.796176 -1.789849 -1.824672 -1.596314 -1.354986 -1.209724 -1.109246 -0.923528 -0.922481 -0.911951 -0.973918 -1.090397 -1.192352 -1.060059 -0.993187 -1.014380 -0.913349 -0.932815 -0.882706 -0.835195 -0.874574 -0.888107 -0.876224 -0.749712 -0.614713 -0.449095 -0.520278 -0.614327 -0.737773 -0.860582 -0.969577 -1.155922 -1.219523 -1.274034 -1.070757 -0.993013 -0.832009 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/perlin_3.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/perlin_3.txt deleted file mode 100644 index c5dd1d518a..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/perlin_3.txt +++ /dev/null @@ -1,100 +0,0 @@ -0.585905 -0.452598 -0.261390 -0.099559 -0.008463 -0.090195 -0.020645 -0.032193 -0.098826 -0.167894 -0.384631 -0.408063 -0.383683 -0.343951 -0.379248 -0.446961 -0.428666 -0.448737 -0.598860 -0.866793 -1.106700 -1.241132 -1.243349 -1.200570 -1.168896 -1.114956 -1.024733 -1.054210 -1.020238 -1.038965 -1.117287 -1.162247 -1.101024 -1.127568 -1.144400 -1.180464 -1.249435 -1.298417 -1.447368 -1.686352 -1.737009 -1.763308 -1.821366 -1.709790 -1.553214 -1.506426 -1.360820 -1.279066 -1.279741 -1.183449 -1.062901 -0.861486 -0.677115 -0.670046 -0.624699 -0.557809 -0.499881 -0.413392 -0.369794 -0.411126 -0.420676 -0.401154 -0.397886 -0.236404 -0.172236 -0.286392 -0.241739 -0.216426 -0.242506 -0.276757 -0.218665 -0.312935 -0.345126 -0.458120 -0.609833 -0.806243 -0.893627 -0.994656 -1.162081 -1.148060 -1.166777 -1.176970 -1.258971 -1.433259 -1.522462 -1.549638 -1.469646 -1.375772 -1.233844 -1.290657 -1.317444 -1.262699 -1.170724 -1.002436 -0.948090 -0.944428 -0.984570 -0.910954 -0.945140 -0.749551 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/perlin_params.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/perlin_params.txt deleted file mode 100644 index 324cbda2ee..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-4/iter-0/perlin_params.txt +++ /dev/null @@ -1,7 +0,0 @@ -SCALE:0.434448 -OFFSET:0.831105 -PERSISTENCE:0.630867 -OCTAVES:8.00407 -PRIME_1:85.4235 -PRIME_2:21.3039 -PRIME_3:104.858 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/OK b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/OK deleted file mode 100644 index 9590cb949c..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/OK +++ /dev/null @@ -1 +0,0 @@ -All jobs complete \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/aggregated.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/aggregated.txt deleted file mode 100644 index 72e58cbf64..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/aggregated.txt +++ /dev/null @@ -1,4 +0,0 @@ -PERLIN_3 0.638889 -PERLIN_2 1.451039 -PERLIN_1 0.280615 -STATE Positive \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/aggregator.stderr b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/aggregator.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/aggregator.stdout b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/aggregator.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/parameters.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/parameters.txt deleted file mode 100644 index 463f5c41d8..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/parameters.txt +++ /dev/null @@ -1,7 +0,0 @@ -PERLIN_PARAM:SCALE 0.72828 -PERLIN_PARAM:OFFSET 0.48251 -PERLIN_PARAM:PERSISTENCE 0.878696 -PERLIN_PARAM:OCTAVES 62.5026 -PERLIN_PARAM:PRIME_1 10.3564 -PERLIN_PARAM:PRIME_2 34.9666 -PERLIN_PARAM:PRIME_3 46.2883 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/perlin.stderr b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/perlin.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/perlin.stdout b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/perlin.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/perlin_1.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/perlin_1.txt deleted file mode 100644 index 11da497a09..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/perlin_1.txt +++ /dev/null @@ -1,100 +0,0 @@ -0.280615 -0.140016 -0.101814 --0.129046 -0.108540 -0.255758 --0.136433 -0.402995 -0.060006 -0.243033 -0.270699 -1.032076 --0.013904 --0.123877 -0.661223 -0.260982 -0.218027 -1.382060 -0.399264 -0.483361 -0.472825 --0.400746 -1.339330 -0.692467 -0.043042 -0.542935 --0.239154 -0.322095 -0.568886 --0.253825 -0.069002 -0.151587 --0.060719 -0.071557 -1.232762 -0.806173 -0.197592 -0.775339 -0.485706 --0.340968 -0.563185 --0.301442 --0.470657 -0.391865 -1.604934 -1.366571 -0.978296 -0.533236 -0.199409 -0.640021 -0.724001 -0.620437 --0.062286 -0.448127 -0.681424 -0.211811 -0.962468 -0.569284 -0.153403 -0.463251 -0.717336 -1.047732 -0.879313 -0.557671 -0.589243 -0.475895 -0.668305 -1.261389 -1.992548 -0.514705 -1.480108 -0.964709 -0.672593 -0.541782 -1.389203 -0.533862 -1.237538 -0.892042 -0.376384 -0.676731 -1.374955 -1.291646 -0.276911 -0.706050 -0.032507 -1.074094 -0.914922 -1.747032 -2.087744 -1.287205 -1.735100 -1.305039 -1.283753 -0.989592 -0.686460 -0.373096 -0.309114 -0.349820 -0.814016 -0.915557 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/perlin_2.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/perlin_2.txt deleted file mode 100644 index 1a12f1d5e3..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/perlin_2.txt +++ /dev/null @@ -1,100 +0,0 @@ -1.451039 -1.328511 -1.321678 -1.010924 -1.162923 -1.281965 -0.771705 -1.251448 -0.931060 -1.049780 -0.969490 -1.577345 -0.337295 -0.132363 -0.914830 -0.557523 -0.549373 -1.650547 -0.579795 -0.521693 -0.409316 --0.441095 -1.281782 -0.734463 -0.209679 -0.827356 -0.224891 -0.875937 -1.215669 -0.485900 -0.898524 -1.098233 -0.941210 -0.991598 -2.010653 -1.423259 -0.679667 -1.148292 -0.671966 --0.322746 -0.525407 --0.321998 --0.482474 -0.307632 -1.422302 -1.158762 -0.874847 -0.615302 -0.371922 -0.822899 -0.995699 -0.989214 -0.340374 -0.936446 -1.215045 -0.782475 -1.595273 -1.139231 -0.635393 -0.865543 -1.080287 -1.470455 -1.373225 -1.114515 -1.182340 -1.049604 -1.162364 -1.594643 -2.190791 -0.577937 -1.382536 -0.849987 -0.600982 -0.468364 -1.270330 -0.198968 -0.646073 -0.106506 --0.562673 --0.307781 -0.388636 -0.341580 --0.610223 --0.109894 --0.723666 -0.341080 -0.164710 -0.971363 -1.311717 -0.548880 -1.079704 -0.794657 -0.987872 -0.944824 -0.875093 -0.670548 -0.618379 -0.552756 -0.920689 -1.086138 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/perlin_3.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/perlin_3.txt deleted file mode 100644 index 4b5a132c2c..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/perlin_3.txt +++ /dev/null @@ -1,100 +0,0 @@ -0.638889 -0.410195 -0.219070 --0.168964 --0.060804 -0.091251 --0.310748 -0.238941 --0.042062 -0.155990 -0.259406 -1.020776 --0.110433 --0.305635 -0.479458 -0.154968 -0.127038 -1.333433 -0.420498 -0.615022 -0.762375 -0.010082 -1.772197 -1.106807 -0.463132 -0.968775 -0.168158 -0.688947 -0.994515 -0.267193 -0.637949 -0.790394 -0.620450 -0.793639 -2.004706 -1.552222 -0.884301 -1.340207 -0.962178 -0.185367 -1.130433 -0.350189 -0.239143 -0.994664 -2.052722 -1.659346 -1.164070 -0.714679 -0.402736 -0.802732 -0.819881 -0.546816 --0.353419 -0.027870 -0.128278 --0.371555 -0.426874 --0.024508 --0.541415 --0.345851 --0.187719 -0.083337 --0.110978 --0.445258 --0.435272 --0.488676 --0.192211 -0.456083 -1.223572 --0.254552 -0.677673 -0.240441 -0.034157 --0.047433 -0.789765 --0.187141 -0.479641 -0.107975 --0.414972 --0.073069 -0.622598 -0.635844 --0.186447 -0.448791 --0.089311 -1.014494 -0.884645 -1.732422 -2.096466 -1.319259 -1.782821 -1.319583 -1.298015 -0.977683 -0.667262 -0.395453 -0.328915 -0.392952 -0.872816 -1.003679 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/perlin_params.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/perlin_params.txt deleted file mode 100644 index 6ffe51857b..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-5/iter-0/perlin_params.txt +++ /dev/null @@ -1,7 +0,0 @@ -SCALE:0.72828 -OFFSET:0.48251 -PERSISTENCE:0.878696 -OCTAVES:62.5026 -PRIME_1:10.3564 -PRIME_2:34.9666 -PRIME_3:46.2883 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/OK b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/OK deleted file mode 100644 index 9590cb949c..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/OK +++ /dev/null @@ -1 +0,0 @@ -All jobs complete \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/aggregated.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/aggregated.txt deleted file mode 100644 index 07f12f2a08..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/aggregated.txt +++ /dev/null @@ -1,4 +0,0 @@ -PERLIN_3 0.870550 -PERLIN_2 1.682701 -PERLIN_1 0.512277 -STATE Positive \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/aggregator.stderr b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/aggregator.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/aggregator.stdout b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/aggregator.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/parameters.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/parameters.txt deleted file mode 100644 index 04dc1adb80..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/parameters.txt +++ /dev/null @@ -1,7 +0,0 @@ -PERLIN_PARAM:SCALE 0.105108 -PERLIN_PARAM:OFFSET 0.913379 -PERLIN_PARAM:PERSISTENCE 0.962764 -PERLIN_PARAM:OCTAVES 54.2875 -PERLIN_PARAM:PRIME_1 12.1353 -PERLIN_PARAM:PRIME_2 108.225 -PERLIN_PARAM:PRIME_3 58.2668 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/perlin.stderr b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/perlin.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/perlin.stdout b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/perlin.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/perlin_1.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/perlin_1.txt deleted file mode 100644 index 309c31a80b..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/perlin_1.txt +++ /dev/null @@ -1,100 +0,0 @@ -0.512277 -0.536404 -0.520619 -0.520234 -0.561383 -0.536841 -0.593527 -0.431159 -0.579716 -0.595432 -0.613877 -0.832759 -0.851509 -0.830369 -0.752398 -0.701988 -0.854139 -0.813144 -0.848016 -0.675839 -0.919173 -1.078956 -1.165071 -1.045397 -1.099168 -1.049976 -0.934854 -0.813458 -0.777245 -0.747191 -0.680688 -0.492784 -0.756629 -0.639112 -0.677362 -0.560299 -0.783620 -0.757035 -0.781494 -1.092201 -1.102767 -1.052654 -1.207713 -1.115009 -1.380213 -1.620005 -1.355587 -1.358326 -1.365758 -1.049275 -1.264629 -1.182026 -1.240226 -1.329804 -1.210895 -1.340758 -1.160254 -1.099240 -1.243394 -1.267952 -1.359115 -1.457122 -1.219766 -1.225781 -1.439935 -1.367284 -1.242810 -1.155161 -1.278395 -1.180081 -1.125988 -1.131542 -1.239492 -1.086901 -1.273243 -1.532824 -1.482385 -1.810195 -1.887451 -1.774089 -1.870171 -1.843973 -1.696110 -1.740468 -1.791604 -1.614504 -1.582554 -1.758357 -1.634232 -1.684106 -1.786180 -1.619646 -1.484936 -1.430948 -1.379634 -1.352505 -1.382218 -1.487943 -1.057155 -0.971585 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/perlin_2.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/perlin_2.txt deleted file mode 100644 index 463edcab27..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/perlin_2.txt +++ /dev/null @@ -1,100 +0,0 @@ -1.682701 -1.724900 -1.740484 -1.660204 -1.615765 -1.563048 -1.501665 -1.279611 -1.450770 -1.402179 -1.312668 -1.378029 -1.202709 -1.086610 -1.006006 -0.998528 -1.185484 -1.081631 -1.028546 -0.714171 -0.855664 -1.038607 -1.107524 -1.087393 -1.265806 -1.334397 -1.398900 -1.367299 -1.424028 -1.486916 -1.510209 -1.439430 -1.758558 -1.559152 -1.455253 -1.177386 -1.265695 -1.129987 -0.967754 -1.110422 -1.064988 -1.032099 -1.195895 -1.030776 -1.197580 -1.412196 -1.252139 -1.440393 -1.538272 -1.232153 -1.536327 -1.550802 -1.642885 -1.818122 -1.744516 -1.911422 -1.793059 -1.669187 -1.725384 -1.670243 -1.722066 -1.879845 -1.713679 -1.782625 -2.033032 -1.940992 -1.736869 -1.488416 -1.476638 -1.243313 -1.028416 -1.016820 -1.167881 -1.013483 -1.154370 -1.197929 -0.890921 -1.024660 -0.948394 -0.789577 -0.883852 -0.893907 -0.808975 -0.924524 -1.035431 -0.881490 -0.832342 -0.982689 -0.858205 -0.945780 -1.130784 -1.109264 -1.189055 -1.386180 -1.568267 -1.649957 -1.691483 -1.690880 -1.163828 -1.142166 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/perlin_3.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/perlin_3.txt deleted file mode 100644 index bb7c009032..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/perlin_3.txt +++ /dev/null @@ -1,100 +0,0 @@ -0.870550 -0.806583 -0.637876 -0.480317 -0.392038 -0.372334 -0.419213 -0.267105 -0.477648 -0.508389 -0.602584 -0.821460 -0.754981 -0.648612 -0.570634 -0.595973 -0.763150 -0.764517 -0.869249 -0.807500 -1.208723 -1.489784 -1.597939 -1.459736 -1.519258 -1.475816 -1.342167 -1.180310 -1.202874 -1.268209 -1.249634 -1.131591 -1.437798 -1.361194 -1.449307 -1.306349 -1.470329 -1.321902 -1.257966 -1.618535 -1.670015 -1.704286 -1.917513 -1.717808 -1.828000 -1.912781 -1.541362 -1.539769 -1.569085 -1.211985 -1.360508 -1.108404 -0.949092 -0.909547 -0.657749 -0.757392 -0.624659 -0.505448 -0.548575 -0.458850 -0.454060 -0.492727 -0.229476 -0.222852 -0.415420 -0.402712 -0.382294 -0.349856 -0.509419 -0.410824 -0.323553 -0.407274 -0.601056 -0.497685 -0.673805 -0.811821 -0.724489 -1.026129 -1.096095 -1.024289 -1.117814 -1.188171 -1.232752 -1.483209 -1.669786 -1.554904 -1.552277 -1.743747 -1.642953 -1.716159 -1.833900 -1.634190 -1.499198 -1.419039 -1.360436 -1.374862 -1.402018 -1.531076 -1.115955 -1.059708 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/perlin_params.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/perlin_params.txt deleted file mode 100644 index 29d18ec899..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-6/iter-0/perlin_params.txt +++ /dev/null @@ -1,7 +0,0 @@ -SCALE:0.105108 -OFFSET:0.913379 -PERSISTENCE:0.962764 -OCTAVES:54.2875 -PRIME_1:12.1353 -PRIME_2:108.225 -PRIME_3:58.2668 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/OK b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/OK deleted file mode 100644 index 9590cb949c..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/OK +++ /dev/null @@ -1 +0,0 @@ -All jobs complete \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/aggregated.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/aggregated.txt deleted file mode 100644 index 6b3b4204d7..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/aggregated.txt +++ /dev/null @@ -1,4 +0,0 @@ -PERLIN_3 -0.223092 -PERLIN_2 0.589059 -PERLIN_1 -0.581365 -STATE Negative \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/aggregator.stderr b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/aggregator.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/aggregator.stdout b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/aggregator.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/parameters.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/parameters.txt deleted file mode 100644 index 0fec4832fd..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/parameters.txt +++ /dev/null @@ -1,7 +0,0 @@ -PERLIN_PARAM:SCALE 0.100905 -PERLIN_PARAM:OFFSET 0.749785 -PERLIN_PARAM:PERSISTENCE 0.960394 -PERLIN_PARAM:OCTAVES 27.0099 -PERLIN_PARAM:PRIME_1 40.6138 -PERLIN_PARAM:PRIME_2 61.0175 -PERLIN_PARAM:PRIME_3 87.8034 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/perlin.stderr b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/perlin.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/perlin.stdout b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/perlin.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/perlin_1.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/perlin_1.txt deleted file mode 100644 index f4ab414309..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/perlin_1.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.581365 -0.196529 -0.251092 -0.129792 -0.331063 -0.243506 -0.276892 -0.080451 -0.396119 -0.359775 -0.367571 -0.375403 -0.583877 -0.600213 -0.433206 -0.667000 -0.730207 -0.597004 -0.652034 -0.663611 -0.746119 -0.692967 -0.730701 -0.876335 -0.892405 -0.727578 -0.723739 -0.564331 -0.468088 -0.488808 -0.664805 -0.660028 -0.630792 -0.524399 -0.474312 -0.443139 -0.580488 -0.481039 -0.800572 -1.001564 -0.911524 -0.901357 -0.788429 -0.858484 -0.905262 -1.091118 -1.153703 -1.092191 -1.125297 -0.931559 -0.887913 -0.949225 -1.000548 -1.157858 -0.916321 -0.916039 -0.825100 -0.963569 -0.946300 -1.325529 -1.317807 -1.051895 -1.371837 -1.120878 -1.290153 -1.132642 -1.106899 -0.951717 -1.053646 -1.097485 -0.993622 -1.071263 -1.003207 -1.060272 -0.945896 -1.081059 -1.483716 -1.639907 -1.778137 -1.743444 -1.658571 -1.670091 -1.528567 -1.360096 -1.348333 -1.247859 -1.311556 -1.223970 -1.139654 -1.236625 -1.220851 -1.388255 -1.244178 -1.146154 -1.093360 -0.984612 -1.125281 -1.104519 -0.927790 -0.740832 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/perlin_2.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/perlin_2.txt deleted file mode 100644 index 3b2079e9c1..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/perlin_2.txt +++ /dev/null @@ -1,100 +0,0 @@ -0.589059 -1.385024 -1.470957 -1.269762 -1.385446 -1.269712 -1.185030 -0.928904 -1.267172 -1.166521 -1.066362 -0.920673 -0.935076 -0.856454 -0.686814 -0.963540 -1.061552 -0.865491 -0.832564 -0.701943 -0.682610 -0.652618 -0.673153 -0.918331 -1.059042 -1.011999 -1.187784 -1.118172 -1.114871 -1.228534 -1.494326 -1.606674 -1.632721 -1.444440 -1.252203 -1.060226 -1.062564 -0.853991 -0.986832 -1.019786 -0.873746 -0.880802 -0.776611 -0.774251 -0.722629 -0.883309 -1.050254 -1.174258 -1.297810 -1.114437 -1.159611 -1.318001 -1.403207 -1.646177 -1.449942 -1.486702 -1.457905 -1.533516 -1.428289 -1.727821 -1.680758 -1.474617 -1.865750 -1.677722 -1.883250 -1.706351 -1.600958 -1.284972 -1.251889 -1.160717 -0.896049 -0.956541 -0.931596 -0.986854 -0.827023 -0.746164 -0.892252 -0.854372 -0.839080 -0.758932 -0.672252 -0.720025 -0.641433 -0.544152 -0.592160 -0.514846 -0.561344 -0.448302 -0.363627 -0.498299 -0.565455 -0.877873 -0.948297 -1.101386 -1.281993 -1.282064 -1.434546 -1.307456 -1.034463 -0.911412 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/perlin_3.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/perlin_3.txt deleted file mode 100644 index 520a51e79f..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/perlin_3.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.223092 -0.466707 -0.368349 -0.089874 -0.161719 -0.078999 -0.102578 --0.083603 -0.294051 -0.272732 -0.356278 -0.364104 -0.487348 -0.418455 -0.251441 -0.560986 -0.639218 -0.548377 -0.673267 -0.795272 -1.035669 -1.103795 -1.163568 -1.290674 -1.312494 -1.153418 -1.131051 -0.931183 -0.893717 -1.009827 -1.233752 -1.298835 -1.311961 -1.246482 -1.246256 -1.189188 -1.267197 -1.045907 -1.277045 -1.527899 -1.478772 -1.552988 -1.498229 -1.461283 -1.353050 -1.383894 -1.339477 -1.273635 -1.328624 -1.094269 -0.983792 -0.875603 -0.709414 -0.737601 -0.363175 -0.332673 -0.289505 -0.369777 -0.251481 -0.516427 -0.412752 -0.087499 -0.381547 -0.117950 -0.265638 -0.168071 -0.246383 -0.146412 -0.284670 -0.328228 -0.191186 -0.346995 -0.364771 -0.471056 -0.346459 -0.360055 -0.725820 -0.855841 -0.986781 -0.993643 -0.906214 -1.014289 -1.065209 -1.102837 -1.226516 -1.188260 -1.281279 -1.209360 -1.148376 -1.268678 -1.268572 -1.402798 -1.258439 -1.134246 -1.074161 -1.006970 -1.145082 -1.147652 -0.986590 -0.828954 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/perlin_params.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/perlin_params.txt deleted file mode 100644 index 4455122772..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-7/iter-0/perlin_params.txt +++ /dev/null @@ -1,7 +0,0 @@ -SCALE:0.100905 -OFFSET:0.749785 -PERSISTENCE:0.960394 -OCTAVES:27.0099 -PRIME_1:40.6138 -PRIME_2:61.0175 -PRIME_3:87.8034 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/OK b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/OK deleted file mode 100644 index 9590cb949c..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/OK +++ /dev/null @@ -1 +0,0 @@ -All jobs complete \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/STATUS b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/STATUS deleted file mode 100644 index bfebf7ba94..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/STATUS +++ /dev/null @@ -1,3 +0,0 @@ -Current host : lx-774616.local/x86_64 -PERLIN : 17:15:11 .... 17:15:12 -AGGREGATOR : 17:15:12 .... 17:15:12 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/aggregated.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/aggregated.txt deleted file mode 100644 index 244709c651..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/aggregated.txt +++ /dev/null @@ -1,4 +0,0 @@ -PERLIN_3 -0.917785 -PERLIN_2 -0.105634 -PERLIN_1 -1.276058 -STATE Negative \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/aggregator.stderr b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/aggregator.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/aggregator.stdout b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/aggregator.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/jobs.py b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/jobs.py deleted file mode 100644 index 72a3af4e0a..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/jobs.py +++ /dev/null @@ -1,28 +0,0 @@ -jobList = [ {"name" : "PERLIN", - "executable" : "/Users/jpb/projects/ert/test-data/local/custom_kw/jobs/perlin.py", - "target_file" : None, - "error_file" : None, - "start_file" : None, - "stdout" : "perlin.stdout", - "stderr" : "perlin.stderr", - "stdin" : None, - "argList" : [], - "environment" : None, - "license_path" : None, - "max_running_minutes" : None, - "max_running" : None, -}, - {"name" : "AGGREGATOR", - "executable" : "/Users/jpb/projects/ert/test-data/local/custom_kw/jobs/aggregator.py", - "target_file" : None, - "error_file" : None, - "start_file" : None, - "stdout" : "aggregator.stdout", - "stderr" : "aggregator.stderr", - "stdin" : None, - "argList" : [], - "environment" : None, - "license_path" : None, - "max_running_minutes" : None, - "max_running" : None, -}] diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/parameters.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/parameters.txt deleted file mode 100644 index 59ba741905..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/parameters.txt +++ /dev/null @@ -1,7 +0,0 @@ -PERLIN_PARAM:SCALE 0.494279 -PERLIN_PARAM:OFFSET -0.526799 -PERLIN_PARAM:PERSISTENCE 0.0911083 -PERLIN_PARAM:OCTAVES 43.0492 -PERLIN_PARAM:PRIME_1 123.299 -PERLIN_PARAM:PRIME_2 42.4258 -PERLIN_PARAM:PRIME_3 14.0702 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/perlin.stderr b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/perlin.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/perlin.stdout b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/perlin.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/perlin_1.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/perlin_1.txt deleted file mode 100644 index 6aa944dccf..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/perlin_1.txt +++ /dev/null @@ -1,100 +0,0 @@ --1.276058 --1.289017 --1.314341 --1.306601 --1.296437 --1.293440 --1.259407 --1.266510 --1.294486 --1.261902 --1.202479 --1.080475 --0.954164 --0.885534 --0.858941 --0.894787 --0.919912 --0.916939 --0.886507 --0.799550 --0.721154 --0.650200 --0.537956 --0.483812 --0.489635 --0.525394 --0.546662 --0.527208 --0.534832 --0.533549 --0.538252 --0.584050 --0.611137 --0.630059 --0.650202 --0.616093 --0.568181 --0.463276 --0.334508 --0.259597 --0.221372 --0.259230 --0.279580 --0.244302 --0.207325 --0.170186 --0.177288 --0.240439 --0.278604 --0.325685 --0.411518 --0.447688 --0.438482 --0.430901 --0.426508 --0.473419 --0.523455 --0.492174 --0.429854 --0.320462 --0.242691 --0.226471 --0.221185 --0.262628 --0.292571 --0.326766 --0.377534 --0.383441 --0.373359 --0.364832 --0.330290 --0.341756 --0.378785 --0.325450 --0.201339 --0.014930 -0.131198 -0.218084 -0.307262 -0.331535 -0.323047 -0.275638 -0.204499 -0.189781 -0.216423 -0.234694 -0.244237 -0.196780 -0.140343 -0.139795 -0.132064 -0.149348 -0.135500 -0.067575 --0.002818 --0.038351 --0.033175 --0.039802 --0.104931 --0.282153 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/perlin_2.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/perlin_2.txt deleted file mode 100644 index 9527f5ea7a..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/perlin_2.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.105634 --0.100522 --0.094477 --0.166631 --0.242055 --0.267233 --0.351269 --0.418058 --0.423433 --0.455156 --0.503687 --0.535205 --0.602964 --0.629293 --0.605334 --0.598246 --0.588567 --0.648452 --0.705977 --0.761218 --0.784663 --0.690549 --0.595504 --0.441816 --0.322998 --0.240974 --0.082616 -0.026633 -0.111952 -0.206176 -0.291269 -0.362596 -0.390792 -0.289982 -0.127689 -0.000994 --0.086106 --0.090324 --0.148248 --0.241375 --0.259151 --0.279786 --0.291397 --0.328535 --0.389958 --0.377995 --0.280737 --0.158372 --0.106091 --0.142807 --0.139820 --0.078912 --0.035823 -0.057418 -0.107112 -0.097244 -0.109350 -0.077772 -0.052136 -0.081830 -0.120261 -0.196251 -0.272728 -0.294216 -0.300526 -0.246943 -0.116525 --0.050187 --0.175115 --0.301600 --0.427862 --0.456478 --0.450396 --0.398868 --0.320212 --0.349825 --0.460267 --0.567451 --0.631795 --0.652977 --0.663271 --0.674428 --0.682635 --0.626163 --0.539750 --0.498320 --0.505975 --0.578888 --0.635684 --0.598530 --0.523332 --0.361034 --0.160381 -0.022807 -0.185816 -0.259100 -0.276090 -0.163135 -0.001742 --0.111572 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/perlin_3.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/perlin_3.txt deleted file mode 100644 index cd80bec7c2..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/perlin_3.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.917785 --1.018838 --1.197085 --1.346518 --1.465782 --1.457947 --1.433721 --1.430564 --1.396554 --1.348945 --1.213771 --1.091774 --1.050692 --1.067291 --1.040706 --1.000801 --1.010901 --0.965566 --0.865274 --0.667889 --0.431604 --0.239372 --0.105089 --0.069473 --0.069545 --0.099554 --0.139350 --0.160356 --0.109202 --0.012531 -0.030695 -0.054757 -0.070031 -0.092023 -0.121743 -0.129957 -0.118527 -0.101591 -0.141964 -0.266738 -0.345876 -0.392401 -0.430221 -0.358497 -0.240463 -0.122590 -0.008486 --0.058995 --0.075277 --0.162975 --0.315639 --0.521310 --0.729615 --0.851158 --0.979655 --1.056785 --1.059049 --1.085967 --1.124672 --1.129564 --1.147745 --1.190867 --1.211475 --1.265556 --1.317086 --1.291337 --1.238050 --1.188747 --1.142334 --1.134089 --1.132725 --1.066024 --1.017221 --0.914666 --0.800777 --0.735933 --0.626698 --0.565983 --0.484094 --0.418266 --0.429310 --0.380164 --0.258859 --0.067478 -0.094606 -0.175094 -0.213959 -0.182170 -0.149065 -0.171849 -0.179785 -0.163891 -0.149761 -0.055666 --0.022016 --0.015994 --0.013374 -0.003331 --0.046131 --0.194030 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/perlin_params.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/perlin_params.txt deleted file mode 100644 index 219b62155c..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-8/iter-0/perlin_params.txt +++ /dev/null @@ -1,7 +0,0 @@ -SCALE:0.494279 -OFFSET:-0.526799 -PERSISTENCE:0.0911083 -OCTAVES:43.0492 -PRIME_1:123.299 -PRIME_2:42.4258 -PRIME_3:14.0702 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/OK b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/OK deleted file mode 100644 index 9590cb949c..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/OK +++ /dev/null @@ -1 +0,0 @@ -All jobs complete \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/aggregated.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/aggregated.txt deleted file mode 100644 index 48b8531624..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/aggregated.txt +++ /dev/null @@ -1,4 +0,0 @@ -PERLIN_3 0.220371 -PERLIN_2 1.032522 -PERLIN_1 -0.137903 -STATE Positive \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/aggregator.stderr b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/aggregator.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/aggregator.stdout b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/aggregator.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/parameters.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/parameters.txt deleted file mode 100644 index 2e4f0f7b04..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/parameters.txt +++ /dev/null @@ -1,7 +0,0 @@ -PERLIN_PARAM:SCALE 0.971949 -PERLIN_PARAM:OFFSET 0.568165 -PERLIN_PARAM:PERSISTENCE 0.332226 -PERLIN_PARAM:OCTAVES 8.48231 -PERLIN_PARAM:PRIME_1 106.04 -PERLIN_PARAM:PRIME_2 17.4819 -PERLIN_PARAM:PRIME_3 56.9629 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/perlin.stderr b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/perlin.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/perlin.stdout b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/perlin.stdout deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/perlin_1.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/perlin_1.txt deleted file mode 100644 index 36798a3f53..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/perlin_1.txt +++ /dev/null @@ -1,100 +0,0 @@ --0.137903 --0.157851 --0.192276 --0.201670 --0.192839 --0.193214 --0.209423 --0.243628 --0.261796 --0.213269 --0.207591 --0.203993 --0.142490 --0.122206 --0.157129 --0.193732 --0.206432 --0.177612 --0.114381 --0.050740 --0.070342 --0.154469 --0.151716 --0.137877 --0.155888 --0.199095 --0.226091 --0.254674 --0.326284 --0.337833 --0.312344 --0.317023 --0.346853 --0.332528 --0.238504 --0.042655 -0.146262 -0.376535 -0.617211 -0.752626 -0.797129 -0.714055 -0.660213 -0.707589 -0.786058 -0.902157 -0.982988 -0.972517 -0.950945 -0.917937 -0.833802 -0.834170 -0.874761 -0.874663 -0.835114 -0.714452 -0.615202 -0.641686 -0.698232 -0.833272 -0.978281 -1.070483 -1.118218 -1.061277 -1.031902 -0.998036 -0.965574 -1.010296 -1.079127 -1.148032 -1.260956 -1.285149 -1.247059 -1.290888 -1.424147 -1.629905 -1.764537 -1.819917 -1.898802 -1.893787 -1.855403 -1.728917 -1.536779 -1.375375 -1.281240 -1.209446 -1.131790 -1.009449 -0.933443 -0.938227 -0.970148 -1.049769 -1.076923 -1.035402 -0.981504 -0.949433 -0.958861 -0.977078 -0.958006 -0.802606 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/perlin_2.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/perlin_2.txt deleted file mode 100644 index ba557199f4..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/perlin_2.txt +++ /dev/null @@ -1,100 +0,0 @@ -1.032522 -1.030645 -1.027589 -0.938300 -0.861544 -0.832993 -0.698715 -0.604825 -0.609257 -0.593477 -0.491201 -0.341277 -0.208709 -0.134035 -0.096478 -0.102808 -0.124913 -0.090875 -0.066149 --0.012408 --0.133850 --0.194818 --0.209263 --0.095881 -0.010749 -0.085326 -0.237955 -0.299167 -0.320499 -0.401893 -0.517178 -0.629623 -0.655076 -0.587512 -0.539387 -0.574432 -0.628337 -0.749487 -0.803470 -0.770847 -0.759350 -0.693500 -0.648396 -0.623356 -0.603426 -0.694348 -0.879540 -1.054584 -1.123458 -1.100816 -1.105500 -1.202947 -1.277420 -1.362982 -1.368734 -1.285116 -1.248007 -1.211633 -1.180222 -1.235564 -1.341232 -1.493206 -1.612131 -1.618121 -1.625000 -1.571745 -1.459633 -1.343551 -1.277370 -1.211264 -1.163383 -1.170426 -1.175448 -1.217470 -1.305274 -1.295011 -1.173072 -1.034382 -0.959745 -0.909275 -0.869084 -0.778851 -0.649645 -0.559430 -0.525067 -0.476432 -0.381578 -0.233781 -0.157416 -0.199901 -0.314752 -0.539386 -0.781042 -0.990634 -1.170137 -1.246885 -1.268126 -1.180015 -1.064679 -0.973186 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/perlin_3.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/perlin_3.txt deleted file mode 100644 index 2bb0cef781..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/perlin_3.txt +++ /dev/null @@ -1,100 +0,0 @@ -0.220371 -0.112328 --0.075019 --0.241588 --0.362184 --0.357721 --0.383737 --0.407682 --0.363864 --0.300312 --0.218883 --0.215292 --0.239019 --0.303964 --0.338894 --0.299746 --0.297421 --0.226239 --0.093147 -0.080922 -0.219209 -0.256359 -0.281152 -0.276463 -0.264202 -0.226745 -0.181221 -0.112178 -0.099345 -0.183186 -0.256603 -0.321784 -0.334316 -0.389554 -0.533441 -0.703395 -0.832970 -0.941402 -1.093683 -1.278960 -1.364377 -1.365686 -1.370013 -1.310389 -1.233846 -1.194933 -1.168762 -1.153961 -1.154271 -1.080648 -0.929681 -0.760549 -0.583628 -0.454406 -0.281967 -0.131086 -0.079608 -0.047894 -0.003413 -0.024170 -0.073226 -0.106088 -0.127928 -0.058349 -0.007387 -0.033465 -0.105058 -0.204991 -0.310151 -0.378775 -0.458521 -0.560881 -0.608623 -0.701672 -0.824709 -0.908902 -1.006640 -1.035850 -1.107446 -1.143986 -1.103046 -1.073115 -1.073421 -1.118115 -1.159422 -1.149846 -1.101513 -0.994839 -0.942165 -0.970280 -1.017869 -1.064312 -1.091185 -1.023493 -0.962306 -0.971791 -0.978662 -1.020211 -1.016806 -0.890728 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/perlin_params.txt b/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/perlin_params.txt deleted file mode 100644 index c3e63c5f53..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/Run/realisation-9/iter-0/perlin_params.txt +++ /dev/null @@ -1,7 +0,0 @@ -SCALE:0.971949 -OFFSET:0.568165 -PERSISTENCE:0.332226 -OCTAVES:8.48231 -PRIME_1:106.04 -PRIME_2:17.4819 -PRIME_3:56.9629 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/current_case b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/current_case deleted file mode 100644 index 331d858ce9..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/current_case +++ /dev/null @@ -1 +0,0 @@ -default \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/0001/files/PERLIN_active b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/0001/files/PERLIN_active deleted file mode 100644 index c72400474a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/0001/files/PERLIN_active and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/0002/files/PERLIN_active b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/0002/files/PERLIN_active deleted file mode 100644 index c72400474a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/0002/files/PERLIN_active and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/0003/files/PERLIN_active b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/0003/files/PERLIN_active deleted file mode 100644 index c72400474a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/0003/files/PERLIN_active and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/FORECAST.data_0 deleted file mode 100644 index 8dcc722d5a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/FORECAST.index deleted file mode 100644 index 0a01a88233..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/PARAMETER.data_0 deleted file mode 100644 index 1d8b6c18da..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/PARAMETER.index deleted file mode 100644 index 1f0db16ccc..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_0/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/FORECAST.data_0 deleted file mode 100644 index 8cfcfa2250..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/FORECAST.index deleted file mode 100644 index 9e25666ab4..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/PARAMETER.data_0 deleted file mode 100644 index ff8922efbf..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/PARAMETER.index deleted file mode 100644 index 2f8c799aed..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_1/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/FORECAST.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/PARAMETER.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_10/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/FORECAST.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/PARAMETER.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_11/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/FORECAST.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/PARAMETER.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_12/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/FORECAST.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/PARAMETER.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_13/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/FORECAST.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/PARAMETER.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_14/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/FORECAST.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/PARAMETER.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_15/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/FORECAST.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/PARAMETER.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_16/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/FORECAST.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/PARAMETER.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_17/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/FORECAST.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/PARAMETER.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_18/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/FORECAST.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/PARAMETER.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_19/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/FORECAST.data_0 deleted file mode 100644 index 6f7244c4fa..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/FORECAST.index deleted file mode 100644 index d90f7a9f75..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/PARAMETER.data_0 deleted file mode 100644 index aad9490e0c..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/PARAMETER.index deleted file mode 100644 index 4c804b5b87..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_2/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/FORECAST.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/PARAMETER.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_20/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/FORECAST.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/PARAMETER.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_21/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/FORECAST.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/PARAMETER.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_22/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/FORECAST.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/PARAMETER.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_23/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/FORECAST.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/PARAMETER.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_24/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/FORECAST.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/PARAMETER.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_25/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/FORECAST.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/PARAMETER.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_26/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/FORECAST.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/PARAMETER.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_27/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/FORECAST.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/PARAMETER.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_28/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/FORECAST.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/PARAMETER.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_29/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/FORECAST.data_0 deleted file mode 100644 index fd7246d7ab..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/FORECAST.index deleted file mode 100644 index 718956c242..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/PARAMETER.data_0 deleted file mode 100644 index 2fc669aaf7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/PARAMETER.index deleted file mode 100644 index cbeb9c1224..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_3/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/FORECAST.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/PARAMETER.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_30/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/FORECAST.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/PARAMETER.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_31/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/FORECAST.data_0 deleted file mode 100644 index 28665371dc..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/FORECAST.index deleted file mode 100644 index a879653abd..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/PARAMETER.data_0 deleted file mode 100644 index 90b4c5e871..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/PARAMETER.index deleted file mode 100644 index b7afb6bf58..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_4/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/FORECAST.data_0 deleted file mode 100644 index 178960502d..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/FORECAST.index deleted file mode 100644 index 7e09d8c482..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/PARAMETER.data_0 deleted file mode 100644 index b47d88c6ce..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/PARAMETER.index deleted file mode 100644 index 68c8652b8a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_5/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/FORECAST.data_0 deleted file mode 100644 index cfb98aa00e..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/FORECAST.index deleted file mode 100644 index 2f03d8d11b..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/PARAMETER.data_0 deleted file mode 100644 index bb97f570e8..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/PARAMETER.index deleted file mode 100644 index e86f73216f..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_6/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/FORECAST.data_0 deleted file mode 100644 index c8b34c3179..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/FORECAST.index deleted file mode 100644 index 7ef99ebfde..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/PARAMETER.data_0 deleted file mode 100644 index 9bc6a11543..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/PARAMETER.index deleted file mode 100644 index 40817c501f..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_7/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/FORECAST.data_0 deleted file mode 100644 index 6ce8ff1142..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/FORECAST.index deleted file mode 100644 index c560413360..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/PARAMETER.data_0 deleted file mode 100644 index 674b8594d6..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/PARAMETER.index deleted file mode 100644 index 86d42f2def..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_8/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/ANALYZED.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/ANALYZED.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/FORECAST.data_0 deleted file mode 100644 index 27d18051fd..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/FORECAST.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/FORECAST.index deleted file mode 100644 index 9bbcfc9ea7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/FORECAST.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/PARAMETER.data_0 deleted file mode 100644 index a6ce92b471..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/PARAMETER.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/PARAMETER.index deleted file mode 100644 index 727e912850..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/STATIC.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/STATIC.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/STATIC.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/STATIC.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Ensemble/mod_9/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Index/INDEX.data_0 b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Index/INDEX.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Index/INDEX.index b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Index/INDEX.index deleted file mode 100644 index e1de74ede3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Index/INDEX.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Index/INDEX.mnt b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Index/INDEX.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/Index/INDEX.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/ert_fstab b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/ert_fstab deleted file mode 100644 index a5d67ad3a3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/ert_fstab and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/files/case_config b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/files/case_config deleted file mode 100644 index 593f4708db..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/files/case_config and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/files/custom_kw_config_set b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/files/custom_kw_config_set deleted file mode 100644 index b51c81a5bb..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/files/custom_kw_config_set and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/files/state-map b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/files/state-map deleted file mode 100644 index f2112badc8..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/files/state-map and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/files/summary-key-set b/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/files/summary-key-set deleted file mode 100644 index 593f4708db..0000000000 Binary files a/ThirdParty/Ert/test-data/local/custom_kw/storage/ertensemble/test_run/files/summary-key-set and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/custom_kw/time_map b/ThirdParty/Ert/test-data/local/custom_kw/time_map deleted file mode 100644 index 95ec9b0216..0000000000 --- a/ThirdParty/Ert/test-data/local/custom_kw/time_map +++ /dev/null @@ -1,4 +0,0 @@ -01/01/2015 -01/02/2015 -01/03/2015 -01/04/2015 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/resopt/config/simple/config b/ThirdParty/Ert/test-data/local/resopt/config/simple/config deleted file mode 100644 index 8111c47113..0000000000 --- a/ThirdParty/Ert/test-data/local/resopt/config/simple/config +++ /dev/null @@ -1,5 +0,0 @@ -JOBNAME Job%d -RUNPATH /tmp/simulations/run%d -NUM_REALIZATIONS 1 - - diff --git a/ThirdParty/Ert/test-data/local/run/config.txt b/ThirdParty/Ert/test-data/local/run/config.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/SEED b/ThirdParty/Ert/test-data/local/snake_oil/SEED deleted file mode 100644 index 314cda88f6..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil/SEED +++ /dev/null @@ -1 +0,0 @@ -67 -110 42 -42 106 34 96 0 18 42 76 -69 44 -40 -78 -61 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil/jobs/SNAKE_OIL_DIFF b/ThirdParty/Ert/test-data/local/snake_oil/jobs/SNAKE_OIL_DIFF deleted file mode 100644 index 98a867d959..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil/jobs/SNAKE_OIL_DIFF +++ /dev/null @@ -1,4 +0,0 @@ -STDOUT snake_oil_diff.stdout -STDERR snake_oil_diff.stderr - -EXECUTABLE snake_oil_diff.py \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil/jobs/SNAKE_OIL_NPV b/ThirdParty/Ert/test-data/local/snake_oil/jobs/SNAKE_OIL_NPV deleted file mode 100644 index 887830c756..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil/jobs/SNAKE_OIL_NPV +++ /dev/null @@ -1,4 +0,0 @@ -STDOUT snake_oil_npv.stdout -STDERR snake_oil_npv.stderr - -EXECUTABLE snake_oil_npv.py \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil/jobs/SNAKE_OIL_SIMULATOR b/ThirdParty/Ert/test-data/local/snake_oil/jobs/SNAKE_OIL_SIMULATOR deleted file mode 100644 index b4b7f9928f..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil/jobs/SNAKE_OIL_SIMULATOR +++ /dev/null @@ -1,4 +0,0 @@ -STDOUT snake_oil.stdout -STDERR snake_oil.stderr - -EXECUTABLE snake_oil_simulator.py \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil/jobs/snake_oil_diff.py b/ThirdParty/Ert/test-data/local/snake_oil/jobs/snake_oil_diff.py deleted file mode 100644 index afabb261f9..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil/jobs/snake_oil_diff.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python -from ert.ecl import EclSum - -def writeDiff(filename, vector1, vector2): - with open(filename, "w") as f: - for index in range(len(vector1)): - node1 = vector1[index] - node2 = vector2[index] - - diff = node1.value - node2.value - f.write("%f\n" % diff) - - -if __name__ == '__main__': - ecl_sum = EclSum("SNAKE_OIL_FIELD") - - report_step = 199 - writeDiff("snake_oil_opr_diff_%d.txt" % report_step, ecl_sum["WOPR:OP1"], ecl_sum["WOPR:OP2"]) - writeDiff("snake_oil_wpr_diff_%d.txt" % report_step, ecl_sum["WWPR:OP1"], ecl_sum["WWPR:OP2"]) - writeDiff("snake_oil_gpr_diff_%d.txt" % report_step, ecl_sum["WGPR:OP1"], ecl_sum["WGPR:OP2"]) - - - - diff --git a/ThirdParty/Ert/test-data/local/snake_oil/jobs/snake_oil_npv.py b/ThirdParty/Ert/test-data/local/snake_oil/jobs/snake_oil_npv.py deleted file mode 100644 index 4ff61251bc..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil/jobs/snake_oil_npv.py +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env python -from ert.ecl import EclSum - -OIL_PRICES = {"2010-01-01": 78.33, - "2010-02-01": 76.39, - "2010-03-01": 81.20, - "2010-04-01": 84.29, - "2010-05-01": 73.74, - "2010-06-01": 75.34, - "2010-07-01": 76.32, - "2010-08-01": 76.60, - "2010-09-01": 75.24, - "2010-10-01": 81.89, - "2010-11-01": 84.25, - "2010-12-01": 89.15, - "2011-01-01": 89.17, - "2011-02-01": 88.58, - "2011-03-01": 102.86, - "2011-04-01": 109.53, - "2011-05-01": 100.90, - "2011-06-01": 96.26, - "2011-07-01": 97.30, - "2011-08-01": 86.33, - "2011-09-01": 85.52, - "2011-10-01": 86.32, - "2011-11-01": 97.16, - "2011-12-01": 98.56, - "2012-01-01": 100.27, - "2012-02-01": 102.20, - "2012-03-01": 106.16, - "2012-04-01": 103.32, - "2012-05-01": 94.65, - "2012-06-01": 82.30, - "2012-07-01": 87.90, - "2012-08-01": 94.13, - "2012-09-01": 94.51, - "2012-10-01": 89.49, - "2012-11-01": 86.53, - "2012-12-01": 87.86, - "2013-01-01": 94.76, - "2013-02-01": 95.31, - "2013-03-01": 92.94, - "2013-04-01": 92.02, - "2013-05-01": 94.51, - "2013-06-01": 95.77, - "2013-07-01": 104.67, - "2013-08-01": 106.57, - "2013-09-01": 106.29, - "2013-10-01": 100.54, - "2013-11-01": 93.86, - "2013-12-01": 97.63, - "2014-01-01": 94.62, - "2014-02-01": 100.82, - "2014-03-01": 100.80, - "2014-04-01": 102.07, - "2014-05-01": 102.18, - "2014-06-01": 105.79, - "2014-07-01": 103.59, - "2014-08-01": 96.54, - "2014-09-01": 93.21, - "2014-10-01": 84.40, - "2014-11-01": 75.79, - "2014-12-01": 59.29, - "2015-01-01": 47.22, - "2015-02-01": 50.58, - "2015-03-01": 47.82, - "2015-04-01": 54.45, - "2015-05-01": 59.27, - "2015-06-01": 59.82, - "2015-07-01": 50.90, - "2015-08-01": 42.87, - "2015-09-01": 45.48} - -if __name__ == '__main__': - ecl_sum = EclSum("SNAKE_OIL_FIELD") - start_time = ecl_sum.getStartTime() - date_ranges = ecl_sum.timeRange(start_time, interval="1M") - production_sums = ecl_sum.blockedProduction("FOPT", date_ranges) - - npv = 0.0 - for index in range(0, len(date_ranges) - 1): - date = date_ranges[index + 1] # end of period - production_sum = production_sums[index] - - oil_price = OIL_PRICES[date.date().strftime("%Y-%m-%d")] - - production_value = oil_price * production_sum - npv += production_value - - with open("snake_oil_npv.txt", "w") as output_file: - output_file.write("NPV %s\n" % npv) - - if npv < 80000: - rating = "POOR" - elif 80000 <= npv < 100000: - rating = "AVERAGE" - elif 100000 <= npv < 120000: - rating = "GOOD" - else: - rating = "EXCELLENT" - - output_file.write("RATING %s\n" % rating) - diff --git a/ThirdParty/Ert/test-data/local/snake_oil/jobs/snake_oil_simulator.py b/ThirdParty/Ert/test-data/local/snake_oil/jobs/snake_oil_simulator.py deleted file mode 100644 index 0083e09155..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil/jobs/snake_oil_simulator.py +++ /dev/null @@ -1,200 +0,0 @@ -#!/usr/bin/env python -from datetime import datetime -import os -import sys - -from ert.ecl import EclSum, EclSumTStep -from ert.test import ExtendedTestCase - -try: - from synthesizer import OilSimulator -except ImportError as e: - share_lib_path = os.path.join(ExtendedTestCase.findShareRoot(), "lib") - - sys.path.insert(0, share_lib_path) - synthesizer_module = __import__("synthesizer") - OilSimulator = synthesizer_module.OilSimulator - sys.path.pop(0) - - -def globalIndex(i, j, k, nx=10, ny=10, nz=10): - return i + nx * (j - 1) + nx * ny * (k - 1) - - -def readParameters(filename): - params = {} - with open(filename, "r") as f: - for line in f: - key, value = line.split(":", 1) - params[key] = value.strip() - - return params - - -def runSimulator(simulator, history_simulator, time_step_count): - """ @rtype: EclSum """ - ecl_sum = EclSum.writer("SNAKE_OIL_FIELD", datetime(2010, 1, 1), 10, 10, 10) - - ecl_sum.addVariable('FOPT', unit="SM3") - ecl_sum.addVariable('FOPR', unit="SM3/DAY") - ecl_sum.addVariable('FGPT', unit="SM3") - ecl_sum.addVariable('FGPR', unit="SM3/DAY") - ecl_sum.addVariable('FWPT', unit="SM3") - ecl_sum.addVariable('FWPR', unit="SM3/DAY") - ecl_sum.addVariable('FGOR', unit="SM3/SM3") - ecl_sum.addVariable('FWCT', unit="SM3/SM3") - - ecl_sum.addVariable('FOIP', unit="SM3") - ecl_sum.addVariable('FGIP', unit="SM3") - ecl_sum.addVariable('FWIP', unit="SM3") - - ecl_sum.addVariable('FOPTH', unit="SM3") - ecl_sum.addVariable('FOPRH', unit="SM3/DAY") - ecl_sum.addVariable('FGPTH', unit="SM3") - ecl_sum.addVariable('FGPRH', unit="SM3/DAY") - ecl_sum.addVariable('FWPTH', unit="SM3") - ecl_sum.addVariable('FWPRH', unit="SM3/DAY") - ecl_sum.addVariable('FGORH', unit="SM3/SM3") - ecl_sum.addVariable('FWCTH', unit="SM3/SM3") - - ecl_sum.addVariable('FOIPH', unit="SM3") - ecl_sum.addVariable('FGIPH', unit="SM3") - ecl_sum.addVariable('FWIPH', unit="SM3") - - ecl_sum.addVariable('WOPR', wgname='OP1', unit="SM3/DAY") - ecl_sum.addVariable('WOPR', wgname='OP2', unit="SM3/DAY") - ecl_sum.addVariable('WWPR', wgname='OP1', unit="SM3/DAY") - ecl_sum.addVariable('WWPR', wgname='OP2', unit="SM3/DAY") - ecl_sum.addVariable('WGPR', wgname='OP1', unit="SM3/DAY") - ecl_sum.addVariable('WGPR', wgname='OP2', unit="SM3/DAY") - ecl_sum.addVariable('WGOR', wgname='OP1', unit="SM3/SM3") - ecl_sum.addVariable('WGOR', wgname='OP2', unit="SM3/SM3") - ecl_sum.addVariable('WWCT', wgname='OP1', unit="SM3/SM3") - ecl_sum.addVariable('WWCT', wgname='OP2', unit="SM3/SM3") - - ecl_sum.addVariable('WOPRH', wgname='OP1', unit="SM3/DAY") - ecl_sum.addVariable('WOPRH', wgname='OP2', unit="SM3/DAY") - ecl_sum.addVariable('WWPRH', wgname='OP1', unit="SM3/DAY") - ecl_sum.addVariable('WWPRH', wgname='OP2', unit="SM3/DAY") - ecl_sum.addVariable('WGPRH', wgname='OP1', unit="SM3/DAY") - ecl_sum.addVariable('WGPRH', wgname='OP2', unit="SM3/DAY") - ecl_sum.addVariable('WGORH', wgname='OP1', unit="SM3/SM3") - ecl_sum.addVariable('WGORH', wgname='OP2', unit="SM3/SM3") - ecl_sum.addVariable('WWCTH', wgname='OP1', unit="SM3/SM3") - ecl_sum.addVariable('WWCTH', wgname='OP2', unit="SM3/SM3") - - ecl_sum.addVariable('BPR', num=globalIndex(5, 5, 5), unit="BARSA") - ecl_sum.addVariable('BPR', num=globalIndex(1, 3, 8), unit="BARSA") - - time_map = [] - mini_step_count = 10 - total_step_count = time_step_count * mini_step_count - - for report_step in range(time_step_count): - for mini_step in range(mini_step_count): - t_step = ecl_sum.addTStep(report_step + 1, sim_days=report_step * mini_step_count + mini_step) - - time_map.append(t_step.getSimTime().datetime().strftime("%d/%m/%Y")) - - simulator.step(scale=1.0 / total_step_count) - history_simulator.step(scale=1.0 / total_step_count) - - t_step['FOPR'] = simulator.fopr() - t_step['FOPT'] = simulator.fopt() - t_step['FGPR'] = simulator.fgpr() - t_step['FGPT'] = simulator.fgpt() - t_step['FWPR'] = simulator.fwpr() - t_step['FWPT'] = simulator.fwpt() - t_step['FGOR'] = simulator.fgor() - t_step['FWCT'] = simulator.fwct() - - t_step['FOIP'] = simulator.foip() - t_step['FGIP'] = simulator.fgip() - t_step['FWIP'] = simulator.fwip() - - t_step['WOPR:OP1'] = simulator.opr('OP1') - t_step['WOPR:OP2'] = simulator.opr('OP2') - - t_step['WGPR:OP1'] = simulator.gpr('OP1') - t_step['WGPR:OP2'] = simulator.gpr('OP2') - - t_step['WWPR:OP1'] = simulator.wpr('OP1') - t_step['WWPR:OP2'] = simulator.wpr('OP2') - - t_step['WGOR:OP1'] = simulator.gor('OP1') - t_step['WGOR:OP2'] = simulator.gor('OP2') - - t_step['WWCT:OP1'] = simulator.wct('OP1') - t_step['WWCT:OP2'] = simulator.wct('OP2') - - t_step['BPR:5,5,5'] = simulator.bpr('5,5,5') - t_step['BPR:1,3,8'] = simulator.bpr('1,3,8') - - t_step['FOPRH'] = history_simulator.fopr() - t_step['FOPTH'] = history_simulator.fopt() - t_step['FGPRH'] = history_simulator.fgpr() - t_step['FGPTH'] = history_simulator.fgpt() - t_step['FWPRH'] = history_simulator.fwpr() - t_step['FWPTH'] = history_simulator.fwpt() - t_step['FGORH'] = history_simulator.fgor() - t_step['FWCTH'] = history_simulator.fwct() - t_step['FOIPH'] = history_simulator.foip() - t_step['FGIPH'] = history_simulator.fgip() - t_step['FWIPH'] = history_simulator.fwip() - - t_step['WOPRH:OP1'] = history_simulator.opr('OP1') - t_step['WOPRH:OP2'] = history_simulator.opr('OP2') - - t_step['WGPRH:OP1'] = history_simulator.gpr('OP1') - t_step['WGPRH:OP2'] = history_simulator.gpr('OP2') - - t_step['WWPRH:OP1'] = history_simulator.wpr('OP1') - t_step['WWPRH:OP2'] = history_simulator.wpr('OP2') - - t_step['WGORH:OP1'] = history_simulator.gor('OP1') - t_step['WGORH:OP2'] = history_simulator.gor('OP2') - - t_step['WWCTH:OP1'] = history_simulator.wct('OP1') - t_step['WWCTH:OP2'] = history_simulator.wct('OP2') - - return ecl_sum, time_map - - -def roundedInt(value): - return int(round(float(value))) - - -if __name__ == '__main__': - seed = int(readParameters("seed.txt")["SEED"]) - parameters = readParameters("snake_oil_params.txt") - - op1_divergence_scale = float(parameters['OP1_DIVERGENCE_SCALE']) - op2_divergence_scale = float(parameters['OP2_DIVERGENCE_SCALE']) - op1_persistence = float(parameters['OP1_PERSISTENCE']) - op2_persistence = float(parameters['OP2_PERSISTENCE']) - op1_offset = float(parameters['OP1_OFFSET']) - op2_offset = float(parameters['OP2_OFFSET']) - bpr_138_persistence = float(parameters['BPR_138_PERSISTENCE']) - bpr_555_persistence = float(parameters['BPR_555_PERSISTENCE']) - - op1_octaves = roundedInt(parameters['OP1_OCTAVES']) - op2_octaves = roundedInt(parameters['OP2_OCTAVES']) - - simulator = OilSimulator() - simulator.addWell('OP1', seed * 997, persistence=op1_persistence, octaves=op1_octaves, divergence_scale=op1_divergence_scale, offset=op1_offset) - simulator.addWell('OP2', seed * 13, persistence=op2_persistence, octaves=op2_octaves, divergence_scale=op2_divergence_scale, offset=op2_offset) - simulator.addBlock('5,5,5', seed * 37, persistence=bpr_555_persistence) - simulator.addBlock('1,3,8', seed * 31, persistence=bpr_138_persistence) - - history_simulator = OilSimulator() - history_simulator.addWell('OP1', 222118781) - history_simulator.addWell('OP2', 118116362) - - report_step_count = 200 - ecl_sum, time_map = runSimulator(simulator, history_simulator, report_step_count) - - ecl_sum.fwrite() - - with open("time_map.txt", "w") as f: - for t in time_map: - f.write("%s\n" % t) diff --git a/ThirdParty/Ert/test-data/local/snake_oil/observations/observations.txt b/ThirdParty/Ert/test-data/local/snake_oil/observations/observations.txt deleted file mode 100644 index de28837efb..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil/observations/observations.txt +++ /dev/null @@ -1,56 +0,0 @@ -HISTORY_OBSERVATION FOPR; - -SUMMARY_OBSERVATION WOPR_OP1_9 -{ - VALUE = 0.1; - ERROR = 0.05; - RESTART = 9; - KEY = WOPR:OP1; -}; - -SUMMARY_OBSERVATION WOPR_OP1_36 -{ - VALUE = 0.7; - ERROR = 0.07; - RESTART = 36; - KEY = WOPR:OP1; -}; - -SUMMARY_OBSERVATION WOPR_OP1_72 -{ - VALUE = 0.5; - ERROR = 0.05; - RESTART = 72; - KEY = WOPR:OP1; -}; - -SUMMARY_OBSERVATION WOPR_OP1_108 -{ - VALUE = 0.3; - ERROR = 0.075; - RESTART = 108; - KEY = WOPR:OP1; -}; - -SUMMARY_OBSERVATION WOPR_OP1_144 -{ - VALUE = 0.2; - ERROR = 0.035; - RESTART = 144; - KEY = WOPR:OP1; -}; - -SUMMARY_OBSERVATION WOPR_OP1_190 -{ - VALUE = 0.015; - ERROR = 0.01; - RESTART = 190; - KEY = WOPR:OP1; -}; - -GENERAL_OBSERVATION WPR_DIFF_1 { - DATA = SNAKE_OIL_WPR_DIFF; - INDEX_LIST = 400,800,1200,1800; - RESTART = 199; - OBS_FILE = observations/wpr_diff_obs.txt; -}; \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil/observations/wpr_diff_obs.txt b/ThirdParty/Ert/test-data/local/snake_oil/observations/wpr_diff_obs.txt deleted file mode 100644 index 4aee6d7ef7..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil/observations/wpr_diff_obs.txt +++ /dev/null @@ -1,4 +0,0 @@ -0.0 0.1 -0.1 0.2 -0.2 0.15 -0.0 0.05 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/parameters/snake_oil_parameters.txt b/ThirdParty/Ert/test-data/local/snake_oil/parameters/snake_oil_parameters.txt deleted file mode 100644 index 64573d0058..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil/parameters/snake_oil_parameters.txt +++ /dev/null @@ -1,11 +0,0 @@ -OP1_PERSISTENCE UNIFORM 0.01 0.4 -OP1_OCTAVES UNIFORM 3 5 -OP1_DIVERGENCE_SCALE UNIFORM 0.25 1.25 -OP1_OFFSET UNIFORM -0.1 0.1 -OP2_PERSISTENCE UNIFORM 0.1 0.6 -OP2_OCTAVES UNIFORM 5 12 -OP2_DIVERGENCE_SCALE UNIFORM 0.5 1.5 -OP2_OFFSET UNIFORM -0.2 0.2 -BPR_555_PERSISTENCE UNIFORM 0.1 0.5 -BPR_138_PERSISTENCE UNIFORM 0.2 0.7 - diff --git a/ThirdParty/Ert/test-data/local/snake_oil/refcase/SNAKE_OIL_FIELD.SMSPEC b/ThirdParty/Ert/test-data/local/snake_oil/refcase/SNAKE_OIL_FIELD.SMSPEC deleted file mode 100644 index c5aa629876..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/refcase/SNAKE_OIL_FIELD.SMSPEC and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/refcase/SNAKE_OIL_FIELD.UNSMRY b/ThirdParty/Ert/test-data/local/snake_oil/refcase/SNAKE_OIL_FIELD.UNSMRY deleted file mode 100644 index 854f523fa7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/refcase/SNAKE_OIL_FIELD.UNSMRY and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/refcase/refcase_readme.txt b/ThirdParty/Ert/test-data/local/snake_oil/refcase/refcase_readme.txt deleted file mode 100644 index a3d0fe6058..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil/refcase/refcase_readme.txt +++ /dev/null @@ -1 +0,0 @@ -To create a refcase run the snake_oil_simulator.py job with the this as working directory. \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil/refcase/seed.txt b/ThirdParty/Ert/test-data/local/snake_oil/refcase/seed.txt deleted file mode 100644 index 0009f6e89a..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil/refcase/seed.txt +++ /dev/null @@ -1 +0,0 @@ -SEED:268776 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil/refcase/snake_oil_params.txt b/ThirdParty/Ert/test-data/local/snake_oil/refcase/snake_oil_params.txt deleted file mode 100644 index 3868522924..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil/refcase/snake_oil_params.txt +++ /dev/null @@ -1,10 +0,0 @@ -OP1_PERSISTENCE:0.15 -OP1_OCTAVES:4 -OP1_DIVERGENCE_SCALE:0.5 -OP1_OFFSET:0.0 -OP2_PERSISTENCE:0.25 -OP2_OCTAVES:7.0 -OP2_DIVERGENCE_SCALE:1.0 -OP2_OFFSET:0.0 -BPR_555_PERSISTENCE:0.25 -BPR_138_PERSISTENCE:0.35 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/refcase/time_map.txt b/ThirdParty/Ert/test-data/local/snake_oil/refcase/time_map.txt deleted file mode 100644 index d54b4293ae..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil/refcase/time_map.txt +++ /dev/null @@ -1,2000 +0,0 @@ -01/01/2010 -02/01/2010 -03/01/2010 -04/01/2010 -05/01/2010 -06/01/2010 -07/01/2010 -08/01/2010 -09/01/2010 -10/01/2010 -11/01/2010 -12/01/2010 -13/01/2010 -14/01/2010 -15/01/2010 -16/01/2010 -17/01/2010 -18/01/2010 -19/01/2010 -20/01/2010 -21/01/2010 -22/01/2010 -23/01/2010 -24/01/2010 -25/01/2010 -26/01/2010 -27/01/2010 -28/01/2010 -29/01/2010 -30/01/2010 -31/01/2010 -01/02/2010 -02/02/2010 -03/02/2010 -04/02/2010 -05/02/2010 -06/02/2010 -07/02/2010 -08/02/2010 -09/02/2010 -10/02/2010 -11/02/2010 -12/02/2010 -13/02/2010 -14/02/2010 -15/02/2010 -16/02/2010 -17/02/2010 -18/02/2010 -19/02/2010 -20/02/2010 -21/02/2010 -22/02/2010 -23/02/2010 -24/02/2010 -25/02/2010 -26/02/2010 -27/02/2010 -28/02/2010 -01/03/2010 -02/03/2010 -03/03/2010 -04/03/2010 -05/03/2010 -06/03/2010 -07/03/2010 -08/03/2010 -09/03/2010 -10/03/2010 -11/03/2010 -12/03/2010 -13/03/2010 -14/03/2010 -15/03/2010 -16/03/2010 -17/03/2010 -18/03/2010 -19/03/2010 -20/03/2010 -21/03/2010 -22/03/2010 -23/03/2010 -24/03/2010 -25/03/2010 -26/03/2010 -27/03/2010 -28/03/2010 -29/03/2010 -30/03/2010 -31/03/2010 -01/04/2010 -02/04/2010 -03/04/2010 -04/04/2010 -05/04/2010 -06/04/2010 -07/04/2010 -08/04/2010 -09/04/2010 -10/04/2010 -11/04/2010 -12/04/2010 -13/04/2010 -14/04/2010 -15/04/2010 -16/04/2010 -17/04/2010 -18/04/2010 -19/04/2010 -20/04/2010 -21/04/2010 -22/04/2010 -23/04/2010 -24/04/2010 -25/04/2010 -26/04/2010 -27/04/2010 -28/04/2010 -29/04/2010 -30/04/2010 -01/05/2010 -02/05/2010 -03/05/2010 -04/05/2010 -05/05/2010 -06/05/2010 -07/05/2010 -08/05/2010 -09/05/2010 -10/05/2010 -11/05/2010 -12/05/2010 -13/05/2010 -14/05/2010 -15/05/2010 -16/05/2010 -17/05/2010 -18/05/2010 -19/05/2010 -20/05/2010 -21/05/2010 -22/05/2010 -23/05/2010 -24/05/2010 -25/05/2010 -26/05/2010 -27/05/2010 -28/05/2010 -29/05/2010 -30/05/2010 -31/05/2010 -01/06/2010 -02/06/2010 -03/06/2010 -04/06/2010 -05/06/2010 -06/06/2010 -07/06/2010 -08/06/2010 -09/06/2010 -10/06/2010 -11/06/2010 -12/06/2010 -13/06/2010 -14/06/2010 -15/06/2010 -16/06/2010 -17/06/2010 -18/06/2010 -19/06/2010 -20/06/2010 -21/06/2010 -22/06/2010 -23/06/2010 -24/06/2010 -25/06/2010 -26/06/2010 -27/06/2010 -28/06/2010 -29/06/2010 -30/06/2010 -01/07/2010 -02/07/2010 -03/07/2010 -04/07/2010 -05/07/2010 -06/07/2010 -07/07/2010 -08/07/2010 -09/07/2010 -10/07/2010 -11/07/2010 -12/07/2010 -13/07/2010 -14/07/2010 -15/07/2010 -16/07/2010 -17/07/2010 -18/07/2010 -19/07/2010 -20/07/2010 -21/07/2010 -22/07/2010 -23/07/2010 -24/07/2010 -25/07/2010 -26/07/2010 -27/07/2010 -28/07/2010 -29/07/2010 -30/07/2010 -31/07/2010 -01/08/2010 -02/08/2010 -03/08/2010 -04/08/2010 -05/08/2010 -06/08/2010 -07/08/2010 -08/08/2010 -09/08/2010 -10/08/2010 -11/08/2010 -12/08/2010 -13/08/2010 -14/08/2010 -15/08/2010 -16/08/2010 -17/08/2010 -18/08/2010 -19/08/2010 -20/08/2010 -21/08/2010 -22/08/2010 -23/08/2010 -24/08/2010 -25/08/2010 -26/08/2010 -27/08/2010 -28/08/2010 -29/08/2010 -30/08/2010 -31/08/2010 -01/09/2010 -02/09/2010 -03/09/2010 -04/09/2010 -05/09/2010 -06/09/2010 -07/09/2010 -08/09/2010 -09/09/2010 -10/09/2010 -11/09/2010 -12/09/2010 -13/09/2010 -14/09/2010 -15/09/2010 -16/09/2010 -17/09/2010 -18/09/2010 -19/09/2010 -20/09/2010 -21/09/2010 -22/09/2010 -23/09/2010 -24/09/2010 -25/09/2010 -26/09/2010 -27/09/2010 -28/09/2010 -29/09/2010 -30/09/2010 -01/10/2010 -02/10/2010 -03/10/2010 -04/10/2010 -05/10/2010 -06/10/2010 -07/10/2010 -08/10/2010 -09/10/2010 -10/10/2010 -11/10/2010 -12/10/2010 -13/10/2010 -14/10/2010 -15/10/2010 -16/10/2010 -17/10/2010 -18/10/2010 -19/10/2010 -20/10/2010 -21/10/2010 -22/10/2010 -23/10/2010 -24/10/2010 -25/10/2010 -26/10/2010 -27/10/2010 -28/10/2010 -29/10/2010 -30/10/2010 -31/10/2010 -01/11/2010 -02/11/2010 -03/11/2010 -04/11/2010 -05/11/2010 -06/11/2010 -07/11/2010 -08/11/2010 -09/11/2010 -10/11/2010 -11/11/2010 -12/11/2010 -13/11/2010 -14/11/2010 -15/11/2010 -16/11/2010 -17/11/2010 -18/11/2010 -19/11/2010 -20/11/2010 -21/11/2010 -22/11/2010 -23/11/2010 -24/11/2010 -25/11/2010 -26/11/2010 -27/11/2010 -28/11/2010 -29/11/2010 -30/11/2010 -01/12/2010 -02/12/2010 -03/12/2010 -04/12/2010 -05/12/2010 -06/12/2010 -07/12/2010 -08/12/2010 -09/12/2010 -10/12/2010 -11/12/2010 -12/12/2010 -13/12/2010 -14/12/2010 -15/12/2010 -16/12/2010 -17/12/2010 -18/12/2010 -19/12/2010 -20/12/2010 -21/12/2010 -22/12/2010 -23/12/2010 -24/12/2010 -25/12/2010 -26/12/2010 -27/12/2010 -28/12/2010 -29/12/2010 -30/12/2010 -31/12/2010 -01/01/2011 -02/01/2011 -03/01/2011 -04/01/2011 -05/01/2011 -06/01/2011 -07/01/2011 -08/01/2011 -09/01/2011 -10/01/2011 -11/01/2011 -12/01/2011 -13/01/2011 -14/01/2011 -15/01/2011 -16/01/2011 -17/01/2011 -18/01/2011 -19/01/2011 -20/01/2011 -21/01/2011 -22/01/2011 -23/01/2011 -24/01/2011 -25/01/2011 -26/01/2011 -27/01/2011 -28/01/2011 -29/01/2011 -30/01/2011 -31/01/2011 -01/02/2011 -02/02/2011 -03/02/2011 -04/02/2011 -05/02/2011 -06/02/2011 -07/02/2011 -08/02/2011 -09/02/2011 -10/02/2011 -11/02/2011 -12/02/2011 -13/02/2011 -14/02/2011 -15/02/2011 -16/02/2011 -17/02/2011 -18/02/2011 -19/02/2011 -20/02/2011 -21/02/2011 -22/02/2011 -23/02/2011 -24/02/2011 -25/02/2011 -26/02/2011 -27/02/2011 -28/02/2011 -01/03/2011 -02/03/2011 -03/03/2011 -04/03/2011 -05/03/2011 -06/03/2011 -07/03/2011 -08/03/2011 -09/03/2011 -10/03/2011 -11/03/2011 -12/03/2011 -13/03/2011 -14/03/2011 -15/03/2011 -16/03/2011 -17/03/2011 -18/03/2011 -19/03/2011 -20/03/2011 -21/03/2011 -22/03/2011 -23/03/2011 -24/03/2011 -25/03/2011 -26/03/2011 -27/03/2011 -28/03/2011 -29/03/2011 -30/03/2011 -31/03/2011 -01/04/2011 -02/04/2011 -03/04/2011 -04/04/2011 -05/04/2011 -06/04/2011 -07/04/2011 -08/04/2011 -09/04/2011 -10/04/2011 -11/04/2011 -12/04/2011 -13/04/2011 -14/04/2011 -15/04/2011 -16/04/2011 -17/04/2011 -18/04/2011 -19/04/2011 -20/04/2011 -21/04/2011 -22/04/2011 -23/04/2011 -24/04/2011 -25/04/2011 -26/04/2011 -27/04/2011 -28/04/2011 -29/04/2011 -30/04/2011 -01/05/2011 -02/05/2011 -03/05/2011 -04/05/2011 -05/05/2011 -06/05/2011 -07/05/2011 -08/05/2011 -09/05/2011 -10/05/2011 -11/05/2011 -12/05/2011 -13/05/2011 -14/05/2011 -15/05/2011 -16/05/2011 -17/05/2011 -18/05/2011 -19/05/2011 -20/05/2011 -21/05/2011 -22/05/2011 -23/05/2011 -24/05/2011 -25/05/2011 -26/05/2011 -27/05/2011 -28/05/2011 -29/05/2011 -30/05/2011 -31/05/2011 -01/06/2011 -02/06/2011 -03/06/2011 -04/06/2011 -05/06/2011 -06/06/2011 -07/06/2011 -08/06/2011 -09/06/2011 -10/06/2011 -11/06/2011 -12/06/2011 -13/06/2011 -14/06/2011 -15/06/2011 -16/06/2011 -17/06/2011 -18/06/2011 -19/06/2011 -20/06/2011 -21/06/2011 -22/06/2011 -23/06/2011 -24/06/2011 -25/06/2011 -26/06/2011 -27/06/2011 -28/06/2011 -29/06/2011 -30/06/2011 -01/07/2011 -02/07/2011 -03/07/2011 -04/07/2011 -05/07/2011 -06/07/2011 -07/07/2011 -08/07/2011 -09/07/2011 -10/07/2011 -11/07/2011 -12/07/2011 -13/07/2011 -14/07/2011 -15/07/2011 -16/07/2011 -17/07/2011 -18/07/2011 -19/07/2011 -20/07/2011 -21/07/2011 -22/07/2011 -23/07/2011 -24/07/2011 -25/07/2011 -26/07/2011 -27/07/2011 -28/07/2011 -29/07/2011 -30/07/2011 -31/07/2011 -01/08/2011 -02/08/2011 -03/08/2011 -04/08/2011 -05/08/2011 -06/08/2011 -07/08/2011 -08/08/2011 -09/08/2011 -10/08/2011 -11/08/2011 -12/08/2011 -13/08/2011 -14/08/2011 -15/08/2011 -16/08/2011 -17/08/2011 -18/08/2011 -19/08/2011 -20/08/2011 -21/08/2011 -22/08/2011 -23/08/2011 -24/08/2011 -25/08/2011 -26/08/2011 -27/08/2011 -28/08/2011 -29/08/2011 -30/08/2011 -31/08/2011 -01/09/2011 -02/09/2011 -03/09/2011 -04/09/2011 -05/09/2011 -06/09/2011 -07/09/2011 -08/09/2011 -09/09/2011 -10/09/2011 -11/09/2011 -12/09/2011 -13/09/2011 -14/09/2011 -15/09/2011 -16/09/2011 -17/09/2011 -18/09/2011 -19/09/2011 -20/09/2011 -21/09/2011 -22/09/2011 -23/09/2011 -24/09/2011 -25/09/2011 -26/09/2011 -27/09/2011 -28/09/2011 -29/09/2011 -30/09/2011 -01/10/2011 -02/10/2011 -03/10/2011 -04/10/2011 -05/10/2011 -06/10/2011 -07/10/2011 -08/10/2011 -09/10/2011 -10/10/2011 -11/10/2011 -12/10/2011 -13/10/2011 -14/10/2011 -15/10/2011 -16/10/2011 -17/10/2011 -18/10/2011 -19/10/2011 -20/10/2011 -21/10/2011 -22/10/2011 -23/10/2011 -24/10/2011 -25/10/2011 -26/10/2011 -27/10/2011 -28/10/2011 -29/10/2011 -30/10/2011 -31/10/2011 -01/11/2011 -02/11/2011 -03/11/2011 -04/11/2011 -05/11/2011 -06/11/2011 -07/11/2011 -08/11/2011 -09/11/2011 -10/11/2011 -11/11/2011 -12/11/2011 -13/11/2011 -14/11/2011 -15/11/2011 -16/11/2011 -17/11/2011 -18/11/2011 -19/11/2011 -20/11/2011 -21/11/2011 -22/11/2011 -23/11/2011 -24/11/2011 -25/11/2011 -26/11/2011 -27/11/2011 -28/11/2011 -29/11/2011 -30/11/2011 -01/12/2011 -02/12/2011 -03/12/2011 -04/12/2011 -05/12/2011 -06/12/2011 -07/12/2011 -08/12/2011 -09/12/2011 -10/12/2011 -11/12/2011 -12/12/2011 -13/12/2011 -14/12/2011 -15/12/2011 -16/12/2011 -17/12/2011 -18/12/2011 -19/12/2011 -20/12/2011 -21/12/2011 -22/12/2011 -23/12/2011 -24/12/2011 -25/12/2011 -26/12/2011 -27/12/2011 -28/12/2011 -29/12/2011 -30/12/2011 -31/12/2011 -01/01/2012 -02/01/2012 -03/01/2012 -04/01/2012 -05/01/2012 -06/01/2012 -07/01/2012 -08/01/2012 -09/01/2012 -10/01/2012 -11/01/2012 -12/01/2012 -13/01/2012 -14/01/2012 -15/01/2012 -16/01/2012 -17/01/2012 -18/01/2012 -19/01/2012 -20/01/2012 -21/01/2012 -22/01/2012 -23/01/2012 -24/01/2012 -25/01/2012 -26/01/2012 -27/01/2012 -28/01/2012 -29/01/2012 -30/01/2012 -31/01/2012 -01/02/2012 -02/02/2012 -03/02/2012 -04/02/2012 -05/02/2012 -06/02/2012 -07/02/2012 -08/02/2012 -09/02/2012 -10/02/2012 -11/02/2012 -12/02/2012 -13/02/2012 -14/02/2012 -15/02/2012 -16/02/2012 -17/02/2012 -18/02/2012 -19/02/2012 -20/02/2012 -21/02/2012 -22/02/2012 -23/02/2012 -24/02/2012 -25/02/2012 -26/02/2012 -27/02/2012 -28/02/2012 -29/02/2012 -01/03/2012 -02/03/2012 -03/03/2012 -04/03/2012 -05/03/2012 -06/03/2012 -07/03/2012 -08/03/2012 -09/03/2012 -10/03/2012 -11/03/2012 -12/03/2012 -13/03/2012 -14/03/2012 -15/03/2012 -16/03/2012 -17/03/2012 -18/03/2012 -19/03/2012 -20/03/2012 -21/03/2012 -22/03/2012 -23/03/2012 -24/03/2012 -25/03/2012 -26/03/2012 -27/03/2012 -28/03/2012 -29/03/2012 -30/03/2012 -31/03/2012 -01/04/2012 -02/04/2012 -03/04/2012 -04/04/2012 -05/04/2012 -06/04/2012 -07/04/2012 -08/04/2012 -09/04/2012 -10/04/2012 -11/04/2012 -12/04/2012 -13/04/2012 -14/04/2012 -15/04/2012 -16/04/2012 -17/04/2012 -18/04/2012 -19/04/2012 -20/04/2012 -21/04/2012 -22/04/2012 -23/04/2012 -24/04/2012 -25/04/2012 -26/04/2012 -27/04/2012 -28/04/2012 -29/04/2012 -30/04/2012 -01/05/2012 -02/05/2012 -03/05/2012 -04/05/2012 -05/05/2012 -06/05/2012 -07/05/2012 -08/05/2012 -09/05/2012 -10/05/2012 -11/05/2012 -12/05/2012 -13/05/2012 -14/05/2012 -15/05/2012 -16/05/2012 -17/05/2012 -18/05/2012 -19/05/2012 -20/05/2012 -21/05/2012 -22/05/2012 -23/05/2012 -24/05/2012 -25/05/2012 -26/05/2012 -27/05/2012 -28/05/2012 -29/05/2012 -30/05/2012 -31/05/2012 -01/06/2012 -02/06/2012 -03/06/2012 -04/06/2012 -05/06/2012 -06/06/2012 -07/06/2012 -08/06/2012 -09/06/2012 -10/06/2012 -11/06/2012 -12/06/2012 -13/06/2012 -14/06/2012 -15/06/2012 -16/06/2012 -17/06/2012 -18/06/2012 -19/06/2012 -20/06/2012 -21/06/2012 -22/06/2012 -23/06/2012 -24/06/2012 -25/06/2012 -26/06/2012 -27/06/2012 -28/06/2012 -29/06/2012 -30/06/2012 -01/07/2012 -02/07/2012 -03/07/2012 -04/07/2012 -05/07/2012 -06/07/2012 -07/07/2012 -08/07/2012 -09/07/2012 -10/07/2012 -11/07/2012 -12/07/2012 -13/07/2012 -14/07/2012 -15/07/2012 -16/07/2012 -17/07/2012 -18/07/2012 -19/07/2012 -20/07/2012 -21/07/2012 -22/07/2012 -23/07/2012 -24/07/2012 -25/07/2012 -26/07/2012 -27/07/2012 -28/07/2012 -29/07/2012 -30/07/2012 -31/07/2012 -01/08/2012 -02/08/2012 -03/08/2012 -04/08/2012 -05/08/2012 -06/08/2012 -07/08/2012 -08/08/2012 -09/08/2012 -10/08/2012 -11/08/2012 -12/08/2012 -13/08/2012 -14/08/2012 -15/08/2012 -16/08/2012 -17/08/2012 -18/08/2012 -19/08/2012 -20/08/2012 -21/08/2012 -22/08/2012 -23/08/2012 -24/08/2012 -25/08/2012 -26/08/2012 -27/08/2012 -28/08/2012 -29/08/2012 -30/08/2012 -31/08/2012 -01/09/2012 -02/09/2012 -03/09/2012 -04/09/2012 -05/09/2012 -06/09/2012 -07/09/2012 -08/09/2012 -09/09/2012 -10/09/2012 -11/09/2012 -12/09/2012 -13/09/2012 -14/09/2012 -15/09/2012 -16/09/2012 -17/09/2012 -18/09/2012 -19/09/2012 -20/09/2012 -21/09/2012 -22/09/2012 -23/09/2012 -24/09/2012 -25/09/2012 -26/09/2012 -27/09/2012 -28/09/2012 -29/09/2012 -30/09/2012 -01/10/2012 -02/10/2012 -03/10/2012 -04/10/2012 -05/10/2012 -06/10/2012 -07/10/2012 -08/10/2012 -09/10/2012 -10/10/2012 -11/10/2012 -12/10/2012 -13/10/2012 -14/10/2012 -15/10/2012 -16/10/2012 -17/10/2012 -18/10/2012 -19/10/2012 -20/10/2012 -21/10/2012 -22/10/2012 -23/10/2012 -24/10/2012 -25/10/2012 -26/10/2012 -27/10/2012 -28/10/2012 -29/10/2012 -30/10/2012 -31/10/2012 -01/11/2012 -02/11/2012 -03/11/2012 -04/11/2012 -05/11/2012 -06/11/2012 -07/11/2012 -08/11/2012 -09/11/2012 -10/11/2012 -11/11/2012 -12/11/2012 -13/11/2012 -14/11/2012 -15/11/2012 -16/11/2012 -17/11/2012 -18/11/2012 -19/11/2012 -20/11/2012 -21/11/2012 -22/11/2012 -23/11/2012 -24/11/2012 -25/11/2012 -26/11/2012 -27/11/2012 -28/11/2012 -29/11/2012 -30/11/2012 -01/12/2012 -02/12/2012 -03/12/2012 -04/12/2012 -05/12/2012 -06/12/2012 -07/12/2012 -08/12/2012 -09/12/2012 -10/12/2012 -11/12/2012 -12/12/2012 -13/12/2012 -14/12/2012 -15/12/2012 -16/12/2012 -17/12/2012 -18/12/2012 -19/12/2012 -20/12/2012 -21/12/2012 -22/12/2012 -23/12/2012 -24/12/2012 -25/12/2012 -26/12/2012 -27/12/2012 -28/12/2012 -29/12/2012 -30/12/2012 -31/12/2012 -01/01/2013 -02/01/2013 -03/01/2013 -04/01/2013 -05/01/2013 -06/01/2013 -07/01/2013 -08/01/2013 -09/01/2013 -10/01/2013 -11/01/2013 -12/01/2013 -13/01/2013 -14/01/2013 -15/01/2013 -16/01/2013 -17/01/2013 -18/01/2013 -19/01/2013 -20/01/2013 -21/01/2013 -22/01/2013 -23/01/2013 -24/01/2013 -25/01/2013 -26/01/2013 -27/01/2013 -28/01/2013 -29/01/2013 -30/01/2013 -31/01/2013 -01/02/2013 -02/02/2013 -03/02/2013 -04/02/2013 -05/02/2013 -06/02/2013 -07/02/2013 -08/02/2013 -09/02/2013 -10/02/2013 -11/02/2013 -12/02/2013 -13/02/2013 -14/02/2013 -15/02/2013 -16/02/2013 -17/02/2013 -18/02/2013 -19/02/2013 -20/02/2013 -21/02/2013 -22/02/2013 -23/02/2013 -24/02/2013 -25/02/2013 -26/02/2013 -27/02/2013 -28/02/2013 -01/03/2013 -02/03/2013 -03/03/2013 -04/03/2013 -05/03/2013 -06/03/2013 -07/03/2013 -08/03/2013 -09/03/2013 -10/03/2013 -11/03/2013 -12/03/2013 -13/03/2013 -14/03/2013 -15/03/2013 -16/03/2013 -17/03/2013 -18/03/2013 -19/03/2013 -20/03/2013 -21/03/2013 -22/03/2013 -23/03/2013 -24/03/2013 -25/03/2013 -26/03/2013 -27/03/2013 -28/03/2013 -29/03/2013 -30/03/2013 -31/03/2013 -01/04/2013 -02/04/2013 -03/04/2013 -04/04/2013 -05/04/2013 -06/04/2013 -07/04/2013 -08/04/2013 -09/04/2013 -10/04/2013 -11/04/2013 -12/04/2013 -13/04/2013 -14/04/2013 -15/04/2013 -16/04/2013 -17/04/2013 -18/04/2013 -19/04/2013 -20/04/2013 -21/04/2013 -22/04/2013 -23/04/2013 -24/04/2013 -25/04/2013 -26/04/2013 -27/04/2013 -28/04/2013 -29/04/2013 -30/04/2013 -01/05/2013 -02/05/2013 -03/05/2013 -04/05/2013 -05/05/2013 -06/05/2013 -07/05/2013 -08/05/2013 -09/05/2013 -10/05/2013 -11/05/2013 -12/05/2013 -13/05/2013 -14/05/2013 -15/05/2013 -16/05/2013 -17/05/2013 -18/05/2013 -19/05/2013 -20/05/2013 -21/05/2013 -22/05/2013 -23/05/2013 -24/05/2013 -25/05/2013 -26/05/2013 -27/05/2013 -28/05/2013 -29/05/2013 -30/05/2013 -31/05/2013 -01/06/2013 -02/06/2013 -03/06/2013 -04/06/2013 -05/06/2013 -06/06/2013 -07/06/2013 -08/06/2013 -09/06/2013 -10/06/2013 -11/06/2013 -12/06/2013 -13/06/2013 -14/06/2013 -15/06/2013 -16/06/2013 -17/06/2013 -18/06/2013 -19/06/2013 -20/06/2013 -21/06/2013 -22/06/2013 -23/06/2013 -24/06/2013 -25/06/2013 -26/06/2013 -27/06/2013 -28/06/2013 -29/06/2013 -30/06/2013 -01/07/2013 -02/07/2013 -03/07/2013 -04/07/2013 -05/07/2013 -06/07/2013 -07/07/2013 -08/07/2013 -09/07/2013 -10/07/2013 -11/07/2013 -12/07/2013 -13/07/2013 -14/07/2013 -15/07/2013 -16/07/2013 -17/07/2013 -18/07/2013 -19/07/2013 -20/07/2013 -21/07/2013 -22/07/2013 -23/07/2013 -24/07/2013 -25/07/2013 -26/07/2013 -27/07/2013 -28/07/2013 -29/07/2013 -30/07/2013 -31/07/2013 -01/08/2013 -02/08/2013 -03/08/2013 -04/08/2013 -05/08/2013 -06/08/2013 -07/08/2013 -08/08/2013 -09/08/2013 -10/08/2013 -11/08/2013 -12/08/2013 -13/08/2013 -14/08/2013 -15/08/2013 -16/08/2013 -17/08/2013 -18/08/2013 -19/08/2013 -20/08/2013 -21/08/2013 -22/08/2013 -23/08/2013 -24/08/2013 -25/08/2013 -26/08/2013 -27/08/2013 -28/08/2013 -29/08/2013 -30/08/2013 -31/08/2013 -01/09/2013 -02/09/2013 -03/09/2013 -04/09/2013 -05/09/2013 -06/09/2013 -07/09/2013 -08/09/2013 -09/09/2013 -10/09/2013 -11/09/2013 -12/09/2013 -13/09/2013 -14/09/2013 -15/09/2013 -16/09/2013 -17/09/2013 -18/09/2013 -19/09/2013 -20/09/2013 -21/09/2013 -22/09/2013 -23/09/2013 -24/09/2013 -25/09/2013 -26/09/2013 -27/09/2013 -28/09/2013 -29/09/2013 -30/09/2013 -01/10/2013 -02/10/2013 -03/10/2013 -04/10/2013 -05/10/2013 -06/10/2013 -07/10/2013 -08/10/2013 -09/10/2013 -10/10/2013 -11/10/2013 -12/10/2013 -13/10/2013 -14/10/2013 -15/10/2013 -16/10/2013 -17/10/2013 -18/10/2013 -19/10/2013 -20/10/2013 -21/10/2013 -22/10/2013 -23/10/2013 -24/10/2013 -25/10/2013 -26/10/2013 -27/10/2013 -28/10/2013 -29/10/2013 -30/10/2013 -31/10/2013 -01/11/2013 -02/11/2013 -03/11/2013 -04/11/2013 -05/11/2013 -06/11/2013 -07/11/2013 -08/11/2013 -09/11/2013 -10/11/2013 -11/11/2013 -12/11/2013 -13/11/2013 -14/11/2013 -15/11/2013 -16/11/2013 -17/11/2013 -18/11/2013 -19/11/2013 -20/11/2013 -21/11/2013 -22/11/2013 -23/11/2013 -24/11/2013 -25/11/2013 -26/11/2013 -27/11/2013 -28/11/2013 -29/11/2013 -30/11/2013 -01/12/2013 -02/12/2013 -03/12/2013 -04/12/2013 -05/12/2013 -06/12/2013 -07/12/2013 -08/12/2013 -09/12/2013 -10/12/2013 -11/12/2013 -12/12/2013 -13/12/2013 -14/12/2013 -15/12/2013 -16/12/2013 -17/12/2013 -18/12/2013 -19/12/2013 -20/12/2013 -21/12/2013 -22/12/2013 -23/12/2013 -24/12/2013 -25/12/2013 -26/12/2013 -27/12/2013 -28/12/2013 -29/12/2013 -30/12/2013 -31/12/2013 -01/01/2014 -02/01/2014 -03/01/2014 -04/01/2014 -05/01/2014 -06/01/2014 -07/01/2014 -08/01/2014 -09/01/2014 -10/01/2014 -11/01/2014 -12/01/2014 -13/01/2014 -14/01/2014 -15/01/2014 -16/01/2014 -17/01/2014 -18/01/2014 -19/01/2014 -20/01/2014 -21/01/2014 -22/01/2014 -23/01/2014 -24/01/2014 -25/01/2014 -26/01/2014 -27/01/2014 -28/01/2014 -29/01/2014 -30/01/2014 -31/01/2014 -01/02/2014 -02/02/2014 -03/02/2014 -04/02/2014 -05/02/2014 -06/02/2014 -07/02/2014 -08/02/2014 -09/02/2014 -10/02/2014 -11/02/2014 -12/02/2014 -13/02/2014 -14/02/2014 -15/02/2014 -16/02/2014 -17/02/2014 -18/02/2014 -19/02/2014 -20/02/2014 -21/02/2014 -22/02/2014 -23/02/2014 -24/02/2014 -25/02/2014 -26/02/2014 -27/02/2014 -28/02/2014 -01/03/2014 -02/03/2014 -03/03/2014 -04/03/2014 -05/03/2014 -06/03/2014 -07/03/2014 -08/03/2014 -09/03/2014 -10/03/2014 -11/03/2014 -12/03/2014 -13/03/2014 -14/03/2014 -15/03/2014 -16/03/2014 -17/03/2014 -18/03/2014 -19/03/2014 -20/03/2014 -21/03/2014 -22/03/2014 -23/03/2014 -24/03/2014 -25/03/2014 -26/03/2014 -27/03/2014 -28/03/2014 -29/03/2014 -30/03/2014 -31/03/2014 -01/04/2014 -02/04/2014 -03/04/2014 -04/04/2014 -05/04/2014 -06/04/2014 -07/04/2014 -08/04/2014 -09/04/2014 -10/04/2014 -11/04/2014 -12/04/2014 -13/04/2014 -14/04/2014 -15/04/2014 -16/04/2014 -17/04/2014 -18/04/2014 -19/04/2014 -20/04/2014 -21/04/2014 -22/04/2014 -23/04/2014 -24/04/2014 -25/04/2014 -26/04/2014 -27/04/2014 -28/04/2014 -29/04/2014 -30/04/2014 -01/05/2014 -02/05/2014 -03/05/2014 -04/05/2014 -05/05/2014 -06/05/2014 -07/05/2014 -08/05/2014 -09/05/2014 -10/05/2014 -11/05/2014 -12/05/2014 -13/05/2014 -14/05/2014 -15/05/2014 -16/05/2014 -17/05/2014 -18/05/2014 -19/05/2014 -20/05/2014 -21/05/2014 -22/05/2014 -23/05/2014 -24/05/2014 -25/05/2014 -26/05/2014 -27/05/2014 -28/05/2014 -29/05/2014 -30/05/2014 -31/05/2014 -01/06/2014 -02/06/2014 -03/06/2014 -04/06/2014 -05/06/2014 -06/06/2014 -07/06/2014 -08/06/2014 -09/06/2014 -10/06/2014 -11/06/2014 -12/06/2014 -13/06/2014 -14/06/2014 -15/06/2014 -16/06/2014 -17/06/2014 -18/06/2014 -19/06/2014 -20/06/2014 -21/06/2014 -22/06/2014 -23/06/2014 -24/06/2014 -25/06/2014 -26/06/2014 -27/06/2014 -28/06/2014 -29/06/2014 -30/06/2014 -01/07/2014 -02/07/2014 -03/07/2014 -04/07/2014 -05/07/2014 -06/07/2014 -07/07/2014 -08/07/2014 -09/07/2014 -10/07/2014 -11/07/2014 -12/07/2014 -13/07/2014 -14/07/2014 -15/07/2014 -16/07/2014 -17/07/2014 -18/07/2014 -19/07/2014 -20/07/2014 -21/07/2014 -22/07/2014 -23/07/2014 -24/07/2014 -25/07/2014 -26/07/2014 -27/07/2014 -28/07/2014 -29/07/2014 -30/07/2014 -31/07/2014 -01/08/2014 -02/08/2014 -03/08/2014 -04/08/2014 -05/08/2014 -06/08/2014 -07/08/2014 -08/08/2014 -09/08/2014 -10/08/2014 -11/08/2014 -12/08/2014 -13/08/2014 -14/08/2014 -15/08/2014 -16/08/2014 -17/08/2014 -18/08/2014 -19/08/2014 -20/08/2014 -21/08/2014 -22/08/2014 -23/08/2014 -24/08/2014 -25/08/2014 -26/08/2014 -27/08/2014 -28/08/2014 -29/08/2014 -30/08/2014 -31/08/2014 -01/09/2014 -02/09/2014 -03/09/2014 -04/09/2014 -05/09/2014 -06/09/2014 -07/09/2014 -08/09/2014 -09/09/2014 -10/09/2014 -11/09/2014 -12/09/2014 -13/09/2014 -14/09/2014 -15/09/2014 -16/09/2014 -17/09/2014 -18/09/2014 -19/09/2014 -20/09/2014 -21/09/2014 -22/09/2014 -23/09/2014 -24/09/2014 -25/09/2014 -26/09/2014 -27/09/2014 -28/09/2014 -29/09/2014 -30/09/2014 -01/10/2014 -02/10/2014 -03/10/2014 -04/10/2014 -05/10/2014 -06/10/2014 -07/10/2014 -08/10/2014 -09/10/2014 -10/10/2014 -11/10/2014 -12/10/2014 -13/10/2014 -14/10/2014 -15/10/2014 -16/10/2014 -17/10/2014 -18/10/2014 -19/10/2014 -20/10/2014 -21/10/2014 -22/10/2014 -23/10/2014 -24/10/2014 -25/10/2014 -26/10/2014 -27/10/2014 -28/10/2014 -29/10/2014 -30/10/2014 -31/10/2014 -01/11/2014 -02/11/2014 -03/11/2014 -04/11/2014 -05/11/2014 -06/11/2014 -07/11/2014 -08/11/2014 -09/11/2014 -10/11/2014 -11/11/2014 -12/11/2014 -13/11/2014 -14/11/2014 -15/11/2014 -16/11/2014 -17/11/2014 -18/11/2014 -19/11/2014 -20/11/2014 -21/11/2014 -22/11/2014 -23/11/2014 -24/11/2014 -25/11/2014 -26/11/2014 -27/11/2014 -28/11/2014 -29/11/2014 -30/11/2014 -01/12/2014 -02/12/2014 -03/12/2014 -04/12/2014 -05/12/2014 -06/12/2014 -07/12/2014 -08/12/2014 -09/12/2014 -10/12/2014 -11/12/2014 -12/12/2014 -13/12/2014 -14/12/2014 -15/12/2014 -16/12/2014 -17/12/2014 -18/12/2014 -19/12/2014 -20/12/2014 -21/12/2014 -22/12/2014 -23/12/2014 -24/12/2014 -25/12/2014 -26/12/2014 -27/12/2014 -28/12/2014 -29/12/2014 -30/12/2014 -31/12/2014 -01/01/2015 -02/01/2015 -03/01/2015 -04/01/2015 -05/01/2015 -06/01/2015 -07/01/2015 -08/01/2015 -09/01/2015 -10/01/2015 -11/01/2015 -12/01/2015 -13/01/2015 -14/01/2015 -15/01/2015 -16/01/2015 -17/01/2015 -18/01/2015 -19/01/2015 -20/01/2015 -21/01/2015 -22/01/2015 -23/01/2015 -24/01/2015 -25/01/2015 -26/01/2015 -27/01/2015 -28/01/2015 -29/01/2015 -30/01/2015 -31/01/2015 -01/02/2015 -02/02/2015 -03/02/2015 -04/02/2015 -05/02/2015 -06/02/2015 -07/02/2015 -08/02/2015 -09/02/2015 -10/02/2015 -11/02/2015 -12/02/2015 -13/02/2015 -14/02/2015 -15/02/2015 -16/02/2015 -17/02/2015 -18/02/2015 -19/02/2015 -20/02/2015 -21/02/2015 -22/02/2015 -23/02/2015 -24/02/2015 -25/02/2015 -26/02/2015 -27/02/2015 -28/02/2015 -01/03/2015 -02/03/2015 -03/03/2015 -04/03/2015 -05/03/2015 -06/03/2015 -07/03/2015 -08/03/2015 -09/03/2015 -10/03/2015 -11/03/2015 -12/03/2015 -13/03/2015 -14/03/2015 -15/03/2015 -16/03/2015 -17/03/2015 -18/03/2015 -19/03/2015 -20/03/2015 -21/03/2015 -22/03/2015 -23/03/2015 -24/03/2015 -25/03/2015 -26/03/2015 -27/03/2015 -28/03/2015 -29/03/2015 -30/03/2015 -31/03/2015 -01/04/2015 -02/04/2015 -03/04/2015 -04/04/2015 -05/04/2015 -06/04/2015 -07/04/2015 -08/04/2015 -09/04/2015 -10/04/2015 -11/04/2015 -12/04/2015 -13/04/2015 -14/04/2015 -15/04/2015 -16/04/2015 -17/04/2015 -18/04/2015 -19/04/2015 -20/04/2015 -21/04/2015 -22/04/2015 -23/04/2015 -24/04/2015 -25/04/2015 -26/04/2015 -27/04/2015 -28/04/2015 -29/04/2015 -30/04/2015 -01/05/2015 -02/05/2015 -03/05/2015 -04/05/2015 -05/05/2015 -06/05/2015 -07/05/2015 -08/05/2015 -09/05/2015 -10/05/2015 -11/05/2015 -12/05/2015 -13/05/2015 -14/05/2015 -15/05/2015 -16/05/2015 -17/05/2015 -18/05/2015 -19/05/2015 -20/05/2015 -21/05/2015 -22/05/2015 -23/05/2015 -24/05/2015 -25/05/2015 -26/05/2015 -27/05/2015 -28/05/2015 -29/05/2015 -30/05/2015 -31/05/2015 -01/06/2015 -02/06/2015 -03/06/2015 -04/06/2015 -05/06/2015 -06/06/2015 -07/06/2015 -08/06/2015 -09/06/2015 -10/06/2015 -11/06/2015 -12/06/2015 -13/06/2015 -14/06/2015 -15/06/2015 -16/06/2015 -17/06/2015 -18/06/2015 -19/06/2015 -20/06/2015 -21/06/2015 -22/06/2015 -23/06/2015 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/snake_oil.ert b/ThirdParty/Ert/test-data/local/snake_oil/snake_oil.ert deleted file mode 100644 index e3dfe76b53..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil/snake_oil.ert +++ /dev/null @@ -1,39 +0,0 @@ -QUEUE_SYSTEM LOCAL - -JOBNAME SNAKE_OIL_%d -NUM_REALIZATIONS 25 - -DEFINE storage/ - -STORE_SEED SEED -LOAD_SEED SEED - -RUNPATH /runpath/realisation-%d/iter-%d -ENSPATH /ensemble -ECLBASE SNAKE_OIL_FIELD -SUMMARY * - -HISTORY_SOURCE REFCASE_HISTORY -REFCASE refcase/SNAKE_OIL_FIELD - -TIME_MAP refcase/time_map.txt -OBS_CONFIG observations/observations.txt - -INSTALL_JOB SNAKE_OIL_SIMULATOR jobs/SNAKE_OIL_SIMULATOR -INSTALL_JOB SNAKE_OIL_NPV jobs/SNAKE_OIL_NPV -INSTALL_JOB SNAKE_OIL_DIFF jobs/SNAKE_OIL_DIFF - -FORWARD_MODEL SNAKE_OIL_SIMULATOR -FORWARD_MODEL SNAKE_OIL_NPV -FORWARD_MODEL SNAKE_OIL_DIFF - -RUN_TEMPLATE templates/seed_template.txt seed.txt -GEN_KW SNAKE_OIL_PARAM templates/snake_oil_template.txt snake_oil_params.txt parameters/snake_oil_parameters.txt -CUSTOM_KW SNAKE_OIL_NPV snake_oil_npv.txt -GEN_DATA SNAKE_OIL_OPR_DIFF INPUT_FORMAT:ASCII RESULT_FILE:snake_oil_opr_diff_%d.txt REPORT_STEPS:199 -GEN_DATA SNAKE_OIL_WPR_DIFF INPUT_FORMAT:ASCII RESULT_FILE:snake_oil_wpr_diff_%d.txt REPORT_STEPS:199 -GEN_DATA SNAKE_OIL_GPR_DIFF INPUT_FORMAT:ASCII RESULT_FILE:snake_oil_gpr_diff_%d.txt REPORT_STEPS:199 - -LOG_LEVEL 3 -LOG_FILE log/log.txt -UPDATE_LOG_PATH log/update diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/current_case b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/current_case deleted file mode 100644 index abe2ad0fa3..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/current_case +++ /dev/null @@ -1 +0,0 @@ -default_0 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/0199/files/SNAKE_OIL_GPR_DIFF_active b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/0199/files/SNAKE_OIL_GPR_DIFF_active deleted file mode 100644 index 200047ee9e..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/0199/files/SNAKE_OIL_GPR_DIFF_active and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/0199/files/SNAKE_OIL_OPR_DIFF_active b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/0199/files/SNAKE_OIL_OPR_DIFF_active deleted file mode 100644 index 200047ee9e..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/0199/files/SNAKE_OIL_OPR_DIFF_active and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/0199/files/SNAKE_OIL_WPR_DIFF_active b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/0199/files/SNAKE_OIL_WPR_DIFF_active deleted file mode 100644 index 200047ee9e..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/0199/files/SNAKE_OIL_WPR_DIFF_active and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/FORECAST.data_0 deleted file mode 100644 index f903ae21cf..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/FORECAST.index deleted file mode 100644 index ea3e7b2759..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/PARAMETER.data_0 deleted file mode 100644 index 914e758e0a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/PARAMETER.index deleted file mode 100644 index 394a6acddb..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_0/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/FORECAST.data_0 deleted file mode 100644 index a0c416f1a2..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/FORECAST.index deleted file mode 100644 index b13f099382..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/PARAMETER.data_0 deleted file mode 100644 index c729e0adca..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/PARAMETER.index deleted file mode 100644 index 7faf5e3e70..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_1/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/FORECAST.data_0 deleted file mode 100644 index b3afe7d7da..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/FORECAST.index deleted file mode 100644 index 4c4f038743..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/PARAMETER.data_0 deleted file mode 100644 index 89089d51ff..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/PARAMETER.index deleted file mode 100644 index 9ae730ac13..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_10/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/FORECAST.data_0 deleted file mode 100644 index e449618e19..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/FORECAST.index deleted file mode 100644 index fcba30db17..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/PARAMETER.data_0 deleted file mode 100644 index 8901a336c2..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/PARAMETER.index deleted file mode 100644 index a1761eace2..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_11/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/FORECAST.data_0 deleted file mode 100644 index bda1686421..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/FORECAST.index deleted file mode 100644 index 74511a9abc..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/PARAMETER.data_0 deleted file mode 100644 index 38f6f229be..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/PARAMETER.index deleted file mode 100644 index 7ed2b239ba..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_12/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/FORECAST.data_0 deleted file mode 100644 index e3e9a7b88f..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/FORECAST.index deleted file mode 100644 index 3f775f8853..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/PARAMETER.data_0 deleted file mode 100644 index e81f2dac3a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/PARAMETER.index deleted file mode 100644 index eb7291b587..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_13/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/FORECAST.data_0 deleted file mode 100644 index e13ec6e9e9..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/FORECAST.index deleted file mode 100644 index 56143a90b4..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/PARAMETER.data_0 deleted file mode 100644 index 7abd7ab116..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/PARAMETER.index deleted file mode 100644 index 5e147e8afa..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_14/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/FORECAST.data_0 deleted file mode 100644 index f7a62199f5..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/FORECAST.index deleted file mode 100644 index fa19a420df..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/PARAMETER.data_0 deleted file mode 100644 index d5a3cc93ac..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/PARAMETER.index deleted file mode 100644 index 3e91b06866..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_15/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/FORECAST.data_0 deleted file mode 100644 index 1255e298ae..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/FORECAST.index deleted file mode 100644 index 1460540829..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/PARAMETER.data_0 deleted file mode 100644 index 0f7fb022ce..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/PARAMETER.index deleted file mode 100644 index 863806367a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_16/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/FORECAST.data_0 deleted file mode 100644 index 6cccb3e4dc..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/FORECAST.index deleted file mode 100644 index f1908387fb..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/PARAMETER.data_0 deleted file mode 100644 index e6042a0cb4..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/PARAMETER.index deleted file mode 100644 index 796c562bd6..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_17/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/FORECAST.data_0 deleted file mode 100644 index 5c1128da5f..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/FORECAST.index deleted file mode 100644 index 3c5f22a423..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/PARAMETER.data_0 deleted file mode 100644 index 5ac5e6633b..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/PARAMETER.index deleted file mode 100644 index 31f31b7c81..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_18/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/FORECAST.data_0 deleted file mode 100644 index eb0f346253..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/FORECAST.index deleted file mode 100644 index 7181e4036c..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/PARAMETER.data_0 deleted file mode 100644 index b9393bd3d1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/PARAMETER.index deleted file mode 100644 index bc3f4758ad..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_19/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/FORECAST.data_0 deleted file mode 100644 index d684b0e58a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/FORECAST.index deleted file mode 100644 index 560a822527..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/PARAMETER.data_0 deleted file mode 100644 index 1b78159dc1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/PARAMETER.index deleted file mode 100644 index 98e78da568..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_2/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/FORECAST.data_0 deleted file mode 100644 index 0193c9858f..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/FORECAST.index deleted file mode 100644 index 62cfffa12c..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/PARAMETER.data_0 deleted file mode 100644 index f804b9c01b..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/PARAMETER.index deleted file mode 100644 index bacebc6b31..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_20/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/FORECAST.data_0 deleted file mode 100644 index d0f0b09d96..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/FORECAST.index deleted file mode 100644 index 827472ecd2..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/PARAMETER.data_0 deleted file mode 100644 index ba2c8fcb43..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/PARAMETER.index deleted file mode 100644 index bbc36c7045..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_21/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/FORECAST.data_0 deleted file mode 100644 index 38299e9bad..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/FORECAST.index deleted file mode 100644 index 93b2a8a40f..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/PARAMETER.data_0 deleted file mode 100644 index 0be9c7bd1b..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/PARAMETER.index deleted file mode 100644 index 8775a960fb..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_22/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/FORECAST.data_0 deleted file mode 100644 index cc4636a3ae..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/FORECAST.index deleted file mode 100644 index 457dbed536..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/PARAMETER.data_0 deleted file mode 100644 index ef0f06cab0..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/PARAMETER.index deleted file mode 100644 index 5cead4c75c..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_23/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/FORECAST.data_0 deleted file mode 100644 index 6288c34a79..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/FORECAST.index deleted file mode 100644 index fe66f53d31..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/PARAMETER.data_0 deleted file mode 100644 index 41ecb4c3a6..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/PARAMETER.index deleted file mode 100644 index db5e6dd43d..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_24/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/FORECAST.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/PARAMETER.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_25/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/FORECAST.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/PARAMETER.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_26/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/FORECAST.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/PARAMETER.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_27/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/FORECAST.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/PARAMETER.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_28/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/FORECAST.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/PARAMETER.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_29/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/FORECAST.data_0 deleted file mode 100644 index d712b2fd9f..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/FORECAST.index deleted file mode 100644 index ecdfc3d830..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/PARAMETER.data_0 deleted file mode 100644 index a137a5e6b1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/PARAMETER.index deleted file mode 100644 index 76c019a3a7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_3/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/FORECAST.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/PARAMETER.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_30/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/FORECAST.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/PARAMETER.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_31/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/FORECAST.data_0 deleted file mode 100644 index 732dacdc28..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/FORECAST.index deleted file mode 100644 index ca34110546..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/PARAMETER.data_0 deleted file mode 100644 index 7f52a5fe22..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/PARAMETER.index deleted file mode 100644 index 78ef983cb5..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_4/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/FORECAST.data_0 deleted file mode 100644 index fbe0a4b97a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/FORECAST.index deleted file mode 100644 index 55f38217c3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/PARAMETER.data_0 deleted file mode 100644 index 2f431ce03d..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/PARAMETER.index deleted file mode 100644 index 2cda545a60..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_5/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/FORECAST.data_0 deleted file mode 100644 index b45e5214a8..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/FORECAST.index deleted file mode 100644 index 4fb2f8d61d..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/PARAMETER.data_0 deleted file mode 100644 index 3023b7b1ca..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/PARAMETER.index deleted file mode 100644 index 28ddb9559c..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_6/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/FORECAST.data_0 deleted file mode 100644 index 86542a2006..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/FORECAST.index deleted file mode 100644 index 78b322106e..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/PARAMETER.data_0 deleted file mode 100644 index 05dee2ddd2..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/PARAMETER.index deleted file mode 100644 index 0cb9ab22af..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_7/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/FORECAST.data_0 deleted file mode 100644 index a7e80be3b9..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/FORECAST.index deleted file mode 100644 index 865dde56f7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/PARAMETER.data_0 deleted file mode 100644 index 7664ed432b..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/PARAMETER.index deleted file mode 100644 index 113befd57e..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_8/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/ANALYZED.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/FORECAST.data_0 deleted file mode 100644 index f1417e17ce..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/FORECAST.index deleted file mode 100644 index c661372176..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/PARAMETER.data_0 deleted file mode 100644 index 3ec5272b40..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/PARAMETER.index deleted file mode 100644 index 9a2da48679..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/STATIC.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Ensemble/mod_9/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Index/INDEX.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Index/INDEX.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Index/INDEX.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Index/INDEX.index deleted file mode 100644 index 4377afdcd7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Index/INDEX.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Index/INDEX.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Index/INDEX.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/Index/INDEX.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/ert_fstab b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/ert_fstab deleted file mode 100644 index a5d67ad3a3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/ert_fstab and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/files/case_config b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/files/case_config deleted file mode 100644 index 593f4708db..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/files/case_config and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/files/custom_kw_config_set b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/files/custom_kw_config_set deleted file mode 100644 index ec71bfdcb0..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/files/custom_kw_config_set and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/files/state-map b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/files/state-map deleted file mode 100644 index 847546ba7a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/files/state-map and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/files/summary-key-set b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/files/summary-key-set deleted file mode 100644 index 374e250937..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/files/summary-key-set and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/files/time-map b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/files/time-map deleted file mode 100644 index 75e73e5c3c..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_0/files/time-map and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/FORECAST.data_0 deleted file mode 100644 index 7712e6890c..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/FORECAST.index deleted file mode 100644 index 2ec82d5de2..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/PARAMETER.data_0 deleted file mode 100644 index 7a759415c8..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/PARAMETER.index deleted file mode 100644 index 124fd15292..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_0/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/FORECAST.data_0 deleted file mode 100644 index f6cc9a9d7e..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/FORECAST.index deleted file mode 100644 index afa1d3eb13..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/PARAMETER.data_0 deleted file mode 100644 index 69a76c69ef..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/PARAMETER.index deleted file mode 100644 index b3d275e53f..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_1/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/FORECAST.data_0 deleted file mode 100644 index 9088aaea34..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/FORECAST.index deleted file mode 100644 index 6491ad708a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/PARAMETER.data_0 deleted file mode 100644 index d13d1306c1..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/PARAMETER.index deleted file mode 100644 index f7a5c2b1ce..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_10/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/FORECAST.data_0 deleted file mode 100644 index bd132b8b6a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/FORECAST.index deleted file mode 100644 index aa96a8a85c..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/PARAMETER.data_0 deleted file mode 100644 index 8dbe842ea4..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/PARAMETER.index deleted file mode 100644 index 93ec9e230f..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_11/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/FORECAST.data_0 deleted file mode 100644 index e13367c600..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/FORECAST.index deleted file mode 100644 index c32bea2654..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/PARAMETER.data_0 deleted file mode 100644 index 06192b663d..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/PARAMETER.index deleted file mode 100644 index 1b3e2dd2fb..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_12/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/FORECAST.data_0 deleted file mode 100644 index 88f2616412..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/FORECAST.index deleted file mode 100644 index c9cabd67fe..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/PARAMETER.data_0 deleted file mode 100644 index 0f77feb613..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/PARAMETER.index deleted file mode 100644 index 28e06a2b12..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_13/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/FORECAST.data_0 deleted file mode 100644 index 15ba295ff2..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/FORECAST.index deleted file mode 100644 index b0f52d5067..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/PARAMETER.data_0 deleted file mode 100644 index e8778073dc..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/PARAMETER.index deleted file mode 100644 index 4a3adecf64..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_14/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/FORECAST.data_0 deleted file mode 100644 index ca6fcfd5b5..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/FORECAST.index deleted file mode 100644 index 2852e1d32f..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/PARAMETER.data_0 deleted file mode 100644 index 30b22bb326..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/PARAMETER.index deleted file mode 100644 index d72eca1831..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_15/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/FORECAST.data_0 deleted file mode 100644 index f1a07702af..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/FORECAST.index deleted file mode 100644 index aca2e32260..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/PARAMETER.data_0 deleted file mode 100644 index f29b9e20c3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/PARAMETER.index deleted file mode 100644 index 25fdec4685..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_16/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/FORECAST.data_0 deleted file mode 100644 index a33bfb12cb..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/FORECAST.index deleted file mode 100644 index 2f9c397b4d..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/PARAMETER.data_0 deleted file mode 100644 index 6e82c5c2db..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/PARAMETER.index deleted file mode 100644 index 4dc7149bcf..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_17/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/FORECAST.data_0 deleted file mode 100644 index 7c069ba069..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/FORECAST.index deleted file mode 100644 index d3ad129f4d..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/PARAMETER.data_0 deleted file mode 100644 index 91e1000417..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/PARAMETER.index deleted file mode 100644 index 8137e1e626..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_18/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/FORECAST.data_0 deleted file mode 100644 index 5ad52e627a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/FORECAST.index deleted file mode 100644 index 8006b4ea6a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/PARAMETER.data_0 deleted file mode 100644 index 487f09c68f..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/PARAMETER.index deleted file mode 100644 index 97668fe2ba..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_19/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/FORECAST.data_0 deleted file mode 100644 index d2f61efb51..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/FORECAST.index deleted file mode 100644 index 1e38fe0e2b..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/PARAMETER.data_0 deleted file mode 100644 index 96b186a466..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/PARAMETER.index deleted file mode 100644 index cfc51a05e8..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_2/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/FORECAST.data_0 deleted file mode 100644 index 982a2723e3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/FORECAST.index deleted file mode 100644 index 9b280c1568..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/PARAMETER.data_0 deleted file mode 100644 index 86829b2270..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/PARAMETER.index deleted file mode 100644 index c33aed0d8a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_20/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/FORECAST.data_0 deleted file mode 100644 index 3bc4bc3caa..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/FORECAST.index deleted file mode 100644 index fe0f0d7c2f..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/PARAMETER.data_0 deleted file mode 100644 index 7873a46f81..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/PARAMETER.index deleted file mode 100644 index 1cf58d702b..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_21/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/FORECAST.data_0 deleted file mode 100644 index 367a2add56..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/FORECAST.index deleted file mode 100644 index 432db22d86..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/PARAMETER.data_0 deleted file mode 100644 index ae315352ba..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/PARAMETER.index deleted file mode 100644 index e4ae83c833..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_22/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/FORECAST.data_0 deleted file mode 100644 index 8b9b240ee5..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/FORECAST.index deleted file mode 100644 index f086160709..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/PARAMETER.data_0 deleted file mode 100644 index 8e6f6150a0..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/PARAMETER.index deleted file mode 100644 index 81a864974b..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_23/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/FORECAST.data_0 deleted file mode 100644 index f948378ae4..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/FORECAST.index deleted file mode 100644 index 635db16f6f..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/PARAMETER.data_0 deleted file mode 100644 index dc0a0e1631..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/PARAMETER.index deleted file mode 100644 index 105c02c7b8..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_24/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/FORECAST.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/PARAMETER.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_25/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/FORECAST.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/PARAMETER.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_26/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/FORECAST.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/PARAMETER.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_27/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/FORECAST.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/PARAMETER.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_28/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/FORECAST.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/PARAMETER.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_29/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/FORECAST.data_0 deleted file mode 100644 index b36f758a29..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/FORECAST.index deleted file mode 100644 index e3a507872d..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/PARAMETER.data_0 deleted file mode 100644 index b1f41588e5..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/PARAMETER.index deleted file mode 100644 index 14e4241100..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_3/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/FORECAST.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/PARAMETER.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_30/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/FORECAST.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/FORECAST.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/PARAMETER.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/PARAMETER.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_31/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/FORECAST.data_0 deleted file mode 100644 index afb802c53b..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/FORECAST.index deleted file mode 100644 index e7bdf52f5a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/PARAMETER.data_0 deleted file mode 100644 index 01708a37a9..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/PARAMETER.index deleted file mode 100644 index fec5f5d82e..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_4/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/FORECAST.data_0 deleted file mode 100644 index 808f1841fb..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/FORECAST.index deleted file mode 100644 index 3fb65418a0..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/PARAMETER.data_0 deleted file mode 100644 index 7ae7c0f6cd..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/PARAMETER.index deleted file mode 100644 index 0018eecf4c..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_5/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/FORECAST.data_0 deleted file mode 100644 index 6142d1e6a8..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/FORECAST.index deleted file mode 100644 index 2ac26beb09..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/PARAMETER.data_0 deleted file mode 100644 index b0d6438d5e..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/PARAMETER.index deleted file mode 100644 index 031003b32e..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_6/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/FORECAST.data_0 deleted file mode 100644 index ab1521c915..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/FORECAST.index deleted file mode 100644 index aa3e002d22..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/PARAMETER.data_0 deleted file mode 100644 index 5f970b15fd..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/PARAMETER.index deleted file mode 100644 index d2054df4c9..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_7/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/FORECAST.data_0 deleted file mode 100644 index 41d0a4aaa7..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/FORECAST.index deleted file mode 100644 index 6803d23177..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/PARAMETER.data_0 deleted file mode 100644 index b2a3976b54..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/PARAMETER.index deleted file mode 100644 index 506140f1b5..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_8/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/ANALYZED.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/ANALYZED.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/ANALYZED.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/ANALYZED.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/ANALYZED.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/ANALYZED.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/ANALYZED.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/ANALYZED.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/FORECAST.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/FORECAST.data_0 deleted file mode 100644 index ed5fbcde99..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/FORECAST.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/FORECAST.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/FORECAST.index deleted file mode 100644 index 1f1df9fac4..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/FORECAST.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/FORECAST.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/FORECAST.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/FORECAST.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/PARAMETER.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/PARAMETER.data_0 deleted file mode 100644 index 9c68873c7a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/PARAMETER.data_0 and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/PARAMETER.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/PARAMETER.index deleted file mode 100644 index e62045d14a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/PARAMETER.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/PARAMETER.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/PARAMETER.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/PARAMETER.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/STATIC.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/STATIC.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/STATIC.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/STATIC.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/STATIC.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/STATIC.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/STATIC.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Ensemble/mod_9/STATIC.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Index/INDEX.data_0 b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Index/INDEX.data_0 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Index/INDEX.index b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Index/INDEX.index deleted file mode 100644 index 6ae8e93535..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Index/INDEX.index and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Index/INDEX.mnt b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Index/INDEX.mnt deleted file mode 100644 index 5280360395..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/Index/INDEX.mnt and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/ert_fstab b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/ert_fstab deleted file mode 100644 index a5d67ad3a3..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/ert_fstab and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/files/case_config b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/files/case_config deleted file mode 100644 index 593f4708db..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/files/case_config and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/files/custom_kw_config_set b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/files/custom_kw_config_set deleted file mode 100644 index ec71bfdcb0..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/files/custom_kw_config_set and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/files/state-map b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/files/state-map deleted file mode 100644 index 847546ba7a..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/files/state-map and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/files/summary-key-set b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/files/summary-key-set deleted file mode 100644 index 374e250937..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/files/summary-key-set and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/files/time-map b/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/files/time-map deleted file mode 100644 index 75e73e5c3c..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil/storage/snake_oil/ensemble/default_1/files/time-map and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil/templates/seed_template.txt b/ThirdParty/Ert/test-data/local/snake_oil/templates/seed_template.txt deleted file mode 100644 index a0bca49fbd..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil/templates/seed_template.txt +++ /dev/null @@ -1 +0,0 @@ -SEED: \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil/templates/snake_oil_template.txt b/ThirdParty/Ert/test-data/local/snake_oil/templates/snake_oil_template.txt deleted file mode 100644 index ad2c648a0b..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil/templates/snake_oil_template.txt +++ /dev/null @@ -1,10 +0,0 @@ -OP1_PERSISTENCE: -OP1_OCTAVES: -OP1_DIVERGENCE_SCALE: -OP1_OFFSET: -OP2_PERSISTENCE: -OP2_OCTAVES: -OP2_DIVERGENCE_SCALE: -OP2_OFFSET: -BPR_555_PERSISTENCE: -BPR_138_PERSISTENCE: diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/SEED b/ThirdParty/Ert/test-data/local/snake_oil_field/SEED deleted file mode 100644 index 314cda88f6..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/SEED +++ /dev/null @@ -1 +0,0 @@ -67 -110 42 -42 106 34 96 0 18 42 76 -69 44 -40 -78 -61 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx0.grdecl b/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx0.grdecl deleted file mode 100644 index 481f9d8b83..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx0.grdecl +++ /dev/null @@ -1,127 +0,0 @@ -PERMX - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 - 0.92063643E-01 0.92063643E-01 0.92063643E-01 0.92063643E-01 -/ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx1.grdecl b/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx1.grdecl deleted file mode 100644 index 03959ed75a..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx1.grdecl +++ /dev/null @@ -1,127 +0,0 @@ -PERMX - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 - 0.53819609E+00 0.53819609E+00 0.53819609E+00 0.53819609E+00 -/ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx2.grdecl b/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx2.grdecl deleted file mode 100644 index 7d8e9bb96a..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx2.grdecl +++ /dev/null @@ -1,127 +0,0 @@ -PERMX - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 - 0.84981030E+00 0.84981030E+00 0.84981030E+00 0.84981030E+00 -/ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx3.grdecl b/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx3.grdecl deleted file mode 100644 index 5b733e38b2..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx3.grdecl +++ /dev/null @@ -1,127 +0,0 @@ -PERMX - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 - 0.24182262E+00 0.24182262E+00 0.24182262E+00 0.24182262E+00 -/ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx4.grdecl b/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx4.grdecl deleted file mode 100644 index 39a483cea1..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx4.grdecl +++ /dev/null @@ -1,127 +0,0 @@ -PERMX - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 - 0.59172921E-01 0.59172921E-01 0.59172921E-01 0.59172921E-01 -/ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx5.grdecl b/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx5.grdecl deleted file mode 100644 index 9286ac8ec9..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx5.grdecl +++ /dev/null @@ -1,127 +0,0 @@ -PERMX - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 - 0.76347315E+00 0.76347315E+00 0.76347315E+00 0.76347315E+00 -/ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx6.grdecl b/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx6.grdecl deleted file mode 100644 index 8e33d568fe..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx6.grdecl +++ /dev/null @@ -1,127 +0,0 @@ -PERMX - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 - 0.37705892E+00 0.37705892E+00 0.37705892E+00 0.37705892E+00 -/ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx7.grdecl b/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx7.grdecl deleted file mode 100644 index 399a9fc9d0..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx7.grdecl +++ /dev/null @@ -1,127 +0,0 @@ -PERMX - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 - 0.84188782E-01 0.84188782E-01 0.84188782E-01 0.84188782E-01 -/ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx8.grdecl b/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx8.grdecl deleted file mode 100644 index ec1f83277b..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx8.grdecl +++ /dev/null @@ -1,127 +0,0 @@ -PERMX - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 - 0.52828066E-01 0.52828066E-01 0.52828066E-01 0.52828066E-01 -/ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx9.grdecl b/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx9.grdecl deleted file mode 100644 index 02dd5a1a0e..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/permx9.grdecl +++ /dev/null @@ -1,127 +0,0 @@ -PERMX - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 - 0.67972553E+00 0.67972553E+00 0.67972553E+00 0.67972553E+00 -/ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro0.grdecl b/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro0.grdecl deleted file mode 100644 index b6075fa61d..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro0.grdecl +++ /dev/null @@ -1,127 +0,0 @@ -PORO - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 - 0.94346166E+00 0.94346166E+00 0.94346166E+00 0.94346166E+00 -/ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro1.grdecl b/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro1.grdecl deleted file mode 100644 index e814818eb8..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro1.grdecl +++ /dev/null @@ -1,127 +0,0 @@ -PORO - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 - 0.68036640E+00 0.68036640E+00 0.68036640E+00 0.68036640E+00 -/ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro2.grdecl b/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro2.grdecl deleted file mode 100644 index ba3eb9d6e8..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro2.grdecl +++ /dev/null @@ -1,127 +0,0 @@ -PORO - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 - 0.21387884E+00 0.21387884E+00 0.21387884E+00 0.21387884E+00 -/ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro3.grdecl b/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro3.grdecl deleted file mode 100644 index f276fb55a3..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro3.grdecl +++ /dev/null @@ -1,127 +0,0 @@ -PORO - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 - 0.72398102E+00 0.72398102E+00 0.72398102E+00 0.72398102E+00 -/ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro4.grdecl b/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro4.grdecl deleted file mode 100644 index 934fecb3ed..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro4.grdecl +++ /dev/null @@ -1,127 +0,0 @@ -PORO - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 - 0.68414760E+00 0.68414760E+00 0.68414760E+00 0.68414760E+00 -/ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro5.grdecl b/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro5.grdecl deleted file mode 100644 index b0448eb974..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro5.grdecl +++ /dev/null @@ -1,127 +0,0 @@ -PORO - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 - 0.81912923E+00 0.81912923E+00 0.81912923E+00 0.81912923E+00 -/ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro6.grdecl b/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro6.grdecl deleted file mode 100644 index 919c438a61..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro6.grdecl +++ /dev/null @@ -1,127 +0,0 @@ -PORO - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 - 0.43541095E+00 0.43541095E+00 0.43541095E+00 0.43541095E+00 -/ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro7.grdecl b/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro7.grdecl deleted file mode 100644 index f8a6beed8d..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro7.grdecl +++ /dev/null @@ -1,127 +0,0 @@ -PORO - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 - 0.48421845E+00 0.48421845E+00 0.48421845E+00 0.48421845E+00 -/ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro8.grdecl b/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro8.grdecl deleted file mode 100644 index 285e34c970..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro8.grdecl +++ /dev/null @@ -1,127 +0,0 @@ -PORO - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 - 0.98167807E+00 0.98167807E+00 0.98167807E+00 0.98167807E+00 -/ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro9.grdecl b/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro9.grdecl deleted file mode 100644 index 1b0faeefd0..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/fields/poro9.grdecl +++ /dev/null @@ -1,127 +0,0 @@ -PORO - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 - 0.82837886E+00 0.82837886E+00 0.82837886E+00 0.82837886E+00 -/ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/grid/CASE.EGRID b/ThirdParty/Ert/test-data/local/snake_oil_field/grid/CASE.EGRID deleted file mode 100644 index 33da9f7a70..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil_field/grid/CASE.EGRID and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/jobs/SNAKE_OIL_DIFF b/ThirdParty/Ert/test-data/local/snake_oil_field/jobs/SNAKE_OIL_DIFF deleted file mode 100644 index 98a867d959..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/jobs/SNAKE_OIL_DIFF +++ /dev/null @@ -1,4 +0,0 @@ -STDOUT snake_oil_diff.stdout -STDERR snake_oil_diff.stderr - -EXECUTABLE snake_oil_diff.py \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/jobs/SNAKE_OIL_NPV b/ThirdParty/Ert/test-data/local/snake_oil_field/jobs/SNAKE_OIL_NPV deleted file mode 100644 index 887830c756..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/jobs/SNAKE_OIL_NPV +++ /dev/null @@ -1,4 +0,0 @@ -STDOUT snake_oil_npv.stdout -STDERR snake_oil_npv.stderr - -EXECUTABLE snake_oil_npv.py \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/jobs/SNAKE_OIL_SIMULATOR b/ThirdParty/Ert/test-data/local/snake_oil_field/jobs/SNAKE_OIL_SIMULATOR deleted file mode 100644 index b4b7f9928f..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/jobs/SNAKE_OIL_SIMULATOR +++ /dev/null @@ -1,4 +0,0 @@ -STDOUT snake_oil.stdout -STDERR snake_oil.stderr - -EXECUTABLE snake_oil_simulator.py \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/jobs/snake_oil_diff.py b/ThirdParty/Ert/test-data/local/snake_oil_field/jobs/snake_oil_diff.py deleted file mode 100644 index afabb261f9..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/jobs/snake_oil_diff.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python -from ert.ecl import EclSum - -def writeDiff(filename, vector1, vector2): - with open(filename, "w") as f: - for index in range(len(vector1)): - node1 = vector1[index] - node2 = vector2[index] - - diff = node1.value - node2.value - f.write("%f\n" % diff) - - -if __name__ == '__main__': - ecl_sum = EclSum("SNAKE_OIL_FIELD") - - report_step = 199 - writeDiff("snake_oil_opr_diff_%d.txt" % report_step, ecl_sum["WOPR:OP1"], ecl_sum["WOPR:OP2"]) - writeDiff("snake_oil_wpr_diff_%d.txt" % report_step, ecl_sum["WWPR:OP1"], ecl_sum["WWPR:OP2"]) - writeDiff("snake_oil_gpr_diff_%d.txt" % report_step, ecl_sum["WGPR:OP1"], ecl_sum["WGPR:OP2"]) - - - - diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/jobs/snake_oil_npv.py b/ThirdParty/Ert/test-data/local/snake_oil_field/jobs/snake_oil_npv.py deleted file mode 100644 index 4ff61251bc..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/jobs/snake_oil_npv.py +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env python -from ert.ecl import EclSum - -OIL_PRICES = {"2010-01-01": 78.33, - "2010-02-01": 76.39, - "2010-03-01": 81.20, - "2010-04-01": 84.29, - "2010-05-01": 73.74, - "2010-06-01": 75.34, - "2010-07-01": 76.32, - "2010-08-01": 76.60, - "2010-09-01": 75.24, - "2010-10-01": 81.89, - "2010-11-01": 84.25, - "2010-12-01": 89.15, - "2011-01-01": 89.17, - "2011-02-01": 88.58, - "2011-03-01": 102.86, - "2011-04-01": 109.53, - "2011-05-01": 100.90, - "2011-06-01": 96.26, - "2011-07-01": 97.30, - "2011-08-01": 86.33, - "2011-09-01": 85.52, - "2011-10-01": 86.32, - "2011-11-01": 97.16, - "2011-12-01": 98.56, - "2012-01-01": 100.27, - "2012-02-01": 102.20, - "2012-03-01": 106.16, - "2012-04-01": 103.32, - "2012-05-01": 94.65, - "2012-06-01": 82.30, - "2012-07-01": 87.90, - "2012-08-01": 94.13, - "2012-09-01": 94.51, - "2012-10-01": 89.49, - "2012-11-01": 86.53, - "2012-12-01": 87.86, - "2013-01-01": 94.76, - "2013-02-01": 95.31, - "2013-03-01": 92.94, - "2013-04-01": 92.02, - "2013-05-01": 94.51, - "2013-06-01": 95.77, - "2013-07-01": 104.67, - "2013-08-01": 106.57, - "2013-09-01": 106.29, - "2013-10-01": 100.54, - "2013-11-01": 93.86, - "2013-12-01": 97.63, - "2014-01-01": 94.62, - "2014-02-01": 100.82, - "2014-03-01": 100.80, - "2014-04-01": 102.07, - "2014-05-01": 102.18, - "2014-06-01": 105.79, - "2014-07-01": 103.59, - "2014-08-01": 96.54, - "2014-09-01": 93.21, - "2014-10-01": 84.40, - "2014-11-01": 75.79, - "2014-12-01": 59.29, - "2015-01-01": 47.22, - "2015-02-01": 50.58, - "2015-03-01": 47.82, - "2015-04-01": 54.45, - "2015-05-01": 59.27, - "2015-06-01": 59.82, - "2015-07-01": 50.90, - "2015-08-01": 42.87, - "2015-09-01": 45.48} - -if __name__ == '__main__': - ecl_sum = EclSum("SNAKE_OIL_FIELD") - start_time = ecl_sum.getStartTime() - date_ranges = ecl_sum.timeRange(start_time, interval="1M") - production_sums = ecl_sum.blockedProduction("FOPT", date_ranges) - - npv = 0.0 - for index in range(0, len(date_ranges) - 1): - date = date_ranges[index + 1] # end of period - production_sum = production_sums[index] - - oil_price = OIL_PRICES[date.date().strftime("%Y-%m-%d")] - - production_value = oil_price * production_sum - npv += production_value - - with open("snake_oil_npv.txt", "w") as output_file: - output_file.write("NPV %s\n" % npv) - - if npv < 80000: - rating = "POOR" - elif 80000 <= npv < 100000: - rating = "AVERAGE" - elif 100000 <= npv < 120000: - rating = "GOOD" - else: - rating = "EXCELLENT" - - output_file.write("RATING %s\n" % rating) - diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/jobs/snake_oil_simulator.py b/ThirdParty/Ert/test-data/local/snake_oil_field/jobs/snake_oil_simulator.py deleted file mode 100644 index 1724cea874..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/jobs/snake_oil_simulator.py +++ /dev/null @@ -1,185 +0,0 @@ -#!/usr/bin/env python -from datetime import datetime -import os -import sys - -from ert.ecl import EclSum, EclSumTStep -from ert.test import ExtendedTestCase - -try: - from synthesizer import OilSimulator -except ImportError as e: - share_lib_path = os.path.join(ExtendedTestCase.findShareRoot(), "lib") - - sys.path.insert(0, share_lib_path) - synthesizer_module = __import__("synthesizer") - OilSimulator = synthesizer_module.OilSimulator - sys.path.pop(0) - - -def globalIndex(i, j, k, nx=10, ny=10, nz=10): - return i + nx * (j - 1) + nx * ny * (k - 1) - - -def readParameters(filename): - params = {} - with open(filename, "r") as f: - for line in f: - key, value = line.split(":", 1) - params[key] = value.strip() - - return params - - -def runSimulator(simulator, history_simulator, time_step_count): - """ @rtype: EclSum """ - ecl_sum = EclSum.writer("SNAKE_OIL_FIELD", datetime(2010, 1, 1), 10, 10, 10) - - ecl_sum.addVariable("FOPT") - ecl_sum.addVariable("FOPR") - ecl_sum.addVariable("FGPT") - ecl_sum.addVariable("FGPR") - ecl_sum.addVariable("FWPT") - ecl_sum.addVariable("FWPR") - ecl_sum.addVariable("FGOR") - ecl_sum.addVariable("FWCT") - - ecl_sum.addVariable("FOPTH") - ecl_sum.addVariable("FOPRH") - ecl_sum.addVariable("FGPTH") - ecl_sum.addVariable("FGPRH") - ecl_sum.addVariable("FWPTH") - ecl_sum.addVariable("FWPRH") - ecl_sum.addVariable("FGORH") - ecl_sum.addVariable("FWCTH") - - ecl_sum.addVariable("WOPR", wgname="OP1") - ecl_sum.addVariable("WOPR", wgname="OP2") - ecl_sum.addVariable("WWPR", wgname="OP1") - ecl_sum.addVariable("WWPR", wgname="OP2") - ecl_sum.addVariable("WGPR", wgname="OP1") - ecl_sum.addVariable("WGPR", wgname="OP2") - ecl_sum.addVariable("WGOR", wgname="OP1") - ecl_sum.addVariable("WGOR", wgname="OP2") - ecl_sum.addVariable("WWCT", wgname="OP1") - ecl_sum.addVariable("WWCT", wgname="OP2") - - ecl_sum.addVariable("WOPRH", wgname="OP1") - ecl_sum.addVariable("WOPRH", wgname="OP2") - ecl_sum.addVariable("WWPRH", wgname="OP1") - ecl_sum.addVariable("WWPRH", wgname="OP2") - ecl_sum.addVariable("WGPRH", wgname="OP1") - ecl_sum.addVariable("WGPRH", wgname="OP2") - ecl_sum.addVariable("WGORH", wgname="OP1") - ecl_sum.addVariable("WGORH", wgname="OP2") - ecl_sum.addVariable("WWCTH", wgname="OP1") - ecl_sum.addVariable("WWCTH", wgname="OP2") - - ecl_sum.addVariable("BPR", num=globalIndex(5, 5, 5)) - ecl_sum.addVariable("BPR", num=globalIndex(1, 3, 8)) - - time_map = [] - mini_step_count = 10 - total_step_count = time_step_count * mini_step_count - - for report_step in range(time_step_count): - for mini_step in range(mini_step_count): - t_step = ecl_sum.addTStep(report_step + 1, sim_days=report_step * mini_step_count + mini_step) - - time_map.append(t_step.getSimTime().datetime().strftime("%d/%m/%Y")) - - simulator.step(scale=1.0 / total_step_count) - history_simulator.step(scale=1.0 / total_step_count) - - t_step["FOPR"] = simulator.fopr() - t_step["FOPT"] = simulator.fopt() - t_step["FGPR"] = simulator.fgpr() - t_step["FGPT"] = simulator.fgpt() - t_step["FWPR"] = simulator.fwpr() - t_step["FWPT"] = simulator.fwpt() - t_step["FGOR"] = simulator.fgor() - t_step["FWCT"] = simulator.fwct() - - t_step["WOPR:OP1"] = simulator.opr("OP1") - t_step["WOPR:OP2"] = simulator.opr("OP2") - - t_step["WGPR:OP1"] = simulator.gpr("OP1") - t_step["WGPR:OP2"] = simulator.gpr("OP2") - - t_step["WWPR:OP1"] = simulator.wpr("OP1") - t_step["WWPR:OP2"] = simulator.wpr("OP2") - - t_step["WGOR:OP1"] = simulator.gor("OP1") - t_step["WGOR:OP2"] = simulator.gor("OP2") - - t_step["WWCT:OP1"] = simulator.wct("OP1") - t_step["WWCT:OP2"] = simulator.wct("OP2") - - t_step["BPR:5,5,5"] = simulator.bpr("5,5,5") - t_step["BPR:1,3,8"] = simulator.bpr("1,3,8") - - t_step["FOPRH"] = history_simulator.fopr() - t_step["FOPTH"] = history_simulator.fopt() - t_step["FGPRH"] = history_simulator.fgpr() - t_step["FGPTH"] = history_simulator.fgpt() - t_step["FWPRH"] = history_simulator.fwpr() - t_step["FWPTH"] = history_simulator.fwpt() - t_step["FGORH"] = history_simulator.fgor() - t_step["FWCTH"] = history_simulator.fwct() - - t_step["WOPRH:OP1"] = history_simulator.opr("OP1") - t_step["WOPRH:OP2"] = history_simulator.opr("OP2") - - t_step["WGPRH:OP1"] = history_simulator.gpr("OP1") - t_step["WGPRH:OP2"] = history_simulator.gpr("OP2") - - t_step["WWPRH:OP1"] = history_simulator.wpr("OP1") - t_step["WWPRH:OP2"] = history_simulator.wpr("OP2") - - t_step["WGORH:OP1"] = history_simulator.gor("OP1") - t_step["WGORH:OP2"] = history_simulator.gor("OP2") - - t_step["WWCTH:OP1"] = history_simulator.wct("OP1") - t_step["WWCTH:OP2"] = history_simulator.wct("OP2") - - return ecl_sum, time_map - - -def roundedInt(value): - return int(round(float(value))) - - -if __name__ == '__main__': - seed = int(readParameters("seed.txt")["SEED"]) - parameters = readParameters("snake_oil_params.txt") - - op1_divergence_scale = float(parameters["OP1_DIVERGENCE_SCALE"]) - op2_divergence_scale = float(parameters["OP2_DIVERGENCE_SCALE"]) - op1_persistence = float(parameters["OP1_PERSISTENCE"]) - op2_persistence = float(parameters["OP2_PERSISTENCE"]) - op1_offset = float(parameters["OP1_OFFSET"]) - op2_offset = float(parameters["OP2_OFFSET"]) - bpr_138_persistence = float(parameters["BPR_138_PERSISTENCE"]) - bpr_555_persistence = float(parameters["BPR_555_PERSISTENCE"]) - - op1_octaves = roundedInt(parameters["OP1_OCTAVES"]) - op2_octaves = roundedInt(parameters["OP2_OCTAVES"]) - - simulator = OilSimulator() - simulator.addWell("OP1", seed * 997, persistence=op1_persistence, octaves=op1_octaves, divergence_scale=op1_divergence_scale, offset=op1_offset) - simulator.addWell("OP2", seed * 13, persistence=op2_persistence, octaves=op2_octaves, divergence_scale=op2_divergence_scale, offset=op2_offset) - simulator.addBlock("5,5,5", seed * 37, persistence=bpr_555_persistence) - simulator.addBlock("1,3,8", seed * 31, persistence=bpr_138_persistence) - - history_simulator = OilSimulator() - history_simulator.addWell("OP1", 222118781) - history_simulator.addWell("OP2", 118116362) - - report_step_count = 200 - ecl_sum, time_map = runSimulator(simulator, history_simulator, report_step_count) - - ecl_sum.fwrite() - - with open("time_map.txt", "w") as f: - for t in time_map: - f.write("%s\n" % t) diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/make_data.py b/ThirdParty/Ert/test-data/local/snake_oil_field/make_data.py deleted file mode 100644 index 069716e345..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/make_data.py +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env python -import os -import os.path - -from ert.ecl import EclGrid, EclKW, EclTypeEnum -from ert.util import RandomNumberGenerator - -# This little script is used as a one-shot operation to generate the -# grid and the corresponding PERMX and PORO fields used for this test -# case. The script itself is not used bye the test. - -nx = 10 -ny = 10 -nz = 5 -ens_size = 10 - - -def make_grid( ): - grid = EclGrid.createRectangular( (nx,ny,nz) , (1,1,1) ) - if not os.path.isdir("grid"): - os.makedirs("grid") - grid.save_EGRID("grid/CASE.EGRID") - - return grid - - - -def make_field(rng , grid , iens): - permx = EclKW.create( "PERMX" , grid.getGlobalSize( ) , EclTypeEnum.ECL_FLOAT_TYPE) - permx.assign( rng.getDouble( ) ) - - poro = EclKW.create( "PORO" , grid.getGlobalSize( ) , EclTypeEnum.ECL_FLOAT_TYPE) - poro.assign( rng.getDouble( ) ) - - if not os.path.isdir("fields"): - os.makedirs("fields") - - with open("fields/permx%d.grdecl" % iens,"w") as f: - permx.write_grdecl( f ) - - with open("fields/poro%d.grdecl" % iens ,"w") as f: - poro.write_grdecl( f ) - - -rng = RandomNumberGenerator( ) -rng.setState("ABCD6375ejascEFGHIJ") - - -grid = make_grid( ) -for iens in range(ens_size): - make_field(rng , grid , iens) diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/observations/observations.txt b/ThirdParty/Ert/test-data/local/snake_oil_field/observations/observations.txt deleted file mode 100644 index de28837efb..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/observations/observations.txt +++ /dev/null @@ -1,56 +0,0 @@ -HISTORY_OBSERVATION FOPR; - -SUMMARY_OBSERVATION WOPR_OP1_9 -{ - VALUE = 0.1; - ERROR = 0.05; - RESTART = 9; - KEY = WOPR:OP1; -}; - -SUMMARY_OBSERVATION WOPR_OP1_36 -{ - VALUE = 0.7; - ERROR = 0.07; - RESTART = 36; - KEY = WOPR:OP1; -}; - -SUMMARY_OBSERVATION WOPR_OP1_72 -{ - VALUE = 0.5; - ERROR = 0.05; - RESTART = 72; - KEY = WOPR:OP1; -}; - -SUMMARY_OBSERVATION WOPR_OP1_108 -{ - VALUE = 0.3; - ERROR = 0.075; - RESTART = 108; - KEY = WOPR:OP1; -}; - -SUMMARY_OBSERVATION WOPR_OP1_144 -{ - VALUE = 0.2; - ERROR = 0.035; - RESTART = 144; - KEY = WOPR:OP1; -}; - -SUMMARY_OBSERVATION WOPR_OP1_190 -{ - VALUE = 0.015; - ERROR = 0.01; - RESTART = 190; - KEY = WOPR:OP1; -}; - -GENERAL_OBSERVATION WPR_DIFF_1 { - DATA = SNAKE_OIL_WPR_DIFF; - INDEX_LIST = 400,800,1200,1800; - RESTART = 199; - OBS_FILE = observations/wpr_diff_obs.txt; -}; \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/observations/wpr_diff_obs.txt b/ThirdParty/Ert/test-data/local/snake_oil_field/observations/wpr_diff_obs.txt deleted file mode 100644 index 4aee6d7ef7..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/observations/wpr_diff_obs.txt +++ /dev/null @@ -1,4 +0,0 @@ -0.0 0.1 -0.1 0.2 -0.2 0.15 -0.0 0.05 diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/parameters/snake_oil_parameters.txt b/ThirdParty/Ert/test-data/local/snake_oil_field/parameters/snake_oil_parameters.txt deleted file mode 100644 index 64573d0058..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/parameters/snake_oil_parameters.txt +++ /dev/null @@ -1,11 +0,0 @@ -OP1_PERSISTENCE UNIFORM 0.01 0.4 -OP1_OCTAVES UNIFORM 3 5 -OP1_DIVERGENCE_SCALE UNIFORM 0.25 1.25 -OP1_OFFSET UNIFORM -0.1 0.1 -OP2_PERSISTENCE UNIFORM 0.1 0.6 -OP2_OCTAVES UNIFORM 5 12 -OP2_DIVERGENCE_SCALE UNIFORM 0.5 1.5 -OP2_OFFSET UNIFORM -0.2 0.2 -BPR_555_PERSISTENCE UNIFORM 0.1 0.5 -BPR_138_PERSISTENCE UNIFORM 0.2 0.7 - diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/refcase/SNAKE_OIL_FIELD.SMSPEC b/ThirdParty/Ert/test-data/local/snake_oil_field/refcase/SNAKE_OIL_FIELD.SMSPEC deleted file mode 100644 index 5a29e043b2..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil_field/refcase/SNAKE_OIL_FIELD.SMSPEC and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/refcase/SNAKE_OIL_FIELD.UNSMRY b/ThirdParty/Ert/test-data/local/snake_oil_field/refcase/SNAKE_OIL_FIELD.UNSMRY deleted file mode 100644 index dfa04f8002..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil_field/refcase/SNAKE_OIL_FIELD.UNSMRY and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/refcase/refcase_readme.txt b/ThirdParty/Ert/test-data/local/snake_oil_field/refcase/refcase_readme.txt deleted file mode 100644 index a3d0fe6058..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/refcase/refcase_readme.txt +++ /dev/null @@ -1 +0,0 @@ -To create a refcase run the snake_oil_simulator.py job with the this as working directory. \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/refcase/seed.txt b/ThirdParty/Ert/test-data/local/snake_oil_field/refcase/seed.txt deleted file mode 100644 index 0009f6e89a..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/refcase/seed.txt +++ /dev/null @@ -1 +0,0 @@ -SEED:268776 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/refcase/snake_oil_params.txt b/ThirdParty/Ert/test-data/local/snake_oil_field/refcase/snake_oil_params.txt deleted file mode 100644 index 3868522924..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/refcase/snake_oil_params.txt +++ /dev/null @@ -1,10 +0,0 @@ -OP1_PERSISTENCE:0.15 -OP1_OCTAVES:4 -OP1_DIVERGENCE_SCALE:0.5 -OP1_OFFSET:0.0 -OP2_PERSISTENCE:0.25 -OP2_OCTAVES:7.0 -OP2_DIVERGENCE_SCALE:1.0 -OP2_OFFSET:0.0 -BPR_555_PERSISTENCE:0.25 -BPR_138_PERSISTENCE:0.35 diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/refcase/time_map.txt b/ThirdParty/Ert/test-data/local/snake_oil_field/refcase/time_map.txt deleted file mode 100644 index d54b4293ae..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/refcase/time_map.txt +++ /dev/null @@ -1,2000 +0,0 @@ -01/01/2010 -02/01/2010 -03/01/2010 -04/01/2010 -05/01/2010 -06/01/2010 -07/01/2010 -08/01/2010 -09/01/2010 -10/01/2010 -11/01/2010 -12/01/2010 -13/01/2010 -14/01/2010 -15/01/2010 -16/01/2010 -17/01/2010 -18/01/2010 -19/01/2010 -20/01/2010 -21/01/2010 -22/01/2010 -23/01/2010 -24/01/2010 -25/01/2010 -26/01/2010 -27/01/2010 -28/01/2010 -29/01/2010 -30/01/2010 -31/01/2010 -01/02/2010 -02/02/2010 -03/02/2010 -04/02/2010 -05/02/2010 -06/02/2010 -07/02/2010 -08/02/2010 -09/02/2010 -10/02/2010 -11/02/2010 -12/02/2010 -13/02/2010 -14/02/2010 -15/02/2010 -16/02/2010 -17/02/2010 -18/02/2010 -19/02/2010 -20/02/2010 -21/02/2010 -22/02/2010 -23/02/2010 -24/02/2010 -25/02/2010 -26/02/2010 -27/02/2010 -28/02/2010 -01/03/2010 -02/03/2010 -03/03/2010 -04/03/2010 -05/03/2010 -06/03/2010 -07/03/2010 -08/03/2010 -09/03/2010 -10/03/2010 -11/03/2010 -12/03/2010 -13/03/2010 -14/03/2010 -15/03/2010 -16/03/2010 -17/03/2010 -18/03/2010 -19/03/2010 -20/03/2010 -21/03/2010 -22/03/2010 -23/03/2010 -24/03/2010 -25/03/2010 -26/03/2010 -27/03/2010 -28/03/2010 -29/03/2010 -30/03/2010 -31/03/2010 -01/04/2010 -02/04/2010 -03/04/2010 -04/04/2010 -05/04/2010 -06/04/2010 -07/04/2010 -08/04/2010 -09/04/2010 -10/04/2010 -11/04/2010 -12/04/2010 -13/04/2010 -14/04/2010 -15/04/2010 -16/04/2010 -17/04/2010 -18/04/2010 -19/04/2010 -20/04/2010 -21/04/2010 -22/04/2010 -23/04/2010 -24/04/2010 -25/04/2010 -26/04/2010 -27/04/2010 -28/04/2010 -29/04/2010 -30/04/2010 -01/05/2010 -02/05/2010 -03/05/2010 -04/05/2010 -05/05/2010 -06/05/2010 -07/05/2010 -08/05/2010 -09/05/2010 -10/05/2010 -11/05/2010 -12/05/2010 -13/05/2010 -14/05/2010 -15/05/2010 -16/05/2010 -17/05/2010 -18/05/2010 -19/05/2010 -20/05/2010 -21/05/2010 -22/05/2010 -23/05/2010 -24/05/2010 -25/05/2010 -26/05/2010 -27/05/2010 -28/05/2010 -29/05/2010 -30/05/2010 -31/05/2010 -01/06/2010 -02/06/2010 -03/06/2010 -04/06/2010 -05/06/2010 -06/06/2010 -07/06/2010 -08/06/2010 -09/06/2010 -10/06/2010 -11/06/2010 -12/06/2010 -13/06/2010 -14/06/2010 -15/06/2010 -16/06/2010 -17/06/2010 -18/06/2010 -19/06/2010 -20/06/2010 -21/06/2010 -22/06/2010 -23/06/2010 -24/06/2010 -25/06/2010 -26/06/2010 -27/06/2010 -28/06/2010 -29/06/2010 -30/06/2010 -01/07/2010 -02/07/2010 -03/07/2010 -04/07/2010 -05/07/2010 -06/07/2010 -07/07/2010 -08/07/2010 -09/07/2010 -10/07/2010 -11/07/2010 -12/07/2010 -13/07/2010 -14/07/2010 -15/07/2010 -16/07/2010 -17/07/2010 -18/07/2010 -19/07/2010 -20/07/2010 -21/07/2010 -22/07/2010 -23/07/2010 -24/07/2010 -25/07/2010 -26/07/2010 -27/07/2010 -28/07/2010 -29/07/2010 -30/07/2010 -31/07/2010 -01/08/2010 -02/08/2010 -03/08/2010 -04/08/2010 -05/08/2010 -06/08/2010 -07/08/2010 -08/08/2010 -09/08/2010 -10/08/2010 -11/08/2010 -12/08/2010 -13/08/2010 -14/08/2010 -15/08/2010 -16/08/2010 -17/08/2010 -18/08/2010 -19/08/2010 -20/08/2010 -21/08/2010 -22/08/2010 -23/08/2010 -24/08/2010 -25/08/2010 -26/08/2010 -27/08/2010 -28/08/2010 -29/08/2010 -30/08/2010 -31/08/2010 -01/09/2010 -02/09/2010 -03/09/2010 -04/09/2010 -05/09/2010 -06/09/2010 -07/09/2010 -08/09/2010 -09/09/2010 -10/09/2010 -11/09/2010 -12/09/2010 -13/09/2010 -14/09/2010 -15/09/2010 -16/09/2010 -17/09/2010 -18/09/2010 -19/09/2010 -20/09/2010 -21/09/2010 -22/09/2010 -23/09/2010 -24/09/2010 -25/09/2010 -26/09/2010 -27/09/2010 -28/09/2010 -29/09/2010 -30/09/2010 -01/10/2010 -02/10/2010 -03/10/2010 -04/10/2010 -05/10/2010 -06/10/2010 -07/10/2010 -08/10/2010 -09/10/2010 -10/10/2010 -11/10/2010 -12/10/2010 -13/10/2010 -14/10/2010 -15/10/2010 -16/10/2010 -17/10/2010 -18/10/2010 -19/10/2010 -20/10/2010 -21/10/2010 -22/10/2010 -23/10/2010 -24/10/2010 -25/10/2010 -26/10/2010 -27/10/2010 -28/10/2010 -29/10/2010 -30/10/2010 -31/10/2010 -01/11/2010 -02/11/2010 -03/11/2010 -04/11/2010 -05/11/2010 -06/11/2010 -07/11/2010 -08/11/2010 -09/11/2010 -10/11/2010 -11/11/2010 -12/11/2010 -13/11/2010 -14/11/2010 -15/11/2010 -16/11/2010 -17/11/2010 -18/11/2010 -19/11/2010 -20/11/2010 -21/11/2010 -22/11/2010 -23/11/2010 -24/11/2010 -25/11/2010 -26/11/2010 -27/11/2010 -28/11/2010 -29/11/2010 -30/11/2010 -01/12/2010 -02/12/2010 -03/12/2010 -04/12/2010 -05/12/2010 -06/12/2010 -07/12/2010 -08/12/2010 -09/12/2010 -10/12/2010 -11/12/2010 -12/12/2010 -13/12/2010 -14/12/2010 -15/12/2010 -16/12/2010 -17/12/2010 -18/12/2010 -19/12/2010 -20/12/2010 -21/12/2010 -22/12/2010 -23/12/2010 -24/12/2010 -25/12/2010 -26/12/2010 -27/12/2010 -28/12/2010 -29/12/2010 -30/12/2010 -31/12/2010 -01/01/2011 -02/01/2011 -03/01/2011 -04/01/2011 -05/01/2011 -06/01/2011 -07/01/2011 -08/01/2011 -09/01/2011 -10/01/2011 -11/01/2011 -12/01/2011 -13/01/2011 -14/01/2011 -15/01/2011 -16/01/2011 -17/01/2011 -18/01/2011 -19/01/2011 -20/01/2011 -21/01/2011 -22/01/2011 -23/01/2011 -24/01/2011 -25/01/2011 -26/01/2011 -27/01/2011 -28/01/2011 -29/01/2011 -30/01/2011 -31/01/2011 -01/02/2011 -02/02/2011 -03/02/2011 -04/02/2011 -05/02/2011 -06/02/2011 -07/02/2011 -08/02/2011 -09/02/2011 -10/02/2011 -11/02/2011 -12/02/2011 -13/02/2011 -14/02/2011 -15/02/2011 -16/02/2011 -17/02/2011 -18/02/2011 -19/02/2011 -20/02/2011 -21/02/2011 -22/02/2011 -23/02/2011 -24/02/2011 -25/02/2011 -26/02/2011 -27/02/2011 -28/02/2011 -01/03/2011 -02/03/2011 -03/03/2011 -04/03/2011 -05/03/2011 -06/03/2011 -07/03/2011 -08/03/2011 -09/03/2011 -10/03/2011 -11/03/2011 -12/03/2011 -13/03/2011 -14/03/2011 -15/03/2011 -16/03/2011 -17/03/2011 -18/03/2011 -19/03/2011 -20/03/2011 -21/03/2011 -22/03/2011 -23/03/2011 -24/03/2011 -25/03/2011 -26/03/2011 -27/03/2011 -28/03/2011 -29/03/2011 -30/03/2011 -31/03/2011 -01/04/2011 -02/04/2011 -03/04/2011 -04/04/2011 -05/04/2011 -06/04/2011 -07/04/2011 -08/04/2011 -09/04/2011 -10/04/2011 -11/04/2011 -12/04/2011 -13/04/2011 -14/04/2011 -15/04/2011 -16/04/2011 -17/04/2011 -18/04/2011 -19/04/2011 -20/04/2011 -21/04/2011 -22/04/2011 -23/04/2011 -24/04/2011 -25/04/2011 -26/04/2011 -27/04/2011 -28/04/2011 -29/04/2011 -30/04/2011 -01/05/2011 -02/05/2011 -03/05/2011 -04/05/2011 -05/05/2011 -06/05/2011 -07/05/2011 -08/05/2011 -09/05/2011 -10/05/2011 -11/05/2011 -12/05/2011 -13/05/2011 -14/05/2011 -15/05/2011 -16/05/2011 -17/05/2011 -18/05/2011 -19/05/2011 -20/05/2011 -21/05/2011 -22/05/2011 -23/05/2011 -24/05/2011 -25/05/2011 -26/05/2011 -27/05/2011 -28/05/2011 -29/05/2011 -30/05/2011 -31/05/2011 -01/06/2011 -02/06/2011 -03/06/2011 -04/06/2011 -05/06/2011 -06/06/2011 -07/06/2011 -08/06/2011 -09/06/2011 -10/06/2011 -11/06/2011 -12/06/2011 -13/06/2011 -14/06/2011 -15/06/2011 -16/06/2011 -17/06/2011 -18/06/2011 -19/06/2011 -20/06/2011 -21/06/2011 -22/06/2011 -23/06/2011 -24/06/2011 -25/06/2011 -26/06/2011 -27/06/2011 -28/06/2011 -29/06/2011 -30/06/2011 -01/07/2011 -02/07/2011 -03/07/2011 -04/07/2011 -05/07/2011 -06/07/2011 -07/07/2011 -08/07/2011 -09/07/2011 -10/07/2011 -11/07/2011 -12/07/2011 -13/07/2011 -14/07/2011 -15/07/2011 -16/07/2011 -17/07/2011 -18/07/2011 -19/07/2011 -20/07/2011 -21/07/2011 -22/07/2011 -23/07/2011 -24/07/2011 -25/07/2011 -26/07/2011 -27/07/2011 -28/07/2011 -29/07/2011 -30/07/2011 -31/07/2011 -01/08/2011 -02/08/2011 -03/08/2011 -04/08/2011 -05/08/2011 -06/08/2011 -07/08/2011 -08/08/2011 -09/08/2011 -10/08/2011 -11/08/2011 -12/08/2011 -13/08/2011 -14/08/2011 -15/08/2011 -16/08/2011 -17/08/2011 -18/08/2011 -19/08/2011 -20/08/2011 -21/08/2011 -22/08/2011 -23/08/2011 -24/08/2011 -25/08/2011 -26/08/2011 -27/08/2011 -28/08/2011 -29/08/2011 -30/08/2011 -31/08/2011 -01/09/2011 -02/09/2011 -03/09/2011 -04/09/2011 -05/09/2011 -06/09/2011 -07/09/2011 -08/09/2011 -09/09/2011 -10/09/2011 -11/09/2011 -12/09/2011 -13/09/2011 -14/09/2011 -15/09/2011 -16/09/2011 -17/09/2011 -18/09/2011 -19/09/2011 -20/09/2011 -21/09/2011 -22/09/2011 -23/09/2011 -24/09/2011 -25/09/2011 -26/09/2011 -27/09/2011 -28/09/2011 -29/09/2011 -30/09/2011 -01/10/2011 -02/10/2011 -03/10/2011 -04/10/2011 -05/10/2011 -06/10/2011 -07/10/2011 -08/10/2011 -09/10/2011 -10/10/2011 -11/10/2011 -12/10/2011 -13/10/2011 -14/10/2011 -15/10/2011 -16/10/2011 -17/10/2011 -18/10/2011 -19/10/2011 -20/10/2011 -21/10/2011 -22/10/2011 -23/10/2011 -24/10/2011 -25/10/2011 -26/10/2011 -27/10/2011 -28/10/2011 -29/10/2011 -30/10/2011 -31/10/2011 -01/11/2011 -02/11/2011 -03/11/2011 -04/11/2011 -05/11/2011 -06/11/2011 -07/11/2011 -08/11/2011 -09/11/2011 -10/11/2011 -11/11/2011 -12/11/2011 -13/11/2011 -14/11/2011 -15/11/2011 -16/11/2011 -17/11/2011 -18/11/2011 -19/11/2011 -20/11/2011 -21/11/2011 -22/11/2011 -23/11/2011 -24/11/2011 -25/11/2011 -26/11/2011 -27/11/2011 -28/11/2011 -29/11/2011 -30/11/2011 -01/12/2011 -02/12/2011 -03/12/2011 -04/12/2011 -05/12/2011 -06/12/2011 -07/12/2011 -08/12/2011 -09/12/2011 -10/12/2011 -11/12/2011 -12/12/2011 -13/12/2011 -14/12/2011 -15/12/2011 -16/12/2011 -17/12/2011 -18/12/2011 -19/12/2011 -20/12/2011 -21/12/2011 -22/12/2011 -23/12/2011 -24/12/2011 -25/12/2011 -26/12/2011 -27/12/2011 -28/12/2011 -29/12/2011 -30/12/2011 -31/12/2011 -01/01/2012 -02/01/2012 -03/01/2012 -04/01/2012 -05/01/2012 -06/01/2012 -07/01/2012 -08/01/2012 -09/01/2012 -10/01/2012 -11/01/2012 -12/01/2012 -13/01/2012 -14/01/2012 -15/01/2012 -16/01/2012 -17/01/2012 -18/01/2012 -19/01/2012 -20/01/2012 -21/01/2012 -22/01/2012 -23/01/2012 -24/01/2012 -25/01/2012 -26/01/2012 -27/01/2012 -28/01/2012 -29/01/2012 -30/01/2012 -31/01/2012 -01/02/2012 -02/02/2012 -03/02/2012 -04/02/2012 -05/02/2012 -06/02/2012 -07/02/2012 -08/02/2012 -09/02/2012 -10/02/2012 -11/02/2012 -12/02/2012 -13/02/2012 -14/02/2012 -15/02/2012 -16/02/2012 -17/02/2012 -18/02/2012 -19/02/2012 -20/02/2012 -21/02/2012 -22/02/2012 -23/02/2012 -24/02/2012 -25/02/2012 -26/02/2012 -27/02/2012 -28/02/2012 -29/02/2012 -01/03/2012 -02/03/2012 -03/03/2012 -04/03/2012 -05/03/2012 -06/03/2012 -07/03/2012 -08/03/2012 -09/03/2012 -10/03/2012 -11/03/2012 -12/03/2012 -13/03/2012 -14/03/2012 -15/03/2012 -16/03/2012 -17/03/2012 -18/03/2012 -19/03/2012 -20/03/2012 -21/03/2012 -22/03/2012 -23/03/2012 -24/03/2012 -25/03/2012 -26/03/2012 -27/03/2012 -28/03/2012 -29/03/2012 -30/03/2012 -31/03/2012 -01/04/2012 -02/04/2012 -03/04/2012 -04/04/2012 -05/04/2012 -06/04/2012 -07/04/2012 -08/04/2012 -09/04/2012 -10/04/2012 -11/04/2012 -12/04/2012 -13/04/2012 -14/04/2012 -15/04/2012 -16/04/2012 -17/04/2012 -18/04/2012 -19/04/2012 -20/04/2012 -21/04/2012 -22/04/2012 -23/04/2012 -24/04/2012 -25/04/2012 -26/04/2012 -27/04/2012 -28/04/2012 -29/04/2012 -30/04/2012 -01/05/2012 -02/05/2012 -03/05/2012 -04/05/2012 -05/05/2012 -06/05/2012 -07/05/2012 -08/05/2012 -09/05/2012 -10/05/2012 -11/05/2012 -12/05/2012 -13/05/2012 -14/05/2012 -15/05/2012 -16/05/2012 -17/05/2012 -18/05/2012 -19/05/2012 -20/05/2012 -21/05/2012 -22/05/2012 -23/05/2012 -24/05/2012 -25/05/2012 -26/05/2012 -27/05/2012 -28/05/2012 -29/05/2012 -30/05/2012 -31/05/2012 -01/06/2012 -02/06/2012 -03/06/2012 -04/06/2012 -05/06/2012 -06/06/2012 -07/06/2012 -08/06/2012 -09/06/2012 -10/06/2012 -11/06/2012 -12/06/2012 -13/06/2012 -14/06/2012 -15/06/2012 -16/06/2012 -17/06/2012 -18/06/2012 -19/06/2012 -20/06/2012 -21/06/2012 -22/06/2012 -23/06/2012 -24/06/2012 -25/06/2012 -26/06/2012 -27/06/2012 -28/06/2012 -29/06/2012 -30/06/2012 -01/07/2012 -02/07/2012 -03/07/2012 -04/07/2012 -05/07/2012 -06/07/2012 -07/07/2012 -08/07/2012 -09/07/2012 -10/07/2012 -11/07/2012 -12/07/2012 -13/07/2012 -14/07/2012 -15/07/2012 -16/07/2012 -17/07/2012 -18/07/2012 -19/07/2012 -20/07/2012 -21/07/2012 -22/07/2012 -23/07/2012 -24/07/2012 -25/07/2012 -26/07/2012 -27/07/2012 -28/07/2012 -29/07/2012 -30/07/2012 -31/07/2012 -01/08/2012 -02/08/2012 -03/08/2012 -04/08/2012 -05/08/2012 -06/08/2012 -07/08/2012 -08/08/2012 -09/08/2012 -10/08/2012 -11/08/2012 -12/08/2012 -13/08/2012 -14/08/2012 -15/08/2012 -16/08/2012 -17/08/2012 -18/08/2012 -19/08/2012 -20/08/2012 -21/08/2012 -22/08/2012 -23/08/2012 -24/08/2012 -25/08/2012 -26/08/2012 -27/08/2012 -28/08/2012 -29/08/2012 -30/08/2012 -31/08/2012 -01/09/2012 -02/09/2012 -03/09/2012 -04/09/2012 -05/09/2012 -06/09/2012 -07/09/2012 -08/09/2012 -09/09/2012 -10/09/2012 -11/09/2012 -12/09/2012 -13/09/2012 -14/09/2012 -15/09/2012 -16/09/2012 -17/09/2012 -18/09/2012 -19/09/2012 -20/09/2012 -21/09/2012 -22/09/2012 -23/09/2012 -24/09/2012 -25/09/2012 -26/09/2012 -27/09/2012 -28/09/2012 -29/09/2012 -30/09/2012 -01/10/2012 -02/10/2012 -03/10/2012 -04/10/2012 -05/10/2012 -06/10/2012 -07/10/2012 -08/10/2012 -09/10/2012 -10/10/2012 -11/10/2012 -12/10/2012 -13/10/2012 -14/10/2012 -15/10/2012 -16/10/2012 -17/10/2012 -18/10/2012 -19/10/2012 -20/10/2012 -21/10/2012 -22/10/2012 -23/10/2012 -24/10/2012 -25/10/2012 -26/10/2012 -27/10/2012 -28/10/2012 -29/10/2012 -30/10/2012 -31/10/2012 -01/11/2012 -02/11/2012 -03/11/2012 -04/11/2012 -05/11/2012 -06/11/2012 -07/11/2012 -08/11/2012 -09/11/2012 -10/11/2012 -11/11/2012 -12/11/2012 -13/11/2012 -14/11/2012 -15/11/2012 -16/11/2012 -17/11/2012 -18/11/2012 -19/11/2012 -20/11/2012 -21/11/2012 -22/11/2012 -23/11/2012 -24/11/2012 -25/11/2012 -26/11/2012 -27/11/2012 -28/11/2012 -29/11/2012 -30/11/2012 -01/12/2012 -02/12/2012 -03/12/2012 -04/12/2012 -05/12/2012 -06/12/2012 -07/12/2012 -08/12/2012 -09/12/2012 -10/12/2012 -11/12/2012 -12/12/2012 -13/12/2012 -14/12/2012 -15/12/2012 -16/12/2012 -17/12/2012 -18/12/2012 -19/12/2012 -20/12/2012 -21/12/2012 -22/12/2012 -23/12/2012 -24/12/2012 -25/12/2012 -26/12/2012 -27/12/2012 -28/12/2012 -29/12/2012 -30/12/2012 -31/12/2012 -01/01/2013 -02/01/2013 -03/01/2013 -04/01/2013 -05/01/2013 -06/01/2013 -07/01/2013 -08/01/2013 -09/01/2013 -10/01/2013 -11/01/2013 -12/01/2013 -13/01/2013 -14/01/2013 -15/01/2013 -16/01/2013 -17/01/2013 -18/01/2013 -19/01/2013 -20/01/2013 -21/01/2013 -22/01/2013 -23/01/2013 -24/01/2013 -25/01/2013 -26/01/2013 -27/01/2013 -28/01/2013 -29/01/2013 -30/01/2013 -31/01/2013 -01/02/2013 -02/02/2013 -03/02/2013 -04/02/2013 -05/02/2013 -06/02/2013 -07/02/2013 -08/02/2013 -09/02/2013 -10/02/2013 -11/02/2013 -12/02/2013 -13/02/2013 -14/02/2013 -15/02/2013 -16/02/2013 -17/02/2013 -18/02/2013 -19/02/2013 -20/02/2013 -21/02/2013 -22/02/2013 -23/02/2013 -24/02/2013 -25/02/2013 -26/02/2013 -27/02/2013 -28/02/2013 -01/03/2013 -02/03/2013 -03/03/2013 -04/03/2013 -05/03/2013 -06/03/2013 -07/03/2013 -08/03/2013 -09/03/2013 -10/03/2013 -11/03/2013 -12/03/2013 -13/03/2013 -14/03/2013 -15/03/2013 -16/03/2013 -17/03/2013 -18/03/2013 -19/03/2013 -20/03/2013 -21/03/2013 -22/03/2013 -23/03/2013 -24/03/2013 -25/03/2013 -26/03/2013 -27/03/2013 -28/03/2013 -29/03/2013 -30/03/2013 -31/03/2013 -01/04/2013 -02/04/2013 -03/04/2013 -04/04/2013 -05/04/2013 -06/04/2013 -07/04/2013 -08/04/2013 -09/04/2013 -10/04/2013 -11/04/2013 -12/04/2013 -13/04/2013 -14/04/2013 -15/04/2013 -16/04/2013 -17/04/2013 -18/04/2013 -19/04/2013 -20/04/2013 -21/04/2013 -22/04/2013 -23/04/2013 -24/04/2013 -25/04/2013 -26/04/2013 -27/04/2013 -28/04/2013 -29/04/2013 -30/04/2013 -01/05/2013 -02/05/2013 -03/05/2013 -04/05/2013 -05/05/2013 -06/05/2013 -07/05/2013 -08/05/2013 -09/05/2013 -10/05/2013 -11/05/2013 -12/05/2013 -13/05/2013 -14/05/2013 -15/05/2013 -16/05/2013 -17/05/2013 -18/05/2013 -19/05/2013 -20/05/2013 -21/05/2013 -22/05/2013 -23/05/2013 -24/05/2013 -25/05/2013 -26/05/2013 -27/05/2013 -28/05/2013 -29/05/2013 -30/05/2013 -31/05/2013 -01/06/2013 -02/06/2013 -03/06/2013 -04/06/2013 -05/06/2013 -06/06/2013 -07/06/2013 -08/06/2013 -09/06/2013 -10/06/2013 -11/06/2013 -12/06/2013 -13/06/2013 -14/06/2013 -15/06/2013 -16/06/2013 -17/06/2013 -18/06/2013 -19/06/2013 -20/06/2013 -21/06/2013 -22/06/2013 -23/06/2013 -24/06/2013 -25/06/2013 -26/06/2013 -27/06/2013 -28/06/2013 -29/06/2013 -30/06/2013 -01/07/2013 -02/07/2013 -03/07/2013 -04/07/2013 -05/07/2013 -06/07/2013 -07/07/2013 -08/07/2013 -09/07/2013 -10/07/2013 -11/07/2013 -12/07/2013 -13/07/2013 -14/07/2013 -15/07/2013 -16/07/2013 -17/07/2013 -18/07/2013 -19/07/2013 -20/07/2013 -21/07/2013 -22/07/2013 -23/07/2013 -24/07/2013 -25/07/2013 -26/07/2013 -27/07/2013 -28/07/2013 -29/07/2013 -30/07/2013 -31/07/2013 -01/08/2013 -02/08/2013 -03/08/2013 -04/08/2013 -05/08/2013 -06/08/2013 -07/08/2013 -08/08/2013 -09/08/2013 -10/08/2013 -11/08/2013 -12/08/2013 -13/08/2013 -14/08/2013 -15/08/2013 -16/08/2013 -17/08/2013 -18/08/2013 -19/08/2013 -20/08/2013 -21/08/2013 -22/08/2013 -23/08/2013 -24/08/2013 -25/08/2013 -26/08/2013 -27/08/2013 -28/08/2013 -29/08/2013 -30/08/2013 -31/08/2013 -01/09/2013 -02/09/2013 -03/09/2013 -04/09/2013 -05/09/2013 -06/09/2013 -07/09/2013 -08/09/2013 -09/09/2013 -10/09/2013 -11/09/2013 -12/09/2013 -13/09/2013 -14/09/2013 -15/09/2013 -16/09/2013 -17/09/2013 -18/09/2013 -19/09/2013 -20/09/2013 -21/09/2013 -22/09/2013 -23/09/2013 -24/09/2013 -25/09/2013 -26/09/2013 -27/09/2013 -28/09/2013 -29/09/2013 -30/09/2013 -01/10/2013 -02/10/2013 -03/10/2013 -04/10/2013 -05/10/2013 -06/10/2013 -07/10/2013 -08/10/2013 -09/10/2013 -10/10/2013 -11/10/2013 -12/10/2013 -13/10/2013 -14/10/2013 -15/10/2013 -16/10/2013 -17/10/2013 -18/10/2013 -19/10/2013 -20/10/2013 -21/10/2013 -22/10/2013 -23/10/2013 -24/10/2013 -25/10/2013 -26/10/2013 -27/10/2013 -28/10/2013 -29/10/2013 -30/10/2013 -31/10/2013 -01/11/2013 -02/11/2013 -03/11/2013 -04/11/2013 -05/11/2013 -06/11/2013 -07/11/2013 -08/11/2013 -09/11/2013 -10/11/2013 -11/11/2013 -12/11/2013 -13/11/2013 -14/11/2013 -15/11/2013 -16/11/2013 -17/11/2013 -18/11/2013 -19/11/2013 -20/11/2013 -21/11/2013 -22/11/2013 -23/11/2013 -24/11/2013 -25/11/2013 -26/11/2013 -27/11/2013 -28/11/2013 -29/11/2013 -30/11/2013 -01/12/2013 -02/12/2013 -03/12/2013 -04/12/2013 -05/12/2013 -06/12/2013 -07/12/2013 -08/12/2013 -09/12/2013 -10/12/2013 -11/12/2013 -12/12/2013 -13/12/2013 -14/12/2013 -15/12/2013 -16/12/2013 -17/12/2013 -18/12/2013 -19/12/2013 -20/12/2013 -21/12/2013 -22/12/2013 -23/12/2013 -24/12/2013 -25/12/2013 -26/12/2013 -27/12/2013 -28/12/2013 -29/12/2013 -30/12/2013 -31/12/2013 -01/01/2014 -02/01/2014 -03/01/2014 -04/01/2014 -05/01/2014 -06/01/2014 -07/01/2014 -08/01/2014 -09/01/2014 -10/01/2014 -11/01/2014 -12/01/2014 -13/01/2014 -14/01/2014 -15/01/2014 -16/01/2014 -17/01/2014 -18/01/2014 -19/01/2014 -20/01/2014 -21/01/2014 -22/01/2014 -23/01/2014 -24/01/2014 -25/01/2014 -26/01/2014 -27/01/2014 -28/01/2014 -29/01/2014 -30/01/2014 -31/01/2014 -01/02/2014 -02/02/2014 -03/02/2014 -04/02/2014 -05/02/2014 -06/02/2014 -07/02/2014 -08/02/2014 -09/02/2014 -10/02/2014 -11/02/2014 -12/02/2014 -13/02/2014 -14/02/2014 -15/02/2014 -16/02/2014 -17/02/2014 -18/02/2014 -19/02/2014 -20/02/2014 -21/02/2014 -22/02/2014 -23/02/2014 -24/02/2014 -25/02/2014 -26/02/2014 -27/02/2014 -28/02/2014 -01/03/2014 -02/03/2014 -03/03/2014 -04/03/2014 -05/03/2014 -06/03/2014 -07/03/2014 -08/03/2014 -09/03/2014 -10/03/2014 -11/03/2014 -12/03/2014 -13/03/2014 -14/03/2014 -15/03/2014 -16/03/2014 -17/03/2014 -18/03/2014 -19/03/2014 -20/03/2014 -21/03/2014 -22/03/2014 -23/03/2014 -24/03/2014 -25/03/2014 -26/03/2014 -27/03/2014 -28/03/2014 -29/03/2014 -30/03/2014 -31/03/2014 -01/04/2014 -02/04/2014 -03/04/2014 -04/04/2014 -05/04/2014 -06/04/2014 -07/04/2014 -08/04/2014 -09/04/2014 -10/04/2014 -11/04/2014 -12/04/2014 -13/04/2014 -14/04/2014 -15/04/2014 -16/04/2014 -17/04/2014 -18/04/2014 -19/04/2014 -20/04/2014 -21/04/2014 -22/04/2014 -23/04/2014 -24/04/2014 -25/04/2014 -26/04/2014 -27/04/2014 -28/04/2014 -29/04/2014 -30/04/2014 -01/05/2014 -02/05/2014 -03/05/2014 -04/05/2014 -05/05/2014 -06/05/2014 -07/05/2014 -08/05/2014 -09/05/2014 -10/05/2014 -11/05/2014 -12/05/2014 -13/05/2014 -14/05/2014 -15/05/2014 -16/05/2014 -17/05/2014 -18/05/2014 -19/05/2014 -20/05/2014 -21/05/2014 -22/05/2014 -23/05/2014 -24/05/2014 -25/05/2014 -26/05/2014 -27/05/2014 -28/05/2014 -29/05/2014 -30/05/2014 -31/05/2014 -01/06/2014 -02/06/2014 -03/06/2014 -04/06/2014 -05/06/2014 -06/06/2014 -07/06/2014 -08/06/2014 -09/06/2014 -10/06/2014 -11/06/2014 -12/06/2014 -13/06/2014 -14/06/2014 -15/06/2014 -16/06/2014 -17/06/2014 -18/06/2014 -19/06/2014 -20/06/2014 -21/06/2014 -22/06/2014 -23/06/2014 -24/06/2014 -25/06/2014 -26/06/2014 -27/06/2014 -28/06/2014 -29/06/2014 -30/06/2014 -01/07/2014 -02/07/2014 -03/07/2014 -04/07/2014 -05/07/2014 -06/07/2014 -07/07/2014 -08/07/2014 -09/07/2014 -10/07/2014 -11/07/2014 -12/07/2014 -13/07/2014 -14/07/2014 -15/07/2014 -16/07/2014 -17/07/2014 -18/07/2014 -19/07/2014 -20/07/2014 -21/07/2014 -22/07/2014 -23/07/2014 -24/07/2014 -25/07/2014 -26/07/2014 -27/07/2014 -28/07/2014 -29/07/2014 -30/07/2014 -31/07/2014 -01/08/2014 -02/08/2014 -03/08/2014 -04/08/2014 -05/08/2014 -06/08/2014 -07/08/2014 -08/08/2014 -09/08/2014 -10/08/2014 -11/08/2014 -12/08/2014 -13/08/2014 -14/08/2014 -15/08/2014 -16/08/2014 -17/08/2014 -18/08/2014 -19/08/2014 -20/08/2014 -21/08/2014 -22/08/2014 -23/08/2014 -24/08/2014 -25/08/2014 -26/08/2014 -27/08/2014 -28/08/2014 -29/08/2014 -30/08/2014 -31/08/2014 -01/09/2014 -02/09/2014 -03/09/2014 -04/09/2014 -05/09/2014 -06/09/2014 -07/09/2014 -08/09/2014 -09/09/2014 -10/09/2014 -11/09/2014 -12/09/2014 -13/09/2014 -14/09/2014 -15/09/2014 -16/09/2014 -17/09/2014 -18/09/2014 -19/09/2014 -20/09/2014 -21/09/2014 -22/09/2014 -23/09/2014 -24/09/2014 -25/09/2014 -26/09/2014 -27/09/2014 -28/09/2014 -29/09/2014 -30/09/2014 -01/10/2014 -02/10/2014 -03/10/2014 -04/10/2014 -05/10/2014 -06/10/2014 -07/10/2014 -08/10/2014 -09/10/2014 -10/10/2014 -11/10/2014 -12/10/2014 -13/10/2014 -14/10/2014 -15/10/2014 -16/10/2014 -17/10/2014 -18/10/2014 -19/10/2014 -20/10/2014 -21/10/2014 -22/10/2014 -23/10/2014 -24/10/2014 -25/10/2014 -26/10/2014 -27/10/2014 -28/10/2014 -29/10/2014 -30/10/2014 -31/10/2014 -01/11/2014 -02/11/2014 -03/11/2014 -04/11/2014 -05/11/2014 -06/11/2014 -07/11/2014 -08/11/2014 -09/11/2014 -10/11/2014 -11/11/2014 -12/11/2014 -13/11/2014 -14/11/2014 -15/11/2014 -16/11/2014 -17/11/2014 -18/11/2014 -19/11/2014 -20/11/2014 -21/11/2014 -22/11/2014 -23/11/2014 -24/11/2014 -25/11/2014 -26/11/2014 -27/11/2014 -28/11/2014 -29/11/2014 -30/11/2014 -01/12/2014 -02/12/2014 -03/12/2014 -04/12/2014 -05/12/2014 -06/12/2014 -07/12/2014 -08/12/2014 -09/12/2014 -10/12/2014 -11/12/2014 -12/12/2014 -13/12/2014 -14/12/2014 -15/12/2014 -16/12/2014 -17/12/2014 -18/12/2014 -19/12/2014 -20/12/2014 -21/12/2014 -22/12/2014 -23/12/2014 -24/12/2014 -25/12/2014 -26/12/2014 -27/12/2014 -28/12/2014 -29/12/2014 -30/12/2014 -31/12/2014 -01/01/2015 -02/01/2015 -03/01/2015 -04/01/2015 -05/01/2015 -06/01/2015 -07/01/2015 -08/01/2015 -09/01/2015 -10/01/2015 -11/01/2015 -12/01/2015 -13/01/2015 -14/01/2015 -15/01/2015 -16/01/2015 -17/01/2015 -18/01/2015 -19/01/2015 -20/01/2015 -21/01/2015 -22/01/2015 -23/01/2015 -24/01/2015 -25/01/2015 -26/01/2015 -27/01/2015 -28/01/2015 -29/01/2015 -30/01/2015 -31/01/2015 -01/02/2015 -02/02/2015 -03/02/2015 -04/02/2015 -05/02/2015 -06/02/2015 -07/02/2015 -08/02/2015 -09/02/2015 -10/02/2015 -11/02/2015 -12/02/2015 -13/02/2015 -14/02/2015 -15/02/2015 -16/02/2015 -17/02/2015 -18/02/2015 -19/02/2015 -20/02/2015 -21/02/2015 -22/02/2015 -23/02/2015 -24/02/2015 -25/02/2015 -26/02/2015 -27/02/2015 -28/02/2015 -01/03/2015 -02/03/2015 -03/03/2015 -04/03/2015 -05/03/2015 -06/03/2015 -07/03/2015 -08/03/2015 -09/03/2015 -10/03/2015 -11/03/2015 -12/03/2015 -13/03/2015 -14/03/2015 -15/03/2015 -16/03/2015 -17/03/2015 -18/03/2015 -19/03/2015 -20/03/2015 -21/03/2015 -22/03/2015 -23/03/2015 -24/03/2015 -25/03/2015 -26/03/2015 -27/03/2015 -28/03/2015 -29/03/2015 -30/03/2015 -31/03/2015 -01/04/2015 -02/04/2015 -03/04/2015 -04/04/2015 -05/04/2015 -06/04/2015 -07/04/2015 -08/04/2015 -09/04/2015 -10/04/2015 -11/04/2015 -12/04/2015 -13/04/2015 -14/04/2015 -15/04/2015 -16/04/2015 -17/04/2015 -18/04/2015 -19/04/2015 -20/04/2015 -21/04/2015 -22/04/2015 -23/04/2015 -24/04/2015 -25/04/2015 -26/04/2015 -27/04/2015 -28/04/2015 -29/04/2015 -30/04/2015 -01/05/2015 -02/05/2015 -03/05/2015 -04/05/2015 -05/05/2015 -06/05/2015 -07/05/2015 -08/05/2015 -09/05/2015 -10/05/2015 -11/05/2015 -12/05/2015 -13/05/2015 -14/05/2015 -15/05/2015 -16/05/2015 -17/05/2015 -18/05/2015 -19/05/2015 -20/05/2015 -21/05/2015 -22/05/2015 -23/05/2015 -24/05/2015 -25/05/2015 -26/05/2015 -27/05/2015 -28/05/2015 -29/05/2015 -30/05/2015 -31/05/2015 -01/06/2015 -02/06/2015 -03/06/2015 -04/06/2015 -05/06/2015 -06/06/2015 -07/06/2015 -08/06/2015 -09/06/2015 -10/06/2015 -11/06/2015 -12/06/2015 -13/06/2015 -14/06/2015 -15/06/2015 -16/06/2015 -17/06/2015 -18/06/2015 -19/06/2015 -20/06/2015 -21/06/2015 -22/06/2015 -23/06/2015 diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/snake_oil.ert b/ThirdParty/Ert/test-data/local/snake_oil_field/snake_oil.ert deleted file mode 100644 index 693ab1715c..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/snake_oil.ert +++ /dev/null @@ -1,50 +0,0 @@ -QUEUE_SYSTEM LOCAL - -JOBNAME SNAKE_OIL_%d -NUM_REALIZATIONS 10 -GRID grid/CASE.EGRID - -DEFINE storage/ - -STORE_SEED SEED -LOAD_SEED SEED - -RUNPATH /runpath/realisation-%d/iter-%d -ENSPATH /ensemble -ECLBASE SNAKE_OIL_FIELD -SUMMARY * - -HISTORY_SOURCE REFCASE_HISTORY -REFCASE refcase/SNAKE_OIL_FIELD - -TIME_MAP refcase/time_map.txt -OBS_CONFIG observations/observations.txt - -INSTALL_JOB SNAKE_OIL_SIMULATOR jobs/SNAKE_OIL_SIMULATOR -INSTALL_JOB SNAKE_OIL_NPV jobs/SNAKE_OIL_NPV -INSTALL_JOB SNAKE_OIL_DIFF jobs/SNAKE_OIL_DIFF - -FORWARD_MODEL SNAKE_OIL_SIMULATOR -FORWARD_MODEL SNAKE_OIL_NPV -FORWARD_MODEL SNAKE_OIL_DIFF - -RUN_TEMPLATE templates/seed_template.txt seed.txt - -GEN_KW SNAKE_OIL_PARAM templates/snake_oil_template.txt snake_oil_params.txt parameters/snake_oil_parameters.txt -CUSTOM_KW SNAKE_OIL_NPV snake_oil_npv.txt -GEN_DATA SNAKE_OIL_OPR_DIFF INPUT_FORMAT:ASCII RESULT_FILE:snake_oil_opr_diff_%d.txt REPORT_STEPS:199 -GEN_DATA SNAKE_OIL_WPR_DIFF INPUT_FORMAT:ASCII RESULT_FILE:snake_oil_wpr_diff_%d.txt REPORT_STEPS:199 -GEN_DATA SNAKE_OIL_GPR_DIFF INPUT_FORMAT:ASCII RESULT_FILE:snake_oil_gpr_diff_%d.txt REPORT_STEPS:199 - - --- Observe that the snake_oil simulator does not really take these --- field parameters into account, they are mainly here to create a --- test case with field parameters. - -FIELD PERMX PARAMETER permx.grdcel INIT_FILES:fields/permx%d.grdecl -FIELD PORO PARAMETER poro.grdcel INIT_FILES:fields/poro%d.grdecl - - -LOG_LEVEL 3 -LOG_FILE log/log.txt -UPDATE_LOG_PATH log/update diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/templates/seed_template.txt b/ThirdParty/Ert/test-data/local/snake_oil_field/templates/seed_template.txt deleted file mode 100644 index a0bca49fbd..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/templates/seed_template.txt +++ /dev/null @@ -1 +0,0 @@ -SEED: \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil_field/templates/snake_oil_template.txt b/ThirdParty/Ert/test-data/local/snake_oil_field/templates/snake_oil_template.txt deleted file mode 100644 index ad2c648a0b..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_field/templates/snake_oil_template.txt +++ /dev/null @@ -1,10 +0,0 @@ -OP1_PERSISTENCE: -OP1_OCTAVES: -OP1_DIVERGENCE_SCALE: -OP1_OFFSET: -OP2_PERSISTENCE: -OP2_OCTAVES: -OP2_DIVERGENCE_SCALE: -OP2_OFFSET: -BPR_555_PERSISTENCE: -BPR_138_PERSISTENCE: diff --git a/ThirdParty/Ert/test-data/local/snake_oil_no_data/SEED b/ThirdParty/Ert/test-data/local/snake_oil_no_data/SEED deleted file mode 100644 index 314cda88f6..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_no_data/SEED +++ /dev/null @@ -1 +0,0 @@ -67 -110 42 -42 106 34 96 0 18 42 76 -69 44 -40 -78 -61 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil_no_data/jobs/SNAKE_OIL_DIFF b/ThirdParty/Ert/test-data/local/snake_oil_no_data/jobs/SNAKE_OIL_DIFF deleted file mode 100644 index 98a867d959..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_no_data/jobs/SNAKE_OIL_DIFF +++ /dev/null @@ -1,4 +0,0 @@ -STDOUT snake_oil_diff.stdout -STDERR snake_oil_diff.stderr - -EXECUTABLE snake_oil_diff.py \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil_no_data/jobs/SNAKE_OIL_NPV b/ThirdParty/Ert/test-data/local/snake_oil_no_data/jobs/SNAKE_OIL_NPV deleted file mode 100644 index 887830c756..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_no_data/jobs/SNAKE_OIL_NPV +++ /dev/null @@ -1,4 +0,0 @@ -STDOUT snake_oil_npv.stdout -STDERR snake_oil_npv.stderr - -EXECUTABLE snake_oil_npv.py \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil_no_data/jobs/SNAKE_OIL_SIMULATOR b/ThirdParty/Ert/test-data/local/snake_oil_no_data/jobs/SNAKE_OIL_SIMULATOR deleted file mode 100644 index b4b7f9928f..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_no_data/jobs/SNAKE_OIL_SIMULATOR +++ /dev/null @@ -1,4 +0,0 @@ -STDOUT snake_oil.stdout -STDERR snake_oil.stderr - -EXECUTABLE snake_oil_simulator.py \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil_no_data/jobs/snake_oil_diff.py b/ThirdParty/Ert/test-data/local/snake_oil_no_data/jobs/snake_oil_diff.py deleted file mode 100644 index afabb261f9..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_no_data/jobs/snake_oil_diff.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python -from ert.ecl import EclSum - -def writeDiff(filename, vector1, vector2): - with open(filename, "w") as f: - for index in range(len(vector1)): - node1 = vector1[index] - node2 = vector2[index] - - diff = node1.value - node2.value - f.write("%f\n" % diff) - - -if __name__ == '__main__': - ecl_sum = EclSum("SNAKE_OIL_FIELD") - - report_step = 199 - writeDiff("snake_oil_opr_diff_%d.txt" % report_step, ecl_sum["WOPR:OP1"], ecl_sum["WOPR:OP2"]) - writeDiff("snake_oil_wpr_diff_%d.txt" % report_step, ecl_sum["WWPR:OP1"], ecl_sum["WWPR:OP2"]) - writeDiff("snake_oil_gpr_diff_%d.txt" % report_step, ecl_sum["WGPR:OP1"], ecl_sum["WGPR:OP2"]) - - - - diff --git a/ThirdParty/Ert/test-data/local/snake_oil_no_data/jobs/snake_oil_npv.py b/ThirdParty/Ert/test-data/local/snake_oil_no_data/jobs/snake_oil_npv.py deleted file mode 100644 index 4ff61251bc..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_no_data/jobs/snake_oil_npv.py +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env python -from ert.ecl import EclSum - -OIL_PRICES = {"2010-01-01": 78.33, - "2010-02-01": 76.39, - "2010-03-01": 81.20, - "2010-04-01": 84.29, - "2010-05-01": 73.74, - "2010-06-01": 75.34, - "2010-07-01": 76.32, - "2010-08-01": 76.60, - "2010-09-01": 75.24, - "2010-10-01": 81.89, - "2010-11-01": 84.25, - "2010-12-01": 89.15, - "2011-01-01": 89.17, - "2011-02-01": 88.58, - "2011-03-01": 102.86, - "2011-04-01": 109.53, - "2011-05-01": 100.90, - "2011-06-01": 96.26, - "2011-07-01": 97.30, - "2011-08-01": 86.33, - "2011-09-01": 85.52, - "2011-10-01": 86.32, - "2011-11-01": 97.16, - "2011-12-01": 98.56, - "2012-01-01": 100.27, - "2012-02-01": 102.20, - "2012-03-01": 106.16, - "2012-04-01": 103.32, - "2012-05-01": 94.65, - "2012-06-01": 82.30, - "2012-07-01": 87.90, - "2012-08-01": 94.13, - "2012-09-01": 94.51, - "2012-10-01": 89.49, - "2012-11-01": 86.53, - "2012-12-01": 87.86, - "2013-01-01": 94.76, - "2013-02-01": 95.31, - "2013-03-01": 92.94, - "2013-04-01": 92.02, - "2013-05-01": 94.51, - "2013-06-01": 95.77, - "2013-07-01": 104.67, - "2013-08-01": 106.57, - "2013-09-01": 106.29, - "2013-10-01": 100.54, - "2013-11-01": 93.86, - "2013-12-01": 97.63, - "2014-01-01": 94.62, - "2014-02-01": 100.82, - "2014-03-01": 100.80, - "2014-04-01": 102.07, - "2014-05-01": 102.18, - "2014-06-01": 105.79, - "2014-07-01": 103.59, - "2014-08-01": 96.54, - "2014-09-01": 93.21, - "2014-10-01": 84.40, - "2014-11-01": 75.79, - "2014-12-01": 59.29, - "2015-01-01": 47.22, - "2015-02-01": 50.58, - "2015-03-01": 47.82, - "2015-04-01": 54.45, - "2015-05-01": 59.27, - "2015-06-01": 59.82, - "2015-07-01": 50.90, - "2015-08-01": 42.87, - "2015-09-01": 45.48} - -if __name__ == '__main__': - ecl_sum = EclSum("SNAKE_OIL_FIELD") - start_time = ecl_sum.getStartTime() - date_ranges = ecl_sum.timeRange(start_time, interval="1M") - production_sums = ecl_sum.blockedProduction("FOPT", date_ranges) - - npv = 0.0 - for index in range(0, len(date_ranges) - 1): - date = date_ranges[index + 1] # end of period - production_sum = production_sums[index] - - oil_price = OIL_PRICES[date.date().strftime("%Y-%m-%d")] - - production_value = oil_price * production_sum - npv += production_value - - with open("snake_oil_npv.txt", "w") as output_file: - output_file.write("NPV %s\n" % npv) - - if npv < 80000: - rating = "POOR" - elif 80000 <= npv < 100000: - rating = "AVERAGE" - elif 100000 <= npv < 120000: - rating = "GOOD" - else: - rating = "EXCELLENT" - - output_file.write("RATING %s\n" % rating) - diff --git a/ThirdParty/Ert/test-data/local/snake_oil_no_data/jobs/snake_oil_simulator.py b/ThirdParty/Ert/test-data/local/snake_oil_no_data/jobs/snake_oil_simulator.py deleted file mode 100644 index 1724cea874..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_no_data/jobs/snake_oil_simulator.py +++ /dev/null @@ -1,185 +0,0 @@ -#!/usr/bin/env python -from datetime import datetime -import os -import sys - -from ert.ecl import EclSum, EclSumTStep -from ert.test import ExtendedTestCase - -try: - from synthesizer import OilSimulator -except ImportError as e: - share_lib_path = os.path.join(ExtendedTestCase.findShareRoot(), "lib") - - sys.path.insert(0, share_lib_path) - synthesizer_module = __import__("synthesizer") - OilSimulator = synthesizer_module.OilSimulator - sys.path.pop(0) - - -def globalIndex(i, j, k, nx=10, ny=10, nz=10): - return i + nx * (j - 1) + nx * ny * (k - 1) - - -def readParameters(filename): - params = {} - with open(filename, "r") as f: - for line in f: - key, value = line.split(":", 1) - params[key] = value.strip() - - return params - - -def runSimulator(simulator, history_simulator, time_step_count): - """ @rtype: EclSum """ - ecl_sum = EclSum.writer("SNAKE_OIL_FIELD", datetime(2010, 1, 1), 10, 10, 10) - - ecl_sum.addVariable("FOPT") - ecl_sum.addVariable("FOPR") - ecl_sum.addVariable("FGPT") - ecl_sum.addVariable("FGPR") - ecl_sum.addVariable("FWPT") - ecl_sum.addVariable("FWPR") - ecl_sum.addVariable("FGOR") - ecl_sum.addVariable("FWCT") - - ecl_sum.addVariable("FOPTH") - ecl_sum.addVariable("FOPRH") - ecl_sum.addVariable("FGPTH") - ecl_sum.addVariable("FGPRH") - ecl_sum.addVariable("FWPTH") - ecl_sum.addVariable("FWPRH") - ecl_sum.addVariable("FGORH") - ecl_sum.addVariable("FWCTH") - - ecl_sum.addVariable("WOPR", wgname="OP1") - ecl_sum.addVariable("WOPR", wgname="OP2") - ecl_sum.addVariable("WWPR", wgname="OP1") - ecl_sum.addVariable("WWPR", wgname="OP2") - ecl_sum.addVariable("WGPR", wgname="OP1") - ecl_sum.addVariable("WGPR", wgname="OP2") - ecl_sum.addVariable("WGOR", wgname="OP1") - ecl_sum.addVariable("WGOR", wgname="OP2") - ecl_sum.addVariable("WWCT", wgname="OP1") - ecl_sum.addVariable("WWCT", wgname="OP2") - - ecl_sum.addVariable("WOPRH", wgname="OP1") - ecl_sum.addVariable("WOPRH", wgname="OP2") - ecl_sum.addVariable("WWPRH", wgname="OP1") - ecl_sum.addVariable("WWPRH", wgname="OP2") - ecl_sum.addVariable("WGPRH", wgname="OP1") - ecl_sum.addVariable("WGPRH", wgname="OP2") - ecl_sum.addVariable("WGORH", wgname="OP1") - ecl_sum.addVariable("WGORH", wgname="OP2") - ecl_sum.addVariable("WWCTH", wgname="OP1") - ecl_sum.addVariable("WWCTH", wgname="OP2") - - ecl_sum.addVariable("BPR", num=globalIndex(5, 5, 5)) - ecl_sum.addVariable("BPR", num=globalIndex(1, 3, 8)) - - time_map = [] - mini_step_count = 10 - total_step_count = time_step_count * mini_step_count - - for report_step in range(time_step_count): - for mini_step in range(mini_step_count): - t_step = ecl_sum.addTStep(report_step + 1, sim_days=report_step * mini_step_count + mini_step) - - time_map.append(t_step.getSimTime().datetime().strftime("%d/%m/%Y")) - - simulator.step(scale=1.0 / total_step_count) - history_simulator.step(scale=1.0 / total_step_count) - - t_step["FOPR"] = simulator.fopr() - t_step["FOPT"] = simulator.fopt() - t_step["FGPR"] = simulator.fgpr() - t_step["FGPT"] = simulator.fgpt() - t_step["FWPR"] = simulator.fwpr() - t_step["FWPT"] = simulator.fwpt() - t_step["FGOR"] = simulator.fgor() - t_step["FWCT"] = simulator.fwct() - - t_step["WOPR:OP1"] = simulator.opr("OP1") - t_step["WOPR:OP2"] = simulator.opr("OP2") - - t_step["WGPR:OP1"] = simulator.gpr("OP1") - t_step["WGPR:OP2"] = simulator.gpr("OP2") - - t_step["WWPR:OP1"] = simulator.wpr("OP1") - t_step["WWPR:OP2"] = simulator.wpr("OP2") - - t_step["WGOR:OP1"] = simulator.gor("OP1") - t_step["WGOR:OP2"] = simulator.gor("OP2") - - t_step["WWCT:OP1"] = simulator.wct("OP1") - t_step["WWCT:OP2"] = simulator.wct("OP2") - - t_step["BPR:5,5,5"] = simulator.bpr("5,5,5") - t_step["BPR:1,3,8"] = simulator.bpr("1,3,8") - - t_step["FOPRH"] = history_simulator.fopr() - t_step["FOPTH"] = history_simulator.fopt() - t_step["FGPRH"] = history_simulator.fgpr() - t_step["FGPTH"] = history_simulator.fgpt() - t_step["FWPRH"] = history_simulator.fwpr() - t_step["FWPTH"] = history_simulator.fwpt() - t_step["FGORH"] = history_simulator.fgor() - t_step["FWCTH"] = history_simulator.fwct() - - t_step["WOPRH:OP1"] = history_simulator.opr("OP1") - t_step["WOPRH:OP2"] = history_simulator.opr("OP2") - - t_step["WGPRH:OP1"] = history_simulator.gpr("OP1") - t_step["WGPRH:OP2"] = history_simulator.gpr("OP2") - - t_step["WWPRH:OP1"] = history_simulator.wpr("OP1") - t_step["WWPRH:OP2"] = history_simulator.wpr("OP2") - - t_step["WGORH:OP1"] = history_simulator.gor("OP1") - t_step["WGORH:OP2"] = history_simulator.gor("OP2") - - t_step["WWCTH:OP1"] = history_simulator.wct("OP1") - t_step["WWCTH:OP2"] = history_simulator.wct("OP2") - - return ecl_sum, time_map - - -def roundedInt(value): - return int(round(float(value))) - - -if __name__ == '__main__': - seed = int(readParameters("seed.txt")["SEED"]) - parameters = readParameters("snake_oil_params.txt") - - op1_divergence_scale = float(parameters["OP1_DIVERGENCE_SCALE"]) - op2_divergence_scale = float(parameters["OP2_DIVERGENCE_SCALE"]) - op1_persistence = float(parameters["OP1_PERSISTENCE"]) - op2_persistence = float(parameters["OP2_PERSISTENCE"]) - op1_offset = float(parameters["OP1_OFFSET"]) - op2_offset = float(parameters["OP2_OFFSET"]) - bpr_138_persistence = float(parameters["BPR_138_PERSISTENCE"]) - bpr_555_persistence = float(parameters["BPR_555_PERSISTENCE"]) - - op1_octaves = roundedInt(parameters["OP1_OCTAVES"]) - op2_octaves = roundedInt(parameters["OP2_OCTAVES"]) - - simulator = OilSimulator() - simulator.addWell("OP1", seed * 997, persistence=op1_persistence, octaves=op1_octaves, divergence_scale=op1_divergence_scale, offset=op1_offset) - simulator.addWell("OP2", seed * 13, persistence=op2_persistence, octaves=op2_octaves, divergence_scale=op2_divergence_scale, offset=op2_offset) - simulator.addBlock("5,5,5", seed * 37, persistence=bpr_555_persistence) - simulator.addBlock("1,3,8", seed * 31, persistence=bpr_138_persistence) - - history_simulator = OilSimulator() - history_simulator.addWell("OP1", 222118781) - history_simulator.addWell("OP2", 118116362) - - report_step_count = 200 - ecl_sum, time_map = runSimulator(simulator, history_simulator, report_step_count) - - ecl_sum.fwrite() - - with open("time_map.txt", "w") as f: - for t in time_map: - f.write("%s\n" % t) diff --git a/ThirdParty/Ert/test-data/local/snake_oil_no_data/observations/observations.txt b/ThirdParty/Ert/test-data/local/snake_oil_no_data/observations/observations.txt deleted file mode 100644 index de28837efb..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_no_data/observations/observations.txt +++ /dev/null @@ -1,56 +0,0 @@ -HISTORY_OBSERVATION FOPR; - -SUMMARY_OBSERVATION WOPR_OP1_9 -{ - VALUE = 0.1; - ERROR = 0.05; - RESTART = 9; - KEY = WOPR:OP1; -}; - -SUMMARY_OBSERVATION WOPR_OP1_36 -{ - VALUE = 0.7; - ERROR = 0.07; - RESTART = 36; - KEY = WOPR:OP1; -}; - -SUMMARY_OBSERVATION WOPR_OP1_72 -{ - VALUE = 0.5; - ERROR = 0.05; - RESTART = 72; - KEY = WOPR:OP1; -}; - -SUMMARY_OBSERVATION WOPR_OP1_108 -{ - VALUE = 0.3; - ERROR = 0.075; - RESTART = 108; - KEY = WOPR:OP1; -}; - -SUMMARY_OBSERVATION WOPR_OP1_144 -{ - VALUE = 0.2; - ERROR = 0.035; - RESTART = 144; - KEY = WOPR:OP1; -}; - -SUMMARY_OBSERVATION WOPR_OP1_190 -{ - VALUE = 0.015; - ERROR = 0.01; - RESTART = 190; - KEY = WOPR:OP1; -}; - -GENERAL_OBSERVATION WPR_DIFF_1 { - DATA = SNAKE_OIL_WPR_DIFF; - INDEX_LIST = 400,800,1200,1800; - RESTART = 199; - OBS_FILE = observations/wpr_diff_obs.txt; -}; \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil_no_data/observations/wpr_diff_obs.txt b/ThirdParty/Ert/test-data/local/snake_oil_no_data/observations/wpr_diff_obs.txt deleted file mode 100644 index 4aee6d7ef7..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_no_data/observations/wpr_diff_obs.txt +++ /dev/null @@ -1,4 +0,0 @@ -0.0 0.1 -0.1 0.2 -0.2 0.15 -0.0 0.05 diff --git a/ThirdParty/Ert/test-data/local/snake_oil_no_data/parameters/snake_oil_parameters.txt b/ThirdParty/Ert/test-data/local/snake_oil_no_data/parameters/snake_oil_parameters.txt deleted file mode 100644 index 64573d0058..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_no_data/parameters/snake_oil_parameters.txt +++ /dev/null @@ -1,11 +0,0 @@ -OP1_PERSISTENCE UNIFORM 0.01 0.4 -OP1_OCTAVES UNIFORM 3 5 -OP1_DIVERGENCE_SCALE UNIFORM 0.25 1.25 -OP1_OFFSET UNIFORM -0.1 0.1 -OP2_PERSISTENCE UNIFORM 0.1 0.6 -OP2_OCTAVES UNIFORM 5 12 -OP2_DIVERGENCE_SCALE UNIFORM 0.5 1.5 -OP2_OFFSET UNIFORM -0.2 0.2 -BPR_555_PERSISTENCE UNIFORM 0.1 0.5 -BPR_138_PERSISTENCE UNIFORM 0.2 0.7 - diff --git a/ThirdParty/Ert/test-data/local/snake_oil_no_data/refcase/SNAKE_OIL_FIELD.SMSPEC b/ThirdParty/Ert/test-data/local/snake_oil_no_data/refcase/SNAKE_OIL_FIELD.SMSPEC deleted file mode 100644 index 5a29e043b2..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil_no_data/refcase/SNAKE_OIL_FIELD.SMSPEC and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_no_data/refcase/SNAKE_OIL_FIELD.UNSMRY b/ThirdParty/Ert/test-data/local/snake_oil_no_data/refcase/SNAKE_OIL_FIELD.UNSMRY deleted file mode 100644 index dfa04f8002..0000000000 Binary files a/ThirdParty/Ert/test-data/local/snake_oil_no_data/refcase/SNAKE_OIL_FIELD.UNSMRY and /dev/null differ diff --git a/ThirdParty/Ert/test-data/local/snake_oil_no_data/refcase/refcase_readme.txt b/ThirdParty/Ert/test-data/local/snake_oil_no_data/refcase/refcase_readme.txt deleted file mode 100644 index a3d0fe6058..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_no_data/refcase/refcase_readme.txt +++ /dev/null @@ -1 +0,0 @@ -To create a refcase run the snake_oil_simulator.py job with the this as working directory. \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil_no_data/refcase/seed.txt b/ThirdParty/Ert/test-data/local/snake_oil_no_data/refcase/seed.txt deleted file mode 100644 index 0009f6e89a..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_no_data/refcase/seed.txt +++ /dev/null @@ -1 +0,0 @@ -SEED:268776 \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil_no_data/refcase/snake_oil_params.txt b/ThirdParty/Ert/test-data/local/snake_oil_no_data/refcase/snake_oil_params.txt deleted file mode 100644 index 3868522924..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_no_data/refcase/snake_oil_params.txt +++ /dev/null @@ -1,10 +0,0 @@ -OP1_PERSISTENCE:0.15 -OP1_OCTAVES:4 -OP1_DIVERGENCE_SCALE:0.5 -OP1_OFFSET:0.0 -OP2_PERSISTENCE:0.25 -OP2_OCTAVES:7.0 -OP2_DIVERGENCE_SCALE:1.0 -OP2_OFFSET:0.0 -BPR_555_PERSISTENCE:0.25 -BPR_138_PERSISTENCE:0.35 diff --git a/ThirdParty/Ert/test-data/local/snake_oil_no_data/refcase/time_map.txt b/ThirdParty/Ert/test-data/local/snake_oil_no_data/refcase/time_map.txt deleted file mode 100644 index d54b4293ae..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_no_data/refcase/time_map.txt +++ /dev/null @@ -1,2000 +0,0 @@ -01/01/2010 -02/01/2010 -03/01/2010 -04/01/2010 -05/01/2010 -06/01/2010 -07/01/2010 -08/01/2010 -09/01/2010 -10/01/2010 -11/01/2010 -12/01/2010 -13/01/2010 -14/01/2010 -15/01/2010 -16/01/2010 -17/01/2010 -18/01/2010 -19/01/2010 -20/01/2010 -21/01/2010 -22/01/2010 -23/01/2010 -24/01/2010 -25/01/2010 -26/01/2010 -27/01/2010 -28/01/2010 -29/01/2010 -30/01/2010 -31/01/2010 -01/02/2010 -02/02/2010 -03/02/2010 -04/02/2010 -05/02/2010 -06/02/2010 -07/02/2010 -08/02/2010 -09/02/2010 -10/02/2010 -11/02/2010 -12/02/2010 -13/02/2010 -14/02/2010 -15/02/2010 -16/02/2010 -17/02/2010 -18/02/2010 -19/02/2010 -20/02/2010 -21/02/2010 -22/02/2010 -23/02/2010 -24/02/2010 -25/02/2010 -26/02/2010 -27/02/2010 -28/02/2010 -01/03/2010 -02/03/2010 -03/03/2010 -04/03/2010 -05/03/2010 -06/03/2010 -07/03/2010 -08/03/2010 -09/03/2010 -10/03/2010 -11/03/2010 -12/03/2010 -13/03/2010 -14/03/2010 -15/03/2010 -16/03/2010 -17/03/2010 -18/03/2010 -19/03/2010 -20/03/2010 -21/03/2010 -22/03/2010 -23/03/2010 -24/03/2010 -25/03/2010 -26/03/2010 -27/03/2010 -28/03/2010 -29/03/2010 -30/03/2010 -31/03/2010 -01/04/2010 -02/04/2010 -03/04/2010 -04/04/2010 -05/04/2010 -06/04/2010 -07/04/2010 -08/04/2010 -09/04/2010 -10/04/2010 -11/04/2010 -12/04/2010 -13/04/2010 -14/04/2010 -15/04/2010 -16/04/2010 -17/04/2010 -18/04/2010 -19/04/2010 -20/04/2010 -21/04/2010 -22/04/2010 -23/04/2010 -24/04/2010 -25/04/2010 -26/04/2010 -27/04/2010 -28/04/2010 -29/04/2010 -30/04/2010 -01/05/2010 -02/05/2010 -03/05/2010 -04/05/2010 -05/05/2010 -06/05/2010 -07/05/2010 -08/05/2010 -09/05/2010 -10/05/2010 -11/05/2010 -12/05/2010 -13/05/2010 -14/05/2010 -15/05/2010 -16/05/2010 -17/05/2010 -18/05/2010 -19/05/2010 -20/05/2010 -21/05/2010 -22/05/2010 -23/05/2010 -24/05/2010 -25/05/2010 -26/05/2010 -27/05/2010 -28/05/2010 -29/05/2010 -30/05/2010 -31/05/2010 -01/06/2010 -02/06/2010 -03/06/2010 -04/06/2010 -05/06/2010 -06/06/2010 -07/06/2010 -08/06/2010 -09/06/2010 -10/06/2010 -11/06/2010 -12/06/2010 -13/06/2010 -14/06/2010 -15/06/2010 -16/06/2010 -17/06/2010 -18/06/2010 -19/06/2010 -20/06/2010 -21/06/2010 -22/06/2010 -23/06/2010 -24/06/2010 -25/06/2010 -26/06/2010 -27/06/2010 -28/06/2010 -29/06/2010 -30/06/2010 -01/07/2010 -02/07/2010 -03/07/2010 -04/07/2010 -05/07/2010 -06/07/2010 -07/07/2010 -08/07/2010 -09/07/2010 -10/07/2010 -11/07/2010 -12/07/2010 -13/07/2010 -14/07/2010 -15/07/2010 -16/07/2010 -17/07/2010 -18/07/2010 -19/07/2010 -20/07/2010 -21/07/2010 -22/07/2010 -23/07/2010 -24/07/2010 -25/07/2010 -26/07/2010 -27/07/2010 -28/07/2010 -29/07/2010 -30/07/2010 -31/07/2010 -01/08/2010 -02/08/2010 -03/08/2010 -04/08/2010 -05/08/2010 -06/08/2010 -07/08/2010 -08/08/2010 -09/08/2010 -10/08/2010 -11/08/2010 -12/08/2010 -13/08/2010 -14/08/2010 -15/08/2010 -16/08/2010 -17/08/2010 -18/08/2010 -19/08/2010 -20/08/2010 -21/08/2010 -22/08/2010 -23/08/2010 -24/08/2010 -25/08/2010 -26/08/2010 -27/08/2010 -28/08/2010 -29/08/2010 -30/08/2010 -31/08/2010 -01/09/2010 -02/09/2010 -03/09/2010 -04/09/2010 -05/09/2010 -06/09/2010 -07/09/2010 -08/09/2010 -09/09/2010 -10/09/2010 -11/09/2010 -12/09/2010 -13/09/2010 -14/09/2010 -15/09/2010 -16/09/2010 -17/09/2010 -18/09/2010 -19/09/2010 -20/09/2010 -21/09/2010 -22/09/2010 -23/09/2010 -24/09/2010 -25/09/2010 -26/09/2010 -27/09/2010 -28/09/2010 -29/09/2010 -30/09/2010 -01/10/2010 -02/10/2010 -03/10/2010 -04/10/2010 -05/10/2010 -06/10/2010 -07/10/2010 -08/10/2010 -09/10/2010 -10/10/2010 -11/10/2010 -12/10/2010 -13/10/2010 -14/10/2010 -15/10/2010 -16/10/2010 -17/10/2010 -18/10/2010 -19/10/2010 -20/10/2010 -21/10/2010 -22/10/2010 -23/10/2010 -24/10/2010 -25/10/2010 -26/10/2010 -27/10/2010 -28/10/2010 -29/10/2010 -30/10/2010 -31/10/2010 -01/11/2010 -02/11/2010 -03/11/2010 -04/11/2010 -05/11/2010 -06/11/2010 -07/11/2010 -08/11/2010 -09/11/2010 -10/11/2010 -11/11/2010 -12/11/2010 -13/11/2010 -14/11/2010 -15/11/2010 -16/11/2010 -17/11/2010 -18/11/2010 -19/11/2010 -20/11/2010 -21/11/2010 -22/11/2010 -23/11/2010 -24/11/2010 -25/11/2010 -26/11/2010 -27/11/2010 -28/11/2010 -29/11/2010 -30/11/2010 -01/12/2010 -02/12/2010 -03/12/2010 -04/12/2010 -05/12/2010 -06/12/2010 -07/12/2010 -08/12/2010 -09/12/2010 -10/12/2010 -11/12/2010 -12/12/2010 -13/12/2010 -14/12/2010 -15/12/2010 -16/12/2010 -17/12/2010 -18/12/2010 -19/12/2010 -20/12/2010 -21/12/2010 -22/12/2010 -23/12/2010 -24/12/2010 -25/12/2010 -26/12/2010 -27/12/2010 -28/12/2010 -29/12/2010 -30/12/2010 -31/12/2010 -01/01/2011 -02/01/2011 -03/01/2011 -04/01/2011 -05/01/2011 -06/01/2011 -07/01/2011 -08/01/2011 -09/01/2011 -10/01/2011 -11/01/2011 -12/01/2011 -13/01/2011 -14/01/2011 -15/01/2011 -16/01/2011 -17/01/2011 -18/01/2011 -19/01/2011 -20/01/2011 -21/01/2011 -22/01/2011 -23/01/2011 -24/01/2011 -25/01/2011 -26/01/2011 -27/01/2011 -28/01/2011 -29/01/2011 -30/01/2011 -31/01/2011 -01/02/2011 -02/02/2011 -03/02/2011 -04/02/2011 -05/02/2011 -06/02/2011 -07/02/2011 -08/02/2011 -09/02/2011 -10/02/2011 -11/02/2011 -12/02/2011 -13/02/2011 -14/02/2011 -15/02/2011 -16/02/2011 -17/02/2011 -18/02/2011 -19/02/2011 -20/02/2011 -21/02/2011 -22/02/2011 -23/02/2011 -24/02/2011 -25/02/2011 -26/02/2011 -27/02/2011 -28/02/2011 -01/03/2011 -02/03/2011 -03/03/2011 -04/03/2011 -05/03/2011 -06/03/2011 -07/03/2011 -08/03/2011 -09/03/2011 -10/03/2011 -11/03/2011 -12/03/2011 -13/03/2011 -14/03/2011 -15/03/2011 -16/03/2011 -17/03/2011 -18/03/2011 -19/03/2011 -20/03/2011 -21/03/2011 -22/03/2011 -23/03/2011 -24/03/2011 -25/03/2011 -26/03/2011 -27/03/2011 -28/03/2011 -29/03/2011 -30/03/2011 -31/03/2011 -01/04/2011 -02/04/2011 -03/04/2011 -04/04/2011 -05/04/2011 -06/04/2011 -07/04/2011 -08/04/2011 -09/04/2011 -10/04/2011 -11/04/2011 -12/04/2011 -13/04/2011 -14/04/2011 -15/04/2011 -16/04/2011 -17/04/2011 -18/04/2011 -19/04/2011 -20/04/2011 -21/04/2011 -22/04/2011 -23/04/2011 -24/04/2011 -25/04/2011 -26/04/2011 -27/04/2011 -28/04/2011 -29/04/2011 -30/04/2011 -01/05/2011 -02/05/2011 -03/05/2011 -04/05/2011 -05/05/2011 -06/05/2011 -07/05/2011 -08/05/2011 -09/05/2011 -10/05/2011 -11/05/2011 -12/05/2011 -13/05/2011 -14/05/2011 -15/05/2011 -16/05/2011 -17/05/2011 -18/05/2011 -19/05/2011 -20/05/2011 -21/05/2011 -22/05/2011 -23/05/2011 -24/05/2011 -25/05/2011 -26/05/2011 -27/05/2011 -28/05/2011 -29/05/2011 -30/05/2011 -31/05/2011 -01/06/2011 -02/06/2011 -03/06/2011 -04/06/2011 -05/06/2011 -06/06/2011 -07/06/2011 -08/06/2011 -09/06/2011 -10/06/2011 -11/06/2011 -12/06/2011 -13/06/2011 -14/06/2011 -15/06/2011 -16/06/2011 -17/06/2011 -18/06/2011 -19/06/2011 -20/06/2011 -21/06/2011 -22/06/2011 -23/06/2011 -24/06/2011 -25/06/2011 -26/06/2011 -27/06/2011 -28/06/2011 -29/06/2011 -30/06/2011 -01/07/2011 -02/07/2011 -03/07/2011 -04/07/2011 -05/07/2011 -06/07/2011 -07/07/2011 -08/07/2011 -09/07/2011 -10/07/2011 -11/07/2011 -12/07/2011 -13/07/2011 -14/07/2011 -15/07/2011 -16/07/2011 -17/07/2011 -18/07/2011 -19/07/2011 -20/07/2011 -21/07/2011 -22/07/2011 -23/07/2011 -24/07/2011 -25/07/2011 -26/07/2011 -27/07/2011 -28/07/2011 -29/07/2011 -30/07/2011 -31/07/2011 -01/08/2011 -02/08/2011 -03/08/2011 -04/08/2011 -05/08/2011 -06/08/2011 -07/08/2011 -08/08/2011 -09/08/2011 -10/08/2011 -11/08/2011 -12/08/2011 -13/08/2011 -14/08/2011 -15/08/2011 -16/08/2011 -17/08/2011 -18/08/2011 -19/08/2011 -20/08/2011 -21/08/2011 -22/08/2011 -23/08/2011 -24/08/2011 -25/08/2011 -26/08/2011 -27/08/2011 -28/08/2011 -29/08/2011 -30/08/2011 -31/08/2011 -01/09/2011 -02/09/2011 -03/09/2011 -04/09/2011 -05/09/2011 -06/09/2011 -07/09/2011 -08/09/2011 -09/09/2011 -10/09/2011 -11/09/2011 -12/09/2011 -13/09/2011 -14/09/2011 -15/09/2011 -16/09/2011 -17/09/2011 -18/09/2011 -19/09/2011 -20/09/2011 -21/09/2011 -22/09/2011 -23/09/2011 -24/09/2011 -25/09/2011 -26/09/2011 -27/09/2011 -28/09/2011 -29/09/2011 -30/09/2011 -01/10/2011 -02/10/2011 -03/10/2011 -04/10/2011 -05/10/2011 -06/10/2011 -07/10/2011 -08/10/2011 -09/10/2011 -10/10/2011 -11/10/2011 -12/10/2011 -13/10/2011 -14/10/2011 -15/10/2011 -16/10/2011 -17/10/2011 -18/10/2011 -19/10/2011 -20/10/2011 -21/10/2011 -22/10/2011 -23/10/2011 -24/10/2011 -25/10/2011 -26/10/2011 -27/10/2011 -28/10/2011 -29/10/2011 -30/10/2011 -31/10/2011 -01/11/2011 -02/11/2011 -03/11/2011 -04/11/2011 -05/11/2011 -06/11/2011 -07/11/2011 -08/11/2011 -09/11/2011 -10/11/2011 -11/11/2011 -12/11/2011 -13/11/2011 -14/11/2011 -15/11/2011 -16/11/2011 -17/11/2011 -18/11/2011 -19/11/2011 -20/11/2011 -21/11/2011 -22/11/2011 -23/11/2011 -24/11/2011 -25/11/2011 -26/11/2011 -27/11/2011 -28/11/2011 -29/11/2011 -30/11/2011 -01/12/2011 -02/12/2011 -03/12/2011 -04/12/2011 -05/12/2011 -06/12/2011 -07/12/2011 -08/12/2011 -09/12/2011 -10/12/2011 -11/12/2011 -12/12/2011 -13/12/2011 -14/12/2011 -15/12/2011 -16/12/2011 -17/12/2011 -18/12/2011 -19/12/2011 -20/12/2011 -21/12/2011 -22/12/2011 -23/12/2011 -24/12/2011 -25/12/2011 -26/12/2011 -27/12/2011 -28/12/2011 -29/12/2011 -30/12/2011 -31/12/2011 -01/01/2012 -02/01/2012 -03/01/2012 -04/01/2012 -05/01/2012 -06/01/2012 -07/01/2012 -08/01/2012 -09/01/2012 -10/01/2012 -11/01/2012 -12/01/2012 -13/01/2012 -14/01/2012 -15/01/2012 -16/01/2012 -17/01/2012 -18/01/2012 -19/01/2012 -20/01/2012 -21/01/2012 -22/01/2012 -23/01/2012 -24/01/2012 -25/01/2012 -26/01/2012 -27/01/2012 -28/01/2012 -29/01/2012 -30/01/2012 -31/01/2012 -01/02/2012 -02/02/2012 -03/02/2012 -04/02/2012 -05/02/2012 -06/02/2012 -07/02/2012 -08/02/2012 -09/02/2012 -10/02/2012 -11/02/2012 -12/02/2012 -13/02/2012 -14/02/2012 -15/02/2012 -16/02/2012 -17/02/2012 -18/02/2012 -19/02/2012 -20/02/2012 -21/02/2012 -22/02/2012 -23/02/2012 -24/02/2012 -25/02/2012 -26/02/2012 -27/02/2012 -28/02/2012 -29/02/2012 -01/03/2012 -02/03/2012 -03/03/2012 -04/03/2012 -05/03/2012 -06/03/2012 -07/03/2012 -08/03/2012 -09/03/2012 -10/03/2012 -11/03/2012 -12/03/2012 -13/03/2012 -14/03/2012 -15/03/2012 -16/03/2012 -17/03/2012 -18/03/2012 -19/03/2012 -20/03/2012 -21/03/2012 -22/03/2012 -23/03/2012 -24/03/2012 -25/03/2012 -26/03/2012 -27/03/2012 -28/03/2012 -29/03/2012 -30/03/2012 -31/03/2012 -01/04/2012 -02/04/2012 -03/04/2012 -04/04/2012 -05/04/2012 -06/04/2012 -07/04/2012 -08/04/2012 -09/04/2012 -10/04/2012 -11/04/2012 -12/04/2012 -13/04/2012 -14/04/2012 -15/04/2012 -16/04/2012 -17/04/2012 -18/04/2012 -19/04/2012 -20/04/2012 -21/04/2012 -22/04/2012 -23/04/2012 -24/04/2012 -25/04/2012 -26/04/2012 -27/04/2012 -28/04/2012 -29/04/2012 -30/04/2012 -01/05/2012 -02/05/2012 -03/05/2012 -04/05/2012 -05/05/2012 -06/05/2012 -07/05/2012 -08/05/2012 -09/05/2012 -10/05/2012 -11/05/2012 -12/05/2012 -13/05/2012 -14/05/2012 -15/05/2012 -16/05/2012 -17/05/2012 -18/05/2012 -19/05/2012 -20/05/2012 -21/05/2012 -22/05/2012 -23/05/2012 -24/05/2012 -25/05/2012 -26/05/2012 -27/05/2012 -28/05/2012 -29/05/2012 -30/05/2012 -31/05/2012 -01/06/2012 -02/06/2012 -03/06/2012 -04/06/2012 -05/06/2012 -06/06/2012 -07/06/2012 -08/06/2012 -09/06/2012 -10/06/2012 -11/06/2012 -12/06/2012 -13/06/2012 -14/06/2012 -15/06/2012 -16/06/2012 -17/06/2012 -18/06/2012 -19/06/2012 -20/06/2012 -21/06/2012 -22/06/2012 -23/06/2012 -24/06/2012 -25/06/2012 -26/06/2012 -27/06/2012 -28/06/2012 -29/06/2012 -30/06/2012 -01/07/2012 -02/07/2012 -03/07/2012 -04/07/2012 -05/07/2012 -06/07/2012 -07/07/2012 -08/07/2012 -09/07/2012 -10/07/2012 -11/07/2012 -12/07/2012 -13/07/2012 -14/07/2012 -15/07/2012 -16/07/2012 -17/07/2012 -18/07/2012 -19/07/2012 -20/07/2012 -21/07/2012 -22/07/2012 -23/07/2012 -24/07/2012 -25/07/2012 -26/07/2012 -27/07/2012 -28/07/2012 -29/07/2012 -30/07/2012 -31/07/2012 -01/08/2012 -02/08/2012 -03/08/2012 -04/08/2012 -05/08/2012 -06/08/2012 -07/08/2012 -08/08/2012 -09/08/2012 -10/08/2012 -11/08/2012 -12/08/2012 -13/08/2012 -14/08/2012 -15/08/2012 -16/08/2012 -17/08/2012 -18/08/2012 -19/08/2012 -20/08/2012 -21/08/2012 -22/08/2012 -23/08/2012 -24/08/2012 -25/08/2012 -26/08/2012 -27/08/2012 -28/08/2012 -29/08/2012 -30/08/2012 -31/08/2012 -01/09/2012 -02/09/2012 -03/09/2012 -04/09/2012 -05/09/2012 -06/09/2012 -07/09/2012 -08/09/2012 -09/09/2012 -10/09/2012 -11/09/2012 -12/09/2012 -13/09/2012 -14/09/2012 -15/09/2012 -16/09/2012 -17/09/2012 -18/09/2012 -19/09/2012 -20/09/2012 -21/09/2012 -22/09/2012 -23/09/2012 -24/09/2012 -25/09/2012 -26/09/2012 -27/09/2012 -28/09/2012 -29/09/2012 -30/09/2012 -01/10/2012 -02/10/2012 -03/10/2012 -04/10/2012 -05/10/2012 -06/10/2012 -07/10/2012 -08/10/2012 -09/10/2012 -10/10/2012 -11/10/2012 -12/10/2012 -13/10/2012 -14/10/2012 -15/10/2012 -16/10/2012 -17/10/2012 -18/10/2012 -19/10/2012 -20/10/2012 -21/10/2012 -22/10/2012 -23/10/2012 -24/10/2012 -25/10/2012 -26/10/2012 -27/10/2012 -28/10/2012 -29/10/2012 -30/10/2012 -31/10/2012 -01/11/2012 -02/11/2012 -03/11/2012 -04/11/2012 -05/11/2012 -06/11/2012 -07/11/2012 -08/11/2012 -09/11/2012 -10/11/2012 -11/11/2012 -12/11/2012 -13/11/2012 -14/11/2012 -15/11/2012 -16/11/2012 -17/11/2012 -18/11/2012 -19/11/2012 -20/11/2012 -21/11/2012 -22/11/2012 -23/11/2012 -24/11/2012 -25/11/2012 -26/11/2012 -27/11/2012 -28/11/2012 -29/11/2012 -30/11/2012 -01/12/2012 -02/12/2012 -03/12/2012 -04/12/2012 -05/12/2012 -06/12/2012 -07/12/2012 -08/12/2012 -09/12/2012 -10/12/2012 -11/12/2012 -12/12/2012 -13/12/2012 -14/12/2012 -15/12/2012 -16/12/2012 -17/12/2012 -18/12/2012 -19/12/2012 -20/12/2012 -21/12/2012 -22/12/2012 -23/12/2012 -24/12/2012 -25/12/2012 -26/12/2012 -27/12/2012 -28/12/2012 -29/12/2012 -30/12/2012 -31/12/2012 -01/01/2013 -02/01/2013 -03/01/2013 -04/01/2013 -05/01/2013 -06/01/2013 -07/01/2013 -08/01/2013 -09/01/2013 -10/01/2013 -11/01/2013 -12/01/2013 -13/01/2013 -14/01/2013 -15/01/2013 -16/01/2013 -17/01/2013 -18/01/2013 -19/01/2013 -20/01/2013 -21/01/2013 -22/01/2013 -23/01/2013 -24/01/2013 -25/01/2013 -26/01/2013 -27/01/2013 -28/01/2013 -29/01/2013 -30/01/2013 -31/01/2013 -01/02/2013 -02/02/2013 -03/02/2013 -04/02/2013 -05/02/2013 -06/02/2013 -07/02/2013 -08/02/2013 -09/02/2013 -10/02/2013 -11/02/2013 -12/02/2013 -13/02/2013 -14/02/2013 -15/02/2013 -16/02/2013 -17/02/2013 -18/02/2013 -19/02/2013 -20/02/2013 -21/02/2013 -22/02/2013 -23/02/2013 -24/02/2013 -25/02/2013 -26/02/2013 -27/02/2013 -28/02/2013 -01/03/2013 -02/03/2013 -03/03/2013 -04/03/2013 -05/03/2013 -06/03/2013 -07/03/2013 -08/03/2013 -09/03/2013 -10/03/2013 -11/03/2013 -12/03/2013 -13/03/2013 -14/03/2013 -15/03/2013 -16/03/2013 -17/03/2013 -18/03/2013 -19/03/2013 -20/03/2013 -21/03/2013 -22/03/2013 -23/03/2013 -24/03/2013 -25/03/2013 -26/03/2013 -27/03/2013 -28/03/2013 -29/03/2013 -30/03/2013 -31/03/2013 -01/04/2013 -02/04/2013 -03/04/2013 -04/04/2013 -05/04/2013 -06/04/2013 -07/04/2013 -08/04/2013 -09/04/2013 -10/04/2013 -11/04/2013 -12/04/2013 -13/04/2013 -14/04/2013 -15/04/2013 -16/04/2013 -17/04/2013 -18/04/2013 -19/04/2013 -20/04/2013 -21/04/2013 -22/04/2013 -23/04/2013 -24/04/2013 -25/04/2013 -26/04/2013 -27/04/2013 -28/04/2013 -29/04/2013 -30/04/2013 -01/05/2013 -02/05/2013 -03/05/2013 -04/05/2013 -05/05/2013 -06/05/2013 -07/05/2013 -08/05/2013 -09/05/2013 -10/05/2013 -11/05/2013 -12/05/2013 -13/05/2013 -14/05/2013 -15/05/2013 -16/05/2013 -17/05/2013 -18/05/2013 -19/05/2013 -20/05/2013 -21/05/2013 -22/05/2013 -23/05/2013 -24/05/2013 -25/05/2013 -26/05/2013 -27/05/2013 -28/05/2013 -29/05/2013 -30/05/2013 -31/05/2013 -01/06/2013 -02/06/2013 -03/06/2013 -04/06/2013 -05/06/2013 -06/06/2013 -07/06/2013 -08/06/2013 -09/06/2013 -10/06/2013 -11/06/2013 -12/06/2013 -13/06/2013 -14/06/2013 -15/06/2013 -16/06/2013 -17/06/2013 -18/06/2013 -19/06/2013 -20/06/2013 -21/06/2013 -22/06/2013 -23/06/2013 -24/06/2013 -25/06/2013 -26/06/2013 -27/06/2013 -28/06/2013 -29/06/2013 -30/06/2013 -01/07/2013 -02/07/2013 -03/07/2013 -04/07/2013 -05/07/2013 -06/07/2013 -07/07/2013 -08/07/2013 -09/07/2013 -10/07/2013 -11/07/2013 -12/07/2013 -13/07/2013 -14/07/2013 -15/07/2013 -16/07/2013 -17/07/2013 -18/07/2013 -19/07/2013 -20/07/2013 -21/07/2013 -22/07/2013 -23/07/2013 -24/07/2013 -25/07/2013 -26/07/2013 -27/07/2013 -28/07/2013 -29/07/2013 -30/07/2013 -31/07/2013 -01/08/2013 -02/08/2013 -03/08/2013 -04/08/2013 -05/08/2013 -06/08/2013 -07/08/2013 -08/08/2013 -09/08/2013 -10/08/2013 -11/08/2013 -12/08/2013 -13/08/2013 -14/08/2013 -15/08/2013 -16/08/2013 -17/08/2013 -18/08/2013 -19/08/2013 -20/08/2013 -21/08/2013 -22/08/2013 -23/08/2013 -24/08/2013 -25/08/2013 -26/08/2013 -27/08/2013 -28/08/2013 -29/08/2013 -30/08/2013 -31/08/2013 -01/09/2013 -02/09/2013 -03/09/2013 -04/09/2013 -05/09/2013 -06/09/2013 -07/09/2013 -08/09/2013 -09/09/2013 -10/09/2013 -11/09/2013 -12/09/2013 -13/09/2013 -14/09/2013 -15/09/2013 -16/09/2013 -17/09/2013 -18/09/2013 -19/09/2013 -20/09/2013 -21/09/2013 -22/09/2013 -23/09/2013 -24/09/2013 -25/09/2013 -26/09/2013 -27/09/2013 -28/09/2013 -29/09/2013 -30/09/2013 -01/10/2013 -02/10/2013 -03/10/2013 -04/10/2013 -05/10/2013 -06/10/2013 -07/10/2013 -08/10/2013 -09/10/2013 -10/10/2013 -11/10/2013 -12/10/2013 -13/10/2013 -14/10/2013 -15/10/2013 -16/10/2013 -17/10/2013 -18/10/2013 -19/10/2013 -20/10/2013 -21/10/2013 -22/10/2013 -23/10/2013 -24/10/2013 -25/10/2013 -26/10/2013 -27/10/2013 -28/10/2013 -29/10/2013 -30/10/2013 -31/10/2013 -01/11/2013 -02/11/2013 -03/11/2013 -04/11/2013 -05/11/2013 -06/11/2013 -07/11/2013 -08/11/2013 -09/11/2013 -10/11/2013 -11/11/2013 -12/11/2013 -13/11/2013 -14/11/2013 -15/11/2013 -16/11/2013 -17/11/2013 -18/11/2013 -19/11/2013 -20/11/2013 -21/11/2013 -22/11/2013 -23/11/2013 -24/11/2013 -25/11/2013 -26/11/2013 -27/11/2013 -28/11/2013 -29/11/2013 -30/11/2013 -01/12/2013 -02/12/2013 -03/12/2013 -04/12/2013 -05/12/2013 -06/12/2013 -07/12/2013 -08/12/2013 -09/12/2013 -10/12/2013 -11/12/2013 -12/12/2013 -13/12/2013 -14/12/2013 -15/12/2013 -16/12/2013 -17/12/2013 -18/12/2013 -19/12/2013 -20/12/2013 -21/12/2013 -22/12/2013 -23/12/2013 -24/12/2013 -25/12/2013 -26/12/2013 -27/12/2013 -28/12/2013 -29/12/2013 -30/12/2013 -31/12/2013 -01/01/2014 -02/01/2014 -03/01/2014 -04/01/2014 -05/01/2014 -06/01/2014 -07/01/2014 -08/01/2014 -09/01/2014 -10/01/2014 -11/01/2014 -12/01/2014 -13/01/2014 -14/01/2014 -15/01/2014 -16/01/2014 -17/01/2014 -18/01/2014 -19/01/2014 -20/01/2014 -21/01/2014 -22/01/2014 -23/01/2014 -24/01/2014 -25/01/2014 -26/01/2014 -27/01/2014 -28/01/2014 -29/01/2014 -30/01/2014 -31/01/2014 -01/02/2014 -02/02/2014 -03/02/2014 -04/02/2014 -05/02/2014 -06/02/2014 -07/02/2014 -08/02/2014 -09/02/2014 -10/02/2014 -11/02/2014 -12/02/2014 -13/02/2014 -14/02/2014 -15/02/2014 -16/02/2014 -17/02/2014 -18/02/2014 -19/02/2014 -20/02/2014 -21/02/2014 -22/02/2014 -23/02/2014 -24/02/2014 -25/02/2014 -26/02/2014 -27/02/2014 -28/02/2014 -01/03/2014 -02/03/2014 -03/03/2014 -04/03/2014 -05/03/2014 -06/03/2014 -07/03/2014 -08/03/2014 -09/03/2014 -10/03/2014 -11/03/2014 -12/03/2014 -13/03/2014 -14/03/2014 -15/03/2014 -16/03/2014 -17/03/2014 -18/03/2014 -19/03/2014 -20/03/2014 -21/03/2014 -22/03/2014 -23/03/2014 -24/03/2014 -25/03/2014 -26/03/2014 -27/03/2014 -28/03/2014 -29/03/2014 -30/03/2014 -31/03/2014 -01/04/2014 -02/04/2014 -03/04/2014 -04/04/2014 -05/04/2014 -06/04/2014 -07/04/2014 -08/04/2014 -09/04/2014 -10/04/2014 -11/04/2014 -12/04/2014 -13/04/2014 -14/04/2014 -15/04/2014 -16/04/2014 -17/04/2014 -18/04/2014 -19/04/2014 -20/04/2014 -21/04/2014 -22/04/2014 -23/04/2014 -24/04/2014 -25/04/2014 -26/04/2014 -27/04/2014 -28/04/2014 -29/04/2014 -30/04/2014 -01/05/2014 -02/05/2014 -03/05/2014 -04/05/2014 -05/05/2014 -06/05/2014 -07/05/2014 -08/05/2014 -09/05/2014 -10/05/2014 -11/05/2014 -12/05/2014 -13/05/2014 -14/05/2014 -15/05/2014 -16/05/2014 -17/05/2014 -18/05/2014 -19/05/2014 -20/05/2014 -21/05/2014 -22/05/2014 -23/05/2014 -24/05/2014 -25/05/2014 -26/05/2014 -27/05/2014 -28/05/2014 -29/05/2014 -30/05/2014 -31/05/2014 -01/06/2014 -02/06/2014 -03/06/2014 -04/06/2014 -05/06/2014 -06/06/2014 -07/06/2014 -08/06/2014 -09/06/2014 -10/06/2014 -11/06/2014 -12/06/2014 -13/06/2014 -14/06/2014 -15/06/2014 -16/06/2014 -17/06/2014 -18/06/2014 -19/06/2014 -20/06/2014 -21/06/2014 -22/06/2014 -23/06/2014 -24/06/2014 -25/06/2014 -26/06/2014 -27/06/2014 -28/06/2014 -29/06/2014 -30/06/2014 -01/07/2014 -02/07/2014 -03/07/2014 -04/07/2014 -05/07/2014 -06/07/2014 -07/07/2014 -08/07/2014 -09/07/2014 -10/07/2014 -11/07/2014 -12/07/2014 -13/07/2014 -14/07/2014 -15/07/2014 -16/07/2014 -17/07/2014 -18/07/2014 -19/07/2014 -20/07/2014 -21/07/2014 -22/07/2014 -23/07/2014 -24/07/2014 -25/07/2014 -26/07/2014 -27/07/2014 -28/07/2014 -29/07/2014 -30/07/2014 -31/07/2014 -01/08/2014 -02/08/2014 -03/08/2014 -04/08/2014 -05/08/2014 -06/08/2014 -07/08/2014 -08/08/2014 -09/08/2014 -10/08/2014 -11/08/2014 -12/08/2014 -13/08/2014 -14/08/2014 -15/08/2014 -16/08/2014 -17/08/2014 -18/08/2014 -19/08/2014 -20/08/2014 -21/08/2014 -22/08/2014 -23/08/2014 -24/08/2014 -25/08/2014 -26/08/2014 -27/08/2014 -28/08/2014 -29/08/2014 -30/08/2014 -31/08/2014 -01/09/2014 -02/09/2014 -03/09/2014 -04/09/2014 -05/09/2014 -06/09/2014 -07/09/2014 -08/09/2014 -09/09/2014 -10/09/2014 -11/09/2014 -12/09/2014 -13/09/2014 -14/09/2014 -15/09/2014 -16/09/2014 -17/09/2014 -18/09/2014 -19/09/2014 -20/09/2014 -21/09/2014 -22/09/2014 -23/09/2014 -24/09/2014 -25/09/2014 -26/09/2014 -27/09/2014 -28/09/2014 -29/09/2014 -30/09/2014 -01/10/2014 -02/10/2014 -03/10/2014 -04/10/2014 -05/10/2014 -06/10/2014 -07/10/2014 -08/10/2014 -09/10/2014 -10/10/2014 -11/10/2014 -12/10/2014 -13/10/2014 -14/10/2014 -15/10/2014 -16/10/2014 -17/10/2014 -18/10/2014 -19/10/2014 -20/10/2014 -21/10/2014 -22/10/2014 -23/10/2014 -24/10/2014 -25/10/2014 -26/10/2014 -27/10/2014 -28/10/2014 -29/10/2014 -30/10/2014 -31/10/2014 -01/11/2014 -02/11/2014 -03/11/2014 -04/11/2014 -05/11/2014 -06/11/2014 -07/11/2014 -08/11/2014 -09/11/2014 -10/11/2014 -11/11/2014 -12/11/2014 -13/11/2014 -14/11/2014 -15/11/2014 -16/11/2014 -17/11/2014 -18/11/2014 -19/11/2014 -20/11/2014 -21/11/2014 -22/11/2014 -23/11/2014 -24/11/2014 -25/11/2014 -26/11/2014 -27/11/2014 -28/11/2014 -29/11/2014 -30/11/2014 -01/12/2014 -02/12/2014 -03/12/2014 -04/12/2014 -05/12/2014 -06/12/2014 -07/12/2014 -08/12/2014 -09/12/2014 -10/12/2014 -11/12/2014 -12/12/2014 -13/12/2014 -14/12/2014 -15/12/2014 -16/12/2014 -17/12/2014 -18/12/2014 -19/12/2014 -20/12/2014 -21/12/2014 -22/12/2014 -23/12/2014 -24/12/2014 -25/12/2014 -26/12/2014 -27/12/2014 -28/12/2014 -29/12/2014 -30/12/2014 -31/12/2014 -01/01/2015 -02/01/2015 -03/01/2015 -04/01/2015 -05/01/2015 -06/01/2015 -07/01/2015 -08/01/2015 -09/01/2015 -10/01/2015 -11/01/2015 -12/01/2015 -13/01/2015 -14/01/2015 -15/01/2015 -16/01/2015 -17/01/2015 -18/01/2015 -19/01/2015 -20/01/2015 -21/01/2015 -22/01/2015 -23/01/2015 -24/01/2015 -25/01/2015 -26/01/2015 -27/01/2015 -28/01/2015 -29/01/2015 -30/01/2015 -31/01/2015 -01/02/2015 -02/02/2015 -03/02/2015 -04/02/2015 -05/02/2015 -06/02/2015 -07/02/2015 -08/02/2015 -09/02/2015 -10/02/2015 -11/02/2015 -12/02/2015 -13/02/2015 -14/02/2015 -15/02/2015 -16/02/2015 -17/02/2015 -18/02/2015 -19/02/2015 -20/02/2015 -21/02/2015 -22/02/2015 -23/02/2015 -24/02/2015 -25/02/2015 -26/02/2015 -27/02/2015 -28/02/2015 -01/03/2015 -02/03/2015 -03/03/2015 -04/03/2015 -05/03/2015 -06/03/2015 -07/03/2015 -08/03/2015 -09/03/2015 -10/03/2015 -11/03/2015 -12/03/2015 -13/03/2015 -14/03/2015 -15/03/2015 -16/03/2015 -17/03/2015 -18/03/2015 -19/03/2015 -20/03/2015 -21/03/2015 -22/03/2015 -23/03/2015 -24/03/2015 -25/03/2015 -26/03/2015 -27/03/2015 -28/03/2015 -29/03/2015 -30/03/2015 -31/03/2015 -01/04/2015 -02/04/2015 -03/04/2015 -04/04/2015 -05/04/2015 -06/04/2015 -07/04/2015 -08/04/2015 -09/04/2015 -10/04/2015 -11/04/2015 -12/04/2015 -13/04/2015 -14/04/2015 -15/04/2015 -16/04/2015 -17/04/2015 -18/04/2015 -19/04/2015 -20/04/2015 -21/04/2015 -22/04/2015 -23/04/2015 -24/04/2015 -25/04/2015 -26/04/2015 -27/04/2015 -28/04/2015 -29/04/2015 -30/04/2015 -01/05/2015 -02/05/2015 -03/05/2015 -04/05/2015 -05/05/2015 -06/05/2015 -07/05/2015 -08/05/2015 -09/05/2015 -10/05/2015 -11/05/2015 -12/05/2015 -13/05/2015 -14/05/2015 -15/05/2015 -16/05/2015 -17/05/2015 -18/05/2015 -19/05/2015 -20/05/2015 -21/05/2015 -22/05/2015 -23/05/2015 -24/05/2015 -25/05/2015 -26/05/2015 -27/05/2015 -28/05/2015 -29/05/2015 -30/05/2015 -31/05/2015 -01/06/2015 -02/06/2015 -03/06/2015 -04/06/2015 -05/06/2015 -06/06/2015 -07/06/2015 -08/06/2015 -09/06/2015 -10/06/2015 -11/06/2015 -12/06/2015 -13/06/2015 -14/06/2015 -15/06/2015 -16/06/2015 -17/06/2015 -18/06/2015 -19/06/2015 -20/06/2015 -21/06/2015 -22/06/2015 -23/06/2015 diff --git a/ThirdParty/Ert/test-data/local/snake_oil_no_data/snake_oil.ert b/ThirdParty/Ert/test-data/local/snake_oil_no_data/snake_oil.ert deleted file mode 100644 index 72fef586d0..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_no_data/snake_oil.ert +++ /dev/null @@ -1,40 +0,0 @@ -QUEUE_SYSTEM LOCAL - -JOBNAME SNAKE_OIL_%d -NUM_REALIZATIONS 25 - -DEFINE storage/ - -STORE_SEED SEED -LOAD_SEED SEED - -RUNPATH_FILE directory/test_runpath_list.txt -RUNPATH /runpath/realisation-%d/iter-%d -ENSPATH /ensemble -ECLBASE SNAKE_OIL_FIELD -SUMMARY * - -HISTORY_SOURCE REFCASE_HISTORY -REFCASE refcase/SNAKE_OIL_FIELD - -TIME_MAP refcase/time_map.txt -OBS_CONFIG observations/observations.txt - -INSTALL_JOB SNAKE_OIL_SIMULATOR jobs/SNAKE_OIL_SIMULATOR -INSTALL_JOB SNAKE_OIL_NPV jobs/SNAKE_OIL_NPV -INSTALL_JOB SNAKE_OIL_DIFF jobs/SNAKE_OIL_DIFF - -FORWARD_MODEL SNAKE_OIL_SIMULATOR -FORWARD_MODEL SNAKE_OIL_NPV -FORWARD_MODEL SNAKE_OIL_DIFF - -RUN_TEMPLATE templates/seed_template.txt seed.txt -GEN_KW SNAKE_OIL_PARAM templates/snake_oil_template.txt snake_oil_params.txt parameters/snake_oil_parameters.txt -CUSTOM_KW SNAKE_OIL_NPV snake_oil_npv.txt -GEN_DATA SNAKE_OIL_OPR_DIFF INPUT_FORMAT:ASCII RESULT_FILE:snake_oil_opr_diff_%d.txt REPORT_STEPS:199 -GEN_DATA SNAKE_OIL_WPR_DIFF INPUT_FORMAT:ASCII RESULT_FILE:snake_oil_wpr_diff_%d.txt REPORT_STEPS:199 -GEN_DATA SNAKE_OIL_GPR_DIFF INPUT_FORMAT:ASCII RESULT_FILE:snake_oil_gpr_diff_%d.txt REPORT_STEPS:199 - -LOG_LEVEL 3 -LOG_FILE log/log.txt -UPDATE_LOG_PATH log/update diff --git a/ThirdParty/Ert/test-data/local/snake_oil_no_data/snake_oil_GEO_ID.ert b/ThirdParty/Ert/test-data/local/snake_oil_no_data/snake_oil_GEO_ID.ert deleted file mode 100644 index 5818bd064d..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_no_data/snake_oil_GEO_ID.ert +++ /dev/null @@ -1,39 +0,0 @@ -QUEUE_SYSTEM LOCAL - -JOBNAME SNAKE_OIL_%d -NUM_REALIZATIONS 25 - -DEFINE storage/ - -STORE_SEED SEED -LOAD_SEED SEED - -RUNPATH simulations//realisation-%d/iter-%d -ENSPATH /ensemble -ECLBASE SNAKE_OIL_FIELD -SUMMARY * - -HISTORY_SOURCE REFCASE_HISTORY -REFCASE refcase/SNAKE_OIL_FIELD - -TIME_MAP refcase/time_map.txt -OBS_CONFIG observations/observations.txt - -INSTALL_JOB SNAKE_OIL_SIMULATOR jobs/SNAKE_OIL_SIMULATOR -INSTALL_JOB SNAKE_OIL_NPV jobs/SNAKE_OIL_NPV -INSTALL_JOB SNAKE_OIL_DIFF jobs/SNAKE_OIL_DIFF - -FORWARD_MODEL SNAKE_OIL_SIMULATOR -FORWARD_MODEL SNAKE_OIL_NPV -FORWARD_MODEL SNAKE_OIL_DIFF - -RUN_TEMPLATE templates/seed_template.txt seed.txt -GEN_KW SNAKE_OIL_PARAM templates/snake_oil_template.txt snake_oil_params.txt parameters/snake_oil_parameters.txt -CUSTOM_KW SNAKE_OIL_NPV snake_oil_npv.txt -GEN_DATA SNAKE_OIL_OPR_DIFF INPUT_FORMAT:ASCII RESULT_FILE:snake_oil_opr_diff_%d.txt REPORT_STEPS:199 -GEN_DATA SNAKE_OIL_WPR_DIFF INPUT_FORMAT:ASCII RESULT_FILE:snake_oil_wpr_diff_%d.txt REPORT_STEPS:199 -GEN_DATA SNAKE_OIL_GPR_DIFF INPUT_FORMAT:ASCII RESULT_FILE:snake_oil_gpr_diff_%d.txt REPORT_STEPS:199 - -LOG_LEVEL 3 -LOG_FILE log/log.txt -UPDATE_LOG_PATH log/update diff --git a/ThirdParty/Ert/test-data/local/snake_oil_no_data/templates/seed_template.txt b/ThirdParty/Ert/test-data/local/snake_oil_no_data/templates/seed_template.txt deleted file mode 100644 index a0bca49fbd..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_no_data/templates/seed_template.txt +++ /dev/null @@ -1 +0,0 @@ -SEED: \ No newline at end of file diff --git a/ThirdParty/Ert/test-data/local/snake_oil_no_data/templates/snake_oil_template.txt b/ThirdParty/Ert/test-data/local/snake_oil_no_data/templates/snake_oil_template.txt deleted file mode 100644 index ad2c648a0b..0000000000 --- a/ThirdParty/Ert/test-data/local/snake_oil_no_data/templates/snake_oil_template.txt +++ /dev/null @@ -1,10 +0,0 @@ -OP1_PERSISTENCE: -OP1_OCTAVES: -OP1_DIVERGENCE_SCALE: -OP1_OFFSET: -OP2_PERSISTENCE: -OP2_OCTAVES: -OP2_DIVERGENCE_SCALE: -OP2_OFFSET: -BPR_555_PERSISTENCE: -BPR_138_PERSISTENCE: diff --git a/ThirdParty/custom-opm-flowdiag-app/CMakeLists.txt b/ThirdParty/custom-opm-flowdiag-app/CMakeLists.txt index 6b2a9d5bc4..cd458bfda0 100644 --- a/ThirdParty/custom-opm-flowdiag-app/CMakeLists.txt +++ b/ThirdParty/custom-opm-flowdiag-app/CMakeLists.txt @@ -21,6 +21,8 @@ foreach (file ${project_source_files} ) list(APPEND project_source_files_complete_path1 "opm-flowdiagnostics-applications/${file}" ) endforeach() +add_definitions(-DHAVE_ERT_ECL_TYPE_H) + add_library(custom-opm-flowdiag-app ${project_source_files_complete_path1} ) diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/CMakeLists.txt b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/CMakeLists.txt index 482918b86e..a34a4a9b59 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/CMakeLists.txt +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/CMakeLists.txt @@ -73,6 +73,35 @@ include (${project}-prereqs) include (CMakeLists_files.cmake) macro (config_hook) + if (NOT ERT_FOUND) + set (HAVE_ERT_ECL_TYPE_H 0) + else () + # ERT_FOUND + cmake_push_check_state () + + set (CMAKE_REQUIRED_INCLUDES ${ERT_INCLUDE_DIR}) + set (CMAKE_REQUIRED_LIBRARIES ${ERT_LIBRARIES}) + + check_cxx_source_compiles ( +" +#include + +#include +#include + +int main () +{ + ecl_kw_type* kw = nullptr; + + std::cout << ecl_type_get_type(ecl_kw_get_data_type(kw)) << std::endl; +} +" + HAVE_ERT_ECL_TYPE_H) + + cmake_pop_check_state () + endif () + + list (APPEND "${project}_CONFIG_VARS" HAVE_ERT_ECL_TYPE_H) endmacro (config_hook) macro (prereqs_hook) diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/CMakeLists_files.cmake b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/CMakeLists_files.cmake index 568ddf04b3..e30cdd67a1 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/CMakeLists_files.cmake +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/CMakeLists_files.cmake @@ -33,6 +33,7 @@ list (APPEND TEST_SOURCE_FILES ) list (APPEND EXAMPLE_SOURCE_FILES + examples/computeFlowStorageCurve.cpp examples/computeLocalSolutions.cpp examples/computeToFandTracers.cpp examples/computeTracers.cpp diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/examples/computeFlowStorageCurve.cpp b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/examples/computeFlowStorageCurve.cpp new file mode 100644 index 0000000000..f29df16e8b --- /dev/null +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/examples/computeFlowStorageCurve.cpp @@ -0,0 +1,79 @@ +/* + Copyright 2016 SINTEF ICT, Applied Mathematics. + Copyright 2016, 2017 Statoil ASA. + + This file is part of the Open Porous Media Project (OPM). + + OPM 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. + + OPM 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 for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . +*/ + +#if HAVE_CONFIG_H +#include +#endif + +#include "exampleSetup.hpp" + +#include +#include + +// Syntax (typical): +// computeFlowStorageCurve case= step= +int main(int argc, char* argv[]) +try { + example::Setup setup(argc, argv); + auto& fdTool = setup.toolbox; + + // Solve for forward and reverse time of flight. + std::vector start; + auto fwd = fdTool.computeInjectionDiagnostics(start); + auto rev = fdTool.computeProductionDiagnostics(start); + + // Give disconnected cells zero pore volume. + std::vector nbcount(setup.graph.numCells(), 0); + for (int nb : setup.graph.neighbours()) { + if (nb >= 0) { + ++nbcount[nb]; + } + } + auto pv = setup.graph.poreVolume(); + for (size_t i = 0; i < pv.size(); ++i) { + if (nbcount[i] == 0) { + pv[i] = 0.0; + } + } + + // Cells that have more than 100 times the average pore volume are + // probably aquifers, we ignore them (again by setting pore volume + // to zero). If this is the correct thing to do or not could + // depend on what you want to use the diagnostic for. + const double average_pv = std::accumulate(pv.begin(), pv.end(), 0.0) / double(pv.size()); + for (double& pvval : pv) { + if (pvval > 100.0 * average_pv) { + pvval = 0.0; + } + } + + // Compute graph. + auto fphi = Opm::FlowDiagnostics::flowCapacityStorageCapacityCurve(fwd, rev, pv); + + // Write it to standard out. + std::cout.precision(16); + const int sz = fphi.first.size(); + for (int i = 0; i < sz; ++i) { + std::cout << fphi.first[i] << " " << fphi.second[i] << '\n'; + } +} +catch (const std::exception& e) { + std::cerr << "Caught exception: " << e.what() << '\n'; +} diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/examples/computeLocalSolutions.cpp b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/examples/computeLocalSolutions.cpp index 8b5e2b7152..50a2a5598d 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/examples/computeLocalSolutions.cpp +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/examples/computeLocalSolutions.cpp @@ -42,9 +42,9 @@ try { std::vector completion_cells; completion_cells.reserve(well.completions.size()); for (const auto& completion : well.completions) { - const int grid_index = completion.grid_index; + const auto& gridName = completion.gridName; const auto& ijk = completion.ijk; - const int cell_index = setup.graph.activeCell(ijk, grid_index); + const int cell_index = setup.graph.activeCell(ijk, gridName); if (cell_index >= 0) { completion_cells.push_back(cell_index); } diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/examples/exampleSetup.hpp b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/examples/exampleSetup.hpp index 5d2f64b4c0..a536c2730e 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/examples/exampleSetup.hpp +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/examples/exampleSetup.hpp @@ -31,10 +31,10 @@ #include #include +#include #include #include -#include #include #include #include @@ -80,38 +80,66 @@ namespace example { throw std::invalid_argument(os.str()); } + + template inline Opm::FlowDiagnostics::ConnectionValues - extractFluxField(const Opm::ECLGraph& G, const bool compute_fluxes) + extractFluxField(const Opm::ECLGraph& G, + FluxCalc&& getFlux) { using ConnVals = Opm::FlowDiagnostics::ConnectionValues; + + const auto actPh = G.activePhases(); + auto flux = ConnVals(ConnVals::NumConnections{G.numConnections()}, - ConnVals::NumPhases{3}); + ConnVals::NumPhases{actPh.size()}); auto phas = ConnVals::PhaseID{0}; - Opm::ECLFluxCalc calc(G); + for (const auto& p : actPh) { + const auto pflux = getFlux(p); - const auto phases = { Opm::ECLGraph::PhaseIndex::Aqua , - Opm::ECLGraph::PhaseIndex::Liquid , - Opm::ECLGraph::PhaseIndex::Vapour }; - - for (const auto& p : phases) - { - const auto pflux = compute_fluxes ? calc.flux(p) : G.flux(p); if (! pflux.empty()) { assert (pflux.size() == flux.numConnections()); + auto conn = ConnVals::ConnID{0}; for (const auto& v : pflux) { flux(conn, phas) = v; conn.id += 1; } } + phas.id += 1; } return flux; } + inline Opm::FlowDiagnostics::ConnectionValues + extractFluxField(const Opm::ECLGraph& G, + const Opm::ECLRestartData& rstrt, + const bool compute_fluxes) + { + if (compute_fluxes) { + Opm::ECLFluxCalc calc(G); + + auto getFlux = [&calc, &rstrt] + (const Opm::ECLGraph::PhaseIndex p) + { + return calc.flux(rstrt, p); + }; + + return extractFluxField(G, getFlux); + } + + auto getFlux = [&G, &rstrt] + (const Opm::ECLGraph::PhaseIndex p) + { + return G.flux(rstrt, p); + }; + + return extractFluxField(G, getFlux); + } + template Opm::FlowDiagnostics::CellSetValues extractWellFlows(const Opm::ECLGraph& G, @@ -120,9 +148,9 @@ namespace example { Opm::FlowDiagnostics::CellSetValues inflow; for (const auto& well : well_fluxes) { for (const auto& completion : well.completions) { - const int grid_index = completion.grid_index; + const auto& gridName = completion.gridName; const auto& ijk = completion.ijk; - const int cell_index = G.activeCell(ijk, grid_index); + const int cell_index = G.activeCell(ijk, gridName); if (cell_index >= 0) { // Since inflow is a std::map, if the key was not // already present operator[] will insert a @@ -142,7 +170,7 @@ namespace example { struct FilePaths { - FilePaths(const Opm::parameter::ParameterGroup& param) + FilePaths(const Opm::ParameterGroup& param) { const string casename = param.getDefault("case", "DEFAULT_CASE_NAME"); grid = param.has("grid") ? param.get("grid") @@ -164,13 +192,13 @@ namespace example { - inline Opm::parameter::ParameterGroup + inline Opm::ParameterGroup initParam(int argc, char** argv) { // Obtain parameters from command line (possibly specifying a parameter file). const bool verify_commandline_syntax = true; const bool parameter_output = false; - Opm::parameter::ParameterGroup param(argc, argv, verify_commandline_syntax, parameter_output); + Opm::ParameterGroup param(argc, argv, verify_commandline_syntax, parameter_output); return param; } @@ -180,10 +208,9 @@ namespace example { inline Opm::ECLGraph initGraph(const FilePaths& file_paths) { - // Read graph and assign restart file. - auto graph = Opm::ECLGraph::load(file_paths.grid, file_paths.init); - graph.assignFluxDataSource(file_paths.restart); - return graph; + const auto I = Opm::ECLInitFileData(file_paths.init); + + return Opm::ECLGraph::load(file_paths.grid, I); } @@ -209,38 +236,47 @@ namespace example { struct Setup { Setup(int argc, char** argv) - : param(initParam(argc, argv)) - , file_paths(param) - , graph(initGraph(file_paths)) - , well_fluxes() - , toolbox(initToolbox(graph)) + : param (initParam(argc, argv)) + , file_paths (param) + , rstrt (file_paths.restart) + , graph (initGraph(file_paths)) + , well_fluxes () + , toolbox (initToolbox(graph)) , compute_fluxes_(param.getDefault("compute_fluxes", false)) { const int step = param.getDefault("step", 0); - if (!selectReportStep(step)) { + + if (! this->selectReportStep(step)) { std::ostringstream os; + os << "Report Step " << step - << " is Not Available in Result Set '" - << file_paths.grid.stem() << '\''; + << " is Not Available in Result Set " + << file_paths.grid.stem(); + throw std::domain_error(os.str()); } } bool selectReportStep(const int step) { - if (graph.selectReportStep(step)) { - auto wsol = Opm::ECLWellSolution{}; - well_fluxes = wsol.solution(graph.rawResultData(), graph.numGrids());; - toolbox.assignConnectionFlux(extractFluxField(graph, compute_fluxes_)); - toolbox.assignInflowFlux(extractWellFlows(graph, well_fluxes)); - return true; - } else { + if (! rstrt.selectReportStep(step)) { return false; } + + { + auto wsol = Opm::ECLWellSolution{}; + well_fluxes = wsol.solution(rstrt, graph.activeGrids()); + } + + toolbox.assignConnectionFlux(extractFluxField(graph, rstrt, compute_fluxes_)); + toolbox.assignInflowFlux(extractWellFlows(graph, well_fluxes)); + + return true; } - Opm::parameter::ParameterGroup param; + Opm::ParameterGroup param; FilePaths file_paths; + Opm::ECLRestartData rstrt; Opm::ECLGraph graph; std::vector well_fluxes; Opm::FlowDiagnostics::Toolbox toolbox; diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/examples/extractFromRestart.cpp b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/examples/extractFromRestart.cpp index 4d38286871..060fba34f7 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/examples/extractFromRestart.cpp +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/examples/extractFromRestart.cpp @@ -25,20 +25,21 @@ #include #include +#include // Syntax (typical): // extractFromRestart unrst= step= keyword= grid_id= int main(int argc, char* argv[]) { try { - Opm::parameter::ParameterGroup param(argc, argv, + Opm::ParameterGroup param(argc, argv, /*verify_commandline_syntax=*/ true, /*parameter_output=*/ false); const std::string unrst_file = param.get("unrst"); const int report_step = param.getDefault("step", int(0)); - const int grid_id = param.getDefault("grid_id", int(0)); + const std::string grid_id = param.getDefault("grid_id", std::string("")); const std::string keyword = param.get("keyword"); - Opm::ECLResultData restart_file(unrst_file); + Opm::ECLRestartData restart_file(unrst_file); if (!restart_file.selectReportStep(report_step)) { std::cerr << "Could not find report step " << report_step << "." << std::endl; diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLFluxCalc.cpp b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLFluxCalc.cpp index 91a6e3d3f0..1e597a4064 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLFluxCalc.cpp +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLFluxCalc.cpp @@ -18,6 +18,8 @@ */ #include +#include + #include namespace Opm @@ -34,11 +36,15 @@ namespace Opm - std::vector ECLFluxCalc::flux(const PhaseIndex /* phase */) const + std::vector + ECLFluxCalc::flux(const ECLRestartData& rstrt, + const PhaseIndex /* phase */) const { // Obtain dynamic data. DynamicData dyn_data; - dyn_data.pressure = graph_.linearisedCellData("PRESSURE", &ECLUnits::UnitSystem::pressure); + dyn_data.pressure = graph_ + .linearisedCellData(rstrt, "PRESSURE", + &ECLUnits::UnitSystem::pressure); // Compute fluxes per connection. const int num_conn = transmissibility_.size(); diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLFluxCalc.hpp b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLFluxCalc.hpp index 340b1974b0..3f230ab23f 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLFluxCalc.hpp +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLFluxCalc.hpp @@ -25,6 +25,7 @@ namespace Opm { + class ECLRestartData; /// Class for computing connection fluxes in the absence of flux output. class ECLFluxCalc @@ -45,7 +46,9 @@ namespace Opm /// \return Flux values corresponding to selected phase. /// Empty if required data is missing. /// Numerical values in SI units (rm^3/s). - std::vector flux(const PhaseIndex phase) const; + std::vector + flux(const ECLRestartData& rstrt, + const PhaseIndex phase) const; private: struct DynamicData diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLGraph.cpp b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLGraph.cpp index d06645c93d..52d94ced43 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLGraph.cpp +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLGraph.cpp @@ -1,6 +1,5 @@ /* - Copyright 2016 SINTEF ICT, Applied Mathematics. - Copyright 2016 Statoil ASA. + Copyright 2016, 2017 Statoil ASA. This file is part of the Open Porous Media Project (OPM). @@ -39,6 +38,7 @@ #include #include #include +#include #include #include @@ -86,6 +86,17 @@ namespace { const ecl_grid_type* getGrid(const ecl_grid_type* G, const int gridID); + /// Retrieve grid name. + /// + /// \param[in] ERT Grid representation. + /// + /// \param[in] gridID Numeric index of requested grid. Zero for the + /// main grid or positive for one of the LGRs. + /// + /// \return Name of grid \p G. Empty for the main grid. + std::string + getGridName(const ecl_grid_type* G, const int gridID); + /// Extract Cartesian dimensions of an ECL grid. /// /// \param[in] G ERT grid instance corresponding to the model's main @@ -99,14 +110,20 @@ namespace { /// Access unit conventions pertaining to single grid in result set. /// + /// \tparam ResultSet Type representing a result set. Must + /// implement methods \code haveKeywordData() \endcode and \code + /// keywordData<>() \endcode. Typically \code Opm::ECLRestartData + /// \endcode or \code Opm::ECLInitFileData \endcode. + /// /// \param[in] rset Result set. /// - /// \param[in] grid_ID Numerical ID of grid. Non-negative. Zero - /// for the main grid and positive for LGRs. + /// \param[in] gridID ID (name) of particular grid. Empty for the + /// main grid. /// - /// \return Unit system convention for \p grid_ID in result set. - auto getUnitSystem(const ::Opm::ECLResultData& rset, - const int grid_ID) + /// \return Unit system convention for \p gridID in result set. + template + auto getUnitSystem(const ResultSet& rset, + const std::string& gridID) -> decltype(::Opm::ECLUnits::createUnitSystem(0)); /// Retrieve global pore-volume vector from INIT source. @@ -117,15 +134,15 @@ namespace { /// /// \param[in] init ERT representation of INIT source. /// - /// \param[in] grid_ID Numerical ID of grid. Non-negative. Zero - /// for the main grid and positive in the case of an LGR. + /// \param[in] gridID ID (name) of grid. Empty for the main grid + /// and non-empty in the case of an LGR. /// /// \return Vector of pore-volumes for all global cells of \p G in /// SI unit conventions (rm^3). std::vector - getPVolVector(const ecl_grid_type* G, - const ::Opm::ECLResultData& init, - const int grid_ID = 0); + getPVolVector(const ecl_grid_type* G, + const ::Opm::ECLInitFileData& init, + const std::string& gridID = ""); /// Extract non-neighbouring connections from ECLIPSE model /// @@ -137,9 +154,10 @@ namespace { /// \return Model's non-neighbouring connections, including those /// between main and local grids. std::vector - loadNNC(const ecl_grid_type* G, - const ::Opm::ECLResultData& init); + loadNNC(const ecl_grid_type* G, + const ecl_file_type* init); + /// Cartesian connections in a model grid. class CartesianGridData { public: @@ -153,15 +171,17 @@ namespace { /// /// \param[in] gridID Numeric identifier of this grid. Zero for /// main grid, positive for LGRs. - CartesianGridData(const ecl_grid_type* G, - const ::Opm::ECLResultData& init, - const int gridID); + CartesianGridData(const ecl_grid_type* G, + const ::Opm::ECLInitFileData& init, + const int gridID); /// Retrieve non-negative numeric ID of grid instance. /// /// \return Constructor's \c gridID parameter. int gridID() const; + const std::string& gridName() const; + /// Retrieve number of active cells in graph. std::size_t numCells() const; @@ -218,14 +238,15 @@ namespace { /// /// \return Numerical values of result set vector, relative to /// global cell numbering of this grid. + template std::vector - cellData(const ::Opm::ECLResultData& src, - const std::string& vector) const; + cellData(const ResultSet& rset, + const std::string& vector) const; - template + template std::vector - activeCellData(const ::Opm::ECLResultData& src, - const std::string& vector) const; + activeCellData(const ResultSet& rset, + const std::string& vector) const; /// Retrieve values of result set vector for all Cartesian /// connections in grid. @@ -238,9 +259,9 @@ namespace { /// \return Numerical values of result set vector attributed to /// all of the grid's Cartesian connections. std::vector - connectionData(const ::Opm::ECLResultData& src, - const std::string& vector, - const double unit) const; + connectionData(const ::Opm::ECLRestartData& rstrt, + const std::string& vector, + const double unit) const; private: /// Facility for deriving Cartesian neighbourship in a grid @@ -424,6 +445,9 @@ namespace { /// than zero for LGRs. const int gridID_; + /// Grid name. Mostly for querying properties in local grids. + const std::string gridName_; + /// Map results from active to global cells. CartesianCells cells_; @@ -445,14 +469,19 @@ namespace { /// Predicate for whether or not a particular result vector is /// defined on the grid's cells. /// - /// \param[in] src Result set. + /// \tparam ResultSet Representation of an ECLIPSE result set. + /// Typically \code Opm::ECLInitFileData \endcode or \code + /// Opm::ECLRestartData \endcode. + /// + /// \param[in] rset Result set. /// /// \param[in] vector Name of result vector. /// - /// \return Whether or not \p vector is defined on model's - /// cells and part of the result set \p src. - bool haveCellData(const ::Opm::ECLResultData& src, - const std::string& keyword) const; + /// \return Whether or not \p vector is defined on model's cells + /// and part of the result set \p src. + template + bool haveCellData(const ResultSet& rset, + const std::string& keyword) const; /// Predicate for whether or not a particular result vector is /// defined on the grid's Cartesian connections. @@ -462,10 +491,10 @@ namespace { /// \param[in] vector Prefix of result vector name. /// /// \return Whether or not all vectors formed by \p vector plus - /// known directional suffixes are defined on model's cells and - /// part of the result set \p src. - bool haveConnData(const ::Opm::ECLResultData& src, - const std::string& keyword) const; + /// known directional suffixes are defined on model's cells + /// and part of the result set \p src. + bool haveConnData(const ::Opm::ECLRestartData& rstrt, + const std::string& keyword) const; /// Append directional cell data to global collection of /// connection data identified by vector name prefix. @@ -480,7 +509,7 @@ namespace { /// input, collection of values corresponding to any previous /// directions (preserved), and on output additionally contains /// the data corresponding to the Cartesian direction \p d. - void connectionData(const ::Opm::ECLResultData& src, + void connectionData(const ::Opm::ECLRestartData& rstrt, const CartesianCells::Direction d, const std::string& vector, const double unit, @@ -510,7 +539,7 @@ namespace { /// /// \param[in] init Internalised void deriveNeighbours(const std::vector& gcells, - const ::Opm::ECLResultData& init, + const ::Opm::ECLInitFileData& init, const CartesianCells::Direction d); }; } // namespace ECL @@ -535,10 +564,20 @@ ECL::getGrid(const ecl_grid_type* G, const int gridID) return ecl_grid_iget_lgr(G, gridID - 1); } +std::string +ECL::getGridName(const ecl_grid_type* G, const int gridID) +{ + if (gridID == ECL_GRID_MAINGRID_LGR_NR) { + return ""; // Empty for main grid. + } + + return ecl_grid_get_name(G); +} + std::vector -ECL::getPVolVector(const ecl_grid_type* G, - const ::Opm::ECLResultData& init, - const int gridID) +ECL::getPVolVector(const ecl_grid_type* G, + const ::Opm::ECLInitFileData& init, + const std::string& gridID) { auto make_szt = [](const int i) { @@ -578,8 +617,8 @@ ECL::loadCase(const boost::filesystem::path& grid) if (! G) { std::ostringstream os; - os << "Failed to load ECL Grid from '" - << grid.generic_string() << '\''; + os << "Failed to load ECL Grid from " + << grid.generic_string(); throw std::invalid_argument(os.str()); } @@ -600,21 +639,40 @@ ECL::cartesianDimensions(const ecl_grid_type* G) make_szt(ecl_grid_get_nz(G)) } }; } -auto ECL::getUnitSystem(const ::Opm::ECLResultData& rset, - const int grid_ID) +template +auto ECL::getUnitSystem(const ResultSet& rset, + const std::string& grid_ID) -> decltype(::Opm::ECLUnits::createUnitSystem(0)) { assert (rset.haveKeywordData(INTEHEAD_KW, grid_ID) && "Result Set Does Not Provide Grid Header"); - const auto ih = rset.keywordData(INTEHEAD_KW, grid_ID); + const auto ih = rset.template keywordData(INTEHEAD_KW, grid_ID); - return ::Opm::ECLUnits::createUnitSystem(ih[INTEHEAD_UNIT_INDEX]); + const auto usys = ih[INTEHEAD_UNIT_INDEX]; + const auto validUsys = (usys >= 1) && (usys <= 4); + + if (! validUsys) { + if (! grid_ID.empty()) { + // Unity system not provided in local grid. Fall back to + // querying the main grid instead. + + const auto mainGrid = std::string{ "" }; + + return getUnitSystem(rset, mainGrid); + } + + throw std::out_of_range { + "No Valid Unit System Key in Result-Set" + }; + } + + return ::Opm::ECLUnits::createUnitSystem(usys); } std::vector -ECL::loadNNC(const ecl_grid_type* G, - const ::Opm::ECLResultData& init) +ECL::loadNNC(const ecl_grid_type* G, + const ecl_file_type* init) { auto make_szt = [](const int n) { @@ -628,7 +686,7 @@ ECL::loadNNC(const ecl_grid_type* G, if (numNNC > 0) { nncData.resize(numNNC); - ecl_nnc_export(G, init.getRawFilePtr(), nncData.data()); + ecl_nnc_export(G, init, nncData.data()); } return nncData; @@ -853,7 +911,7 @@ ECL::CartesianGridData::CartesianCells::numActiveCells() const { return this->rsMap_.subset.size(); } - + std::size_t ECL::CartesianGridData:: CartesianCells::globIdx(const IndexTuple& ijk) const @@ -890,11 +948,12 @@ CartesianCells::ind2sub(const std::size_t globalCell) const // ====================================================================== ECL::CartesianGridData:: -CartesianGridData(const ecl_grid_type* G, - const ::Opm::ECLResultData& init, - const int gridID) - : gridID_(gridID) - , cells_ (G, ::ECL::getPVolVector(G, init, gridID_)) +CartesianGridData(const ecl_grid_type* G, + const ::Opm::ECLInitFileData& init, + const int gridID) + : gridID_ (gridID) + , gridName_(::ECL::getGridName(G, gridID)) + , cells_ (G, ::ECL::getPVolVector(G, init, gridName_)) { { using VT = DirectionSuffix::value_type; @@ -923,6 +982,12 @@ int ECL::CartesianGridData::gridID() const return this->gridID_; } +const std::string& +ECL::CartesianGridData::gridName() const +{ + return this->gridName_; +} + std::size_t ECL::CartesianGridData::numCells() const { @@ -973,48 +1038,51 @@ ECL::CartesianGridData::isSubdivided(const int cellID) const return this->cells_.isSubdivided(cellID); } +template std::vector ECL::CartesianGridData:: -cellData(const ::Opm::ECLResultData& src, - const std::string& vector) const +cellData(const ResultSet& rset, + const std::string& vector) const { - if (! this->haveCellData(src, vector)) { + if (! this->haveCellData(rset, vector)) { return {}; } - auto x = src.keywordData(vector, this->gridID_); + const auto x = + rset.template keywordData(vector, this->gridName()); return this->cells_.scatterToGlobal(x); } namespace { namespace ECL { - template + template std::vector - CartesianGridData::activeCellData(const ::Opm::ECLResultData& src, - const std::string& vector) const + CartesianGridData::activeCellData(const ResultSet& rset, + const std::string& vector) const { - if (! this->haveCellData(src, vector)) { + if (! this->haveCellData(rset, vector)) { return {}; } - auto x = src.keywordData(vector, this->gridID_); + auto x = rset.template keywordData(vector, this->gridName()); return this->cells_.gatherToActive(std::move(x)); } }} // namespace Anonymous::ECL +template bool ECL::CartesianGridData:: -haveCellData(const ::Opm::ECLResultData& src, - const std::string& vector) const +haveCellData(const ResultSet& rset, + const std::string& vector) const { - return src.haveKeywordData(vector, this->gridID_); + return rset.haveKeywordData(vector, this->gridName()); } bool ECL::CartesianGridData:: -haveConnData(const ::Opm::ECLResultData& src, - const std::string& vector) const +haveConnData(const ::Opm::ECLRestartData& rstrt, + const std::string& vector) const { auto have_data = true; @@ -1024,7 +1092,7 @@ haveConnData(const ::Opm::ECLResultData& src, { const auto vname = this->vectorName(vector, d); - have_data = this->haveCellData(src, vname); + have_data = this->haveCellData(rstrt, vname); if (! have_data) { break; } } @@ -1034,11 +1102,11 @@ haveConnData(const ::Opm::ECLResultData& src, std::vector ECL::CartesianGridData:: -connectionData(const ::Opm::ECLResultData& src, - const std::string& vector, - const double unit) const +connectionData(const ::Opm::ECLRestartData& rstrt, + const std::string& vector, + const double unit) const { - if (! this->haveConnData(src, vector)) { + if (! this->haveConnData(rstrt, vector)) { return {}; } @@ -1048,7 +1116,9 @@ connectionData(const ::Opm::ECLResultData& src, CartesianCells::Direction::J , CartesianCells::Direction::K }) { - this->connectionData(src, d, this->vectorName(vector, d), unit, x); + const auto vname = this->vectorName(vector, d); + + this->connectionData(rstrt, d, vname, unit, x); } return x; @@ -1056,13 +1126,13 @@ connectionData(const ::Opm::ECLResultData& src, void ECL::CartesianGridData:: -connectionData(const ::Opm::ECLResultData& src, +connectionData(const ::Opm::ECLRestartData& rstrt, const CartesianCells::Direction d, const std::string& vector, const double unit, std::vector& x) const { - const auto v = this->cellData(src, vector); + const auto v = this->cellData(rstrt, vector); const auto& cells = this->outCell_.find(d); @@ -1090,7 +1160,7 @@ vectorName(const std::string& vector, void ECL::CartesianGridData:: deriveNeighbours(const std::vector& gcells, - const ::Opm::ECLResultData& init, + const ::Opm::ECLInitFileData& init, const CartesianCells::Direction d) { auto tran = std::string{"TRAN"}; @@ -1112,12 +1182,12 @@ deriveNeighbours(const std::vector& gcells, throw std::invalid_argument("Input direction must be (I,J,K)"); } - const auto& T = init.haveKeywordData(tran, this->gridID_) + const auto& T = init.haveKeywordData(tran, this->gridName()) ? this->cellData(init, tran) : std::vector(this->cells_.numGlobalCells(), 1.0); const auto trans_unit = - ECL::getUnitSystem(init, this->gridID_)->transmissibility(); + ECL::getUnitSystem(init, this->gridName())->transmissibility(); auto SI_trans = [trans_unit](const double trans) { @@ -1166,7 +1236,7 @@ public: /// \param[in] grid Name or prefix of ECL grid (i.e., .GRID or /// .EGRID) file. /// - /// \param[in] init Name of ECL INIT file corresponding to \p grid + /// \param[in] init ECL INIT result set corresponding to \p grid /// input. Assumed to provide at least a complete set /// of pore-volume values (i.e., for all global cells /// defined in the \p grid). @@ -1174,13 +1244,8 @@ public: /// If available in the INIT file, the constructor will /// also leverage the transmissibility data when /// constructing the active cell neighbourship table. - Impl(const Path& grid, const Path& init); - - /// Assign source object for phase flux calculation. - /// - /// \param[in] src Name of ECL restart file, possibly unified, from - /// which next set of phase fluxes should be retrieved. - void assignDataSource(const Path& src); + Impl(const boost::filesystem::path& grid, + const ECLInitFileData& init); /// Retrieve number of grids. /// @@ -1200,7 +1265,7 @@ public: /// ijk from specified grid. Negative one (-1) if (I,J,K) outside /// valid range or if the specific cell identified by \p ijk and \p /// gridID is not actually active. - int activeCell(const int gridID, + int activeCell(const std::string& gridID, const std::array& ijk) const; /// Retrieve number of active cells in graph. @@ -1215,6 +1280,11 @@ public: /// flux() may return non-zero values. const std::vector& activePhases() const; + /// Retrieve the simulation scenario's set of active grids. + /// + /// Mostly for canonical lookup of result data in LGRs. + const std::vector& activeGrids() const; + /// Retrieve neighbourship relations between active cells. /// /// The \c i-th connection is between active cells \code @@ -1238,24 +1308,6 @@ public: /// \endcode. std::vector transmissibility() const; - /// Restrict dynamic result set data to single report step. - /// - /// This method must be called before calling either flux() or - /// rawResultData(). - /// - /// \param[in] rptstep Selected temporal vector. Report-step ID. - /// - /// \return Whether or not dynamic data for the requested report step - /// exists in the underlying result set identified in method - /// assignDataSource(). - bool selectReportStep(const int rptstep) const; - - /// Access underlying result set. - /// - /// The result set dynamic data corresponds to the most recent call to - /// method selectReportStep(). - const ::Opm::ECLResultData& rawResultData() const; - /// Retrieve phase flux on all connections defined by \code neighbours() /// \endcode. /// @@ -1269,15 +1321,56 @@ public: /// reported due to report frequencies or no flux values are output at /// all). std::vector - flux(const PhaseIndex phase) const; + flux(const ECLRestartData& rstrt, + const PhaseIndex phase) const; - template + /// Retrieve result set vector from current view linearised on active + /// cells. + /// + /// \tparam T Element type of result set vector. + /// + /// \tparam ResultSet Implementation of an ECL Result Set. Typically + /// \code Opm::ECLRestartData \endcode or \code Opm::ECLInitFileData + /// \endcode. + /// + /// \param[in] rset ECL Result set. Typically an instance of \code + /// Opm::ECLRestartData \endcode or \code Opm::ECLInitFileData + /// \endcode. + /// + /// \param[in] vector Name of result set vector. + /// + /// \return Result set vector linearised on active cells. + template std::vector - rawLinearisedCellData(const std::string& vector) const; + rawLinearisedCellData(const ResultSet& rset, + const std::string& vector) const; + /// Retrieve floating-point result set vector from current view + /// (e.g., particular report step) linearised on active cells and + /// converted to strict SI unit conventions. + /// + /// Typical call: + /// \code + /// const auto press = + /// lCD(rstrt, "PRESSURE", &ECLUnits::UnitSystem::pressure); + /// \endcode + /// + /// \param[in] rstrt ECL Restart dataset. It is the responsibility of + /// the caller to ensure that the restart data is correctly + /// positioned on a particular report step. + /// + /// \param[in] vector Name of result set vector. + /// + /// \param[in] unit Call-back hook in \c UnitSystem implementation + /// that enables converting the raw result data to strict SI unit + /// conventions. Hook is called for each grid in the result set. + /// + /// \return Result set vector linearised on active cells, converted + /// to strict SI unit conventions. std::vector - linearisedCellData(const std::string& vector, - UnitConvention unit) const; + linearisedCellData(const ECLRestartData& rstrt, + const std::string& vector, + UnitConvention unit) const; private: /// Collection of non-Cartesian neighbourship relations attributed to a @@ -1518,8 +1611,10 @@ private: /// the simulation run. std::vector activePhases_; - /// Current result set. - std::unique_ptr src_; + /// Set of active grids in result set. + std::vector activeGrids_; + + std::unordered_map gridID_; /// Extract explicit non-neighbouring connections from ECL output. /// @@ -1528,15 +1623,13 @@ private: /// \param[in] G ERT Grid representation. /// /// \param[in] init ERT representation of INIT source. - /// - /// \param[in] coll Backing data for neighbourship extraction. - void defineNNCs(const ecl_grid_type* G, - const ::Opm::ECLResultData& init); + void defineNNCs(const ecl_grid_type* G, + const ECLInitFileData& init); /// Extract scenario's set of active phases. /// /// Writes to activePhases_. - void defineActivePhases(const ::Opm::ECLResultData& init); + void defineActivePhases(const ::Opm::ECLInitFileData& init); /// Compute ECL vector basename for particular phase flux. /// @@ -1554,6 +1647,8 @@ private: /// \tparam[in] GetFluxUnit Type of function object for computing the /// grid-dependent flux unit. /// + /// \param[in] rstrt ECL Restart data result set. + /// /// \param[in] vector Result set vector prefix. Typically computed by /// method flowVector(). /// @@ -1572,9 +1667,10 @@ private: /// contains those values that correspond to the non-neighbouring /// connections (appended onto \p flux). template - void fluxNNC(const std::string& vector, - GetFluxUnit&& fluxUnit, - std::vector& flux) const; + void fluxNNC(const ECLRestartData& rstrt, + const std::string& vector, + GetFluxUnit&& fluxUnit, + std::vector& flux) const; }; // ====================================================================== @@ -1763,12 +1859,10 @@ isViable(const std::vector& grids, // ====================================================================== -Opm::ECLGraph::Impl::Impl(const Path& grid, const Path& init) +Opm::ECLGraph::Impl::Impl(const boost::filesystem::path& grid, + const ECLInitFileData& init) { const auto G = ECL::loadCase(grid); - auto I = ::Opm::ECLResultData{ init }; - - I.selectGlobalView(); const auto numGrids = ECL::numGrids(G.get()); @@ -1779,41 +1873,42 @@ Opm::ECLGraph::Impl::Impl(const Path& grid, const Path& init) for (auto gridID = 0*numGrids; gridID < numGrids; ++gridID) { this->grid_.emplace_back(ECL::getGrid(G.get(), gridID), - I, gridID); + init, gridID); this->activeOffset_.push_back(this->activeOffset_.back() + this->grid_.back().numCells()); + + this->activeGrids_.push_back(this->grid_.back().gridName()); + + this->gridID_[this->activeGrids_.back()] = gridID; } - this->defineNNCs(G.get(), I); - this->defineActivePhases(I); -} - -void -Opm::ECLGraph::Impl::assignDataSource(const Path& src) -{ - this->src_.reset(new ECLResultData(src)); + this->defineNNCs(G.get(), init); + this->defineActivePhases(init); } int -Opm::ECLGraph::Impl:: -numGrids() const +Opm::ECLGraph::Impl::numGrids() const { return grid_.size(); } int Opm::ECLGraph::Impl:: -activeCell(const int gridID, +activeCell(const std::string& gridID, const std::array& ijk) const { - const auto gIdx = - static_castgrid_.size())>(gridID); - - if (gIdx >= this->grid_.size()) { + const auto gID = this->gridID_.find(gridID); + if (gID == std::end(this->gridID_)) { return -1; } + const auto gIdx = + static_castgrid_.size())>(gID->second); + + assert ((gIdx <= this->grid_.size()) && + "Logic Error in ECLGraph::Impl::Impl()"); + const auto& grid = this->grid_[gIdx]; const auto active = grid.activeCell(ijk[0], ijk[1], ijk[2]); @@ -1851,6 +1946,12 @@ Opm::ECLGraph::Impl::activePhases() const return this->activePhases_; } +const std::vector& +Opm::ECLGraph::Impl::activeGrids() const +{ + return this->activeGrids_; +} + std::vector Opm::ECLGraph::Impl::neighbours() const { @@ -1925,24 +2026,13 @@ Opm::ECLGraph::Impl::transmissibility() const return trans; } -const ::Opm::ECLResultData& -Opm::ECLGraph::Impl::rawResultData() const -{ - return *this->src_; -} - -bool Opm::ECLGraph::Impl::selectReportStep(const int rptstep) const -{ - return this->src_->selectReportStep(rptstep); -} - std::vector -Opm::ECLGraph::Impl:: -flux(const PhaseIndex phase) const +Opm::ECLGraph::Impl::flux(const ECLRestartData& rstrt, + const PhaseIndex phase) const { - auto fluxUnit = [this](const int gridID) + auto fluxUnit = [&rstrt](const std::string& gridID) { - return ::ECL::getUnitSystem(*this->src_, gridID)->reservoirRate(); + return ::ECL::getUnitSystem(rstrt, gridID)->reservoirRate(); }; const auto vector = this->flowVector(phase); @@ -1956,7 +2046,7 @@ flux(const PhaseIndex phase) const for (const auto& G : this->grid_) { const auto& q = - G.connectionData(*this->src_, vector, fluxUnit(G.gridID())); + G.connectionData(rstrt, vector, fluxUnit(G.gridName())); if (q.empty()) { // Flux vector invalid unless all grids provide this result @@ -1971,7 +2061,7 @@ flux(const PhaseIndex phase) const // Model includes non-neighbouring connections such as faults and/or // local grid refinement. Extract pertinent flux values for these // connections. - this->fluxNNC(vector, std::move(fluxUnit), v); + this->fluxNNC(rstrt, vector, std::move(fluxUnit), v); } if (v.size() < totconn) { @@ -1985,14 +2075,15 @@ flux(const PhaseIndex phase) const namespace Opm { - template + template std::vector - ECLGraph::Impl::rawLinearisedCellData(const std::string& vector) const + ECLGraph::Impl::rawLinearisedCellData(const ResultSet& rset, + const std::string& vector) const { auto x = std::vector{}; x.reserve(this->numCells()); for (const auto& G : this->grid_) { - const auto xi = G.activeCellData(*this->src_, vector); + const auto xi = G.activeCellData(rset, vector); x.insert(x.end(), std::begin(xi), std::end(xi)); } @@ -2006,19 +2097,20 @@ namespace Opm { } // namespace Opm std::vector -Opm::ECLGraph::Impl::linearisedCellData(const std::string& vector, - UnitConvention unit) const +Opm::ECLGraph::Impl::linearisedCellData(const ECLRestartData& rstrt, + const std::string& vector, + UnitConvention unit) const { auto x = std::vector{}; x.reserve(this->numCells()); for (const auto& G : this->grid_) { - const auto xi = G.activeCellData(*this->src_, vector); + const auto xi = G.activeCellData(rstrt, vector); if (xi.empty()) { continue; } // Note: Compensate for incrementing Grid ID above. const auto usys = - ECL::getUnitSystem(*this->src_, G.gridID()); + ECL::getUnitSystem(rstrt, G.gridName()); // Note: 'usys' (generally, std::unique_ptr<>) does not support // regular PMF syntax (i.e., operator->*()). @@ -2040,25 +2132,28 @@ Opm::ECLGraph::Impl::linearisedCellData(const std::string& vector, } void -Opm::ECLGraph::Impl::defineNNCs(const ecl_grid_type* G, - const ::Opm::ECLResultData& init) +Opm::ECLGraph::Impl::defineNNCs(const ecl_grid_type* G, + const ECLInitFileData& init) { // Assume all transmissibilites in the result set follow the same unit // conventions. - const auto trans_unit = - ECL::getUnitSystem(init, 0)->transmissibility(); + const auto gridID = std::string{ "" }; // Empty in main grid. - for (const auto& nnc : ECL::loadNNC(G, init)) { + const auto trans_unit = + ECL::getUnitSystem(init, gridID)->transmissibility(); + + for (const auto& nnc : ECL::loadNNC(G, init.getRawFilePtr())) { this->nnc_.add(this->grid_, this->activeOffset_, trans_unit, nnc); } } template void -Opm::ECLGraph::Impl::fluxNNC(const std::string& vector, - GetFluxUnit&& fluxUnit, - std::vector& flux) const +Opm::ECLGraph::Impl::fluxNNC(const ECLRestartData& rstrt, + const std::string& vector, + GetFluxUnit&& fluxUnit, + std::vector& flux) const { auto v = std::vector(this->nnc_.numConnections(), 0.0); auto assigned = std::vector(v.size(), false); @@ -2068,28 +2163,31 @@ Opm::ECLGraph::Impl::fluxNNC(const std::string& vector, const auto fluxID = rel.makeKeyword(vector); for (const auto& G : this->grid_) { - const auto gridID = G.gridID(); + const auto& gridName = G.gridName(); const auto& iset = - rel.indexSet().getGridCollection(gridID); + rel.indexSet().getGridCollection(G.gridID()); - if (iset.empty()) { - // No NNCs for this category in this grid. Skip. + if (iset.empty() || + ! rstrt.haveKeywordData(fluxID, gridName)) + { + // No NNCs for this category in this grid or corresponding + // flux vector does not exist. Skip. continue; } - // Note: Method name is confusing, but does actually do what we - // want here. - const auto q = G.cellData(*this->src_, fluxID); + const auto q = rstrt.keywordData(fluxID, gridName); if (q.empty()) { - // No flux data for this category in this grid. Skip. + // Empty flux data for this category in this grid. Not + // really supposed to happen if the above check fires, but + // skip this (category,gridID) pair nonetheless. continue; } - const auto flux_unit = fluxUnit(gridID); + const auto flux_unit = fluxUnit(gridName); - // Data fully available for (category,gridID). Assign + // Data fully available for (category,gridName). Assign // approriate subset of NNC flux vector. for (const auto& ix : iset) { assert (ix.neighIdx < v.size()); @@ -2118,10 +2216,12 @@ Opm::ECLGraph::Impl::fluxNNC(const std::string& vector, void Opm::ECLGraph::Impl:: -defineActivePhases(const ::Opm::ECLResultData& init) +defineActivePhases(const ::Opm::ECLInitFileData& init) { + const auto gridID = std::string{ "" }; // Empty in main grid. + const auto ih = - init.keywordData(INTEHEAD_KW, ECL_GRID_MAINGRID_LGR_NR); + init.keywordData(INTEHEAD_KW, gridID); const auto phaseMask = static_cast(ih[INTEHEAD_PHASE_INDEX]); @@ -2143,8 +2243,7 @@ defineActivePhases(const ::Opm::ECLResultData& init) } std::string -Opm::ECLGraph::Impl:: -flowVector(const PhaseIndex phase) const +Opm::ECLGraph::Impl::flowVector(const PhaseIndex phase) const { const auto vector = std::string("FLR"); // Flow-rate, reservoir @@ -2193,40 +2292,32 @@ Opm::ECLGraph::operator=(ECLGraph&& rhs) } Opm::ECLGraph -Opm::ECLGraph::load(const Path& grid, const Path& init) +Opm::ECLGraph::load(const boost::filesystem::path& grid, + const ECLInitFileData& init) { auto pImpl = ImplPtr{new Impl(grid, init)}; return { std::move(pImpl) }; } -int -Opm::ECLGraph::numGrids() const +int Opm::ECLGraph::numGrids() const { return this->pImpl_->numGrids(); } int Opm::ECLGraph::activeCell(const std::array& ijk, - const int gridID) const + const std::string& gridID) const { return this->pImpl_->activeCell(gridID, ijk); } -void -Opm::ECLGraph::assignFluxDataSource(const Path& src) -{ - this->pImpl_->assignDataSource(src); -} - -std::size_t -Opm::ECLGraph::numCells() const +std::size_t Opm::ECLGraph::numCells() const { return this->pImpl_->numCells(); } -std::size_t -Opm::ECLGraph::numConnections() const +std::size_t Opm::ECLGraph::numConnections() const { return this->pImpl_->numConnections(); } @@ -2237,6 +2328,12 @@ Opm::ECLGraph::activePhases() const return this->pImpl_->activePhases(); } +const std::vector& +Opm::ECLGraph::activeGrids() const +{ + return this->pImpl_->activeGrids(); +} + std::vector Opm::ECLGraph::neighbours() const { return this->pImpl_->neighbours(); @@ -2252,45 +2349,47 @@ std::vector Opm::ECLGraph::transmissibility() const return this->pImpl_->transmissibility(); } -bool Opm::ECLGraph::selectReportStep(const int rptstep) const -{ - return this->pImpl_->selectReportStep(rptstep); -} - -const Opm::ECLResultData& -Opm::ECLGraph::rawResultData() const -{ - return this->pImpl_->rawResultData(); -} - std::vector -Opm::ECLGraph:: -flux(const PhaseIndex phase) const +Opm::ECLGraph::flux(const ECLRestartData& rstrt, + const PhaseIndex phase) const { - return this->pImpl_->flux(phase); + return this->pImpl_->flux(rstrt, phase); } namespace Opm { - template + template std::vector - ECLGraph::rawLinearisedCellData(const std::string& vector) const + ECLGraph::rawLinearisedCellData(const ResultSet& rset, + const std::string& vector) const { - return this->pImpl_->rawLinearisedCellData(vector); + return this->pImpl_->rawLinearisedCellData(rset, vector); } - // Explicit instantiations for the element types we care about. + // Explicit instantiations of method rawLinearisedCellData() for the + // element and result set types we care about. template std::vector - ECLGraph::rawLinearisedCellData(const std::string& vector) const; + ECLGraph::rawLinearisedCellData(const ECLInitFileData& rset, + const std::string& vector) const; + + template std::vector + ECLGraph::rawLinearisedCellData(const ECLRestartData& rset, + const std::string& vector) const; template std::vector - ECLGraph::rawLinearisedCellData(const std::string& vector) const; + ECLGraph::rawLinearisedCellData(const ECLInitFileData& rset, + const std::string& vector) const; + + template std::vector + ECLGraph::rawLinearisedCellData(const ECLRestartData& rset, + const std::string& vector) const; } // namespace Opm std::vector -Opm::ECLGraph::linearisedCellData(const std::string& vector, - UnitConvention unit) const +Opm::ECLGraph::linearisedCellData(const ECLRestartData& rstrt, + const std::string& vector, + UnitConvention unit) const { - return this->pImpl_->linearisedCellData(vector, unit); + return this->pImpl_->linearisedCellData(rstrt, vector, unit); } diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLGraph.hpp b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLGraph.hpp index 62204e5722..ff60cf67dc 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLGraph.hpp +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLGraph.hpp @@ -1,6 +1,5 @@ /* - Copyright 2016 SINTEF ICT, Applied Mathematics. - Copyright 2016 Statoil ASA. + Copyright 2016, 2017 Statoil ASA. This file is part of the Open Porous Media Project (OPM). @@ -27,6 +26,7 @@ #include #include #include +#include #include #include @@ -45,8 +45,6 @@ namespace Opm { class ECLGraph { public: - using Path = boost::filesystem::path; - /// Enum for indicating requested phase from the flux() method. enum class PhaseIndex { Aqua = 0, Liquid = 1, Vapour = 2 }; @@ -93,17 +91,12 @@ namespace Opm { /// \return Fully formed ECLIPSE connection graph with property /// associations. static ECLGraph - load(const Path& grid, const Path& init); + load(const boost::filesystem::path& gridFile, + const ECLInitFileData& init); - /// Assign source object for phase flux calculation. + /// Retrieve number of grids in model. /// - /// \param[in] src Name of ECL restart file, possibly unified, from - /// which next set of phase fluxes should be retrieved. - void assignFluxDataSource(const Path& src); - - /// Retrieve number of grids. - /// - /// \return The number of LGR grids plus one (the main grid). + /// \return The number of LGR grids plus one (the main grid). int numGrids() const; /// Retrieve active cell ID from (I,J,K) tuple in particular grid. @@ -120,7 +113,7 @@ namespace Opm { /// outside valid range or if the specific cell identified by \p /// ijk and \p gridID is not actually active. int activeCell(const std::array& ijk, - const int gridID = 0) const; + const std::string& gridID = 0) const; /// Retrieve number of active cells in graph. std::size_t numCells() const; @@ -134,6 +127,11 @@ namespace Opm { /// which flux() will return non-zero values if data available. const std::vector& activePhases() const; + /// Retrieve the simulation scenario's set of active grids. + /// + /// Mostly for canonical lookup of result data in LGRs. + const std::vector& activeGrids() const; + /// Retrieve neighbourship relations between active cells. /// /// The \c i-th connection is between active cells \code @@ -157,24 +155,6 @@ namespace Opm { /// \endcode. std::vector transmissibility() const; - /// Restrict dynamic result set data to single report step. - /// - /// This method must be called before calling either flux() or - /// rawResultData(). - /// - /// \param[in] rptstep Selected temporal vector. Report-step ID. - /// - /// \return Whether or not dynamic data for the requested report - /// step exists in the underlying result set identified in method - /// assignFluxDataSource(). - bool selectReportStep(const int rptstep) const; - - /// Access underlying result set. - /// - /// The result set dynamic data corresponds to the most recent call - /// to method selectReportStep(). - const ::Opm::ECLResultData& rawResultData() const; - /// Retrieve phase flux on all connections defined by \code /// neighbours() \endcode. /// @@ -186,7 +166,8 @@ namespace Opm { /// output to the restart file). Numerical values in SI units /// (rm^3/s). std::vector - flux(const PhaseIndex phase) const; + flux(const ECLRestartData& rstrt, + const PhaseIndex phase) const; /// Retrieve result set vector from current view (e.g., particular /// report step) linearised on active cells. @@ -196,9 +177,10 @@ namespace Opm { /// \param[in] vector Name of result set vector. /// /// \return Result set vector linearised on active cells. - template + template std::vector - rawLinearisedCellData(const std::string& vector) const; + rawLinearisedCellData(const ResultSet& rset, + const std::string& vector) const; /// Convenience type alias for \c UnitSystem PMFs (pointer to member /// function). @@ -211,9 +193,13 @@ namespace Opm { /// Typical call: /// \code /// const auto press = - /// lCD("PRESSURE", &ECLUnits::UnitSystem::pressure); + /// lCD(rstrt, "PRESSURE", &ECLUnits::UnitSystem::pressure); /// \endcode /// + /// \param[in] rstrt ECL Restart dataset. It is the responsibility + /// of the caller to ensure that the restart data is correctly + /// positioned on a particular report step. + /// /// \param[in] vector Name of result set vector. /// /// \param[in] unit Call-back hook in \c UnitSystem implementation @@ -223,8 +209,9 @@ namespace Opm { /// \return Result set vector linearised on active cells, converted /// to strict SI unit conventions. std::vector - linearisedCellData(const std::string& vector, - UnitConvention unit) const; + linearisedCellData(const ECLRestartData& rstrt, + const std::string& vector, + UnitConvention unit) const; private: /// Implementation class. diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.cpp b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.cpp index 21174ee78e..2add62a4e6 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.cpp +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.cpp @@ -1,6 +1,5 @@ /* - Copyright 2016 SINTEF ICT, Applied Mathematics. - Copyright 2016 Statoil ASA. + Copyright 2016, 2017 Statoil ASA. This file is part of the Open Porous Media Project (OPM). @@ -28,9 +27,15 @@ #include #include #include +#include +#include +#include #include #include +#include +#include #include +#include #include #include @@ -46,15 +51,38 @@ #include #include +#if defined(HAVE_ERT_ECL_TYPE_H) && HAVE_ERT_ECL_TYPE_H +#include +#endif // defined(HAVE_ERT_ECL_TYPE_H) && HAVE_ERT_ECL_TYPE_H + /// \file /// /// Implementation of ECL Result-Set Interface. namespace { + inline ecl_type_enum + getKeywordElementType(const ecl_kw_type* kw) + { +#if defined(HAVE_ERT_ECL_TYPE_H) && HAVE_ERT_ECL_TYPE_H + return ecl_type_get_type(ecl_kw_get_data_type(kw)); + +#else // ! (defined(HAVE_ERT_ECL_TYPE_H) && HAVE_ERT_ECL_TYPE_H) + + return ecl_kw_get_type(kw); +#endif // defined(HAVE_ERT_ECL_TYPE_H) && HAVE_ERT_ECL_TYPE_H + } + namespace ECLImpl { - using FilePtr = ::ERT::ert_unique_ptr; + using FilePtr = std::shared_ptr; namespace Details { + + inline std::string + firstBlockKeyword(const ecl_file_view_type* block) + { + return ecl_kw_get_header(ecl_file_view_iget_kw(block, 0)); + } + /// Convert vector of elements from one element type to another. /// /// \tparam Input Element type of input collection. @@ -294,7 +322,7 @@ namespace { static std::vector as(const ecl_kw_type* kw, std::false_type) { - assert (ecl_kw_get_type(kw) == Input); + assert (getKeywordElementType(kw) == Input); return Details::getData< T, typename Details::ElementType::type @@ -352,7 +380,7 @@ namespace { static std::vector as(const ecl_kw_type* kw, std::true_type) { - assert (ecl_kw_get_type(kw) == ECL_CHAR_TYPE); + assert (getKeywordElementType(kw) == ECL_CHAR_TYPE); auto result = std::vector{}; result.reserve(ecl_kw_get_size(kw)); @@ -362,11 +390,122 @@ namespace { i < nkw; ++i) { result.emplace_back(ecl_kw_iget_char_ptr(kw, i)); + + // Trim trailing white-space. + auto& s = result.back(); + + const auto e = s.find_last_not_of(" \t"); + if (e != std::string::npos) { + s = s.substr(0, e + 1); + } } return result; } }; + + /// Translate grid names to (local) numeric IDs within a + /// section/view of an ECL result set. + /// + /// Provides a caching mechanism to accelerate repeated lookup. + class GridIDCache + { + public: + /// Constructor + /// + /// \param[in] block View relative to which to interpret grid + /// names. + explicit GridIDCache(const ecl_file_view_type* block); + + /// Get integral grid ID of particular grid relative to cache's + /// view. + /// + /// \param[in] gridName Name of particular grid. Empty for the + /// main grid (grid ID 0). + /// + /// \return Numeric grid ID of \p gridName. Negative if \p + /// gridName does not correspond to a grdi in the cache's + /// view. + int getGridID(const std::string& gridName) const; + + private: + /// View into ECL result set. + const ecl_file_view_type* block_; + + /// Cache of name->ID map. + mutable std::unordered_map cache_; + }; + + /// Partition INIT file into sections + class InitFileSections + { + public: + explicit InitFileSections(const ecl_file_type* init); + + struct Section { + Section(const ecl_file_view_type* blk) + : block (blk) + , first_kw(Details::firstBlockKeyword(block)) + {} + + const ecl_file_view_type* block; + std::string first_kw; + }; + + const std::vector
& sections() const + { + return this->sect_; + } + + using SectionID = std::vector
::size_type; + + SectionID numSections() const + { + return this->sections().size(); + } + + const Section& operator[](const SectionID i) const + { + assert ((i < this->numSections()) && "Internal Error"); + + return this->sect_[i]; + } + + private: + const ecl_file_view_type* init_; + + std::vector
sect_; + }; + + template + std::vector getKeywordData(const ecl_kw_type* kw) + { + // Whether or not caller requests a vector. + const auto makeStringVector = + typename std::is_same::type{}; + + switch (getKeywordElementType(kw)) { + case ECL_CHAR_TYPE: + return GetKeywordData:: + as(kw, makeStringVector); + + case ECL_INT_TYPE: + return GetKeywordData:: + as(kw, makeStringVector); + + case ECL_FLOAT_TYPE: + return GetKeywordData:: + as(kw, makeStringVector); + + case ECL_DOUBLE_TYPE: + return GetKeywordData:: + as(kw, makeStringVector); + + default: + // No operator exists for this type. Return empty. + return {}; + } + } } // namespace ECLImpl /// Predicate for whether or not a particular path represents a regular @@ -402,18 +541,22 @@ namespace { /// /// \param[in] file Filename or casename prefix. /// + /// \param[in] ext Set of possible filename extensions. + /// /// \return Filesystem element corresponding to result-set. Either the - /// input \p file itself or, in the case of a casename prefix, the - /// path to a restart file (unified format only). + /// input \p file itself or, in the case of a filename prefix, the + /// first possible match amongst the set generated by the prefix and + /// the input extensions. boost::filesystem::path - deriveResultPath(boost::filesystem::path file) + deriveResultPath(boost::filesystem::path file, + const std::vector& ext) { if (isFile(file)) { return file; } - for (const auto* ext : { ".UNRST", ".FUNRST" }) { - file.replace_extension(ext); + for (const auto& e : ext) { + file.replace_extension(e); if (isFile(file)) { return file; @@ -430,30 +573,72 @@ namespace { throw std::invalid_argument(os.str()); } - /// Load result-set represented by filesystem element. + /// Derive filesystem element from prefix or filename. + /// + /// Pass-through if the input already is a regular file in order to + /// support accessing result-sets other than restart files (e.g., the + /// INIT vectors). /// /// Fails (throws an exception of type \code std::invalid_argument - /// \endcode) if the input filesystem element does not represent a valid - /// result-set resource or if the resource could not be opened (e.g., - /// due to lack of permission). + /// \endcode) if no valid filesystem element can be derived from the + /// input argument /// - /// \param[in] rset Fileystem element representing a result-set. + /// \param[in] file Filename or casename prefix. /// - /// \return Accessor handle of result-set. - ECLImpl::FilePtr openResultSet(const boost::filesystem::path& rset) + /// \return Filesystem element corresponding to result-set. Either the + /// input \p file itself or, in the case of a casename prefix, the + /// path to a restart file (unified format only). + boost::filesystem::path + deriveRestartPath(boost::filesystem::path file) + { + return deriveResultPath(std::move(file), { ".UNRST", ".FUNRST" }); + } + + /// Derive filesystem element from prefix or filename. + /// + /// Pass-through if the input already is a regular file in order to + /// support accessing result-sets other than restart files (e.g., the + /// INIT vectors). + /// + /// Fails (throws an exception of type \code std::invalid_argument + /// \endcode) if no valid filesystem element can be derived from the + /// input argument + /// + /// \param[in] file Filename or casename prefix. + /// + /// \return Filesystem element corresponding to result-set. Either the + /// input \p file itself or, in the case of a casename prefix, the + /// path to an INIT file (unformatted or formatted). + boost::filesystem::path + deriveInitPath(boost::filesystem::path file) + { + return deriveResultPath(std::move(file), { ".INIT", ".FINIT" }); + } + + /// Open ECL result set from pathname. + /// + /// Fails (throws an exception of type \code std::invalid_argument + /// \endcode) if the input argument does not refer to a valid filesystem + /// element. + /// + /// \param[in] file Filename. + /// + /// \return Open stream corresponding to result-set. + ECLImpl::FilePtr openResultSet(const boost::filesystem::path& fname) { // Read-only, keep open between requests const auto open_flags = 0; - auto F = ECLImpl::FilePtr{ - ecl_file_open(rset.generic_string().c_str(), open_flags) + auto F = ECLImpl::FilePtr { + ecl_file_open(fname.generic_string().c_str(), open_flags), + ecl_file_close }; if (! F) { std::ostringstream os; - os << "Failed to load ECL Result object from '" - << rset.generic_string() << '\''; + os << "Failed to load ECL Result object from " + << fname.generic_string(); throw std::invalid_argument(os.str()); } @@ -475,19 +660,160 @@ namespace { auto* globView = ecl_file_get_global_view(const_cast(file)); - return ecl_kw_get_header(ecl_file_view_iget_kw(globView, 0)); + return ECLImpl::Details::firstBlockKeyword(globView); + } + + std::string paddedGridName(const std::string& gridName) + { + if (gridName.empty()) { + return gridName; + } + + std::ostringstream os; + + os << std::setw(8) << std::left << gridName; + + return os.str(); } } // namespace Anonymous -/// Engine powering implementation of \c ECLResultData interface -class Opm::ECLResultData::Impl +// ====================================================================== +// Class (Anonymous)::ECLImpl::GridIDCache +// ====================================================================== + +ECLImpl::GridIDCache::GridIDCache(const ecl_file_view_type* block) + : block_(block) +{} + +int ECLImpl::GridIDCache::getGridID(const std::string& gridName) const +{ + if (gridName.empty()) { + return ECL_GRID_MAINGRID_LGR_NR; + } + + { + auto i = this->cache_.find(gridName); + if (i != std::end(this->cache_)) { + return i->second; + } + } + + const auto nLGR = ecl_file_view_get_num_named_kw + (this->block_, LGR_KW); + + auto lgrID = 0 * nLGR; + for (; lgrID < nLGR; ++lgrID) + { + const auto* kw = ecl_file_view_iget_named_kw + (this->block_, LGR_KW, lgrID); + + if ((getKeywordElementType(kw) != ECL_CHAR_TYPE) || + (ecl_kw_get_size(kw) != 1)) + { + // Huh !?! + continue; + } + + const auto kwname = GetKeywordData + ::as(kw, std::true_type()); + + if (kwname[0] == gridName) { + break; + } + } + + if (lgrID == nLGR) { + // No such LGR in block. Somewhat surprising. + return -1; + } + + return this->cache_[gridName] = + ECL_GRID_MAINGRID_LGR_NR + 1 + lgrID; +} + +// ====================================================================== +// Class (Anonymous)::ECLImpl::InitFileSections +// ====================================================================== + +ECLImpl::InitFileSections::InitFileSections(const ecl_file_type* init) + // Note: ecl_file_get_global_view() does not modify input arg + : init_(ecl_file_get_global_view(const_cast(init))) +{ + const auto* endLGR_kw = "LGRSGONE"; + const auto nEndLGR = + ecl_file_view_get_num_named_kw(this->init_, endLGR_kw); + + if (nEndLGR == 0) { + // No LGRs in model. INIT file consists of global section only, + // meaning that the only available section is equal to the global + // view (i.e., this->init_). + this->sect_.push_back(Section{ this->init_ }); + } + else { + const auto* start_kw = INTEHEAD_KW; + const auto* end_kw = endLGR_kw; + + this->sect_.reserve(2 * nEndLGR); + + for (auto sectID = 0*nEndLGR; sectID < nEndLGR; ++sectID) { + // Note: Start keyword occurrence lags one behind section ID + // when creating sections *between* LGRSGONE keywords. + const auto start_kw_occurrence = (sectID > 0) + ? sectID - 1 : 0*sectID; + + // Main section 'sectID': [ start_kw, LGRSGONE ] + const auto* sect = + ecl_file_view_add_blockview2(this->init_, start_kw, + end_kw, start_kw_occurrence); + + if (sect == nullptr) { + continue; + } + + const auto firstkw = Details::firstBlockKeyword(sect); + const auto occurrence = 0; + + // Main grid sub-section of 'sectID': [ start_kw, LGR ] + const auto* main_grid_sect = + ecl_file_view_add_blockview2(sect, firstkw.c_str(), + LGR_KW, occurrence); + + // LGR sub-section of 'sectID': [ LGR, LGRSGONE ] + const auto* lgr_sect = + ecl_file_view_add_blockview2(sect, LGR_KW, + end_kw, occurrence); + + // Note: main_grid_sect or lgr_sect *may* (in rare cases) be + // nullptr, but we'll deal with that in the calling context. + this->sect_.push_back(Section { main_grid_sect }); + this->sect_.push_back(Section { lgr_sect }); + + // start_kw == end_kw for all but first section. + start_kw = end_kw; + } + } +} + +// ====================================================================== +// Class Opm::ECLRestartData::Impl +// ====================================================================== + +/// Engine powering implementation of \c ECLRestartData interface +class Opm::ECLRestartData::Impl { public: + using Path = boost::filesystem::path; + /// Constructor /// - /// \param[in] rset Filesystem element or casename prefix representing + /// \param[in] rstrt Filesystem element or casename prefix representing /// an ECL result-set. - Impl(Path rset); + Impl(Path rstrt); + + /// Constructor + /// + /// \param[in] rstrt ECL restart result set + Impl(std::shared_ptr rstrt); /// Copy constructor. /// @@ -500,27 +826,6 @@ public: /// instance. Underlying result-set accessor is null upon return. Impl(Impl&& rhs); - /// Access the underlying ERT representation of the result-set. - /// - /// This is a hole in the interface that exists to be able to access - /// ERT's internal data structures for non-neighbouring connections - /// (i.e., faults and/or connections between main grid and LGRs). See - /// function ecl_nnc_export() in the ERT. - /// - /// Handle with care. - /// - /// \return Handle to underlying ERT representation of result-set. - const ecl_file_type* getRawFilePtr() const; - - /// Reset the object's internal view of the result-set to encompass the - /// entirety of the underlying file's result vectors. - /// - /// This is mostly useful in the case of accessing static result-sets - /// such as INIT files. - /// - /// \return Whether or not generating the global view succeeded. - bool selectGlobalView(); - /// Select a result-set view that corresponds to a single report step. /// /// This is needed when working with dynamic restart data. @@ -544,7 +849,7 @@ public: /// \return Whether or not keyword data for the named result vector is /// available in the specific grid. bool haveKeywordData(const std::string& vector, - const int gridID) const; + const std::string& gridName) const; /// Retrieve current result-set view's data values for particular named /// result vector in particular enumerated grid. @@ -572,7 +877,7 @@ public: template std::vector keywordData(const std::string& vector, - const int gridID) const; + const std::string& gridName) const; private: /// RAII class to select a sub-block pertaining to a particular grid @@ -626,7 +931,7 @@ private: /// Saved original active view from host (prior to restricting view /// to single grid ID). - ecl_file_view_type* save_; + const ecl_file_view_type* save_; }; /// Casename prefix. Mostly to implement copy ctor. @@ -639,8 +944,11 @@ private: /// of main grid's section within a view. std::string firstKeyword_; + /// Map LGR names to integral grid IDs. + std::unique_ptr gridIDCache_; + /// Current active result-set view. - mutable ecl_file_view_type* activeBlock_{ nullptr }; + mutable const ecl_file_view_type* activeBlock_{ nullptr }; /// Support for passing \code *this \endcode to ERT functions that /// require an \c ecl_file_type, particularly the function that selects @@ -657,45 +965,42 @@ private: /// Retrieve result-set keyword that identifies beginning of main grid's /// result vectors. const std::string& mainGridStart() const; + + int gridID(const std::string& gridName) const; }; -Opm::ECLResultData::Impl::Impl(Path prefix) +Opm::ECLRestartData::Impl::Impl(Path prefix) : prefix_ (std::move(prefix)) - , result_ (openResultSet(deriveResultPath(prefix_))) + , result_ (openResultSet(deriveRestartPath(prefix_))) , firstKeyword_(firstFileKeyword(result_.get())) {} -Opm::ECLResultData::Impl::Impl(const Impl& rhs) +Opm::ECLRestartData::Impl::Impl(std::shared_ptr rstrt) + : prefix_ (ecl_file_get_src_file(rstrt.get())) + , result_ (std::move(rstrt)) + , firstKeyword_(firstFileKeyword(result_.get())) +{} + +Opm::ECLRestartData::Impl::Impl(const Impl& rhs) : prefix_ (rhs.prefix_) - , result_ (openResultSet(deriveResultPath(prefix_))) + , result_ (openResultSet(deriveRestartPath(prefix_))) , firstKeyword_(firstFileKeyword(result_.get())) {} -Opm::ECLResultData::Impl::Impl(Impl&& rhs) +Opm::ECLRestartData::Impl::Impl(Impl&& rhs) : prefix_ (std::move(rhs.prefix_)) , result_ (std::move(rhs.result_)) , firstKeyword_(std::move(rhs.firstKeyword_)) {} -const ecl_file_type* -Opm::ECLResultData::Impl::getRawFilePtr() const -{ - return this->result_.get(); -} - -bool Opm::ECLResultData::Impl::selectGlobalView() -{ - this->activeBlock_ = ecl_file_get_global_view(*this); - - return this->activeBlock_ != nullptr; -} - -bool Opm::ECLResultData::Impl::selectReportStep(const int step) +bool Opm::ECLRestartData::Impl::selectReportStep(const int step) { if (! ecl_file_has_report_step(*this, step)) { return false; } + this->gridIDCache_.reset(); + if (auto* globView = ecl_file_get_global_view(*this)) { // Ignore sequence numbers, dates, and simulation time. const auto seqnum = -1; @@ -706,16 +1011,26 @@ bool Opm::ECLResultData::Impl::selectReportStep(const int step) ecl_file_view_add_restart_view(globView, seqnum, step, dates, simdays); - return this->activeBlock_ != nullptr; + if (this->activeBlock_ != nullptr) { + this->gridIDCache_ + .reset(new ECLImpl::GridIDCache(this->activeBlock_)); + + return true; + } } return false; } -bool Opm::ECLResultData::Impl:: -haveKeywordData(const std::string& vector, const int gridID) const +bool Opm::ECLRestartData::Impl:: +haveKeywordData(const std::string& vector, + const std::string& gridName) const { - assert ((gridID >= 0) && "Grid IDs must be non-negative"); + const auto gridID = this->gridIDCache_->getGridID(gridName); + + if (gridID < 0) { + return false; + } // Note: Non-trivial dtor. Compiler can't ignore object. const auto block = Restrict{ *this, gridID }; @@ -730,18 +1045,22 @@ namespace Opm { template std::vector - ECLResultData::Impl::keywordData(const std::string& vector, - const int gridID) const + ECLRestartData::Impl::keywordData(const std::string& vector, + const std::string& gridName) const { - if (! this->haveKeywordData(vector, gridID)) { + if (! this->haveKeywordData(vector, gridName)) { std::ostringstream os; - os << "Cannot Access Non-Existent Keyword Data Pair (" - << vector << ", " << gridID << ')'; + os << "RESTART: Cannot Access Non-Existent Keyword Data Pair (" + << vector << ", " + << (gridName.empty() ? "Main Grid" : gridName) + << ')'; throw std::invalid_argument(os.str()); } + const auto gridID = this->gridIDCache_->getGridID(gridName); + // Note: Non-trivial dtor. Compiler can't ignore object. const auto block = Restrict{ *this, gridID }; @@ -754,105 +1073,483 @@ namespace Opm { assert ((kw != nullptr) && "Logic Error In Data Availability Check"); - // Whether or not caller requests a vector. - const auto makeStringVector = - typename std::is_same::type{}; - - switch (ecl_kw_get_type(kw)) { - case ECL_CHAR_TYPE: - return ECLImpl::GetKeywordData:: - as(kw, makeStringVector); - - case ECL_INT_TYPE: - return ECLImpl::GetKeywordData:: - as(kw, makeStringVector); - - case ECL_FLOAT_TYPE: - return ECLImpl::GetKeywordData:: - as(kw, makeStringVector); - - case ECL_DOUBLE_TYPE: - return ECLImpl::GetKeywordData:: - as(kw, makeStringVector); - - default: - // No operator exists for this type. Return empty. - return {}; - } + return ECLImpl::getKeywordData(kw); } } // namespace Opm -Opm::ECLResultData::Impl::operator ecl_file_type*() const +Opm::ECLRestartData::Impl::operator ecl_file_type*() const { return this->result_.get(); } -Opm::ECLResultData::Impl::operator const ecl_file_view_type*() const +Opm::ECLRestartData::Impl::operator const ecl_file_view_type*() const { return this->activeBlock_; } const std::string& -Opm::ECLResultData::Impl::mainGridStart() const +Opm::ECLRestartData::Impl::mainGridStart() const { return this->firstKeyword_; } +int +Opm::ECLRestartData::Impl::gridID(const std::string& gridName) const +{ + return this->gridIDCache_->getGridID(gridName); +} + // ====================================================================== -// Implementation of class Opm::ECLResultData Below Separator +// Class Opm::ECLInitFileData::Impl // ====================================================================== -Opm::ECLResultData::ECLResultData(const Path& prefix) - : pImpl_(new Impl(prefix)) +class Opm::ECLInitFileData::Impl +{ +public: + using Path = boost::filesystem::path; + + /// Constructor. + /// + /// Construct from filename. Owning semantics. + /// + /// \param[in] casePrefix Name or prefix of ECL result data. + Impl(Path initFile); + + /// Constructor. + /// + /// Construct from dataset already input through other means. + /// + /// Non-owning semantics. + Impl(std::shared_ptr initFile); + + /// Copy constructor. + /// + /// \param[in] rhs Object from which to construct new \c Impl instance. + Impl(const Impl& rhs); + + /// Move constructor. + /// + /// \param[in,out] rhs Object from which to constructo new \c Impl + /// instance. Underlying result-set accessor is null upon return. + Impl(Impl&& rhs); + + const ecl_file_type* getRawFilePtr() const; + + /// Query current result-set view for availability of particular named + /// result vector in particular enumerated grid. + /// + /// \param[in] vector Named result vector for which to query data + /// availability. + /// + /// \param[in] gridID Identity of specific grid for which to query data + /// availability. + /// + /// \return Whether or not keyword data for the named result vector is + /// available in the specific grid. + bool haveKeywordData(const std::string& vector, + const std::string& gridName) const; + + /// Retrieve current result-set view's data values for particular named + /// result vector in particular enumerated grid. + /// + /// Will fail (throw an exception of type std::invalid_argument) unless + /// the requested keyword data is available in the specific grid in the + /// current active view. + /// + /// \tparam T Element type of return value. The underlying keyword data + /// will be converted to this type if needed and possible. Note that + /// some type combinations do not make sense. It is, for instance, + /// not possible to retrieve keyword values of an underlying + /// arithmetic type in the form of a \code std::vector + /// \endcode. Similarly, we cannot access underlying character data + /// through elements of an arithmetic type (e.g., \code + /// std::vector \endcode.) + /// + /// \param[in] vector Named result vector for which to retrieve + /// keyword data. + /// + /// \param[in] gridID Identity of specific grid for which to + /// retrieve keyword data. + /// + /// \return Keyword data values. Empty if type conversion fails. + template + std::vector + keywordData(const std::string& vector, + const std::string& gridName) const; + +private: + using SectionID = + ECLImpl::InitFileSections::SectionID; + + /// Result of searching for a particular pairing of (vector,gridName) in + /// INIT. + struct LookupResult + { + /// In what INIT file section the KW was located (-1 if not found). + SectionID sectID; + + /// Local ID, within sectID, of grid section data section that hosts + /// the 'vector' (-1 if not found). + int gridSectID; + }; + + /// Pairing of kw vector and grid name. + struct KWKey { + /// Keyword/result set vector + std::string vector; + + /// ID of grid for which to look up 'vector'. + std::string gridName; + }; + + /// Comparator (std::set<> and std::map<>) for KWKeys. + struct CompareKWKey { + bool operator()(const KWKey& k1, const KWKey& k2) const + { + return std::tie(k1.vector, k1.gridName) + < std::tie(k2.vector, k2.gridName); + } + }; + + /// Negative look-up cache. + using MissingKW = std::set; + + /// Keyword-to-section cache to accelerate repeated look-up. + using KWSection = std::map; + + /// Casename prefix. Mostly to implement copy ctor. + const Path prefix_; + + /// Raw result set. + ECLImpl::FilePtr initFile_; + + /// Sections of the INIT result set. + ECLImpl::InitFileSections sections_; + + mutable const ecl_file_view_type* activeBlock_{ nullptr }; + + /// Negative look-up cache for haveKeywordData() queries. + mutable MissingKW missing_kw_; + + /// Keyword-to-section map for successful haveKeywordData() and + /// keywordData() queries. Accelerates repeated look-up queries. + mutable KWSection kw_section_; + + operator const ecl_file_view_type*() const; + + LookupResult + lookup(const std::string& vector, + const std::string& gridName) const; + + LookupResult lookupMainGrid(const KWKey& key) const; + + LookupResult lookupLGR(const KWKey& key) const; + + void setActiveBlock(const SectionID sect) const; + + const ECLImpl::InitFileSections::Section& + getSection(const SectionID sect) const; +}; + +Opm::ECLInitFileData::Impl::Impl(Path initFile) + : prefix_ (initFile.stem()) + , initFile_(openResultSet(deriveInitPath(std::move(initFile)))) + , sections_(initFile_.get()) {} -Opm::ECLResultData::ECLResultData(const ECLResultData& rhs) +Opm::ECLInitFileData::Impl::Impl(std::shared_ptr initFile) + : prefix_ (Path(ecl_file_get_src_file(initFile.get())).stem()) + , initFile_(std::move(initFile)) + , sections_(initFile_.get()) +{} + +Opm::ECLInitFileData::Impl::Impl(const Impl& rhs) + : prefix_ (rhs.prefix_) + , initFile_(rhs.initFile_) + , sections_(initFile_.get()) +{} + +Opm::ECLInitFileData::Impl::Impl(Impl&& rhs) + : prefix_ (std::move(rhs.prefix_)) + , initFile_(std::move(rhs.initFile_)) + , sections_(std::move(rhs.sections_)) +{} + +const ecl_file_type* +Opm::ECLInitFileData::Impl::getRawFilePtr() const +{ + return this->initFile_.get(); +} + +bool +Opm::ECLInitFileData::Impl:: +haveKeywordData(const std::string& vector, + const std::string& gridName) const +{ + const auto kwloc = this->lookup(vector, gridName); + + return (kwloc.sectID < this->sections_.numSections()) + && (kwloc.gridSectID >= 0); +} + +namespace Opm { + + template + std::vector + ECLInitFileData::Impl:: + keywordData(const std::string& vector, + const std::string& gridName) const + { + if (! this->haveKeywordData(vector, gridName)) { + std::ostringstream os; + + os << "INIT: Cannot Access Non-Existent Keyword Data Pair (" + << vector << ", " + << (gridName.empty() ? "Main Grid" : gridName) + << ')'; + + throw std::invalid_argument(os.str()); + }; + + const auto kwloc = this->lookup(vector, gridName); + + this->setActiveBlock(kwloc.sectID); + + if (! gridName.empty()) { + // We're cons + this->activeBlock_ = + ecl_file_view_add_blockview(this->activeBlock_, LGR_KW, + kwloc.gridSectID); + } + + const auto occurrence = 0; + + const auto* kw = + ecl_file_view_iget_named_kw(*this, vector.c_str(), + occurrence); + + assert ((kw != nullptr) && + "Logic Error In Data Availability Check"); + + return ECLImpl::getKeywordData(kw); + } + +} + +Opm::ECLInitFileData::Impl::operator const ecl_file_view_type*() const +{ + return this->activeBlock_; +} + +Opm::ECLInitFileData::Impl::LookupResult +Opm::ECLInitFileData::Impl:: +lookup(const std::string& vector, const std::string& gridName) const +{ + const auto key = KWKey{ vector, gridName }; + + { + auto m = this->missing_kw_.find(key); + + if (m != std::end(this->missing_kw_)) { + // 'vector' known to be mssing for 'gridName'. Report as such. + return { SectionID(-1), -1 }; + } + } + + { + auto i = this->kw_section_.find(key); + + if (i != std::end(this->kw_section_)) { + // 'vector' previously located for 'gridName'. Return it. + return i->second; + } + } + + if (gridName.empty()) { + return this->lookupMainGrid(key); + } + + return this->lookupLGR(key); +} + +Opm::ECLInitFileData::Impl::LookupResult +Opm::ECLInitFileData::Impl::lookupMainGrid(const KWKey& key) const +{ + assert (key.gridName.empty() && "Logic Error"); + + const auto* kwheader = key.vector.c_str(); + + // Main grid sections are even numbered. + for (auto nSect = this->sections_.numSections(), sectID = 0*nSect; + sectID < nSect; sectID += 2) + { + const auto& s = this->getSection(sectID); + + // Skip empty sections + if (s.block == nullptr) { continue; } + + const auto count = + ecl_file_view_get_num_named_kw(s.block, kwheader); + + if (count > 0) { + // Result-set 'vector' present in main grid. Record and return. + + // Assume that keyword does not occur multiple times in main + // grid section. + const auto gridSectID = 0; + + return this->kw_section_[key] = + LookupResult { sectID, gridSectID }; + } + } + + // No result-set 'vector' in main grid. Record as missing and return + // "not found". + this->missing_kw_.insert(key); + + return { SectionID(-1), -1 }; +} + +Opm::ECLInitFileData::Impl::LookupResult +Opm::ECLInitFileData::Impl::lookupLGR(const KWKey& key) const +{ + assert ((! key.gridName.empty()) && "Logic Error"); + + const auto gridID = paddedGridName(key.gridName); + const auto* kwheader = key.vector.c_str(); + const auto* gridName = gridID.c_str(); + + // LGR sections are odd numbered. + for (auto nSect = this->sections_.numSections(), sectID = 0*nSect + 1; + sectID < nSect; sectID += 2) + { + const auto& s = this->getSection(sectID); + + // Skip empty sections. + if (s.block == nullptr) { continue; } + + const auto nLGR = + ecl_file_view_get_num_named_kw(s.block, LGR_KW); + + assert ((nLGR > 0) && "Logic Error"); + + for (auto lgrID = 0*nLGR; lgrID < nLGR; ++lgrID) { + const auto* kw = + ecl_file_view_iget_named_kw(s.block, LGR_KW, lgrID); + + if (! ecl_kw_data_equal(kw, gridName)) { + // This is not the grid you're looking for. + continue; + } + + // This LGR section pertains to key.gridName. Look for + // key.vector between this occurrence of LGR_KW and the next. + // Continue searching if we don't find that vector however, + // because there may be multiple relevant LGR instances for + // key.gridName. + + const auto* lgrSect = + ecl_file_view_add_blockview(s.block, LGR_KW, lgrID); + + const auto kwCount = + ecl_file_view_get_num_named_kw(lgrSect, kwheader); + + if (kwCount > 0) { + // We found the key.vector in this LGR data section. Record + // position and return it to caller. + + return this->kw_section_[key] = + LookupResult { SectionID(sectID), lgrID }; + } + + // Did not find 'key.vector' in this LGR data section. Continue + // searching nonetheless because there may be more LGR sections + // that pertain to 'key.gridName'. + } + } + + // key.vector not found for key.gridName in any of the LGR sections. + // Record as missing and return "not found". + + this->missing_kw_.insert(key); + + return { SectionID(-1), -1 }; +} + +void +Opm::ECLInitFileData::Impl::setActiveBlock(const SectionID sect) const +{ + this->activeBlock_ = this->getSection(sect).block; +} + +const ECLImpl::InitFileSections::Section& +Opm::ECLInitFileData::Impl::getSection(const SectionID sect) const +{ + assert (sect < this->sections_.numSections()); + + return this->sections_[sect]; +} + +// ###################################################################### +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = +// Public Interfaces Follow +// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// ###################################################################### + +// ====================================================================== +// Implementation of class Opm::ECLRestartData Below Separator +// ====================================================================== + +Opm::ECLRestartData::ECLRestartData(boost::filesystem::path rstrt) + : pImpl_(new Impl(std::move(rstrt))) +{} + +Opm::ECLRestartData::ECLRestartData(std::shared_ptr rstrt) + : pImpl_(new Impl(std::move(rstrt))) +{} + +Opm::ECLRestartData::ECLRestartData(const ECLRestartData& rhs) : pImpl_(new Impl(*rhs.pImpl_)) {} -Opm::ECLResultData::ECLResultData(ECLResultData&& rhs) +Opm::ECLRestartData::ECLRestartData(ECLRestartData&& rhs) : pImpl_(std::move(rhs.pImpl_)) {} -Opm::ECLResultData& -Opm::ECLResultData::operator=(const ECLResultData& rhs) +Opm::ECLRestartData& +Opm::ECLRestartData::operator=(const ECLRestartData& rhs) { this->pImpl_.reset(new Impl(*rhs.pImpl_)); return *this; } -Opm::ECLResultData& -Opm::ECLResultData::operator=(ECLResultData&& rhs) +Opm::ECLRestartData& +Opm::ECLRestartData::operator=(ECLRestartData&& rhs) { this->pImpl_ = std::move(rhs.pImpl_); return *this; } -Opm::ECLResultData::~ECLResultData() +Opm::ECLRestartData::~ECLRestartData() {} -const ecl_file_type* -Opm::ECLResultData::getRawFilePtr() const +bool Opm::ECLRestartData::selectReportStep(const int step) const { - return this->pImpl_->getRawFilePtr(); -} + // selectReportStep() const is a bit of a lie. pImpl_ is a const + // pointer to modifiable Impl. -bool Opm::ECLResultData::selectGlobalView() -{ - return this->pImpl_->selectGlobalView(); -} - -bool Opm::ECLResultData::selectReportStep(const int step) -{ return this->pImpl_->selectReportStep(step); } bool -Opm::ECLResultData:: -haveKeywordData(const std::string& vector, const int gridID) const +Opm::ECLRestartData:: +haveKeywordData(const std::string& vector, + const std::string& gridID) const { return this->pImpl_->haveKeywordData(vector, gridID); } @@ -861,23 +1558,101 @@ namespace Opm { template std::vector - ECLResultData::keywordData(const std::string& vector, - const int gridID) const + ECLRestartData::keywordData(const std::string& vector, + const std::string& gridID) const { return this->pImpl_->template keywordData(vector, gridID); } // Explicit instantiations for those types we care about. template std::vector - ECLResultData::keywordData(const std::string& vector, - const int gridID) const; + ECLRestartData::keywordData(const std::string& vector, + const std::string& gridID) const; template std::vector - ECLResultData::keywordData(const std::string& vector, - const int gridID) const; + ECLRestartData::keywordData(const std::string& vector, + const std::string& gridID) const; template std::vector - ECLResultData::keywordData(const std::string& vector, - const int gridID) const; + ECLRestartData::keywordData(const std::string& vector, + const std::string& gridID) const; + +} // namespace Opm::ECL + +// ====================================================================== +// Implementation of class Opm::ECLInitFileData Below Separator +// ====================================================================== + +Opm::ECLInitFileData::ECLInitFileData(boost::filesystem::path init) + : pImpl_(new Impl(std::move(init))) +{} + +Opm::ECLInitFileData::ECLInitFileData(std::shared_ptr init) + : pImpl_(new Impl(std::move(init))) +{} + +Opm::ECLInitFileData::ECLInitFileData(const ECLInitFileData& rhs) + : pImpl_(new Impl(*rhs.pImpl_)) +{} + +Opm::ECLInitFileData::ECLInitFileData(ECLInitFileData&& rhs) + : pImpl_(std::move(rhs.pImpl_)) +{} + +Opm::ECLInitFileData& +Opm::ECLInitFileData::operator=(const ECLInitFileData& rhs) +{ + this->pImpl_.reset(new Impl(*rhs.pImpl_)); + + return *this; +} + +Opm::ECLInitFileData& +Opm::ECLInitFileData::operator=(ECLInitFileData&& rhs) +{ + this->pImpl_ = std::move(rhs.pImpl_); + + return *this; +} + +Opm::ECLInitFileData::~ECLInitFileData() +{} + +bool +Opm::ECLInitFileData:: +haveKeywordData(const std::string& vector, + const std::string& gridID) const +{ + return this->pImpl_->haveKeywordData(vector, gridID); +} + +const ecl_file_type* +Opm::ECLInitFileData::getRawFilePtr() const +{ + return this->pImpl_->getRawFilePtr(); +} + +namespace Opm { + + template + std::vector + ECLInitFileData::keywordData(const std::string& vector, + const std::string& gridID) const + { + return this->pImpl_->template keywordData(vector, gridID); + } + + // Explicit instantiations for those types we care about. + template std::vector + ECLInitFileData::keywordData(const std::string& vector, + const std::string& gridID) const; + + template std::vector + ECLInitFileData::keywordData(const std::string& vector, + const std::string& gridID) const; + + template std::vector + ECLInitFileData::keywordData(const std::string& vector, + const std::string& gridID) const; } // namespace Opm::ECL diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.hpp b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.hpp index a804e4baf8..c48b6a4645 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.hpp +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.hpp @@ -1,6 +1,5 @@ /* - Copyright 2016 SINTEF ICT, Applied Mathematics. - Copyright 2016 Statoil ASA. + Copyright 2016, 2017 Statoil ASA. This file is part of the Open Porous Media Project (OPM). @@ -18,8 +17,8 @@ along with OPM. If not, see . */ -#ifndef OPM_ECLRESTARTDATA_HEADER_INCLUDED -#define OPM_ECLRESTARTDATA_HEADER_INCLUDED +#ifndef OPM_ECLRESULTDATA_HEADER_INCLUDED +#define OPM_ECLRESULTDATA_HEADER_INCLUDED #include #include @@ -34,14 +33,17 @@ /// Forward-declaration of ERT's representation of an ECLIPSE result file. /// /// This is a hole in the insulation between the interface and the -/// underlying implementation of class ECLResultData. +/// underlying implementation of class ECLInitFileData and furthermore +/// enables constructing wrapper objects from separately parsed result sets. extern "C" { typedef struct ecl_file_struct ecl_file_type; } // extern "C" namespace Opm { - /// Representation of an ECLIPSE result-set. + class ECLGraph; + + /// Representation of an ECLIPSE Restart result-set. /// /// This class is aware of the internal structure of ECLIPSE restart /// files and may restrict its operation to a single report step. The @@ -51,30 +53,37 @@ namespace Opm { /// /// Note: The client must select a view of the result-set before /// accessing any vectors within the set. - class ECLResultData + class ECLRestartData { public: - using Path = boost::filesystem::path; - /// Default constructor disabled. - ECLResultData() = delete; + ECLRestartData() = delete; /// Constructor. /// - /// \param[in] casePrefix Name or prefix of ECL result data. - explicit ECLResultData(const Path& casePrefix); + /// Owning semantics. + /// + /// \param[in] rstrt Name or prefix of ECL result data. + explicit ECLRestartData(boost::filesystem::path rstrt); + + /// Constructor + /// + /// Shared ownership of result set. + /// + /// \param[in] rstrt ECL restart result set. + explicit ECLRestartData(std::shared_ptr rstrt); /// Copy constructor. /// /// \param[in] rhs Object from which to construct new instance. - ECLResultData(const ECLResultData& rhs); + ECLRestartData(const ECLRestartData& rhs); /// Move constructor. /// /// \param[in,out] rhs Object from which to construct new instance. /// Its internal implementation will be subsumed into the new /// object. - ECLResultData(ECLResultData&& rhs); + ECLRestartData(ECLRestartData&& rhs); /// Assignment operator. /// @@ -82,7 +91,7 @@ namespace Opm { /// instance. /// /// \return \code *this \endcode. - ECLResultData& operator=(const ECLResultData& rhs); + ECLRestartData& operator=(const ECLRestartData& rhs); /// Move assignment operator. /// @@ -91,27 +100,10 @@ namespace Opm { /// instance. /// /// \return \code *this \endcode. - ECLResultData& operator=(ECLResultData&& rhs); + ECLRestartData& operator=(ECLRestartData&& rhs); /// Destructor. - ~ECLResultData(); - - /// Access the underlying ERT representation of the result-set. - /// - /// This is essentially a hole in the interface that is intended to - /// support a few very specialised uses. Handle with care. - /// - /// \return Handle to underlying ERT representation of result-set. - const ecl_file_type* getRawFilePtr() const; - - /// Reset the object's internal view of the result-set to encompass - /// the entirety of the underlying file's result vectors. - /// - /// This is mostly useful in the case of accessing static result - /// sets such as INIT files. - /// - /// \return Whether or not generating the global view succeeded. - bool selectGlobalView(); + ~ECLRestartData(); /// Select a result-set view that corresponds to a single report /// step. @@ -123,7 +115,7 @@ namespace Opm { /// \return Whether or not selecting the report step succeeded. The /// typical failure case is the report step not being available /// in the result-set. - bool selectReportStep(const int step); + bool selectReportStep(const int step) const; /// Query current result-set view for availability of particular /// named result vector in particular enumerated grid. @@ -132,12 +124,12 @@ namespace Opm { /// availability. /// /// \param[in] gridID Identity of specific grid for which to query - /// data availability. + /// data availability. Empty for the main grid. /// /// \return Whether or not keyword data for the named result vector /// is available in the specific grid. bool haveKeywordData(const std::string& vector, - const int gridID) const; + const std::string& gridID = "") const; /// Retrieve current result-set view's data values for particular /// named result vector in particular enumerated grid. @@ -159,13 +151,13 @@ namespace Opm { /// keyword data. /// /// \param[in] gridID Identity of specific grid for which to - /// retrieve keyword data. + /// retrieve keyword data. Empty for the main grid. /// /// \return Keyword data values. Empty if type conversion fails. template std::vector keywordData(const std::string& vector, - const int gridID) const; + const std::string& gridID = "") const; private: class Impl; @@ -173,6 +165,119 @@ namespace Opm { std::unique_ptr pImpl_; }; + /// Representation of an ECLIPSE Initialization result-set. + /// + /// This class is aware of the internal structure of ECLIPSE INIT files + /// and queries only those objects that pertain to a single grid. + class ECLInitFileData + { + public: + ECLInitFileData() = delete; + + /// Constructor. + /// + /// Construct from filename. Owning semantics. + /// + /// \param[in] casePrefix Name or prefix of ECL result data. + explicit ECLInitFileData(boost::filesystem::path initFile); + + /// Constructor. + /// + /// Construct from dataset already input through other means. + /// + /// Non-owning/shared ownership semantics. + explicit ECLInitFileData(std::shared_ptr initFile); + + /// Copy constructor. + /// + /// \param[in] rhs Object from which to construct new instance. + ECLInitFileData(const ECLInitFileData& rhs); + + /// Move constructor. + /// + /// \param[in,out] rhs Object from which to construct new instance. + /// Its internal implementation will be subsumed into the new + /// object. + ECLInitFileData(ECLInitFileData&& rhs); + + /// Assignment operator. + /// + /// \param[in] rhs Object from which to assign new values to current + /// instance. + /// + /// \return \code *this \endcode. + ECLInitFileData& operator=(const ECLInitFileData& rhs); + + /// Move assignment operator. + /// + /// \param[in,out] Object from which to assign new instance values. + /// Its internal implementation will be subsumed into this + /// instance. + /// + /// \return \code *this \endcode. + ECLInitFileData& operator=(ECLInitFileData&& rhs); + + /// Destructor. + ~ECLInitFileData(); + + /// Query current result-set view for availability of particular + /// named result vector in particular enumerated grid. + /// + /// \param[in] vector Named result vector for which to query data + /// availability. + /// + /// \param[in] gridID Identity of specific grid for which to query + /// data availability. Empty for the main grid. + /// + /// \return Whether or not keyword data for the named result vector + /// is available in the specific grid. + bool haveKeywordData(const std::string& vector, + const std::string& gridID = "") const; + + /// Retrieve current result-set view's data values for particular + /// named result vector in particular enumerated grid. + /// + /// Will fail (throw an exception of type std::invalid_argument) + /// unless the requested keyword data is available in the specific + /// grid in the current active view. + /// + /// \tparam T Element type of return value. The underlying keyword + /// data will be converted to this type if needed and possible. + /// Note that some type combinations do not make sense. It is, + /// for instance, not possible to retrieve keyword values of an + /// underlying arithmetic type in the form of a \code + /// std::vector \endcode. Similarly, we cannot + /// access underlying character data through elements of an + /// arithmetic type (e.g., \code std::vector \endcode.) + /// + /// \param[in] vector Named result vector for which to retrieve + /// keyword data. + /// + /// \param[in] gridID Identity of specific grid for which to + /// retrieve keyword data. Empty for the main grid. + /// + /// \return Keyword data values. Empty if type conversion fails. + template + std::vector + keywordData(const std::string& vector, + const std::string& gridID = "") const; + + // Grant class ECLGraph privileged access to getRawFilePtr(). + friend class ECLGraph; + + private: + class Impl; + + std::unique_ptr pImpl_; + + /// Access the underlying ERT representation of the result-set. + /// + /// This is essentially a hole in the interface that is intended to + /// support a few very specialised uses. Handle with care. + /// + /// \return Handle to underlying ERT representation of result-set. + const ecl_file_type* getRawFilePtr() const; + }; } // namespace Opm -#endif // OPM_ECLRESTARTDATA_HEADER_INCLUDED +#endif // OPM_ECLRESULTDATA_HEADER_INCLUDED diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLUnitHandling.cpp b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLUnitHandling.cpp index 4a3b77b1c1..4f29ba1ae6 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLUnitHandling.cpp +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLUnitHandling.cpp @@ -1,5 +1,4 @@ /* - Copyright 2017 SINTEF ICT, Applied Mathematics. Copyright 2017 Statoil ASA. This file is part of the Open Porous Media Project (OPM). diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLUnitHandling.hpp b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLUnitHandling.hpp index ee11974fe0..87fe95d75b 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLUnitHandling.hpp +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLUnitHandling.hpp @@ -1,5 +1,4 @@ /* - Copyright 2017 SINTEF ICT, Applied Mathematics. Copyright 2017 Statoil ASA. This file is part of the Open Porous Media Project (OPM). diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLWellSolution.cpp b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLWellSolution.cpp index 20b611a4a0..f1c17fbc52 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLWellSolution.cpp +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLWellSolution.cpp @@ -1,6 +1,6 @@ /* Copyright 2016 SINTEF ICT, Applied Mathematics. - Copyright 2016 Statoil ASA. + Copyright 2016, 2017 Statoil ASA. This file is part of the Open Porous Media project (OPM). @@ -146,13 +146,16 @@ namespace Opm std::vector - ECLWellSolution::solution(const ECLResultData& restart, - const int num_grids) const + ECLWellSolution::solution(const ECLRestartData& restart, + const std::vector& grids) const { + // Note: this function expects to be called with the correct restart + // block--e.g., a report step--selected in the caller. + // Read well data for global grid. std::vector all_wd{}; - for (int grid_index = 0; grid_index < num_grids; ++grid_index) { - std::vector wd = readWellData(restart, grid_index); + for (const auto& gridName : grids) { + std::vector wd = readWellData(restart, gridName); // Append to set of all well data. all_wd.insert(all_wd.end(), wd.begin(), wd.end()); } @@ -163,24 +166,34 @@ namespace Opm std::vector - ECLWellSolution::readWellData(const ECLResultData& restart, const int grid_index) const + ECLWellSolution::readWellData(const ECLRestartData& restart, + const std::string& gridName) const { - // Note: this function is expected to be called in a context - // where the correct restart block using the ert block mechanisms. + // Check if result set provides complete set of well solution data. + if (! (restart.haveKeywordData(ZWEL_KW, gridName) && + restart.haveKeywordData(IWEL_KW, gridName) && + restart.haveKeywordData("XWEL" , gridName) && + restart.haveKeywordData(ICON_KW, gridName) && + restart.haveKeywordData("XCON" , gridName))) + { + // Not all requisite keywords present in this grid. Can't + // create a well solution. + return {}; + } // Read header, return if trivial. - INTEHEAD ih(restart.keywordData(INTEHEAD_KW, grid_index)); + INTEHEAD ih(restart.keywordData(INTEHEAD_KW, gridName)); if (ih.nwell == 0) { return {}; } const double qr_unit = resRateUnit(ih.unit); - // Read necessary keywords. - auto zwel = restart.keywordData(ZWEL_KW, grid_index); - auto iwel = restart.keywordData (IWEL_KW, grid_index); - auto xwel = restart.keywordData ("XWEL" , grid_index); - auto icon = restart.keywordData (ICON_KW, grid_index); - auto xcon = restart.keywordData ("XCON" , grid_index); + // Load well topology and flow rates. + auto zwel = restart.keywordData(ZWEL_KW, gridName); + auto iwel = restart.keywordData (IWEL_KW, gridName); + auto xwel = restart.keywordData ("XWEL" , gridName); + auto icon = restart.keywordData (ICON_KW, gridName); + auto xcon = restart.keywordData ("XCON" , gridName); // Create well data. std::vector wd_vec; @@ -204,7 +217,7 @@ namespace Opm const int xcon_offset = (well*ih.ncwma + comp_index) * ih.nxcon; WellData::Completion completion; // Note: subtracting 1 from indices (Fortran -> C convention). - completion.grid_index = grid_index; + completion.gridName = gridName; completion.ijk = { icon[icon_offset + ICON_I_INDEX] - 1, icon[icon_offset + ICON_J_INDEX] - 1, icon[icon_offset + ICON_K_INDEX] - 1 }; @@ -212,7 +225,7 @@ namespace Opm completion.reservoir_inflow_rate = -unit::convert::from(xcon[xcon_offset + XCON_QR_INDEX], qr_unit); if (disallow_crossflow_) { // Add completion only if not cross-flowing (injecting producer or producing injector). - if (completion.reservoir_inflow_rate < 0.0 == is_producer) { + if ((completion.reservoir_inflow_rate < 0.0) == is_producer) { wd.completions.push_back(completion); } } else { diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLWellSolution.hpp b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLWellSolution.hpp index e6ab682b2a..94e24c65ec 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLWellSolution.hpp +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLWellSolution.hpp @@ -1,6 +1,6 @@ /* Copyright 2016 SINTEF ICT, Applied Mathematics. - Copyright 2016 Statoil ASA. + Copyright 2016, 2017 Statoil ASA. This file is part of the Open Porous Media project (OPM). @@ -29,7 +29,7 @@ namespace Opm { - class ECLResultData; + class ECLRestartData; class ECLWellSolution { @@ -47,7 +47,7 @@ namespace Opm bool is_injector_well; struct Completion { - int grid_index; // 0 for main grid, otherwise LGR grid. + std::string gridName; // empty for main grid, otherwise LGR grid. std::array ijk; // Cartesian location in grid. double reservoir_inflow_rate; // Total fluid rate in SI (m^3/s). }; @@ -58,8 +58,8 @@ namespace Opm /// /// Will throw if required data is not available for the /// requested step. - std::vector solution(const ECLResultData& restart, - const int num_grids) const; + std::vector solution(const ECLRestartData& restart, + const std::vector& grids) const; private: // Data members. @@ -67,8 +67,8 @@ namespace Opm bool disallow_crossflow_; // Methods. - std::vector readWellData(const ECLResultData& restart, - const int grid_index) const; + std::vector readWellData(const ECLRestartData& restart, + const std::string& gridName) const; }; diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/tests/runAcceptanceTest.cpp b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/tests/runAcceptanceTest.cpp index 3b799a11fb..bb8108d72d 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/tests/runAcceptanceTest.cpp +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/tests/runAcceptanceTest.cpp @@ -250,7 +250,7 @@ namespace { } ErrorTolerance - testTolerances(const ::Opm::parameter::ParameterGroup& param) + testTolerances(const ::Opm::ParameterGroup& param) { const auto atol = param.getDefault("atol", 1.0e-8); const auto rtol = param.getDefault("rtol", 5.0e-12); @@ -277,7 +277,7 @@ namespace { } ReferenceToF - loadReference(const ::Opm::parameter::ParameterGroup& param, + loadReference(const ::Opm::ParameterGroup& param, const int step, const int nDigits) { diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/tests/runLinearisedCellDataTest.cpp b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/tests/runLinearisedCellDataTest.cpp index 89500d9b8e..1811f8a3ed 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/tests/runLinearisedCellDataTest.cpp +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/tests/runLinearisedCellDataTest.cpp @@ -377,7 +377,7 @@ namespace { } ErrorTolerance - testTolerances(const ::Opm::parameter::ParameterGroup& param) + testTolerances(const ::Opm::ParameterGroup& param) { const auto atol = param.getDefault("atol", 1.0e-8); const auto rtol = param.getDefault("rtol", 5.0e-12); @@ -386,7 +386,7 @@ namespace { } std::vector - testQuantities(const ::Opm::parameter::ParameterGroup& param) + testQuantities(const ::Opm::ParameterGroup& param) { return StringUtils::VectorValue:: get(param.get("quant")); @@ -411,7 +411,7 @@ namespace { } ReferenceSolution - loadReference(const ::Opm::parameter::ParameterGroup& param, + loadReference(const ::Opm::ParameterGroup& param, const std::string& quant, const int step, const int nDigits) @@ -493,7 +493,8 @@ namespace { std::array sampleDifferences(const ::Opm::ECLGraph& graph, - const ::Opm::parameter::ParameterGroup& param, + const ::Opm::ECLRestartData& rstrt, + const ::Opm::ParameterGroup& param, const std::string& quant, const std::vector& steps) { @@ -510,7 +511,7 @@ namespace { auto E = std::array{}; for (const auto& step : steps) { - if (! graph.selectReportStep(step)) { + if (! rstrt.selectReportStep(step)) { continue; } @@ -518,7 +519,7 @@ namespace { { const auto raw = Calculated { - graph.rawLinearisedCellData(ECLquant) + graph.rawLinearisedCellData(rstrt, ECLquant) }; computeErrors(Reference{ ref.raw }, raw, E[0]); @@ -526,7 +527,7 @@ namespace { { const auto SI = Calculated { - graph.linearisedCellData(ECLquant, unit) + graph.linearisedCellData(rstrt, ECLquant, unit) }; computeErrors(Reference{ ref.SI }, SI, E[1]); @@ -561,12 +562,14 @@ try { const auto pth = example::FilePaths(prm); const auto tol = testTolerances(prm); + const auto rstrt = ::Opm::ECLRestartData(pth.restart); const auto steps = availableReportSteps(pth); const auto graph = example::initGraph(pth); auto all_ok = true; for (const auto& quant : testQuantities(prm)) { - const auto E = sampleDifferences(graph, prm, quant, steps); + const auto E = + sampleDifferences(graph, rstrt, prm, quant, steps); const auto ok = everythingFine(E[0], tol) && everythingFine(E[1], tol); diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/tests/runTransTest.cpp b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/tests/runTransTest.cpp index e705cfede4..766a11048c 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/tests/runTransTest.cpp +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/tests/runTransTest.cpp @@ -152,7 +152,7 @@ namespace { } ErrorTolerance - testTolerances(const ::Opm::parameter::ParameterGroup& param) + testTolerances(const ::Opm::ParameterGroup& param) { const auto atol = param.getDefault("atol", 1.0e-8); const auto rtol = param.getDefault("rtol", 5.0e-12); @@ -161,7 +161,7 @@ namespace { } std::vector - loadReference(const ::Opm::parameter::ParameterGroup& param) + loadReference(const ::Opm::ParameterGroup& param) { namespace fs = boost::filesystem; @@ -185,7 +185,7 @@ namespace { }; } - bool transfieldAcceptable(const ::Opm::parameter::ParameterGroup& param, + bool transfieldAcceptable(const ::Opm::ParameterGroup& param, const std::vector& trans) { const auto Tref = loadReference(param); diff --git a/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/opm/flowdiagnostics/DerivedQuantities.cpp b/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/opm/flowdiagnostics/DerivedQuantities.cpp index 3ad859a0ef..dca1df6d21 100644 --- a/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/opm/flowdiagnostics/DerivedQuantities.cpp +++ b/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/opm/flowdiagnostics/DerivedQuantities.cpp @@ -1,5 +1,6 @@ /* - Copyright 2015, 2016 SINTEF ICT, Applied Mathematics. + Copyright 2015, 2016, 2017 SINTEF ICT, Applied Mathematics. + Copyright 2017 Statoil ASA. This file is part of the Open Porous Media project (OPM). @@ -70,9 +71,26 @@ namespace FlowDiagnostics const Toolbox::Reverse& producer_solution, const std::vector& pv) { - const auto& ftof = injector_solution.fd.timeOfFlight(); - const auto& rtof = producer_solution.fd.timeOfFlight(); - if (pv.size() != ftof.size() || pv.size() != rtof.size()) { + return flowCapacityStorageCapacityCurve(injector_solution.fd.timeOfFlight(), + producer_solution.fd.timeOfFlight(), + pv); + } + + + + + /// The F-Phi curve. + /// + /// The F-Phi curve is an analogue to the fractional flow + /// curve in a 1D displacement. It can be used to compute + /// other interesting diagnostic quantities such as the Lorenz + /// coefficient. For a technical description see Shavali et + /// al. (SPE 146446), Shook and Mitchell (SPE 124625). + Graph flowCapacityStorageCapacityCurve(const std::vector& injector_tof, + const std::vector& producer_tof, + const std::vector& pv) + { + if (pv.size() != injector_tof.size() || pv.size() != producer_tof.size()) { throw std::runtime_error("flowCapacityStorageCapacityCurve(): " "Input solutions must have same size."); } @@ -82,12 +100,12 @@ namespace FlowDiagnostics typedef std::pair D2; std::vector time_and_pv(n); for (int ii = 0; ii < n; ++ii) { - time_and_pv[ii].first = ftof[ii] + rtof[ii]; // Total travel time. + time_and_pv[ii].first = injector_tof[ii] + producer_tof[ii]; // Total travel time. time_and_pv[ii].second = pv[ii]; } std::sort(time_and_pv.begin(), time_and_pv.end()); - auto Phi = cumulativeNormalized(time_and_pv, [](const D2& i) { return i.first; }); + auto Phi = cumulativeNormalized(time_and_pv, [](const D2& i) { return i.second; }); auto F = cumulativeNormalized(time_and_pv, [](const D2& i) { return i.second / i.first; }); return Graph{std::move(Phi), std::move(F)}; diff --git a/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/opm/flowdiagnostics/DerivedQuantities.hpp b/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/opm/flowdiagnostics/DerivedQuantities.hpp index 0f3642bec1..22023ab708 100644 --- a/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/opm/flowdiagnostics/DerivedQuantities.hpp +++ b/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/opm/flowdiagnostics/DerivedQuantities.hpp @@ -50,6 +50,14 @@ namespace FlowDiagnostics const Toolbox::Reverse& producer_solution, const std::vector& pore_volume); + /// This overload gets the injector and producer time-of-flight + /// directly instead of extracting it from the solution + /// objects. It otherwise behaves identically to the other + /// overload. + Graph flowCapacityStorageCapacityCurve(const std::vector& injector_tof, + const std::vector& producer_tof, + const std::vector& pore_volume); + /// The Lorenz coefficient from the F-Phi curve. /// /// The Lorenz coefficient is a measure of heterogeneity. It diff --git a/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/opm/flowdiagnostics/Solution.cpp b/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/opm/flowdiagnostics/Solution.cpp index ee88861d39..d31e65bc7e 100644 --- a/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/opm/flowdiagnostics/Solution.cpp +++ b/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/opm/flowdiagnostics/Solution.cpp @@ -1,5 +1,6 @@ /* Copyright 2016 SINTEF ICT, Applied Mathematics. + Copyright 2016 Statoil ASA. This file is part of the Open Porous Media project (OPM). diff --git a/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/opm/flowdiagnostics/TracerTofSolver.cpp b/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/opm/flowdiagnostics/TracerTofSolver.cpp index 064f8c61e7..dc1994df86 100644 --- a/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/opm/flowdiagnostics/TracerTofSolver.cpp +++ b/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/opm/flowdiagnostics/TracerTofSolver.cpp @@ -1,6 +1,6 @@ /* Copyright 2016 SINTEF ICT, Applied Mathematics. - Copyright 2016 Statoil ASA. + Copyright 2016, 2017 Statoil ASA. This file is part of the Open Porous Media project (OPM). diff --git a/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/opm/utility/graph/AssembledConnectionsIteration.hpp b/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/opm/utility/graph/AssembledConnectionsIteration.hpp index b949242505..d91baeaeff 100644 --- a/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/opm/utility/graph/AssembledConnectionsIteration.hpp +++ b/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/opm/utility/graph/AssembledConnectionsIteration.hpp @@ -1,5 +1,6 @@ /* Copyright 2016 SINTEF ICT, Applied Mathematics. + Copyright 2016 Statoil ASA. This file is part of the Open Porous Media project (OPM). diff --git a/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/tests/test_derivedquantities.cpp b/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/tests/test_derivedquantities.cpp index bab38628a1..6c14694949 100644 --- a/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/tests/test_derivedquantities.cpp +++ b/ThirdParty/custom-opm-flowdiagnostics/opm-flowdiagnostics/tests/test_derivedquantities.cpp @@ -247,6 +247,8 @@ BOOST_AUTO_TEST_CASE (OneDimCase) BOOST_CHECK_THROW(flowCapacityStorageCapacityCurve(fwd, rev, {}), std::runtime_error); const auto fcapscap = flowCapacityStorageCapacityCurve(fwd, rev, pv); check_is_close(fcapscap, expectedFPhi); + const auto fcapscap2 = flowCapacityStorageCapacityCurve(fwd.fd.timeOfFlight(), rev.fd.timeOfFlight(), pv); + check_is_close(fcapscap2, expectedFPhi); BOOST_TEST_MESSAGE("==== Lorenz coefficient"); const double expectedLorenz = 0.0; @@ -296,4 +298,28 @@ BOOST_AUTO_TEST_CASE (OneDimCase) } + + + + +BOOST_AUTO_TEST_CASE (GeneralCase) +{ + BOOST_TEST_MESSAGE("==== F-Phi graph"); + + std::vector pv { 1.0, 2.0, 1.0 }; + std::vector ftof { 0.0, 2.0, 1.0 }; + std::vector rtof { 1.0, 2.0, 0.0 }; + const Graph expectedFPhi{ + { 0.0, 0.25, 0.5, 1.0 }, + { 0.0, 0.4, 0.8, 1.0 } + }; + const auto fcapscap = flowCapacityStorageCapacityCurve(ftof, rtof, pv); + check_is_close(fcapscap, expectedFPhi); + + BOOST_TEST_MESSAGE("==== Lorenz coefficient"); + const double expectedLorenz = 0.3; + BOOST_CHECK_CLOSE(lorenzCoefficient(fcapscap), expectedLorenz, 1e-10); +} + + BOOST_AUTO_TEST_SUITE_END() diff --git a/doc/well_path_part_manager.plantuml b/doc/well_path_part_manager.plantuml new file mode 100644 index 0000000000..7c5e7509b3 --- /dev/null +++ b/doc/well_path_part_manager.plantuml @@ -0,0 +1,23 @@ +@startuml + + + +RimView --> RivWellPathCollectionPartMgr + +RivWellPathCollectionPartMgr -* "N" RivWellPathPartMgr + +class RivWellPathPartMgr { +RimWellPath* m_wellPath +} + +class RimWellPath { +RimWellPathFractureCollection m_fractureCollection; +} + +class RimWellPathFractureCollection { +caf::PdmChildArrayField fractures; +} + + + +@enduml diff --git a/patches/fix-synthetic-odb-cases.patch b/patches/fix-synthetic-odb-cases.patch new file mode 100644 index 0000000000..6b3247c686 --- /dev/null +++ b/patches/fix-synthetic-odb-cases.patch @@ -0,0 +1,43 @@ +From 8d2557fe8dd00ac30f524197c8a50db2e89bf720 Mon Sep 17 00:00:00 2001 +From: Magne Sjaastad +Date: Tue, 25 Apr 2017 13:11:00 +0200 +Subject: [PATCH] #1396 Reapply fix for synthetic odb files + +--- + ThirdParty/Ert/libecl/src/ecl_rsthead.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/ThirdParty/Ert/libecl/src/ecl_rsthead.c b/ThirdParty/Ert/libecl/src/ecl_rsthead.c +index 52ad954..e382cc1 100644 +--- a/ThirdParty/Ert/libecl/src/ecl_rsthead.c ++++ b/ThirdParty/Ert/libecl/src/ecl_rsthead.c +@@ -88,7 +88,8 @@ ecl_rsthead_type * ecl_rsthead_alloc_from_kw( int report_step , const ecl_kw_typ + // The only derived quantity + rsthead->sim_time = rsthead_date( rsthead->day , rsthead->month , rsthead->year ); + } +- rsthead->sim_days = ecl_kw_iget_double( doubhead_kw , DOUBHEAD_DAYS_INDEX ); ++ if (doubhead_kw) ++ rsthead->sim_days = ecl_kw_iget_double( doubhead_kw , DOUBHEAD_DAYS_INDEX ); + if (logihead_kw) + rsthead->dualp = ecl_kw_iget_bool( logihead_kw , LOGIHEAD_DUALP_INDEX); + +@@ -109,12 +110,15 @@ ecl_rsthead_type * ecl_rsthead_alloc_from_kw( int report_step , const ecl_kw_typ + + ecl_rsthead_type * ecl_rsthead_alloc( const ecl_file_view_type * rst_view, int report_step) { + const ecl_kw_type * intehead_kw = ecl_file_view_iget_named_kw( rst_view , INTEHEAD_KW , 0); +- const ecl_kw_type * doubhead_kw = ecl_file_view_iget_named_kw( rst_view , DOUBHEAD_KW , 0); ++ const ecl_kw_type * doubhead_kw = NULL; + const ecl_kw_type * logihead_kw = NULL; + + if (ecl_file_view_has_kw(rst_view, LOGIHEAD_KW)) + logihead_kw = ecl_file_view_iget_named_kw( rst_view , LOGIHEAD_KW , 0); + ++ if (ecl_file_view_has_kw(rst_view, DOUBHEAD_KW)) ++ doubhead_kw = ecl_file_view_iget_named_kw(rst_view, DOUBHEAD_KW, 0); ++ + if (ecl_file_view_has_kw( rst_view , SEQNUM_KW)) { + const ecl_kw_type * seqnum_kw = ecl_file_view_iget_named_kw( rst_view , SEQNUM_KW , 0); + report_step = ecl_kw_iget_int( seqnum_kw , 0); +-- +2.10.2.windows.1 + diff --git a/patches/readme.txt b/patches/readme.txt new file mode 100644 index 0000000000..23d442149b --- /dev/null +++ b/patches/readme.txt @@ -0,0 +1,6 @@ + +Command line: +git apply --reject --whitespace=fix patches/fix-synthetic-odb-cases.patch + +Description: +Will fix reading of special Eclipse cases related to synthetic ODB test cases. Required for regression testing.