16#ifndef dealii_solver_selector_h
17#define dealii_solver_selector_h
90template <
typename VectorType = Vector<
double>>
119 template <
class Matrix,
class Preconditioner>
121 solve(
const Matrix & A,
123 const VectorType & b,
124 const Preconditioner &precond)
const;
131 select(
const std::string &name);
195 <<
"Solver " << arg1 <<
" does not exist. Use one of "
249template <
typename VectorType>
253 , control(&solver_control)
258template <
typename VectorType>
267template <
typename VectorType>
268template <
class Matrix,
class Preconditioner>
272 const VectorType & b,
273 const Preconditioner &precond)
const
275 if (solver_name ==
"richardson")
278 solver.
solve(A, x, b, precond);
280 else if (solver_name ==
"cg")
283 solver.
solve(A, x, b, precond);
285 else if (solver_name ==
"minres")
288 solver.
solve(A, x, b, precond);
290 else if (solver_name ==
"bicgstab")
293 solver.
solve(A, x, b, precond);
295 else if (solver_name ==
"gmres")
298 solver.
solve(A, x, b, precond);
300 else if (solver_name ==
"fgmres")
303 solver.
solve(A, x, b, precond);
306 Assert(
false, ExcSolverDoesNotExist(solver_name));
311template <
typename VectorType>
320template <
typename VectorType>
324 return "richardson|cg|bicgstab|gmres|fgmres|minres";
329template <
typename VectorType>
339template <
typename VectorType>
349template <
typename VectorType>
354 richardson_data = data;
359template <
typename VectorType>
369template <
typename VectorType>
379template <
typename VectorType>
384 bicgstab_data = data;
void solve(const MatrixType &A, VectorType &x, const VectorType &b, const PreconditionerType &preconditioner)
void solve(const MatrixType &A, VectorType &x, const VectorType &b, const PreconditionerType &preconditioner)
void solve(const MatrixType &A, VectorType &x, const VectorType &b, const PreconditionerType &preconditioner)
void solve(const MatrixType &A, VectorType &x, const VectorType &b, const PreconditionerType &preconditioner)
void solve(const MatrixType &A, VectorType &x, const VectorType &b, const PreconditionerType &preconditioner)
void solve(const MatrixType &A, VectorType &x, const VectorType &b, const PreconditionerType &preconditioner)
SolverGMRES< VectorType >::AdditionalData gmres_data
virtual ~SolverSelector() override=default
SolverBicgstab< VectorType >::AdditionalData bicgstab_data
void select(const std::string &name)
static std::string get_solver_names()
void set_control(SolverControl &ctrl)
SolverFGMRES< VectorType >::AdditionalData fgmres_data
SolverMinRes< VectorType >::AdditionalData minres_data
void solve(const Matrix &A, VectorType &x, const VectorType &b, const Preconditioner &precond) const
void set_data(const typename SolverRichardson< VectorType >::AdditionalData &data)
SmartPointer< SolverControl, SolverSelector< VectorType > > control
SolverCG< VectorType >::AdditionalData cg_data
SolverRichardson< VectorType >::AdditionalData richardson_data
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcSolverDoesNotExist(std::string arg1)
#define Assert(cond, exc)
#define DeclException1(Exception1, type1, outsequence)