Hi dear all,
I'm working on a project in Opensees. As I'm not used to work with the software
I have a maybe easy question concerning a small 2D-Frame under different earthquake
accelerations.
Is there any possibility to built in a "loop" for outputting the different time histories
(acceleraion on y-Axis and time on x-Axis) for several hundred of earthquake files?
I would like to get Opensees loading the earhquake-files itself instead of changing the
name of the files manually.
The files I have are dot acc files which I can open with a normal editor.
Thank you very much,
Cedric
loop for changing earthquake files?
Moderators: silvia, selimgunay, Moderators
Re: loop for changing earthquake files?
Code: Select all
set gmFilenames "file1.txt file2.txt ... "
foreach gmFile $gmFilenames {
# analyze for $gmFile
}
Re: loop for changing earthquake files?
Something else you can try is using tcl's procs. It would look something like:
Then assuming your ground motion files are sequentially numbered in a way such as groundmotion1.acc, groundmotion2.acc, groundmotion3.acc, etc you would modify your time history code that points to a single file in the following way:
and also then add the following block at the end of your code after the proc close bracket:
Hope this helps, I choose to define $all_gms as a list so that if you want to come back and say run gm's 1, 3, 15, and 62 you can just modify that list
-Boris
Code: Select all
proc MyAnalysis{ Groundmotion } {
#put the entirety of your current code inside this procedure
}
Code: Select all
set GM_file "groundmotion_$Groundmotion.acc"
timeSeries Path 1234 -dt $Dt -filePath myfolder/$GM_file -factor $gmfact
pattern UniformExcitation $patternTag $dir -accel 1234
Code: Select all
set all_gms [list 1 2 3 4 5]
foreach Groundmotions $all_gms {
puts "Running Groundmotion record $Groundmotions"
MyAnalysis $Groundmotions
}
-Boris