Skip to content

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

Open
SAY-5 wants to merge 1 commit into
SciML:masterfrom
SAY-5:coarse-grid-argument-error
Open

Throw clear ArgumentError for grids too coarse for boundary stencil#578
SAY-5 wants to merge 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

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.

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)

2 participants