31SymFncBaseCompAngWeighted::
32SymFncBaseCompAngWeighted(
size_t type,
ElementMap const& elementMap) :
36 angleLeftRadians (0.0),
37 angleRightRadians(0.0)
46 vector<string> splitLine =
split(
reduce(parameterString));
48 if (
type != (
size_t)atoi(splitLine.at(1).c_str()))
50 throw runtime_error(
"ERROR: Incorrect symmetry function type.\n");
54 rl = atof(splitLine.at(2).c_str());
55 rc = atof(splitLine.at(3).c_str());
56 angleLeft = atof(splitLine.at(4).c_str());
63 throw runtime_error(
"ERROR: Lower radial boundary >= upper "
64 "radial boundary.\n");
78 throw runtime_error(
"ERROR: Left angle boundary right of or equal to "
79 "right angle boundary.\n");
83 if ( (
angleLeft < 0.0 && center != 0.0) ||
86 throw runtime_error(
"ERROR: Angle boundary out of [0,180] and "
87 "center of angular function /= 0 or /= 180.\n");
91 throw runtime_error(
"ERROR: Periodic symmetry function cannot spread "
92 "over domain > 360 degrees\n");
116 string s =
strpr(
"symfunction_short %2s %2zu %16.8E %16.8E "
117 "%16.8E %16.8E %s\n",
174#ifndef N2P2_NO_SF_CACHE
188 v.push_back(
strpr(
"%zu f ", i) + s);
189 v.push_back(
strpr(
"%zu df ", i) + 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.
std::size_t size() const
Get element map size.
virtual double calculateAngularPart(double angle) const
Calculate (partial) symmetry function value for one given angle.
CompactFunction ca
Compact function member for angular part.
virtual void changeLengthUnit(double convLength)
Change length unit.
virtual std::string parameterLine() const
Give symmetry function parameters in one line.
double angleLeft
Left angle boundary.
virtual std::vector< std::string > parameterInfo() const
Get description with parameter names and values.
double angleLeftRadians
Left angle boundary in radians.
double angleRight
Right angle boundary.
virtual std::string getSettingsLine() const
Get settings file line from currently set parameters.
virtual bool checkRelevantElement(std::size_t index) const
Check whether symmetry function is relevant for given element.
virtual double calculateRadialPart(double distance) const
Calculate (partial) symmetry function value for one given distance.
virtual std::vector< std::string > getCacheIdentifiers() const
Get unique cache identifiers.
virtual void setParameters(std::string const ¶meterString)
Set symmetry function parameters.
double angleRightRadians
Right angle boundary in radians.
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.