n2p2 - A neural network potential package
SymFncBaseCompAngWeighted.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// Copyright (C) 2020 Martin P. Bircher
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <https://www.gnu.org/licenses/>.
17
18#ifndef SYMFNCBASECOMPANGWEIGHTED_H
19#define SYMFNCBASECOMPANGWEIGHTED_H
20
21#include "SymFncBaseComp.h"
22#include <cstddef> // std::size_t
23#include <string> // std::string
24#include <vector> // std::vector
25
26namespace nnp
27{
28
31{
32public:
38 virtual void setParameters(std::string const& parameterString);
43 virtual void changeLengthUnit(double convLength);
48 virtual std::string getSettingsLine() const;
49 // Core fcts
50 void getCompactAngle(double const x,
51 double& fx,
52 double& dfx) const;
53 void getCompactRadial(double const x,
54 double& fx,
55 double& dfx) const;
60 virtual std::string parameterLine() const;
65 virtual std::vector<
66 std::string> parameterInfo() const;
69 double getAngleLeft() const;
72 double getAngleRight() const;
78 virtual double calculateRadialPart(double distance) const;
84 virtual double calculateAngularPart(double angle) const;
91 virtual bool checkRelevantElement(std::size_t index) const;
92#ifndef N2P2_NO_SF_CACHE
98 virtual std::vector<
99 std::string> getCacheIdentifiers() const;
100#endif
101
102protected:
104 double angleLeft;
113
116 SymFncBaseCompAngWeighted(std::size_t type, ElementMap const&);
117};
118
120// Inlined function definitions //
122
124{
125 return angleLeft;
126}
127
129{
130 return angleRight;
131}
132
134 double& fx,
135 double& dfx) const
136{
137 ca.fdf(x, fx, dfx);
138 return;
139}
140
142 double& fx,
143 double& dfx) const
144{
145 cr.fdf(x, fx, dfx);
146 return;
147}
148
149}
150
151#endif
A general function with compact support.
void fdf(double a, double &fa, double &dfa) const
Calculate compact function and derivative at once.
Contains element map.
Definition: ElementMap.h:30
Intermediate symmetry function class for weighted angular compact SFs.
SymFncBaseCompAngWeighted(std::size_t type, ElementMap const &)
Constructor, initializes type.
virtual double calculateAngularPart(double angle) const
Calculate (partial) symmetry function value for one given angle.
CompactFunction ca
Compact function member for angular part.
void getCompactRadial(double const x, double &fx, double &dfx) const
virtual void changeLengthUnit(double convLength)
Change length unit.
double getAngleRight() const
Get private angleRight member variable.
double getAngleLeft() const
Get private angleLeft member variable.
virtual std::string parameterLine() const
Give symmetry function parameters in one line.
double angleLeft
Left angle boundary.
void getCompactAngle(double const x, double &fx, double &dfx) const
virtual std::vector< std::string > parameterInfo() const
Get description with parameter names and values.
double angleLeftRadians
Left angle boundary in radians.
double angleRight
Right angle boundary.
virtual std::string getSettingsLine() const
Get settings file line from currently set parameters.
virtual bool checkRelevantElement(std::size_t index) const
Check whether symmetry function is relevant for given element.
virtual double calculateRadialPart(double distance) const
Calculate (partial) symmetry function value for one given distance.
virtual std::vector< std::string > getCacheIdentifiers() const
Get unique cache identifiers.
virtual void setParameters(std::string const &parameterString)
Set symmetry function parameters.
double angleRightRadians
Right angle boundary in radians.
Symmetry function base class for SFs with compact support.
CompactFunction cr
Compact function for radial part.
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