39    if (
ec   != rhs.
getEc()  ) 
return false;
 
   44    if (
rc          != c.
rc          ) 
return false;
 
   45    if (
rl          != c.
rl          ) 
return false;
 
 
   53    if      (
ec   < rhs.
getEc()  ) 
return true;
 
   54    else if (
ec   > rhs.
getEc()  ) 
return false;
 
   61    if      (
rc          < c.
rc          ) 
return true;
 
   62    else if (
rc          > c.
rc          ) 
return false;
 
   63    if      (
rl          < c.
rl          ) 
return true;
 
   64    else if (
rl          > c.
rl          ) 
return false;
 
 
   78    if (numNeighbors == 0) numNeighbors = 1;
 
   80    for (
size_t j = 0; j < numNeighbors - 1; j++)
 
   84        double const rij = nj.
d;
 
   85        if (rij < rc && rij > 
rl)
 
   89#ifndef N2P2_NO_SF_CACHE 
   95                if (crad < 0) 
cr.fdf(rij, crad, cdrad);
 
  100            cr.fdf(rij, radij, dradij);
 
  102            for (
size_t k = j + 1; k < numNeighbors; k++)
 
  106                double const rik = nk.
d;
 
  107                if (rik < rc && rik > 
rl)
 
  112#ifndef N2P2_NO_SF_CACHE 
  115                        cr.fdf(rik, radik, dradik);
 
  121                        if (crad < 0) 
cr.fdf(rik, crad, cdrad);
 
  126                    cr.fdf(rik, radik, dradik);
 
  132                    double costijk = drij * drik;
 
  133                    double rinvijik = 1.0 / rij / rik;
 
  138                    if (costijk <= -1.0 || costijk >= 1.0) 
continue;
 
  141                    double const acostijk = acos(costijk);
 
  147                    ca.fdf(acostijk, ang, dang);
 
  149                    double const rad  = radij * radik; 
 
  155                    if (!derivatives) 
continue;
 
  157                    double const dacostijk = -1.0
 
  158                                           / sqrt(1.0 - costijk * costijk);
 
  162                    double const rinvij = rinvijik * rik;
 
  163                    double const rinvik = rinvijik * rij;
 
  164                    double phiijik = rinvij * (rinvik - rinvij * costijk);
 
  165                    double phiikij = rinvik * (rinvij - rinvik * costijk);
 
  166                    double psiijik = rinvijik; 
 
  172                    double const chiij = rinvij * radik * dradij;
 
  173                    double const chiik = rinvik * radij * dradik;
 
  176                    double const p1 = rad * phiijik +  ang * chiij;
 
  177                    double const p2 = rad * phiikij +  ang * chiik;
 
  178                    double const p3 = rad * psiijik;
 
  185#ifndef N2P2_FULL_SFD_MEMORY 
 
SymFncBaseCompAngWeighted(std::size_t type, ElementMap const &)
Constructor, initializes type.
 
CompactFunction ca
Compact function member for angular part.
 
double angleLeft
Left angle boundary.
 
double angleLeftRadians
Left angle boundary in radians.
 
double angleRight
Right angle boundary.
 
double angleRightRadians
Right angle boundary in radians.
 
std::string getSubtype() const
Get private subtype member variable.
 
double rl
Lower bound of compact function, .
 
CompactFunction cr
Compact function for radial part.
 
std::string subtype
Subtype string (specifies e.g. polynom type).
 
virtual bool operator<(SymFnc const &rhs) const
Overload < operator.
 
SymFncCompAngwWeighted(ElementMap const &elementMap)
Constructor, sets type = 25.
 
virtual void calculate(Atom &atom, bool const derivatives) const
Calculate symmetry function for one atom.
 
virtual bool operator==(SymFnc const &rhs) const
Overload == operator.
 
Symmetry function base class.
 
std::size_t type
Symmetry function type.
 
std::size_t index
Symmetry function index (per element).
 
double scalingFactor
Scaling factor.
 
std::size_t getType() const
Get private type member variable.
 
std::vector< std::vector< std::size_t > > cacheIndices
Cache indices for each element.
 
ElementMap elementMap
Copy of element map.
 
double scale(double value) const
Apply symmetry function scaling and/or centering.
 
std::size_t getEc() const
Get private ec member variable.
 
std::vector< std::size_t > indexPerElement
Per-element index for derivative memory in Atom::Neighbor::dGdr arrays.
 
std::size_t ec
Element index of center atom.
 
Struct to store information on neighbor atoms.
 
std::vector< double > cache
Symmetry function cache (e.g. for cutoffs, compact functions).
 
std::size_t element
Element index of neighbor atom.
 
double d
Distance to neighbor atom.
 
Vec3D dr
Distance vector to neighbor atom.
 
std::vector< Vec3D > dGdr
Derivatives of symmetry functions with respect to neighbor coordinates.
 
Storage for a single atom.
 
std::vector< Neighbor > neighbors
Neighbor array (maximum number defined in macros.h.
 
std::vector< Vec3D > dGdr
Derivative of symmetry functions with respect to this atom's coordinates.
 
std::vector< double > G
Symmetry function values.
 
std::size_t numNeighbors
Total number of neighbors.
 
Vector in 3 dimensional real space.