n2p2 - A neural network potential package
SymGrpCompAngw.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 SYMGRPCOMPANGW_H
19#define SYMGRPCOMPANGW_H
20
21#include "SymGrpBaseCompAng.h"
22#include "SymFncCompAngw.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
51{
52public:
58 virtual bool operator==(SymGrp const& rhs) const;
61 virtual bool operator<(SymGrp const& rhs) const;
70 virtual bool addMember(SymFnc const* const symmetryFunction);
75 virtual void sortMembers();
82 virtual void calculate(Atom& atom, bool const derivatives) const;
83
84private:
89 virtual std::vector<SymFncBaseCompAng const*> getMembers() const;
90
92 std::vector<SymFncCompAngw const*> members;
93};
94
95inline std::vector<SymFncBaseCompAng const*> SymGrpCompAngw::getMembers() const
96{
97 std::vector<SymFncBaseCompAng const*> cast;
98
99 for (auto p : members)
100 {
101 cast.push_back(dynamic_cast<SymFncBaseCompAng const*>(p));
102 }
103
104 return cast;
105}
106
107}
108
109#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
Wide angular symmetry function with compact support (type 22)
std::vector< SymFncCompAngw const * > members
Vector of all group member pointers.
virtual void sortMembers()
Sort member symmetry functions.
virtual void calculate(Atom &atom, bool const derivatives) const
Calculate all symmetry functions of this group for one atom.
virtual std::vector< SymFncBaseCompAng const * > getMembers() const
Get symmetry function members.
virtual bool addMember(SymFnc const *const symmetryFunction)
Potentially add a member to group.
virtual bool operator==(SymGrp const &rhs) const
Overload == operator.
virtual bool operator<(SymGrp const &rhs) const
Overload < operator.
SymGrpCompAngw(ElementMap const &elementMap)
Constructor, sets type = 22.
ElementMap elementMap
Copy of element map.
Definition: SymGrp.h:108
Definition: Atom.h:29
size_t p
Definition: nnp-cutoff.cpp:33
Storage for a single atom.
Definition: Atom.h:33