13 functions (release)
The functions object holds all function objects, identified by user defined identifiers. A function must be one of the specified types. Functions are used to describe mathematical behavior.
Name |
| Type |
| Description |
| Default |
label |
| STRING |
| User provided identifier for this function definition. |
| |
piecewise_linear (release) | constant (release) | custom_julia (beta) | exodus_file (alpha) |
| SUB OBJECT | SUB OBJECT | SUB OBJECT | SUB OBJECT |
| One of the given keywords must be defined to specify the type of function to be used. |
|
Example Usage:functions: [ { label: "constant_1", constant: { value: 1 } }, { label: "linear_ramp", piecewise_linear: { abscissa: [ 0, 1 ], ordinate: [ 0, 1 ] } } ]
13.1 piecewise_linear (release)
This object is used to define a piecewise linear function which will linearly interpolate between the given values.
Name |
| Type |
| Description |
| Default |
abscissa |
| [ DOUBLE, ... ] |
| A vector of at least two discrete time values for the various function segments. |
| |
ordinate | vector_valued_ordinate |
| [ DOUBLE, ... ] | [ [ DOUBLE, ... ], ... ] |
| One of the given keywords must be defined to specify the function ordinate dimension |
|
Example Usage:piecewise_linear: { abscissa: [ 0, 1 ], ordinate: [ 0, 1 ] }
13.1.1 ordinate | vector_valued_ordinate
One of the given keywords must be defined to specify the function ordinate dimension
Name |
| Type |
| Description |
| Default |
ordinate |
| [ DOUBLE, ... ] |
| A vector of length equal to abscissa signifying the scalar value of the function at each discrete time point. |
| |
vector_valued_ordinate |
| [ [ DOUBLE, ... ], ... ] |
| A vector of length equal to abscissa signifying the vector value of the function at each discrete time point. |
|
13.2 constant (release)
This object defines constant function properties.
Name |
| Type |
| Description |
| Default |
value | vector_value |
| DOUBLE | [ DOUBLE, ... ] |
| One of the given keywords must be defined to specify the dimension of the functions return value. |
|
Example Usage:constant: { value: 1 }
13.2.1 value | vector_value
One of the given keywords must be defined to specify the dimension of the functions return value.
Name |
| Type |
| Description |
| Default |
value |
| DOUBLE |
| The constant scalar value of the function. |
| |
vector_value |
| [ DOUBLE, ... ] |
| The constant vector value of the function. |
|
13.3 custom_julia (beta)
A custom function specified with Julia. A separate Julia file can be referenced with the julia-file object, or the function can be written inline with the julia-function object. The function takes in a three-dimensional point as the first argument and a scalar time as the second argument, and must return a vector or a scalar. The solver adds to and modifies this function. As such, it should not be defined within a module. DO NOT repeat function names. Julia allows functions to be redefined without error or warning. We do have some rudimentary guards in place that will save the simulation if names are shared across very simple files or functions. However, in more complicated situations these guards can fail. The guards mainly protect against typical quick copy and paste errors.
Name |
| Type |
| Description |
| Default |
return_type (beta) |
| “scalar” | “vector” |
| Whether the function returns a single value or a vector. The vector can be up to size six. |
| |
| SUB OBJECT | SUB OBJECT |
| One of the given keywords must be defined to specify the source of the julia function |
|
Example Usage:custom_julia: { return_type: "vector", julia_file: { function_name: "stresscontour", file_name: "plate_with_hole_stress.jl" } }
13.3.1 julia_file (beta)
This object points to a separate Julia file for use in the function.
Name |
| Type |
| Description |
| Default |
function_name (beta) |
| STRING |
| The name of the main Julia function that will be called. |
| |
file_name (beta) |
| STRING |
| The file name for a Julia file containing the function. |
|
Example Usage:julia_file: { function_name: "stresscontour", file_name: "plate_with_hole_stress.jl" }
13.3.2 julia_function (beta)
This object holds a Julia function, written inline, for use in the function.
Name |
| Type |
| Description |
| Default |
function_name (beta) |
| STRING |
| The name of the main Julia function that will be called. |
| |
function_body (beta) |
| STRING |
| The Julia code that specifies the function. |
|
13.4 exodus_file (alpha)
Import an exodus file that describes the function evaluation. This function type is currently only supported for temperature distribution load conditions for solid mechanics procedures.
Name |
| Type |
| Description |
| Default |
file_name (alpha) |
| STRING |
| The name of the exodus file that will be used for evaluation. |
| |
block (alpha) |
| STRING |
| The name of the block that will be used for evaluation. |
| |
variable (alpha) |
| STRING |
| The name of the variable that will be used for evaluation. |
| |
time_step (alpha) |
| INTEGER |
| The time step that will used for evaulation. |
| |
julia_file (alpha) [optional] |
| SUB OBJECT |
| See linked documentation |
|
13.4.1 julia_file (alpha)
Julia function that will operate on the exodus function output. The function must take a scalar value and a time argument and return a single scalar. This field is optional, and if omittied the exodus function value will be used unaltered.
Name |
| Type |
| Description |
| Default |
function_name (alpha) |
| STRING |
| The name of the main Julia function that will be called. |
| |
file_name (alpha) |
| STRING |
| The file name for a Julia file containing the function. |
|