6#include <amdis/CreatorMap.hpp>
7#include <amdis/CreatorInterface.hpp>
8#include <amdis/linearalgebra/LinearSolverInterface.hpp>
13 template <
class Mat,
class VecX,
class VecY = VecX>
15 :
public LinearSolverInterface<Mat,VecX,VecY>
17 using M =
typename Mat::BaseMatrix;
18 using X =
typename VecX::BaseVector;
19 using Y =
typename VecX::BaseVector;
21 using Map = CreatorMap<LinearSolverInterface<M,X,Y>>;
24 LinearSolver(std::string
const& name, std::string
const& prefix)
25 : solver_(named(Map::get(name, prefix))->createWithString(prefix))
29 void init(Mat
const& A)
override
31 solver_->init(A.matrix());
41 void apply(VecX& x, VecY
const& b, Dune::InverseOperatorResult& stat)
override
43 solver_->apply(x.vector(), b.vector(), stat);
47 std::shared_ptr<LinearSolverInterface<M,X,Y>> solver_;
void apply(VecX &x, VecY const &b, Dune::InverseOperatorResult &stat) override
Implements LinearSolverInterface::apply()
Definition: LinearSolver.hpp:41
void init(Mat const &A) override
Implements LinearSolverInterface::init()
Definition: LinearSolver.hpp:29
void finish() override
Implements LinearSolverInterface::finish()
Definition: LinearSolver.hpp:35