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§
- GpuMd
Atom - A single MD atom stored in the GPU buffer.
- GpuMd
Buffer - GPU-side buffer holding the full MD system state.
- GpuMd
Params - 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.