9.4. Cyclic Pushover Animation
- plotter.animate_cpo(cpo_dict, nodeList, elementList, push_dir, export_path)[source]
Generates and saves the CPO animation using FuncAnimation, showing: 1. Deformed model shape. 2. Base shear vs. top displacement (hysteretic curve). 3. Base shear vs. maximum interstorey drift (hysteretic curve).
The animation figure uses
self.figsize_animwithconstrained_layoutso that every exported frame has identical, deterministic pixel dimensions.- Parameters:
cpo_dict (dict) – The analysis results dictionary returned by do_cpo_analysis.
nodeList (list) – List of node tags in the model.
elementList (list) – List of element tags in the model.
push_dir (int) – Direction of the pushover analysis (1=X, 2=Y, 3=Z).
export_path (str) – File path to save the animation (.gif or .mp4).
- Returns:
The animation is written to
export_path; the figure is closed afterwards to free memory.- Return type:
None
Example
from openquake.vmtk.plotter import plotter
# Usual route: ``do_cpo_analysis`` calls this method when
# ``save_animation_path`` is given
cpo_dict = m.do_cpo_analysis(
ref_disp, mu_levels, push_dir, dispIncr, phi,
save_animation_path="cpo_animation.gif",
)
# Direct call, from the dictionary returned by ``do_cpo_analysis``
pl = plotter()
pl.animate_cpo(
cpo_dict=cpo_dict,
nodeList=nodeList,
elementList=elementList,
push_dir=push_dir,
export_path="cpo_animation.gif",
)