n2p2 - A neural network potential package
SymGrpExpAngn.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//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <https://www.gnu.org/licenses/>.
16
17#ifndef SYMGRPEXPANGN_H
18#define SYMGRPEXPANGN_H
19
20#include "SymGrpBaseExpAng.h"
21#include "SymFncExpAngn.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;
32
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<SymFncBaseExpAng const*> getMembers() const;
90
92 std::vector<SymFncExpAngn const*> members;
93};
94
95inline std::vector<SymFncBaseExpAng const*> SymGrpExpAngn::getMembers() const
96{
97 std::vector<SymFncBaseExpAng const*> cast;
98
99 for (auto p : members)
100 {
101 cast.push_back(dynamic_cast<SymFncBaseExpAng const*>(p));
102 }
103
104 return cast;
105}
106
107}
108
109#endif
Contains element map.
Definition: ElementMap.h:30
Intermediate class for angular SFs based on cutoffs and exponentials.
Symmetry function base class.
Definition: SymFnc.h:40
Angular symmetry function group (type 3)
Definition: SymGrpExpAngn.h:51
SymGrpExpAngn(ElementMap const &elementMap)
Constructor, sets type = 3.
virtual bool operator==(SymGrp const &rhs) const
Overload == operator.
virtual void sortMembers()
Sort member symmetry functions.
virtual bool operator<(SymGrp const &rhs) const
Overload < operator.
std::vector< SymFncExpAngn const * > members
Vector of all group member pointers.
Definition: SymGrpExpAngn.h:92
virtual std::vector< SymFncBaseExpAng const * > getMembers() const
Get symmetry function members.
Definition: SymGrpExpAngn.h:95
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.
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