pele
Python energy landscape explorer
 All Classes Namespaces Functions Variables Typedefs
Public Member Functions | Public Attributes
pele::InversePower_interaction Struct Reference

#include <inversepower.h>

List of all members.

Public Member Functions

 InversePower_interaction (double pow, double eps, Array< double > const radii)
double energy (double r2, size_t atomi, size_t atomj) const
double energy_gradient (double r2, double *gij, size_t atomi, size_t atomj) const
double energy_gradient_hessian (double r2, double *gij, double *hij, size_t atomi, size_t atomj) const

Public Attributes

double const _eps
double const _pow
Array< double > const _radii

Detailed Description

Pairwise interaction for Inverse power potential eps/pow * (1 - r/r0)^pow 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). Another possibility is to make the power a template parameter and then write template specialisations for the most common exponents, this however makes the interface with python ugly because cython does not deal well with template integer/double parameter yet.

So in the interest of simplicity I would keep the implementation as is for now, 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).

If you have any experience with pow please suggest any better solution and/or provide a faster implementation.

Definition at line 40 of file inversepower.h.


Constructor & Destructor Documentation

pele::InversePower_interaction::InversePower_interaction ( double  pow,
double  eps,
Array< double > const  radii 
) [inline]

Definition at line 45 of file inversepower.h.


Member Function Documentation

double pele::InversePower_interaction::energy ( double  r2,
size_t  atomi,
size_t  atomj 
) const [inline]

Definition at line 52 of file inversepower.h.

double pele::InversePower_interaction::energy_gradient ( double  r2,
double *  gij,
size_t  atomi,
size_t  atomj 
) const [inline]

Definition at line 66 of file inversepower.h.

double pele::InversePower_interaction::energy_gradient_hessian ( double  r2,
double *  gij,
double *  hij,
size_t  atomi,
size_t  atomj 
) const [inline]

Definition at line 84 of file inversepower.h.


Member Data Documentation

Definition at line 41 of file inversepower.h.

Definition at line 42 of file inversepower.h.

Definition at line 43 of file inversepower.h.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs