10 #ifdef MOOSE_MFEM_ENABLED 23 "Base class for defining linear mfem::Solver derived classes for Moose.");
29 _preconditioner{
nullptr},
30 _equation_system(getMFEMProblem().getProblemData().eqn_system)
43 "Moose::MFEM::SolverBase", getParam<MFEMSolverName>(
"preconditioner"));
49 mooseError(
"Eigensolvers cannot be used as preconditioners.");
52 if constexpr (std::is_base_of_v<mfem::HypreSolver, T> || std::is_same_v<mfem::HypreAME, T>)
53 if (
auto *
const hypre_pre = dynamic_cast<mfem::HypreSolver *>(&mfem_pre))
54 solver.SetPreconditioner(*hypre_pre);
56 mooseError(
"hypre solver preconditioners must themselves be hypre solvers");
58 solver.SetPreconditioner(mfem_pre);
MFEMProblem & getMFEMProblem()
Return the owning MFEM problem.
T & getMFEMObject(const std::string &system, const std::string &name, const THREAD_ID tid=0) const
Retrieve an MFEM object from the warehouse by system and name.
LinearSolverBase(const InputParameters ¶meters)
LinearSolverBase * GetPreconditioner()
Returns this solver's preconditioner.
static InputParameters validParams()
std::shared_ptr< LinearSolverBase > _preconditioner
Preconditioner to be used for the problem.
Base class for linear MFEM solvers and preconditioners.
static InputParameters validParams()
Base class for wrapping mfem::Solver-derived classes.
void SetPreconditioner(T &solver)
Retrieves the preconditioner userobject if present, sets the member pointer to said object if still u...
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 UpdateEquationSystemContext() override
Update the solver following any changes to the EquationSystem it is responsible for solving...
Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).
bool isParamSetByUser(const std::string &name) const
Test if the supplied parameter is set by a user, as opposed to not set or set to default.