10 #ifdef MOOSE_MFEM_ENABLED 16 #include "libmesh/ignore_warnings.h" 17 #include "mfem/fem/multigrid.hpp" 18 #include "libmesh/restore_warnings.h" 89 void setMG(mfem::GeometricMultigrid & mg);
92 void SetOperator(
const mfem::Operator & op)
override;
95 void Mult(
const mfem::Vector & x, mfem::Vector & y)
const override;
102 mfem::GeometricMultigrid *
_mg =
nullptr;
109 std::shared_ptr<mfem::ParFiniteElementSpaceHierarchy>
_hierarchy;
127 std::vector<std::unique_ptr<mfem::OperatorHandle>>
_level_ops;
130 std::unique_ptr<mfem::GeometricMultigrid>
_mg;
void ConstructSolver() override
Creates a stable proxy solver; the real multigrid is built when the proxy gets an operator...
std::shared_ptr< mfem::ParFiniteElementSpaceHierarchy > _hierarchy
Finite element space hierarchy defining the multigrid levels.
MFEMGeometricMultigridSolver(const InputParameters ¶meters)
void BuildMultigrid(const mfem::Operator &op)
Rebuild the multigrid object and per-level operators for the supplied finest-level operator...
const std::string _var_name
Trial variable whose operator is preconditioned by this solver.
const InputParameters & parameters() const
Get the parameters of the object.
mfem::GeometricMultigrid * _mg
Non-owning pointer to the currently active concrete MFEM multigrid object.
MGProxy(MFEMGeometricMultigridSolver &owner)
Constructs a proxy that delegates multigrid rebuilding to the owning MOOSE solver.
std::vector< mfem::AssemblyLevel > _assembly_levels
Assembly level requested for each multigrid level after optional single-value expansion.
const MFEMSolverName _coarse_solver_name
Name of the solver used on the coarsest multigrid level.
Base class for linear MFEM solvers and preconditioners.
void SetOperator(mfem::Operator &op) override
Rebuilds the multigrid hierarchy for the supplied finest-level operator.
void Mult(const mfem::Vector &x, mfem::Vector &y) const override
Applies the current concrete MFEM multigrid preconditioner.
static InputParameters validParams()
std::vector< std::shared_ptr< mfem::ParBilinearForm > > _level_blfs
Rediscretized bilinear forms kept alive for the active linear coarse-level operators.
const std::vector< MFEMSolverName > _smoother_names
Names of solvers used as smoothers on interior multigrid levels.
Stable preconditioner object seen by outer MFEM solvers.
std::unique_ptr< mfem::GeometricMultigrid > _mg
Concrete MFEM multigrid preconditioner rebuilt on each SetOperator() call.
mfem::AssemblyLevel ParseAssemblyLevel(const std::string &s) const
Map assembly-level string ("legacy", "full", "element", "partial", "none") to the corresponding mfem:...
MGProxy * _mg_proxy
Non-owning pointer to the proxy solver stored in _solver.
P-multigrid / geometric multigrid preconditioner backed by mfem::GeometricMultigrid.
MFEMGeometricMultigridSolver & _owner
Solver object that owns the concrete multigrid and level data.
void setMG(mfem::GeometricMultigrid &mg)
Updates the concrete MFEM multigrid object used by Mult().
std::vector< std::unique_ptr< mfem::OperatorHandle > > _level_ops
Constrained linear coarse-level operators; destroyed before the forms that own their data...
void SetOperator(const mfem::Operator &op) override
Rebuilds the owner's multigrid hierarchy for the new outer-solver operator.