(Time) function records¶
These records describe the functions that generally describe the variation of
components during the solution. They are counted by nltf in the
Components size record, and the numbering must start at one and end at
n, where n is the number of records.
Record syntax common to all functions
TimeFunctType num (in)
[initialValue (rn)] [paramtype (in)]
Common parameters
- [
initialValue(rn)] Controls how the increment of the receiver is evaluated for the first solution step: that increment is the difference between the value of the receiver at the first step and this initial value, which defaults to zero. In subsequent steps the increment is the difference between the receiver evaluated at the given solution step and at the previous one.
Note
Deprecated in the sources, but still read.
- [
paramtype(in)] What the function’s argument is.
0, the default, evaluates the function at the current solution time.1evaluates it at a parameter supplied by whatever uses the function, so that the abscissa is not time at all.This is what lets a function describe a dependence on something other than time — a gap-dependent conductivity, for instance; see Thermal surface-to-surface contact.
Constant function¶
A constant function.
Record syntax
ConstantFunction num (in) f(t) (rn)
Peak function¶
A peak function: if the time equals t, the value of the function is
f(t); otherwise zero is returned.
Record syntax
PeakFunction num (in) t (rn)
f(t) (rn)
Piecewise linear function¶
A piecewise linear function. The time values in t must be sorted
along the time scale, and the corresponding function values are in
f(t). The value for a time not present in t is computed by
linear interpolation.
Record syntax
PiecewiseLinFunction num (in)
((t (ra) f(t) (ra)) |
datafile (s))
[npoints (in)] [paramtype (in)]
Parameters
t(ra),f(t)(ra)The abscissa and ordinate arrays.
datafile(s)Read the data from an external ASCII file instead. The data should be stored in two columns, or simply interleaved; lines starting with
#are skipped. The file name must be enclosed in double quotes. An empty name is permitted, for a function that is intentionally never used.- [
npoints(in)] Number of time-value pairs.
Note
Accepted but ignored: like every array attribute,
tandf(t)carry their own size (see Attribute types), and that is what is used. It appears in many existing input files, so it is still tolerated.
Step function¶
Like the piecewise linear function, but the value is held constant between the given points instead of being interpolated.
Record syntax
StepFunction num (in)
((t (ra) f(t) (ra)) |
datafile (s))
Periodic piecewise linear function¶
A piecewise linear function repeated with a given period.
Record syntax
PeriodicPiecewiseLinFunction num (in)
t (ra) f(t) (ra)
period (rn) [addtf (in)]
Parameters
period(rn)Length of one period. After it the function repeats.
- [
addtf(in)] Number of another function whose value is added to this one, which allows a periodic variation to be superposed on a trend.
Heaviside-like function¶
Zero up to the time given by origin; equal to value for
times greater than origin.
Record syntax
HeavisideLTF num (in) origin (rn)
value (rn)
Pulse function¶
A rectangular pulse: equal to value between tmin and
tmax, and zero outside that interval.
Record syntax
PulseFunction num (in) tmin (rn)
tmax (rn) value (rn)
[tstime (rn)]
Parameters
tmin(rn),tmax(rn)Start and end of the pulse.
value(rn)Value of the function inside the interval.
- [
tstime(rn)] Time-step time used to resolve the pulse.
User-defined function¶
A user-defined function given as an expression, which may depend on the
parameter t, for which the actual time is substituted before the expression
is evaluated. See Attribute types for the expression syntax.
The first and second time derivatives may be required, depending on the type of analysis.
Record syntax
UsrDefLTF num (in) f(t) (expr)
[dfdt(t) (expr)] [d2fdt2(t) (expr)]
User-defined Python expression¶
Note
Requires a build configured with USE_PYTHON_EXTENSION=ON.
A user-defined function given as a Python expression or script. The code may
depend on the parameter t, for which the actual time is substituted, and on
the array x, which holds the position.
The expression or script must assign to a variable named ret, whose value is
returned as the value of the function.
Important
Text between double quotes is not lower-cased by the parser (see Anatomy of an input file), so Python identifiers keep their case.
Record syntax
PythonExpression num (in)
(f (s) | fpath (s))
([dfdt (s)] | [dfdtpath (s)])
([d2fdt2 (s)] | [d2fdt2path (s)])
Parameters
f(s)A string containing the Python expression.
fpath(s)Alternatively, a string containing the path to a Python script file defining the code for the function.
- [
dfdt(s)], [dfdtpath(s)] Expression, or path to a script, evaluating the first derivative of the function.
- [
d2fdt2(s)], [d2fdt2path(s)] Expression, or path to a script, evaluating the second derivative.
The derivatives may be required depending on the context in which the function is used.
Interpolating function¶
Interpolates values from a data file over a structured grid of one, two or three dimensions.
Record syntax
InterpolatingFunction num (in)
name (s) dim (in)
Parameters
name(s)Path to the file holding the data.
dim(in)Number of dimensions of the data.
Local Gaussian random function¶
Returns a normally distributed random value, used to introduce randomness into material properties over a domain.
Record syntax
LocalGaussRandomFunction num (in)
mean (rn) variance (rn)
[seed (in)]
Parameters
mean(rn),variance(rn)Mean and variance of the distribution.
- [
seed(in)] Seed of the random generator, so that a run can be reproduced.