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.");
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<UserObjectName>(
"preconditioner",
"Optional choice of preconditioner to use.");
43 solver->SetRelTol(getParam<mfem::real_t>(
"l_tol"));
44 solver->SetAbsTol(getParam<mfem::real_t>(
"l_abs_tol"));
45 solver->SetMaxIter(getParam<int>(
"l_max_its"));
46 solver->SetPrintLevel(getParam<int>(
"print_level"));
55 mooseError(
"LOR solver cannot take a preconditioner");
65 mooseError(
"Low-Order-Refined solver requires the FESpace closed_basis to be GaussLobatto " 66 "and the open-basis to be IntegratedGLL for ND and RT elements.");
68 auto lor_solver =
new mfem::LORSolver<mfem::GMRESSolver>(a, tdofs);
69 lor_solver->GetSolver().SetRelTol(getParam<mfem::real_t>(
"l_tol"));
70 lor_solver->GetSolver().SetAbsTol(getParam<mfem::real_t>(
"l_abs_tol"));
71 lor_solver->GetSolver().SetMaxIter(getParam<int>(
"l_max_its"));
72 lor_solver->GetSolver().SetPrintLevel(getParam<int>(
"print_level"));
virtual MFEMMesh & mesh() override
Overwritten mesh() method from base MooseMesh to retrieve the correct mesh type, in this case MFEMMes...
const InputParameters & parameters() const
Get the parameters of the object.
MFEMGMRESSolver(const InputParameters ¶meters)
MFEMSolverBase * _preconditioner
Preconditioner to be used for the problem.
registerMooseObject("MooseApp", MFEMGMRESSolver)
static InputParameters validParams()
static InputParameters validParams()
void setPreconditioner(T &solver)
Retrieves the preconditioner userobject if present, sets the member pointer to said object if still u...
void constructSolver(const InputParameters ¶meters) override
Override in derived classes to construct and set the solver options.
Wrapper for mfem::GMRESSolver.
virtual bool checkSpectralEquivalence(mfem::ParBilinearForm &blf) const
Checks for the correct configuration of quadrature bases for LOR spectral equivalence.
mfem::ParMesh & getMFEMParMesh()
Accessors for the _mfem_par_mesh object.
bool _lor
Variable defining whether to use LOR solver.
MFEMProblem & getMFEMProblem()
Returns a reference to the MFEMProblem instance.
Base class for wrapping mfem::Solver-derived classes.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
virtual void updateSolver(mfem::ParBilinearForm &a, mfem::Array< int > &tdofs)=0
Updates the solver with the given bilinear form and essential dof list, in case an LOR or algebraic s...
void updateSolver(mfem::ParBilinearForm &a, mfem::Array< int > &tdofs) override
Updates the solver with the bilinear form in case LOR solve is required.
std::unique_ptr< mfem::Solver > _solver
Solver to be used for the problem.