diff --git a/ApplicationLibCode/CommandFileInterface/CMakeLists_files.cmake b/ApplicationLibCode/CommandFileInterface/CMakeLists_files.cmake index 093858fdeb..a64e24d426 100644 --- a/ApplicationLibCode/CommandFileInterface/CMakeLists_files.cmake +++ b/ApplicationLibCode/CommandFileInterface/CMakeLists_files.cmake @@ -5,7 +5,6 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicfExportMsw.h ${CMAKE_CURRENT_LIST_DIR}/RicfExportMultiCaseSnapshots.h ${CMAKE_CURRENT_LIST_DIR}/RicfExportProperty.h - ${CMAKE_CURRENT_LIST_DIR}/RicfExportSimWellFractureCompletions.h ${CMAKE_CURRENT_LIST_DIR}/RicfExportSnapshots.h ${CMAKE_CURRENT_LIST_DIR}/RicfExportWellPathCompletions.h ${CMAKE_CURRENT_LIST_DIR}/RicfLoadCase.h @@ -46,7 +45,6 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicfExportMsw.cpp ${CMAKE_CURRENT_LIST_DIR}/RicfExportMultiCaseSnapshots.cpp ${CMAKE_CURRENT_LIST_DIR}/RicfExportProperty.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicfExportSimWellFractureCompletions.cpp ${CMAKE_CURRENT_LIST_DIR}/RicfExportSnapshots.cpp ${CMAKE_CURRENT_LIST_DIR}/RicfExportWellPathCompletions.cpp ${CMAKE_CURRENT_LIST_DIR}/RicfLoadCase.cpp diff --git a/ApplicationLibCode/CommandFileInterface/RicfExportSimWellFractureCompletions.cpp b/ApplicationLibCode/CommandFileInterface/RicfExportSimWellFractureCompletions.cpp deleted file mode 100644 index 69018158a6..0000000000 --- a/ApplicationLibCode/CommandFileInterface/RicfExportSimWellFractureCompletions.cpp +++ /dev/null @@ -1,156 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// 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 "RicfExportSimWellFractureCompletions.h" - -#include "RicfApplicationTools.h" -#include "RicfCommandFileExecutor.h" - -#include "RiaApplication.h" -#include "RiaLogging.h" - -#include "RimDialogData.h" -#include "RimEclipseCase.h" -#include "RimEclipseCaseCollection.h" -#include "RimEclipseView.h" -#include "RimOilField.h" -#include "RimProject.h" -#include "RimSimWellInView.h" -#include "RimSimWellInViewCollection.h" -#include "RimWellPath.h" -#include "RimWellPathCollection.h" - -#include "CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.h" - -#include "cafPdmFieldScriptingCapability.h" - -CAF_PDM_SOURCE_INIT( RicfExportSimWellFractureCompletions, "exportSimWellFractureCompletions" ); - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RicfExportSimWellFractureCompletions::RicfExportSimWellFractureCompletions() -{ - CAF_PDM_InitScriptableField( &m_caseId, "caseId", -1, "Case ID" ); - CAF_PDM_InitScriptableField( &m_viewId, "viewId", -1, "View ID" ); - CAF_PDM_InitScriptableField( &m_viewName, "viewName", QString( "" ), "View Name" ); - CAF_PDM_InitScriptableField( &m_timeStep, "timeStep", -1, "Time Step Index" ); - CAF_PDM_InitScriptableField( &m_simWellNames, "simulationWellNames", std::vector(), "Simulation Well Names" ); - CAF_PDM_InitScriptableField( &m_fileSplit, "fileSplit", RicExportCompletionDataSettingsUi::ExportSplitType(), "File Split" ); - CAF_PDM_InitScriptableField( &m_compdatExport, "compdatExport", RicExportCompletionDataSettingsUi::CompdatExportType(), "Compdat Export" ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -caf::PdmScriptResponse RicfExportSimWellFractureCompletions::execute() -{ - using TOOLS = RicfApplicationTools; - - RicExportCompletionDataSettingsUi exportSettings; - - exportSettings.timeStep = m_timeStep; - exportSettings.fileSplit = m_fileSplit; - exportSettings.compdatExport = m_compdatExport; - exportSettings.setExportDataSourceAsComment( true ); - - { - auto eclipseCase = TOOLS::caseFromId( m_caseId() ); - if ( !eclipseCase ) - { - QString error = QString( "exportSimWellCompletions: Could not find case with ID %1" ).arg( m_caseId() ); - RiaLogging::error( error ); - return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error ); - } - exportSettings.caseToApply = eclipseCase; - } - - QString exportFolder = RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::ExportType::COMPLETIONS ); - if ( exportFolder.isNull() ) - { - exportFolder = RiaApplication::instance()->createAbsolutePathFromProjectRelativePath( "completions" ); - } - exportSettings.folder = exportFolder; - - std::vector views; - for ( Rim3dView* v : exportSettings.caseToApply->views() ) - { - RimEclipseView* eclipseView = dynamic_cast( v ); - if ( eclipseView && ( eclipseView->id() == m_viewId() || eclipseView->name() == m_viewName() ) ) - { - views.push_back( eclipseView ); - } - } - if ( views.empty() ) - { - QString error = QString( "exportSimWellCompletions: Could not find any views with id %1 or named \"%2\" in the " - "case with ID %3" ) - .arg( m_viewId ) - .arg( m_viewName ) - .arg( m_caseId() ); - RiaLogging::error( error ); - return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, error ); - } - - caf::PdmScriptResponse response; - - std::vector simWells; - if ( m_simWellNames().empty() ) - { - for ( RimEclipseView* view : views ) - { - for ( auto simWell : view->wellCollection()->wells ) - { - if ( simWell->showWell() ) - { - simWells.push_back( simWell ); - } - } - } - } - else - { - for ( const QString& wellPathName : m_simWellNames() ) - { - for ( RimEclipseView* view : views ) - { - RimSimWellInView* simWell = view->wellCollection()->findWell( wellPathName ); - if ( simWell ) - { - simWells.push_back( simWell ); - } - else - { - QString warning = QString( "exportSimWellCompletions: Could not find well with name %1 in view " - "\"%2\" on case with ID %2" ) - .arg( wellPathName ) - .arg( m_viewName ) - .arg( m_caseId() ); - RiaLogging::warning( warning ); - response.updateStatus( caf::PdmScriptResponse::COMMAND_WARNING, warning ); - } - } - } - } - - std::vector wellPaths; - - RicWellPathExportCompletionDataFeatureImpl::exportCompletions( wellPaths, simWells, exportSettings ); - - return response; -} diff --git a/ApplicationLibCode/CommandFileInterface/RicfExportSimWellFractureCompletions.h b/ApplicationLibCode/CommandFileInterface/RicfExportSimWellFractureCompletions.h deleted file mode 100644 index 086b8c1312..0000000000 --- a/ApplicationLibCode/CommandFileInterface/RicfExportSimWellFractureCompletions.h +++ /dev/null @@ -1,50 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// 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 "RicfCommandObject.h" - -#include "CompletionExportCommands/RicExportCompletionDataSettingsUi.h" - -#include "cafPdmField.h" - -//================================================================================================== -// -// -// -//================================================================================================== -class RicfExportSimWellFractureCompletions : public RicfCommandObject -{ - CAF_PDM_HEADER_INIT; - -public: - RicfExportSimWellFractureCompletions(); - - caf::PdmScriptResponse execute() override; - -private: - caf::PdmField m_caseId; - caf::PdmField m_viewId; - caf::PdmField m_viewName; - caf::PdmField m_timeStep; - caf::PdmField> m_simWellNames; - - caf::PdmField m_fileSplit; - caf::PdmField m_compdatExport; -}; diff --git a/ApplicationLibCode/CommandFileInterface/RicfExportWellPathCompletions.cpp b/ApplicationLibCode/CommandFileInterface/RicfExportWellPathCompletions.cpp index 3ddc780787..5f38308b4f 100644 --- a/ApplicationLibCode/CommandFileInterface/RicfExportWellPathCompletions.cpp +++ b/ApplicationLibCode/CommandFileInterface/RicfExportWellPathCompletions.cpp @@ -187,9 +187,7 @@ caf::PdmScriptResponse RicfExportWellPathCompletions::execute() } } - std::vector simWells; - - RicWellPathExportCompletionDataFeatureImpl::exportCompletions( wellPaths, simWells, exportSettings ); + RicWellPathExportCompletionDataFeatureImpl::exportCompletions( wellPaths, exportSettings ); return response; } diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/CompletionExportCommands/CMakeLists_files.cmake index dcba2afae4..0b3de886ba 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/CompletionExportCommands/CMakeLists_files.cmake @@ -9,7 +9,6 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicCaseAndFileExportSettingsUi.h ${CMAKE_CURRENT_LIST_DIR}/RicExportFractureCompletionsImpl.h ${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForVisibleWellPathsFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForVisibleSimWellsFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicMswBranch.h ${CMAKE_CURRENT_LIST_DIR}/RicMswCompletions.h ${CMAKE_CURRENT_LIST_DIR}/RicMswExportInfo.h @@ -34,7 +33,6 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicCaseAndFileExportSettingsUi.cpp ${CMAKE_CURRENT_LIST_DIR}/RicExportFractureCompletionsImpl.cpp ${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForVisibleWellPathsFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForVisibleSimWellsFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicMswBranch.cpp ${CMAKE_CURRENT_LIST_DIR}/RicMswCompletions.cpp ${CMAKE_CURRENT_LIST_DIR}/RicMswExportInfo.cpp diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionDataSettingsUi.cpp b/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionDataSettingsUi.cpp index 0cbd13dbe9..03809b2ac9 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionDataSettingsUi.cpp +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionDataSettingsUi.cpp @@ -112,8 +112,6 @@ RicExportCompletionDataSettingsUi::RicExportCompletionDataSettingsUi() CAF_PDM_InitField( &m_useCustomFileName, "UseCustomFileName", false, "Use Custom Filename" ); CAF_PDM_InitField( &m_customFileName, "CustomFileName", {}, "Custom Filename" ); - m_displayForSimWell = true; - m_fracturesEnabled = true; m_perforationsEnabled = true; m_fishbonesEnabled = true; @@ -127,22 +125,6 @@ void RicExportCompletionDataSettingsUi::enableIncludeMsw() includeMsw = true; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RicExportCompletionDataSettingsUi::showForSimWells() -{ - m_displayForSimWell = true; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RicExportCompletionDataSettingsUi::showForWellPath() -{ - m_displayForSimWell = false; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -381,17 +363,14 @@ void RicExportCompletionDataSettingsUi::defineUiOrdering( QString uiConfigName, { caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Completions Export Selection" ); - if ( !m_displayForSimWell ) + if ( m_perforationsEnabled ) { - if ( m_perforationsEnabled ) - { - group->add( &includePerforations ); - group->add( &timeStep ); - if ( !includePerforations ) - timeStep.uiCapability()->setUiReadOnly( true ); - else - timeStep.uiCapability()->setUiReadOnly( false ); - } + group->add( &includePerforations ); + group->add( &timeStep ); + if ( !includePerforations ) + timeStep.uiCapability()->setUiReadOnly( true ); + else + timeStep.uiCapability()->setUiReadOnly( false ); } if ( m_fracturesEnabled ) @@ -442,19 +421,16 @@ void RicExportCompletionDataSettingsUi::defineUiOrdering( QString uiConfigName, !includeMsw ); } - if ( !m_displayForSimWell ) + if ( m_fishbonesEnabled ) { - if ( m_fishbonesEnabled ) - { - group->add( &includeFishbones ); - group->add( &excludeMainBoreForFishbones ); + group->add( &includeFishbones ); + group->add( &excludeMainBoreForFishbones ); - // Set visibility - if ( !includeFishbones ) - excludeMainBoreForFishbones.uiCapability()->setUiReadOnly( true ); - else - excludeMainBoreForFishbones.uiCapability()->setUiReadOnly( false ); - } + // Set visibility + if ( !includeFishbones ) + excludeMainBoreForFishbones.uiCapability()->setUiReadOnly( true ); + else + excludeMainBoreForFishbones.uiCapability()->setUiReadOnly( false ); } } diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionDataSettingsUi.h b/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionDataSettingsUi.h index 5d425deefc..d491c0d6f4 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionDataSettingsUi.h +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionDataSettingsUi.h @@ -81,8 +81,6 @@ public: caf::PdmField includeFractures; void enableIncludeMsw(); - void showForSimWells(); - void showForWellPath(); void setCombinationMode( CombinationMode combinationMode ); @@ -121,7 +119,6 @@ private: caf::PdmField m_useCustomFileName; caf::PdmField m_customFileName; - bool m_displayForSimWell; bool m_fracturesEnabled; bool m_perforationsEnabled; bool m_fishbonesEnabled; diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionsForTemporaryLgrsFeature.cpp b/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionsForTemporaryLgrsFeature.cpp index c649af87cf..e1f6ec64b1 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionsForTemporaryLgrsFeature.cpp +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionsForTemporaryLgrsFeature.cpp @@ -61,10 +61,8 @@ void RicExportCompletionsForTemporaryLgrsFeature::onActionTriggered( bool isChec return; } - std::vector simWells; - QString dialogTitle = "Export Completion Data for Temporary LGRs"; - - RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompletions( dialogTitle, wellPaths, simWells ); + QString dialogTitle = "Export Completion Data for Temporary LGRs"; + RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompletions( dialogTitle, wellPaths ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionsForVisibleSimWellsFeature.cpp b/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionsForVisibleSimWellsFeature.cpp deleted file mode 100644 index 276b9b3895..0000000000 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionsForVisibleSimWellsFeature.cpp +++ /dev/null @@ -1,107 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// 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 "RicExportCompletionsForVisibleSimWellsFeature.h" - -#include "RicWellPathExportCompletionDataFeature.h" - -#include "RimSimWellInView.h" -#include "RimSimWellInViewCollection.h" - -#include "cafSelectionManager.h" - -#include - -CAF_CMD_SOURCE_INIT( RicExportCompletionsForVisibleSimWellsFeature, "RicExportCompletionsForVisibleSimWellsFeature" ); - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RicExportCompletionsForVisibleSimWellsFeature::isCommandEnabled() const -{ - std::vector simWells = visibleSimWells(); - - return !simWells.empty(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RicExportCompletionsForVisibleSimWellsFeature::onActionTriggered( bool isChecked ) -{ - std::vector simWells = visibleSimWells(); - CVF_ASSERT( !simWells.empty() ); - - std::vector wellPaths; - QString dialogTitle = "Export Completion Data for Visible Simulation Wells"; - - RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompletions( dialogTitle, wellPaths, simWells ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RicExportCompletionsForVisibleSimWellsFeature::setupActionLook( QAction* actionToSetup ) -{ - actionToSetup->setText( "Export Completion Data for Visible Simulation Wells" ); - actionToSetup->setIcon( QIcon( ":/ExportCompletionsSymbol16x16.png" ) ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -std::vector RicExportCompletionsForVisibleSimWellsFeature::visibleSimWells() -{ - std::vector simWells; - - { - std::vector simWellCollection; - caf::SelectionManager::instance()->objectsByType( &simWellCollection ); - - if ( simWellCollection.empty() ) - { - std::vector selectedSimWells; - caf::SelectionManager::instance()->objectsByType( &selectedSimWells ); - - if ( !selectedSimWells.empty() ) - { - RimSimWellInViewCollection* parent = selectedSimWells[0]->firstAncestorOrThisOfType(); - if ( parent ) - { - simWellCollection.push_back( parent ); - } - } - } - - for ( auto coll : simWellCollection ) - { - for ( const auto& wellPath : coll->wells() ) - { - if ( wellPath->showWell() ) - { - simWells.push_back( wellPath ); - } - } - } - } - - std::set uniqueWellPaths( simWells.begin(), simWells.end() ); - simWells.assign( uniqueWellPaths.begin(), uniqueWellPaths.end() ); - - return simWells; -} diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionsForVisibleSimWellsFeature.h b/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionsForVisibleSimWellsFeature.h deleted file mode 100644 index 973fa317ce..0000000000 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionsForVisibleSimWellsFeature.h +++ /dev/null @@ -1,39 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// 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 RimSimWellInView; - -//================================================================================================== -/// -//================================================================================================== -class RicExportCompletionsForVisibleSimWellsFeature : public caf::CmdFeature -{ - CAF_CMD_HEADER_INIT; - -protected: - bool isCommandEnabled() const override; - void onActionTriggered( bool isChecked ) override; - void setupActionLook( QAction* actionToSetup ) override; - -private: - static std::vector visibleSimWells(); -}; diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionsForVisibleWellPathsFeature.cpp b/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionsForVisibleWellPathsFeature.cpp index dd77bb0a27..52dc3f982b 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionsForVisibleWellPathsFeature.cpp +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionsForVisibleWellPathsFeature.cpp @@ -71,10 +71,8 @@ void RicExportCompletionsForVisibleWellPathsFeature::onActionTriggered( bool isC std::vector wellPaths = visibleWellPaths(); if ( wellPaths.empty() ) return RiaLogging::warning( "No visible well paths found, no data exported." ); - std::vector simWells; - QString dialogTitle = "Export Completion Data for Visible Well Paths"; - - RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompletions( dialogTitle, wellPaths, simWells ); + QString dialogTitle = "Export Completion Data for Visible Well Paths"; + RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompletions( dialogTitle, wellPaths ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.cpp b/ApplicationLibCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.cpp index 5fe2c9c0c8..45028fb597 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.cpp +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.cpp @@ -35,9 +35,6 @@ #include "RimObservedEclipseUserData.h" #include "RimProject.h" #include "RimReloadCaseTools.h" -#include "RimSimWellFracture.h" -#include "RimSimWellFractureCollection.h" -#include "RimSimWellInView.h" #include "RimStimPlanFractureTemplate.h" #include "RimSummaryCase.h" #include "RimWellPath.h" @@ -97,46 +94,6 @@ std::vector pdParams ); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -std::vector - RicExportFractureCompletionsImpl::generateCompdatValuesForSimWell( RimEclipseCase* eclipseCase, - const RimSimWellInView* well, - QTextStream* outputStreamForIntermediateResultsText, - PressureDepletionParameters pdParams ) -{ - std::vector completionData; - - auto branches = well->wellPipeBranches(); - - for ( size_t branchIndex = 0; branchIndex < branches.size(); ++branchIndex ) - { - std::vector fractures; - for ( RimSimWellFracture* fracture : well->simwellFractureCollection->simwellFractures() ) - { - if ( fracture->isChecked() && static_cast( fracture->branchIndex() ) == branchIndex ) - { - fracture->ensureValidNonDarcyProperties(); - - fractures.push_back( fracture ); - } - } - - std::vector branchCompletions = generateCompdatValues( eclipseCase, - well->name(), - branches[branchIndex], - fractures, - nullptr, - outputStreamForIntermediateResultsText, - pdParams ); - - completionData.insert( completionData.end(), branchCompletions.begin(), branchCompletions.end() ); - } - - return completionData; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.h b/ApplicationLibCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.h index 5efa699f29..684f8746c1 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.h +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.h @@ -37,7 +37,6 @@ class RigCaseCellResultsData; class RimEclipseCase; class RimFracture; class RimFractureTemplate; -class RimSimWellInView; class RimWellPath; class QTextStream; @@ -84,12 +83,6 @@ public: QTextStream* outputStreamForIntermediateResultsText, PressureDepletionParameters pdParams = PressureDepletionParameters() ); - static std::vector - generateCompdatValuesForSimWell( RimEclipseCase* eclipseCase, - const RimSimWellInView* well, - QTextStream* outputStreamForIntermediateResultsText, - PressureDepletionParameters pdParams = PressureDepletionParameters() ); - static std::vector generateCompdatValues( RimEclipseCase* caseToApply, const QString& wellNameForExport, const RigWellPath* wellPathGeometry, diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeature.cpp b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeature.cpp index 9618f4a790..a864ff7fe1 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeature.cpp +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeature.cpp @@ -29,9 +29,6 @@ #include "RimFishbones.h" #include "RimPerforationInterval.h" #include "RimProject.h" -#include "RimSimWellFracture.h" -#include "RimSimWellInView.h" -#include "RimSimWellInViewCollection.h" #include "RimWellPath.h" #include "RimWellPathCollection.h" #include "RimWellPathCompletions.h" @@ -51,9 +48,8 @@ CAF_CMD_SOURCE_INIT( RicWellPathExportCompletionDataFeature, "RicWellPathExportC //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompletions( const QString& dialogTitle, - const std::vector& wellPaths, - const std::vector& simWells ) +void RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompletions( const QString& dialogTitle, + const std::vector& wellPaths ) { RiaApplication* app = RiaApplication::instance(); RimProject* project = app->project(); @@ -61,15 +57,6 @@ void RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompl RicExportCompletionDataSettingsUi* exportSettings = project->dialogData()->exportCompletionData(); - if ( wellPaths.empty() ) - { - exportSettings->showForSimWells(); - } - else - { - exportSettings->showForWellPath(); - } - if ( !exportSettings->caseToApply() ) { std::vector cases = app->project()->allGridCases(); @@ -86,17 +73,10 @@ void RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompl if ( exportSettings->folder().isEmpty() ) exportSettings->folder = defaultDir; - std::vector simWellFractures; std::vector wellPathFractures; std::vector wellPathFishbones; std::vector wellPathPerforations; - for ( auto s : simWells ) - { - auto fratures = s->descendantsIncludingThisOfType(); - simWellFractures.insert( simWellFractures.end(), fratures.begin(), fratures.end() ); - } - std::vector topLevelWells; { std::set myWells; @@ -137,7 +117,7 @@ void RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompl wellPathPerforations.insert( wellPathPerforations.end(), perforations.begin(), perforations.end() ); } - if ( ( !simWellFractures.empty() ) || ( !wellPathFractures.empty() ) ) + if ( !wellPathFractures.empty() ) { exportSettings->showFractureInUi( true ); } @@ -194,7 +174,7 @@ void RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompl RiaApplication::instance()->setLastUsedDialogDirectory( "COMPLETIONS", exportSettings->folder ); - RicWellPathExportCompletionDataFeatureImpl::exportCompletions( topLevelWells, simWells, *exportSettings ); + RicWellPathExportCompletionDataFeatureImpl::exportCompletions( topLevelWells, *exportSettings ); } } @@ -216,10 +196,8 @@ void RicWellPathExportCompletionDataFeature::onActionTriggered( bool isChecked ) std::vector wellPaths = selectedWellPaths(); CVF_ASSERT( !wellPaths.empty() ); - std::vector simWells; - QString dialogTitle = "Export Completion Data for Selected Well Paths"; - - RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompletions( dialogTitle, wellPaths, simWells ); + QString dialogTitle = "Export Completion Data for Selected Well Paths"; + RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompletions( dialogTitle, wellPaths ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeature.h b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeature.h index b74182ec34..23b82a52a9 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeature.h +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeature.h @@ -31,9 +31,7 @@ class RicWellPathExportCompletionDataFeature : public caf::CmdFeature CAF_CMD_HEADER_INIT; public: - static void prepareExportSettingsAndExportCompletions( const QString& dialogTitle, - const std::vector& wellPaths, - const std::vector& simWells ); + static void prepareExportSettingsAndExportCompletions( const QString& dialogTitle, const std::vector& wellPaths ); protected: bool isCommandEnabled() const override; diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp index 9788290fa4..a670e5220c 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp @@ -88,7 +88,6 @@ /// //-------------------------------------------------------------------------------------------------- void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::vector& wellPaths, - const std::vector& simWells, const RicExportCompletionDataSettingsUi& exportSettings ) { if ( exportSettings.caseToApply() == nullptr ) @@ -281,28 +280,6 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v } } - for ( auto simWell : simWells ) - { - std::map> completionsPerEclipseCell; - - std::vector fractureCompletionData = RicExportFractureCompletionsImpl:: - generateCompdatValuesForSimWell( exportSettings.caseToApply(), - simWell, - fractureTransmissibilityExportInformationStream.get(), - RicExportFractureCompletionsImpl:: - PressureDepletionParameters( exportSettings.performTransScaling(), - exportSettings.transScalingTimeStep(), - exportSettings.transScalingWBHPSource(), - exportSettings.transScalingWBHP() ) ); - - appendCompletionData( &completionsPerEclipseCell, fractureCompletionData ); - - for ( auto& data : completionsPerEclipseCell ) - { - completions.push_back( combineEclipseCellCompletions( data.second, exportSettings ) ); - } - } - const QString eclipseCaseName = exportSettings.caseToApply->caseUserDescription(); if ( exportSettings.fileSplit == RicExportCompletionDataSettingsUi::ExportSplit::UNIFIED_FILE ) @@ -413,35 +390,6 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v } } } - - // Export sim wells - if ( exportSettings.fileSplit == RicExportCompletionDataSettingsUi::ExportSplit::SPLIT_ON_WELL || - exportSettings.fileSplit == RicExportCompletionDataSettingsUi::ExportSplit::SPLIT_ON_WELL_AND_COMPLETION_TYPE ) - { - for ( auto simWell : simWells ) - { - std::vector wellCompletions; - for ( const auto& completion : completions ) - { - if ( completion.wellName() == simWell->name() ) - { - wellCompletions.push_back( completion ); - } - } - - if ( wellCompletions.empty() ) continue; - - QString fileName = QString( "%1_Fractures_%2" ).arg( simWell->name() ).arg( eclipseCaseName ); - sortAndExportCompletionsToFile( exportSettings.caseToApply, - exportSettings.folder, - fileName, - wellCompletions, - fractureDataReportItems, - exportSettings.compdatExport, - exportSettings.exportDataSourceAsComment(), - exportSettings.exportWelspec() ); - } - } } if ( exportSettings.includeMsw ) diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.h b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.h index 7668f3e278..45bc91dfda 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.h +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.h @@ -38,7 +38,6 @@ class RigEclipseCaseData; class RigMainGrid; class RimEclipseCase; class RimFishbones; -class RimSimWellInView; class RimPerforationInterval; class RimWellPath; class RimWellPathValve; @@ -117,9 +116,7 @@ public: const RimNonDarcyPerforationParameters* nonDarcyParameters, const double effectivePermeability ); - static void exportCompletions( const std::vector& wellPaths, - const std::vector& simWells, - const RicExportCompletionDataSettingsUi& exportSettings ); + static void exportCompletions( const std::vector& wellPaths, const RicExportCompletionDataSettingsUi& exportSettings ); static std::vector computeStaticCompletionsForWellPath( RimWellPath* wellPath, RimEclipseCase* eclipseCase ); diff --git a/ApplicationLibCode/Commands/FractureCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/FractureCommands/CMakeLists_files.cmake index f3a910e4d5..7b52181305 100644 --- a/ApplicationLibCode/Commands/FractureCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/FractureCommands/CMakeLists_files.cmake @@ -6,8 +6,6 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicCreateDuplicateTemplateInOtherUnitSystemFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicFractureNameGenerator.h ${CMAKE_CURRENT_LIST_DIR}/RicNewEllipseFractureTemplateFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicNewSimWellFractureAtPosFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicNewSimWellFractureFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanFractureTemplateFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicNewThermalFractureTemplateFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureAtPosFeature.h @@ -32,8 +30,6 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicCreateDuplicateTemplateInOtherUnitSystemFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicFractureNameGenerator.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewEllipseFractureTemplateFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicNewSimWellFractureAtPosFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicNewSimWellFractureFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanFractureTemplateFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewThermalFractureTemplateFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureAtPosFeature.cpp diff --git a/ApplicationLibCode/Commands/FractureCommands/RicNewSimWellFractureAtPosFeature.cpp b/ApplicationLibCode/Commands/FractureCommands/RicNewSimWellFractureAtPosFeature.cpp deleted file mode 100644 index dd21cf7e95..0000000000 --- a/ApplicationLibCode/Commands/FractureCommands/RicNewSimWellFractureAtPosFeature.cpp +++ /dev/null @@ -1,143 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// 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 "RicNewSimWellFractureAtPosFeature.h" - -#include "RiaApplication.h" -#include "RigEclipseCaseData.h" - -#include "Rim3dView.h" -#include "RimCase.h" -#include "RimEclipseResultCase.h" -#include "RimEclipseView.h" -#include "RimEllipseFractureTemplate.h" -#include "RimFractureTemplateCollection.h" -#include "RimOilField.h" -#include "RimProject.h" -#include "RimSimWellFracture.h" -#include "RimSimWellFractureCollection.h" -#include "RimSimWellInView.h" -#include "RimStimPlanColors.h" - -#include "Riu3DMainWindowTools.h" -#include "Riu3dSelectionManager.h" -#include "RivSimWellPipeSourceInfo.h" - -#include "cafSelectionManager.h" - -#include "cvfAssert.h" - -#include - -CAF_CMD_SOURCE_INIT( RicNewSimWellFractureAtPosFeature, "RicNewSimWellFractureAtPosFeature" ); - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RicNewSimWellFractureAtPosFeature::onActionTriggered( bool isChecked ) -{ - RimProject* proj = RimProject::current(); - if ( proj->allFractureTemplates().empty() ) return; - - Rim3dView* activeView = RiaApplication::instance()->activeReservoirView(); - if ( !activeView ) return; - - Riu3dSelectionManager* riuSelManager = Riu3dSelectionManager::instance(); - RiuSelectionItem* selItem = riuSelManager->selectedItem( Riu3dSelectionManager::RUI_TEMPORARY ); - - RiuSimWellSelectionItem* simWellItem = static_cast( selItem ); - if ( !simWellItem ) return; - - RimSimWellInView* simWell = simWellItem->m_simWell; - if ( !simWell ) return; - - RimSimWellFractureCollection* fractureCollection = simWell->simwellFractureCollection(); - if ( !fractureCollection ) return; - - RimSimWellFracture* fracture = new RimSimWellFracture(); - if ( fractureCollection->simwellFractures.empty() ) - { - RimEclipseView* eclipseView = dynamic_cast( RiaApplication::instance()->activeReservoirView() ); - if ( eclipseView ) - { - eclipseView->fractureColors()->setDefaultResultName(); - } - } - - fractureCollection->simwellFractures.push_back( fracture ); - - fracture->setClosestWellCoord( simWellItem->m_domainCoord, simWellItem->m_branchIndex ); - - RimOilField* oilfield = RimProject::current()->activeOilField(); - if ( !oilfield ) return; - - std::vector oldFractures = oilfield->descendantsIncludingThisOfType(); - QString fracNum = QString( "%1" ).arg( oldFractures.size(), 2, 10, QChar( '0' ) ); - - fracture->setName( QString( "Fracture_" ) + fracNum ); - - auto unitSet = RiaDefines::EclipseUnitSystem::UNITS_UNKNOWN; - { - RimEclipseResultCase* eclipseCase = simWell->firstAncestorOrThisOfType(); - if ( eclipseCase ) - { - unitSet = eclipseCase->eclipseCaseData()->unitsType(); - } - - fracture->setFractureUnit( unitSet ); - } - - RimFractureTemplate* fracDef = oilfield->fractureDefinitionCollection()->firstFractureOfUnit( unitSet ); - fracture->setFractureTemplate( fracDef ); - - simWell->updateConnectedEditors(); - - activeView->scheduleCreateDisplayModelAndRedraw(); - - auto eclipseCase = simWell->firstAncestorOrThisOfType(); - if ( eclipseCase ) - { - proj->reloadCompletionTypeResultsForEclipseCase( eclipseCase ); - fractureCollection->updateConnectedEditors(); - } - Riu3DMainWindowTools::selectAsCurrentItem( fracture ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RicNewSimWellFractureAtPosFeature::setupActionLook( QAction* actionToSetup ) -{ - actionToSetup->setIcon( QIcon( ":/FractureSymbol16x16.png" ) ); - actionToSetup->setText( "Create Fracture" ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RicNewSimWellFractureAtPosFeature::isCommandEnabled() const -{ - RimProject* proj = RimProject::current(); - if ( proj->allFractureTemplates().empty() ) return false; - - auto objHandle = caf::SelectionManager::instance()->selectedItemOfType(); - if ( !objHandle ) return false; - - RimSimWellInView* eclipseWell = objHandle->firstAncestorOrThisOfType(); - return eclipseWell != nullptr; -} diff --git a/ApplicationLibCode/Commands/FractureCommands/RicNewSimWellFractureAtPosFeature.h b/ApplicationLibCode/Commands/FractureCommands/RicNewSimWellFractureAtPosFeature.h deleted file mode 100644 index 18437a7ac3..0000000000 --- a/ApplicationLibCode/Commands/FractureCommands/RicNewSimWellFractureAtPosFeature.h +++ /dev/null @@ -1,36 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// 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" - -#include - -//================================================================================================== -/// -//================================================================================================== -class RicNewSimWellFractureAtPosFeature : public caf::CmdFeature -{ - CAF_CMD_HEADER_INIT; - -protected: - void onActionTriggered( bool isChecked ) override; - void setupActionLook( QAction* actionToSetup ) override; - bool isCommandEnabled() const override; -}; diff --git a/ApplicationLibCode/Commands/FractureCommands/RicNewSimWellFractureFeature.cpp b/ApplicationLibCode/Commands/FractureCommands/RicNewSimWellFractureFeature.cpp deleted file mode 100644 index ce7a15c5d3..0000000000 --- a/ApplicationLibCode/Commands/FractureCommands/RicNewSimWellFractureFeature.cpp +++ /dev/null @@ -1,127 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// 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 "RicNewSimWellFractureFeature.h" - -#include "RicFractureNameGenerator.h" - -#include "RiaApplication.h" -#include "RigEclipseCaseData.h" - -#include "RimCase.h" -#include "RimEclipseCase.h" -#include "RimEclipseResultCase.h" -#include "RimEclipseView.h" -#include "RimEllipseFractureTemplate.h" -#include "RimFractureTemplateCollection.h" -#include "RimOilField.h" -#include "RimProject.h" -#include "RimSimWellFracture.h" -#include "RimSimWellFractureCollection.h" -#include "RimSimWellInView.h" -#include "RimStimPlanColors.h" - -#include "Riu3DMainWindowTools.h" - -#include "cafSelectionManager.h" - -#include "cvfAssert.h" - -#include - -CAF_CMD_SOURCE_INIT( RicNewSimWellFractureFeature, "RicNewSimWellFractureFeature" ); - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RicNewSimWellFractureFeature::onActionTriggered( bool isChecked ) -{ - RimProject* proj = RimProject::current(); - if ( proj->allFractureTemplates().empty() ) return; - - auto objHandle = caf::SelectionManager::instance()->selectedItemOfType(); - if ( !objHandle ) return; - - auto eclipseWell = objHandle->firstAncestorOrThisOfType(); - - RimSimWellFracture* fracture = new RimSimWellFracture(); - if ( eclipseWell->simwellFractureCollection()->simwellFractures.empty() ) - { - RimEclipseView* activeView = dynamic_cast( RiaApplication::instance()->activeReservoirView() ); - if ( activeView ) - { - activeView->fractureColors()->setDefaultResultName(); - } - } - - eclipseWell->simwellFractureCollection()->simwellFractures.push_back( fracture ); - - auto oilfield = objHandle->firstAncestorOrThisOfType(); - if ( !oilfield ) return; - - fracture->setName( RicFractureNameGenerator::nameForNewFracture() ); - - auto unitSet = RiaDefines::EclipseUnitSystem::UNITS_UNKNOWN; - { - auto eclipseCase = objHandle->firstAncestorOrThisOfType(); - if ( eclipseCase ) - { - unitSet = eclipseCase->eclipseCaseData()->unitsType(); - } - fracture->setFractureUnit( unitSet ); - } - - RimFractureTemplate* fracDef = oilfield->fractureDefinitionCollection()->firstFractureOfUnit( unitSet ); - fracture->setFractureTemplate( fracDef ); - - fracture->updateFracturePositionFromLocation(); - - eclipseWell->updateConnectedEditors(); - - auto eclipseCase = objHandle->firstAncestorOrThisOfType(); - if ( eclipseCase ) - { - proj->reloadCompletionTypeResultsForEclipseCase( eclipseCase ); - eclipseWell->simwellFractureCollection()->updateConnectedEditors(); - } - Riu3DMainWindowTools::selectAsCurrentItem( fracture ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RicNewSimWellFractureFeature::setupActionLook( QAction* actionToSetup ) -{ - actionToSetup->setIcon( QIcon( ":/FractureSymbol16x16.png" ) ); - actionToSetup->setText( "New Fracture" ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RicNewSimWellFractureFeature::isCommandEnabled() const -{ - RimProject* proj = RimProject::current(); - if ( proj->allFractureTemplates().empty() ) return false; - - auto objHandle = caf::SelectionManager::instance()->selectedItemOfType(); - if ( !objHandle ) return false; - - auto simWell = objHandle->firstAncestorOrThisOfType(); - return simWell != nullptr; -} diff --git a/ApplicationLibCode/Commands/FractureCommands/RicNewSimWellFractureFeature.h b/ApplicationLibCode/Commands/FractureCommands/RicNewSimWellFractureFeature.h deleted file mode 100644 index 3360ff858a..0000000000 --- a/ApplicationLibCode/Commands/FractureCommands/RicNewSimWellFractureFeature.h +++ /dev/null @@ -1,36 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// 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" - -#include - -//================================================================================================== -/// -//================================================================================================== -class RicNewSimWellFractureFeature : public caf::CmdFeature -{ - CAF_CMD_HEADER_INIT; - -protected: - void onActionTriggered( bool isChecked ) override; - void setupActionLook( QAction* actionToSetup ) override; - bool isCommandEnabled() const override; -}; diff --git a/ApplicationLibCode/ProjectDataModel/Completions/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/Completions/CMakeLists_files.cmake index 08f2ca8585..17be67f32c 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/Completions/CMakeLists_files.cmake @@ -19,8 +19,6 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimFractureTemplateCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimValveTemplateCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimValveTemplate.h - ${CMAKE_CURRENT_LIST_DIR}/RimSimWellFracture.h - ${CMAKE_CURRENT_LIST_DIR}/RimSimWellFractureCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimMeshFractureTemplate.h ${CMAKE_CURRENT_LIST_DIR}/RimThermalFractureTemplate.h ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanFractureTemplate.h @@ -56,8 +54,6 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimFractureTemplateCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimValveTemplateCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimValveTemplate.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimSimWellFracture.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimSimWellFractureCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimMeshFractureTemplate.cpp ${CMAKE_CURRENT_LIST_DIR}/RimThermalFractureTemplate.cpp ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanFractureTemplate.cpp diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimSimWellFracture.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimSimWellFracture.cpp deleted file mode 100644 index c027cac759..0000000000 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimSimWellFracture.cpp +++ /dev/null @@ -1,368 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// 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 "RimSimWellFracture.h" - -#include "RigCell.h" -#include "RigMainGrid.h" -#include "Well/RigSimWellData.h" -#include "Well/RigSimulationWellCenterLineCalculator.h" -#include "Well/RigWellPath.h" -#include "Well/RigWellResultPoint.h" - -#include "RimEclipseView.h" -#include "RimEllipseFractureTemplate.h" -#include "RimFracture.h" -#include "RimFractureTemplate.h" -#include "RimProject.h" -#include "RimSimWellInView.h" - -#include "cafPdmUiDoubleSliderEditor.h" - -CAF_PDM_SOURCE_INIT( RimSimWellFracture, "SimWellFracture" ); - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RimSimWellFracture::RimSimWellFracture() -{ - CAF_PDM_InitObject( "SimWellFracture", ":/FractureSymbol16x16.png" ); - - CAF_PDM_InitField( &m_location, "MeasuredDepth", 0.0f, "Pseudo Length Location" ); - m_location.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() ); - - CAF_PDM_InitFieldNoDefault( &m_displayIJK, "Cell_IJK", "Cell IJK" ); - m_displayIJK.registerGetMethod( this, &RimSimWellFracture::createOneBasedIJKText ); - m_displayIJK.uiCapability()->setUiReadOnly( true ); - m_displayIJK.xmlCapability()->disableIO(); - - CAF_PDM_InitField( &m_branchIndex, "Branch", 0, "Branch" ); - - setDeletable( true ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RimSimWellFracture::~RimSimWellFracture() -{ -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimSimWellFracture::setClosestWellCoord( cvf::Vec3d& position, size_t branchIndex ) -{ - computeSimWellBranchesIfRequired(); - - double location = m_branchCenterLines[branchIndex].locationAlongWellCoords( position ); - - m_branchIndex = static_cast( branchIndex ); - - m_location = location; - updateFracturePositionFromLocation(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimSimWellFracture::updateAzimuthBasedOnWellAzimuthAngle() -{ - computeSimWellBranchesIfRequired(); - - if ( !fractureTemplate() ) return; - - if ( fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH || - fractureTemplate()->orientationType() == RimFractureTemplate::TRANSVERSE_WELL_PATH ) - { - double simWellAzimuth = wellAzimuthAtFracturePosition(); - - if ( fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH ) - { - m_azimuth = simWellAzimuth; - } - else if ( fractureTemplate()->orientationType() == RimFractureTemplate::TRANSVERSE_WELL_PATH ) - { - if ( simWellAzimuth + 90 < 360 ) - m_azimuth = simWellAzimuth + 90; - else - m_azimuth = simWellAzimuth - 90; - } - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -double RimSimWellFracture::wellAzimuthAtFracturePosition() const -{ - double simWellAzimuth = m_branchCenterLines[m_branchIndex].simWellAzimuthAngle( fracturePosition() ); - if ( simWellAzimuth < 0 ) simWellAzimuth += 360; - - return simWellAzimuth; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimSimWellFracture::loadDataAndUpdate() -{ - computeSimWellBranchCenterLines(); - updateFracturePositionFromLocation(); - updateAzimuthBasedOnWellAzimuthAngle(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -std::vector RimSimWellFracture::perforationLengthCenterLineCoords() const -{ - std::vector coords; - - if ( !m_branchCenterLines.empty() && m_branchIndex < static_cast( m_branchCenterLines.size() ) ) - { - RigWellPath wellPathGeometry( m_branchCenterLines[m_branchIndex].wellPathPoints(), - m_branchCenterLines[m_branchIndex].measuredDepths() ); - - double startMd = m_location - perforationLength() / 2.0; - double endMd = m_location + perforationLength() / 2.0; - - coords = wellPathGeometry.clippedPointSubset( startMd, endMd ).first; - } - - return coords; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimSimWellFracture::isEnabled() const -{ - return isChecked(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimSimWellFracture::applyOffset( double offsetMD ) -{ - m_location = m_location + offsetMD; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimSimWellFracture::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) -{ - RimFracture::fieldChangedByUi( changedField, oldValue, newValue ); - - if ( changedField == &m_location || changedField == &m_branchIndex ) - { - updateFracturePositionFromLocation(); - - RimFractureTemplate::FracOrientationEnum orientation; - if ( fractureTemplate() ) - orientation = fractureTemplate()->orientationType(); - else - orientation = RimFractureTemplate::AZIMUTH; - - if ( orientation != RimFractureTemplate::AZIMUTH ) - { - updateAzimuthBasedOnWellAzimuthAngle(); - } - - RimProject* proj = RimProject::current(); - if ( proj ) proj->reloadCompletionTypeResultsInAllViews(); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimSimWellFracture::recomputeWellCenterlineCoordinates() -{ - m_branchCenterLines.clear(); - - computeSimWellBranchesIfRequired(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimSimWellFracture::updateFracturePositionFromLocation() -{ - computeSimWellBranchesIfRequired(); - - if ( !m_branchCenterLines.empty() ) - { - cvf::Vec3d interpolated = m_branchCenterLines[m_branchIndex()].interpolatedPointAlongWellPath( m_location() ); - - setAnchorPosition( interpolated ); - - RimProject* proj = RimProject::current(); - if ( proj ) proj->scheduleCreateDisplayModelAndRedrawAllViews(); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimSimWellFracture::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) -{ - RimFracture::defineUiOrdering( uiConfigName, uiOrdering ); - - uiOrdering.add( nameField() ); - uiOrdering.add( &m_fractureTemplate ); - - caf::PdmUiGroup* locationGroup = uiOrdering.addNewGroup( "Location / Orientation" ); - locationGroup->add( &m_location ); - locationGroup->add( &m_branchIndex ); - locationGroup->add( &m_azimuth ); - locationGroup->add( &m_uiWellPathAzimuth ); - locationGroup->add( &m_uiWellFractureAzimuthDiff ); - locationGroup->add( &m_wellFractureAzimuthAngleWarning ); - locationGroup->add( &m_dip ); - locationGroup->add( &m_tilt ); - - caf::PdmUiGroup* propertyGroup = uiOrdering.addNewGroup( "Properties" ); - propertyGroup->add( &m_fractureUnit ); - propertyGroup->add( &m_stimPlanTimeIndexToPlot ); - propertyGroup->add( &m_perforationLength ); - propertyGroup->add( &m_perforationEfficiency ); - propertyGroup->add( &m_wellDiameter ); - - caf::PdmUiGroup* fractureCenterGroup = uiOrdering.addNewGroup( "Fracture Center Info" ); - fractureCenterGroup->add( &m_uiAnchorPosition ); - fractureCenterGroup->add( &m_displayIJK ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimSimWellFracture::defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) -{ - RimFracture::defineEditorAttribute( field, uiConfigName, attribute ); - - if ( field == &m_location ) - { - caf::PdmUiDoubleSliderEditorAttribute* myAttr = dynamic_cast( attribute ); - - if ( myAttr ) - { - computeSimWellBranchesIfRequired(); - - if ( !m_branchCenterLines.empty() ) - { - const RigSimulationWellCoordsAndMD& pointAndMd = m_branchCenterLines[m_branchIndex]; - - myAttr->m_minimum = pointAndMd.measuredDepths().front(); - myAttr->m_maximum = pointAndMd.measuredDepths().back(); - myAttr->m_sliderTickCount = pointAndMd.measuredDepths().back(); - } - } - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QList RimSimWellFracture::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) -{ - QList options = RimFracture::calculateValueOptions( fieldNeedingOptions ); - - if ( fieldNeedingOptions == &m_branchIndex ) - { - if ( m_branchCenterLines.empty() ) - { - computeSimWellBranchesIfRequired(); - } - - if ( !m_branchCenterLines.empty() ) - { - size_t branchCount = m_branchCenterLines.size(); - - for ( size_t bIdx = 0; bIdx < branchCount; ++bIdx ) - { - // Use 1-based index in UI - options.push_back( caf::PdmOptionItemInfo( QString::number( bIdx + 1 ), QVariant::fromValue( bIdx ) ) ); - } - } - } - - return options; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RigMainGrid* RimSimWellFracture::ownerCaseMainGrid() const -{ - auto ownerEclView = firstAncestorOrThisOfType(); - if ( ownerEclView ) - return ownerEclView->mainGrid(); - else - return nullptr; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimSimWellFracture::computeSimWellBranchesIfRequired() -{ - if ( m_branchCenterLines.empty() ) - { - computeSimWellBranchCenterLines(); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimSimWellFracture::computeSimWellBranchCenterLines() -{ - m_branchCenterLines.clear(); - - auto rimWell = firstAncestorOrThisOfTypeAsserted(); - const auto simWellBranches = RigSimulationWellCenterLineCalculator::calculateWellPipeStaticCenterline( rimWell ); - for ( const auto& [coords, wellCells] : simWellBranches ) - { - RigSimulationWellCoordsAndMD wellPathWithMD( coords ); - - m_branchCenterLines.push_back( wellPathWithMD ); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString RimSimWellFracture::createOneBasedIJKText() const -{ - RigMainGrid* mainGrid = ownerCaseMainGrid(); - size_t i, j, k; - size_t anchorCellIdx = mainGrid->findReservoirCellIndexFromPoint( anchorPosition() ); - - if ( anchorCellIdx == cvf::UNDEFINED_SIZE_T ) return ""; - - size_t gridLocalCellIdx; - const RigGridBase* hostGrid = mainGrid->gridAndGridLocalIdxFromGlobalCellIdx( anchorCellIdx, &gridLocalCellIdx ); - - bool ok = hostGrid->ijkFromCellIndex( gridLocalCellIdx, &i, &j, &k ); - if ( !ok ) return ""; - - return QString( "Grid %1: [%2, %3, %4]" ).arg( QString::fromStdString( hostGrid->gridName() ) ).arg( i + 1 ).arg( j + 1 ).arg( k + 1 ); -} diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimSimWellFracture.h b/ApplicationLibCode/ProjectDataModel/Completions/RimSimWellFracture.h deleted file mode 100644 index 15ce4e70c7..0000000000 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimSimWellFracture.h +++ /dev/null @@ -1,76 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// 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 "RimFracture.h" - -#include "Well/RigSimulationWellCoordsAndMD.h" - -#include "RimEllipseFractureTemplate.h" - -//================================================================================================== -/// -/// -//================================================================================================== -class RimSimWellFracture : public RimFracture -{ - CAF_PDM_HEADER_INIT; - -public: - RimSimWellFracture(); - ~RimSimWellFracture() override; - - void setClosestWellCoord( cvf::Vec3d& position, size_t branchIndex ); - - void recomputeWellCenterlineCoordinates(); - void updateFracturePositionFromLocation(); - void updateAzimuthBasedOnWellAzimuthAngle() override; - - double wellAzimuthAtFracturePosition() const override; - double fractureMD() const override { return m_location; } - - int branchIndex() const { return m_branchIndex(); } - - void loadDataAndUpdate() override; - - std::vector perforationLengthCenterLineCoords() const override; - - bool isEnabled() const override; // RimWellPathCompletionsInterface override - - void applyOffset( double offsetMD ) override; - -protected: - void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; - void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; - void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override; - QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override; - -private: - RigMainGrid* ownerCaseMainGrid() const; - void computeSimWellBranchesIfRequired(); - void computeSimWellBranchCenterLines(); - QString createOneBasedIJKText() const; - -private: - caf::PdmField m_location; - caf::PdmField m_branchIndex; - std::vector m_branchCenterLines; - - caf::PdmProxyValueField m_displayIJK; -}; diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimSimWellFractureCollection.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimSimWellFractureCollection.cpp deleted file mode 100644 index f3664e4a2a..0000000000 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimSimWellFractureCollection.cpp +++ /dev/null @@ -1,55 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// 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 "RimSimWellFractureCollection.h" - -#include "RimSimWellFracture.h" -#include "cafPdmObject.h" - -CAF_PDM_SOURCE_INIT( RimSimWellFractureCollection, "SimWellFractureCollection" ); - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RimSimWellFractureCollection::RimSimWellFractureCollection() -{ - CAF_PDM_InitObject( "Fractures", ":/FractureLayout16x16.png" ); - - CAF_PDM_InitFieldNoDefault( &simwellFractures, "Fractures", "" ); - - setDeletable( true ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimSimWellFractureCollection::deleteFractures() -{ - simwellFractures.deleteChildren(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimSimWellFractureCollection::recomputeSimWellCenterlines() -{ - for ( RimSimWellFracture* frac : simwellFractures() ) - { - frac->recomputeWellCenterlineCoordinates(); - } -} diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimSimWellFractureCollection.h b/ApplicationLibCode/ProjectDataModel/Completions/RimSimWellFractureCollection.h deleted file mode 100644 index d262139bca..0000000000 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimSimWellFractureCollection.h +++ /dev/null @@ -1,43 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// 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 "cafPdmChildArrayField.h" -#include "cafPdmField.h" -#include "cafPdmObject.h" - -class RimSimWellFracture; - -//================================================================================================== -/// -/// -//================================================================================================== -class RimSimWellFractureCollection : public caf::PdmObject -{ - CAF_PDM_HEADER_INIT; - -public: - RimSimWellFractureCollection(); - - caf::PdmChildArrayField simwellFractures; - - void deleteFractures(); - - void recomputeSimWellCenterlines(); -}; diff --git a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp index 9b1a9e7b5f..a145d186dd 100644 --- a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp @@ -111,9 +111,7 @@ #include "RimSeismicDataCollection.h" #include "RimSeismicSectionCollection.h" #include "RimSeismicViewCollection.h" -#include "RimSimWellFracture.h" #include "RimSimWellInView.h" -#include "RimSimWellInViewCollection.h" #include "RimStimPlanFractureTemplate.h" #include "RimStimPlanModel.h" #include "RimStimPlanModelCollection.h" @@ -842,12 +840,6 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() menuBuilder << "RicShowWellAllocationPlotFeature"; menuBuilder << "RicShowCumulativePhasePlotFeature"; menuBuilder.subMenuEnd(); - - menuBuilder << "RicExportCompletionsForVisibleSimWellsFeature"; - } - else if ( dynamic_cast( firstUiItem ) ) - { - menuBuilder << "RicExportCompletionsForVisibleSimWellsFeature"; } else if ( dynamic_cast( firstUiItem ) ) { @@ -903,10 +895,6 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() #endif menuBuilder << "RicShowGridStatisticsFeature"; } - else if ( dynamic_cast( firstUiItem ) ) - { - menuBuilder << "RicNewSimWellFractureFeature"; - } else if ( dynamic_cast( firstUiItem ) ) { menuBuilder << "RicNewValveTemplateFeature"; @@ -1222,7 +1210,6 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() menuBuilder << "RicEclipseWellShowWellCellsFeature"; menuBuilder << "RicEclipseWellShowWellCellFenceFeature"; menuBuilder << "Separator"; - menuBuilder << "RicNewSimWellFractureFeature"; menuBuilder << "RicNewSimWellIntersectionFeature"; } else if ( dynamic_cast( firstUiItem ) ) diff --git a/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp b/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp index b48870660f..5f3e4a1759 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp @@ -79,7 +79,6 @@ #include "RimReservoirCellResultsStorage.h" #include "RimSeismicSection.h" #include "RimSeismicSectionCollection.h" -#include "RimSimWellFracture.h" #include "RimSimWellInView.h" #include "RimSimWellInViewCollection.h" #include "RimStimPlanColors.h" @@ -1101,37 +1100,6 @@ void RimEclipseView::appendWellsAndFracturesToModel() frameScene->addModel( wellPathModelBasicList.p() ); } - - // Sim Well Fractures - { - cvf::String name = "SimWellFracturesModel"; - RimEclipseView::removeModelByName( frameScene, name ); - - cvf::ref simWellFracturesModelBasicList = new cvf::ModelBasicList; - simWellFracturesModelBasicList->setName( name ); - - cvf::ref transForm = displayCoordTransform(); - - std::vector fractures = descendantsIncludingThisOfType(); - for ( RimFracture* f : fractures ) - { - RimSimWellInView* simWell = f->firstAncestorOrThisOfType(); - if ( simWell ) - { - bool isAnyGeometryPresent = simWell->isWellPipeVisible( m_currentTimeStep ) || - simWell->isWellSpheresVisible( m_currentTimeStep ); - if ( !isAnyGeometryPresent ) - { - continue; - } - } - - f->fracturePartManager()->appendGeometryPartsToModel( simWellFracturesModelBasicList.p(), *this ); - } - - simWellFracturesModelBasicList->updateBoundingBoxesRecursive(); - frameScene->addModel( simWellFracturesModelBasicList.p() ); - } } } } @@ -1238,16 +1206,6 @@ void RimEclipseView::onLoadDataAndUpdate() synchronizeLocalAnnotationsFromGlobal(); - { - // Update simulation well fractures after well cell results are imported - - std::vector simFractures = descendantsIncludingThisOfType(); - for ( auto fracture : simFractures ) - { - fracture->loadDataAndUpdate(); - } - } - if ( isVirtualConnectionFactorGeometryVisible() ) { m_virtualPerforationResult->loadData(); diff --git a/ApplicationLibCode/ProjectDataModel/RimSimWellInView.cpp b/ApplicationLibCode/ProjectDataModel/RimSimWellInView.cpp index ba0de2b820..0fa142f39b 100644 --- a/ApplicationLibCode/ProjectDataModel/RimSimWellInView.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimSimWellInView.cpp @@ -39,8 +39,6 @@ #include "RimExtrudedCurveIntersection.h" #include "RimIntersectionCollection.h" #include "RimPropertyFilterCollection.h" -#include "RimSimWellFracture.h" -#include "RimSimWellFractureCollection.h" #include "RimSimWellInViewCollection.h" #include "RimSimWellInViewTools.h" #include "RimSummaryCase.h" @@ -88,28 +86,16 @@ RimSimWellInView::RimSimWellInView() CAF_PDM_InitField( &showWellCells, "ShowWellCells", false, "Well Cells" ); CAF_PDM_InitField( &showWellCellFence, "ShowWellCellFence", false, "Well Cell Fence" ); - CAF_PDM_InitFieldNoDefault( &simwellFractureCollection, "FractureCollection", "Fractures" ); - name.uiCapability()->setUiHidden( true ); name.uiCapability()->setUiReadOnly( true ); m_resultWellIndex = cvf::UNDEFINED_SIZE_T; - simwellFractureCollection = new RimSimWellFractureCollection(); - m_isInjector = false; m_isValidDisk = false; m_diskScale = 1.0; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RimSimWellInView::~RimSimWellInView() -{ - if ( simwellFractureCollection() ) delete simwellFractureCollection(); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -439,10 +425,6 @@ void RimSimWellInView::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin //-------------------------------------------------------------------------------------------------- void RimSimWellInView::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/ ) { - for ( RimSimWellFracture* fracture : simwellFractureCollection()->simwellFractures() ) - { - uiTreeOrdering.add( fracture ); - } uiTreeOrdering.skipRemainingChildren( true ); const auto reservoirView = firstAncestorOrThisOfType(); diff --git a/ApplicationLibCode/ProjectDataModel/RimSimWellInView.h b/ApplicationLibCode/ProjectDataModel/RimSimWellInView.h index 3b4db2d480..27241f0e04 100644 --- a/ApplicationLibCode/ProjectDataModel/RimSimWellInView.h +++ b/ApplicationLibCode/ProjectDataModel/RimSimWellInView.h @@ -38,7 +38,6 @@ class RigSimWellData; class RigWellResultFrame; -class RimSimWellFractureCollection; class RigWellPath; class RimWellDiskConfig; @@ -52,7 +51,6 @@ class RimSimWellInView : public caf::PdmObject, public Rim3dPropertiesInterface public: RimSimWellInView(); - ~RimSimWellInView() override; void setSimWellData( RigSimWellData* simWellData, size_t resultWellIndex ); RigSimWellData* simWellData(); @@ -102,8 +100,6 @@ public: caf::PdmField showWellCells; caf::PdmField showWellCellFence; - caf::PdmChildField simwellFractureCollection; - double calculateInjectionProductionFractions( const RimWellDiskConfig& wellDiskConfig, bool* isOk ); void scaleDisk( double minValue, double maxValue ); diff --git a/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.cpp b/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.cpp index 0f7ba6cf27..e5743343b7 100644 --- a/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.cpp @@ -32,7 +32,6 @@ #include "RimEclipseResultCase.h" #include "RimEclipseView.h" #include "RimProject.h" -#include "RimSimWellFractureCollection.h" #include "RimSimWellInView.h" #include "RimSimWellInViewTools.h" #include "RimSummaryCase.h" @@ -475,11 +474,6 @@ void RimSimWellInViewCollection::fieldChangedByUi( const caf::PdmFieldHandle* ch if ( &wellPipeCoordType == changedField || &isAutoDetectingBranches == changedField ) { if ( m_reservoirView ) m_reservoirView->scheduleCreateDisplayModelAndRedraw(); - - for ( RimSimWellInView* w : wells ) - { - w->simwellFractureCollection()->recomputeSimWellCenterlines(); - } } } diff --git a/ApplicationLibCode/ReservoirDataModel/Completions/RigWellPathStimplanIntersector.cpp b/ApplicationLibCode/ReservoirDataModel/Completions/RigWellPathStimplanIntersector.cpp index 0c85fc3245..6d433df5c1 100644 --- a/ApplicationLibCode/ReservoirDataModel/Completions/RigWellPathStimplanIntersector.cpp +++ b/ApplicationLibCode/ReservoirDataModel/Completions/RigWellPathStimplanIntersector.cpp @@ -25,7 +25,6 @@ #include "RimFracture.h" #include "RimFractureTemplate.h" -#include "RimSimWellFracture.h" #include "RimStimPlanFractureTemplate.h" #include "cvfMath.h" diff --git a/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp b/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp index 96d7b4f091..2467203028 100644 --- a/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp +++ b/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp @@ -569,8 +569,6 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event ) menuBuilder.addSeparator(); menuBuilder << "RicShowContributingWellsFeature"; menuBuilder.addSeparator(); - menuBuilder << "RicNewSimWellFractureAtPosFeature"; - menuBuilder.addSeparator(); menuBuilder << "RicNewSimWellIntersectionFeature"; } }