Skip to content

Conversation

@bennibolm
Copy link
Contributor

@bennibolm bennibolm commented Sep 24, 2025

This PR contains 3D subcell limiting for P4estMesh:

  • only positivity limiter for conservative variables
  • no support for equations with nonconservative terms yet

Convergence test with polynomial degree of 4:

####################################################################################################
l2
rho                 rho_v1              rho_v2              rho_v3              rho_e               
error     EOC       error     EOC       error     EOC       error     EOC       error     EOC       
3.97e-03  -         4.22e-03  -         4.31e-03  -         3.99e-03  -         8.09e-03  -         
1.96e-04  4.34      2.24e-04  4.24      2.23e-04  4.27      1.40e-04  4.83      4.12e-04  4.30      
6.63e-06  4.89      7.37e-06  4.92      7.36e-06  4.92      4.32e-06  5.02      1.38e-05  4.90      
1.71e-07  5.28      1.78e-07  5.37      1.76e-07  5.39      1.20e-07  5.17      3.51e-07  5.29      

mean      4.83      mean      4.84      mean      4.86      mean      5.01      mean      4.83      
----------------------------------------------------------------------------------------------------
linf
rho                 rho_v1              rho_v2              rho_v3              rho_e               
error     EOC       error     EOC       error     EOC       error     EOC       error     EOC       
3.91e-02  -         3.21e-02  -         4.75e-02  -         4.77e-02  -         1.00e-01  -         
1.77e-03  4.46      1.91e-03  4.07      1.98e-03  4.58      1.63e-03  4.87      4.33e-03  4.53      
6.36e-05  4.80      6.22e-05  4.94      7.62e-05  4.70      5.85e-05  4.80      1.44e-04  4.91      
3.71e-06  4.10      3.46e-06  4.17      4.42e-06  4.11      3.58e-06  4.03      7.92e-06  4.18      

mean      4.45      mean      4.39      mean      4.46      mean      4.57      mean      4.54      
----------------------------------------------------------------------------------------------------

used the following mesh
image

Example of the sedov blast (see elixir): I used a easier setup with pressure 0.1 since only positivity limiting of density can be used.
On the left: Simulation in 3d. I adapted the initial condition such that nothing happens in the third direction.
On the right: Simulation in 2d

video.mp4

There are very small differences between the simulations, but I would say that this is expected.

@github-actions
Copy link
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.

@codecov
Copy link

codecov bot commented Sep 24, 2025

Codecov Report

❌ Patch coverage is 97.72727% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.81%. Comparing base (1d75f8f) to head (5f271e7).

Files with missing lines Patch % Lines
src/solvers/dgsem_p4est/subcell_limiters_3d.jl 90.00% 3 Missing ⚠️
...llbacks_stage/subcell_limiter_idp_correction_3d.jl 97.30% 1 Missing ⚠️
src/solvers/dgsem_p4est/dg_3d_subcell_limiters.jl 99.24% 1 Missing ⚠️
src/solvers/dgsem_tree/containers_3d.jl 98.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2582      +/-   ##
==========================================
+ Coverage   96.81%   96.81%   +0.01%     
==========================================
  Files         535      539       +4     
  Lines       42813    43077     +264     
==========================================
+ Hits        41446    41704     +258     
- Misses       1367     1373       +6     
Flag Coverage Δ
unittests 96.81% <97.73%> (+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.

@DanielDoehring DanielDoehring added the enhancement New feature or request label Sep 24, 2025
@bennibolm bennibolm marked this pull request as ready for review October 6, 2025 12:28
@bennibolm bennibolm requested a review from amrueda October 6, 2025 13:33
@DanielDoehring
Copy link
Member

I will take a closer look at the code this afternoon.

Could you maybe run one more refinement step of the convergence test (If it takes not too much time)?

@bennibolm bennibolm removed the request for review from amrueda October 15, 2025 09:45
Copy link
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.

Most of my comments are aiming for consistent formatting & asking for some comments. The implementation itself looks sound to me. Would be good to add a test (not necessarily an additional elixir) with AMR to stress-test the resize!ing

@bennibolm
Copy link
Contributor Author

I will take a closer look at the code this afternoon.

Could you maybe run one more refinement step of the convergence test (If it takes not too much time)?

Thank you very much.
I added one more step to the table above. The l2 error looks good, while the linf error drops a bit. This last simulation already took over an hour.

I will work through the suggestions in the next couple of hours. Thank you!

DanielDoehring
DanielDoehring previously approved these changes Oct 15, 2025
Copy link
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.

Good to go from my side!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants