10#ifdef MOOSE_MFEM_ENABLED
21 params.
addClassDescription(
"MFEM native solver for the iterative solution of MFEM equation "
22 "systems using the generalized minimal residual method.");
23 params.
set<
bool>(
"use_initial_guess",
true) =
true;
24 params.
addParam<mfem::real_t>(
"l_tol", 1e-5,
"Set the relative tolerance.");
25 params.
addParam<mfem::real_t>(
"l_abs_tol", 1e-50,
"Set the absolute tolerance.");
26 params.
addParam<
int>(
"l_max_its", 10000,
"Set the maximum number of iterations.");
27 params.
addParam<
int>(
"print_level", 2,
"Set the solver verbosity.");
28 params.
addParam<MFEMSolverName>(
"preconditioner",
"Optional choice of preconditioner to use.");
34 :
Moose::MFEM::LORLinearSolverBase<
mfem::GMRESSolver>(parameters)
42 auto solver = std::make_unique<mfem::GMRESSolver>(
getMFEMProblem().getComm());
51 solver.iterative_mode = getParam<bool>(
"use_initial_guess");
52 solver.SetRelTol(getParam<mfem::real_t>(
"l_tol"));
53 solver.SetAbsTol(getParam<mfem::real_t>(
"l_abs_tol"));
54 solver.SetMaxIter(getParam<int>(
"l_max_its"));
55 solver.SetPrintLevel(getParam<int>(
"print_level"));
registerMooseObject("MooseApp", MFEMGMRESSolver)
Wrapper for mfem::GMRESSolver.
MFEMGMRESSolver(const InputParameters ¶meters)
void ConstructSolver() override
Override in derived classes to construct and set the solver options.
static InputParameters validParams()
virtual void SetSolverParameters(mfem::GMRESSolver &solver) override
Update the wrapped MFEM solver parameters.
MFEMProblem & getMFEMProblem()
Return the owning MFEM problem.
static InputParameters validParams()
void SetPreconditioner(T &solver)
Retrieves the preconditioner userobject if present, sets the member pointer to said object if still u...
std::unique_ptr< mfem::Solver > _solver
Solver to be used for the problem.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...