Hello,
I am new to opensees and am converting some existing code from tcl to python. I am struggling with converting the following element recorder:
recorder Element -file $DataDir/StrainT.out -ele 1 section fiber -10.75 0. stressStrain
What I currently have is:
recorder('Element', '-file', DataDir+'/StrainT.out','-closeOnWrite', '-ele',1, *['section',1, 'fiber',[-10.75,0], 'stressStrain'])
I am getting stress-strain values, but they are incorrect. I suspect it is something to do with defining the coordinates (-10.75,0) because changing the numbers does not change the results.
Does anyone know what I am doing wrong?
Thanks
Python Element recorder
Moderators: silvia, selimgunay, Moderators
-
- Posts: 913
- Joined: Mon Sep 09, 2013 8:50 pm
- Location: University of California, Berkeley
Re: Python Element recorder
You might be defining your section incorrectly. I would use an elasticmaterial and check against analytical results (leT's say using sigma=My/I)
-
- Posts: 1
- Joined: Sat Jul 13, 2019 7:25 pm
- Location: NC State University
Re: Python Element recorder
I am having a similar problem for stressStrain recorder in openseespy.
Here is what I did:
I downloaded both .tcl and .py examples of the pushover analysis of RC Frame from the respective websites. I added two lines of code in each example to record the stress-strain values at two different fibers. The same two fibers were used in both .tcl and .py versions of code.
.tcl additional lines of code:
recorder Element -file stress1.out -time -ele 1 section 1 fiber [expr $y1-$cover] [expr $z1-$cover] stressStrain
recorder Element -file stress2.out -time -ele 1 section 1 fiber [expr $cover-$y1] [expr $z1-$cover] stressStrain
.py additional lines of code:
recorder('Element', '-file', 'stress1.out', '-time', '-ele', *[1], *['section', 1, 'fiber', [y1 - cover, z1 - cover], 'stressStrain'])
recorder('Element', '-file', 'stress2.out', '-time', '-ele', *[1], *['section', 1, 'fiber', [cover - y1, z1 - cover], 'stressStrain'])
Note that the fibers I picked are on either side of the neutral axis and hence I expected one to be in tension while other in compression. .tcl version gave me meaningful results. However, .py version gives me the same numbers regardless of what fiber I choose. The numbers are also not consistent with the .tcl output. Is this a problem with the recorder object in openseespy?
Also note that the forces and deformations of the element from both versions match exactly.
Here is what I did:
I downloaded both .tcl and .py examples of the pushover analysis of RC Frame from the respective websites. I added two lines of code in each example to record the stress-strain values at two different fibers. The same two fibers were used in both .tcl and .py versions of code.
.tcl additional lines of code:
recorder Element -file stress1.out -time -ele 1 section 1 fiber [expr $y1-$cover] [expr $z1-$cover] stressStrain
recorder Element -file stress2.out -time -ele 1 section 1 fiber [expr $cover-$y1] [expr $z1-$cover] stressStrain
.py additional lines of code:
recorder('Element', '-file', 'stress1.out', '-time', '-ele', *[1], *['section', 1, 'fiber', [y1 - cover, z1 - cover], 'stressStrain'])
recorder('Element', '-file', 'stress2.out', '-time', '-ele', *[1], *['section', 1, 'fiber', [cover - y1, z1 - cover], 'stressStrain'])
Note that the fibers I picked are on either side of the neutral axis and hence I expected one to be in tension while other in compression. .tcl version gave me meaningful results. However, .py version gives me the same numbers regardless of what fiber I choose. The numbers are also not consistent with the .tcl output. Is this a problem with the recorder object in openseespy?
Also note that the forces and deformations of the element from both versions match exactly.