#1462 Add checkbox to decide whether laterals in cells with the main well path are exported

This commit is contained in:
Bjørnar Grip Fjær 2017-05-16 15:17:19 +02:00
parent f4223435f6
commit f280835f9e
4 changed files with 18 additions and 9 deletions

View File

@ -88,7 +88,7 @@ void RicWellPathExportCompletionDataFeature::onActionTriggered(bool isChecked)
{
RiaApplication::instance()->setLastUsedDialogDirectory("COMPLETIONS", QFileInfo(exportSettings.fileName).absolutePath());
exportToFolder(objects[0], exportSettings.fileName, exportSettings.caseToApply, exportSettings.includeWpimult());
exportToFolder(objects[0], exportSettings.fileName, exportSettings.caseToApply, exportSettings.includeWpimult(), exportSettings.removeLateralsInMainBoreCells());
}
}
@ -103,7 +103,7 @@ void RicWellPathExportCompletionDataFeature::setupActionLook(QAction* actionToSe
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportCompletionDataFeature::exportToFolder(RimWellPath* wellPath, const QString& fileName, const RimEclipseCase* caseToApply, bool includeWpimult)
void RicWellPathExportCompletionDataFeature::exportToFolder(RimWellPath* wellPath, const QString& fileName, const RimEclipseCase* caseToApply, bool includeWpimult, bool removeLateralsInMainBoreCells)
{
QFile exportFile(fileName);
@ -112,7 +112,7 @@ void RicWellPathExportCompletionDataFeature::exportToFolder(RimWellPath* wellPat
RiaLogging::error("Export Completions Data: Cannot export completions data without specified eclipse case");
return;
}
if (!exportFile.open(QIODevice::WriteOnly))
{
RiaLogging::error(QString("Export Completions Data: Could not open the file: %1").arg(fileName));
@ -122,7 +122,13 @@ void RicWellPathExportCompletionDataFeature::exportToFolder(RimWellPath* wellPat
QTextStream stream(&exportFile);
const RigEclipseCaseData* caseData = caseToApply->eclipseCaseData();
std::vector<size_t> wellPathCells = findIntersectingCells(caseData, wellPath->wellPathGeometry()->m_wellPathPoints);
std::vector<size_t> wellPathCells;
if (removeLateralsInMainBoreCells)
{
wellPathCells = findIntersectingCells(caseData, wellPath->wellPathGeometry()->m_wellPathPoints);
}
std::map<size_t, double> lateralsPerCell;
RifEclipseOutputTableFormatter formatter(stream);
@ -165,9 +171,12 @@ void RicWellPathExportCompletionDataFeature::exportToFolder(RimWellPath* wellPat
addLateralToCells(&lateralsPerCell, lateralCells);
}
std::vector<size_t> cellsUniqueToLateral = filterWellPathCells(lateralCells, wellPathCells);
if (removeLateralsInMainBoreCells)
{
lateralCells = filterWellPathCells(lateralCells, wellPathCells);
}
std::vector<EclipseCellIndexRange> cellRanges = getCellIndexRange(caseData->mainGrid(), cellsUniqueToLateral);
std::vector<EclipseCellIndexRange> cellRanges = getCellIndexRange(caseData->mainGrid(), lateralCells);
formatter.comment(QString("Fishbone %1 - Sub: %2 - Lateral: %3").arg(subs->name()).arg(subIndex).arg(lateralIndex));
for (auto cellRange : cellRanges)

View File

@ -52,7 +52,7 @@ protected:
virtual void setupActionLook(QAction* actionToSetup) override;
private:
static void exportToFolder(RimWellPath* wellPath, const QString& fileName, const RimEclipseCase* caseToApply, bool includeWpimult);
static void exportToFolder(RimWellPath* wellPath, const QString& fileName, const RimEclipseCase* caseToApply, bool includeWpimult, bool removeLateralsInMainBoreCells);
static std::vector<size_t> findCloseCells(const RigEclipseCaseData* caseData, const cvf::BoundingBox& bb);
static std::vector<EclipseCellIndexRange> getCellIndexRange(const RigMainGrid* grid, const std::vector<size_t>& cellIndices);
static bool cellOrdering(const EclipseCellIndex& cell1, const EclipseCellIndex& cell2);

View File

@ -1,7 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017- Statoil ASA
// Copyright (C) 2017- Ceetron Solutions AS
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@ -29,4 +28,5 @@ RimExportCompletionDataSettings::RimExportCompletionDataSettings()
CAF_PDM_InitObject("RimExportCompletionDataSettings", "", "", "");
CAF_PDM_InitFieldNoDefault(&includeWpimult, "IncludeWPIMULT", "Include WPIMLUT", "", "", "");
CAF_PDM_InitFieldNoDefault(&removeLateralsInMainBoreCells, "RemoveLateralsInMainBoreCells", "Remove Laterals in Main Bore Cells", "", "", "");
}

View File

@ -1,7 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017- Statoil ASA
// Copyright (C) 2017- Ceetron Solutions AS
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@ -35,4 +34,5 @@ public:
RimExportCompletionDataSettings();
caf::PdmField<bool> includeWpimult;
caf::PdmField<bool> removeLateralsInMainBoreCells;
};