ConstantFunction

A function that returns a constant value as defined by an input parameter.

The value parameter of the ConstantFunction is controllable, so it may modified during the simulation using the Controls system.

Example input syntax

This example uses a ConstantFunction to feed into vectorized spatial samplers, which sample the function in specified locations. These samples are then compared using another postprocessor. The ConstantFunction sampled anywhere in time and space will return its constant value.

[Functions]
  # Sampled values will be [2, 2, 2]
  [./a_fn]
    type = ConstantFunction
    value = 2
  [../]
  # Sampled values will be [0, 1, 2]
  [./b_fn]
    type = ParsedFunction
    expression = 'x'
  [../]
[]
(moose/test/tests/postprocessors/vector_postprocessor_comparison/vector_postprocessor_comparison.i)

Input Parameters

  • value0The constant value

    Default:0

    C++ Type:double

    Unit:(no unit assumed)

    Controllable:Yes

    Description:The constant value

Optional Parameters

  • control_tagsAdds user-defined labels for accessing object parameters via control logic.

    C++ Type:std::vector<std::string>

    Unit:(no unit assumed)

    Controllable:No

    Description:Adds user-defined labels for accessing object parameters via control logic.

  • enableTrueSet the enabled status of the MooseObject.

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Set the enabled status of the MooseObject.

Advanced Parameters