www.mooseframework.org
UserForcingFunctionNodalKernel.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
16 
17 #include "Function.h"
18 
19 template <>
22 {
24  params.addRequiredParam<FunctionName>("function", "The forcing function");
25  return params;
26 }
27 
29  : NodalKernel(parameters), _func(getFunction("function"))
30 {
31 }
32 
33 Real
35 {
36  return -_func.value(_t, (*_current_node));
37 }
virtual Real value(Real t, const Point &p)
Override this to evaluate the scalar function at point (t,x,y,z), by default this returns zero...
Definition: Function.C:43
const Node *& _current_node
current node being processed
Definition: NodalKernel.h:149
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParameters validParams< NodalKernel >()
Definition: NodalKernel.C:24
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
virtual Real computeQpResidual() override
The user can override this function to compute the residual at a node.
UserForcingFunctionNodalKernel(const InputParameters &parameters)
Constructor grabs the Function.
Base class for creating new types of boundary conditions.
Definition: NodalKernel.h:50
InputParameters validParams< UserForcingFunctionNodalKernel >()