mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
added: StandardWellEquations::apply(x,Ax)
this applies the equation system to a vector. use the new method in the well implementation.
This commit is contained in:
@@ -111,6 +111,25 @@ void StandardWellEquations<Scalar,numEq>::clear()
|
||||
resWell_ = 0.0;
|
||||
}
|
||||
|
||||
template<class Scalar, int numEq>
|
||||
void StandardWellEquations<Scalar,numEq>::apply(const BVector& x, BVector& Ax) const
|
||||
{
|
||||
assert(Bx_.size() == duneB_.N());
|
||||
assert(invDrw_.size() == invDuneD_.N());
|
||||
|
||||
// Bx_ = duneB_ * x
|
||||
parallelB_.mv(x, Bx_);
|
||||
|
||||
// invDBx = invDuneD_ * Bx_
|
||||
// TODO: with this, we modified the content of the invDrw_.
|
||||
// Is it necessary to do this to save some memory?
|
||||
auto& invDBx = invDrw_;
|
||||
invDuneD_.mv(Bx_, invDBx);
|
||||
|
||||
// Ax = Ax - duneC_^T * invDBx
|
||||
duneC_.mmtv(invDBx, Ax);
|
||||
}
|
||||
|
||||
#define INSTANCE(N) \
|
||||
template class StandardWellEquations<double,N>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user