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 & name,
49 if (!std::dynamic_pointer_cast<Moose::MFEM::EigensolverBase>(
getProblemData().jacobian_solver))
51 "' is not an eigensolver, but the problem is marked as an eigenproblem.");
56 const std::string & var_name,
61 const auto num_modes = getParam<int>(
"num_modes");
66 "' clashes with an existing gridfunction (likely an eigenmode entry from another " 67 "variable). Choose a different variable name or set 'mode_separator' to a string " 68 "that avoids the clash.");
70 for (
int i = 0; i < num_modes; ++i)
72 const auto mode_name = var_name + sep + std::to_string(i);
78 "' clashes with an already-registered variable. Set 'mode_separator' to a " 79 "string that avoids the clash, or rename the conflicting variable.");
84 for (
int i = 0; i < num_modes; ++i)
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.
MFEMProblemData & getProblemData()
Method to get the current MFEMProblemData object storing the current data specifying the FE problem...
NumericType _num_type
The numeric representation currently active for this problem.
registerMooseObject("MooseApp", MFEMEigenproblem)
static InputParameters validParams()
Return the input parameters used to construct an MFEM problem.
const InputParameters & parameters() const
Get the parameters of the object.
virtual void addVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶meters) override
Override of MFEMProblem::addVariable.
MFEMEigenproblem(const InputParameters ¶ms)
std::shared_ptr< Moose::MFEM::LinearSolverBase > jacobian_solver
const std::string & name() const
Get the name of the class.
virtual void addMFEMSolver(const std::string &user_object_name, const std::string &name, InputParameters ¶meters) override
Method called in AddMFEMSolverAction which will create the solver.
const std::string & type() const
Get the type of this class.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
std::string mode_separator
static InputParameters validParams()