n2p2 - A neural network potential package
SymFncExpAngnWeighted.h
Go to the documentation of this file.
1// n2p2 - A neural network potential package
2// Copyright (C) 2018 Andreas Singraber (University of Vienna)
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <https://www.gnu.org/licenses/>.
16
17#ifndef SYMFNCEXPANGNWEIGHTED_H
18#define SYMFNCEXPANGNWEIGHTED_H
19
20#include "SymFncBaseCutoff.h"
21#include <cstddef> // std::size_t
22#include <string> // std::string
23#include <vector> // std::vector
24
25namespace nnp
26{
27
28struct Atom;
29class ElementMap;
30
54{
55public:
61 virtual bool operator==(SymFnc const& rhs) const;
64 virtual bool operator<(SymFnc const& rhs) const;
70 virtual void setParameters(std::string const& parameterString);
75 virtual void changeLengthUnit(double convLength);
80 virtual std::string getSettingsLine() const;
87 virtual void calculate(Atom& atom, bool const derivatives) const;
92 virtual std::string parameterLine() const;
97 virtual std::vector<
98 std::string> parameterInfo() const;
101 bool getUseIntegerPow() const;
104 int getZetaInt() const;
107 double getEta() const;
110 double getRs() const;
113 double getLambda() const;
116 double getZeta() const;
122 virtual double calculateRadialPart(double distance) const;
128 virtual double calculateAngularPart(double angle) const;
135 virtual bool checkRelevantElement(std::size_t index) const;
136#ifndef N2P2_NO_SF_CACHE
142 virtual std::vector<
143 std::string> getCacheIdentifiers() const;
144#endif
145
146private:
152 double eta;
154 double rs;
156 double lambda;
158 double zeta;
159};
160
162// Inlined function definitions //
164
166{
167 return useIntegerPow;
168}
169
170inline int SymFncExpAngnWeighted::getZetaInt() const { return zetaInt; }
171inline double SymFncExpAngnWeighted::getEta() const { return eta; }
172inline double SymFncExpAngnWeighted::getRs() const { return rs; }
173inline double SymFncExpAngnWeighted::getLambda() const { return lambda; }
174inline double SymFncExpAngnWeighted::getZeta() const { return zeta; }
175
176}
177
178#endif
Contains element map.
Definition: ElementMap.h:30
Intermediate class for SFs based on cutoff functions.
Weighted angular symmetry function (type 13)
virtual double calculateAngularPart(double angle) const
Calculate (partial) symmetry function value for one given angle.
virtual bool checkRelevantElement(std::size_t index) const
Check whether symmetry function is relevant for given element.
int zetaInt
Integer version of .
virtual std::string getSettingsLine() const
Get settings file line from currently set parameters.
double rs
Shift of gaussian.
virtual double calculateRadialPart(double distance) const
Calculate (partial) symmetry function value for one given distance.
double lambda
Cosine shift factor.
virtual std::string parameterLine() const
Give symmetry function parameters in one line.
double getEta() const
Get private eta member variable.
bool getUseIntegerPow() const
Get private useIntegerPow member variable.
double getRs() const
Get private rs member variable.
SymFncExpAngnWeighted(ElementMap const &elementMap)
Constructor, sets type = 13.
double getZeta() const
Get private zeta member variable.
double getLambda() const
Get private lambda member variable.
virtual bool operator==(SymFnc const &rhs) const
Overload == operator.
bool useIntegerPow
Whether to use integer version of power function (faster).
double eta
Width of gaussian.
virtual bool operator<(SymFnc const &rhs) const
Overload < operator.
double zeta
Exponent of cosine term.
virtual void setParameters(std::string const &parameterString)
Set symmetry function parameters.
virtual void changeLengthUnit(double convLength)
Change length unit.
virtual std::vector< std::string > getCacheIdentifiers() const
Get unique cache identifiers.
virtual void calculate(Atom &atom, bool const derivatives) const
Calculate symmetry function for one atom.
int getZetaInt() const
Get private zetaInt member variable.
virtual std::vector< std::string > parameterInfo() const
Get description with parameter names and values.
Symmetry function base class.
Definition: SymFnc.h:40
double convLength
Data set normalization length conversion factor.
Definition: SymFnc.h:296
std::size_t index
Symmetry function index (per element).
Definition: SymFnc.h:272
ElementMap elementMap
Copy of element map.
Definition: SymFnc.h:270
Definition: Atom.h:29
Storage for a single atom.
Definition: Atom.h:33