10 #ifdef MOOSE_MFEM_ENABLED 22 params.
addClassDescription(
"Hypre BoomerAMG solver and preconditioner for the iterative solution " 23 "of MFEM equation systems.");
24 params.
addParam<mfem::real_t>(
"l_tol", 1e-5,
"Set the relative tolerance.");
25 params.
addParam<
int>(
"l_max_its", 10000,
"Set the maximum number of iterations.");
26 params.
addParam<
int>(
"print_level", 2,
"Set the solver verbosity.");
28 "fespace",
"H1 FESpace to use in HypreBoomerAMG setup for elasticity problems.");
30 "strength_threshold", 0.25,
"HypreBoomerAMG strong threshold. Defaults to 0.25.");
31 MooseEnum errmode(
"ignore=0 warn=1 abort=2",
"abort",
false);
32 params.
addParam<
MooseEnum>(
"error_mode", errmode,
"Set the behavior for treating hypre errors.");
37 :
Moose::MFEM::LinearSolverBase(parameters),
39 isParamSetByUser(
"fespace")
41 .getMFEMObject<
MFEMFESpace>(
"MFEMFESpace", getParam<MFEMFESpaceName>(
"fespace"))
53 auto solver = std::make_unique<mfem::HypreBoomerAMG>();
55 solver->iterative_mode = getParam<bool>(
"use_initial_guess");
56 solver->SetTol(getParam<mfem::real_t>(
"l_tol"));
57 solver->SetMaxIter(getParam<int>(
"l_max_its"));
58 solver->SetPrintLevel(getParam<int>(
"print_level"));
59 solver->SetStrengthThresh(getParam<mfem::real_t>(
"strength_threshold"));
60 solver->SetErrorMode(mfem::HypreSolver::ErrorMode(
int(getParam<MooseEnum>(
"error_mode"))));
74 auto lor_solver =
new mfem::LORSolver<mfem::HypreBoomerAMG>(a, tdofs);
75 lor_solver->GetSolver().SetTol(getParam<mfem::real_t>(
"l_tol"));
76 lor_solver->GetSolver().SetMaxIter(getParam<int>(
"l_max_its"));
77 lor_solver->GetSolver().SetPrintLevel(getParam<int>(
"print_level"));
78 lor_solver->GetSolver().SetStrengthThresh(getParam<mfem::real_t>(
"strength_threshold"));
82 lor_solver->GetSolver().SetElasticityOptions(
_mfem_fespace.get());
MFEMHypreBoomerAMG(const InputParameters &)
void SetupLOR(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.
std::unique_ptr< mfem::Solver > _solver
Solver to be used for the problem.
static InputParameters validParams()
registerMooseObject("MooseApp", MFEMHypreBoomerAMG)
bool _lor
Variable defining whether to use LOR solver.
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
void ConstructSolver() override
Override in derived classes to construct and set the solver options.
static InputParameters validParams()
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
virtual void CheckSpectralEquivalence(mfem::ParBilinearForm &blf) const
Checks for the correct configuration of quadrature bases for LOR spectral equivalence.