24#ifndef DUMUX_LINEAR_SOLVER_HH
25#define DUMUX_LINEAR_SOLVER_HH
27#include <dune/common/exceptions.hh>
55 verbosity_ = getParamFromGroup<int>(
paramGroup,
"LinearSolver.Verbosity");
56 maxIter_ = getParamFromGroup<int>(
paramGroup,
"LinearSolver.MaxIterations");
57 residReduction_ = getParamFromGroup<double>(
paramGroup,
"LinearSolver.ResidualReduction");
58 relaxation_ = getParamFromGroup<double>(
paramGroup,
"LinearSolver.PreconditionerRelaxation");
59 precondIter_ = getParamFromGroup<int>(
paramGroup,
"LinearSolver.PreconditionerIterations");
66 template<
class Matrix,
class Vector>
67 bool solve(
const Matrix& A, Vector& x,
const Vector& b)
69 DUNE_THROW(Dune::NotImplemented,
"Linear solver doesn't implement a solve method!");
74 {
return "unknown solver"; }
78 {
return paramGroup_; }
82 {
return verbosity_; }
98 {
return residReduction_; }
102 { residReduction_ = r; }
106 {
return relaxation_; }
114 {
return precondIter_; }
118 { precondIter_ = i; }
123 double residReduction_;
126 const std::string paramGroup_;
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
Base class for linear solvers.
Definition: dumux/linear/solver.hh:37
bool solve(const Matrix &A, Vector &x, const Vector &b)
Solve the linear system Ax = b.
Definition: dumux/linear/solver.hh:67
void setResidualReduction(double r)
set the linear solver residual reduction
Definition: dumux/linear/solver.hh:101
void setMaxIter(int i)
set the maximum number of linear solver iterations
Definition: dumux/linear/solver.hh:93
int precondIter() const
the number of preconditioner iterations
Definition: dumux/linear/solver.hh:113
double residReduction() const
the linear solver residual reduction
Definition: dumux/linear/solver.hh:97
int maxIter() const
the maximum number of linear solver iterations
Definition: dumux/linear/solver.hh:89
void setPrecondIter(int i)
set the number of preconditioner iterations
Definition: dumux/linear/solver.hh:117
void setVerbosity(int v)
set the verbosity level
Definition: dumux/linear/solver.hh:85
const std::string & paramGroup() const
the parameter group for getting parameter from the parameter tree
Definition: dumux/linear/solver.hh:77
void setRelaxation(double r)
set the linear solver relaxation factor
Definition: dumux/linear/solver.hh:109
LinearSolver(const std::string ¶mGroup="")
Contruct the solver.
Definition: dumux/linear/solver.hh:52
int verbosity() const
the verbosity level
Definition: dumux/linear/solver.hh:81
std::string name() const
the name of the linear solver
Definition: dumux/linear/solver.hh:73
double Scalar
Definition: dumux/linear/solver.hh:41
double relaxation() const
the linear solver relaxation factor
Definition: dumux/linear/solver.hh:105