Skip to content

tgergo1/wavefront-simulation

Repository files navigation

wavefront-simulation

Scientific N-dimensional wave simulation library in C++20 with interchangeable solver modes, symbolic constitutive laws, deterministic CPU execution, exact-reference hooks, and Python bindings.

Simulation Visualization

All animations below are generated by running the library itself. The generator enforces scenario-level physical checks and writes quantitative results to /Users/gergely.toth/Work/wavefront-simulation/docs/assets/_checks/validation-metrics.json.

1) Interchangeable Solver Modes (same problem setup)

Left to right: LinearApprox, NonlinearContinuum, MicroSurrogate.

Wavefield mode evolution

2) Interface Reflection / Transmission Example

Single linear solver with a smooth impedance jump in x_0, showing reflected and transmitted fronts.

Interface reflection transmission

3) Boundary Behavior Example

Left: periodic boundaries (re-entering energy). Right: PML boundaries (absorbing edges).

Boundary comparison periodic vs pml

4) Double-Slit Experiment

Single source on the left, opaque wall in the middle (dark gray) with two open slits (cyan), and downstream interference fringes behind the slits.

Double slit experiment

5) 3D Wavefield (Volumetric Perspective)

Full 3D simulation rendered as a perspective volume (not slice planes), with a rotating camera to show depth.

3d wave volume

6) 4D Wavefield (Hyperslice Grid)

A 4-D acoustic wave launched from a point source at the centre of [0,1]⁴.
Because wave fronts in 4-D expand as a 3-sphere (the surface of a 4-ball), each 2-D cross-section at a fixed (x₂, x₃) position shows a circular arc whose radius depends on the slice distance from the source.

The 3 × 3 grid visualises this directly:

  • rows → three x₂ levels: ¼, ½, ¾ of the domain (stripe colour encodes the level)
  • columns → three x₃ levels: ¼, ½, ¾ of the domain
  • The centre panel (x₂ = ½, x₃ = ½) cuts through the equator of the 3-sphere and shows the largest wavefront ring; corner panels reveal progressively smaller cross-sections, exposing the 4-D geometry.

4D hyperslice grid

Regenerate all GIFs with:

PYTHONPATH=build/python python3 examples/generate_readme_gifs.py

Note: GIF export requires ffmpeg on PATH.

Features

  • Runtime interchangeable modes: LinearApprox, NonlinearContinuum, MicroSurrogate
  • Compile-time solver API: SolverND<N, Scalar, Mode>
  • N-D Cartesian domains and configurable spatial order (2nd / 4th)
  • Boundary operators: Dirichlet, Neumann, Robin, Periodic, Impedance, PML
  • Interface physics helpers for reflection/refraction/mode-conversion calculations
  • Symbolic expression parser/compiler for medium and source terms
  • Exact-reference infrastructure with limitless in ExactReference mode
  • CMake package export and pybind11 Python module
  • Unit/integration/verification/benchmark test matrix

Build

cmake -S . -B build -DWAVEFRONT_BUILD_TESTS=ON -DWAVEFRONT_BUILD_PYTHON=ON
cmake --build build -j
ctest --test-dir build --output-on-failure

Python wheel build

python -m pip install -U build
python -m build

License

GPL-3.0-only (aligned with limitless). See /Users/gergely.toth/Work/wavefront-simulation/LICENSE.

Documentation

  • /Users/gergely.toth/Work/wavefront-simulation/docs/API_REFERENCE.md
  • /Users/gergely.toth/Work/wavefront-simulation/docs/MATHEMATICAL_DERIVATIONS.md
  • /Users/gergely.toth/Work/wavefront-simulation/docs/VALIDATION_REPORT.md
  • /Users/gergely.toth/Work/wavefront-simulation/docs/tutorial_nd_setup.md
  • /Users/gergely.toth/Work/wavefront-simulation/docs/tutorial_mode_switching.md
  • /Users/gergely.toth/Work/wavefront-simulation/docs/tutorial_precision_reference.md

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors