Envelope of accelerations in OpenseesMP with API
Posted: Tue Apr 18, 2023 1:25 pm
Dear STKO team,
I am trying to use Python API to visualize the envelope of minimum and maximum accelerations for each node of the mesh. I have followed the example of the Getting started Week 12 example, Utils 14 and 15 (load combination and envelope).
In my case I just want to get the envelope of the accelerations (it is a transient (seismic analysis)).
If I understand well, the basic code should be something like this:
Until line 23 "print(type(R1))" I don't get any errors, then for env_max I get the following error:
Is this a problem connected with the fact that I am using OpenSeesMP?
How can I modify the code to make it work?
Thank you very much
I am trying to use Python API to visualize the envelope of minimum and maximum accelerations for each node of the mesh. I have followed the example of the Getting started Week 12 example, Utils 14 and 15 (load combination and envelope).
In my case I just want to get the envelope of the accelerations (it is a transient (seismic analysis)).
If I understand well, the basic code should be something like this:
Code: Select all
from PyMpc import *
from PyMpc import MpcOdbVirtualResult as vr
App.clearTerminal()
doc = App.postDocument()
db = doc.getDatabase(1)
result_names = ['Acceleration']
result_labels = [
['Ax','Ay']]
R1 = db.getNodalResult(
'Acceleration (Volumes',
match=MpcOdb.StartsWith,
time=vr.stageEnd(3)
)
print(type(R1))
env_max = vr.max(R1)
env_min = vr.min(R1)
env_max.setDisplayName('(ENVmax) Acceleration')
env_max.setComponentLabels(['Ax','Ay'])
env_min.setDisplayName('(ENVmin) Acceleration')
env_min.setComponentLabels(['Ax','Ay'])
db.addVirtualResult(env_max)
db.addVirtualResult(env_min)Is this a problem connected with the fact that I am using OpenSeesMP?
How can I modify the code to make it work?
Thank you very much