From ef32c8bdc56505856132c7f30ac0ee080a722371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Tue, 14 Mar 2017 19:11:45 +0100 Subject: [PATCH] #1314 use of abs() is unsafe on linux. Ends up with integer abs() fossibly due to a different default include behaviour. Changed to fabs --- .../ReservoirDataModel/RigAccWellFlowCalculator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/ReservoirDataModel/RigAccWellFlowCalculator.cpp b/ApplicationCode/ReservoirDataModel/RigAccWellFlowCalculator.cpp index d951508a1f..01861a3165 100644 --- a/ApplicationCode/ReservoirDataModel/RigAccWellFlowCalculator.cpp +++ b/ApplicationCode/ReservoirDataModel/RigAccWellFlowCalculator.cpp @@ -689,7 +689,7 @@ void RigAccWellFlowCalculator::sortTracers() double totalFlow = 0.0; - if (mainBranchAccFlow.size()) totalFlow = - abs( mainBranchAccFlow.back() ); // Based on size in reverse order (biggest to least) + if (mainBranchAccFlow.size()) totalFlow = - fabs( mainBranchAccFlow.back() ); // Based on size in reverse order (biggest to least) sortedTracers.insert({totalFlow, tracerName}); } @@ -722,7 +722,7 @@ void RigAccWellFlowCalculator::groupSmallContributions() for ( const auto& tracerPair : totalTracerFractions ) { - if ( abs(tracerPair.second) <= m_smallContributionsThreshold + if ( fabs(tracerPair.second) <= m_smallContributionsThreshold && (hasConsistentWellFlow || tracerPair.first != RIG_RESERVOIR_TRACER_NAME) ) // Do not group the Reservoir tracer if the well flow is inconsistent, because cross flow is shown as the reservoir fraction { tracersToGroup.push_back(tracerPair.first);