max step number in a simulation

Forum for OpenSees users to post questions, comments, etc. on the use of the OpenSees interpreter, OpenSees.exe

Moderators: silvia, selimgunay, Moderators

Post Reply
dgale
Posts: 55
Joined: Fri Jan 15, 2016 4:01 am
Location: UPM

max step number in a simulation

Post by dgale » Wed Jul 11, 2018 8:52 am

Hello,
I would like to know how many steps the ground motion has, when I use the script bellow. I mean, I have a file with the ground motion acceleratons but when I introduce it to OpenSees by "set AccelSeries " Series -dt $dt -filePath $outFile -factor $GMfatt" " I would like to know the vector size. This way, I will be able to indicate the maximum time of the earthquake.

# Bidirectional Uniform Earthquake ground motion (uniform acceleration input at all support nodes)
set Earthquakes Earthquakes
set iGMdirection "1 2"; # ground-motion direction
set iGMfact "1.0 1.0"; # ground-motion scaling factor
set dt 0.005

set IDloadTag 400; # for uniformSupport excitation
foreach GMdirection $iGMdirection GMfile $iGMfile GMfact $iGMfact {
incr IDloadTag;
# set inFile $Earthquakes/$GMfile.at2
set outFile $Earthquakes/$GMfile.txt; # set variable holding new filename (PEER files have .at2/dt2 extension)
# ReadSMDFile $inFile $outFile dt; # call procedure to convert the ground-motion file
set GMfatt [expr $g*$GMfact]; # data in input file is in g Unifts -- ACCELERATION TH
set AccelSeries "Series -dt $dt -filePath $outFile -factor $GMfatt"; # time series information <----------------------------------------- I guess that it is in somewhere from here
pattern UniformExcitation $IDloadTag $GMdirection -accel $AccelSeries ; # create Unifform excitation
}

Thanks a lot!
David

apapaso
Posts: 17
Joined: Sun Mar 19, 2017 1:19 am
Location: AUTh - Greece

Re: max step number in a simulation

Post by apapaso » Wed Jul 11, 2018 11:10 am

Hi, I do this by counting the records in the acceleration data file with the following four lines:

set fp [open $THFileName r]
set THData [split [read $fp] "\n"]
set StepN [llength $THData]
close $fp

$THFileName is the file with the acceleration history records
$StepN is the number of records in the acceleration history file.

dgale
Posts: 55
Joined: Fri Jan 15, 2016 4:01 am
Location: UPM

Re: max step number in a simulation

Post by dgale » Mon Jul 16, 2018 5:02 am

Thanks!

Post Reply