-
Notifications
You must be signed in to change notification settings - Fork 18
[GSPH] Add core GSPH infrastructure #1450
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
[GSPH] Add core GSPH infrastructure #1450
Conversation
Summary of ChangesHello @Guo-astro, 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 initiates the development of the Godunov Smoothed Particle Hydrodynamics (GSPH) solver by establishing its foundational configuration and data storage structures. It introduces key components for defining solver parameters, selecting Riemann and reconstruction schemes, and managing simulation-critical data, setting the stage for subsequent phases that will implement the solver's runtime physics and algorithms. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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 the foundational infrastructure for the Godunov SPH (GSPH) solver, including configurations for the solver, Riemann solvers, reconstruction methods, and runtime data storage. The code is well-structured and clearly documented. My feedback primarily focuses on improving C++ const-correctness and idiomatic usage, along with addressing a potential build issue in the CMake configuration. I've suggested marking several methods in SolverConfig.hpp as const because they don't alter the object's state. Additionally, I've recommended changing SolverStorage from a class to a struct since all its members are public. Lastly, I've highlighted a restrictive version requirement in CMakeLists.txt that could affect compatibility with newer CMake versions.
src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp
Outdated
Show resolved
Hide resolved
|
yeah you need to change the mailmap to change the email on the files. Are you okay with this for the mailmap it should display I already launched a PR for it #1455, can you confirm that the informations are correct ? |
|
@Guo-astro if you update this PR the mailman should be fixed |
|
i forgot to note that earlier you can also comment pre-commit.ci run to trigger the precommit run |
|
it just need to appear on a line by itself. I think that pre-commit.ci autofix should also work |
Phase 1 of GSPH implementation - configuration and storage structures: - SolverConfig: Main solver configuration with SPH kernel template, EOS selection, and field layout definitions - RiemannConfig: Riemann solver configuration supporting Iterative (van Leer 1997), Exact (Toro), HLLC, and Roe solvers - ReconstructConfig: Spatial reconstruction configuration for PiecewiseConstant and MUSCL schemes with slope limiters - SolverStorage: Runtime storage for neighbor caches, ghost data, tree structures, and computed fields References: - Inutsuka, S. (2002) "Reformulation of SPH with Riemann Solver" - van Leer (1997), Toro (2009) for Riemann solver methods
- Fix CMakeLists.txt version range (remove upper bound) - Add const qualifiers to getter methods in SolverConfig - Change SolverStorage from class to struct (all members public) - Update author headers with --no git blame-- annotation
This reverts commit 7c2b447.
- Add shammodels_gsph to as_subproject list - Add add_subdirectory(shammodels/gsph) for build inclusion
Wall boundary configuration is removed for now as it needs further development. Changes: - Remove wall_flags, wall_num_layers from SolverConfig - Remove set_boundary_wall() method - Clean up boundary type enum
The SolverConfig.hpp includes headers from shamtree and shammodels_sph, but the CMakeLists.txt was missing these library dependencies, causing CI build failures.
74af55a to
137d7e6
Compare
These methods reference set_exact() and set_roe() in RiemannConfig which are not available in the core infrastructure branch. They will be added in the gsph-riemann-solvers branch which extends RiemannConfig with Exact and Roe solver types.
|
btw, if you want another review or anything don't hesitate to ping me. |
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.
LGTM ! (just waiting for the CI though)
Workflow reportworkflow report corresponding to commit bbd1f1b Pre-commit check reportPre-commit check: ✅ Test pipeline can run. Clang-tidy diff reportNo relevant changes found. You should now go back to your normal life and enjoy a hopefully sunny day while waiting for the review. Doxygen diff with
|
y-lapeyre
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.
Looks good!
## Summary This PR adds the mathematical core of GSPH - the Riemann solver and force computation routines. **Depends on:** #1450 (Core GSPH infrastructure) ### Files added **math/riemann/iterative.hpp:** - Van Leer (1997) iterative Riemann solver using Newton-Raphson iteration - HLLC approximate Riemann solver for faster computation - Returns interface pressure (p*) and velocity (v*) at particle pairs **math/forces.hpp:** - GSPH force computation following Cha & Whitworth (2003) - Acceleration: uses p* instead of artificial viscosity - Energy rate: ensures proper energy conservation in shocks - Velocity projection utilities for 1D Riemann problem All implementations are header-only for GPU kernel inlining via SYCL. ## References - van Leer (1997) "Towards the ultimate conservative difference scheme" - Toro (2009) "Riemann Solvers and Numerical Methods for Fluid Dynamics" - Cha & Whitworth (2003) "Implementations and tests of Godunov-type particle hydrodynamics" ## Test plan - [ ] Header-only code compiles without errors - [ ] Riemann solver produces correct p*, v* for known test cases (Sod shock tube initial conditions) --------- Co-authored-by: Yona LAPEYRE <yona.lapeyre@ens-lyon.fr> Co-authored-by: David--Cléris Timothée <timothee.davidcleris@proton.me>
## Summary Phase 1 of GSPH (Godunov SPH) implementation - core configuration and storage structures. **Files added:** - `SolverConfig.hpp/cpp` - Main solver configuration with SPH kernel template, EOS selection, and field layout definitions - `config/RiemannConfig.hpp` - Riemann solver configuration supporting Iterative (van Leer 1997), Exact (Toro), HLLC, and Roe solvers - `config/ReconstructConfig.hpp` - Spatial reconstruction configuration for PiecewiseConstant and MUSCL schemes - `modules/SolverStorage.hpp` - Runtime storage for neighbor caches, ghost data, tree structures, and computed fields This PR provides the foundational types for the GSPH solver without adding runtime code. Subsequent PRs will add: - Riemann solver implementations - Physics modules (density, forces, integration) - Boundary conditions and I/O - Python bindings ## References - Inutsuka, S. (2002) "Reformulation of Smoothed Particle Hydrodynamics with Riemann Solver" - van Leer (1997) for iterative Riemann solver - Toro (2009) "Riemann Solvers and Numerical Methods for Fluid Dynamics" ## Test plan - [ ] Builds successfully with existing codebase - [ ] No conflicts with existing SPH module - [ ] Configuration structures can be instantiated --------- Co-authored-by: Yona LAPEYRE <yona.lapeyre@ens-lyon.fr> Co-authored-by: David--Cléris Timothée <timothee.davidcleris@proton.me>
## Summary This PR adds the mathematical core of GSPH - the Riemann solver and force computation routines. **Depends on:** Shamrock-code#1450 (Core GSPH infrastructure) ### Files added **math/riemann/iterative.hpp:** - Van Leer (1997) iterative Riemann solver using Newton-Raphson iteration - HLLC approximate Riemann solver for faster computation - Returns interface pressure (p*) and velocity (v*) at particle pairs **math/forces.hpp:** - GSPH force computation following Cha & Whitworth (2003) - Acceleration: uses p* instead of artificial viscosity - Energy rate: ensures proper energy conservation in shocks - Velocity projection utilities for 1D Riemann problem All implementations are header-only for GPU kernel inlining via SYCL. ## References - van Leer (1997) "Towards the ultimate conservative difference scheme" - Toro (2009) "Riemann Solvers and Numerical Methods for Fluid Dynamics" - Cha & Whitworth (2003) "Implementations and tests of Godunov-type particle hydrodynamics" ## Test plan - [ ] Header-only code compiles without errors - [ ] Riemann solver produces correct p*, v* for known test cases (Sod shock tube initial conditions) --------- Co-authored-by: Yona LAPEYRE <yona.lapeyre@ens-lyon.fr> Co-authored-by: David--Cléris Timothée <timothee.davidcleris@proton.me>
Summary
Phase 1 of GSPH (Godunov SPH) implementation - core configuration and storage structures.
Files added:
SolverConfig.hpp/cpp- Main solver configuration with SPH kernel template, EOS selection, and field layout definitionsconfig/RiemannConfig.hpp- Riemann solver configuration supporting Iterative (van Leer 1997), Exact (Toro), HLLC, and Roe solversconfig/ReconstructConfig.hpp- Spatial reconstruction configuration for PiecewiseConstant and MUSCL schemesmodules/SolverStorage.hpp- Runtime storage for neighbor caches, ghost data, tree structures, and computed fieldsThis PR provides the foundational types for the GSPH solver without adding runtime code. Subsequent PRs will add:
References
Test plan