diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp index a1604f5b7c..3765fab7f4 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp @@ -849,17 +849,17 @@ RicMswExportInfo RicWellPathExportMswCompletionsImpl::generateFishbonesMswExport for ( auto& sub : subs->installedLateralIndices() ) { double subEndMD = subs->measuredDepth( sub.subIndex ); - double subEndTVD = -wellPath->wellPathGeometry()->interpolatedPointAlongWellPath( subEndMD ).z(); + double subEndTVD = RicWellPathExportMswCompletionsImpl::tvdFromMeasuredDepth( wellPath, subEndMD ); int subSegCount = SubSegmentIntersectionInfo::numberOfSplittedSegments( subStartMD, subEndMD, maxSegmentLength ); double subSegLen = ( subEndMD - subStartMD ) / subSegCount; double startMd = subStartMD; - double startTvd = -wellPath->wellPathGeometry()->interpolatedPointAlongWellPath( startMd ).z(); + double startTvd = RicWellPathExportMswCompletionsImpl::tvdFromMeasuredDepth( wellPath, startMd ); for ( int ssi = 0; ssi < subSegCount; ssi++ ) { double endMd = startMd + subSegLen; - double endTvd = -wellPath->wellPathGeometry()->interpolatedPointAlongWellPath( endMd ).z(); + double endTvd = RicWellPathExportMswCompletionsImpl::tvdFromMeasuredDepth( wellPath, endMd ); std::shared_ptr location( new RicMswSegment( subs->generatedName(), startMd, endMd, startTvd, endTvd, sub.subIndex ) ); @@ -1910,6 +1910,18 @@ void RicWellPathExportMswCompletionsImpl::assignBranchAndSegmentNumbers( const R } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RicWellPathExportMswCompletionsImpl::tvdFromMeasuredDepth( const RimWellPath* wellPath, double measuredDepth ) +{ + CVF_ASSERT( wellPath && wellPath->wellPathGeometry() ); + + double tvdValue = -wellPath->wellPathGeometry()->interpolatedPointAlongWellPath( measuredDepth ).z(); + + return tvdValue; +} + SubSegmentIntersectionInfo::SubSegmentIntersectionInfo( size_t globCellIndex, double startTVD, double endTVD, diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.h b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.h index ad343b1f44..f2e7211022 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.h +++ b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.h @@ -163,4 +163,6 @@ private: int* branchNum, int* segmentNum ); static void assignBranchAndSegmentNumbers( const RimEclipseCase* caseToApply, RicMswExportInfo* exportInfo ); + + static double tvdFromMeasuredDepth( const RimWellPath* wellPath, double measuredDepth ); };