16#ifndef dealii_solver_selector_h
17#define dealii_solver_selector_h
88template <
typename VectorType = Vector<
double>>
117 template <
class Matrix,
class Preconditioner>
119 solve(
const Matrix & A,
121 const VectorType & b,
122 const Preconditioner &precond)
const;
129 select(
const std::string &name);
193 <<
"Solver " << arg1 <<
" does not exist. Use one of "
247template <
typename VectorType>
251 , control(&solver_control)
256template <
typename VectorType>
265template <
typename VectorType>
266template <
class Matrix,
class Preconditioner>
270 const VectorType & b,
271 const Preconditioner &precond)
const
273 if (solver_name ==
"richardson")
276 solver.
solve(A, x, b, precond);
278 else if (solver_name ==
"cg")
281 solver.
solve(A, x, b, precond);
283 else if (solver_name ==
"minres")
286 solver.
solve(A, x, b, precond);
288 else if (solver_name ==
"bicgstab")
291 solver.
solve(A, x, b, precond);
293 else if (solver_name ==
"gmres")
296 solver.
solve(A, x, b, precond);
298 else if (solver_name ==
"fgmres")
301 solver.
solve(A, x, b, precond);
304 Assert(
false, ExcSolverDoesNotExist(solver_name));
309template <
typename VectorType>
318template <
typename VectorType>
322 return "richardson|cg|bicgstab|gmres|fgmres|minres";
327template <
typename VectorType>
337template <
typename VectorType>
347template <
typename VectorType>
352 richardson_data = data;
357template <
typename VectorType>
367template <
typename VectorType>
377template <
typename VectorType>
382 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)