qimpy.transport.TimeEvolution

class TimeEvolution(*, i_step=0, t=0.0, dt=0.0, dt_save=0.0, t_max=0.0, n_collate=0, integrator='RK2', steady_state=None, checkpoint_in=(None, ''), dt_max_sources)

Bases: TreeNode

Time evolution parameters.

Parameters:
  • i_step (int)

  • t (float)

  • dt (float)

  • dt_save (float)

  • t_max (float)

  • n_collate (int)

  • integrator (str)

  • steady_state (dict[str, str | float])

  • checkpoint_in (CheckpointPath)

  • dt_max_sources (list)

__init__(*, i_step=0, t=0.0, dt=0.0, dt_save=0.0, t_max=0.0, n_collate=0, integrator='RK2', steady_state=None, checkpoint_in=(None, ''), dt_max_sources)

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.

  • steady_state (dict[str, str | float]) – [Input file] Steady state options. EXPERIMENTAL: works only with a single process and geometry domain for now. Specify a dictionary of rho0_path for initial state, method for solver, nit for number of iterations and nit_save for iterations to save at.

  • dt_max_sources (list) – List of objects with dt_max that determine maximum safe time step.

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

run

Run time evolution loop, checkpointing at regular intervals.

save_checkpoint

Save self and all children in hierarchy to cp_path.

steady_state_sol

time_step

Second-order correct time step.

Attributes

t

Current time

dt

Time step (set automatically if zero)

i_step

Current step number

i_step_initial

Initial step number for current job (not zero if continued)

n_steps

Number of steps

save_interval

Save results every so many steps

n_collate

Collect these many save steps into a single checkpoint

integrator

Time-step style used for integration

steady_state

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