From b5612806ac467dda67d2eb27b2982b2e2de1aa40 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Wed, 12 Apr 2017 13:34:13 +0200 Subject: [PATCH] Revert to using standard algorithms instead of using masks. This is now possible as the values stored for ghost/overlap elements (minimum where we compute the maxiumum, zero where we sum up) will not influence the result of the computation any more. --- opm/autodiff/BlackoilModelEbos.hpp | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/opm/autodiff/BlackoilModelEbos.hpp b/opm/autodiff/BlackoilModelEbos.hpp index 67f0cda41..7e3c1ad7e 100644 --- a/opm/autodiff/BlackoilModelEbos.hpp +++ b/opm/autodiff/BlackoilModelEbos.hpp @@ -803,24 +803,12 @@ namespace Opm { // computation for ( int idx = 0; idx < np; ++idx ) { - B_avg[idx] = accumulateMaskedValues(B[ idx ], mask) / double(ncGlobal); - R_sum[idx] = accumulateMaskedValues(R[ idx ], mask); + B_avg[idx] = std::accumulate( B[ idx ].begin(), B[ idx ].end(), + 0.0 ) / double(ncGlobal); + R_sum[idx] = std::accumulate( R[ idx ].begin(), R[ idx ].end(), + 0.0 ); - if(comm.size()>1) - { - auto mi = mask->begin(); - for(auto elem = tempV[idx].begin(), end = tempV[idx].end(); elem != end; ++elem, ++mi) - { - if ( *mi ) - { - maxCoeff[idx] = std::max( maxCoeff[idx], *elem); - } - } - } - else - { - maxCoeff[idx] = *(std::max_element( tempV[ idx ].begin(), tempV[ idx ].end() )); - } + maxCoeff[idx] = *(std::max_element( tempV[ idx ].begin(), tempV[ idx ].end() )); assert(np >= np); if (idx < np) {