15#ifndef dealii_solver_selector_h
16#define dealii_solver_selector_h
90template <
typename VectorType = Vector<
double>>
120 template <
typename MatrixType,
typename PreconditionerType>
124 void solve(
const MatrixType &A,
127 const PreconditionerType &precond)
const;
134 select(
const std::string &name);
198 <<
"Solver " << arg1 <<
" does not exist. Use one of "
200 << get_solver_names());
252template <
typename VectorType>
257 , control(&solver_control)
262template <
typename VectorType>
271template <
typename VectorType>
273template <
typename MatrixType,
typename PreconditionerType>
280 const PreconditionerType &precond)
const
282 if (solver_name ==
"richardson")
285 solver.
solve(A, x, b, precond);
287 else if (solver_name ==
"cg")
290 solver.
solve(A, x, b, precond);
292 else if (solver_name ==
"minres")
295 solver.
solve(A, x, b, precond);
297 else if (solver_name ==
"bicgstab")
300 solver.
solve(A, x, b, precond);
302 else if (solver_name ==
"gmres")
305 solver.
solve(A, x, b, precond);
307 else if (solver_name ==
"fgmres")
310 solver.
solve(A, x, b, precond);
313 Assert(
false, ExcSolverDoesNotExist(solver_name));
318template <
typename VectorType>
327template <
typename VectorType>
331 return "richardson|cg|bicgstab|gmres|fgmres|minres";
336template <
typename VectorType>
339 const typename
SolverGMRES<VectorType>::AdditionalData &data)
346template <
typename VectorType>
349 const typename
SolverFGMRES<VectorType>::AdditionalData &data)
356template <
typename VectorType>
361 richardson_data = data;
366template <
typename VectorType>
369 const typename
SolverCG<VectorType>::AdditionalData &data)
376template <
typename VectorType>
379 const typename
SolverMinRes<VectorType>::AdditionalData &data)
386template <
typename VectorType>
391 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
SolverFGMRES< VectorType >::AdditionalData fgmres_data
SolverMinRes< VectorType >::AdditionalData minres_data
SmartPointer< SolverControl, SolverSelector< VectorType > > control
SolverCG< VectorType >::AdditionalData cg_data
SolverRichardson< VectorType >::AdditionalData richardson_data
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_CXX20_REQUIRES(condition)
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
#define DeclException1(Exception1, type1, outsequence)