-
Notifications
You must be signed in to change notification settings - Fork 17
[Ramses][AMR][RefinementHandler] Enforce 2:1 rule #1391
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @Akos299, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a critical enhancement to the Adaptive Mesh Refinement (AMR) system by implementing and enforcing the 2:1 refinement rule. This rule is vital for maintaining the structural integrity and computational efficiency of adaptive grids by preventing large jumps in resolution between neighboring blocks. The changes involve adding new data structures to track block refinement levels and a parallel kernel to apply the rule, alongside significant documentation updates to improve code clarity. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces a new block_levels field to SolverStorage and implements a SYCL kernel in AMRGridRefinementHandler to enforce the 2:1 refinement restriction using block neighbor graphs and block levels. It also adds extensive Doxygen comments to clarify the purpose of graph building nodes (FindBlockNeigh, BlockNeighToCellNeigh) and AMR-related functions. Review comments address a critical race condition in the new SYCL kernel, recommending the use of sycl::atomic_ref for atomic updates, and suggest removing commented-out code, clarifying ambiguous comments, correcting typos in documentation, and refactoring repetitive code blocks for better maintainability.
src/shammodels/common/include/shammodels/common/amr/NeighGraph.hpp
Outdated
Show resolved
Hide resolved
For each patch get its size Compute for each patch the amr level of its blocks
Add linear interpolation for new childs fields. For each cell to be refined get slopes of its conservative fields. Then perform linear interpolation to fill its news eight children. At the end performed renormalisation to enforce conservation. TODO: extend this such that it takes into high order interpolations
- Add new node to compute AMR level in solvergraph - Add new module + new node to compute level0 size for each patch - fix previous bug for unexisting ptr. - TODO1 slope limiter gives 0 find what is wrong and fix it - TODO2 Add another refinement criterion + tests
Workflow reportworkflow report corresponding to commit 939a6a7 Pre-commit check reportPre-commit check: ✅ Test pipeline can run. |
In the previous commit, slopes limiter using ConsState variables gave rise to NaN. By switching to field by field approach, we get no more NaN. This will be investigate further since the first approach is more optimal than the first one. We also change the interpolation method. And check that conservative enforcement is respected.
@tdavidcl @bcommerc , I added the linear interpolation to fill children cells.
Doing this, I reused the cells graph. compute slope limiter for conservatives variables,
interpolate parent cell fields and renormalize to ensure conservation.
I would like to have your feedback about this.