Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #ifdef MOOSE_MFEM_ENABLED 11 : 12 : #pragma once 13 : 14 : #include "MFEMSolverBase.h" 15 : 16 : /** 17 : * Base class for eigensolvers. 18 : */ 19 : class MFEMEigensolverBase : public MFEMSolverBase 20 : { 21 : public: 22 : static InputParameters validParams(); 23 : 24 : MFEMEigensolverBase(const InputParameters & parameters); 25 : 26 : /// Sets the operator for the eigensolver in derived classes 27 : virtual void setOperator(mfem::OperatorHandle & op) override = 0; 28 : 29 : /// Sets the mass matrix for the eigensolver in derived classes 30 : virtual void setMassMatrix(mfem::OperatorHandle & mass) = 0; 31 : 32 : /// Retrieves the computed eigenvalues 33 : virtual void getEigenvalues(mfem::Array<mfem::real_t> & eigenvalues) const = 0; 34 : 35 : /// Retrieves the computed eigenvector corresponding to the given index 36 : virtual const mfem::HypreParVector & getEigenvector(int index) const = 0; 37 : 38 : /// Updates the solver with the given bilinear form and essential dof list, in case an LOR or algebraic solver is needed. 39 0 : virtual void updateSolver(mfem::ParBilinearForm &, mfem::Array<int> &) override {} 40 : 41 : protected: 42 : /// Number of eigenmodes to compute 43 : int _num_modes; 44 : }; 45 : 46 : #endif