Merge pull request #3033 from totto82/fixEmptyEquilOutput

Fix empty region output in parallel
This commit is contained in:
Bård Skaflestad 2021-01-27 15:03:06 +01:00 committed by GitHub
commit 9360d0a646
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1819,14 +1819,14 @@ private:
auto psat = PhaseSat { materialLawManager, this->swatInit_ };
auto vspan = std::array<double, 2>{};
std::vector<int> regionIsEmpty(rec.size(), 0);
for (size_t r = 0; r < rec.size(); ++r) {
const auto& cells = reg.cells(r);
Details::verticalExtent(cells, cellZMinMax_, comm, vspan);
if (cells.empty()) {
Opm::OpmLog::warning("Equilibration region " + std::to_string(r + 1)
+ " has no active cells");
regionIsEmpty[r] = 1;
continue;
}
@ -1852,6 +1852,14 @@ private:
ptable, psat);
}
}
comm.min(regionIsEmpty.data(),regionIsEmpty.size());
if (comm.rank() == 0) {
for (size_t r = 0; r < rec.size(); ++r) {
if (regionIsEmpty[r]) //region is empty on all partitions
Opm::OpmLog::warning("Equilibration region " + std::to_string(r + 1)
+ " has no active cells");
}
}
}
template <class CellRange, class EquilibrationMethod>