32SymFncBaseCompAng(
size_t type,
ElementMap const& elementMap) :
38 angleLeftRadians (0.0),
39 angleRightRadians(0.0)
50 vector<string> splitLine =
split(
reduce(parameterString));
52 if (
type != (
size_t)atoi(splitLine.at(1).c_str()))
54 throw runtime_error(
"ERROR: Incorrect symmetry function type.\n");
60 rl = atof(splitLine.at(4).c_str());
61 rc = atof(splitLine.at(5).c_str());
62 angleLeft = atof(splitLine.at(6).c_str());
76 throw runtime_error(
"ERROR: Lower radial boundary >= upper "
77 "radial boundary.\n");
91 throw runtime_error(
"ERROR: Left angle boundary right of or equal to "
92 "right angle boundary.\n");
96 if ( (
angleLeft < 0.0 && center != 0.0) ||
99 throw runtime_error(
"ERROR: Angle boundary out of [0,180] and "
100 "center of angular function /= 0 or /= 180.\n");
104 throw runtime_error(
"ERROR: Periodic symmetry function cannot spread "
105 "over domain > 360 degrees\n");
129 string s =
strpr(
"symfunction_short %2s %2zu %2s %2s %16.8E %16.8E "
130 "%16.8E %16.8E %s\n",
196#ifndef N2P2_NO_SF_CACHE
208 v.push_back(
strpr(
"%zu f ",
e1) + s);
209 v.push_back(
strpr(
"%zu df ",
e1) + s);
210 if (
e1 !=
e2) v.push_back(
strpr(
"%zu f ",
e2) + s);
211 if (
e1 !=
e2) v.push_back(
strpr(
"%zu df ",
e2) + s);
void setCoreFunction(CoreFunction::Type const type)
Set type.
double f(double a) const
Compact function .
CoreFunction::Type getCoreFunctionType() const
Getter for #type.
void setLeftRight(double left, double right)
Set left and right boundary.
double angleLeft
Left angle boundary.
double angleRight
Right angle boundary.
double angleRightRadians
Right angle boundary in radians.
std::size_t e2
Element index of neighbor atom 2.
virtual std::vector< std::string > getCacheIdentifiers() const
Get unique cache identifiers.
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.
CompactFunction ca
Compact function member for angular part.
virtual std::string parameterLine() const
Give symmetry function parameters in one line.
virtual double calculateAngularPart(double angle) const
Calculate (partial) symmetry function value for one given angle.
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.
virtual double calculateRadialPart(double distance) const
Calculate (partial) symmetry function value for one given distance.
double angleLeftRadians
Left angle boundary in radians.
virtual std::string getSettingsLine() const
Get settings file line from currently set parameters.
std::size_t e1
Element index of neighbor atom 1.
Symmetry function base class for SFs with compact support.
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.
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.