mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Add communication when multiplying with the matrix duneB_ in recoverSolutionWell
Here we go from cells to segments, and everything concerning segments is stored globally.
This commit is contained in:
parent
81a5da8b63
commit
627b9c98ba
@ -212,9 +212,20 @@ template<class Scalar, int numWellEq, int numEq>
|
||||
void MultisegmentWellEquations<Scalar,numWellEq,numEq>::
|
||||
recoverSolutionWell(const BVector& x, BVectorWell& xw) const
|
||||
{
|
||||
BVectorWell resWell = resWell_;
|
||||
// resWell = resWell - B * x
|
||||
duneB_.mmv(x, resWell);
|
||||
BVectorWell resWell = resWell_;
|
||||
if (this->pw_info_.communication().size() == 1) {
|
||||
duneB_.mmv(x, resWell);
|
||||
} else {
|
||||
BVectorWell Bx(duneB_.N());
|
||||
duneB_.mv(x, Bx);
|
||||
|
||||
// We need to communicate here to get the contributions from all segments
|
||||
this->pw_info_.communication().sum(Bx.data(), Bx.size());
|
||||
|
||||
resWell -= Bx;
|
||||
}
|
||||
|
||||
// xw = D^-1 * resWell
|
||||
xw = mswellhelpers::applyUMFPack(*duneDSolver_, resWell);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user