16 #ifndef _d2k_parsed_solver_h 17 #define _d2k_parsed_solver_h 19 #include <deal2lkit/config.h> 41 template <
typename VECTOR>
44 return [](VECTOR &, bool)
47 "operator. Try avoiding PackagedOperator if you don't want " 48 "to implement this function."));
70 template<
typename VECTOR>
83 const std::string &default_solver=
"cg",
84 const unsigned int iter=1000,
85 const double reduction=1
e-8,
87 identity_operator<VECTOR>(default_reinit<VECTOR>()),
89 identity_operator<VECTOR>(default_reinit<VECTOR>()));
104 virtual void parse_parameters_call_back();
129 template<
typename MySolver >
130 void initialize_solver(MySolver *);
159 template<
typename VECTOR>
161 const std::string &default_solver,
162 const unsigned int default_iter,
163 const double default_reduction,
169 solver_name(default_solver),
170 max_iterations(default_iter),
171 reduction(default_reduction)
175 template<
typename VECTOR>
180 "minres|qmrs|richardson"),
181 "Name of the solver to use.");
190 template<
typename VECTOR>
198 template<
typename VECTOR>
199 template<
typename MySolver >
206 template<
typename VECTOR>
A parameter acceptor base class.
static ParameterHandler prm
Static parameter.
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
std::function< void(VECTOR &, bool)> default_reinit()
LinearOperator< VECTOR > op
The Operator this solver use.
virtual void parse_parameters(ParameterHandler &prm)
Parse solver type and solver options.
A solver selector which uses parameter files to choose between different options. ...
void set(const std::string &entry_name, const std::string &new_value)
void parse_parameters(ParameterHandler ¶m)
shared_ptr< T > SP(T *t)
Construct a shared pointer to a non const class T.
LinearOperator< VECTOR > prec
The preconditioner used by this solver.
ReductionControl control
ReductionControl.
static void declare_parameters(ParameterHandler ¶m)
#define Assert(cond, exc)
void initialize_solver(MySolver *)
Store a shared pointer, and intilize the inverse operator.
double reduction
Default reduction required to succesfully complete a solution step.
virtual void declare_parameters(ParameterHandler &prm)
Declare solver type and solver options.
ParsedSolver(const std::string &name="", const std::string &default_solver="cg", const unsigned int iter=1000, const double reduction=1e-8, const LinearOperator< VECTOR > &op=identity_operator< VECTOR >(default_reinit< VECTOR >()), const LinearOperator< VECTOR > &prec=identity_operator< VECTOR >(default_reinit< VECTOR >()))
Constructor.
unsigned int max_iterations
Default number of maximum iterations required to succesfully complete a solution step.
virtual void parse_parameters(ParameterHandler &prm)
Parse the parameter file.
LinearOperator< VECTOR, VECTOR, Payload > inverse_operator(const LinearOperator< VECTOR, VECTOR, Payload > &op, Solver &solver, const Preconditioner &preconditioner)
virtual void parse_parameters_call_back()
Initialize internal variables.
std::string solver_name
Solver name.
shared_ptr< Solver< VECTOR > > solver
The actual solver.
void add_parameter(ParameterHandler &prm, T *parameter, const std::string &entry, const std::string &default_value, const Patterns::PatternBase &pattern=Patterns::Anything(), const std::string &documentation=std::string())
Add a parameter the given parameter list.
static::ExceptionBase & ExcInternalError()