Problem
When evaluating the SteadyState, a bug occurs if the SystemModel is not initialized with a Config where touchdown=True. The root cause is that SlabTouchdown is implemented as a cached_property. If touchdown=False is passed during SystemModel initialization (the default for Config), the cached property is set to None. Later, when touchdown information is required, this results in an error.
Minimal reproduction:
model_input = ModelInput(
weak_layer=weak_layer,
layers=new_layers,
scenario_config=scenario_config,
segments=segments,
)
system = SystemModel(model_input=model_input)
ss_result: SteadyStateResult = criteria_evaluator.evaluate_SteadyState(
system, vertical=False, print_call_stats=False
)
Error:
AttributeError: 'NoneType' object has no attribute 'l_BC'
This happens because l_BC, which is required for the evaluation of touchdown distance, energy release rate, and S_xx in the steady state, is not available if touchdown mode is not set before first access. As a result, WEAC returns an error instead of computing the steady state.
Current implementation
In evaluate_SteadyState, the touchdown flag is currently set manually.
Suggestion
Instead of setting the attribute directly, use the toggle_touchdown method from the SystemModel class. This method properly invalidates the cached slab_touchdown property, ensuring the state is correct for steady state analysis.
Reference files and locations
- Change evaluation logic:
src/weac/analysis/criteria_evaluator.py – CriteriaEvaluator().evaluateSteadyState
- Relevant method:
src/weac/core/system_model.py – SystemModel().toggle_touchdown
Let me know if you need further clarification or if you want a PR for this fix.
Problem
When evaluating the SteadyState, a bug occurs if the
SystemModelis not initialized with aConfigwheretouchdown=True. The root cause is thatSlabTouchdownis implemented as acached_property. Iftouchdown=Falseis passed duringSystemModelinitialization (the default forConfig), the cached property is set toNone. Later, when touchdown information is required, this results in an error.Minimal reproduction:
Error:
This happens because
l_BC, which is required for the evaluation of touchdown distance, energy release rate, and S_xx in the steady state, is not available if touchdown mode is not set before first access. As a result, WEAC returns an error instead of computing the steady state.Current implementation
In
evaluate_SteadyState, the touchdown flag is currently set manually.Suggestion
Instead of setting the attribute directly, use the
toggle_touchdownmethod from theSystemModelclass. This method properly invalidates the cachedslab_touchdownproperty, ensuring the state is correct for steady state analysis.Reference files and locations
src/weac/analysis/criteria_evaluator.py–CriteriaEvaluator().evaluateSteadyStatesrc/weac/core/system_model.py–SystemModel().toggle_touchdownLet me know if you need further clarification or if you want a PR for this fix.