Skip to content

Loads#

The cheersafe.loads classes compute wind loads, component failures, and final resistance states for one building, one wind orientation, one wind speed, and one set of sampled component resistances.

Use these classes when you need the load/failure part of the CHEERSafe workflow without running the full damage-probability batch process. The usual end point is LoadingAndFailureCheck, which produces the final loads and final resistances consumed by damage-ratio calculations.

Related API: Loads API Planned notebook: loads workflow notebook

Class Pages#

Shared Inputs#

All load classes require:

  • Building: a cheersafe.inventory.Building with panel and roof-wall connection geometry already calculated. BuildingInventory creates these automatically when Config.AUTO_LOAD_DATASETS and Config.AUTO_EXECUTE_METHODS are enabled.
  • WindOrientation: degrees, normally one of 0, 45, 90, 135, 180, 225, 270, 315.
  • WindSpeed: wind speed in mph for the wind-pressure equations.

Failure-check classes also require sampled or deterministic 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 (DoorFront + DoorBack + DoorGarage + OpeningFront + OpeningBack + 2 * (OpeningSideR + OpeningSideH),).
  • rWt: wall resistance, shape (12,), flattened as four walls by three wall demand modes.

Load units follow the source implementation: wind speed is mph; pressure calculations use FPHLM/ASCE-style pressure coefficients and produce loads in the force units used by the resistance inputs.

Dataset Loading#

With Config.AUTO_LOAD_DATASETS = True, BaseLoad.__post_init__ loads these files from Config.INPUTS_PATH:

  • MWFRSCp.json, shape (8,)
  • CCRoofGCp.json, shape (3,)
  • CCWallGCp.json, shape (4,)

With Config.AUTO_LOAD_DATASETS = False, construct the class, assign MWFRSCp, CCRoofGCp, and CCWallGCp yourself, or call load_MWFRSCp(), load_CCRoofGCp(), and load_CCWallGCp() before executing methods that need them.

Method Execution#

With Config.AUTO_EXECUTE_METHODS = True, constructors call the relevant fn_* methods and assign outputs to instance attributes.

With Config.AUTO_EXECUTE_METHODS = False, constructors only set direct inputs and any unconditional setup. Call fn_* methods manually and assign the returned values you want to keep.

from cheersafe.inventory import BuildingInventory
from cheersafe.loads import InitialLoad

building = BuildingInventory(buildings_file_name="BuildingGeometry.json").buildings[0]
loads = InitialLoad(building, WindOrientation=0, WindSpeed=50)

print(loads.pRS.shape, loads.pW.shape)
from cheersafe.config import Config
from cheersafe.inventory import BuildingInventory
from cheersafe.loads import InitialLoad

building = BuildingInventory(buildings_file_name="BuildingGeometry.json").buildings[0]
old_execute = Config.AUTO_EXECUTE_METHODS
Config.AUTO_EXECUTE_METHODS = False
try:
    loads = InitialLoad(building, WindOrientation=0, WindSpeed=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()
finally:
    Config.AUTO_EXECUTE_METHODS = old_execute