ansys / ansys/pymapdl-reader

Getting the limit values from color bar in animate_nodal_displacement

Open
#133 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
60
Forks
32
Avg merge
5h 50m
Merged PRs (30d)
8

Description

Hello,
I am trying to automate postprocessing of **cyclic model**. I stumbled into following problems:
1) I would like to animate multiple mode shapes, one after another, but each requires different `displacement_factor`. Can I somehow get the maximum on the colorbar so I could use that value as basis for parametric displacement factor?
2) Some of my models are not modelled in CSYS=1. Is there some way to select CSYS when importing the model?
3) How can I get for the plot the cpos values? I tried `return_cpos=True` but am getting an error: _TypeError: "return_cpos" is an invalid keyword argument for `add_mesh`_.

Example of my code:
```
from ansys.mapdl import reader as pymapdl_reader
example_path = 'C:/Users/212421348/Documents/modal.rst'
rst = pymapdl_reader.read_binary(example_path)

rst.plot(background="w",show_edges=False)

rst.plot_nodal_solution((1, 1), comp='norm', stitle='USUM',
background="w",show_edges=False, cmap='turbo',
text_color="k")

for i in range(0,int(rst.harmonic_indices.shape[0]/2)):
step = 1
substep = 2*i+1
mode = i+1
rst.nodal_solution((2, 1))
_ = rst.animate_nodal_displacement((step, substep), displacement_factor=0.25,text_color="k", cmap='turbo',
n_frames=30, show_axes=True, background='w', stitle='Mode {0}'.format(mode),
loop=False, add_text=False,
movie_filename='EO{0}_Mode{1}.gif'.format(step,mode))
```

Contributor guide

Open the contributing guide

Research direction

Start with the public rst.plot, rst.plot_nodal_solution, rst.nodal_solution, and rst.animate_nodal_displacement entry points used in the example. Reproduce the three reported questions with the cyclic model workflow and inspect how displacement limits, CSYS selection, and camera positions are currently handled. Done means the requested values or supported behavior are documented and the example no longer encounters the reported cpos error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.