n2p2 - A neural network potential package
SymGrpCompAngn.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 SYMGRPCOMPANGN_H
19#define SYMGRPCOMPANGN_H
20
21#include "SymGrpBaseCompAng.h"
22#include "SymFncCompAngn.h"
23#include <cstddef> // std::size_t
24#include <string> // std::string
25#include <vector> // std::vector
26
27namespace nnp
28{
29
30struct Atom;
31class ElementMap;
32class SymFnc;
33
52{
53public:
59 virtual bool operator==(SymGrp const& rhs) const;
62 virtual bool operator<(SymGrp const& rhs) const;
71 virtual bool addMember(SymFnc const* const symmetryFunction);
76 virtual void sortMembers();
83 virtual void calculate(Atom& atom, bool const derivatives) const;
84
85private:
90 virtual std::vector<SymFncBaseCompAng const*> getMembers() const;
91
93 std::vector<SymFncCompAngn const*> members;
94};
95
96inline std::vector<SymFncBaseCompAng const*> SymGrpCompAngn::getMembers() const
97{
98 std::vector<SymFncBaseCompAng const*> cast;
99
100 for (auto p : members)
101 {
102 cast.push_back(dynamic_cast<SymFncBaseCompAng const*>(p));
103 }
104
105 return cast;
106}
107
108}
109
110#endif
Contains element map.
Definition: ElementMap.h:30
Intermediate symmetry function class for angular SFs with compact support.
Symmetry function base class.
Definition: SymFnc.h:40
Narrow angular symmetry function with compact support (type 21)
virtual std::vector< SymFncBaseCompAng const * > getMembers() const
Get symmetry function members.
virtual void calculate(Atom &atom, bool const derivatives) const
Calculate all symmetry functions of this group for one atom.
virtual bool addMember(SymFnc const *const symmetryFunction)
Potentially add a member to group.
virtual void sortMembers()
Sort member symmetry functions.
virtual bool operator==(SymGrp const &rhs) const
Overload == operator.
virtual bool operator<(SymGrp const &rhs) const
Overload < operator.
SymGrpCompAngn(ElementMap const &elementMap)
Constructor, sets type = 21.
std::vector< SymFncCompAngn const * > members
Vector of all group member pointers.
ElementMap elementMap
Copy of element map.
Definition: SymGrp.h:108
Definition: Atom.h:28
size_t p
Definition: nnp-cutoff.cpp:33
Storage for a single atom.
Definition: Atom.h:32