7 const auto displacement = q.
getX() - p.
getX();
13 }
else if (dist <=
r_c) {
17 const double sigma_pow_6 = std::pow(sigma, 6);
18 const double dist_pow_6 = std::pow(dist, 6);
20 const auto f_smoothed_lennard_jones =
21 (-24 * sigma_pow_6 * epsilon) / (std::pow(dist, 14) * std::pow(
r_c -
r_l, 3)) * (
r_c - dist) *
22 (
r_c *
r_c * (2 * sigma_pow_6 - dist_pow_6) +
r_c * (3 *
r_l - dist) * (dist_pow_6 - 2 * sigma_pow_6) +
23 dist * (5 *
r_l * sigma_pow_6 - 2 *
r_l * dist_pow_6 - 3 * sigma_pow_6 * dist + std::pow(dist, 7))) *
26 return f_smoothed_lennard_jones;
32 SmoothedLennardJonesForce::operator std::string()
const {
return "SmoothedLennardJones"; };
Class to calculate the Lennard-Jones force between particles. Implements the interface PairwiseForceS...
std::array< double, 3UL > calculateForce(const Particle &p, const Particle &q) const override
Calculates the Lennard-Jones forces between two particles.
Class to represent a particle.
double getSigma() const
Gets the Lennard-Jones potential parameter sigma.
const std::array< double, 3 > & getX() const
Gets the position of the particle.
double getEpsilon() const
Gets the Lennard-Jones potential parameter epsilon.
double r_c
the radius after which the force is 0
std::array< double, 3UL > calculateForce(const Particle &p, const Particle &q) const override
Calculates the smoothed Lennard-Jones forces between two particles.
double r_l
the radius whithin the normal Lennard-Jones force is applied. Between r_l and r_c the force is smooth...
auto L2Norm(const Container &c)