Repository navigation
Support integrals in ArrayDiscretization - #655
Merged
ChrisRackauckas merged 4 commits intoAug 26, 2026
Merged
Conversation
The pointwise trapezoid rule is unchanged; the array path writes the same increments once as a scan or a weighted sum.
Broadcast a scalar residual onto a slice instead of fill, which inlined one zero per point. Rename array_zerod_value for the spell checker.
utkuyilmaz1903
force-pushed
the
feature/array-integrals
branch
from
August 23, 2026 19:41
50078d7 to
56f57d6
Compare
Member
Author
|
Do not merge this yet. |
utkuyilmaz1903
marked this pull request as ready for review
August 25, 2026 09:41
Member
Author
|
@ChrisRackauckas This is now ready for review. |
This was referenced Aug 26, 2026
ChrisRackauckas
referenced
this pull request
Aug 27, 2026
v1.1.1 was never registered - AutoMerge rejected it because `import MethodOfLines` failed, and that PR was closed unmerged. The version number is therefore still free, so 1.1.2 would skip it and trips the sequential-version guideline. Restore 1.1.1, keeping the Symbolics 7.38 floor that actually fixes the load failure. Claude-Session: https://claude.ai/code/session_014FEzNTLFutCmTEAZ3zBg5R Co-authored-by: Claude <[email protected]>
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.
Part of #623.
Summary
Integrals still expanded to one scalar equation per grid point, so both the equation count and the expression size grew with
n. They are reductions, not stencils: the pointwise path is the trapezoid rule (I[1] = 0, then a running sum of(Δ/2)*(u[k-1]+u[k])). The array path writes that same arithmetic once.Integral(xmin, x)(u): full-axis increments plus a registered prefix scan (axis_cumsum_pad). Same weights as_euler_integral.Integral(xmin, xmax)(u): weightedsum, and only when the integration axis is absent from the equation variable (the existingindexmap/bvarfilter). 0D and single-point BCs get the compact sum so the RHS stays O(1) nodes.S(t),R(t)) bind as scalars, which is what keeps the age-structured SIRI(a,t)equation in slice form.Scalar sides of an array equation (the
~ 0residual, a 0D variable) broadcast onto a core slice.fill(0, n)was anarray_literaland made the expression grow with the grid.Same-signature whole-domain (
integral(t,x) ~ Ix(u(t,x))withxon the equation) is still not substituted. That was never a scalar interior scheme; it stays a docs limitation.(a,b)limits and composite integrands are unchanged.Results
Ix(u),xmin..xn=11vs41)atol=0.36dxvectorn=11vs31)8×6vs16×10)Dt(u)+Dx(cumuSum), aux wrapn=12vs24)solve(prob)succeedsDt(u) ~ Dxx(u) + Ix(u)cumuSum(t) ~ Ix(u)n=11vs41)sum; analyticatol=0.3v(t,y) ~ Ix(u(t,x,y))8×6vs16×10)sumalongxIspatial,S/R0D)n=10andn=20sumonS/R;solve(prob)succeedsFalls back
Unchanged from the scalar path:
(a,b)intervals, composite integrands without an aux, stationary systems, and equations that already fall back for another reason. Same-signature whole-domain in the interior is still not a scheme.