FinalFailureCheck#
FinalFailureCheck applies final loads to the current resistance state. It is the last calculation class before the public LoadingAndFailureCheck workflow wrapper.
Related API: Loads API Planned notebook: loads workflow notebook
Inputs#
The constructor takes the same arguments as FinalLoad: five resistance arrays, Building, WindOrientation, and WindSpeed.
The final check relies on these already-computed arrays when run manually:
pfRS,pfRC,pfRWC,pfO,pfW: final loads.pInternal: scalar internal pressure.rRSt,rRCt,rRWCt,rOt,rWt: current resistance arrays.
Outputs And Returns#
With automatic execution:
rRSt: zeroed wherepfRS > rRSt.rRCt: zeroed where roof sheathing has failed orpfRC > rRCt.rRWCt: updated roof-wall connection resistance.rOt: zeroed wherepfO > rOt.rWt: zeroed where final wall loads exceed wall resistance.RWCFails: shape(4,); side-level flags for roof-wall connection failure.
Manual return methods:
fn_final_failure_check_rwc() -> tuple[np.ndarray, np.ndarray]fn_final_failure_check_w() -> np.ndarray
The class-level final resistance updates in __post_init__ are assignment behavior, not a separate return method.
Config Behavior#
With AUTO_LOAD_DATASETS = True, coefficient files are loaded automatically. With it disabled, assign or load coefficients yourself.
With AUTO_EXECUTE_METHODS = True, the full inherited chain runs and then final resistances are assigned. With it disabled, calculate the inherited outputs first, then call the two final-check helper methods and apply the same assignment logic needed by your workflow.
Automatic Example#
import numpy as np
from cheersafe.inventory import BuildingInventory
from cheersafe.loads import FinalFailureCheck
from cheersafe.tools import Utils
building = BuildingInventory(buildings_file_name="BuildingGeometry.json").buildings[0]
mean = Utils.from_json("Inputs/MeanResistanceValue.json")
check = FinalFailureCheck(
np.full(sum(building.NumPanel), mean[1, 0]),
np.full(sum(building.NumPanel), mean[0, 0]),
np.full(sum(building.NumConnection), mean[2, 0]),
np.full(building.DoorFront + building.DoorBack + building.DoorGarage
+ building.OpeningFront + building.OpeningBack
+ 2 * (building.OpeningSideR + building.OpeningSideH), mean[3, 0]),
np.full(12, mean[4, 0]),
building,
0,
50,
)
print(check.RWCFails)
Manual-Control Example#
import numpy as np
from cheersafe.config import Config
from cheersafe.inventory import BuildingInventory
from cheersafe.loads import FinalFailureCheck
from cheersafe.tools import Utils
building = BuildingInventory(buildings_file_name="BuildingGeometry.json").buildings[0]
old_execute = Config.AUTO_EXECUTE_METHODS
Config.AUTO_EXECUTE_METHODS = False
try:
mean = Utils.from_json("Inputs/MeanResistanceValue.json")
check = FinalFailureCheck(
np.full(sum(building.NumPanel), mean[1, 0]),
np.full(sum(building.NumPanel), mean[0, 0]),
np.full(sum(building.NumConnection), mean[2, 0]),
np.full(building.DoorFront + building.DoorBack + building.DoorGarage
+ building.OpeningFront + building.OpeningBack
+ 2 * (building.OpeningSideR + building.OpeningSideH), mean[3, 0]),
np.full(12, mean[4, 0]),
building,
0,
50,
)
check.PressureZoneCoordinate, check.NumZone = check.fn_pressure_zone_coordinate()
check.PressureZoneArea, check.PanelArea = check.fn_preprocess_rs()
check.pRS = check.fn_initial_load_rs()
check.pRC = check.fn_initial_load_rc()
check.pRWC = check.fn_initial_load_rwc()
check.pO = check.fn_initial_load_o()
check.pW = check.fn_initial_load_w()
resistance = check.fn_initial_failure_check()
check.rRSt = resistance["Roof Sheathings"]
check.rRCt = resistance["Roof Coverings"]
check.rRWCt = resistance["Roof-Wall Connections"]
check.rOt = resistance["Openings"]
check.rWt = resistance["Walls"]
check.pInternal = check.fn_pressure_internal()
check.pfRC = check.fn_final_load_rc()
check.pfRS = check.fn_final_load_rs() if check.pInternal else check.pRS
check.pfRWC = check.fn_final_load_rwc() if check.pInternal else check.pRWC
check.pfO = check.fn_final_load_o() if check.pInternal else check.pO
check.pfW = check.fn_final_load_w() if check.pInternal else check.pW
check.rRWCt, check.RWCFails = check.fn_final_failure_check_rwc()
finally:
Config.AUTO_EXECUTE_METHODS = old_execute