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 MFEM_ENABLED 11 : 12 : #pragma once 13 : #include "ProblemOperator.h" 14 : #include "EquationSystemInterface.h" 15 : 16 : namespace Moose::MFEM 17 : { 18 : /// Steady-state problem operator with an equation system. 19 : class EquationSystemProblemOperator : public ProblemOperator, public EquationSystemInterface 20 : { 21 : public: 22 110 : EquationSystemProblemOperator(MFEMProblemData & problem) 23 110 : : ProblemOperator(problem), _equation_system(problem.eqn_system) 24 : { 25 110 : } 26 : 27 : void SetGridFunctions() override; 28 : void Init(mfem::BlockVector & X) override; 29 : virtual void Solve(mfem::Vector & X) override; 30 : 31 454 : [[nodiscard]] Moose::MFEM::EquationSystem * GetEquationSystem() const override 32 : { 33 454 : if (!_equation_system) 34 : { 35 0 : MFEM_ABORT("No equation system has been added to ProblemOperator."); 36 : } 37 : 38 454 : return _equation_system.get(); 39 : } 40 : 41 : private: 42 : std::shared_ptr<Moose::MFEM::EquationSystem> _equation_system{nullptr}; 43 : }; 44 : 45 : } // namespace Moose::MFEM 46 : 47 : #endif