-
Notifications
You must be signed in to change notification settings - Fork 112
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
Outsource saving of bounds check errors #1824
Outsource saving of bounds check errors #1824
Conversation
Review checklistThis 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
Code quality
Documentation
Testing
Performance
Verification
Created with ❤️ by the Trixi.jl community. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1824 +/- ##
==========================================
+ Coverage 96.09% 96.15% +0.06%
==========================================
Files 453 453
Lines 36481 36485 +4
==========================================
+ Hits 35055 35081 +26
+ Misses 1426 1404 -22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
examples/tree_2d_dgsem/elixir_eulermulti_shock_bubble_shockcapturing_subcell_positivity.jl
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final changes I think - almost gtg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once tests pass
To complete testing this "Save deviations"-part, I added another test in 8111037. |
During subcell IDP limiting, the given subcell bounds can be checked. This happens in the stage callback
BoundsCheckCallback
. It contains, on the one hand the calculation of the maximum deviation for each variable, and on the other hand, a possible saving of these errors to a txt file.This PR outsources the saving of the bounds check errors into its own function.
First, this is a much cleaner way to of structuring the bounds check routine.
But mainly, I noticed some very weird behaviors of this bounds check regarding allocations a couple of times in the last months. In some cases, there are many allocs.
And a finally found the reason for that in the error saving lines of code. Sometimes this phenomenon didn't really make sense since
save_errors
was set tofalse
, but probably there were problems with this sort of IO inside the same routine. Nevertheless, with this variant here, that is solved.Additionally, this PR increases the coverage by activating saving the bounds check errors for a local limiting and adapts the first time step the deviations should be saved (in 3b513ed).