sewkokot / opsvis

OpenSeesPy postprocessing and plotting module
GNU General Public License v3.0
35 stars 21 forks source link

Problem when plotting the supports #17

Open CYZ-sudo opened 2 years ago

CYZ-sudo commented 2 years ago

Hi,

I tried to use 'plot_supports_and_loads_2d()' and I got this problem when I ran the example 2d Portal Frame from https://opsvis.readthedocs.io/en/latest/ex_2d_portal_frame.html. Here is the comparison of the fig from opsvis’s documentation and my result. comparison The support at the left bottom should be a square (see the green arrows). I think the problem is caused by the following lines. https://github.com/sewkokot/opsvis/blob/5a830ec1c58aec803ff0a0515013ad318eb69244/docs/src/opsvis/opsvis.py#L3828-L3839 In this case, 'ndim' is 2 so both fixed and pinned nodes will be the triangle. I think these lines can't fit the needs of both 1 and 2 dimension cases correctly. It will be helpful if you can rewrite this part (or activate 'alternative plot of supports'). Thanks!

firai commented 2 years ago

As mentioned, the issue seems to be that plot_supports_and_loads_2d() used the number of dimensions (ndim), which by definition is 2 for 2D, in the code attempting to determine whether rotationally-restrained supports are possible. I assume that the code meant to check if the number of DOFs per node is less than 3 to see if rotation DOFs exist. I have added PR https://github.com/sewkokot/opsvis/pull/18 to fix this check, which seems to fix the issue described above. @sewkokot, can you please review/accept/revise the PR as appropriate?

As a side note, it seems like the only point of calculating ndim in plot_supports_and_loads_2d() would be to raise an error if it's actually a 3D model. However, the rest of the code does not raise any errors, so I haven't tried to fix the sanity check in this PR.