-
Notifications
You must be signed in to change notification settings - Fork 22
/
ConstructFiberBeam.tcl
153 lines (123 loc) · 4.94 KB
/
ConstructFiberBeam.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
############################################################################################
# ConstructFiberBeam.tcl
#
# This procedure will produce a 2D beam element between the 2 given points in a 2D/3D system (Z coordinates were set to 0).
# P-Delta Transformation is used by default
#
# Command Syntax ConstructBrace eleID Node1 Node2 secID numSeg Initial_GI nInt Trans_tag
#
# Command Arguments
# L Overall Length of Bracing
# Initial_GI Required Maximum Initial Imperfection ratio at Middle of Bracing
# numSeg Number of required Segment along Bracing Length
# nInt Number of integration point per segment.
# Node1 Node ID Brace Element Start Point
# Node2 Node ID Brace Element End Point
# Splice_status 0 --> Column wtih No Splice
# 1 --> Column with Splice (lower part)
# 2 --> Column with Splice (upper part)
############################################################################################
proc ConstructFiberBeam {eleID Node1 Node2 secID numSeg Initial_GI nInt Trans_tag Splice_status} {
set integration "Lobatto $secID $nInt"
set PI [expr 2*asin(1.0)]; # define constant pi
# Get Coordinates of the Column End Points
set X1 [nodeCoord $Node1 1];
set Y1 [nodeCoord $Node1 2];
set X2 [nodeCoord $Node2 1];
set Y2 [nodeCoord $Node2 2];
# Deduce the Length of the Column
set L [expr sqrt(pow(($X2-$X1),2)+ pow(($Y2-$Y1),2))];
if {$Splice_status==0} {
# Set nodeID for the first intermediate node
set nodeID [expr 500000+$Node1]
for {set i 1} {$i <= [expr $numSeg-1]} {incr i 1} {
set nodeid [expr $nodeID+$i]
# Deduce the coordinates of each intermediate node in global system
set xGlobal [expr $X1+$L/$numSeg*$i];
set yGlobal [expr $Y1+sin($PI*$i/$numSeg)*$Initial_GI*$L];
node $nodeid $xGlobal $yGlobal
}
# Define segments
# set initial elementID
set ElementID [expr $eleID+500]
#puts "S0 $ElementID"
if {$numSeg>1} {
# Define first element
element dispBeamColumn $ElementID $Node1 [expr $nodeID+1] $nInt $secID $Trans_tag -integration $integration
# Define internal elements
for {set i 1} {$i <[expr $numSeg-1]} {incr i 1} {
incr ElementID 1
set iNode [expr $i +$nodeID]
set jNode [expr $i +$nodeID+1]
# Create the Brace Elements
element dispBeamColumn $ElementID $iNode $jNode $nInt $secID $Trans_tag -integration $integration
}
# Define last element
element dispBeamColumn [expr $ElementID+1] [expr $nodeID+$numSeg-1] $Node2 $nInt $secID $Trans_tag -integration $integration
} else {
element dispBeamColumn $ElementID $Node1 $Node2 $nInt $secID $Trans_tag -integration $integration
}
}
if {$Splice_status==1} {
# Set nodeID for the first intermediate node
set nodeID [expr 100000+$Node1+3]
for {set i 1} {$i <= [expr $numSeg-1]} {incr i 1} {
set nodeid [expr $nodeID+$i]
# Deduce the coordinates of each intermediate node in global system
set xGlobal [expr $X1+$L/$numSeg*$i];
set yGlobal [expr $Y1+sin($PI*$i/$numSeg)*$Initial_GI*$L];
node $nodeid $xGlobal $yGlobal
}
# Define segments
# set initial elementID
set ElementID [expr $eleID+3]
#puts "S1 $ElementID"
if {$numSeg>1} {
# Define first element
element dispBeamColumn $eleID $Node1 [expr $nodeID+1] $nInt $secID $Trans_tag -integration $integration
# Define internal elements
for {set i 1} {$i <[expr $numSeg-1]} {incr i 1} {
incr ElementID 1
set iNode [expr $i +$nodeID]
set jNode [expr $i +$nodeID+1]
# Create the Brace Elements
element dispBeamColumn $ElementID $iNode $jNode $nInt $secID $Trans_tag -integration $integration
}
# Define last element
element dispBeamColumn [expr $ElementID+1] [expr $nodeID+$numSeg-1] $Node2 $nInt $secID $Trans_tag -integration $integration
} else {
element dispBeamColumn $eleID $Node1 $Node2 $nInt $secID $Trans_tag -integration $integration
}
}
if {$Splice_status==2} {
# Set nodeID for the first intermediate node
set nodeID [expr 100000+$Node2+10]
for {set i 1} {$i <= [expr $numSeg-1]} {incr i 1} {
set nodeid [expr $nodeID+$i]
# Deduce the coordinates of each intermediate node in global system
set xGlobal [expr $X2+sin($PI*$i/$numSeg)*$Initial_GI*$L];
set yGlobal [expr $Y2-$L/$numSeg*$i];
node $nodeid $xGlobal $yGlobal
}
# Define segments
# set initial elementID
set ElementID [expr $eleID+10]
#puts "S2 $ElementID"
if {$numSeg>1} {
# Define first element
element dispBeamColumn $eleID $Node1 [expr $nodeID+1] $nInt $secID $Trans_tag -integration $integration
# Define internal elements
for {set i 1} {$i <[expr $numSeg-1]} {incr i 1} {
incr ElementID 1
set iNode [expr $i +$nodeID]
set jNode [expr $i +$nodeID+1]
# Create the Brace Elements
element dispBeamColumn $ElementID $iNode $jNode $nInt $secID $Trans_tag -integration $integration
}
# Define last element
element dispBeamColumn [expr $ElementID+1] [expr $nodeID+$numSeg-1] $Node2 $nInt $secID $Trans_tag -integration $integration
} else {
element dispBeamColumn $eleID $Node1 $Node2 $nInt $secID $Trans_tag -integration $integration
}
}
}