OpenSeesPyAssistant 1.1
OpenSeesPy for everyone
FibersRect Class Reference

Class that stores funcions, material properties, geometric and mechanical parameters for a rectangular RC fiber section. More...

Inheritance diagram for FibersRect:
Fibers FibersRectRCRectShape

Public Member Functions

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. More...
 
def CreateFibers (self)
 Method that initialises the fiber by calling the OpenSeesPy commands. More...
 
def ReInit (self)
 Implementation of the homonym abstract method. More...
 
def ShowInfo (self, plot=False, block=False)
 Implementation of the homonym abstract method. More...
 
def UpdateStoredData (self)
 Implementation of the homonym abstract method. More...
 

Public Attributes

 Ay
 
 b
 
 bars_mat_ID
 
 bars_x
 
 conf_mat_ID
 
 d
 
 D_hoops
 
 data
 
 discr_core
 
 discr_cover_lateral
 
 discr_cover_topbottom
 
 e
 
 fib_sec
 
 GJ
 
 ID
 
 Initialized
 
 ranges_y
 
 rebarYZ
 
 section_name_tag
 
 unconf_mat_ID
 

Detailed Description

Class that stores funcions, material properties, geometric and mechanical parameters for a rectangular RC fiber section.

Coordinates: plotting coordinte (x, y) = fiber section coordinate (z, y) = (-x, y). For more information, see the OpenSeesPy documentation.

Parameters
FibersParent abstract class.

Definition at line 28 of file Fibers.py.

Constructor & Destructor Documentation

◆ __init__()

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.

Parameters
ID(int): Unique fiber section ID.
b(float): Width of the section.
d(float): Depth of the section.
Ay(float): Area of one vertical reinforcing bar.
D_hoops(float): Diameter of the hoops.
e(float): Concrete cover.
unconf_mat_ID(int): ID of material model that will be assigned to the unconfined fibers.
conf_mat_ID(int): ID of material model that will be assigned to the confined fibers.
bars_mat_ID(int): ID of material model that will be assigned to the reinforcing bars fibers.
bars_x(np.ndarray): Array with a range of aligned vertical reinforcing bars for each row in x direction. Distances from border to bar centerline, bar to bar centerlines and finally bar centerline to border in the x direction (aligned). Starting from the left to right, from the top range to the bottom one. The number of bars for each range can vary; in this case, add this argument when defining the array " dtype = object"
ranges_y(np.ndarray): Array of dimension 1 with the position or spacing in y of the ranges in bars_x. Distances from border to range centerlines, range to range centerlines and finally range centerline to border in the y direction. Starting from the top range to the bottom one.
discr_core(list): List with two entries: discretisation in IJ (x/z) and JK (y) for the confined core.
discr_cover_lateral(list): List with two entries: discretisation in IJ (x/z) and JK (y) for the lateral unconfined cover.
discr_cover_topbottom(list): List with two entries: discretisation in IJ (x/z) and JK (y) for the top and bottom unconfined cover.
GJ(float, optional): Linear-elastic torsional stiffness assigned to the section. Defaults to 0.0, assume no torsional stiffness.
Exceptions
NegativeValueID needs to be a positive integer.
NegativeValueb needs to be positive.
NegativeValued needs to be positive.
NegativeValueAy needs to be positive.
NegativeValueD_hoops needs to be positive.
NegativeValuee needs to be positive.
NegativeValueunconf_mat_ID needs to be a positive integer.
NegativeValueconf_mat_ID needs to be a positive integer.
NegativeValuebars_mat_ID needs to be a positive integer.
WrongDimensionNumber of rows in the list bars_x needs to be the same of the length of ranges_y - 1.
InconsistentGeometryThe sum of the distances for each row in bars_x should be equal to the section's width (tol = 5 mm).
InconsistentGeometryThe sum of the distances in ranges_y should be equal to the section's depth (tol = 5 mm).
InconsistentGeometrye should be smaller than half the depth and the width of the section.
WrongDimensiondiscr_core has a length of 2.
WrongDimensiondiscr_cover_lateral has a length of 2.
WrongDimensiondiscr_cover_topbottom has a length of 2.
NegativeValueGJ needs to be positive.

