n2p2 - A neural network potential package
nnp::SymFncExpRad Class Reference

Radial symmetry function (type 2) More...

#include <SymFncExpRad.h>

Inheritance diagram for nnp::SymFncExpRad:
Collaboration diagram for nnp::SymFncExpRad:

Public Member Functions

 SymFncExpRad (ElementMap const &elementMap)
 Constructor, sets type = 2. More...
 
virtual bool operator== (SymFnc const &rhs) const
 Overload == operator. More...
 
virtual bool operator< (SymFnc const &rhs) const
 Overload < operator. More...
 
virtual void setParameters (std::string const &parameterString)
 Set symmetry function parameters. More...
 
virtual void changeLengthUnit (double convLength)
 Change length unit. More...
 
virtual std::string getSettingsLine () const
 Get settings file line from currently set parameters. More...
 
virtual void calculate (Atom &atom, bool const derivatives) const
 Calculate symmetry function for one atom. More...
 
virtual std::string parameterLine () const
 Give symmetry function parameters in one line. More...
 
virtual std::vector< std::string > parameterInfo () const
 Get description with parameter names and values. More...
 
std::size_t getE1 () const
 Get private e1 member variable. More...
 
double getEta () const
 Get private eta member variable. More...
 
double getRs () const
 Get private rs member variable. More...
 
virtual double calculateRadialPart (double distance) const
 Calculate (partial) symmetry function value for one given distance. More...
 
virtual double calculateAngularPart (double angle) const
 Calculate (partial) symmetry function value for one given angle. More...
 
virtual bool checkRelevantElement (std::size_t index) const
 Check whether symmetry function is relevant for given element. More...
 
virtual std::vector< std::string > getCacheIdentifiers () const
 Get unique cache identifiers. More...
 
- Public Member Functions inherited from nnp::SymFncBaseCutoff
virtual std::vector< std::string > parameterInfo () const
 Get description with parameter names and values. More...
 
void setCutoffFunction (CutoffFunction::CutoffType cutoffType, double cutoffAlpha)
 Set cutoff function type and parameter. More...
 
double getCutoffAlpha () const
 Get private cutoffAlpha member variable. More...
 
std::string getSubtype () const
 Get private subtype member variable. More...
 
CutoffFunction::CutoffType getCutoffType () const
 Get private cutoffType member variable. More...
 
- Public Member Functions inherited from nnp::SymFnc
virtual ~SymFnc ()
 Virtual destructor. More...
 
virtual bool operator== (SymFnc const &rhs) const =0
 Overload == operator. More...
 
virtual bool operator< (SymFnc const &rhs) const =0
 Overload < operator. More...
 
bool operator!= (SymFnc const &rhs) const
 Overload != operator. More...
 
bool operator> (SymFnc const &rhs) const
 Overload > operator. More...
 
bool operator<= (SymFnc const &rhs) const
 Overload <= operator. More...
 
bool operator>= (SymFnc const &rhs) const
 Overload >= operator. More...
 
virtual void setParameters (std::string const &parameterString)=0
 Set parameters. More...
 
virtual void changeLengthUnit (double convLength)=0
 Change length unit. More...
 
virtual std::string getSettingsLine () const =0
 Get settings file line from currently set parameters. More...
 
virtual void calculate (Atom &atom, bool const derivatives) const =0
 Calculate symmetry function for one atom. More...
 
virtual std::string parameterLine () const =0
 Give symmetry function parameters in one line. More...
 
virtual std::vector< std::string > parameterInfo () const
 Get description with parameter names and values. More...
 
void setScalingType (ScalingType scalingType, std::string statisticsLine, double Smin, double Smax)
 Set symmetry function scaling type. More...
 
double scale (double value) const
 Apply symmetry function scaling and/or centering. More...
 
double unscale (double value) const
 Undo symmetry function scaling and/or centering. More...
 
std::size_t getType () const
 Get private type member variable. More...
 
std::size_t getIndex () const
 Get private index member variable. More...
 
std::size_t getLineNumber () const
 Get private lineNumber member variable. More...
 
std::size_t getEc () const
 Get private ec member variable. More...
 
std::size_t getMinNeighbors () const
 Get private minNeighbors member variable. More...
 
double getRc () const
 Get private rc member variable. More...
 
double getGmin () const
 Get private Gmin member variable. More...
 
double getGmax () const
 Get private Gmax member variable. More...
 
double getScalingFactor () const
 Get private scalingFactor member variable. More...
 
double getConvLength () const
 Get private convLength member variable. More...
 
std::set< std::string > getParameters () const
 Get private parameters member variable. More...
 
std::vector< std::size_t > getIndexPerElement () const
 Get private indexPerElement member variable. More...
 
void setIndex (std::size_t index)
 Set private index member variable. More...
 
void setIndexPerElement (std::size_t elementIndex, std::size_t index)
 Set private indexPerElement member variable. More...
 
void setLineNumber (std::size_t lineNumber)
 Set line number. More...
 
std::string scalingLine () const
 Get string with scaling information. More...
 
virtual double calculateRadialPart (double distance) const =0
 Calculate (partial) symmetry function value for one given distance. More...
 
virtual double calculateAngularPart (double angle) const =0
 Calculate (partial) symmetry function value for one given angle. More...
 
virtual bool checkRelevantElement (std::size_t index) const =0
 Check whether symmetry function is relevant for given element. More...
 
virtual std::vector< std::string > getCacheIdentifiers () const
 Get unique cache identifiers. More...
 
void addCacheIndex (std::size_t element, std::size_t cacheIndex, std::string cacheIdentifier)
 Add one cache index for given neighbor element and check identifier. More...
 
std::vector< std::vector< std::size_t > > getCacheIndices () const
 Getter for cacheIndices. More...
 

Private Attributes

std::size_t e1
 Element index of neighbor atom. More...
 
double eta
 Width \(\eta\) of gaussian. More...
 
double rs
 Shift \(r_s\) of gaussian. More...
 

Additional Inherited Members

- Public Types inherited from nnp::SymFnc
enum  ScalingType {
  ST_NONE , ST_SCALE , ST_CENTER , ST_SCALECENTER ,
  ST_SCALESIGMA
}
 List of available scaling types. More...
 
- Protected Types inherited from nnp::SymFnc
typedef std::map< std::string, std::pair< std::string, std::string > > PrintFormat
 
typedef std::vector< std::string > PrintOrder
 
- Protected Member Functions inherited from nnp::SymFncBaseCutoff
 SymFncBaseCutoff (std::size_t type, ElementMap const &)
 Constructor, initializes type. More...
 
- Protected Member Functions inherited from nnp::SymFnc
 SymFnc (std::size_t type, ElementMap const &)
 Constructor, initializes type. More...
 
std::string getPrintFormat () const
 Generate format string for symmetry function parameter printing. More...
 
- Static Protected Member Functions inherited from nnp::SymFnc
static PrintFormat const initializePrintFormat ()
 Initialize static print format map for all possible parameters. More...
 
static PrintOrder const initializePrintOrder ()
 Initialize static print order vector for all possible parameters. More...
 
- Protected Attributes inherited from nnp::SymFncBaseCutoff
double cutoffAlpha
 Cutoff parameter \(\alpha\). More...
 
std::string subtype
 Subtype string (specifies cutoff type). More...
 
CutoffFunction fc
 Cutoff function used by this symmetry function. More...
 
CutoffFunction::CutoffType cutoffType
 Cutoff type used by this symmetry function. More...
 
- Protected Attributes inherited from nnp::SymFnc
std::size_t type
 Symmetry function type. More...
 
ElementMap elementMap
 Copy of element map. More...
 
std::size_t index
 Symmetry function index (per element). More...
 
std::size_t lineNumber
 Line number. More...
 
std::size_t ec
 Element index of center atom. More...
 
std::size_t minNeighbors
 Minimum number of neighbors required. More...
 
double Smin
 Minimum for scaling range. More...
 
double Smax
 Maximum for scaling range. More...
 
double Gmin
 Minimum unscaled symmetry function value. More...
 
double Gmax
 Maximum unscaled symmetry function value. More...
 
double Gmean
 Mean unscaled symmetry function value. More...
 
double Gsigma
 Sigma of unscaled symmetry function values. More...
 
