Skip to content

Support WENO advection on periodic nonuniform grids in ArrayDiscretization - #649

Merged
ChrisRackauckas merged 2 commits into
SciML:masterfrom
utkuyilmaz1903:feat/weno-nu-periodic-array
Aug 20, 2026
Merged

ChrisRackauckas merged 2 commits into
SciML:masterfrom
utkuyilmaz1903:feat/weno-nu-periodic-array

Conversation

@utkuyilmaz1903

@utkuyilmaz1903 utkuyilmaz1903 commented Aug 20, 2026 •

Copy link
Copy Markdown
Member

Closes the periodic nonuniform WENO gap deliberately left in #646, finishing the WENO item from #623.

Summary

The machinery was already there: seam-wrapping tap slices (#619) and the coefficient split (#646). The one missing piece was the coefficient windows at seam-adjacent points, where view(grid, i .+ taps) runs out of bounds. Those windows now take the same periodically shifted coordinates the scalar path's bcoord produces, via a new array_periodic_coord helper that mirrors _wrapcoord bit for bit (single add/subtract of the parenthesized period, identical FP association). The slots stay numeric per point and the kernel still traces once, so #646's bitwise-parity invariant carries over unchanged — the seam never touches the trace.

The blanket rejection of nonuniform interfaces in array_periodic_dims is removed; the guard moves to the point of use (array_central_difference, array_upwind_difference, array_nonlinear_laplacian), matching the existing style.

Results

All 1D cases verified against ScalarizedDiscretization on the current master base:

Case Interior array eqs Numerics vs scalar path
1D periodic nonuniform WENO (cosine grid) 1 solution bitwise identical (==)
Smallest admissible grid (n = 7; every window wraps) 1 RHS / solution bitwise identical (maxdiff 0.0)
n = 16, RHS at IC and 5 random matched states 1 RHS bitwise identical (maxdiff 0.0)
Seam coefficient windows (both ends) — symbolically identical (isequal) to the scalar core
Resolution independence (n = 40 vs n = 80) same count equation count independent of grid size
Strict mode, periodic nonuniform 1 passes
2D: periodic nonuniform x, Dirichlet uniform y 5 (array path) no scalar reference (see below); vs exact advection L∞ < 0.1
WENO + diffusion on a periodic nonuniform grid fallback identical via pointwise
Mixed Dx(Dy(u)) along a periodic nonuniform direction fallback identical via pointwise

The 1D equation count stays independent of the grid resolution. Wrap points remain pointwise for the same structural reason as on a uniform periodic grid: a tap range that straddles the seam is not a contiguous slice.

2D periodic nonuniform advection has no scalar reference: the scalar path eagerly builds mixed-derivative stencils for every multi-dimensional system and still rejects nonuniform interfaces. The array path builds mixed rules only for mixed terms present in the equation, so this system stays in slice form and is checked against the exact advection solution.

tutorials/nonuniform_weno.md is now fully covered, including its periodic variant.

@utkuyilmaz1903
utkuyilmaz1903 marked this pull request as ready for review August 20, 2026 14:25
@utkuyilmaz1903
utkuyilmaz1903 force-pushed the feat/weno-nu-periodic-array branch from 0381b7d to fb23bc3 Compare August 20, 2026 14:46
@ChrisRackauckas
ChrisRackauckas merged commit 88a568e into SciML:master Aug 20, 2026
69 checks passed
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.

2 participants