Display current time during analysis
Moderators: silvia, selimgunay, Moderators
Display current time during analysis
Is there a way to display the current time at every step of a transient analysis ; the test command only displays the current number of iterations for $pFlag=0 or 1.
-
- Posts: 913
- Joined: Mon Sep 09, 2013 8:50 pm
- Location: University of California, Berkeley
Re: Display current time during analysis
You can display the step number during the analyze command.
Re: Display current time during analysis
if you do the analysis inside a while or for loop you could spit out the time in the loop, i.e. if we look at basic example:
while {$ok == 0 && $tCurrent < $tFinal} {
set ok [analyze 1 .01]
# if the analysis fails try initial tangent iteration
if {$ok != 0} {
puts "regular newton failed .. lets try an initail stiffness for this step"
test NormDispIncr 1.0e-12 100 0
algorithm ModifiedNewton -initial
set ok [analyze 1 .01]
if {$ok == 0} {puts "that worked .. back to regular newton"}
test NormDispIncr 1.0e-12 10
algorithm Newton
}
set tCurrent [getTime]
puts "currentTime: $tCurrent]
}
while {$ok == 0 && $tCurrent < $tFinal} {
set ok [analyze 1 .01]
# if the analysis fails try initial tangent iteration
if {$ok != 0} {
puts "regular newton failed .. lets try an initail stiffness for this step"
test NormDispIncr 1.0e-12 100 0
algorithm ModifiedNewton -initial
set ok [analyze 1 .01]
if {$ok == 0} {puts "that worked .. back to regular newton"}
test NormDispIncr 1.0e-12 10
algorithm Newton
}
set tCurrent [getTime]
puts "currentTime: $tCurrent]
}
Re: Display current time during analysis
Thanks a lot Frank ! I will put analyze 1 in a for-loop together with getTime. Great.
Re: Display current time during analysis
This works great for all $pFlag options :
for .... {
set t [getTime]
puts -nonewline "Time $t "
set Ok[analyze 1]
}
for .... {
set t [getTime]
puts -nonewline "Time $t "
set Ok[analyze 1]
}