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 "TimeDependentProblemOperator.h" 15 : #include "EquationSystemInterface.h" 16 : #include "TimeDependentEquationSystem.h" 17 : 18 : namespace Moose::MFEM 19 : { 20 : 21 : /// Problem operator for time-dependent problems with an equation system. 22 : class TimeDependentEquationSystemProblemOperator : public TimeDependentProblemOperator, 23 : public EquationSystemInterface 24 : { 25 : public: 26 274 : TimeDependentEquationSystemProblemOperator(MFEMProblem & problem) 27 274 : : TimeDependentProblemOperator(problem), 28 274 : _equation_system( 29 274 : std::dynamic_pointer_cast<TimeDependentEquationSystem>(_problem_data.eqn_system)) 30 : { 31 274 : } 32 : 33 : virtual void SetGridFunctions() override; 34 : virtual void Init(mfem::BlockVector & X) override; 35 : virtual void ImplicitSolve(const mfem::real_t, const mfem::Vector &, mfem::Vector &) override; 36 : virtual void Solve() override; 37 : 38 : [[nodiscard]] virtual Moose::MFEM::TimeDependentEquationSystem * 39 7908 : GetEquationSystem() const override 40 : { 41 : mooseAssert(_equation_system, 42 : "No TimeDependentEquationSystem in TimeDependentEquationSystemProblemOperator."); 43 7908 : return _equation_system.get(); 44 : } 45 : 46 : protected: 47 : /// Add kernels/bcs and assemble the linear part of the equation system 48 : void BuildEquationSystemOperator(mfem::real_t dt); 49 : 50 : private: 51 : std::shared_ptr<Moose::MFEM::TimeDependentEquationSystem> _equation_system{nullptr}; 52 : }; 53 : 54 : } // namespace Moose::MFEM 55 : 56 : #endif