Coupled RC Core Wall with MVLEM-3D

STKO Team
Posts: 1811
Joined: Tue Oct 29, 2019 8:45 am

Re: Coupled RC Core Wall with MVLEM-3D

Post by STKO Team » Mon Jan 23, 2023 5:19 pm

We just released it. Try it now

kolozvari
Posts: 128
Joined: Tue Oct 05, 2021 9:22 pm

Re: Coupled RC Core Wall with MVLEM-3D

Post by kolozvari » Mon Jan 23, 2023 8:41 pm

It works now. Thank you!

I am trying to use your latest extract_data_from_selection file to modify it to extract data from selection sets.

Can you please give me a bit more details what should I do with the code below? Should I replace something with this code or add it somewhere?
App.clearTerminal()
doc = App.postDocument()
db = doc.getDatabase(1)
ssets = db.selectionSets
for sset_id, sset in ssets.items():
print('\nSelection Set {}'.format(sset_id))
print(sset.id)
print(sset.name)
print(sset.nodes)
print(sset.elements)
I would really appreciate if you can point me in the right direction.

Thank you very much

STKO Team
Posts: 1811
Joined: Tue Oct 29, 2019 8:45 am

Re: Coupled RC Core Wall with MVLEM-3D

Post by STKO Team » Tue Jan 24, 2023 2:33 pm

Try this:
extract_data_from_selection_sets.zip
(3.4 KiB) Downloaded 6 times

kolozvari
Posts: 128
Joined: Tue Oct 05, 2021 9:22 pm

Re: Coupled RC Core Wall with MVLEM-3D

Post by kolozvari » Tue Jan 24, 2023 5:41 pm

Thank you for sending the file. It does extract selection set results. However, I would like to make modifications to the file so I can create a loop and extract many selection sets with a single click. It seems that the only way to run the file is using STKO. Running them from Python gives me an error. How can I make changes to the file and debug it? Currently I dont see an option for testing and debugging the API files.

Please let me know. Thank you.

STKO Team
Posts: 1811
Joined: Tue Oct 29, 2019 8:45 am

Re: Coupled RC Core Wall with MVLEM-3D

Post by STKO Team » Tue Jan 24, 2023 6:05 pm

If you want you can edit the file with whatever editor you want outside of STKO.
But you need to run it in STKO, because it adds extensions to the standard python

kolozvari
Posts: 128
Joined: Tue Oct 05, 2021 9:22 pm

Re: Coupled RC Core Wall with MVLEM-3D

Post by kolozvari » Tue Jan 24, 2023 6:08 pm

Yes, I understand that. But how do you debug it? For example, if I want to print out some variables on the screen, it seems that I cannot see this when I run STKO because there is no command window where things can be printed out...

Please advise. Thank you.

STKO Team
Posts: 1811
Joined: Tue Oct 29, 2019 8:45 am

Re: Coupled RC Core Wall with MVLEM-3D

Post by STKO Team » Wed Jan 25, 2023 7:54 am

You can print to the STKO's terminal. Inside the STKO's environment, the Python's print is redirected to the std::cout, and thus to the terminal
terminal.png
terminal.png (135.38 KiB) Viewed 613 times

Code: Select all

from PyMpc import *

# This clears the STKO's terminal
App.clearTerminal()

# this prints to the STKO's terminal using the
# 'standard' formatting (black color)
print("Hello from python print")

# same as above, but you need to explicitly put a newline
IO.write_cout("Hello from python PyMpc.IO.write_cout\n")

# ... or using the 'log' format (blue color)
IO.write_clog("Hello from python PyMpc.IO.write_clog\n")

# ... or using the 'err' format (red color)
IO.write_cerr("Hello from python PyMpc.IO.write_cerr\n")

kolozvari
Posts: 128
Joined: Tue Oct 05, 2021 9:22 pm

Re: Coupled RC Core Wall with MVLEM-3D

Post by kolozvari » Tue Jan 31, 2023 6:11 pm

Hello,

I am using API to process element responses. I modified your API to create a loop and everything works fine for nodal results. However, when I process element results I have an issue. Per your recommendation, I created a separate region and MPCO recorder for coupling beams only. I also have a selection set that includes coupling beams, and I used BeamWithShearHinge element for coupling beams. When I select "strain" response and run API, I get the following error "data not available for element XXX". It seems to me that API is trying to access strain for the BeamWithShearHinge, but because this is really a compound element of elastic beams and a shear hinge, it is trying to get strain from the elastic beam, which doesnt exist. This is what I think is happening, but I am not sure. Can you please advise how to go about this issue? I only need strains and stresses from the shear hinge.

Please let me know. Thank you,

STKO Team
Posts: 1811
Joined: Tue Oct 29, 2019 8:45 am

Re: Coupled RC Core Wall with MVLEM-3D

Post by STKO Team » Wed Feb 01, 2023 9:04 am

It seems to me that API is trying to access strain for the BeamWithShearHinge, but because this is really a compound element of elastic beams and a shear hinge, it is trying to get strain from the elastic beam, which doesn't exist. This is what I think is happening, but I am not sure. Can you please advise how to go about this issue? I only need strains and stresses from the shear hinge.
You're right. The SelectionSet in the post-processor corresponds to the selection set in the STKO pre-processor (i.e. before the compound elements are created, during the WriteTcl command).

I made a simple change in the previous script:
  1. I put the field[row] command in a try/except block, so that it will not generate an Exception if a result is not available in a certain element
  2. I modified the way I get the elements from the selection set.
    First, I look for elements, not included in the selection set, but sharing all nodes with a selection set. If those elements are found, we ask you to choose among these options:
    • Consider only elements in the original selection set
    • Consider only elements embedded into the original set (this is what you want)
    • Consider both
Let us know
Attachments
extract_data_from_selection_sets.zip
(3.81 KiB) Downloaded 3 times

kolozvari
Posts: 128
Joined: Tue Oct 05, 2021 9:22 pm

Re: Coupled RC Core Wall with MVLEM-3D

Post by kolozvari » Wed Feb 01, 2023 5:04 pm

Thank you for your quick response. I tried running your script, but the results come out blank.

You can download the results and the extracted data from the link below so you can test it your self. Names of selection sets with coupling beams start with "CB".

https://www.dropbox.com/s/2g2jxgv424xn6 ... T.zip?dl=0

Please let me know if you find anything.

Thank you

Post Reply