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, **kwargs)#
Animate the workflow of the Animator, using inputs.
- Parameters:
loop_over (Field) – 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 (str, optional) – Name of the workflow output to use as Field for each frame’s contour. Defaults to “to_render”.
input_name (list of str, optional) – Name of the workflow inputs to feed loop_over values into. Defaults to “loop_over”.
save_as (str, optional) – 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 (float, list, optional) – Scale factor to apply when warping the mesh. Defaults to 1.0. Can be a list to make scaling frequency-dependent.
freq_kwargs (dict, optional) – 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”.**kwargs (optional) – Additional keyword arguments for the animator. Used by
pyvista.Plotter()
(off_screen, cpos, …), or bypyvista.Plotter.open_movie()
(framerate, quality, …)