1 #ifndef OPENMPCD_PAIRPOTENTIALS_GEMN_HPP
2 #define OPENMPCD_PAIRPOTENTIALS_GEMN_HPP
4 #include <OpenMPCD/PairPotentials/Base.hpp>
8 namespace PairPotentials
20 template<
typename T = FP>
31 GEMn(
const T eps,
const T sigma,
const int n)
32 : epsilon(eps), sigma(sigma), n(n)
51 const T rOverSigma =
pow( (abs_r/sigma),
double(n));
52 return (( n * epsilon * rOverSigma * exp((-1) * rOverSigma)) / (abs_r)) * R.
getNormalized();
73 #endif //OPENMPCD_PAIRPOTENTIALS_GEMN_HPP
GEM-n Interaction An extension of the Gaussian Core Model, see Stillinger, F.
OPENMPCD_CUDA_HOST_AND_DEVICE boost::enable_if< boost::is_integral< B >, double >::type pow(const B base, const double exponent)
The power function.
#define OPENMPCD_CUDA_HOST_AND_DEVICE
Denotes a function to be callable both from the Host and from a CUDA Device.
const OPENMPCD_CUDA_HOST_AND_DEVICE Vector3D getNormalized() const
Returns this vector, but normalized.
OPENMPCD_CUDA_HOST_AND_DEVICE Vector3D< T > force(const Vector3D< T > &R) const
Returns the force vector of the interaction for a given position vector.
OPENMPCD_CUDA_HOST_AND_DEVICE GEMn(const T eps, const T sigma, const int n)
The constructor.
OPENMPCD_CUDA_HOST_AND_DEVICE T potential(const Vector3D< T > &R) const
Returns the potential of the interaction for a given position vector.
Abstract base class for pair potentials.
OPENMPCD_CUDA_HOST_AND_DEVICE RealType getMagnitude() const
Returns the magnitude of this vector.