20 #ifndef __DOLFIN_EIGEN_KRYLOV_SOLVER_H 21 #define __DOLFIN_EIGEN_KRYLOV_SOLVER_H 25 #include <dolfin/common/types.h> 26 #include "GenericLinearSolver.h" 47 std::string preconditioner=
"default");
53 void set_operator(std::shared_ptr<const GenericLinearOperator> A);
59 void set_operators(std::shared_ptr<const GenericLinearOperator> A,
60 std::shared_ptr<const GenericLinearOperator> P);
64 std::shared_ptr<const EigenMatrix> P);
84 std::string
str(
bool verbose)
const;
87 static std::map<std::string, std::string>
methods();
97 {
return "krylov_solver"; }
102 void init(
const std::string method,
const std::string pc=
"default");
105 template <
typename Solver>
116 static const std::map<std::string, std::string> _methods_descr;
117 static const std::map<std::string, std::string> _pcs_descr;
120 std::shared_ptr<const EigenMatrix> _matA;
123 std::shared_ptr<const EigenMatrix> _matP;
void set_operator(std::shared_ptr< const GenericLinearOperator > A)
Set operator (matrix)
Definition: EigenKrylovSolver.cpp:91
std::shared_ptr< const EigenMatrix > get_operator() const
Get operator (matrix)
Definition: EigenKrylovSolver.cpp:118
static std::map< std::string, std::string > methods()
Return a list of available solver methods.
Definition: EigenKrylovSolver.cpp:58
std::string str(bool verbose) const
Return informal string representation (pretty-print)
Definition: EigenKrylovSolver.cpp:291
~EigenKrylovSolver()
Destructor.
Definition: EigenKrylovSolver.cpp:85
Definition: GenericLinearOperator.h:42
Definition: EigenMatrix.h:46
static Parameters default_parameters()
Default parameter values.
Definition: EigenKrylovSolver.cpp:68
Definition: Parameters.h:94
std::size_t solve(GenericVector &x, const GenericVector &b)
Solve linear system Ax = b and return number of iterations.
Definition: EigenKrylovSolver.cpp:129
static std::map< std::string, std::string > preconditioners()
Return a list of available preconditioners.
Definition: EigenKrylovSolver.cpp:63
EigenKrylovSolver(std::string method="default", std::string preconditioner="default")
Definition: EigenKrylovSolver.cpp:75
Definition: EigenVector.h:45
This class provides a general solver for linear systems Ax = b.
Definition: GenericLinearSolver.h:37
void set_operators(std::shared_ptr< const GenericLinearOperator > A, std::shared_ptr< const GenericLinearOperator > P)
Set operator (matrix) and preconditioner matrix.
Definition: EigenKrylovSolver.cpp:101
std::string parameter_type() const
Return parameter type: "krylov_solver" or "lu_solver".
Definition: EigenKrylovSolver.h:96
This class defines a common interface for vectors.
Definition: GenericVector.h:47
Definition: EigenKrylovSolver.h:40