VTK Quick Plot#
- class pybamm.VTKQuickPlot(solutions: Solution | Simulation | list[Solution | Simulation], output_variables: str | list[str] | None = None, options: dict[str, dict[str, Any] | list[dict[str, Any]]] | None = None, interpolate_time: bool = False)[source]#
Interactive VTK visualization for unstructured mesh solutions.
Supports spatial (unstructured 2D/3D) and 0D (time-series) variables.
- Parameters:
solutions (
pybamm.Solutionorpybamm.Simulation) – The solution to plot; a single-element list is also accepted.output_variables (str or list of str, optional) – Variables to plot. Defaults to the model’s default quick-plot variables that are 0D or live on an unstructured mesh.
options (dict, optional) –
Per-variable options keyed by variable name. Each value is a dict that may contain:
"plot_type":"3d"(default) or"slice""x"/"y"/"z": float in [0, 1] giving the slice position as a fraction of the axis range (required whenplot_typeis"slice")"scale":"auto"(default),None, or(sx, sy, sz)
A variable’s value may also be a list of such dicts, in which case one panel is created per entry:
options={"T": [ {"plot_type": "3d"}, {"plot_type": "slice", "x": 0.5}, ]}
interpolate_time (bool, optional) – Evaluate the variables at the exact slider time instead of snapping to the nearest stored solution time. Default is False.
- dynamic_plot(show_plot: bool = True) None[source]#
Launch an interactive VTK window with a time slider.