PreProcessLoad#
PreProcessLoad prepares roof pressure-zone geometry before any component loads are calculated. Use it when you need to inspect pressure-zone coordinates, panel areas, or the fraction of each roof panel inside ASCE pressure zones.
Related API: Loads API Planned notebook: loads workflow notebook
Inputs#
Building:cheersafe.inventory.Building. Required geometry includesRoofShape,HipRidgeAngle,BldgLength,BldgWidth,RoofWidth,MeanRoofHeight,SheathingLength,SheathingWidth,PanelCoordinate, andNumPanel.WindOrientation: degrees. Pressure-zone layout changes with orientation.WindSpeed: mph for the wind-pressure equations. Accepted by the base load class, but preprocessing geometry does not use the speed directly.- Optional defaults:
G=0.85,GCpi=0.18; these are inherited but not central to preprocessing.
Required files when Config.AUTO_LOAD_DATASETS = True: Inputs/MWFRSCp.json, Inputs/CCRoofGCp.json, and Inputs/CCWallGCp.json.
Outputs And Returns#
When automatic execution is enabled, the instance receives:
PressureZoneCoordinate: pressure-zone coordinate tensor. For the first sample building this is shape(8, 4, 4).NumZone: list of zone counts by roof side. For the first sample building at0degrees this is[4, 1, 1, 1].PressureZoneArea: panel area fractions by pressure zone, shape(3, sum(Building.NumPanel)).PanelArea: panel areas, shape(sum(Building.NumPanel),).
Manual methods return the same values:
fn_pressure_zone_coordinate() -> tuple[np.ndarray, list[int]]fn_preprocess_rs() -> tuple[np.ndarray, np.ndarray]
Config Behavior#
With AUTO_LOAD_DATASETS = True, pressure coefficient files load during construction. With it disabled, load or assign MWFRSCp, CCRoofGCp, and CCWallGCp before later load calculations need them.
With AUTO_EXECUTE_METHODS = True, PressureZoneCoordinate, NumZone, PressureZoneArea, and PanelArea are populated during construction. With it disabled, call fn_pressure_zone_coordinate() before fn_preprocess_rs(), because preprocessing reads PressureZoneCoordinate and NumZone.
Automatic Example#
from cheersafe.inventory import BuildingInventory
from cheersafe.loads import PreProcessLoad
building = BuildingInventory(buildings_file_name="BuildingGeometry.json").buildings[0]
pre = PreProcessLoad(building, WindOrientation=0, WindSpeed=50)
print(pre.PressureZoneArea.shape)
print(pre.PanelArea.sum())
Manual-Control Example#
from cheersafe.config import Config
from cheersafe.inventory import BuildingInventory
from cheersafe.loads import PreProcessLoad
building = BuildingInventory(buildings_file_name="BuildingGeometry.json").buildings[0]
old_execute = Config.AUTO_EXECUTE_METHODS
Config.AUTO_EXECUTE_METHODS = False
try:
pre = PreProcessLoad(building, WindOrientation=0, WindSpeed=50)
pre.PressureZoneCoordinate, pre.NumZone = pre.fn_pressure_zone_coordinate()
pre.PressureZoneArea, pre.PanelArea = pre.fn_preprocess_rs()
finally:
Config.AUTO_EXECUTE_METHODS = old_execute