From 9a6073eb7b1de89b7ca5567e6bccb431d4fb6d69 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 13 May 2021 20:19:49 +0200 Subject: [PATCH] #7678 Fishbones MSW : Always create an intersection for an ICD segment --- .../RicWellPathExportMswCompletionsImpl.cpp | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp index d655a3f2ea..621ed60346 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp @@ -530,7 +530,8 @@ void RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfo( } // Find cell intersections closest to each sub location - std::map> subAndCellIntersectionIndices; + std::map> closestSubForCellIntersections; + std::map cellIntersectionContainingSubIndex; { auto fishboneSectionStart = subs->startMD(); auto fishboneSectionEnd = subs->endMD(); @@ -549,6 +550,11 @@ void RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfo( { double subMD = subs->measuredDepth( sub.first ); + if ( ( cellIntersection.startMD <= subMD ) && ( subMD <= cellIntersection.endMD ) ) + { + cellIntersectionContainingSubIndex[sub.first] = intersectionIndex; + } + auto distanceCandicate = std::abs( subMD - intersectionMidpoint ); if ( distanceCandicate < closestDistance ) { @@ -557,7 +563,7 @@ void RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfo( } } - subAndCellIntersectionIndices[closestSubIndex].push_back( intersectionIndex ); + closestSubForCellIntersections[closestSubIndex].push_back( intersectionIndex ); } } } @@ -597,7 +603,15 @@ void RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfo( { const RigMainGrid* mainGrid = eclipseCase->mainGrid(); - for ( auto intersectionIndex : subAndCellIntersectionIndices[sub.first] ) + std::set indices; + for ( auto intersectionIndex : closestSubForCellIntersections[sub.first] ) + { + indices.insert( intersectionIndex ); + } + + indices.insert( cellIntersectionContainingSubIndex[sub.first] ); + + for ( auto intersectionIndex : indices ) { auto intersection = filteredIntersections[intersectionIndex]; if ( intersection.globCellIndex >= mainGrid->globalCellArray().size() ) continue;