-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathMaxDriftTesterOriginal.tcl
63 lines (53 loc) · 1.9 KB
/
MaxDriftTesterOriginal.tcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# MaxDriftTester ########################################################################
#
# Procedure that checks if the drift is maximum for Collapse
# Calls the floor displacements of the structure and checks if they exceed the drift Collapse limit
#
# Developed by Dimitrios G. Lignos, Ph.D
#
# First Created: 04/20/2010
# Last Modified: 05/06/2010
#
# #######################################################################################
proc MaxDriftTesterOriginal {numStories DriftLimit FloorNodes h1 htyp} {
global CollapseFlag
global IterationCounter;
global nIterationsFlag;
set CollapseFlag "NO"
set nIterationsFlag "NO"
set IterationCounter [expr $IterationCounter+1];
puts "******* ITERATION NUMBER $IterationCounter *******"
if {$IterationCounter >= 3000} {
set nIterationsFlag "YES"
set CollapseFlag "YES"
}
for {set i 0} { $i<=$numStories-1} {incr i} {
if { $i==0 } {
set Node [lindex $FloorNodes $i]
set NodeDisplI [nodeDisp $Node 1]
set SDR [expr $NodeDisplI/$h1]
lappend Drift [list $SDR]
} elseif { $i > 0 } {
set NodeI [lindex $FloorNodes $i]
set NodeDisplI [nodeDisp $NodeI 1]
set NodeJ [lindex $FloorNodes [expr $i-1]]
set NodeDisplJ [nodeDisp $NodeJ 1]
set SDR [expr ($NodeDisplI - $NodeDisplJ)/$htyp]
lappend Drift [list $SDR]
}
}
set MAXDrift $DriftLimit
for { set h 0 } { $h <= $numStories-1} {incr h} {
set TDrift [ lindex $Drift [expr $h] ]
set TDrift [expr abs( $TDrift )]
if { $TDrift > $MAXDrift } {
set CollapseFlag "YES"
puts "Collapse"
# Addition by Ahmed Elkady 25 July 2012 for Tracing of Collapse Point
set fileID [open CollapseState.txt w]; # Create/Open CollapseState.txt file (writing permission)
puts -nonewline $fileID 1; # Write value of 1 in case of collapse in CollapseState.txt file (
close $fileID; # Close CollapseState.txt file
##################
}
}
}