5#include <amdis/CreatorInterface.hpp>
6#include <amdis/Initfile.hpp>
7#include <amdis/linearalgebra/LinearSolverInterface.hpp>
8#include <amdis/linearalgebra/eigen/PreconConfig.hpp>
9#include <amdis/linearalgebra/eigen/SolverConfig.hpp>
13 template <
class M,
class X,
class Y,
class IterativeSolver>
24 SolverCfg::init(prefix, solver_);
25 PreconCfg::init(prefix +
"->precon", solver_.preconditioner());
32 if (!reusePattern_ || !initialized_) {
33 solver_.analyzePattern(A);
38 test_exit(solver_.info() == Eigen::Success,
"Error in solver.compute(matrix)");
48 void apply(X& x, Y
const& b, Dune::InverseOperatorResult& stat)
override
51 x = solver_.solveWithGuess(b, x);
53 stat.reduction = solver_.error();
54 stat.iterations = solver_.iterations();
55 stat.converged = (solver_.info() == Eigen::Success);
56 stat.elapsed = t.elapsed();
60 IterativeSolver solver_;
61 bool reusePattern_ =
false;
62 bool initialized_ =
false;
static std::optional< T > get(std::string const &key)
Get parameter-values from parameter-tree.
Definition: Initfile.hpp:25
Definition: IterativeRunner.hpp:16
void finish()
Implements LinearSolverInterface::finish()
Definition: IterativeRunner.hpp:42
void apply(X &x, Y const &b, Dune::InverseOperatorResult &stat) override
Implements LinearSolverInterface::apply()
Definition: IterativeRunner.hpp:48
void init(M const &A)
initialize the matrix and maybe compute factorization
Definition: IterativeRunner.hpp:30
Definition: LinearSolverInterface.hpp:9
Definition: PreconConfig.hpp:13
Definition: SolverConfig.hpp:14