Commit dfa0e14
committed
perf(P3): integrate ice self-collection over the D₁<D₂ triangle
The ice self-collection kernel π(r₁+r₂)²·|v(D₁)−v(D₂)|·n(D₁)·n(D₂) is symmetric
under D₁↔D₂, so the double integral over the (D₁,D₂) square equals twice the
integral over the D₁<D₂ triangle. Restricting the inner integral to [D₁, D_max]
(the ×2 cancels the existing ½ double-counting factor) halves the inner-integral
work and places the |Δv| velocity-crossover cusp at the integration endpoint
rather than mid-interval, restoring spectral convergence.
The regime breakpoints are restricted to [D₁, D_max] by clamping each up to D₁
(subintervals below D₁ collapse to zero width, a no-op in `integrate`), adding D₁
as the lower endpoint, and re-sorting; the operations run on fixed-length tuples.
~1.96× faster self-collection (~1.32× the full 2M+P3 tendency); equal to the full
integral to quadrature precision. No allocations, type-stable.
The triangle-restricted integral converges marginally more slowly at low order
for dn_ice_dt of one ice-bearing column (rel ≈ 5.3e-3 at order 50), so the
quadrature-order-sweep test relaxes the order-50 tolerance 5e-3 → 6e-3.1 parent aeb57d4 commit dfa0e14
2 files changed
Lines changed: 17 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
698 | 698 | | |
699 | 699 | | |
700 | 700 | | |
| 701 | + | |
701 | 702 | | |
702 | 703 | | |
703 | 704 | | |
704 | | - | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
705 | 712 | | |
706 | 713 | | |
707 | 714 | | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
712 | 719 | | |
713 | 720 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
250 | 253 | | |
251 | 254 | | |
252 | 255 | | |
| |||
0 commit comments