mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3604 Export completions. New feature 'Export Completion Data for Temporary LGRs'
This commit is contained in:
@@ -13,6 +13,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForVisibleSimWellsFeature.h
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RicMultiSegmentWellExportInfo.h
|
${CMAKE_CURRENT_LIST_DIR}/RicMultiSegmentWellExportInfo.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureTextReportFeatureImpl.h
|
${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureTextReportFeatureImpl.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureReportItem.h
|
${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureReportItem.h
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForTemporaryLgrsFeature.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -30,6 +31,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForVisibleSimWellsFeature.cpp
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RicMultiSegmentWellExportInfo.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicMultiSegmentWellExportInfo.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureTextReportFeatureImpl.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureTextReportFeatureImpl.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureReportItem.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureReportItem.cpp
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForTemporaryLgrsFeature.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND CODE_HEADER_FILES
|
list(APPEND CODE_HEADER_FILES
|
||||||
|
|||||||
@@ -0,0 +1,104 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// 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 "RicExportCompletionsForTemporaryLgrsFeature.h"
|
||||||
|
|
||||||
|
#include "RiaApplication.h"
|
||||||
|
|
||||||
|
#include "RicWellPathExportCompletionDataFeature.h"
|
||||||
|
|
||||||
|
#include "RigMainGrid.h"
|
||||||
|
|
||||||
|
#include "RiuPlotMainWindow.h"
|
||||||
|
|
||||||
|
#include "RimGridCollection.h"
|
||||||
|
#include "RimWellPath.h"
|
||||||
|
#include "RimProject.h"
|
||||||
|
#include "RimWellPathCollection.h"
|
||||||
|
#include "RimEclipseCase.h"
|
||||||
|
|
||||||
|
#include "cafSelectionManagerTools.h"
|
||||||
|
|
||||||
|
#include <QAction>
|
||||||
|
|
||||||
|
CAF_CMD_SOURCE_INIT(RicExportCompletionsForTemporaryLgrsFeature, "RicExportCompletionsForTemporaryLgrsFeature");
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RicExportCompletionsForTemporaryLgrsFeature::isCommandEnabled()
|
||||||
|
{
|
||||||
|
std::vector<RimGridInfoCollection*> selGridInfos = caf::selectedObjectsByTypeStrict<RimGridInfoCollection*>();
|
||||||
|
return selGridInfos.size() == 1 && selGridInfos.front()->uiName() == RimGridCollection::temporaryGridUiName();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicExportCompletionsForTemporaryLgrsFeature::onActionTriggered(bool isChecked)
|
||||||
|
{
|
||||||
|
std::vector<RimWellPath*> wellPaths = wellPathsAssociatedWithLgrs();
|
||||||
|
CVF_ASSERT(wellPaths.size() > 0);
|
||||||
|
|
||||||
|
std::vector<RimSimWellInView*> simWells;
|
||||||
|
QString dialogTitle = "Export Completion Data for Temporary LGRs";
|
||||||
|
|
||||||
|
RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompletions(dialogTitle, wellPaths, simWells);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RicExportCompletionsForTemporaryLgrsFeature::setupActionLook(QAction* actionToSetup)
|
||||||
|
{
|
||||||
|
actionToSetup->setText("Export Completion Data");
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::vector<RimWellPath*> RicExportCompletionsForTemporaryLgrsFeature::wellPathsAssociatedWithLgrs()
|
||||||
|
{
|
||||||
|
std::vector<RimWellPath*> wellPaths;
|
||||||
|
|
||||||
|
auto selectedEclipseCase = caf::firstAncestorOfTypeFromSelectedObject<RimEclipseCase*>();
|
||||||
|
auto mainGrid = selectedEclipseCase->mainGrid();
|
||||||
|
|
||||||
|
std::set<QString> wellPathNames;
|
||||||
|
|
||||||
|
for (size_t i = 0; i < mainGrid->gridCount(); i++)
|
||||||
|
{
|
||||||
|
const RigGridBase* grid = mainGrid->gridByIndex(i);
|
||||||
|
|
||||||
|
if (!grid->associatedWellPathName().empty())
|
||||||
|
{
|
||||||
|
wellPathNames.insert(QString::fromStdString(grid->associatedWellPathName()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
auto project = RiaApplication::instance()->project();
|
||||||
|
for (const auto& wellPathName : wellPathNames)
|
||||||
|
{
|
||||||
|
auto wellPath = project->wellPathByName(wellPathName);
|
||||||
|
if (wellPath)
|
||||||
|
{
|
||||||
|
wellPaths.push_back(wellPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return wellPaths;
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// 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 "cafCmdFeature.h"
|
||||||
|
|
||||||
|
class RimSimWellInView;
|
||||||
|
class RimWellPath;
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RicExportCompletionsForTemporaryLgrsFeature : public caf::CmdFeature
|
||||||
|
{
|
||||||
|
CAF_CMD_HEADER_INIT;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool isCommandEnabled() override;
|
||||||
|
void onActionTriggered(bool isChecked) override;
|
||||||
|
void setupActionLook(QAction* actionToSetup) override;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static std::vector<RimWellPath*> wellPathsAssociatedWithLgrs();
|
||||||
|
};
|
||||||
@@ -124,7 +124,7 @@ std::vector<RigCompletionData> filterCompletionsOnType(const std::vector<RigComp
|
|||||||
const std::set<RigCompletionData::CompletionType>& includedCompletionTypes)
|
const std::set<RigCompletionData::CompletionType>& includedCompletionTypes)
|
||||||
{
|
{
|
||||||
std::vector<RigCompletionData> filtered;
|
std::vector<RigCompletionData> filtered;
|
||||||
for (auto completion : completions)
|
for (const auto& completion : completions)
|
||||||
{
|
{
|
||||||
if (includedCompletionTypes.count(completion.completionType()) > 0) filtered.push_back(completion);
|
if (includedCompletionTypes.count(completion.completionType()) > 0) filtered.push_back(completion);
|
||||||
}
|
}
|
||||||
@@ -344,12 +344,12 @@ std::vector<LgrInfo> RicExportLgrFeature::buildLgrsForWellPath(RimWellPath*
|
|||||||
if (splitType == Lgr::LGR_PER_CELL)
|
if (splitType == Lgr::LGR_PER_CELL)
|
||||||
{
|
{
|
||||||
auto intersectingCells = cellsIntersectingCompletions(eclipseCase, wellPath, timeStep, completionTypes, intersectingOtherLgrs);
|
auto intersectingCells = cellsIntersectingCompletions(eclipseCase, wellPath, timeStep, completionTypes, intersectingOtherLgrs);
|
||||||
lgrs = buildLgrsPerMainCell(eclipseCase, intersectingCells, lgrCellCounts);
|
lgrs = buildLgrsPerMainCell(eclipseCase, wellPath, intersectingCells, lgrCellCounts);
|
||||||
}
|
}
|
||||||
else if (splitType == Lgr::LGR_PER_COMPLETION)
|
else if (splitType == Lgr::LGR_PER_COMPLETION)
|
||||||
{
|
{
|
||||||
auto intersectingCells = cellsIntersectingCompletions_PerCompletion(eclipseCase, wellPath, timeStep, completionTypes, intersectingOtherLgrs);
|
auto intersectingCells = cellsIntersectingCompletions_PerCompletion(eclipseCase, wellPath, timeStep, completionTypes, intersectingOtherLgrs);
|
||||||
lgrs = buildLgrsPerCompletion(eclipseCase, intersectingCells, lgrCellCounts);
|
lgrs = buildLgrsPerCompletion(eclipseCase, wellPath, intersectingCells, lgrCellCounts);
|
||||||
}
|
}
|
||||||
else if (splitType == Lgr::LGR_PER_WELL)
|
else if (splitType == Lgr::LGR_PER_WELL)
|
||||||
{
|
{
|
||||||
@@ -357,7 +357,7 @@ std::vector<LgrInfo> RicExportLgrFeature::buildLgrsForWellPath(RimWellPath*
|
|||||||
|
|
||||||
int lgrId = firstAvailableLgrId(eclipseCase->mainGrid());
|
int lgrId = firstAvailableLgrId(eclipseCase->mainGrid());
|
||||||
auto lgrName = createLgrName("", lgrId);
|
auto lgrName = createLgrName("", lgrId);
|
||||||
lgrs.push_back(buildLgr(lgrId, lgrName, lgrName, eclipseCase, intersectingCells, lgrCellCounts));
|
lgrs.push_back(buildLgr(lgrId, lgrName, lgrName, eclipseCase, wellPath, intersectingCells, lgrCellCounts));
|
||||||
}
|
}
|
||||||
return lgrs;
|
return lgrs;
|
||||||
}
|
}
|
||||||
@@ -366,16 +366,17 @@ std::vector<LgrInfo> RicExportLgrFeature::buildLgrsForWellPath(RimWellPath*
|
|||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<LgrInfo> RicExportLgrFeature::buildLgrsPerMainCell(RimEclipseCase* eclipseCase,
|
std::vector<LgrInfo> RicExportLgrFeature::buildLgrsPerMainCell(RimEclipseCase* eclipseCase,
|
||||||
|
RimWellPath* wellPath,
|
||||||
const std::vector<RigCompletionDataGridCell>& intersectingCells,
|
const std::vector<RigCompletionDataGridCell>& intersectingCells,
|
||||||
const caf::VecIjk& lgrSizes)
|
const caf::VecIjk& lgrSizes)
|
||||||
{
|
{
|
||||||
std::vector<LgrInfo> lgrs;
|
std::vector<LgrInfo> lgrs;
|
||||||
|
|
||||||
int lgrId = firstAvailableLgrId(eclipseCase->mainGrid());
|
int lgrId = firstAvailableLgrId(eclipseCase->mainGrid());
|
||||||
for (auto intersectionCell : intersectingCells)
|
for (const auto& intersectionCell : intersectingCells)
|
||||||
{
|
{
|
||||||
auto lgrName = createLgrName("", lgrId);
|
auto lgrName = createLgrName("", lgrId);
|
||||||
lgrs.push_back(buildLgr(lgrId++, lgrName, lgrName, eclipseCase, {intersectionCell}, lgrSizes));
|
lgrs.push_back(buildLgr(lgrId++, lgrName, lgrName, eclipseCase, wellPath, {intersectionCell}, lgrSizes));
|
||||||
}
|
}
|
||||||
return lgrs;
|
return lgrs;
|
||||||
}
|
}
|
||||||
@@ -385,6 +386,7 @@ std::vector<LgrInfo> RicExportLgrFeature::buildLgrsPerMainCell(RimEclipseCase*
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<LgrInfo> RicExportLgrFeature::buildLgrsPerCompletion(
|
std::vector<LgrInfo> RicExportLgrFeature::buildLgrsPerCompletion(
|
||||||
RimEclipseCase* eclipseCase,
|
RimEclipseCase* eclipseCase,
|
||||||
|
RimWellPath* wellPath,
|
||||||
const std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>& completionInfo,
|
const std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>& completionInfo,
|
||||||
const caf::VecIjk& lgrSizesPerMainGridCell)
|
const caf::VecIjk& lgrSizesPerMainGridCell)
|
||||||
{
|
{
|
||||||
@@ -401,7 +403,7 @@ std::vector<LgrInfo> RicExportLgrFeature::buildLgrsPerCompletion(
|
|||||||
auto& typeName = namesAndCounters[complInfo.first.type].first;
|
auto& typeName = namesAndCounters[complInfo.first.type].first;
|
||||||
auto& typeCounter = namesAndCounters[complInfo.first.type].second;
|
auto& typeCounter = namesAndCounters[complInfo.first.type].second;
|
||||||
auto lgrShortName = createShortLgrName(typeName, typeCounter++);
|
auto lgrShortName = createShortLgrName(typeName, typeCounter++);
|
||||||
lgrs.push_back(buildLgr(lgrId++, lgrName, lgrShortName, eclipseCase, complInfo.second, lgrSizesPerMainGridCell));
|
lgrs.push_back(buildLgr(lgrId++, lgrName, lgrShortName, eclipseCase, wellPath, complInfo.second, lgrSizesPerMainGridCell));
|
||||||
}
|
}
|
||||||
return lgrs;
|
return lgrs;
|
||||||
}
|
}
|
||||||
@@ -413,6 +415,7 @@ LgrInfo RicExportLgrFeature::buildLgr(int
|
|||||||
const QString& lgrName,
|
const QString& lgrName,
|
||||||
const QString& shortLgrName,
|
const QString& shortLgrName,
|
||||||
RimEclipseCase* eclipseCase,
|
RimEclipseCase* eclipseCase,
|
||||||
|
RimWellPath* wellPath,
|
||||||
const std::vector<RigCompletionDataGridCell>& intersectingCells,
|
const std::vector<RigCompletionDataGridCell>& intersectingCells,
|
||||||
const caf::VecIjk& lgrSizesPerMainGridCell)
|
const caf::VecIjk& lgrSizesPerMainGridCell)
|
||||||
{
|
{
|
||||||
@@ -423,7 +426,7 @@ LgrInfo RicExportLgrFeature::buildLgr(int
|
|||||||
auto jRange = initRange();
|
auto jRange = initRange();
|
||||||
auto kRange = initRange();
|
auto kRange = initRange();
|
||||||
|
|
||||||
for (auto cell : intersectingCells)
|
for (const auto& cell : intersectingCells)
|
||||||
{
|
{
|
||||||
iRange.first = std::min(cell.localCellIndexI(), iRange.first);
|
iRange.first = std::min(cell.localCellIndexI(), iRange.first);
|
||||||
iRange.second = std::max(cell.localCellIndexI(), iRange.second);
|
iRange.second = std::max(cell.localCellIndexI(), iRange.second);
|
||||||
@@ -439,7 +442,7 @@ LgrInfo RicExportLgrFeature::buildLgr(int
|
|||||||
caf::VecIjk mainGridStartCell(iRange.first, jRange.first, kRange.first);
|
caf::VecIjk mainGridStartCell(iRange.first, jRange.first, kRange.first);
|
||||||
caf::VecIjk mainGridEndCell(iRange.second, jRange.second, kRange.second);
|
caf::VecIjk mainGridEndCell(iRange.second, jRange.second, kRange.second);
|
||||||
|
|
||||||
return LgrInfo(lgrId, lgrName, shortLgrName, lgrSizes, mainGridStartCell, mainGridEndCell);
|
return LgrInfo(lgrId, lgrName, shortLgrName, wellPath->name(), lgrSizes, mainGridStartCell, mainGridEndCell);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -526,7 +529,7 @@ std::vector<std::pair<RigCompletionDataGridCell, std::vector<RigCompletionData>>
|
|||||||
|
|
||||||
if (!cellFoundOnWellPath)
|
if (!cellFoundOnWellPath)
|
||||||
{
|
{
|
||||||
cellsNotOnWellPath.push_back({ true, CellInfo(complCell.first.globalCellIndex()) });
|
cellsNotOnWellPath.emplace_back( true, CellInfo(complCell.first.globalCellIndex()) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -540,7 +543,7 @@ std::vector<std::pair<RigCompletionDataGridCell, std::vector<RigCompletionData>>
|
|||||||
// Add cell on well path first
|
// Add cell on well path first
|
||||||
auto complDataGridCell = complCellLookup.at(cellOnWellPath.globCellIndex);
|
auto complDataGridCell = complCellLookup.at(cellOnWellPath.globCellIndex);
|
||||||
auto complDataList = completionCells.at(complDataGridCell);
|
auto complDataList = completionCells.at(complDataGridCell);
|
||||||
result.push_back({complDataGridCell, complDataList});
|
result.emplace_back(complDataGridCell, complDataList);
|
||||||
|
|
||||||
// Check intersected completions in current cell
|
// Check intersected completions in current cell
|
||||||
RigCompletionData::CompletionType complTypes[] = { RigCompletionData::FRACTURE, RigCompletionData::FISHBONES, RigCompletionData::PERFORATION };
|
RigCompletionData::CompletionType complTypes[] = { RigCompletionData::FRACTURE, RigCompletionData::FISHBONES, RigCompletionData::PERFORATION };
|
||||||
@@ -570,7 +573,7 @@ std::vector<std::pair<RigCompletionDataGridCell, std::vector<RigCompletionData>>
|
|||||||
|
|
||||||
if (itr != complDataList2.end())
|
if (itr != complDataList2.end())
|
||||||
{
|
{
|
||||||
result.push_back({ complCellLookup.at(cellNotOnWellPath.second.globCellIndex), complDataList2});
|
result.emplace_back( complCellLookup.at(cellNotOnWellPath.second.globCellIndex), complDataList2);
|
||||||
cellNotOnWellPath.first = false;
|
cellNotOnWellPath.first = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -599,7 +602,7 @@ std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>
|
|||||||
auto completions = eclipseCase->computeAndGetVirtualPerforationTransmissibilities();
|
auto completions = eclipseCase->computeAndGetVirtualPerforationTransmissibilities();
|
||||||
if (wellPathGeometry && completions)
|
if (wellPathGeometry && completions)
|
||||||
{
|
{
|
||||||
auto intCells = completions->multipleCompletionsPerEclipseCell(wellPath, timeStep);
|
const auto& intCells = completions->multipleCompletionsPerEclipseCell(wellPath, timeStep);
|
||||||
CompletionInfo lastCompletionInfo;
|
CompletionInfo lastCompletionInfo;
|
||||||
|
|
||||||
auto wpIntCells = RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath(eclipseCase->eclipseCaseData(),
|
auto wpIntCells = RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath(eclipseCase->eclipseCaseData(),
|
||||||
@@ -655,7 +658,7 @@ bool RicExportLgrFeature::isCommandEnabled()
|
|||||||
void RicExportLgrFeature::onActionTriggered(bool isChecked)
|
void RicExportLgrFeature::onActionTriggered(bool isChecked)
|
||||||
{
|
{
|
||||||
std::vector<RimWellPath*> wellPaths = selectedWellPaths();
|
std::vector<RimWellPath*> wellPaths = selectedWellPaths();
|
||||||
if(wellPaths.size() == 0) return;
|
if(wellPaths.empty()) return;
|
||||||
|
|
||||||
QString dialogTitle = "Export LGR for Completions";
|
QString dialogTitle = "Export LGR for Completions";
|
||||||
|
|
||||||
|
|||||||
@@ -45,10 +45,12 @@ public:
|
|||||||
LgrInfo(int id,
|
LgrInfo(int id,
|
||||||
const QString& name,
|
const QString& name,
|
||||||
const QString& shortName,
|
const QString& shortName,
|
||||||
|
const QString& associatedWellPathName,
|
||||||
const caf::VecIjk& sizes,
|
const caf::VecIjk& sizes,
|
||||||
const caf::VecIjk& mainGridStartCell,
|
const caf::VecIjk& mainGridStartCell,
|
||||||
const caf::VecIjk& mainGridEndCell)
|
const caf::VecIjk& mainGridEndCell)
|
||||||
: id(id), name(name), shortName(shortName), sizes(sizes), mainGridStartCell(mainGridStartCell), mainGridEndCell(mainGridEndCell)
|
: id(id), name(name), shortName(shortName), associatedWellPathName(associatedWellPathName),
|
||||||
|
sizes(sizes), mainGridStartCell(mainGridStartCell), mainGridEndCell(mainGridEndCell)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,6 +69,7 @@ public:
|
|||||||
int id;
|
int id;
|
||||||
QString name;
|
QString name;
|
||||||
QString shortName;
|
QString shortName;
|
||||||
|
QString associatedWellPathName;
|
||||||
caf::VecIjk sizes;
|
caf::VecIjk sizes;
|
||||||
|
|
||||||
caf::VecIjk mainGridStartCell;
|
caf::VecIjk mainGridStartCell;
|
||||||
@@ -162,16 +165,19 @@ private:
|
|||||||
static void exportLgrs(QTextStream& stream, const std::vector<LgrInfo>& lgrInfos);
|
static void exportLgrs(QTextStream& stream, const std::vector<LgrInfo>& lgrInfos);
|
||||||
|
|
||||||
static std::vector<LgrInfo> buildLgrsPerMainCell(RimEclipseCase* eclipseCase,
|
static std::vector<LgrInfo> buildLgrsPerMainCell(RimEclipseCase* eclipseCase,
|
||||||
|
RimWellPath* wellPath,
|
||||||
const std::vector<RigCompletionDataGridCell>& intersectingCells,
|
const std::vector<RigCompletionDataGridCell>& intersectingCells,
|
||||||
const caf::VecIjk& lgrSizes);
|
const caf::VecIjk& lgrSizes);
|
||||||
static std::vector<LgrInfo>
|
static std::vector<LgrInfo>
|
||||||
buildLgrsPerCompletion(RimEclipseCase* eclipseCase,
|
buildLgrsPerCompletion(RimEclipseCase* eclipseCase,
|
||||||
|
RimWellPath* wellPath,
|
||||||
const std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>& completionInfo,
|
const std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>& completionInfo,
|
||||||
const caf::VecIjk& lgrSizesPerMainGridCell);
|
const caf::VecIjk& lgrSizesPerMainGridCell);
|
||||||
static LgrInfo buildLgr(int lgrId,
|
static LgrInfo buildLgr(int lgrId,
|
||||||
const QString& lgrName,
|
const QString& lgrName,
|
||||||
const QString& shortLgrName,
|
const QString& shortLgrName,
|
||||||
RimEclipseCase* eclipseCase,
|
RimEclipseCase* eclipseCase,
|
||||||
|
RimWellPath* wellPath,
|
||||||
const std::vector<RigCompletionDataGridCell>& intersectingCells,
|
const std::vector<RigCompletionDataGridCell>& intersectingCells,
|
||||||
const caf::VecIjk& lgrSizesPerMainGridCell);
|
const caf::VecIjk& lgrSizesPerMainGridCell);
|
||||||
|
|
||||||
|
|||||||
@@ -220,6 +220,7 @@ void RicCreateTemporaryLgrFeature::createLgr(const LgrInfo& lgrInfo, RigMainGrid
|
|||||||
// Create local grid and set properties
|
// Create local grid and set properties
|
||||||
RigLocalGrid* localGrid = new RigLocalGrid(mainGrid);
|
RigLocalGrid* localGrid = new RigLocalGrid(mainGrid);
|
||||||
localGrid->setAsTempGrid(true);
|
localGrid->setAsTempGrid(true);
|
||||||
|
localGrid->setAssociatedWellPathName(lgrInfo.associatedWellPathName.toStdString());
|
||||||
localGrid->setGridId(lgrId);
|
localGrid->setGridId(lgrId);
|
||||||
localGrid->setIndexToStartOfCells(totalCellCount);
|
localGrid->setIndexToStartOfCells(totalCellCount);
|
||||||
localGrid->setGridName(lgrInfo.name.toStdString());
|
localGrid->setGridName(lgrInfo.name.toStdString());
|
||||||
|
|||||||
@@ -193,6 +193,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
|||||||
}
|
}
|
||||||
else if (dynamic_cast<RimGridInfoCollection*>(uiItem))
|
else if (dynamic_cast<RimGridInfoCollection*>(uiItem))
|
||||||
{
|
{
|
||||||
|
menuBuilder << "RicExportCompletionsForTemporaryLgrsFeature";
|
||||||
menuBuilder << "RicDeleteTemporaryLgrsFeature";
|
menuBuilder << "RicDeleteTemporaryLgrsFeature";
|
||||||
}
|
}
|
||||||
else if (dynamic_cast<RimGeoMechCase*>(uiItem))
|
else if (dynamic_cast<RimGeoMechCase*>(uiItem))
|
||||||
|
|||||||
@@ -30,8 +30,7 @@
|
|||||||
RigGridBase::RigGridBase(RigMainGrid* mainGrid):
|
RigGridBase::RigGridBase(RigMainGrid* mainGrid):
|
||||||
m_gridPointDimensions(0,0,0),
|
m_gridPointDimensions(0,0,0),
|
||||||
m_indexToStartOfCells(0),
|
m_indexToStartOfCells(0),
|
||||||
m_mainGrid(mainGrid),
|
m_mainGrid(mainGrid)
|
||||||
m_isTempGrid(false)
|
|
||||||
{
|
{
|
||||||
if (mainGrid == nullptr)
|
if (mainGrid == nullptr)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ public:
|
|||||||
|
|
||||||
cvf::BoundingBox boundingBox();
|
cvf::BoundingBox boundingBox();
|
||||||
|
|
||||||
|
virtual bool isTempGrid() const = 0;
|
||||||
|
virtual const std::string& associatedWellPathName() const = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class RigMainGrid;//::initAllSubGridsParentGridPointer();
|
friend class RigMainGrid;//::initAllSubGridsParentGridPointer();
|
||||||
void initSubGridParentPointer();
|
void initSubGridParentPointer();
|
||||||
@@ -105,10 +108,6 @@ public:
|
|||||||
bool isCellValid( size_t i, size_t j, size_t k ) const override;
|
bool isCellValid( size_t i, size_t j, size_t k ) const override;
|
||||||
bool cellIJKNeighbor(size_t i, size_t j, size_t k, FaceType face, size_t* neighborCellIndex ) const override;
|
bool cellIJKNeighbor(size_t i, size_t j, size_t k, FaceType face, size_t* neighborCellIndex ) const override;
|
||||||
|
|
||||||
void setAsTempGrid(bool isTemp) { m_isTempGrid = isTemp; }
|
|
||||||
bool isTempGrid() const { return m_isTempGrid; }
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string m_gridName;
|
std::string m_gridName;
|
||||||
cvf::Vec3st m_gridPointDimensions;
|
cvf::Vec3st m_gridPointDimensions;
|
||||||
@@ -119,8 +118,6 @@ private:
|
|||||||
cvf::BoundingBox m_boundingBox;
|
cvf::BoundingBox m_boundingBox;
|
||||||
|
|
||||||
std::vector<std::array<size_t, 6>> m_coarseningBoxInfo;
|
std::vector<std::array<size_t, 6>> m_coarseningBoxInfo;
|
||||||
|
|
||||||
bool m_isTempGrid;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,9 @@
|
|||||||
RigLocalGrid::RigLocalGrid(RigMainGrid* mainGrid):
|
RigLocalGrid::RigLocalGrid(RigMainGrid* mainGrid):
|
||||||
RigGridBase(mainGrid),
|
RigGridBase(mainGrid),
|
||||||
m_parentGrid(nullptr),
|
m_parentGrid(nullptr),
|
||||||
m_positionInParentGrid(cvf::UNDEFINED_SIZE_T)
|
m_positionInParentGrid(cvf::UNDEFINED_SIZE_T),
|
||||||
|
m_isTempGrid(false),
|
||||||
|
m_associatedWellPathName("")
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -64,3 +66,35 @@ void RigLocalGrid::setPositionInParentGrid(size_t positionInParentGrid)
|
|||||||
{
|
{
|
||||||
m_positionInParentGrid = positionInParentGrid;
|
m_positionInParentGrid = positionInParentGrid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RigLocalGrid::setAsTempGrid(bool isTemp)
|
||||||
|
{
|
||||||
|
m_isTempGrid = isTemp;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RigLocalGrid::isTempGrid() const
|
||||||
|
{
|
||||||
|
return m_isTempGrid;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RigLocalGrid::setAssociatedWellPathName(const std::string& wellPathName)
|
||||||
|
{
|
||||||
|
m_associatedWellPathName = wellPathName;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
const std::string& RigLocalGrid::associatedWellPathName() const
|
||||||
|
{
|
||||||
|
return m_associatedWellPathName;
|
||||||
|
}
|
||||||
|
|||||||
@@ -31,8 +31,16 @@ public:
|
|||||||
size_t positionInParentGrid() const;
|
size_t positionInParentGrid() const;
|
||||||
void setPositionInParentGrid(size_t positionInParentGrid);
|
void setPositionInParentGrid(size_t positionInParentGrid);
|
||||||
|
|
||||||
|
void setAsTempGrid(bool isTemp);
|
||||||
|
bool isTempGrid() const override;
|
||||||
|
|
||||||
|
void setAssociatedWellPathName(const std::string& wellPathName);
|
||||||
|
const std::string& associatedWellPathName() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RigGridBase * m_parentGrid;
|
RigGridBase * m_parentGrid;
|
||||||
size_t m_positionInParentGrid;
|
size_t m_positionInParentGrid;
|
||||||
|
bool m_isTempGrid;
|
||||||
|
std::string m_associatedWellPathName;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -754,3 +754,20 @@ cvf::BoundingBox RigMainGrid::boundingBox() const
|
|||||||
|
|
||||||
return m_boundingBox;
|
return m_boundingBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RigMainGrid::isTempGrid() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
const std::string& RigMainGrid::associatedWellPathName() const
|
||||||
|
{
|
||||||
|
static const std::string EMPTY_STRING;
|
||||||
|
return EMPTY_STRING;
|
||||||
|
}
|
||||||
|
|||||||
@@ -90,6 +90,9 @@ public:
|
|||||||
|
|
||||||
cvf::BoundingBox boundingBox() const;
|
cvf::BoundingBox boundingBox() const;
|
||||||
|
|
||||||
|
bool isTempGrid() const override;
|
||||||
|
const std::string& associatedWellPathName() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initAllSubCellsMainGridCellIndex();
|
void initAllSubCellsMainGridCellIndex();
|
||||||
void buildCellSearchTree();
|
void buildCellSearchTree();
|
||||||
|
|||||||
Reference in New Issue
Block a user