Reimplemented in FibersRectRCRectShape.

Definition at line 35 of file Fibers.py.

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.ID = ID
102 self.b = b
103 self.d = d
104 self.Ay = Ay
105 self.D_hoops = D_hoops
106 self.e = e
107 self.unconf_mat_ID = unconf_mat_ID
108 self.conf_mat_ID = conf_mat_ID
109 self.bars_mat_ID = bars_mat_ID
110 self.bars_x = deepcopy(bars_x)
111 self.ranges_y = copy(ranges_y)
112 self.discr_core = copy(discr_core)
113 self.discr_cover_lateral = copy(discr_cover_lateral)
114 self.discr_cover_topbottom = copy(discr_cover_topbottom)
115 self.GJ = GJ
116
117 # Initialized the parameters that are dependent from others
118 self.section_name_tag = "None"
119 self.Initialized = False
120 self.ReInit()
121

Member Function Documentation

◆ CreateFibers()

def CreateFibers (   self)

Method that initialises the fiber by calling the OpenSeesPy commands.

Definition at line 226 of file Fibers.py.

226 def CreateFibers(self):
227 """
228 Method that initialises the fiber by calling the OpenSeesPy commands.
229 """
230 create_fiber_section(self.fib_sec)
231 self.Initialized = True
232 self.UpdateStoredData()
233
234
def create_fiber_section(fiber_info)
Initialise fiber cross-section with OpenSeesPy commands.
Definition: Fibers.py:857

◆ ReInit()

def ReInit (   self)

Implementation of the homonym abstract method.

See parent class DataManagement for detailed information.

Definition at line 122 of file Fibers.py.

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_tag != "None": self.section_name_tag = self.section_name_tag + " (modified)"
129
130 # Parameters
131 z1 = self.b/2
132 y1 = self.d/2
133 zc = z1-self.e-self.D_hoops/2
134 yc = y1-self.e-self.D_hoops/2
135
136 # Create the concrete core fibers
137 core = [-yc, -zc, yc, zc]
138 core_cmd = ['patch', 'rect', self.conf_mat_ID, *self.discr_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_ID, *self.discr_cover_topbottom, *cover_up]
146 cover_down_cmd = ['patch', 'rect', self.unconf_mat_ID, *self.discr_cover_topbottom, *cover_down]
147 cover_left_cmd = ['patch', 'rect', self.unconf_mat_ID, *self.discr_cover_lateral, *cover_left]
148 cover_right_cmd = ['patch', 'rect', self.unconf_mat_ID, *self.discr_cover_lateral, *cover_right]
149 self.fib_sec = [['section', 'Fiber', self.ID, '-GJ', self.GJ],
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_x:
156 nr_bars += np.size(range)-1
157 rebarY = -np.cumsum(self.ranges_y[0:-1]) + y1
158 self.rebarYZ = np.zeros((nr_bars, 2))
159
160 iter = 0
161 for ii, Y in enumerate(rebarY):
162 rebarZ = -np.cumsum(self.bars_x[ii][0:-1]) + z1
163 for Z in rebarZ:
164 self.rebarYZ[iter, :] = [Y, Z]
165 iter = iter + 1
166
167 for YZ in self.rebarYZ:
168 self.fib_sec.append(['layer', 'bar', self.bars_mat_ID, self.Ay, *YZ])
169
170 # Data storage for loading/saving
171 self.UpdateStoredData()
172
173
Module with the parent abstract class DataManagement.

◆ ShowInfo()

def ShowInfo (   self,
  plot = False,
  block = False 
)

Implementation of the homonym abstract method.

See parent class DataManagement for detailed information.

Parameters
plot(bool, optional): Option to show the plot of the fiber. Defaults to False.
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.

Definition at line 199 of file Fibers.py.

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.ID))
209 print("Section associated: {} ".format(self.section_name_tag))
210 print("Base b = {} mm and depth d = {} mm".format(self.b/mm_unit, self.d/mm_unit))
211 print("Confined material model ID = {}".format(self.conf_mat_ID))
212 print("Unconfined material model ID = {}".format(self.unconf_mat_ID))
213 print("Bars material model ID = {}".format(self.bars_mat_ID))
214 print("Discretisation in the core [IJ or x/z dir, JK or y dir] = {}".format(self.discr_core))
215 print("Discretisation in the lateral covers [IJ or x/z dir, JK or y dir] = {}".format(self.discr_cover_lateral))
216 print("Discretisation in the top and bottom covers [IJ or x/z dir, JK or y dir] = {}".format(self.discr_cover_topbottom))
217 print("")
218
219 if plot:
220 plot_fiber_section(self.fib_sec, matcolor=['#808080', '#D3D3D3', 'k'])
221
222 if block:
223 plt.show()
224
225
def plot_fiber_section(fiber_info, fill_shapes=True, matcolor=['#808080', '#D3D3D3', 'r', 'b', 'g', 'y'])
Plot fiber cross-section.
Definition: Fibers.py:673

