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>
17 using M =
typename Mat::BaseMatrix;
18 using X =
typename VecX::BaseVector;
19 using Y =
typename VecX::BaseVector;
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_;
static CreatorInterface< BaseClass > * get(std::string key, std::string initFileStr)
Creates a object of the type corresponding to key.
Definition: CreatorMap.hpp:44
void init(Mat const &A) override
Implements LinearSolverInterface::init()
Definition: LinearSolver.hpp:29
void apply(VecX &x, VecY const &b, Dune::InverseOperatorResult &stat) override
Implements LinearSolverInterface::apply()
Definition: LinearSolver.hpp:41
A CreatorMap is used to construct objects, which types depends on key words determined at run time...
Definition: CreatorMap.hpp:29
Definition: AdaptBase.hpp:6
Definition: LinearSolverInterface.hpp:8
Implementation of LinearSolverInterface for EIGEN solvers.
Definition: LinearSolver.hpp:14
void finish() override
Implements LinearSolverInterface::finish()
Definition: LinearSolver.hpp:35