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 : #include "FunctionAux.h" 11 : #include "Function.h" 12 : 13 : registerMooseObject("MooseApp", FunctionAux); 14 : 15 : InputParameters 16 33017 : FunctionAux::validParams() 17 : { 18 33017 : InputParameters params = AuxKernel::validParams(); 19 33017 : params.addClassDescription("Auxiliary Kernel that creates and updates a field variable by " 20 : "sampling a function through space and time."); 21 33017 : params.addRequiredParam<FunctionName>("function", "The function to use as the value"); 22 33017 : return params; 23 0 : } 24 : 25 2316 : FunctionAux::FunctionAux(const InputParameters & parameters) 26 2316 : : AuxKernel(parameters), _func(getFunction("function")) 27 : { 28 2316 : } 29 : 30 : Real 31 10628960 : FunctionAux::computeValue() 32 : { 33 10628960 : if (isNodal()) 34 5168589 : return _func.value(_t, *_current_node); 35 : else 36 5460371 : return _func.value(_t, _q_point[_qp]); 37 : }