From c9a4dfd8c043b331ff9635e09ac1d132c6e3d21c Mon Sep 17 00:00:00 2001 From: John Vouvakis Manousakis Date: Thu, 12 Dec 2024 15:45:24 -0800 Subject: [PATCH] Remove `dead` and `live`, replace by `static`. --- src/osmg/analysis/load_case.py | 40 +++++++++------------------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/src/osmg/analysis/load_case.py b/src/osmg/analysis/load_case.py index 7ebe143..dff0a11 100644 --- a/src/osmg/analysis/load_case.py +++ b/src/osmg/analysis/load_case.py @@ -614,25 +614,14 @@ class HasLoads: @dataclass(repr=False) -class DeadLoadCase(LoadCase, HasLoads): - """Dead load case.""" +class StaticLoadCase(LoadCase, HasLoads): + """Static load case.""" analysis: StaticAnalysis = field(default_factory=StaticAnalysis) def __post_init__(self) -> None: """Post-initialization.""" - self._case_type = 'Dead' - - -@dataclass(repr=False) -class LiveLoadCase(LoadCase, HasLoads): - """Live load case.""" - - analysis: StaticAnalysis = field(default_factory=StaticAnalysis) - - def __post_init__(self) -> None: - """Post-initialization.""" - self._case_type = 'Live' + self._case_type = 'Static' @dataclass(repr=False) @@ -959,15 +948,9 @@ class LoadCaseRegistry: Load case registry. A load case registry is an organized collection of load cases. - Load cases are categorized based on the nature of the loads, such - as `dead`, `live`, or `seismic_elf`. Each type of loading - necessitates a specific type of analysis needed to estimate the - structural response, with most being static. Custom analyses which - don't need to conform to load type classification can use the - `other` load case. - - The load case registry can be used to orchestrate all analyses, - retrieve, and post-process results. + Load cases are categorized based on the type of analysis required, + such as `static`, or `modal`. Custom analyses which don't need to + conform to load type classification can use the `other` load case. """ def __init__( @@ -978,8 +961,7 @@ def __init__( self.result_setup = result_setup or AnalysisResultSetup() # Initialize defaultdicts with factory functions that include the model - self.dead = defaultdict(lambda: DeadLoadCase(model=self.model)) - self.live = defaultdict(lambda: LiveLoadCase(model=self.model)) + self.static = defaultdict(lambda: StaticLoadCase(model=self.model)) self.modal = defaultdict(lambda: ModalLoadCase(model=self.model)) self.seismic_elf = defaultdict(lambda: SeismicELFLoadCase(model=self.model)) self.seismic_rs = defaultdict(lambda: SeismicRSLoadCase(model=self.model)) @@ -1008,7 +990,7 @@ def self_weight(self, case_name: str, scaling_factor: float = 1.0) -> None: for component in components: weight_per_length = component.get_section().sec_w * scaling_factor udl = UDL((0.00, 0.00, -weight_per_length)) - self.dead[case_name].load_registry.component_udl[component.uid] = udl + self.static[case_name].load_registry.component_udl[component.uid] = udl def self_mass( self, @@ -1079,8 +1061,7 @@ def get_load_cases(self) -> dict[LoadCase]: Dictionary of load cases. """ return ( - self.dead - | self.live + self.static | self.modal | self.seismic_elf | self.seismic_rs @@ -1149,8 +1130,7 @@ def combine_recorder(self, recorder_name: str) -> pd.DataFrame: """ # TODO(JVM): in progress. cases_list = [ - ('dead', cast(defaultdict[str, LoadCase], self.dead)), - ('live', cast(defaultdict[str, LoadCase], self.live)), + ('dead', cast(defaultdict[str, LoadCase], self.static)), ] all_data: dict[str, dict[str, pd.DataFrame]] = defaultdict(dict) case_type_data = {}