Skip to content

Conversation

@Guo-astro
Copy link
Contributor

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

@gemini-code-assist
Copy link

Summary of Changes

Hello @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

  • Core GSPH Configuration: Introduction of SolverConfig.hpp/cpp to manage the overall GSPH solver settings, including SPH kernel, Equation of State (EOS), and field layouts.
  • Riemann Solver Configuration: Added RiemannConfig.hpp to define various Riemann solver types (Iterative, HLLC, Exact, Roe) for inter-particle flux calculations.
  • Spatial Reconstruction Schemes: Implemented ReconstructConfig.hpp to support PiecewiseConstant (1st order) and MUSCL (2nd order with multiple limiters) for variable extrapolation.
  • Runtime Data Storage: Created SolverStorage.hpp to centralize runtime data such as neighbor caches, ghost particle data, tree structures, and computed fields.
  • Module Integration: Established a new CMakeLists.txt to integrate the GSPH module into the build system.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

@tdavidcl
Copy link
Member

tdavidcl commented Dec 19, 2025

yeah you need to change the mailmap to change the email on the files. Are you okay with this for the mailmap

Guo Yansong <guo.yansong.ngy@gmail.com> <guo.yansong@optimind.tech>
Guo Yansong <guo.yansong.ngy@gmail.com> <guo.yansong.ngy@gmail.com>

it should display @author Guo Yansong (guo.yansong.ngy@gmail.com) in the end on the files

I already launched a PR for it #1455, can you confirm that the informations are correct ?

@tdavidcl
Copy link
Member

@Guo-astro if you update this PR the mailman should be fixed

@tdavidcl
Copy link
Member

i forgot to note that earlier you can also comment

pre-commit.ci run

to trigger the precommit run

@tdavidcl
Copy link
Member

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
- 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
Change '@author Guo' to '@author Guo Yansong' to match
the expected author format in the codebase.
The SolverConfig.hpp includes headers from shamtree and shammodels_sph,
but the CMakeLists.txt was missing these library dependencies, causing
CI build failures.
@Guo-astro Guo-astro force-pushed the gsph-core-infrastructure branch from 74af55a to 137d7e6 Compare December 20, 2025 21:55
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.
@tdavidcl
Copy link
Member

btw, if you want another review or anything don't hesitate to ping me.
You can also come on discord if you want :)

Copy link
Member

@tdavidcl tdavidcl left a 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)

@github-actions
Copy link

Workflow report

workflow report corresponding to commit bbd1f1b
Commiter email is timothee.davidcleris@proton.me
GitHub page artifact URL GitHub page artifact link (can expire)

Pre-commit check report

Pre-commit check: ✅

trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check for merge conflicts................................................Passed
check that executables have shebangs.....................................Passed
check that scripts with shebangs are executable..........................Passed
check for added large files..............................................Passed
check for case conflicts.................................................Passed
check for broken symlinks................................................Passed
check yaml...............................................................Passed
detect private key.......................................................Passed
No-tabs checker..........................................................Passed
Tabs remover.............................................................Passed
Validate GitHub Workflows................................................Passed
clang-format.............................................................Passed
black....................................................................Passed
ruff check...............................................................Passed
Check doxygen headers....................................................Passed
Check license headers....................................................Passed
Check #pragma once.......................................................Passed
Check SYCL #include......................................................Passed
No ssh in git submodules remote..........................................Passed

Test pipeline can run.

Clang-tidy diff report

No relevant changes found.
Well done!

You should now go back to your normal life and enjoy a hopefully sunny day while waiting for the review.

Doxygen diff with main

Removed warnings : 2
New warnings : 99
Warnings count : 7448 → 7545 (1.3%)

