visualsimanimator.py

This module contains functions for animating simulation fields including visualisation of virtual sensor locations on the simulation mesh using pyvista.

animate_sim_with_sensors(sensor_array, component, time_steps=None, vis_opts=None, anim_opts=None)[source]

Creates an animation of the simulation fields using pyvista showing the virtual sensor locations during the animation.

Parameters:
  • sensor_array (SensorArrayPoint) – Sensor array that will be displayed on the simulation while the simulation results are animated.

  • component (str) – String key for the field component to animate.

  • time_steps (np.ndarray | None, optional) – Time steps over which to creatre the animation, by default None. If None then the animation is performed over all time steps.

  • vis_opts (VisOptsSimSensors | None, optional) – Dataclass containing options for controlling the appearance of the virtual sensors, by default None. If None a default options dataclass is created.

  • anim_opts (VisOptsAnimation | None, optional) – Dataclass containing options for controlling the animation output, by default None. If None then a default options dataclass is created.

Returns:

pv.Plotter – Handle to the pyvista plotter object used to create the animation.