mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1520 Establish new result type 'Completion Type'
This commit is contained in:
parent
8a937116e5
commit
b20a563517
@ -53,6 +53,7 @@ void RicNewFishbonesSubsAtMeasuredDepthFeature::onActionTriggered(bool isChecked
|
||||
int integerValue = wellPathSelItem->m_measuredDepth;
|
||||
obj->setMeasuredDepthAndCount(integerValue, 24, 1);
|
||||
|
||||
|
||||
RicNewFishbonesSubsFeature::askUserToSetUsefulScaling(wellPath->fishbonesCollection());
|
||||
|
||||
wellPath->updateConnectedEditors();
|
||||
@ -60,7 +61,7 @@ void RicNewFishbonesSubsAtMeasuredDepthFeature::onActionTriggered(bool isChecked
|
||||
|
||||
RimProject* proj;
|
||||
wellPath->firstAncestorOrThisOfTypeAsserted(proj);
|
||||
proj->createDisplayModelAndRedrawAllViews();
|
||||
proj->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RimFishboneWellPathCollection.h"
|
||||
#include "RimFishbonesCollection.h"
|
||||
#include "RimFishbonesMultipleSubs.h"
|
||||
@ -52,6 +53,10 @@ void RicNewFishbonesSubsFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
fishbonesCollection->updateConnectedEditors();
|
||||
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()
|
||||
|
||||
set (SOURCE_GROUP_HEADER_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RimCompletionCellIntersectionCalc.h
|
||||
${CEE_CURRENT_LIST_DIR}RimFishbonesCollection.h
|
||||
${CEE_CURRENT_LIST_DIR}RimFishbonesMultipleSubs.h
|
||||
${CEE_CURRENT_LIST_DIR}RimFishbonesPipeProperties.h
|
||||
@ -16,6 +17,7 @@ ${CEE_CURRENT_LIST_DIR}RimWellPathCompletions.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RimCompletionCellIntersectionCalc.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimFishbonesCollection.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimFishbonesMultipleSubs.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();
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(completion);
|
||||
|
||||
RimView* rimView = NULL;
|
||||
firstAncestorOrThisOfType(rimView);
|
||||
if (rimView)
|
||||
{
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
|
||||
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;
|
||||
this->firstAncestorOrThisOfTypeAsserted(proj);
|
||||
proj->createDisplayModelAndRedrawAllViews();
|
||||
proj->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -75,12 +75,9 @@ void RimPerforationCollection::appendPerforation(RimPerforationInterval* perfora
|
||||
updateConnectedEditors();
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(perforation);
|
||||
|
||||
RimView* rimView = NULL;
|
||||
firstAncestorOrThisOfType(rimView);
|
||||
if (rimView)
|
||||
{
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
RimProject* proj;
|
||||
this->firstAncestorOrThisOfTypeAsserted(proj);
|
||||
proj->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "RimPerforationInterval.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
|
||||
#include "RimProject.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)
|
||||
{
|
||||
RimProject* proj;
|
||||
this->firstAncestorOrThisOfTypeAsserted(proj);
|
||||
proj->createDisplayModelAndRedrawAllViews();
|
||||
|
||||
if (changedField == &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);
|
||||
}
|
||||
|
||||
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
|
||||
};
|
||||
|
||||
enum CompletionType {
|
||||
WELL_PATH,
|
||||
PERFORATION_INTERVAL,
|
||||
FISHBONE
|
||||
};
|
||||
|
||||
static bool isPerCellFaceResult(const QString& resultName);
|
||||
|
||||
static QString undefinedResultName() { return "None"; }
|
||||
@ -52,10 +58,10 @@ public:
|
||||
static QString ternarySaturationResultName() { return "TERNARY"; }
|
||||
static QString combinedMultResultName() { return "MULTXYZ"; }
|
||||
|
||||
static QString riTranXResultName() { return "riTRANX"; }
|
||||
static QString riTranYResultName() { return "riTRANY"; }
|
||||
static QString riTranZResultName() { return "riTRANZ"; }
|
||||
static QString combinedRiTranResultName() { return "riTRANXYZ"; }
|
||||
static QString riTranXResultName() { return "riTRANX"; }
|
||||
static QString riTranYResultName() { return "riTRANY"; }
|
||||
static QString riTranZResultName() { return "riTRANZ"; }
|
||||
static QString combinedRiTranResultName() { return "riTRANXYZ"; }
|
||||
|
||||
static QString riMultXResultName() { return "riMULTX"; }
|
||||
static QString riMultYResultName() { return "riMULTY"; }
|
||||
@ -67,12 +73,14 @@ public:
|
||||
static QString riAreaNormTranZResultName() { return "riTRANZbyArea"; }
|
||||
static QString combinedRiAreaNormTranResultName() { return "riTRANXYZbyArea"; }
|
||||
|
||||
static QString completionTypeResultName() { return "Completion Type"; }
|
||||
|
||||
// Mock model text identifiers
|
||||
static QString mockModelBasic() { return "Result Mock Debug Model Simple"; }
|
||||
static QString mockModelBasicWithResults() { return "Result Mock Debug Model With Results"; }
|
||||
static QString mockModelLargeWithResults() { return "Result Mock Debug Model Large With Results"; }
|
||||
static QString mockModelCustomized() { return "Result Mock Debug Model Customized"; }
|
||||
static QString mockModelBasicInputCase() { return "Input 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 mockModelLargeWithResults() { return "Result Mock Debug Model Large With Results"; }
|
||||
static QString mockModelCustomized() { return "Result Mock Debug Model Customized"; }
|
||||
static QString mockModelBasicInputCase() { return "Input Mock Debug Model Simple"; }
|
||||
|
||||
enum DepthUnitType
|
||||
{
|
||||
|
@ -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;
|
||||
for (i = 0; i < reservoirViews().size(); i++)
|
||||
m_matrixModelResults->clearScalarResult(type, resultName);
|
||||
|
||||
for (RimView* view : views())
|
||||
{
|
||||
RimEclipseView* reservoirView = reservoirViews()[i];
|
||||
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
|
||||
view->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "RifReaderInterface.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimDefines.h"
|
||||
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmChildField.h"
|
||||
@ -77,7 +78,7 @@ public:
|
||||
RimEclipseView* createAndAddReservoirView();
|
||||
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 gridFileName() const { return QString(); }
|
||||
|
@ -377,15 +377,24 @@ void RimEclipseCellColors::updateLegendData(size_t currentTimeStep)
|
||||
|
||||
if (this->hasCategoryResult())
|
||||
{
|
||||
if (this->resultType() != RimDefines::FORMATION_NAMES)
|
||||
{
|
||||
this->legendConfig()->setIntegerCategories(cellResultsData->uniqueCellScalarValues(this->scalarResultIndex()));
|
||||
}
|
||||
else
|
||||
if (this->resultType() == RimDefines::FORMATION_NAMES)
|
||||
{
|
||||
const std::vector<QString>& fnVector = eclipseCase->activeFormationNames()->formationNames();
|
||||
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->resultType() != RimDefines::FORMATION_NAMES )
|
||||
{
|
||||
setCategoryValues(results->cellResults()->uniqueCellScalarValues(scalarIndex));
|
||||
}
|
||||
else
|
||||
if ( resultDefinition->resultType() == RimDefines::FORMATION_NAMES )
|
||||
{
|
||||
CVF_ASSERT(parentContainer()->reservoirView()->eclipseCase()->eclipseCaseData());
|
||||
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();
|
||||
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()->activeFormationNames() ) return true;
|
||||
|
||||
if (this->m_resultType() == RimDefines::DYNAMIC_NATIVE
|
||||
&& this->resultVariable() == RimDefines::completionTypeResultName()) return true;
|
||||
|
||||
if (this->m_resultType() == RimDefines::FLOW_DIAGNOSTICS
|
||||
&& m_resultVariable() == RIG_FLD_MAX_FRACTION_TRACER_RESNAME) return true;
|
||||
|
||||
|
@ -626,6 +626,17 @@ RimOilField* RimProject::activeOilField()
|
||||
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;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
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
|
||||
|
||||
#include "RimDefines.h"
|
||||
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmChildField.h"
|
||||
#include "cafPdmDocument.h"
|
||||
@ -98,13 +100,16 @@ public:
|
||||
|
||||
void computeUtmAreaOfInterest();
|
||||
|
||||
RimOilField* activeOilField();
|
||||
RimOilField* activeOilField();
|
||||
const RimOilField* activeOilField() const;
|
||||
|
||||
void actionsBasedOnSelection(QMenu& contextMenu);
|
||||
|
||||
bool show3DWindow() const;
|
||||
bool showPlotWindow() const;
|
||||
|
||||
void removeResult(RimDefines::ResultCatType type, const QString& resultName);
|
||||
|
||||
protected:
|
||||
// Overridden methods
|
||||
void initScriptDirectories();
|
||||
|
@ -27,6 +27,8 @@
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimCompletionCellIntersectionCalc.h"
|
||||
|
||||
#include "cafProgressInfo.h"
|
||||
#include "cafUtils.h"
|
||||
@ -253,6 +255,14 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResult(const QString& res
|
||||
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))
|
||||
{
|
||||
return scalarResultIndex;
|
||||
@ -352,6 +361,14 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResult(RimDefines::Result
|
||||
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)
|
||||
{
|
||||
@ -426,6 +443,12 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResultForTimeStep(RimDefi
|
||||
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);
|
||||
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(const QString& resultName); ///< Simplified search. Assumes unique names across types.
|
||||
|
||||
void clearScalarResult(RimDefines::ResultCatType type, const QString& resultName);
|
||||
|
||||
protected:
|
||||
// Overridden methods from PdmObject
|
||||
virtual void setupBeforeSave();
|
||||
@ -77,6 +79,8 @@ private:
|
||||
void computeRiTRANSbyAreaComponent(const QString& riTransByAreaCompResultName);
|
||||
void computeNncCombRiTRANSbyArea();
|
||||
|
||||
void computeCompletionTypeForTimeStep(size_t timeStep);
|
||||
|
||||
double darchysValue();
|
||||
|
||||
QString getValidCacheFileName();
|
||||
|
@ -214,6 +214,10 @@ void RimWellPathCollection::addWellPaths( QStringList filePaths )
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
size_t tranX, tranY, tranZ;
|
||||
|
Loading…
Reference in New Issue
Block a user