10#ifdef MOOSE_MFEM_ENABLED
22 params.
addClassDescription(
"Problem type for building and solving a finite element eigenproblem "
23 "using the MFEM finite element library.");
24 params.
addParam<
int>(
"num_modes", 1,
"Set the number of lowest eigenmodes to compute.");
28 "Separator string inserted between a variable name and its eigenmode index when "
29 "registering the gridfunction that stores the corresponding eigenvector.");
38 mooseError(
"Complex numbers are not currently supported for eigenproblems.");
43 const std::string & var_name,
50 const auto num_modes = getParam<int>(
"num_modes");
55 "' clashes with an existing gridfunction (likely an eigenmode entry from another "
56 "variable). Choose a different variable name or set 'mode_separator' to a string "
57 "that avoids the clash.");
59 for (
int i = 0; i < num_modes; ++i)
61 const auto mode_name = var_name + sep + std::to_string(i);
67 "' clashes with an already-registered variable. Set 'mode_separator' to a "
68 "string that avoids the clash, or rename the conflicting variable.");
73 for (
int i = 0; i < num_modes; ++i)
83 mooseError(
"MFEMEigenproblem does not support nonlinear solver '",
88 !std::dynamic_pointer_cast<Moose::MFEM::EigensolverBase>(
getProblemData().jacobian_solver))
91 "' is not an eigensolver, but the problem is marked as an eigenproblem.");
registerMooseObject("MooseApp", MFEMEigenproblem)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
virtual void resolveMFEMSolvers() override
Construct recorded MFEM solvers in dependency order and select the problem driver solver(s).
static InputParameters validParams()
virtual void addVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶meters) override
Override of MFEMProblem::addVariable.
MFEMEigenproblem(const InputParameters ¶ms)
MFEMProblemData & getProblemData()
Method to get the current MFEMProblemData object storing the current data specifying the FE problem.
void validateVariableNumericType(const std::string &var_type, const std::string &var_name) const
Verify that a primary variable's numeric type matches the problem's equation system.
static InputParameters validParams()
Return the input parameters used to construct an MFEM problem.
void addGridFunction(const std::string &var_type, const std::string &var_name, InputParameters ¶meters)
Adds one MFEM GridFunction to be used in the MFEM solve.
NumericType _num_type
The numeric representation currently active for this problem.
virtual void resolveMFEMSolvers()
Construct recorded MFEM solvers in dependency order and select the problem driver solver(s).
const InputParameters & parameters() const
Get the parameters of the object.
std::string mode_separator