53 KOKKOS_INLINE_FUNCTION
56 auto r = std::sqrt(distSqr);
57 real_t prefac = 138.935458_r * q1 * q2;
60 auto force = prefac * (erfc / r + 2_r * alpha_ *
inv_sqrtpi * expX2 + r * forceShift_);
61 return force / distSqr;
68 KOKKOS_INLINE_FUNCTION
71 auto r = std::sqrt(distSqr);
72 real_t prefac = 138.935458_r * q1 * q2;
74 return prefac * (erfc / r - energyShift_ - forceShift_ * (r - rc_));
79 real_t erfc = std::erfc(alpha_ * rc);
80 real_t exp = std::exp(-alpha_ * alpha_ * rcSqr_);
81 forceShift_ = -(erfc / rcSqr_ + 2_r *
inv_sqrtpi * alpha_ * exp / rc);
82 energyShift_ = erfc / rc;
Implements the Coulomb potential with the Damped Shifted Force (DSF) method.
Definition CoulombDSF.hpp:40
KOKKOS_INLINE_FUNCTION real_t computeForce(const real_t &distSqr, const real_t q1, const real_t q2) const
DOI: 10.1140/epjst/e2016-60151-6 eq 16.
Definition CoulombDSF.hpp:54
KOKKOS_INLINE_FUNCTION real_t computeEnergy(const real_t &distSqr, const real_t q1, const real_t q2) const
DOI: 10.1140/epjst/e2016-60151-6 eq 15.
Definition CoulombDSF.hpp:69
CoulombDSF(const real_t &rc, const real_t &alpha)
Definition CoulombDSF.hpp:77
KOKKOS_INLINE_FUNCTION real_t approxErfc(const real_t &x, real_t &expX2)
"Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Table" Milton Abramowitz ...
Definition math.hpp:58
Definition BerendsenBarostat.cpp:18
constexpr auto inv_sqrtpi
Definition constants.hpp:27
double real_t
Definition datatypes.hpp:99