Runs the Smooth Particle Ewald Mesh (SPME) algorithm for n-body simulations with periodic boundary conditions
Original paper describing the SPME method
This library is for Python and Rust.
This has applications primarily in structural biology. For example, molecular dynamics. Compared to other n-body approximations for long-range forces, this has utility when periodic bounday conditions are used. If not using these, for example in cosmology simulations, consider Barnes Hut, or Fast Multipole Methods (FMM) instead.
Uses Rayon to parallelize as thread pools. Support for SIMD (256-bit and 512-bit), and CUDA (via CUDARC) are planned. For now, you may wish to write custom GPU kernels, using this lib as a reference.
WIP code for using the SPME/recip interaction on GPU.
Used by the Daedalus protein viewer and molecular dynamics program.
Here's an example of use. The Python API is equivalent.
use *;
use ;
const LONG_RANGE_CUTOFF: f64 = 10.0;
// A bigger α means more damping, and a smaller real-space contribution. (Cheaper real), but larger
// reciprocal load.
const EWALD_ALPHA: f64 = 0.35; // Å^-1. 0.35 is good for cutoff = 10.