Vectorize I_nm/I_mk coupling integrals and remove per-element assembly loops - #99
Conversation
…ommand Set PR_TITLE environment variable for base version computation.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #99 +/- ##
===================================================
- Coverage 98.56061% 98.53372% -0.02688%
===================================================
Files 11 11
Lines 1320 1364 +44
===================================================
+ Hits 1301 1344 +43
- Misses 19 20 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
rebeccamccabe
left a comment
There was a problem hiding this comment.
@copilot look at the suggestions I have made which starts with nan and explicitly assigns zeros, instead of starting with zeros and having lack of assignment be the zeros. this is a change for readability to ensure the formulas are easier to check and it is clear exactly where there are zeros. apply these changes and the equivalent changes for the remainder of the function.
Implemented in commit 920f560. |
rebeccamccabe
left a comment
There was a problem hiding this comment.
restoring lost comments
Co-authored-by: Becca <32020426+rebeccamccabe@users.noreply.github.com>
I_nmandI_mkwere scalar/branch-oriented and required nested Python loops in matrix assembly, limiting performance and making fast-path formulas harder to apply selectively. This change makes both integrals array-native and applies case-specific formulas via mask-based indexing so expensive/general formulas run only where required.Vectorized coupling APIs (
multi_equations.py)I_nmandI_mkto compute with logical masks for:Assembly/cache integration (
meem_engine.py)(n,m)precompute loops forI_nmwith a single vectorized call over mode grids.(m,k)closure loop forI_mkwith a single vectorized call, preserving existing cache interfaces and downstream block assembly behavior.Illustrative usage