Repository navigation
Add Eshelby memo, caching and lazy fields - #129
Merged
Merged
Conversation
Introduce eshelby_memo to memoize Eshelby tensors for identical inclusion geometry/medium and reuse them within a homogenization pass (bitwise key). Integrate the memo into ellipsoid_multi: add S_loc_memo, eshelby_memoized(), and extend fillT/fillT_iso/fillT_mec_in to accept an optional memo; implement find/store/clear in C++ and use memcmp for exact-medium keys. Create a per-pass memo in various micromechanics schemes so identical integrations are shared, improving performance. Python-side optimizations: make SolverResults compute expensive derived field 'LogStrain' lazily (pending derivations, _materialize, and persistent behavior on save/load/to_dataframe). In tensor.py add Basis pickling support that drops cached handles, add cached rotation handles and optional C++ rotation handles propagation to rotation paths to avoid re-creating C++ rotation objects in single-tensor rotations. Other changes: rows_to_arr now moves the Armadillo matrix into the numpy conversion to avoid an extra copy; add required includes (vector, cstring, utility). Add tests (test_lazy_derivations.py and Teshelby test update) covering memo behavior, Basis cache/pickling, and lazy LogStrain materialization. Overall the changes reduce redundant recomputation and improve performance while preserving numerical results.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce eshelby_memo to memoize Eshelby tensors for identical inclusion geometry/medium and reuse them within a homogenization pass (bitwise key). Integrate the memo into ellipsoid_multi: add S_loc_memo, eshelby_memoized(), and extend fillT/fillT_iso/fillT_mec_in to accept an optional memo; implement find/store/clear in C++ and use memcmp for exact-medium keys. Create a per-pass memo in various micromechanics schemes so identical integrations are shared, improving performance.
Python-side optimizations: make SolverResults compute expensive derived field 'LogStrain' lazily (pending derivations, _materialize, and persistent behavior on save/load/to_dataframe). In tensor.py add Basis pickling support that drops cached handles, add cached rotation handles and optional C++ rotation handles propagation to rotation paths to avoid re-creating C++ rotation objects in single-tensor rotations.
Other changes: rows_to_arr now moves the Armadillo matrix into the numpy conversion to avoid an extra copy; add required includes (vector, cstring, utility). Add tests (test_lazy_derivations.py and Teshelby test update) covering memo behavior, Basis cache/pickling, and lazy LogStrain materialization. Overall the changes reduce redundant recomputation and improve performance while preserving numerical results.