Relativity-Simulator

Deterministic simulation and ray-tracing engine for General Relativity, Post-Newtonian dynamics, relativistic hydrodynamics, and polarized radiative transfer in curved spacetimes.


Documentation Map

Primary references:


Key Features


Visual Overview

The visual renders and trajectory sequences below were recorded and generated using the integrated Capture Studio workspace widget.

Curved Spacetime Null Geodesic Ray-Tracing (Schwarzschild Metric, M = 60.00)

Schwarzschild Metric Flyby Trajectory (M = 60.00) Schwarzschild Metric Infall Trajectory (M = 60.00)


Building and Installation

Prerequisites

Standard Build (Release with LTO)

cmake -B build -DCMAKE_BUILD_TYPE=Release -DENABLE_LTO=ON
cmake --build build --config Release -j $(nproc)

Profile-Guided Optimization (PGO) Build

Instrumented build

cmake -B build-pgo -DCMAKE_BUILD_TYPE=Release -DENABLE_PGO_GENERATE=ON
cmake --build build-pgo --config Release -j $(nproc)
./build-pgo/headless_exporter --validate-benchmarks

Optimized build using profile data

cmake -B build-opt -DCMAKE_BUILD_TYPE=Release -DENABLE_PGO_USE=ON
cmake --build build-opt --config Release -j $(nproc)

Running Test Suite

ctest --test-dir build --output-on-failure

Generating Installation Packages (CPack)

cd build
cpack -G TGZ
cpack -G DEB  # Linux Debian/Ubuntu
cpack -G RPM  # Linux Fedora/RHEL
cpack -G NSIS # Windows Installer

Quickstart

Interactive REPL Mode

./build/engine_cli

Available interactive commands (warp, step, set mass, status, etc.) are documented in the Interactive Terminal Commands (REPL) and navigation keybindings in Navigation & Viewport Keybindings.

Headless Batch Execution

./build/headless_exporter --validate-benchmarks
./build/headless_exporter --scenario scenarios/kerr_accretion_disk.yaml --output-dir ./output --width 3840 --height 2160

Command-line options are documented in Headless Batch Exporter, declarative scenario definitions in Declarative Scenario Definition, and validation targets in Verification Criteria & Benchmark Protocols.


Third-Party Assets and Image Licenses

Sky and panorama assets:

Earth and planetary assets:


License

This project is licensed under the MIT License. See LICENSE for details.