Access to material properties

Post Reply
dudchenkoav
Posts: 47
Joined: Mon Feb 17, 2020 3:27 pm

Access to material properties

Post by dudchenkoav » Fri Jul 16, 2021 9:35 am

Hello STKO Team!

We started verification of material models for various concrete failure mechanisms. As a consequence, I would like to parameterise the computations in terms of material parameters. However, I have not found the way I can access the parameters of e.g. TC3D model using python and change them. Could you please give me a guide how it can be performed?

Best Regards,
Aleksandr

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

Re: Access to material properties

Post by STKO Team » Fri Jul 16, 2021 10:56 am

Ok, so if you send me a list of value that you want to parametrize I will create a Python script you can start working with

admin
Site Admin
Posts: 10
Joined: Mon Jun 10, 2019 7:48 am

Re: Access to material properties

Post by admin » Fri Jul 16, 2021 11:12 am

Dear Aleksandr,

If you are asking how to change the parameters of a Physical Property already created in the work Tree through your Python API here is a small example script.

If you already created an instance of a material, let's lay Concrete 02, you can define a function that will have the id of the property as an argument, plus all the attributes you wish to modify:

def makeConcrete02 (id,fpc,epsc0,fpcu,epsU,unload,ft,Ets):
p = doc.getPhysicalProperty(id)
p.XObject.getAttribute('fpc').quantityScalar.value = fpc
p.XObject.getAttribute('epsc0').real = epsc0
p.XObject.getAttribute('fpcu').quantityScalar.value = fpcu
p.XObject.getAttribute('epsU').real = epsU
p.XObject.getAttribute('lambda').real = unload
p.XObject.getAttribute('ft').quantityScalar.value = ft
p.XObject.getAttribute('Ets').quantityScalar.value = Ets
p.commitXObjectChanges()

Then you can define the appropriate input parameters, for example:

fpc = -35.0*MPa
epsc0 = -0.002
fpcu = 0.2*fpc
epsU = -0.01
unload = 0.1
ft = -0.14*fpc
Ets = ft/abs(epsc0)

And use your function.

makeConcrete02(1,fpc,epsc0,fpcu,epsU,unload,ft,Ets)

For DamageTC3D you can do the same. As you may have noticed different attributes have different types. To check the type of a specific attribute you can go into this folder on your computer:

C:\Program Files\STKO\external_solvers\opensees

And search for the python file related to the XObject of interest. For example, as you see in the image below, the young modulus is a quantityScalar, while the Compressive law shape parameters are QuantityScalar.
4.png
4.png (170.76 KiB) Viewed 7591 times
With this you can access the properties, the parametrization is a further step, I am sure Dr. Petracca can help you with that.
Let us know how it goes and enjoy your programming! :geek:

Francesca

dudchenkoav
Posts: 47
Joined: Mon Feb 17, 2020 3:27 pm

Re: Access to material properties

Post by dudchenkoav » Fri Jul 16, 2021 12:46 pm

Thank you for your answers!
I'll start working with that and I hope I will not disturb you too much.

Best Regards,
Aleksandr

KaushalPatel
Posts: 23
Joined: Thu Dec 21, 2023 3:17 pm

Re: Access to material properties

Post by KaushalPatel » Thu Dec 21, 2023 7:40 pm

Hi,

I am trying to use python script to define matrial properties for concrete 02. I am using the script provided in "week 5" of webinar "Get Started in OpenSees with STKO". The script is not able to update epso, epsU and lambda. All other parameteres are updating well as defined in the python script. Can you just look into that and inform me if I am doing anything wrong?

Thanks in advance.

kesavapraba
Posts: 468
Joined: Sat Mar 28, 2020 2:25 pm

Re: Access to material properties

Post by kesavapraba » Wed Dec 27, 2023 11:03 am

Hi, Kaushal. There was an incorrect usage of the attribute's type - Real instread quantityScale.value should be used for the attributes that you mentioned. Please always check the Type of the attribute before calling it.
Attachments
Screenshot 2023-12-27 120005.png
Screenshot 2023-12-27 120005.png (29.89 KiB) Viewed 5429 times
:: With best wishes ::
Prabakaran Kesavan

KaushalPatel
Posts: 23
Joined: Thu Dec 21, 2023 3:17 pm

Re: Access to material properties

Post by KaushalPatel » Wed Dec 27, 2023 4:26 pm

Your solution is working well, but the screenshot you attached is different from what appears in python code from week 5 of the webinar. May be, you need to update that python file as well.

Thank you.

kesavapraba
Posts: 468
Joined: Sat Mar 28, 2020 2:25 pm

Re: Access to material properties

Post by kesavapraba » Wed Dec 27, 2023 5:48 pm

Yes, the attached screenshot is meant for the demonstration purposes. Sure, we will update the script on the website. Thank you.
:: With best wishes ::
Prabakaran Kesavan

Post Reply