qimpy.transport.TimeEvolution

class TimeEvolution(*, dt=0.0, dt_save, t_max, n_collate, checkpoint_in=(None, ''), geometry)

Bases: TreeNode

Time evolution parameters.

Parameters:
  • dt (float) –

  • dt_save (float) –

  • t_max (float) –

  • n_collate (int) –

  • checkpoint_in (CheckpointPath) –

  • geometry (Geometry) –

__init__(*, dt=0.0, dt_save, t_max, n_collate, checkpoint_in=(None, ''), geometry)

Initialize time evolution parameters

Parameters:
  • 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.

  • 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.

  • t_max (float) – [Input file] Stop evolution at this time.

  • geometry (Geometry) – Corresponding geometry from which maximum time step is determined

  • checkpoint_in (CheckpointPath) –

Return type:

None

Methods

__init__

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.

next_rho_list

Ingredient of time step: compute rho_initial + dt * f(rho_eval).

run

Run time evolution loop, checkpointing at regular intervals.

save_checkpoint

Save self and all children in hierarchy to cp_path.

time_step

Second-order correct time step.

Attributes

t

Current time

dt

Time step (set automatically if zero)

i_step

Current step number

n_steps

Number of steps

save_interval

Save results every so many steps

n_collate

Collect these many save steps into a single checkpoint

child_names

Names of attributes with child objects.

next_rho_list(dt, rho_list_initial, rho_list_eval, geometry)

Ingredient of time step: compute rho_initial + dt * f(rho_eval).

Parameters:
  • dt (float) –

  • rho_list_initial (list[Tensor]) –

  • rho_list_eval (list[Tensor]) –

  • geometry (Geometry) –

Return type:

list[Tensor]

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

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