Animate_mode is not working as expected
Hi
I ve been recently trying to use functionality of Animate_mode, but tbh i found weird how it works, its producing animation as expected, but only contour plot is changing during animation and mesh is not deformed by field. This should look like that, or i am doing sth wrong?
i used example provided in HELP with added "deform_scale_factor=10"
import ansys.dpf.core as dpf from ansys.dpf.core import examples model = dpf.Model(examples.download_modal_frame()) disp = model.results.displacement.on_all_time_freqs.eval() #Creates an animation from a modal result. from ansys.dpf.core import animation animation.animate_mode(disp, mode_number=1, save_as="tmp.gif",deform_scale_factor=10)
Answers
-
Known issue. You can check in on progress by checking the github link for the issue: https://github.com/ansys/pydpf-core/issues/1032
0 -
@M said:
Known issue. You can check in on progress by checking the github link for the issue: https://github.com/ansys/pydpf-core/issues/1032thank you M for that response, do you know when possible solution of that issue will be published ?
0 -
Is there any workaround for this issue? Such as converting the displacement to the time domain?
0 -
A pull request exists for the Fix, not aware of any workaround.
0 -
This could be done with the python work around I created for a pymapdl example.
Basically, create a lot of images, use imagio to animate.import os, webbrowser import imageio.v2 as imageio from IPython.display import display, clear_output subfolder = 'figs' if subfolder not in os.listdir(): os.mkdir(subfolder) picList = [] for ctr in range(10): fileName = os.path.join(jobLocation, subfolder , 'file' + str(ctr) + '.jpg') picList.append(fileName) result.plot_nodal_displacement(0, cpos='xy',off_screen=True,displacement_factor = ctr*1000,show_displacement = True, show_edges=True, screenshot=fileName) clear_output() myfile = 'myAnime.mp4' aniSave = os.path.join(jobLocation, myfile) images = [] for filename in picList: images.append(imageio.imread(filename)) imageio.mimsave(aniSave, images) myfile = 'myAnime.mp4' writer = imageio.get_writer(myfile, fps=40) for im in picList: writer.append_data(imageio.imread(im)) writer.close() import webbrowser webbrowser.open(aniSave)
0