From 9e36faaa1f39876f4e9bfc3ee153d35c8e5665e0 Mon Sep 17 00:00:00 2001 From: Lisa Julia Nebel Date: Tue, 8 Oct 2024 15:02:27 +0200 Subject: [PATCH] Add comments at the spots where we multiply with D^(-1) - we actually can do this on all processes --- .../wells/MultisegmentWellEquations.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/opm/simulators/wells/MultisegmentWellEquations.cpp b/opm/simulators/wells/MultisegmentWellEquations.cpp index 3be842cc44..3033782f81 100644 --- a/opm/simulators/wells/MultisegmentWellEquations.cpp +++ b/opm/simulators/wells/MultisegmentWellEquations.cpp @@ -155,6 +155,9 @@ apply(const BVector& x, BVector& Ax) const // We need to communicate here to get the contributions from all segments this->pw_info_.communication().sum(Bx.data(), Bx.size()); + // It is ok to do this on each process instead of only on one, + // because the other processes would remain idle while waiting for + // the single process to complete the computation. // invDBx = duneD^-1 * Bx_ const BVectorWell invDBx = mswellhelpers::applyUMFPack(*duneDSolver_, Bx); @@ -166,6 +169,9 @@ template void MultisegmentWellEquations:: apply(BVector& r) const { + // It is ok to do this on each process instead of only on one, + // because the other processes would remain idle while waiting for + // the single process to complete the computation. // invDrw_ = duneD^-1 * resWell_ const BVectorWell invDrw = mswellhelpers::applyUMFPack(*duneDSolver_, resWell_); // r = r - duneC_^T * invDrw @@ -196,6 +202,9 @@ template typename MultisegmentWellEquations::BVectorWell MultisegmentWellEquations::solve() const { + // It is ok to do this on each process instead of only on one, + // because the other processes would remain idle while waiting for + // the single process to complete the computation. return mswellhelpers::applyUMFPack(*duneDSolver_, resWell_); } @@ -203,6 +212,9 @@ template typename MultisegmentWellEquations::BVectorWell MultisegmentWellEquations::solve(const BVectorWell& rhs) const { + // It is ok to do this on each process instead of only on one, + // because the other processes would remain idle while waiting for + // the single process to complete the computation. return mswellhelpers::applyUMFPack(*duneDSolver_, rhs); } @@ -220,6 +232,9 @@ recoverSolutionWell(const BVector& x, BVectorWell& xw) const resWell -= Bx; // xw = D^-1 * resWell + // It is ok to do this on each process instead of only on one, + // because the other processes would remain idle while waiting for + // the single process to complete the computation. xw = mswellhelpers::applyUMFPack(*duneDSolver_, resWell); }