Skip to content
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

Add one-sided local subcell IDP limiting for non-linear variables #1792

Merged
merged 49 commits into from
May 8, 2024

Conversation

bennibolm
Copy link
Contributor

@bennibolm bennibolm commented Dec 22, 2023

The positivity limiting for non-linear variables was merged (PR) and therefore the Newton-bisection method is now included to main.
So now, the Newton method can easily be used for a local one-sided limiting of nonlinear variables.
General variables, e.g. entropy_guermond_etal or entropy_math, can be passed combined with a specification of the wanted bound, i.e. pass min for a lower bound and max for upper bounds.
Example: Pass the following parameter within the limiter

local_onesided_variables_nonlinear = [(Trixi.entropy_guermond_etal, min)]

Additional, in this PR I renamed local_minmax to local_twosided to be consistent with local_onesided.

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.

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 Dec 22, 2023

Codecov Report

Attention: Patch coverage is 92.50000% with 15 lines in your changes are missing coverage. Please review.

Project coverage is 96.10%. Comparing base (7fd735f) to head (3ede188).

Files Patch % Lines
src/callbacks_stage/subcell_bounds_check_2d.jl 79.17% 5 Missing ⚠️
src/callbacks_stage/subcell_bounds_check.jl 78.95% 4 Missing ⚠️
src/solvers/dgsem_tree/subcell_limiters.jl 88.89% 4 Missing ⚠️
src/solvers/dgsem_tree/subcell_limiters_2d.jl 98.04% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1792      +/-   ##
==========================================
- Coverage   96.11%   96.10%   -0.01%     
==========================================
  Files         451      451              
  Lines       36261    36414     +153     
==========================================
+ Hits        34850    34993     +143     
- Misses       1411     1421      +10     
Flag Coverage Δ
unittests 96.10% <92.50%> (-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.

@bennibolm bennibolm requested a review from sloede March 25, 2024 15:49
Copy link
Member

@sloede sloede left a comment

Choose a reason for hiding this comment

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

Almost there 😊

src/equations/compressible_euler_2d.jl Outdated Show resolved Hide resolved
src/equations/compressible_euler_2d.jl Outdated Show resolved Hide resolved
src/equations/compressible_euler_2d.jl Outdated Show resolved Hide resolved
src/solvers/dgsem_tree/subcell_limiters.jl Outdated Show resolved Hide resolved
@bennibolm bennibolm requested a review from sloede May 7, 2024 13:03
Copy link
Member

@sloede sloede left a comment

Choose a reason for hiding this comment

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

LGTM!

@sloede
Copy link
Member

sloede commented May 7, 2024

All failures seem to be Codecov related, but we still cannot see code coverage 😢

@sloede sloede closed this May 7, 2024
@sloede sloede reopened this May 7, 2024
@bennibolm
Copy link
Contributor Author

All failures seem to be Codecov related, but we still cannot see code coverage 😢

If it now fails again, I will rerun the failed tests overnight. That works most of the time.

@bennibolm
Copy link
Contributor Author

@sloede All tests have been run through now. The codecov tests still slightly fail, mostly due to not tested line within the saving deviations part of the BoundsCheckCallback.
Is it okay like this? Otherwise, I would have to enable more limiters in the one or two elixirs where the deviations are actually saved in the tests.

@sloede
Copy link
Member

sloede commented May 8, 2024

It seems to me that I/O for one-sided or two-sided limiters is not covered in the tests. If I were you, I'd make sure to have this part executed at least in one test to ensure it will continue to work even if you decide to modify some variables somewhere else.

But I'll leave the decision up to you on how to proceed.

@bennibolm
Copy link
Contributor Author

It seems to me that I/O for one-sided or two-sided limiters is not covered in the tests. If I were you, I'd make sure to have this part executed at least in one test to ensure it will continue to work even if you decide to modify some variables somewhere else.

But I'll leave the decision up to you on how to proceed.

I already included a two sided limiter I/O test in #1824. So, I think it would merge this PR as it is and handle the one sided I/O in the other PR (or a completely new one).

@sloede
Copy link
Member

sloede commented May 8, 2024

I already included a two sided limiter I/O test in #1824.

Are you sure? On Codecov, I am seeing this
image

for src/callbacks_stage/subcell_bounds_check_2d.jl, and this
image

for src/callbacks_stage/subcell_bounds_check.jl.

But if that's ok, we can still merge right away 😊

@bennibolm
Copy link
Contributor Author

I already included a two sided limiter I/O test in #1824.

Are you sure? On Codecov, I am seeing this image

for src/callbacks_stage/subcell_bounds_check_2d.jl, and this image

for src/callbacks_stage/subcell_bounds_check.jl.

But if that's ok, we can still merge right away 😊

Oh, you're right. I just added the test for elixir_euler_sedov_blast_wave_sc_subcell without any additional limiter. But I added the onesided limiter to this specific elixir in this PR here, so I'll have to deal with it anyway 😅

So, I would go for it and merge it 🚀

@sloede sloede merged commit 80f3c36 into trixi-framework:main May 8, 2024
35 of 37 checks passed
@bennibolm bennibolm deleted the subcell-limiting-entropies branch May 8, 2024 10:34
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.

None yet

3 participants