LiveAnimation#
- class fridom.framework.modules.animation.live_animation.LiveAnimation(model_plotter: ModelPlotter, interval: int = 50)[source]#
Bases:
ModuleCreate a live plot of the model that gets updated at regular intervals during the simulation.
Description#
To create a live animation of the model, one must provide a ModelPlotter that will be used to create the figure. Note that live animations only work in Jupyter notebooks (no MPI support).
Warning
The live animation module clashes with the Progress bar module. Make sure to disable the progress bar module when using the live animation.
Parameters#
- model_plotterModelPlotterBase
The model plotter that will be used to create the figure.
- intervalint, optional (default=50)
The interval (time steps) at which the plot will be updated.
- __init__(model_plotter: ModelPlotter, interval: int = 50) None[source]#
Methods
__init__(model_plotter[, interval])disable()Enabling the module means that it will be executed at each time step.
enable()Enabling the module means that it will be executed at each time step.
is_enabled()Return whether the module is enabled or not.
reset()Stop and start the module.
setup(mset)Start the module
start()Initialize the figure.
stop()Stop the module
update(mz)Update the figure from the model state and display it.
Attributes
diff_moduleThe differentiation module to be used by this module.
gridThe grid of the model settings
infoReturn a dictionary with information about the time stepper.
interp_moduleThe interpolation module to be used by this module.
msetThe model settings
required_halo- name = 'Live Animation'#
- update(mz: ModelState) ModelState[source]#
Update the figure from the model state and display it.
Parameters#
- mzModelState
The model state to be used to update the figure.