PiecewiseLinear

Linearly interpolates between pairs of x-y data

Description

The PiecewiseLinear function performs linear interpolations between user-provided pairs of x-y data. The x-y data can be provided in three ways. The first way is through a combination of the x and y paramaters, which are lists of the x and y coordinates of the data points that make up the function. The second way is in the xy_data parameter, which is a list of pairs of x-y data that make up the points of the function. This allows for the function data to be specified in columns by inserting line breaks after each x-y data point. Finally, the x-y data can be provided in an external file containing comma-separated values. The file name is provided in data_file, and the data can be provided in either rows (default) or columns, as specified in the format parameter.

By default, the x-data corresponds to time, but this can be changed to correspond to x, y, or z coordinate with the axis line. If the function is queried outside of its range of x data, it returns the y value associated with the closest x data point, unless the parameter extrap is set to true, in which case extrapolation is performed instead.

Example Input Syntax

[Functions]
  [./ic_function]
    type = PiecewiseLinear
    data_file = piecewise_linear_columns.csv #Will generate error because data is expected in rows
    scale_factor = 1.0
  [../]
[]
(../moose/test/tests/misc/check_error/function_file_test1.i)

Input Parameters

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

    C++ Type:MooseEnum

    Options:x, y, z

    Controllable:No

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

  • data_fileFile holding CSV data

    C++ Type:FileName

    Controllable:No

    Description:File holding CSV data

  • 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, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM, ALWAYS.

    Default:LINEAR

    C++ Type:ExecFlagEnum

    Options:NONE, INITIAL, LINEAR, NONLINEAR, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_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, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM, ALWAYS.

  • extrapFalseIf true, extrapolates when sample point is outside of abscissa range

    Default:False

    C++ Type:bool

    Controllable:No

    Description:If true, extrapolates when sample point is outside of abscissa range

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

    Default:rows

    C++ Type:MooseEnum

    Options:columns, rows

    Controllable:No

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

  • scale_factor1Scale factor to be applied to the ordinate values

    Default:1

    C++ Type:double

    Controllable:Yes

    Description:Scale factor to be applied to the ordinate values

  • xThe abscissa values

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

    Controllable:No

    Description:The abscissa values

  • x_index_in_file0The abscissa index in the data file

    Default:0

    C++ Type:unsigned int

    Controllable:No

    Description:The abscissa index in the data file

  • x_titleThe title of the column/row containing the x data in the data file

    C++ Type:std::string

    Controllable:No

    Description:The title of the column/row containing the x data in the data file

  • xy_dataAll function data, supplied in abscissa, ordinate pairs

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

    Controllable:No

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

  • xy_in_file_onlyTrueIf the data file only contains abscissa and ordinate data

    Default:True

    C++ Type:bool

    Controllable:No

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

  • yThe ordinate values

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

    Controllable:No

    Description:The ordinate values

  • y_index_in_file1The ordinate index in the data file

    Default:1

    C++ Type:unsigned int

    Controllable:No

    Description:The ordinate index in the data file

  • y_titleThe title of the column/row containing the y data in the data file

    C++ Type:std::string

    Controllable:No

    Description:The title of the column/row containing the y data in the data file

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