10#ifdef MOOSE_MFEM_ENABLED
19 params.
addClassDescription(
"Base class for MFEM weak forms, which build the EquationSystem "
20 "solved by an MFEM problem operator.");
23 params.
addParam<std::vector<MFEMBoundaryConditionName>>(
24 "bcs", {},
"List of boundary conditions to add to the weak form");
25 params.
addParam<std::vector<MFEMKernelName>>(
26 "kernels", {},
"List of kernels to add to the weak form");
32 _bc_names(getParam<
std::vector<MFEMBoundaryConditionName>>(
"bcs")),
33 _kernel_names(getParam<
std::vector<MFEMKernelName>>(
"kernels"))
37std::shared_ptr<Moose::MFEM::EquationSystem>
50 for (
const auto & [bc_name, bc] : problem_data.bcs)
55 if (!problem_data.bcs.Has(bc_name))
57 "bcs",
"No boundary condition named '", bc_name,
"' has been added to the problem.");
62 for (
const auto & [kernel_name, kernel] : problem_data.kernels)
67 if (!problem_data.kernels.Has(kernel_name))
68 paramError(
"kernels",
"No kernel named '", kernel_name,
"' has been added to the problem.");
69 addKernel(kernel_name, problem_data.kernels.GetShared(kernel_name));
72 if (problem_data.nonlinear_solver)
73 _equation_system->SetGradientRequired(problem_data.nonlinear_solver->RequiresGradient());
79 problem_data.cmplx_gridfunctions,
Thin base for MFEM objects backed directly by MooseObject instead of UserObject.
static InputParameters validParams()
Declare the common parameters required by MFEM MooseObject-backed classes.
MFEMProblem & getMFEMProblem()
Return the owning MFEM problem.
MFEMProblemData & getProblemData()
Method to get the current MFEMProblemData object storing the current data specifying the FE problem.
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 ...