-
Notifications
You must be signed in to change notification settings - Fork 22
/
DynamicAnalysisCollapseSolverX.tcl
207 lines (187 loc) · 6.8 KB
/
DynamicAnalysisCollapseSolverX.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# DynamicAnalysisCollapseSolver #########################################################
#
# This Solver is used for Collapse "hunting"
# Time Controlled Algorithm that keeps original run
#
# Developed by Dimitrios G. Lignos, Ph.D
#
# First Created: 04/20/2010
# Last Modified: 08/23/2011
#
# Uses:
# 1. dt : Ground Motion step
# 2. dt_anal_Step : Analysis time step
# 3. GMtime : Ground Motion Total Time
# 4. numStories : DriftLimit
#
# Subroutines called:
# SDRlimitTester: Checks after loss of convergence the drifts
# and guarantees convergence for collapse
#
# Integrator Used: Modified Implicit: Hilbert Hughes Taylor with Increment Reduction
# #######################################################################################
proc DynamicAnalysisCollapseSolverX {dt dt_anal_Step GMtime numStories DriftLimit MFFloorNodes EGFFloorNodes h1 htyp TraceGFDrift StartTime MaxRunTime} {
set x [clock seconds];
set RunTime [expr $x - $StartTime];
global CollapseFlag; # global variable to monitor collapse
set CollapseFlag "NO"
wipeAnalysis
constraints Plain
numberer RCM
system UmfPack
test EnergyIncr 1.0e-3 100
algorithm KrylovNewton
integrator Newmark 0.50 0.25
analysis Transient
set NumSteps [expr round(($GMtime + 0.0)/$dt_anal_Step)]; # number of steps in analysis
set ok [analyze $NumSteps $dt_anal_Step];
# Check Max Drifts for Collapse by Monitoring the CollapseFlag Variable
source SDRlimitTester.tcl;
SDRlimitTester $numStories $DriftLimit $MFFloorNodes $EGFFloorNodes $h1 $htyp $TraceGFDrift
if {$CollapseFlag == "YES" || $RunTime > $MaxRunTime} {
set ok 0
puts "----> Collapse Occured";
}
# If analysis failed
if {$ok != 0} {
puts "Analysis did not converge..."
# The analysis will be time-controlled and is done for the remaining time
set ok 0;
set controlTime [getTime];
# While the GM did not finish OR while analysis is failing
while {$controlTime < $GMtime || $ok !=0 } {
SDRlimitTester $numStories $DriftLimit $MFFloorNodes $EGFFloorNodes $h1 $htyp $TraceGFDrift
if {$CollapseFlag == "YES" || $RunTime > $MaxRunTime} {
set ok 0; break;
} else {
set ok 1
}
# Get Control Time inside the loop
set controlTime [getTime]
puts "----> Currently at time $controlTime out of $GMtime"
if {$ok != 0} {
puts "Run Newton 100 steps with 1/2 of step.."
set controlTime [getTime]
set remainTime [expr $GMtime - $controlTime]
set NewRemainSteps [expr round(($remainTime)/($dt_anal_Step/2.0))]
test EnergyIncr 1.0e-3 100 0
algorithm KrylovNewton
integrator Newmark 0.50 0.25
set ok [analyze 10 [expr $dt_anal_Step/2.0]]
SDRlimitTester $numStories $DriftLimit $MFFloorNodes $EGFFloorNodes $h1 $htyp $TraceGFDrift
if {$CollapseFlag == "YES"} {
set ok 0
}
}
if {$ok != 0 } {
puts "Go Back to KrylovNewton with tangent Tangent and original step.."
set controlTime [getTime]
set remainTime [expr $GMtime - $controlTime]
set NewRemainSteps [expr round(($remainTime)/($dt_anal_Step))]
test EnergyIncr 1.0e-2 100 0
algorithm KrylovNewton
integrator Newmark 0.50 0.25
set ok [analyze $NewRemainSteps [expr $dt_anal_Step]]
SDRlimitTester $numStories $DriftLimit $MFFloorNodes $EGFFloorNodes $h1 $htyp $TraceGFDrift
if {$CollapseFlag == "YES"} {
set ok 0
}
}
if {$ok != 0 } {
puts "Run 10 steps KrylovNewton with Initial Tangent with 1/2 of original step.."
set controlTime [getTime]
set remainTime [expr $GMtime - $controlTime]
set NewRemainSteps [expr round(($remainTime)/($dt_anal_Step/2.0))]
test EnergyIncr 1.0e-2 200 0
algorithm KrylovNewton -initial
set ok [analyze 10 [expr $dt_anal_Step/2.0]]
SDRlimitTester $numStories $DriftLimit $MFFloorNodes $EGFFloorNodes $h1 $htyp $TraceGFDrift
if {$CollapseFlag == "YES"} {
set ok 0
}
}
if {$ok != 0 } {
puts "Go Back to KrylovNewton with tangent Tangent and original step.."
set controlTime [getTime]
set remainTime [expr $GMtime - $controlTime]
set NewRemainSteps [expr round(($remainTime)/($dt_anal_Step))]
test EnergyIncr 1.0e-2 100 0
algorithm KrylovNewton
integrator Newmark 0.50 0.25
set ok [analyze $NewRemainSteps [expr $dt_anal_Step]]
SDRlimitTester $numStories $DriftLimit $MFFloorNodes $EGFFloorNodes $h1 $htyp $TraceGFDrift
if {$CollapseFlag == "YES"} {
set ok 0
}
}
if {$ok != 0 } {
puts "Go Back to KrylovNewton with tangent Tangent and 0.001 step.."
set controlTime [getTime]
set remainTime [expr $GMtime - $controlTime]
set NewRemainSteps [expr round(($remainTime)/(0.001))]
test EnergyIncr 1.0e-2 200 0
algorithm KrylovNewton
integrator Newmark 0.50 0.25
set ok [analyze $NewRemainSteps [expr 0.001]]
SDRlimitTester $numStories $DriftLimit $MFFloorNodes $EGFFloorNodes $h1 $htyp $TraceGFDrift
if {$CollapseFlag == "YES"} {
set ok 0
}
}
if {$ok != 0 } {
puts "KrylovNewton Initial with 1/2 of step and Displacement Control Convergence.."
test EnergyIncr 1.0e-2 100 0
algorithm KrylovNewton -initial
set ok [analyze 10 [expr $dt_anal_Step/2.0]]
SDRlimitTester $numStories $DriftLimit $MFFloorNodes $EGFFloorNodes $h1 $htyp $TraceGFDrift
if {$CollapseFlag == "YES"} {
set ok 0
}
}
if {$ok != 0 } {
puts "Go Back to KrylovNewton with tangent Tangent and 0.0001 step.."
set controlTime [getTime]
set remainTime [expr $GMtime - $controlTime]
set NewRemainSteps [expr round(($remainTime)/(0.0001))]
test EnergyIncr 1.0e-2 100 0
algorithm KrylovNewton
integrator Newmark 0.50 0.25
set ok [analyze 5 [expr 0.0001]]
SDRlimitTester $numStories $DriftLimit $MFFloorNodes $EGFFloorNodes $h1 $htyp $TraceGFDrift
if {$CollapseFlag == "YES"} {
set ok 0
}
}
if {$ok != 0 } {
puts "Go Back to KrylovNewton with tangent Tangent and original step.."
set controlTime [getTime]
set remainTime [expr $GMtime - $controlTime]
set NewRemainSteps [expr round(($remainTime)/($dt_anal_Step))]
test EnergyIncr 1.0e-2 100 0
algorithm KrylovNewton
integrator Newmark 0.50 0.25
set ok [analyze $NewRemainSteps [expr $dt_anal_Step]]
SDRlimitTester $numStories $DriftLimit $MFFloorNodes $EGFFloorNodes $h1 $htyp $TraceGFDrift
if {$CollapseFlag == "YES"} {
set ok 0
}
}
if {$ok != 0 } {
puts "Newton with Fixed Number of Iterations else continue"
set controlTime [getTime]
set remainTime [expr $GMtime - $controlTime]
set NewRemainSteps [expr round(($remainTime)/(0.0001))]
puts $NewRemainSteps
test FixedNumIter 50
integrator NewmarkHSFixedNumIter 0.5 0.25
algorithm Newton
set ok [analyze 10 [expr 0.0001]]
SDRlimitTester $numStories $DriftLimit $MFFloorNodes $EGFFloorNodes $h1 $htyp $TraceGFDrift
if {$CollapseFlag == "YES"} {
set ok 0
}
}
set controlTime [getTime]
}
}
}