mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
#1520 Establish new result type 'Completion Type'
This commit is contained in:
+2
-1
@@ -53,6 +53,7 @@ void RicNewFishbonesSubsAtMeasuredDepthFeature::onActionTriggered(bool isChecked
|
|||||||
int integerValue = wellPathSelItem->m_measuredDepth;
|
int integerValue = wellPathSelItem->m_measuredDepth;
|
||||||
obj->setMeasuredDepthAndCount(integerValue, 24, 1);
|
obj->setMeasuredDepthAndCount(integerValue, 24, 1);
|
||||||
|
|
||||||
|
|
||||||
RicNewFishbonesSubsFeature::askUserToSetUsefulScaling(wellPath->fishbonesCollection());
|
RicNewFishbonesSubsFeature::askUserToSetUsefulScaling(wellPath->fishbonesCollection());
|
||||||
|
|
||||||
wellPath->updateConnectedEditors();
|
wellPath->updateConnectedEditors();
|
||||||
@@ -60,7 +61,7 @@ void RicNewFishbonesSubsAtMeasuredDepthFeature::onActionTriggered(bool isChecked
|
|||||||
|
|
||||||
RimProject* proj;
|
RimProject* proj;
|
||||||
wellPath->firstAncestorOrThisOfTypeAsserted(proj);
|
wellPath->firstAncestorOrThisOfTypeAsserted(proj);
|
||||||
proj->createDisplayModelAndRedrawAllViews();
|
proj->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName());
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
|
||||||
|
#include "RimProject.h"
|
||||||
#include "RimFishboneWellPathCollection.h"
|
#include "RimFishboneWellPathCollection.h"
|
||||||
#include "RimFishbonesCollection.h"
|
#include "RimFishbonesCollection.h"
|
||||||
#include "RimFishbonesMultipleSubs.h"
|
#include "RimFishbonesMultipleSubs.h"
|
||||||
@@ -52,6 +53,10 @@ void RicNewFishbonesSubsFeature::onActionTriggered(bool isChecked)
|
|||||||
|
|
||||||
fishbonesCollection->updateConnectedEditors();
|
fishbonesCollection->updateConnectedEditors();
|
||||||
RiuMainWindow::instance()->selectAsCurrentItem(obj);
|
RiuMainWindow::instance()->selectAsCurrentItem(obj);
|
||||||
|
|
||||||
|
RimProject* proj;
|
||||||
|
fishbonesCollection->firstAncestorOrThisOfTypeAsserted(proj);
|
||||||
|
proj->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName());
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ if (${CMAKE_VERSION} VERSION_GREATER "2.8.2")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set (SOURCE_GROUP_HEADER_FILES
|
set (SOURCE_GROUP_HEADER_FILES
|
||||||
|
${CEE_CURRENT_LIST_DIR}RimCompletionCellIntersectionCalc.h
|
||||||
${CEE_CURRENT_LIST_DIR}RimFishbonesCollection.h
|
${CEE_CURRENT_LIST_DIR}RimFishbonesCollection.h
|
||||||
${CEE_CURRENT_LIST_DIR}RimFishbonesMultipleSubs.h
|
${CEE_CURRENT_LIST_DIR}RimFishbonesMultipleSubs.h
|
||||||
${CEE_CURRENT_LIST_DIR}RimFishbonesPipeProperties.h
|
${CEE_CURRENT_LIST_DIR}RimFishbonesPipeProperties.h
|
||||||
@@ -16,6 +17,7 @@ ${CEE_CURRENT_LIST_DIR}RimWellPathCompletions.h
|
|||||||
)
|
)
|
||||||
|
|
||||||
set (SOURCE_GROUP_SOURCE_FILES
|
set (SOURCE_GROUP_SOURCE_FILES
|
||||||
|
${CEE_CURRENT_LIST_DIR}RimCompletionCellIntersectionCalc.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RimFishbonesCollection.cpp
|
${CEE_CURRENT_LIST_DIR}RimFishbonesCollection.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RimFishbonesMultipleSubs.cpp
|
${CEE_CURRENT_LIST_DIR}RimFishbonesMultipleSubs.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RimFishbonesPipeProperties.cpp
|
${CEE_CURRENT_LIST_DIR}RimFishbonesPipeProperties.cpp
|
||||||
|
|||||||
@@ -0,0 +1,106 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// 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>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "RimCompletionCellIntersectionCalc.h"
|
||||||
|
|
||||||
|
#include "RimDefines.h"
|
||||||
|
#include "RimProject.h"
|
||||||
|
#include "RimOilField.h"
|
||||||
|
#include "RimWellPathCollection.h"
|
||||||
|
#include "RimWellPath.h"
|
||||||
|
#include "RimWellPathCompletions.h"
|
||||||
|
#include "RimFishbonesCollection.h"
|
||||||
|
#include "RimFishbonesMultipleSubs.h"
|
||||||
|
#include "RimPerforationCollection.h"
|
||||||
|
#include "RimPerforationInterval.h"
|
||||||
|
|
||||||
|
#include "RigMainGrid.h"
|
||||||
|
#include "RigWellPath.h"
|
||||||
|
#include "RigWellPathIntersectionTools.h"
|
||||||
|
|
||||||
|
#include <QDateTime>
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimCompletionCellIntersectionCalc::calculateIntersections(const RimProject* project, const RigMainGrid* grid, std::vector<double>& values, const QDateTime& fromDate)
|
||||||
|
{
|
||||||
|
for (const RimWellPath* wellPath : project->activeOilField()->wellPathCollection->wellPaths)
|
||||||
|
{
|
||||||
|
if (wellPath->showWellPath())
|
||||||
|
{
|
||||||
|
calculateWellPathIntersections(wellPath, grid, values, fromDate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimCompletionCellIntersectionCalc::calculateWellPathIntersections(const RimWellPath* wellPath, const RigMainGrid* grid, std::vector<double>& values, const QDateTime& fromDate)
|
||||||
|
{
|
||||||
|
std::vector<HexIntersectionInfo> intersections = RigWellPathIntersectionTools::getIntersectedCells(grid, wellPath->wellPathGeometry()->m_wellPathPoints);
|
||||||
|
|
||||||
|
for (auto& intersection : intersections)
|
||||||
|
{
|
||||||
|
values[intersection.m_hexIndex] = RimDefines::WELL_PATH;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const RimFishbonesMultipleSubs* fishbones : wellPath->fishbonesCollection()->fishbonesSubs)
|
||||||
|
{
|
||||||
|
calculateFishbonesIntersections(fishbones, grid, values);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const RimPerforationInterval* perforationInterval : wellPath->perforationIntervalCollection()->perforations())
|
||||||
|
{
|
||||||
|
if (perforationInterval->isActiveOnDate(fromDate))
|
||||||
|
{
|
||||||
|
calculatePerforationIntersections(wellPath, perforationInterval, grid, values);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimCompletionCellIntersectionCalc::calculateFishbonesIntersections(const RimFishbonesMultipleSubs* fishbonesSubs, const RigMainGrid* grid, std::vector<double>& values)
|
||||||
|
{
|
||||||
|
for (size_t subIndex = 0; subIndex < fishbonesSubs->locationOfSubs().size(); ++subIndex)
|
||||||
|
{
|
||||||
|
for (size_t lateralIndex = 0; lateralIndex < fishbonesSubs->lateralCountPerSub(); ++lateralIndex)
|
||||||
|
{
|
||||||
|
std::vector<HexIntersectionInfo> intersections = RigWellPathIntersectionTools::getIntersectedCells(grid, fishbonesSubs->coordsForLateral(subIndex, lateralIndex));
|
||||||
|
for (auto& intersection : intersections)
|
||||||
|
{
|
||||||
|
values[intersection.m_hexIndex] = RimDefines::FISHBONE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimCompletionCellIntersectionCalc::calculatePerforationIntersections(const RimWellPath* wellPath, const RimPerforationInterval* perforationInterval, const RigMainGrid* grid, std::vector<double>& values)
|
||||||
|
{
|
||||||
|
std::vector<HexIntersectionInfo> intersections = RigWellPathIntersectionTools::getIntersectedCells(grid, wellPath->wellPathGeometry()->clippedPointSubset(perforationInterval->startMD(), perforationInterval->endMD()));
|
||||||
|
for (auto& intersection : intersections)
|
||||||
|
{
|
||||||
|
values[intersection.m_hexIndex] = RimDefines::PERFORATION_INTERVAL;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2017 Statoil ASA
|
||||||
|
//
|
||||||
|
// ResInsight is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
//
|
||||||
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
class RimProject;
|
||||||
|
class RimWellPath;
|
||||||
|
class RimFishbonesMultipleSubs;
|
||||||
|
class RimPerforationInterval;
|
||||||
|
|
||||||
|
class RigMainGrid;
|
||||||
|
class QDateTime;
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RimCompletionCellIntersectionCalc
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static void calculateIntersections(const RimProject* project, const RigMainGrid* grid, std::vector<double>& values, const QDateTime& fromDate);
|
||||||
|
|
||||||
|
private:
|
||||||
|
static void calculateWellPathIntersections(const RimWellPath* wellPath, const RigMainGrid* grid, std::vector<double>& values, const QDateTime& fromDate);
|
||||||
|
static void calculateFishbonesIntersections(const RimFishbonesMultipleSubs* fishbonesSubs, const RigMainGrid* grid, std::vector<double>& values);
|
||||||
|
static void calculatePerforationIntersections(const RimWellPath* wellPath, const RimPerforationInterval* perforationInterval, const RigMainGrid* grid, std::vector<double>& values);
|
||||||
|
};
|
||||||
@@ -97,14 +97,14 @@ void RimFishboneWellPathCollection::appendCompletion(RimFishboneWellPath* comple
|
|||||||
updateConnectedEditors();
|
updateConnectedEditors();
|
||||||
RiuMainWindow::instance()->selectAsCurrentItem(completion);
|
RiuMainWindow::instance()->selectAsCurrentItem(completion);
|
||||||
|
|
||||||
RimView* rimView = NULL;
|
|
||||||
firstAncestorOrThisOfType(rimView);
|
|
||||||
if (rimView)
|
|
||||||
{
|
|
||||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
|
||||||
}
|
|
||||||
|
|
||||||
uiCapability()->setUiHidden(!m_wellPaths.empty());
|
uiCapability()->setUiHidden(!m_wellPaths.empty());
|
||||||
|
|
||||||
|
RimProject* project = NULL;
|
||||||
|
firstAncestorOrThisOfTypeAsserted(project);
|
||||||
|
if (project)
|
||||||
|
{
|
||||||
|
project->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ void RimFishbonesMultipleSubs::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
|||||||
|
|
||||||
RimProject* proj;
|
RimProject* proj;
|
||||||
this->firstAncestorOrThisOfTypeAsserted(proj);
|
this->firstAncestorOrThisOfTypeAsserted(proj);
|
||||||
proj->createDisplayModelAndRedrawAllViews();
|
proj->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName());
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -75,12 +75,9 @@ void RimPerforationCollection::appendPerforation(RimPerforationInterval* perfora
|
|||||||
updateConnectedEditors();
|
updateConnectedEditors();
|
||||||
RiuMainWindow::instance()->selectAsCurrentItem(perforation);
|
RiuMainWindow::instance()->selectAsCurrentItem(perforation);
|
||||||
|
|
||||||
RimView* rimView = NULL;
|
RimProject* proj;
|
||||||
firstAncestorOrThisOfType(rimView);
|
this->firstAncestorOrThisOfTypeAsserted(proj);
|
||||||
if (rimView)
|
proj->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName());
|
||||||
{
|
|
||||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include "RimPerforationInterval.h"
|
#include "RimPerforationInterval.h"
|
||||||
|
|
||||||
#include "RigWellPath.h"
|
#include "RigWellPath.h"
|
||||||
|
#include "RigCaseCellResultsData.h"
|
||||||
|
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
#include "RimWellPath.h"
|
#include "RimWellPath.h"
|
||||||
@@ -136,14 +137,15 @@ cvf::BoundingBox RimPerforationInterval::boundingBoxInDomainCoords()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimPerforationInterval::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
void RimPerforationInterval::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||||
{
|
{
|
||||||
RimProject* proj;
|
|
||||||
this->firstAncestorOrThisOfTypeAsserted(proj);
|
|
||||||
proj->createDisplayModelAndRedrawAllViews();
|
|
||||||
|
|
||||||
if (changedField == &m_startOfHistory)
|
if (changedField == &m_startOfHistory)
|
||||||
{
|
{
|
||||||
m_date.uiCapability()->setUiReadOnly(m_startOfHistory());
|
m_date.uiCapability()->setUiReadOnly(m_startOfHistory());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RimProject* proj;
|
||||||
|
this->firstAncestorOrThisOfTypeAsserted(proj);
|
||||||
|
proj->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName());
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -65,6 +65,15 @@ namespace caf
|
|||||||
setDefault(RimDefines::PLOT_AXIS_LEFT);
|
setDefault(RimDefines::PLOT_AXIS_LEFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
void caf::AppEnum< RimDefines::CompletionType >::setUp()
|
||||||
|
{
|
||||||
|
addItem(RimDefines::WELL_PATH, "WELL_PATH", "Well Path");
|
||||||
|
addItem(RimDefines::PERFORATION_INTERVAL, "PERFORATION_INTERVAL", "Perforation Interval");
|
||||||
|
addItem(RimDefines::FISHBONE, "FISHBONE", "Fishbone");
|
||||||
|
|
||||||
|
setDefault(RimDefines::WELL_PATH);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,12 @@ public:
|
|||||||
FRACTURE_MODEL
|
FRACTURE_MODEL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum CompletionType {
|
||||||
|
WELL_PATH,
|
||||||
|
PERFORATION_INTERVAL,
|
||||||
|
FISHBONE
|
||||||
|
};
|
||||||
|
|
||||||
static bool isPerCellFaceResult(const QString& resultName);
|
static bool isPerCellFaceResult(const QString& resultName);
|
||||||
|
|
||||||
static QString undefinedResultName() { return "None"; }
|
static QString undefinedResultName() { return "None"; }
|
||||||
@@ -67,6 +73,8 @@ public:
|
|||||||
static QString riAreaNormTranZResultName() { return "riTRANZbyArea"; }
|
static QString riAreaNormTranZResultName() { return "riTRANZbyArea"; }
|
||||||
static QString combinedRiAreaNormTranResultName() { return "riTRANXYZbyArea"; }
|
static QString combinedRiAreaNormTranResultName() { return "riTRANXYZbyArea"; }
|
||||||
|
|
||||||
|
static QString completionTypeResultName() { return "Completion Type"; }
|
||||||
|
|
||||||
// Mock model text identifiers
|
// Mock model text identifiers
|
||||||
static QString mockModelBasic() { return "Result Mock Debug Model Simple"; }
|
static QString mockModelBasic() { return "Result Mock Debug Model Simple"; }
|
||||||
static QString mockModelBasicWithResults() { return "Result Mock Debug Model With Results"; }
|
static QString mockModelBasicWithResults() { return "Result Mock Debug Model With Results"; }
|
||||||
|
|||||||
@@ -249,50 +249,13 @@ RimEclipseView* RimEclipseCase::createCopyAndAddView(const RimEclipseView* sourc
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimEclipseCase::removeResult(const QString& resultName)
|
void RimEclipseCase::removeResult(RimDefines::ResultCatType type, const QString& resultName)
|
||||||
{
|
{
|
||||||
size_t i;
|
m_matrixModelResults->clearScalarResult(type, resultName);
|
||||||
for (i = 0; i < reservoirViews().size(); i++)
|
|
||||||
|
for (RimView* view : views())
|
||||||
{
|
{
|
||||||
RimEclipseView* reservoirView = reservoirViews()[i];
|
view->loadDataAndUpdate();
|
||||||
CVF_ASSERT(reservoirView);
|
|
||||||
|
|
||||||
RimEclipseCellColors* result = reservoirView->cellResult;
|
|
||||||
CVF_ASSERT(result);
|
|
||||||
|
|
||||||
bool rebuildDisplayModel = false;
|
|
||||||
|
|
||||||
// Set cell result variable to none if displaying
|
|
||||||
if (result->resultVariable() == resultName)
|
|
||||||
{
|
|
||||||
result->setResultVariable(RimDefines::undefinedResultName());
|
|
||||||
result->loadResult();
|
|
||||||
|
|
||||||
rebuildDisplayModel = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
RimEclipsePropertyFilterCollection* propFilterCollection = reservoirView->eclipsePropertyFilterCollection();
|
|
||||||
for (size_t filter = 0; filter < propFilterCollection->propertyFilters().size(); filter++)
|
|
||||||
{
|
|
||||||
RimEclipsePropertyFilter* propertyFilter = propFilterCollection->propertyFilters()[filter];
|
|
||||||
if (propertyFilter->resultDefinition->resultVariable() == resultName)
|
|
||||||
{
|
|
||||||
propertyFilter->resultDefinition->setResultVariable(RimDefines::undefinedResultName());
|
|
||||||
propertyFilter->resultDefinition->loadResult();
|
|
||||||
propertyFilter->setToDefaultValues();
|
|
||||||
|
|
||||||
rebuildDisplayModel = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rebuildDisplayModel)
|
|
||||||
{
|
|
||||||
reservoirViews()[i]->createDisplayModelAndRedraw();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
// CellEdgeResults are not considered, as they do not support display of input properties yet
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#include "RifReaderInterface.h"
|
#include "RifReaderInterface.h"
|
||||||
|
|
||||||
#include "RimCase.h"
|
#include "RimCase.h"
|
||||||
|
#include "RimDefines.h"
|
||||||
|
|
||||||
#include "cafPdmChildArrayField.h"
|
#include "cafPdmChildArrayField.h"
|
||||||
#include "cafPdmChildField.h"
|
#include "cafPdmChildField.h"
|
||||||
@@ -77,7 +78,7 @@ public:
|
|||||||
RimEclipseView* createAndAddReservoirView();
|
RimEclipseView* createAndAddReservoirView();
|
||||||
RimEclipseView* createCopyAndAddView(const RimEclipseView* sourceView);
|
RimEclipseView* createCopyAndAddView(const RimEclipseView* sourceView);
|
||||||
|
|
||||||
void removeResult(const QString& resultName);
|
void removeResult(RimDefines::ResultCatType type, const QString& resultName);
|
||||||
|
|
||||||
virtual QString locationOnDisc() const { return QString(); }
|
virtual QString locationOnDisc() const { return QString(); }
|
||||||
virtual QString gridFileName() const { return QString(); }
|
virtual QString gridFileName() const { return QString(); }
|
||||||
|
|||||||
@@ -377,15 +377,24 @@ void RimEclipseCellColors::updateLegendData(size_t currentTimeStep)
|
|||||||
|
|
||||||
if (this->hasCategoryResult())
|
if (this->hasCategoryResult())
|
||||||
{
|
{
|
||||||
if (this->resultType() != RimDefines::FORMATION_NAMES)
|
if (this->resultType() == RimDefines::FORMATION_NAMES)
|
||||||
{
|
|
||||||
this->legendConfig()->setIntegerCategories(cellResultsData->uniqueCellScalarValues(this->scalarResultIndex()));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
const std::vector<QString>& fnVector = eclipseCase->activeFormationNames()->formationNames();
|
const std::vector<QString>& fnVector = eclipseCase->activeFormationNames()->formationNames();
|
||||||
this->legendConfig()->setNamedCategoriesInverse(fnVector);
|
this->legendConfig()->setNamedCategoriesInverse(fnVector);
|
||||||
}
|
}
|
||||||
|
else if (this->resultType() == RimDefines::DYNAMIC_NATIVE && this->resultVariable() == RimDefines::completionTypeResultName())
|
||||||
|
{
|
||||||
|
std::vector<QString> ctNames;
|
||||||
|
for (QString ctName : caf::AppEnum<RimDefines::CompletionType>::uiTexts())
|
||||||
|
{
|
||||||
|
ctNames.push_back(ctName);
|
||||||
|
}
|
||||||
|
this->legendConfig()->setNamedCategoriesInverse(ctNames);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->legendConfig()->setIntegerCategories(cellResultsData->uniqueCellScalarValues(this->scalarResultIndex()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -379,11 +379,7 @@ void RimEclipsePropertyFilter::computeResultValueRange()
|
|||||||
|
|
||||||
if ( resultDefinition->hasCategoryResult() )
|
if ( resultDefinition->hasCategoryResult() )
|
||||||
{
|
{
|
||||||
if ( resultDefinition->resultType() != RimDefines::FORMATION_NAMES )
|
if ( resultDefinition->resultType() == RimDefines::FORMATION_NAMES )
|
||||||
{
|
|
||||||
setCategoryValues(results->cellResults()->uniqueCellScalarValues(scalarIndex));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
CVF_ASSERT(parentContainer()->reservoirView()->eclipseCase()->eclipseCaseData());
|
CVF_ASSERT(parentContainer()->reservoirView()->eclipseCase()->eclipseCaseData());
|
||||||
CVF_ASSERT(parentContainer()->reservoirView()->eclipseCase()->eclipseCaseData()->activeFormationNames());
|
CVF_ASSERT(parentContainer()->reservoirView()->eclipseCase()->eclipseCaseData()->activeFormationNames());
|
||||||
@@ -391,6 +387,19 @@ void RimEclipsePropertyFilter::computeResultValueRange()
|
|||||||
const std::vector<QString>& fnVector = parentContainer()->reservoirView()->eclipseCase()->eclipseCaseData()->activeFormationNames()->formationNames();
|
const std::vector<QString>& fnVector = parentContainer()->reservoirView()->eclipseCase()->eclipseCaseData()->activeFormationNames()->formationNames();
|
||||||
setCategoryNames(fnVector);
|
setCategoryNames(fnVector);
|
||||||
}
|
}
|
||||||
|
else if (resultDefinition->resultVariable() == RimDefines::completionTypeResultName())
|
||||||
|
{
|
||||||
|
std::vector<QString> ctNames;
|
||||||
|
for (QString ctName : caf::AppEnum<RimDefines::CompletionType>::uiTexts())
|
||||||
|
{
|
||||||
|
ctNames.push_back(ctName);
|
||||||
|
}
|
||||||
|
setCategoryNames(ctNames);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setCategoryValues(results->cellResults()->uniqueCellScalarValues(scalarIndex));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -966,6 +966,9 @@ bool RimEclipseResultDefinition::hasCategoryResult() const
|
|||||||
&& m_eclipseCase->eclipseCaseData()
|
&& m_eclipseCase->eclipseCaseData()
|
||||||
&& m_eclipseCase->eclipseCaseData()->activeFormationNames() ) return true;
|
&& m_eclipseCase->eclipseCaseData()->activeFormationNames() ) return true;
|
||||||
|
|
||||||
|
if (this->m_resultType() == RimDefines::DYNAMIC_NATIVE
|
||||||
|
&& this->resultVariable() == RimDefines::completionTypeResultName()) return true;
|
||||||
|
|
||||||
if (this->m_resultType() == RimDefines::FLOW_DIAGNOSTICS
|
if (this->m_resultType() == RimDefines::FLOW_DIAGNOSTICS
|
||||||
&& m_resultVariable() == RIG_FLD_MAX_FRACTION_TRACER_RESNAME) return true;
|
&& m_resultVariable() == RIG_FLD_MAX_FRACTION_TRACER_RESNAME) return true;
|
||||||
|
|
||||||
|
|||||||
@@ -626,6 +626,17 @@ RimOilField* RimProject::activeOilField()
|
|||||||
return oilFields[0];
|
return oilFields[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
/// Currently there will be only one oil field in Resinsight, so return hardcoded first oil field
|
||||||
|
/// from the RimOilField collection.
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
const RimOilField * RimProject::activeOilField() const
|
||||||
|
{
|
||||||
|
CVF_ASSERT(oilFields.size() == 1);
|
||||||
|
|
||||||
|
return oilFields[0];
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -752,6 +763,17 @@ bool RimProject::showPlotWindow() const
|
|||||||
return m_showPlotWindow;
|
return m_showPlotWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimProject::removeResult(RimDefines::ResultCatType type, const QString & resultName)
|
||||||
|
{
|
||||||
|
for (RimEclipseCase* eclipseCase : activeOilField()->analysisModels->cases)
|
||||||
|
{
|
||||||
|
eclipseCase->removeResult(type, resultName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "RimDefines.h"
|
||||||
|
|
||||||
#include "cafPdmChildArrayField.h"
|
#include "cafPdmChildArrayField.h"
|
||||||
#include "cafPdmChildField.h"
|
#include "cafPdmChildField.h"
|
||||||
#include "cafPdmDocument.h"
|
#include "cafPdmDocument.h"
|
||||||
@@ -99,12 +101,15 @@ public:
|
|||||||
void computeUtmAreaOfInterest();
|
void computeUtmAreaOfInterest();
|
||||||
|
|
||||||
RimOilField* activeOilField();
|
RimOilField* activeOilField();
|
||||||
|
const RimOilField* activeOilField() const;
|
||||||
|
|
||||||
void actionsBasedOnSelection(QMenu& contextMenu);
|
void actionsBasedOnSelection(QMenu& contextMenu);
|
||||||
|
|
||||||
bool show3DWindow() const;
|
bool show3DWindow() const;
|
||||||
bool showPlotWindow() const;
|
bool showPlotWindow() const;
|
||||||
|
|
||||||
|
void removeResult(RimDefines::ResultCatType type, const QString& resultName);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Overridden methods
|
// Overridden methods
|
||||||
void initScriptDirectories();
|
void initScriptDirectories();
|
||||||
|
|||||||
@@ -27,6 +27,8 @@
|
|||||||
|
|
||||||
#include "RimEclipseCase.h"
|
#include "RimEclipseCase.h"
|
||||||
#include "RimTools.h"
|
#include "RimTools.h"
|
||||||
|
#include "RimProject.h"
|
||||||
|
#include "RimCompletionCellIntersectionCalc.h"
|
||||||
|
|
||||||
#include "cafProgressInfo.h"
|
#include "cafProgressInfo.h"
|
||||||
#include "cafUtils.h"
|
#include "cafUtils.h"
|
||||||
@@ -253,6 +255,14 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResult(const QString& res
|
|||||||
return scalarResultIndex;
|
return scalarResultIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimReservoirCellResultsStorage::clearScalarResult(RimDefines::ResultCatType type, const QString & resultName)
|
||||||
|
{
|
||||||
|
size_t scalarResultIndex = m_cellResults->findScalarResultIndex(type, resultName);
|
||||||
|
m_cellResults->cellScalarResults(scalarResultIndex).clear();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
@@ -325,7 +335,6 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResult(RimDefines::Result
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (isDataPresent(scalarResultIndex))
|
if (isDataPresent(scalarResultIndex))
|
||||||
{
|
{
|
||||||
return scalarResultIndex;
|
return scalarResultIndex;
|
||||||
@@ -352,6 +361,14 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResult(RimDefines::Result
|
|||||||
return scalarResultIndex;
|
return scalarResultIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (resultName == RimDefines::completionTypeResultName())
|
||||||
|
{
|
||||||
|
m_cellResults->cellScalarResults(scalarResultIndex).resize(m_cellResults->maxTimeStepCount());
|
||||||
|
for (size_t timeStepIdx = 0; timeStepIdx < m_cellResults->maxTimeStepCount(); ++timeStepIdx)
|
||||||
|
{
|
||||||
|
computeCompletionTypeForTimeStep(timeStepIdx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (type == RimDefines::GENERATED)
|
if (type == RimDefines::GENERATED)
|
||||||
{
|
{
|
||||||
@@ -426,6 +443,12 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResultForTimeStep(RimDefi
|
|||||||
return soilScalarResultIndex;
|
return soilScalarResultIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (type == RimDefines::DYNAMIC_NATIVE && resultName == RimDefines::completionTypeResultName())
|
||||||
|
{
|
||||||
|
size_t completionTypeScalarResultIndex = m_cellResults->findScalarResultIndex(type, resultName);
|
||||||
|
computeCompletionTypeForTimeStep(timeStepIndex);
|
||||||
|
return completionTypeScalarResultIndex;
|
||||||
|
}
|
||||||
|
|
||||||
size_t scalarResultIndex = m_cellResults->findScalarResultIndex(type, resultName);
|
size_t scalarResultIndex = m_cellResults->findScalarResultIndex(type, resultName);
|
||||||
if (scalarResultIndex == cvf::UNDEFINED_SIZE_T) return cvf::UNDEFINED_SIZE_T;
|
if (scalarResultIndex == cvf::UNDEFINED_SIZE_T) return cvf::UNDEFINED_SIZE_T;
|
||||||
@@ -1376,6 +1399,39 @@ void RimReservoirCellResultsStorage::computeNncCombRiTRANSbyArea()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimReservoirCellResultsStorage::computeCompletionTypeForTimeStep(size_t timeStep)
|
||||||
|
{
|
||||||
|
size_t completionTypeResultIndex = m_cellResults->findScalarResultIndex(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName());
|
||||||
|
|
||||||
|
if (m_cellResults->cellScalarResults(completionTypeResultIndex).size() != timeStep)
|
||||||
|
{
|
||||||
|
m_cellResults->cellScalarResults(completionTypeResultIndex).resize(timeStep);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<double>& completionTypeResult = m_cellResults->cellScalarResults(completionTypeResultIndex, 0);
|
||||||
|
|
||||||
|
size_t resultValues = m_ownerMainGrid->globalCellArray().size();
|
||||||
|
|
||||||
|
if (completionTypeResult.size() == resultValues)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
completionTypeResult.resize(resultValues);
|
||||||
|
std::fill(completionTypeResult.begin(), completionTypeResult.end(), HUGE_VAL);
|
||||||
|
|
||||||
|
RimProject* project;
|
||||||
|
firstAncestorOrThisOfTypeAsserted(project);
|
||||||
|
RimEclipseCase* eclipseCase;
|
||||||
|
firstAncestorOrThisOfTypeAsserted(eclipseCase);
|
||||||
|
QDateTime timeStepDate = eclipseCase->timeStepDates()[timeStep];
|
||||||
|
|
||||||
|
RimCompletionCellIntersectionCalc::calculateIntersections(project, m_ownerMainGrid, completionTypeResult, timeStepDate);
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ public:
|
|||||||
size_t findOrLoadScalarResult(RimDefines::ResultCatType type, const QString& resultName);
|
size_t findOrLoadScalarResult(RimDefines::ResultCatType type, const QString& resultName);
|
||||||
size_t findOrLoadScalarResult(const QString& resultName); ///< Simplified search. Assumes unique names across types.
|
size_t findOrLoadScalarResult(const QString& resultName); ///< Simplified search. Assumes unique names across types.
|
||||||
|
|
||||||
|
void clearScalarResult(RimDefines::ResultCatType type, const QString& resultName);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Overridden methods from PdmObject
|
// Overridden methods from PdmObject
|
||||||
virtual void setupBeforeSave();
|
virtual void setupBeforeSave();
|
||||||
@@ -77,6 +79,8 @@ private:
|
|||||||
void computeRiTRANSbyAreaComponent(const QString& riTransByAreaCompResultName);
|
void computeRiTRANSbyAreaComponent(const QString& riTransByAreaCompResultName);
|
||||||
void computeNncCombRiTRANSbyArea();
|
void computeNncCombRiTRANSbyArea();
|
||||||
|
|
||||||
|
void computeCompletionTypeForTimeStep(size_t timeStep);
|
||||||
|
|
||||||
double darchysValue();
|
double darchysValue();
|
||||||
|
|
||||||
QString getValidCacheFileName();
|
QString getValidCacheFileName();
|
||||||
|
|||||||
@@ -214,6 +214,10 @@ void RimWellPathCollection::addWellPaths( QStringList filePaths )
|
|||||||
}
|
}
|
||||||
|
|
||||||
readAndAddWellPaths(wellPathArray);
|
readAndAddWellPaths(wellPathArray);
|
||||||
|
|
||||||
|
RimProject* proj;
|
||||||
|
firstAncestorOrThisOfTypeAsserted(proj);
|
||||||
|
proj->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -667,6 +667,15 @@ void RigCaseCellResultsData::createPlaceholderResultEntries()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Completion type
|
||||||
|
{
|
||||||
|
size_t completionTypeIndex = findScalarResultIndex(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName());
|
||||||
|
if (completionTypeIndex == cvf::UNDEFINED_SIZE_T)
|
||||||
|
{
|
||||||
|
addEmptyScalarResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TRANSXYZ
|
// TRANSXYZ
|
||||||
{
|
{
|
||||||
size_t tranX, tranY, tranZ;
|
size_t tranX, tranY, tranZ;
|
||||||
|
|||||||
Reference in New Issue
Block a user