Skip to content

Bug: SteadyState evaluation fails if SystemModel is initialized without touchdown=True in Config #37

Description

@pillowbeast

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.pyCriteriaEvaluator().evaluateSteadyState
  • Relevant method: src/weac/core/system_model.pySystemModel().toggle_touchdown

Let me know if you need further clarification or if you want a PR for this fix.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions