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 : #include "MFEMGeneralUserObject.h" 13 : #include "MFEMProblem.h" 14 : 15 : registerMooseObject("MooseApp", MFEMGeneralUserObject); 16 : 17 : InputParameters 18 444801 : MFEMGeneralUserObject::validParams() 19 : { 20 444801 : InputParameters params = GeneralUserObject::validParams(); 21 444801 : params.addClassDescription("Base class for custom GeneralUserObjects to add to MFEM problems."); 22 444801 : return params; 23 0 : } 24 : 25 2337 : MFEMGeneralUserObject::MFEMGeneralUserObject(const InputParameters & parameters) 26 2337 : : GeneralUserObject(parameters), _mfem_problem(static_cast<MFEMProblem &>(_fe_problem)) 27 : { 28 2337 : } 29 : 30 : mfem::Coefficient & 31 658 : MFEMGeneralUserObject::getScalarCoefficientByName(const MFEMScalarCoefficientName & name) 32 : { 33 658 : return getMFEMProblem().getCoefficients().getScalarCoefficient(name); 34 : } 35 : 36 : mfem::VectorCoefficient & 37 147 : MFEMGeneralUserObject::getVectorCoefficientByName(const MFEMVectorCoefficientName & name) 38 : { 39 147 : return getMFEMProblem().getCoefficients().getVectorCoefficient(name); 40 : } 41 : 42 : mfem::MatrixCoefficient & 43 0 : MFEMGeneralUserObject::getMatrixCoefficientByName(const MFEMMatrixCoefficientName & name) 44 : { 45 0 : return getMFEMProblem().getCoefficients().getMatrixCoefficient(name); 46 : } 47 : 48 : mfem::Coefficient & 49 658 : MFEMGeneralUserObject::getScalarCoefficient(const std::string & name) 50 : { 51 658 : return getScalarCoefficientByName(getParam<MFEMScalarCoefficientName>(name)); 52 : } 53 : 54 : mfem::VectorCoefficient & 55 147 : MFEMGeneralUserObject::getVectorCoefficient(const std::string & name) 56 : { 57 147 : return getVectorCoefficientByName(getParam<MFEMVectorCoefficientName>(name)); 58 : } 59 : 60 : mfem::MatrixCoefficient & 61 0 : MFEMGeneralUserObject::getMatrixCoefficient(const std::string & name) 62 : { 63 0 : return getMatrixCoefficientByName(getParam<MFEMMatrixCoefficientName>(name)); 64 : } 65 : 66 : #endif