Lennard-Jones
LjNd
-
class LjNd : public minim::NewPotential<LjNd>
Lennard-Jones potential in an arbitrary number of dimensions.
Pairwise interaction of particles, with energy \( 4 \epsilon \left[ (\sigma/r)^{12} - (\sigma/r)^{6} \right] \), where \( r \) is the particle separation. The repulsive \( r^{-12} \) and attractive \( r^{-6} \) terms give a potential well of depth \( \epsilon \) at separation \( \sigma 2^{1/6} \).
The number of particles is inferred from the length of the coordinates, and all pairs are used as energy elements.
Subclassed by minim::Lj2d, minim::Lj3d
System size
Parameters
Overrides
-
virtual void init(const vector<double> &coords) override
Initialise the potential with the coordinates of a new state.
-
virtual void elementEnergyGradient(const vector<double> &coords, const Element &el, double *e, vector<double> *g) const override
Compute the energy and gradient of a single element.
-
virtual void init(const vector<double> &coords) override