flow_ebos FIP: try to fix hcpv and pres in the parallel case

the global reduction must be done _after_ the local computation, not
before it...

thanks to [at]blattms and [at]atgeirr.
This commit is contained in:
Andreas Lauser 2017-01-17 11:47:55 +01:00
parent d03dbb7e2c
commit 55547a1b86

View File

@ -1051,9 +1051,6 @@ namespace Opm {
dims = comm.max(dims);
std::vector<std::vector<double>> values(dims, std::vector<double>(FIPDataType::fipValues,0.0));
std::vector<double> hcpv(dims, 0.0);
std::vector<double> pres(dims, 0.0);
//Accumulate phases for each region
for (int phase = 0; phase < maxnp; ++phase) {
if (active_[ phase ]) {
@ -1077,8 +1074,8 @@ namespace Opm {
}
}
comm.sum(hcpv.data(), hcpv.size());
comm.sum(pres.data(), pres.size());
std::vector<double> hcpv(dims, 0.0);
std::vector<double> pres(dims, 0.0);
elemIt = elemCtx.gridView().template begin</*codim=*/0>();
for (; elemIt != elemEndIt; ++elemIt) {
@ -1104,6 +1101,9 @@ namespace Opm {
}
}
comm.sum(hcpv.data(), hcpv.size());
comm.sum(pres.data(), pres.size());
elemIt = elemCtx.gridView().template begin</*codim=*/0>();
for (; elemIt != elemEndIt; ++elemIt) {
const auto& elem = *elemIt;