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 "MooseParsedFunction.h" 15 : #include "FunctionParserUtils.h" 16 : #include "MFEMProblem.h" 17 : 18 : /** 19 : * Scalar, parsed function of position, time, and any number of scalar problem coefficients, 20 : * including any scalar variables, postprocessors, material properties or functions 21 : */ 22 : class MFEMParsedFunction : public MooseParsedFunction, public FunctionParserUtils<false> 23 : { 24 : public: 25 : static InputParameters validParams(); 26 : 27 : MFEMParsedFunction(const InputParameters & parameters); 28 16 : virtual ~MFEMParsedFunction() = default; 29 : 30 : void initialSetup() override; 31 : 32 : protected: 33 : /// reference to the MFEMProblem instance 34 : MFEMProblem & _mfem_problem; 35 : /// function parser object 36 : SymFunctionPtr _sym_function; 37 : /// coordinate and time variable names 38 : const std::vector<std::string> _xyzt; 39 : /// vector of references to the scalar coefficients used in the function 40 : std::vector<std::reference_wrapper<mfem::Coefficient>> _coefficients; 41 : }; 42 : 43 : #endif