weac.analysis.criteria_evaluator module¶
This module provides the CriteriaEvaluator class, which is used to evaluate various fracture criteria based on the model results.
- class weac.analysis.criteria_evaluator.CoupledCriterionHistory(skier_weights, crack_lengths, incr_energies, g_deltas, dist_maxs, dist_mins)[source]¶
Bases:
object
Stores the history of the coupled criterion evaluation.
- Parameters:
skier_weights (List[float])
crack_lengths (List[float])
incr_energies (List[ndarray])
g_deltas (List[float])
dist_maxs (List[float])
dist_mins (List[float])
- skier_weights: List[float]¶
- crack_lengths: List[float]¶
- incr_energies: List[ndarray]¶
- g_deltas: List[float]¶
- dist_maxs: List[float]¶
- dist_mins: List[float]¶
- __init__(skier_weights, crack_lengths, incr_energies, g_deltas, dist_maxs, dist_mins)¶
- Parameters:
skier_weights (List[float])
crack_lengths (List[float])
incr_energies (List[ndarray])
g_deltas (List[float])
dist_maxs (List[float])
dist_mins (List[float])
- Return type:
None
- class weac.analysis.criteria_evaluator.CoupledCriterionResult(converged, message, self_collapse, pure_stress_criteria, critical_skier_weight, initial_critical_skier_weight, crack_length, g_delta, dist_ERR_envelope, iterations, history, final_system, max_dist_stress, min_dist_stress)[source]¶
Bases:
object
Holds the results of the coupled criterion evaluation.
Attributes:¶
- convergedbool
Whether the algorithm converged.
- messagestr
The message of the evaluation.
- self_collapsebool
Whether the system collapsed.
- pure_stress_criteriabool
Whether the pure stress criteria is satisfied.
- critical_skier_weightfloat
The critical skier weight.
- initial_critical_skier_weightfloat
The initial critical skier weight.
- crack_lengthfloat
The crack length.
- g_deltafloat
The g_delta value.
- dist_ERR_envelopefloat
The distance to the ERR envelope.
- iterationsint
The number of iterations.
- historyCoupledCriterionHistory
The history of the evaluation.
- final_systemSystemModel
The final system model.
- max_dist_stressfloat
The maximum distance to failure.
- min_dist_stressfloat
The minimum distance to failure.
- converged: bool¶
- message: str¶
- self_collapse: bool¶
- pure_stress_criteria: bool¶
- critical_skier_weight: float¶
- initial_critical_skier_weight: float¶
- crack_length: float¶
- g_delta: float¶
- dist_ERR_envelope: float¶
- iterations: int¶
- history: CoupledCriterionHistory | None¶
- final_system: SystemModel¶
- max_dist_stress: float¶
- min_dist_stress: float¶
- __init__(converged, message, self_collapse, pure_stress_criteria, critical_skier_weight, initial_critical_skier_weight, crack_length, g_delta, dist_ERR_envelope, iterations, history, final_system, max_dist_stress, min_dist_stress)¶
- Parameters:
converged (bool)
message (str)
self_collapse (bool)
pure_stress_criteria (bool)
critical_skier_weight (float)
initial_critical_skier_weight (float)
crack_length (float)
g_delta (float)
dist_ERR_envelope (float)
iterations (int)
history (CoupledCriterionHistory | None)
final_system (SystemModel)
max_dist_stress (float)
min_dist_stress (float)
- Return type:
None
- Parameters:
converged (bool)
message (str)
self_collapse (bool)
pure_stress_criteria (bool)
critical_skier_weight (float)
initial_critical_skier_weight (float)
crack_length (float)
g_delta (float)
dist_ERR_envelope (float)
iterations (int)
history (CoupledCriterionHistory | None)
final_system (SystemModel)
max_dist_stress (float)
min_dist_stress (float)
- class weac.analysis.criteria_evaluator.SSERRResult(converged, message, touchdown_distance, SSERR)[source]¶
Bases:
object
Holds the results of the SSERR evaluation.
Attributes:¶
- convergedbool
Whether the algorithm converged.
- messagestr
The message of the evaluation.
- touchdown_distancefloat
The touchdown distance.
- SSERRfloat
The Steady-State Energy Release Rate calculated with the touchdown distance from G_I and G_II.
- converged: bool¶
- message: str¶
- touchdown_distance: float¶
- SSERR: float¶
- __init__(converged, message, touchdown_distance, SSERR)¶
- Parameters:
converged (bool)
message (str)
touchdown_distance (float)
SSERR (float)
- Return type:
None
- Parameters:
converged (bool)
message (str)
touchdown_distance (float)
SSERR (float)
- class weac.analysis.criteria_evaluator.FindMinimumForceResult(success, critical_skier_weight, new_segments, old_segments, iterations, max_dist_stress, min_dist_stress)[source]¶
Bases:
object
Holds the results of the find_minimum_force evaluation.
Attributes:¶
- successbool
Whether the algorithm converged.
- critical_skier_weightfloat
The critical skier weight.
- new_segmentsList[Segment]
The new segments.
- old_segmentsList[Segment]
The old segments.
- iterationsint
The number of iterations.
- max_dist_stressfloat
The maximum distance to failure.
- min_dist_stressfloat
The minimum distance to failure.
- success: bool¶
- critical_skier_weight: float¶
- iterations: int | None¶
- max_dist_stress: float¶
- min_dist_stress: float¶
- __init__(success, critical_skier_weight, new_segments, old_segments, iterations, max_dist_stress, min_dist_stress)¶
- class weac.analysis.criteria_evaluator.CriteriaEvaluator(criteria_config)[source]¶
Bases:
object
Provides methods for stability analysis of layered slabs on compliant elastic foundations, based on the logic from criterion_check.py.
- Parameters:
criteria_config (CriteriaConfig)
- __init__(criteria_config)[source]¶
Initializes the evaluator with global simulation and criteria configurations.
Parameters:¶
criteria_config (CriteriaConfig): The configuration for failure criteria.
- Parameters:
criteria_config (CriteriaConfig)
- criteria_config: CriteriaConfig¶
- fracture_toughness_envelope(G_I, G_II, weak_layer)[source]¶
Evaluates the fracture toughness criterion for a given combination of Mode I (G_I) and Mode II (G_II) energy release rates.
A value of 1 indicates the boundary of the fracture toughness envelope is reached.
Parameters:¶
- G_Ifloat
Mode I energy release rate (ERR) in J/m².
- G_IIfloat
Mode II energy release rate (ERR) in J/m².
- weak_layerWeakLayer
The weak layer object containing G_Ic and G_IIc.
Returns:¶
- g_deltafloat
Evaluation of the fracture toughness envelope.
- Parameters:
G_I (float | ndarray)
G_II (float | ndarray)
weak_layer (WeakLayer)
- Return type:
float | ndarray
- stress_envelope(sigma, tau, weak_layer, method=None)[source]¶
Evaluate the stress envelope for given stress components. Weak Layer failure is defined as the stress envelope crossing 1.
- Parameters:
sigma (ndarray) – Normal stress components (kPa).
tau (ndarray) – Shear stress components (kPa).
weak_layer (WeakLayer) – The weak layer object, used to get density.
method (str, optional) – Method to use for the stress envelope. Defaults to None.
- Returns:
stress_envelope – Stress envelope evaluation values in [0, inf]. Values > 1 indicate failure.
- Return type:
ndarray
Notes
- Mede’s envelopes (‘mede_s-RG1’, ‘mede_s-RG2’, ‘mede_s-FCDH’) are derived
from the work of Mede et al. (2018), “Snow Failure Modes Under Mixed Loading,” published in Geophysical Research Letters.
- Schöttner’s envelope (‘schottner’) is based on the preprint by Schöttner
et al. (2025), “On the Compressive Strength of Weak Snow Layers of Depth Hoar”.
- The ‘adam_unpublished’ envelope scales with weak layer density linearly
(compared to density baseline) by a ‘scaling_factor’ (weak layer density / density baseline), unless modified by ‘order_of_magnitude’.
- Mede’s criteria (‘mede_s-RG1’, ‘mede_s-RG2’, ‘mede_s-FCDH’) define
failure based on a piecewise function of stress ranges.
- evaluate_coupled_criterion(system, max_iterations=25, damping_ERR=0.0, tolerance_ERR=0.002, tolerance_stress=0.005, print_call_stats=False, _recursion_depth=0)[source]¶
Evaluates the coupled criterion for anticrack nucleation, finding the critical combination of skier weight and anticrack length.
Parameters:¶
- system: SystemModel
The system model.
- max_iterations: int
Max iterations for the solver. Defaults to 25.
- damping_ERR: float
damping factor for the ERR criterion. Defaults to 0.0.
- tolerance_ERR: float, optional
Tolerance for g_delta convergence. Defaults to 0.002.
- tolerance_stress: float, optional
Tolerance for stress envelope convergence. Defaults to 0.005.
- print_call_stats: bool
Whether to print the call statistics. Defaults to False.
- _recursion_depth: int
The depth of the recursion. Defaults to 0.
- returns:
results – An object containing the results of the analysis, including critical skier weight, crack length, and convergence details.
- rtype:
CoupledCriterionResult
- Parameters:
system (SystemModel)
max_iterations (int)
damping_ERR (float)
tolerance_ERR (float)
tolerance_stress (float)
print_call_stats (bool)
_recursion_depth (int)
- Return type:
- evaluate_SSERR(system, vertical=False, print_call_stats=False)[source]¶
Evaluates the Touchdown Distance in the Steady State and the Steady State Energy Release Rate.
Parameters:¶
- system: SystemModel
The system model.
- vertical: bool, optional
Whether to evaluate the system in a vertical configuration. Defaults to False.
- print_call_stats: bool, optional
Whether to print the call statistics. Defaults to False.
IMPORTANT: There is a bug in vertical = True, so always slope normal, i.e. vertical=False should be used.
- Parameters:
system (SystemModel)
vertical (bool)
print_call_stats (bool)
- Return type:
- find_minimum_force(system, tolerance_stress=0.0005, print_call_stats=False)[source]¶
Finds the minimum skier weight required to surpass the stress failure envelope.
This method iteratively adjusts the skier weight until the maximum distance to the stress envelope converges to 1, indicating the critical state.
Parameters:¶
- system: SystemModel
The system model.
- tolerance_stress: float, optional
Tolerance for the stress envelope. Defaults to 0.005.
- print_call_stats: bool, optional
Whether to print the call statistics. Defaults to False.
Returns:¶
- results: FindMinimumForceResult
An object containing the results of the analysis, including critical skier weight, and convergence details.
- Parameters:
system (SystemModel)
tolerance_stress (float)
print_call_stats (bool)
- Return type:
- find_minimum_crack_length(system, search_interval=None, target=1)[source]¶
Finds the minimum crack length required to surpass the energy release rate envelope.
Parameters:¶
- system: SystemModel
The system model.
Returns:¶
- minimum_crack_length: float
The minimum crack length required to surpass the energy release rate envelope [mm]
- new_segments: List[Segment]
The updated list of segments
- Parameters:
system (SystemModel)
search_interval (tuple[float, float] | None)
target (float)
- Return type:
tuple[float, List[Segment]]
- check_crack_self_propagation(system, rm_skier_weight=False)[source]¶
Evaluates whether a crack will propagate without any additional load. This method determines if a pre-existing crack will propagate without any additional load.
Parameters:¶
system: SystemModel
- returns:
g_delta_diff (float) – The evaluation of the fracture toughness envelope.
can_propagate (bool) – True if the criterion is met (g_delta_diff >= 1).
- Parameters:
system (SystemModel)
rm_skier_weight (bool)
- Return type:
tuple[float, bool]
- find_crack_length_for_weight(system, skier_weight)[source]¶
Finds the resulting anticrack length and updated segment configurations for a given skier weight.
Parameters:¶
- system: SystemModel
The system model.
- skier_weight: float
The weight of the skier [kg]
- returns:
new_crack_length (float) – The total length of the new cracked segments [mm]
new_segments (List[Segment]) – The updated list of segments
- Parameters:
system (SystemModel)
skier_weight (float)
- Return type:
tuple[float, List[Segment]]