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 "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 2595 : MFEMProblem & getMFEMProblem() { return _mfem_problem; } 34 442 : const MFEMProblem & getMFEMProblem() const { return _mfem_problem; } 35 : 36 : /// Returns references to coefficients stored in the MFEMProblem PropertiesManager. 37 : mfem::Coefficient & getScalarCoefficientByName(const MFEMScalarCoefficientName & name); 38 : mfem::VectorCoefficient & getVectorCoefficientByName(const MFEMVectorCoefficientName & name); 39 : mfem::MatrixCoefficient & getMatrixCoefficientByName(const MFEMMatrixCoefficientName & name); 40 : mfem::Coefficient & getScalarCoefficient(const std::string & name); 41 : mfem::VectorCoefficient & getVectorCoefficient(const std::string & name); 42 : mfem::MatrixCoefficient & getMatrixCoefficient(const std::string & name); 43 : 44 2899 : void execute() override {} 45 : 46 3073 : void initialize() override {} 47 : 48 3073 : void finalize() override {} 49 : 50 : private: 51 : MFEMProblem & _mfem_problem; 52 : }; 53 : 54 : #endif