PiecewiseConstant

Defines data using a set of x-y data pairs

Description

The PiecewiseConstant function defines the data using a set of x-y data pairs. Instead of linearly interpolating between the values, however, the PiecewiseConstant function is constant when the abscissa is between the values provided by the user. The direction parameter controls whether the function takes the value of the abscissa of the user-provided point to the right or left of the value at which the function is evaluated.

Example Input Syntax


[Functions]
  [./a]
    type = PiecewiseConstant
    xy_data = '0.5 0.1
               1.0 0.2
               1.5 0.1'
    direction = left
  [../]
  [./b]
    type = PiecewiseConstant
    x = '0.5 1.0 1.5'
    y = '0.1 0.2 0.1'
    direction = right
  [../]
  [./c]
    type = PiecewiseConstant
    data_file = pc.csv
    direction = left
    format = columns
  [../]
  [./d]
    type = PiecewiseConstant
    data_file = pc.csv
    direction = right
    format = columns
  [../]
[]
(../moose/test/tests/functions/piecewise_constant/piecewise_constant.i)

Input Parameters

  • directionleftDirection to look to find value: left right

    Default:left

    C++ Type:MooseEnum

    Description:Direction to look to find value: left right

  • xy_dataAll function data, supplied in abscissa, ordinate pairs

    C++ Type:std::vector

    Description:All function data, supplied in abscissa, ordinate pairs

  • scale_factor1Scale factor to be applied to the ordinate values

    Default:1

    C++ Type:double

    Description:Scale factor to be applied to the ordinate values

  • formatrowsFormat of csv data file that is in either in columns or rows

    Default:rows

    C++ Type:MooseEnum

    Description:Format of csv data file that is in either in columns or rows

  • data_fileFile holding csv data for use with Piecewise

    C++ Type:FileName

    Description:File holding csv data for use with Piecewise

  • x_index_in_file0The abscissa index in the data file

    Default:0

    C++ Type:unsigned int

    Description:The abscissa index in the data file

  • xy_in_file_onlyTrueIf the data file only contains abscissa and ordinate data

    Default:True

    C++ Type:bool

    Description:If the data file only contains abscissa and ordinate data

  • y_index_in_file1The ordinate index in the data file

    Default:1

    C++ Type:unsigned int

    Description:The ordinate index in the data file

  • yThe ordinate values

    C++ Type:std::vector

    Description:The ordinate values

  • xThe abscissa values

    C++ Type:std::vector

    Description:The abscissa values

  • axisThe axis used (x, y, or z) if this is to be a function of position

    C++ Type:MooseEnum

    Description:The axis used (x, y, or z) if this is to be a function of position

Optional Parameters

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

    C++ Type:std::vector

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

  • enableTrueSet the enabled status of the MooseObject.

    Default:True

    C++ Type:bool

    Description:Set the enabled status of the MooseObject.

Advanced Parameters