10 #ifdef MOOSE_MFEM_ENABLED 21 params.
addClassDescription(
"Hypre solver for the iterative solution of MFEM equation systems " 22 "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>(
"kdim", 10,
"Set the k-dimension.");
28 params.
addParam<
int>(
"print_level", 2,
"Set the solver verbosity.");
29 params.
addParam<MFEMSolverName>(
"preconditioner",
"Optional choice of preconditioner to use.");
35 :
Moose::MFEM::LinearSolverBase(parameters)
44 solver->iterative_mode = getParam<bool>(
"use_initial_guess");
45 solver->SetTol(getParam<mfem::real_t>(
"l_tol"));
46 solver->SetAbsTol(getParam<mfem::real_t>(
"l_abs_tol"));
47 solver->SetMaxIter(getParam<int>(
"l_max_its"));
48 solver->SetKDim(getParam<int>(
"kdim"));
49 solver->SetPrintLevel(getParam<int>(
"print_level"));
58 mooseError(
"LOR solver cannot take a preconditioner");
60 mfem::Array<int> ess_tdofs;
61 a.ParFESpace()->GetEssentialTrueDofs(ess_bdr_markers, ess_tdofs);
70 mfem::ParLORDiscretization lor_disc(a, ess_tdofs);
72 lor_solver->GetSolver().SetTol(getParam<mfem::real_t>(
"l_tol"));
73 lor_solver->GetSolver().SetAbsTol(getParam<mfem::real_t>(
"l_abs_tol"));
74 lor_solver->GetSolver().SetMaxIter(getParam<int>(
"l_max_its"));
75 lor_solver->GetSolver().SetKDim(getParam<int>(
"kdim"));
76 lor_solver->GetSolver().SetPrintLevel(getParam<int>(
"print_level"));
static InputParameters validParams()
MFEMProblem & getMFEMProblem()
Return the owning MFEM problem.
void SetupLOR(mfem::ParBilinearForm &a, mfem::Array< int > &ess_bdr_markers) 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.
registerMooseObject("MooseApp", MFEMHypreGMRES)
static InputParameters validParams()
std::shared_ptr< LinearSolverBase > _preconditioner
Preconditioner to be used for the problem.
MFEMHypreGMRES(const InputParameters &)
bool _lor
Variable defining whether to use LOR solver.
Wrapper for mfem::HypreGMRES solver.
MPI_Comm getComm()
Return the MPI communicator associated with this FE problem's mesh.
void SetPreconditioner(T &solver)
Retrieves the preconditioner userobject if present, sets the member pointer to said object if still u...
void ConstructSolver() override
Override in derived classes to construct and set the solver options.
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...
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.