-
Notifications
You must be signed in to change notification settings - Fork 21
[SPH] Hard wall boundary condition #1558
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
|
Thanks @y-lapeyre for opening this PR! You can do multiple things directly here: Once the workflow completes a message will appear displaying informations related to the run. Also the PR gets automatically reviewed by gemini, you can: |
Summary of ChangesHello @y-lapeyre, 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 lays the groundwork for implementing hard wall boundary conditions by introducing a flexible configuration mechanism for defining particle disabling regions. It integrates a particle selection process into the main solver loop, allowing for dynamic identification of particles based on these defined regions. However, there is a notable inconsistency where the module intended to identify particles 'in wall' actually selects particles 'outside' a spherical boundary, and the solver's current implementation explicitly uses an 'outside sphere' module, which might require clarification or adjustment depending on the exact definition of a 'hard wall boundary condition' in this context. 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 mechanism for a 'hard wall boundary condition' by disabling particles. While the goal is clear, the implementation has several significant issues with naming consistency, code duplication, and potentially incorrect logic. A new ParticleDisableConfig is added, but its Wall struct actually defines a sphere. A new module, GetParticlesInWall, is introduced but it's a functional duplicate of GetParticlesOutsideSphere, is misnamed, and contains logic that selects particles outside the region. Furthermore, the solver logic incorrectly uses the old GetParticlesOutsideSphere module instead of the new one. I've left several comments to address these critical design and correctness issues to improve the clarity and maintainability of the code.
src/shammodels/sph/include/shammodels/sph/modules/GetParticlesInWall.hpp
Show resolved
Hide resolved
tdavidcl
left a comment
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.
i kind of like the beginning of it.
I would recommend setting sph force to 0 after update dervis so that you don't need to pass extra things to it.
Also could you rename ParticleDisablingConfig to something like GhostParticleConfig for consistency with Phantom ?
|
/gemini review |
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 hard wall boundary condition by disabling particles within specified wall regions. The implementation has several critical issues that need to be addressed. There's a logic error in the Python bindings for adding a wall, an inverted condition for checking if walls exist, and incomplete JSON serialization for wall configurations. Additionally, there's an out-of-bounds access in get_edges and some leftover debug logs. All comments provided are valid and do not contradict any of the established rules. I've provided detailed comments and suggestions to fix these issues.
|
|
||
| update_derivs(); | ||
|
|
||
| bool has_walls = solver_config.particle_disable.disable_list.empty(); |
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.
The logic for has_walls is inverted. disable_list.empty() returns true if the list is empty, meaning has_walls will be true when there are no walls. The particle disabling logic inside the if (has_walls) block will only execute when no walls are configured. You should negate the result of empty().
| bool has_walls = solver_config.particle_disable.disable_list.empty(); | |
| bool has_walls = !solver_config.particle_disable.disable_list.empty(); |
src/shammodels/sph/include/shammodels/sph/modules/GetParticlesInWall.hpp
Outdated
Show resolved
Hide resolved
Workflow reportworkflow report corresponding to commit 3388cdb Light CI is enabled. This will only run the basic tests and not the full tests. Pre-commit check reportPre-commit check: ✅ Test pipeline can run. Doxygen diff with
|
No description provided.