Skip to main content

Module gpu_sph_solver

Module gpu_sph_solver 

Source
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§

GpuSphBuffer
GPU-side buffer holding all per-particle arrays.
GpuSphParams
Simulation parameters for the GPU SPH solver.
GpuSphParticle
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.