gravityCU documentation

Run your first simulation

Build the CUDA TreePM engine, evolve a 16³ dark-matter test case and inspect its snapshot. Then find examples for halos, merger trees and lightcones.

Get the source

Use a supported NVIDIA GPU, a matching CUDA toolkit, Make, and Python 3 with NumPy. Run the example from the repository root.

Shell
git clone https://github.com/HainaHuang729/gravityCU.git
cd gravityCU
python3 -m venv .venv
. .venv/bin/activate
python -m pip install numpy

Installation and documentation overview

Run the 16³ example

Build the engine, generate 4,096 test particles and evolve them to scale factor a = 0.9.

Shell
make engine
python3 scripts/make_smoke_ic.py build/example-ic.bin --n-side 16
./build/multi_gpu_slab build/example-ic.bin build/example-final.bin 0.9

Check the snapshot

The input fixture is build/example-ic.bin. The final evolved snapshot is build/example-final.bin. Check that the output file exists, then use the snapshot examples to read it.

ls -lh build/example-final.bin

Use a lightcone with ObsCU

The shell stack includes density arrays and redshift edges. Export full-sky HEALPix or pencil-beam geometry, including ZIP64 archives larger than 4 GiB.

Functions and examples