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. Supports GPU, or thread-pooled CPU.
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), is planned. To use on an nVidia GPU, enable
the cuda feature in Cargo.toml.
Used by the Daedalus protein viewer and molecular dynamics program, and the Dynamics library.
Uses f32 for Lennard Jones and Coulomb interactions. Energy sums are computed as f64.
Here's an example of use. The Python API is equivalent.
use *;
use ;
const LONG_RANGE_CUTOFF: f32 = 10.0;
// A bigger α means more damping, and a smaller real-space contribution. (Cheaper real), but larger
// reciprocal load.
const EWALD_ALPHA: f32 = 0.35; // Å^-1. 0.35 is good for cutoff = 10.