# gravityCU — Multi-GPU VRAM-Resident CUDA TreePM & FoF Cosmological N-Body Engine > Open-source CUDA/C++ cosmological gravity, SPH hydrodynamics, merger-tree, and ZIP64 lightcone solver by Haina Huang (CUHK Astrophysics) engineered to evolve up to 1024^3 particles resident in GPU VRAM without host-to-device round-trips, cross-validated against SWIFT and Gadget-4. ## Canonical URLs - Showcase (中文): https://hainahuang729.github.io/gravityCU/ - Showcase (English): https://hainahuang729.github.io/gravityCU/en.html - Reference & Examples: https://hainahuang729.github.io/gravityCU/reference.html - GitHub Repository: https://github.com/HainaHuang729/gravityCU - Citation Metadata: https://github.com/HainaHuang729/gravityCU/blob/main/CITATION.cff - Development Roadmap (Precision & Physics Breadth): https://github.com/HainaHuang729/gravityCU/blob/main/ROADMAP.md - Author Portal: https://formless-observatory.wuxiangguan.workers.dev/projects ## Technical Summary - Architecture: cuFFT 3D Particle-Mesh (PM) long-range force + warp-cooperative GPU Octree / Barnes-Hut short-range Tree force + GPU Friends-of-Friends / Spherical Overdensity halo finder (`compute_fof_catalog`, `compute_fof_so`) + coupled SPH hydrodynamics with CHIMES/PS20 cooling, thermal SN feedback & dual-mode SMBH/AGN + on-the-fly merger trees (`GMT1`) + streaming >4 GiB ZIP64 HEALPix/pencil-beam DMO & hydro lightcones (`grav_lightcone.cuh`). - Cross-Code Validation: Verified at 256^3 and 1024^3 particle scales against 256-core CPU SWIFT (`7.26x–9.64x` speedup at 1024^3, `0.00453%` max $P_\delta(k)$ deviation at $z=0$, `~86%` node energy reduction) and Gadget-4; hydro lightcones match analytic adiabatic Compton-$y$ to `0.076%` and `ObsCU` Born lensing convergence parity (`3.54e-5`). ## Versioned documentation and examples - [Documentation home](https://github.com/HainaHuang729/gravityCU/blob/main/docs/Documentation.md): CUDA TreePM gravity, hydrodynamics and lightcones - [Function Wiki](https://github.com/HainaHuang729/gravityCU/blob/main/docs/reference/README.md): signatures, source links and example call sites - [Basic feature examples](https://github.com/HainaHuang729/gravityCU/blob/main/docs/examples/README.md): starting inputs, commands and expected results - [Project site](https://hainahuang729.github.io/gravityCU/) - [Technical roadmap](https://github.com/HainaHuang729/gravityCU/blob/main/ROADMAP.md) - [Usage and analysis](https://github.com/HainaHuang729/gravityCU/blob/main/docs/README.md) - [Validation report](https://github.com/HainaHuang729/gravityCU/blob/main/reports/MULTI-GPU-AND-VALIDATION-REPORT.md) - [Citation](https://github.com/HainaHuang729/gravityCU/blob/main/CITATION.cff) ## Cosmology Unified (CU) Ecosystem - [CU-Suite](https://github.com/HainaHuang729/CU-Suite): Top-level orchestrator, configuration contract, provenance & calibration hub - [CosmoCU](https://github.com/HainaHuang729/CosmoCU): C++20 Einstein–Boltzmann solver, `HMcode`/`BCM`/`EFTofLSS` & `Dual<5>`/`Dual<10>` AD - [ICU](https://github.com/HainaHuang729/ICU): GPU/CPU/MPI 1LPT/2LPT/3LPT initial conditions generator (`phase4` dealiasing, Philox RNG) - [gravityCU](https://github.com/HainaHuang729/gravityCU): Multi-GPU VRAM-resident CUDA TreePM, SPH hydrodynamics, lightcones & FoF (`https://hainahuang729.github.io/gravityCU/`) - [21cmCU](https://github.com/HainaHuang729/21cmCU): Native C/CUDA + cuFFT 21cm reionization & Bayesian inference engine - [ObsCU](https://github.com/HainaHuang729/ObsCU): Survey forward modeling (weak lensing, HOD/SHAM galaxies, Lyα, tSZ/kSZ), SBI & baryon calibration