6#include <amdis/CreatorInterface.hpp>
7#include <amdis/Initfile.hpp>
8#include <amdis/linearalgebra/LinearSolverInterface.hpp>
9#include <amdis/linearalgebra/eigen/SolverConfig.hpp>
18 template <
class M,
class X,
class Y,
template <
class>
class Solver>
23 using EigenSolver = Solver<M>;
28 std::unique_ptr<LinearSolverInterface<M,X,Y>>
31 return std::make_unique<Self>(prefix);
45 void init(M
const& A)
override
47 if (!reusePattern_ || !initialized_) {
48 solver_.analyzePattern(A);
53 test_exit(solver_.info() == Eigen::Success,
"Error in solver.compute(matrix)");
63 void apply(X& x, Y
const& b, Dune::InverseOperatorResult& stat)
override
68 stat.converged = (solver_.info() == Eigen::Success);
69 stat.elapsed = t.elapsed();
74 bool reusePattern_ =
false;
75 bool initialized_ =
false;
Interface for creators with name.
Definition: CreatorInterface.hpp:44
for the (external) direct solvers
Definition: DirectRunner.hpp:21
void init(M const &A) override
initialize the matrix and maybe compute factorization
Definition: DirectRunner.hpp:45
DirectRunner(std::string const &prefix)
Constructor.
Definition: DirectRunner.hpp:37
void apply(X &x, Y const &b, Dune::InverseOperatorResult &stat) override
Implements LinearSolverInterface::apply()
Definition: DirectRunner.hpp:63
void finish() override
Implements LinearSolverInterface::finish()
Definition: DirectRunner.hpp:57
static std::optional< T > get(std::string const &key)
Get parameter-values from parameter-tree.
Definition: Initfile.hpp:25
Definition: LinearSolverInterface.hpp:9
Definition: DirectRunner.hpp:27
std::unique_ptr< LinearSolverInterface< M, X, Y > > createWithString(std::string prefix) final
Must be implemented by sub classes of CreatorInterfaceName. Creates a new instance of the sub class o...
Definition: DirectRunner.hpp:29
Definition: SolverConfig.hpp:14