31SymFncCompRadWeighted::SymFncCompRadWeighted(
ElementMap const& elementMap) :
39 if (
ec != rhs.
getEc() )
return false;
44 if (
rc != c.
rc )
return false;
45 if (
rl != c.
rl )
return false;
51 if (
ec < rhs.
getEc() )
return true;
52 else if (
ec > rhs.
getEc() )
return false;
59 if (
rc < c.
rc )
return true;
60 else if (
rc > c.
rc )
return false;
61 if (
rl < c.
rl )
return true;
62 else if (
rl > c.
rl )
return false;
68 vector<string> splitLine =
split(
reduce(parameterString));
70 if (
type != (
size_t)atoi(splitLine.at(1).c_str()))
72 throw runtime_error(
"ERROR: Incorrect symmetry function type.\n");
76 rl = atof(splitLine.at(2).c_str());
77 rc = atof(splitLine.at(3).c_str());
82 throw runtime_error(
"ERROR: Lower radial boundary >= upper "
83 "radial boundary.\n");
110 string s =
strpr(
"symfunction_short %2s %2zu %16.8E %16.8E %s\n",
131 double const rij = n.
d;
136#ifndef N2P2_NO_SF_CACHE
142 if (crad < 0)
cr.
fdf(r, crad, cdrad);
147 cr.
fdf(r, rad, drad);
152 if (!derivatives)
continue;
158#ifndef N2P2_FULL_SFD_MEMORY
207#ifndef N2P2_NO_SF_CACHE
221 v.push_back(
strpr(
"%zu f ", i) + s);
222 v.push_back(
strpr(
"%zu df ", i) + s);
void fdf(double a, double &fa, double &dfa) const
Calculate compact function and derivative at once.
double f(double a) const
Compact function .
void setLeftRight(double left, double right)
Set left and right boundary.
std::size_t size() const
Get element map size.
std::size_t atomicNumber(std::size_t index) const
Get atomic number from element index.
Symmetry function base class for SFs with compact support.
std::string getSubtype() const
Get private subtype member variable.
double rl
Lower bound of compact function, .
virtual std::vector< std::string > parameterInfo() const
Get description with parameter names and values.
CompactFunction cr
Compact function for radial part.
std::string subtype
Subtype string (specifies e.g. polynom type).
void setCompactFunction(std::string subtype)
Set radial compact function.
Weighted radial symmetry function with compact support (type 23)
virtual std::string getSettingsLine() const
Get settings file line from currently set parameters.
virtual std::vector< std::string > parameterInfo() const
Get description with parameter names and values.
virtual std::vector< std::string > getCacheIdentifiers() const
Get unique cache identifiers.
virtual void setParameters(std::string const ¶meterString)
Set symmetry function parameters.
virtual void changeLengthUnit(double convLength)
Change length unit.
virtual bool checkRelevantElement(std::size_t index) const
Check whether symmetry function is relevant for given element.
virtual bool operator==(SymFnc const &rhs) const
Overload == operator.
virtual std::string parameterLine() const
Give symmetry function parameters in one line.
virtual bool operator<(SymFnc const &rhs) const
Overload < operator.
virtual double calculateRadialPart(double distance) const
Calculate (partial) symmetry function value for one given distance.
virtual double calculateAngularPart(double angle) const
Calculate (partial) symmetry function value for one given angle.
virtual void calculate(Atom &atom, bool const derivatives) const
Calculate symmetry function for one atom.
Symmetry function base class.
double convLength
Data set normalization length conversion factor.
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.
std::size_t minNeighbors
Minimum number of neighbors required.
std::size_t lineNumber
Line number.
std::string getPrintFormat() const
Generate format string for symmetry function parameter printing.
string strpr(const char *format,...)
String version of printf function.
vector< string > split(string const &input, char delimiter)
Split string at each delimiter.
string reduce(string const &line, string const &whitespace, string const &fill)
Replace multiple whitespaces with fill.
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.