Detailed changes :
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:101: warning: Member Rkern (variable) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:112: warning: Member unit_sys (variable) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:114: warning: Member set_units(shamunits::UnitSystem< Tscal > new_sys) (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:116: warning: Member get_constant_G() const (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:134: warning: Member SolverStatusVar (typedef) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:135: warning: Member time_state (variable) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:137: warning: Member set_time(Tscal t) (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:138: warning: Member set_next_dt(Tscal dt) (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:139: warning: Member get_time() const (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:140: warning: Member get_dt() const (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:150: warning: Member RiemannConfig (typedef) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:151: warning: Member riemann_config (variable) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:153: warning: Member set_riemann_iterative(Tscal tol=Tscal{1e-6}, u32 max_iter=20) (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:157: warning: Member set_riemann_hllc() (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:167: warning: Member ReconstructConfig (typedef) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:168: warning: Member reconstruct_config (variable) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:170: warning: Member set_reconstruct_piecewise_constant() (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:174: warning: Member set_reconstruct_muscl(typename ReconstructConfig::Limiter limiter=ReconstructConfig::Limiter::VanLeer) (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:179: warning: Member requires_gradients() const (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:189: warning: Member EOSConfig (typedef) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:190: warning: Member eos_config (variable) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:192: warning: Member is_eos_adiabatic() const (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:197: warning: Member is_eos_isothermal() const (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:202: warning: Member set_eos_adiabatic(Tscal _gamma) (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:207: warning: Member set_eos_isothermal(Tscal cs) (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:217: warning: Member BCConfig (typedef) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:218: warning: Member boundary_config (variable) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:220: warning: Member set_boundary_free() (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:221: warning: Member set_boundary_periodic() (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:231: warning: Member ExtForceConfig (typedef) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:232: warning: Member ext_force_config (variable) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:234: warning: Member add_ext_force_point_mass(Tscal central_mass, Tscal Racc) (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:246: warning: Member tree_reduction_level (variable) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:247: warning: Member use_two_stage_search (variable) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:249: warning: Member set_tree_reduction_level(u32 level) (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:250: warning: Member set_two_stage_search(bool enable) (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:270: warning: Member has_field_uint() const (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:272: warning: Member print_status() (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:285: warning: Member check_config() const (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:292: warning: Member check_config_runtime() const (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:301: warning: Member set_layout(shamrock::patch::PatchDataLayerLayout &pdl) (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:302: warning: Member set_ghost_layout(shamrock::patch::PatchDataLayerLayout &ghost_layout) (function) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:308: warning: Member to_json(nlohmann::json &j, const CFLConfig< Tscal > &p) (function) of namespace shammodels::gsph is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:316: warning: Member from_json(const nlohmann::json &j, CFLConfig< Tscal > &p) (function) of namespace shammodels::gsph is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:322: warning: Member to_json(nlohmann::json &j, const SolverStatusVar< Tvec > &p) (function) of namespace shammodels::gsph is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:330: warning: Member from_json(const nlohmann::json &j, SolverStatusVar< Tvec > &p) (function) of namespace shammodels::gsph is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:337: warning: Member to_json(nlohmann::json &j, const SolverConfig< Tvec, SPHKernel > &p) (function) of namespace shammodels::gsph is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:371: warning: Member from_json(const nlohmann::json &j, SolverConfig< Tvec, SPHKernel > &p) (function) of namespace shammodels::gsph is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:85: warning: Member Tscal (typedef) of struct shammodels::gsph::SolverStatusVar is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:94: warning: Member Tscal (typedef) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:95: warning: Member dim (variable) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:96: warning: Member Kernel (typedef) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:97: warning: Member u_morton (typedef) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/SolverConfig.hpp:99: warning: Member RTree (typedef) of struct shammodels::gsph::SolverConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/ReconstructConfig.hpp:122: warning: Member to_json(nlohmann::json &j, const ReconstructConfig< Tvec > &p) (function) of namespace shammodels::gsph is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/ReconstructConfig.hpp:150: warning: Member from_json(const nlohmann::json &j, ReconstructConfig< Tvec > &p) (function) of namespace shammodels::gsph is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/ReconstructConfig.hpp:48: warning: Member Tscal (typedef) of struct shammodels::gsph::ReconstructConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/ReconstructConfig.hpp:49: warning: Member dim (variable) of struct shammodels::gsph::ReconstructConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/ReconstructConfig.hpp:80: warning: Member Variant (typedef) of struct shammodels::gsph::ReconstructConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/ReconstructConfig.hpp:82: warning: Member config (variable) of struct shammodels::gsph::ReconstructConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/ReconstructConfig.hpp:84: warning: Member set(Variant v) (function) of struct shammodels::gsph::ReconstructConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/ReconstructConfig.hpp:86: warning: Member set_piecewise_constant() (function) of struct shammodels::gsph::ReconstructConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/ReconstructConfig.hpp:88: warning: Member set_muscl(Limiter limiter=Limiter::VanLeer) (function) of struct shammodels::gsph::ReconstructConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/ReconstructConfig.hpp:90: warning: Member is_piecewise_constant() const (function) of struct shammodels::gsph::ReconstructConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/ReconstructConfig.hpp:94: warning: Member is_muscl() const (function) of struct shammodels::gsph::ReconstructConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/ReconstructConfig.hpp:96: warning: Member requires_gradients() const (function) of struct shammodels::gsph::ReconstructConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/ReconstructConfig.hpp:98: warning: Member print_status() const (function) of struct shammodels::gsph::ReconstructConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/RiemannConfig.hpp:111: warning: Member to_json(nlohmann::json &j, const RiemannConfig< Tvec > &p) (function) of namespace shammodels::gsph is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/RiemannConfig.hpp:132: warning: Member from_json(const nlohmann::json &j, RiemannConfig< Tvec > &p) (function) of namespace shammodels::gsph is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/RiemannConfig.hpp:52: warning: Member Tscal (typedef) of struct shammodels::gsph::RiemannConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/RiemannConfig.hpp:53: warning: Member dim (variable) of struct shammodels::gsph::RiemannConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/RiemannConfig.hpp:76: warning: Member Variant (typedef) of struct shammodels::gsph::RiemannConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/RiemannConfig.hpp:78: warning: Member config (variable) of struct shammodels::gsph::RiemannConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/RiemannConfig.hpp:80: warning: Member set(Variant v) (function) of struct shammodels::gsph::RiemannConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/RiemannConfig.hpp:82: warning: Member set_iterative(Tscal tol=Tscal{1.0e-6}, u32 max_iter=20) (function) of struct shammodels::gsph::RiemannConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/RiemannConfig.hpp:86: warning: Member set_hllc() (function) of struct shammodels::gsph::RiemannConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/RiemannConfig.hpp:88: warning: Member is_iterative() const (function) of struct shammodels::gsph::RiemannConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/RiemannConfig.hpp:89: warning: Member is_hllc() const (function) of struct shammodels::gsph::RiemannConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/config/RiemannConfig.hpp:91: warning: Member print_status() const (function) of struct shammodels::gsph::RiemannConfig is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp:107: warning: Member merged_patchdata_ghost (variable) of struct shammodels::gsph::SolverStorage is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp:114: warning: Member soundspeed (variable) of struct shammodels::gsph::SolverStorage is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp:123: warning: Member old_duint (variable) of struct shammodels::gsph::SolverStorage is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp:127: warning: Member interface (variable) of struct shammodels::gsph::SolverStorage::Timings is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp:128: warning: Member neighbors (variable) of struct shammodels::gsph::SolverStorage::Timings is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp:129: warning: Member io (variable) of struct shammodels::gsph::SolverStorage::Timings is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp:132: warning: Member reset() (function) of struct shammodels::gsph::SolverStorage::Timings is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp:133: warning: Member timings_details (variable) of struct shammodels::gsph::SolverStorage is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp:47: warning: Member Component (typedef) of namespace shammodels::gsph is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp:63: warning: Member Tscal (typedef) of struct shammodels::gsph::SolverStorage is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp:64: warning: Member dim (variable) of struct shammodels::gsph::SolverStorage is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp:67: warning: Member GhostHandle (typedef) of struct shammodels::gsph::SolverStorage is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp:68: warning: Member GhostHandleCache (typedef) of struct shammodels::gsph::SolverStorage is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp:70: warning: Member RTree (typedef) of struct shammodels::gsph::SolverStorage is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp:74: warning: Member part_counts_with_ghost (variable) of struct shammodels::gsph::SolverStorage is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp:78: warning: Member hpart_with_ghosts (variable) of struct shammodels::gsph::SolverStorage is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp:91: warning: Member ghost_patch_cache (variable) of struct shammodels::gsph::SolverStorage is not documented.
+ src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp:99: warning: Member rtree_rint_field (variable) of struct shammodels::gsph::SolverStorage is not documented.

Copy link
Collaborator

@y-lapeyre y-lapeyre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@tdavidcl tdavidcl merged commit 9c86b2e into Shamrock-code:main Dec 22, 2025
61 checks passed
tdavidcl added a commit that referenced this pull request Dec 24, 2025
## 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>
DavidFang03 pushed a commit to DavidFang03/Shamrock that referenced this pull request Jan 6, 2026
## 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>
DavidFang03 pushed a commit to DavidFang03/Shamrock that referenced this pull request Jan 6, 2026
## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants