n2p2 - A neural network potential package
SymGrpCompRad.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 SYMGRPCOMPRAD_H
19#define SYMGRPCOMPRAD_H
20
21#include "SymGrpBaseComp.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;
31class SymFnc;
32class SymFncCompRad;
33
48{
49public:
55 virtual bool operator==(SymGrp const& rhs) const;
58 virtual bool operator<(SymGrp const& rhs) const;
67 virtual bool addMember(SymFnc const* const symmetryFunction);
72 virtual void sortMembers();
75 virtual void setScalingFactors();
82 virtual void calculate(Atom& atom, bool const derivatives) const;
87 virtual std::vector<std::string>
88 parameterLines() const;
89
90private:
92 std::size_t e1;
94 std::vector<SymFncCompRad const*> members;
96 std::vector<double> mrl;
98 std::vector<double> mrc;
99#ifndef N2P2_NO_SF_CACHE
101 std::vector<std::vector<std::size_t>> mci;
102#endif
103};
104
105}
106
107#endif
Contains element map.
Definition: ElementMap.h:30
Symmetry function base class.
Definition: SymFnc.h:40
Radial symmetry function with compact support (type 20)
Definition: SymGrpCompRad.h:48
virtual std::vector< std::string > parameterLines() const
Give symmetry function group parameters on multiple lines.
std::size_t e1
Element index of neighbor atom (common feature).
Definition: SymGrpCompRad.h:92
std::vector< double > mrc
Member rc.
Definition: SymGrpCompRad.h:98
virtual void setScalingFactors()
Fill scalingFactors with values from member symmetry functions.
virtual bool operator<(SymGrp const &rhs) const
Overload < operator.
std::vector< double > mrl
Member rl.
Definition: SymGrpCompRad.h:96
virtual bool operator==(SymGrp const &rhs) const
Overload == operator.
virtual void sortMembers()
Sort member symmetry functions.
std::vector< SymFncCompRad const * > members
Vector of all group member pointers.
Definition: SymGrpCompRad.h:94
std::vector< std::vector< std::size_t > > mci
Member cache indices for actual neighbor element.
virtual bool addMember(SymFnc const *const symmetryFunction)
Potentially add a member to group.
virtual void calculate(Atom &atom, bool const derivatives) const
Calculate all symmetry functions of this group for one atom.
SymGrpCompRad(ElementMap const &elementMap)
Constructor, sets type = 20.
ElementMap elementMap
Copy of element map.
Definition: SymGrp.h:108
Definition: Atom.h:29
Storage for a single atom.
Definition: Atom.h:33