u-anurag / vfo-docs

Documentation for vfo (Visualization for OpenSees)
https://vfo.readthedocs.io
1 stars 1 forks source link

Problem vfo.plot_deformedshape #1

Closed LuisVelasc closed 1 year ago

LuisVelasc commented 1 year ago

Hi I encountered a problem when I try to use the vfo.plot_deformedshape command. The following error is shown to me when trying to visualize the deformed shape of a truss. Could you help me with this?

WARNING:root:Encountered issue in callback (most recent call last): File "C:\Users\fable\anaconda3\lib\site-packages\vfo\vfo.py", line 627, in _get_deformed_mesh DeflectedNodeCoordArray = nodeArray[:,1:]+ scale*displacement_nodeArray[jj,:,:] ValueError: operands could not be broadcast together with shapes (12,3) (12,2)

u-anurag commented 1 year ago

Do you have a 2D model? If possible, could you share the content of the "_ODB" folder on Dropbox or Google Drive?

LuisVelasc commented 1 year ago

Thank you very much for your prompt reply. Yes, it is a 2D model. I share with you the link of the drive where I uploaded the ODB: https://drive.google.com/drive/folders/1GDjBokPtEd6s2T26uNEJe6ycxFc1cw1M?usp=sharing

The commands I use in the model are these: vfo.createODB(model="Armadura",loadcase="Estatico") After wipe()... vfo.plot_deformedshape(model="Armadura",loadcase="Estatico",scale=10.0, overlap='yes')

u-anurag commented 1 year ago

I know where the problem is. I'll fix it by tomorrow. Thank you for sharing the data.

LuisVelasc commented 1 year ago

You are amazing! Thank you so much! :D

u-anurag commented 1 year ago

@LuisVelasc I couldn't get to it over the weekend because of work deadlines. Will work on it today.

u-anurag commented 1 year ago

I have fixed the issue and updated the package to version 0.0.10. You should upgrade the the latest version using following command,

python -m pip install --upgrade vfo

Here is the output for the following command,

vfo.plot_deformedshape(model="Armadura",loadcase="Estatico",scale=50.0, contour="y", line_width=5)

You can use the slider to see the deformed shape at any step.

image
u-anurag commented 1 year ago

@LuisVelasc, Here is the output for the animate_deformedshape() command,

vfo.animate_deformedshape(model="Armadura",loadcase="Estatico",scale=50.0, contour="y", line_width=5, gifname="Armadura_Estatico")

Armadura_Estatico

u-anurag commented 1 year ago

Since there is no response, I assume this issue if fixed now.