Stimplan preprocessor refact (#5895)

* #5633 Add Fracture Model data object.
* #5633 Add visualization for Fracture Model.
* Use thickness direction well path.
* #5834 WIP Fracture Model: Extract facies names along thickness direction vector
* Update to class enums.
* Remove RimFractureModel dip, tilt and azimuth (no longer used).
* #5824: Fix fracture model direction relative to formation dip
* Workaround problem in generated python code which breaks tests on linux. See #5862.
* Update name of thickness direction well path.
* #5834 Add import command for facies roff file.
* #5834 Show color legend data in facies track.
Also make it possible to change the data source for the curve data in plot.
* Fracture Model: replace "Thickness Type" with "Extraction Type".
* Use shorter curve legends in fracture model plot.
* Use class enum for RimFractureModel::ExtractionType.
* Use RimProject::current() instead of RiaApplication::instance()->project().
* Simplify RimFractureModel by not implementing Rim3dPropertiesInterface.
* Use scoped enums in RiaPlotAnnotationTool.
* Remove unused RimFractureModelPlot fields.
* Hide fracture model plots field, and add accessor methods.
This commit is contained in:
Kristian Bendiksen
2020-05-14 06:39:55 +02:00
committed by GitHub
parent 73ac3e5db1
commit 20ca3354b9
46 changed files with 2290 additions and 93 deletions

View File

@@ -24,6 +24,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicRangeFilterNewExec.h
${CMAKE_CURRENT_LIST_DIR}/RicRangeFilterNewSliceIFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicRangeFilterNewSliceJFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicRangeFilterNewSliceKFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicImportFaciesFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicImportFormationNamesFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicReloadFormationNamesFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicReloadWellPathFormationNamesFeature.h
@@ -116,6 +117,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicRangeFilterNewExec.cpp
${CMAKE_CURRENT_LIST_DIR}/RicRangeFilterNewSliceIFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicRangeFilterNewSliceJFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicRangeFilterNewSliceKFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicImportFaciesFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicImportFormationNamesFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicReloadFormationNamesFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicReloadWellPathFormationNamesFeature.cpp

View File

@@ -12,6 +12,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewValveAtMeasuredDepthFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicDeleteValveTemplateFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicWellPathImportCompletionsFileFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicWellPathImportPerforationIntervalsFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewFractureModelPlotFeature.h
)
set (SOURCE_GROUP_SOURCE_FILES
@@ -27,6 +28,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewValveAtMeasuredDepthFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicDeleteValveTemplateFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicWellPathImportCompletionsFileFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicWellPathImportPerforationIntervalsFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewFractureModelPlotFeature.cpp
)

View File

@@ -0,0 +1,319 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicNewFractureModelPlotFeature.h"
#include "RiaApplication.h"
#include "RiaColorTables.h"
#include "RiaGuiApplication.h"
#include "RiaLogging.h"
#include "WellLogCommands/RicNewWellLogPlotFeatureImpl.h"
#include "RigWellPath.h"
#include "RimEclipseCase.h"
#include "RimEclipseView.h"
#include "RimFractureModel.h"
#include "RimFractureModelCurve.h"
#include "RimFractureModelPlot.h"
#include "RimFractureModelPlotCollection.h"
#include "RimMainPlotCollection.h"
#include "RimModeledWellPath.h"
#include "RimProject.h"
#include "RimWellLogTrack.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "RiuPlotMainWindowTools.h"
#include "cafProgressInfo.h"
#include "cafSelectionManager.h"
#include "cvfAssert.h"
#include "cvfMath.h"
#include <QAction>
#include <QDateTime>
#include <QString>
#include <algorithm>
CAF_CMD_SOURCE_INIT( RicNewFractureModelPlotFeature, "RicNewFractureModelPlotFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModelPlot*
RicNewFractureModelPlotFeature::createPlot( RimEclipseCase* eclipseCase, RimFractureModel* fractureModel, int timeStep )
{
caf::ProgressInfo progInfo( 100, "Creating Fracture Model Plot" );
RimFractureModelPlot* plot = createFractureModelPlot( true, "Fracture Model" );
{
auto task = progInfo.task( "Creating formation track", 2 );
createFormationTrack( plot, fractureModel, eclipseCase );
}
{
auto task = progInfo.task( "Creating facies track", 2 );
createFaciesTrack( plot, fractureModel, eclipseCase );
}
{
auto task = progInfo.task( "Creating parameters track", 15 );
std::vector<std::pair<QString, RiaDefines::ResultCatType>> results =
{std::make_pair( "PORO", RiaDefines::ResultCatType::STATIC_NATIVE ),
std::make_pair( "PRESSURE", RiaDefines::ResultCatType::DYNAMIC_NATIVE ),
std::make_pair( "PERMZ", RiaDefines::ResultCatType::STATIC_NATIVE )};
for ( auto result : results )
{
createParametersTrack( plot, fractureModel, eclipseCase, timeStep, result.first, result.second );
}
}
{
auto task = progInfo.task( "Updating all tracks", 5 );
plot->nameConfig()->setAutoNameTags( false, false, false, false, false );
plot->setPlotTitleVisible( true );
plot->setLegendsVisible( true );
plot->setLegendsHorizontal( true );
plot->setDepthType( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH );
plot->setAutoScaleDepthEnabled( true );
// RicNewWellLogPlotFeatureImpl::updateAfterCreation( plot );
plot->loadDataAndUpdate();
}
RiuPlotMainWindowTools::selectAsCurrentItem( plot );
// Make sure the summary plot window is visible
RiuPlotMainWindowTools::showPlotMainWindow();
return plot;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicNewFractureModelPlotFeature::isCommandEnabled()
{
Rim3dView* view = RiaApplication::instance()->activeReservoirView();
if ( !view ) return false;
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( view );
return eclipseView != nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewFractureModelPlotFeature::onActionTriggered( bool isChecked )
{
RimFractureModel* fractureModel = caf::SelectionManager::instance()->selectedItemAncestorOfType<RimFractureModel>();
if ( !fractureModel ) return;
Rim3dView* view = RiaApplication::instance()->activeReservoirView();
if ( !view ) return;
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( view );
if ( !eclipseView ) return;
RimEclipseCase* eclipseCase = eclipseView->eclipseCase();
if ( !eclipseCase ) return;
createPlot( eclipseCase, fractureModel, view->currentTimeStep() );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewFractureModelPlotFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText( "New Fracture Model Plot" );
// actionToSetup->setIcon( QIcon( ":/WellBoreStability16x16.png" ) );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewFractureModelPlotFeature::createFormationTrack( RimFractureModelPlot* plot,
RimFractureModel* fractureModel,
RimEclipseCase* eclipseCase )
{
RimWellLogTrack* formationTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, "Formations", plot );
formationTrack->setFormationWellPath( fractureModel->thicknessDirectionWellPath() );
formationTrack->setFormationCase( eclipseCase );
formationTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS );
formationTrack->setVisibleXRange( 0.0, 0.0 );
formationTrack->setColSpan( RimPlot::ONE );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewFractureModelPlotFeature::createFaciesTrack( RimFractureModelPlot* plot,
RimFractureModel* fractureModel,
RimEclipseCase* eclipseCase )
{
QString defaultProperty = "OPERNUM_1";
RimWellLogTrack* faciesTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, "Facies", plot );
faciesTrack->setFormationWellPath( fractureModel->thicknessDirectionWellPath() );
faciesTrack->setFormationCase( eclipseCase );
faciesTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS );
faciesTrack->setRegionPropertyResultType( RiaDefines::ResultCatType::INPUT_PROPERTY, defaultProperty );
faciesTrack->setVisibleXRange( 0.0, 0.0 );
faciesTrack->setColSpan( RimPlot::ONE );
caf::ColorTable colors = RiaColorTables::contrastCategoryPaletteColors();
std::vector<RiuQwtPlotCurve::LineStyleEnum> lineStyles = {RiuQwtPlotCurve::STYLE_SOLID,
RiuQwtPlotCurve::STYLE_DASH,
RiuQwtPlotCurve::STYLE_DASH_DOT};
RimFractureModelCurve* curve = new RimFractureModelCurve;
curve->setFractureModel( fractureModel );
curve->setCase( eclipseCase );
curve->setEclipseResultCategory( RiaDefines::ResultCatType::INPUT_PROPERTY );
curve->setEclipseResultVariable( defaultProperty );
curve->setColor( colors.cycledColor3f( 0 ) );
curve->setLineStyle( lineStyles[0] );
curve->setLineThickness( 2 );
curve->setAutoNameComponents( false, true, false, false, false );
faciesTrack->addCurve( curve );
faciesTrack->setAutoScaleXEnabled( true );
curve->loadDataAndUpdate( true );
curve->updateConnectedEditors();
faciesTrack->updateConnectedEditors();
plot->updateConnectedEditors();
RiaApplication::instance()->project()->updateConnectedEditors();
RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
RiuPlotMainWindowTools::selectAsCurrentItem( curve );
RiuPlotMainWindowTools::showPlotMainWindow();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewFractureModelPlotFeature::createParametersTrack( RimFractureModelPlot* plot,
RimFractureModel* fractureModel,
RimEclipseCase* eclipseCase,
int timeStep,
const QString& resultVariable,
RiaDefines::ResultCatType resultCategoryType )
{
RimWellLogTrack* plotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, resultVariable, plot );
plotTrack->setFormationWellPath( fractureModel->thicknessDirectionWellPath() );
plotTrack->setColSpan( RimPlot::TWO );
plotTrack->setVisibleXRange( 0.0, 2.0 );
plotTrack->setAutoScaleXEnabled( true );
plotTrack->setTickIntervals( 1.0, 0.2 );
plotTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
plotTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::CURVE_ANNOTATIONS );
plotTrack->setShowRegionLabels( true );
plotTrack->setShowWindow( true );
caf::ColorTable colors = RiaColorTables::contrastCategoryPaletteColors();
std::vector<RiuQwtPlotCurve::LineStyleEnum> lineStyles = {RiuQwtPlotCurve::STYLE_SOLID,
RiuQwtPlotCurve::STYLE_DASH,
RiuQwtPlotCurve::STYLE_DASH_DOT};
RimFractureModelCurve* curve = new RimFractureModelCurve;
curve->setFractureModel( fractureModel );
curve->setCase( eclipseCase );
curve->setEclipseResultVariable( resultVariable );
curve->setEclipseResultCategory( resultCategoryType );
curve->setColor( colors.cycledColor3f( 0 ) );
curve->setLineStyle( lineStyles[0] );
curve->setLineThickness( 2 );
curve->setAutoNameComponents( false, true, false, false, false );
plotTrack->addCurve( curve );
plotTrack->setAutoScaleXEnabled( true );
curve->loadDataAndUpdate( true );
curve->updateConnectedEditors();
plotTrack->updateConnectedEditors();
plot->updateConnectedEditors();
RiaApplication::instance()->project()->updateConnectedEditors();
RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
RiuPlotMainWindowTools::selectAsCurrentItem( curve );
RiuPlotMainWindowTools::showPlotMainWindow();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModelPlot* RicNewFractureModelPlotFeature::createFractureModelPlot( bool showAfterCreation,
const QString& plotDescription )
{
RimFractureModelPlotCollection* fractureModelPlotColl = fractureModelPlotCollection();
CVF_ASSERT( fractureModelPlotColl );
// Make sure the summary plot window is created
RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
RimFractureModelPlot* plot = new RimFractureModelPlot();
plot->setAsPlotMdiWindow();
fractureModelPlotColl->addFractureModelPlot( plot );
if ( !plotDescription.isEmpty() )
{
plot->nameConfig()->setCustomName( plotDescription );
}
else
{
plot->nameConfig()->setCustomName(
QString( "Fracture Model Plot %1" ).arg( fractureModelPlotCollection()->fractureModelPlots().size() ) );
}
if ( showAfterCreation )
{
RiaGuiApplication::instance()->getOrCreateAndShowMainPlotWindow();
}
return plot;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModelPlotCollection* RicNewFractureModelPlotFeature::fractureModelPlotCollection()
{
RimProject* project = RiaApplication::instance()->project();
CVF_ASSERT( project );
RimMainPlotCollection* mainPlotColl = project->mainPlotCollection();
CVF_ASSERT( mainPlotColl );
RimFractureModelPlotCollection* fractureModelPlotColl = mainPlotColl->fractureModelPlotCollection();
CVF_ASSERT( fractureModelPlotColl );
return mainPlotColl->fractureModelPlotCollection();
}

View File

@@ -0,0 +1,61 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafCmdFeature.h"
#include "RiaDefines.h"
class RimEclipseCase;
class RimFractureModelPlot;
class RimFractureModelPlotCollection;
class RimFractureModel;
//==================================================================================================
///
//==================================================================================================
class RicNewFractureModelPlotFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
public:
static RimFractureModelPlot* createPlot( RimEclipseCase* eclipseCase, RimFractureModel* fractureModel, int timeStep );
protected:
// Overrides
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
private:
static void
createFormationTrack( RimFractureModelPlot* plot, RimFractureModel* fractureModel, RimEclipseCase* eclipseCase );
static void
createFaciesTrack( RimFractureModelPlot* plot, RimFractureModel* fractureModel, RimEclipseCase* eclipseCase );
static void createParametersTrack( RimFractureModelPlot* plot,
RimFractureModel* fractureModel,
RimEclipseCase* eclipseCase,
int timeStep,
const QString& resultVariable,
RiaDefines::ResultCatType resultCategoryType );
static RimFractureModelPlot* createFractureModelPlot( bool showAfterCreation, const QString& plotDescription );
static RimFractureModelPlotCollection* fractureModelPlotCollection();
};

