Skip to content

Commit

Permalink
Fix frequency value shown
Browse files Browse the repository at this point in the history
  • Loading branch information
PProfizi committed Jan 8, 2025
1 parent e7933c6 commit bd52a3b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ansys/dpf/core/animator.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def render_frame(frame):
workflow.connect(input_name, [frame])

else:
workflow.connect(input_name, loop_over.data[frame])
workflow.connect(input_name, loop_over.scoping.ids[frame])
workflow.connect("loop_over_values", loop_over.data)

field = workflow.get_output(output_name, core.types.field)
deform = None
Expand All @@ -126,7 +127,7 @@ def render_frame(frame):
if mode_number is None:
str_template = "t={0:{2}} {1}"
self._plotter.add_text(
str_template.format(indices[frame], unit, freq_fmt), **kwargs_in
str_template.format(loop_over.data_as_list[frame], unit, freq_fmt), **kwargs_in
)
else:
str_template = "frq={0:{2}} {1}"
Expand Down
4 changes: 4 additions & 0 deletions src/ansys/dpf/core/fields_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,10 @@ def animate(self, save_as=None, deform_by=None, scale_factor=1.0, **kwargs):
# First define the workflow index input
forward_index = dpf.core.operators.utility.forward()
wf.set_input_name("loop_over", forward_index.inputs.any)
# Add a time values input
forward_time = dpf.core.operators.utility.forward()
wf.set_input_name("loop_over_values", forward_time.inputs.any)
wf.set_output_name("time_values", forward_time.outputs.any)
# Define the field extraction using the fields_container and indices
extract_field_op = dpf.core.operators.utility.extract_field(self)
to_render = extract_field_op.outputs.field
Expand Down

0 comments on commit bd52a3b

Please sign in to comment.