Expand description
For Smooth-Particle-Mesh Ewald; a standard approximation for Coulomb forces in MD. We use this to handle periodic boundary conditions (e.g. of the solvent) properly. See the Readme for details. The API is split into two main parts: A standalone function to calculate short-range force, and a struct with forces methods for long-range reciprical forces.
Structs§
- PmeRecip
- Initialize this once for the application, or once per step. Note:
Functions§
- fft3d_
c2r - Complex-to-real inverse 3D FFT.
- fft3d_
r2c - Real-to-Complex forward 3D FFT. This approach uses less memory, and is probably faster, than using complex to complex transform (Factor of 2 for the memory).
- force_
correction - For flexible molecules, computes the correction term. May be useful for scaling corrections, e.g. bonded scaling and exlusions? todo: This may not be suitable for general use.
- force_
coulomb_ short_ range - Computes the direct, short-range component. Ideally, use a combined GPU kernel with Lennard Jones,
or a SIMD variant, instead of this. We use this for short-range Coulomb forces on the CPU, as part of SPME.
cutoff_distis the distance, in Å, at which we no longer apply any force from this component. α controls the blending of short and long-range forces; 0.35Å for α is a good default for a cutoff of 10Å. - force_
coulomb_ short_ range_ x8 - force_
coulomb_ short_ range_ x16 - get_
grid_ n - A utility function to get the (nx, ny, nz) tuple of plan dimensions based
on grid dimensions, and mesh spacing. A mesh spacing of 1Å is a good starting point.
Pass this into the
PmeRecip::new()constructor, or set these values up with some other approach.