qimpy.transport.TimeEvolution
- class TimeEvolution(*, i_step=0, t=0.0, dt=0.0, dt_save, t_max, n_collate, integrator='RK2', checkpoint_in=(None, ''), geometry)
Bases:
TreeNode
Time evolution parameters.
- Parameters:
i_step (int)
t (float)
dt (float)
dt_save (float)
t_max (float)
n_collate (int)
integrator (str)
checkpoint_in (CheckpointPath)
geometry (Geometry)
- __init__(*, i_step=0, t=0.0, dt=0.0, dt_save, t_max, n_collate, integrator='RK2', checkpoint_in=(None, ''), geometry)
Initialize time evolution parameters
- Parameters:
i_step (int) – Initial step index, used for continuing from checkpoint.
t (float) – Initial time, used for continuing from checkpoint.
dt (float) – [Input file] Time step for evolution. If zero, this is set to the maximum stable time step for advection.
dt_save (float) – [Input file] Time interval at which to save results. This will be rounded to the nearest multiple of dt to ensure that the results are written at uniform intervals.
t_max (float) – [Input file] Stop evolution at this time.
n_collate (int) – [Input file] Number of save-steps to collect into each checkpoint file. Collecting together several saves can substantially improve performance by amortizing the latency associated with disk I/O and GPU transfers. The results in the checkpoint have an additional outermost dimension corresponding to the number of collated steps.
integrator (str) – [Input file] Integrator for time-stepping: RK2 or RK4.
geometry (Geometry) – Corresponding geometry from which maximum time step is determined
checkpoint_in (CheckpointPath)
- Return type:
None
Methods
Initialize time evolution parameters
add_child
Construct child object self.`attr_name` of type cls.
add_child_one_of
Invoke add_child on one of several child options in args.
Run time evolution loop, checkpointing at regular intervals.
save_checkpoint
Save self and all children in hierarchy to cp_path.
Second-order correct time step.
Attributes
Current time
Time step (set automatically if zero)
Current step number
Initial step number for current job (not zero if continued)
Number of steps
Save results every so many steps
Collect these many save steps into a single checkpoint
Time-step style used for integration
child_names
Names of attributes with child objects.
variant_name
Version of children having variants (if any)
- run(transport)
Run time evolution loop, checkpointing at regular intervals.
- Parameters:
transport (Transport)
- Return type:
None
- time_step(geometry)
Second-order correct time step.
- Parameters:
geometry (Geometry)
- Return type:
None
- dt: float
Time step (set automatically if zero)
- i_step: int
Current step number
- i_step_initial: int
Initial step number for current job (not zero if continued)
- integrator: str
Time-step style used for integration
- n_collate: int
Collect these many save steps into a single checkpoint
- n_steps: int
Number of steps
- save_interval: int
Save results every so many steps
- t: float
Current time