10#ifdef MOOSE_MFEM_ENABLED
20 mfem::Coefficient & beta_coef,
23 : _alpha_coef(alpha_coef),
24 _beta_coef(beta_coef),
25 _inner_pi_its(inner_pi_its),
26 _inner_g_its(inner_g_its)
37 auto matrix_free_ams = std::make_unique<mfem::MatrixFreeAMS>(*
_aform,
38 const_cast<mfem::Operator &
>(op),
54 params.
addClassDescription(
"MFEM matrix-free auxiliary-space Maxwell preconditioner for the "
55 "iterative solution of MFEM equation systems.");
56 params.
addParam<MFEMScalarCoefficientName>(
59 "Name of scalar coefficient used in curl-curl component of target equation system.");
60 params.
addParam<MFEMScalarCoefficientName>(
63 "Name of scalar coefficient used in mass component of target equation system.");
65 "inner_pi_iterations", 2,
"Number of CG iterations on auxiliary Pi space.");
67 "inner_g_iterations", 2,
"Number of CG iterations on auxiliary G space.");
75 :
Moose::MFEM::LORLinearSolverBase<
mfem::MatrixFreeAMS>(parameters),
76 _alpha_coef(getScalarCoefficient(
"alpha_coefficient")),
77 _beta_coef(getScalarCoefficient(
"beta_coefficient")),
78 _inner_pi_its(getParam<unsigned
int>(
"inner_pi_iterations")),
79 _inner_g_its(getParam<unsigned
int>(
"inner_g_iterations"))
87 auto solver = std::make_unique<Moose::MFEM::MatrixFreeAMS>(
96 LinearSolverBase::UpdateEquationSystemContext();
97 SetupLOR(_equation_system);
100 auto & matrix_free_ams = cast_ref<Moose::MFEM::MatrixFreeAMS &>(*_solver);
101 matrix_free_ams.SetBilinearForm(*_a);
102 matrix_free_ams.SetBoundaryMarkers(_ess_bdr_markers);
registerMooseObject("MooseApp", MFEMMatrixFreeAMS)
void ErrorVector unsigned int
Wrapper for mfem::MatrixFreeAMS solver.
mfem::Coefficient & _beta_coef
MFEMMatrixFreeAMS(const InputParameters &)
void ConstructSolver() override
Override in derived classes to construct and set the solver options.
static InputParameters validParams()
mfem::Coefficient & _alpha_coef
virtual void UpdateEquationSystemContext() override
Update the solver following any changes to the EquationSystem it is responsible for solving.
static InputParameters validParams()
std::unique_ptr< mfem::MatrixFreeAMS > _matrix_free_ams
mfem::Coefficient & _beta_coef
MatrixFreeAMS(mfem::Coefficient &alpha_coef, mfem::Coefficient &beta_coef, int inner_pi_its=0, int inner_g_its=1)
void SetOperator(const mfem::Operator &op) override
mfem::Array< int > _ess_bdr_markers
mfem::Coefficient & _alpha_coef
mfem::ParBilinearForm * _aform
std::unique_ptr< mfem::Solver > _solver
Solver to be used for the problem.
Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...