www.mooseframework.org
RealFunctionControl.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 // MOOSE includes
16 #include "RealFunctionControl.h"
17 #include "Function.h"
18 
19 template <>
22 {
24  params.addClassDescription(
25  "Sets the value of a 'Real' input parameters to the value of a provided function.");
26  params.addRequiredParam<FunctionName>(
27  "function", "The function to use for controlling the specified parameter.");
28  params.addRequiredParam<std::string>(
29  "parameter",
30  "The input parameter(s) to control. Specify a single parameter name and all "
31  "parameters in all objects matching the name will be updated");
32  return params;
33 }
34 
36  : Control(parameters), _function(getFunction("function"))
37 {
38 }
39 
40 void
42 {
43  Real value = _function.value(_t, Point());
44  setControllableValue<Real>("parameter", value);
45 }
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
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 void execute() override
Execute the control.
InputParameters validParams< RealFunctionControl >()
Function & _function
The function to execute.
Base class for Control objects.
Definition: Control.h:43
InputParameters validParams< Control >()
Definition: Control.C:20
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...
RealFunctionControl(const InputParameters &parameters)
Class constructor.