Model construction with Python API
Model construction with Python API
Dear STKO team,
I'm trying to model a soil domain which is formed by a soil deposit (of 2 layer) on top of a bedrock layer, I attach the draw below.
1. I built the geometry of the 2D model with Python API but i have some problems creating the second layer in my soil deposit. Below i've attached the Python script.
2. I also need to generate some codes (using Python API) to implement the physical properties by specifying various geotechincal parameters to be assigned, how can i do?
For example I have to assign a velocity trend that varies with depth within each layer, is it possible?
Thank you very much!!
Fabiola
I'm trying to model a soil domain which is formed by a soil deposit (of 2 layer) on top of a bedrock layer, I attach the draw below.
1. I built the geometry of the 2D model with Python API but i have some problems creating the second layer in my soil deposit. Below i've attached the Python script.
2. I also need to generate some codes (using Python API) to implement the physical properties by specifying various geotechincal parameters to be assigned, how can i do?
For example I have to assign a velocity trend that varies with depth within each layer, is it possible?
Thank you very much!!
Fabiola
- Attachments
-
- Stko forum.jpg (45.52 KiB) Viewed 3978 times
-
- Geometria deposito monostrato_asimmetrico.rar
- (2.47 KiB) Downloaded 169 times
Re: Model construction with Python API
Before going ahead with the property assignment, have a look at this modified version of your script:
It's a bit cleaner. It builds the grid lines and then uses them to create the planar faces. In your previous script there was some mistake and some faces were invalid.
Check it and let us know if it works as intended.
Also there is a note at line 75. Please have a look
Check it and let us know if it works as intended.
Also there is a note at line 75. Please have a look
Re: Model construction with Python API
Thank you so much for your help!
I checked the script and it runs very well. Now i'm trying to automate the process of implementing the properties and building the mesh in python. The focus of my work is to develop an automated python code to create the model. I tried to assign the properties directly on stko and then i tried to extract the input files, but i think it's not the right way, Can I have your help for this step?
Thank you again
I checked the script and it runs very well. Now i'm trying to automate the process of implementing the properties and building the mesh in python. The focus of my work is to develop an automated python code to create the model. I tried to assign the properties directly on stko and then i tried to extract the input files, but i think it's not the right way, Can I have your help for this step?
Thank you again
Re: Model construction with Python API
Could you please assign some properties to the model generated by the script, and share it here?
I will show you how to do it in Python.
I will show you how to do it in Python.
Re: Model construction with Python API
Yes sure, Thank you so much!!!
- Attachments
-
- MakeGeometry.rar
- (9.44 MiB) Downloaded 206 times
Re: Model construction with Python API
Ok, let's do it one step at a time.
In this script you will see how to:
In this script you will see how to:
- Create a physical property (Soil Material)
- Assign it to some faces of the geometry
Re: Model construction with Python API
Hi team,
Following your directions I've tried to assign the bedrock the same physical properties but I'm having some difficulty. I attach the model below.
I also have other questions:
1. How can I generate a second layer with variable y (for example also y=0) inside the basin using Python API?
2. How can I create a mesh using Python API?
Thanks for your help.
Following your directions I've tried to assign the bedrock the same physical properties but I'm having some difficulty. I attach the model below.
I also have other questions:
1. How can I generate a second layer with variable y (for example also y=0) inside the basin using Python API?
2. How can I create a mesh using Python API?
Thanks for your help.
- Attachments
-
- MakeGeometry.rar
- (2.37 KiB) Downloaded 175 times
Re: Model construction with Python API
There were some mistakes in the logic for assignment of the bedrock material
Re: Model construction with Python API
Hello team,
thanks for your advice!!! I'm here again to ask for your help!
The starting file, this time, is the one updated by my teacher, I attach it below. The next step is to create a routine to define and assign element properties. I hope for your help!
Thank you so much
thanks for your advice!!! I'm here again to ask for your help!
The starting file, this time, is the one updated by my teacher, I attach it below. The next step is to create a routine to define and assign element properties. I hope for your help!
Thank you so much
- Attachments
-
- MakeGeometry - MUz - N layers v02.rar
- (2.92 KiB) Downloaded 174 times
Re: Model construction with Python API
Here it is:
It follows the same steps as the physical properties.
You just have to figure out what attribute you want to change, and what Type it is (i.e. Real, Integer, QuantityScalar, etc...).
You can do it by looking at the associated python file (in your case the quadUP.py in C:\Program Files\STKO\external_solvers\opensees\element_properties\up_elements)
You just have to figure out what attribute you want to change, and what Type it is (i.e. Real, Integer, QuantityScalar, etc...).
You can do it by looking at the associated python file (in your case the quadUP.py in C:\Program Files\STKO\external_solvers\opensees\element_properties\up_elements)