Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

143 refactor notch approximation #150

Merged
merged 25 commits into from
Feb 6, 2025

Conversation

johannes-mueller
Copy link
Member

Closes #143

In a nutshell:

  • Introduce NotchApproxBinner new class to do the binning for the notch approximation.
  • Introduced methods NotchApproximationLawBase.primary and NotchApproximationLawBase.secondary in order to be able to get stress strain data in only one lookup.
  • Therefore the load argument can be dropped in the methods for strain calculation.
  • NotchApproximationBinner has the method .initialize to set the maximum load. That means, that determining the maximum load can be left to FKMRainflowDetector.
  • Drop obsolete Binned class in favor of NotchApproxBinner
  • Adjust the unit tests accordingly. Some assertions in tests/strength/fkm_nonlinear/test_fkm_nonlinear.py had to be dropped because they were using internals of Binned.

This adds a performance boost of roughly factor 10.

Open point

As we now do no longer need to precondition the binner with the maximum load, we need to rethink the role of "max_load_independently_for_nodes" in the assessment parameters and find a neat way how to handle it. This will be treated in a follow up issue.

@maierbn take your time to review, no rush. We can discuss details after the winter break. I put some effort into arranging the commits in a meaningful way. So reviewing them individually might be easier to understand what's going on.

Signed-off-by: Johannes Mueller <[email protected]>
The LUTs are implementation details and should not be accessed directly by
tests.

Signed-off-by: Johannes Mueller <[email protected]>
Signed-off-by: Johannes Mueller <[email protected]>
Signed-off-by: Johannes Mueller <[email protected]>
Signed-off-by: Johannes Mueller <[email protected]>
@johannes-mueller johannes-mueller force-pushed the 143-refactor-notch-approximation branch from c2dd7b9 to a7105fd Compare January 16, 2025 15:44
The epsilon_min_LF and epsilon_max_LF values where wrongly picked for open
hysteresis loops. Now the epsilon_(min|max)_LF calculation is identical to the
state of bf10295.

Signed-off-by: Johannes Mueller <[email protected]>
Signed-off-by: Johannes Mueller <[email protected]>
Copy link
Contributor

@maierbn maierbn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fkm_nonlinear.py There is a typo HYSTORY_COLUMNS -> HISTORY_COLUMNS

src/pylife/materiallaws/notch_approximation_law.py Outdated Show resolved Hide resolved
src/pylife/materiallaws/notch_approximation_law.py Outdated Show resolved Hide resolved
src/pylife/materiallaws/notch_approximation_law.py Outdated Show resolved Hide resolved
@maierbn
Copy link
Contributor

maierbn commented Feb 3, 2025

review continues...

Copy link
Contributor

@maierbn maierbn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable overall, it would be nice to have the issues addressed before merge.

src/pylife/stress/rainflow/fkm_nonlinear.py Outdated Show resolved Hide resolved
tests/stress/rainflow/test_fkm_nonlinear.py Show resolved Hide resolved
tests/stress/rainflow/test_fkm_nonlinear.py Show resolved Hide resolved
src/pylife/materiallaws/notch_approximation_law.py Outdated Show resolved Hide resolved
tests/strength/test_damage_calculator.py Outdated Show resolved Hide resolved
src/pylife/stress/rainflow/fkm_nonlinear.py Show resolved Hide resolved
src/pylife/stress/rainflow/fkm_nonlinear.py Show resolved Hide resolved
@johannes-mueller
Copy link
Member Author

fkm_nonlinear.py There is a typo HYSTORY_COLUMNS -> HISTORY_COLUMNS

Oh gee, I got that one wrong ever so often. "hysteresis", "history". Will fix it.

@johannes-mueller johannes-mueller merged commit 94d3f8d into develop Feb 6, 2025
14 checks passed
@johannes-mueller
Copy link
Member Author

Thanks @maierbn for your hints. I've merged this now. The rest we will treat in follow up issues if needed.

@johannes-mueller johannes-mueller deleted the 143-refactor-notch-approximation branch February 6, 2025 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor notch approximation classes for better performance
2 participants