InitialFailureCheck#
InitialFailureCheck compares initial loads with component resistance arrays and returns the first updated resistance state. Use it when you need the opening, wall, and roof sheathing failures that drive internal-pressure recalculation.
Related API: Loads API Planned notebook: loads workflow notebook
Inputs#
This class has all InitialLoad inputs plus resistance arrays:
rRSt: roof sheathing resistance, shape(sum(Building.NumPanel),).rRCt: roof covering resistance, shape(sum(Building.NumPanel),).rRWCt: roof-wall connection resistance, shape(sum(Building.NumConnection),).rOt: opening resistance, shape equal to total doors plus windows.rWt: wall resistance, shape(12,).
The example below uses Inputs/MeanResistanceValue.json as a deterministic resistance source. Production simulations usually pass sampled values.
Outputs And Returns#
With automatic execution, the instance updates:
rRSt: entries become0wherepRS > rRSt.rRCt: copied unchanged by the initial check.rRWCt: copied unchanged by the initial check.rOt: entries become0wherepO >= rOt.rWt: entries become0where flattened wall loads exceed wall resistance.
fn_initial_failure_check() returns a dictionary keyed by "Roof Sheathings", "Roof Coverings", "Roof-Wall Connections", "Openings", and "Walls". It does not mutate the original arrays unless the caller assigns the returned values.
Config Behavior#
With AUTO_LOAD_DATASETS = True, load coefficient files are read automatically. With it disabled, provide the coefficient arrays before load methods run.
With AUTO_EXECUTE_METHODS = True, initial loads and the initial failure check run during construction. With it disabled, calculate and assign pRS, pO, and pW before calling fn_initial_failure_check().
Automatic Example#
import numpy as np
from cheersafe.inventory import BuildingInventory
from cheersafe.loads import InitialFailureCheck
from cheersafe.tools import Utils
building = BuildingInventory(buildings_file_name="BuildingGeometry.json").buildings[0]
mean = Utils.from_json("Inputs/MeanResistanceValue.json")
check = InitialFailureCheck(
rRSt=np.full(sum(building.NumPanel), mean[1, 0]),
rRCt=np.full(sum(building.NumPanel), mean[0, 0]),
rRWCt=np.full(sum(building.NumConnection), mean[2, 0]),
rOt=np.full(building.DoorFront + building.DoorBack + building.DoorGarage
+ building.OpeningFront + building.OpeningBack
+ 2 * (building.OpeningSideR + building.OpeningSideH), mean[3, 0]),
rWt=np.full(12, mean[4, 0]),
Building=building,
WindOrientation=0,
WindSpeed=50,
)
print(check.rOt.shape)
Manual-Control Example#
import numpy as np
from cheersafe.config import Config
from cheersafe.inventory import BuildingInventory
from cheersafe.loads import InitialFailureCheck
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 = InitialFailureCheck(
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.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()
finally:
Config.AUTO_EXECUTE_METHODS = old_execute