2Module for the fibers (rectangular, circular and I shape).
7import matplotlib.pyplot
as plt
8from matplotlib.patches
import Circle, Polygon, Wedge
10from copy
import copy, deepcopy
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.
23 @param DataManagement: Parent abstract
class.
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.
33 @param Fibers: Parent abstract
class.
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):
38 Constructor of the class.
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.
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.
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
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()
124 Implementation of the homonym abstract method.
133 zc = z1-self.
ee-self.
D_hoopsD_hoops/2
134 yc = y1-self.
ee-self.
D_hoopsD_hoops/2
137 core = [-yc, -zc, yc, zc]
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]
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]
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
161 for ii, Y
in enumerate(rebarY):
162 rebarZ = -np.cumsum(self.
bars_xbars_x[ii][0:-1]) + z1
164 self.
rebarYZrebarYZ[iter, :] = [Y, Z]
177 Implementation of the homonym abstract method.
180 self.datadata = [["INFO_TYPE",
"FibersRect"],
186 [
"D_hoops", self.
D_hoopsD_hoops],
195 [
"bars_x", self.
bars_xbars_x],
196 [
"ranges_y", self.
ranges_yranges_y],
201 Implementation of the homonym abstract method.
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.
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))
228 Method that initialises the fiber by calling the OpenSeesPy commands.
237 Class that is the children of FibersRect
and combine the
class RCRectShape (
section) to retrieve the information needed.
239 @param FibersRect: Parent
class.
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):
244 Constructor of the class.
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.
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)
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.
268 @param Fibers: Parent abstract
class.
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):
273 Constructor of the class.
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.
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.
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()
346 Implementation of the homonym abstract method.
361 self.
fib_secfib_sec = [[
'section',
'Fiber', self.
IDID,
'-GJ', self.
GJGJ],
366 self.
fib_secfib_sec.append(bars_cmd)
375 Implementation of the homonym abstract method.
378 self.datadata = [["INFO_TYPE",
"FibersCirc"],
383 [
"r_core", self.
r_corer_core],
384 [
"D_bars", self.
D_barsD_bars],
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],
401 Implementation of the homonym abstract method.
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.
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))
428 Method that initialise the fiber by calling the OpenSeesPy commands.
437 Class that is the children of FibersCirc
and combine the
class RCCircShape (
section) to retrieve the information needed.
439 @param FibersCirc: Parent
class.
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):
444 Constructor of the class.
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.
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)
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.
470 @param Fibers: Parent abstract
class.
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):
475 Constructor of the class.
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.
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.
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()
548 Implementation of the homonym abstract method.
556 y1 = (self.
dd - self.
tf_ttf_t - self.
tf_btf_b)/2
559 flange_top = [y1, -self.
bf_tbf_t/2, y1+self.
tf_ttf_t, self.
bf_tbf_t/2]
563 flange_bottom = [-y1-self.
tf_btf_b, -self.
bf_bbf_b/2, -y1, self.
bf_bbf_b/2]
567 web = [-y1, -z1, y1, z1]
570 self.
fib_secfib_sec = [[
'section',
'Fiber', self.
IDID,
'-GJ', self.
GJGJ],
571 flange_top_cmd, web_cmd, flange_bottom_cmd]
580 Implementation of the homonym abstract method.
583 self.datadata = [["INFO_TYPE",
"FibersIShape"],
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],
604 Implementation of the homonym abstract method.
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.
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))
633 Method that initialise the fiber by calling the OpenSeesPy commands.
642 Class that is the children of FibersIShape
and combine the
class SteelIShape (
section) to retrieve the information needed.
644 @param FibersIShape: Parent
class.
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):
649 Constructor of the class.
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.
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
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)
673def plot_fiber_section(fiber_info, fill_shapes = True, matcolor=['#808080', '#D3D3D3', 'r', 'b', 'g', 'y']):
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.
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]
682 [
'layer',
'straight', mat_ID, n_bars, A, yI, zI, yJ, zJ]
683 [
'layer',
'circ', mat_ID, n_bars, A, yC, zC, r, (a0_deg), (a1_deg)]
684 [
'patch',
'rect', mat_ID, *discr, -yI, zI, yK, -zK]
685 [
'patch',
'quad', mat_ID, *discr, yI, zI, yJ, zJ, yK, zK, yL, zL]
686 [
'patch',
'circ', mat_ID, *discr, yC, zC, ri, re, (a0), (a1)]
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'].
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],
695 [
'layer',
'bar', bars_mat_ID, Ay, yI-e-D/2, -(zI-e-D/2)]]
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],
701 [
'patch',
'rect', mat_ID, *discr, yI_bf, zI_bf, yK_bf, zK_bf],
702 [
'patch',
'rect', mat_ID, *discr, yI_w, zI_w, yK_w, zK_w]]
706 fig, ax = plt.subplots()
709 for item
in fiber_info:
710 if item[0] ==
'section':
712 if item[0] ==
'layer':
714 mat_to_col = __assignColorToMat(matID, mat_to_col, matcolor)
719 r = np.sqrt(As / np.pi)
720 bar = Circle((-Iz, Iy), r, ec=
'k', fc=
'k', zorder=10)
722 if item[1] ==
'straight':
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)
732 if item[1] ==
'circ':
733 n_bars, As = item[3], item[4]
734 yC, zC, r = item[5], item[6], item[7]
739 a1_deg = 360. - 360./n_bars + a0_deg
740 if len(item) > 9: a1_deg = item[9]
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)
751 if (item[0] ==
'patch' and (item[1] ==
'quad' or item[1] ==
'quadr' or
753 matID, nIJ, nJK = item[2], item[3], item[4]
754 mat_to_col = __assignColorToMat(matID, mat_to_col, matcolor)
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]
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
765 if Kz-Iz < 0
or Ky-Iy < 0: print(
"!!!!!!! WARNING !!!!!!! The fiber is not defined bottom right, top left")
768 outIJxIK = (Jy-Iy)*(Kz-Iz) - (Ky-Iy)*(Jz-Iz)
769 outIKxIL = (Ky-Iy)*(Lz-Iz) - (Ly-Iy)*(Kz-Iz)
771 outIJxIL = (Jy-Iy)*(Lz-Iz) - (Ly-Iy)*(Jz-Iz)
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')
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)
783 Z = np.zeros((nIJ+1, nJK+1))
784 Y = np.zeros((nIJ+1, nJK+1))
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)
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])
801 for az, bz, ay, by
in zip(IJz, LKz, IJy, LKy):
802 plt.plot([-az, -bz], [ay, by],
'b-', zorder=1)
805 for az, bz, ay, by
in zip(JKz, ILz, JKy, ILy):
806 plt.plot([-az, -bz], [ay, by],
'b-', zorder=1)
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)
812 yC, zC, ri, re = item[5], item[6], item[7], item[8]
818 if len(item) > 10: a1 = item[10]
830 wedge = Wedge((-zC, yC), rj1, thi, thi1, width=dr, ec=
'k',
831 lw=1, fc=mat_to_col[matID])
833 ax.set(xlabel=
'x dimension [{}]'.format(length_unit), ylabel=
'y dimension [{}]'.format(length_unit),
834 title=
'Fiber section (ID = {})'.format(fib_ID))
838def __assignColorToMat(matID: int, mat_to_col: dict, matcolor: list):
840 PRIVATE FUNCTION. Used to assign different colors for each material model assign to the fiber section.
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.
846 @returns dict: Updated dictionary.
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'
853 mat_to_col[matID] = matcolor[len(mat_to_col)]
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
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]
867 [
'layer',
'straight', mat_ID, n_bars, A, yI, zI, yJ, zJ]
868 [
'layer',
'circ', mat_ID, n_bars, A, yC, zC, r, (a0_deg), (a1_deg)]
869 [
'patch',
'rect', mat_ID, *discr, -yI, zI, yK, -zK]
870 [
'patch',
'quad', mat_ID, *discr, yI, zI, yJ, zJ, yK, zK, yL, zL]
871 [
'patch',
'circ', mat_ID, *discr, yC, zC, ri, re, (a0), (a1)]
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)
878 if dat[0] ==
'layer':
880 if dat[1] ==
'straight':
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)
889 fiber(Iy, Iz, As, mat_ID)
892 n_bars, As = dat[3], dat[4]
893 yC, zC, r = dat[5], dat[6], dat[7]
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)
902 if dat[0] ==
'patch':
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,
914 Iy, Iz, Ky, Kz = dat[5], dat[6], dat[7], dat[8]
915 patch(
'rect', mat_ID, nIJ, nJK, Iy, Iz, Ky, Kz)
919 mat_ID, nc, nr = dat[2], dat[3], dat[4]
920 yC, zC, ri, re = dat[5], dat[6], dat[7], dat[8]
926 if len(dat) > 10: a1 = dat[10]
927 patch(
'circ', mat_ID, nc, nr, yC, zC, ri, re, a0, a1)
Class that is the children of FibersCirc and combine the class RCCircShape (section) to retrieve the ...
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.
Class that stores funcions, material properties, geometric and mechanical parameters for a circular R...
def ShowInfo(self, plot=False, block=False)
Implementation of the homonym abstract method.
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.
def CreateFibers(self)
Method that initialise the fiber by calling the OpenSeesPy commands.
def UpdateStoredData(self)
Implementation of the homonym abstract method.
def ReInit(self)
Implementation of the homonym abstract method.
Class that is the children of FibersIShape and combine the class SteelIShape (section) to retrieve th...
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.
Class that stores funcions, material properties, geometric and mechanical parameters for a steel I sh...
def ShowInfo(self, plot=False, block=False)
Implementation of the homonym abstract method.
def CreateFibers(self)
Method that initialise the fiber by calling the OpenSeesPy commands.
def UpdateStoredData(self)
Implementation of the homonym abstract method.
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.
def ReInit(self)
Implementation of the homonym abstract method.
Class that is the children of FibersRect and combine the class RCRectShape (section) to retrieve the ...
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.
Class that stores funcions, material properties, geometric and mechanical parameters for a rectangula...
def ShowInfo(self, plot=False, block=False)
Implementation of the homonym abstract method.
def CreateFibers(self)
Method that initialises the fiber by calling the OpenSeesPy commands.
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.
def UpdateStoredData(self)
Implementation of the homonym abstract method.
def ReInit(self)
Implementation of the homonym abstract method.
Parent abstract class for the storage and manipulation of a fiber's information (mechanical and geome...
Module with the parent abstract class DataManagement.
def create_fiber_section(fiber_info)
Initialise fiber cross-section with OpenSeesPy commands.
def plot_fiber_section(fiber_info, fill_shapes=True, matcolor=['#808080', '#D3D3D3', 'r', 'b', 'g', 'y'])
Plot fiber cross-section.