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 "EquationSystem.h" 15 : 16 : namespace Moose::MFEM 17 : { 18 : class EigensolverBase; 19 : 20 : /// Equation system specialization for eigenproblems. 21 : class EigenproblemEquationSystem : public EquationSystem 22 : { 23 : public: 24 26 : EigenproblemEquationSystem() = default; 25 26 : ~EigenproblemEquationSystem() override = default; 26 : 27 : /// Build eigenproblem system, with essential boundary conditions accounted for 28 : void BuildEigenproblemJacobian(mfem::BlockVector & trueX); 29 : 30 : /// Prepare the provided eigensolver 31 : void PrepareEigensolver(EigensolverBase & solver); 32 : 33 : protected: 34 : /// Mark external boundaries as essential for eigenproblem BC elimination 35 : virtual void ApplyEssentialBCs() override; 36 : 37 : /// Form HypreParMatrix matrix operator for the eigensolver with Dirichlet BC elimination. 38 : void FormEigenproblemMatrix(); 39 : 40 : /// Form mass matrix for the eigensolver with Dirichlet BC elimination. 41 : void FormMassMatrix(); 42 : 43 : private: 44 : friend class EigenproblemESProblemOperator; 45 : 46 : mfem::Array<int> _global_ess_markers; 47 : /// The mass operator (e.g. the RHS operator for a generalized eigenproblem) 48 : mfem::OperatorHandle _mass_rhs; 49 : }; 50 : 51 : } // namespace Moose::MFEM 52 : 53 : #endif