www.mooseframework.org
FunctionIC.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 "FunctionIC.h"
16 #include "Function.h"
17 
18 template <>
21 {
23  params.addRequiredParam<FunctionName>("function", "The initial condition function.");
24  return params;
25 }
26 
28  : InitialCondition(parameters), _func(getFunction("function"))
29 {
30 }
31 
32 Real
33 FunctionIC::value(const Point & p)
34 {
35  return _func.value(_t, p);
36 }
37 
39 FunctionIC::gradient(const Point & p)
40 {
41  return _func.gradient(_t, p);
42 }
virtual RealGradient gradient(const Point &p) override
The value of the gradient at a point.
Definition: FunctionIC.C:39
RealVectorValue RealGradient
Definition: Assembly.h:43
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
virtual RealGradient gradient(Real t, const Point &p)
Function objects can optionally provide a gradient at a point.
Definition: Function.C:49
InputParameters validParams< FunctionIC >()
Definition: FunctionIC.C:20
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...
InitialConditions are objects that set the initial value of variables.
virtual Real value(const Point &p) override
The value of the variable at a point.
Definition: FunctionIC.C:33
FunctionIC(const InputParameters &parameters)
Definition: FunctionIC.C:27
InputParameters validParams< InitialCondition >()
Function & _func
Definition: FunctionIC.h:58