LiveAnimation#
- class fridom.framework.modules.animation.live_animation.LiveAnimation(model_plotter: ModelPlotter, interval: int = 50)[source]#
Bases:
ModuleCreate a plot 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()Disable the module.
enable()Enable the module.
is_enabled()Whether the module is enabled or not.
reset()Stop and start the module.
setup(mset[, setup_mode])Set the module up.
start()Start the module.
stop()Stop the module.
update(mz)Update the model state.
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.
is_setupWhether the module is set up.
msetThe model settings.
required_haloThe required halo points for this module.
- name = 'Live Animation'#
- start() None[source]#
Start the module.
Description#
This method is called at the beginning of the model run. Child classes that require a start method (for example to start an output writer) should overwrite this method. Make sure to decorate the method with the @module_method decorator.
- update(mz: ModelState) ModelState[source]#
Update the model state.
Description#
This method is called by the model at each time step. Child classes should overwrite this method to update the module. Make sure to decorate the method with the @module_method decorator.
Parameters#
- mzfr.ModelState
The model state at the current time step.
Returns#
- fr.ModelState
The updated model state.