structuralcodes 0.1.0__py3-none-any.whl → 0.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of structuralcodes might be problematic. Click here for more details.

@@ -3,7 +3,7 @@
3
3
  from . import codes, core, geometry, materials, sections
4
4
  from .codes import get_design_codes, set_design_code, set_national_annex
5
5
 
6
- __version__ = '0.1.0'
6
+ __version__ = '0.1.1'
7
7
 
8
8
  __all__ = [
9
9
  'set_design_code',
@@ -191,7 +191,7 @@ def eps_cs(
191
191
  ValueError: Checks if the cement class equals R, N or S.
192
192
  """
193
193
  _cement_class = cement_class.upper().strip()
194
- beta_ds = (t - t_S) / (t - t_S + 0.04 * h_0 ** (1 / 3)) # (3.10)
194
+ beta_ds = (t - t_S) / (t - t_S + 0.04 * h_0 ** (3 / 2)) # (3.10)
195
195
  beta_as = 1 - math.exp(-0.2 * t**0.5) # (3.13)
196
196
 
197
197
  # k_h is defined in Table 3.3 under (3.9)
@@ -1,6 +1,7 @@
1
1
  """Design rules according to EN 1992-1-1 regarding shear."""
2
2
 
3
3
  import math
4
+ import typing as t
4
5
 
5
6
  # General functions
6
7
 
@@ -171,6 +172,7 @@ def VRdc(
171
172
  fcd: float,
172
173
  k1: float = 0.15,
173
174
  gamma_c: float = 1.5,
175
+ CRdc: t.Optional[float] = None,
174
176
  ) -> float:
175
177
  """Compute the design strength of the shear resistance.
176
178
 
@@ -194,11 +196,13 @@ def VRdc(
194
196
  value might differ between National Annexes.
195
197
  gamma_c (float): Partial factor for concrete. Default value = 1.5,
196
198
  value might differ between National Annexes.
199
+ CRdc (Optional[float]): Scaling factor for the shear resistance.
200
+ Default value is 0.18 / gamma_c.
197
201
 
198
202
  Returns:
199
203
  float: The concrete shear resistance in MPa.
200
204
  """
201
- CRdc = 0.18 / gamma_c
205
+ CRdc = CRdc or 0.18 / gamma_c
202
206
  return (
203
207
  max(
204
208
  CRdc * _k(d) * (100 * _rho_L(Asl, bw, d) * fck) ** (1.0 / 3.0)
@@ -291,7 +291,9 @@ def beta_ds(
291
291
  numpy.ndarray: Multiplication factor used for calculating the drying
292
292
  shrinkage as a function of time.
293
293
  """
294
- return np.sqrt((time - ts) / (0.035 * (notional_size) ** 2 + (time - ts)))
294
+ time_drying = np.atleast_1d(time - ts)
295
+ time_drying[time_drying < 0.0] = 0.0
296
+ return np.sqrt(time_drying / (0.035 * (notional_size) ** 2 + time_drying))
295
297
 
296
298
 
297
299
  def beta_s1(fcm: float) -> float:
@@ -18,6 +18,7 @@ def add_reinforcement(
18
18
  coords: t.Tuple[float, float],
19
19
  diameter: float,
20
20
  material: t.Union[Material, ConstitutiveLaw],
21
+ group_label: t.Optional[str] = None,
21
22
  ) -> CompoundGeometry:
22
23
  """Add a single bar given coordinate.
23
24
 
@@ -28,12 +29,16 @@ def add_reinforcement(
28
29
  diameter (float): The diameter of the reinforcement.
29
30
  material (Union(Material, ConstitutiveLaw)): A material or a
30
31
  constitutive law for the behavior of the reinforcement.
32
+ group_label (Optional(str)): A label for grouping several objects
33
+ (default is None).
31
34
 
32
35
  Returns:
33
36
  CompoundGeometry: A compound geometry with the original geometry and
34
37
  the reinforcement.
35
38
  """
36
- bar = PointGeometry(Point(coords), diameter, material)
39
+ bar = PointGeometry(
40
+ Point(coords), diameter, material, group_label=group_label
41
+ )
37
42
  return geo + bar
38
43
 
39
44
 
@@ -47,6 +52,7 @@ def add_reinforcement_line(
47
52
  s: float = 0.0,
48
53
  first: bool = True,
49
54
  last: bool = True,
55
+ group_label: t.Optional[str] = None,
50
56
  ) -> CompoundGeometry:
51
57
  """Adds a set of bars distributed in a line.
52
58
 
@@ -66,6 +72,8 @@ def add_reinforcement_line(
66
72
  True).
67
73
  last (bool): Boolean indicating if placing the last bar (default =
68
74
  True).
75
+ group_label (Optional(str)): A label for grouping several objects
76
+ (default is None).
69
77
 
70
78
  Note:
71
79
  At least n or s should be greater than zero.
@@ -110,6 +118,10 @@ def add_reinforcement_line(
110
118
  continue
111
119
  coords = p1 + v * s * i
112
120
  geo = add_reinforcement(
113
- geo, (coords[0], coords[1]), diameter, material
121
+ geo,
122
+ (coords[0], coords[1]),
123
+ diameter,
124
+ material,
125
+ group_label=group_label,
114
126
  )
115
127
  return geo
@@ -2,9 +2,9 @@
2
2
 
3
3
  from __future__ import annotations # To have clean hints of ArrayLike in docs
4
4
 
5
+ import math
5
6
  import typing as t
6
7
  import warnings
7
- from math import cos, sin
8
8
 
9
9
  import numpy as np
10
10
  from numpy.typing import ArrayLike
@@ -208,7 +208,13 @@ class GenericSectionCalculator(SectionCalculator):
208
208
  )
209
209
  # Change sign due to moment sign convention
210
210
  izz *= -1
211
- if abs(abs(izy) - abs(iyz)) > 10:
211
+
212
+ # Compute reasonable value for absolute tolerance for checking iyz
213
+ rel_tol = 1e-9
214
+ abs_tol = 0.5 * (iyy + izz) * rel_tol
215
+
216
+ # Check calculated cross moment
217
+ if not math.isclose(iyz, izy, rel_tol=rel_tol, abs_tol=abs_tol):
212
218
  error_str = 'Something went wrong with computation of '
213
219
  error_str += f'moments of area: iyz = {iyz}, izy = {izy}.\n'
214
220
  error_str += 'They should be equal but are not!'
@@ -574,7 +580,12 @@ class GenericSectionCalculator(SectionCalculator):
574
580
  """Rotate triangulated data of angle theta."""
575
581
  rotated_triangulated_data = []
576
582
  for tr in self.triangulated_data:
577
- T = np.array([[cos(theta), -sin(theta)], [sin(theta), cos(theta)]])
583
+ T = np.array(
584
+ [
585
+ [np.cos(theta), -np.sin(theta)],
586
+ [np.sin(theta), np.cos(theta)],
587
+ ]
588
+ )
578
589
  coords = np.vstack((tr[0], tr[1]))
579
590
  coords_r = T @ coords
580
591
  rotated_triangulated_data.append(
@@ -636,7 +647,9 @@ class GenericSectionCalculator(SectionCalculator):
636
647
  )
637
648
 
638
649
  # Rotate back to section CRS TODO Check
639
- T = np.array([[cos(theta), -sin(theta)], [sin(theta), cos(theta)]])
650
+ T = np.array(
651
+ [[np.cos(theta), -np.sin(theta)], [np.sin(theta), np.cos(theta)]]
652
+ )
640
653
  M = T @ np.array([[My], [Mz]])
641
654
  if self.triangulated_data is not None:
642
655
  # Rotate back also triangulated data!
@@ -771,7 +784,12 @@ class GenericSectionCalculator(SectionCalculator):
771
784
  geo=rotated_geom, strain=strain, tri=self.triangulated_data
772
785
  )
773
786
  # Rotate back to section CRS
774
- T = np.array([[cos(theta), -sin(theta)], [sin(theta), cos(theta)]])
787
+ T = np.array(
788
+ [
789
+ [np.cos(theta), -np.sin(theta)],
790
+ [np.sin(theta), np.cos(theta)],
791
+ ]
792
+ )
775
793
  M = T @ np.array([[My], [Mz]])
776
794
  eps_a[i] = strain[0]
777
795
  my[i] = M[0, 0]
@@ -1106,7 +1124,9 @@ class GenericSectionCalculator(SectionCalculator):
1106
1124
  eps_a = eps_n - kappa_y * y_n
1107
1125
 
1108
1126
  # rotate back components to work in section CRS
1109
- T = np.array([[cos(theta), -sin(theta)], [sin(theta), cos(theta)]])
1127
+ T = np.array(
1128
+ [[np.cos(theta), -np.sin(theta)], [np.sin(theta), np.cos(theta)]]
1129
+ )
1110
1130
  components = np.vstack((kappa_y, np.zeros_like(kappa_y)))
1111
1131
  rotated_components = T @ components
1112
1132
  return np.column_stack((eps_a, rotated_components.T)), field_num
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: structuralcodes
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: A Python package that contains models from structural design codes.
5
5
  Author-email: fib - International Federation for Structural Concrete <info@fib-international.org>
6
6
  Requires-Python: >=3.8
@@ -1,17 +1,17 @@
1
- structuralcodes/__init__.py,sha256=opNmFZxtV5QKx38kj-eHuoZX-JPLuLojIGDH7au31WE,390
1
+ structuralcodes/__init__.py,sha256=4WhcwbLVv6pNyZiQjaNHUXYs0YzQTVU0kkM9EMA9ZyE,390
2
2
  structuralcodes/codes/__init__.py,sha256=g5xMAJ3jEZHFd0cypvZY6lMCi7XeVEntsO8zHzI2mWc,2803
3
3
  structuralcodes/codes/ec2_2004/__init__.py,sha256=_PdL9kX7qlfn9VBfqUCJQy6V9fWmIyugzIiSZczjNAA,1986
4
4
  structuralcodes/codes/ec2_2004/_concrete_material_properties.py,sha256=Ol51tzcVOHUvc2Vea24WQJ4FABxXc-9cB5RVu2N1pio,5964
5
5
  structuralcodes/codes/ec2_2004/_reinforcement_material_properties.py,sha256=_ZlvdHcOswu1Ge1XjSvt4j5ue-znDceMOlA0s528IqM,2779
6
6
  structuralcodes/codes/ec2_2004/_section_7_3_crack_control.py,sha256=a91tWQKNTxB2SpSKu0Wtm-P5GdmifRLggNlEHIQ3XMY,31981
7
- structuralcodes/codes/ec2_2004/annex_b_shrink_and_creep.py,sha256=Vht8VjmpHNRl7-AirTm2buJl1RzL76AbW6-XgdDK6Kg,7348
8
- structuralcodes/codes/ec2_2004/shear.py,sha256=uA9a5Po5X4ysp5pDI8HB0pBjI9Z9txxhPD_joLTM8O0,16910
7
+ structuralcodes/codes/ec2_2004/annex_b_shrink_and_creep.py,sha256=kaMXZ_Ufp-k1wYQDXB27Tt2BUmi_lGYYuNzQxGtC6SQ,7348
8
+ structuralcodes/codes/ec2_2004/shear.py,sha256=gzhgIa-EgoD9gLO_Hfa8VeCmjAxuPK0wZ0soDKC7W5w,17095
9
9
  structuralcodes/codes/ec2_2023/__init__.py,sha256=UohRxikCUqPAUpHj4uSWHw5drICjZm3zvJJw7clljo0,1618
10
10
  structuralcodes/codes/ec2_2023/_annexB_time_dependent.py,sha256=ykRAHBHzqtMSErkVA-rwTHBdUq8-L7q2AOaEd2YW5wc,472
11
11
  structuralcodes/codes/ec2_2023/_section5_materials.py,sha256=-vYowBVcebyPyuGvX3wLfxiePdM0OrBgRrYil71Vd88,32384
12
12
  structuralcodes/codes/ec2_2023/_section9_sls.py,sha256=l1d3xcALAweU9jAAf1d91TJaGB_0p-eMzbRGuhfKydQ,11252
13
13
  structuralcodes/codes/mc2010/__init__.py,sha256=g2J2GTIy9jbLTVq_yF4DXau4WLmAkpmMTgnD4QmW2vI,2844
14
- structuralcodes/codes/mc2010/_concrete_creep_and_shrinkage.py,sha256=7VRzXGjGAM7JkfMcgWvntq4PC2n7VVtSS7CHQuxZaHM,23193
14
+ structuralcodes/codes/mc2010/_concrete_creep_and_shrinkage.py,sha256=wFTVHfJKIyt0jUGthd1gWKfr4JfoFo9YN6d3nL6Ouq4,23277
15
15
  structuralcodes/codes/mc2010/_concrete_interface_different_casting_times.py,sha256=x_n9Z9WEPY6DFf8Og5UIERPivNh-O_3RM4ZnGBy64cs,3570
16
16
  structuralcodes/codes/mc2010/_concrete_material_properties.py,sha256=MTz70-9iaN_s0Z8gJksCEzP0Yza4pPfZ-vOI30pzbw4,12362
17
17
  structuralcodes/codes/mc2010/_concrete_punching.py,sha256=ZG2P7WXIRcFh5sGlmHP20BsJbz0o44cFO51FCru2kXw,17431
@@ -24,7 +24,7 @@ structuralcodes/core/_section_results.py,sha256=hHXoS71TpSmWqw276pBeLiLrEEiMEWcl
24
24
  structuralcodes/core/base.py,sha256=TqgsXzIXITQmER3tKNjzjPrbSN5uT_PqCpG3PVMd3Yw,8562
25
25
  structuralcodes/geometry/__init__.py,sha256=FwzywfyGKOk6v96ZyOfyBo5iVeuK_W0TQVz5llAkYW4,559
26
26
  structuralcodes/geometry/_geometry.py,sha256=kmY7TER5yS-TVw0XY4EuwNviLuEhExtLoon8oO2TJbA,31175
27
- structuralcodes/geometry/_reinforcement.py,sha256=8Xes3N8zm85bJVu_bgVNzMs4zo2zPv17xadw2I9CnE0,3739
27
+ structuralcodes/geometry/_reinforcement.py,sha256=N2wTH-NoZ1fG-_vRT9gGX2Kk3zlW7CbDtl1oqS_lMv0,4144
28
28
  structuralcodes/geometry/_steel_sections.py,sha256=UdJmhhnK8r5gEfBzvWsMFHGs5gmuoOhFoduBanlRMQg,60225
29
29
  structuralcodes/materials/__init__.py,sha256=r5E5vsXVKB-BGZXTnEbsrYJbH6rr6Xlc_b4LlcUPIbc,173
30
30
  structuralcodes/materials/constitutive_laws.py,sha256=DX_yuC4OpgDCl_g3sl0Hi2ee7lFD2fy3yO4PTINKBzE,34455
@@ -39,13 +39,13 @@ structuralcodes/materials/reinforcement/_reinforcementEC2_2004.py,sha256=svLpubj
39
39
  structuralcodes/materials/reinforcement/_reinforcementEC2_2023.py,sha256=3tKpFcMNYK52s5K2K_PctRcuSgwZTe-QXX3xziHPUno,2887
40
40
  structuralcodes/materials/reinforcement/_reinforcementMC2010.py,sha256=az_IAQJNKSF6Vv9KMoXjWTdYkWI6xcEm7s8i8GETn3A,2939
41
41
  structuralcodes/sections/__init__.py,sha256=qPoD5eS31at-uveYtxtVkXGLNHPrIMRrxGYY3wOLQ4s,441
42
- structuralcodes/sections/_generic.py,sha256=UHbj7r2fsBvT4DVDWkxpaQck82cQiV0XFkY8N-g_eYI,49479
42
+ structuralcodes/sections/_generic.py,sha256=jpubO8wBsVWJajpOkUYzBpunf4ltse8rmiNFyiwDuoI,49968
43
43
  structuralcodes/sections/section_integrators/__init__.py,sha256=PK4ixV0XrfHXN-itIrB1r90npoWo3aIJqMcenqcaees,399
44
44
  structuralcodes/sections/section_integrators/_factory.py,sha256=MHp14hfWU-oXTiIutCKLJEC47LirYsHgEAAmHVtnFMY,1242
45
45
  structuralcodes/sections/section_integrators/_fiber_integrator.py,sha256=5sxcfbmxMJfy45Pfd84I4sAh6HpPc5B4r6ab0WpjSNI,9305
46
46
  structuralcodes/sections/section_integrators/_marin_integration.py,sha256=SZgya6d_Tequ3jez7UEBlYioZepW2IDKaAxn_6WrMbU,1563
47
47
  structuralcodes/sections/section_integrators/_marin_integrator.py,sha256=rtEtd1X0QYAWNcaH7Pjd_b6LEzVjHqD_fbIrX64p7fg,9121
48
48
  structuralcodes/sections/section_integrators/_section_integrator.py,sha256=O-jsG1Pu_doovgRJsFG1Sf0KlkN2wNfQdmgkJiSHNN0,1590
49
- structuralcodes-0.1.0.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
50
- structuralcodes-0.1.0.dist-info/METADATA,sha256=z10AmhI6UDYF_wu-kJTNvLYcmSu_nhn1WBNiodbrm8M,2444
51
- structuralcodes-0.1.0.dist-info/RECORD,,
49
+ structuralcodes-0.1.1.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
50
+ structuralcodes-0.1.1.dist-info/METADATA,sha256=CDs31oS5sYYBt1hk-gRLTGPJtfa6SiM1H5QP3IlGecI,2444
51
+ structuralcodes-0.1.1.dist-info/RECORD,,