10#ifdef MOOSE_MFEM_ENABLED
23 "Base class for defining linear mfem::Solver derived classes for Moose.");
27 "Name of the weak form in the WeakForms block whose equation system provides context for "
28 "this solver. May be omitted only if the problem has a single weak form, whose equation "
29 "system is then used.");
34 :
SolverBase(parameters), _preconditioner{nullptr}
36 const auto & weak_form_name = getParam<MFEMWeakFormName>(
"weak_form");
37 if (!weak_form_name.empty() && !
getMFEMProblem().getProblemData().eqn_systems.Has(weak_form_name))
39 "No weak form named '",
41 "' has been added to the problem. Weak forms are added in the 'WeakForms' block.");
53 "Moose::MFEM::SolverBase", getParam<MFEMSolverName>(
"preconditioner"));
55 paramError(
"preconditioner",
"Eigensolvers cannot be used as preconditioners.");
57 _preconditioner = std::static_pointer_cast<LinearSolverBase>(pre.getSharedPtr());
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.
std::shared_ptr< Moose::MFEM::EquationSystem > getEquationSystem(const std::string &weak_form_name="") const
Return the EquationSystem built by the weak form named weak_form_name.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
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.
Base class for eigensolvers.
Base class for linear MFEM solvers and preconditioners.
std::shared_ptr< EquationSystem > _equation_system
Pointer to EquationSystem used for problem-specific solver setup.
virtual void SetPreconditionerImpl()
Override in solvers that accept a preconditioner.
std::shared_ptr< LinearSolverBase > _preconditioner
Preconditioner to be used for the problem.
static InputParameters validParams()
void SetPreconditioner(const mfem::Operator &op)
Retrieves the preconditioner, sets the operator on it, and sets it on the wrapped solver.
LinearSolverBase(const InputParameters ¶meters)
virtual void SetOperator(const mfem::Operator &op) override
Updates the solver and any associated weak form context at the operator level.
Base class for wrapping mfem::Solver-derived classes.
virtual void UpdateEquationSystemContext()
Update the solver following any changes to the weak form it is responsible for solving.
static InputParameters validParams()
virtual void SetOperatorImpl(const mfem::Operator &op)
Updates the solver at the operator level.
Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).