Skip to content

Commit

Permalink
added an argument in the reinforcement_provision to allow user update…
Browse files Browse the repository at this point in the history
… area_of_steel_provided
  • Loading branch information
kunle009 committed Aug 20, 2024
1 parent 50b771c commit 6c9b853
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
18 changes: 16 additions & 2 deletions FoundationDesign/foundationdesign.py
Original file line number Diff line number Diff line change
Expand Up @@ -1613,7 +1613,7 @@ def __reinforcement_calculations_X_dir(self):
result = reinforcement_provision(as_required, self.fyk)
return result

def reinforcement_provision_flexure_X_dir(self):
def reinforcement_provision_flexure_X_dir(self, area_of_steel_provided=None):
"""
Calculates the area of steel to be provided along the x direction of the foundation
Expand All @@ -1630,6 +1630,14 @@ def reinforcement_provision_flexure_X_dir(self):
bar_dia = steel_bars[1]
bar_spacing = steel_bars[2]
area_provided = steel_bars[3]

if area_of_steel_provided is not None:
try:
user_provided_area = float(area_of_steel_provided)
area_provided = user_provided_area
except ValueError:
print("Invalid input for user-provided area. Using the default calculated area.")

return {
"steel_label": steel_label,
"bar_diameter": bar_dia,
Expand Down Expand Up @@ -1682,7 +1690,7 @@ def __reinforcement_calculations_Y_dir(self):
result = reinforcement_provision(as_required, self.fyk)
return result

def reinforcement_provision_flexure_Y_dir(self):
def reinforcement_provision_flexure_Y_dir(self, area_of_steel_provided=None):
"""
Calculates the area of steel to be provided along the y direction of the foundation
Expand All @@ -1699,6 +1707,12 @@ def reinforcement_provision_flexure_Y_dir(self):
bar_dia = steel_bars[1]
bar_spacing = steel_bars[2]
area_provided = steel_bars[3]
if area_of_steel_provided is not None:
try:
user_provided_area = float(area_of_steel_provided)
area_provided = user_provided_area
except ValueError:
print("Invalid input for user-provided area. Using the default calculated area.")
return {
"steel_label": steel_label,
"bar_diameter": bar_dia,
Expand Down
10 changes: 5 additions & 5 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
# print(fdn_design.get_design_shear_force_X())
# print(fdn_design.area_of_steel_reqd_X_dir())
# print(fdn_design.area_of_steel_reqd_Y_dir())
# print(fdn_design.reinforcement_provision_flexure_X_dir())
# print(fdn_design.reinforcement_provision_flexure_Y_dir())
print(fdn_design.reinforcement_provision_flexure_X_dir())
print(fdn_design.reinforcement_provision_flexure_Y_dir())

#print(fdn_design.punching_shear_column_face())
#print(fdn_design.punching_shear_check_1d())
#print(fdn_design.punching_shear_check_2d())
print(fdn_design.tranverse_shear_check_Xdir())
print(fdn_design.tranverse_shear_check_Ydir())
print(fdn_design.sliding_resistance_check())
#print(fdn_design.tranverse_shear_check_Xdir())
#print(fdn_design.tranverse_shear_check_Ydir())
#print(fdn_design.sliding_resistance_check())


# outputs
Expand Down

0 comments on commit 6c9b853

Please sign in to comment.