ResetTendency#
- class fridom.framework.modules.ResetTendency[source]#
Bases:
ModuleA module that resets the tendency of a model state.
Description#
Time steppers may reuse tendency states to avoid unnecessary memory deallocation and reallocation. For this reason, it is important to reset the tendency state before updating it. It should always be the first module of the tendencies list.
- __init__() None#
Methods
__init__()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.
Set the state to zero.
setup(mset)Start the module
start()Start the module
stop()Stop the module
update(mz)Update the module
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 = 'Reset Tendency'#
- update(mz: ModelState) ModelState[source]#
Update the module
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.