#2127 Sim Well Branches : Major refactor of sim well branch computation

Remove local branch geometry caches
Add checkbox to control if branch detection should be used
Add RiaSimWllBranchTools and move helper functions from RimProject
This commit is contained in:
Magne Sjaastad
2017-12-07 14:51:58 +01:00
parent 94a4bfeea5
commit 1841379e64
23 changed files with 345 additions and 312 deletions

View File

@@ -167,7 +167,7 @@ RimWellPath* RicWellLogTools::selectedWellPathWithLogFile()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogExtractionCurve* RicWellLogTools::addExtractionCurve(RimWellLogTrack* plotTrack, RimView* view, RimWellPath* wellPath, const RimSimWellInView* simWell, int branchIndex)
RimWellLogExtractionCurve* RicWellLogTools::addExtractionCurve(RimWellLogTrack* plotTrack, RimView* view, RimWellPath* wellPath, const RimSimWellInView* simWell, int branchIndex, bool useBranchDetection)
{
CVF_ASSERT(plotTrack);
RimWellLogExtractionCurve* curve = new RimWellLogExtractionCurve();
@@ -182,7 +182,7 @@ RimWellLogExtractionCurve* RicWellLogTools::addExtractionCurve(RimWellLogTrack*
}
if (simWell)
{
curve->setFromSimulationWellName(simWell->name(), branchIndex);
curve->setFromSimulationWellName(simWell->name(), branchIndex, useBranchDetection);
plotTrack->setFormationSimWellName(simWell->name());
plotTrack->setFormationBranchIndex(branchIndex);
plotTrack->setFormationTrajectoryType(RimWellLogTrack::SIMULATION_WELL);

View File

@@ -1,23 +1,27 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017- Statoil ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include <QString>
#include <vector>
class RimSimWellInView;
class RimView;
class RimWellLogExtractionCurve;
@@ -27,24 +31,23 @@ class RimWellLogRftCurve;
class RimWellLogTrack;
class RimWellPath;
#include <QString>
#include <vector>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
class RicWellLogTools
{
public:
static RimWellLogTrack* selectedWellLogPlotTrack();
static RimSimWellInView* selectedSimulationWell(int *branchIndex);
static RimWellPath* selectedWellPath();
static bool wellHasRftData(const QString& wellName);
static bool isWellPathOrSimWellSelectedInView();
static void addWellLogChannelsToPlotTrack(RimWellLogTrack* plotTrack, const std::vector<RimWellLogFileChannel*>& wellLogFileChannels);
static RimWellPath* selectedWellPathWithLogFile();
static RimWellLogExtractionCurve* addExtractionCurve(RimWellLogTrack* plotTrack, RimView* view, RimWellPath* wellPath, const RimSimWellInView* simWell, int branchIndex);
static RimWellLogRftCurve* addRftCurve(RimWellLogTrack* plotTrack, const RimSimWellInView* simWell);
static RimWellLogFileCurve* addFileCurve(RimWellLogTrack* plotTrack);
};
static RimWellLogTrack* selectedWellLogPlotTrack();
static RimSimWellInView* selectedSimulationWell(int* branchIndex);
static RimWellPath* selectedWellPath();
static bool wellHasRftData(const QString& wellName);
static bool isWellPathOrSimWellSelectedInView();
static void addWellLogChannelsToPlotTrack(RimWellLogTrack* plotTrack,
const std::vector<RimWellLogFileChannel*>& wellLogFileChannels);
static RimWellPath* selectedWellPathWithLogFile();
static RimWellLogExtractionCurve* addExtractionCurve(RimWellLogTrack* plotTrack, RimView* view, RimWellPath* wellPath,
const RimSimWellInView* simWell, int branchIndex,
bool useBranchDetection);
static RimWellLogRftCurve* addRftCurve(RimWellLogTrack* plotTrack, const RimSimWellInView* simWell);
static RimWellLogFileCurve* addFileCurve(RimWellLogTrack* plotTrack);
};

View File

@@ -44,6 +44,7 @@
#include <QAction>
#include <vector>
#include "RimSimWellInViewCollection.h"
CAF_CMD_SOURCE_INIT(RicNewWellLogCurveExtractionFeature, "RicNewWellLogCurveExtractionFeature");
@@ -69,17 +70,29 @@ void RicNewWellLogCurveExtractionFeature::onActionTriggered(bool isChecked)
RimWellLogTrack* wellLogPlotTrack = RicWellLogTools::selectedWellLogPlotTrack();
if (wellLogPlotTrack)
{
RicWellLogTools::addExtractionCurve(wellLogPlotTrack, nullptr, nullptr, nullptr, -1);
RicWellLogTools::addExtractionCurve(wellLogPlotTrack, nullptr, nullptr, nullptr, -1, true);
}
else
{
RimWellPath* wellPath = RicWellLogTools::selectedWellPath();
int branchIndex = -1;
RimSimWellInView* simWell = RicWellLogTools::selectedSimulationWell(&branchIndex);
bool useBranchDetection = true;
RimSimWellInViewCollection* simWellColl = nullptr;
if (simWell)
{
simWell->firstAncestorOrThisOfTypeAsserted(simWellColl);
useBranchDetection = simWellColl->isAutoDetectingBranches;
}
if (wellPath || simWell)
{
RimWellLogTrack* wellLogPlotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack();
RimWellLogExtractionCurve* plotCurve = RicWellLogTools::addExtractionCurve(wellLogPlotTrack, RiaApplication::instance()->activeReservoirView(), wellPath, simWell, branchIndex);
RimWellLogExtractionCurve* plotCurve =
RicWellLogTools::addExtractionCurve(wellLogPlotTrack, RiaApplication::instance()->activeReservoirView(), wellPath,
simWell, branchIndex, useBranchDetection);
plotCurve->loadDataAndUpdate(true);

View File

@@ -53,7 +53,7 @@ bool RicNewWellLogPlotFeature::isCommandEnabled()
void RicNewWellLogPlotFeature::onActionTriggered(bool isChecked)
{
RimWellLogTrack* plotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack();
RicWellLogTools::addExtractionCurve(plotTrack, nullptr, nullptr, nullptr, -1);
RicWellLogTools::addExtractionCurve(plotTrack, nullptr, nullptr, nullptr, -1, true);
}
//--------------------------------------------------------------------------------------------------

View File

@@ -62,7 +62,7 @@ void RicNewWellLogPlotTrackFeature::onActionTriggered(bool isChecked)
plotTrack->setDescription(QString("Track %1").arg(wellLogPlot->trackCount()));
wellLogPlot->updateConnectedEditors();
RicWellLogTools::addExtractionCurve(plotTrack, nullptr, nullptr, nullptr, -1);
RicWellLogTools::addExtractionCurve(plotTrack, nullptr, nullptr, nullptr, -1, true);
}
}