Skip to content

Add missing p4est functions with nonconservative terms #2308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

benegee
Copy link
Contributor

@benegee benegee commented Mar 20, 2025

When using nonconservative terms in equations,

  • 2D calc_mpi_interface_flux
  • 2D calc_mpi_mortar_flux
  • 3D calc_boundary_flux

were missing. I tried to do implement them in analogy to the corresponding 2D/3D case.

Some tests are still missing.

@benegee benegee requested a review from amrueda March 20, 2025 10:27
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.

Copy link

codecov bot commented Mar 20, 2025

Codecov Report

Attention: Patch coverage is 82.08955% with 12 lines in your changes missing coverage. Please review.

Project coverage is 96.91%. Comparing base (4785741) to head (b394034).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/solvers/dgsem_p4est/dg_3d.jl 56.00% 11 Missing ⚠️
src/callbacks_step/analysis_dg2d.jl 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2308      +/-   ##
==========================================
+ Coverage   96.90%   96.91%   +0.01%     
==========================================
  Files         503      505       +2     
  Lines       41717    41768      +51     
==========================================
+ Hits        40425    40479      +54     
+ Misses       1292     1289       -3     
Flag Coverage Δ
unittests 96.91% <82.09%> (+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.

@benegee benegee changed the title Add nonconservative terms to p4est 3D calc_boundary_flux Add missing p4est functions with nonconservative terms Apr 13, 2025
Copy link
Contributor

@amrueda amrueda left a comment

Choose a reason for hiding this comment

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

Thanks for adding this @benegee!
I have only checked the 2D part, and I think that I identified an issue. I'll commit a suggestion. After this, we can add a test to check if the parallel implementation does the same as the serial one.
@benegee, can you please copy one of the existing curvilinear non-conservative examples into the MPI test suit? (see, e.g., the 3D non-conservative MPI PR: #2126)

@DanielDoehring DanielDoehring added bug Something isn't working enhancement New feature or request labels Apr 25, 2025
@benegee
Copy link
Contributor Author

benegee commented Apr 30, 2025

I added an MPI test, using a new elixir adapted from the 3D elixir_mhd_alfven_wave_nonconforming.jl.
Would you want to run this without MPI as well, to check consistency?

@amrueda
Copy link
Contributor

amrueda commented Apr 30, 2025

I added an MPI test, using a new elixir adapted from the 3D elixir_mhd_alfven_wave_nonconforming.jl. Would you want to run this without MPI as well, to check consistency?

Yes, I think that we should have tests with and without MPI running the same elixir and getting the same reference values. You can just copy a non-conservative test set from test/test_mpi_p4est_2d.jl into test/test_p4est_2d.jl or the other way around 😉

benegee and others added 2 commits April 30, 2025 17:51
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@benegee
Copy link
Contributor Author

benegee commented Apr 30, 2025

The 2D test cases seem to work.

Any idea which elixir could be used to cover the 3D calc_boundary_flux?

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants