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 '",
91 "' is not an eigensolver, but the problem is marked as an eigenproblem.");
virtual void resolveMFEMSolvers()
Construct recorded MFEM solvers in dependency order and select the problem driver solver(s)...
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
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
These are reworked from https://stackoverflow.com/a/11003103.
virtual void resolveMFEMSolvers() override
Construct recorded MFEM solvers in dependency order and select the problem driver solver(s)...
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
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.
Base class for eigensolvers.
static InputParameters validParams()