double rc
 Cutoff radius \(r_c\). More...
 
double scalingFactor
 Scaling factor. More...
 
double convLength
 Data set normalization length conversion factor. More...
 
ScalingType scalingType
 Symmetry function scaling type used by this symmetry function. More...
 
std::set< std::string > parameters
 Set with symmetry function parameter IDs (lookup for printing). More...
 
std::vector< std::size_t > indexPerElement
 Per-element index for derivative memory in Atom::Neighbor::dGdr arrays. More...
 
std::vector< std::vector< std::size_t > > cacheIndices
 Cache indices for each element. More...
 
- Static Protected Attributes inherited from nnp::SymFnc
static std::size_t const sfinfoWidth = 12
 Width of the SFINFO parameter description field (see parameterInfo()). More...
 
static PrintFormat const printFormat = initializePrintFormat()
 Map of parameter format strings and empty strings. More...
 
static PrintOrder const printOrder = initializePrintOrder()
 Vector of parameters in order of printing. More...
 

Detailed Description

Radial symmetry function (type 2)

\[ G^2_i = \sum_{j \neq i} \mathrm{e}^{-\eta(r_{ij} - r_\mathrm{s})^2} f_c(r_{ij}) \]

Parameter string:

<element-central> 2 <element-neighbor> <eta> <rshift> <rcutoff>
double eta
Width of gaussian.
Definition: SymFncExpRad.h:136

where

  • <element-central> .... element symbol of central atom
  • <element-neighbor> ... element symbol of neighbor atom
  • <eta> ................ \(\eta\)
  • <rshift> ............. \(r_\mathrm{s}\)
  • <rcutoff> ............ \(r_c\)

Definition at line 48 of file SymFncExpRad.h.

Constructor & Destructor Documentation

◆ SymFncExpRad()

SymFncExpRad::SymFncExpRad ( ElementMap const &  elementMap)

Constructor, sets type = 2.

Definition at line 29 of file SymFncExpRad.cpp.

29 :
31 e1 (0 ),
32 eta (0.0),
33 rs (0.0)
34{
35 minNeighbors = 1;
36 parameters.insert("e1");
37 parameters.insert("eta");
38 parameters.insert("rs/rl");
39}
SymFncBaseCutoff(std::size_t type, ElementMap const &)
Constructor, initializes type.
std::size_t e1
Element index of neighbor atom.
Definition: SymFncExpRad.h:134
double rs
Shift of gaussian.
Definition: SymFncExpRad.h:138
std::set< std::string > parameters
Set with symmetry function parameter IDs (lookup for printing).
Definition: SymFnc.h:300
ElementMap elementMap
Copy of element map.
Definition: SymFnc.h:270
std::size_t minNeighbors
Minimum number of neighbors required.
Definition: SymFnc.h:278

References nnp::SymFnc::minNeighbors, and nnp::SymFnc::parameters.

Member Function Documentation

◆ operator==()

bool SymFncExpRad::operator== ( SymFnc const &  rhs) const
virtual

Overload == operator.

Implements nnp::SymFnc.

Definition at line 41 of file SymFncExpRad.cpp.

42{
43 if (ec != rhs.getEc() ) return false;
44 if (type != rhs.getType()) return false;
45 SymFncExpRad const& c = dynamic_cast<SymFncExpRad const&>(rhs);
46 if (cutoffType != c.cutoffType ) return false;
47 if (cutoffAlpha != c.cutoffAlpha) return false;
48 if (rc != c.rc ) return false;
49 if (eta != c.eta ) return false;
50 if (rs != c.rs ) return false;
51 if (e1 != c.e1 ) return false;
52 return true;
53}
CutoffFunction::CutoffType cutoffType
Cutoff type used by this symmetry function.
double cutoffAlpha
Cutoff parameter .
Radial symmetry function (type 2)
Definition: SymFncExpRad.h:49
std::size_t type
Symmetry function type.
Definition: SymFnc.h:268
double rc
Cutoff radius .
Definition: SymFnc.h:292
std::size_t ec
Element index of center atom.
Definition: SymFnc.h:276

