From 8d9080d6950debae97e1fb4982f340f306cd0df1 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 23 Nov 2018 11:32:50 +0100 Subject: [PATCH] #3750 Completion export header : Report only referenced fracture templates --- .../RicWellPathFractureReportItem.cpp | 4 +- ...cWellPathFractureTextReportFeatureImpl.cpp | 56 ++++++++++++------- 2 files changed, 39 insertions(+), 21 deletions(-) diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureReportItem.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureReportItem.cpp index c194586137..70022f4a93 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureReportItem.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureReportItem.cpp @@ -25,11 +25,11 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RicWellPathFractureReportItem::RicWellPathFractureReportItem(const QString& wellPathName, +RicWellPathFractureReportItem::RicWellPathFractureReportItem(const QString& wellPathNameForExport, const QString& fractureName, const QString& fractureTemplateName, double measuredDepth) - : m_wellPathNameForExport(wellPathName) + : m_wellPathNameForExport(wellPathNameForExport) , m_wellPathFracture(fractureName) , m_wellPathFractureTemplate(fractureTemplateName) , m_mesuredDepth(measuredDepth) diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.cpp index e87e143a02..a9b38bce1b 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.cpp @@ -80,24 +80,39 @@ QString RicWellPathFractureTextReportFeatureImpl::wellPathFractureReport( textStream << lineStart << "\n"; - auto proj = RiaApplication::instance()->project(); - auto fractureTemplates = proj->activeOilField()->fractureDefinitionCollection()->fractureTemplates(); std::vector stimPlanTemplates; std::vector ellipseTemplates; + - for (const auto fracTemplate : fractureTemplates) { - auto stimPlanTemplate = dynamic_cast(fracTemplate); - if (stimPlanTemplate) + auto proj = RiaApplication::instance()->project(); + auto fractureTemplates = proj->activeOilField()->fractureDefinitionCollection()->fractureTemplates(); + + std::set usedFractureTemplateNames; + for (const auto& item : wellPathFractureReportItems) { - stimPlanTemplates.push_back(stimPlanTemplate); + usedFractureTemplateNames.insert(item.fractureTemplateName()); } - auto ellipseTemplate = dynamic_cast(fracTemplate); - if (ellipseTemplate) + for (const auto fracTemplate : fractureTemplates) { - ellipseTemplates.push_back(ellipseTemplate); + if (usedFractureTemplateNames.find(fracTemplate->name()) == usedFractureTemplateNames.end()) + { + continue; + } + + auto stimPlanTemplate = dynamic_cast(fracTemplate); + if (stimPlanTemplate) + { + stimPlanTemplates.push_back(stimPlanTemplate); + } + + auto ellipseTemplate = dynamic_cast(fracTemplate); + if (ellipseTemplate) + { + ellipseTemplates.push_back(ellipseTemplate); + } } } @@ -136,7 +151,11 @@ QString RicWellPathFractureTextReportFeatureImpl::wellPathFractureReport( } { - QString tableText = createFractureText(fractureTemplates); + std::vector fracTemplates; + fracTemplates.insert(fracTemplates.end(), ellipseTemplates.begin(), ellipseTemplates.end()); + fracTemplates.insert(fracTemplates.end(), stimPlanTemplates.begin(), stimPlanTemplates.end()); + + QString tableText = createFractureText(fracTemplates); textStream << tableText; textStream << lineStart << "\n"; } @@ -623,7 +642,7 @@ QString RicWellPathFractureTextReportFeatureImpl::createFractureCompletionSummar RifEclipseOutputTableColumn(meanText, RifEclipseOutputTableDoubleFormatting(RIF_FLOAT, 1), RIGHT), // KfWf RifEclipseOutputTableColumn(meanText, RifEclipseOutputTableDoubleFormatting(RIF_FLOAT, 1), RIGHT), // Kf floatNumberColumn(meanText), // wf - RifEclipseOutputTableColumn(meanText, RifEclipseOutputTableDoubleFormatting(RIF_FLOAT, 1), RIGHT), //xf + RifEclipseOutputTableColumn(meanText, RifEclipseOutputTableDoubleFormatting(RIF_FLOAT, 1), RIGHT), // xf RifEclipseOutputTableColumn(meanText, RifEclipseOutputTableDoubleFormatting(RIF_FLOAT, 1), RIGHT), // H floatNumberColumn(meanText), // Km }; @@ -698,7 +717,8 @@ QString RicWellPathFractureTextReportFeatureImpl::createFractureCompletionSummar //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -QString RicWellPathFractureTextReportFeatureImpl::createFracturePressureDepletionSummaryText(const std::vector& wellPathFractureReportItems) const +QString RicWellPathFractureTextReportFeatureImpl::createFracturePressureDepletionSummaryText( + const std::vector& wellPathFractureReportItems) const { QString tableText; @@ -706,13 +726,11 @@ QString RicWellPathFractureTextReportFeatureImpl::createFracturePressureDepletio RifEclipseDataTableFormatter formatter(stream); configureFormatter(&formatter); - std::vector header = { - RifEclipseOutputTableColumn("Well"), - RifEclipseOutputTableColumn("Fracture"), - RifEclipseOutputTableColumn("Actual WBHP"), - RifEclipseOutputTableColumn("Min Pressure Drop"), - RifEclipseOutputTableColumn("Max Pressure Drop") - }; + std::vector header = {RifEclipseOutputTableColumn("Well"), + RifEclipseOutputTableColumn("Fracture"), + RifEclipseOutputTableColumn("Actual WBHP"), + RifEclipseOutputTableColumn("Min Pressure Drop"), + RifEclipseOutputTableColumn("Max Pressure Drop")}; bool createdTable = false;