-
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
Fix calcuation of n_elements
in resizing limiter-specific containers
#1655
Fix calcuation of n_elements
in resizing limiter-specific containers
#1655
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:
Additional details and impacted files@@ Coverage Diff @@
## main #1655 +/- ##
==========================================
+ Coverage 95.46% 96.11% +0.65%
==========================================
Files 418 418
Lines 34247 34248 +1
==========================================
+ Hits 32692 32915 +223
+ Misses 1555 1333 -222
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
🎉
I don't understand this, especially the "respecting the bounds is not guaranteed" part. If this may or may not produce correct results for refined meshes, I think it is too dangerous to activate. In that case it might produce unexpected errors or exhibit otherwise undefined behavior, which is extremely annoying to debug - then, I'd rather not enable it at all. If it only means that subcell limiting is not as effective at refinement boundaries as in uniform boundaries but otherwise work correctly (including no out of bounds memory access), I'd leave it up to you to decide whether it is "good enough" to use. However, I still think a proper mortar support would be better - is that possible? |
So this means that the IDP on non-conforming meshes might violate something like positivity of density, correct? IIRC, this is also the case if one does not respect the (quite restrictive) time step criterion of the IDP schemes. Am I interpreting this correctly IDP crew @bennibolm @amrueda @gregorgassner ? Is there any existing literature of IDP + non-conforming meshes? I did a cursory check on Nazarov's webpage and some quick searches but did not see anything. |
To some of your questions:
Yes. Unfortunately, the methods that we have developed and @bennibolm has implemented are not fully functional on non-conforming meshes. The main reason for this is that the implementation assumes that the low- and high-order schemes have the same surface terms. This is perfectly fine for conforming meshes, but not for non-conforming meshes. The low-order scheme with a high-order mortar is not invariant domain preserving. As @bennibolm points out, the subcell IDP positivity limiter still works in many situations, where the low-order scheme + DG mortar produces "positive" solutions although the method is not really provably positivity preserving. Similar to when a time-step size higher than the IDP time-step size is used. Other subcell limiters (e.g., the one that enforces local minimum and maximum principles) are less functional, as we currently do not have a strategy to define the bounds for nodes that sit at a non-confoming interface.
That would be great, but it is unfortunately not trivial. It would be nice to explore that in the future though! In my opinion, the possibility to use subcell positivity limiting in non-conforming meshes is a nice feature to have, even though the method can still fail and the simulation crash. So I would add this feature, but I would suggest adding a warning message when the mesh is / can become non-conforming.
I know of some literature in the context of algebraic flux correction for FEM. However, we have not experimented with any of these methods. Here some references:
|
Thanks for the clarifications, @amrueda! If this essentially means that IDP does work from an implementation point of view, I'm fine to merge it as is. I was just concerned about out of bounds memory access. Not being able to prove positivity on refined meshes (at least for now) is absolutely acceptable if it means we can continue to use this stabilization technique for a larger set of problems. It would be good, however, if this were documented in one of the docstrings for the limiter (preferably the most high-level one), such that users are aware of this formal loss of positivity for refined meshes. |
Thanks for the detailed answer and references @amrueda ! |
@bennibolm it would be great if you could put this into one of your next PRs 🙏 |
Yes, sure. I already added a TODO to a PR. |
This fixes an error in the resizing of limiter-specific containers. Before,
length(u_ode)
was used for the new number of elements, althoughlength(u_ode) = n_variables * n_nodes^n_dims * n_elements
.So, now it is possible to use AMR and initially nonconforming meshes for subcell limiting.
Nevertheless, respecting the bounds is not guaranteed for subcell IDP limiting at non-conforming subcell interfaces. Therefore, hanging nodes and mortars are ignored in the limiting process right now. However, often the simulation is still running nearly as good and with less computing effort.