References nnp::SymFncBaseCutoff::cutoffAlpha, nnp::SymFncBaseCutoff::cutoffType, e1, nnp::SymFnc::ec, eta, nnp::SymFnc::getEc(), nnp::SymFnc::getType(), nnp::SymFnc::rc, rs, and nnp::SymFnc::type.

Here is the call graph for this function:

◆ operator<()

bool SymFncExpRad::operator< ( SymFnc const &  rhs) const
virtual

Overload < operator.

Implements nnp::SymFnc.

Definition at line 55 of file SymFncExpRad.cpp.

56{
57 if (ec < rhs.getEc() ) return true;
58 else if (ec > rhs.getEc() ) return false;
59 if (type < rhs.getType()) return true;
60 else if (type > rhs.getType()) return false;
61 SymFncExpRad const& c = dynamic_cast<SymFncExpRad const&>(rhs);
62 if (cutoffType < c.cutoffType ) return true;
63 else if (cutoffType > c.cutoffType ) return false;
64 if (cutoffAlpha < c.cutoffAlpha) return true;
65 else if (cutoffAlpha > c.cutoffAlpha) return false;
66 if (rc < c.rc ) return true;
67 else if (rc > c.rc ) return false;
68 if (eta < c.eta ) return true;
69 else if (eta > c.eta ) return false;
70 if (rs < c.rs ) return true;
71 else if (rs > c.rs ) return false;
72 if (e1 < c.e1 ) return true;
73 else if (e1 > c.e1 ) return false;
74 return false;
75}

References nnp::SymFncBaseCutoff::cutoffAlpha, nnp::SymFncBaseCutoff::cutoffType, e1, nnp::SymFnc::ec, eta, nnp::SymFnc::getEc(), nnp::SymFnc::getType(), nnp::SymFnc::rc, rs, and nnp::SymFnc::type.

Here is the call graph for this function:

◆ setParameters()

void SymFncExpRad::setParameters ( std::string const &  parameterString)
virtual

Set symmetry function parameters.

Parameters
[in]parameterStringString containing radial symmetry function parameters.

Implements nnp::SymFnc.

Definition at line 77 of file SymFncExpRad.cpp.

78{
79 vector<string> splitLine = split(reduce(parameterString));
80
81 if (type != (size_t)atoi(splitLine.at(1).c_str()))
82 {
83 throw runtime_error("ERROR: Incorrect symmetry function type.\n");
84 }
85
86 ec = elementMap[splitLine.at(0)];
87 e1 = elementMap[splitLine.at(2)];
88 eta = atof(splitLine.at(3).c_str());
89 rs = atof(splitLine.at(4).c_str());
90 rc = atof(splitLine.at(5).c_str());
91
94
95 return;
96}
void setCutoffParameter(double const alpha)
Set parameter for polynomial cutoff function (CT_POLY).
void setCutoffRadius(double const cutoffRadius)
Set cutoff radius.
CutoffFunction fc
Cutoff function used by this symmetry function.
vector< string > split(string const &input, char delimiter)
Split string at each delimiter.
Definition: utility.cpp:33
string reduce(string const &line, string const &whitespace, string const &fill)
Replace multiple whitespaces with fill.
Definition: utility.cpp:60

References nnp::SymFncBaseCutoff::cutoffAlpha, e1, nnp::SymFnc::ec, nnp::SymFnc::elementMap, eta, nnp::SymFncBaseCutoff::fc, nnp::SymFnc::rc, nnp::reduce(), rs, nnp::CutoffFunction::setCutoffParameter(), nnp::CutoffFunction::setCutoffRadius(), nnp::split(), and nnp::SymFnc::type.

Here is the call graph for this function:

◆ changeLengthUnit()

void SymFncExpRad::changeLengthUnit ( double  convLength)
virtual

Change length unit.

Parameters
[in]convLengthMultiplicative length unit conversion factor.

Implements nnp::SymFnc.

Definition at line 98 of file SymFncExpRad.cpp.

99{
100 this->convLength = convLength;
102 rs *= convLength;
103 rc *= convLength;
104
107
108 return;
109}
double convLength
Data set normalization length conversion factor.
Definition: SymFnc.h:296

