n2p2 - A neural network potential package
SymFncBaseExpAng.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 SYMFNCBASEEXPANG_H
18#define SYMFNCBASEEXPANG_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
30{
31public:
37 virtual void setParameters(std::string const& parameterString);
42 virtual void changeLengthUnit(double convLength);
47 virtual std::string getSettingsLine() const;
52 virtual std::string parameterLine() const;
57 virtual std::vector<
58 std::string> parameterInfo() const;
64 virtual double calculateRadialPart(double distance) const;
70 virtual double calculateAngularPart(double angle) const;
77 virtual bool checkRelevantElement(std::size_t index) const;
78#ifndef N2P2_NO_SF_CACHE
84 virtual std::vector<
85 std::string> getCacheIdentifiers() const;
86#endif
89 bool getUseIntegerPow() const;
92 std::size_t getE1() const;
95 std::size_t getE2() const;
98 int getZetaInt() const;
101 double getLambda() const;
104 double getEta() const;
107 double getZeta() const;
110 double getRs() const;
111
112protected:
116 std::size_t e1;
118 std::size_t e2;
122 double lambda;
124 double eta;
126 double zeta;
128 double rs;
129
132 SymFncBaseExpAng(std::size_t type, ElementMap const&);
133};
134
136// Inlined function definitions //
138
140inline std::size_t SymFncBaseExpAng::getE1() const { return e1; }
141inline std::size_t SymFncBaseExpAng::getE2() const { return e2; }
142inline int SymFncBaseExpAng::getZetaInt() const { return zetaInt; }
143inline double SymFncBaseExpAng::getLambda() const { return lambda; }
144inline double SymFncBaseExpAng::getEta() const { return eta; }
145inline double SymFncBaseExpAng::getZeta() const { return zeta; }
146inline double SymFncBaseExpAng::getRs() const { return rs; }
147
148}
149
150#endif
Contains element map.
Definition: ElementMap.h:30
Intermediate class for SFs based on cutoff functions.
Intermediate class for angular SFs based on cutoffs and exponentials.
virtual std::vector< std::string > getCacheIdentifiers() const
Get unique cache identifiers.
virtual double calculateAngularPart(double angle) const
Calculate (partial) symmetry function value for one given angle.
double lambda
Cosine shift factor.
SymFncBaseExpAng(std::size_t type, ElementMap const &)
Constructor, initializes type.
double zeta
Exponent of cosine term.
double getLambda() const
Get private lambda member variable.
double getRs() const
Get private rs member variable.
int getZetaInt() const
Get private zetaInt member variable.
virtual double calculateRadialPart(double distance) const
Calculate (partial) symmetry function value for one given distance.
double eta
Width of gaussian.
virtual void changeLengthUnit(double convLength)
Change length unit.
double getZeta() const
Get private zeta member variable.
virtual void setParameters(std::string const &parameterString)
Set symmetry function parameters.
virtual std::vector< std::string > parameterInfo() const
Get description with parameter names and values.
std::size_t e1
Element index of neighbor atom 1.
bool getUseIntegerPow() const
Get private useIntegerPow member variable.
std::size_t getE1() const
Get private e1 member variable.
std::size_t e2
Element index of neighbor atom 2.
double getEta() const
Get private eta member variable.
virtual bool checkRelevantElement(std::size_t index) const
Check whether symmetry function is relevant for given element.
virtual std::string parameterLine() const
Give symmetry function parameters in one line.
int zetaInt
Integer version of .
double rs
Shift of gaussian.
virtual std::string getSettingsLine() const
Get settings file line from currently set parameters.
bool useIntegerPow
Whether to use integer version of power function (faster).
std::size_t getE2() const
Get private e2 member variable.
double convLength
Data set normalization length conversion factor.
Definition: SymFnc.h:296
std::size_t type
Symmetry function type.
Definition: SymFnc.h:268
std::size_t index
Symmetry function index (per element).
Definition: SymFnc.h:272
Definition: Atom.h:29