n2p2 - A neural network potential package
|
Weighted angular symmetry function (type 13) More...
#include <SymFncExpAngnWeighted.h>
Public Member Functions | |
SymFncExpAngnWeighted (ElementMap const &elementMap) | |
Constructor, sets type = 13. 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 ¶meterString) |
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... | |
bool | getUseIntegerPow () const |
Get private useIntegerPow member variable. More... | |
int | getZetaInt () const |
Get private zetaInt member variable. More... | |
double | getEta () const |
Get private eta member variable. More... | |
double | getRs () const |
Get private rs member variable. More... | |
double | getLambda () const |
Get private lambda member variable. More... | |
double | getZeta () const |
Get private zeta 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 ¶meterString)=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 | |
bool | useIntegerPow |
Whether to use integer version of power function (faster). More... | |
int | zetaInt |
Integer version of \(\zeta\). More... | |
double | eta |
Width \(\eta\) of gaussian. More... | |
double | rs |
Shift \(r_s\) of gaussian. More... | |
double | lambda |
Cosine shift factor. More... | |
double | zeta |
Exponent \(\zeta\) of cosine term. 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... | |
Weighted angular symmetry function (type 13)
\[ G^{13}_i = 2^{1-\zeta} \sum_{\substack{j,k\neq i \\ j < k}} Z_j Z_k \, \left( 1 + \lambda \cos \theta_{ijk} \right)^\zeta \mathrm{e}^{-\eta \left[ (r_{ij} - r_s)^2 + (r_{ik} - r_s)^2 + (r_{jk} - r_s)^2 \right] } f_c(r_{ij}) f_c(r_{ik}) f_c(r_{jk}) \]
Parameter string:
where
<element-central> .....
element symbol of central atom<eta> .................
\(\eta\)<rshift> ..............
\(r_s\)<lambda> ..............
\(\lambda\)<zeta> ................
\(\zeta\)<rcutoff> .............
\(r_c\) Definition at line 53 of file SymFncExpAngnWeighted.h.
SymFncExpAngnWeighted::SymFncExpAngnWeighted | ( | ElementMap const & | elementMap | ) |
Constructor, sets type = 13.
Definition at line 30 of file SymFncExpAngnWeighted.cpp.
References nnp::SymFnc::minNeighbors, and nnp::SymFnc::parameters.
|
virtual |
Overload == operator.
Implements nnp::SymFnc.
Definition at line 46 of file SymFncExpAngnWeighted.cpp.
References nnp::SymFncBaseCutoff::cutoffAlpha, nnp::SymFncBaseCutoff::cutoffType, nnp::SymFnc::ec, eta, nnp::SymFnc::getEc(), nnp::SymFnc::getType(), lambda, nnp::SymFnc::rc, rs, nnp::SymFnc::type, and zeta.
|
virtual |
Overload < operator.
Implements nnp::SymFnc.
Definition at line 62 of file SymFncExpAngnWeighted.cpp.
References nnp::SymFncBaseCutoff::cutoffAlpha, nnp::SymFncBaseCutoff::cutoffType, nnp::SymFnc::ec, eta, nnp::SymFnc::getEc(), nnp::SymFnc::getType(), lambda, nnp::SymFnc::rc, rs, nnp::SymFnc::type, and zeta.
|
virtual |
Set symmetry function parameters.
[in] | parameterString | String containing weighted angular symmetry function parameters. |
Implements nnp::SymFnc.
Definition at line 87 of file SymFncExpAngnWeighted.cpp.
References nnp::SymFncBaseCutoff::cutoffAlpha, nnp::SymFnc::ec, nnp::SymFnc::elementMap, eta, nnp::SymFncBaseCutoff::fc, lambda, nnp::SymFnc::rc, nnp::reduce(), rs, nnp::CutoffFunction::setCutoffParameter(), nnp::CutoffFunction::setCutoffRadius(), nnp::split(), nnp::SymFnc::type, useIntegerPow, zeta, and zetaInt.
|
virtual |
Change length unit.
[in] | convLength | Multiplicative length unit conversion factor. |
Implements nnp::SymFnc.
Definition at line 119 of file SymFncExpAngnWeighted.cpp.
References nnp::SymFnc::convLength, nnp::SymFncBaseCutoff::cutoffAlpha, eta, nnp::SymFncBaseCutoff::fc, nnp::SymFnc::rc, rs, nnp::CutoffFunction::setCutoffParameter(), and nnp::CutoffFunction::setCutoffRadius().
|
virtual |
Get settings file line from currently set parameters.
Implements nnp::SymFnc.
Definition at line 132 of file SymFncExpAngnWeighted.cpp.
References nnp::SymFnc::convLength, nnp::SymFnc::ec, nnp::SymFnc::elementMap, eta, lambda, nnp::SymFnc::rc, rs, nnp::strpr(), nnp::SymFnc::type, and zeta.
|
virtual |
Calculate symmetry function for one atom.
[in,out] | atom | Atom for which the symmetry function is caluclated. |
[in] | derivatives | If also symmetry function derivatives will be calculated and saved. |
Implements nnp::SymFnc.
Definition at line 147 of file SymFncExpAngnWeighted.cpp.
References nnp::ElementMap::atomicNumber(), nnp::Atom::Neighbor::cache, nnp::SymFnc::cacheIndices, nnp::Atom::Neighbor::d, nnp::Atom::Neighbor::dGdr, nnp::Atom::dGdr, nnp::Atom::Neighbor::dr, nnp::Atom::Neighbor::element, nnp::SymFnc::elementMap, eta, nnp::SymFncBaseCutoff::fc, nnp::CutoffFunction::fdf(), nnp::Atom::G, nnp::SymFnc::index, nnp::SymFnc::indexPerElement, lambda, nnp::Atom::neighbors, nnp::Vec3D::norm2(), nnp::Atom::numNeighbors, nnp::pow_int(), nnp::SymFnc::rc, rs, nnp::SymFnc::scale(), nnp::SymFnc::scalingFactor, useIntegerPow, zeta, and zetaInt.
|
virtual |
Give symmetry function parameters in one line.
Implements nnp::SymFnc.
Definition at line 290 of file SymFncExpAngnWeighted.cpp.
References nnp::SymFnc::convLength, nnp::SymFncBaseCutoff::cutoffAlpha, nnp::SymFnc::ec, nnp::SymFnc::elementMap, eta, nnp::SymFnc::getPrintFormat(), nnp::SymFnc::index, lambda, nnp::SymFnc::lineNumber, nnp::SymFnc::rc, rs, nnp::strpr(), nnp::SymFncBaseCutoff::subtype, nnp::SymFnc::type, and zeta.
|
virtual |
Get description with parameter names and values.
Reimplemented from nnp::SymFncBaseCutoff.
Definition at line 306 of file SymFncExpAngnWeighted.cpp.
References nnp::SymFnc::convLength, eta, lambda, nnp::pad(), nnp::SymFncBaseCutoff::parameterInfo(), rs, nnp::SymFnc::sfinfoWidth, nnp::strpr(), and zeta.
|
inline |
Get private useIntegerPow member variable.
Definition at line 165 of file SymFncExpAngnWeighted.h.
References useIntegerPow.
|
inline |
Get private zetaInt member variable.
Definition at line 170 of file SymFncExpAngnWeighted.h.
References zetaInt.
|
inline |
Get private eta member variable.
Definition at line 171 of file SymFncExpAngnWeighted.h.
References eta.
|
inline |
Get private rs member variable.
Definition at line 172 of file SymFncExpAngnWeighted.h.
References rs.
|
inline |
Get private lambda member variable.
Definition at line 173 of file SymFncExpAngnWeighted.h.
References lambda.
|
inline |
Get private zeta member variable.
Definition at line 174 of file SymFncExpAngnWeighted.h.
References zeta.
|
virtual |
Calculate (partial) symmetry function value for one given distance.
[in] | distance | Distance between two atoms. |
Implements nnp::SymFnc.
Definition at line 325 of file SymFncExpAngnWeighted.cpp.
References nnp::SymFnc::convLength, eta, nnp::CutoffFunction::f(), nnp::SymFncBaseCutoff::fc, p, and rs.
|
virtual |
Calculate (partial) symmetry function value for one given angle.
[in] | angle | Angle between triplet of atoms (in radians). |
Implements nnp::SymFnc.
Definition at line 333 of file SymFncExpAngnWeighted.cpp.
|
virtual |
Check whether symmetry function is relevant for given element.
[in] | index | Index of given element. |
Implements nnp::SymFnc.
Definition at line 338 of file SymFncExpAngnWeighted.cpp.
|
virtual |
Get unique cache identifiers.
Reimplemented from nnp::SymFnc.
Definition at line 344 of file SymFncExpAngnWeighted.cpp.
References nnp::SymFnc::convLength, nnp::SymFncBaseCutoff::cutoffAlpha, nnp::SymFnc::elementMap, nnp::SymFnc::rc, nnp::ElementMap::size(), nnp::strpr(), and nnp::SymFncBaseCutoff::subtype.
|
private |
Whether to use integer version of power function (faster).
Definition at line 148 of file SymFncExpAngnWeighted.h.
Referenced by calculate(), getUseIntegerPow(), and setParameters().
|
private |
Integer version of \(\zeta\).
Definition at line 150 of file SymFncExpAngnWeighted.h.
Referenced by calculate(), getZetaInt(), and setParameters().
|
private |
Width \(\eta\) of gaussian.
Definition at line 152 of file SymFncExpAngnWeighted.h.
Referenced by calculate(), calculateRadialPart(), changeLengthUnit(), getEta(), getSettingsLine(), operator<(), operator==(), parameterInfo(), parameterLine(), and setParameters().
|
private |
Shift \(r_s\) of gaussian.
Definition at line 154 of file SymFncExpAngnWeighted.h.
Referenced by calculate(), calculateRadialPart(), changeLengthUnit(), getRs(), getSettingsLine(), operator<(), operator==(), parameterInfo(), parameterLine(), and setParameters().
|
private |
Cosine shift factor.
Definition at line 156 of file SymFncExpAngnWeighted.h.
Referenced by calculate(), calculateAngularPart(), getLambda(), getSettingsLine(), operator<(), operator==(), parameterInfo(), parameterLine(), and setParameters().
|
private |
Exponent \(\zeta\) of cosine term.
Definition at line 158 of file SymFncExpAngnWeighted.h.
Referenced by calculate(), calculateAngularPart(), getSettingsLine(), getZeta(), operator<(), operator==(), parameterInfo(), parameterLine(), and setParameters().