u-anurag / OpenSeesPy

OpenSeesPy-Visualization: This branch is to work on Plotting commands to Python-based visualization of OpenSees models.
https://openseespydoc.readthedocs.io/en/latest/src/Plotting_Development_Guide.html
5 stars 2 forks source link

Plot and Animate Deformed shape for cyclic loads #81

Open cslotboom opened 4 years ago

cslotboom commented 4 years ago

I'm fairly using time, instead of time step, will break plot_deformedshape and animate_deformedshape in a cyclic pushover.

Consider the following code.

jj = (np.abs(timeSteps - tstep)).argmin()           # index closest to the time step requested.
if timeSteps[-1] < tstep:
    print("XX Warining: Time-Step has exceeded maximum analysis time step XX")
printLine = "Deformation at time: " + str(round(timeSteps[jj], 2))

In a cyclic pushover, you might have more than one time step that equals the target time, and it's not clear what time step to plot. image

Similar problems occur for the slider in the animation functions.

image

A solution would be to plot a time step, not a time. I'm not sure there is a way we can make the function work for both time values, and time steps...

u-anurag commented 4 years ago

One idea would be to introduce a switch pushover = "yes" that will ignore plotting based on the time-step in plot_deformedshape(). In that case, the tstep could be used to input the step number of the pushover analysis (similar to SAP2000 or Etabs pushover curve).

Another option could be provide a user input for 'control_node' and 'control_disp' to plot the pushover/cyclic deformed shape. This aligns with the philosophy of pushover/cyclic displacement controlled analysis. This will provide an easy way to investigate the deformation at the peaks of the cyclic analysis.

I like the first option since it is easy to implement. What do yo think? In my opinion, users are better off using the animate_deformedshape() function for pushover and cyclic analyses. The animation is quicker in these two cases since they have fewer data points as compared to dynamic analysis.

cslotboom commented 4 years ago

Yes, a switch could work, that's a good idea. We'll end up with quite a few functions to manage, but that can be handled. I'll try to implement this.

With option 2, would we not run into similar issues if multiple displacements have the same displacements?

One thing that I think would make sense is if we change the animations from functions to classes. Right now we use global variables which is kind of awkward. Changing these functions to classes will help us. especially if we are adding more functions

u-anurag commented 4 years ago

Introducing classes is a good idea. I started adding functions as I created them for my own use. I had no idea if people would be interested in expanding it. Let's chalk-up some ideas of code management. Do not jump on it right away.