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.
This commit is contained in:
Markus Blatt
2017-04-12 13:34:13 +02:00
parent 0db663fe51
commit b5612806ac

View File

@@ -803,24 +803,12 @@ namespace Opm {
// computation // computation
for ( int idx = 0; idx < np; ++idx ) for ( int idx = 0; idx < np; ++idx )
{ {
B_avg[idx] = accumulateMaskedValues(B[ idx ], mask) / double(ncGlobal); B_avg[idx] = std::accumulate( B[ idx ].begin(), B[ idx ].end(),
R_sum[idx] = accumulateMaskedValues(R[ idx ], mask); 0.0 ) / double(ncGlobal);
R_sum[idx] = std::accumulate( R[ idx ].begin(), R[ idx ].end(),
0.0 );
if(comm.size()>1) maxCoeff[idx] = *(std::max_element( tempV[ idx ].begin(), tempV[ idx ].end() ));
{
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() ));
}
assert(np >= np); assert(np >= np);
if (idx < np) { if (idx < np) {