From 81a5da8b637eb07534045c35abc753effdf875b4 Mon Sep 17 00:00:00 2001 From: Lisa Julia Nebel Date: Wed, 16 Oct 2024 14:44:11 +0200 Subject: [PATCH] Add communication when multiplying with the matrix duneB_ in apply Here we go from cells to segments, and everything concerning segments is stored globally. --- opm/simulators/wells/MultisegmentWellEquations.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/opm/simulators/wells/MultisegmentWellEquations.cpp b/opm/simulators/wells/MultisegmentWellEquations.cpp index d229c7191..1eb1875f6 100644 --- a/opm/simulators/wells/MultisegmentWellEquations.cpp +++ b/opm/simulators/wells/MultisegmentWellEquations.cpp @@ -152,6 +152,11 @@ apply(const BVector& x, BVector& Ax) const duneB_.mv(x, Bx); + if (this->pw_info_.communication().size() == 1) { + // We need to communicate here to get the contributions from all segments + this->pw_info_.communication().sum(Bx.data(), Bx.size()); + } + // invDBx = duneD^-1 * Bx_ const BVectorWell invDBx = mswellhelpers::applyUMFPack(*duneDSolver_, Bx);