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:
@@ -192,8 +192,10 @@ public:
|
|||||||
|
|
||||||
bool hasPerfectUpdate() const override
|
bool hasPerfectUpdate() const override
|
||||||
{
|
{
|
||||||
// The Hypre preconditioner can depend on the values of the matrix, so it must be recreated
|
// The Hypre preconditioner can depend on the values of the matrix so it does not have perfect update.
|
||||||
return false;
|
// 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:
|
private:
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual bool hasPerfectUpdate() const override {
|
virtual bool hasPerfectUpdate() const override {
|
||||||
return false;
|
return twolevel_method_.hasPerfectUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -88,6 +88,11 @@ namespace Amg
|
|||||||
return linsolver_->category();
|
return linsolver_->category();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool hasPerfectUpdate() const
|
||||||
|
{
|
||||||
|
return linsolver_->preconditioner().hasPerfectUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
void apply(X& x, X& b, double reduction, Dune::InverseOperatorResult& res) override
|
void apply(X& x, X& b, double reduction, Dune::InverseOperatorResult& res) override
|
||||||
{
|
{
|
||||||
linsolver_->apply(x, b, reduction, res);
|
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)
|
void apply(FineDomainType& v, const FineRangeType& d)
|
||||||
{
|
{
|
||||||
FineDomainType u(v);
|
FineDomainType u(v);
|
||||||
|
|||||||
Reference in New Issue
Block a user