View File

@@ -12,6 +12,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewSimWellFractureFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanFractureTemplateFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureAtPosFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewFractureModelFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesOptionItemUi.h
@@ -33,6 +34,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewSimWellFractureFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanFractureTemplateFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureAtPosFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewFractureModelFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesOptionItemUi.cpp

View File

@@ -19,37 +19,20 @@
#include "RicFractureNameGenerator.h"
#include "RimFracture.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimFractureModel.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RicFractureNameGenerator::nameForNewFracture()
{
std::vector<RimFracture*> oldFractures;
RimProject::current()->activeOilField()->descendantsIncludingThisOfType( oldFractures );
size_t fractureNum = oldFractures.size();
bool found;
QString name;
do
{
found = false;
name = QString( "Fracture_%1" ).arg( fractureNum, 2, 10, QChar( '0' ) );
for ( RimFracture* fracture : oldFractures )
{
if ( fracture->name() == name )
{
found = true;
break;
}
}
fractureNum++;
} while ( found );
return name;
return RicFractureNameGenerator::nameForNewObject<RimFracture>( "Fracture_%1" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RicFractureNameGenerator::nameForNewFractureModel()
{
return RicFractureNameGenerator::nameForNewObject<RimFractureModel>( "Fracture Model_%1" );
}

View File

@@ -18,6 +18,9 @@
#pragma once
#include "RimOilField.h"
#include "RimProject.h"
#include <QString>
//==================================================================================================
@@ -27,4 +30,36 @@ class RicFractureNameGenerator
{
public:
static QString nameForNewFracture();
static QString nameForNewFractureModel();
private:
template <typename T>
static QString nameForNewObject( const QString& namePattern )
{
std::vector<T*> oldObjects;
RimProject::current()->activeOilField()->descendantsIncludingThisOfType( oldObjects );
size_t objectNum = oldObjects.size();
bool found;
QString name;
do
{
found = false;
name = QString( namePattern ).arg( objectNum, 2, 10, QChar( '0' ) );
for ( T* object : oldObjects )
{
if ( object->name() == name )
{
found = true;
break;
}
}
objectNum++;
} while ( found );
return name;
}
};

View File

@@ -0,0 +1,162 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicNewFractureModelFeature.h"
#include "RiaApplication.h"
#include "RicFractureNameGenerator.h"
#include "RimFractureModel.h"
#include "RimFractureModelCollection.h"
#include "RimModeledWellPath.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "RimWellPathCompletions.h"
#include "Riu3DMainWindowTools.h"
#include "WellPathCommands/RicWellPathsUnitSystemSettingsImpl.h"
#include "cafSelectionManager.h"
#include "cvfAssert.h"
#include <QAction>
CAF_CMD_SOURCE_INIT( RicNewFractureModelFeature, "RicNewFractureModelFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewFractureModelFeature::addFractureModel( RimWellPath* wellPath, RimWellPathCollection* wellPathCollection )
{
CVF_ASSERT( wellPath );
if ( !RicWellPathsUnitSystemSettingsImpl::ensureHasUnitSystem( wellPath ) ) return;
RimFractureModelCollection* fractureModelCollection = wellPath->fractureModelCollection();
CVF_ASSERT( fractureModelCollection );
RimFractureModel* fractureModel = new RimFractureModel();
fractureModelCollection->addFractureModel( fractureModel );
RimOilField* oilfield = nullptr;
fractureModelCollection->firstAncestorOrThisOfType( oilfield );
if ( !oilfield ) return;
QString fractureModelName = RicFractureNameGenerator::nameForNewFractureModel();
fractureModel->setName( fractureModelName );
RimProject* project = nullptr;
fractureModelCollection->firstAncestorOrThisOfType( project );
// Add a "fake" well path for thickess direction
RimModeledWellPath* thicknessDirectionWellPath = new RimModeledWellPath;
fractureModel->setThicknessDirectionWellPath( thicknessDirectionWellPath );
std::vector<RimWellPath*> wellPaths = {thicknessDirectionWellPath};
wellPathCollection->addWellPaths( wellPaths );
if ( project )
{
project->reloadCompletionTypeResultsInAllViews();
project->updateAllRequiredEditors();
}
Riu3DMainWindowTools::selectAsCurrentItem( fractureModel );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewFractureModelFeature::onActionTriggered( bool isChecked )
{
RimFractureModelCollection* fractureColl = RicNewFractureModelFeature::selectedFractureModelCollection();
if ( !fractureColl ) return;
RimWellPath* wellPath = nullptr;
fractureColl->firstAncestorOrThisOfTypeAsserted( wellPath );
RimWellPathCollection* wellPathCollection = nullptr;
fractureColl->firstAncestorOrThisOfTypeAsserted( wellPathCollection );
RicNewFractureModelFeature::addFractureModel( wellPath, wellPathCollection );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewFractureModelFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon( QIcon( ":/FractureSymbol16x16.png" ) );
actionToSetup->setText( "Create Fracture Model" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicNewFractureModelFeature::isCommandEnabled()
{
if ( selectedFractureModelCollection() )
{
return true;
}
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModelCollection* RicNewFractureModelFeature::selectedFractureModelCollection()
{
std::vector<caf::PdmUiItem*> allSelectedItems;
caf::SelectionManager::instance()->selectedItems( allSelectedItems );
if ( allSelectedItems.size() != 1u ) return nullptr;
caf::PdmUiItem* pdmUiItem = allSelectedItems.front();
RimFractureModelCollection* objToFind = nullptr;
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
if ( objHandle )
{
objHandle->firstAncestorOrThisOfType( objToFind );
}
if ( objToFind == nullptr )
{
std::vector<RimWellPath*> wellPaths;
caf::SelectionManager::instance()->objectsByType( &wellPaths );
if ( !wellPaths.empty() )
{
return wellPaths[0]->fractureModelCollection();
}
RimWellPathCompletions* completions =
caf::SelectionManager::instance()->selectedItemOfType<RimWellPathCompletions>();
if ( completions )
{
return completions->fractureModelCollection();
}
}
return objToFind;
}

View File

@@ -0,0 +1,44 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafCmdFeature.h"
class RimFractureModelCollection;
class RimWellPath;
class RimWellPathCollection;
//==================================================================================================
///
//==================================================================================================
class RicNewFractureModelFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
public:
static void addFractureModel( RimWellPath* wellPath, RimWellPathCollection* wellPathCollection );
protected:
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
bool isCommandEnabled() override;
private:
static RimFractureModelCollection* selectedFractureModelCollection();
};

View File

@@ -0,0 +1,106 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020 Equinor 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicImportFaciesFeature.h"
#include "RiaApplication.h"
#include "RiaColorTables.h"
#include "RiaLogging.h"
#include "RimColorLegend.h"
#include "RimColorLegendCollection.h"
#include "RimColorLegendItem.h"
#include "RimProject.h"
#include "RifColorLegendData.h"
#include "RifRoffReader.h"
#include "Riu3DMainWindowTools.h"
#include "cafColorTable.h"
#include <QAction>
#include <QFileDialog>
CAF_CMD_SOURCE_INIT( RicImportFaciesFeature, "RicImportFaciesFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicImportFaciesFeature::isCommandEnabled()
{
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicImportFaciesFeature::onActionTriggered( bool isChecked )
{
RiaApplication* app = RiaApplication::instance();
QString defaultDir = app->lastUsedDialogDirectory( "ROFF_FILE" );
QString filterText = QString( "Roff ascii file (*.roff);;All Files (*.*)" );
QString fileName =
QFileDialog::getOpenFileName( Riu3DMainWindowTools::mainWindowWidget(), "Import Facies", defaultDir, filterText );
if ( fileName.isEmpty() ) return;
// Remember the path to next time
app->setLastUsedDialogDirectory( "ROFF_FILE", QFileInfo( fileName ).absolutePath() );
std::map<int, QString> codeNames;
try
{
RifRoffReader::readCodeNames( fileName, codeNames );
}
catch ( RifRoffReaderException& ex )
{
RiaLogging::error( QString::fromStdString( ex.message ) );
return;
}
// TODO: try to map names of facies to a sensible color
const caf::ColorTable& colorTable = RiaColorTables::contrastCategoryPaletteColors();
RimColorLegend* colorLegend = new RimColorLegend;
colorLegend->setColorLegendName( "Facies colors" );
// Iterate over the map using Iterator till end.
for ( auto it : codeNames )
{
RimColorLegendItem* colorLegendItem = new RimColorLegendItem;
colorLegendItem->setValues( it.second, it.first, colorTable.cycledColor3f( it.first ) );
colorLegend->appendColorLegendItem( colorLegendItem );
}
RimColorLegendCollection* colorLegendCollection = RimProject::current()->colorLegendCollection;
colorLegendCollection->appendColorLegend( colorLegend );
colorLegendCollection->updateConnectedEditors();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicImportFaciesFeature::setupActionLook( QAction* actionToSetup )
{
// TODO: add icon?
// actionToSetup->setIcon( QIcon( ":/Formations16x16.png" ) );
actionToSetup->setText( "Import Facies" );
}

View File

@@ -0,0 +1,34 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020 Equinor 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafCmdFeature.h"
//==================================================================================================
///
//==================================================================================================
class RicImportFaciesFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};

View File

@@ -214,7 +214,7 @@ void RicNewWellBoreStabilityPlotFeature::createFormationTrack( RimWellBoreStabil
RimWellLogTrack* formationTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, "Formations", plot );
formationTrack->setFormationWellPath( wellPath );
formationTrack->setFormationCase( geoMechCase );
formationTrack->setAnnotationType( RiuPlotAnnotationTool::FORMATION_ANNOTATIONS );
formationTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS );
formationTrack->setVisibleXRange( 0.0, 0.0 );
formationTrack->setColSpan( RimPlot::ONE );
}
@@ -230,7 +230,7 @@ void RicNewWellBoreStabilityPlotFeature::createCasingShoeTrack( RimWellBoreStabi
casingShoeTrack->setColSpan( RimPlot::ONE );
casingShoeTrack->setFormationWellPath( wellPath );
casingShoeTrack->setFormationCase( geoMechCase );
casingShoeTrack->setAnnotationType( RiuPlotAnnotationTool::FORMATION_ANNOTATIONS );
casingShoeTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS );
casingShoeTrack->setAnnotationDisplay( RiuPlotAnnotationTool::COLOR_SHADING_AND_LINES );
casingShoeTrack->setShowRegionLabels( false );
casingShoeTrack->setShowWellPathAttributes( true );
@@ -259,7 +259,7 @@ void RicNewWellBoreStabilityPlotFeature::createParametersTrack( RimWellBoreStabi
paramCurvesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
paramCurvesTrack->setFormationWellPath( wellPath );
paramCurvesTrack->setFormationCase( geoMechCase );
paramCurvesTrack->setAnnotationType( RiuPlotAnnotationTool::CURVE_ANNOTATIONS );
paramCurvesTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::CURVE_ANNOTATIONS );
paramCurvesTrack->setShowRegionLabels( true );
paramCurvesTrack->setShowWindow( false );
std::set<RigWbsParameter> parameters = RigWbsParameter::allParameters();
@@ -308,7 +308,7 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore
stabilityCurvesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
stabilityCurvesTrack->setFormationWellPath( wellPath );
stabilityCurvesTrack->setFormationCase( geoMechCase );
stabilityCurvesTrack->setAnnotationType( RiuPlotAnnotationTool::FORMATION_ANNOTATIONS );
stabilityCurvesTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS );
stabilityCurvesTrack->setAnnotationDisplay( RiuPlotAnnotationTool::LIGHT_LINES );
stabilityCurvesTrack->setShowRegionLabels( false );
@@ -425,7 +425,7 @@ void RicNewWellBoreStabilityPlotFeature::createAnglesTrack( RimWellBoreStability
wellPathAnglesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
wellPathAnglesTrack->setFormationWellPath( wellPath );
wellPathAnglesTrack->setFormationCase( geoMechCase );
wellPathAnglesTrack->setAnnotationType( RiuPlotAnnotationTool::FORMATION_ANNOTATIONS );
wellPathAnglesTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS );
wellPathAnglesTrack->setAnnotationDisplay( RiuPlotAnnotationTool::LIGHT_LINES );
wellPathAnglesTrack->setShowRegionLabels( false );
}

View File

@@ -21,6 +21,8 @@
#include "RimCase.h"
#include "RimEclipseCase.h"
#include "RimFractureModelPlot.h"
#include "RimFractureModelPlotCollection.h"
#include "RimMainPlotCollection.h"
#include "RimProject.h"
#include "RimWellBoreStabilityPlot.h"
@@ -115,11 +117,11 @@ RimWellLogPlot* RicNewWellLogPlotFeatureImpl::createWellLogPlot( bool showAfterC
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogTrack* RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( bool updateAfter,
const QString& trackDescription,
RimWellLogPlot* existingPlot )
RimWellLogTrack* RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( bool updateAfter,
const QString& trackDescription,
RimDepthTrackPlot* existingPlot )
{
RimWellLogPlot* plot = existingPlot;
RimDepthTrackPlot* plot = existingPlot;
if ( plot == nullptr )
{
plot = createWellLogPlot();
@@ -223,7 +225,7 @@ RimWellLogTrack* RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( bool
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewWellLogPlotFeatureImpl::updateAfterCreation( RimWellLogPlot* plot )
void RicNewWellLogPlotFeatureImpl::updateAfterCreation( RimDepthTrackPlot* plot )
{
CVF_ASSERT( plot );
plot->loadDataAndUpdate();

View File

@@ -26,6 +26,7 @@ class RimWellBoreStabilityPlot;
class RimWellLogPlotCollection;
class RimWellLogPlot;
class RimWellLogTrack;
class RimDepthTrackPlot;
//==================================================================================================
///
@@ -38,10 +39,10 @@ public:
const RimWbsParameters* params = nullptr );
static RimWellLogPlot* createWellLogPlot( bool showAfterCreation = true,
const QString& plotDescription = QString( "" ) );
static RimWellLogTrack* createWellLogPlotTrack( bool updateAfterCreation = true,
const QString& trackDescription = QString( "" ),
RimWellLogPlot* existingPlot = nullptr );
static void updateAfterCreation( RimWellLogPlot* plot );
static RimWellLogTrack* createWellLogPlotTrack( bool updateAfterCreation = true,
const QString& trackDescription = QString( "" ),
RimDepthTrackPlot* existingPlot = nullptr );
static void updateAfterCreation( RimDepthTrackPlot* plot );
private:
static RimWellLogPlotCollection* wellLogPlotCollection();

View File

@@ -156,7 +156,9 @@ ${CMAKE_CURRENT_LIST_DIR}/RimElementVectorResult.h
${CMAKE_CURRENT_LIST_DIR}/RimColorLegendCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimColorLegend.h
${CMAKE_CURRENT_LIST_DIR}/RimColorLegendItem.h
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelPlot.h
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelPlotCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelCurve.h
)
@@ -317,6 +319,9 @@ ${CMAKE_CURRENT_LIST_DIR}/RimElementVectorResult.cpp
${CMAKE_CURRENT_LIST_DIR}/RimColorLegendCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimColorLegend.cpp
${CMAKE_CURRENT_LIST_DIR}/RimColorLegendItem.cpp
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelPlotCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelCurve.cpp
)
list(APPEND CODE_HEADER_FILES

View File

@@ -15,6 +15,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RimFractureContainment.h
${CMAKE_CURRENT_LIST_DIR}/RimFractureContainmentTools.h
${CMAKE_CURRENT_LIST_DIR}/RimFractureExportSettings.h
${CMAKE_CURRENT_LIST_DIR}/RimFractureTemplate.h
${CMAKE_CURRENT_LIST_DIR}/RimFractureModel.h
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimCompletionTemplateCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimFractureTemplateCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimValveTemplateCollection.h
@@ -51,6 +53,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RimFractureContainment.cpp
${CMAKE_CURRENT_LIST_DIR}/RimFractureContainmentTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RimFractureExportSettings.cpp
${CMAKE_CURRENT_LIST_DIR}/RimFractureTemplate.cpp
${CMAKE_CURRENT_LIST_DIR}/RimFractureModel.cpp
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimCompletionTemplateCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimFractureTemplateCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimValveTemplateCollection.cpp

View File

@@ -0,0 +1,452 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimFractureModel.h"
#include "RiaColorTables.h"
#include "RiaCompletionTypeCalculationScheduler.h"
#include "RiaEclipseUnitTools.h"
#include "RiaLogging.h"
#include "Riu3DMainWindowTools.h"
#include "RigEclipseCaseData.h"
#include "RigMainGrid.h"
#include "RigWellPath.h"
#include "Rim3dView.h"
#include "RimEclipseCase.h"
#include "RimEclipseCellColors.h"
#include "RimEclipseView.h"
#include "RimEllipseFractureTemplate.h"
#include "RimModeledWellPath.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimReservoirCellResultsStorage.h"
#include "RimStimPlanColors.h"
#include "RimStimPlanFractureTemplate.h"
#include "RimWellPath.h"
#include "RimWellPathGeometryDef.h"
#include "RimWellPathTarget.h"
#include "cafPdmUiDoubleSliderEditor.h"
#include "cafPdmUiPushButtonEditor.h"
#include "cafPdmUiToolButtonEditor.h"
#include "cafPdmUiTreeOrdering.h"
#include "cvfBoundingBox.h"
#include "cvfGeometryTools.h"
#include "cvfMath.h"
#include "cvfMatrix4.h"
#include "cvfPlane.h"
#include <cmath>
CAF_PDM_SOURCE_INIT( RimFractureModel, "RimFractureModel" );
namespace caf
{
template <>
void caf::AppEnum<RimFractureModel::ExtractionType>::setUp()
{
addItem( RimFractureModel::ExtractionType::TRUE_VERTICAL_THICKNESS, "TVT", "True Vertical Thickness" );
addItem( RimFractureModel::ExtractionType::TRUE_STRATIGRAPHIC_THICKNESS, "TST", "True Stratigraphic Thickness" );
setDefault( RimFractureModel::ExtractionType::TRUE_VERTICAL_THICKNESS );
}
}; // namespace caf
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModel::RimFractureModel()
{
CAF_PDM_InitObject( "FractureModel", "", "", "" );
CAF_PDM_InitField( &m_MD, "MD", 0.0, "MD", "", "", "" );
CAF_PDM_InitField( &m_extractionType,
"ExtractionType",
caf::AppEnum<ExtractionType>( ExtractionType::TRUE_STRATIGRAPHIC_THICKNESS ),
"Extraction Type",
"",
"",
"" );
CAF_PDM_InitFieldNoDefault( &m_anchorPosition, "AnchorPosition", "Anchor Position", "", "", "" );
m_anchorPosition.uiCapability()->setUiReadOnly( true );
CAF_PDM_InitFieldNoDefault( &m_thicknessDirection, "ThicknessDirection", "Thickness Direction", "", "", "" );
m_thicknessDirection.uiCapability()->setUiReadOnly( true );
CAF_PDM_InitFieldNoDefault( &m_thicknessDirectionWellPath,
"ThicknessDirectionWellPath",
"Thickness Direction Well Path",
"",
"",
"" );
CAF_PDM_InitField( &m_boundingBoxHorizontal, "BoundingBoxHorizontal", 50.0, "Bounding Box Horizontal", "", "", "" );
CAF_PDM_InitField( &m_boundingBoxVertical, "BoundingBoxVertical", 100.0, "Bounding Box Vertical", "", "", "" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModel::~RimFractureModel()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimFractureModel::isEnabled() const
{
return isChecked();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModel::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
{
if ( changedField == &m_MD )
{
updatePositionFromMeasuredDepth();
}
if ( changedField == &m_MD || changedField == &m_extractionType || changedField == &m_boundingBoxVertical ||
changedField == &m_boundingBoxHorizontal )
{
updateThicknessDirection();
}
if ( changedField == &m_extractionType || changedField == &m_thicknessDirectionWellPath )
{
updateThicknessDirectionWellPathName();
m_thicknessDirectionWellPath()->updateConnectedEditors();
}
{
RimEclipseCase* eclipseCase = nullptr;
this->firstAncestorOrThisOfType( eclipseCase );
if ( eclipseCase )
{
RiaCompletionTypeCalculationScheduler::instance()->scheduleRecalculateCompletionTypeAndRedrawAllViews(
eclipseCase );
}
else
{
RiaCompletionTypeCalculationScheduler::instance()->scheduleRecalculateCompletionTypeAndRedrawAllViews();
}
RimProject::current()->scheduleCreateDisplayModelAndRedrawAllViews();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Vec3d RimFractureModel::fracturePosition() const
{
return m_anchorPosition;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaDefines::WellPathComponentType RimFractureModel::componentType() const
{
return RiaDefines::WellPathComponentType::FRACTURE;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimFractureModel::componentLabel() const
{
return name();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimFractureModel::componentTypeLabel() const
{
return "Fracture Model";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RimFractureModel::defaultComponentColor() const
{
return cvf::Color3f::RED; // RiaColorTables::wellPathComponentColors()[componentType()];
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModel::startMD() const
{
return m_MD();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFractureModel::endMD() const
{
return m_MD();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Vec3d RimFractureModel::anchorPosition() const
{
return m_anchorPosition();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Vec3d RimFractureModel::thicknessDirection() const
{
return m_thicknessDirection();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModel::updatePositionFromMeasuredDepth()
{
cvf::Vec3d positionAlongWellpath = cvf::Vec3d::ZERO;
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( this );
if ( !objHandle ) return;
RimWellPath* wellPath = nullptr;
objHandle->firstAncestorOrThisOfType( wellPath );
if ( !wellPath ) return;
RigWellPath* wellPathGeometry = wellPath->wellPathGeometry();
if ( wellPathGeometry )
{
positionAlongWellpath = wellPathGeometry->interpolatedPointAlongWellPath( m_MD() );
}
m_anchorPosition = positionAlongWellpath;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModel::updateThicknessDirection()
{
// True vertical thickness: just point straight up
cvf::Vec3d direction( 0.0, 0.0, -1.0 );
if ( m_extractionType() == ExtractionType::TRUE_STRATIGRAPHIC_THICKNESS )
{
direction = calculateTSTDirection();
}
m_thicknessDirection = direction;
if ( m_thicknessDirectionWellPath )
{
cvf::Vec3d topPosition;
cvf::Vec3d bottomPosition;
findThicknessTargetPoints( topPosition, bottomPosition );
topPosition.z() *= -1.0;
bottomPosition.z() *= -1.0;
RimWellPathGeometryDef* wellGeomDef = m_thicknessDirectionWellPath->geometryDefinition();
wellGeomDef->deleteAllTargets();
RimWellPathTarget* topPathTarget = new RimWellPathTarget();
topPathTarget->setAsPointTargetXYD( topPosition );
RimWellPathTarget* bottomPathTarget = new RimWellPathTarget();
bottomPathTarget->setAsPointTargetXYD( bottomPosition );
wellGeomDef->insertTarget( nullptr, topPathTarget );
wellGeomDef->insertTarget( nullptr, bottomPathTarget );
wellGeomDef->updateConnectedEditors();
wellGeomDef->updateWellPathVisualization();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Vec3d RimFractureModel::calculateTSTDirection() const
{
cvf::Vec3d defaultDirection = cvf::Vec3d( 0.0, 0.0, -1.0 );
// TODO: find a better way?
// Find an eclipse case
RimProject* proj = RimProject::current();
if ( proj->eclipseCases().empty() ) return defaultDirection;
RimEclipseCase* eclipseCase = proj->eclipseCases()[0];
if ( !eclipseCase ) return defaultDirection;
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
if ( !eclipseCaseData ) return defaultDirection;
RigMainGrid* mainGrid = eclipseCaseData->mainGrid();
if ( !mainGrid ) return defaultDirection;
cvf::Vec3d boundingBoxSize( m_boundingBoxHorizontal, m_boundingBoxHorizontal, m_boundingBoxVertical );
// Find upper face of cells close to the anchor point
cvf::BoundingBox boundingBox( m_anchorPosition() - boundingBoxSize, m_anchorPosition() + boundingBoxSize );
std::vector<size_t> closeCells;
mainGrid->findIntersectingCells( boundingBox, &closeCells );
// The stratigraphic thickness is the averge of normals of the top face
cvf::Vec3d direction = cvf::Vec3d::ZERO;
int numContributingCells = 0;
for ( size_t globalCellIndex : closeCells )
{
const RigCell& cell = mainGrid->globalCellArray()[globalCellIndex];
if ( !cell.isInvalid() )
{
direction += cell.faceNormalWithAreaLenght( cvf::StructGridInterface::NEG_K ).getNormalized();
numContributingCells++;
}
}
RiaLogging::info( QString( "TST contributing cells: %1/%2" ).arg( numContributingCells ).arg( closeCells.size() ) );
if ( numContributingCells == 0 )
{
// No valid close cells found: just point straight up
return defaultDirection;
}
return ( direction / static_cast<double>( numContributingCells ) ).getNormalized();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModel::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
m_thicknessDirectionWellPath.uiCapability()->setUiHidden( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellPath* RimFractureModel::wellPath() const
{
const caf::PdmObjectHandle* objHandle = dynamic_cast<const caf::PdmObjectHandle*>( this );
if ( !objHandle ) return nullptr;
RimWellPath* wellPath = nullptr;
objHandle->firstAncestorOrThisOfType( wellPath );
return wellPath;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimModeledWellPath* RimFractureModel::thicknessDirectionWellPath() const
{
return m_thicknessDirectionWellPath;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModel::setThicknessDirectionWellPath( RimModeledWellPath* thicknessDirectionWellPath )
{
m_thicknessDirectionWellPath = thicknessDirectionWellPath;
updateThicknessDirectionWellPathName();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModel::updateThicknessDirectionWellPathName()
{
QString wellNameFormat( "%1 for %2" );
m_thicknessDirectionWellPath()->setName( wellNameFormat.arg( m_extractionType().text() ).arg( name() ) );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimFractureModel::vecToString( const cvf::Vec3d& vec )
{
return QString( "[%1, %2, %3]" ).arg( vec.x() ).arg( vec.y() ).arg( vec.z() );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModel::findThicknessTargetPoints( cvf::Vec3d& topPosition, cvf::Vec3d& bottomPosition )
{
// TODO: duplicated and ugly!
RimProject* proj = RimProject::current();
if ( proj->eclipseCases().empty() ) return;
RimEclipseCase* eclipseCase = proj->eclipseCases()[0];
if ( !eclipseCase ) return;
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
if ( !eclipseCaseData ) return;
const cvf::Vec3d& position = anchorPosition();
const cvf::Vec3d& direction = thicknessDirection();
// Create a "fake" well path which from top to bottom of formation
// passing through the point and with the given direction
const cvf::BoundingBox& geometryBoundingBox = eclipseCase->mainGrid()->boundingBox();
RiaLogging::info( QString( "All cells bounding box: %1 %2" )
.arg( RimFractureModel::vecToString( geometryBoundingBox.min() ) )
.arg( RimFractureModel::vecToString( geometryBoundingBox.max() ) ) );
RiaLogging::info( QString( "Position: %1" ).arg( RimFractureModel::vecToString( position ) ) );
RiaLogging::info( QString( "Direction: %1" ).arg( RimFractureModel::vecToString( direction ) ) );
// Create plane on top and bottom of formation
cvf::Plane topPlane;
topPlane.setFromPointAndNormal( geometryBoundingBox.max(), cvf::Vec3d::Z_AXIS );
cvf::Plane bottomPlane;
bottomPlane.setFromPointAndNormal( geometryBoundingBox.min(), cvf::Vec3d::Z_AXIS );
// Find and add point on top plane
cvf::Vec3d abovePlane = position + ( direction * -10000.0 );
topPlane.intersect( position, abovePlane, &topPosition );
RiaLogging::info( QString( "Top: %1" ).arg( RimFractureModel::vecToString( topPosition ) ) );
// Find and add point on bottom plane
cvf::Vec3d belowPlane = position + ( direction * 10000.0 );
bottomPlane.intersect( position, belowPlane, &bottomPosition );
RiaLogging::info( QString( "Bottom: %1" ).arg( RimFractureModel::vecToString( bottomPosition ) ) );
}

View File

@@ -0,0 +1,95 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RiaEclipseUnitTools.h"
#include "RimCheckableNamedObject.h"
#include "RimWellPathComponentInterface.h"
#include "cvfObject.h"
#include "cvfVector3.h"
#include "cafPdmChildField.h"
#include "cafPdmFieldCvfVec3d.h"
#include "cafPdmProxyValueField.h"
#include "cafPdmPtrField.h"
class RimEclipseCase;
class RimWellPath;
class RimModeledWellPath;
//==================================================================================================
///
///
//==================================================================================================
class RimFractureModel : public RimCheckableNamedObject, public RimWellPathComponentInterface
{
CAF_PDM_HEADER_INIT;
public:
enum class ExtractionType
{
TRUE_VERTICAL_THICKNESS,
TRUE_STRATIGRAPHIC_THICKNESS,
};
RimFractureModel( void );
~RimFractureModel( void ) override;
cvf::Vec3d anchorPosition() const;
cvf::Vec3d thicknessDirection() const;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
cvf::Vec3d fracturePosition() const;
// RimWellPathCompletionsInterface overrides.
RiaDefines::WellPathComponentType componentType() const override;
QString componentLabel() const override;
QString componentTypeLabel() const override;
cvf::Color3f defaultComponentColor() const override;
double startMD() const override;
double endMD() const override;
bool isEnabled() const override;
RimWellPath* wellPath() const;
RimModeledWellPath* thicknessDirectionWellPath() const;
void setThicknessDirectionWellPath( RimModeledWellPath* thicknessDirectionWellPath );
protected:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
private:
void updatePositionFromMeasuredDepth();
void updateThicknessDirection();
cvf::Vec3d calculateTSTDirection() const;
void findThicknessTargetPoints( cvf::Vec3d& topPosition, cvf::Vec3d& bottomPosition );
static QString vecToString( const cvf::Vec3d& vec );
void updateThicknessDirectionWellPathName();
protected:
caf::PdmField<double> m_MD;
caf::PdmField<caf::AppEnum<ExtractionType>> m_extractionType;
caf::PdmField<cvf::Vec3d> m_anchorPosition;
caf::PdmField<cvf::Vec3d> m_thicknessDirection;
caf::PdmField<double> m_boundingBoxVertical;
caf::PdmField<double> m_boundingBoxHorizontal;
caf::PdmPtrField<RimModeledWellPath*> m_thicknessDirectionWellPath;
};

View File

@@ -0,0 +1,119 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimFractureModelCollection.h"
#include "RimFractureModel.h"
#include "RimProject.h"
#include "cafPdmObject.h"
CAF_PDM_SOURCE_INIT( RimFractureModelCollection, "FractureModelCollection" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModelCollection::RimFractureModelCollection( void )
{
CAF_PDM_InitObject( "Fracture Models", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_fractureModels, "FractureModels", "", "", "", "" );
m_fractureModels.uiCapability()->setUiHidden( true );
setName( "Fracture Models" );
nameField()->uiCapability()->setUiHidden( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModelCollection::~RimFractureModelCollection()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelCollection::addFractureModel( RimFractureModel* fracture )
{
m_fractureModels.push_back( fracture );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelCollection::deleteFractureModels()
{
m_fractureModels.deleteAllChildObjects();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimFractureModel*> RimFractureModelCollection::allFractureModels() const
{
return m_fractureModels.childObjects();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimFractureModel*> RimFractureModelCollection::activeFractureModels() const
{
std::vector<RimFractureModel*> active;
if ( isChecked() )
{
for ( const auto& f : allFractureModels() )
{
if ( f->isChecked() )
{
active.push_back( f );
}
}
}
return active;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelCollection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
uiOrdering.skipRemainingFields( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelCollection::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
{
RimProject* proj;
this->firstAncestorOrThisOfTypeAsserted( proj );
if ( changedField == &m_isChecked )
{
proj->reloadCompletionTypeResultsInAllViews();
}
else
{
proj->scheduleCreateDisplayModelAndRedrawAllViews();
}
}

View File

@@ -0,0 +1,53 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RimCheckableNamedObject.h"
#include "cafPdmChildArrayField.h"
#include <vector>
class RimFractureModel;
//==================================================================================================
///
///
//==================================================================================================
class RimFractureModelCollection : public RimCheckableNamedObject
{
CAF_PDM_HEADER_INIT;
public:
RimFractureModelCollection( void );
~RimFractureModelCollection( void ) override;
void addFractureModel( RimFractureModel* fracture );
void deleteFractureModels();
std::vector<RimFractureModel*> allFractureModels() const;
std::vector<RimFractureModel*> activeFractureModels() const;
private:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
private:
caf::PdmChildArrayField<RimFractureModel*> m_fractureModels;
};

View File

@@ -23,6 +23,8 @@
#include "RimFishboneWellPathCollection.h"
#include "RimFishbonesCollection.h"
#include "RimFishbonesMultipleSubs.h"
#include "RimFractureModel.h"
#include "RimFractureModelCollection.h"
#include "RimPerforationCollection.h"
#include "RimPerforationInterval.h"
#include "RimWellPathComponentInterface.h"
@@ -110,6 +112,10 @@ RimWellPathCompletions::RimWellPathCompletions()
m_fractureCollection = new RimWellPathFractureCollection;
m_fractureCollection.uiCapability()->setUiHidden( true );
CAF_PDM_InitFieldNoDefault( &m_fractureModelCollection, "FractureModels", "Fracture Models", "", "", "" );
m_fractureModelCollection = new RimFractureModelCollection;
m_fractureModelCollection.uiCapability()->setUiHidden( true );
CAF_PDM_InitField( &m_wellNameForExport, "WellNameForExport", QString(), "Well Name", "", "", "" );
m_wellNameForExport.uiCapability()->setUiEditorTypeName( caf::PdmUiLineEditor::uiEditorTypeName() );
@@ -224,6 +230,16 @@ RimWellPathFractureCollection* RimWellPathCompletions::fractureCollection() cons
return m_fractureCollection;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModelCollection* RimWellPathCompletions::fractureModelCollection() const
{
CVF_ASSERT( m_fractureModelCollection );
return m_fractureModelCollection;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -268,7 +284,7 @@ std::vector<const RimWellPathComponentInterface*> RimWellPathCompletions::allCom
//--------------------------------------------------------------------------------------------------
bool RimWellPathCompletions::hasCompletions() const
{
if ( !fractureCollection()->allFractures().empty() )
if ( !fractureCollection()->allFractures().empty() || !fractureModelCollection()->allFractureModels().empty() )
{
return true;
}
@@ -394,6 +410,11 @@ void RimWellPathCompletions::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTre
{
uiTreeOrdering.add( &m_fractureCollection );
}
if ( !fractureModelCollection()->allFractureModels().empty() )
{
uiTreeOrdering.add( &m_fractureModelCollection );
}
}
//--------------------------------------------------------------------------------------------------

View File

@@ -27,6 +27,7 @@ class RimPerforationCollection;
class RimWellPathFractureCollection;
class RimWellPathComponentInterface;
class RimWellPathValve;
class RimFractureModelCollection;
//==================================================================================================
///
@@ -74,6 +75,7 @@ public:
RimFishbonesCollection* fishbonesCollection() const;
RimPerforationCollection* perforationCollection() const;
RimWellPathFractureCollection* fractureCollection() const;
RimFractureModelCollection* fractureModelCollection() const;
std::vector<RimWellPathValve*> valves() const;
std::vector<const RimWellPathComponentInterface*> allCompletions() const;
@@ -112,6 +114,7 @@ private:
caf::PdmChildField<RimFishbonesCollection*> m_fishbonesCollection;
caf::PdmChildField<RimPerforationCollection*> m_perforationCollection;
caf::PdmChildField<RimWellPathFractureCollection*> m_fractureCollection;
caf::PdmChildField<RimFractureModelCollection*> m_fractureModelCollection;
caf::PdmField<QString> m_wellNameForExport;
caf::PdmField<QString> m_wellGroupName;

View File

@@ -1121,7 +1121,7 @@ void RimWellPltPlot::onLoadDataAndUpdate()
CAF_ASSERT( plotTrack );
if ( plotTrack )
{
plotTrack->setAnnotationType( RiuPlotAnnotationTool::FORMATION_ANNOTATIONS );
plotTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS );
}
}
m_isOnLoad = false;

View File

@@ -1063,7 +1063,7 @@ void RimWellRftPlot::onLoadDataAndUpdate()
CAF_ASSERT( plotTrack );
if ( plotTrack )
{
plotTrack->setAnnotationType( RiuPlotAnnotationTool::FORMATION_ANNOTATIONS );
plotTrack->setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS );
}
}

View File

@@ -68,6 +68,7 @@
#include "RimFlowPlotCollection.h"
#include "RimFormationNames.h"
#include "RimFormationNamesCollection.h"
#include "RimFractureModel.h"
#include "RimFractureTemplate.h"
#include "RimFractureTemplateCollection.h"
#include "RimGeoMechCase.h"
@@ -424,6 +425,11 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
{
menuBuilder << "RicDeleteWellPathAttributeFeature";
}
else if ( dynamic_cast<RimFractureModel*>( firstUiItem ) )
{
menuBuilder << "RicNewFractureModelPlotFeature";
menuBuilder << "RicImportFaciesFeature";
}
else if ( dynamic_cast<Rim3dWellLogCurveCollection*>( firstUiItem ) ||
dynamic_cast<Rim3dWellLogExtractionCurve*>( firstUiItem ) ||
dynamic_cast<Rim3dWellLogFileCurve*>( firstUiItem ) ||
@@ -1237,6 +1243,7 @@ int RimContextCommandBuilder::appendCreateCompletions( caf::CmdFeatureMenuBuilde
candidates << "RicNewValveFeature";
candidates << "RicNewFishbonesSubsFeature";
candidates << "RicNewWellPathFractureFeature";
candidates << "RicNewFractureModelFeature";
candidates << "Separator";
candidates << "RicCreateMultipleFracturesFeature";
candidates << "RicNewWellPathAttributeFeature";

View File

@@ -63,6 +63,7 @@
#include "RimTernaryLegendConfig.h"
#include "RimViewLinker.h"
#include "RimWellLogExtractionCurve.h"
#include "RimWellLogTrack.h"
#include "cafCategoryMapper.h"
#include "cafPdmFieldIOScriptability.h"
@@ -500,6 +501,14 @@ void RimEclipseResultDefinition::updateAnyFieldHasChanged()
{
contourMap->updatedWeightingResult();
}
RimWellLogTrack* wellLogTrack = nullptr;
this->firstAncestorOrThisOfType( wellLogTrack );
if ( wellLogTrack )
{
wellLogTrack->loadDataAndUpdate();
wellLogTrack->updateEditors();
}
}
//--------------------------------------------------------------------------------------------------

View File

@@ -0,0 +1,170 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimFractureModelCurve.h"
#include "RigEclipseCaseData.h"
#include "RigEclipseWellLogExtractor.h"
#include "RigResultAccessorFactory.h"
#include "RigWellLogCurveData.h"
#include "RigWellPath.h"
#include "RimCase.h"
#include "RimEclipseCase.h"
#include "RimEclipseResultDefinition.h"
#include "RimFractureModel.h"
#include "RimFractureModelPlot.h"
#include "RimModeledWellPath.h"
#include "RimTools.h"
#include "RimWellLogFile.h"
#include "RimWellLogPlot.h"
#include "RimWellLogTrack.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "RimWellPlotTools.h"
#include "RiuQwtPlotCurve.h"
#include "RiuQwtPlotWidget.h"
#include "RiaApplication.h"
#include "RiaPreferences.h"
#include "cafPdmUiTreeOrdering.h"
#include <QFileInfo>
#include <QMessageBox>
CAF_PDM_SOURCE_INIT( RimFractureModelCurve, "FractureModelCurve" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModelCurve::RimFractureModelCurve()
{
CAF_PDM_InitObject( "Fracture Model Curve", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_fractureModel, "FractureModel", "Fracture Model", "", "", "" );
m_fractureModel.uiCapability()->setUiTreeChildrenHidden( true );
m_fractureModel.uiCapability()->setUiHidden( true );
m_wellPath = nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModelCurve::~RimFractureModelCurve()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelCurve::setFractureModel( RimFractureModel* fractureModel )
{
m_fractureModel = fractureModel;
m_wellPath = fractureModel->thicknessDirectionWellPath();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelCurve::setEclipseResultCategory( RiaDefines::ResultCatType catType )
{
m_eclipseResultDefinition->setResultType( catType );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelCurve::performDataExtraction( bool* isUsingPseudoLength )
{
std::vector<double> values;
std::vector<double> measuredDepthValues;
std::vector<double> tvDepthValues;
double rkbDiff = 0.0;
RiaDefines::DepthUnitType depthUnit = RiaDefines::DepthUnitType::UNIT_METER;
QString xUnits = RiaWellLogUnitTools<double>::noUnitString();
*isUsingPseudoLength = false;
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( m_case.value() );
if ( eclipseCase )
{
RigEclipseWellLogExtractor eclExtractor( eclipseCase->eclipseCaseData(),
m_fractureModel->thicknessDirectionWellPath()->wellPathGeometry(),
"fracture model" );
measuredDepthValues = eclExtractor.cellIntersectionMDs();
tvDepthValues = eclExtractor.cellIntersectionTVDs();
rkbDiff = eclExtractor.wellPathData()->rkbDiff();
m_eclipseResultDefinition->setEclipseCase( eclipseCase );
m_eclipseResultDefinition->loadResult();
cvf::ref<RigResultAccessor> resAcc =
RigResultAccessorFactory::createFromResultDefinition( eclipseCase->eclipseCaseData(),
0,
m_timeStep,
m_eclipseResultDefinition );
if ( resAcc.notNull() )
{
eclExtractor.curveData( resAcc.p(), &values );
}
else
{
std::cerr << "RESULT ACCESSOR IS NULL" << std::endl;
}
RiaEclipseUnitTools::UnitSystem eclipseUnitsType = eclipseCase->eclipseCaseData()->unitsType();
if ( eclipseUnitsType == RiaEclipseUnitTools::UnitSystem::UNITS_FIELD )
{
// See https://github.com/OPM/ResInsight/issues/538
depthUnit = RiaDefines::DepthUnitType::UNIT_FEET;
}
}
bool performDataSmoothing = false;
if ( !values.empty() && !measuredDepthValues.empty() )
{
if ( tvDepthValues.empty() )
{
this->setValuesAndDepths( values,
measuredDepthValues,
RiaDefines::DepthTypeEnum::MEASURED_DEPTH,
0.0,
depthUnit,
!performDataSmoothing,
xUnits );
}
else
{
this->setValuesWithMdAndTVD( values,
measuredDepthValues,
tvDepthValues,
rkbDiff,
depthUnit,
!performDataSmoothing,
xUnits );
}
}
}

View File

@@ -0,0 +1,53 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2019- Equinor 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RimWellLogExtractionCurve.h"
#include "RiuQwtSymbol.h"
#include "cafPdmField.h"
#include "cafPdmPtrField.h"
#include <vector>
class RimWellPath;
class RimWellMeasurement;
class RimFractureModel;
//==================================================================================================
///
//==================================================================================================
class RimFractureModelCurve : public RimWellLogExtractionCurve
{
CAF_PDM_HEADER_INIT;
public:
RimFractureModelCurve();
~RimFractureModelCurve() override;
void setFractureModel( RimFractureModel* fractureModel );
void setEclipseResultCategory( RiaDefines::ResultCatType catType );
protected:
void performDataExtraction( bool* isUsingPseudoLength ) override;
caf::PdmPtrField<RimFractureModel*> m_fractureModel;
};

View File

@@ -0,0 +1,72 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimFractureModelPlot.h"
#include "RiaDefines.h"
#include "RicfCommandObject.h"
#include "RimEclipseCase.h"
#include "RimFractureModel.h"
#include "cafPdmBase.h"
#include "cafPdmFieldIOScriptability.h"
#include "cafPdmObject.h"
#include "cafPdmUiGroup.h"
CAF_PDM_SOURCE_INIT( RimFractureModelPlot, "FractureModelPlot" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModelPlot::RimFractureModelPlot()
{
CAF_PDM_InitScriptableObject( "Fracture Model Plot", "", "", "A fracture model plot" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
caf::PdmUiGroup* depthGroup = uiOrdering.addNewGroup( "Depth Axis" );
RimDepthTrackPlot::uiOrderingForDepthAxis( uiConfigName, *depthGroup );
caf::PdmUiGroup* titleGroup = uiOrdering.addNewGroup( "Plot Title" );
RimDepthTrackPlot::uiOrderingForAutoName( uiConfigName, *titleGroup );
caf::PdmUiGroup* plotLayoutGroup = uiOrdering.addNewGroup( "Plot Layout" );
RimPlotWindow::uiOrderingForPlotLayout( uiConfigName, *plotLayoutGroup );
uiOrdering.skipRemainingFields( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelPlot::onLoadDataAndUpdate()
{
RimDepthTrackPlot::onLoadDataAndUpdate();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelPlot::applyDataSource()
{
this->updateConnectedEditors();
}

View File

@@ -0,0 +1,39 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RimDepthTrackPlot.h"
#include "cafPdmField.h"
#include "cafPdmPtrField.h"
class RimFractureModelPlot : public RimDepthTrackPlot
{
CAF_PDM_HEADER_INIT;
public:
RimFractureModelPlot();
protected:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void onLoadDataAndUpdate() override;
private:
void applyDataSource();
};

View File

@@ -0,0 +1,77 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimFractureModelPlotCollection.h"
#include "RimFractureModelPlot.h"
CAF_PDM_SOURCE_INIT( RimFractureModelPlotCollection, "FractureModelPlotCollection" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModelPlotCollection::RimFractureModelPlotCollection()
{
CAF_PDM_InitObject( "FractureModelPlots", ":/WellLogPlots16x16.png", "", "" );
CAF_PDM_InitFieldNoDefault( &m_fractureModelPlots, "FractureModelPlots", "", "", "", "" );
m_fractureModelPlots.uiCapability()->setUiHidden( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModelPlotCollection::~RimFractureModelPlotCollection()
{
m_fractureModelPlots.deleteAllChildObjects();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelPlotCollection::reloadAllPlots()
{
for ( const auto& w : m_fractureModelPlots() )
{
w->loadDataAndUpdate();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelPlotCollection::addFractureModelPlot( RimFractureModelPlot* newPlot )
{
m_fractureModelPlots.push_back( newPlot );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimFractureModelPlot*> RimFractureModelPlotCollection::fractureModelPlots() const
{
return m_fractureModelPlots.childObjects();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModelPlotCollection::deleteAllPlots()
{
m_fractureModelPlots.deleteAllChildObjects();
}

View File

@@ -0,0 +1,49 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafPdmChildArrayField.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
class RimFractureModelPlot;
//==================================================================================================
///
///
//==================================================================================================
class RimFractureModelPlotCollection : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimFractureModelPlotCollection();
~RimFractureModelPlotCollection() override;
void addFractureModelPlot( RimFractureModelPlot* newPlot );
std::vector<RimFractureModelPlot*> fractureModelPlots() const;
void reloadAllPlots();
void deleteAllPlots();
private:
caf::PdmChildArrayField<RimFractureModelPlot*> m_fractureModelPlots;
};

View File

@@ -22,6 +22,8 @@
#include "RimCorrelationPlotCollection.h"
#include "RimFlowCharacteristicsPlot.h"
#include "RimFlowPlotCollection.h"
#include "RimFractureModelPlot.h"
#include "RimFractureModelPlotCollection.h"
#include "RimGridCrossPlot.h"
#include "RimGridCrossPlotCollection.h"
#include "RimMultiPlot.h"
@@ -93,6 +95,9 @@ RimMainPlotCollection::RimMainPlotCollection()
CAF_PDM_InitFieldNoDefault( &m_multiPlotCollection, "RimMultiPlotCollection", "Multi Plots", "", "", "" );
m_multiPlotCollection.uiCapability()->setUiHidden( true );
CAF_PDM_InitFieldNoDefault( &m_fractureModelPlotCollection, "FractureModelPlotCollection", "", "", "", "" );
m_fractureModelPlotCollection.uiCapability()->setUiHidden( true );
m_wellLogPlotCollection = new RimWellLogPlotCollection();
m_rftPlotCollection = new RimRftPlotCollection();
m_pltPlotCollection = new RimPltPlotCollection();
@@ -104,6 +109,7 @@ RimMainPlotCollection::RimMainPlotCollection()
m_multiPlotCollection = new RimMultiPlotCollection;
m_analysisPlotCollection = new RimAnalysisPlotCollection;
m_correlationPlotCollection = new RimCorrelationPlotCollection;
m_fractureModelPlotCollection = new RimFractureModelPlotCollection;
}
//--------------------------------------------------------------------------------------------------
@@ -218,6 +224,14 @@ RimCorrelationPlotCollection* RimMainPlotCollection::correlationPlotCollection()
return m_correlationPlotCollection();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModelPlotCollection* RimMainPlotCollection::fractureModelPlotCollection()
{
return m_fractureModelPlotCollection();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -234,6 +248,7 @@ void RimMainPlotCollection::deleteAllContainedObjects()
m_multiPlotCollection()->deleteAllChildObjects();
m_analysisPlotCollection()->deleteAllChildObjects();
m_correlationPlotCollection()->deleteAllChildObjects();
m_fractureModelPlotCollection()->deleteAllPlots();
}
//--------------------------------------------------------------------------------------------------
@@ -293,6 +308,14 @@ void RimMainPlotCollection::updatePlotsWithFormations()
plotWindow->loadDataAndUpdate();
}
}
if ( m_fractureModelPlotCollection )
{
for ( RimFractureModelPlot* fractureModelPlot : m_fractureModelPlotCollection->fractureModelPlots() )
{
fractureModelPlot->loadDataAndUpdate();
}
}
}
//--------------------------------------------------------------------------------------------------

View File

@@ -40,6 +40,7 @@ class RifReaderEclipseSummary;
class RimEclipseResultCase;
class RimFlowPlotCollection;
class RimSaturationPressurePlotCollection;
class RimFractureModelPlotCollection;
//==================================================================================================
///
@@ -64,6 +65,7 @@ public:
RimGridCrossPlotCollection* gridCrossPlotCollection();
RimSaturationPressurePlotCollection* saturationPressurePlotCollection();
RimMultiPlotCollection* multiPlotCollection();
RimFractureModelPlotCollection* fractureModelPlotCollection();
void deleteAllContainedObjects();
void updateCurrentTimeStepInPlots();
@@ -90,6 +92,7 @@ private:
caf::PdmChildField<RimGridCrossPlotCollection*> m_gridCrossPlotCollection;
caf::PdmChildField<RimSaturationPressurePlotCollection*> m_saturationPressurePlotCollection;
caf::PdmChildField<RimMultiPlotCollection*> m_multiPlotCollection;
caf::PdmChildField<RimFractureModelPlotCollection*> m_fractureModelPlotCollection;
caf::PdmField<bool> m_show;
};

View File

@@ -49,6 +49,7 @@
#include "RimEclipseCaseCollection.h"
#include "RimFlowPlotCollection.h"
#include "RimFormationNamesCollection.h"
#include "RimFractureModelPlotCollection.h"
#include "RimFractureTemplate.h"
#include "RimFractureTemplateCollection.h"
#include "RimGeoMechCase.h"
@@ -1436,6 +1437,11 @@ void RimProject::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, Q
{
itemCollection->add( mainPlotCollection->multiPlotCollection() );
}
if ( mainPlotCollection->fractureModelPlotCollection() )
{
itemCollection->add( mainPlotCollection->fractureModelPlotCollection() );
}
}
uiTreeOrdering.add( scriptCollection() );

View File

@@ -22,7 +22,7 @@
#include "RiaCurveDataTools.h"
#include "RigWellLogCurveData.h"
#include "RimWellLogPlot.h"
#include "RimDepthTrackPlot.h"
#include "RimWellLogTrack.h"
#include "RiuQwtPlotCurve.h"
@@ -98,7 +98,7 @@ bool RimWellLogCurve::yValueRangeInData( double* minimumValue, double* maximumVa
return false;
}
RimWellLogPlot* wellLogPlot = nullptr;
RimDepthTrackPlot* wellLogPlot = nullptr;
firstAncestorOrThisOfTypeAsserted( wellLogPlot );
auto depthType = wellLogPlot->depthType();
auto displayUnit = wellLogPlot->depthUnit();
@@ -193,7 +193,7 @@ void RimWellLogCurve::updateZoomInParentPlot()
{
wellLogTrack->setAutoScaleXIfNecessary();
RimWellLogPlot* wellLogPlot;
RimDepthTrackPlot* wellLogPlot;
wellLogTrack->firstAncestorOrThisOfType( wellLogPlot );
if ( wellLogPlot )

View File

@@ -338,7 +338,7 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate( bool updateParentPlot )
bool isUsingPseudoLength = false;
performDataExtraction( &isUsingPseudoLength );
RimWellLogPlot* wellLogPlot;
RimDepthTrackPlot* wellLogPlot;
firstAncestorOrThisOfType( wellLogPlot );
if ( !wellLogPlot ) return;

View File

@@ -105,14 +105,12 @@ protected:
static QString dataSourceGroupKeyword();
private:
void setLogScaleFromSelectedResult();
void clampTimestep();
void clampBranchIndex();
std::set<QString> sortedSimWellNames();
void clearGeneratedSimWellPaths();
private:
caf::PdmPtrField<RimCase*> m_case;
caf::PdmField<caf::AppEnum<TrajectoryType>> m_trajectoryType;
caf::PdmPtrField<RimWellPath*> m_wellPath;

View File

@@ -21,6 +21,7 @@
#include "RiaColorTables.h"
#include "RiaExtractionTools.h"
#include "RiaLogging.h"
#include "RiaSimWellBranchTools.h"
#include "RigEclipseCaseData.h"
@@ -41,7 +42,11 @@
#include "RigWellPathFormations.h"
#include "RimCase.h"
#include "RimColorLegend.h"
#include "RimColorLegendCollection.h"
#include "RimColorLegendItem.h"
#include "RimEclipseCase.h"
#include "RimEclipseResultDefinition.h"
#include "RimFishbonesCollection.h"
#include "RimFishbonesMultipleSubs.h"
#include "RimGeoMechCase.h"
@@ -131,10 +136,11 @@ void AppEnum<RigWellPathFormations::FormationLevel>::setUp()
template <>
void AppEnum<RiuPlotAnnotationTool::RegionAnnotationType>::setUp()
{
addItem( RiuPlotAnnotationTool::NO_ANNOTATIONS, "NO_ANNOTATIONS", "No Annotations" );
addItem( RiuPlotAnnotationTool::FORMATION_ANNOTATIONS, "FORMATIONS", "Formations" );
addItem( RiuPlotAnnotationTool::CURVE_ANNOTATIONS, "CURVE_DATA", "Curve Data Annotations" );
setDefault( RiuPlotAnnotationTool::NO_ANNOTATIONS );
addItem( RiuPlotAnnotationTool::RegionAnnotationType::NO_ANNOTATIONS, "NO_ANNOTATIONS", "No Annotations" );
addItem( RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS, "FORMATIONS", "Formations" );
addItem( RiuPlotAnnotationTool::RegionAnnotationType::CURVE_ANNOTATIONS, "CURVE_DATA", "Curve Data Annotations" );
addItem( RiuPlotAnnotationTool::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS, "RESULT_PROPERTY", "Result Property" );
setDefault( RiuPlotAnnotationTool::RegionAnnotationType::NO_ANNOTATIONS );
}
template <>
@@ -245,6 +251,11 @@ RimWellLogTrack::RimWellLogTrack()
CAF_PDM_InitFieldNoDefault( &m_wellPathComponentSource, "AttributesWellPathSource", "Well Path", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_wellPathAttributeCollection, "AttributesCollection", "Well Attributes", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_resultDefinition, "ResultDefinition", "Result Definition", "", "", "" );
m_resultDefinition.uiCapability()->setUiHidden( true );
m_resultDefinition.uiCapability()->setUiTreeChildrenHidden( true );
m_resultDefinition = new RimEclipseResultDefinition;
CAF_PDM_InitField( &m_show_OBSOLETE, "Show", false, "Show Plot", "", "", "" );
m_show_OBSOLETE.uiCapability()->setUiHidden( true );
m_show_OBSOLETE.xmlCapability()->setIOWritable( false );
@@ -944,19 +955,25 @@ QList<caf::PdmOptionItemInfo> RimWellLogTrack::calculateValueOptions( const caf:
if ( fieldNeedingOptions == &m_regionAnnotationType )
{
options.push_back( caf::PdmOptionItemInfo( RegionAnnotationTypeEnum::uiText( RiuPlotAnnotationTool::NO_ANNOTATIONS ),
RiuPlotAnnotationTool::NO_ANNOTATIONS ) );
options.push_back(
caf::PdmOptionItemInfo( RegionAnnotationTypeEnum::uiText( RiuPlotAnnotationTool::FORMATION_ANNOTATIONS ),
RiuPlotAnnotationTool::FORMATION_ANNOTATIONS ) );
options.push_back( caf::PdmOptionItemInfo( RegionAnnotationTypeEnum::uiText(
RiuPlotAnnotationTool::RegionAnnotationType::NO_ANNOTATIONS ),
RiuPlotAnnotationTool::RegionAnnotationType::NO_ANNOTATIONS ) );
options.push_back( caf::PdmOptionItemInfo( RegionAnnotationTypeEnum::uiText(
RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS ),
RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS ) );
RimWellBoreStabilityPlot* wellBoreStabilityPlot = nullptr;
this->firstAncestorOrThisOfType( wellBoreStabilityPlot );
if ( wellBoreStabilityPlot )
{
options.push_back(
caf::PdmOptionItemInfo( RegionAnnotationTypeEnum::uiText( RiuPlotAnnotationTool::CURVE_ANNOTATIONS ),
RiuPlotAnnotationTool::CURVE_ANNOTATIONS ) );
options.push_back( caf::PdmOptionItemInfo( RegionAnnotationTypeEnum::uiText(
RiuPlotAnnotationTool::RegionAnnotationType::CURVE_ANNOTATIONS ),
RiuPlotAnnotationTool::RegionAnnotationType::CURVE_ANNOTATIONS ) );
}
options.push_back(
caf::PdmOptionItemInfo( RegionAnnotationTypeEnum::uiText(
RiuPlotAnnotationTool::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS ),
RiuPlotAnnotationTool::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS ) );
}
if ( fieldNeedingOptions == &m_formationWellPathForSourceCase )
{
@@ -1142,15 +1159,17 @@ void RimWellLogTrack::onLoadDataAndUpdate()
m_curves[cIdx]->loadDataAndUpdate( false );
}
if ( m_regionAnnotationType == RiuPlotAnnotationTool::FORMATION_ANNOTATIONS )
if ( m_regionAnnotationType == RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS ||
m_regionAnnotationType == RiuPlotAnnotationTool::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS )
{
m_resultDefinition->loadDataAndUpdate();
setFormationFieldsUiReadOnly( false );
}
else
{
setFormationFieldsUiReadOnly( true );
}
bool noAnnotations = m_regionAnnotationType() == RiuPlotAnnotationTool::NO_ANNOTATIONS;
bool noAnnotations = m_regionAnnotationType() == RiuPlotAnnotationTool::RegionAnnotationType::NO_ANNOTATIONS;
m_regionAnnotationDisplay.uiCapability()->setUiReadOnly( noAnnotations );
m_showRegionLabels.uiCapability()->setUiReadOnly( noAnnotations );
@@ -1190,7 +1209,7 @@ void RimWellLogTrack::setAndUpdateWellPathFormationNamesData( RimCase* rimCase,
updateConnectedEditors();
if ( m_regionAnnotationType != RiuPlotAnnotationTool::NO_ANNOTATIONS )
if ( m_regionAnnotationType != RiuPlotAnnotationTool::RegionAnnotationType::NO_ANNOTATIONS )
{
updateRegionAnnotationsOnPlot();
}
@@ -1222,7 +1241,7 @@ void RimWellLogTrack::setAndUpdateSimWellFormationNamesData( RimCase* rimCase, c
updateConnectedEditors();
if ( m_regionAnnotationType != RiuPlotAnnotationTool::NO_ANNOTATIONS )
if ( m_regionAnnotationType != RiuPlotAnnotationTool::RegionAnnotationType::NO_ANNOTATIONS )
{
updateRegionAnnotationsOnPlot();
}
@@ -1362,6 +1381,17 @@ int RimWellLogTrack::formationBranchIndex() const
void RimWellLogTrack::setFormationCase( RimCase* rimCase )
{
m_formationCase = rimCase;
m_resultDefinition->setEclipseCase( dynamic_cast<RimEclipseCase*>( rimCase ) );
m_resultDefinition->setPorosityModel( RiaDefines::PorosityModelType::MATRIX_MODEL );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setRegionPropertyResultType( RiaDefines::ResultCatType resultCatType, const QString& resultVariable )
{
m_resultDefinition->setResultType( resultCatType );
m_resultDefinition->setResultVariable( resultVariable );
}
//--------------------------------------------------------------------------------------------------
@@ -1558,7 +1588,7 @@ RiuPlotAnnotationTool::RegionDisplay RimWellLogTrack::annotationDisplay() const
//--------------------------------------------------------------------------------------------------
bool RimWellLogTrack::showFormations() const
{
return m_regionAnnotationType() == RiuPlotAnnotationTool::FORMATION_ANNOTATIONS;
return m_regionAnnotationType() == RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS;
}
//--------------------------------------------------------------------------------------------------
@@ -1751,6 +1781,11 @@ void RimWellLogTrack::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
}
}
if ( m_regionAnnotationType() == RiuPlotAnnotationTool::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS )
{
m_resultDefinition->uiOrdering( uiConfigName, *annotationGroup );
}
caf::PdmUiGroup* componentGroup = uiOrdering.addNewGroup( "Well Path Components" );
componentGroup->add( &m_showWellPathAttributes );
componentGroup->add( &m_showWellPathCompletions );
@@ -1771,12 +1806,19 @@ void RimWellLogTrack::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::initAfterRead()
{
if ( m_showFormations_OBSOLETE() && m_regionAnnotationType() == RiuPlotAnnotationTool::NO_ANNOTATIONS )
if ( m_showFormations_OBSOLETE() &&
m_regionAnnotationType() == RiuPlotAnnotationTool::RegionAnnotationType::NO_ANNOTATIONS )
{
m_regionAnnotationType = RiuPlotAnnotationTool::FORMATION_ANNOTATIONS;
m_regionAnnotationType = RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS;
m_regionAnnotationDisplay = RiuPlotAnnotationTool::DARK_LINES;
}
if ( m_regionAnnotationType() == RiuPlotAnnotationTool::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS )
{
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( m_formationCase.value() );
m_resultDefinition->setEclipseCase( dynamic_cast<RimEclipseCase*>( eclipseCase ) );
}
if ( m_xAxisGridVisibility() == RimWellLogPlot::AXIS_GRID_MINOR )
{
m_xAxisGridVisibility = RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR;
@@ -1827,6 +1869,8 @@ size_t RimWellLogTrack::curveIndex( RimWellLogCurve* curve )
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::updateAxisScaleEngine()
{
if ( !m_plotWidget ) return;
if ( m_isLogarithmicScaleEnabled )
{
m_plotWidget->setAxisScaleEngine( QwtPlot::xTop, new QwtLogScaleEngine );
@@ -1875,9 +1919,9 @@ void RimWellLogTrack::updateWellPathAttributesCollection()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogPlot* RimWellLogTrack::parentWellLogPlot() const
RimDepthTrackPlot* RimWellLogTrack::parentWellLogPlot() const
{
RimWellLogPlot* wellLogPlot = nullptr;
RimDepthTrackPlot* wellLogPlot = nullptr;
this->firstAncestorOrThisOfTypeAsserted( wellLogPlot );
return wellLogPlot;
}
@@ -2252,6 +2296,8 @@ void RimWellLogTrack::setFormationFieldsUiReadOnly( bool readOnly /*= true*/ )
m_formationBranchIndex.uiCapability()->setUiReadOnly( readOnly );
m_formationLevel.uiCapability()->setUiReadOnly( readOnly );
m_showformationFluids.uiCapability()->setUiReadOnly( readOnly );
m_colorShadingTransparency.uiCapability()->setUiReadOnly( readOnly );
m_colorShadingPalette.uiCapability()->setUiReadOnly( readOnly );
}
//--------------------------------------------------------------------------------------------------
@@ -2261,17 +2307,21 @@ void RimWellLogTrack::updateRegionAnnotationsOnPlot()
{
removeRegionAnnotations();
if ( m_regionAnnotationType == RiuPlotAnnotationTool::NO_ANNOTATIONS ) return;
if ( m_regionAnnotationType == RiuPlotAnnotationTool::RegionAnnotationType::NO_ANNOTATIONS ) return;
if ( m_annotationTool == nullptr )
{
m_annotationTool = std::unique_ptr<RiuPlotAnnotationTool>( new RiuPlotAnnotationTool() );
}
if ( m_regionAnnotationType == RiuPlotAnnotationTool::FORMATION_ANNOTATIONS )
if ( m_regionAnnotationType == RiuPlotAnnotationTool::RegionAnnotationType::FORMATION_ANNOTATIONS )
{
updateFormationNamesOnPlot();
}
else if ( m_regionAnnotationType == RiuPlotAnnotationTool::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS )
{
updateResultPropertyNamesOnPlot();
}
else
{
updateCurveDataRegionsOnPlot();
@@ -2283,7 +2333,7 @@ void RimWellLogTrack::updateRegionAnnotationsOnPlot()
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::updateFormationNamesOnPlot()
{
RimWellLogPlot* plot = nullptr;
RimDepthTrackPlot* plot = nullptr;
firstAncestorOrThisOfTypeAsserted( plot );
if ( m_formationSource() == WELL_PICK_FILTER )
@@ -2392,7 +2442,7 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
waterAndRockColors,
( ( 100 - m_colorShadingTransparency ) * 255 ) / 100,
m_showRegionLabels(),
RiuPlotAnnotationTool::LEFT_COLUMN,
RiuPlotAnnotationTool::TrackSpan::LEFT_COLUMN,
{Qt::SolidPattern, Qt::Dense6Pattern} );
}
@@ -2426,6 +2476,103 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::updateResultPropertyNamesOnPlot()
{
RimDepthTrackPlot* plot = nullptr;
firstAncestorOrThisOfTypeAsserted( plot );
RimMainPlotCollection* mainPlotCollection;
this->firstAncestorOrThisOfTypeAsserted( mainPlotCollection );
RimWellLogPlotCollection* wellLogCollection = mainPlotCollection->wellLogPlotCollection();
RigEclipseWellLogExtractor* eclWellLogExtractor =
RiaExtractionTools::wellLogExtractorEclipseCase( m_formationWellPathForSourceCase,
dynamic_cast<RimEclipseCase*>( m_formationCase() ) );
if ( !eclWellLogExtractor )
{
RiaLogging::error( "No well log extractor found for case." );
return;
}
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( m_formationCase() );
m_resultDefinition->loadResult();
size_t m_timeStep = 0;
cvf::ref<RigResultAccessor> resultAccessor =
RigResultAccessorFactory::createFromResultDefinition( eclipseCase->eclipseCaseData(), 0, m_timeStep, m_resultDefinition );
if ( !resultAccessor.notNull() )
{
RiaLogging::error( "Unable to get result accessor" );
return;
}
CurveSamplingPointData curveData = RimWellLogTrack::curveSamplingPointData( eclWellLogExtractor, resultAccessor.p() );
// Attach water and rock base formations
const std::pair<double, double> xRange = std::make_pair( m_visibleXRangeMin(), m_visibleXRangeMax() );
if ( m_formationSource == CASE )
{
if ( ( m_formationSimWellName == QString( "None" ) && m_formationWellPathForSourceCase == nullptr ) ||
m_formationCase == nullptr )
return;
RimProject* proj = RimProject::current();
RimColorLegendCollection* colorLegendCollection = proj->colorLegendCollection;
std::vector<RimColorLegend*> legends = colorLegendCollection->colorLegends();
if ( legends.empty() )
{
RiaLogging::error( "No color legend found." );
return;
}
// TODO: let the user select the color legend instead of just picking the first one...
std::vector<cvf::Color3ub> colors;
std::vector<QString> namesVector;
for ( RimColorLegendItem* legendItem : legends[0]->colorLegendItems() )
{
namesVector.push_back( legendItem->categoryName() );
}
std::vector<QString> namesToPlot;
std::vector<std::pair<double, double>> yValues;
RimWellLogTrack::findRegionNamesToPlot( curveData, namesVector, plot->depthType(), &namesToPlot, &yValues );
// TODO: unecessarily messy!
// Need to map colors to names (since a category can be used several times)
for ( QString nameToPlot : namesToPlot )
{
for ( RimColorLegendItem* legendItem : legends[0]->colorLegendItems() )
{
if ( legendItem->categoryName() == nameToPlot )
colors.push_back( cvf::Color3ub( legendItem->color() ) );
}
}
if ( colors.empty() )
{
RiaLogging::error( "No colors found." );
return;
}
caf::ColorTable colorTable( colors );
m_annotationTool->attachNamedRegions( m_plotWidget,
namesToPlot,
xRange,
yValues,
m_regionAnnotationDisplay(),
colorTable,
( ( 100 - m_colorShadingTransparency ) * 255 ) / 100,
m_showRegionLabels() );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -2489,7 +2636,7 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot()
colorTable,
( ( ( 100 - m_colorShadingTransparency ) * 255 ) / 100 ) / 3,
m_showRegionLabels(),
RiuPlotAnnotationTool::LEFT_COLUMN );
RiuPlotAnnotationTool::TrackSpan::LEFT_COLUMN );
}
{
caf::ColorTable colorTable( RimRegularLegendConfig::colorArrayFromColorType( m_colorShadingPalette() ) );
@@ -2515,7 +2662,7 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot()
colorTable,
( ( ( 100 - m_colorShadingTransparency ) * 255 ) / 100 ) / 3,
m_showRegionLabels(),
RiuPlotAnnotationTool::CENTRE_COLUMN );
RiuPlotAnnotationTool::TrackSpan::CENTRE_COLUMN );
}
{
caf::ColorTable colorTable( RimRegularLegendConfig::colorArrayFromColorType( m_colorShadingPalette() ) );
@@ -2540,7 +2687,7 @@ void RimWellLogTrack::updateCurveDataRegionsOnPlot()
colorTable,
( ( ( 100 - m_colorShadingTransparency ) * 255 ) / 100 ) / 3,
m_showRegionLabels(),
RiuPlotAnnotationTool::RIGHT_COLUMN );
RiuPlotAnnotationTool::TrackSpan::RIGHT_COLUMN );
}
}
}
@@ -2622,7 +2769,7 @@ void RimWellLogTrack::updateWellPathAttributesOnPlot()
completionsAssignedToLegend.insert( legendTitle );
}
RimWellLogPlot* wellLogPlot;
RimDepthTrackPlot* wellLogPlot;
this->firstAncestorOrThisOfTypeAsserted( wellLogPlot );
RimWellLogPlot::DepthTypeEnum depthType = wellLogPlot->depthType();

View File

@@ -46,6 +46,7 @@ class RimWellPathAttributeCollection;
class RimWellFlowRateCurve;
class RimWellLogCurve;
class RimWellPath;
class RimDepthTrackPlot;
class RiuWellPathComponentPlotItem;
class RiuWellLogTrack;
class RigEclipseWellLogExtractor;
@@ -54,6 +55,7 @@ class RigGeoMechWellLogExtractor;
class RigResultAccessor;
class RigFemResultAddress;
class RigWellLogExtractor;
class RimEclipseResultDefinition;
class QwtPlotCurve;
@@ -124,6 +126,7 @@ public:
RimCase* formationNamesCase() const;
void setFormationTrajectoryType( TrajectoryType trajectoryType );
TrajectoryType formationTrajectoryType() const;
void setRegionPropertyResultType( RiaDefines::ResultCatType resultCatType, const QString& resultVariable );
void detachAllCurves() override;
void reattachAllCurves() override;
@@ -266,6 +269,7 @@ private:
void updateRegionAnnotationsOnPlot();
void updateFormationNamesOnPlot();
void updateResultPropertyNamesOnPlot();
void updateCurveDataRegionsOnPlot();
void updateWellPathAttributesOnPlot();
void removeRegionAnnotations();
@@ -275,7 +279,7 @@ private:
void updateWellPathAttributesCollection();
RimWellLogPlot* parentWellLogPlot() const;
RimDepthTrackPlot* parentWellLogPlot() const;
void handleWheelEvent( QWheelEvent* event ) override;
void doUpdateLayout() override;
@@ -324,6 +328,7 @@ private:
caf::PdmField<bool> m_wellPathCompletionsInLegend;
caf::PdmPtrField<RimWellPath*> m_wellPathComponentSource;
caf::PdmPtrField<RimWellPathAttributeCollection*> m_wellPathAttributeCollection;
caf::PdmChildField<RimEclipseResultDefinition*> m_resultDefinition;
caf::PdmField<bool> m_showFormations_OBSOLETE;
caf::PdmField<bool> m_show_OBSOLETE;

View File

@@ -35,6 +35,7 @@
#include "Rim3dWellLogCurve.h"
#include "Rim3dWellLogCurveCollection.h"
#include "RimFishbonesMultipleSubs.h"
#include "RimFractureModelCollection.h"
#include "RimMainPlotCollection.h"
#include "RimProject.h"
#include "RimTools.h"
@@ -325,6 +326,26 @@ const RimWellPathFractureCollection* RimWellPath::fractureCollection() const
return m_completions->fractureCollection();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFractureModelCollection* RimWellPath::fractureModelCollection()
{
CVF_ASSERT( m_completions );
return m_completions->fractureModelCollection();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const RimFractureModelCollection* RimWellPath::fractureModelCollection() const
{
CVF_ASSERT( m_completions );
return m_completions->fractureModelCollection();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -47,6 +47,7 @@ class RimProject;
class RimWellLogFile;
class RimFractureTemplateCollection;
class RimFishboneWellPathCollection;
class RimFractureModelCollection;
class RimFishbonesCollection;
class RimPerforationCollection;
@@ -113,6 +114,8 @@ public:
const RimPerforationCollection* perforationIntervalCollection() const;
RimWellPathFractureCollection* fractureCollection();
const RimWellPathFractureCollection* fractureCollection() const;
RimFractureModelCollection* fractureModelCollection();
const RimFractureModelCollection* fractureModelCollection() const;
RimWellPathAttributeCollection* attributeCollection();
const RimWellPathAttributeCollection* attributeCollection() const;

View File

@@ -210,7 +210,7 @@ std::pair<RimWellPathTarget*, RimWellPathTarget*>
if ( wt->isEnabled() && !foundTarget ) before = wt;
}
return { before, after };
return {before, after};
}
//--------------------------------------------------------------------------------------------------
@@ -234,6 +234,14 @@ void RimWellPathGeometryDef::deleteTarget( RimWellPathTarget* targetTodelete )
delete targetTodelete;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathGeometryDef::deleteAllTargets()
{
m_wellTargets.deleteAllChildObjects();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -451,7 +459,7 @@ void RimWellPathGeometryDef::updateTargetAtSeaLevel()
newPos = firstTarget->targetPointXYZ() - horizontalLengthFromTarget * tangentInHorizontalPlane;
newPos.z() = -referencePointXyz().z();
m_autoTargetAtSeaLevel->setAsPointXYZAndTangentTarget( { newPos[0], newPos[1], newPos[2] }, 0, 0 );
m_autoTargetAtSeaLevel->setAsPointXYZAndTangentTarget( {newPos[0], newPos[1], newPos[2]}, 0, 0 );
}
}

View File

@@ -59,6 +59,7 @@ public:
void insertTarget( const RimWellPathTarget* targetToInsertBefore, RimWellPathTarget* targetToInsert );
void deleteTarget( RimWellPathTarget* targetTodelete );
void deleteAllTargets();
void appendTarget();
const RimWellPathTarget* firstActiveTarget() const;

View File

@@ -196,13 +196,13 @@ Qt::Alignment RiuPlotAnnotationTool::trackTextAlignment( TrackSpan trackSpan )
{
switch ( trackSpan )
{
case FULL_WIDTH:
case TrackSpan::FULL_WIDTH:
return Qt::AlignRight;
case LEFT_COLUMN:
case TrackSpan::LEFT_COLUMN:
return Qt::AlignLeft;
case CENTRE_COLUMN:
case TrackSpan::CENTRE_COLUMN:
return Qt::AlignCenter;
case RIGHT_COLUMN:
case TrackSpan::RIGHT_COLUMN:
return Qt::AlignRight;
}
return Qt::AlignRight;

View File

@@ -33,11 +33,12 @@ class QwtPlot;
class RiuPlotAnnotationTool
{
public:
enum RegionAnnotationType
enum class RegionAnnotationType
{
NO_ANNOTATIONS = 0,
FORMATION_ANNOTATIONS = 1,
CURVE_ANNOTATIONS = 2
NO_ANNOTATIONS = 0,
FORMATION_ANNOTATIONS = 1,
CURVE_ANNOTATIONS = 2,
RESULT_PROPERTY_ANNOTATIONS = 3
};
enum RegionDisplay
{
@@ -47,7 +48,7 @@ public:
COLOR_SHADING_AND_LINES = 0x05,
LIGHT_LINES = 0x08,
};
enum TrackSpan
enum class TrackSpan
{
FULL_WIDTH,
LEFT_COLUMN,
@@ -67,7 +68,7 @@ public:
const caf::ColorTable& colorTable,
int shadingAlphaByte,
bool showNames = true,
TrackSpan trackSpan = FULL_WIDTH,
TrackSpan trackSpan = TrackSpan::FULL_WIDTH,
const std::vector<Qt::BrushStyle>& brushStyles = {} );
void attachWellPicks( QwtPlot* plot, const std::vector<QString>& names, const std::vector<double>& yPositions );