ansys / pydpf-core

Data Processing Framework - Python Core
http://dpf.docs.pyansys.com/
MIT License
64 stars 23 forks source link

Add deformation to the mode shape animation #1644

Open Rfaelv opened 6 days ago

Rfaelv commented 6 days ago

Description of the feature

The actual mode shape animation looks like this example presented in the documentation. Even though the method animate_mode allows the deform_scale_factor parameter, only the colors changes in the animation. I expected that the node coordinates changes too (acording to the mode shape).

If some of you could please implement that feature I would apreciate it so much.

Steps for implementing the feature

No response

Useful links and references

No response

Rfaelv commented 6 days ago

I've driven into the code and found a way (not necessarily the better) to show the mode shape deformation. Below I describe the solution:

Here: https://github.com/ansys/pydpf-core/blob/05399b10cd293c63020ea224d13d3b3dba1f11d4/src/ansys/dpf/core/animation.py#L98 I added an addtional workflow output for deform_by as follows: wf.set_output_name("deform_by", scaling_op.outputs.field)

Finally, in method https://github.com/ansys/pydpf-core/blob/05399b10cd293c63020ea224d13d3b3dba1f11d4/src/ansys/dpf/core/animator.py#L98 I passed the parameter scale_factor with the following value: scale_factor[frame]