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 "UserForcingFunctionNodalKernel.h" 11 : 12 : #include "Function.h" 13 : 14 : registerMooseObjectDeprecated("MooseApp", UserForcingFunctionNodalKernel, "01/01/2026 00:00"); 15 : 16 : InputParameters 17 14265 : UserForcingFunctionNodalKernel::validParams() 18 : { 19 14265 : InputParameters params = NodalKernel::validParams(); 20 14265 : params.addClassDescription( 21 : "Residual contribution to an ODE from a source function acting at nodes."); 22 14265 : params.addRequiredParam<FunctionName>("function", "The forcing function"); 23 14265 : return params; 24 0 : } 25 : 26 0 : UserForcingFunctionNodalKernel::UserForcingFunctionNodalKernel(const InputParameters & parameters) 27 0 : : NodalKernel(parameters), _func(getFunction("function")) 28 : { 29 0 : } 30 : 31 : Real 32 0 : UserForcingFunctionNodalKernel::computeQpResidual() 33 : { 34 0 : return -_func.value(_t, (*_current_node)); 35 : }