SaveOnceOnCompletion

class plasmapy.simulation.particle_tracker.save_routines.SaveOnceOnCompletion(
output_directory: Path | None = None,
output_basename: str = 'output',
)[source]

Bases: AbstractSaveRoutine

Save only once the ParticleTracker has finished.

This works by taking advantage of the fact that the save() method is called directly at the conclusion of a simulation, effectively bypassing the save_now() criteria.

Attributes Summary

require_synchronized_dt

A synchronized time step is not required for this save routine to make sense.

results

Return the results of the simulation.

save_now

Never save during the simulation.

tracker

Return the ParticleTracker object for this stop condition.

Methods Summary

post_push_hook()

Function called after a push step.

save()

Save the current state of the simulation to memory.

Attributes Documentation

require_synchronized_dt

A synchronized time step is not required for this save routine to make sense.

results

Return the results of the simulation. The quantities returned depend on those defined in the body of the save routine.

save_now

Never save during the simulation.

tracker

Return the ParticleTracker object for this stop condition.

Methods Documentation

post_push_hook() None

Function called after a push step.

This function is responsible for handling two steps of save routine, namely:
  • Deciding to save on the current time step

  • How the simulation data is saved (i.e. to disk or memory)

save() None

Save the current state of the simulation to memory.

If an output directory is specified then the state will also be saved to the disk.