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.

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
[../]
[]

(test/tests/misc/check_error/function_file_test1.i)

Input Parameters

• xy_dataAll function data, supplied in abscissa, ordinate pairs

C++ Type:std::vector

Options:

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

Options:

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

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

Default:rows

C++ Type:MooseEnum

Options:columns rows

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

Options:

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

Options:

Description:The abscissa index in the data file

• scale_factor1Scale factor to be applied to the ordinate values

Default:1

C++ Type:double

Options:

Description:Scale factor to be applied to the ordinate values

• y_index_in_file1The ordinate index in the data file

Default:1

C++ Type:unsigned int

Options:

Description:The ordinate index in the data file

• yThe ordinate values

C++ Type:std::vector

Options:

Description:The ordinate values

• xThe abscissa values

C++ Type:std::vector

Options:

Description:The abscissa values

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

C++ Type:MooseEnum

Options:x y z 0 1 2

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

Options:

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

• enableTrueSet the enabled status of the MooseObject.

Default:True

C++ Type:bool

Options:

Description:Set the enabled status of the MooseObject.