Enforce tresca mises methods in tf stresscl()#4433
Conversation
…mises_stress function from materials file instead
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4433 +/- ##
==========================================
- Coverage 48.63% 48.63% -0.01%
==========================================
Files 151 151
Lines 29673 29674 +1
==========================================
Hits 14432 14432
- Misses 15241 15242 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
timothy-nunn
left a comment
There was a problem hiding this comment.
Happy with code changes. I have a few requests about tests to ensure these functions work with (combinations of) the types stated.
There was a problem hiding this comment.
Could you write a couple of quick tests for calculate_tresca_stress that check it returns the expected value when running with floats, numpy arrays, and mixtures of the two (if this makes sense).
There was a problem hiding this comment.
Is there an existing test for calculate_von_mises_stress? if not could this test be copied into the appropriate location for that function
* Change tresca stress calculation to be numba compliant for pytest * Update von mises function to use numba * 🔥 Remove `sigvm` method from TF base class and use the calculate_von_mises_stress function from materials file instead * Add tests for Tresca stress calculation with various input types * Add tests for von Mises stress calculation with various input types
This pull request refactors the calculation of Tresca and Von Mises stresses in the codebase to improve performance and maintainability. The main changes involve replacing legacy, hand-coded stress calculation logic with optimized, reusable functions, and updating all usages to rely on these new implementations. Additionally, related tests and unused code are cleaned up.
process/models/tfcoil/base.pyto use the newcalculate_tresca_stressandcalculate_von_mises_stressfunctions throughout, replacing manual calculations for both array and scalar cases.Code cleanup:
sigvmfunction fromprocess/models/tfcoil/base.pyas it is now superseded by the new stress calculation functions.test_sigvmtest fromtests/unit/models/tfcoil/test_tfcoil.pythat directly tested the removedsigvmfunction.These changes make the stress calculations more efficient, easier to maintain, and consistent across the codebase.## Description
Checklist
I confirm that I have completed the following checks: