18 #ifndef __GENERIC_LINEAR_SOLVER_H 19 #define __GENERIC_LINEAR_SOLVER_H 23 #include <dolfin/common/Variable.h> 24 #include <dolfin/log/log.h> 30 class GenericLinearOperator;
33 class VectorSpaceBasis;
43 set_operator(std::shared_ptr<const GenericLinearOperator> A) = 0;
48 std::shared_ptr<const GenericLinearOperator> P)
51 "set operator and preconditioner for linear solver",
52 "Not supported by current linear algebra backend");
60 "solve linear system",
61 "Not supported by current linear algebra backend. Consider using solve(x, b)");
79 this->parameters.
update(parameters);
99 static std::shared_ptr<const GenericMatrix>
Common base class for DOLFIN variables.
Definition: Variable.h:35
virtual void update_parameters(const Parameters ¶meters)
Update solver parameters (useful for LinearSolver wrapper)
Definition: GenericLinearSolver.h:77
virtual std::string parameter_type() const
Return parameter type: "krylov_solver" or "lu_solver".
Definition: GenericLinearSolver.h:71
Definition: GenericLinearOperator.h:42
virtual std::size_t solve(const GenericLinearOperator &A, GenericVector &x, const GenericVector &b)
Solve linear system Ax = b.
Definition: GenericLinearSolver.h:56
Parameters parameters
Parameters.
Definition: Variable.h:74
Definition: Parameters.h:94
static const GenericMatrix & require_matrix(const GenericLinearOperator &A)
Definition: GenericLinearSolver.cpp:25
virtual void set_operators(std::shared_ptr< const GenericLinearOperator > A, std::shared_ptr< const GenericLinearOperator > P)
Set operator (matrix) and preconditioner matrix.
Definition: GenericLinearSolver.h:47
virtual void set_operator(std::shared_ptr< const GenericLinearOperator > A)=0
Set operator (matrix)
This class defines a common interface for matrices.
Definition: GenericMatrix.h:46
This class provides a general solver for linear systems Ax = b.
Definition: GenericLinearSolver.h:37
void dolfin_error(std::string location, std::string task, std::string reason,...)
Definition: log.cpp:129
void update(const Parameters ¶meters)
Update parameters with another set of parameters.
Definition: Parameters.cpp:245
This class defines a common interface for vectors.
Definition: GenericVector.h:47