mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Skip duplicate well target locations to avoid numerical issues in curve generator
This commit is contained in:
parent
bbd0c5c67e
commit
4d5ceb0441
@ -608,10 +608,26 @@ std::vector<RimWellPathTarget*> RimWellPathGeometryDef::activeWellTargets() cons
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RiaLineArcWellPathCalculator RimWellPathGeometryDef::lineArcWellPathCalculator() const
|
RiaLineArcWellPathCalculator RimWellPathGeometryDef::lineArcWellPathCalculator() const
|
||||||
{
|
{
|
||||||
|
std::vector<RimWellPathTarget*> activeTargets;
|
||||||
|
|
||||||
|
auto candidates = activeWellTargets();
|
||||||
|
if ( !candidates.empty() )
|
||||||
|
{
|
||||||
|
activeTargets.push_back( candidates.front() );
|
||||||
|
RimWellPathTarget* previousTarget = candidates.front();
|
||||||
|
|
||||||
|
for ( size_t i = 1; i < candidates.size(); i++ )
|
||||||
|
{
|
||||||
|
auto candidate = candidates[i];
|
||||||
|
if ( previousTarget && ( previousTarget->targetPointXYZ() - candidate->targetPointXYZ() ).length() > 1e-3 )
|
||||||
|
{
|
||||||
|
activeTargets.push_back( candidate );
|
||||||
|
previousTarget = candidate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<RiaLineArcWellPathCalculator::WellTarget> targetDatas;
|
std::vector<RiaLineArcWellPathCalculator::WellTarget> targetDatas;
|
||||||
|
|
||||||
std::vector<RimWellPathTarget*> activeTargets = activeWellTargets();
|
|
||||||
|
|
||||||
for ( auto wellTarget : activeTargets )
|
for ( auto wellTarget : activeTargets )
|
||||||
{
|
{
|
||||||
targetDatas.push_back( wellTarget->wellTargetData() );
|
targetDatas.push_back( wellTarget->wellTargetData() );
|
||||||
|
Loading…
Reference in New Issue
Block a user