Skip to content

DGMulti shock capturing part 2: SBP approximation types#2942

Merged
jlchan merged 28 commits intotrixi-framework:mainfrom
jlchan:jc/shock_capturing_part_2
Apr 29, 2026
Merged

DGMulti shock capturing part 2: SBP approximation types#2942
jlchan merged 28 commits intotrixi-framework:mainfrom
jlchan:jc/shock_capturing_part_2

Conversation

@jlchan
Copy link
Copy Markdown
Contributor

@jlchan jlchan commented Apr 20, 2026

This splits off implementation of shock capturing for SBP types from #2872 into a smaller PR. Part 1 is #2940 and should be merged first.

The main functionality implemented here is volume_integral_kernel! for DGMultiFluxDiffSBP types on tensor product element types. Previously, there was only an implementation for GaussSBP types, which involved one additional projection step.

@github-actions
Copy link
Copy Markdown
Contributor

Review checklist

This checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging.

Purpose and scope

  • The PR has a single goal that is clear from the PR title and/or description.
  • All code changes represent a single set of modifications that logically belong together.
  • No more than 500 lines of code are changed or there is no obvious way to split the PR into multiple PRs.

Code quality

  • The code can be understood easily.
  • Newly introduced names for variables etc. are self-descriptive and consistent with existing naming conventions.
  • There are no redundancies that can be removed by simple modularization/refactoring.
  • There are no leftover debug statements or commented code sections.
  • The code adheres to our conventions and style guide, and to the Julia guidelines.

Documentation

  • New functions and types are documented with a docstring or top-level comment.
  • Relevant publications are referenced in docstrings (see example for formatting).
  • Inline comments are used to document longer or unusual code sections.
  • Comments describe intent ("why?") and not just functionality ("what?").
  • If the PR introduces a significant change or new feature, it is documented in NEWS.md with its PR number.

Testing

  • The PR passes all tests.
  • New or modified lines of code are covered by tests.
  • New or modified tests run in less then 10 seconds.

Performance

  • There are no type instabilities or memory allocations in performance-critical parts.
  • If the PR intent is to improve performance, before/after time measurements are posted in the PR.

Verification

  • The correctness of the code was verified using appropriate tests.
  • If new equations/methods are added, a convergence test has been run and the results
    are posted in the PR.

Created with ❤️ by the Trixi.jl community.

jlchan added 3 commits April 19, 2026 21:26
Removing curved shock capturing test since we haven't implemented low order free-stream metrics
@jlchan
Copy link
Copy Markdown
Contributor Author

jlchan commented Apr 20, 2026

CI results differ pretty significantly from local results in this PR: https://github.com/trixi-framework/Trixi.jl/actions/runs/24645680499/job/72057804271?pr=2942#step:7:11928

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.13%. Comparing base (237cca1) to head (04d0210).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2942   +/-   ##
=======================================
  Coverage   97.13%   97.13%           
=======================================
  Files         623      624    +1     
  Lines       48384    48439   +55     
=======================================
+ Hits        46995    47050   +55     
  Misses       1389     1389           
Flag Coverage Δ
unittests 97.13% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@jlchan
Copy link
Copy Markdown
Contributor Author

jlchan commented Apr 21, 2026

CI results differ pretty significantly from local results in this PR: https://github.com/trixi-framework/Trixi.jl/actions/runs/24645680499/job/72057804271?pr=2942#step:7:11928

Still trying to track down CI differences. Rerunning with Julia v1.10.11 on my laptop doesn't change test results.

Edit: it seems to be an Apple Silicon issue. Using julia +1.12~x86 matches CI results, while julia+1.12 on aarch64 results in different values...

@jlchan
Copy link
Copy Markdown
Contributor Author

jlchan commented Apr 21, 2026

Found the issue: it's the discontinuous initial condition from initial_condition_weak_blast_wave. Floating point differences on aarch64 and x86 resulted in different initial conditions when using SBP approximation types with points on the boundary.

This issue doesn't arise for other approximation types because they initialize the solution using an L2 projection at interior quadrature points and never evaluate the solution exactly at the discontinuity.

Edit: maybe not, CI still seems to be having issues still

Edit 2: ah, the issue is discontinuity of atan around x=0.

jlchan and others added 3 commits April 20, 2026 22:27
Replace the polar-coordinate blast setup with a Cartesian weak C0 initial condition so we avoid floating-point trouble from polar evaluation and from sampling exactly on the discontinuity.

Update the GaussSBP and SBP regression L2/L∞ norms in test_dgmulti_2d.jl for elixir_euler_shockcapturing.jl to match the new IC.

Made-with: Cursor
Comment thread src/solvers/dgmulti/shock_capturing.jl Outdated
Comment thread src/solvers/dgmulti/shock_capturing.jl Outdated
Comment thread src/solvers/dgmulti/shock_capturing.jl
Comment thread src/solvers/dgmulti/shock_capturing.jl
Comment thread src/solvers/dgmulti/shock_capturing.jl
@jlchan jlchan marked this pull request as ready for review April 23, 2026 02:55
@jlchan
Copy link
Copy Markdown
Contributor Author

jlchan commented Apr 23, 2026

Thanks for the review @DanielDoehring!

Comment thread src/solvers/dgmulti/shock_capturing.jl Outdated
Comment thread examples/dgmulti_2d/elixir_euler_shockcapturing.jl Outdated
DanielDoehring
DanielDoehring previously approved these changes Apr 26, 2026
Copy link
Copy Markdown
Member

@DanielDoehring DanielDoehring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for making these PRs easier digestible Jesse :)

Comment thread src/solvers/dgmulti/shock_capturing.jl Outdated
Comment thread src/solvers/dgmulti/shock_capturing.jl Outdated
@jlchan jlchan merged commit c724d12 into trixi-framework:main Apr 29, 2026
40 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