n2p2 - A neural network potential package
SymFncCompRadWeighted.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 SYMFNCCOMPRADWEIGHTED_H
19#define SYMFNCCOMPRADWEIGHTED_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
29struct Atom;
30class ElementMap;
31
57{
58public:
64 virtual bool operator==(SymFnc const& rhs) const;
67 virtual bool operator<(SymFnc const& rhs) const;
73 virtual void setParameters(std::string const& parameterString);
78 virtual void changeLengthUnit(double convLength);
83 virtual std::string getSettingsLine() const;
90 virtual void calculate(Atom& atom, bool const derivatives) const;
91 // Access core fct. for groups
92 void getCompactOnly(double const x,
93 double& fx,
94 double& dfx) const;
99 virtual std::string parameterLine() const;
104 virtual std::vector<
105 std::string> parameterInfo() const;
111 virtual double calculateRadialPart(double distance) const;
117 virtual double calculateAngularPart(double angle) const;
124 virtual bool checkRelevantElement(std::size_t index) const;
125#ifndef N2P2_NO_SF_CACHE
131 virtual std::vector<
132 std::string> getCacheIdentifiers() const;
133#endif
134};
135
137// Inlined function definitions //
139
140inline void SymFncCompRadWeighted::getCompactOnly(double const x,
141 double& fx,
142 double& dfx) const
143{
144 cr.fdf(x, fx, dfx);
145 return;
146}
147
148}
149
150#endif
void fdf(double a, double &fa, double &dfa) const
Calculate compact function and derivative at once.
Contains element map.
Definition: ElementMap.h:30
Symmetry function base class for SFs with compact support.
CompactFunction cr
Compact function for radial part.
Weighted radial symmetry function with compact support (type 23)
virtual std::string getSettingsLine() const
Get settings file line from currently set parameters.
virtual std::vector< std::string > parameterInfo() const
Get description with parameter names and values.
virtual std::vector< std::string > getCacheIdentifiers() const
Get unique cache identifiers.
virtual void setParameters(std::string const &parameterString)
Set symmetry function parameters.
virtual void changeLengthUnit(double convLength)
Change length unit.
virtual bool checkRelevantElement(std::size_t index) const
Check whether symmetry function is relevant for given element.
void getCompactOnly(double const x, double &fx, double &dfx) const
SymFncCompRadWeighted(ElementMap const &elementMap)
Constructor, sets type = 23.
virtual bool operator==(SymFnc const &rhs) const
Overload == operator.
virtual std::string parameterLine() const
Give symmetry function parameters in one line.
virtual bool operator<(SymFnc const &rhs) const
Overload < operator.
virtual double calculateRadialPart(double distance) const
Calculate (partial) symmetry function value for one given distance.
virtual double calculateAngularPart(double angle) const
Calculate (partial) symmetry function value for one given angle.
virtual void calculate(Atom &atom, bool const derivatives) const
Calculate symmetry function for one atom.
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