www.mooseframework.org
ConstantFunction.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 "ConstantFunction.h"
16 
17 template <>
20 {
22  params.addParam<Real>("value", 0.0, "The constant value");
23  params.declareControllable("value");
24  return params;
25 }
26 
28  : Function(parameters), _value(getParam<Real>("value"))
29 {
30 }
31 
32 Real
33 ConstantFunction::value(Real, const Point &)
34 {
35  return _value;
36 }
const Real & _value
Base class for function objects.
Definition: Function.h:46
ConstantFunction(const InputParameters &parameters)
InputParameters validParams< ConstantFunction >()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void declareControllable(const std::string &name)
Declare the given parameters as controllable.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an option parameter and a documentation string to the InputParameters object...
InputParameters validParams< Function >()
Definition: Function.C:19
virtual Real value(Real t, const Point &p) override
Override this to evaluate the scalar function at point (t,x,y,z), by default this returns zero...