10 #ifdef MOOSE_MFEM_ENABLED 24 if (es->GetTestVarNames().size() > 1)
25 mooseError(
"Eigenproblems are only supported in single-variable systems");
29 es->PrepareEigensolver(*eigensolver);
45 mfem::Array<mfem::real_t> eigenvalues;
54 for (
int i = 0; i < eigenvalues.Size(); ++i)
55 gridfunctions.
Get(trial_var_name + sep + std::to_string(i))
void BuildEquationSystemOperator()
Add kernels/bcs and assemble the linear part of the equation system.
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...
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
EigenproblemEquationSystem * GetEquationSystem() const override
Returns a pointer to the operator's equation system.
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 const mfem::HypreParVector & GetEigenvector(int index) const =0
Retrieves the computed eigenvector corresponding to the given index.
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...
virtual void Solve() override
virtual void Solve()
For eigensolvers, this method calls the underlying Solve method.
mfem::BlockVector _true_x
virtual void BuildEquationSystem()
Build all forms comprising this EquationSystem.
void RecoverEigenproblemSolution(GridFunctions &gridfunctions, EigensolverBase *eigensolver)
virtual void GetEigenvalues(mfem::Array< mfem::real_t > &eigenvalues) const =0
Retrieves the computed eigenvalues.
std::string mode_separator
Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).
Moose::MFEM::GridFunctions gridfunctions
Base class for eigensolvers.
void BuildEigenproblemJacobian(mfem::BlockVector &trueX)
Build eigenproblem system, with essential boundary conditions accounted for.