Requesting a tracer in OpenSees

A forum dedicated to feature requests and the future direction of OpenSees, i.e. what would you like, what do you need, what should we explore

Moderators: silvia, selimgunay, Moderators

Post Reply
oleviuqserh
Posts: 65
Joined: Mon Oct 04, 2010 6:24 pm
Location: Colombia

Requesting a tracer in OpenSees

Post by oleviuqserh » Sun Jan 30, 2011 6:19 am

Dear Frank. It would be very useful if a tracer is implemented in OpenSees. By a tracer I am meaning a recorder-like to trace some parameters (i.e. the last committed data, LCD) as the analysis progresses to perform some operations in real time. For example, a few days ago I posted a thread on how to trace the most outer compression fiber of a section to determine its nominal moment. The idea of the script is to trace the strain of such compression fiber till it is less than -0.003. When the analysis reaches this point, it should stop and then be able to get the nominal moment from the output data which in this case is the last committed time (since the analysis is using a displacement control in dof-3 and a reference moment of 1). To fit my needs, I was thinking of building two commands. One of them would be responsible of defining the tracer and the other one to let us get the last committed data at any time. I mean,

To build a node tracer (behaves more like a node recorder):
tracer $tracerTag -type Node <-time> -node $nodeTag -dof ($dof1 $dof2 ...) $respType

To build an element tracer (behaves more like an element recorder):
tracer $tracerTag -type Element <-time> -ele $eleTag $arg1 $arg2 ...

To get the last committed data from $tracerTag:
getLCD $tracerTag


In context,

-----------------------------------
# Basic Units: [Length] = [m], and [Force] = [kN].

wipe

model basic -ndm 2 -ndf 3

node 1 0. 0.
node 2 0. 0.

fix 1 1 1 1
fix 2 0 1 0

uniaxialMaterial Steel01 1420 420000. 200.e6 0.01
uniaxialMaterial Concrete04 2070 -70000. -0.00211 -0.00422 [expr 5.e6*sqrt(70.)]

section Fiber 101 {
patch quad 2070 120 1 0.600 0.600 -0.600 0.600 -0.600 -0.600 0.600 -0.600

layer straight 1420 2 [expr 11*387.e-6] 0.533 0.000 -0.533 0.000
layer straight 1420 9 [expr 2*387.e-6] 0.426 0.000 -0.426 0.000
}

element zeroLengthSection 12 1 2 101

set axialLoad -32000.; # Probable axial load (1.00D + 0.25L).

pattern Plain 10 Linear {load 2 $axialLoad 0. 0.}

constraints Plain
numberer Plain
system BandGeneral
test NormDispIncr 1.e-8 25
set algorithmByDefault ModifiedNewton
algorithm $algorithmByDefault
integrator LoadControl 0.10
analysis Static

analyze 10
loadConst -time 0.

pattern Plain 20 Linear {load 2 0. 0. 1.}

integrator DisplacementControl 2 3 0.0001

tracer 100 -type Element -time -ele 12 section fiber 100. 0. 2070 stressStrain; # 3 columns: time-stress-strain
tracer 101 -type Element -time -ele 12 section fiber -100. 0. 1420 stressStrain; # 3 columns: time-stress-strain

set ok 0
while {$ok==0} {
set ok [analyze 1]

if {$ok != 0} {
algorithm Newton
set ok [analyze 1]
algorithm $algorithmByDefault
}

if {$ok != 0} {
algorithm NewtonLineSearch 0.8
set ok [analyze 1]
algorithm $algorithmByDefault
}

if {$ok != 0} {
algorithm Broyden 8
set ok [analyze 1]
algorithm $algorithmByDefault
}

set epsc [lindex [getLCD 100] 2]; # getting concrete strain from third column.

if {$epsc <= -0.003} {
set epss [lindex [getLCD 101] 2]; # getting steel strain from third column.
set Mn [lindex [getLCD 100] 0]; # getting nominal moment from first column.

break
}
}

if {$epsc <= -0.003} {
if {$epss <= 0.002} {
set phi 0.65
} elseif {$epss >= 0.005} {
set phi 0.90
} else {
set phi [expr 83.333*($epss-0.002)+0.65]
}

puts "Ppr = $axialLoad"
puts "epsc = $epsc"
puts "epss = $epss"
puts "Mn = $Mn"
puts "phi = $phi"
puts "phiMn = [expr $phi*$Mn]"
} else {
puts "OpenSees got convergence problems."
}
-----------------------------------



Please, let me know if this concept is relevant enough to meet the future OpenSees goals...

Thank you.

fmk
Site Admin
Posts: 5883
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Requesting a tracer in OpenSees

Post by fmk » Mon Jan 31, 2011 5:52 pm

you can use eleResponse now .. tracer objects as you describe would be more efficient.

fmk
Site Admin
Posts: 5883
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Requesting a tracer in OpenSees

Post by fmk » Wed Feb 01, 2012 4:47 pm

can you post a link to the example .. you can of course do this with the eleResponse command .. an alternative would be to use the existing recorder command and add a new handler (place where recorder output goes) that the user could query from the script.

oleviuqserh
Posts: 65
Joined: Mon Oct 04, 2010 6:24 pm
Location: Colombia

Re: Requesting a tracer in OpenSees

Post by oleviuqserh » Tue Feb 07, 2012 8:41 am

Dear Frank McKenna,

Thank you very much to stay tuned in this subject. Should I assume you are working in the implementation of this feature currently? As of your request, there is not such a link. The example I propose here for this feature is explained above (first post). The another example that I reference externally was solved nicely using eleResponse command, though.

"an alternative would be to use the existing recorder command and add a new handler (place where recorder output goes) that the user could query from the script.". Would you explain me in more detail that another alternative? Perhaps, by giving me an example?

Thank you.

fmk
Site Admin
Posts: 5883
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Requesting a tracer in OpenSees

Post by fmk » Thu Feb 09, 2012 11:00 am

i am not working on it .. i have added it to my list .. there are other things that are missing from the code that there is no work around for .. for this, there is the workaround using eleResponse .. and you could make look it like you have in the script using tcl procedures.

wuhaoshrek
Posts: 122
Joined: Tue Oct 28, 2008 4:01 am

Re: Requesting a tracer in OpenSees

Post by wuhaoshrek » Wed Jan 09, 2013 12:28 pm

oleviuqserh wrote:
> Dear Frank. It would be very useful if a tracer is implemented in OpenSees. By a
> tracer I am meaning a recorder-like to trace some parameters (i.e. the last committed
> data, LCD) as the analysis progresses to perform some operations in real time. For
> example, a few days ago I posted a thread on how to trace the most outer compression
> fiber of a section to determine its nominal moment. The idea of the script is to
> trace the strain of such compression fiber till it is less than -0.003. When the
> analysis reaches this point, it should stop and then be able to get the nominal
> moment from the output data which in this case is the last committed time (since the
> analysis is using a displacement control in dof-3 and a reference moment of 1). To
> fit my needs, I was thinking of building two commands. One of them would be
> responsible of defining the tracer and the other one to let us get the last committed
> data at any time. I mean,
>
> To build a node tracer (behaves more like a node recorder):
> tracer $tracerTag -type Node <-time> -node $nodeTag -dof ($dof1 $dof2 ...)
> $respType
>
> To build an element tracer (behaves more like an element recorder):
> tracer $tracerTag -type Element <-time> -ele $eleTag $arg1 $arg2 ...
>
> To get the last committed data from $tracerTag:
> getLCD $tracerTag
>
>
> In context,
>
> -----------------------------------
> # Basic Units: [Length] = [m], and [Force] = [kN].
>
> wipe
>
> model basic -ndm 2 -ndf 3
>
> node 1 0. 0.
> node 2 0. 0.
>
> fix 1 1 1 1
> fix 2 0 1 0
>
> uniaxialMaterial Steel01 1420 420000. 200.e6 0.01
> uniaxialMaterial Concrete04 2070 -70000. -0.00211 -0.00422 [expr 5.e6*sqrt(70.)]
>
> section Fiber 101 {
> patch quad 2070 120 1 0.600 0.600 -0.600 0.600 -0.600 -0.600 0.600 -0.600
>
> layer straight 1420 2 [expr 11*387.e-6] 0.533 0.000 -0.533 0.000
> layer straight 1420 9 [expr 2*387.e-6] 0.426 0.000 -0.426 0.000
> }
>
> element zeroLengthSection 12 1 2 101
>
> set axialLoad -32000.; # Probable axial load (1.00D + 0.25L).
>
> pattern Plain 10 Linear {load 2 $axialLoad 0. 0.}
>
> constraints Plain
> numberer Plain
> system BandGeneral
> test NormDispIncr 1.e-8 25
> set algorithmByDefault ModifiedNewton
> algorithm $algorithmByDefault
> integrator LoadControl 0.10
> analysis Static
>
> analyze 10
> loadConst -time 0.
>
> pattern Plain 20 Linear {load 2 0. 0. 1.}
>
> integrator DisplacementControl 2 3 0.0001
>
> tracer 100 -type Element -time -ele 12 section fiber 100. 0. 2070 stressStrain; # 3
> columns: time-stress-strain
> tracer 101 -type Element -time -ele 12 section fiber -100. 0. 1420 stressStrain; # 3
> columns: time-stress-strain
>
> set ok 0
> while {$ok==0} {
> set ok [analyze 1]
>
> if {$ok != 0} {
> algorithm Newton
> set ok [analyze 1]
> algorithm $algorithmByDefault
> }
>
> if {$ok != 0} {
> algorithm NewtonLineSearch 0.8
> set ok [analyze 1]
> algorithm $algorithmByDefault
> }
>
> if {$ok != 0} {
> algorithm Broyden 8
> set ok [analyze 1]
> algorithm $algorithmByDefault
> }
>
> set epsc [lindex [getLCD 100] 2]; # getting concrete strain from third column.
>
> if {$epsc <= -0.003} {
> set epss [lindex [getLCD 101] 2]; # getting steel strain from third column.
> set Mn [lindex [getLCD 100] 0]; # getting nominal moment from first column.
>
> break
> }
> }
>
> if {$epsc <= -0.003} {
> if {$epss <= 0.002} {
> set phi 0.65
> } elseif {$epss >= 0.005} {
> set phi 0.90
> } else {
> set phi [expr 83.333*($epss-0.002)+0.65]
> }
>
> puts "Ppr = $axialLoad"
> puts "epsc = $epsc"
> puts "epss = $epss"
> puts "Mn = $Mn"
> puts "phi = $phi"
> puts "phiMn = [expr $phi*$Mn]"
> } else {
> puts "OpenSees got convergence problems."
> }
> -----------------------------------
>
>
>
> Please, let me know if this concept is relevant enough to meet the future OpenSees
> goals...
>
> Thank you.


It is just a concept or idea that you wanna be implemented in OpenSees in future, right?
You didn't code it into the handler in OpenSees, did you?

I used to post-process the data and find the exact time I needed in the problem and calculate
the outcome by hand, obviously your idea is much handy.

Thanks.

oleviuqserh
Posts: 65
Joined: Mon Oct 04, 2010 6:24 pm
Location: Colombia

Re: Requesting a tracer in OpenSees

Post by oleviuqserh » Sun Jan 13, 2013 6:53 pm

wuhaoshrek,

Since I am not an OpenSees developer, this feature should be taken as a concept. However, as Frank explains above, a workaround with eleResponse command may solve the problem.

Post Reply