Commit 8f52770
authored
Tensile Strength Evaluation as part of Steady State Analysis (#34)
This pull request refactors and improves the stress and steady-state
evaluation logic in the `weac.analysis` package. It introduces new
result data classes and fixes plotting issues related to stress
calculations and visualization.
### Refactoring and Data Model Improvements
* Introduced `MaximalStressResult` and `SteadyStateResult` data classes,
replacing the old `SSERRResult` for clearer and more comprehensive
result encapsulation. The new classes include normalized stress fields
and system state at touchdown.
(`[[1]](diffhunk://#diff-cd31ff029b0e336203154640e70d582b1554ca04f41c94048eaec4dee7daab6dL98-R129)`,
`[[2]](diffhunk://#diff-cd31ff029b0e336203154640e70d582b1554ca04f41c94048eaec4dee7daab6dL110-R153)`,
`[[3]](diffhunk://#diff-1b897e0700621752c15b1115da95c4b2a2d61aa57dde50d6b780bf490269b16cL11-R11)`,
`[[4]](diffhunk://#diff-1b897e0700621752c15b1115da95c4b2a2d61aa57dde50d6b780bf490269b16cL21-R21)`)
* Updated method names and references from `SSERR` to `SteadyState` for
consistency and clarity, including renaming the evaluation method and
result types.
(`[[1]](diffhunk://#diff-cd31ff029b0e336203154640e70d582b1554ca04f41c94048eaec4dee7daab6dL644-R684)`,
`[[2]](diffhunk://#diff-cd31ff029b0e336203154640e70d582b1554ca04f41c94048eaec4dee7daab6dL691-R734)`,
`[[3]](diffhunk://#diff-1b897e0700621752c15b1115da95c4b2a2d61aa57dde50d6b780bf490269b16cL11-R11)`,
`[[4]](diffhunk://#diff-1b897e0700621752c15b1115da95c4b2a2d61aa57dde50d6b780bf490269b16cL21-R21)`)
### Stress Calculation Enhancements
* Refactored the `Sxx` method in `analyzer.py` to support normalization
of axial normal stress to tensile strength, improving numerical
stability and result interpretability.
(`[[1]](diffhunk://#diff-8468e03357e32957d46ec295646154a4a64e750fa249655a80c6620d9ad32440L228-R228)`,
`[[2]](diffhunk://#diff-8468e03357e32957d46ec295646154a4a64e750fa249655a80c6620d9ad32440R242-R243)`,
`[[3]](diffhunk://#diff-8468e03357e32957d46ec295646154a4a64e750fa249655a80c6620d9ad32440L261-R269)`,
`[[4]](diffhunk://#diff-8468e03357e32957d46ec295646154a4a64e750fa249655a80c6620d9ad32440L277-R291)`)
* Improved normalization logic in `principal_stress_slab` to correctly
convert tensile strength units and normalize principal stresses.
(`[[1]](diffhunk://#diff-8468e03357e32957d46ec295646154a4a64e750fa249655a80c6620d9ad32440R451-R452)`,
`[[2]](diffhunk://#diff-8468e03357e32957d46ec295646154a4a64e750fa249655a80c6620d9ad32440L463-R478)`)
* Added `_calculate_maximal_stresses` helper method to centralize
maximal stress computation for steady-state evaluation.
(`[src/weac/analysis/criteria_evaluator.pyR1211-R1241](diffhunk://#diff-cd31ff029b0e336203154640e70d582b1554ca04f41c94048eaec4dee7daab6dR1211-R1241)`)
### Plotting and Visualization Fixes
* Updated `plot_deformed` in `plotter.py` to robustly handle NaN values
in weak-layer coordinates, ensuring correct plotting and preventing
errors when visualizing stress/displacement fields.
(`[[1]](diffhunk://#diff-737cdaa926ddb7c8e3803d8568adddbe44745a23baca2d6bd39fc27e8a41a1dcL888-R934)`,
`[[2]](diffhunk://#diff-737cdaa926ddb7c8e3803d8568adddbe44745a23baca2d6bd39fc27e8a41a1dcL971-R978)`)
These changes collectively enhance the clarity of stress analysis and
steady-state evaluation in the codebase.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Per-layer stress normalization option and a new deformation
visualization routine with selectable fields and normalization.
* **Bug Fixes**
* Robust handling and masking of NaN/invalid weak-layer coordinates in
deformation plotting.
* **Refactor**
* Steady‑state evaluation payload reorganized and renamed: includes
energy-release metric, detailed maximal-stress metrics, and system info.
* **Tests**
* Added tests for stress unit conversion and normalization consistency.
* **Chores**
* Gitignore reinstates .weac-reference and adds a dev/ entry.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->10 files changed
Lines changed: 645 additions & 93 deletions
File tree
- demo
- src/weac/analysis
- tests
- analysis
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
| 217 | + | |
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
242 | 246 | | |
243 | 247 | | |
244 | 248 | | |
| |||
258 | 262 | | |
259 | 263 | | |
260 | 264 | | |
261 | | - | |
| 265 | + | |
262 | 266 | | |
263 | 267 | | |
264 | 268 | | |
265 | | - | |
| 269 | + | |
266 | 270 | | |
267 | | - | |
| 271 | + | |
268 | 272 | | |
269 | 273 | | |
270 | 274 | | |
| |||
274 | 278 | | |
275 | 279 | | |
276 | 280 | | |
277 | | - | |
278 | | - | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
279 | 291 | | |
280 | 292 | | |
281 | | - | |
| 293 | + | |
282 | 294 | | |
283 | 295 | | |
284 | | - | |
| 296 | + | |
285 | 297 | | |
286 | 298 | | |
287 | 299 | | |
| |||
295 | 307 | | |
296 | 308 | | |
297 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
298 | 313 | | |
299 | 314 | | |
300 | 315 | | |
| |||
332 | 347 | | |
333 | 348 | | |
334 | 349 | | |
335 | | - | |
336 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
337 | 360 | | |
338 | 361 | | |
339 | | - | |
| 362 | + | |
340 | 363 | | |
341 | 364 | | |
342 | | - | |
| 365 | + | |
343 | 366 | | |
344 | 367 | | |
345 | 368 | | |
| |||
353 | 376 | | |
354 | 377 | | |
355 | 378 | | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
356 | 383 | | |
357 | 384 | | |
358 | 385 | | |
| |||
392 | 419 | | |
393 | 420 | | |
394 | 421 | | |
395 | | - | |
396 | | - | |
| 422 | + | |
| 423 | + | |
397 | 424 | | |
398 | | - | |
399 | | - | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
400 | 435 | | |
401 | 436 | | |
402 | 437 | | |
| |||
438 | 473 | | |
439 | 474 | | |
440 | 475 | | |
| 476 | + | |
| 477 | + | |
441 | 478 | | |
442 | 479 | | |
443 | 480 | | |
| |||
460 | 497 | | |
461 | 498 | | |
462 | 499 | | |
463 | | - | |
| 500 | + | |
| 501 | + | |
464 | 502 | | |
465 | | - | |
| 503 | + | |
466 | 504 | | |
467 | 505 | | |
468 | 506 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
101 | 130 | | |
102 | 131 | | |
103 | 132 | | |
| |||
107 | 136 | | |
108 | 137 | | |
109 | 138 | | |
110 | | - | |
111 | | - | |
112 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
113 | 146 | | |
114 | 147 | | |
115 | 148 | | |
116 | 149 | | |
117 | 150 | | |
118 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
119 | 154 | | |
120 | 155 | | |
121 | 156 | | |
| |||
641 | 676 | | |
642 | 677 | | |
643 | 678 | | |
644 | | - | |
| 679 | + | |
645 | 680 | | |
646 | 681 | | |
647 | 682 | | |
648 | 683 | | |
649 | | - | |
| 684 | + | |
650 | 685 | | |
651 | 686 | | |
652 | 687 | | |
| |||
688 | 723 | | |
689 | 724 | | |
690 | 725 | | |
691 | | - | |
692 | | - | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
693 | 733 | | |
694 | | - | |
| 734 | + | |
695 | 735 | | |
696 | | - | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
697 | 739 | | |
698 | 740 | | |
699 | 741 | | |
| |||
1170 | 1212 | | |
1171 | 1213 | | |
1172 | 1214 | | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
0 commit comments