diff --git a/ApplicationCode/Commands/WellPathCommands/RicWellPathExportCompletionDataFeature.cpp b/ApplicationCode/Commands/WellPathCommands/RicWellPathExportCompletionDataFeature.cpp index c19a87db40..ea35fecfb3 100644 --- a/ApplicationCode/Commands/WellPathCommands/RicWellPathExportCompletionDataFeature.cpp +++ b/ApplicationCode/Commands/WellPathCommands/RicWellPathExportCompletionDataFeature.cpp @@ -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 wellPathCells = findIntersectingCells(caseData, wellPath->wellPathGeometry()->m_wellPathPoints); + + std::vector wellPathCells; + if (removeLateralsInMainBoreCells) + { + wellPathCells = findIntersectingCells(caseData, wellPath->wellPathGeometry()->m_wellPathPoints); + } + std::map lateralsPerCell; RifEclipseOutputTableFormatter formatter(stream); @@ -165,9 +171,12 @@ void RicWellPathExportCompletionDataFeature::exportToFolder(RimWellPath* wellPat addLateralToCells(&lateralsPerCell, lateralCells); } - std::vector cellsUniqueToLateral = filterWellPathCells(lateralCells, wellPathCells); + if (removeLateralsInMainBoreCells) + { + lateralCells = filterWellPathCells(lateralCells, wellPathCells); + } - std::vector cellRanges = getCellIndexRange(caseData->mainGrid(), cellsUniqueToLateral); + std::vector 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) diff --git a/ApplicationCode/Commands/WellPathCommands/RicWellPathExportCompletionDataFeature.h b/ApplicationCode/Commands/WellPathCommands/RicWellPathExportCompletionDataFeature.h index eea5037640..36f507d562 100644 --- a/ApplicationCode/Commands/WellPathCommands/RicWellPathExportCompletionDataFeature.h +++ b/ApplicationCode/Commands/WellPathCommands/RicWellPathExportCompletionDataFeature.h @@ -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 findCloseCells(const RigEclipseCaseData* caseData, const cvf::BoundingBox& bb); static std::vector getCellIndexRange(const RigMainGrid* grid, const std::vector& cellIndices); static bool cellOrdering(const EclipseCellIndex& cell1, const EclipseCellIndex& cell2); diff --git a/ApplicationCode/ProjectDataModel/RimExportCompletionDataSettings.cpp b/ApplicationCode/ProjectDataModel/RimExportCompletionDataSettings.cpp index 656e0680bf..eb342e1f38 100644 --- a/ApplicationCode/ProjectDataModel/RimExportCompletionDataSettings.cpp +++ b/ApplicationCode/ProjectDataModel/RimExportCompletionDataSettings.cpp @@ -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", "", "", ""); } diff --git a/ApplicationCode/ProjectDataModel/RimExportCompletionDataSettings.h b/ApplicationCode/ProjectDataModel/RimExportCompletionDataSettings.h index 3728ab04e3..37594a18b2 100644 --- a/ApplicationCode/ProjectDataModel/RimExportCompletionDataSettings.h +++ b/ApplicationCode/ProjectDataModel/RimExportCompletionDataSettings.h @@ -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 includeWpimult; + caf::PdmField removeLateralsInMainBoreCells; };