Skip to content

FinalLoad#

FinalLoad calculates internal pressure after the initial failure check and then computes final component loads. Use it when opening failures may change internal pressure and therefore roof, wall, and opening demands.

Related API: Loads API Planned notebook: loads workflow notebook

Inputs#

FinalLoad inherits all inputs from InitialFailureCheck: building, wind orientation, wind speed, coefficient datasets, and five resistance arrays.

Important shape expectations:

  • roof sheathing and roof covering arrays: (sum(Building.NumPanel),).
  • roof-wall connection arrays: (sum(Building.NumConnection),).
  • opening arrays: total door/window count.
  • wall arrays: (12,) for resistances and (4, 3) for wall loads.

Outputs And Returns#

With automatic execution:

  • pInternal: scalar internal pressure after initial opening failure.
  • pfRS: final roof sheathing load, shape (sum(Building.NumPanel),).
  • pfRC: final roof covering load, shape (sum(Building.NumPanel),).
  • pfRWC: final roof-wall connection load, shape (sum(Building.NumConnection),).
  • pfO: final opening load, usually array-like with total opening count.
  • pfW: final wall load matrix, shape (4, 3).

Manual methods return these outputs: fn_pressure_internal(), fn_final_load_rs(), fn_final_load_rc(), fn_final_load_rwc(), fn_final_load_o(), and fn_final_load_w().

If pInternal == 0, the constructor reuses initial loads for pfRS, pfRWC, pfO, and pfW instead of recalculating them.

Config Behavior#

With AUTO_LOAD_DATASETS = True, coefficient files are loaded automatically. With it disabled, assign or load coefficients before running load methods.

With AUTO_EXECUTE_METHODS = True, preprocessing, initial loads, initial failure checks, internal pressure, and final loads run during construction. With it disabled, follow that same order manually. fn_final_load_w() reads pInternal, so assign it first.

Automatic Example#

import numpy as np
from cheersafe.inventory import BuildingInventory
from cheersafe.loads import FinalLoad
from cheersafe.tools import Utils

building = BuildingInventory(buildings_file_name="BuildingGeometry.json").buildings[0]
mean = Utils.from_json("Inputs/MeanResistanceValue.json")

loads = FinalLoad(
    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(loads.pInternal, loads.pfW.shape)

Manual-Control Example#

import numpy as np
from cheersafe.config import Config
from cheersafe.inventory import BuildingInventory
from cheersafe.loads import FinalLoad
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")
    loads = FinalLoad(
        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,
    )
    loads.PressureZoneCoordinate, loads.NumZone = loads.fn_pressure_zone_coordinate()
    loads.PressureZoneArea, loads.PanelArea = loads.fn_preprocess_rs()
    loads.pRS = loads.fn_initial_load_rs()
    loads.pRWC = loads.fn_initial_load_rwc()
    loads.pO = loads.fn_initial_load_o()
    loads.pW = loads.fn_initial_load_w()
    resistance = loads.fn_initial_failure_check()
    loads.rRSt = resistance["Roof Sheathings"]
    loads.rOt = resistance["Openings"]
    loads.rWt = resistance["Walls"]
    loads.pInternal = loads.fn_pressure_internal()
    loads.pfRC = loads.fn_final_load_rc()
finally:
    Config.AUTO_EXECUTE_METHODS = old_execute