Relativity-Simulator

Relativistic Engine - Technical Architecture Manual

1. Core Engineering & System Design

The Relativistic Engine is written in ISO C++23. It is structured around data-oriented memory layouts, static compile-time polymorphism, deterministic execution guarantees, & parallel computation.

1.1. Design Constraints

1.2. Platform Compatibility, Toolchain & CMake Configuration Matrix

The simulation and raytracing engine compiles and executes across major desktop, workstation, cloud instance, and high-performance computing operating systems.

Host Compiler Standards & Optimization Directives

Runtime Linker & Dynamic Loader Resolution (RPATH)

CMake Target Architecture


2. Core Subsystems & Components

2.1. Static Tensor & SIMD Algebra Layer

2.2. Spacetime Metric Implementations

All metric types satisfy the SpacetimeMetric concept:

Metric Usage in SoftwareComputeEngine

The metric identifiers correspond to Render::MetricId (include/relativistic/render/gpu_types.hpp). The central mass used by the tracers is max(metric_mass, 1e-4) and spin is clamped to $\pm 0.999 M$. Multi-source configurations containing two or more independent black holes (preset_3d == 8) automatically dispatch to trace_multi_source using Cartesian Kerr-Schild metric superposition.

Id MetricId Tracer Function Horizon Boundary Accretion Disk Model Parameters Evaluated
0 FlatMinkowski step_schwarzschild_null_rk4 ($M = 0$) No No None
1 Schwarzschild step_schwarzschild_null_rk4 Yes ($r_h = 2M$) Yes $M$
2 Kerr step_schwarzschild_null_rk4 if $\lvert a \rvert \le 10^{-9}M$, else trace_kerr_schild_photon Yes ($r_h = M + \sqrt{M^2-a^2}$) Yes $M, a$
3 KerrSchild Same selection as Kerr; executes trace_kerr_schild_photon Yes ($r_h = M + \sqrt{M^2-a^2}$) Yes $M, a$
4 ReissnerNordstrom step_schwarzschild_null_rk4 if $\lvert Q \rvert \le 10^{-9}M$, else trace_planar_photon Yes ($r_+ = M + \sqrt{M^2-Q^2}$) Yes $M, Q$
5 KerrNewman trace_exact_photon with KerrNewmanMetric Yes ($r_+ = M + \sqrt{M^2-a^2-Q^2}$) Yes $M, a, Q$
6 SchwarzschildDeSitter trace_planar_photon with SchwarzschildDeSitterMetric Yes (Cosmological and Event Horizons) Yes $M, \Lambda$
7 FLRW trace_extended_photon (Friedmann expansion solver) Boundary ($a < 10^{-3}$) No $H_0, \Omega_m, \Omega_\Lambda$
8 MorrisThorne trace_extended_photon (Wormhole throat solver) No (Throat transit $l \in (-\infty, \infty)$) No $b_0, \Phi_0$
9 Alcubierre trace_extended_photon (Warp metric solver) Boundary (Apparent Horizon) No $v_s, R, \sigma$
10 LemaitreTolmanBondi trace_spherical_photon (trace_spherical_spacetime_dispatch) No Yes $H_0, r_{\text{void}}, w_{\text{void}}, \Omega_{\text{in}}, \Omega_{\text{out}}$
11 QuintessenceCosmology trace_extended_photon (Tabulated expansion history) Boundary No $w_0, w_a, \Omega_m, \Omega_\phi$
12 ChaplyginCosmology trace_extended_photon (Tabulated expansion history) Boundary No $A, \alpha, \Omega_m$
13 EvaporatingBlackHole trace_spherical_photon (VaidyaEvaporatingMetric) Yes ($r_h = 2M(v)$) Yes $M(v), \dot{M}_{\text{Hawking}}$
14 EddingtonFinkelstein trace_spherical_photon (EddingtonFinkelsteinMetric) Yes ($r_h = 2M$) Yes $M$
15 PainleveGullstrand trace_spherical_photon (PainleveGullstrandMetric) Yes ($r_h = 2M$) Yes $M$
16 TeVeS trace_spherical_photon (TeVeSSpacetimeMetric) Yes ($r_h = 2M e^\phi$) Yes $M, a_0, \phi$
* Multi-Source Superposition trace_multi_source (Up to 16 Kerr black holes) Yes (Individual Kerr Horizons) Yes (Per-Source Disks) Superposed Kerr-Schild centroids, spins, disks

Parameters including cosmological_lambda, wormhole_throat, warp_velocity, warp_bubble_radius, warp_wall_sharpness, wormhole_tidal_potential, and teves_critical_acceleration are directly evaluated along geodesics by trace_extended_photon and trace_spherical_spacetime_dispatch. BssnGrid is not referenced by the render path; the BSSN selection resolves to Schwarzschild (see CLI_REFERENCE.md). Ray-tracing equations are given in MATHEMATICAL_FORMULATION.md.

2.3. Differential Solvers & Integrators

Runtime Use of the Integrator Selection

2.4. Post-Newtonian Multi-Body Subsystem

2.5. Relativistic Hydrodynamics (GRHD/GRMHD) & Stellar Physics

2.6. Polarized Radiative Transfer & Optics

2.7. Uncertainty Quantification Subsystem

2.8. Orchestration, Scheduling & User Interface

2.9. Rendering Back Ends

2.10. Capture Modules

2.11. Constants, Units and Expressions

2.12. Interface Support Modules

2.13. Distributed Computing & Cluster Engine

The distributed subsystem (include/relativistic/distributed/) provides network-distributed compute offloading across homogeneous or heterogeneous machines:

2.14. Application Lifecycle, Platform Bootstrap & Startup Window Subsystem

The application lifecycle and startup instrumentation subsystem (include/relativistic/startup/) provides host integration, inter-process synchronization, and progress tracking prior to workspace presentation: