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 "TimeDomainProblemOperator.h" 14 : #include "EquationSystemInterface.h" 15 : 16 : namespace Moose::MFEM 17 : { 18 : 19 : /// Problem operator for time-dependent problems with an equation system. 20 : class TimeDomainEquationSystemProblemOperator : public TimeDomainProblemOperator, 21 : public EquationSystemInterface 22 : { 23 : public: 24 24 : TimeDomainEquationSystemProblemOperator(MFEMProblemData & problem) 25 24 : : TimeDomainProblemOperator(problem), 26 24 : _equation_system( 27 24 : std::dynamic_pointer_cast<Moose::MFEM::TimeDependentEquationSystem>(problem.eqn_system)) 28 : { 29 24 : } 30 : 31 : void SetGridFunctions() override; 32 : void Init(mfem::BlockVector & X) override; 33 : 34 : void ImplicitSolve(const double dt, const mfem::Vector & X, mfem::Vector & dX_dt) override; 35 : 36 368 : [[nodiscard]] Moose::MFEM::TimeDependentEquationSystem * GetEquationSystem() const override 37 : { 38 368 : if (!_equation_system) 39 : { 40 0 : MFEM_ABORT("No equation system has been added."); 41 : } 42 : 43 368 : return _equation_system.get(); 44 : } 45 : 46 : protected: 47 : void BuildEquationSystemOperator(double dt); 48 : 49 : private: 50 : std::vector<mfem::ParGridFunction *> _trial_variable_time_derivatives; 51 : std::shared_ptr<Moose::MFEM::TimeDependentEquationSystem> _equation_system{nullptr}; 52 : }; 53 : 54 : } // namespace Moose::MFEM 55 : 56 : #endif