mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
added: MultisegmentWellEquations::apply(r)
this applies the equation system to a vector. use the new method in the well implementation.
This commit is contained in:
parent
f2acbccc1a
commit
abf5f94561
@ -130,6 +130,16 @@ apply(const BVector& x, BVector& Ax) const
|
||||
duneC_.mmtv(invDBx,Ax);
|
||||
}
|
||||
|
||||
template<class Scalar, int numWellEq, int numEq>
|
||||
void MultisegmentWellEquations<Scalar,numWellEq,numEq>::
|
||||
apply(BVector& r) const
|
||||
{
|
||||
// invDrw_ = duneD^-1 * resWell_
|
||||
const BVectorWell invDrw = mswellhelpers::applyUMFPack(duneD_, duneDSolver_, resWell_);
|
||||
// r = r - duneC_^T * invDrw
|
||||
duneC_.mmtv(invDrw, r);
|
||||
}
|
||||
|
||||
#define INSTANCE(numWellEq, numEq) \
|
||||
template class MultisegmentWellEquations<double,numWellEq,numEq>;
|
||||
|
||||
|
@ -77,6 +77,9 @@ public:
|
||||
//! \brief Apply linear operator to vector.
|
||||
void apply(const BVector& x, BVector& Ax) const;
|
||||
|
||||
//! \brief Apply linear operator to vector.
|
||||
void apply(BVector& r) const;
|
||||
|
||||
// two off-diagonal matrices
|
||||
OffDiagMatWell duneB_;
|
||||
OffDiagMatWell duneC_;
|
||||
|
@ -217,14 +217,11 @@ namespace Opm
|
||||
MultisegmentWell<TypeTag>::
|
||||
apply(BVector& r) const
|
||||
{
|
||||
if (!this->isOperableAndSolvable() && !this->wellIsStopped()) return;
|
||||
if (!this->isOperableAndSolvable() && !this->wellIsStopped()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// invDrw_ = duneD^-1 * resWell_
|
||||
const BVectorWell invDrw = mswellhelpers::applyUMFPack(this->linSys_.duneD_,
|
||||
this->linSys_.duneDSolver_,
|
||||
this->linSys_.resWell_);
|
||||
// r = r - duneC_^T * invDrw
|
||||
this->linSys_.duneC_.mmtv(invDrw, r);
|
||||
this->linSys_.apply(r);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user