www.mooseframework.org
FunctionAux.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 
15 #include "FunctionAux.h"
16 #include "Function.h"
17 
18 template <>
21 {
23  params.addClassDescription("Auxiliary Kernel that creates and updates a field variable by "
24  "sampling a function through space and time.");
25  params.addRequiredParam<FunctionName>("function", "The function to use as the value");
26  return params;
27 }
28 
30  : AuxKernel(parameters), _func(getFunction("function"))
31 {
32 }
33 
34 Real
36 {
37  if (isNodal())
38  return _func.value(_t, *_current_node);
39  else
40  return _func.value(_t, _q_point[_qp]);
41 }
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
InputParameters validParams< FunctionAux >()
Definition: FunctionAux.C:20
const MooseArray< Point > & _q_point
Dimension of the problem being solved.
Definition: AuxKernel.h:159
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
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 computeValue() override
Definition: FunctionAux.C:35
InputParameters validParams< AuxKernel >()
Definition: AuxKernel.C:30
Function & _func
Function being used to compute the value of this kernel.
Definition: FunctionAux.h:43
const Node *& _current_node
Current node (valid only for nodal kernels)
Definition: AuxKernel.h:186
bool isNodal()
Nodal or elemental kernel?
Definition: AuxKernel.h:89
unsigned int _qp
Quadrature point index.
Definition: AuxKernel.h:192
Base class for creating new auxiliary kernels and auxiliary boundary conditions.
Definition: AuxKernel.h:51
FunctionAux(const InputParameters &parameters)
Factory constructor, takes parameters so that all derived classes can be built using the same constru...
Definition: FunctionAux.C:29
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...