◆ UpdateStoredData()

def UpdateStoredData (   self)

Implementation of the homonym abstract method.

See parent class DataManagement for detailed information.

Definition at line 175 of file Fibers.py.

175 def UpdateStoredData(self):
176 """
177 Implementation of the homonym abstract method.
178 See parent class DataManagement for detailed information.
179 """
180 self.data = [["INFO_TYPE", "FibersRect"], # Tag for differentiating different data
181 ["ID", self.ID],
182 ["section_name_tag", self.section_name_tag],
183 ["b", self.b],
184 ["d", self.d],
185 ["Ay", self.Ay],
186 ["D_hoops", self.D_hoops],
187 ["e", self.e],
188 ["GJ", self.GJ],
189 ["conf_mat_ID", self.conf_mat_ID],
190 ["discr_core", self.discr_core],
191 ["unconf_mat_ID", self.unconf_mat_ID],
192 ["discr_cover_topbottom", self.discr_cover_topbottom],
193 ["discr_cover_lateral", self.discr_cover_lateral],
194 ["bars_mat_ID", self.bars_mat_ID],
195 ["bars_x", self.bars_x],
196 ["ranges_y", self.ranges_y],
197 ["Initialized", self.Initialized]]
198

Member Data Documentation

◆ Ay

Ay

Definition at line 104 of file Fibers.py.

◆ b

b

Definition at line 102 of file Fibers.py.

◆ bars_mat_ID

bars_mat_ID

Definition at line 109 of file Fibers.py.

◆ bars_x

bars_x

Definition at line 110 of file Fibers.py.

◆ conf_mat_ID

conf_mat_ID

Definition at line 108 of file Fibers.py.

◆ d

d

Definition at line 103 of file Fibers.py.

◆ D_hoops

D_hoops

Definition at line 105 of file Fibers.py.

◆ data

data

Definition at line 180 of file Fibers.py.

◆ discr_core

discr_core

Definition at line 112 of file Fibers.py.

◆ discr_cover_lateral

discr_cover_lateral

Definition at line 113 of file Fibers.py.

◆ discr_cover_topbottom

discr_cover_topbottom

Definition at line 114 of file Fibers.py.

◆ e

e

Definition at line 106 of file Fibers.py.

◆ fib_sec

fib_sec

Definition at line 149 of file Fibers.py.

◆ GJ

GJ

Definition at line 115 of file Fibers.py.

◆ ID

ID

Definition at line 101 of file Fibers.py.

◆ Initialized

Initialized

Definition at line 119 of file Fibers.py.

◆ ranges_y

ranges_y

Definition at line 111 of file Fibers.py.

◆ rebarYZ

rebarYZ

Definition at line 158 of file Fibers.py.

◆ section_name_tag

section_name_tag

Definition at line 118 of file Fibers.py.

◆ unconf_mat_ID

unconf_mat_ID

Definition at line 107 of file Fibers.py.


The documentation for this class was generated from the following file: