Repository navigation
feat: add interface and periodic boundary support for non-uniform WENO - #602
Merged
ChrisRackauckas merged 1 commit intoJul 28, 2026
Merged
Conversation
utkuyilmaz1903
force-pushed
the
feat/weno-nu-interface-bc
branch
3 times, most recently
from
July 17, 2026 22:45
7062ad5 to
f79056f
Compare
utkuyilmaz1903
marked this pull request as ready for review
July 17, 2026 23:04
utkuyilmaz1903
force-pushed
the
feat/weno-nu-interface-bc
branch
from
July 22, 2026 10:41
f79056f to
8bf5a3e
Compare
Member
Author
ChrisRackauckas
approved these changes
Jul 28, 2026
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.
Interface and periodic boundary support for non-uniform WENO
Adds native interface / periodic BC support to the non-uniform WENO-5 advection scheme. Previously this configuration crashed at discretization time (
BoundsErrorfrom slicing theN-1-lengthdxvector with wrapped indices) and would have fed non-monotonic coordinates to the kernel.Core changes
interface_boundary.jl— newbcoord/_wrapcoord: returns the physical coordinate of a raw stencil tap in the differentiated grid's chart. Wrapped taps use the exact chart transition of the interface (periodic: shift by period length; contiguous two-domain: zero shift), so coordinates are strictly increasing across the seam. Purely additive; existingbwrap/RefCartesianIndexindex-wrapping is untouched.function_scheme.jl—get_f_taps_coordsnow also returns the unwrapped indices (Iraw). With interfaces present,discxis built viabcoordanddx = diff(discx); without interfaces, the original@viewfast path is byte-identical. Adds a guard: wrapping requiresN-1 >= interior_points(periodicu[1] ≡ u[N]leavesN-1distinct nodes), with a clear error otherwise.get_f_and_tapskept as a thin wrapper for API compatibility.MOL_discretization.jl—check_boundarymapwaives the equal-dxrequirement only for non-uniformFunctionalSchemewith grid vectors on both sides of the interface (shared predicatemismatched_interface_dxs).interior_map.jl—validate_interface_orders(called fromconstruct_var_equation_mapping): rejects systems containing spatial derivative orders > 1 in variables connected by a mismatched-grid interface, since only the first-order path is coordinate-aware. Prevents silently inaccurate diffusion stencils at the seam; matched-grid interfaces are unaffected.The WENO kernels (
nonuniform_weno.jl,WENO.jl) are untouched. All new code runs at discretization time; the generated RHS structure is unchanged.Tests
test/Components/weno_interface_coords.jl(new): unit tests forbcoordchart transitions (periodic shifts, zero-shift contiguous interface, seam monotonicity) and the stencil-wrap guard (N=5throws,N=6passes).test/Convection_WENO/MOL_1D_WENO_NU_Interface.jl(new):@test_throws ArgumentErrorforDxxacross a mismatched-grid interface.Docs
advection_schemes.md/boundary_conditions.md: document non-uniform periodic/interface support and the first-order-only restriction for mismatched grids.