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
    value = 'x'
  [../]
[]
(../../../SoftwareDownloads/moose/test/tests/postprocessors/vector_postprocessor_comparison/vector_postprocessor_comparison.i)

Input Parameters

  • execute_onLINEARThe list of flag(s) indicating when this object should be executed, the available options include NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM, ALWAYS.

    Default:LINEAR

    C++ Type:ExecFlagEnum

    Options:NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM, ALWAYS

    Controllable:No

    Description:The list of flag(s) indicating when this object should be executed, the available options include NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, FINAL, CUSTOM, ALWAYS.

  • value0The constant value

    Default:0

    C++ Type:double

    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>

    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

    Controllable:No

    Description:Set the enabled status of the MooseObject.

Advanced Parameters