Skip to content

unify NeumannBC/NeumannGradientBC as ExtrapolationBC aliases#79

Merged
maltezfaria merged 2 commits intomainfrom
extrap-bc
Mar 12, 2026
Merged

unify NeumannBC/NeumannGradientBC as ExtrapolationBC aliases#79
maltezfaria merged 2 commits intomainfrom
extrap-bc

Conversation

@maltezfaria
Copy link
Copy Markdown
Owner

Generalise the extrapolation boundary conditions to handle arbitrary order extrapolation. I found this was necessary to observe high-order convergence of the WENO5 scheme (which in turn was needed for me to observe high-order convergence in time of some of the time integrators). Done with Copilot and Claude.

- Add ExtrapolationBC{P}: P-point one-sided Lagrange extrapolation BC
- NeumannBC = ExtrapolationBC{1} (constant extension, ∂ϕ/∂n = 0)
- NeumannGradientBC = ExtrapolationBC{2} (linear extrapolation, ∂²ϕ/∂n² = 0)
- Remove dedicated NeumannBC/NeumannGradientBC dispatch in _getindexrec;
  both now flow through _apply_extrapolation_bc (same performance, ~1.7 ns)
- Remove dead CartesianMeshField-specific _getindex overloads for these BCs
- Inline _wrap_index_neumann/_wrap_index_neumann_gradient into their only
  caller (_i2oe_neighbor_relation in levelsetequation.jl)
- Add tests asserting ExtrapolationBC{1}==NeumannBC and ExtrapolationBC{2}==NeumannGradientBC
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 12, 2026

Codecov Report

❌ Patch coverage is 96.42857% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 59.42%. Comparing base (98a34f2) to head (a0beb35).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/levelsetequation.jl 83.33% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (98a34f2) and HEAD (a0beb35). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (98a34f2) HEAD (a0beb35)
2 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main      #79       +/-   ##
===========================================
- Coverage   82.11%   59.42%   -22.70%     
===========================================
  Files          16       16               
  Lines        1180     1151       -29     
===========================================
- Hits          969      684      -285     
- Misses        211      467      +256     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maltezfaria maltezfaria merged commit 52c703d into main Mar 12, 2026
6 checks passed
@maltezfaria maltezfaria deleted the extrap-bc branch March 12, 2026 08:43
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.

1 participant