Check which each well whether to call apply for well contributions.

This allows for different implementations of wells in well_container
when adding well contributions to the matrix.
This commit is contained in:
Markus Blatt 2018-02-26 15:47:25 +01:00
parent 455cf79d8d
commit e53374b8ec

View File

@ -321,13 +321,15 @@ namespace Opm {
apply(const BVector& x, BVector& Ax) const
{
// TODO: do we still need localWellsActive()?
if ( ! localWellsActive() ||
well_container_[0]->jacobianContainsWellContributions() ) {
if ( ! localWellsActive() ) {
return;
}
for (auto& well : well_container_) {
well->apply(x, Ax);
if ( ! well->jacobianContainsWellContributions() )
{
well->apply(x, Ax);
}
}
}
@ -341,8 +343,7 @@ namespace Opm {
BlackoilWellModel<TypeTag>::
applyScaleAdd(const Scalar alpha, const BVector& x, BVector& Ax) const
{
if ( ! localWellsActive() ||
well_container_[0]->jacobianContainsWellContributions() ) {
if ( ! localWellsActive() ) {
return;
}