10 #ifdef MOOSE_MFEM_ENABLED 21 params.
addClassDescription(
"Hypre BoomerAMG solver and preconditioner for the iterative solution " 22 "of MFEM equation systems.");
23 params.
addParam<mfem::real_t>(
"l_tol", 1e-5,
"Set the relative tolerance.");
24 params.
addParam<
int>(
"l_max_its", 10000,
"Set the maximum number of iterations.");
25 params.
addParam<
int>(
"print_level", 2,
"Set the solver verbosity.");
27 "fespace",
"H1 FESpace to use in HypreBoomerAMG setup for elasticity problems.");
29 "strength_threshold", 0.25,
"HypreBoomerAMG strong threshold. Defaults to 0.25.");
30 MooseEnum errmode(
"ignore=0 warn=1 abort=2",
"abort",
false);
31 params.
addParam<
MooseEnum>(
"error_mode", errmode,
"Set the behavior for treating hypre errors.");
37 _mfem_fespace(isParamSetByUser(
"fespace") ? getUserObject<
MFEMFESpace>(
"fespace").getFESpace()
46 auto solver = std::make_unique<mfem::HypreBoomerAMG>();
48 solver->SetTol(getParam<mfem::real_t>(
"l_tol"));
49 solver->SetMaxIter(getParam<int>(
"l_max_its"));
50 solver->SetPrintLevel(getParam<int>(
"print_level"));
51 solver->SetStrengthThresh(getParam<mfem::real_t>(
"strength_threshold"));
52 solver->SetErrorMode(mfem::HypreSolver::ErrorMode(
int(getParam<MooseEnum>(
"error_mode"))));
66 auto lor_solver =
new mfem::LORSolver<mfem::HypreBoomerAMG>(a, tdofs);
67 lor_solver->GetSolver().SetTol(getParam<mfem::real_t>(
"l_tol"));
68 lor_solver->GetSolver().SetMaxIter(getParam<int>(
"l_max_its"));
69 lor_solver->GetSolver().SetPrintLevel(getParam<int>(
"print_level"));
70 lor_solver->GetSolver().SetStrengthThresh(getParam<mfem::real_t>(
"strength_threshold"));
73 lor_solver->GetSolver().SetElasticityOptions(
_mfem_fespace.get());
MFEMHypreBoomerAMG(const InputParameters &)
void updateSolver(mfem::ParBilinearForm &a, mfem::Array< int > &tdofs) override
Updates the solver with the bilinear form in case LOR solve is required.
Wrapper for mfem::HypreBoomerAMG solver.
const InputParameters & parameters() const
Get the parameters of the object.
virtual void checkSpectralEquivalence(mfem::ParBilinearForm &blf) const
Checks for the correct configuration of quadrature bases for LOR spectral equivalence.
static InputParameters validParams()
registerMooseObject("MooseApp", MFEMHypreBoomerAMG)
void constructSolver(const InputParameters ¶meters) override
Override in derived classes to construct and set the solver options.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Constructs and stores an mfem::ParFiniteElementSpace object.
std::shared_ptr< mfem::ParFiniteElementSpace > _mfem_fespace
bool _lor
Variable defining whether to use LOR solver.
Base class for wrapping mfem::Solver-derived classes.
static InputParameters validParams()
std::unique_ptr< mfem::Solver > _solver
Solver to be used for the problem.