Skip to content

Commit 6c9b853

Browse files
committed
added an argument in the reinforcement_provision to allow user update area_of_steel_provided
1 parent 50b771c commit 6c9b853

2 files changed

Lines changed: 21 additions & 7 deletions

File tree

FoundationDesign/foundationdesign.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,7 +1613,7 @@ def __reinforcement_calculations_X_dir(self):
16131613
result = reinforcement_provision(as_required, self.fyk)
16141614
return result
16151615

1616-
def reinforcement_provision_flexure_X_dir(self):
1616+
def reinforcement_provision_flexure_X_dir(self, area_of_steel_provided=None):
16171617
"""
16181618
Calculates the area of steel to be provided along the x direction of the foundation
16191619
@@ -1630,6 +1630,14 @@ def reinforcement_provision_flexure_X_dir(self):
16301630
bar_dia = steel_bars[1]
16311631
bar_spacing = steel_bars[2]
16321632
area_provided = steel_bars[3]
1633+
1634+
if area_of_steel_provided is not None:
1635+
try:
1636+
user_provided_area = float(area_of_steel_provided)
1637+
area_provided = user_provided_area
1638+
except ValueError:
1639+
print("Invalid input for user-provided area. Using the default calculated area.")
1640+
16331641
return {
16341642
"steel_label": steel_label,
16351643
"bar_diameter": bar_dia,
@@ -1682,7 +1690,7 @@ def __reinforcement_calculations_Y_dir(self):
16821690
result = reinforcement_provision(as_required, self.fyk)
16831691
return result
16841692

1685-
def reinforcement_provision_flexure_Y_dir(self):
1693+
def reinforcement_provision_flexure_Y_dir(self, area_of_steel_provided=None):
16861694
"""
16871695
Calculates the area of steel to be provided along the y direction of the foundation
16881696
@@ -1699,6 +1707,12 @@ def reinforcement_provision_flexure_Y_dir(self):
16991707
bar_dia = steel_bars[1]
17001708
bar_spacing = steel_bars[2]
17011709
area_provided = steel_bars[3]
1710+
if area_of_steel_provided is not None:
1711+
try:
1712+
user_provided_area = float(area_of_steel_provided)
1713+
area_provided = user_provided_area
1714+
except ValueError:
1715+
print("Invalid input for user-provided area. Using the default calculated area.")
17021716
return {
17031717
"steel_label": steel_label,
17041718
"bar_diameter": bar_dia,

tests/test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@
3737
# print(fdn_design.get_design_shear_force_X())
3838
# print(fdn_design.area_of_steel_reqd_X_dir())
3939
# print(fdn_design.area_of_steel_reqd_Y_dir())
40-
# print(fdn_design.reinforcement_provision_flexure_X_dir())
41-
# print(fdn_design.reinforcement_provision_flexure_Y_dir())
40+
print(fdn_design.reinforcement_provision_flexure_X_dir())
41+
print(fdn_design.reinforcement_provision_flexure_Y_dir())
4242

4343
#print(fdn_design.punching_shear_column_face())
4444
#print(fdn_design.punching_shear_check_1d())
4545
#print(fdn_design.punching_shear_check_2d())
46-
print(fdn_design.tranverse_shear_check_Xdir())
47-
print(fdn_design.tranverse_shear_check_Ydir())
48-
print(fdn_design.sliding_resistance_check())
46+
#print(fdn_design.tranverse_shear_check_Xdir())
47+
#print(fdn_design.tranverse_shear_check_Ydir())
48+
#print(fdn_design.sliding_resistance_check())
4949

5050

5151
# outputs

0 commit comments

Comments
 (0)