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 33368 : FunctionAux::validParams() 17 : { 18 33368 : InputParameters params = AuxKernel::validParams(); 19 33368 : params.addClassDescription("Auxiliary Kernel that creates and updates a field variable by " 20 : "sampling a function through space and time."); 21 33368 : params.addRequiredParam<FunctionName>("function", "The function to use as the value"); 22 33368 : return params; 23 0 : } 24 : 25 2492 : FunctionAux::FunctionAux(const InputParameters & parameters) 26 2492 : : AuxKernel(parameters), _func(getFunction("function")) 27 : { 28 2492 : } 29 : 30 : Real 31 11901642 : FunctionAux::computeValue() 32 : { 33 11901642 : if (isNodal()) 34 5834099 : return _func.value(_t, *_current_node); 35 : else 36 6067543 : return _func.value(_t, _q_point[_qp]); 37 : }