30SymFncBaseExpAng::SymFncBaseExpAng(
size_t type,
ElementMap const& elementMap) :
52 vector<string> splitLine =
split(
reduce(parameterString));
54 if (
type != (
size_t)atoi(splitLine.at(1).c_str()))
56 throw runtime_error(
"ERROR: Incorrect symmetry function type.\n");
62 eta = atof(splitLine.at(4).c_str());
63 lambda = atof(splitLine.at(5).c_str());
64 zeta = atof(splitLine.at(6).c_str());
65 rc = atof(splitLine.at(7).c_str());
67 if (splitLine.size() > 8)
69 rs = atof(splitLine.at(8).c_str());
83 if (fabs(
zeta -
zetaInt) <= numeric_limits<double>::min())
110 string s =
strpr(
"symfunction_short %2s %2zu %2s %2s %16.8E %16.8E "
111 "%16.8E %16.8E %16.8E\n",
154 v.push_back(
strpr((
pad(s, w) +
"%14.8E").c_str(),
159 v.push_back(
strpr((
pad(s, w) +
"%14.8E").c_str(),
zeta));
169 double const p = exp(-
eta * (r -
rs) * (r -
rs)) *
fc.
f(r);
176 return 2.0 * pow((1.0 +
lambda * cos(angle)) / 2.0,
zeta);
185#ifndef N2P2_NO_SF_CACHE
197 v.push_back(
strpr(
"%zu f ",
e1) + s);
198 v.push_back(
strpr(
"%zu df ",
e1) + s);
199 if (
e1 !=
e2) v.push_back(
strpr(
"%zu f ",
e2) + s);
200 if (
e1 !=
e2) v.push_back(
strpr(
"%zu df ",
e2) + s);
double f(double r) const
Cutoff function .
void setCutoffParameter(double const alpha)
Set parameter for polynomial cutoff function (CT_POLY).
void setCutoffRadius(double const cutoffRadius)
Set cutoff radius.
Intermediate class for SFs based on cutoff functions.
std::string subtype
Subtype string (specifies cutoff type).
CutoffFunction fc
Cutoff function used by this symmetry function.
virtual std::vector< std::string > parameterInfo() const
Get description with parameter names and values.
double cutoffAlpha
Cutoff parameter .
virtual std::vector< std::string > getCacheIdentifiers() const
Get unique cache identifiers.
virtual double calculateAngularPart(double angle) const
Calculate (partial) symmetry function value for one given angle.
double lambda
Cosine shift factor.
double zeta
Exponent of cosine term.
virtual double calculateRadialPart(double distance) const
Calculate (partial) symmetry function value for one given distance.
double eta
Width of gaussian.
virtual void changeLengthUnit(double convLength)
Change length unit.
virtual void setParameters(std::string const ¶meterString)
Set symmetry function parameters.
virtual std::vector< std::string > parameterInfo() const
Get description with parameter names and values.
std::size_t e1
Element index of neighbor atom 1.
std::size_t e2
Element index of neighbor atom 2.
virtual bool checkRelevantElement(std::size_t index) const
Check whether symmetry function is relevant for given element.
virtual std::string parameterLine() const
Give symmetry function parameters in one line.
int zetaInt
Integer version of .
double rs
Shift of gaussian.
virtual std::string getSettingsLine() const
Get settings file line from currently set parameters.
bool useIntegerPow
Whether to use integer version of power function (faster).
double convLength
Data set normalization length conversion factor.
std::size_t type
Symmetry function type.
std::set< std::string > parameters
Set with symmetry function parameter IDs (lookup for printing).
std::size_t index
Symmetry function index (per element).
ElementMap elementMap
Copy of element map.
std::size_t ec
Element index of center atom.
static std::size_t const sfinfoWidth
Width of the SFINFO parameter description field (see parameterInfo()).
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 pad(string const &input, size_t num, char fill, bool right)
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.