Animator
#
- class ansys.dpf.core.animator.Animator(workflow=None, **kwargs)#
The DPF animator class.
Overview#
Import detail#
from ansys.dpf.core.animator import Animator
Property detail#
- property Animator.workflow: ansys.dpf.core.Workflow#
Workflow used to generate a Field at each frame of the animation.
By default, the “to_render” Field output will be plotted, and the “loop_over” input defines what the animation iterates on. Optionally, the workflow can also have a “deform_by” Field output, used to deform the mesh support.
- Returns:
workflow
- Return type:
Method detail#
- Animator.animate(loop_over: ansys.dpf.core.Field, output_name: str = 'to_render', input_name: str = 'loop_over', save_as: str = None, scale_factor: float | Sequence[float] = 1.0, freq_kwargs: dict = None, shell_layer: ansys.dpf.core.shell_layers = core.shell_layers.top, **kwargs)#
Animate the workflow of the Animator, using inputs.
- Parameters:
loop_over – Field of values to loop over. Can for example be a subset of sets of TimeFreqSupport.time_frequencies. The unit of the Field will be displayed if present.
output_name – Name of the workflow output to use as Field for each frame’s contour. Defaults to “to_render”.
input_name – Name of the workflow inputs to feed loop_over values into. Defaults to “loop_over”.
save_as – Path of file to save the animation to. Defaults to None. Can be of any format supported by pyvista.Plotter.write_frame (.gif, .mp4, …).
scale_factor – Scale factor to apply when warping the mesh. Defaults to 1.0. Can be a list to make scaling frequency-dependent.
freq_kwargs – Dictionary of kwargs given to the
pyvista.Plotter.add_text()
method, used to format the frequency information. Can also contain a “fmt” key, defining the format for the frequency displayed with a string such as “.3e”.shell_layer – Enum used to set the shell layer if the field to plot contains shell elements. Defaults to top layer.
**kwargs (optional) – Additional keyword arguments for the animator. Used by
pyvista.Plotter()
(off_screen, cpos, …), or bypyvista.Plotter.open_movie()
(framerate, quality, …)