Expand description
GPU-side SPH solver — CPU mock backend.
Implements a complete Smoothed Particle Hydrodynamics (SPH) solver pipeline using plain Rust loops as a CPU fallback. The API mirrors what would run on a GPU kernel dispatch, making it straightforward to swap in a real GPU backend without changing call-sites.
Structs§
- GpuSph
Buffer - GPU-side buffer holding all per-particle arrays.
- GpuSph
Params - Simulation parameters for the GPU SPH solver.
- GpuSph
Particle - A single SPH particle stored on the GPU buffer.
Functions§
- compute_
density_ gpu - Compute per-particle densities via O(N²) neighbour sum.
- compute_
pressure_ force_ gpu - Compute pressure forces on all particles.
- compute_
pressure_ gpu - Compute per-particle pressures using the Tait equation of state.
- compute_
viscosity_ force_ gpu - Compute viscosity forces on all particles.
- gpu_
sph_ step - Perform one complete SPH time-step.
- integrate_
sph_ gpu - Semi-implicit Euler integration step.
- sph_
kernel_ gpu - Wendland C2 SPH kernel W(r, h).
- sph_
kernel_ grad_ gpu - Wendland C2 SPH kernel gradient magnitude dW/dr.