Skip to content

jlvoiseux/resonance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Resonance

GPU-accelerated 3D FDTD electromagnetic solver. This is a toy project built to experiment with Rust + wgpu compute shaders, Python bindings via PyO3, and a Vue.js visualization frontend.

Features

  • 3D finite-difference time-domain (FDTD) simulation on the GPU via wgpu
  • f16 vectorized field storage (vec4) for reduced memory bandwidth
  • Fused source injection in the E-update kernel (2 passes per step instead of 3)
  • Gaussian, modulated Gaussian, sinusoidal, and Ricker wavelet sources
  • Dielectric/lossy material support with per-cell coefficients
  • Geometry primitives (boxes, spheres, cylinders)
  • Snapshot-based seeking and replay
  • Real-time 3D visualization with volume rendering and 2D slices

Architecture

lib/          Rust core — wgpu compute shaders, FDTD kernels, simulation facade
  src/fdtd/     GPU kernels (WGSL) and simulator
  src/gpu/      Device context, buffers, pipelines
  src/simulation/  Config, world, facade API
  src/python.rs    PyO3 bindings

api/          Python FastAPI backend — wraps the Rust lib as a REST API
  src/routes/     /simulation/configure, /run, /seek, /fields, etc.
  src/services/   Singleton simulation manager

frontend/     Vue 3 + Three.js frontend — 3D visualization and controls

Usage

Prerequisites: Rust (2024 edition), Python 3.10+, Node.js

# Start the dev environment (builds lib, starts API + frontend)
./run.sh

# Run all tests
./test.sh

The frontend is served at http://localhost:5173, the API at http://localhost:8000 (Swagger UI at http://localhost:8000/docs).

Screenshots

Screenshot 2026-01-23 at 22 41 07 Screenshot 2026-01-23 at 22 40 07 Screenshot 2026-01-23 at 22 38 32

License

GPLv3

About

GPU-accelerated 3D FDTD electromagnetic solver

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors