Skip to content

Commit

Permalink
Add comments at the spots where we multiply with D^(-1) - we actually…
Browse files Browse the repository at this point in the history
… can do this on all processes
  • Loading branch information
lisajulia committed Nov 21, 2024
1 parent a05015e commit b3130be
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions opm/simulators/wells/MultisegmentWellEquations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -166,6 +169,9 @@ template<class Scalar, int numWellEq, int numEq>
void MultisegmentWellEquations<Scalar,numWellEq,numEq>::
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
Expand Down Expand Up @@ -196,13 +202,19 @@ template<class Scalar, int numWellEq, int numEq>
typename MultisegmentWellEquations<Scalar,numWellEq,numEq>::BVectorWell
MultisegmentWellEquations<Scalar,numWellEq,numEq>::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_);
}

template<class Scalar, int numWellEq, int numEq>
typename MultisegmentWellEquations<Scalar,numWellEq,numEq>::BVectorWell
MultisegmentWellEquations<Scalar,numWellEq,numEq>::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);
}

Expand All @@ -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);
}

Expand Down

0 comments on commit b3130be

Please sign in to comment.