References nnp::SymFnc::convLength, nnp::SymFncBaseCutoff::cutoffAlpha, eta, nnp::SymFncBaseCutoff::fc, nnp::SymFnc::rc, rs, nnp::CutoffFunction::setCutoffParameter(), and nnp::CutoffFunction::setCutoffRadius().

Here is the call graph for this function:

◆ getSettingsLine()

string SymFncExpRad::getSettingsLine ( ) const
virtual

Get settings file line from currently set parameters.

Returns
Settings file string ("symfunction_short ...").

Implements nnp::SymFnc.

Definition at line 111 of file SymFncExpRad.cpp.

112{
113 string s = strpr("symfunction_short %2s %2zu %2s %16.8E %16.8E %16.8E\n",
114 elementMap[ec].c_str(),
115 type,
116 elementMap[e1].c_str(),
118 rs / convLength,
119 rc / convLength);
120
121 return s;
122}
string strpr(const char *format,...)
String version of printf function.
Definition: utility.cpp:90

References nnp::SymFnc::convLength, e1, nnp::SymFnc::ec, nnp::SymFnc::elementMap, eta, nnp::SymFnc::rc, rs, nnp::strpr(), and nnp::SymFnc::type.

Here is the call graph for this function:

◆ calculate()

void SymFncExpRad::calculate ( Atom atom,
bool const  derivatives 
) const
virtual

Calculate symmetry function for one atom.

Parameters
[in,out]atomAtom for which the symmetry function is caluclated.
[in]derivativesIf also symmetry function derivatives will be calculated and saved.

Implements nnp::SymFnc.

Definition at line 124 of file SymFncExpRad.cpp.

