Skip to content

Throw clear ArgumentError for grids too coarse for boundary stencil#578

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
SAY-5:coarse-grid-argument-error
Jul 5, 2026
Merged

Throw clear ArgumentError for grids too coarse for boundary stencil#578
ChrisRackauckas merged 1 commit into
SciML:masterfrom
SAY-5:coarse-grid-argument-error

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #559. On a non-uniform grid with fewer than approximation_order + 1 points, the boundary extrapolator indexed dx out of range and failed with an opaque BoundsError deep in extrapolation_weights.jl. This adds an explicit length check up front so the user gets a clear message telling them the grid is too coarse for the boundary stencil. Added a regression test alongside the existing non-uniform convection cases.

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
@utkuyilmaz1903

Copy link
Copy Markdown
Contributor

This looks much better. I've closed my PR since this is a cleaner approach. Thanks.

@ChrisRackauckas ChrisRackauckas merged commit f067f01 into SciML:master Jul 5, 2026
14 of 65 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.

Bug/Enhancement: Extrapolator throws opaque BoundsError instead of ArgumentError for small AbstractVector grids (N < 7)

3 participants