Skip to content

deccalum/gr_sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gr_sim

A C++23 general relativity simulator built as a focused study of numerical relativity and CPU performance engineering. The design is metric-first: a MetricProvider interface owns the geometry, bodies integrate geodesics without knowing the metric underneath, and a hardware benchmarking layer (gr_bench) profiles the machine to assign per-body compute budgets at runtime.

What's built

Schwarzschild geodesics — isotropic Cartesian coordinates; metric, Christoffel symbols, and inverse metric computed analytically.
Validated against MTW §25.5: energy $E$, angular momentum $L$, and norm $g_{\mu\nu}u^\mu u^\nu = -1$ all hold to $< 2 \times 10^{-14}$ over 10,000 RK4 steps at the ISCO.
Details

Observer system — static and co-moving observers accumulate proper time; gravitational time dilation from the Schwarzschild lapse factor $A(\rho)$ verified against the analytic ratio

Hardware benchmarking gr_bench — probes sustained FLOP/s and memory bandwidth via PAPI or proxy counters; writes a HardwareProfile used by the roofline allocator to cap geodesic iterations per body per step

Test suite — three tests against MTW: geodesic RHS at the ISCO, two-clock gravitational time dilation, coarse vs. fine step-size accuracy contrast

Roadmap

Roofline allocator — real contention model distributing compute budget across bodies from hardware ridge point and local curvature demand

Kerr metric — next MetricProvider; validates metric-swapping at runtime; enables frame dragging, ergosphere, and spin-shifted ISCO ($a \approx 0.9M$ for Sgr A*)

Force injection — extend the RK4 stepper to accept $f^\mu$ from secondary engines (rocket thrust, atmospheric drag, radiation pressure); currently the property bag is decoupled from integration

Null geodesics — photon paths as first-class simulation objects; photon sphere dynamics, shadow edges, light travel time

Vulkan renderer — camera-as-observer promoted from the observer system; null geodesic ray tracer; Flamm paraboloid embedding diagram

References

About

A C++23 general relativity simulator built as a focused study of numerical relativity and CPU performance engineering.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors