n2p2 - A neural network potential package
SymFncExpRad.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 SYMFNCEXPRAD_H
18#define SYMFNCEXPRAD_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
49{
50public:
56 virtual bool operator==(SymFnc const& rhs) const;
59 virtual bool operator<(SymFnc const& rhs) const;
65 virtual void setParameters(std::string const& parameterString);
70 virtual void changeLengthUnit(double convLength);
75 virtual std::string getSettingsLine() const;
82 virtual void calculate(Atom& atom, bool const derivatives) const;
87 virtual std::string parameterLine() const;
92 virtual std::vector<
93 std::string> parameterInfo() const;
96 std::size_t getE1() const;
99 double getEta() const;
102 double getRs() const;
108 virtual double calculateRadialPart(double distance) const;
114 virtual double calculateAngularPart(double angle) const;
121 virtual bool checkRelevantElement(std::size_t index) const;
122#ifndef N2P2_NO_SF_CACHE
128 virtual std::vector<
129 std::string> getCacheIdentifiers() const;
130#endif
131
132private:
134 std::size_t e1;
136 double eta;
138 double rs;
139};
140
142// Inlined function definitions //
144
145inline std::size_t SymFncExpRad::getE1() const { return e1; }
146inline double SymFncExpRad::getEta() const { return eta; }
147inline double SymFncExpRad::getRs() const { return rs; }
148
149}
150
151#endif
Contains element map.
Definition: ElementMap.h:30
Intermediate class for SFs based on cutoff functions.
Radial symmetry function (type 2)
Definition: SymFncExpRad.h:49
SymFncExpRad(ElementMap const &elementMap)
Constructor, sets type = 2.
virtual bool checkRelevantElement(std::size_t index) const
Check whether symmetry function is relevant for given element.
std::size_t e1
Element index of neighbor atom.
Definition: SymFncExpRad.h:134
double getEta() const
Get private eta member variable.
Definition: SymFncExpRad.h:146
virtual void setParameters(std::string const &parameterString)
Set symmetry function parameters.
virtual void changeLengthUnit(double convLength)
Change length unit.
virtual double calculateRadialPart(double distance) const
Calculate (partial) symmetry function value for one given distance.
virtual bool operator<(SymFnc const &rhs) const
Overload < operator.
double eta
Width of gaussian.
Definition: SymFncExpRad.h:136
virtual double calculateAngularPart(double angle) const
Calculate (partial) symmetry function value for one given angle.
virtual std::vector< std::string > getCacheIdentifiers() const
Get unique cache identifiers.
virtual std::string parameterLine() const
Give symmetry function parameters in one line.
virtual bool operator==(SymFnc const &rhs) const
Overload == operator.
virtual std::vector< std::string > parameterInfo() const
Get description with parameter names and values.
virtual void calculate(Atom &atom, bool const derivatives) const
Calculate symmetry function for one atom.
std::size_t getE1() const
Get private e1 member variable.
Definition: SymFncExpRad.h:145
double rs
Shift of gaussian.
Definition: SymFncExpRad.h:138
double getRs() const
Get private rs member variable.
Definition: SymFncExpRad.h:147
virtual std::string getSettingsLine() const
Get settings file line from currently set parameters.
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:28
Storage for a single atom.
Definition: Atom.h:32