Struct InversePower_interaction#
Defined in File inversepower.hpp
Inheritance Relationships#
Base Type#
public pele::BaseInteraction(Struct BaseInteraction)
Struct Documentation#
-
struct InversePower_interaction : public pele::BaseInteraction#
Pairwise interaction for Inverse power potential eps/pow * (1 - r/dij)^pow eps is the energy scale, dij sets the maximum distance of interaction the radii array allows for polydispersity The most common exponents are: pow=2 -> Hookean interaction pow=2.5 -> Hertzian interaction.
Comments about this implementation:
This implementation is using STL pow for all exponents. Performance wise this may not be the fastest possible implementation, for instance using exp(pow*log) could be faster (twice as fast according to some blogs).
Maybe we should consider a function that calls exp(pow*log) though, this should be carefully benchmarked though as my guess is that the improvement is going to be marginal and will depend on the architecture (how well pow, exp and log can be optimized on a given architecture).
See below for meta pow implementations for integer and half-integer exponents.
If you have any experience with pow please suggest any better solution and/or provide a faster implementation.
Public Functions
-
inline InversePower_interaction(double pow, double eps)#
-
inline virtual double energy(double r2, const double dij) const#
-
inline virtual double energy_gradient(double r2, double *gij, const double dij) const#
- inline virtual double energy_gradient_hessian(
- double r2,
- double *gij,
- double *hij,
- const double dij
-
inline InversePower_interaction(double pow, double eps)#