31SymGrpCompRadWeighted::
32SymGrpCompRadWeighted(
ElementMap const& elementMap) :
39 if (
ec != rhs.
getEc() )
return false;
46 if (
ec < rhs.
getEc() )
return true;
47 else if (
ec > rhs.
getEc() )
return false;
55 if (symmetryFunction->
getType() !=
type)
return false;
66 if (sf->
getEc() !=
ec )
return false;
69 throw runtime_error(
"ERROR: Unable to add symmetry function members "
70 "with different conversion factors.\n");
86 comparePointerTargets<SymFncCompRadWeighted const>);
88 for (
size_t i = 0; i <
members.size(); i++)
96 for (
size_t i = 0; i <
members.size(); i++)
108 for (
size_t i = 0; i <
members.size(); i++)
124 double* result =
new double[
members.size()];
125 for (
size_t k = 0; k <
members.size(); ++k)
133 double const rij = n.
d;
134 if (rij < rmax && rij >
rmin)
137 double const*
const d1 = n.
dr.
r;
139 for (
size_t k = 0; k <
members.size(); ++k)
142 if (rij <=
mrl[k] || rij >=
mrc[k])
continue;
145#ifndef N2P2_NO_SF_CACHE
150 double& crad = n.
cache[ci[ne][0]];
151 double& cdrad = n.
cache[ci[ne][1]];
162 if (!derivatives || drad == 0.0)
continue;
166 double const p1drijx = drad * d1[0];
167 double const p1drijy = drad * d1[1];
168 double const p1drijz = drad * d1[2];
171#ifndef N2P2_FULL_SFD_MEMORY
180 double* dGdr = atom.
dGdr[ki].r;
185#ifndef N2P2_FULL_SFD_MEMORY
196 for (
size_t k = 0; k <
members.size(); ++k)
217 for (
size_t i = 0; i <
members.size(); ++i)
220 members[i]->getSubtype().c_str(),
223 members[i]->getLineNumber() + 1,
std::size_t atomicNumber(std::size_t index) const
Get atomic number from element index.
double getRl() const
Get private rl member variable.
Weighted radial symmetry function with compact support (type 23)
void getCompactOnly(double const x, double &fx, double &dfx) const
Symmetry function base class.
double getConvLength() const
Get private convLength member variable.
double getRc() const
Get private rc member variable.
std::size_t getType() const
Get private type member variable.
std::vector< std::vector< std::size_t > > getCacheIndices() const
Getter for cacheIndices.
std::size_t getEc() const
Get private ec member variable.
double rmin
Minimum radius within group.
double rmax
Maximum radius within group.
virtual bool operator==(SymGrp const &rhs) const
Overload == operator.
std::vector< SymFncCompRadWeighted const * > members
Vector of all group member pointers.
std::vector< double > mrc
Member rc.
virtual void calculate(Atom &atom, bool const derivatives) const
Calculate all symmetry functions of this group for one atom.
virtual void sortMembers()
Sort member symmetry functions.
virtual std::vector< std::string > parameterLines() const
Give symmetry function group parameters on multiple lines.
virtual bool operator<(SymGrp const &rhs) const
Overload < operator.
std::vector< double > mrl
Member rl.
virtual bool addMember(SymFnc const *const symmetryFunction)
Potentially add a member to group.
virtual void setScalingFactors()
Fill scalingFactors with values from member symmetry functions.
std::size_t type
Symmetry function type.
std::size_t getType() const
Get private type member variable.
std::size_t index
Symmetry function group index.
std::vector< size_t > memberIndex
Vector containing indices of all member symmetry functions.
std::string getPrintFormatCommon() const
Get common parameter line format string.
std::size_t ec
Element index of center atom (common feature).
std::vector< std::vector< std::size_t > > memberIndexPerElement
Vector containing per-element indices of all member symmetry functions.
std::size_t getEc() const
Get private ec member variable.
double convLength
Data set normalization length conversion factor.
ElementMap elementMap
Copy of element map.
std::size_t getIndex() const
Get private index member variable.
std::string getPrintFormatMember() const
Get member parameter line format string.
std::vector< double > scalingFactors
Scaling factors of all member symmetry functions.
string strpr(const char *format,...)
String version of printf function.
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.
double r[3]
cartesian coordinates.