OpenSeesPyAssistant 1.1
OpenSeesPy for everyone
Fibers.py
Go to the documentation of this file.
1"""
2Module for the fibers (rectangular, circular and I shape).
3Carmine Schipani, 2021
4"""
5
6from openseespy.opensees import *
7import matplotlib.pyplot as plt
8from matplotlib.patches import Circle, Polygon, Wedge
9import numpy as np
10from copy import copy, deepcopy
14from OpenSeesPyAssistant.Units import *
16
17
19 """
20 Parent abstract class for the storage and manipulation of a fiber's information (mechanical
21 and geometrical parameters, etc) and initialisation in the model.
22
23 @param DataManagement: Parent abstract class.
24 """
25 pass
26
27
29 """
30 Class that stores funcions, material properties, geometric and mechanical parameters for a rectangular RC fiber section.
31 Coordinates: plotting coordinte (x, y) = fiber section coordinate (z, y) = (-x, y). For more information, see the OpenSeesPy documentation.
32
33 @param Fibers: Parent abstract class.
34 """
35 def __init__(self, ID: int, b, d, Ay, D_hoops, e, unconf_mat_ID: int, conf_mat_ID: int, bars_mat_ID: int,
36 bars_x: np.ndarray, ranges_y: np.ndarray, discr_core: list, discr_cover_lateral: list, discr_cover_topbottom: list, GJ = 0.0):
37 """
38 Constructor of the class.
39
40 @param ID (int): Unique fiber section ID.
41 @param b (float): Width of the section.
42 @param d (float): Depth of the section.
43 @param Ay (float): Area of one vertical reinforcing bar.
44 @param D_hoops (float): Diameter of the hoops.
45 @param e (float): Concrete cover.
46 @param unconf_mat_ID (int): ID of material model that will be assigned to the unconfined fibers.
47 @param conf_mat_ID (int): ID of material model that will be assigned to the confined fibers.
48 @param bars_mat_ID (int): ID of material model that will be assigned to the reinforcing bars fibers.
49 @param bars_x (np.ndarray): Array with a range of aligned vertical reinforcing bars for each row in x direction.
50 Distances from border to bar centerline, bar to bar centerlines and finally bar centerline to border in the x direction (aligned).
51 Starting from the left to right, from the top range to the bottom one.
52 The number of bars for each range can vary; in this case, add this argument when defining the array " dtype = object"
53 @param ranges_y (np.ndarray): Array of dimension 1 with the position or spacing in y of the ranges in bars_x.
54 Distances from border to range centerlines, range to range centerlines and finally range centerline to border in the y direction.
55 Starting from the top range to the bottom one.
56 @param discr_core (list): List with two entries: discretisation in IJ (x/z) and JK (y) for the confined core.
57 @param discr_cover_lateral (list): List with two entries: discretisation in IJ (x/z) and JK (y) for the lateral unconfined cover.
58 @param discr_cover_topbottom (list): List with two entries: discretisation in IJ (x/z) and JK (y) for the top and bottom unconfined cover.
59 @param GJ (float, optional): Linear-elastic torsional stiffness assigned to the section. Defaults to 0.0, assume no torsional stiffness.
60
61 @exception NegativeValue: ID needs to be a positive integer.
62 @exception NegativeValue: b needs to be positive.
63 @exception NegativeValue: d needs to be positive.
64 @exception NegativeValue: Ay needs to be positive.
65 @exception NegativeValue: D_hoops needs to be positive.
66 @exception NegativeValue: e needs to be positive.
67 @exception NegativeValue: unconf_mat_ID needs to be a positive integer.
68 @exception NegativeValue: conf_mat_ID needs to be a positive integer.
69 @exception NegativeValue: bars_mat_ID needs to be a positive integer.
70 @exception WrongDimension: Number of rows in the list bars_x needs to be the same of the length of ranges_y - 1.
71 @exception InconsistentGeometry: The sum of the distances for each row in bars_x should be equal to the section's width (tol = 5 mm).
72 @exception InconsistentGeometry: The sum of the distances in ranges_y should be equal to the section's depth (tol = 5 mm).
73 @exception InconsistentGeometry: e should be smaller than half the depth and the width of the section.
74 @exception WrongDimension: discr_core has a length of 2.
75 @exception WrongDimension: discr_cover_lateral has a length of 2.
76 @exception WrongDimension: discr_cover_topbottom has a length of 2.
77 @exception NegativeValue: GJ needs to be positive.
78 """
79 # Check
80 if ID < 1: raise NegativeValue()
81 if b < 0: raise NegativeValue()
82 if d < 0: raise NegativeValue()
83 if Ay < 0: raise NegativeValue()
84 if D_hoops < 0: raise NegativeValue()
85 if e < 0: raise NegativeValue()
86 if unconf_mat_ID < 1: raise NegativeValue()
87 if conf_mat_ID < 1: raise NegativeValue()
88 if bars_mat_ID < 1: raise NegativeValue()
89 if np.size(bars_x) != np.size(ranges_y)-1: raise WrongDimension()
90 geometry_tol = 5*mm_unit
91 for bars in bars_x:
92 if abs(np.sum(bars) - b) > geometry_tol: raise InconsistentGeometry()
93 if abs(np.sum(ranges_y) - d) > geometry_tol: raise InconsistentGeometry()
94 if e > b/2 or e > d/2: raise InconsistentGeometry()
95 if len(discr_core) != 2: raise WrongDimension()
96 if len(discr_cover_lateral) != 2: raise WrongDimension()
97 if len(discr_cover_topbottom) != 2: raise WrongDimension()
98 if GJ < 0: raise NegativeValue()
99
100 # Arguments
101 self.IDID = ID
102 self.bb = b
103 self.dd = d
104 self.AyAy = Ay
105 self.D_hoopsD_hoops = D_hoops
106 self.ee = e
107 self.unconf_mat_IDunconf_mat_ID = unconf_mat_ID
108 self.conf_mat_IDconf_mat_ID = conf_mat_ID
109 self.bars_mat_IDbars_mat_ID = bars_mat_ID
110 self.bars_xbars_x = deepcopy(bars_x)
111 self.ranges_yranges_y = copy(ranges_y)
112 self.discr_corediscr_core = copy(discr_core)
113 self.discr_cover_lateraldiscr_cover_lateral = copy(discr_cover_lateral)
114 self.discr_cover_topbottomdiscr_cover_topbottom = copy(discr_cover_topbottom)
115 self.GJGJ = GJ
116
117 # Initialized the parameters that are dependent from others
118 self.section_name_tagsection_name_tag = "None"
119 self.InitializedInitialized = False
120 self.ReInitReInit()
121
122 def ReInit(self):
123 """
124 Implementation of the homonym abstract method.
125 See parent class DataManagement for detailed information.
126 """
127 # Memebers
128 if self.section_name_tagsection_name_tag != "None": self.section_name_tagsection_name_tag = self.section_name_tagsection_name_tag + " (modified)"
129
130 # Parameters
131 z1 = self.bb/2
132 y1 = self.dd/2
133 zc = z1-self.ee-self.D_hoopsD_hoops/2
134 yc = y1-self.ee-self.D_hoopsD_hoops/2
135
136 # Create the concrete core fibers
137 core = [-yc, -zc, yc, zc]
138 core_cmd = ['patch', 'rect', self.conf_mat_IDconf_mat_ID, *self.discr_corediscr_core, *core]
139
140 # Create the concrete cover fibers (bottom left, top right)
141 cover_up = [yc, -z1, y1, z1]
142 cover_down = [-y1, -z1, -yc, z1]
143 cover_left = [-yc, zc, yc, z1]
144 cover_right = [-yc, -z1, yc, -zc]
145 cover_up_cmd = ['patch', 'rect', self.unconf_mat_IDunconf_mat_ID, *self.discr_cover_topbottomdiscr_cover_topbottom, *cover_up]
146 cover_down_cmd = ['patch', 'rect', self.unconf_mat_IDunconf_mat_ID, *self.discr_cover_topbottomdiscr_cover_topbottom, *cover_down]
147 cover_left_cmd = ['patch', 'rect', self.unconf_mat_IDunconf_mat_ID, *self.discr_cover_lateraldiscr_cover_lateral, *cover_left]
148 cover_right_cmd = ['patch', 'rect', self.unconf_mat_IDunconf_mat_ID, *self.discr_cover_lateraldiscr_cover_lateral, *cover_right]
149 self.fib_secfib_sec = [['section', 'Fiber', self.IDID, '-GJ', self.GJGJ],
150 core_cmd, cover_up_cmd, cover_down_cmd, cover_left_cmd, cover_right_cmd]
151
152 # Create the reinforcing fibers (top, middle, bottom)
153 # NB: note the order of definition of bars_x and ranges_y
154 nr_bars = 0
155 for range in self.bars_xbars_x:
156 nr_bars += np.size(range)-1
157 rebarY = -np.cumsum(self.ranges_yranges_y[0:-1]) + y1
158 self.rebarYZrebarYZ = np.zeros((nr_bars, 2))
159
160 iter = 0
161 for ii, Y in enumerate(rebarY):
162 rebarZ = -np.cumsum(self.bars_xbars_x[ii][0:-1]) + z1
163 for Z in rebarZ:
164 self.rebarYZrebarYZ[iter, :] = [Y, Z]
165 iter = iter + 1
166
167 for YZ in self.rebarYZrebarYZ:
168 self.fib_secfib_sec.append(['layer', 'bar', self.bars_mat_IDbars_mat_ID, self.AyAy, *YZ])
169
170 # Data storage for loading/saving
171 self.UpdateStoredDataUpdateStoredData()
172
173
174 # Methods
176 """
177 Implementation of the homonym abstract method.
178 See parent class DataManagement for detailed information.
179 """
180 self.datadata = [["INFO_TYPE", "FibersRect"], # Tag for differentiating different data
181 ["ID", self.IDID],
182 ["section_name_tag", self.section_name_tagsection_name_tag],
183 ["b", self.bb],
184 ["d", self.dd],
185 ["Ay", self.AyAy],
186 ["D_hoops", self.D_hoopsD_hoops],
187 ["e", self.ee],
188 ["GJ", self.GJGJ],
189 ["conf_mat_ID", self.conf_mat_IDconf_mat_ID],
190 ["discr_core", self.discr_corediscr_core],
191 ["unconf_mat_ID", self.unconf_mat_IDunconf_mat_ID],
192 ["discr_cover_topbottom", self.discr_cover_topbottomdiscr_cover_topbottom],
193 ["discr_cover_lateral", self.discr_cover_lateraldiscr_cover_lateral],
194 ["bars_mat_ID", self.bars_mat_IDbars_mat_ID],
195 ["bars_x", self.bars_xbars_x],
196 ["ranges_y", self.ranges_yranges_y],
197 ["Initialized", self.InitializedInitialized]]
198
199 def ShowInfo(self, plot = False, block = False):
200 """
201 Implementation of the homonym abstract method.
202 See parent class DataManagement for detailed information.
203
204 @param plot (bool, optional): Option to show the plot of the fiber. Defaults to False.
205 @param block (bool, optional): Option to wait the user command 'plt.show()' (avoiding the stop of the program everytime that a plot should pop up). Defaults to False.
206 """
207 print("")
208 print("Requested info for FibersRect, ID = {}".format(self.IDID))
209 print("Section associated: {} ".format(self.section_name_tagsection_name_tag))
210 print("Base b = {} mm and depth d = {} mm".format(self.bb/mm_unit, self.dd/mm_unit))
211 print("Confined material model ID = {}".format(self.conf_mat_IDconf_mat_ID))
212 print("Unconfined material model ID = {}".format(self.unconf_mat_IDunconf_mat_ID))
213 print("Bars material model ID = {}".format(self.bars_mat_IDbars_mat_ID))
214 print("Discretisation in the core [IJ or x/z dir, JK or y dir] = {}".format(self.discr_corediscr_core))
215 print("Discretisation in the lateral covers [IJ or x/z dir, JK or y dir] = {}".format(self.discr_cover_lateraldiscr_cover_lateral))
216 print("Discretisation in the top and bottom covers [IJ or x/z dir, JK or y dir] = {}".format(self.discr_cover_topbottomdiscr_cover_topbottom))
217 print("")
218
219 if plot:
220 plot_fiber_section(self.fib_secfib_sec, matcolor=['#808080', '#D3D3D3', 'k'])
221
222 if block:
223 plt.show()
224
225
226 def CreateFibers(self):
227 """
228 Method that initialises the fiber by calling the OpenSeesPy commands.
229 """
230 create_fiber_section(self.fib_secfib_sec)
231 self.InitializedInitialized = True
232 self.UpdateStoredDataUpdateStoredData()
233
234
236 """
237 Class that is the children of FibersRect and combine the class RCRectShape (section) to retrieve the information needed.
238
239 @param FibersRect: Parent class.
240 """
241 def __init__(self, ID: int, section: RCRectShape, unconf_mat_ID: int, conf_mat_ID: int, bars_mat_ID: int,
242 discr_core: list, discr_cover_lateral: list, discr_cover_topbottom: list, GJ=0):
243 """
244 Constructor of the class.
245
246 @param ID (int): Unique fiber section ID.
247 @param section (RCRectShape): RCRectShape section object.
248 @param unconf_mat_ID (int): ID of material model that will be assigned to the unconfined fibers.
249 @param conf_mat_ID (int): ID of material model that will be assigned to the confined fibers.
250 @param bars_mat_ID (int): ID of material model that will be assigned to the reinforcing bars fibers.
251 @param discr_core (list): List with two entries: discretisation in IJ (x/z) and JK (y) for the confined core.
252 @param discr_cover_lateral (list): List with two entries: discretisation in IJ (x/z) and JK (y) for the lateral unconfined core.
253 @param discr_cover_topbottom (list): List with two entries: discretisation in IJ (x/z) and JK (y) for the top and bottom unconfined core.
254 @param GJ (float, optional): Linear-elastic torsional stiffness assigned to the section. Defaults to 0.0, assume no torsional stiffness.
255 """
256 self.sectionsection = deepcopy(section)
257 super().__init__(ID, section.b, section.d, section.Ay, section.D_hoops, section.e, unconf_mat_ID, conf_mat_ID, bars_mat_ID,
258 section.bars_position_x, section.bars_ranges_position_y, discr_core, discr_cover_lateral, discr_cover_topbottom, GJ=GJ)
259 self.section_name_tagsection_name_tagsection_name_tag = section.name_tag
260 self.UpdateStoredDataUpdateStoredData()
261
262
264 """
265 Class that stores funcions, material properties, geometric and mechanical parameters for a circular RC fiber section.
266 Coordinates: plotting coordinte (x, y) = fiber section coordinate (z, y) = (-x, y). For more information, see the OpenSeesPy documentation.
267
268 @param Fibers: Parent abstract class.
269 """
270 def __init__(self, ID: int, b, e, D_bars, Ay, n_bars, D_hoops, unconf_mat_ID: int, conf_mat_ID: int, bars_mat_ID: int,
271 discr_core: list, discr_cover: list, alpha_i = 0.0, GJ = 0.0):
272 """
273 Constructor of the class.
274
275 @param ID (int): Unique fiber section ID.
276 @param b (float): Width of the section.
277 @param e (float): Concrete cover.
278 @param D_bars (float): Diameter of vertical reinforcing bars.
279 @param Ay (float): Area of one vertical reinforcing bar.
280 @param n_bars (float): Number of reinforcement (allow float for computing the equivalent n_bars with different reinforcement areas).
281 @param D_hoops (float): Diameter of the hoops.
282 @param unconf_mat_ID (int): ID of material model that will be assigned to the unconfined fibers.
283 @param conf_mat_ID (int): ID of material model that will be assigned to the confined fibers.
284 @param bars_mat_ID (int): ID of material model that will be assigned to the reinforcing bars fibers.
285 @param discr_core (list): List with two entries: number of subdivisions (fibers) in the circumferential direction (number of wedges),
286 number of subdivisions (fibers) in the radial direction (number of rings) for the confined core.
287 @param discr_cover (list): List with two entries: number of subdivisions (fibers) in the circumferential direction (number of wedges),
288 number of subdivisions (fibers) in the radial direction (number of rings) for the unconfined cover.
289 @param alpha_i (float, optional): Angle in deg of the first vertical rebars with respect to the y axis, counterclockwise. Defaults to 0.0.
290 @param GJ (float, optional): Linear-elastic torsional stiffness assigned to the section. Defaults to 0.0, assume no torsional stiffness.
291
292 @exception NegativeValue: ID needs to be a positive integer.
293 @exception NegativeValue: b needs to be positive.
294 @exception NegativeValue: e needs to be positive.
295 @exception InconsistentGeometry: e can't be bigger than half of the width b.
296 @exception NegativeValue: D_bars needs to be positive.
297 @exception NegativeValue: Ay needs to be positive.
298 @exception NegativeValue: n_bars needs to be positive.
299 @exception NegativeValue: D_hoops needs to be positive.
300 @exception NegativeValue: unconf_mat_ID needs to be a positive integer.
301 @exception NegativeValue: conf_mat_ID needs to be a positive integer.
302 @exception NegativeValue: bars_mat_ID needs to be a positive integer.
303 @exception WrongDimension: discr_core has a length of 2.
304 @exception WrongDimension: discr_cover has a length of 2.
305 @exception NegativeValue: GJ needs to be positive.
306 """
307 # Check
308 if ID < 1: raise NegativeValue()
309 if b < 0: raise NegativeValue()
310 if e < 0: raise NegativeValue()
311 if e > b/2: raise InconsistentGeometry()
312 if D_bars < 0: raise NegativeValue()
313 if Ay < 0: raise NegativeValue()
314 if n_bars < 0: raise NegativeValue()
315 if D_hoops < 0: raise NegativeValue()
316 if unconf_mat_ID < 1: raise NegativeValue()
317 if conf_mat_ID < 1: raise NegativeValue()
318 if bars_mat_ID < 1: raise NegativeValue()
319 if len(discr_core) != 2: raise WrongDimension()
320 if len(discr_cover) != 2: raise WrongDimension()
321 if GJ < 0: raise NegativeValue()
322
323 # Arguments
324 self.IDID = ID
325 self.bb = b
326 self.ee = e
327 self.D_barsD_bars = D_bars
328 self.AyAy = Ay
329 self.n_barsn_bars = n_bars
330 self.D_hoopsD_hoops = D_hoops
331 self.unconf_mat_IDunconf_mat_ID = unconf_mat_ID
332 self.conf_mat_IDconf_mat_ID = conf_mat_ID
333 self.bars_mat_IDbars_mat_ID = bars_mat_ID
334 self.discr_corediscr_core = copy(discr_core)
335 self.discr_coverdiscr_cover = copy(discr_cover)
336 self.alpha_ialpha_i = alpha_i
337 self.GJGJ = GJ
338
339 # Initialized the parameters that are dependent from others
340 self.section_name_tagsection_name_tag = "None"
341 self.InitializedInitialized = False
342 self.ReInitReInit()
343
344 def ReInit(self):
345 """
346 Implementation of the homonym abstract method.
347 See parent class DataManagement for detailed information.
348 """
349 # Memebers
350 if self.section_name_tagsection_name_tag != "None": self.section_name_tagsection_name_tag = self.section_name_tagsection_name_tag + " (modified)"
351
352 # Parameters
353 self.r_barsr_bars = self.bb/2 - self.ee - self.D_hoopsD_hoops - self.D_barsD_bars/2
354 self.r_corer_core = self.bb/2 - self.ee - self.D_hoopsD_hoops/2
355
356 # Create the concrete core fibers
357 core_cmd = ['patch', 'circ', self.conf_mat_IDconf_mat_ID, *self.discr_corediscr_core, 0, 0, 0, self.r_corer_core]
358
359 # Create the concrete cover fibers
360 cover_cmd = ['patch', 'circ', self.unconf_mat_IDunconf_mat_ID, *self.discr_coverdiscr_cover, 0, 0, self.r_corer_core, self.bb/2]
361 self.fib_secfib_sec = [['section', 'Fiber', self.IDID, '-GJ', self.GJGJ],
362 core_cmd, cover_cmd]
363
364 # Create the reinforcing fibers
365 bars_cmd = ['layer', 'circ', self.bars_mat_IDbars_mat_ID, self.n_barsn_bars, self.AyAy, 0, 0, self.r_barsr_bars, self.alpha_ialpha_i]
366 self.fib_secfib_sec.append(bars_cmd)
367
368 # Data storage for loading/saving
369 self.UpdateStoredDataUpdateStoredData()
370
371
372 # Methods
374 """
375 Implementation of the homonym abstract method.
376 See parent class DataManagement for detailed information.
377 """
378 self.datadata = [["INFO_TYPE", "FibersCirc"], # Tag for differentiating different data
379 ["ID", self.IDID],
380 ["section_name_tag", self.section_name_tagsection_name_tag],
381 ["b", self.bb],
382 ["e", self.ee],
383 ["r_core", self.r_corer_core],
384 ["D_bars", self.D_barsD_bars],
385 ["Ay", self.AyAy],
386 ["n_bars", self.n_barsn_bars],
387 ["r_bars", self.r_barsr_bars],
388 ["D_hoops", self.D_hoopsD_hoops],
389 ["alpha_i", self.alpha_ialpha_i],
390 ["GJ", self.GJGJ],
391 ["conf_mat_ID", self.conf_mat_IDconf_mat_ID],
392 ["discr_core", self.discr_corediscr_core],
393 ["unconf_mat_ID", self.unconf_mat_IDunconf_mat_ID],
394 ["discr_cover", self.discr_coverdiscr_cover],
395 ["bars_mat_ID", self.bars_mat_IDbars_mat_ID],
396 ["Initialized", self.InitializedInitialized]]
397
398
399 def ShowInfo(self, plot = False, block = False):
400 """
401 Implementation of the homonym abstract method.
402 See parent class DataManagement for detailed information.
403
404 @param plot (bool, optional): Option to show the plot of the material model. Defaults to False.
405 @param block (bool, optional): Option to wait the user command 'plt.show()' (avoiding the stop of the program everytime that a plot should pop up). Defaults to False.
406 """
407 print("")
408 print("Requested info for FibersCirc, ID = {}".format(self.IDID))
409 print("Section associated: {} ".format(self.section_name_tagsection_name_tag))
410 print("Base b = {} mm and concrete cover e = {} mm".format(self.bb/mm_unit, self.ee/mm_unit))
411 print("Radius of the confined core r_core = {} mm, radius of the bars range r_bars = {} mm and initial angle alpha_i = {} deg".format(self.r_corer_core/mm_unit, self.r_barsr_bars/mm_unit, self.alpha_ialpha_i))
412 print("Confined material model ID = {}".format(self.conf_mat_IDconf_mat_ID))
413 print("Unconfined material model ID = {}".format(self.unconf_mat_IDunconf_mat_ID))
414 print("Bars material model ID = {}".format(self.bars_mat_IDbars_mat_ID))
415 print("Discretisation in the core [number of wedges, number of rings] = {}".format(self.discr_corediscr_core))
416 print("Discretisation in the lateral covers [number of wedges, number of rings] = {}".format(self.discr_coverdiscr_cover))
417 print("")
418
419 if plot:
420 plot_fiber_section(self.fib_secfib_sec, matcolor=['#808080', '#D3D3D3', 'k'])
421
422 if block:
423 plt.show()
424
425
426 def CreateFibers(self):
427 """
428 Method that initialise the fiber by calling the OpenSeesPy commands.
429 """
430 create_fiber_section(self.fib_secfib_sec)
431 self.InitializedInitialized = True
432 self.UpdateStoredDataUpdateStoredData()
433
434
436 """
437 Class that is the children of FibersCirc and combine the class RCCircShape (section) to retrieve the information needed.
438
439 @param FibersCirc: Parent class.
440 """
441 def __init__(self, ID: int, section: RCCircShape, unconf_mat_ID: int, conf_mat_ID: int, bars_mat_ID: int,
442 discr_core: list, discr_cover: list, alpha_i=0.0, GJ=0):
443 """
444 Constructor of the class.
445
446 @param ID (int): Unique fiber section ID.
447 @param section (RCCircShape): RCCircShape section object.
448 @param unconf_mat_ID (int): ID of material model that will be assigned to the unconfined fibers.
449 @param conf_mat_ID (int): ID of material model that will be assigned to the confined fibers.
450 @param bars_mat_ID (int): ID of material model that will be assigned to the reinforcing bars fibers.
451 @param discr_core (list): List with two entries: number of subdivisions (fibers) in the circumferential direction (number of wedges),
452 number of subdivisions (fibers) in the radial direction (number of rings) for the confined core.
453 @param discr_cover (list): List with two entries: number of subdivisions (fibers) in the circumferential direction (number of wedges),
454 number of subdivisions (fibers) in the radial direction (number of rings) for the unconfined cover.
455 @param alpha_i (float, optional): Angle in deg of the first vertical rebars with respect to the y axis, counterclockwise. Defaults to 0.0.
456 @param GJ (float, optional): Linear-elastic torsional stiffness assigned to the section. Defaults to 0.0, assume no torsional stiffness.
457 """
458 self.sectionsection = deepcopy(section)
459 super().__init__(ID, section.b, section.e, section.D_bars, section.Ay, section.n_bars, section.D_hoops, unconf_mat_ID, conf_mat_ID, bars_mat_ID,
460 discr_core, discr_cover, alpha_i=alpha_i, GJ=GJ)
461 self.section_name_tagsection_name_tagsection_name_tag = section.name_tag
462 self.UpdateStoredDataUpdateStoredData()
463
464
466 """
467 Class that stores funcions, material properties, geometric and mechanical parameters for a steel I shape (non double symmetric) fiber section.
468 Coordinates: plotting coordinte (x, y) = fiber section coordinate (z, y) = (-x, y). For more information, see the OpenSeesPy documentation.
469
470 @param Fibers: Parent abstract class.
471 """
472 def __init__(self, ID: int, d, bf_t, bf_b, tf_t, tf_b, tw, top_flange_mat_ID: int, bottom_flange_mat_ID: int, web_mat_ID: int,
473 discr_top_flange: list, discr_bottom_flange: list, discr_web: list, GJ = 0.0):
474 """
475 Constructor of the class.
476
477 @param ID (int): Unique fiber section ID.
478 @param d (float): Depth of the section.
479 @param bf_t (float): Top flange's width of the section
480 @param bf_b (float): Bottom flange's width of the section
481 @param tf_t (float): Top flange's thickness of the section
482 @param tf_b (float): Bottom flange's thickness of the section
483 @param tw (float): Web's thickness of the section
484 @param top_flange_mat_ID (int): ID of material model that will be assigned to the top flange fibers.
485 @param bottom_flange_mat_ID (int): ID of material model that will be assigned to the bottom flange fibers.
486 @param web_mat_ID (int): ID of material model that will be assigned to the web fibers.
487 @param discr_top_flange (list): List with two entries: discretisation in IJ (x/z) and JK (y) for the top flange.
488 @param discr_bottom_flange (list): List with two entries: discretisation in IJ (x/z) and JK (y) for the bottom flange.
489 @param discr_web (list): List with two entries: discretisation in IJ (x/z) and JK (y) for the web.
490 @param GJ (float, optional): Linear-elastic torsional stiffness assigned to the section. Defaults to 0.0, assume no torsional stiffness.
491
492 @exception NegativeValue: ID needs to be a positive integer.
493 @exception NegativeValue: d needs to be positive.
494 @exception NegativeValue: bf_t needs to be positive.
495 @exception NegativeValue: bf_b needs to be positive.
496 @exception NegativeValue: tf_t needs to be positive.
497 @exception NegativeValue: tf_b needs to be positive.
498 @exception NegativeValue: tw needs to be positive.
499 @exception NegativeValue: top_flange_mat_ID needs to be a positive integer.
500 @exception NegativeValue: bottom_flange_mat_ID needs to be a positive integer.
501 @exception NegativeValue: web_mat_ID needs to be a positive integer.
502 @exception WrongDimension: discr_top_flange has a length of 2.
503 @exception WrongDimension: discr_bottom_flange has a length of 2.
504 @exception WrongDimension: discr_web has a length of 2.
505 @exception NegativeValue: GJ needs to be positive.
506 @exception InconsistentGeometry: The sum of the flanges thickness can't be bigger than d.
507 """
508 # Check
509 if ID < 1: raise NegativeValue()
510 if d < 0: raise NegativeValue()
511 if bf_t < 0: raise NegativeValue()
512 if bf_b < 0: raise NegativeValue()
513 if tf_b < 0: raise NegativeValue()
514 if tf_t < 0: raise NegativeValue()
515 if tw < 0: raise NegativeValue()
516 if top_flange_mat_ID < 1: raise NegativeValue()
517 if bottom_flange_mat_ID < 1: raise NegativeValue()
518 if web_mat_ID < 1: raise NegativeValue()
519 if len(discr_top_flange) != 2: raise WrongDimension()
520 if len(discr_bottom_flange) != 2: raise WrongDimension()
521 if len(discr_web) != 2: raise WrongDimension()
522 if GJ < 0: raise NegativeValue()
523 if tf_t+tf_b >= d: raise InconsistentGeometry()
524
525 # Arguments
526 self.IDID = ID
527 self.dd = d
528 self.bf_tbf_t = bf_t
529 self.bf_bbf_b = bf_b
530 self.tf_ttf_t = tf_t
531 self.tf_btf_b = tf_b
532 self.twtw = tw
533 self.top_flange_mat_IDtop_flange_mat_ID = top_flange_mat_ID
534 self.bottom_flange_mat_IDbottom_flange_mat_ID = bottom_flange_mat_ID
535 self.web_mat_IDweb_mat_ID = web_mat_ID
536 self.discr_top_flangediscr_top_flange = copy(discr_top_flange)
537 self.discr_bottom_flangediscr_bottom_flange = copy(discr_bottom_flange)
538 self.discr_webdiscr_web = copy(discr_web)
539 self.GJGJ = GJ
540
541 # Initialized the parameters that are dependent from others
542 self.section_name_tagsection_name_tag = "None"
543 self.InitializedInitialized = False
544 self.ReInitReInit()
545
546 def ReInit(self):
547 """
548 Implementation of the homonym abstract method.
549 See parent class DataManagement for detailed information.
550 """
551 # Memebers
552 if self.section_name_tagsection_name_tag != "None": self.section_name_tagsection_name_tag = self.section_name_tagsection_name_tag + " (modified)"
553
554 # Parameters
555 z1 = self.twtw/2
556 y1 = (self.dd - self.tf_ttf_t - self.tf_btf_b)/2
557
558 # Create the flange top
559 flange_top = [y1, -self.bf_tbf_t/2, y1+self.tf_ttf_t, self.bf_tbf_t/2]
560 flange_top_cmd = ['patch', 'rect', self.top_flange_mat_IDtop_flange_mat_ID, *self.discr_top_flangediscr_top_flange, *flange_top]
561
562 # Create the flange bottom
563 flange_bottom = [-y1-self.tf_btf_b, -self.bf_bbf_b/2, -y1, self.bf_bbf_b/2]
564 flange_bottom_cmd = ['patch', 'rect', self.bottom_flange_mat_IDbottom_flange_mat_ID, *self.discr_bottom_flangediscr_bottom_flange, *flange_bottom]
565
566 # Create the web
567 web = [-y1, -z1, y1, z1]
568 web_cmd = ['patch', 'rect', self.web_mat_IDweb_mat_ID, *self.discr_webdiscr_web, *web]
569
570 self.fib_secfib_sec = [['section', 'Fiber', self.IDID, '-GJ', self.GJGJ],
571 flange_top_cmd, web_cmd, flange_bottom_cmd]
572
573 # Data storage for loading/saving
574 self.UpdateStoredDataUpdateStoredData()
575
576
577 # Methods
579 """
580 Implementation of the homonym abstract method.
581 See parent class DataManagement for detailed information.
582 """
583 self.datadata = [["INFO_TYPE", "FibersIShape"], # Tag for differentiating different data
584 ["ID", self.IDID],
585 ["section_name_tag", self.section_name_tagsection_name_tag],
586 ["d", self.dd],
587 ["bf_t", self.bf_tbf_t],
588 ["bf_b", self.bf_bbf_b],
589 ["tf_t", self.tf_ttf_t],
590 ["tf_b", self.tf_btf_b],
591 ["tw", self.twtw],
592 ["GJ", self.GJGJ],
593 ["top_flange_mat_ID", self.top_flange_mat_IDtop_flange_mat_ID],
594 ["bottom_flange_mat_ID", self.bottom_flange_mat_IDbottom_flange_mat_ID],
595 ["web_mat_ID", self.web_mat_IDweb_mat_ID],
596 ["discr_top_flange", self.discr_top_flangediscr_top_flange],
597 ["discr_bottom_flange", self.discr_bottom_flangediscr_bottom_flange],
598 ["discr_web", self.discr_webdiscr_web],
599 ["Initialized", self.InitializedInitialized]]
600
601
602 def ShowInfo(self, plot = False, block = False):
603 """
604 Implementation of the homonym abstract method.
605 See parent class DataManagement for detailed information.
606
607 @param plot (bool, optional): Option to show the plot of the fiber. Defaults to False.
608 @param block (bool, optional): Option to wait the user command 'plt.show()' (avoiding the stop of the program everytime that a plot should pop up). Defaults to False.
609 """
610 print("")
611 print("Requested info for FibersRect, ID = {}".format(self.IDID))
612 print("Section associated: {} ".format(self.section_name_tagsection_name_tag))
613 print("Depth d = {} mm and web thickness tw = {} mm".format(self.dd/mm_unit, self.twtw/mm_unit))
614 print("Top flange width bf_t = {} mm and thickness tf_t = {} mm".format(self.bf_tbf_t/mm_unit, self.tf_ttf_t/mm_unit))
615 print("Bottom flange width bf_b = {} mm and thickness tf_b = {} mm".format(self.bf_bbf_b/mm_unit, self.tf_btf_b/mm_unit))
616 print("Web material model ID = {}".format(self.web_mat_IDweb_mat_ID))
617 print("Top flange material model ID = {}".format(self.top_flange_mat_IDtop_flange_mat_ID))
618 print("Bottom flange material model ID = {}".format(self.bottom_flange_mat_IDbottom_flange_mat_ID))
619 print("Discretisation in the web [IJ or x/z dir, JK or y dir] = {}".format(self.discr_webdiscr_web))
620 print("Discretisation in the top flange [IJ or x/z dir, JK or y dir] = {}".format(self.discr_top_flangediscr_top_flange))
621 print("Discretisation in the bottom flange [IJ or x/z dir, JK or y dir] = {}".format(self.discr_bottom_flangediscr_bottom_flange))
622 print("")
623
624 if plot:
625 plot_fiber_section(self.fib_secfib_sec, matcolor=['r', 'b', 'g', 'k'])
626
627 if block:
628 plt.show()
629
630
631 def CreateFibers(self):
632 """
633 Method that initialise the fiber by calling the OpenSeesPy commands.
634 """
635 create_fiber_section(self.fib_secfib_sec)
636 self.InitializedInitialized = True
637 self.UpdateStoredDataUpdateStoredData()
638
639
641 """
642 Class that is the children of FibersIShape and combine the class SteelIShape (section) to retrieve the information needed.
643
644 @param FibersIShape: Parent class.
645 """
646 def __init__(self, ID: int, section: SteelIShape, top_flange_mat_ID: int, discr_top_flange: list, discr_bottom_flange: list, discr_web: list,
647 GJ=0.0, bottom_flange_mat_ID = -1, web_mat_ID = -1):
648 """
649 Constructor of the class.
650
651 @param ID (int): Unique fiber section ID.
652 @param section (SteelIShape): SteelIShape section object.
653 @param top_flange_mat_ID (int): ID of material model that will be assigned to the top flange fibers.
654 @param discr_top_flange (list): List with two entries: discretisation in IJ (x/z) and JK (y) for the top flange.
655 @param discr_bottom_flange (list): List with two entries: discretisation in IJ (x/z) and JK (y) for the bottom flange.
656 @param discr_web (list): List with two entries: discretisation in IJ (x/z) and JK (y) for the web.
657 @param GJ (float, optional): Linear-elastic torsional stiffness assigned to the section. Defaults to 0.0, assume no torsional stiffness.
658 @param bottom_flange_mat_ID (int): ID of material model that will be assigned to the bottom flange fibers.
659 Defaults to -1, e.g. equal to top_flange_mat_ID.
660 @param web_mat_ID (int): ID of material model that will be assigned to the web fibers.
661 Defaults to -1, e.g. equal to top_flange_mat_ID.
662 """
663 self.sectionsection = deepcopy(section)
664 if bottom_flange_mat_ID == -1: bottom_flange_mat_ID = top_flange_mat_ID
665 if web_mat_ID == -1: web_mat_ID = top_flange_mat_ID
666
667 super().__init__(ID, section.d, section.bf, section.bf, section.tf, section.tf, section.tw, top_flange_mat_ID, bottom_flange_mat_ID, web_mat_ID,
668 discr_top_flange, discr_bottom_flange, discr_web, GJ)
669 self.section_name_tagsection_name_tagsection_name_tag = section.name_tag
670 self.UpdateStoredDataUpdateStoredData()
671
672
673def plot_fiber_section(fiber_info, fill_shapes = True, matcolor=['#808080', '#D3D3D3', 'r', 'b', 'g', 'y']):
674 """
675 Plot fiber cross-section. Coordinate system used: plotting coordinte = (x, y), fiber section coordinate (z, y) = (-x, y)
676 Inspired by plot_fiber_section from ops_vis written by Seweryn Kokot.
677
678 @param fiber_info (list): List of lists (be careful with the local coordinate system!). The first list defines the fiber section: \n
679 ['section', 'Fiber', ID, '-GJ', GJ] \n
680 The other lists have one of the following format (coordinate input: (y, z)!): \n
681 ['layer', 'bar', mat_ID, A, y, z] # one bar \n
682 ['layer', 'straight', mat_ID, n_bars, A, yI, zI, yJ, zJ] # line range of bars (with I = first bar, J = last bar) \n
683 ['layer', 'circ', mat_ID, n_bars, A, yC, zC, r, (a0_deg), (a1_deg)] # circular range of bars (with C = center, r = radius) \n
684 ['patch', 'rect', mat_ID, *discr, -yI, zI, yK, -zK] # rectangle (with yI = yK = d/2; zI = zK = b/2) \n
685 ['patch', 'quad', mat_ID, *discr, yI, zI, yJ, zJ, yK, zK, yL, zL] # quadrilateral shaped (starting from bottom left, counterclockwise: I, J, K, L) \n
686 ['patch', 'circ', mat_ID, *discr, yC, zC, ri, re, (a0), (a1)] # (with C = center, ri = internal radius, re = external radius)
687 @param fill_shapes (bool, optional): Option to fill fibers with color specified in matcolor. Defaults to True.
688 @param matcolor (list, optional): List of colors for various material IDs. Defaults to ['#808080', '#D3D3D3', 'r', 'b', 'g', 'y'].
689
690 Example 1: Simple rectangle with 2 rebars (D = diameter) on top (e distance from the top and from the lateral borders).
691 Rectangle with first corner = I (bottom right) and second corner = K (top left); number of fibers = discr (list of 2)
692 fib_sec = [['section', 'Fiber', ID, '-GJ', GJ],
693 ['patch', 'rect', concrete_mat_ID, *discr, yI, zI, yK, zK],
694 ['layer', 'bar', bars_mat_ID, Ay, yI-e-D/2, zI-e-D/2], # left rebar
695 ['layer', 'bar', bars_mat_ID, Ay, yI-e-D/2, -(zI-e-D/2)]] # right rebar
696
697 Example 2: double symmetric I shape.
698 Each rectangle (2 flanges and 1 web): first corner = I (bottom right) and second corner = K (top left); number of fibers = discr (list of 2)
699 fib_sec = [['section', 'Fiber', ID, '-GJ', GJ],
700 ['patch', 'rect', mat_ID, *discr, yI_tf, zI_tf, yK_tf, zK_tf], # top flange
701 ['patch', 'rect', mat_ID, *discr, yI_bf, zI_bf, yK_bf, zK_bf], # bottom flange
702 ['patch', 'rect', mat_ID, *discr, yI_w, zI_w, yK_w, zK_w]] # web
703 """
704
705 mat_to_col = {}
706 fig, ax = plt.subplots()
707 ax.grid(False)
708
709 for item in fiber_info:
710 if item[0] == 'section':
711 fib_ID = item[2]
712 if item[0] == 'layer':
713 matID = item[2]
714 mat_to_col = __assignColorToMat(matID, mat_to_col, matcolor)
715 if item[1] == 'bar':
716 As = item[3]
717 Iy = item[4]
718 Iz = item[5]
719 r = np.sqrt(As / np.pi)
720 bar = Circle((-Iz, Iy), r, ec='k', fc='k', zorder=10)
721 ax.add_patch(bar)
722 if item[1] == 'straight':
723 n_bars = item[3]
724 As = item[4]
725 Iy, Iz, Jy, Jz = item[5], item[6], item[7], item[8]
726 r = np.sqrt(As / np.pi)
727 Y = np.linspace(Iy, Jy, n_bars)
728 Z = np.linspace(Iz, Jz, n_bars)
729 for zi, yi in zip(Z, Y):
730 bar = Circle((-zi, yi), r, ec='k', fc=mat_to_col[matID], zorder=10)
731 ax.add_patch(bar)
732 if item[1] == 'circ':
733 n_bars, As = item[3], item[4]
734 yC, zC, r = item[5], item[6], item[7]
735 if len(item) > 8:
736 a0_deg = item[8]
737 else:
738 a0_deg = 0.
739 a1_deg = 360. - 360./n_bars + a0_deg
740 if len(item) > 9: a1_deg = item[9]
741
742 a0_rad, a1_rad = np.pi * a0_deg / 180., np.pi * a1_deg / 180.
743 r_bar = np.sqrt(As / np.pi)
744 thetas = np.linspace(a0_rad, a1_rad, n_bars)
745 Y = yC + r * np.cos(thetas)
746 Z = zC + r * np.sin(thetas)
747 for zi, yi in zip(Z, Y):
748 bar = Circle((-zi, yi), r_bar, ec='k', fc=mat_to_col[matID], zorder=10)
749 ax.add_patch(bar)
750
751 if (item[0] == 'patch' and (item[1] == 'quad' or item[1] == 'quadr' or
752 item[1] == 'rect')):
753 matID, nIJ, nJK = item[2], item[3], item[4]
754 mat_to_col = __assignColorToMat(matID, mat_to_col, matcolor)
755
756
757 if item[1] == 'quad' or item[1] == 'quadr':
758 Iy, Iz, Jy, Jz = item[5], item[6], item[7], item[8]
759 Ky, Kz, Ly, Lz = item[9], item[10], item[11], item[12]
760
761 if item[1] == 'rect':
762 Iy, Iz, Ky, Kz = item[5], item[6], item[7], item[8]
763 Jy, Jz, Ly, Lz = Iy, Kz, Ky, Iz
764 # check order of definition
765 if Kz-Iz < 0 or Ky-Iy < 0: print("!!!!!!! WARNING !!!!!!! The fiber is not defined bottom right, top left")
766
767 # check for convexity (vector products)
768 outIJxIK = (Jy-Iy)*(Kz-Iz) - (Ky-Iy)*(Jz-Iz)
769 outIKxIL = (Ky-Iy)*(Lz-Iz) - (Ly-Iy)*(Kz-Iz)
770 # check if I, J, L points are colinear
771 outIJxIL = (Jy-Iy)*(Lz-Iz) - (Ly-Iy)*(Jz-Iz)
772 # outJKxJL = (Ky-Jy)*(Lz-Jz) - (Ly-Jy)*(Kz-Jz)
773
774 if -outIJxIK <= 0 or -outIKxIL <= 0 or -outIJxIL <= 0:
775 print('!!!!!!! WARNING !!!!!!! Patch quad is non-convex or non-counter-clockwise defined or has at least 3 colinear points in line')
776
777 IJz, IJy = np.linspace(Iz, Jz, nIJ+1), np.linspace(Iy, Jy, nIJ+1)
778 JKz, JKy = np.linspace(Jz, Kz, nJK+1), np.linspace(Jy, Ky, nJK+1)
779 LKz, LKy = np.linspace(Lz, Kz, nIJ+1), np.linspace(Ly, Ky, nIJ+1)
780 ILz, ILy = np.linspace(Iz, Lz, nJK+1), np.linspace(Iy, Ly, nJK+1)
781
782 if fill_shapes:
783 Z = np.zeros((nIJ+1, nJK+1))
784 Y = np.zeros((nIJ+1, nJK+1))
785
786 for j in range(nIJ+1):
787 Z[j, :] = np.linspace(IJz[j], LKz[j], nJK+1)
788 Y[j, :] = np.linspace(IJy[j], LKy[j], nJK+1)
789
790 for j in range(nIJ):
791 for k in range(nJK):
792 zy = np.array([[-Z[j, k], Y[j, k]],
793 [-Z[j, k+1], Y[j, k+1]],
794 [-Z[j+1, k+1], Y[j+1, k+1]],
795 [-Z[j+1, k], Y[j+1, k]]])
796 poly = Polygon(zy, True, ec='k', fc=mat_to_col[matID])
797 ax.add_patch(poly)
798
799 else:
800 # horizontal lines
801 for az, bz, ay, by in zip(IJz, LKz, IJy, LKy):
802 plt.plot([-az, -bz], [ay, by], 'b-', zorder=1)
803
804 # vertical lines
805 for az, bz, ay, by in zip(JKz, ILz, JKy, ILy):
806 plt.plot([-az, -bz], [ay, by], 'b-', zorder=1)
807
808 if item[0] == 'patch' and item[1] == 'circ':
809 matID, nc, nr = item[2], item[3], item[4]
810 mat_to_col = __assignColorToMat(matID, mat_to_col, matcolor)
811
812 yC, zC, ri, re = item[5], item[6], item[7], item[8]
813 if len(item) > 9:
814 a0 = item[9]
815 else:
816 a0 = 0.
817 a1 = 360. + a0
818 if len(item) > 10: a1 = item[10]
819
820 dr = (re - ri) / nr
821 dth = (a1 - a0) / nc
822
823 for j in range(nr):
824 rj = ri + j * dr
825 rj1 = rj + dr
826
827 for i in range(nc):
828 thi = a0 + i * dth
829 thi1 = thi + dth
830 wedge = Wedge((-zC, yC), rj1, thi, thi1, width=dr, ec='k', #Seweryn Kokot: (yC, -zC), wrong??
831 lw=1, fc=mat_to_col[matID])
832 ax.add_patch(wedge)
833 ax.set(xlabel='x dimension [{}]'.format(length_unit), ylabel='y dimension [{}]'.format(length_unit),
834 title='Fiber section (ID = {})'.format(fib_ID))
835 ax.axis('equal')
836
837
838def __assignColorToMat(matID: int, mat_to_col: dict, matcolor: list):
839 """
840 PRIVATE FUNCTION. Used to assign different colors for each material model assign to the fiber section.
841
842 @param matID (int): ID of the material model.
843 @param mat_to_col (dict): Dictionary to check with material model has which color.
844 @param matcolor (list): List of colors.
845
846 @returns dict: Updated dictionary.
847 """
848 if not matID in mat_to_col:
849 if len(mat_to_col) >= len(matcolor):
850 print("Warning: not enough colors defined for fiber section plot (white used)")
851 mat_to_col[matID] = 'w'
852 else:
853 mat_to_col[matID] = matcolor[len(mat_to_col)]
854 return mat_to_col
855
856
857def create_fiber_section(fiber_info):
858 """
859 Initialise fiber cross-section with OpenSeesPy commands.
860 For examples, see plot_fiber_section.
861 Inspired by fib_sec_list_to_cmds from ops_vis written by Seweryn Kokot
862
863 @param fiber_info (list): List of lists (be careful with the local coordinate system!). The first list defines the fiber section: \n
864 ['section', 'Fiber', ID, '-GJ', GJ] \n
865 The other lists have one of the following format (coordinate input: (y, z)!): \n
866 ['layer', 'bar', mat_ID, A, y, z] # one bar \n
867 ['layer', 'straight', mat_ID, n_bars, A, yI, zI, yJ, zJ] # line range of bars (with I = first bar, J = last bar) \n
868 ['layer', 'circ', mat_ID, n_bars, A, yC, zC, r, (a0_deg), (a1_deg)] # circular range of bars (with C = center, r = radius) \n
869 ['patch', 'rect', mat_ID, *discr, -yI, zI, yK, -zK] # rectangle (with yI = yK = d/2; zI = zK = b/2) \n
870 ['patch', 'quad', mat_ID, *discr, yI, zI, yJ, zJ, yK, zK, yL, zL] # quadrilateral shaped (starting from bottom left, counterclockwise: I, J, K, L) \n
871 ['patch', 'circ', mat_ID, *discr, yC, zC, ri, re, (a0), (a1)] # (with C = center, ri = internal radius, re = external radius)
872 """
873 for dat in fiber_info:
874 if dat[0] == 'section':
875 fib_ID, GJ = dat[2], dat[4]
876 section('Fiber', fib_ID, 'GJ', GJ)
877
878 if dat[0] == 'layer':
879 mat_ID = dat[2]
880 if dat[1] == 'straight':
881 n_bars = dat[3]
882 As = dat[4]
883 Iy, Iz, Jy, Jz = dat[5], dat[6], dat[7], dat[8]
884 layer('straight', mat_ID, n_bars, As, Iy, Iz, Jy, Jz)
885 if dat[1] == 'bar':
886 As = dat[3]
887 Iy = dat[4]
888 Iz = dat[5]
889 fiber(Iy, Iz, As, mat_ID)
890 # layer('straight', mat_ID, 1, As, Iy, Iz, Iy, Iz)
891 if dat[1] == 'circ':
892 n_bars, As = dat[3], dat[4]
893 yC, zC, r = dat[5], dat[6], dat[7]
894 if len(dat) > 8:
895 a0_deg = dat[8]
896 else:
897 a0_deg = 0.
898 a1_deg = 360. - 360./n_bars + a0_deg
899 if len(dat) > 9: a1_deg = dat[9]
900 layer('circ', mat_ID, n_bars, As, yC, zC, r, a0_deg, a1_deg)
901
902 if dat[0] == 'patch':
903 mat_ID = dat[2]
904 nIJ = dat[4]
905 nJK = dat[3]
906
907 if dat[1] == 'quad' or dat[1] == 'quadr':
908 Iy, Iz, Jy, Jz = dat[5], dat[6], dat[7], dat[8]
909 Ky, Kz, Ly, Lz = dat[9], dat[10], dat[11], dat[12]
910 patch('quad', mat_ID, nIJ, nJK, Iy, Iz, Jy, Jz, Ky, Kz,
911 Ly, Lz)
912
913 if dat[1] == 'rect':
914 Iy, Iz, Ky, Kz = dat[5], dat[6], dat[7], dat[8]
915 patch('rect', mat_ID, nIJ, nJK, Iy, Iz, Ky, Kz)
916 # patch('rect', mat_ID, nIJ, nJK, Iy, Kz, Ky, Iz)
917
918 if dat[1] == 'circ':
919 mat_ID, nc, nr = dat[2], dat[3], dat[4]
920 yC, zC, ri, re = dat[5], dat[6], dat[7], dat[8]
921 if len(dat) > 9:
922 a0 = dat[9]
923 else:
924 a0 = 0.
925 a1 = 360. + a0
926 if len(dat) > 10: a1 = dat[10]
927 patch('circ', mat_ID, nc, nr, yC, zC, ri, re, a0, a1)
928
Class that is the children of FibersCirc and combine the class RCCircShape (section) to retrieve the ...
Definition: Fibers.py:435
def __init__(self, int ID, RCCircShape section, int unconf_mat_ID, int conf_mat_ID, int bars_mat_ID, list discr_core, list discr_cover, alpha_i=0.0, GJ=0)
Constructor of the class.
Definition: Fibers.py:442
Class that stores funcions, material properties, geometric and mechanical parameters for a circular R...
Definition: Fibers.py:263
def ShowInfo(self, plot=False, block=False)
Implementation of the homonym abstract method.
Definition: Fibers.py:399
def __init__(self, int ID, b, e, D_bars, Ay, n_bars, D_hoops, int unconf_mat_ID, int conf_mat_ID, int bars_mat_ID, list discr_core, list discr_cover, alpha_i=0.0, GJ=0.0)
Constructor of the class.
Definition: Fibers.py:271
def CreateFibers(self)
Method that initialise the fiber by calling the OpenSeesPy commands.
Definition: Fibers.py:426
def UpdateStoredData(self)
Implementation of the homonym abstract method.
Definition: Fibers.py:373
def ReInit(self)
Implementation of the homonym abstract method.
Definition: Fibers.py:344
Class that is the children of FibersIShape and combine the class SteelIShape (section) to retrieve th...
Definition: Fibers.py:640
def __init__(self, int ID, SteelIShape section, int top_flange_mat_ID, list discr_top_flange, list discr_bottom_flange, list discr_web, GJ=0.0, bottom_flange_mat_ID=-1, web_mat_ID=-1)
Constructor of the class.
Definition: Fibers.py:647
Class that stores funcions, material properties, geometric and mechanical parameters for a steel I sh...
Definition: Fibers.py:465
def ShowInfo(self, plot=False, block=False)
Implementation of the homonym abstract method.
Definition: Fibers.py:602
def CreateFibers(self)
Method that initialise the fiber by calling the OpenSeesPy commands.
Definition: Fibers.py:631
def UpdateStoredData(self)
Implementation of the homonym abstract method.
Definition: Fibers.py:578
def __init__(self, int ID, d, bf_t, bf_b, tf_t, tf_b, tw, int top_flange_mat_ID, int bottom_flange_mat_ID, int web_mat_ID, list discr_top_flange, list discr_bottom_flange, list discr_web, GJ=0.0)
Constructor of the class.
Definition: Fibers.py:473
def ReInit(self)
Implementation of the homonym abstract method.
Definition: Fibers.py:546
Class that is the children of FibersRect and combine the class RCRectShape (section) to retrieve the ...
Definition: Fibers.py:235
def __init__(self, int ID, RCRectShape section, int unconf_mat_ID, int conf_mat_ID, int bars_mat_ID, list discr_core, list discr_cover_lateral, list discr_cover_topbottom, GJ=0)
Constructor of the class.
Definition: Fibers.py:242
Class that stores funcions, material properties, geometric and mechanical parameters for a rectangula...
Definition: Fibers.py:28
def ShowInfo(self, plot=False, block=False)
Implementation of the homonym abstract method.
Definition: Fibers.py:199
def CreateFibers(self)
Method that initialises the fiber by calling the OpenSeesPy commands.
Definition: Fibers.py:226
def __init__(self, int ID, b, d, Ay, D_hoops, e, int unconf_mat_ID, int conf_mat_ID, int bars_mat_ID, np.ndarray bars_x, np.ndarray ranges_y, list discr_core, list discr_cover_lateral, list discr_cover_topbottom, GJ=0.0)
Constructor of the class.
Definition: Fibers.py:36
def UpdateStoredData(self)
Implementation of the homonym abstract method.
Definition: Fibers.py:175
def ReInit(self)
Implementation of the homonym abstract method.
Definition: Fibers.py:122
Parent abstract class for the storage and manipulation of a fiber's information (mechanical and geome...
Definition: Fibers.py:18
Module with the parent abstract class DataManagement.
def create_fiber_section(fiber_info)
Initialise fiber cross-section with OpenSeesPy commands.
Definition: Fibers.py:857
def plot_fiber_section(fiber_info, fill_shapes=True, matcolor=['#808080', '#D3D3D3', 'r', 'b', 'g', 'y'])
Plot fiber cross-section.
Definition: Fibers.py:673