125{
126 double result = 0.0;
127#ifndef N2P2_NO_SF_CACHE
128 bool unique = true;
129 size_t c0 = 0;
130 size_t c1 = 0;
131 if (cacheIndices.at(e1).size() > 0)
132 {
133 unique = false;
134 c0 = cacheIndices.at(e1).at(0);
135 c1 = cacheIndices.at(e1).at(1);
136 }
137#endif
138
139 for (size_t j = 0; j < atom.getStoredMinNumNeighbors(rc); ++j)
140 {
141 Atom::Neighbor& n = atom.neighbors[j];
142 if (e1 == n.element && n.d < rc)
143 {
144 // Energy calculation.
145 double const rij = n.d;
146 double const pexp = exp(-eta * (rij - rs) * (rij - rs));
147
148 // Calculate cutoff function and derivative.
149 double pfc;
150 double pdfc;
151#ifndef N2P2_NO_SF_CACHE
152 if (unique) fc.fdf(rij, pfc, pdfc);
153 else
154 {
155 double& cfc = n.cache[c0];
156 double& cdfc = n.cache[c1];
157 if (cfc < 0) fc.fdf(rij, cfc, cdfc);
158 pfc = cfc;
159 pdfc = cdfc;
160 }
161#else
162 fc.fdf(rij, pfc, pdfc);
163#endif
164 result += pexp * pfc;
165 // Force calculation.
166 if (!derivatives) continue;
167 double const p1 = scalingFactor
168 * (pdfc - 2.0 * eta * (rij - rs)
169 * pfc) * pexp / rij;
170 Vec3D dij = p1 * n.dr;
171 // Save force contributions in Atom storage.
172 atom.dGdr[index] += dij;
173#ifndef N2P2_FULL_SFD_MEMORY
174 n.dGdr[indexPerElement[e1]] -= dij;
175#else
176 n.dGdr[index] -= dij;
177#endif
178 }
179 }
180
181 atom.G[index] = scale(result);
182
183 return;
184}
void fdf(double r, double &fc, double &dfc) const
Calculate cutoff function and derivative .
std::size_t index
Symmetry function index (per element).
Definition: SymFnc.h:272
double scalingFactor
Scaling factor.
Definition: SymFnc.h:294
std::vector< std::vector< std::size_t > > cacheIndices
Cache indices for each element.
Definition: SymFnc.h:306
double scale(double value) const
Apply symmetry function scaling and/or centering.
Definition: SymFnc.cpp:169
std::vector< std::size_t > indexPerElement
Per-element index for derivative memory in Atom::Neighbor::dGdr arrays.
Definition: SymFnc.h:302
Struct to store information on neighbor atoms.
Definition: Atom.h:36
std::vector< double > cache
Symmetry function cache (e.g. for cutoffs, compact functions).
Definition: Atom.h:49
std::size_t element
Element index of neighbor atom.
Definition: Atom.h:42
double d
Distance to neighbor atom.
Definition: Atom.h:44
Vec3D dr
Distance vector to neighbor atom.
Definition: Atom.h:46
std::vector< Vec3D > dGdr
Derivatives of symmetry functions with respect to neighbor coordinates.
Definition: Atom.h:60
std::vector< Neighbor > neighbors
Neighbor array (maximum number defined in macros.h.
Definition: Atom.h:170
std::size_t getStoredMinNumNeighbors(double const cutoffRadius) const
Return needed number of neighbors for a given cutoff radius from neighborCutoffs map.
Definition: Atom.cpp:329
std::vector< Vec3D > dGdr
Derivative of symmetry functions with respect to this atom's coordinates.
Definition: Atom.h:161
std::vector< double > G
Symmetry function values.
Definition: Atom.h:146
Vector in 3 dimensional real space.
Definition: Vec3D.h:30

References nnp::Atom::Neighbor::cache, nnp::SymFnc::cacheIndices, nnp::Atom::Neighbor::d, nnp::Atom::Neighbor::dGdr, nnp::Atom::dGdr, nnp::Atom::Neighbor::dr, e1, nnp::Atom::Neighbor::element, eta, nnp::SymFncBaseCutoff::fc, nnp::CutoffFunction::fdf(), nnp::Atom::G, nnp::Atom::getStoredMinNumNeighbors(), nnp::SymFnc::index, nnp::SymFnc::indexPerElement, nnp::Atom::neighbors, nnp::SymFnc::rc, rs, nnp::SymFnc::scale(), and nnp::SymFnc::scalingFactor.

Here is the call graph for this function:

◆ parameterLine()

string SymFncExpRad::parameterLine ( ) const
virtual

Give symmetry function parameters in one line.

Returns
String containing symmetry function parameter values.

Implements nnp::SymFnc.

Definition at line 186 of file SymFncExpRad.cpp.

187{
188 return strpr(getPrintFormat().c_str(),
189 index + 1,
190 elementMap[ec].c_str(),
191 type,
192 subtype.c_str(),
193 elementMap[e1].c_str(),
195 rs / convLength,
196 rc / convLength,
198 lineNumber + 1);
199}
std::string subtype
Subtype string (specifies cutoff type).
std::size_t lineNumber
Line number.
Definition: SymFnc.h:274
std::string getPrintFormat() const
Generate format string for symmetry function parameter printing.
Definition: SymFnc.cpp:285

References nnp::SymFnc::convLength, nnp::SymFncBaseCutoff::cutoffAlpha, e1, nnp::SymFnc::ec, nnp::SymFnc::elementMap, eta, nnp::SymFnc::getPrintFormat(), nnp::SymFnc::index, nnp::SymFnc::lineNumber, nnp::SymFnc::rc, rs, nnp::strpr(), nnp::SymFncBaseCutoff::subtype, and nnp::SymFnc::type.

Here is the call graph for this function:

◆ parameterInfo()

vector< string > SymFncExpRad::parameterInfo ( ) const
virtual

Get description with parameter names and values.

Returns
Vector of parameter description strings.

Reimplemented from nnp::SymFncBaseCutoff.

Definition at line 201 of file SymFncExpRad.cpp.

202{
203 vector<string> v = SymFncBaseCutoff::parameterInfo();
204 string s;
205 size_t w = sfinfoWidth;
206
207 s = "e1";
208 v.push_back(strpr((pad(s, w) + "%s" ).c_str(), elementMap[e1].c_str()));
209 s = "eta";
210 v.push_back(strpr((pad(s, w) + "%14.8E").c_str(),
212 s = "rs";
213 v.push_back(strpr((pad(s, w) + "%14.8E").c_str(), rs / convLength));
214
215 return v;
216}
virtual std::vector< std::string > parameterInfo() const
Get description with parameter names and values.
static std::size_t const sfinfoWidth
Width of the SFINFO parameter description field (see parameterInfo()).
Definition: SymFnc.h:309
string pad(string const &input, size_t num, char fill, bool right)
Definition: utility.cpp:79

References nnp::SymFnc::convLength, e1, nnp::SymFnc::elementMap, eta, nnp::pad(), nnp::SymFncBaseCutoff::parameterInfo(), rs, nnp::SymFnc::sfinfoWidth, and nnp::strpr().

Here is the call graph for this function:

◆ getE1()

std::size_t nnp::SymFncExpRad::getE1 ( ) const
inline

Get private e1 member variable.

Definition at line 145 of file SymFncExpRad.h.

145{ return e1; }

References e1.

Referenced by nnp::SymGrpExpRad::addMember().

Here is the caller graph for this function:

◆ getEta()

double nnp::SymFncExpRad::getEta ( ) const
inline

Get private eta member variable.

Definition at line 146 of file SymFncExpRad.h.

146{ return eta; }

References eta.

◆ getRs()

double nnp::SymFncExpRad::getRs ( ) const
inline

Get private rs member variable.

Definition at line 147 of file SymFncExpRad.h.

147{ return rs; }

References rs.

◆ calculateRadialPart()

double SymFncExpRad::calculateRadialPart ( double  distance) const
virtual

Calculate (partial) symmetry function value for one given distance.

Parameters
[in]distanceDistance between two atoms.
Returns
\( e^{-\eta (r - r_s)^2} f_c(r)\)

Implements nnp::SymFnc.

Definition at line 218 of file SymFncExpRad.cpp.

219{
220 double const& r = distance * convLength;
221
222 return exp(-eta * (r - rs) * (r - rs)) * fc.f(r);
223}
double f(double r) const
Cutoff function .

References nnp::SymFnc::convLength, eta, nnp::CutoffFunction::f(), nnp::SymFncBaseCutoff::fc, and rs.

Here is the call graph for this function:

◆ calculateAngularPart()

double SymFncExpRad::calculateAngularPart ( double  angle) const
virtual

Calculate (partial) symmetry function value for one given angle.

Parameters
[in]angleAngle between triplet of atoms (in radians).
Returns
\(1\)

Implements nnp::SymFnc.

Definition at line 225 of file SymFncExpRad.cpp.

226{
227 return 1.0;
228}

◆ checkRelevantElement()

bool SymFncExpRad::checkRelevantElement ( std::size_t  index) const
virtual

Check whether symmetry function is relevant for given element.

Parameters
[in]indexIndex of given element.
Returns
True if symmetry function is sensitive to given element, false otherwise.

Implements nnp::SymFnc.

Definition at line 230 of file SymFncExpRad.cpp.

231{
232 if (index == e1) return true;
233 else return false;
234}

References e1, and nnp::SymFnc::index.

◆ getCacheIdentifiers()

vector< string > SymFncExpRad::getCacheIdentifiers ( ) const
virtual

Get unique cache identifiers.

Returns
Vector of string identifying the type of cache this symmetry function requires.

Reimplemented from nnp::SymFnc.

Definition at line 237 of file SymFncExpRad.cpp.

238{
239 vector<string> v;
240 string s("");
241
242 s += subtype;
243 s += " ";
244 s += strpr("alpha = %16.8E", cutoffAlpha);
245 s += " ";
246 s += strpr("rc = %16.8E", rc / convLength);
247
248 v.push_back(strpr("%zu f ", e1) + s);
249 v.push_back(strpr("%zu df ", e1) + s);
250
251 return v;
252}

References nnp::SymFnc::convLength, nnp::SymFncBaseCutoff::cutoffAlpha, e1, nnp::SymFnc::rc, nnp::strpr(), and nnp::SymFncBaseCutoff::subtype.

Here is the call graph for this function:

Member Data Documentation

◆ e1

std::size_t nnp::SymFncExpRad::e1
private

◆ eta

double nnp::SymFncExpRad::eta
private

◆ rs

double nnp::SymFncExpRad::rs
private

The documentation for this class was generated from the following files: