mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Propagate need for recreating solver properly for two level methods
This commit is contained in:
parent
3b67d6dc54
commit
e60aa7da13
@ -192,8 +192,10 @@ public:
|
||||
|
||||
bool hasPerfectUpdate() const override
|
||||
{
|
||||
// The Hypre preconditioner can depend on the values of the matrix, so it must be recreated
|
||||
return false;
|
||||
// The Hypre preconditioner can depend on the values of the matrix so it does not have perfect update.
|
||||
// However, copying the matrix to Hypre requires to setup the solver again, so this is handled internally.
|
||||
// So for ISTLSolver, we can return true.
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -174,7 +174,7 @@ public:
|
||||
}
|
||||
|
||||
virtual bool hasPerfectUpdate() const override {
|
||||
return false;
|
||||
return twolevel_method_.hasPerfectUpdate();
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -88,6 +88,11 @@ namespace Amg
|
||||
return linsolver_->category();
|
||||
}
|
||||
|
||||
bool hasPerfectUpdate() const
|
||||
{
|
||||
return linsolver_->preconditioner().hasPerfectUpdate();
|
||||
}
|
||||
|
||||
void apply(X& x, X& b, double reduction, Dune::InverseOperatorResult& res) override
|
||||
{
|
||||
linsolver_->apply(x, b, reduction, res);
|
||||
|
@ -495,6 +495,12 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
bool hasPerfectUpdate() const
|
||||
{
|
||||
// The two-level method has perfect update if both the finesmoother and coarse solver do.
|
||||
return smoother_->hasPerfectUpdate() && coarseSolver_->hasPerfectUpdate();
|
||||
}
|
||||
|
||||
void apply(FineDomainType& v, const FineRangeType& d)
|
||||
{
|
||||
FineDomainType u(v);
|
||||
|
Loading…
Reference in New Issue
Block a user