AMDiS 2.10
The Adaptive Multi-Dimensional Simulation Toolbox
PreconditionerInterface.hpp
1#pragma once
2
3#include <amdis/Output.hpp>
4
5namespace AMDiS
6{
8 template <class M, class X, class Y>
10 {
11 public:
13 virtual ~PreconditionerInterface() = default;
14
16 virtual void init(M const& A) = 0;
17
19 virtual void finish() = 0;
20
22 virtual void solve(X const& x, Y& y) const = 0;
23
25 virtual void adjoint_solve(X const& x, Y& y) const
26 {
27 error_exit("Must be implemented by derived class.");
28 }
29 };
30
31} // end namespace AMDiS
Interface for Preconditioner y = M*x.
Definition: PreconditionerInterface.hpp:10
virtual void init(M const &A)=0
Is called a the beginning of a solution procedure.
virtual ~PreconditionerInterface()=default
Virtual destructor.
virtual void finish()=0
Is called at the end of a solution procedure.
virtual void adjoint_solve(X const &x, Y &y) const
Apply the transposed preconditioner to a vector x and store the result in y.
Definition: PreconditionerInterface.hpp:25
virtual void solve(X const &x, Y &y) const =0
Apply the preconditioner to a vector x and store the result in y.