historyFunc

historyFunc

A UserFunc of kind = historyFunc returns values from a <History>.

Currently only Tensor Histories can be probed by historyFunc; see Tensor Histories.

A UserFunc of kind = historyFunc is a function that takes a single argument of a single integer, and returns a (scalar) value from a <History> record. The argument is meant to be the difference between the current time step and a past time step. For example, a kind = historyFunc function will return its most recent record given an argument of 0; it will return its next-most-recent record given argument of 1, and so on.

historyFunc parameters

history (string, required)

The name of a <History> from which to retrieve data.

index (vector of integers, required)

The array-index of the desired element in the History. For example, if the History stores records that are \(3\times 2\) arrays (or tensors), then index might be [0, 0] or [2,1]. For a History that stores scalar records, this should simply be [0]. (N.B. the array dimensions of a history can be looked up in the History dump-file, keeping in mind that the first dimension is the record-index; for example, a scalar history stores a dataset of dimensions \(n\times 1\).)