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 : 14 : #include "GeneralUserObject.h" 15 : #include "libmesh/ignore_warnings.h" 16 : #include <mfem.hpp> 17 : #include "libmesh/restore_warnings.h" 18 : 19 : // Forwards declaration. 20 : class MFEMProblem; 21 : 22 : /* 23 : * This class adds a getMFEMProblem method. 24 : */ 25 : class MFEMGeneralUserObject : public GeneralUserObject 26 : { 27 : public: 28 : static InputParameters validParams(); 29 : 30 : MFEMGeneralUserObject(const InputParameters & parameters); 31 : 32 : /// Returns a reference to the MFEMProblem instance. 33 1470 : MFEMProblem & getMFEMProblem() { return _mfem_problem; } 34 274 : const MFEMProblem & getMFEMProblem() const { return _mfem_problem; } 35 : 36 : /// Returns references to coefficients stored in the MFEMProblem PropertiesManager. 37 : mfem::Coefficient & getScalarCoefficient(const std::string & name); 38 : mfem::VectorCoefficient & getVectorCoefficient(const std::string & name); 39 : mfem::MatrixCoefficient & getMatrixCoefficient(const std::string & name); 40 : 41 1514 : void execute() override {} 42 : 43 1608 : void initialize() override {} 44 : 45 1608 : void finalize() override {} 46 : 47 : private: 48 : MFEMProblem & _mfem_problem; 49 : }; 50 : 51 : #endif