Skip to main content

Module gpu_md_solver

Module gpu_md_solver 

Source
Expand description

GPU-side molecular dynamics (MD) solver — CPU mock backend.

Implements a Lennard-Jones MD solver pipeline using plain Rust loops as a CPU fallback. Periodic boundary conditions (minimum image convention) are applied. The API mirrors a GPU kernel dispatch for easy substitution.

Structs§

GpuMdAtom
A single MD atom stored in the GPU buffer.
GpuMdBuffer
GPU-side buffer holding the full MD system state.
GpuMdParams
Simulation parameters for the GPU MD solver.

Functions§

compute_forces_gpu
Compute all-pairs LJ forces on every atom and store in atom.force.
kinetic_energy_gpu
Compute total kinetic energy: KE = Σ 0.5 * m_i * |v_i|².
lj_force_gpu
Lennard-Jones 12-6 force magnitude dU/dr (negative of force along r̂).
lj_potential_gpu
Lennard-Jones 12-6 pair potential.
pbc_distance_gpu
Minimum-image distance between two atoms under periodic boundary conditions.
potential_energy_gpu
Compute total LJ potential energy.
rescale_velocities_gpu
Rescale all atom velocities to achieve target_temp (velocity scaling).
temperature_gpu
Estimate instantaneous temperature from kinetic energy.
verlet_integrate_gpu
Velocity-Verlet integration step.