slippy.contact.OutputRequest¶
- class slippy.contact.OutputRequest(name: str, parameters: Sequence[str], timing_mode: str = 'interval', value: Union[Sequence, float] = 1)[source]¶
An output request for a multi step contact model
- Parameters
name (str) – The name of the output request, used for debugging
parameters (list[str]) – A list of parameters to be saved as part of the output, check step and sub-model descriptions for valid names, alternatively [‘all’] will save the entire model state
timing_mode ({'interval', 'time_interval', 'n_outputs_per_step', 'step_times', 'global_times'},) –
('interval') (optional) –
The timing mode used to control when this output is written to file, the value parameter controls how each method is executed:
- ’interval’ the output is written every n time points during execution, using this with value set to 1
(as is the default behaviour) writes the output on every sub step / time point.
’time_interval’ the output is written every n units of time, for example if value is set to 0.25 a step which is 1 unit of time long will output 4 times [t = 0.25, 0.5, 0.75, 1]. This is reset at the beginning of each model step.
’n_outputs_per_step’ the output is written n times in each step it is active in regardless of the length of each step, the time points are evenly spaced. value is the number of outputs to be recorded
’step times’ the output is written at specific times measured from the beginning of the steps which the output is active in, this resets for every model step which uses this output. value should be a sorted list of relative times
’global_times’ the output is written at specific times measured from the start of model execution, no output will be written from steps where this output is not active. value should be a sorted list of absolute times
- value: Union[list, float], optional (1)
Either a float or list of floats, as defined above
Notes
Outputs cannot be requested from the start of a step.
Outputs will only be written from steps which have the output added, this can be done through the individual steps or the contact model.
See also
Examples
An output request that will save everything at all time points:
>>> OutputRequest('output-0', ['all'])
An output request that will save ‘contact_nodes’ and normal load for every time step:
>>> OutputRequest('output-1', ['contact_nodes', 'loads_z'])
- __init__(name: str, parameters: Sequence[str], timing_mode: str = 'interval', value: Union[Sequence, float] = 1)[source]¶
Methods
__init__(name, parameters[, timing_mode, value])is_active(current_time, step_max_time)True if the output should be written on this time step
new_step(current_time)Called by the model when a new step is started
Attributes
parameters