10#ifdef MOOSE_MFEM_ENABLED
20 const std::string & weak_form_name)
23 if (!std::dynamic_pointer_cast<EigenproblemEquationSystem>(
25 mooseError(
"The weak form supplying this operator does not provide an "
26 "EigenproblemEquationSystem, which is required by "
27 "EigenproblemESProblemOperator.");
34 TIME_SECTION(
"EigenproblemESProblemOperator::FormSystem", 2,
"Assembling MFEM Eigenproblem");
39 if (es->GetTestVarNames().size() > 1)
40 mooseError(
"Eigenproblems are only supported in single-variable systems");
46 TIME_SECTION(
"EigenproblemESProblemOperator::SolveSystem", 2,
"Solving MFEM Eigenproblem");
47 es->PrepareEigensolver(*eigensolver);
65 mfem::Array<mfem::real_t> eigenvalues;
74 for (
int i = 0; i < eigenvalues.Size(); ++i)
75 gridfunctions.
Get(trial_var_name + sep + std::to_string(i))
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
std::shared_ptr< Moose::MFEM::EquationSystem > getEquationSystem(const std::string &weak_form_name="") const
Return the EquationSystem built by the weak form named weak_form_name.
EigenproblemESProblemOperator(MFEMProblem &problem, const std::string &weak_form_name="")
virtual void Solve() override
EigenproblemEquationSystem * GetEquationSystem() const override
Returns a pointer to the operator's equation system.
void FormEquationSystemOperator()
Form the equation-system operator used by the eigensolver.
void RecoverEigenproblemSolution(GridFunctions &gridfunctions, EigensolverBase *eigensolver)
void BuildEigenproblemJacobian(mfem::BlockVector &trueX, EigenRHSCoefficient rhs_coefficient)
Build eigenproblem system, with essential boundary conditions accounted for.
Base class for eigensolvers.
virtual void GetEigenvalues(mfem::Array< mfem::real_t > &eigenvalues) const =0
Retrieves the computed eigenvalues.
virtual const mfem::HypreParVector & GetEigenvector(int index) const =0
Retrieves the computed eigenvector corresponding to the given index.
Steady-state ProblemOperator that prepares and solves a single EquationSystem.
virtual void BuildEquationSystem()
Build all forms comprising this EquationSystem.
T * Get(const std::string &field_name) const
Returns a non-owning pointer to the field. This is guaranteed to return a non-null pointer.
MFEMProblem & _problem
Reference to the current problem.
MFEMProblemData & _problem_data
std::vector< std::string > _trial_var_names
Vector of names of state gridfunctions used in formulation, ordered by appearance in block vector dur...
mfem::BlockVector _true_x
Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).
std::shared_ptr< Moose::MFEM::LinearSolverBase > jacobian_solver
std::string mode_separator
Moose::MFEM::GridFunctions gridfunctions