4.7 pde.trackers package
Classes for tracking simulation results in controlled interrupts.
Trackers are classes that periodically receive the state of the simulation to analyze, store, or output it. The trackers defined in this module are:
Tracker calling a function periodically. |
|
Tracker showing the progress of the simulation. |
|
Tracker printing data to a stream (default: stdout) |
|
Tracker plotting data on screen, to files, or writes a movie. |
|
PlotTracker with defaults for live plotting. |
|
Tracker storing custom data obtained by calling a function. |
|
Tracker aborting the simulation once steady state is reached. |
|
Tracker interrupting the simulation once a duration has passed. |
|
Tracker interrupting the simulation when the state is not finite. |
|
Tracker showing the state interactively in napari. |
Some trackers can also be referenced by name for convenience when using them in
simulations. The lit of supported names is returned by
get_named_trackers()
.
Multiple trackers can be collected in a TrackerCollection
, which provides
methods for handling them efficiently. Moreover, custom trackers can be implemented by
deriving from TrackerBase
. Note that trackers generally receive
a view into the current state, implying that they can adjust the state by modifying it
in-place. Moreover, trackers can abort the simulation by raising the special exception
StopIteration
.
For each tracker, the time at which the simulation is interrupted can be decided using one of the following classes:
Class representing a list of interrupt times. |
|
Class representing equidistantly spaced time interrupts. |
|
Class representing logarithmically spaced time interrupts. |
|
Class representing time interrupts spaced equidistantly in real time. |
In particular, interrupts can be specified conveniently using
parse_interrupt()
.